[gimp/gtk3-port: 105/237] libgimp*: derive from GtkBox directly instead of GtkHBox/VBox



commit f380e1ccf6fbac5aa2c43a67f225f1a07a6162fd
Author: Michael Natterer <mitch gimp org>
Date:   Sat Oct 30 17:28:30 2010 +0200

    libgimp*: derive from GtkBox directly instead of GtkHBox/VBox

 libgimp/gimpselectbutton.c          |    5 ++++-
 libgimp/gimpselectbutton.h          |    6 +++---
 libgimpwidgets/gimpcolorselection.c |    5 ++++-
 libgimpwidgets/gimpcolorselection.h |    4 ++--
 libgimpwidgets/gimpcolorselector.c  |    5 ++++-
 libgimpwidgets/gimpcolorselector.h  |   10 +++++-----
 libgimpwidgets/gimpfileentry.c      |    5 ++++-
 libgimpwidgets/gimpfileentry.h      |    2 +-
 libgimpwidgets/gimpmemsizeentry.c   |    5 ++++-
 libgimpwidgets/gimpmemsizeentry.h   |   18 +++++++++---------
 libgimpwidgets/gimppageselector.c   |    9 ++++++---
 libgimpwidgets/gimppageselector.h   |    4 ++--
 libgimpwidgets/gimppatheditor.c     |    5 ++++-
 libgimpwidgets/gimppatheditor.h     |    4 ++--
 libgimpwidgets/gimppreview.c        |    6 ++++--
 libgimpwidgets/gimppreview.h        |   26 +++++++++++++-------------
 16 files changed, 71 insertions(+), 48 deletions(-)
---
diff --git a/libgimp/gimpselectbutton.c b/libgimp/gimpselectbutton.c
index 0dab586..6b4a899 100644
--- a/libgimp/gimpselectbutton.c
+++ b/libgimp/gimpselectbutton.c
@@ -44,7 +44,7 @@
 static void   gimp_select_button_dispose (GObject *object);
 
 
-G_DEFINE_TYPE (GimpSelectButton, gimp_select_button, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GimpSelectButton, gimp_select_button, GTK_TYPE_BOX)
 
 static void
 gimp_select_button_class_init (GimpSelectButtonClass *klass)
@@ -57,6 +57,9 @@ gimp_select_button_class_init (GimpSelectButtonClass *klass)
 static void
 gimp_select_button_init (GimpSelectButton *select_button)
 {
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (select_button),
+                                  GTK_ORIENTATION_HORIZONTAL);
+
   select_button->temp_callback = NULL;
 }
 
diff --git a/libgimp/gimpselectbutton.h b/libgimp/gimpselectbutton.h
index db91c33..399f4b5 100644
--- a/libgimp/gimpselectbutton.h
+++ b/libgimp/gimpselectbutton.h
@@ -42,16 +42,16 @@ typedef struct _GimpSelectButtonClass   GimpSelectButtonClass;
 
 struct _GimpSelectButton
 {
-  GtkHBox      parent_instance;
+  GtkBox       parent_instance;
 
   const gchar *temp_callback;
 };
 
 struct _GimpSelectButtonClass
 {
-  GtkHBoxClass  parent_class;
+  GtkBoxClass  parent_class;
 
-  gchar        *default_title;
+  gchar       *default_title;
 
   void (*select_destroy) (const gchar *callback);
 
diff --git a/libgimpwidgets/gimpcolorselection.c b/libgimpwidgets/gimpcolorselection.c
index 4f50853..876ad4c 100644
--- a/libgimpwidgets/gimpcolorselection.c
+++ b/libgimpwidgets/gimpcolorselection.c
@@ -113,7 +113,7 @@ static void   gimp_color_selection_update            (GimpColorSelection *select
                                                       UpdateType          update);
 
 
-G_DEFINE_TYPE (GimpColorSelection, gimp_color_selection, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (GimpColorSelection, gimp_color_selection, GTK_TYPE_BOX)
 
 #define parent_class gimp_color_selection_parent_class
 
@@ -159,6 +159,9 @@ gimp_color_selection_init (GimpColorSelection *selection)
   GtkSizeGroup *new_group;
   GtkSizeGroup *old_group;
 
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (selection),
+                                  GTK_ORIENTATION_VERTICAL);
+
   selection->show_alpha = TRUE;
 
   gimp_rgba_set (&selection->rgb, 0.0, 0.0, 0.0, 1.0);
diff --git a/libgimpwidgets/gimpcolorselection.h b/libgimpwidgets/gimpcolorselection.h
index 045a990..3f15164 100644
--- a/libgimpwidgets/gimpcolorselection.h
+++ b/libgimpwidgets/gimpcolorselection.h
@@ -43,7 +43,7 @@ typedef struct _GimpColorSelectionClass GimpColorSelectionClass;
 
 struct _GimpColorSelection
 {
-  GtkVBox                   parent_instance;
+  GtkBox                    parent_instance;
 
   gboolean                  show_alpha;
 
@@ -63,7 +63,7 @@ struct _GimpColorSelection
 
 struct _GimpColorSelectionClass
 {
-  GtkVBoxClass  parent_class;
+  GtkBoxClass  parent_class;
 
   void (* color_changed) (GimpColorSelection *selection);
 
diff --git a/libgimpwidgets/gimpcolorselector.c b/libgimpwidgets/gimpcolorselector.c
index 16299ee..24ae386 100644
--- a/libgimpwidgets/gimpcolorselector.c
+++ b/libgimpwidgets/gimpcolorselector.c
@@ -55,7 +55,7 @@ enum
 };
 
 
-G_DEFINE_TYPE (GimpColorSelector, gimp_color_selector, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (GimpColorSelector, gimp_color_selector, GTK_TYPE_BOX)
 
 #define parent_class gimp_color_selector_parent_class
 
@@ -103,6 +103,9 @@ gimp_color_selector_class_init (GimpColorSelectorClass *klass)
 static void
 gimp_color_selector_init (GimpColorSelector *selector)
 {
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (selector),
+                                  GTK_ORIENTATION_VERTICAL);
+
   selector->toggles_visible   = TRUE;
   selector->toggles_sensitive = TRUE;
   selector->show_alpha        = TRUE;
diff --git a/libgimpwidgets/gimpcolorselector.h b/libgimpwidgets/gimpcolorselector.h
index 2490d23..48cdd14 100644
--- a/libgimpwidgets/gimpcolorselector.h
+++ b/libgimpwidgets/gimpcolorselector.h
@@ -64,7 +64,7 @@ typedef struct _GimpColorSelectorClass GimpColorSelectorClass;
 
 struct _GimpColorSelector
 {
-  GtkVBox                   parent_instance;
+  GtkBox                    parent_instance;
 
   gboolean                  toggles_visible;
   gboolean                  toggles_sensitive;
@@ -78,11 +78,11 @@ struct _GimpColorSelector
 
 struct _GimpColorSelectorClass
 {
-  GtkVBoxClass  parent_class;
+  GtkBoxClass  parent_class;
 
-  const gchar  *name;
-  const gchar  *help_id;
-  const gchar  *stock_id;
+  const gchar *name;
+  const gchar *help_id;
+  const gchar *stock_id;
 
   /*  virtual functions  */
   void (* set_toggles_visible)   (GimpColorSelector        *selector,
diff --git a/libgimpwidgets/gimpfileentry.c b/libgimpwidgets/gimpfileentry.c
index 9aa8477..b91886c 100644
--- a/libgimpwidgets/gimpfileentry.c
+++ b/libgimpwidgets/gimpfileentry.c
@@ -78,7 +78,7 @@ static void   gimp_file_entry_browse_clicked  (GtkWidget     *widget,
 static void   gimp_file_entry_check_filename  (GimpFileEntry *entry);
 
 
-G_DEFINE_TYPE (GimpFileEntry, gimp_file_entry, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GimpFileEntry, gimp_file_entry, GTK_TYPE_BOX)
 
 #define parent_class gimp_file_entry_parent_class
 
@@ -114,6 +114,9 @@ gimp_file_entry_init (GimpFileEntry *entry)
 {
   GtkWidget *image;
 
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (entry),
+                                  GTK_ORIENTATION_HORIZONTAL);
+
   entry->title       = NULL;
   entry->file_dialog = NULL;
   entry->check_valid = FALSE;
diff --git a/libgimpwidgets/gimpfileentry.h b/libgimpwidgets/gimpfileentry.h
index 04ac920..57ae76d4 100644
--- a/libgimpwidgets/gimpfileentry.h
+++ b/libgimpwidgets/gimpfileentry.h
@@ -45,7 +45,7 @@ typedef struct _GimpFileEntryClass  GimpFileEntryClass;
 
 struct _GimpFileEntry
 {
-  GtkHBox    parent_instance;
+  GtkBox     parent_instance;
 
   GtkWidget *file_exists;
   GtkWidget *entry;
diff --git a/libgimpwidgets/gimpmemsizeentry.c b/libgimpwidgets/gimpmemsizeentry.c
index 185149e..c5c7d17 100644
--- a/libgimpwidgets/gimpmemsizeentry.c
+++ b/libgimpwidgets/gimpmemsizeentry.c
@@ -58,7 +58,7 @@ static void  gimp_memsize_entry_unit_callback (GtkWidget        *widget,
                                                GimpMemsizeEntry *entry);
 
 
-G_DEFINE_TYPE (GimpMemsizeEntry, gimp_memsize_entry, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GimpMemsizeEntry, gimp_memsize_entry, GTK_TYPE_BOX)
 
 #define parent_class gimp_memsize_entry_parent_class
 
@@ -87,6 +87,9 @@ gimp_memsize_entry_class_init (GimpMemsizeEntryClass *klass)
 static void
 gimp_memsize_entry_init (GimpMemsizeEntry *entry)
 {
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (entry),
+                                  GTK_ORIENTATION_HORIZONTAL);
+
   gtk_box_set_spacing (GTK_BOX (entry), 4);
 
   entry->value      = 0;
diff --git a/libgimpwidgets/gimpmemsizeentry.h b/libgimpwidgets/gimpmemsizeentry.h
index 25a681d..6473da5 100644
--- a/libgimpwidgets/gimpmemsizeentry.h
+++ b/libgimpwidgets/gimpmemsizeentry.h
@@ -41,23 +41,23 @@ typedef struct _GimpMemsizeEntryClass  GimpMemsizeEntryClass;
 
 struct _GimpMemsizeEntry
 {
-  GtkHBox            parent_instance;
+  GtkBox         parent_instance;
 
   /*< private >*/
-  guint64            value;
-  guint64            lower;
-  guint64            upper;
+  guint64        value;
+  guint64        lower;
+  guint64        upper;
 
-  guint              shift;
+  guint          shift;
 
-  GtkAdjustment     *adjustment;
-  GtkWidget         *spinbutton;
-  GtkWidget         *menu;
+  GtkAdjustment *adjustment;
+  GtkWidget     *spinbutton;
+  GtkWidget     *menu;
 };
 
 struct _GimpMemsizeEntryClass
 {
-  GtkHBoxClass       parent_class;
+  GtkBoxClass  parent_class;
 
   void (* value_changed)  (GimpMemsizeEntry *entry);
 
diff --git a/libgimpwidgets/gimppageselector.c b/libgimpwidgets/gimppageselector.c
index 6798ba2..b4f0d49 100644
--- a/libgimpwidgets/gimppageselector.c
+++ b/libgimpwidgets/gimppageselector.c
@@ -127,7 +127,7 @@ static GdkPixbuf * gimp_page_selector_add_frame    (GtkWidget        *widget,
                                                     GdkPixbuf        *pixbuf);
 
 
-G_DEFINE_TYPE (GimpPageSelector, gimp_page_selector, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (GimpPageSelector, gimp_page_selector, GTK_TYPE_BOX)
 
 #define parent_class gimp_page_selector_parent_class
 
@@ -226,6 +226,11 @@ gimp_page_selector_init (GimpPageSelector *selector)
   GtkWidget               *label;
   GtkWidget               *combo;
 
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (selector),
+                                  GTK_ORIENTATION_VERTICAL);
+
+  gtk_box_set_spacing (GTK_BOX (selector), 12);
+
   selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (selector,
                                                 GIMP_TYPE_PAGE_SELECTOR,
                                                 GimpPageSelectorPrivate);
@@ -235,8 +240,6 @@ gimp_page_selector_init (GimpPageSelector *selector)
   priv->n_pages = 0;
   priv->target  = GIMP_PAGE_SELECTOR_TARGET_LAYERS;
 
-  gtk_box_set_spacing (GTK_BOX (selector), 12);
-
   /*  Pages  */
 
   vbox = gtk_vbox_new (FALSE, 2);
diff --git a/libgimpwidgets/gimppageselector.h b/libgimpwidgets/gimppageselector.h
index 66f87d6..454a881 100644
--- a/libgimpwidgets/gimppageselector.h
+++ b/libgimpwidgets/gimppageselector.h
@@ -40,14 +40,14 @@ typedef struct _GimpPageSelectorClass  GimpPageSelectorClass;
 
 struct _GimpPageSelector
 {
-  GtkVBox   parent_instance;
+  GtkBox    parent_instance;
 
   gpointer  priv;
 };
 
 struct _GimpPageSelectorClass
 {
-  GtkVBoxClass  parent_class;
+  GtkBoxClass  parent_class;
 
   void (* selection_changed) (GimpPageSelector *selector);
   void (* activate)          (GimpPageSelector *selector);
diff --git a/libgimpwidgets/gimppatheditor.c b/libgimpwidgets/gimppatheditor.c
index 1c24e85..6522482 100644
--- a/libgimpwidgets/gimppatheditor.c
+++ b/libgimpwidgets/gimppatheditor.c
@@ -89,7 +89,7 @@ static void   gimp_path_editor_writable_toggled   (GtkCellRendererToggle *toggle
                                                    GimpPathEditor      *editor);
 
 
-G_DEFINE_TYPE (GimpPathEditor, gimp_path_editor, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (GimpPathEditor, gimp_path_editor, GTK_TYPE_BOX)
 
 #define parent_class gimp_path_editor_parent_class
 
@@ -145,6 +145,9 @@ gimp_path_editor_init (GimpPathEditor *editor)
   GtkTreeViewColumn *col;
   GtkCellRenderer   *renderer;
 
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (editor),
+                                  GTK_ORIENTATION_VERTICAL);
+
   editor->file_entry = NULL;
   editor->sel_path   = NULL;
   editor->num_items  = 0;
diff --git a/libgimpwidgets/gimppatheditor.h b/libgimpwidgets/gimppatheditor.h
index 2bff48f..54ad032 100644
--- a/libgimpwidgets/gimppatheditor.h
+++ b/libgimpwidgets/gimppatheditor.h
@@ -43,7 +43,7 @@ typedef struct _GimpPathEditorClass  GimpPathEditorClass;
 
 struct _GimpPathEditor
 {
-  GtkVBox            parent_instance;
+  GtkBox             parent_instance;
 
   GtkWidget         *upper_hbox;
 
@@ -66,7 +66,7 @@ struct _GimpPathEditor
 
 struct _GimpPathEditorClass
 {
-  GtkVBoxClass  parent_class;
+  GtkBoxClass  parent_class;
 
   void (* path_changed)     (GimpPathEditor *editor);
   void (* writable_changed) (GimpPathEditor *editor);
diff --git a/libgimpwidgets/gimppreview.c b/libgimpwidgets/gimppreview.c
index f9736db..c747fa8 100644
--- a/libgimpwidgets/gimppreview.c
+++ b/libgimpwidgets/gimppreview.c
@@ -138,7 +138,7 @@ gimp_preview_get_type (void)
         (GInstanceInitFunc) gimp_preview_init,
       };
 
-      preview_type = g_type_register_static (GTK_TYPE_VBOX,
+      preview_type = g_type_register_static (GTK_TYPE_BOX,
                                              "GimpPreview",
                                              &preview_info,
                                              G_TYPE_FLAG_ABSTRACT);
@@ -203,7 +203,9 @@ gimp_preview_init (GimpPreview *preview)
   GtkWidget          *frame;
   gdouble             xalign = 0.0;
 
-  gtk_box_set_homogeneous (GTK_BOX (preview), FALSE);
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (preview),
+                                  GTK_ORIENTATION_VERTICAL);
+
   gtk_box_set_spacing (GTK_BOX (preview), 6);
 
   if (gtk_widget_get_direction (GTK_WIDGET (preview)) == GTK_TEXT_DIR_RTL)
diff --git a/libgimpwidgets/gimppreview.h b/libgimpwidgets/gimppreview.h
index 031b592..19aa9d6 100644
--- a/libgimpwidgets/gimppreview.h
+++ b/libgimpwidgets/gimppreview.h
@@ -43,29 +43,29 @@ typedef struct _GimpPreviewClass  GimpPreviewClass;
 
 struct _GimpPreview
 {
-  GtkVBox       parent_instance;
+  GtkBox     parent_instance;
 
-  gboolean      update_preview;
+  gboolean   update_preview;
 
   /*< protected >*/
-  GtkWidget    *area;
-  GtkWidget    *table;
-  GtkWidget    *frame;
-  GtkWidget    *toggle;
-  GdkCursor    *cursor_busy;
-  GdkCursor    *default_cursor;
+  GtkWidget *area;
+  GtkWidget *table;
+  GtkWidget *frame;
+  GtkWidget *toggle;
+  GdkCursor *cursor_busy;
+  GdkCursor *default_cursor;
 
   /*< private >*/
-  gint          xoff, yoff;
-  gint          xmin, xmax, ymin, ymax;
-  gint          width, height;
+  gint       xoff, yoff;
+  gint       xmin, xmax, ymin, ymax;
+  gint       width, height;
 
-  guint         timeout_id;
+  guint      timeout_id;
 };
 
 struct _GimpPreviewClass
 {
-  GtkVBoxClass  parent_class;
+  GtkBoxClass  parent_class;
 
   /* virtual methods */
   void   (* draw)        (GimpPreview     *preview);



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