[gimp] app: add icons to the generated gimp-gegl-config-proxy classes



commit 6541c6b80bf0cd5a5802cb65281bdb93fd5c35cc
Author: Michael Natterer <mitch gimp org>
Date:   Sat Jan 16 22:01:07 2016 +0100

    app: add icons to the generated gimp-gegl-config-proxy classes

 app/actions/gimpgeglprocedure.c   |    1 +
 app/gegl/gimp-gegl-config-proxy.c |   12 ++++++++++++
 app/gegl/gimp-gegl-config-proxy.h |    1 +
 app/tools/gimpoperationtool.c     |    1 +
 4 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/app/actions/gimpgeglprocedure.c b/app/actions/gimpgeglprocedure.c
index 3c46c8e..34cf6d1 100644
--- a/app/actions/gimpgeglprocedure.c
+++ b/app/actions/gimpgeglprocedure.c
@@ -243,6 +243,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure  *procedure,
       GimpContainer *container;
 
       settings = gimp_gegl_get_config_proxy (procedure->original_name,
+                                             gimp_viewable_get_icon_name (GIMP_VIEWABLE (procedure)),
                                              GIMP_TYPE_SETTINGS);
 
       container = gimp_gegl_get_config_container (G_TYPE_FROM_INSTANCE (settings));
diff --git a/app/gegl/gimp-gegl-config-proxy.c b/app/gegl/gimp-gegl-config-proxy.c
index d2cb8b6..f2c3802 100644
--- a/app/gegl/gimp-gegl-config-proxy.c
+++ b/app/gegl/gimp-gegl-config-proxy.c
@@ -30,6 +30,7 @@
 
 #include "core/gimplist.h"
 #include "core/gimpparamspecs-duplicate.h"
+#include "core/gimpviewable.h"
 
 #include "gimp-gegl-config-proxy.h"
 #include "gimp-gegl-utils.h"
@@ -192,11 +193,13 @@ gimp_gegl_config_config_iface_init (GimpConfigInterface *iface)
 
 GimpObject *
 gimp_gegl_get_config_proxy (const gchar *operation,
+                            const gchar *icon_name,
                             GType        parent_type)
 {
   GType config_type;
 
   g_return_val_if_fail (operation != NULL, NULL);
+  g_return_val_if_fail (icon_name != NULL, NULL);
   g_return_val_if_fail (g_type_is_a (parent_type, GIMP_TYPE_OBJECT), NULL);
 
   if (! config_types)
@@ -248,6 +251,15 @@ gimp_gegl_get_config_proxy (const gchar *operation,
         g_type_add_interface_static (config_type, GIMP_TYPE_CONFIG,
                                      &config_info);
 
+        if (g_type_is_a (config_type, GIMP_TYPE_VIEWABLE))
+          {
+            GimpViewableClass *viewable_class = g_type_class_ref (config_type);
+
+            viewable_class->default_icon_name = g_strdup (icon_name);
+
+            g_type_class_unref (viewable_class);
+          }
+
         g_hash_table_insert (config_types,
                              g_strdup (operation),
                              (gpointer) config_type);
diff --git a/app/gegl/gimp-gegl-config-proxy.h b/app/gegl/gimp-gegl-config-proxy.h
index b5e9312..40c453f 100644
--- a/app/gegl/gimp-gegl-config-proxy.h
+++ b/app/gegl/gimp-gegl-config-proxy.h
@@ -20,6 +20,7 @@
 
 
 GimpObject    * gimp_gegl_get_config_proxy     (const gchar *operation,
+                                                const gchar *icon_name,
                                                 GType        parent_type);
 GimpContainer * gimp_gegl_get_config_container (GType        config_type);
 
diff --git a/app/tools/gimpoperationtool.c b/app/tools/gimpoperationtool.c
index 156eb07..16c1252 100644
--- a/app/tools/gimpoperationtool.c
+++ b/app/tools/gimpoperationtool.c
@@ -247,6 +247,7 @@ gimp_operation_tool_get_operation (GimpImageMapTool  *im_tool,
 
   if (tool->operation)
     *config = G_OBJECT (gimp_gegl_get_config_proxy (tool->operation,
+                                                    tool->icon_name,
                                                     GIMP_TYPE_SETTINGS));
 
   if (tool->undo_desc)


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