[gegl] Remove ifdeffed away code that has been dead for years
- From: Martin Nordholts <martinn src gnome org>
- To: svn-commits-list gnome org
- Subject: [gegl] Remove ifdeffed away code that has been dead for years
- Date: Mon, 22 Jun 2009 15:12:46 -0400 (EDT)
commit 35ab56189a8b80f8871c40c83fdf1b9a848a9011
Author: Martin Nordholts <martinn src gnome org>
Date: Mon Jun 22 21:01:54 2009 +0200
Remove ifdeffed away code that has been dead for years
bindings/rgegl/src/rgegl-node.c | 53 ------
bindings/rgegl/src/rgegl-rectangle.c | 25 ---
examples/util/gegl-view.c | 10 -
gegl/gegl-xml.c | 299 ----------------------------------
tools/operation_reference.c | 11 --
5 files changed, 0 insertions(+), 398 deletions(-)
---
diff --git a/bindings/rgegl/src/rgegl-node.c b/bindings/rgegl/src/rgegl-node.c
index d7aef5c..b4666aa 100644
--- a/bindings/rgegl/src/rgegl-node.c
+++ b/bindings/rgegl/src/rgegl-node.c
@@ -70,28 +70,6 @@ cnode_get_producer (self, pad_name)
return Qnil;
}
-#if 0
-static VALUE
-cnode_get_consumer (self, pad_name)
- VALUE self, pad_name;
-{
- GeglNode *node;
- gchar *pad;
-
- node = gegl_node_get_consumer (_SELF (self), RVAL2CSTR(pad_name), &pad);
- if (node)
- {
- VALUE ary;
- ary = rb_ary_new();
- rb_ary_push (ary, GOBJ2RVAL(G_OBJECT(node)));
- rb_ary_push (ary, rb_str_new2(pad));
- g_free(pad);
- return ary;
- }
- return Qnil;
-}
-#endif
-
static VALUE
cnode_get_consumers (self, pad_name)
VALUE self, pad_name;
@@ -358,37 +336,6 @@ cnode_to_xml (self,
return CSTR2RVAL (xml);
}
-#if 0
-gpointer gegl_node_get_cache (GeglNode *node);
-void gegl_buffer_save (gpointer buffer,
- const gchar *path,
- GeglRectangle *roi);
-void gegl_buffer_load (gpointer buffer,
- const gchar *path);
-
-
-static VALUE
-cnode_save_cache (self,
- path)
- VALUE self, path;
-{
- /*gpointer cache = gegl_node_get_cache (_SELF (self));
- gegl_buffer_save (cache, RVAL2CSTR(path), NULL);*/
- return Qnil;
-}
-
-static VALUE
-cnode_load_cache (self,
- path)
- VALUE self, path;
-{
- /*gpointer cache = gegl_node_get_cache (_SELF (self));
- gegl_buffer_load (cache, RVAL2CSTR(path));*/
- /* FIXME: fix what is legal data for cache (or do it in load?)*/
- return Qnil;
-}
-#endif
-
gchar *gegl_to_dot (GeglNode *self);
static VALUE
diff --git a/bindings/rgegl/src/rgegl-rectangle.c b/bindings/rgegl/src/rgegl-rectangle.c
index 0b8aa1d..c2b5f1a 100644
--- a/bindings/rgegl/src/rgegl-rectangle.c
+++ b/bindings/rgegl/src/rgegl-rectangle.c
@@ -51,25 +51,6 @@ geglrect_initialize(self, x, y, width, height)
G_INITIALIZE(self, &new);
return Qnil;
}
-#if 0
-static VALUE
-geglrect_intersect(self, other)
- VALUE self, other;
-{
- GeglRectangle dest;
- gboolean ret = gegl_rect_intersect(&dest, _SELF(self), _SELF(other));
- return ret ? BOXED2RVAL(&dest, GEGL_TYPE_RECTANGLE) : Qnil;
-}
-
-static VALUE
-geglrect_union(self, other)
- VALUE self, other;
-{
- GeglRectangle dest;
- gegl_rect_bounding_box (&dest, _SELF(self), _SELF(other));
- return BOXED2RVAL(&dest, GEGL_TYPE_RECTANGLE);
-}
-#endif
/* Struct accessors */
static VALUE
@@ -147,12 +128,6 @@ Init_gegl_rectangle(VALUE module)
VALUE geglRectangle = G_DEF_CLASS(GEGL_TYPE_RECTANGLE, "Rectangle", module);
rb_define_method(geglRectangle, "initialize", geglrect_initialize, 4);
-#if 0
- rb_define_method(geglRectangle, "intersect", geglrect_intersect, 1);
- rb_define_alias(geglRectangle, "&", "intersect");
- rb_define_method(geglRectangle, "union", geglrect_union, 1);
- rb_define_alias(geglRectangle, "|", "union");
-#endif
rb_define_method(geglRectangle, "x", geglrect_x, 0);
rb_define_method(geglRectangle, "y", geglrect_y, 0);
rb_define_method(geglRectangle, "width", geglrect_w, 0);
diff --git a/examples/util/gegl-view.c b/examples/util/gegl-view.c
index 45a4064..21f356d 100644
--- a/examples/util/gegl-view.c
+++ b/examples/util/gegl-view.c
@@ -235,9 +235,6 @@ set_property (GObject *gobject,
case PROP_NODE:
if (priv->node)
{
-#if 0
- gegl_node_disable_cache (priv->node); /* FIXME: should we really? */
-#endif
g_object_unref (priv->node);
}
@@ -508,13 +505,6 @@ gegl_view_repaint (GeglView *view)
roi.width = ceil(widget->allocation.width / priv->scale+1);
roi.height = ceil(widget->allocation.height / priv->scale+1);
-#if 0
- /* forget all already queued repaints */
- gegl_cache_dequeue (gegl_node_get_cache (priv->node), NULL);
- /* then enqueue our selves */
- gegl_cache_enqueue (gegl_node_get_cache (priv->node), roi);
-#endif
-
if (priv->monitor_id == 0)
{
priv->monitor_id = g_idle_add_full (G_PRIORITY_LOW,
diff --git a/gegl/gegl-xml.c b/gegl/gegl-xml.c
index a753dc4..bd40f20 100644
--- a/gegl/gegl-xml.c
+++ b/gegl/gegl-xml.c
@@ -544,305 +544,6 @@ free_clone_id (gpointer key,
g_free (value);
}
-#if 0
-
-static void
-tuple_old (GString *buf,
- const gchar *key,
- const gchar *value)
-{
- g_assert (key);
-
- if (value)
- {
- gchar *text = g_markup_escape_text (value, -1);
- gchar *p;
-
- g_string_append_c (buf, ' ');
- g_string_append (buf, key);
- g_string_append_c (buf, '=');
- g_string_append_c (buf, '\'');
- for (p = text; *p; p++)
- {
- if (*p == '\n')
- g_string_append (buf, " ");
- else
- g_string_append_c (buf, *p);
- }
- g_string_append_c (buf, '\'');
-
- g_free (text);
- }
-}
-
-static void
-encode_node_attributes_old (SerializeState *ss,
- GeglNode *node,
- const gchar *id)
-{
- GParamSpec **properties;
- guint n_properties;
- gchar *class;
- gint i;
-
- properties = gegl_list_properties (gegl_node_get_operation (node),
- &n_properties);
-
- if (!ss->terse)
- {
- gegl_node_get (node, "operation", &class, NULL);
- tuple_old (ss->buf, "operation", class);
- g_free (class);
- }
-
- for (i = 0; i < n_properties; i++)
- {
- if (strcmp (properties[i]->name, "input") &&
- strcmp (properties[i]->name, "output") &&
- strcmp (properties[i]->name, "aux"))
- {
- if (g_type_is_a (G_PARAM_SPEC_TYPE (properties[i]),
- GEGL_TYPE_PARAM_PATH))
- {
- gchar *value;
- gegl_node_get (node, properties[i]->name, &value, NULL);
-
- if (value)
- {
- if (ss->path_root &&
- !strncmp (ss->path_root, value, strlen (ss->path_root)))
- {
- tuple_old (ss->buf, properties[i]->name, &value[strlen (ss->path_root)]);
- }
- else
- {
- tuple_old (ss->buf, properties[i]->name, value);
- }
- }
-
- g_free (value);
- }
- else if (properties[i]->value_type == G_TYPE_FLOAT)
- {
- gfloat value;
- gchar str[G_ASCII_DTOSTR_BUF_SIZE];
- gegl_node_get (node, properties[i]->name, &value, NULL);
- g_ascii_dtostr (str, sizeof(str), value);
- tuple_old (ss->buf, properties[i]->name, str);
- }
- else if (properties[i]->value_type == G_TYPE_DOUBLE)
- {
- gdouble value;
- gchar str[G_ASCII_DTOSTR_BUF_SIZE];
- gegl_node_get (node, properties[i]->name, &value, NULL);
- g_ascii_dtostr (str, sizeof(str), value);
- tuple_old (ss->buf, properties[i]->name, str);
- }
- else if (properties[i]->value_type == G_TYPE_INT)
- {
- gint value;
- gchar str[64];
- gegl_node_get (node, properties[i]->name, &value, NULL);
- g_snprintf (str, sizeof (str), "%i", value);
- tuple_old (ss->buf, properties[i]->name, str);
- }
- else if (properties[i]->value_type == G_TYPE_BOOLEAN)
- {
- gboolean value;
- gegl_node_get (node, properties[i]->name, &value, NULL);
- if (value)
- {
- tuple_old (ss->buf, properties[i]->name, "true");
- }
- else
- {
- tuple_old (ss->buf, properties[i]->name, "false");
- }
- }
- else if (properties[i]->value_type == G_TYPE_STRING)
- {
- gchar *value;
- gegl_node_get (node, properties[i]->name, &value, NULL);
- tuple_old (ss->buf, properties[i]->name, value);
- g_free (value);
- }
- else if (properties[i]->value_type == GEGL_TYPE_COLOR)
- {
- GeglColor *color;
- gchar *value;
- gegl_node_get (node, properties[i]->name, &color, NULL);
- g_object_get (color, "string", &value, NULL);
- g_object_unref (color);
- tuple_old (ss->buf, properties[i]->name, value);
- g_free (value);
- }
- else
- {
- g_warning ("%s: serialization of %s proeprties not implemented",
- properties[i]->name, g_type_name (properties[i]->value_type));
- }
- }
- }
- if (id != NULL)
- tuple_old (ss->buf, "id", id);
-
- g_free (properties);
-}
-
-static void
-add_stack_old (SerializeState *ss,
- gint indent,
- GeglNode *head)
-{
- if (GEGL_IS_NODE (head))
- {
- GeglNode *iter = head;
-
- while (iter)
- {
- GeglPad *input, *aux;
- const gchar *id = NULL;
-
- input = gegl_node_get_pad (iter, "input");
- aux = gegl_node_get_pad (iter, "aux");
-
- if (gegl_node_get_num_sinks (iter) > 1)
- {
- const gchar *new_id = g_hash_table_lookup (ss->clones, iter);
- if (new_id)
- {
- ind; g_string_append (ss->buf, "<clone ref='");
- g_string_append (ss->buf, new_id);
- g_string_append (ss->buf, "'/>\n");
- return; /* terminate the stack, the cloned part is already
- serialized */
- }
- else
- {
- gchar temp_id[64];
- g_snprintf (temp_id, sizeof (temp_id),
- "clone%i", ss->clone_count++);
- id = g_strdup (temp_id);
- g_hash_table_insert (ss->clones, iter, (gchar *) id);
- /* the allocation is freed by the hash table */
- }
- }
-
- if (aux &&
- gegl_pad_get_connected_to (aux))
- {
- GeglPad *source_pad;
- GeglNode *source_node;
- source_pad = gegl_pad_get_connected_to (aux);
- source_node = gegl_pad_get_node (source_pad);
- {
- GeglNode *graph = g_object_get_data (G_OBJECT (source_node),
- "graph");
- if (graph)
- source_node = graph;
- }
- ind; if (ss->terse)
- {
- g_string_append (ss->buf, "<");
- g_string_append (ss->buf, gegl_node_get_operation (iter));
- }
- else
- {
- g_string_append (ss->buf, "<node");
- }
- encode_node_attributes_old (ss, iter, id);
- g_string_append (ss->buf, ">\n");
- add_stack_old (ss, indent + 4, source_node);
-
- ind; if (ss->terse)
- {
- g_string_append (ss->buf, "</");
- g_string_append (ss->buf, gegl_node_get_operation (iter));
- g_string_append (ss->buf, ">\n");
- }
- else
- {
- g_string_append (ss->buf, "</node\n>");
- }
- }
- else
- {
- gchar *class;
- gegl_node_get (iter, "operation", &class, NULL);
-
- if (class)
- {
- if (strcmp (class, "nop") &&
- strcmp (class, "clone"))
- {
- ind; if (ss->terse)
- {
- g_string_append (ss->buf, "<");
- g_string_append (ss->buf, class);
- }
- else
- {
- g_string_append (ss->buf, "<node");
- }
-
- encode_node_attributes_old (ss, iter, id);
- g_string_append (ss->buf, "/>\n");
- }
- g_free (class);
- }
- }
- id = NULL;
- if (input)
- {
- GeglPad *source_pad;
- source_pad = gegl_pad_get_connected_to (input);
- if (source_pad)
- {
- GeglNode *source_node = gegl_pad_get_node (source_pad);
- GeglNode *graph = g_object_get_data (G_OBJECT (source_node),
- "graph");
- if (graph)
- source_node = graph;
- iter = source_node;
- }
- else
- iter = NULL;
- }
- else
- iter = NULL;
- }
- }
-}
-
-
-gchar *
-gegl_node_to_xml_old (GeglNode *gegl,
- const gchar *path_root)
-{
- SerializeState ss;
-
- ss.buf = g_string_new ("");
- ss.path_root = path_root;
- ss.clone_count = 0;
- ss.clones = g_hash_table_new (NULL, NULL);
- ss.terse = TRUE;
-
- gegl = gegl_node_get_output_proxy (gegl, "output");
-
- g_string_append (ss.buf, "<?xml version='1.0' encoding='UTF-8'?>\n");
- g_string_append (ss.buf, "<gegl>\n");
-
- add_stack_old (&ss, 2, gegl);
-
- g_string_append (ss.buf, "</gegl>\n");
-
- g_hash_table_foreach (ss.clones, free_clone_id, NULL);
- g_hash_table_destroy (ss.clones);
-
- return g_string_free (ss.buf, FALSE);
-}
-#endif
-
static void
xml_attr (GString *buf,
const gchar *key,
diff --git a/tools/operation_reference.c b/tools/operation_reference.c
index 41cf6c1..6b08528 100644
--- a/tools/operation_reference.c
+++ b/tools/operation_reference.c
@@ -212,17 +212,6 @@ static gchar *html_top = "<html>\n<head>\n<title>GEGL operations</title>\n<link
"</style>\n</head>\n\n<body>\n<div class='paper'>\n<div class='content'>\n";
static gchar *html_bottom = "</div>\n</div>\n</body>\n</html>\n";
-#if 0
-static void category_menu_item (gpointer key,
- gpointer value,
- gpointer user_data)
-{
- gchar *category = key;
- if (!strcmp (category, "hidden"))
- return;
- g_print ("<li><a href='#cat_%s'> %s</a></li>\n", category, category);
-}
-#endif
static void category_index (gpointer key,
gpointer value,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]