[gegl/property-keys] add back file_path property type



commit 2ec8a81cc61b2fcddd2a2db5512549dad3ed7472
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed May 14 18:41:52 2014 +0200

    add back file_path property type

 gegl/gegl-op.h |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/gegl/gegl-op.h b/gegl/gegl-op.h
index 1bd0fde..dddabed 100644
--- a/gegl/gegl-op.h
+++ b/gegl/gegl-op.h
@@ -169,6 +169,7 @@ gegl_module_register (GTypeModule *module)
 /* enum registration */
 #define gegl_property_double(name, ...)
 #define gegl_property_string(name, ...)
+#define gegl_property_file_path(name, ...)
 #define gegl_property_int(name, ...)
 #define gegl_property_boolean(name, ...)
 #define gegl_property_enum(name, enum, enum_name, ...)
@@ -213,6 +214,7 @@ GType enum_name ## _get_type (void)               \
 
 #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
@@ -243,6 +245,7 @@ struct _GeglProperties
 #define gegl_property_boolean(name, ...)                                           gboolean            name;
 #define gegl_property_int(name, ...)                                           gint            name;
 #define gegl_property_string(name, ...)                                        gchar *name;
+#define gegl_property_file_path(name, ...)                                        gchar *name;
 #define gegl_property_enum(name, enum, enum_name, ...)                    enum               name;
 #define gegl_property_object(name, ...)                                    GObject           *name;
 #define gegl_property_pointer(name, ...)                                   gpointer           name;
@@ -260,6 +263,7 @@ struct _GeglProperties
 #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
@@ -280,6 +284,7 @@ enum
 #define gegl_property_boolean(name, ...)                                           PROP_##name,
 #define gegl_property_int(name, ...)                                           PROP_##name,
 #define gegl_property_string(name, ...)                                           PROP_##name,
+#define gegl_property_file_path(name, ...)                                           PROP_##name,
 #define gegl_property_enum(name, enum, enum_name, ...)                                  PROP_##name,
 #define gegl_property_object(name, ...)                                    PROP_##name,
 #define gegl_property_pointer(name, ...)                                   PROP_##name,
@@ -293,6 +298,7 @@ enum
 
 #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
@@ -334,6 +340,10 @@ get_property (GObject      *gobject,
     case PROP_##name:                                         \
       g_value_set_string (value, properties->name);           \
       break;
+#define gegl_property_file_path(name, ...)                    \
+    case PROP_##name:                                         \
+      g_value_set_file_path (value, properties->name);        \
+      break;
 #define gegl_property_enum(name, enum, enum_name, ...)        \
     case PROP_##name:                                         \
       g_value_set_enum (value, properties->name);             \
@@ -373,6 +383,7 @@ get_property (GObject      *gobject,
 #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
@@ -418,6 +429,12 @@ set_property (GObject      *gobject,
         g_free (properties->name);                                    \
       properties->name = g_value_dup_string (value);                  \
       break;
+#define gegl_property_file_path(name, ...)                            \
+    case PROP_##name:                                                 \
+      if (properties->name)                                           \
+        g_free (properties->name);                                    \
+      properties->name = g_value_dup_string (value);                  \
+      break;
 #define gegl_property_enum(name, enum, enum_name, ...)                \
     case PROP_##name:                                                 \
       properties->name = g_value_get_enum (value);                    \
@@ -481,6 +498,7 @@ set_property (GObject      *gobject,
 #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
@@ -511,6 +529,12 @@ static void gegl_op_destroy_notify (gpointer data)
       g_free (properties->name);                    \
       properties->name = NULL;                      \
     }
+#define gegl_property_file_path(name, ...)          \
+  if (properties->name)                             \
+    {                                               \
+      g_free (properties->name);                    \
+      properties->name = NULL;                      \
+    }
 #define gegl_property_enum(name, enum, enum_name, ...)
 #define gegl_property_object(name, ...)             \
   if (properties->name)                             \
@@ -551,6 +575,7 @@ static void gegl_op_destroy_notify (gpointer data)
 #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
@@ -581,6 +606,7 @@ gegl_op_constructor (GType                  type,
 #define gegl_property_boolean(name, ...)
 #define gegl_property_int(name, ...)
 #define gegl_property_string(name, ...)
+#define gegl_property_file_path(name, ...)
 #define gegl_property_enum(name, enum, enum_name, ...)
 #define gegl_property_object(name, ...)
 #define gegl_property_pointer(name, ...)
@@ -600,6 +626,7 @@ gegl_op_constructor (GType                  type,
 #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
@@ -635,6 +662,9 @@ gegl_op_class_intern_init (gpointer klass)
 #define gegl_property_string(name, foo...)                                   \
   { GParamSpec *pspec = gegl_param_spec_string_from_vararg (#name, foo);     \
     g_object_class_install_property (object_class, PROP_##name, pspec);};
+#define gegl_property_file_path(name, foo...)                                \
+  { GParamSpec *pspec = gegl_param_spec_file_path_from_vararg (#name, foo);  \
+    g_object_class_install_property (object_class, PROP_##name, pspec);};
 #define gegl_property_enum(name, enum, enum_name, foo... )                   \
   { GParamSpec *pspec = gegl_param_spec_enum_from_vararg (#name,             \
                                      enum_name ## _get_type (), foo);        \
@@ -668,6 +698,7 @@ gegl_op_class_intern_init (gpointer klass)
 #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


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