Commit ec3b4ba5 authored by Øyvind Kolås's avatar Øyvind Kolås

Removed bits of GeglChant that still refer directly to operation, since

	* gegl/gegl-chant.h: Removed bits of GeglChant that still refer
	directly to operation, since the chanting framework as of now is
	base class independent.
	* operations/**/*.c:
	* operations/**/*.rb: renamed operation_class_init
	gegl_chant_class_init.

svn path=/trunk/; revision=2065
parent 90bf161c
......@@ -29,28 +29,28 @@
#include <gegl-plugin.h>
GType operation_get_type ();
GType gegl_chant_get_type ();
typedef struct _GeglChantO GeglChantO;
typedef struct _GeglChant GeglChant;
static void operation_register_type (GTypeModule *module);
static void gegl_chant_init (GeglChant *self);
static void gegl_chant_class_init (gpointer klass);
static gpointer gegl_chant_parent_class = NULL;
static void gegl_chant_register_type (GTypeModule *module);
static void gegl_chant_init_properties (GeglChant *self);
static void gegl_chant_class_intern_init (gpointer klass);
static gpointer chant_parent_class = NULL;
#define GEGL_DEFINE_DYNAMIC_OPERATION(T_P) GEGL_DEFINE_DYNAMIC_OPERATION_EXTENDED (GEGL_CHANT_C_FILE, GeglChant, operation, T_P, 0, {})
#define GEGL_DEFINE_DYNAMIC_OPERATION(T_P) GEGL_DEFINE_DYNAMIC_OPERATION_EXTENDED (GEGL_CHANT_C_FILE, GeglChant, gegl_chant, T_P, 0, {})
#define GEGL_DEFINE_DYNAMIC_OPERATION_EXTENDED(C_FILE, TypeName, type_name, TYPE_PARENT, flags, CODE) \
static void type_name##_init (TypeName *self); \
static void type_name##_class_init (TypeName##Class *klass); \
static void type_name##_class_finalize (TypeName##Class *klass); \
static gpointer type_name##_parent_class = NULL; \
static GType type_name##_type_id = 0; \
static void type_name##_class_intern_init (gpointer klass) \
static void type_name##_class_chant_intern_init (gpointer klass) \
{ \
type_name##_parent_class = g_type_class_peek_parent (klass); \
gegl_chant_parent_class = type_name##_parent_class; \
chant_parent_class = type_name##_parent_class; \
type_name##_class_init ((TypeName##Class*) klass); \
gegl_chant_class_init (klass); \
gegl_chant_class_intern_init (klass); \
} \
GType \
type_name##_get_type (void) \
......@@ -68,7 +68,7 @@ type_name##_register_type (GTypeModule *type_module) \
sizeof (TypeName##Class), \
(GBaseInitFunc) NULL, \
(GBaseFinalizeFunc) NULL, \
(GClassInitFunc) type_name##_class_intern_init, \
(GClassInitFunc) type_name##_class_chant_intern_init, \
(GClassFinalizeFunc) type_name##_class_finalize, \
NULL, /* class_data */ \
sizeof (TypeName), \
......@@ -241,13 +241,13 @@ GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_POINT_COMPOSER);
*/
#ifndef GEGL_CHANT_CUSTOM
static void
operation_init (GeglChant *self)
gegl_chant_init (GeglChant *self)
{
gegl_chant_init (self);
gegl_chant_init_properties (self);
}
static void
operation_class_finalize (GeglChantClass *self)
gegl_chant_class_finalize (GeglChantClass *self)
{
}
......@@ -265,7 +265,7 @@ gegl_module_query (GTypeModule *module)
G_MODULE_EXPORT gboolean
gegl_module_register (GTypeModule *module)
{
operation_register_type (module);
gegl_chant_register_type (module);
return TRUE;
}
......@@ -587,7 +587,7 @@ gegl_chant_constructor (GType type,
{
GObject *obj;
obj = G_OBJECT_CLASS (gegl_chant_parent_class)->constructor (
obj = G_OBJECT_CLASS (chant_parent_class)->constructor (
type, n_construct_properties, construct_properties);
g_object_set_data_full (obj, "chant-data", obj, gegl_chant_destroy_notify);
......@@ -595,7 +595,7 @@ gegl_chant_constructor (GType type,
}
static void
gegl_chant_class_init (gpointer klass)
gegl_chant_class_intern_init (gpointer klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
......@@ -710,7 +710,7 @@ gegl_chant_class_init (gpointer klass)
static void
gegl_chant_init (GeglChant *self)
gegl_chant_init_properties (GeglChant *self)
{
self->properties = g_slice_new0 (GeglChantO);
}
......
......@@ -243,7 +243,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -456,7 +456,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -110,7 +110,7 @@ process (GeglOperation *op,
* (template) in the GObject OO framework.
*/
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -100,7 +100,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -54,7 +54,7 @@ process (GeglOperation *op,
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -76,7 +76,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -82,7 +82,7 @@ process (GeglOperation *operation,
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -169,7 +169,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
......
......@@ -134,7 +134,7 @@ process (GeglOperation *operation,
* computations.
*/
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -83,7 +83,7 @@ process (GeglOperation *op,
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -111,7 +111,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -75,7 +75,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -90,7 +90,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
......
......@@ -55,7 +55,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -131,7 +131,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
......
......@@ -53,7 +53,7 @@ process (GeglOperation *operation,
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
......
......@@ -160,7 +160,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
......
......@@ -160,7 +160,7 @@ bilateral_filter (GeglBuffer *src,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -195,7 +195,7 @@ snn_mean (GeglBuffer *src,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -130,7 +130,7 @@ process (GeglOperation *op,
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -80,7 +80,7 @@ file_tail1 = '
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -108,7 +108,7 @@ file_tail1 = '
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -97,7 +97,7 @@ file_tail1 = '
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -156,7 +156,7 @@ process (GeglOperation *operation,
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSinkClass *sink_class;
......
......@@ -641,7 +641,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -417,7 +417,7 @@ finalize (GObject *object)
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -182,7 +182,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -76,7 +76,7 @@ dispose (GObject *object)
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -163,7 +163,7 @@ finalize (GObject *object)
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GObjectClass *object_class;
......
......@@ -124,7 +124,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -71,7 +71,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -404,7 +404,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -151,7 +151,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSinkClass *sink_class;
......
......@@ -137,7 +137,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -46,7 +46,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSinkClass *sink_class;
......
......@@ -84,7 +84,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSinkClass *sink_class;
......
......@@ -217,7 +217,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -80,7 +80,7 @@ static void attach (GeglOperation *operation)
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
......
......@@ -87,7 +87,7 @@ static void attach (GeglOperation *operation)
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GObjectClass *object_class;
GeglOperationClass *operation_class;
......
......@@ -30,6 +30,8 @@ gegl_chant_double(x, "X", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
"Horizontal position")
gegl_chant_double(y, "Y", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
"Vertical position")
gegl_chant_double(scale, "scale", -G_MAXDOUBLE, G_MAXDOUBLE, 1.0,
"Scale 1:1 size")
gegl_chant_path(src, "Source", "",
"Source datafile (png, jpg, raw, svg, bmp, tif, ...)")
......@@ -49,11 +51,13 @@ struct _GeglChant
GeglNode *composite_op;
GeglNode *shift;
GeglNode *opacity;
GeglNode *scale;
GeglNode *load;
gchar *cached_path;
gdouble p_opacity;
gdouble p_scale;
gdouble p_x;
gdouble p_y;
gchar *p_composite_op;
......@@ -140,6 +144,15 @@ prepare (GeglOperation *operation)
}
}
if (o->scale != self->p_scale)
{
gegl_node_set (self->scale,
"x", o->scale,
"y", o->scale,
NULL);
self->p_scale= o->scale;
}
if (o->opacity != self->p_opacity)
{
gegl_node_set (self->opacity,
......@@ -158,6 +171,8 @@ prepare (GeglOperation *operation)
self->p_x = o->x;
self->p_y = o->y;
}
}
static void attach (GeglOperation *operation)
......@@ -178,6 +193,7 @@ static void attach (GeglOperation *operation)
NULL);
self->shift = gegl_node_new_child (gegl, "operation", "shift", NULL);
self->scale = gegl_node_new_child (gegl, "operation", "scale", NULL);
self->opacity = gegl_node_new_child (gegl, "operation", "opacity", NULL);
self->load = gegl_node_new_child (gegl,
......@@ -185,7 +201,8 @@ static void attach (GeglOperation *operation)
"string", "foo",
NULL);
gegl_node_link_many (self->load, self->opacity, self->shift, NULL);
gegl_node_link_many (self->load, self->scale, self->opacity, self->shift,
NULL);
gegl_node_link_many (self->input, self->composite_op, self->output, NULL);
gegl_node_connect_from (self->composite_op, "aux", self->shift, "output");
}
......@@ -205,7 +222,7 @@ finalize (GObject *object)
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GObjectClass *object_class;
GeglOperationClass *operation_class;
......
......@@ -116,7 +116,7 @@ static void attach (GeglOperation *operation)
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GObjectClass *object_class;
GeglOperationClass *operation_class;
......
......@@ -85,7 +85,7 @@ static void attach (GeglOperation *operation)
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GObjectClass *object_class;
GeglOperationClass *operation_class;
......
......@@ -108,7 +108,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -80,7 +80,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -450,7 +450,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -105,7 +105,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -81,7 +81,7 @@ process (GeglOperation *operation,
}
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSourceClass *source_class;
......
......@@ -272,7 +272,7 @@ prepare (GeglOperation *operation)
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GObjectClass *object_class;
GeglOperationClass *operation_class;
......
......@@ -96,7 +96,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -73,7 +73,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -111,7 +111,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -107,7 +107,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
......
......@@ -77,7 +77,7 @@ process (GeglOperation *op,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -172,7 +172,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -173,7 +173,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -205,7 +205,7 @@ median (GeglBuffer *src,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -166,7 +166,7 @@ static void c2g (GeglBuffer *src,
static void
operation_class_init (GeglChantClass *klass)
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
......
......@@ -191,7 +191,7 @@ process (GeglOperation *operation,
static void
operation_class_init (GeglChantClass *klass)