[gegl] Add gamma parameter to integer ui paramspecs



commit 09dc3a8aa4b026204be1cf182e94a00ba3daed14
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Fri Mar 30 20:21:00 2012 +0100

    Add gamma parameter to integer ui paramspecs

 gegl/gegl-chant.h                     |   16 ++++++++--------
 gegl/property-types/gegl-paramspecs.c |    3 +++
 gegl/property-types/gegl-paramspecs.h |    2 ++
 3 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/gegl/gegl-chant.h b/gegl/gegl-chant.h
index 2ce91f7..9fbcc9f 100644
--- a/gegl/gegl-chant.h
+++ b/gegl/gegl-chant.h
@@ -343,7 +343,7 @@ struct _GeglChantO
                         * do not create an empty struct if there are no chanted properties.
                         */
 #define gegl_chant_int(name, nick, min, max, def, blurb)                        gint               name;
-#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, blurb)     gint               name;
+#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)     gint               name;
 #define gegl_chant_double(name, nick, min, max, def, blurb)                     gdouble            name;
 #define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) gdouble   name;
 #define gegl_chant_boolean(name, nick, def, blurb)                              gboolean           name;
@@ -382,7 +382,7 @@ enum
 {
   PROP_0,
 #define gegl_chant_int(name, nick, min, max, def, blurb)                        PROP_##name,
-#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, blurb)     PROP_##name,
+#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)     PROP_##name,
 #define gegl_chant_double(name, nick, min, max, def, blurb)                     PROP_##name,
 #define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) PROP_##name,
 #define gegl_chant_boolean(name, nick, def, blurb)                              PROP_##name,
@@ -431,7 +431,7 @@ get_property (GObject      *gobject,
     case PROP_##name:                                         \
       g_value_set_int (value, properties->name);              \
       break;
-#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, blurb) \
+#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) \
     case PROP_##name:                                         \
       g_value_set_int (value, properties->name);              \
       break;
@@ -524,7 +524,7 @@ set_property (GObject      *gobject,
     case PROP_##name:                                                 \
       properties->name = g_value_get_int (value);                     \
       break;
-#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, blurb) \
+#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) \
     case PROP_##name:                                                 \
       properties->name = g_value_get_int (value);                     \
       break;
@@ -631,7 +631,7 @@ static void gegl_chant_destroy_notify (gpointer data)
   GeglChantO *properties = GEGL_CHANT_PROPERTIES (data);
 
 #define gegl_chant_int(name, nick, min, max, def, blurb)
-#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, blurb)
+#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)
 #define gegl_chant_double(name, nick, min, max, def, blurb)
 #define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)
 #define gegl_chant_boolean(name, nick, def, blurb)
@@ -715,7 +715,7 @@ gegl_chant_constructor (GType                  type,
   properties = GEGL_CHANT_PROPERTIES (obj);
 
 #define gegl_chant_int(name, nick, min, max, def, blurb)
-#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, blurb)
+#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)
 #define gegl_chant_double(name, nick, min, max, def, blurb)
 #define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)
 #define gegl_chant_boolean(name, nick, def, blurb)
@@ -770,10 +770,10 @@ gegl_chant_class_intern_init (gpointer klass)
                                                      G_PARAM_READWRITE |     \
                                                      G_PARAM_CONSTRUCT |     \
                                                      GEGL_PARAM_PAD_INPUT)));
-#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, blurb)  \
+#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)  \
   g_object_class_install_property (object_class, PROP_##name,                \
                                    gegl_param_spec_int (#name, nick, blurb,     \
-                                                     min, max, def, ui_min, ui_max, \
+                                                     min, max, def, ui_min, ui_max, ui_gamma, \
                                                      (GParamFlags) (         \
                                                      G_PARAM_READWRITE |     \
                                                      G_PARAM_CONSTRUCT |     \
diff --git a/gegl/property-types/gegl-paramspecs.c b/gegl/property-types/gegl-paramspecs.c
index 4d513f7..23e016c 100644
--- a/gegl/property-types/gegl-paramspecs.c
+++ b/gegl/property-types/gegl-paramspecs.c
@@ -136,6 +136,7 @@ gegl_param_int_init (GParamSpec *pspec)
   GeglParamSpecInt *gdpspec = GEGL_PARAM_SPEC_INT (pspec);
   gdpspec->ui_minimum = dpspec->minimum;
   gdpspec->ui_maximum = dpspec->maximum;
+  gdpspec->ui_gamma = 1.0;
 }
 
 GParamSpec *
@@ -147,6 +148,7 @@ gegl_param_spec_int (const gchar *name,
                      gint         default_value,
                      gint         ui_minimum,
                      gint         ui_maximum,
+                     gdouble      ui_gamma,
                      GParamFlags  flags)
 {
   GeglParamSpecInt *pspec;
@@ -162,6 +164,7 @@ gegl_param_spec_int (const gchar *name,
   ispec->default_value = default_value;
   pspec->ui_minimum = ui_minimum;
   pspec->ui_maximum = ui_maximum;
+  pspec->ui_gamma = ui_gamma;
 
   return G_PARAM_SPEC (pspec);
 }
diff --git a/gegl/property-types/gegl-paramspecs.h b/gegl/property-types/gegl-paramspecs.h
index 03ffc25..57a0705 100644
--- a/gegl/property-types/gegl-paramspecs.h
+++ b/gegl/property-types/gegl-paramspecs.h
@@ -89,6 +89,7 @@ struct _GeglParamSpecInt
   GParamSpecInt parent_instance;
   gint          ui_minimum; /* reasonable range to present to user */
   gint          ui_maximum;
+  gdouble       ui_gamma;
 };
 
 GType        gegl_param_int_get_type (void) G_GNUC_CONST;
@@ -101,6 +102,7 @@ GParamSpec * gegl_param_spec_int (const gchar *name,
                                   gint         default_value,
                                   gint         ui_minimum,
                                   gint         ui_maximum,
+                                  gdouble      ui_gamma,
                                   GParamFlags  flags);
 
 



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