[gimp/soc-2010-cage] add an enum for cage mode



commit 94c8950512beb68ecf0b60868e8ca6d1ffde4083
Author: Michael Muré <batolettre gmail com>
Date:   Fri Jul 23 15:13:19 2010 +0200

    add an enum for cage mode

 libgimp/gimpenums.c.tail    |    2 ++
 libgimpbase/gimpbaseenums.c |   30 ++++++++++++++++++++++++++++++
 libgimpbase/gimpbaseenums.h |   10 ++++++++++
 tools/pdbgen/enums.pl       |    7 +++++++
 4 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/libgimp/gimpenums.c.tail b/libgimp/gimpenums.c.tail
index acafcfb..8af079a 100644
--- a/libgimp/gimpenums.c.tail
+++ b/libgimp/gimpenums.c.tail
@@ -8,6 +8,7 @@ static const GimpGetTypeFunc get_type_funcs[] =
   gimp_brush_application_mode_get_type,
   gimp_brush_generated_shape_get_type,
   gimp_bucket_fill_mode_get_type,
+  gimp_cage_mode_get_type,
   gimp_channel_ops_get_type,
   gimp_channel_type_get_type,
   gimp_clone_type_get_type,
@@ -64,6 +65,7 @@ static const gchar * const type_names[] =
   "GimpBrushApplicationMode",
   "GimpBrushGeneratedShape",
   "GimpBucketFillMode",
+  "GimpCageMode",
   "GimpChannelOps",
   "GimpChannelType",
   "GimpCloneType",
diff --git a/libgimpbase/gimpbaseenums.c b/libgimpbase/gimpbaseenums.c
index 45a506b..3183889 100644
--- a/libgimpbase/gimpbaseenums.c
+++ b/libgimpbase/gimpbaseenums.c
@@ -115,6 +115,36 @@ gimp_bucket_fill_mode_get_type (void)
 }
 
 GType
+gimp_cage_mode_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_CAGE_MODE_CAGE_CHANGE, "GIMP_CAGE_MODE_CAGE_CHANGE", "cage-change" },
+    { GIMP_CAGE_MODE_DEFORM, "GIMP_CAGE_MODE_DEFORM", "deform" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_CAGE_MODE_CAGE_CHANGE, NC_("cage-mode", "Create or adjust the cage"), NULL },
+    { GIMP_CAGE_MODE_DEFORM, NC_("cage-mode", "Deform the cage to deform the image"), NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (G_UNLIKELY (! type))
+    {
+      type = g_enum_register_static ("GimpCageMode", values);
+      gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
+      gimp_type_set_translation_context (type, "cage-mode");
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
+GType
 gimp_channel_ops_get_type (void)
 {
   static const GEnumValue values[] =
diff --git a/libgimpbase/gimpbaseenums.h b/libgimpbase/gimpbaseenums.h
index 3ad47b8..d13dd30 100644
--- a/libgimpbase/gimpbaseenums.h
+++ b/libgimpbase/gimpbaseenums.h
@@ -74,6 +74,16 @@ typedef enum
   GIMP_PATTERN_BUCKET_FILL  /*< desc="Pattern fill"  >*/
 } GimpBucketFillMode;
 
+#define GIMP_TYPE_CAGE_MODE (gimp_cage_mode_get_type ())
+
+GType gimp_cage_mode_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_CAGE_MODE_CAGE_CHANGE,   /*< desc="Create or adjust the cage"            >*/
+  GIMP_CAGE_MODE_DEFORM         /*< desc="Deform the cage to deform the image"  >*/
+} GimpCageMode;
+
 
 #define GIMP_TYPE_CHANNEL_OPS (gimp_channel_ops_get_type ())
 
diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl
index ed5ef50..aa6dbc2 100644
--- a/tools/pdbgen/enums.pl
+++ b/tools/pdbgen/enums.pl
@@ -53,6 +53,13 @@ package Gimp::CodeGen::enums;
 		       GIMP_BG_BUCKET_FILL => '1',
 		       GIMP_PATTERN_BUCKET_FILL => '2' }
 	},
+    GimpCageMode =>
+	{ contig => 1,
+	  header => 'libgimpbase/gimpbaseenums.h',
+	  symbols => [ qw(GIMP_CAGE_MODE_CAGE_CHANGE GIMP_CAGE_MODE_DEFORM) ],
+	  mapping => { GIMP_CAGE_MODE_CAGE_CHANGE => '0',
+		       GIMP_CAGE_MODE_DEFORM => '1' }
+	},
     GimpChannelOps =>
 	{ contig => 1,
 	  header => 'libgimpbase/gimpbaseenums.h',



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