]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkbox.c
Add default handlers for all signals; for consistency and for the benefit
[~andy/gtk] / gtk / gtkbox.c
index 4b3aba0a1db96934ca8304820a80f2abe4099439..87fb1b79425d7dea4666b34ebab18b7a86f075b5 100644 (file)
@@ -70,32 +70,35 @@ static void gtk_box_get_child_property (GtkContainer    *container,
                                        guint            property_id,
                                        GValue          *value,
                                        GParamSpec      *pspec);
-static GtkType gtk_box_child_type (GtkContainer   *container);
+static GType gtk_box_child_type (GtkContainer   *container);
      
 
 static GtkContainerClass *parent_class = NULL;
 
 
-GtkType
+GType
 gtk_box_get_type (void)
 {
-  static GtkType box_type = 0;
+  static GType box_type = 0;
 
   if (!box_type)
     {
-      static const GtkTypeInfo box_info =
+      static const GTypeInfo box_info =
       {
-       "GtkBox",
-       sizeof (GtkBox),
        sizeof (GtkBoxClass),
-       (GtkClassInitFunc) gtk_box_class_init,
-       (GtkObjectInitFunc) gtk_box_init,
-        /* reserved_1 */ NULL,
-       /* reserved_2 */ NULL,
-       (GtkClassInitFunc) NULL,
+       NULL,           /* base_init */
+       NULL,           /* base_finalize */
+       (GClassInitFunc) gtk_box_class_init,
+       NULL,           /* class_finalize */
+       NULL,           /* class_data */
+       sizeof (GtkBox),
+       0,              /* n_preallocs */
+       (GInstanceInitFunc) gtk_box_init,
+       NULL,           /* value_table */
       };
 
-      box_type = gtk_type_unique (GTK_TYPE_CONTAINER, &box_info);
+      box_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkBox", 
+                                        &box_info, G_TYPE_FLAG_ABSTRACT);
     }
 
   return box_type;
@@ -122,8 +125,8 @@ gtk_box_class_init (GtkBoxClass *class)
   g_object_class_install_property (gobject_class,
                                    PROP_SPACING,
                                    g_param_spec_int ("spacing",
-                                                     _("Spacing"),
-                                                     _("The amount of space between children."),
+                                                     P_("Spacing"),
+                                                     P_("The amount of space between children"),
                                                      0,
                                                      G_MAXINT,
                                                      0,
@@ -132,44 +135,44 @@ gtk_box_class_init (GtkBoxClass *class)
   g_object_class_install_property (gobject_class,
                                    PROP_HOMOGENEOUS,
                                    g_param_spec_boolean ("homogeneous",
-                                                        _("Homogeneous"),
-                                                        _("Whether the children should all be the same size."),
+                                                        P_("Homogeneous"),
+                                                        P_("Whether the children should all be the same size"),
                                                         FALSE,
                                                         G_PARAM_READABLE | G_PARAM_WRITABLE));
 
   gtk_container_class_install_child_property (container_class,
                                              CHILD_PROP_EXPAND,
                                              g_param_spec_boolean ("expand", 
-                                                                   _("Expand"), 
-                                                                   _("Whether the child should receive extra space when the parent grows"),
+                                                                   P_("Expand"), 
+                                                                   P_("Whether the child should receive extra space when the parent grows"),
                                                                    TRUE,
                                                                    G_PARAM_READWRITE));
   gtk_container_class_install_child_property (container_class,
                                              CHILD_PROP_FILL,
                                              g_param_spec_boolean ("fill", 
-                                                                   _("Fill"), 
-                                                                   _("Whether extra space given to the child should be allocated to the child or used as padding"),
+                                                                   P_("Fill"), 
+                                                                   P_("Whether extra space given to the child should be allocated to the child or used as padding"),
                                                                    TRUE,
                                                                    G_PARAM_READWRITE));
   gtk_container_class_install_child_property (container_class,
                                              CHILD_PROP_PADDING,
                                              g_param_spec_uint ("padding", 
-                                                                _("Padding"), 
-                                                                _("Extra space to put between the child and its neighbors, in pixels"),
+                                                                P_("Padding"), 
+                                                                P_("Extra space to put between the child and its neighbors, in pixels"),
                                                                 0, G_MAXINT, 0,
                                                                 G_PARAM_READWRITE));
   gtk_container_class_install_child_property (container_class,
                                              CHILD_PROP_PACK_TYPE,
                                              g_param_spec_enum ("pack_type", 
-                                                                _("Pack type"), 
-                                                                _("A GtkPackType indicating whether the child is packed with reference to the start or end of the parent"),
+                                                                P_("Pack type"), 
+                                                                P_("A GtkPackType indicating whether the child is packed with reference to the start or end of the parent"),
                                                                 GTK_TYPE_PACK_TYPE, GTK_PACK_START,
                                                                 G_PARAM_READWRITE));
   gtk_container_class_install_child_property (container_class,
                                              CHILD_PROP_POSITION,
                                              g_param_spec_int ("position", 
-                                                               _("Position"), 
-                                                               _("The index of the child in the parent"),
+                                                               P_("Position"), 
+                                                               P_("The index of the child in the parent"),
                                                                -1, G_MAXINT, 0,
                                                                G_PARAM_READWRITE));
 }
@@ -232,8 +235,8 @@ static void gtk_box_get_property (GObject         *object,
     }
 }
 
-static GtkType
-gtk_box_child_type     (GtkContainer   *container)
+static GType
+gtk_box_child_type (GtkContainer   *container)
 {
   return GTK_TYPE_WIDGET;
 }