gegl r2765 - in trunk: . gegl/buffer
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2765 - in trunk: . gegl/buffer
- Date: Sun, 16 Nov 2008 16:36:24 +0000 (UTC)
Author: ok
Date: Sun Nov 16 16:36:24 2008
New Revision: 2765
URL: http://svn.gnome.org/viewvc/gegl?rev=2765&view=rev
Log:
* gegl/buffer/gegl-tile-handler.[ch]: (gegl_tile_handler_set_source):
added accessor method.
* gegl/buffer/gegl-tile-handler-chain.c:
(gegl_tile_handler_chain_rebind): use accesor methods/macros instead
of g_object_get and g_object_set.
Modified:
trunk/ChangeLog
trunk/gegl/buffer/gegl-tile-handler-chain.c
trunk/gegl/buffer/gegl-tile-handler.c
trunk/gegl/buffer/gegl-tile-handler.h
Modified: trunk/gegl/buffer/gegl-tile-handler-chain.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-handler-chain.c (original)
+++ trunk/gegl/buffer/gegl-tile-handler-chain.c Sun Nov 16 16:36:24 2008
@@ -143,14 +143,13 @@
handler = iter->data;
if (iter->next)
{
- source = g_object_ref (iter->next->data);
+ source = iter->next->data;
}
else
{
- g_object_get (tile_handler_chain, "source", &source, NULL);
+ source = gegl_tile_handler_get_source (tile_handler_chain);
}
- g_object_set (G_OBJECT (handler), "source", source, NULL);
- g_object_unref (source);
+ gegl_tile_handler_set_source (handler, source);
iter = iter->next;
}
}
Modified: trunk/gegl/buffer/gegl-tile-handler.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-handler.c (original)
+++ trunk/gegl/buffer/gegl-tile-handler.c Sun Nov 16 16:36:24 2008
@@ -82,6 +82,36 @@
}
}
+void
+gegl_tile_handler_set_source (GeglTileHandler *handler,
+ GeglTileSource *source)
+{
+ if (handler->source != NULL)
+ g_object_unref (handler->source);
+
+ if (source == NULL)
+ {
+ handler->source = NULL;
+ return;
+ }
+ handler->source = g_object_ref (source);
+
+ /* special case if we are the Traits subclass of Trait
+ * also set the source at the end of the chain.
+ */
+ if (GEGL_IS_TILE_HANDLER_CHAIN (handler))
+ {
+ GeglTileHandlerChain *tile_handler_chain = GEGL_TILE_HANDLER_CHAIN (handler);
+ GSList *iter = (void *) tile_handler_chain->chain;
+ while (iter && iter->next)
+ iter = iter->next;
+ if (iter)
+ {
+ gegl_tile_handler_set_source (GEGL_HANDLER (iter->data), handler->source);
+ }
+ }
+}
+
static void
set_property (GObject *gobject,
guint property_id,
@@ -93,24 +123,7 @@
switch (property_id)
{
case PROP_SOURCE:
- if (handler->source != NULL)
- g_object_unref (handler->source);
- handler->source = GEGL_TILE_SOURCE (g_value_dup_object (value));
-
- /* special case if we are the Traits subclass of Trait
- * also set the source at the end of the chain.
- */
- if (GEGL_IS_TILE_HANDLER_CHAIN (handler))
- {
- GeglTileHandlerChain *tile_handler_chain = GEGL_TILE_HANDLER_CHAIN (handler);
- GSList *iter = (void *) tile_handler_chain->chain;
- while (iter && iter->next)
- iter = iter->next;
- if (iter)
- {
- g_object_set (GEGL_HANDLER (iter->data), "source", handler->source, NULL);
- }
- }
+ gegl_tile_handler_set_source (handler, GEGL_TILE_SOURCE (g_value_get_object (value)));
return;
default:
Modified: trunk/gegl/buffer/gegl-tile-handler.h
==============================================================================
--- trunk/gegl/buffer/gegl-tile-handler.h (original)
+++ trunk/gegl/buffer/gegl-tile-handler.h Sun Nov 16 16:36:24 2008
@@ -48,6 +48,11 @@
GType gegl_tile_handler_get_type (void) G_GNUC_CONST;
+void
+gegl_tile_handler_set_source (GeglTileHandler *handler,
+ GeglTileSource *source);
+
+
#define gegl_tile_handler_get_source(handler) (((GeglTileHandler*)handler)->source)
#define gegl_tile_handler_chain_up(handler,command,x,y,z,data) (gegl_tile_handler_get_source(handler)?gegl_tile_source_command(gegl_tile_handler_get_source(handler), command, x, y, z, data):NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]