[gegl/pippin/property-keys] fix macro magic for defining color properties
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/pippin/property-keys] fix macro magic for defining color properties
- Date: Wed, 14 May 2014 18:23:11 +0000 (UTC)
commit 476b775b8cdefb83a2bc70a2167323d5280be565
Author: Øyvind Kolås <pippin gimp org>
Date: Wed May 14 20:18:48 2014 +0200
fix macro magic for defining color properties
gegl/gegl-op.h | 15 ++++++++++++---
gegl/gegl-plugin.h | 1 +
gegl/operation/gegl-operation-property-keys.c | 2 +-
gegl/operation/gegl-operation-property-keys.h | 6 ++++++
4 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/gegl/gegl-op.h b/gegl/gegl-op.h
index 4775848..aef10f8 100644
--- a/gegl/gegl-op.h
+++ b/gegl/gegl-op.h
@@ -24,11 +24,20 @@
#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
+/* 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 +181,7 @@ typedef struct
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_OP_PARENT)
#else
-#error "no parent class specified"
+#error "no parent class specified"
#endif
@@ -660,7 +669,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]