[gegl/pippin/property-keys: 8/16] make gegl_chant_class_init warn better



commit bd96b1918bdc258d424b35a4217e15a450374d9e
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed May 14 20:18:48 2014 +0200

    make gegl_chant_class_init warn better

 gegl/gegl-op.h                                |   19 +++++++++++++++----
 gegl/gegl-plugin.h                            |    1 +
 gegl/operation/gegl-operation-property-keys.c |    2 +-
 gegl/operation/gegl-operation-property-keys.h |    6 ++++++
 4 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/gegl/gegl-op.h b/gegl/gegl-op.h
index 4775848..1a89bd8 100644
--- a/gegl/gegl-op.h
+++ b/gegl/gegl-op.h
@@ -24,11 +24,22 @@
 
 #ifndef GEGL_OP_C_FILE
 #ifdef GEGL_CHANT_C_FILE
-#error "GEGL_OP_C_FILE not defined, %s/GEGL_CHANT_C_FILE/GEGL_OP_C_FILE/"
+#error   GEGL_OP_C_FILE not defined, %s/GEGL_CHANT_C_FILE/GEGL_OP_C_FILE/
 #endif
 #error "GEGL_OP_C_FILE not defined"
 #endif
 
+#define gegl_chant_class_init   gegl_chant_class_init_SHOULD_BE_gegl_op_class_init 
+
+/* XXX: */
+#ifdef GEGL_CHANT_TYPE_POINT_RENDER
+#error "GEGL_CHANT_TYPE_POINT_RENDER should be replaced with GEGL_OP_POINT_RENDER"
+#endif
+
+#ifdef GEGL_CHANT_PROPERTIES
+#error "GEGL_CHANT_PROPERTIES should be replaced with GEGL_PROPERTIES"
+#endif
+
 #include <gegl-plugin.h>
 
 G_BEGIN_DECLS
@@ -172,7 +183,7 @@ typedef struct
 GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_OP_PARENT)
 
 #else
-#error "no parent class specified"
+//#error  "no parent class specified"
 #endif
 
 
@@ -389,7 +400,7 @@ get_property (GObject      *gobject,
       break;
 #define gegl_property_file_path(name, ...)                    \
     case PROP_##name:                                         \
-      g_value_set_file_path (value, properties->name);        \
+      g_value_set_string (value, properties->name);        \
       break;
 #define gegl_property_enum(name, enum, enum_name, ...)        \
     case PROP_##name:                                         \
@@ -660,7 +671,7 @@ gegl_op_constructor (GType                  type,
 #define gegl_property_format(name, ...)
 #define gegl_property_color(name, ...)              \
     if (properties->name == NULL)                   \
-    {const char *def = gegl_operation_class_get_property_key (g_type_peek_class (type), name, 
"default");properties->name = gegl_color_new(def?def:"black");}
+    {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, rand_name, ...)    \
     if (properties->rand_name == NULL)              \
       {properties->rand_name = gegl_random_new_with_seed (0);}
diff --git a/gegl/gegl-plugin.h b/gegl/gegl-plugin.h
index b5f955c..2c334d3 100644
--- a/gegl/gegl-plugin.h
+++ b/gegl/gegl-plugin.h
@@ -77,6 +77,7 @@ GType gegl_module_register_type (GTypeModule     *module,
 #include <operation/gegl-operation-sink.h>
 #include <operation/gegl-operation-meta.h>
 #include <operation/gegl-extension-handler.h>
+#include <operation/gegl-operation-property-keys.h>
 
 G_END_DECLS
 
diff --git a/gegl/operation/gegl-operation-property-keys.c b/gegl/operation/gegl-operation-property-keys.c
index 32152fb..938e86c 100644
--- a/gegl/operation/gegl-operation-property-keys.c
+++ b/gegl/operation/gegl-operation-property-keys.c
@@ -139,7 +139,7 @@ gegl_operation_class_set_property_key (GeglOperationClass *operation_class,
 }
 
 
-static const gchar *
+const gchar *
 gegl_operation_class_get_property_key (GeglOperationClass *operation_class,
                                        const gchar        *property_name,
                                        const gchar        *key_name)
diff --git a/gegl/operation/gegl-operation-property-keys.h b/gegl/operation/gegl-operation-property-keys.h
index 59bc4a2..0ffa044 100644
--- a/gegl/operation/gegl-operation-property-keys.h
+++ b/gegl/operation/gegl-operation-property-keys.h
@@ -33,4 +33,10 @@ void       gegl_operation_class_set_property_key
                                              const gchar        *property_name,
                                              const gchar        *key_name,
                                              const gchar        *value);
+
+const gchar *
+gegl_operation_class_get_property_key (GeglOperationClass *operation_class,
+                                       const gchar        *property_name,
+                                       const gchar        *key_name);
+
 #endif


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