[gegl] gegl-op.h: get rid of varargs property meta-data



commit 00c9ce558d9faba7b8e5fac34e4eb3104f66084a
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue May 20 21:44:10 2014 +0200

    gegl-op.h: get rid of varargs property meta-data

 gegl/gegl-op.h                        |  326 -----------------
 gegl/property-types/gegl-paramspecs.c |  619 ---------------------------------
 gegl/property-types/gegl-paramspecs.h |   94 -----
 3 files changed, 0 insertions(+), 1039 deletions(-)
---
diff --git a/gegl/gegl-op.h b/gegl/gegl-op.h
index 9bd9d84..8e405f5 100644
--- a/gegl/gegl-op.h
+++ b/gegl/gegl-op.h
@@ -255,19 +255,6 @@ gegl_module_register (GTypeModule *module)
 #define property_curve(name, label, def_val)      ITEM2(name,label,def_val,object)
 #define property_path(name, label, def_val)       ITEM2(name,label,def_val,object)
 #define property_color(name, label, def_val)      ITEM2(name,label,def_val,object)
-#define gegl_property_double(name, label, ...)    ITEM(name,label,def_val,double)
-#define gegl_property_string(name, label, ...)    ITEM(name,label,def_val,string)
-#define gegl_property_file_path(name, label, ...) ITEM(name,label,def_val,string)
-#define gegl_property_int(name, label, ...)       ITEM(name,label,def_val,int)
-#define gegl_property_boolean(name, label, ...)   ITEM(name,label,def_val,boolean)
-#define gegl_property_object(name, label, ...)    ITEM2(name,label,def_val,object)
-#define gegl_property_pointer(name, label, ...)   ITEM(name,label,def_val,pointer)
-#define gegl_property_format(name, label, ...)    ITEM(name,label,def_val,pointer)
-#define gegl_property_color(name, label, ...)     ITEM(name,label,def_val,object)
-#define gegl_property_curve(name, label, ...)     ITEM2(name,label,def_val,object)
-#define gegl_property_path(name, label, ...)      ITEM2(name,label,def_val,object)
-#define gegl_property_seed(name, label, rand_name, ...)   ITEM(name,label,def_val,int)
-#define gegl_property_enum(name, label, enm, enum_name, ...)  ITEM(name,label,def_val,enum)
 
 #define enum_start(enum_name)   typedef enum {
 #define enum_value(value, nick)    value ,
@@ -313,19 +300,6 @@ GType enum_name ## _get_type (void)               \
 #undef property_curve
 #undef property_color
 #undef property_path
-#undef gegl_property_double
-#undef gegl_property_string
-#undef gegl_property_file_path
-#undef gegl_property_boolean
-#undef gegl_property_int
-#undef gegl_property_enum
-#undef gegl_property_object
-#undef gegl_property_pointer
-#undef gegl_property_format
-#undef gegl_property_color
-#undef gegl_property_curve
-#undef gegl_property_seed
-#undef gegl_property_path
 #undef enum_start
 #undef enum_value
 #undef enum_end
@@ -353,22 +327,6 @@ struct _GeglProperties
 #define property_seed(name, label, rand_name)          gint        name;\
                                                        GeglRandom *rand_name;
 
-#define gegl_property_double(name, label, ...)         gdouble     name;
-#define gegl_property_boolean(name, label, ...)        gboolean    name;
-#define gegl_property_int(name, label, ...)            gint        name;
-#define gegl_property_string(name, label, ...)         gchar      *name;
-#define gegl_property_file_path(name, label, ...)      gchar      *name;
-#define gegl_property_enum(name, label, enum, enum_name, ...) enum  name;
-#define gegl_property_object(name, label, ...)         GObject    *name;
-#define gegl_property_pointer(name, label, ...)        gpointer    name;
-#define gegl_property_format(name, label, ...)         gpointer    name;
-#define gegl_property_color(name, label, ...)          GeglColor  *name;
-#define gegl_property_curve(name, label, ...)          GeglCurve  *name;
-#define gegl_property_seed(name, label, rand_name, ...)gint        name;\
-                                                       GeglRandom *rand_name;
-#define gegl_property_path(name, label, ...)                  GeglPath   *name;\
-                                                       gulong path_changed_handler;
-
 #include GEGL_OP_C_FILE
 
 #undef property_double
@@ -384,19 +342,6 @@ struct _GeglProperties
 #undef property_curve
 #undef property_color
 #undef property_path
-#undef gegl_property_double
-#undef gegl_property_boolean
-#undef gegl_property_int
-#undef gegl_property_string
-#undef gegl_property_file_path
-#undef gegl_property_enum
-#undef gegl_property_object
-#undef gegl_property_pointer
-#undef gegl_property_format
-#undef gegl_property_color
-#undef gegl_property_curve
-#undef gegl_property_seed
-#undef gegl_property_path
 };
 
 #define GEGL_OP_OPERATION(obj) ((Operation*)(obj))
@@ -423,20 +368,6 @@ enum
 #define property_enum(name, label, enm, enum_name, def_val) ITEM(name,label,def_val,enum)
 #define property_seed(name, label, rand_name)     ITEM(name,label,def_val,int)
 
-#define gegl_property_double(name, label, ...)    ITEM(name,label,def_val,double)
-#define gegl_property_string(name, label, ...)    ITEM(name,label,def_val,string)
-#define gegl_property_file_path(name, label, ...) ITEM(name,label,def_val,string)
-#define gegl_property_int(name, label, ...)       ITEM(name,label,def_val,int)
-#define gegl_property_boolean(name, label, ...)   ITEM(name,label,def_val,boolean)
-#define gegl_property_object(name, label, ...)    ITEM2(name,label,def_val,object)
-#define gegl_property_pointer(name, label, ...)   ITEM(name,label,def_val,pointer)
-#define gegl_property_format(name, label, ...)    ITEM(name,label,def_val,pointer)
-#define gegl_property_color(name, label, ...)     ITEM(name,label,def_val,object)
-#define gegl_property_curve(name, label, ...)     ITEM2(name,label,def_val,object)
-#define gegl_property_path(name, label, ...)      ITEM2(name,label,def_val,object)
-#define gegl_property_seed(name, label, rand_name, ...)   ITEM(name,label,def_val,int)
-#define gegl_property_enum(name, label, enm, enum_name, ...)  ITEM(name,label,def_val,enum)
-
 #include GEGL_OP_C_FILE
 
 #undef ITEM
@@ -477,19 +408,6 @@ get_property (GObject      *gobject,
 #undef property_curve
 #undef property_color
 #undef property_path
-#undef gegl_property_double
-#undef gegl_property_boolean
-#undef gegl_property_int
-#undef gegl_property_string
-#undef gegl_property_file_path
-#undef gegl_property_enum
-#undef gegl_property_object
-#undef gegl_property_pointer
-#undef gegl_property_format
-#undef gegl_property_color
-#undef gegl_property_curve
-#undef gegl_property_seed
-#undef gegl_property_path
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
       break;
@@ -590,87 +508,6 @@ set_property (GObject      *gobject,
         gegl_random_set_seed (properties->rand_name, properties->name);\
       break;
 
-#define gegl_property_double(name, label, ...)                        \
-    case PROP_##name:                                                 \
-      properties->name = g_value_get_double (value);                  \
-      break;
-#define gegl_property_boolean(name, label, ...)                       \
-    case PROP_##name:                                                 \
-      properties->name = g_value_get_boolean (value);                 \
-      break;
-#define gegl_property_int(name, label, ...)                           \
-    case PROP_##name:                                                 \
-      properties->name = g_value_get_int (value);                     \
-      break;
-#define gegl_property_string(name, label, ...)                        \
-    case PROP_##name:                                                 \
-      if (properties->name)                                           \
-        g_free (properties->name);                                    \
-      properties->name = g_value_dup_string (value);                  \
-      break;
-#define gegl_property_file_path(name, label, ...)                     \
-    case PROP_##name:                                                 \
-      if (properties->name)                                           \
-        g_free (properties->name);                                    \
-      properties->name = g_value_dup_string (value);                  \
-      break;
-#define gegl_property_enum(name, label, enum, enum_name, ...)         \
-    case PROP_##name:                                                 \
-      properties->name = g_value_get_enum (value);                    \
-      break;
-#define gegl_property_object(name, label, ...)                        \
-    case PROP_##name:                                                 \
-      if (properties->name != NULL)                                   \
-         g_object_unref (properties->name);                           \
-      properties->name = g_value_dup_object (value);                  \
-      break;
-#define gegl_property_pointer(name, label, ...)                       \
-    case PROP_##name:                                                 \
-      properties->name = g_value_get_pointer (value);                 \
-      break;
-#define gegl_property_format(name, label, ...)                        \
-    case PROP_##name:                                                 \
-      properties->name = g_value_get_pointer (value);                 \
-      break;
-#define gegl_property_color(name, label, ...)                         \
-    case PROP_##name:                                                 \
-      if (properties->name != NULL)                                   \
-         g_object_unref (properties->name);                           \
-      properties->name = g_value_dup_object (value);                  \
-      break;
-#define gegl_property_curve(name, label, ...)                         \
-    case PROP_##name:                                                 \
-      if (properties->name != NULL)                                   \
-         g_object_unref (properties->name);                           \
-      properties->name = g_value_dup_object (value);                  \
-      break;
-#define gegl_property_seed(name, label, rand_name, ...)               \
-    case PROP_##name:                                                 \
-      properties->name = g_value_get_int (value);                     \
-      if (!properties->rand_name)                                     \
-        properties->rand_name = gegl_random_new_with_seed (properties->name);\
-      else                                                            \
-        gegl_random_set_seed (properties->rand_name, properties->name);\
-      break;
-#define gegl_property_path(name, label, ...)                          \
-    case PROP_##name:                                                 \
-      if (properties->name != NULL)                                   \
-        {                                                             \
-          if (properties->path_changed_handler)                       \
-            g_signal_handler_disconnect (G_OBJECT (properties->name), \
-                                         properties->path_changed_handler); \
-          properties->path_changed_handler = 0;                       \
-          g_object_unref (properties->name);                          \
-        }                                                             \
-      properties->name = g_value_dup_object (value);                  \
-      if (properties->name != NULL)                                   \
-        {                                                             \
-          properties->path_changed_handler =                          \
-            g_signal_connect (G_OBJECT (properties->name), "changed", \
-                              G_CALLBACK(path_changed), gobject);     \
-         }                                                            \
-      break; /*XXX*/
-
 #include GEGL_OP_C_FILE
 
 #undef property_double
@@ -686,19 +523,6 @@ set_property (GObject      *gobject,
 #undef property_format
 #undef property_enum
 #undef property_seed
-#undef gegl_property_double
-#undef gegl_property_boolean
-#undef gegl_property_int
-#undef gegl_property_string
-#undef gegl_property_file_path
-#undef gegl_property_enum
-#undef gegl_property_object
-#undef gegl_property_pointer
-#undef gegl_property_format
-#undef gegl_property_color
-#undef gegl_property_curve
-#undef gegl_property_seed
-#undef gegl_property_path
 
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
@@ -755,54 +579,6 @@ static void gegl_op_destroy_notify (gpointer data)
 #define property_format(name, label, ...)
 #define property_enum(name, label, ...)
 #define property_seed(name, label, ...)
-#define gegl_property_double(name, label, ...)
-#define gegl_property_boolean(name, label, ...)
-#define gegl_property_int(name, label, ...)
-#define gegl_property_string(name, label, ...)      \
-  if (properties->name)                             \
-    {                                               \
-      g_free (properties->name);                    \
-      properties->name = NULL;                      \
-    }
-#define gegl_property_file_path(name, label, ...)   \
-  if (properties->name)                             \
-    {                                               \
-      g_free (properties->name);                    \
-      properties->name = NULL;                      \
-    }
-#define gegl_property_enum(name, label, enum, enum_name, ...)
-#define gegl_property_object(name, label, ...)      \
-  if (properties->name)                             \
-    {                                               \
-      g_object_unref (properties->name);            \
-      properties->name = NULL;                      \
-    }
-#define gegl_property_pointer(name, label, ...)
-#define gegl_property_format(name, label, ...)
-#define gegl_property_color(name, label, ...)       \
-  if (properties->name)                             \
-    {                                               \
-      g_object_unref (properties->name);            \
-      properties->name = NULL;                      \
-    }
-#define gegl_property_curve(name, label, ...)       \
-  if (properties->name)                             \
-    {                                               \
-      g_object_unref (properties->name);            \
-      properties->name = NULL;                      \
-    }
-#define gegl_property_seed(name, label, rand_name, ...)  \
-  if (properties->rand_name)                        \
-    {                                               \
-      gegl_random_free (properties->rand_name);     \
-      properties->rand_name = NULL;                 \
-    }
-#define gegl_property_path(name, label, ...)        \
-  if (properties->name)                             \
-    {                                               \
-      g_object_unref (properties->name);            \
-      properties->name = NULL;                      \
-    }
 
 #include GEGL_OP_C_FILE
 
@@ -819,19 +595,6 @@ static void gegl_op_destroy_notify (gpointer data)
 #undef property_curve
 #undef property_color
 #undef property_path
-#undef gegl_property_double
-#undef gegl_property_boolean
-#undef gegl_property_int
-#undef gegl_property_string
-#undef gegl_property_file_path
-#undef gegl_property_enum
-#undef gegl_property_object
-#undef gegl_property_pointer
-#undef gegl_property_format
-#undef gegl_property_color
-#undef gegl_property_curve
-#undef gegl_property_seed
-#undef gegl_property_path
 
   g_slice_free (GeglProperties, properties);
 }
@@ -867,23 +630,6 @@ gegl_op_constructor (GType                  type,
 #define property_seed(name, label, rand_name)    \
     if (properties->rand_name == NULL)              \
       {properties->rand_name = gegl_random_new_with_seed (0);}
-#define gegl_property_double(name, label, ...)
-#define gegl_property_boolean(name, label, ...)
-#define gegl_property_int(name, label, ...)
-#define gegl_property_string(name, label, ...)
-#define gegl_property_file_path(name, label, ...)
-#define gegl_property_enum(name, label, enum, enum_name, ...)
-#define gegl_property_object(name, label, ...)
-#define gegl_property_pointer(name, label, ...)
-#define gegl_property_format(name, label, ...)
-#define gegl_property_color(name, label, ...)              \
-    if (properties->name == NULL)                   \
-    {const char *def = gegl_operation_class_get_property_key (g_type_class_peek (type), #name, 
"default");properties->name = gegl_color_new(def?def:"black");}
-#define gegl_property_seed(name, label, rand_name, ...)    \
-    if (properties->rand_name == NULL)              \
-      {properties->rand_name = gegl_random_new_with_seed (0);}
-#define gegl_property_path(name, label, ...)
-#define gegl_property_curve(name, label, ...)
 
 #include GEGL_OP_C_FILE
 
@@ -900,19 +646,6 @@ gegl_op_constructor (GType                  type,
 #undef property_curve
 #undef property_color
 #undef property_path
-#undef gegl_property_double
-#undef gegl_property_boolean
-#undef gegl_property_int
-#undef gegl_property_string
-#undef gegl_property_file_path
-#undef gegl_property_enum
-#undef gegl_property_object
-#undef gegl_property_pointer
-#undef gegl_property_format
-#undef gegl_property_color
-#undef gegl_property_curve
-#undef gegl_property_seed
-#undef gegl_property_path
 
   g_object_set_data_full (obj, "chant-data", obj, gegl_op_destroy_notify);
   properties ++; /* evil hack to silence gcc */
@@ -1168,52 +901,6 @@ gegl_op_class_intern_init (gpointer klass)
   }{ GParamSpec *pspec = gegl_param_spec_seed (#name, label, NULL, flags);       \
     current_prop = PROP_##name ;
 
-#define gegl_property_string(name, label, foo...)                              \
-  { GParamSpec *pspec = gegl_param_spec_string_from_vararg (#name, label, foo);\
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-
-#define gegl_property_double(name, label, foo...)                              \
-  { GParamSpec *pspec = gegl_param_spec_double_from_vararg (#name, label, foo);\
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_boolean(name, label, foo...)                             \
-  { GParamSpec *pspec = gegl_param_spec_boolean_from_vararg(#name, label, foo);\
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_int(name, label, foo...)                                 \
-  { GParamSpec *pspec = gegl_param_spec_int_from_vararg (#name, label, foo);   \
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_string(name, label, foo...)                              \
-  { GParamSpec *pspec = gegl_param_spec_string_from_vararg (#name, label, foo);\
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_file_path(name, label, foo...)                           \
-  { GParamSpec *pspec =gegl_param_spec_file_path_from_vararg(#name,label, foo);\
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_enum(name, label, enum, enum_name, foo... )              \
-  { GParamSpec *pspec = gegl_param_spec_enum_from_vararg (#name, label,        \
-                                     enum_name ## _get_type (), foo);          \
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-
-#define gegl_property_object(name, label, foo...)                              \
-  { GParamSpec *pspec = gegl_param_spec_object_from_vararg (#name, label, foo);\
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_pointer(name, label, foo...)                             \
-  { GParamSpec *pspec = gegl_param_spec_pointer_from_vararg(#name, label, foo);\
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_format(name, label, foo...)                              \
-  { GParamSpec *pspec = gegl_param_spec_format_from_vararg (#name, label, foo);\
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_seed(name, label, rand_name, foo...)                     \
-  { GParamSpec *pspec = gegl_param_spec_seed_from_vararg (#name, label, foo);  \
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_color(name, label, foo...)                               \
-  { GParamSpec *pspec = gegl_param_spec_color_from_vararg (#name, label, foo); \
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_path(name, label, foo...)                                \
-  { GParamSpec *pspec = gegl_param_spec_path_from_vararg (#name, label, foo);  \
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-#define gegl_property_curve(name, label, foo...)                               \
-  { GParamSpec *pspec = gegl_param_spec_curve_from_vararg (#name, label, foo); \
-    g_object_class_install_property (object_class, PROP_##name, pspec);};
-
 #include GEGL_OP_C_FILE
 
     REGISTER_IF_ANY
@@ -1238,19 +925,6 @@ gegl_op_class_intern_init (gpointer klass)
 #undef property_object
 #undef property_format
 
-#undef gegl_property_double
-#undef gegl_property_boolean
-#undef gegl_property_int
-#undef gegl_property_string
-#undef gegl_property_file_path
-#undef gegl_property_enum
-#undef gegl_property_object
-#undef gegl_property_pointer
-#undef gegl_property_format
-#undef gegl_property_color
-#undef gegl_property_curve
-#undef gegl_property_seed
-#undef gegl_property_path
 }
 
 static void
diff --git a/gegl/property-types/gegl-paramspecs.c b/gegl/property-types/gegl-paramspecs.c
index ae70446..5bd69d8 100644
--- a/gegl/property-types/gegl-paramspecs.c
+++ b/gegl/property-types/gegl-paramspecs.c
@@ -781,622 +781,3 @@ gegl_param_spec_format (const gchar *name,
 
   return G_PARAM_SPEC (pspec);
 }
-
-GParamSpec *
-gegl_param_spec_double_from_vararg (const char *name,
-                                    const char *nick,
-                                    ...)
-{
-  const gchar *blurb = "";
-  gdouble min_value     = -G_MAXDOUBLE,
-          max_value     = G_MAXDOUBLE,
-          default_value = 0.0,
-          ui_min = -100,
-          ui_max = 100,
-          ui_gamma = 1.0;
-  gboolean min_set = FALSE,
-           max_set = FALSE,
-           ui_min_set = FALSE,
-           ui_max_set = FALSE;
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if      (g_str_equal (key, "min"))
-    {
-      min_value = va_arg (var_args, double);
-      min_set = TRUE;
-    }
-    else if (g_str_equal (key, "max"))
-    {
-      max_value = va_arg (var_args, double);
-      max_set = TRUE;
-    }
-    else if (g_str_equal (key, "ui-min"))
-    {
-      ui_min = va_arg (var_args, double);
-      ui_min_set = TRUE;
-    }
-    else if (g_str_equal (key, "ui-gamma"))
-      ui_gamma = va_arg (var_args, double);
-    else if (g_str_equal (key, "ui-max"))
-    {
-      ui_max = va_arg (var_args, double);
-      ui_max_set = TRUE;
-    }
-    else if (g_str_equal (key, "default"))
-      default_value = va_arg (var_args, double);
-    else if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-
-  if (!ui_min_set && min_set)
-    ui_min = min_value;
-  if (!ui_max_set && max_set)
-    ui_max = max_value;
-
-  if (ui_min < min_value)
-    g_warning ("ui-min %f smaller than min %f for property %s",
-               ui_min, min_value, name);
-  if (ui_max > max_value)
-    g_warning ("ui-max %f bigger than max %f for property %s",
-               ui_max, max_value, name);
-
-  pspec = gegl_param_spec_double (name, nick, blurb,
-                               min_value, max_value, default_value,
-                               ui_min, ui_max, ui_gamma, \
-                               (GParamFlags) (         \
-                               G_PARAM_READWRITE |     \
-                               G_PARAM_CONSTRUCT |     \
-                               GEGL_PARAM_PAD_INPUT));
-
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-
-GParamSpec *
-gegl_param_spec_int_from_vararg (const char *name,
-                                 const char *nick, ...)
-{
-  const gchar *blurb = "";
-  gint min_value     = G_MININT,
-       max_value     = G_MAXINT,
-       default_value = 0,
-       ui_min = -100,
-       ui_max = 100,
-       ui_gamma = 1.0;
-  gboolean min_set = FALSE,
-           max_set = FALSE,
-           ui_min_set = FALSE,
-           ui_max_set = FALSE;
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if      (g_str_equal (key, "min"))
-    {
-      min_value = va_arg (var_args, gint);
-      min_set = TRUE;
-    }
-    else if (g_str_equal (key, "max"))
-    {
-      max_value = va_arg (var_args, gint);
-      max_set = TRUE;
-    }
-    else if (g_str_equal (key, "ui-min"))
-    {
-      ui_min = va_arg (var_args, gint);
-      ui_min_set = TRUE;
-    }
-    else if (g_str_equal (key, "ui-gamma"))
-      ui_gamma = va_arg (var_args, double);
-    else if (g_str_equal (key, "ui-max"))
-    {
-      ui_max = va_arg (var_args, gint);
-      ui_max_set = TRUE;
-    }
-    else if (g_str_equal (key, "default"))
-      default_value = va_arg (var_args, gint);
-    else if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-
-  if (!ui_min_set && min_set)
-    ui_min = min_value;
-  if (!ui_max_set && max_set)
-    ui_max = max_value;
-
-  if (ui_min < min_value)
-    g_warning ("ui-min %i smaller than min %i for property %s",
-               ui_min, min_value, name);
-  if (ui_max > max_value)
-    g_warning ("ui-max %i bigger than max %i for property %s",
-               ui_max, max_value, name);
-
-  pspec = gegl_param_spec_int (name, nick, blurb,
-                               min_value, max_value, default_value,
-                               ui_min, ui_max, ui_gamma, \
-                               (GParamFlags) (         \
-                               G_PARAM_READWRITE |     \
-                               G_PARAM_CONSTRUCT |     \
-                               GEGL_PARAM_PAD_INPUT));
-
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-
-GParamSpec *
-gegl_param_spec_boolean_from_vararg (const char *name,
-                                     const char *nick, ...)
-{
-  const gchar *blurb = "";
-  gboolean default_value = FALSE;
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "default"))
-      default_value = va_arg (var_args, gboolean);
-    else if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = g_param_spec_boolean (name, nick, blurb,
-                            default_value,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_string_from_vararg (const char *name,
-                                    const char *nick,
-                                    ...)
-{
-  const gchar *blurb = "";
-  const gchar *default_value = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "default"))
-      default_value = va_arg (var_args, const gchar *);
-    else if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = g_param_spec_string (name, nick, blurb,
-                            default_value,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_file_path_from_vararg (const char *name,
-                                       const char *nick, ...)
-{
-  const gchar *blurb = "";
-  const gchar *default_value = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "default"))
-      default_value = va_arg (var_args, const gchar *);
-    else if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = gegl_param_spec_file_path (name, nick, blurb,
-                            FALSE, FALSE, /* XXX: take from varargs? */
-                            default_value,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_enum_from_vararg (const char *name,
-                                  const char *nick,
-                                  GType       enum_type, ...)
-{
-  const gchar *blurb = "";
-  int default_value = 0;
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, enum_type);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "default"))
-      default_value = va_arg (var_args, int);
-    else if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-
-  pspec = g_param_spec_enum (name, nick, blurb,
-                             enum_type,
-                             default_value,
-                             (GParamFlags) (
-                             G_PARAM_READWRITE |
-                             G_PARAM_CONSTRUCT |
-                             GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_pointer_from_vararg (const char *name,
-                                     const char *nick,
-                                     ...)
-{
-  const gchar *blurb = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = g_param_spec_pointer (name, nick, blurb,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_object_from_vararg (const char *name, const char *nick, ...)
-{
-  const gchar *blurb = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = g_param_spec_object (name, nick, blurb,
-                            G_TYPE_OBJECT,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_curve_from_vararg (const char *name,
-                                   const char *nick,
-                                   ...)
-{
-  const gchar *blurb = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-  GeglCurve  *curve;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  curve = gegl_curve_new_default ();
-  pspec = gegl_param_spec_curve (name, nick, blurb,
-                             curve,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_object_unref (curve);
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_path_from_vararg (const char *name,
-                                  const char *nick,
-                                  ...)
-{
-  const gchar *blurb = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = gegl_param_spec_path (name, nick, blurb, NULL,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_format_from_vararg (const char *name,
-                                    const char *nick, ...)
-{
-  const gchar *blurb = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = gegl_param_spec_format (name, nick, blurb,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_color_from_vararg (const char *name,
-                                   const char *nick,
-                                   ...)
-{
-  const gchar *blurb = "";
-  const gchar *default_value = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "default"))
-    {
-      default_value = va_arg (var_args, const gchar *);
-    }
-    else if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = gegl_param_spec_color_from_string (name, nick, blurb,
-                            default_value,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
-
-GParamSpec *
-gegl_param_spec_seed_from_vararg (const char *name,
-                                  const char *nick, ...)
-{
-  const gchar *blurb = "";
-
-  GParamSpec *pspec;
-  GHashTable *ht;
-
-  va_list var_args;
-  const gchar *key;
-
-  ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-  va_start (var_args, nick);
-  key = va_arg (var_args, const char*);
-  while (key)
-  {
-    if (g_str_equal (key, "description"))
-      blurb = va_arg (var_args, const gchar *);
-    else
-    {
-      const char *value = va_arg (var_args, const gchar*);
-      g_hash_table_insert (ht, g_strdup (key), g_strdup (value));
-    }
-    key = va_arg (var_args, const char*);
-  }
-  va_end (var_args);
-  pspec = gegl_param_spec_seed (name, nick, blurb,
-                            (GParamFlags) (
-                            G_PARAM_READWRITE |
-                            G_PARAM_CONSTRUCT |
-                            GEGL_PARAM_PAD_INPUT));
-  g_param_spec_set_qdata_full (pspec, g_quark_from_static_string ("gegl-property-keys"),
-                               ht, (GDestroyNotify)g_hash_table_unref);
-  return pspec;
-}
diff --git a/gegl/property-types/gegl-paramspecs.h b/gegl/property-types/gegl-paramspecs.h
index 4e1452b..4b3dce0 100644
--- a/gegl/property-types/gegl-paramspecs.h
+++ b/gegl/property-types/gegl-paramspecs.h
@@ -392,100 +392,6 @@ GParamSpec * gegl_param_spec_format (const gchar *name,
                                      const gchar *blurb,
                                      GParamFlags  flags);
 
-/**
- * gegl_param_spec_double_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_double_from_vararg (const char *name,
-                                                 const char *nick, ...) 
-                                                 G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_int_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_int_from_vararg (const char *name,
-                                              const char *nick, ...)
-                                              G_GNUC_NULL_TERMINATED;
-
-/**
- * gegl_param_spec_string_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_string_from_vararg (const char *name,
-                                                 const char *nick, ...)
-                                                 G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_boolean_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_boolean_from_vararg (const char *name,
-                                                  const char *nick, ...)
-                                                  G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_pointer_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_pointer_from_vararg (const char *name,
-                                                  const char *nick, ...)
-                                                  G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_enum_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_enum_from_vararg (const char *name,
-                                               const char *nick,
-                                               GType enum_type, ...)
-                                               G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_color_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_color_from_vararg (const char *name,
-                                                const char *nick, ...)
-                                                G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_seed_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_seed_from_vararg (const char *name,
-                                               const char *nick, ...)
-                                               G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_object_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_object_from_vararg (const char *name,
-                                                 const char *nick, ...)
-                                                 G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_format_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_format_from_vararg (const char *name,
-                                                 const char *nick, ...)
-                                                 G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_curve_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_curve_from_vararg (const char *name,
-                                                const char *nick, ...)
-                                                G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_path_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_path_from_vararg (const char *name,
-                                               const char *nick, ...)
-                                               G_GNUC_NULL_TERMINATED;
-/**
- * gegl_param_spec_file_path_from_vararg: (skip)
- * Returns: (transfer full): a newly created parameter specification
- */
-GParamSpec * gegl_param_spec_file_path_from_vararg (const char *name,
-                                                    const char *nick, ...)
-                                                    G_GNUC_NULL_TERMINATED;
-
 
 G_END_DECLS
 #endif  /*  __GEGL_PARAM_SPECS_H__  */



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