[gimp] app: remove enum GimpTransformGridType



commit 43788feb50e1e241e7ad8bf1040929ce0247fd5a
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jul 24 18:01:21 2011 +0200

    app: remove enum GimpTransformGridType
    
    and use the two new values from GimpGuidesType instead.

 app/tools/gimptransformoptions.c |    8 +++++---
 app/tools/gimptransformoptions.h |    2 +-
 app/tools/gimptransformtool.c    |    8 ++++----
 app/tools/tools-enums.c          |   29 -----------------------------
 app/tools/tools-enums.h          |   11 -----------
 5 files changed, 10 insertions(+), 48 deletions(-)
---
diff --git a/app/tools/gimptransformoptions.c b/app/tools/gimptransformoptions.c
index d303c7e..86ac948 100644
--- a/app/tools/gimptransformoptions.c
+++ b/app/tools/gimptransformoptions.c
@@ -129,8 +129,8 @@ gimp_transform_options_class_init (GimpTransformOptionsClass *klass)
   GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_GRID_TYPE,
                                  "grid-type",
                                   N_("How to define grid settings"),
-                                 GIMP_TYPE_TRANSFORM_GRID_TYPE,
-                                 GIMP_TRANSFORM_GRID_TYPE_N_LINES,
+                                 GIMP_TYPE_GUIDES_TYPE,
+                                 GIMP_GUIDES_N_LINES,
                                  GIMP_PARAM_STATIC_STRINGS);
   GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_GRID_SIZE,
                                 "grid-size",
@@ -334,7 +334,9 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
   gimp_transform_options_preview_opacity_notify (options, NULL, scale);
 
   /*  the grid type menu  */
-  combo = gimp_prop_enum_combo_box_new (config, "grid-type", 0, 0);
+  combo = gimp_prop_enum_combo_box_new (config, "grid-type",
+                                        GIMP_GUIDES_N_LINES,
+                                        GIMP_GUIDES_SPACING);
   gtk_box_pack_start (GTK_BOX (preview_box), combo, FALSE, FALSE, 0);
   gtk_widget_show (combo);
 
diff --git a/app/tools/gimptransformoptions.h b/app/tools/gimptransformoptions.h
index b04251e..d1d9c97 100644
--- a/app/tools/gimptransformoptions.h
+++ b/app/tools/gimptransformoptions.h
@@ -44,7 +44,7 @@ struct _GimpTransformOptions
   gboolean                  clip;
   GimpTransformPreviewType  preview_type;
   gdouble                   preview_opacity;
-  GimpTransformGridType     grid_type;
+  GimpGuidesType            grid_type;
   gint                      grid_size;
   gboolean                  constrain;
 };
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index 59437d6..544454f 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -1350,8 +1350,8 @@ gimp_transform_tool_grid_recalc (GimpTransformTool *tr_tool)
 
   switch (options->grid_type)
     {
-    case GIMP_TRANSFORM_GRID_TYPE_N_LINES:
-    case GIMP_TRANSFORM_GRID_TYPE_SPACING:
+    case GIMP_GUIDES_N_LINES:
+    case GIMP_GUIDES_SPACING:
       {
         gint     i, gci;
         gdouble *coords;
@@ -1360,7 +1360,7 @@ gimp_transform_tool_grid_recalc (GimpTransformTool *tr_tool)
         width  = MAX (1, tr_tool->x2 - tr_tool->x1);
         height = MAX (1, tr_tool->y2 - tr_tool->y1);
 
-        if (options->grid_type == GIMP_TRANSFORM_GRID_TYPE_N_LINES)
+        if (options->grid_type == GIMP_GUIDES_N_LINES)
           {
             if (width <= height)
               {
@@ -1373,7 +1373,7 @@ gimp_transform_tool_grid_recalc (GimpTransformTool *tr_tool)
                 tr_tool->ngx = tr_tool->ngy * MAX (1, width / height);
               }
           }
-        else /* GIMP_TRANSFORM_GRID_TYPE_SPACING */
+        else /* GIMP_GUIDES_SPACING */
           {
             gint grid_size = MAX (2, options->grid_size);
 
diff --git a/app/tools/tools-enums.c b/app/tools/tools-enums.c
index 990b4f5..754eaad 100644
--- a/app/tools/tools-enums.c
+++ b/app/tools/tools-enums.c
@@ -262,35 +262,6 @@ gimp_transform_preview_type_get_type (void)
 }
 
 GType
-gimp_transform_grid_type_get_type (void)
-{
-  static const GEnumValue values[] =
-  {
-    { GIMP_TRANSFORM_GRID_TYPE_N_LINES, "GIMP_TRANSFORM_GRID_TYPE_N_LINES", "n-lines" },
-    { GIMP_TRANSFORM_GRID_TYPE_SPACING, "GIMP_TRANSFORM_GRID_TYPE_SPACING", "spacing" },
-    { 0, NULL, NULL }
-  };
-
-  static const GimpEnumDesc descs[] =
-  {
-    { GIMP_TRANSFORM_GRID_TYPE_N_LINES, NC_("transform-grid-type", "Number of grid lines"), NULL },
-    { GIMP_TRANSFORM_GRID_TYPE_SPACING, NC_("transform-grid-type", "Grid line spacing"), NULL },
-    { 0, NULL, NULL }
-  };
-
-  static GType type = 0;
-
-  if (G_UNLIKELY (! type))
-    {
-      type = g_enum_register_static ("GimpTransformGridType", values);
-      gimp_type_set_translation_context (type, "transform-grid-type");
-      gimp_enum_set_value_descriptions (type, descs);
-    }
-
-  return type;
-}
-
-GType
 gimp_vector_mode_get_type (void)
 {
   static const GEnumValue values[] =
diff --git a/app/tools/tools-enums.h b/app/tools/tools-enums.h
index b3a3318..b6cdb6e 100644
--- a/app/tools/tools-enums.h
+++ b/app/tools/tools-enums.h
@@ -120,17 +120,6 @@ typedef enum
 } GimpTransformPreviewType;
 
 
-#define GIMP_TYPE_TRANSFORM_GRID_TYPE (gimp_transform_grid_type_get_type ())
-
-GType gimp_transform_grid_type_get_type (void) G_GNUC_CONST;
-
-typedef enum
-{
-  GIMP_TRANSFORM_GRID_TYPE_N_LINES,  /*< desc="Number of grid lines" >*/
-  GIMP_TRANSFORM_GRID_TYPE_SPACING   /*< desc="Grid line spacing"    >*/
-} GimpTransformGridType;
-
-
 #define GIMP_TYPE_VECTOR_MODE (gimp_vector_mode_get_type ())
 
 GType gimp_vector_mode_get_type (void) G_GNUC_CONST;



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