gtk+ r22112 - in trunk: . gtk



Author: cdywan
Date: Tue Jan 13 15:24:03 2009
New Revision: 22112
URL: http://svn.gnome.org/viewvc/gtk+?rev=22112&view=rev

Log:
2009-01-13  Christian Dywan  <christian imendio com>

	Bug 566532 â GtkScaleButton implementation of GtkOrientable

	* gtk/gtk.symbols:
	* gtk/gtkscalebutton.c (gtk_scale_button_class_init),
	(gtk_scale_button_set_property):
	* gtk/gtkscalebutton.h: Deprecate gtk_scale_button_get_orientation
        in favour of implementing GtkOrientable. Patch by Bruce Cowan.

Modified:
   trunk/ChangeLog
   trunk/gtk/gtk.symbols
   trunk/gtk/gtkscalebutton.c
   trunk/gtk/gtkscalebutton.h

Modified: trunk/gtk/gtk.symbols
==============================================================================
--- trunk/gtk/gtk.symbols	(original)
+++ trunk/gtk/gtk.symbols	Tue Jan 13 15:24:03 2009
@@ -3469,8 +3469,10 @@
 gtk_scale_button_set_value
 gtk_scale_button_get_adjustment
 gtk_scale_button_set_adjustment
+#ifndef GTK_DISABLE_DEPRECATED
 gtk_scale_button_get_orientation
 gtk_scale_button_set_orientation
+#endif
 gtk_scale_button_get_plus_button
 gtk_scale_button_get_minus_button
 gtk_scale_button_get_popup

Modified: trunk/gtk/gtkscalebutton.c
==============================================================================
--- trunk/gtk/gtkscalebutton.c	(original)
+++ trunk/gtk/gtkscalebutton.c	Tue Jan 13 15:24:03 2009
@@ -51,6 +51,7 @@
 #include "gtkhscale.h"
 #include "gtkvscale.h"
 #include "gtkframe.h"
+#include "gtkorientable.h"
 #include "gtkhbox.h"
 #include "gtkvbox.h"
 #include "gtkwindow.h"
@@ -156,9 +157,11 @@
 /* see below for scale definitions */
 static GtkWidget *gtk_scale_button_scale_box_new(GtkScaleButton      *button);
 
-static guint signals[LAST_SIGNAL] = { 0, };
+G_DEFINE_TYPE_WITH_CODE (GtkScaleButton, gtk_scale_button, GTK_TYPE_BUTTON,
+                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
+                                                NULL))
 
-G_DEFINE_TYPE (GtkScaleButton, gtk_scale_button, GTK_TYPE_BUTTON)
+static guint signals[LAST_SIGNAL] = { 0, };
 
 static void
 gtk_scale_button_class_init (GtkScaleButtonClass *klass)
@@ -187,14 +190,9 @@
    *
    * Since: 2.14
    **/
-  g_object_class_install_property (gobject_class,
-				   PROP_ORIENTATION,
-				   g_param_spec_enum ("orientation",
-                                                      P_("Orientation"),
-                                                      P_("The orientation of the scale"),
-                                                      GTK_TYPE_ORIENTATION,
-                                                      GTK_ORIENTATION_VERTICAL,
-                                                      GTK_PARAM_READWRITE));
+  g_object_class_override_property (gobject_class,
+				    PROP_ORIENTATION,
+				    "orientation");
 
   g_object_class_install_property (gobject_class,
 				   PROP_VALUE,
@@ -426,7 +424,7 @@
   switch (prop_id)
     {
     case PROP_ORIENTATION:
-      gtk_scale_button_set_orientation (button, g_value_get_enum (value));
+      gtk_orientable_set_orientation (GTK_ORIENTABLE (button), g_value_get_enum (value));
       break;
     case PROP_VALUE:
       gtk_scale_button_set_value (button, g_value_get_double (value));
@@ -705,6 +703,8 @@
  * Returns: the #GtkScaleButton's orientation.
  *
  * Since: 2.14
+ *
+ * Deprecated: 2.16: Use gtk_orientable_get_orientation() instead.
  **/
 GtkOrientation
 gtk_scale_button_get_orientation (GtkScaleButton *button)
@@ -722,6 +722,8 @@
  * Sets the orientation of the #GtkScaleButton's popup window.
  *
  * Since: 2.14
+ *
+ * Deprecated: 2.16: Use gtk_orientable_set_orientation() instead.
  **/
 void
 gtk_scale_button_set_orientation (GtkScaleButton *button,

Modified: trunk/gtk/gtkscalebutton.h
==============================================================================
--- trunk/gtk/gtkscalebutton.h	(original)
+++ trunk/gtk/gtkscalebutton.h	Tue Jan 13 15:24:03 2009
@@ -95,13 +95,18 @@
 GtkAdjustment *  gtk_scale_button_get_adjustment   (GtkScaleButton  *button);
 void             gtk_scale_button_set_adjustment   (GtkScaleButton  *button,
                                                     GtkAdjustment   *adjustment);
-GtkOrientation   gtk_scale_button_get_orientation  (GtkScaleButton  *button);
-void             gtk_scale_button_set_orientation  (GtkScaleButton  *button,
-                                                    GtkOrientation   orientation);
 GtkWidget *      gtk_scale_button_get_plus_button  (GtkScaleButton  *button);
 GtkWidget *      gtk_scale_button_get_minus_button (GtkScaleButton  *button);
 GtkWidget *      gtk_scale_button_get_popup        (GtkScaleButton  *button);
 
+#ifndef GTK_DISABLE_DEPRECATED
+
+GtkOrientation   gtk_scale_button_get_orientation  (GtkScaleButton  *button);
+void             gtk_scale_button_set_orientation  (GtkScaleButton  *button,
+                                                    GtkOrientation   orientation);
+
+#endif /* GTK_DISABLE_DEPRECATED */
+
 G_END_DECLS
 
 #endif /* __GTK_SCALE_BUTTON_H__ */



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