[gegl] gegl, operations: refactor gegl-op.h's enum_value() macro



commit fa80e20aa22cd38fb0ec95e61b8ec2c2879369d4
Author: Michael Natterer <mitch gimp org>
Date:   Sat May 24 17:32:34 2014 +0200

    gegl, operations: refactor gegl-op.h's enum_value() macro
    
    Change it to take 3 parameters:
    
      enum_value (value, nick, name)
    
    - "nick" is an untranslated string for (de)serializing the enum value
      that must contain no spaces.
    - "name" is the human-readable name for the GUI, wrapped in N_().
    
    Change enum registration to translate the name if GETTEXT_PACKAGE is
    defined.

 gegl/gegl-op.h                          |   47 +++++++++++++++++++++---------
 operations/common/alien-map.c           |    4 +-
 operations/common/bump-map.c            |    6 ++--
 operations/common/color-reduction.c     |   12 ++++----
 operations/common/deinterlace.c         |    8 ++--
 operations/common/emboss.c              |    4 +-
 operations/common/fractal-explorer.c    |   33 ++++++++++++++--------
 operations/common/fractal-trace.c       |    4 +-
 operations/common/gaussian-blur.c       |    6 ++--
 operations/common/mosaic.c              |    8 ++--
 operations/common/pixelize.c            |    6 ++--
 operations/common/ripple.c              |    4 +-
 operations/common/shift.c               |    4 +-
 operations/common/texturize-canvas.c    |   12 +++++--
 operations/common/vignette.c            |    6 ++--
 operations/common/warp.c                |   14 ++++----
 operations/external/lcms-from-profile.c |   12 +++++--
 operations/workshop/gaussian-blur-iir.c |   14 ++++----
 operations/workshop/gblur-1d.c          |   41 +++++++++++++++------------
 operations/workshop/ink-simulator.c     |    7 ++--
 20 files changed, 146 insertions(+), 106 deletions(-)
---
diff --git a/gegl/gegl-op.h b/gegl/gegl-op.h
index d34dcd1..69a61c9 100644
--- a/gegl/gegl-op.h
+++ b/gegl/gegl-op.h
@@ -29,7 +29,7 @@
 #error "GEGL_OP_C_FILE not defined"
 #endif
 
-#define gegl_chant_class_init   gegl_chant_class_init_SHOULD_BE_gegl_op_class_init 
+#define gegl_chant_class_init   gegl_chant_class_init_SHOULD_BE_gegl_op_class_init
 
 /* XXX: */
 #ifdef GEGL_CHANT_TYPE_POINT_RENDER
@@ -257,7 +257,7 @@ gegl_module_register (GTypeModule *module)
 #define property_color(name, label, def_val)      ITEM2(name,label,def_val,object)
 
 #define enum_start(enum_name)   typedef enum {
-#define enum_value(value, nick)    value ,
+#define enum_value(value, nick, name)    value ,
 #define enum_end(enum)          } enum ;
 
 #include GEGL_OP_C_FILE
@@ -266,6 +266,12 @@ gegl_module_register (GTypeModule *module)
 #undef enum_value
 #undef enum_end
 
+#ifdef GETTEXT_PACKAGE
+static const gchar *gegl_op_gettext_package G_GNUC_UNUSED = GETTEXT_PACKAGE;
+#else
+static const gchar *gegl_op_gettext_package G_GNUC_UNUSED = NULL;
+#endif
+
 #define enum_start(enum_name)          \
 GType enum_name ## _get_type (void) G_GNUC_CONST; \
 GType enum_name ## _get_type (void)               \
@@ -274,16 +280,29 @@ GType enum_name ## _get_type (void)               \
   if (etype == 0) {                               \
     static const GEnumValue values[] = {
 
-#define enum_value(value, nick) \
-      { value, nick, nick },
-
-#define enum_end(enum)             \
-      { 0, NULL, NULL }                             \
-    };                                              \
-    etype = g_enum_register_static (#enum, values); \
-  }                                                 \
-  return etype;                                     \
-}                                                   \
+#define enum_value(value, nick, name)                \
+      { value, name, nick },
+
+#define enum_end(enum)                                              \
+      { 0, NULL, NULL }                                             \
+    };                                                              \
+    etype = g_enum_register_static (#enum, values);                 \
+    if (gegl_op_gettext_package)                                    \
+      {                 g_printerr ("foo\n");                       \
+        GEnumClass *enum_class = g_type_class_ref (etype);          \
+        gint i;                                                     \
+        for (i = enum_class->minimum; i <= enum_class->maximum; i++)\
+          {                                                         \
+            GEnumValue *value = g_enum_get_value (enum_class, i);   \
+            if (value) { g_printerr ("%s -> %s\n", value->value_name, dgettext (GETTEXT_PACKAGE, 
value->value_name)); \
+              value->value_name =                                   \
+                dgettext (GETTEXT_PACKAGE, value->value_name);      }   \
+          }                                                         \
+        g_type_class_unref (enum_class);                            \
+      }                                                             \
+  }                                                                 \
+  return etype;                                                     \
+}
 
 #include GEGL_OP_C_FILE
 
@@ -304,7 +323,7 @@ GType enum_name ## _get_type (void)               \
 #undef enum_value
 #undef enum_end
 #define enum_start(enum_name)
-#define enum_value(value, nick)
+#define enum_value(value, nick, name)
 #define enum_end(enum)
 
 /* Properties */
@@ -819,7 +838,7 @@ gegl_op_class_intern_init (gpointer klass)
     gegl_param_spec_set_property_key(pspec, key, val);
 #define ui_digits(digits) \
     upspec->ui_digits = digits; \
-    ui_digits_set = TRUE; 
+    ui_digits_set = TRUE;
 
 #define property_double(name, label, def_val) \
     REGISTER_IF_ANY  \
diff --git a/operations/common/alien-map.c b/operations/common/alien-map.c
index 98a53c5..df57c51 100644
--- a/operations/common/alien-map.c
+++ b/operations/common/alien-map.c
@@ -26,8 +26,8 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_alien_map_color_model)
-  enum_value (GEGL_ALIEN_MAP_COLOR_MODEL_RGB, "RGB")
-  enum_value (GEGL_ALIEN_MAP_COLOR_MODEL_HSL, "HSL")
+  enum_value (GEGL_ALIEN_MAP_COLOR_MODEL_RGB, "rgb", N_("RGB"))
+  enum_value (GEGL_ALIEN_MAP_COLOR_MODEL_HSL, "hsl", N_("HSL"))
 enum_end (GeglAlienMapColorModel)
 
 property_enum (color_model, _("Color model"),
diff --git a/operations/common/bump-map.c b/operations/common/bump-map.c
index d8f4898..207a81f 100644
--- a/operations/common/bump-map.c
+++ b/operations/common/bump-map.c
@@ -37,9 +37,9 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_bump_map_type)
-  enum_value (GEGL_BUMP_MAP_TYPE_LINEAR,     "Linear")
-  enum_value (GEGL_BUMP_MAP_TYPE_SPHERICAL,  "Cosinus")
-  enum_value (GEGL_BUMP_MAP_TYPE_SINUSOIDAL, "Sinusoidal")
+  enum_value (GEGL_BUMP_MAP_TYPE_LINEAR,     "linear",     N_("Linear"))
+  enum_value (GEGL_BUMP_MAP_TYPE_SPHERICAL,  "spherical",  N_("Spherical"))
+  enum_value (GEGL_BUMP_MAP_TYPE_SINUSOIDAL, "sinusodial", N_("Sinusoidal"))
 enum_end (GeglBumpMapType)
 
 property_enum (type, _("Type"), GeglBumpMapType, gegl_bump_map_type,
diff --git a/operations/common/color-reduction.c b/operations/common/color-reduction.c
index b7b20e6..b4e572a 100644
--- a/operations/common/color-reduction.c
+++ b/operations/common/color-reduction.c
@@ -24,12 +24,12 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_dither_strategy)
-  enum_value (GEGL_DITHER_NONE, "None")
-  enum_value (GEGL_DITHER_RANDOM, "Random")
-  enum_value (GEGL_DITHER_RESILIENT, "Resilient")
-  enum_value (GEGL_DITHER_RANDOM_COVARIANT, "Random Covariant")
-  enum_value (GEGL_DITHER_BAYER,  "Bayer")
-  enum_value (GEGL_DITHER_FLOYD_STEINBERG, "Floyd-Steinberg")
+  enum_value (GEGL_DITHER_NONE,             "none",             N_("None"))
+  enum_value (GEGL_DITHER_RANDOM,           "random",           N_("Random"))
+  enum_value (GEGL_DITHER_RESILIENT,        "resilient",        N_("Resilient"))
+  enum_value (GEGL_DITHER_RANDOM_COVARIANT, "random-covariant", N_("Random Covariant"))
+  enum_value (GEGL_DITHER_BAYER,            "bayer",            N_("Bayer"))
+  enum_value (GEGL_DITHER_FLOYD_STEINBERG,  "floyd-steinberg",  N_("Floyd-Steinberg"))
 enum_end (GeglDitherStrategy)
 
 property_int  (red_bits, _("Red bits"), 8)
diff --git a/operations/common/deinterlace.c b/operations/common/deinterlace.c
index 550bcfc..7515613 100644
--- a/operations/common/deinterlace.c
+++ b/operations/common/deinterlace.c
@@ -28,13 +28,13 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_deinterlace_keep)
-  enum_value (GEGL_DEINTERLACE_KEEP_EVEN, "Keep even fields")
-  enum_value (GEGL_DEINTERLACE_KEEP_ODD,  "Keep odd fields")
+  enum_value (GEGL_DEINTERLACE_KEEP_EVEN, "even", N_("Keep even fields"))
+  enum_value (GEGL_DEINTERLACE_KEEP_ODD,  "odd",  N_("Keep odd fields"))
 enum_end (GeglDeinterlaceKeep)
 
 enum_start (gegl_orientation)
-  enum_value (GEGL_ORIENTATION_HORIZONTAL, "Horizontal")
-  enum_value (GEGL_ORIENTATION_VERTICAL,   "Vertical")
+  enum_value (GEGL_ORIENTATION_HORIZONTAL, "horizontal", N_("Horizontal"))
+  enum_value (GEGL_ORIENTATION_VERTICAL,   "vertical",   N_("Vertical"))
 enum_end (GeglOrientation)
 
 property_enum (keep, _("Keep"),
diff --git a/operations/common/emboss.c b/operations/common/emboss.c
index 02ccdac..26d251a 100644
--- a/operations/common/emboss.c
+++ b/operations/common/emboss.c
@@ -23,8 +23,8 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_emboss_type)
-  enum_value (GEGL_EMBOSS_TYPE_EMBOSS,  "Emboss")
-  enum_value (GEGL_EMBOSS_TYPE_BUMPMAP, "Bumpmap (preserve original colors)")
+  enum_value (GEGL_EMBOSS_TYPE_EMBOSS,  "emboss",  N_("Emboss"))
+  enum_value (GEGL_EMBOSS_TYPE_BUMPMAP, "bumpmap", N_("Bumpmap (preserve original colors)"))
 enum_end (GeglEmbossType)
 
 property_enum (type, _("Emboss Type"),
diff --git a/operations/common/fractal-explorer.c b/operations/common/fractal-explorer.c
index ff03098..65b708d 100644
--- a/operations/common/fractal-explorer.c
+++ b/operations/common/fractal-explorer.c
@@ -28,15 +28,24 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_fractal_explorer_type)
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_MANDELBROT, "Mandelbrot")
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_JULIA,      "Julia")
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_BARNSLEY_1, "Barnsley 1")
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_BARNSLEY_2, "Barnsley 2")
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_BARNSLEY_3, "Barnsley 3")
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_SPIDER,     "Spider")
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_MAN_O_WAR,  "Man O War")
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_LAMBDA,     "Lambda")
-  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_SIERPINSKI, "Sierpinski")
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_MANDELBROT, "mandelbrot",
+              N_("Mandelbrot"))
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_JULIA,      "julia",
+              N_("Julia"))
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_BARNSLEY_1, "barnsley-1",
+              N_("Barnsley 1"))
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_BARNSLEY_2, "barnsley-2",
+              N_("Barnsley 2"))
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_BARNSLEY_3, "barnsley-3",
+              N_("Barnsley 3"))
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_SPIDER,     "spider",
+              N_("Spider"))
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_MAN_O_WAR,  "man-o-war",
+              N_("Man O War"))
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_LAMBDA,     "lambda",
+              N_("Lambda"))
+  enum_value (GEGL_FRACTAL_EXPLORER_TYPE_SIERPINSKI, "sierpinski",
+              N_("Sierpinski"))
 enum_end (GeglFractalExplorerType)
 
 property_enum (fractaltype, _("Fractal type"),
@@ -79,9 +88,9 @@ property_double (bluestretch, _("Blue stretching factor"), 1.0)
     value_range (0.0, 1.0)
 
 enum_start (gegl_fractal_explorer_mode)
-  enum_value (GEGL_FRACTAL_EXPLORER_MODE_SIN , "Sine")
-  enum_value (GEGL_FRACTAL_EXPLORER_MODE_COS , "Cosinus")
-  enum_value (GEGL_FRACTAL_EXPLORER_MODE_NONE, "None")
+  enum_value (GEGL_FRACTAL_EXPLORER_MODE_SIN , "sine",   N_("Sine"))
+  enum_value (GEGL_FRACTAL_EXPLORER_MODE_COS , "cosine", N_("Cosine"))
+  enum_value (GEGL_FRACTAL_EXPLORER_MODE_NONE, "none",   N_("None"))
 enum_end (GeglFractalExplorerMode)
 
 property_enum (redmode, _("Red application mode"),
diff --git a/operations/common/fractal-trace.c b/operations/common/fractal-trace.c
index 87e690c..777299c 100644
--- a/operations/common/fractal-trace.c
+++ b/operations/common/fractal-trace.c
@@ -23,8 +23,8 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_fractal_trace_type)
-  enum_value (GEGL_FRACTAL_TRACE_TYPE_MANDELBROT, "Mandelbrot")
-  enum_value (GEGL_FRACTAL_TRACE_TYPE_JULIA,      "Julia")
+  enum_value (GEGL_FRACTAL_TRACE_TYPE_MANDELBROT, "mandelbrot", N_("Mandelbrot"))
+  enum_value (GEGL_FRACTAL_TRACE_TYPE_JULIA,      "julia",      N_("Julia"))
 enum_end (GeglFractalTraceType)
 
 property_enum (fractal, _("Fractal type"),
diff --git a/operations/common/gaussian-blur.c b/operations/common/gaussian-blur.c
index 030a6d8..591d118 100644
--- a/operations/common/gaussian-blur.c
+++ b/operations/common/gaussian-blur.c
@@ -28,9 +28,9 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_gaussian_blur_filter)
-  enum_value (GEGL_GAUSSIAN_BLUR_FILTER_AUTO, "Auto")
-  enum_value (GEGL_GAUSSIAN_BLUR_FILTER_FIR,  "FIR")
-  enum_value (GEGL_GAUSSIAN_BLUR_FILTER_IIR,  "IIR")
+  enum_value (GEGL_GAUSSIAN_BLUR_FILTER_AUTO, "auto", N_("Auto"))
+  enum_value (GEGL_GAUSSIAN_BLUR_FILTER_FIR,  "fir",  N_("FIR"))
+  enum_value (GEGL_GAUSSIAN_BLUR_FILTER_IIR,  "iir",  N_("IIR"))
 enum_end (GeglGaussianBlurFilter)
 
 property_double (std_dev_x, _("Size X"), 1.5)
diff --git a/operations/common/mosaic.c b/operations/common/mosaic.c
index f02b26d..3d90578 100644
--- a/operations/common/mosaic.c
+++ b/operations/common/mosaic.c
@@ -29,10 +29,10 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_mosaic_tile)
-  enum_value (GEGL_MOSAIC_TILE_SQUARES,   "Squares")
-  enum_value (GEGL_MOSAIC_TILE_HEXAGONS,  "Hexagons")
-  enum_value (GEGL_MOSAIC_TILE_OCTAGONS,  "Octagons")
-  enum_value (GEGL_MOSAIC_TILE_TRIANGLES, "Triangles")
+  enum_value (GEGL_MOSAIC_TILE_SQUARES,   "squares",   N_("Squares"))
+  enum_value (GEGL_MOSAIC_TILE_HEXAGONS,  "hexagons",  N_("Hexagons"))
+  enum_value (GEGL_MOSAIC_TILE_OCTAGONS,  "octagons",  N_("Octagons"))
+  enum_value (GEGL_MOSAIC_TILE_TRIANGLES, "triangles", N_("Triangles"))
 enum_end (GeglMosaicTile)
 
 property_enum (tile_type, _("Tile geometry"),
diff --git a/operations/common/pixelize.c b/operations/common/pixelize.c
index e2ba1a5..99ef38c 100644
--- a/operations/common/pixelize.c
+++ b/operations/common/pixelize.c
@@ -24,9 +24,9 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_pixelize_norm)
-  enum_value (GEGL_PIXELIZE_NORM_MANHATTAN, "Diamond")
-  enum_value (GEGL_PIXELIZE_NORM_EUCLIDEAN, "Round")
-  enum_value (GEGL_PIXELIZE_NORM_INFINITY,  "Square")
+  enum_value (GEGL_PIXELIZE_NORM_MANHATTAN, "diamond", N_("Diamond"))
+  enum_value (GEGL_PIXELIZE_NORM_EUCLIDEAN, "round",   N_("Round"))
+  enum_value (GEGL_PIXELIZE_NORM_INFINITY,  "square",  N_("Square"))
 enum_end (GeglPixelizeNorm)
 
 property_enum   (norm, _("Shape"),
diff --git a/operations/common/ripple.c b/operations/common/ripple.c
index 6ca1709..29a6d45 100644
--- a/operations/common/ripple.c
+++ b/operations/common/ripple.c
@@ -25,8 +25,8 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_ripple_wave_type)
-  enum_value (GEGL_RIPPLE_WAVE_TYPE_SINE,     "Sine")
-  enum_value (GEGL_RIPPLE_WAVE_TYPE_SAWTOOTH, "Sawtooth")
+  enum_value (GEGL_RIPPLE_WAVE_TYPE_SINE,     "sine",     N_("Sine"))
+  enum_value (GEGL_RIPPLE_WAVE_TYPE_SAWTOOTH, "sawtooth", N_("Sawtooth"))
 enum_end (GeglRippleWaveType)
 
 property_double (amplitude, _("Amplitude"), 25.0)
diff --git a/operations/common/shift.c b/operations/common/shift.c
index e23f1f2..02217d3 100644
--- a/operations/common/shift.c
+++ b/operations/common/shift.c
@@ -24,8 +24,8 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_shift_direction)
-  enum_value (GEGL_SHIFT_DIRECTION_HORIZONTAL, "Horizontal")
-  enum_value (GEGL_SHIFT_DIRECTION_VERTICAL,   "Vertical")
+  enum_value (GEGL_SHIFT_DIRECTION_HORIZONTAL, "horizontal", N_("Horizontal"))
+  enum_value (GEGL_SHIFT_DIRECTION_VERTICAL,   "vertical",   N_("Vertical"))
 enum_end (GeglShiftDirection)
 
 property_int  (shift, _("Shift"), 5)
diff --git a/operations/common/texturize-canvas.c b/operations/common/texturize-canvas.c
index 3093b84..0860b8d 100644
--- a/operations/common/texturize-canvas.c
+++ b/operations/common/texturize-canvas.c
@@ -25,10 +25,14 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_texturize_canvas_direction)
-  enum_value (GEGL_TEXTURIZE_CANVAS_DIRECTION_TOP_RIGHT,    "Top-right")
-  enum_value (GEGL_TEXTURIZE_CANVAS_DIRECTION_TOP_LEFT,     "Top-left")
-  enum_value (GEGL_TEXTURIZE_CANVAS_DIRECTION_BOTTOM_LEFT,  "Bottom-left")
-  enum_value (GEGL_TEXTURIZE_CANVAS_DIRECTION_BOTTOM_RIGHT, "Bottom-right")
+  enum_value (GEGL_TEXTURIZE_CANVAS_DIRECTION_TOP_RIGHT,    "top-right",
+              N_("Top-right"))
+  enum_value (GEGL_TEXTURIZE_CANVAS_DIRECTION_TOP_LEFT,     "top-left",
+              N_("Top-left"))
+  enum_value (GEGL_TEXTURIZE_CANVAS_DIRECTION_BOTTOM_LEFT,  "bottom-left",
+              N_("Bottom-left"))
+  enum_value (GEGL_TEXTURIZE_CANVAS_DIRECTION_BOTTOM_RIGHT, "bottom-right",
+              N_("Bottom-right"))
 enum_end (GeglTexturizeCanvasDirection)
 
 property_enum (direction, _("Direction"),
diff --git a/operations/common/vignette.c b/operations/common/vignette.c
index ab48459..efc0bb1 100644
--- a/operations/common/vignette.c
+++ b/operations/common/vignette.c
@@ -22,9 +22,9 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_vignette_shape)
-  enum_value (GEGL_VIGNETTE_SHAPE_CIRCLE,  "Circle")
-  enum_value (GEGL_VIGNETTE_SHAPE_SQUARE,  "Square")
-  enum_value (GEGL_VIGNETTE_SHAPE_DIAMOND, "Diamond")
+  enum_value (GEGL_VIGNETTE_SHAPE_CIRCLE,  "circle",  N_("Circle"))
+  enum_value (GEGL_VIGNETTE_SHAPE_SQUARE,  "square",  N_("Square"))
+  enum_value (GEGL_VIGNETTE_SHAPE_DIAMOND, "diamond", N_("Diamond"))
 enum_end (GeglVignetteShape)
 
 property_enum (shape, _("Vignette shape"),
diff --git a/operations/common/warp.c b/operations/common/warp.c
index c01c861..90fde6a 100644
--- a/operations/common/warp.c
+++ b/operations/common/warp.c
@@ -23,13 +23,13 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_warp_behavior)
-  enum_value (GEGL_WARP_BEHAVIOR_MOVE,      "Move pixels")
-  enum_value (GEGL_WARP_BEHAVIOR_GROW,      "Grow area")
-  enum_value (GEGL_WARP_BEHAVIOR_SHRINK,    "Shrink area")
-  enum_value (GEGL_WARP_BEHAVIOR_SWIRL_CW,  "Swirl clockwise")
-  enum_value (GEGL_WARP_BEHAVIOR_SWIRL_CCW, "Swirl counter-clockwise")
-  enum_value (GEGL_WARP_BEHAVIOR_ERASE,     "Erase warping")
-  enum_value (GEGL_WARP_BEHAVIOR_SMOOTH,    "Smooth warping")
+  enum_value (GEGL_WARP_BEHAVIOR_MOVE,      "move",      N_("Move pixels"))
+  enum_value (GEGL_WARP_BEHAVIOR_GROW,      "grow",      N_("Grow area"))
+  enum_value (GEGL_WARP_BEHAVIOR_SHRINK,    "shrink",    N_("Shrink area"))
+  enum_value (GEGL_WARP_BEHAVIOR_SWIRL_CW,  "swirl-cw",  N_("Swirl clockwise"))
+  enum_value (GEGL_WARP_BEHAVIOR_SWIRL_CCW, "swirl-ccw", N_("Swirl counter-clockwise"))
+  enum_value (GEGL_WARP_BEHAVIOR_ERASE,     "erase",     N_("Erase warping"))
+  enum_value (GEGL_WARP_BEHAVIOR_SMOOTH,    "smooth",    N_("Smooth warping"))
 enum_end (GeglWarpBehavior)
 
 property_double (strength, _("Strength"), 50)
diff --git a/operations/external/lcms-from-profile.c b/operations/external/lcms-from-profile.c
index 28a76c7..f97b4c1 100644
--- a/operations/external/lcms-from-profile.c
+++ b/operations/external/lcms-from-profile.c
@@ -27,10 +27,14 @@ property_pointer (src_profile, _("Source Profile"),
 
 /* These are positioned so their values match up with the LCMS enum */
 enum_start (gegl_rendering_intent)
-  enum_value (GEGL_RENDERING_INTENT_PERCEPTUAL,            "Perceptual")
-  enum_value (GEGL_RENDERING_INTENT_RELATIVE_COLORIMETRIC, "Relative Colorimetric")
-  enum_value (GEGL_RENDERING_INTENT_SATURATION,            "Saturation")
-  enum_value (GEGL_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC, "Absolute Colorimetric")
+  enum_value (GEGL_RENDERING_INTENT_PERCEPTUAL,
+              "perceptual",            N_("Perceptual"))
+  enum_value (GEGL_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
+              "relative-colorimetric", N_("Relative Colorimetric"))
+  enum_value (GEGL_RENDERING_INTENT_SATURATION,
+              "saturation",            N_("Saturation"))
+  enum_value (GEGL_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC,
+              "absolute-colorimetric", N_("Absolute Colorimetric"))
 /* TODO: Add the K_ONLY and K_PLANE intents */
 enum_end (GeglRenderingIntent)
 
diff --git a/operations/workshop/gaussian-blur-iir.c b/operations/workshop/gaussian-blur-iir.c
index f8b2425..baf8217 100644
--- a/operations/workshop/gaussian-blur-iir.c
+++ b/operations/workshop/gaussian-blur-iir.c
@@ -22,16 +22,16 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_gaussian_blur_filter2)
-   enum_value (GEGL_GAUSSIAN_BLUR_FILTER2_AUTO, "Auto")
-   enum_value (GEGL_GAUSSIAN_BLUR_FILTER2_FIR,  "FIR")
-   enum_value (GEGL_GAUSSIAN_BLUR_FILTER2_IIR,  "IIR")
+   enum_value (GEGL_GAUSSIAN_BLUR_FILTER2_AUTO, "auto", N_("Auto"))
+   enum_value (GEGL_GAUSSIAN_BLUR_FILTER2_FIR,  "fir",  N_("FIR"))
+   enum_value (GEGL_GAUSSIAN_BLUR_FILTER2_IIR,  "iir",  N_("IIR"))
 enum_end (GeglGaussianBlurFilter2)
 
 enum_start (gegl_gaussian_blur_policy)
-   enum_value (GEGL_GAUSSIAN_BLUR_ABYSS_NONE,  "None")
-   enum_value (GEGL_GAUSSIAN_BLUR_ABYSS_CLAMP, "Clamp")
-   enum_value (GEGL_GAUSSIAN_BLUR_ABYSS_BLACK, "Black")
-   enum_value (GEGL_GAUSSIAN_BLUR_ABYSS_WHITE, "White")
+   enum_value (GEGL_GAUSSIAN_BLUR_ABYSS_NONE,  "none",   N_("None"))
+   enum_value (GEGL_GAUSSIAN_BLUR_ABYSS_CLAMP, "clamp",  N_("Clamp"))
+   enum_value (GEGL_GAUSSIAN_BLUR_ABYSS_BLACK, "black",  N_("Black"))
+   enum_value (GEGL_GAUSSIAN_BLUR_ABYSS_WHITE, "white",  N_("White"))
 enum_end (GeglGaussianBlurPolicy)
 
 
diff --git a/operations/workshop/gblur-1d.c b/operations/workshop/gblur-1d.c
index c2a7048..9e62f99 100644
--- a/operations/workshop/gblur-1d.c
+++ b/operations/workshop/gblur-1d.c
@@ -28,21 +28,21 @@
 #ifdef GEGL_PROPERTIES
 
 enum_start (gegl_gblur_1d_policy)
-   enum_value (GEGL_GBLUR_1D_ABYSS_NONE,  "None")
-   enum_value (GEGL_GBLUR_1D_ABYSS_CLAMP, "Clamp")
-   enum_value (GEGL_GBLUR_1D_ABYSS_BLACK, "Black")
-   enum_value (GEGL_GBLUR_1D_ABYSS_WHITE, "White")
+   enum_value (GEGL_GBLUR_1D_ABYSS_NONE,  "none",  N_("None"))
+   enum_value (GEGL_GBLUR_1D_ABYSS_CLAMP, "clamp", N_("Clamp"))
+   enum_value (GEGL_GBLUR_1D_ABYSS_BLACK, "black", N_("Black"))
+   enum_value (GEGL_GBLUR_1D_ABYSS_WHITE, "white", N_("White"))
 enum_end (GeglGblur1dPolicy)
 
 enum_start (gegl_gblur_1d_orientation)
-  enum_value (GEGL_GBLUR_1D_HORIZONTAL, "Horizontal")
-  enum_value (GEGL_GBLUR_1D_VERTICAL,   "Vertical")
+  enum_value (GEGL_GBLUR_1D_HORIZONTAL, "horizontal", N_("Horizontal"))
+  enum_value (GEGL_GBLUR_1D_VERTICAL,   "vertical",   N_("Vertical"))
   enum_end (GeglGblur1dOrientation)
 
 enum_start (gegl_gblur_1d_filter)
-  enum_value (GEGL_GBLUR_1D_AUTO, "Auto")
-  enum_value (GEGL_GBLUR_1D_FIR,  "FIR")
-  enum_value (GEGL_GBLUR_1D_IIR,  "IIR")
+  enum_value (GEGL_GBLUR_1D_AUTO, "auto", N_("Auto"))
+  enum_value (GEGL_GBLUR_1D_FIR,  "fir",  N_("FIR"))
+  enum_value (GEGL_GBLUR_1D_IIR,  "iir",  N_("IIR"))
 enum_end (GeglGblur1dFilter)
 
 property_double (std_dev, _("Size"), 1.5)
@@ -50,19 +50,24 @@ property_double (std_dev, _("Size"), 1.5)
   value_range   (0.0, 1500.0)
   ui_range      (0.0, 100.0)
   ui_gamma      (3.0)
-property_enum      (orientation, _("Orientation"),
-                      GeglGblur1dOrientation, gegl_gblur_1d_orientation,
-                      GEGL_GBLUR_1D_HORIZONTAL)
+
+property_enum (orientation, _("Orientation"),
+               GeglGblur1dOrientation, gegl_gblur_1d_orientation,
+               GEGL_GBLUR_1D_HORIZONTAL)
   description (_("The orientation of the blur - hor/ver"))
-property_enum      (filter, _("Filter"),
-                      GeglGblur1dFilter, gegl_gblur_1d_filter,
-                      GEGL_GBLUR_1D_AUTO)
+
+property_enum (filter, _("Filter"),
+               GeglGblur1dFilter, gegl_gblur_1d_filter,
+               GEGL_GBLUR_1D_AUTO)
   description (_("How the gaussian kernel is discretized"))
-property_enum      (abyss_policy, _("Abyss policy"), GeglGblur1dPolicy,
-                      gegl_gblur_1d_policy, GEGL_GBLUR_1D_ABYSS_NONE)
+
+property_enum (abyss_policy, _("Abyss policy"), GeglGblur1dPolicy,
+               gegl_gblur_1d_policy, GEGL_GBLUR_1D_ABYSS_NONE)
   description (_("How image edges are handled"))
-property_boolean   (clip_extent, _("Clip to the input extent"), TRUE)
+
+property_boolean (clip_extent, _("Clip to the input extent"), TRUE)
   description (_("Should the output extent be clipped to the input extent"))
+
 #else
 
 #define GEGL_OP_FILTER
diff --git a/operations/workshop/ink-simulator.c b/operations/workshop/ink-simulator.c
index 61384a6..3a601e7 100644
--- a/operations/workshop/ink-simulator.c
+++ b/operations/workshop/ink-simulator.c
@@ -18,7 +18,6 @@
 
 #include "config.h"
 #include <glib/gi18n-lib.h>
-#include <stdio.h>
 
 //#define USE_UI
 
@@ -34,9 +33,9 @@
 "\n"\
 
 enum_start (ink_sim_mode)
-  enum_value (GEGL_SSIM_PROOF, "proof")
-  enum_value (GEGL_SSIM_SEPARATE, "separate")
-  enum_value (GEGL_SSIM_SEPARATE_PROOF, "separate-proof")
+  enum_value (GEGL_SSIM_PROOF,          "proof",          N_("Proof"))
+  enum_value (GEGL_SSIM_SEPARATE,       "separate",       N_("Separate"))
+  enum_value (GEGL_SSIM_SEPARATE_PROOF, "separate-proof", N_("Separate and proof"))
 enum_end (GeglInkSimMode)
 
 property_string (config, _("Ink configuration"), DEFAULT_CONFIG)


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