[gimp] app: Add and use gimp_image_dock_get_ui_manager()



commit f5d1c1ba4d7236a9fcde18df062857d78e18e1e8
Author: Martin Nordholts <martinn src gnome org>
Date:   Sat Sep 12 22:19:39 2009 +0200

    app: Add and use gimp_image_dock_get_ui_manager()

 app/widgets/gimpdockbook.c  |    4 ++--
 app/widgets/gimpimagedock.c |    8 ++++++++
 app/widgets/gimpimagedock.h |    3 ++-
 app/widgets/gimptoolbox.c   |   15 ++++++++-------
 4 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c
index 4874c9e..f004393 100644
--- a/app/widgets/gimpdockbook.c
+++ b/app/widgets/gimpdockbook.c
@@ -451,7 +451,7 @@ gimp_dockbook_create_tab_widget (GimpDockbook *dockbook,
 
   /* EEK */
   if (GIMP_IS_IMAGE_DOCK (dockbook->dock) &&
-      GIMP_IMAGE_DOCK (dockbook->dock)->ui_manager != NULL)
+      gimp_image_dock_get_ui_manager (GIMP_IMAGE_DOCK (dockbook->dock)))
     {
       const gchar *dialog_id;
 
@@ -463,7 +463,7 @@ gimp_dockbook_create_tab_widget (GimpDockbook *dockbook,
           GimpActionGroup *group;
 
           group = gimp_ui_manager_get_action_group
-            (GIMP_IMAGE_DOCK (dockbook->dock)->ui_manager, "dialogs");
+            (gimp_image_dock_get_ui_manager (GIMP_IMAGE_DOCK (dockbook->dock)), "dialogs");
 
           if (group)
             {
diff --git a/app/widgets/gimpimagedock.c b/app/widgets/gimpimagedock.c
index 5c27413..f1dade1 100644
--- a/app/widgets/gimpimagedock.c
+++ b/app/widgets/gimpimagedock.c
@@ -172,3 +172,11 @@ gimp_image_dock_image_flush (GimpImage     *image,
         gimp_ui_manager_update (dock->ui_manager, display);
     }
 }
+
+GimpUIManager *
+gimp_image_dock_get_ui_manager (GimpImageDock *image_dock)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE_DOCK (image_dock), NULL);
+
+  return image_dock->ui_manager;
+}
diff --git a/app/widgets/gimpimagedock.h b/app/widgets/gimpimagedock.h
index 9ca28b5..49d5c90 100644
--- a/app/widgets/gimpimagedock.h
+++ b/app/widgets/gimpimagedock.h
@@ -54,7 +54,8 @@ struct _GimpImageDockClass
 };
 
 
-GType   gimp_image_dock_get_type (void) G_GNUC_CONST;
+GType           gimp_image_dock_get_type       (void) G_GNUC_CONST;
+GimpUIManager * gimp_image_dock_get_ui_manager (GimpImageDock *image_dock);
 
 
 #endif /* __GIMP_IMAGE_DOCK_H__ */
diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c
index de39836..c4b40a4 100644
--- a/app/widgets/gimptoolbox.c
+++ b/app/widgets/gimptoolbox.c
@@ -717,12 +717,13 @@ toolbox_create_tools (GimpToolbox *toolbox,
                         G_CALLBACK (toolbox_tool_button_press),
                         toolbox);
 
-      if (GIMP_IMAGE_DOCK (toolbox)->ui_manager)
+      if (gimp_image_dock_get_ui_manager (GIMP_IMAGE_DOCK (toolbox)))
         {
-          GtkAction   *action;
-          const gchar *identifier;
-          gchar       *tmp;
-          gchar       *name;
+          GimpUIManager *ui_manager;
+          GtkAction     *action;
+          const gchar   *identifier;
+          gchar         *tmp;
+          gchar         *name;
 
           identifier = gimp_object_get_name (tool_info);
 
@@ -731,8 +732,8 @@ toolbox_create_tools (GimpToolbox *toolbox,
           name = g_strdup_printf ("tools-%s", tmp);
           g_free (tmp);
 
-          action = gimp_ui_manager_find_action (GIMP_IMAGE_DOCK (toolbox)->ui_manager,
-                                                "tools", name);
+          ui_manager = gimp_image_dock_get_ui_manager (GIMP_IMAGE_DOCK (toolbox));
+          action = gimp_ui_manager_find_action (ui_manager, "tools", name);
           g_free (name);
 
           if (action)



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