diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-02 23:56:43 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-02 23:56:43 +0000 |
commit | f26aad1916445d25c99878138dfc384de67a2060 (patch) | |
tree | b72263ecb326e82a49f1e8d1871ec4288b8aa299 /gtk/gtkfixed.c | |
parent | 33cddd12d78abb2efe6facba9c859017f8df9819 (diff) | |
download | gtk+-f26aad1916445d25c99878138dfc384de67a2060.tar.gz |
Boilerplate reduction
Diffstat (limited to 'gtk/gtkfixed.c')
-rw-r--r-- | gtk/gtkfixed.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c index d98cb04a60..d2465e9adc 100644 --- a/gtk/gtkfixed.c +++ b/gtk/gtkfixed.c @@ -29,15 +29,12 @@ #include "gtkprivate.h" #include "gtkintl.h" #include "gtkalias.h" - enum { CHILD_PROP_0, CHILD_PROP_X, CHILD_PROP_Y }; -static void gtk_fixed_class_init (GtkFixedClass *klass); -static void gtk_fixed_init (GtkFixed *fixed); static void gtk_fixed_realize (GtkWidget *widget); static void gtk_fixed_size_request (GtkWidget *widget, GtkRequisition *requisition); @@ -64,35 +61,7 @@ static void gtk_fixed_get_child_property (GtkContainer *container, GValue *value, GParamSpec *pspec); -static GtkContainerClass *parent_class = NULL; - - -GType -gtk_fixed_get_type (void) -{ - static GType fixed_type = 0; - - if (!fixed_type) - { - static const GTypeInfo fixed_info = - { - sizeof (GtkFixedClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_fixed_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkFixed), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_fixed_init, - }; - - fixed_type = g_type_register_static (GTK_TYPE_CONTAINER, I_("GtkFixed"), - &fixed_info, 0); - } - - return fixed_type; -} +G_DEFINE_TYPE (GtkFixed, gtk_fixed, GTK_TYPE_CONTAINER); static void gtk_fixed_class_init (GtkFixedClass *class) @@ -103,8 +72,6 @@ gtk_fixed_class_init (GtkFixedClass *class) widget_class = (GtkWidgetClass*) class; container_class = (GtkContainerClass*) class; - parent_class = g_type_class_peek_parent (class); - widget_class->realize = gtk_fixed_realize; widget_class->size_request = gtk_fixed_size_request; widget_class->size_allocate = gtk_fixed_size_allocate; @@ -306,7 +273,7 @@ gtk_fixed_realize (GtkWidget *widget) gint attributes_mask; if (GTK_WIDGET_NO_WINDOW (widget)) - GTK_WIDGET_CLASS (parent_class)->realize (widget); + GTK_WIDGET_CLASS (gtk_fixed_parent_class)->realize (widget); else { GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); |