summaryrefslogtreecommitdiff
path: root/gtk/gtkexpander.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2006-05-02 23:56:43 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-05-02 23:56:43 +0000
commitf26aad1916445d25c99878138dfc384de67a2060 (patch)
treeb72263ecb326e82a49f1e8d1871ec4288b8aa299 /gtk/gtkexpander.c
parent33cddd12d78abb2efe6facba9c859017f8df9819 (diff)
downloadgtk+-f26aad1916445d25c99878138dfc384de67a2060.tar.gz
Boilerplate reduction
Diffstat (limited to 'gtk/gtkexpander.c')
-rw-r--r--gtk/gtkexpander.c49
1 files changed, 8 insertions, 41 deletions
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index c658340b79..d90e16561b 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -68,9 +68,6 @@ struct _GtkExpanderPrivate
guint prelight : 1;
};
-static void gtk_expander_class_init (GtkExpanderClass *klass);
-static void gtk_expander_init (GtkExpander *expander);
-
static void gtk_expander_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -129,35 +126,7 @@ static void gtk_expander_activate (GtkExpander *expander);
static void get_expander_bounds (GtkExpander *expander,
GdkRectangle *rect);
-static GtkBinClass *parent_class = NULL;
-
-GType
-gtk_expander_get_type (void)
-{
- static GType expander_type = 0;
-
- if (!expander_type)
- {
- static const GTypeInfo expander_info =
- {
- sizeof (GtkExpanderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gtk_expander_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GtkExpander),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gtk_expander_init,
- };
-
- expander_type = g_type_register_static (GTK_TYPE_BIN,
- I_("GtkExpander"),
- &expander_info, 0);
- }
-
- return expander_type;
-}
+G_DEFINE_TYPE (GtkExpander, gtk_expander, GTK_TYPE_BIN);
static void
gtk_expander_class_init (GtkExpanderClass *klass)
@@ -167,8 +136,6 @@ gtk_expander_class_init (GtkExpanderClass *klass)
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
- parent_class = g_type_class_peek_parent (klass);
-
gobject_class = (GObjectClass *) klass;
object_class = (GtkObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
@@ -392,7 +359,7 @@ gtk_expander_destroy (GtkObject *object)
priv->animation_timeout = 0;
}
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ GTK_OBJECT_CLASS (gtk_expander_parent_class)->destroy (object);
}
static void
@@ -448,7 +415,7 @@ gtk_expander_unrealize (GtkWidget *widget)
priv->event_window = NULL;
}
- GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
+ GTK_WIDGET_CLASS (gtk_expander_parent_class)->unrealize (widget);
}
static void
@@ -707,7 +674,7 @@ gtk_expander_map (GtkWidget *widget)
if (priv->label_widget)
gtk_widget_map (priv->label_widget);
- GTK_WIDGET_CLASS (parent_class)->map (widget);
+ GTK_WIDGET_CLASS (gtk_expander_parent_class)->map (widget);
if (priv->event_window)
gdk_window_show (priv->event_window);
@@ -721,7 +688,7 @@ gtk_expander_unmap (GtkWidget *widget)
if (priv->event_window)
gdk_window_hide (priv->event_window);
- GTK_WIDGET_CLASS (parent_class)->unmap (widget);
+ GTK_WIDGET_CLASS (gtk_expander_parent_class)->unmap (widget);
if (priv->label_widget)
gtk_widget_unmap (priv->label_widget);
@@ -884,7 +851,7 @@ gtk_expander_expose (GtkWidget *widget,
if (GTK_WIDGET_HAS_FOCUS (expander))
gtk_expander_paint_focus (expander, &event->area);
- GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
+ GTK_WIDGET_CLASS (gtk_expander_parent_class)->expose_event (widget, event);
}
return FALSE;
@@ -1208,7 +1175,7 @@ static void
gtk_expander_add (GtkContainer *container,
GtkWidget *widget)
{
- GTK_CONTAINER_CLASS (parent_class)->add (container, widget);
+ GTK_CONTAINER_CLASS (gtk_expander_parent_class)->add (container, widget);
gtk_widget_set_child_visible (widget, GTK_EXPANDER (container)->priv->expanded);
gtk_widget_queue_resize (GTK_WIDGET (container));
@@ -1223,7 +1190,7 @@ gtk_expander_remove (GtkContainer *container,
if (GTK_EXPANDER (expander)->priv->label_widget == widget)
gtk_expander_set_label_widget (expander, NULL);
else
- GTK_CONTAINER_CLASS (parent_class)->remove (container, widget);
+ GTK_CONTAINER_CLASS (gtk_expander_parent_class)->remove (container, widget);
}
static void