[gtk+] Trivial: slight code rearrangement



commit 716ecff28d13f3fca0ea2dde1114f6d54d9c297c
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 23 21:41:58 2014 -0400

    Trivial: slight code rearrangement

 gtk/gtkseparator.c |   91 ++++++++++++++++++++-------------------------------
 1 files changed, 36 insertions(+), 55 deletions(-)
---
diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c
index acd2425..d8452f1 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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]