summaryrefslogtreecommitdiff
path: root/gtk/gtkseparator.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-05-23 21:41:58 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-05-23 21:41:58 -0400
commit716ecff28d13f3fca0ea2dde1114f6d54d9c297c (patch)
tree7713910fc6e64c99d3eaf0c4b88ca9fa6739a6a8 /gtk/gtkseparator.c
parent38cbd87cac0db2f61bfe056f9296ba036f522283 (diff)
downloadgtk+-716ecff28d13f3fca0ea2dde1114f6d54d9c297c.tar.gz
Trivial: slight code rearrangement
Diffstat (limited to 'gtk/gtkseparator.c')
-rw-r--r--gtk/gtkseparator.c91
1 files changed, 36 insertions, 55 deletions
diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c
index acd24255f0..d8452f1cf9 100644
--- a/gtk/gtkseparator.c
+++ b/gtk/gtkseparator.c
@@ -35,9 +35,9 @@
* @Title: GtkSeparator
*
* GtkSeparator is a horizontal or vertical separator widget, depending on the
- * value of the #GtkOrientable:orientation property, used to group the widgets within a
- * window. It displays a line with a shadow to make it appear sunken into the
- * interface.
+ * value of the #GtkOrientable:orientation property, used to group the widgets
+ * within a window. It displays a line with a shadow to make it appear sunken
+ * into the interface.
*/
@@ -52,25 +52,6 @@ enum {
PROP_ORIENTATION
};
-static void gtk_separator_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void gtk_separator_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void gtk_separator_get_preferred_width
- (GtkWidget *widget,
- gint *minimum,
- gint *natural);
-static void gtk_separator_get_preferred_height
- (GtkWidget *widget,
- gint *minimum,
- gint *natural);
-static gboolean gtk_separator_draw (GtkWidget *widget,
- cairo_t *cr);
-
G_DEFINE_TYPE_WITH_CODE (GtkSeparator, gtk_separator, GTK_TYPE_WIDGET,
G_ADD_PRIVATE (GtkSeparator)
@@ -78,39 +59,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkSeparator, gtk_separator, GTK_TYPE_WIDGET,
static void
-gtk_separator_class_init (GtkSeparatorClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
-
- object_class->set_property = gtk_separator_set_property;
- object_class->get_property = gtk_separator_get_property;
-
- widget_class->get_preferred_width = gtk_separator_get_preferred_width;
- widget_class->get_preferred_height = gtk_separator_get_preferred_height;
-
- widget_class->draw = gtk_separator_draw;
-
- gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_SEPARATOR);
-
- g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation");
-}
-
-static void
-gtk_separator_init (GtkSeparator *separator)
-{
- GtkStyleContext *context;
-
- separator->priv = gtk_separator_get_instance_private (separator);
- separator->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
-
- gtk_widget_set_has_window (GTK_WIDGET (separator), FALSE);
-
- context = gtk_widget_get_style_context (GTK_WIDGET (separator));
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
-}
-
-static void
gtk_separator_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -248,6 +196,39 @@ gtk_separator_draw (GtkWidget *widget,
return FALSE;
}
+static void
+gtk_separator_init (GtkSeparator *separator)
+{
+ GtkStyleContext *context;
+
+ separator->priv = gtk_separator_get_instance_private (separator);
+ separator->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
+
+ gtk_widget_set_has_window (GTK_WIDGET (separator), FALSE);
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (separator));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
+}
+
+static void
+gtk_separator_class_init (GtkSeparatorClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+
+ object_class->set_property = gtk_separator_set_property;
+ object_class->get_property = gtk_separator_get_property;
+
+ widget_class->get_preferred_width = gtk_separator_get_preferred_width;
+ widget_class->get_preferred_height = gtk_separator_get_preferred_height;
+
+ widget_class->draw = gtk_separator_draw;
+
+ gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_SEPARATOR);
+
+ g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation");
+}
+
/**
* gtk_separator_new:
* @orientation: the separator’s orientation.