[gimp] app: Add GimpUIManager property to GimpDock



commit 3ebad746ee7227f3e18259bb0355fa67cf2d6c5a
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun Sep 20 19:24:04 2009 +0200

    app: Add GimpUIManager property to GimpDock
    
    Add GimpUIManager property to GimpDock. We need it later when the
    GimpDock stops being a GimpDockWindow.

 app/widgets/gimpdock.c |   34 +++++++++++++++++++++++++++++++++-
 app/widgets/gimpdock.h |    1 +
 2 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/app/widgets/gimpdock.c b/app/widgets/gimpdock.c
index b9556de..77a90f6 100644
--- a/app/widgets/gimpdock.c
+++ b/app/widgets/gimpdock.c
@@ -35,6 +35,7 @@
 #include "gimpdockable.h"
 #include "gimpdockbook.h"
 #include "gimpdockseparator.h"
+#include "gimpuimanager.h"
 
 #include "gimp-intl.h"
 
@@ -43,7 +44,8 @@ enum
 {
   PROP_0,
   PROP_CONTEXT,
-  PROP_DIALOG_FACTORY
+  PROP_DIALOG_FACTORY,
+  PROP_UI_MANAGER
 };
 
 enum
@@ -60,6 +62,7 @@ struct _GimpDockPrivate
 {
   GimpDialogFactory *dialog_factory;
   GimpContext       *context;
+  GimpUIManager     *ui_manager;
 
   GtkWidget         *main_vbox;
   GtkWidget         *vbox;
@@ -161,6 +164,13 @@ gimp_dock_class_init (GimpDockClass *klass)
                                                         GIMP_PARAM_READWRITE |
                                                         G_PARAM_CONSTRUCT_ONLY));
 
+  g_object_class_install_property (object_class, PROP_UI_MANAGER,
+                                   g_param_spec_object ("ui-manager",
+                                                        NULL, NULL,
+                                                        GIMP_TYPE_UI_MANAGER,
+                                                        GIMP_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT_ONLY));
+
   g_type_class_add_private (klass, sizeof (GimpDockPrivate));
 }
 
@@ -207,6 +217,10 @@ gimp_dock_set_property (GObject      *object,
       dock->p->dialog_factory = g_value_get_object (value);
       break;
 
+    case PROP_UI_MANAGER:
+      dock->p->ui_manager = g_value_dup_object (value);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -231,6 +245,10 @@ gimp_dock_get_property (GObject    *object,
       g_value_set_object (value, dock->p->dialog_factory);
       break;
 
+    case PROP_UI_MANAGER:
+      g_value_set_object (value, dock->p->ui_manager);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -245,6 +263,12 @@ gimp_dock_destroy (GtkObject *object)
   while (dock->p->dockbooks)
     gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->p->dockbooks->data));
 
+  if (dock->p->ui_manager)
+    {
+      g_object_unref (dock->p->ui_manager);
+      dock->p->ui_manager = NULL;
+    }
+
   if (dock->p->context)
     {
       g_object_unref (dock->p->context);
@@ -373,6 +397,14 @@ gimp_dock_get_dialog_factory (GimpDock *dock)
   return dock->p->dialog_factory;
 }
 
+GimpUIManager *
+gimp_dock_get_ui_manager (GimpDock *dock)
+{
+  g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
+
+  return dock->p->ui_manager;
+}
+
 GList *
 gimp_dock_get_dockbooks (GimpDock *dock)
 {
diff --git a/app/widgets/gimpdock.h b/app/widgets/gimpdock.h
index 82f01c7..ee357b2 100644
--- a/app/widgets/gimpdock.h
+++ b/app/widgets/gimpdock.h
@@ -85,6 +85,7 @@ void                gimp_dock_set_host_geometry_hints
 void                gimp_dock_invalidate_geometry(GimpDock       *dock);
 GimpContext       * gimp_dock_get_context        (GimpDock       *dock);
 GimpDialogFactory * gimp_dock_get_dialog_factory (GimpDock       *dock);
+GimpUIManager     * gimp_dock_get_ui_manager     (GimpDock       *dock);
 GList             * gimp_dock_get_dockbooks      (GimpDock       *dock);
 gint                gimp_dock_get_n_dockables    (GimpDock       *dock);
 GtkWidget         * gimp_dock_get_main_vbox      (GimpDock       *dock);



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