[gegl/property-keys] add back shortcuts for common GEGL parent classes
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/property-keys] add back shortcuts for common GEGL parent classes
- Date: Wed, 14 May 2014 17:17:44 +0000 (UTC)
commit e754b5dcfe594cf970546dca32e05036605161b5
Author: Øyvind Kolås <pippin gimp org>
Date: Wed May 14 19:15:40 2014 +0200
add back shortcuts for common GEGL parent classes
gegl/gegl-op.h | 173 +++++++++++++++++++++++++++++++++++--------------------
1 files changed, 110 insertions(+), 63 deletions(-)
---
diff --git a/gegl/gegl-op.h b/gegl/gegl-op.h
index dddabed..4775848 100644
--- a/gegl/gegl-op.h
+++ b/gegl/gegl-op.h
@@ -23,6 +23,9 @@
*/
#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/"
+#endif
#error "GEGL_OP_C_FILE not defined"
#endif
@@ -93,6 +96,67 @@ type_name##_register_type (GTypeModule *type_module) \
#define MKCLASS(a) MKCLASS2(a)
#define MKCLASS2(a) a##Class
+#ifdef GEGL_OP_POINT_FILTER
+#define GEGL_OP_Parent GeglOperationPointFilter
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_POINT_FILTER
+#endif
+
+#ifdef GEGL_OP_POINT_COMPOSER
+#define GEGL_OP_Parent GeglOperationPointComposer
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_POINT_COMPOSER
+#endif
+
+#ifdef GEGL_OP_POINT_COMPOSER3
+#define GEGL_OP_Parent GeglOperationPointComposer3
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_POINT_COMPOSER3
+#endif
+
+#ifdef GEGL_OP_POINT_RENDER
+#define GEGL_OP_Parent GeglOperationPointRender
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_POINT_RENDER
+#endif
+
+#ifdef GEGL_OP_AREA_FILTER
+#define GEGL_OP_Parent GeglOperationAreaFilter
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_AREA_FILTER
+#endif
+
+#ifdef GEGL_OP_FILTER
+#define GEGL_OP_Parent GeglOperationFilter
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_FILTER
+#endif
+
+#ifdef GEGL_OP_TEMPORAL
+#define GEGL_OP_Parent GeglOperationTemporal
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_TEMPORAL
+#endif
+
+#ifdef GEGL_OP_SOURCE
+#define GEGL_OP_Parent GeglOperationSource
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_SOURCE
+#endif
+
+#ifdef GEGL_OP_SINK
+#define GEGL_OP_Parent GeglOperationSink
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_SINK
+#endif
+
+#ifdef GEGL_OP_COMPOSER
+#define GEGL_OP_Parent GeglOperationComposer
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_COMPOSER
+#endif
+
+#ifdef GEGL_OP_COMPOSER3
+#define GEGL_OP_Parent GeglOperationComposer3
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_COMPOSER3
+#endif
+
+#ifdef GEGL_OP_META
+#include <operation/gegl-operation-meta.h>
+#define GEGL_OP_Parent GeglOperationMeta
+#define GEGL_OP_PARENT GEGL_TYPE_OPERATION_META
+#endif
+
#ifdef GEGL_OP_Parent
struct _GeglOp
{
@@ -107,23 +171,10 @@ typedef struct
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_OP_PARENT)
+#else
+#error "no parent class specified"
#endif
-#ifdef GEGL_OP_TYPE_META
-#include <operation/gegl-operation-meta.h>
-struct _GeglOp
-{
- GeglOperationMeta parent_instance;
- gpointer properties;
-};
-
-typedef struct
-{
- GeglOperationMetaClass parent_class;
-} GeglOpClass;
-
-GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_META)
-#endif
#define GEGL_OP(obj) ((GeglOp*)(obj))
@@ -181,17 +232,17 @@ gegl_module_register (GTypeModule *module)
#define gegl_property_seed(name, rand_name, ...)
#define gegl_property_path(name, ...)
-#define gegl_op_register_enum(enum_name) typedef enum {
-#define enum_value(value, nick) value ,
-#define gegl_op_register_enum_end(enum) } enum ;
+#define gegl_enum_start(enum_name) typedef enum {
+#define gegl_enum_value(value, nick) value ,
+#define gegl_enum_end(enum) } enum ;
#include GEGL_OP_C_FILE
-#undef gegl_op_register_enum
-#undef enum_value
-#undef gegl_op_register_enum_end
+#undef gegl_enum_start
+#undef gegl_enum_value
+#undef gegl_enum_end
-#define gegl_op_register_enum(enum_name) \
+#define gegl_enum_start(enum_name) \
GType enum_name ## _get_type (void) G_GNUC_CONST; \
GType enum_name ## _get_type (void) \
{ \
@@ -199,10 +250,10 @@ GType enum_name ## _get_type (void) \
if (etype == 0) { \
static const GEnumValue values[] = {
-#define enum_value(value, nick) \
+#define gegl_enum_value(value, nick) \
{ value, nick, nick },
-#define gegl_op_register_enum_end(enum) \
+#define gegl_enum_end(enum) \
{ 0, NULL, NULL } \
}; \
etype = g_enum_register_static (#enum, values); \
@@ -225,37 +276,33 @@ GType enum_name ## _get_type (void) \
#undef gegl_property_curve
#undef gegl_property_seed
#undef gegl_property_path
-#undef gegl_op_register_enum
-#undef enum_value
-#undef gegl_op_register_enum_end
-#define gegl_op_register_enum(enum_name)
-#define enum_value(value, nick)
-#define gegl_op_register_enum_end(enum)
+#undef gegl_enum_start
+#undef gegl_enum_value
+#undef gegl_enum_end
+#define gegl_enum_start(enum_name)
+#define gegl_enum_value(value, nick)
+#define gegl_enum_end(enum)
/* Properties */
struct _GeglProperties
{
- gpointer user_data; /* Unused by the chanting framework can be used by operations
- * for storage of a private struct, (remember to clean up
- * in finalize). Also serves as a filler making sure that we
- * do not create an empty struct if there are no chanted properties.
- */
-#define gegl_property_double(name, ...) gdouble name;
-#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;
-#define gegl_property_format(name, ...) gpointer name;
-#define gegl_property_color(name, ...) GeglColor *name;
-#define gegl_property_curve(name, ...) GeglCurve *name;
-#define gegl_property_seed(name, rand_name, ...) gint name;\
- GeglRandom *rand_name;
-#define gegl_property_path(name, ...) GeglPath *name;\
- gulong path_changed_handler;
+ gpointer user_data; /* for use by the op implementation */
+#define gegl_property_double(name, ...) gdouble name;
+#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;
+#define gegl_property_format(name, ...) gpointer name;
+#define gegl_property_color(name, ...) GeglColor *name;
+#define gegl_property_curve(name, ...) GeglCurve *name;
+#define gegl_property_seed(name, rand_name, ...) gint name;\
+ GeglRandom *rand_name;
+#define gegl_property_path(name, ...) GeglPath *name;\
+ gulong path_changed_handler;
#include GEGL_OP_C_FILE
@@ -280,19 +327,19 @@ enum
{
PROP_0,
-#define gegl_property_double(name, ...) PROP_##name,
-#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,
-#define gegl_property_format(name, ...) PROP_##name,
-#define gegl_property_color(name, ...) PROP_##name,
-#define gegl_property_curve(name, ...) PROP_##name,
-#define gegl_property_seed(name, rand_name, ...) PROP_##name,
-#define gegl_property_path(name, ...) PROP_##name,
+#define gegl_property_double(name, ...) PROP_##name,
+#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,
+#define gegl_property_format(name, ...) PROP_##name,
+#define gegl_property_color(name, ...) PROP_##name,
+#define gegl_property_curve(name, ...) PROP_##name,
+#define gegl_property_seed(name, rand_name, ...) PROP_##name,
+#define gegl_property_path(name, ...) PROP_##name,
#include GEGL_OP_C_FILE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]