[gimp] app: move enum GimpHandleType to display-enums.h



commit 69da253e51cddd1b940f34029edcee5a34bf75c7
Author: Michael Natterer <mitch gimp org>
Date:   Mon Sep 20 19:26:34 2010 +0200

    app: move enum GimpHandleType to display-enums.h

 app/display/display-enums.c |   35 +++++++++++++++++++++++++++++++++++
 app/display/display-enums.h |   14 ++++++++++++++
 app/tools/gimpdrawtool.h    |   10 ----------
 3 files changed, 49 insertions(+), 10 deletions(-)
---
diff --git a/app/display/display-enums.c b/app/display/display-enums.c
index 0db113e..0130d4d 100644
--- a/app/display/display-enums.c
+++ b/app/display/display-enums.c
@@ -40,6 +40,41 @@ gimp_cursor_precision_get_type (void)
 }
 
 GType
+gimp_handle_type_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_HANDLE_SQUARE, "GIMP_HANDLE_SQUARE", "square" },
+    { GIMP_HANDLE_FILLED_SQUARE, "GIMP_HANDLE_FILLED_SQUARE", "filled-square" },
+    { GIMP_HANDLE_CIRCLE, "GIMP_HANDLE_CIRCLE", "circle" },
+    { GIMP_HANDLE_FILLED_CIRCLE, "GIMP_HANDLE_FILLED_CIRCLE", "filled-circle" },
+    { GIMP_HANDLE_CROSS, "GIMP_HANDLE_CROSS", "cross" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_HANDLE_SQUARE, "GIMP_HANDLE_SQUARE", NULL },
+    { GIMP_HANDLE_FILLED_SQUARE, "GIMP_HANDLE_FILLED_SQUARE", NULL },
+    { GIMP_HANDLE_CIRCLE, "GIMP_HANDLE_CIRCLE", NULL },
+    { GIMP_HANDLE_FILLED_CIRCLE, "GIMP_HANDLE_FILLED_CIRCLE", NULL },
+    { GIMP_HANDLE_CROSS, "GIMP_HANDLE_CROSS", NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (G_UNLIKELY (! type))
+    {
+      type = g_enum_register_static ("GimpHandleType", values);
+      gimp_type_set_translation_context (type, "handle-type");
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
+GType
 gimp_zoom_focus_get_type (void)
 {
   static const GEnumValue values[] =
diff --git a/app/display/display-enums.h b/app/display/display-enums.h
index 28a1ae1..33f851b 100644
--- a/app/display/display-enums.h
+++ b/app/display/display-enums.h
@@ -31,6 +31,20 @@ typedef enum
 } GimpCursorPrecision;
 
 
+#define GIMP_TYPE_HANDLE_TYPE (gimp_handle_type_get_type ())
+
+GType gimp_handle_type_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_HANDLE_SQUARE,
+  GIMP_HANDLE_FILLED_SQUARE,
+  GIMP_HANDLE_CIRCLE,
+  GIMP_HANDLE_FILLED_CIRCLE,
+  GIMP_HANDLE_CROSS
+} GimpHandleType;
+
+
 #define GIMP_TYPE_ZOOM_FOCUS (gimp_zoom_focus_get_type ())
 
 GType gimp_zoom_focus_get_type (void) G_GNUC_CONST;
diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h
index b1d2df5..2ff4067 100644
--- a/app/tools/gimpdrawtool.h
+++ b/app/tools/gimpdrawtool.h
@@ -22,16 +22,6 @@
 #include "gimptool.h"
 
 
-typedef enum
-{
-  GIMP_HANDLE_SQUARE,
-  GIMP_HANDLE_FILLED_SQUARE,
-  GIMP_HANDLE_CIRCLE,
-  GIMP_HANDLE_FILLED_CIRCLE,
-  GIMP_HANDLE_CROSS
-} GimpHandleType;
-
-
 #define GIMP_TYPE_DRAW_TOOL            (gimp_draw_tool_get_type ())
 #define GIMP_DRAW_TOOL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DRAW_TOOL, GimpDrawTool))
 #define GIMP_DRAW_TOOL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DRAW_TOOL, GimpDrawToolClass))



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