[gimp] app: Add "dock-factory" property to GimpImageWindow



commit f3235e6f456814aecab4c0c56014208cb7c86019
Author: Martin Nordholts <martinn src gnome org>
Date:   Tue Dec 8 19:49:13 2009 +0100

    app: Add "dock-factory" property to GimpImageWindow
    
    With the introduction of a single-window mode, not only dock windows
    needs to be able to create docks, the image window also needs to. So
    give it a "dock-factory" property.

 app/display/gimpdisplay.c     |    6 ++++--
 app/display/gimpdisplay.h     |    3 ++-
 app/display/gimpimagewindow.c |   33 +++++++++++++++++++++++++++++++--
 app/display/gimpimagewindow.h |    4 +++-
 app/gui/gimpuiconfigurer.c    |    3 ++-
 app/gui/gui-vtable.c          |    3 ++-
 6 files changed, 44 insertions(+), 8 deletions(-)
---
diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c
index e204e48..9b2f62c 100644
--- a/app/display/gimpdisplay.c
+++ b/app/display/gimpdisplay.c
@@ -384,7 +384,8 @@ gimp_display_new (Gimp              *gimp,
                   gdouble            scale,
                   GimpMenuFactory   *menu_factory,
                   GimpUIManager     *popup_manager,
-                  GimpDialogFactory *display_factory)
+                  GimpDialogFactory *display_factory,
+                  GimpDialogFactory *dock_factory)
 {
   GimpDisplay        *display;
   GimpDisplayPrivate *private;
@@ -434,7 +435,8 @@ gimp_display_new (Gimp              *gimp,
       window = gimp_image_window_new (gimp,
                                       display->image,
                                       menu_factory,
-                                      display_factory);
+                                      display_factory,
+                                      dock_factory);
     }
 
   /*  create the shell for the image  */
diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h
index 1e09b9c..20ede64 100644
--- a/app/display/gimpdisplay.h
+++ b/app/display/gimpdisplay.h
@@ -56,7 +56,8 @@ GimpDisplay      * gimp_display_new          (Gimp              *gimp,
                                               gdouble            scale,
                                               GimpMenuFactory   *menu_factory,
                                               GimpUIManager     *popup_manager,
-                                              GimpDialogFactory *display_factory);
+                                              GimpDialogFactory *display_factory,
+                                              GimpDialogFactory *dock_factory);
 void               gimp_display_delete       (GimpDisplay       *display);
 void               gimp_display_close        (GimpDisplay       *display);
 
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index d457d2c..ddb2261 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -62,7 +62,8 @@ enum
   PROP_0,
   PROP_GIMP,
   PROP_MENU_FACTORY,
-  PROP_DISPLAY_FACTORY
+  PROP_DISPLAY_FACTORY,
+  PROP_DOCK_FACTORY
 };
 
 
@@ -73,6 +74,7 @@ struct _GimpImageWindowPrivate
   Gimp              *gimp;
   GimpUIManager     *menubar_manager;
   GimpDialogFactory *display_factory;
+  GimpDialogFactory *dock_factory;
 
   GList             *shells;
   GimpDisplayShell  *active_shell;
@@ -208,6 +210,13 @@ gimp_image_window_class_init (GimpImageWindowClass *klass)
                                                         GIMP_PARAM_READWRITE |
                                                         G_PARAM_CONSTRUCT_ONLY));
 
+  g_object_class_install_property (object_class, PROP_DOCK_FACTORY,
+                                   g_param_spec_object ("dock-factory",
+                                                        NULL, NULL,
+                                                        GIMP_TYPE_DIALOG_FACTORY,
+                                                        GIMP_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT_ONLY));
+
   g_type_class_add_private (klass, sizeof (GimpImageWindowPrivate));
 
   gtk_rc_parse_string (image_window_rc_style);
@@ -379,6 +388,9 @@ gimp_image_window_set_property (GObject      *object,
     case PROP_DISPLAY_FACTORY:
       private->display_factory = g_value_get_object (value);
       break;
+    case PROP_DOCK_FACTORY:
+      private->dock_factory = g_value_get_object (value);
+      break;
 
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -403,6 +415,9 @@ gimp_image_window_get_property (GObject    *object,
     case PROP_DISPLAY_FACTORY:
       g_value_set_object (value, private->display_factory);
       break;
+    case PROP_DOCK_FACTORY:
+      g_value_set_object (value, private->dock_factory);
+      break;
 
     case PROP_MENU_FACTORY:
     default:
@@ -595,7 +610,8 @@ GimpImageWindow *
 gimp_image_window_new (Gimp              *gimp,
                        GimpImage         *image,
                        GimpMenuFactory   *menu_factory,
-                       GimpDialogFactory *display_factory)
+                       GimpDialogFactory *display_factory,
+                       GimpDialogFactory *dock_factory)
 {
   GimpImageWindow *window;
 
@@ -608,6 +624,7 @@ gimp_image_window_new (Gimp              *gimp,
                          "gimp",            gimp,
                          "menu-factory",    menu_factory,
                          "display-factory", display_factory,
+                         "dock-factory",    dock_factory,
                          /* The window position will be overridden by the
                           * dialog factory, it is only really used on first
                           * startup.
@@ -648,6 +665,18 @@ gimp_image_window_get_ui_manager (GimpImageWindow *window)
   return private->menubar_manager;
 }
 
+GimpDialogFactory*
+gimp_image_window_get_dock_factory (GimpImageWindow *window)
+{
+  GimpImageWindowPrivate *private;
+
+  g_return_val_if_fail (GIMP_IS_IMAGE_WINDOW (window), FALSE);
+
+  private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
+
+  return private->dock_factory;
+}
+
 GimpDockColumns  *
 gimp_image_window_get_left_docks (GimpImageWindow  *window)
 {
diff --git a/app/display/gimpimagewindow.h b/app/display/gimpimagewindow.h
index 0700f93..ee4adfb 100644
--- a/app/display/gimpimagewindow.h
+++ b/app/display/gimpimagewindow.h
@@ -48,10 +48,12 @@ GType              gimp_image_window_get_type           (void) G_GNUC_CONST;
 GimpImageWindow  * gimp_image_window_new                (Gimp              *gimp,
                                                          GimpImage         *image,
                                                          GimpMenuFactory   *menu_factory,
-                                                         GimpDialogFactory *display_factory);
+                                                         GimpDialogFactory *display_factory,
+                                                         GimpDialogFactory *dock_factory);
 void               gimp_image_window_destroy            (GimpImageWindow   *window);
 
 GimpUIManager    * gimp_image_window_get_ui_manager     (GimpImageWindow  *window);
+GimpDialogFactory* gimp_image_window_get_dock_factory   (GimpImageWindow  *window);
 GimpDockColumns  * gimp_image_window_get_left_docks     (GimpImageWindow  *window);
 GimpDockColumns  * gimp_image_window_get_right_docks    (GimpImageWindow  *window);
 
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index e9f90cd..c9be53b 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -311,7 +311,8 @@ gimp_ui_configurer_separate_shells (GimpUIConfigurer *ui_configurer,
       new_image_window = gimp_image_window_new (ui_configurer->p->gimp,
                                                 NULL,
                                                 global_menu_factory,
-                                                global_display_factory);
+                                                global_display_factory,
+                                                global_dock_factory);
       /* Move the shell there */
       shell = gimp_image_window_get_shell (source_image_window, 1);
 
diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c
index 4acbb88..0aded2b 100644
--- a/app/gui/gui-vtable.c
+++ b/app/gui/gui-vtable.c
@@ -351,7 +351,8 @@ gui_display_create (Gimp      *gimp,
       display = gimp_display_new (gimp, image, unit, scale,
                                   global_menu_factory,
                                   image_managers->data,
-                                  global_display_factory);
+                                  global_display_factory,
+                                  global_dock_factory);
    }
 
   if (gimp_context_get_display (context) == display)



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