[gimp] app, libgimpbase: move enum GimpStrokeMethod to libgimpbase



commit e3ea38358085852be84923851792e7960c751587
Author: Michael Natterer <mitch gimp org>
Date:   Sun Nov 8 22:48:48 2015 +0100

    app, libgimpbase: move enum GimpStrokeMethod to libgimpbase
    
    and rename its values.

 app/core/core-enums.c        |   29 -----------------------------
 app/core/core-enums.h        |   11 -----------
 app/core/gimpchannel.c       |    4 ++--
 app/core/gimpstrokeoptions.c |    8 ++++----
 app/pdb/edit-cmds.c          |    4 ++--
 app/pdb/paths-cmds.c         |    2 +-
 app/vectors/gimpvectors.c    |    4 ++--
 libgimp/gimpenums.c.tail     |    2 ++
 libgimpbase/gimpbase.def     |    1 +
 libgimpbase/gimpbaseenums.c  |   30 ++++++++++++++++++++++++++++++
 libgimpbase/gimpbaseenums.h  |   11 +++++++++++
 tools/pdbgen/enums.pl        |    7 +++++++
 tools/pdbgen/pdb/edit.pdb    |    4 ++--
 tools/pdbgen/pdb/paths.pdb   |    2 +-
 14 files changed, 65 insertions(+), 54 deletions(-)
---
diff --git a/app/core/core-enums.c b/app/core/core-enums.c
index 846dbd1..ab7df51 100644
--- a/app/core/core-enums.c
+++ b/app/core/core-enums.c
@@ -483,35 +483,6 @@ gimp_fill_style_get_type (void)
 }
 
 GType
-gimp_stroke_method_get_type (void)
-{
-  static const GEnumValue values[] =
-  {
-    { GIMP_STROKE_METHOD_LIBART, "GIMP_STROKE_METHOD_LIBART", "libart" },
-    { GIMP_STROKE_METHOD_PAINT_CORE, "GIMP_STROKE_METHOD_PAINT_CORE", "paint-core" },
-    { 0, NULL, NULL }
-  };
-
-  static const GimpEnumDesc descs[] =
-  {
-    { GIMP_STROKE_METHOD_LIBART, NC_("stroke-method", "Stroke line"), NULL },
-    { GIMP_STROKE_METHOD_PAINT_CORE, NC_("stroke-method", "Stroke with a paint tool"), NULL },
-    { 0, NULL, NULL }
-  };
-
-  static GType type = 0;
-
-  if (G_UNLIKELY (! type))
-    {
-      type = g_enum_register_static ("GimpStrokeMethod", values);
-      gimp_type_set_translation_context (type, "stroke-method");
-      gimp_enum_set_value_descriptions (type, descs);
-    }
-
-  return type;
-}
-
-GType
 gimp_join_style_get_type (void)
 {
   static const GEnumValue values[] =
diff --git a/app/core/core-enums.h b/app/core/core-enums.h
index ca30d40..839a206 100644
--- a/app/core/core-enums.h
+++ b/app/core/core-enums.h
@@ -235,17 +235,6 @@ typedef enum  /*< pdb-skip >*/
 } GimpFillStyle;
 
 
-#define GIMP_TYPE_STROKE_METHOD (gimp_stroke_method_get_type ())
-
-GType gimp_stroke_method_get_type (void) G_GNUC_CONST;
-
-typedef enum  /*< pdb-skip >*/
-{
-  GIMP_STROKE_METHOD_LIBART,     /*< desc="Stroke line"              >*/
-  GIMP_STROKE_METHOD_PAINT_CORE  /*< desc="Stroke with a paint tool" >*/
-} GimpStrokeMethod;
-
-
 #define GIMP_TYPE_JOIN_STYLE (gimp_join_style_get_type ())
 
 GType gimp_join_style_get_type (void) G_GNUC_CONST;
diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c
index 8fb1957..dfa771c 100644
--- a/app/core/gimpchannel.c
+++ b/app/core/gimpchannel.c
@@ -829,7 +829,7 @@ gimp_channel_stroke (GimpItem           *item,
 
   switch (gimp_stroke_options_get_method (stroke_options))
     {
-    case GIMP_STROKE_METHOD_LIBART:
+    case GIMP_STROKE_LINE:
       gimp_drawable_stroke_boundary (drawable,
                                      stroke_options,
                                      segs_in, n_segs_in,
@@ -838,7 +838,7 @@ gimp_channel_stroke (GimpItem           *item,
       retval = TRUE;
       break;
 
-    case GIMP_STROKE_METHOD_PAINT_CORE:
+    case GIMP_STROKE_PAINT_METHOD:
       {
         GimpPaintInfo    *paint_info;
         GimpPaintCore    *core;
diff --git a/app/core/gimpstrokeoptions.c b/app/core/gimpstrokeoptions.c
index ea9688a..49dcf05 100644
--- a/app/core/gimpstrokeoptions.c
+++ b/app/core/gimpstrokeoptions.c
@@ -154,7 +154,7 @@ gimp_stroke_options_class_init (GimpStrokeOptionsClass *klass)
   GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_METHOD,
                                  "method", NULL,
                                  GIMP_TYPE_STROKE_METHOD,
-                                 GIMP_STROKE_METHOD_LIBART,
+                                 GIMP_STROKE_LINE,
                                  GIMP_PARAM_STATIC_STRINGS);
 
   GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_WIDTH,
@@ -429,7 +429,7 @@ GimpStrokeMethod
 gimp_stroke_options_get_method (GimpStrokeOptions *options)
 {
   g_return_val_if_fail (GIMP_IS_STROKE_OPTIONS (options),
-                        GIMP_STROKE_METHOD_LIBART);
+                        GIMP_STROKE_LINE);
 
   return GET_PRIVATE (options)->method;
 }
@@ -559,10 +559,10 @@ gimp_stroke_options_prepare (GimpStrokeOptions *options,
 
   switch (private->method)
     {
-    case GIMP_STROKE_METHOD_LIBART:
+    case GIMP_STROKE_LINE:
       break;
 
-    case GIMP_STROKE_METHOD_PAINT_CORE:
+    case GIMP_STROKE_PAINT_METHOD:
       {
         GimpPaintInfo *paint_info = GIMP_CONTEXT (options)->paint_info;
 
diff --git a/app/pdb/edit-cmds.c b/app/pdb/edit-cmds.c
index 4009d57..990716b 100644
--- a/app/pdb/edit-cmds.c
+++ b/app/pdb/edit-cmds.c
@@ -866,7 +866,7 @@ edit_stroke_invoker (GimpProcedure         *procedure,
 
           options = gimp_stroke_options_new (gimp, context, TRUE);
           g_object_set (options,
-                        "method", GIMP_STROKE_METHOD_PAINT_CORE,
+                        "method", GIMP_STROKE_PAINT_METHOD,
                         NULL);
 
           paint_options =
@@ -917,7 +917,7 @@ edit_stroke_vectors_invoker (GimpProcedure         *procedure,
 
           options = gimp_stroke_options_new (gimp, context, TRUE);
           g_object_set (options,
-                        "method", GIMP_STROKE_METHOD_PAINT_CORE,
+                        "method", GIMP_STROKE_PAINT_METHOD,
                         NULL);
 
           paint_options =
diff --git a/app/pdb/paths-cmds.c b/app/pdb/paths-cmds.c
index b9e36b1..73ce4c5 100644
--- a/app/pdb/paths-cmds.c
+++ b/app/pdb/paths-cmds.c
@@ -345,7 +345,7 @@ path_stroke_current_invoker (GimpProcedure         *procedure,
 
           options = gimp_stroke_options_new (gimp, context, TRUE);
           g_object_set (options,
-                        "method", GIMP_STROKE_METHOD_PAINT_CORE,
+                        "method", GIMP_STROKE_PAINT_METHOD,
                         NULL);
 
           paint_options =
diff --git a/app/vectors/gimpvectors.c b/app/vectors/gimpvectors.c
index d1d75ae..31ab229 100644
--- a/app/vectors/gimpvectors.c
+++ b/app/vectors/gimpvectors.c
@@ -632,13 +632,13 @@ gimp_vectors_stroke (GimpItem           *item,
 
   switch (gimp_stroke_options_get_method (stroke_options))
     {
-    case GIMP_STROKE_METHOD_LIBART:
+    case GIMP_STROKE_LINE:
       retval = gimp_drawable_stroke_vectors (drawable,
                                              stroke_options,
                                              vectors, push_undo, error);
       break;
 
-    case GIMP_STROKE_METHOD_PAINT_CORE:
+    case GIMP_STROKE_PAINT_METHOD:
       {
         GimpPaintInfo    *paint_info;
         GimpPaintCore    *core;
diff --git a/libgimp/gimpenums.c.tail b/libgimp/gimpenums.c.tail
index 27da775..70062eb 100644
--- a/libgimp/gimpenums.c.tail
+++ b/libgimp/gimpenums.c.tail
@@ -51,6 +51,7 @@ static const GimpGetTypeFunc get_type_funcs[] =
   gimp_select_criterion_get_type,
   gimp_size_type_get_type,
   gimp_stack_trace_mode_get_type,
+  gimp_stroke_method_get_type,
   gimp_text_direction_get_type,
   gimp_text_hint_style_get_type,
   gimp_text_justification_get_type,
@@ -111,6 +112,7 @@ static const gchar * const type_names[] =
   "GimpSelectCriterion",
   "GimpSizeType",
   "GimpStackTraceMode",
+  "GimpStrokeMethod",
   "GimpTextDirection",
   "GimpTextHintStyle",
   "GimpTextJustification",
diff --git a/libgimpbase/gimpbase.def b/libgimpbase/gimpbase.def
index 32e7ff9..8b2a530 100644
--- a/libgimpbase/gimpbase.def
+++ b/libgimpbase/gimpbase.def
@@ -134,6 +134,7 @@ EXPORTS
        gimp_signal_private
        gimp_size_type_get_type
        gimp_stack_trace_mode_get_type
+       gimp_stroke_method_get_type
        gimp_strip_uline
        gimp_sysconf_directory
        gimp_sysconf_directory_file
diff --git a/libgimpbase/gimpbaseenums.c b/libgimpbase/gimpbaseenums.c
index 94748e8..a7ddada 100644
--- a/libgimpbase/gimpbaseenums.c
+++ b/libgimpbase/gimpbaseenums.c
@@ -1563,6 +1563,36 @@ gimp_stack_trace_mode_get_type (void)
 }
 
 GType
+gimp_stroke_method_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_STROKE_LINE, "GIMP_STROKE_LINE", "line" },
+    { GIMP_STROKE_PAINT_METHOD, "GIMP_STROKE_PAINT_METHOD", "paint-method" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_STROKE_LINE, NC_("stroke-method", "Stroke line"), NULL },
+    { GIMP_STROKE_PAINT_METHOD, NC_("stroke-method", "Stroke with a paint tool"), NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (G_UNLIKELY (! type))
+    {
+      type = g_enum_register_static ("GimpStrokeMethod", values);
+      gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
+      gimp_type_set_translation_context (type, "stroke-method");
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
+GType
 gimp_text_direction_get_type (void)
 {
   static const GEnumValue values[] =
diff --git a/libgimpbase/gimpbaseenums.h b/libgimpbase/gimpbaseenums.h
index 06fb7d2..d4e1bdb 100644
--- a/libgimpbase/gimpbaseenums.h
+++ b/libgimpbase/gimpbaseenums.h
@@ -700,6 +700,17 @@ typedef enum
 } GimpStackTraceMode;
 
 
+#define GIMP_TYPE_STROKE_METHOD (gimp_stroke_method_get_type ())
+
+GType gimp_stroke_method_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_STROKE_LINE,         /*< desc="Stroke line"              >*/
+  GIMP_STROKE_PAINT_METHOD  /*< desc="Stroke with a paint tool" >*/
+} GimpStrokeMethod;
+
+
 #define GIMP_TYPE_TEXT_DIRECTION (gimp_text_direction_get_type ())
 
 GType gimp_text_direction_get_type (void) G_GNUC_CONST;
diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl
index 43c473b..57f7b8a 100644
--- a/tools/pdbgen/enums.pl
+++ b/tools/pdbgen/enums.pl
@@ -510,6 +510,13 @@ package Gimp::CodeGen::enums;
                       GIMP_STACK_TRACE_QUERY => '1',
                       GIMP_STACK_TRACE_ALWAYS => '2' }
        },
+    GimpStrokeMethod =>
+       { contig => 1,
+         header => 'libgimpbase/gimpbaseenums.h',
+         symbols => [ qw(GIMP_STROKE_LINE GIMP_STROKE_PAINT_METHOD) ],
+         mapping => { GIMP_STROKE_LINE => '0',
+                      GIMP_STROKE_PAINT_METHOD => '1' }
+       },
     GimpTextDirection =>
        { contig => 1,
          header => 'libgimpbase/gimpbaseenums.h',
diff --git a/tools/pdbgen/pdb/edit.pdb b/tools/pdbgen/pdb/edit.pdb
index c725a71..77d07d8 100644
--- a/tools/pdbgen/pdb/edit.pdb
+++ b/tools/pdbgen/pdb/edit.pdb
@@ -943,7 +943,7 @@ HELP
 
       options = gimp_stroke_options_new (gimp, context, TRUE);
       g_object_set (options,
-                    "method", GIMP_STROKE_METHOD_PAINT_CORE,
+                    "method", GIMP_STROKE_PAINT_METHOD,
                     NULL);
 
       paint_options =
@@ -997,7 +997,7 @@ HELP
 
       options = gimp_stroke_options_new (gimp, context, TRUE);
       g_object_set (options,
-                    "method", GIMP_STROKE_METHOD_PAINT_CORE,
+                    "method", GIMP_STROKE_PAINT_METHOD,
                     NULL);
 
       paint_options =
diff --git a/tools/pdbgen/pdb/paths.pdb b/tools/pdbgen/pdb/paths.pdb
index 86cf6e3..0bbd599 100644
--- a/tools/pdbgen/pdb/paths.pdb
+++ b/tools/pdbgen/pdb/paths.pdb
@@ -276,7 +276,7 @@ sub path_stroke_current {
 
       options = gimp_stroke_options_new (gimp, context, TRUE);
       g_object_set (options,
-                    "method", GIMP_STROKE_METHOD_PAINT_CORE,
+                    "method", GIMP_STROKE_PAINT_METHOD,
                     NULL);
 
       paint_options =


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