[gimp] app: Add image_window boolean to GimpDialogFactoryEntry



commit 7edf717baee93025c312a0049a6d5f2e59bd1e74
Author: Martin Nordholts <martinn src gnome org>
Date:   Fri May 13 21:02:05 2011 +0200

    app: Add image_window boolean to GimpDialogFactoryEntry
    
    Add image_window boolean to GimpDialogFactoryEntry and rename
    FOREIGN_NOT_HIDEABLE() to IMAGE_WINDOW(). We need to treat image
    windows a bit special when we restore a single-window mode session.

 app/dialogs/dialogs.c           |   20 +++++++++++++++-----
 app/widgets/gimpdialogfactory.c |    2 ++
 app/widgets/gimpdialogfactory.h |    4 ++++
 app/widgets/gimpsessioninfo.c   |    3 ++-
 4 files changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/app/dialogs/dialogs.c b/app/dialogs/dialogs.c
index b1ccfe4..fd6fafe 100644
--- a/app/dialogs/dialogs.c
+++ b/app/dialogs/dialogs.c
@@ -61,9 +61,10 @@ GimpContainer *global_recent_docks = NULL;
     remember_size  /* remember_size    */, \
     FALSE          /* remember_if_open */, \
     TRUE           /* hideable         */, \
+    FALSE          /* image_window     */, \
     FALSE          /* dockable         */}
 
-#define FOREIGN_NOT_HIDEABLE(id, singleton, remember_size) \
+#define IMAGE_WINDOW(id, singleton, remember_size) \
   { id             /* identifier       */, \
     NULL           /* name             */, \
     NULL           /* blurb            */, \
@@ -76,6 +77,7 @@ GimpContainer *global_recent_docks = NULL;
     remember_size  /* remember_size    */, \
     FALSE          /* remember_if_open */, \
     FALSE          /* hideable         */, \
+    TRUE           /* image_window     */, \
     FALSE          /* dockable         */}
 
 #define TOPLEVEL(id, new_func, singleton, session_managed, remember_size) \
@@ -91,6 +93,7 @@ GimpContainer *global_recent_docks = NULL;
     remember_size    /* remember_size    */, \
     FALSE            /* remember_if_open */, \
     TRUE             /* hideable         */, \
+    FALSE            /* image_window     */, \
     FALSE            /* dockable         */}
 
 #define DOCKABLE(id, name, blurb, stock_id, help_id, new_func, view_size, singleton) \
@@ -106,6 +109,7 @@ GimpContainer *global_recent_docks = NULL;
     FALSE      /* remember_size    */, \
     TRUE       /* remember_if_open */, \
     TRUE       /* hideable         */, \
+    FALSE      /* image_window     */, \
     TRUE       /* dockable         */}
 
 #define DOCK(id, new_func) \
@@ -121,6 +125,7 @@ GimpContainer *global_recent_docks = NULL;
     FALSE      /* remember_size    */, \
     FALSE      /* remember_if_open */, \
     TRUE       /* hideable         */, \
+    FALSE      /* image_window     */, \
     FALSE      /* dockable         */}
 
 #define DOCK_WINDOW(id, new_func) \
@@ -136,6 +141,7 @@ GimpContainer *global_recent_docks = NULL;
     TRUE       /* remember_size    */, \
     TRUE       /* remember_if_open */, \
     TRUE       /* hideable         */, \
+    FALSE      /* image_window     */, \
     FALSE      /* dockable         */}
 
 #define LISTGRID(id, name, blurb, stock_id, help_id, view_size) \
@@ -151,6 +157,7 @@ GimpContainer *global_recent_docks = NULL;
     FALSE                         /* remember_size    */,  \
     TRUE                          /* remember_if_open */,  \
     TRUE                          /* hideable         */,  \
+    FALSE                         /* image_window     */,  \
     TRUE                          /* dockable         */}, \
   { "gimp-"#id"-grid"             /* identifier       */,  \
     name                          /* name             */,  \
@@ -164,6 +171,7 @@ GimpContainer *global_recent_docks = NULL;
     FALSE                         /* remember_size    */,  \
     TRUE                          /* remember_if_open */,  \
     TRUE                          /* hideable         */,  \
+    FALSE                         /* image_window     */,  \
     TRUE                          /* dockable         */}
 
 #define LIST(id, new_func, name, blurb, stock_id, help_id, view_size) \
@@ -179,6 +187,7 @@ GimpContainer *global_recent_docks = NULL;
     FALSE                               /* remember_size    */, \
     TRUE                                /* remember_if_open */, \
     TRUE                                /* hideable         */, \
+    FALSE                               /* image_window     */, \
     TRUE                                /* dockable         */}
 
 
@@ -371,10 +380,10 @@ static const GimpDialogFactoryEntry entries[] =
             dialogs_tool_preset_editor_get, 0, TRUE),
 
   /*  image windows  */
-  FOREIGN_NOT_HIDEABLE ("gimp-empty-image-window",
-                        TRUE, TRUE),
-  FOREIGN_NOT_HIDEABLE ("gimp-single-image-window",
-                        TRUE, TRUE)
+  IMAGE_WINDOW ("gimp-empty-image-window",
+                TRUE, TRUE),
+  IMAGE_WINDOW ("gimp-single-image-window",
+                TRUE, TRUE)
 };
 
 
@@ -409,6 +418,7 @@ dialogs_init (Gimp            *gimp,
                                         entries[i].remember_size,
                                         entries[i].remember_if_open,
                                         entries[i].hideable,
+                                        entries[i].image_window,
                                         entries[i].dockable);
 
   global_recent_docks = gimp_list_new (GIMP_TYPE_SESSION_INFO, FALSE);
diff --git a/app/widgets/gimpdialogfactory.c b/app/widgets/gimpdialogfactory.c
index 1d89fb6..23e64cd 100644
--- a/app/widgets/gimpdialogfactory.c
+++ b/app/widgets/gimpdialogfactory.c
@@ -273,6 +273,7 @@ gimp_dialog_factory_register_entry (GimpDialogFactory *factory,
                                     gboolean           remember_size,
                                     gboolean           remember_if_open,
                                     gboolean           hideable,
+                                    gboolean           image_window,
                                     gboolean           dockable)
 {
   GimpDialogFactoryEntry *entry;
@@ -294,6 +295,7 @@ gimp_dialog_factory_register_entry (GimpDialogFactory *factory,
   entry->remember_size    = remember_size ? TRUE : FALSE;
   entry->remember_if_open = remember_if_open ? TRUE : FALSE;
   entry->hideable         = hideable ? TRUE : FALSE;
+  entry->image_window     = image_window ? TRUE : FALSE;
   entry->dockable         = dockable ? TRUE : FALSE;
 
   factory->p->registered_dialogs = g_list_prepend (factory->p->registered_dialogs,
diff --git a/app/widgets/gimpdialogfactory.h b/app/widgets/gimpdialogfactory.h
index 2c0d323..f8c3f9e 100644
--- a/app/widgets/gimpdialogfactory.h
+++ b/app/widgets/gimpdialogfactory.h
@@ -65,6 +65,9 @@ struct _GimpDialogFactoryEntry
   /* If TRUE the visibility of the dialog is toggleable */
   gboolean           hideable;
 
+  /* If TRUE the entry is for a GimpImageWindow, FALSE otherwise */
+  gboolean           image_window;
+
   /* If TRUE the entry is for a dockable, FALSE otherwise */
   gboolean           dockable;
 };
@@ -123,6 +126,7 @@ void                gimp_dialog_factory_register_entry       (GimpDialogFactory
                                                               gboolean                 remember_size,
                                                               gboolean                 remember_if_open,
                                                               gboolean                 hideable,
+                                                              gboolean                 image_window,
                                                               gboolean                 dockable);
 GimpDialogFactoryEntry *
                     gimp_dialog_factory_find_entry           (GimpDialogFactory       *factory,
diff --git a/app/widgets/gimpsessioninfo.c b/app/widgets/gimpsessioninfo.c
index 5101eec..2350bda 100644
--- a/app/widgets/gimpsessioninfo.c
+++ b/app/widgets/gimpsessioninfo.c
@@ -481,7 +481,8 @@ gimp_session_info_restore (GimpSessionInfo   *info,
   info->p->screen = DEFAULT_SCREEN;
 
   if (info->p->factory_entry &&
-      ! info->p->factory_entry->dockable)
+      ! info->p->factory_entry->dockable &&
+      ! info->p->factory_entry->image_window)
     {
       GimpCoreConfig *config = gimp_dialog_factory_get_context (factory)->gimp->config;
 



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