[gimp] app: Add "gimp" property to GimpImageWindow



commit b9214fd3cfaad34d16115f1896ce784a6faf6bda
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun Oct 25 21:44:23 2009 +0100

    app: Add "gimp" property to GimpImageWindow

 app/display/gimpdisplay.c     |    1 +
 app/display/gimpimagewindow.c |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c
index e1be801..ae2f739 100644
--- a/app/display/gimpdisplay.c
+++ b/app/display/gimpdisplay.c
@@ -432,6 +432,7 @@ gimp_display_new (Gimp              *gimp,
   if (! window)
     {
       window = g_object_new (GIMP_TYPE_IMAGE_WINDOW,
+                             "gimp",            gimp,
                              "menu-factory",    menu_factory,
                              "display-factory", display_factory,
                              /* The window position will be overridden by the
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index b6223f9..62062d1 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -60,6 +60,7 @@
 enum
 {
   PROP_0,
+  PROP_GIMP,
   PROP_MENU_FACTORY,
   PROP_DISPLAY_FACTORY
 };
@@ -69,6 +70,7 @@ typedef struct _GimpImageWindowPrivate GimpImageWindowPrivate;
 
 struct _GimpImageWindowPrivate
 {
+  Gimp              *gimp;
   GimpUIManager     *menubar_manager;
   GimpDialogFactory *display_factory;
 
@@ -186,6 +188,12 @@ gimp_image_window_class_init (GimpImageWindowClass *klass)
   widget_class->window_state_event = gimp_image_window_window_state_event;
   widget_class->style_set          = gimp_image_window_style_set;
 
+  g_object_class_install_property (object_class, PROP_GIMP,
+                                   g_param_spec_object ("gimp",
+                                                        NULL, NULL,
+                                                        GIMP_TYPE_GIMP,
+                                                        GIMP_PARAM_WRITABLE |
+                                                        G_PARAM_CONSTRUCT_ONLY));
   g_object_class_install_property (object_class, PROP_MENU_FACTORY,
                                    g_param_spec_object ("menu-factory",
                                                         NULL, NULL,
@@ -355,6 +363,9 @@ gimp_image_window_set_property (GObject      *object,
 
   switch (property_id)
     {
+    case PROP_GIMP:
+      private->gimp = g_value_get_object (value);
+      break;
     case PROP_MENU_FACTORY:
       {
         GimpMenuFactory *factory = g_value_get_object (value);
@@ -386,6 +397,9 @@ gimp_image_window_get_property (GObject    *object,
 
   switch (property_id)
     {
+    case PROP_GIMP:
+      g_value_set_object (value, private->gimp);
+      break;
     case PROP_DISPLAY_FACTORY:
       g_value_set_object (value, private->display_factory);
       break;



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