gegl r2653 - in trunk: . bin examples gegl gegl/operation gegl/property-types operations/common operations/external operations/workshop



Author: ok
Date: Mon Oct 20 22:51:24 2008
New Revision: 2653
URL: http://svn.gnome.org/viewvc/gegl?rev=2653&view=rev

Log:
* gegl/property-types/gegl-vector.c: renamed this ..
* gegl/property-types/gegl-vector.h: .. and this to ..
* gegl/property-types/gegl-path.c: .. this and ..
* gegl/property-types/gegl-path.h: .. this.
These files needed updating:
* bin/editor.c:
* bin/gegl-node-editor.c:
* bin/gegl-spiro.c:
* bin/gegl.c:
* examples/gegl-paint.c:
* gegl/gegl-chant.h:
* gegl/gegl-types.h:
* gegl/gegl-xml.c:
* gegl/operation/gegl-operation.h:
* gegl/property-types/Makefile.am:
* gegl/property-types/gegl-paramspecs.c:
* gegl/property-types/gegl-paramspecs.h:
* operations/common/layer.c:
* operations/common/load.c:
* operations/common/magick-load.c:
* operations/common/raw-load.c:
* operations/external/ff-load.c:
* operations/external/fill.c: 
* operations/external/jpg-load.c:
* operations/external/openraw.c:
* operations/external/png-load.c:
* operations/external/svg-load.c:
* operations/external/v4l.c:
* operations/workshop/stroke.c:


Added:
   trunk/gegl/property-types/gegl-path.c   (contents, props changed)
      - copied, changed from r2651, /trunk/gegl/property-types/gegl-vector.c
   trunk/gegl/property-types/gegl-path.h   (contents, props changed)
      - copied, changed from r2651, /trunk/gegl/property-types/gegl-vector.h
Removed:
   trunk/gegl/property-types/gegl-vector.c
   trunk/gegl/property-types/gegl-vector.h
Modified:
   trunk/ChangeLog
   trunk/bin/editor.c
   trunk/bin/gegl-node-editor.c
   trunk/bin/gegl-spiro.c
   trunk/bin/gegl.c
   trunk/examples/gegl-paint.c
   trunk/gegl/gegl-chant.h
   trunk/gegl/gegl-types.h
   trunk/gegl/gegl-xml.c
   trunk/gegl/operation/gegl-operation.h
   trunk/gegl/property-types/Makefile.am
   trunk/gegl/property-types/gegl-paramspecs.c
   trunk/gegl/property-types/gegl-paramspecs.h
   trunk/operations/common/layer.c
   trunk/operations/common/load.c
   trunk/operations/common/magick-load.c
   trunk/operations/common/raw-load.c
   trunk/operations/external/ff-load.c
   trunk/operations/external/fill.c
   trunk/operations/external/jpg-load.c
   trunk/operations/external/openraw.c
   trunk/operations/external/png-load.c
   trunk/operations/external/svg-load.c
   trunk/operations/external/v4l.c
   trunk/operations/workshop/stroke.c

Modified: trunk/bin/editor.c
==============================================================================
--- trunk/bin/editor.c	(original)
+++ trunk/bin/editor.c	Mon Oct 20 22:51:24 2008
@@ -82,7 +82,7 @@
   return FALSE;
 }
 
-#include "gegl-vector.h"
+#include "gegl-path.h"
 
 Editor editor;
 
@@ -123,8 +123,8 @@
 
 }
 
-static void foreach_cairo (const GeglVectorKnot *knot,
-                           gpointer              cr)
+static void foreach_cairo (const GeglPathItem *knot,
+                           gpointer            cr)
 {
   switch (knot->type)
     {
@@ -147,13 +147,13 @@
     }
 }
 
-static void gegl_vector_cairo_play (GeglVector *vector,
-                                    cairo_t *cr)
+static void gegl_path_cairo_play (GeglPath *vector,
+                                  cairo_t  *cr)
 {
-  gegl_vector_flat_knot_foreach (vector, foreach_cairo, cr);
+  gegl_path_foreach_flat (vector, foreach_cairo, cr);
 }
 
-static void get_loc (const GeglVectorKnot *knot, 
+static void get_loc (const GeglPathItem *knot, 
                      gdouble        *x,
                      gdouble        *y)
 {
@@ -170,7 +170,7 @@
 }
 
 static gboolean path_editing_active = FALSE;
-static GeglVector *da_vector = NULL;
+static GeglPath *da_vector = NULL;
 static gint     selected_no = 0;
 static gint     drag_no = -1;
 static gint     drag_sub = 0;
@@ -186,14 +186,14 @@
     {
       case GDK_i:
         {
-          GeglVectorKnot knot = *gegl_vector_get_knot (da_vector, selected_no);
+          GeglPathItem knot = *gegl_path_get (da_vector, selected_no);
           knot.point[0].x += 10;
-          gegl_vector_add_knot (da_vector, selected_no, &knot);
+          gegl_path_insert (da_vector, selected_no, &knot);
           selected_no ++;
         }
         return TRUE;
       case GDK_BackSpace:
-        gegl_vector_remove_knot (da_vector, selected_no);
+        gegl_path_remove (da_vector, selected_no);
         if (selected_no>0)
           selected_no --;
         else
@@ -201,7 +201,7 @@
         return TRUE;
       case GDK_m:
         {
-          GeglVectorKnot knot = *gegl_vector_get_knot (da_vector, selected_no);
+          GeglPathItem knot = *gegl_path_get (da_vector, selected_no);
           switch (knot.type)
             {
               case 'v':
@@ -221,7 +221,7 @@
                 break;
             }
           g_print ("setting %c\n", knot.type);
-          gegl_vector_replace_knot (da_vector, selected_no, &knot);
+          gegl_path_replace_knot (da_vector, selected_no, &knot);
         }
         return TRUE;
       default:
@@ -241,9 +241,9 @@
   gdouble ex, ey;
 
   cairo_t *cr = gdk_cairo_create (widget->window);
-  GeglVector *vector;
-  const GeglVectorKnot *knot;
-  const GeglVectorKnot *prev_knot = NULL;
+  GeglPath *vector;
+  const GeglPathItem *knot;
+  const GeglPathItem *prev_knot = NULL;
   gint i;
   gint n;
 
@@ -261,17 +261,17 @@
   cairo_scale (cr, scale, scale);
   cairo_translate (cr, tx, ty);*/
 
-  gegl_node_get (data, "vector", &vector, NULL);
+  gegl_node_get (data, "path", &vector, NULL);
 
-  gegl_vector_cairo_play (vector, cr);
+  gegl_path_cairo_play (vector, cr);
 
-  n= gegl_vector_get_knot_count (vector);
+  n= gegl_path_get_count (vector);
 
   prev_knot = NULL;
   for (i=0;i<n;i++)
     {
       gdouble x, y;
-      knot = gegl_vector_get_knot (vector, i);
+      knot = gegl_path_get (vector, i);
       if (knot->type == 'C')
         {
 
@@ -347,8 +347,8 @@
           case '*':
 foo:
             {
-              GeglVectorKnot knot = {'*', {{ex, ey}}};
-              gegl_vector_add_knot (vector, -1, &knot);
+              GeglPathItem knot = {'*', {{ex, ey}}};
+              gegl_path_insert (vector, -1, &knot);
               selected_no = drag_no = n;
               drag_sub = 0;
               prevx = ex;
@@ -358,8 +358,8 @@
           case 'o':
           case 'O':
             {
-              GeglVectorKnot knot = {'o', {{ex, ey}}};
-              gegl_vector_add_knot (vector, -1, &knot);
+              GeglPathItem knot = {'o', {{ex, ey}}};
+              gegl_path_insert (vector, -1, &knot);
               selected_no = drag_no = n;
               drag_sub = 0;
               prevx = ex;
@@ -371,8 +371,8 @@
           case 'l':
           case 'L':
             {
-              GeglVectorKnot knot = {'L', {{ex, ey}}};
-              gegl_vector_add_knot (vector, -1, &knot);
+              GeglPathItem knot = {'L', {{ex, ey}}};
+              gegl_path_insert (vector, -1, &knot);
               selected_no = drag_no = n;
               drag_sub = 0;
               prevx = ex;
@@ -409,8 +409,8 @@
       gdouble ex, ey;
       gdouble rx, ry;
 
-      GeglVector *vector;
-      GeglVectorKnot  new_knot;
+      GeglPath *vector;
+      GeglPathItem  new_knot;
 
       g_object_get (G_OBJECT (widget),
                     "x", &x,
@@ -425,45 +425,45 @@
       rx = prevx - ex;
       ry = prevy - ey;
 
-      gegl_node_get (data, "vector", &vector, NULL);
+      gegl_node_get (data, "path", &vector, NULL);
 
       if (drag_sub == 0)
         {
-          new_knot = *gegl_vector_get_knot (vector, drag_no);
+          new_knot = *gegl_path_get (vector, drag_no);
           if (new_knot.type == 'C')
             {
               new_knot.point[1].x -= rx;
               new_knot.point[1].y -= ry;
               new_knot.point[2].x -= rx;
               new_knot.point[2].y -= ry;
-              gegl_vector_replace_knot (vector, drag_no, &new_knot);
-              new_knot = *gegl_vector_get_knot (vector, drag_no + 1);
+              gegl_path_replace_knot (vector, drag_no, &new_knot);
+              new_knot = *gegl_path_get (vector, drag_no + 1);
               new_knot.point[0].x -= rx;
               new_knot.point[0].y -= ry;
-              gegl_vector_replace_knot (vector, drag_no + 1, &new_knot);
+              gegl_path_replace_knot (vector, drag_no + 1, &new_knot);
             }
           else
             {
               new_knot.point[0].x -= rx;
               new_knot.point[0].y -= ry;
-              gegl_vector_replace_knot (vector, drag_no, &new_knot);
+              gegl_path_replace_knot (vector, drag_no, &new_knot);
             }
           gtk_widget_queue_draw (widget);
         }
       else if (drag_sub == 1)
         {
-          new_knot = *gegl_vector_get_knot (vector, drag_no);
+          new_knot = *gegl_path_get (vector, drag_no);
           new_knot.point[1].x -= rx;
           new_knot.point[1].y -= ry;
-          gegl_vector_replace_knot (vector, drag_no, &new_knot);
+          gegl_path_replace_knot (vector, drag_no, &new_knot);
           gtk_widget_queue_draw (widget);
         }
       else if (drag_sub == -1)
         {
-          new_knot = *gegl_vector_get_knot (vector, drag_no + 1);
+          new_knot = *gegl_path_get (vector, drag_no + 1);
           new_knot.point[0].x -= rx;
           new_knot.point[0].y -= ry;
-          gegl_vector_replace_knot (vector, drag_no + 1, &new_knot);
+          gegl_path_replace_knot (vector, drag_no + 1, &new_knot);
           gtk_widget_queue_draw (widget);
         }
 
@@ -488,9 +488,9 @@
   gdouble tx, ty;
 
   cairo_t *cr = gdk_cairo_create (widget->window);
-  GeglVector *vector;
-  const GeglVectorKnot *knot;
-  const GeglVectorKnot *prev_knot = NULL;
+  GeglPath *vector;
+  const GeglPathItem *knot;
+  const GeglPathItem *prev_knot = NULL;
   gint i;
   gint n;
 
@@ -505,16 +505,16 @@
   cairo_scale (cr, scale, scale);
   cairo_translate (cr, tx, ty);
 
-  gegl_node_get (user_data, "vector", &vector, NULL);
+  gegl_node_get (user_data, "path", &vector, NULL);
 
-  gegl_vector_cairo_play (vector, cr);
+  gegl_path_cairo_play (vector, cr);
 
-  n= gegl_vector_get_knot_count (vector);
+  n= gegl_path_get_count (vector);
   prev_knot = NULL;
   for (i=0;i<n;i++)
     {
       gdouble x, y;
-      knot = gegl_vector_get_knot (vector, i);
+      knot = gegl_path_get (vector, i);
       if (knot->type == 'C')
         {
           get_loc (prev_knot, &x, &y);
@@ -533,12 +533,12 @@
   cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.5);
   cairo_stroke (cr);
 
-  n= gegl_vector_get_knot_count (vector);
+  n= gegl_path_get_count (vector);
   prev_knot = NULL;
   for (i=0;i<n;i++)
     {
       gdouble x, y;
-      knot = gegl_vector_get_knot (vector, i);
+      knot = gegl_path_get (vector, i);
       if (knot->type == 'C')
         {
           x = knot->point[0].x;
@@ -636,8 +636,8 @@
 
   if (g_str_equal (opname, "gegl:fill"))
     {
-      GeglVector *vector;
-      gegl_node_get (node, "vector", &vector, NULL);
+      GeglPath *vector;
+      gegl_node_get (node, "path", &vector, NULL);
 
       da_vector = vector;
       g_object_unref (vector);
@@ -674,9 +674,9 @@
 
   if (g_str_equal (operation, "gegl:fill"))
     {
-      GeglVector *vector;
+      GeglPath *vector;
 
-      gegl_node_get (node, "vector", &vector, NULL);
+      gegl_node_get (node, "path", &vector, NULL);
       g_object_unref (vector);
     }
 

Modified: trunk/bin/gegl-node-editor.c
==============================================================================
--- trunk/bin/gegl-node-editor.c	(original)
+++ trunk/bin/gegl-node-editor.c	Mon Oct 20 22:51:24 2008
@@ -31,7 +31,7 @@
 
 #include "gegl-node-editor.h"
 #include "gegl-paramspecs.h"
-#include "gegl-vector.h"
+#include "gegl-path.h"
 
 
 enum
@@ -410,10 +410,10 @@
 
 
 static GtkWidget *
-type_editor_path (GtkSizeGroup *col1,
-                  GtkSizeGroup *col2,
-                  GeglNode     *node,
-                  GParamSpec   *param_spec)
+type_editor_file_path (GtkSizeGroup *col1,
+                       GtkSizeGroup *col2,
+                       GeglNode     *node,
+                       GParamSpec   *param_spec)
 {
   GObject   *config = G_OBJECT (node);
   GtkWidget *hbox   = gtk_hbox_new (FALSE, 5);
@@ -827,17 +827,17 @@
   GParamSpec  *param_spec  = data;
   GeglNode    *node        = g_object_get_data (G_OBJECT (entry), "node");
   const gchar *prop_name   = param_spec->name;
-  GeglVector *vector;
+  GeglPath *vector;
 
   gegl_node_get (node, prop_name, &vector, NULL);
-  gegl_vector_clear (vector);
-  gegl_vector_parse_svg_path (vector, gtk_entry_get_text (GTK_ENTRY (entry)));
+  gegl_path_clear (vector);
+  gegl_path_parse_string (vector, gtk_entry_get_text (GTK_ENTRY (entry)));
   g_object_unref (vector);
 }
 
 
 static GtkWidget *
-type_editor_vector (GtkSizeGroup *col1,
+type_editor_path (GtkSizeGroup *col1,
                     GtkSizeGroup *col2,
                     GeglNode     *node,
                     GParamSpec   *param_spec)
@@ -852,10 +852,10 @@
                     (gpointer) param_spec);
     {
       gchar *value;
-      GeglVector *vector;
+      GeglPath *vector;
 
       gegl_node_get (node, param_spec->name, &vector, NULL);
-      value = gegl_vector_to_svg_path (vector);
+      value = gegl_path_to_string (vector);
       gtk_entry_set_text (GTK_ENTRY (entry), value);
       g_object_unref (vector);
       g_free (value);
@@ -892,9 +892,9 @@
         {
           GtkWidget *prop_editor;
 
-          if (g_type_is_a (G_PARAM_SPEC_TYPE (properties[i]), GEGL_TYPE_PARAM_PATH))
+          if (g_type_is_a (G_PARAM_SPEC_TYPE (properties[i]), GEGL_TYPE_PARAM_FILE_PATH))
             {
-              prop_editor = type_editor_path (col1, col2, node, properties[i]);
+              prop_editor = type_editor_file_path (col1, col2, node, properties[i]);
             }
           else if (g_type_is_a (G_PARAM_SPEC_TYPE (properties[i]), GEGL_TYPE_PARAM_MULTILINE))
             {
@@ -924,9 +924,9 @@
             {
               prop_editor = type_editor_string (col1, col2, node, properties[i]);
             }
-          else if (properties[i]->value_type == GEGL_TYPE_VECTOR)
+          else if (properties[i]->value_type == GEGL_TYPE_PATH)
             {
-              prop_editor = type_editor_vector (col1, col2, node, properties[i]);
+              prop_editor = type_editor_path (col1, col2, node, properties[i]);
             }
           else 
             {

Modified: trunk/bin/gegl-spiro.c
==============================================================================
--- trunk/bin/gegl-spiro.c	(original)
+++ trunk/bin/gegl-spiro.c	Mon Oct 20 22:51:24 2008
@@ -18,7 +18,7 @@
 
 #include "gegl-spiro.h"
 #include <gegl/gegl.h>
-#include "gegl-vector.h"
+#include "gegl-path.h"
 #include <math.h>
 
 #include <spiroentrypoints.h>
@@ -41,16 +41,16 @@
 
 	/* I'm not entirely sure what this does -- I just leave it blank */
     void (*mark_knot)(bezctx *bc, int knot_idx);
-    GeglVectorPath *path;
+    GeglPathList *path;
 } bezcontext;
 
 static void moveto (bezctx *bc, double x, double y, int is_open)
 {
-  bezcontext.path = gegl_vector_path_add (bezcontext.path, 'M', x, y);
+  bezcontext.path = gegl_path_list_append (bezcontext.path, 'M', x, y);
 }
 static void lineto (bezctx *bc, double x, double y)
 {
-  bezcontext.path = gegl_vector_path_add (bezcontext.path, 'L', x, y);
+  bezcontext.path = gegl_path_list_append (bezcontext.path, 'L', x, y);
 }
 static void quadto (bezctx *bc, double x1, double y1, double x2, double y2)
 {
@@ -61,12 +61,12 @@
                     double x2, double y2,
  		    double x3, double y3)
 {
-  bezcontext.path = gegl_vector_path_add (bezcontext.path, 'C', x1, y1, x2, y2, x3, y3);
+  bezcontext.path = gegl_path_list_append (bezcontext.path, 'C', x1, y1, x2, y2, x3, y3);
 }
 
-static GeglVectorPath *gegl_vector_spiro_flatten (GeglVectorPath *original)
+static GeglPathList *gegl_path_spiro_flatten (GeglPathList *original)
 {
-  GeglVectorPath *iter;
+  GeglPathList *iter;
   spiro_cp *points;
   gboolean is_spiro = TRUE;
   gint count;
@@ -155,12 +155,12 @@
   return bezcontext.path;
 }
 
-static GeglVectorPath *
+static GeglPathList *
 points_to_bezier_path (gdouble  coord_x[],
                        gdouble  coord_y[],
                        gint     n_coords)
 {
-  GeglVectorPath *ret = NULL;
+  GeglPathList *ret = NULL;
   gint    i;
   gdouble smooth_value;
  
@@ -169,7 +169,7 @@
   if (!n_coords)
     return NULL;
 
-  ret = gegl_vector_path_add (ret, 'M', coord_x[0], coord_y[0]);
+  ret = gegl_path_list_append (ret, 'M', coord_x[0], coord_y[0]);
 
   for (i=1;i<n_coords;i++)
     {
@@ -231,7 +231,7 @@
             ctrl2_y = y2;
           }
 
-        ret = gegl_vector_path_add (ret, 'C', ctrl1_x, ctrl1_y,
+        ret = gegl_path_list_append (ret, 'C', ctrl1_x, ctrl1_y,
                                               ctrl2_x, ctrl2_y,
                                               x2,      y2);
       }
@@ -240,10 +240,10 @@
 }
 
 
-static GeglVectorPath *gegl_vector_spiro_flatten2 (GeglVectorPath *original)
+static GeglPathList *gegl_path_spiro_flatten2 (GeglPathList *original)
 {
-  GeglVectorPath *ret;
-  GeglVectorPath *iter;
+  GeglPathList *ret;
+  GeglPathList *iter;
   gdouble *coordsx;
   gdouble *coordsy;
   gboolean is_spiro = TRUE;
@@ -293,14 +293,14 @@
   if (done)
     return;
   done = TRUE;
-  gegl_vector_add_knot_type ('v', 1, "spiro corner");
-  gegl_vector_add_knot_type ('o', 1, "spiro g4");
-  gegl_vector_add_knot_type ('O', 1, "spiro g2");
-  gegl_vector_add_knot_type ('[', 1, "spiro left");
-  gegl_vector_add_knot_type (']', 1, "spiro right");
+  gegl_path_add_type ('v', 1, "spiro corner");
+  gegl_path_add_type ('o', 1, "spiro g4");
+  gegl_path_add_type ('O', 1, "spiro g2");
+  gegl_path_add_type ('[', 1, "spiro left");
+  gegl_path_add_type (']', 1, "spiro right");
 
-  gegl_vector_add_knot_type ('*', 1, "path");
+  gegl_path_add_type ('*', 1, "path");
 
-  gegl_vector_add_flattener (gegl_vector_spiro_flatten);
-  gegl_vector_add_flattener (gegl_vector_spiro_flatten2);
+  gegl_path_add_flattener (gegl_path_spiro_flatten);
+  gegl_path_add_flattener (gegl_path_spiro_flatten2);
 }

Modified: trunk/bin/gegl.c
==============================================================================
--- trunk/bin/gegl.c	(original)
+++ trunk/bin/gegl.c	Mon Oct 20 22:51:24 2008
@@ -49,7 +49,7 @@
 #endif
 
 #define DEFAULT_COMPOSITION \
-"<?xml version='1.0'?> <gegl> <node operation='gegl:crop'> <params> <param name='x'>0</param> <param name='y'>0</param> <param name='width'>512</param> <param name='height'>216</param> </params> </node> <node operation='gegl:over'> <node operation='gegl:shift'> <params> <param name='x'>15</param> <param name='y'>150</param> </params> </node> <gegl:opacity value='0.6'/> <node name='text' operation='gegl:text'> <params> <param name='string'>2000-2008 &#xA9; Calvin Williamson, Caroline Dahloff, Manish Singh, Jay Cox, Daniel Rogers, Sven Neumann, Michael Natterer,  &#xD8;yvind Kol&#xE5;s, Philip Lafleur, Dominik Ernst, Richard Kralovic, Kevin Cozens, Victor Bogado, Martin Nordholts, Geert Jordaens, Michael Schumacher, John Marshall, &#xC9;tienne Bersac, Mark Probst, H&#xE5;kon Hitland, Tor Lillqvist, Hans Breuer, Deji Akingunola, Bradley Broom, Hans Petter Jansson, Jan Heller, dmacks netspace org, Sven Anders, Hubert Figui&#xE8;re, Sam Hocevar, yahvuu at gmail.com, Nicolas Robid
 oux, Garry R. Osgood, Shlomi Fish and Jakub Steiner</param> <param name='font'>Sans</param> <param name='size'>8</param> <param name='color'>#000000</param> <param name='wrap'>485</param> <param name='alignment'>0</param> <param name='width'>355</param> <param name='height'>70</param> </params> </node> </node> <node operation='gegl:over'> <gegl:shift x='80' y='30'/> <gegl:over> <gegl:shift y='0' x='0'/> <gegl:dropshadow radius='8.0' x='0' y='0' opacity='1.2'/> <gegl:fill vector='M 0,50 C 0,78 24,100 50,100 C 77,100 100,78 100,50 C 100,45 99,40 98,35 C 82,35 66,35 50,35 C 42,35 35,42 35,50 C 35,58 42,65 50,65 C 56,65 61,61 64,56 C 67,51 75,55 73,60 C 69,69 60,75 50,75 C 36,75 25,64 25,50 C 25,36 36,25 50,25 L 93,25 C 83,9 67,0 49,0 C 25,0 0,20 0,50 z' color='#ffffffff'/> </gegl:over> <gegl:over> <gegl:shift x='88' y='0'/> <gegl:dropshadow radius='8.0' x='0' y='0' opacity='1.2'/> <gegl:fill vector='M 50,0 C 23,0 0,22 0,50 C 0,77 22,100 50,100 C 68,100 85,90 93,75 L 40,75 C 35,
 75 35,65 40,65 L 98,65 C 100,55 100,45 98,35 L 40,35 C 35,35 35,25 40,25 L 93,25 C 84,10 68,0 50,0 z' color='#ffffffff'/> </gegl:over> <gegl:over> <gegl:shift x='176' y='0'/> <gegl:dropshadow radius='8.0' x='0' y='0' opacity='1.2'/> <gegl:fill vector='M 0,50 C 0,78 24,100 50,100 C 77,100 100,78 100,50 C 100,45 99,40 98,35 C 82,35 66,35 50,35 C 42,35 35,42 35,50 C 35,58 42,65 50,65 C 56,65 61,61 64,56 C 67,51 75,55 73,60 C 69,69 60,75 50,75 C 36,75 25,64 25,50 C 25,36 36,25 50,25 L 93,25 C 83,9 67,0 49,0 C 25,0 0,20 0,50 z' color='#ffffffff'/> </gegl:over> <gegl:shift x='264' y='0'/> <gegl:dropshadow radius='8.0' x='0' y='0' opacity='1.2'/> <gegl:fill vector='M 30,4 C 12,13 0,30 0,50 C 0,78 23,100 50,100 C 71,100 88,88 96,71 L 56,71 C 42,71 30,59 30,45 L 30,4 z' color='#ffffffff'/> </node> <gegl:color value='white'/> </gegl>"
+"<?xml version='1.0'?> <gegl> <node operation='gegl:crop'> <params> <param name='x'>0</param> <param name='y'>0</param> <param name='width'>512</param> <param name='height'>216</param> </params> </node> <node operation='gegl:over'> <node operation='gegl:shift'> <params> <param name='x'>15</param> <param name='y'>150</param> </params> </node> <gegl:opacity value='0.6'/> <node name='text' operation='gegl:text'> <params> <param name='string'>2000-2008 &#xA9; Calvin Williamson, Caroline Dahloff, Manish Singh, Jay Cox, Daniel Rogers, Sven Neumann, Michael Natterer,  &#xD8;yvind Kol&#xE5;s, Philip Lafleur, Dominik Ernst, Richard Kralovic, Kevin Cozens, Victor Bogado, Martin Nordholts, Geert Jordaens, Michael Schumacher, John Marshall, &#xC9;tienne Bersac, Mark Probst, H&#xE5;kon Hitland, Tor Lillqvist, Hans Breuer, Deji Akingunola, Bradley Broom, Hans Petter Jansson, Jan Heller, dmacks netspace org, Sven Anders, Hubert Figui&#xE8;re, Sam Hocevar, yahvuu at gmail.com, Nicolas Robid
 oux, Garry R. Osgood, Shlomi Fish and Jakub Steiner</param> <param name='font'>Sans</param> <param name='size'>8</param> <param name='color'>#000000</param> <param name='wrap'>485</param> <param name='alignment'>0</param> <param name='width'>355</param> <param name='height'>70</param> </params> </node> </node> <node operation='gegl:over'> <gegl:shift x='80' y='30'/> <gegl:over> <gegl:shift y='0' x='0'/> <gegl:dropshadow radius='8.0' x='0' y='0' opacity='1.2'/> <gegl:fill path='M 0,50 C 0,78 24,100 50,100 C 77,100 100,78 100,50 C 100,45 99,40 98,35 C 82,35 66,35 50,35 C 42,35 35,42 35,50 C 35,58 42,65 50,65 C 56,65 61,61 64,56 C 67,51 75,55 73,60 C 69,69 60,75 50,75 C 36,75 25,64 25,50 C 25,36 36,25 50,25 L 93,25 C 83,9 67,0 49,0 C 25,0 0,20 0,50 z' color='#ffffffff'/> </gegl:over> <gegl:over> <gegl:shift x='88' y='0'/> <gegl:dropshadow radius='8.0' x='0' y='0' opacity='1.2'/> <gegl:fill path='M 50,0 C 23,0 0,22 0,50 C 0,77 22,100 50,100 C 68,100 85,90 93,75 L 40,75 C 35,75 3
 5,65 40,65 L 98,65 C 100,55 100,45 98,35 L 40,35 C 35,35 35,25 40,25 L 93,25 C 84,10 68,0 50,0 z' color='#ffffffff'/> </gegl:over> <gegl:over> <gegl:shift x='176' y='0'/> <gegl:dropshadow radius='8.0' x='0' y='0' opacity='1.2'/> <gegl:fill path='M 0,50 C 0,78 24,100 50,100 C 77,100 100,78 100,50 C 100,45 99,40 98,35 C 82,35 66,35 50,35 C 42,35 35,42 35,50 C 35,58 42,65 50,65 C 56,65 61,61 64,56 C 67,51 75,55 73,60 C 69,69 60,75 50,75 C 36,75 25,64 25,50 C 25,36 36,25 50,25 L 93,25 C 83,9 67,0 49,0 C 25,0 0,20 0,50 z' color='#ffffffff'/> </gegl:over> <gegl:shift x='264' y='0'/> <gegl:dropshadow radius='8.0' x='0' y='0' opacity='1.2'/> <gegl:fill path='M 30,4 C 12,13 0,30 0,50 C 0,78 23,100 50,100 C 71,100 88,88 96,71 L 56,71 C 42,71 30,59 30,45 L 30,4 z' color='#ffffffff'/> </node> <gegl:color value='white'/> </gegl>"
 /******************/
 
 

Modified: trunk/examples/gegl-paint.c
==============================================================================
--- trunk/examples/gegl-paint.c	(original)
+++ trunk/examples/gegl-paint.c	Mon Oct 20 22:51:24 2008
@@ -22,7 +22,7 @@
 #include <gtk/gtk.h>
 #include "../bin/gegl-view.h"
 #include "../bin/gegl-view.c"
-#include "property-types/gegl-vector.h"
+#include "property-types/gegl-path.h"
 
 #define HARDNESS     0.2
 #define LINEWIDTH   60.0
@@ -35,7 +35,7 @@
 static GeglNode   *out      = NULL;
 static GeglNode   *top      = NULL;
 static gboolean    pen_down = FALSE;
-static GeglVector *vector   = NULL;
+static GeglPath   *vector   = NULL;
 
 static GeglNode   *over     = NULL;
 static GeglNode   *stroke   = NULL;
@@ -46,7 +46,7 @@
 {
   if (event->button == 1)
     {
-      vector     = gegl_vector_new ();
+      vector     = gegl_path_new ();
 
       over       = gegl_node_new_child (gegl, "operation", "gegl:over", NULL);
       stroke     = gegl_node_new_child (gegl, "operation", "gegl:stroke",
@@ -76,9 +76,7 @@
           return TRUE;
         }
 
-      gegl_vector_line_to (vector,
-                           event->x,
-                           event->y);
+      gegl_path_append (vector, 'L', event->x, event->y);
       return TRUE;
     }
   return FALSE;
@@ -95,7 +93,7 @@
       GeglNode      *writebuf;
       GeglRectangle  roi;
 
-      gegl_vector_get_bounds (vector, &x0, &x1, &y0, &y1);
+      gegl_path_get_bounds (vector, &x0, &x1, &y0, &y1);
 
       roi      = (GeglRectangle){x0 - LINEWIDTH, y0 - LINEWIDTH,
                                  x1 - x0 + LINEWIDTH * 2, y1 - y0 + LINEWIDTH * 2};

Modified: trunk/gegl/gegl-chant.h
==============================================================================
--- trunk/gegl/gegl-chant.h	(original)
+++ trunk/gegl/gegl-chant.h	Mon Oct 20 22:51:24 2008
@@ -347,14 +347,14 @@
 #define gegl_chant_double(name, nick, min, max, def, blurb)  gdouble     name;
 #define gegl_chant_boolean(name, nick, def, blurb)           gboolean    name;
 #define gegl_chant_string(name, nick, def, blurb)            gchar      *name;
-#define gegl_chant_path(name, nick, def, blurb)              gchar      *name;
+#define gegl_chant_file_path(name, nick, def, blurb)         gchar      *name;
 #define gegl_chant_multiline(name, nick, def, blurb)         gchar      *name;
 #define gegl_chant_multiline(name, nick, def, blurb)         gchar      *name;
 #define gegl_chant_object(name,nick,  blurb)                 GObject    *name;
 #define gegl_chant_pointer(name, nick, blurb)                gpointer    name;
 #define gegl_chant_color(name, nick, def, blurb)             GeglColor  *name;
 #define gegl_chant_curve(name, nick, blurb)                  GeglCurve  *name;
-#define gegl_chant_vector(name, nick, blurb)                 GeglVector *name;
+#define gegl_chant_path(name, nick, blurb)                   GeglPath   *name;
 
 #include GEGL_CHANT_C_FILE
 
@@ -362,14 +362,14 @@
 #undef gegl_chant_double
 #undef gegl_chant_boolean
 #undef gegl_chant_string
-#undef gegl_chant_path
+#undef gegl_chant_file_path
 #undef gegl_chant_multiline
 #undef gegl_chant_multiline
 #undef gegl_chant_object
 #undef gegl_chant_pointer
 #undef gegl_chant_color
 #undef gegl_chant_curve
-#undef gegl_chant_vector
+#undef gegl_chant_path
 };
 
 #define GEGL_CHANT_OPERATION(obj) ((Operation*)(obj))
@@ -381,13 +381,13 @@
 #define gegl_chant_double(name, nick, min, max, def, blurb)  PROP_##name,
 #define gegl_chant_boolean(name, nick, def, blurb)           PROP_##name,
 #define gegl_chant_string(name, nick, def, blurb)            PROP_##name,
-#define gegl_chant_path(name, nick, def, blurb)              PROP_##name,
+#define gegl_chant_file_path(name, nick, def, blurb)         PROP_##name,
 #define gegl_chant_multiline(name, nick, def, blurb)         PROP_##name,
 #define gegl_chant_object(name, nick, blurb)                 PROP_##name,
 #define gegl_chant_pointer(name, nick, blurb)                PROP_##name,
 #define gegl_chant_color(name, nick, def, blurb)             PROP_##name,
 #define gegl_chant_curve(name, nick, blurb)                  PROP_##name,
-#define gegl_chant_vector(name, nick, blurb)                 PROP_##name,
+#define gegl_chant_path(name, nick, blurb)                   PROP_##name,
 
 #include GEGL_CHANT_C_FILE
 
@@ -395,13 +395,13 @@
 #undef gegl_chant_double
 #undef gegl_chant_boolean
 #undef gegl_chant_string
-#undef gegl_chant_path
+#undef gegl_chant_file_path
 #undef gegl_chant_multiline
 #undef gegl_chant_object
 #undef gegl_chant_pointer
 #undef gegl_chant_color
 #undef gegl_chant_curve
-#undef gegl_chant_vector
+#undef gegl_chant_path
   PROP_LAST
 };
 
@@ -433,7 +433,7 @@
     case PROP_##name:                                         \
       g_value_set_string (value, properties->name);           \
       break;
-#define gegl_chant_path(name, nick, def, blurb)               \
+#define gegl_chant_file_path(name, nick, def, blurb)          \
     case PROP_##name:                                         \
       g_value_set_string (value, properties->name);           \
       break;
@@ -457,7 +457,7 @@
     case PROP_##name:                                         \
       g_value_set_object (value, properties->name);           \
       break;
-#define gegl_chant_vector(name, nick, blurb)                  \
+#define gegl_chant_path(name, nick, blurb)                  \
     case PROP_##name:                                         \
       g_value_set_object (value, properties->name);           \
       break;/*XXX*/
@@ -468,13 +468,13 @@
 #undef gegl_chant_double
 #undef gegl_chant_boolean
 #undef gegl_chant_string
-#undef gegl_chant_path
+#undef gegl_chant_file_path
 #undef gegl_chant_multiline
 #undef gegl_chant_object
 #undef gegl_chant_pointer
 #undef gegl_chant_color
 #undef gegl_chant_curve
-#undef gegl_chant_vector
+#undef gegl_chant_path
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
       break;
@@ -511,7 +511,7 @@
         g_free (properties->name);                                    \
       properties->name = g_strdup (g_value_get_string (value));       \
       break;
-#define gegl_chant_path(name, nick, def, blurb)                       \
+#define gegl_chant_file_path(name, nick, def, blurb)                  \
     case PROP_##name:                                                 \
       if (properties->name)                                           \
         g_free (properties->name);                                    \
@@ -545,7 +545,7 @@
          g_object_unref (properties->name);                           \
       properties->name = g_value_dup_object (value);                  \
       break;
-#define gegl_chant_vector(name, nick, blurb)                          \
+#define gegl_chant_path(name, nick, blurb)                            \
     case PROP_##name:                                                 \
       if (properties->name != NULL)                                   \
         {/*XXX: remove old signal */                                  \
@@ -556,7 +556,7 @@
         {                                                             \
           properties->name = g_value_dup_object (value);              \
           g_signal_connect (G_OBJECT (properties->name), "changed",   \
-          G_CALLBACK(gegl_operation_vector_prop_changed), gobject);   \
+          G_CALLBACK(gegl_operation_path_prop_changed), gobject);     \
          }
       break; /*XXX*/
 
@@ -566,13 +566,13 @@
 #undef gegl_chant_double
 #undef gegl_chant_boolean
 #undef gegl_chant_string
-#undef gegl_chant_path
+#undef gegl_chant_file_path
 #undef gegl_chant_multiline
 #undef gegl_chant_object
 #undef gegl_chant_pointer
 #undef gegl_chant_color
 #undef gegl_chant_curve
-#undef gegl_chant_vector
+#undef gegl_chant_path
 
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
@@ -593,7 +593,7 @@
       g_free (properties->name);                    \
       properties->name = NULL;                      \
     }
-#define gegl_chant_path(name, nick, def, blurb)     \
+#define gegl_chant_file_path(name, nick, def, blurb) \
   if (properties->name)                             \
     {                                               \
       g_free (properties->name);                    \
@@ -624,7 +624,7 @@
       g_object_unref (properties->name);            \
       properties->name = NULL;                      \
     }
-#define gegl_chant_vector(name, nick, blurb)        \
+#define gegl_chant_path(name, nick, blurb)          \
   if (properties->name)                             \
     {                                               \
       g_object_unref (properties->name);            \
@@ -637,13 +637,13 @@
 #undef gegl_chant_double
 #undef gegl_chant_boolean
 #undef gegl_chant_string
-#undef gegl_chant_path
+#undef gegl_chant_file_path
 #undef gegl_chant_multiline
 #undef gegl_chant_object
 #undef gegl_chant_pointer
 #undef gegl_chant_color
 #undef gegl_chant_curve
-#undef gegl_chant_vector
+#undef gegl_chant_path
 
   g_slice_free (GeglChantO, properties);
 }
@@ -703,9 +703,9 @@
                                                         G_PARAM_READWRITE |  \
                                                         G_PARAM_CONSTRUCT |  \
                                                         GEGL_PARAM_PAD_INPUT)));
-#define gegl_chant_path(name, nick, def, blurb)                              \
+#define gegl_chant_file_path(name, nick, def, blurb)                              \
   g_object_class_install_property (object_class, PROP_##name,                \
-                                   gegl_param_spec_path (#name, nick, blurb, \
+                                   gegl_param_spec_file_path (#name, nick, blurb, \
                                                          FALSE, FALSE,       \
                                                          def,                \
                                                          (GParamFlags) (     \
@@ -751,9 +751,9 @@
                                                           G_PARAM_READWRITE |\
                                                           G_PARAM_CONSTRUCT |\
                                                           GEGL_PARAM_PAD_INPUT)));
-#define gegl_chant_vector(name, nick, blurb)                                 \
+#define gegl_chant_path(name, nick, blurb)                                 \
   g_object_class_install_property (object_class, PROP_##name,                \
-                                   gegl_param_spec_vector (#name, nick, blurb,\
+                                   gegl_param_spec_path (#name, nick, blurb,\
                                                            NULL,             \
                                                           (GParamFlags) (    \
                                                           G_PARAM_READWRITE |\
@@ -767,13 +767,13 @@
 #undef gegl_chant_double
 #undef gegl_chant_boolean
 #undef gegl_chant_string
-#undef gegl_chant_path
+#undef gegl_chant_file_path
 #undef gegl_chant_multiline
 #undef gegl_chant_object
 #undef gegl_chant_pointer
 #undef gegl_chant_color
 #undef gegl_chant_curve
-#undef gegl_chant_vector
+#undef gegl_chant_path
 }
 
 

Modified: trunk/gegl/gegl-types.h
==============================================================================
--- trunk/gegl/gegl-types.h	(original)
+++ trunk/gegl/gegl-types.h	Mon Oct 20 22:51:24 2008
@@ -26,7 +26,7 @@
 typedef struct _GeglColor            GeglColor;
 typedef struct _GeglCurve            GeglCurve;
 typedef struct _GeglNode             GeglNode;
-typedef struct _GeglVector           GeglVector;
+typedef struct _GeglPath             GeglPath;
 typedef struct _GeglProcessor        GeglProcessor;
 typedef struct _GeglRectangle        GeglRectangle;
 

Modified: trunk/gegl/gegl-xml.c
==============================================================================
--- trunk/gegl/gegl-xml.c	(original)
+++ trunk/gegl/gegl-xml.c	Mon Oct 20 22:51:24 2008
@@ -31,7 +31,7 @@
 #include "operation/gegl-operation.h"
 #include "property-types/gegl-color.h"
 #include "property-types/gegl-curve.h"
-#include "property-types/gegl-vector.h"
+#include "property-types/gegl-path.h"
 #include "property-types/gegl-paramspecs.h"
 #include "gegl-instrument.h"
 #include "gegl-xml.h"
@@ -119,7 +119,7 @@
                      param_name, gegl_node_get_debug_name (new));
         }
       else if (g_type_is_a (G_PARAM_SPEC_TYPE (paramspec),
-                            GEGL_TYPE_PARAM_PATH))
+                            GEGL_TYPE_PARAM_FILE_PATH))
         {
           gchar buf[PATH_MAX];
 
@@ -195,11 +195,11 @@
 	      pd->curve = NULL;
 	    }
 	}
-      else if (paramspec->value_type == GEGL_TYPE_VECTOR)
+      else if (paramspec->value_type == GEGL_TYPE_PATH)
         {
-          GeglVector *vector = gegl_vector_new ();
-          gegl_vector_parse_svg_path (vector, param_value);
-	  gegl_node_set (new, param_name, vector, NULL);
+          GeglPath *path = gegl_path_new ();
+          gegl_path_parse_string (path, param_value);
+	  gegl_node_set (new, param_name, path, NULL);
 	}
       else
         {
@@ -1000,7 +1000,7 @@
             }
 
           if (g_type_is_a (G_PARAM_SPEC_TYPE (properties[i]),
-                           GEGL_TYPE_PARAM_PATH))
+                           GEGL_TYPE_PARAM_FILE_PATH))
             {
               gchar *value;
               gegl_node_get (node, properties[i]->name, &value, NULL);
@@ -1086,17 +1086,17 @@
 	      indent += 2; ind; indent -= 2; xml_param_end (ss);
 	      g_object_unref (curve);
 	    }
-	  else if (properties[i]->value_type == GEGL_TYPE_VECTOR)
+	  else if (properties[i]->value_type == GEGL_TYPE_PATH)
 	    {
           gchar *svg_path;
-          GeglVector *vector;
-	      gegl_node_get (node, properties[i]->name, &vector, NULL);
+          GeglPath *path;
+	      gegl_node_get (node, properties[i]->name, &path, NULL);
 	      xml_param_start (ss, indent + 2, properties[i]->name);
-          svg_path = gegl_vector_to_svg_path (vector);	      
+          svg_path = gegl_path_to_string (path);	      
 	      g_string_append (ss->buf, svg_path);
 	      indent += 2; ind; indent -= 2; xml_param_end (ss);
 
-          g_object_unref (vector);
+          g_object_unref (path);
 	    }
           else
             {

Modified: trunk/gegl/operation/gegl-operation.h
==============================================================================
--- trunk/gegl/operation/gegl-operation.h	(original)
+++ trunk/gegl/operation/gegl-operation.h	Mon Oct 20 22:51:24 2008
@@ -214,7 +214,7 @@
  * externally */
 gboolean gegl_operation_calc_source_regions  (GeglOperation       *operation,
                                               gpointer             context_id);
-void     gegl_operation_vector_prop_changed  (GeglVector          *vector,
+void     gegl_operation_path_prop_changed    (GeglPath            *path,
                                               GeglOperation       *operation);
 void     gegl_operation_invalidate            (GeglOperation       *operation,
                                                const GeglRectangle *roi);

Modified: trunk/gegl/property-types/Makefile.am
==============================================================================
--- trunk/gegl/property-types/Makefile.am	(original)
+++ trunk/gegl/property-types/Makefile.am	Mon Oct 20 22:51:24 2008
@@ -3,14 +3,14 @@
 PROPERTYTYPES_sources = \
 	gegl-color.c		\
 	gegl-curve.c		\
-	gegl-vector.c		\
+	gegl-path.c		\
 	gegl-paramspecs.c
 
 
 PROPERTYTYPES_headers = \
 	gegl-color.h		\
 	gegl-curve.h		\
-	gegl-vector.h		\
+	gegl-path.h		\
 	gegl-paramspecs.h
 
 

Modified: trunk/gegl/property-types/gegl-paramspecs.c
==============================================================================
--- trunk/gegl/property-types/gegl-paramspecs.c	(original)
+++ trunk/gegl/property-types/gegl-paramspecs.c	Mon Oct 20 22:51:24 2008
@@ -403,16 +403,16 @@
 }
 
 /*
- * GEGL_TYPE_PARAM_PATH
+ * GEGL_TYPE_PARAM_FILE_PATH
  */
 
-static void       gegl_param_path_class_init (GParamSpecClass *klass);
-static void       gegl_param_path_init (GParamSpec *pspec);
-static gboolean   gegl_param_path_validate (GParamSpec *pspec,
-                                            GValue     *value);
+static void       gegl_param_file_path_class_init (GParamSpecClass *klass);
+static void       gegl_param_file_path_init       (GParamSpec *pspec);
+static gboolean   gegl_param_file_path_validate   (GParamSpec *pspec,
+                                                   GValue     *value);
 
 GType
-gegl_param_path_get_type (void)
+gegl_param_file_path_get_type (void)
 {
   static GType type = 0;
 
@@ -422,42 +422,42 @@
       {
         sizeof (GParamSpecClass),
         NULL,                                        NULL,
-        (GClassInitFunc) gegl_param_path_class_init,
+        (GClassInitFunc) gegl_param_file_path_class_init,
         NULL,                                        NULL,
         sizeof (GeglParamSpecString),
         0,
-        (GInstanceInitFunc) gegl_param_path_init
+        (GInstanceInitFunc) gegl_param_file_path_init
       };
 
       type = g_type_register_static (G_TYPE_PARAM_STRING,
-                                     "GeglParamPath", &info, 0);
+                                     "GeglParamFilePath", &info, 0);
     }
 
   return type;
 }
 
 static void
-gegl_param_path_class_init (GParamSpecClass *klass)
+gegl_param_file_path_class_init (GParamSpecClass *klass)
 {
   klass->value_type     = G_TYPE_STRING;
-  klass->value_validate = gegl_param_path_validate;
+  klass->value_validate = gegl_param_file_path_validate;
 }
 
 static void
-gegl_param_path_init (GParamSpec *pspec)
+gegl_param_file_path_init (GParamSpec *pspec)
 {
-  GeglParamSpecPath *sspec = GEGL_PARAM_SPEC_PATH (pspec);
+  GeglParamSpecFilePath *sspec = GEGL_PARAM_SPEC_FILE_PATH (pspec);
 
   sspec->no_validate = FALSE;
   sspec->null_ok     = FALSE;
 }
 
 static gboolean
-gegl_param_path_validate (GParamSpec *pspec,
-                          GValue     *value)
+gegl_param_file_path_validate (GParamSpec *pspec,
+                               GValue     *value)
 {
-  GeglParamSpecPath *sspec = GEGL_PARAM_SPEC_PATH (pspec);
-  gchar             *path  = value->data[0].v_pointer;
+  GeglParamSpecFilePath *sspec = GEGL_PARAM_SPEC_FILE_PATH (pspec);
+  gchar                 *path  = value->data[0].v_pointer;
 
   if (path)
     {
@@ -482,19 +482,18 @@
   return FALSE;
 }
 
-/* rename to not be in conflict with vector based path? */
 GParamSpec *
-gegl_param_spec_path (const gchar *name,
-                      const gchar *nick,
-                      const gchar *blurb,
-                      gboolean     no_validate,
-                      gboolean     null_ok,
-                      const gchar *default_value,
-                      GParamFlags  flags)
+gegl_param_spec_file_path (const gchar *name,
+                           const gchar *nick,
+                           const gchar *blurb,
+                           gboolean     no_validate,
+                           gboolean     null_ok,
+                           const gchar *default_value,
+                           GParamFlags  flags)
 {
-  GeglParamSpecPath *sspec;
+  GeglParamSpecFilePath *sspec;
 
-  sspec = g_param_spec_internal (GEGL_TYPE_PARAM_PATH,
+  sspec = g_param_spec_internal (GEGL_TYPE_PARAM_FILE_PATH,
                                  name, nick, blurb, flags);
 
   if (sspec)

Modified: trunk/gegl/property-types/gegl-paramspecs.h
==============================================================================
--- trunk/gegl/property-types/gegl-paramspecs.h	(original)
+++ trunk/gegl/property-types/gegl-paramspecs.h	Mon Oct 20 22:51:24 2008
@@ -173,16 +173,16 @@
 
 
 /*
- * GEGL_TYPE_PARAM_PATH
+ * GEGL_TYPE_PARAM_FILEPATH
  */
 
-#define GEGL_TYPE_PARAM_PATH           (gegl_param_path_get_type ())
-#define GEGL_PARAM_SPEC_PATH(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GEGL_TYPE_PARAM_PATH, GeglParamSpecPath))
-#define GEGL_IS_PARAM_SPEC_PATH(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GEGL_TYPE_PARAM_PATH))
+#define GEGL_TYPE_PARAM_FILE_PATH           (gegl_param_file_path_get_type ())
+#define GEGL_PARAM_SPEC_FILE_PATH(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GEGL_TYPE_PARAM_FILE_PATH, GeglParamSpecFilePath))
+#define GEGL_IS_PARAM_SPEC_FILE_PATH(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GEGL_TYPE_PARAM_FILE_PATH))
 
-typedef struct _GeglParamSpecPath GeglParamSpecPath;
+typedef struct _GeglParamSpecFilePath GeglParamSpecFilePath;
 
-struct _GeglParamSpecPath
+struct _GeglParamSpecFilePath
 {
   GParamSpecString parent_instance;
 
@@ -190,15 +190,15 @@
   guint            null_ok     : 1;
 };
 
-GType        gegl_param_path_get_type (void) G_GNUC_CONST;
+GType        gegl_param_file_path_get_type (void) G_GNUC_CONST;
 
-GParamSpec * gegl_param_spec_path (const gchar *name,
-                                   const gchar *nick,
-                                   const gchar *blurb,
-                                   gboolean     no_validate,
-                                   gboolean     null_ok,
-                                   const gchar *default_value,
-                                   GParamFlags  flags);
+GParamSpec * gegl_param_spec_file_path (const gchar *name,
+                                        const gchar *nick,
+                                        const gchar *blurb,
+                                        gboolean     no_validate,
+                                        gboolean     null_ok,
+                                        const gchar *default_value,
+                                        GParamFlags  flags);
 
 
 /*

Copied: trunk/gegl/property-types/gegl-path.c (from r2651, /trunk/gegl/property-types/gegl-vector.c)
==============================================================================
--- /trunk/gegl/property-types/gegl-vector.c	(original)
+++ trunk/gegl/property-types/gegl-path.c	Mon Oct 20 22:51:24 2008
@@ -26,57 +26,39 @@
 #include "gegl-types.h"
 
 #include "gegl-buffer-private.h"
-#include "gegl-vector.h"
+#include "gegl-path.h"
 #include "gegl-color.h"
 #include "gegl-utils.h"
 #include <glib/gprintf.h>
 
 #include <stdarg.h>
 
-
 /* ###################################################################### */
-/* path-list code originating in horizon */
 
-#define BEZIER_SEGMENTS 32
-#define AA 3
+#define BEZIER_SEGMENTS 64
 
 #include <glib.h>
 #include <math.h>
 
-/* the path is a series of commands in a linked list,
- * the first node is the path state, it contains the pens last coordinates.
- *
- * The second node is always a move to, and specifies the start of the
- * first segment. Curves are automatically turned into lines upon generation.
- *
- * s: 40, 50
- * m: 100, 100
- * l: 200, 100
- * l: 200, 50
- */
-
-
-typedef struct KnotInfo
+typedef struct InstructionInfo
 {
   gchar  type;
   gint   pairs;
   gchar *name;
-  GeglVectorPath *(*flatten) (GeglVectorPath *head, GeglVectorPath *prev, GeglVectorPath *self);
-} KnotInfo;
 
-#if 0
-/* it would be possible to compile paths like this into the library */
-static GeglVectorKnot test[] = 
-      {{'m', {{0.0, 0.0}}},
-       {'l', {{20.0, 20.0}}},
-       {'C', {{20.0, 20.0}, {40, 40}, {50, 50}}}
-  };
-#endif
+  /* a flatten function pointer is kept for all stored InstructionInfo's but are only
+   * used for the internal ones
+   */
+  GeglPathList *(*flatten) (GeglPathList *head,
+                            GeglPathList *prev,
+                            GeglPathList *self);
+} InstructionInfo;
 
-static GeglVectorPath *flatten_copy      (GeglVectorPath *head, GeglVectorPath *prev, GeglVectorPath *self);
-static GeglVectorPath *flatten_rel_copy  (GeglVectorPath *head, GeglVectorPath *prev, GeglVectorPath *self);
-static GeglVectorPath *flatten_nop       (GeglVectorPath *head, GeglVectorPath *prev, GeglVectorPath *self);
-static GeglVectorPath *flatten_curve     (GeglVectorPath *head, GeglVectorPath *prev, GeglVectorPath *self);
+
+static GeglPathList *flatten_copy      (GeglPathList *head, GeglPathList *prev, GeglPathList *self);
+static GeglPathList *flatten_rel_copy  (GeglPathList *head, GeglPathList *prev, GeglPathList *self);
+static GeglPathList *flatten_nop       (GeglPathList *head, GeglPathList *prev, GeglPathList *self);
+static GeglPathList *flatten_curve     (GeglPathList *head, GeglPathList *prev, GeglPathList *self);
 
 /* FIXME: handling of relative commands should be moved to the flattening stage */
 
@@ -84,7 +66,7 @@
  * "SVG path" parser/serializer.
  */
 
-static KnotInfo knot_types[64]= /* reserve space for a total of up to 64 types of instructions. */
+static InstructionInfo knot_types[64]= /* reserve space for a total of up to 64 types of instructions. */
 {
   {'M',  1, "move to",              flatten_copy},
   {'L',  1, "line to",              flatten_copy},
@@ -99,16 +81,25 @@
   {'\0', 0, "end of instructions",  flatten_copy},
 };
 
+static InstructionInfo *lookup_instruction_info (gchar type)
+{
+  gint i;
+  for (i=0; knot_types[i].type != '\0'; i++)
+    if (knot_types[i].type == type)
+      return &knot_types[i];
+  return NULL;
+}
+
 void
-gegl_vector_add_knot_type (gchar        type, 
-                           gint         pairs,
-                           const gchar *name)
+gegl_path_add_type (gchar        type, 
+                    gint         pairs,
+                    const gchar *name)
 {
   gint i;
   for (i=0; knot_types[i].type != '\0'; i++)
     if (knot_types[i].type == type)
       {
-        g_warning ("knot type %c already exists\n", type);
+        g_warning ("control point type %c already exists\n", type);
         return;
       }
   knot_types[i].type = type;
@@ -119,40 +110,56 @@
   return;
 }
 
-static KnotInfo *find_knot_type(gchar type)
+
+static GeglPathList *
+gegl_path_list_append_item  (GeglPathList  *head,
+                             GeglPathList **res)
 {
-  gint i;
-  for (i=0; knot_types[i].type != '\0'; i++)
-    if (knot_types[i].type == type)
-      return &knot_types[i];
-  return NULL;
-}
+  GeglPathList *iter = head;
+  while (iter && iter->next)
+    iter=iter->next;
+
+  if (iter)
+    {
+      iter->next = g_slice_new0 (GeglPathList);
+      iter = iter->next;
+    }
+  else /* creating new path */
+    {
+      head = g_slice_new0 (GeglPathList);
+      iter=head;
+    }
+  g_assert (res);
+    *res = iter;
 
-static GeglVectorPath *
-path_append (GeglVectorPath  *head,
-             GeglVectorPath **res);
+  return head;
+}
 
-static GeglVectorPath *flatten_nop (GeglVectorPath *head, GeglVectorPath *prev, GeglVectorPath *self)
+static GeglPathList *flatten_nop (GeglPathList *head,
+                                  GeglPathList *prev,
+                                  GeglPathList *self)
 {
   return head;
 }
 
-static GeglVectorPath *flatten_copy (GeglVectorPath *head, GeglVectorPath *prev, GeglVectorPath *self)
+static GeglPathList *flatten_copy (GeglPathList *head,
+                                   GeglPathList *prev,
+                                   GeglPathList *self)
 {
-  GeglVectorPath *newp;
-  head = path_append (head, &newp);
+  GeglPathList *newp;
+  head = gegl_path_list_append_item (head, &newp);
   newp->d = self->d;
   return head;
 }
 
-static GeglVectorPath *
-flatten_rel_copy (GeglVectorPath *head,
-                  GeglVectorPath *prev,
-                  GeglVectorPath *self)
+static GeglPathList *
+flatten_rel_copy (GeglPathList *head,
+                  GeglPathList *prev,
+                  GeglPathList *self)
 {
-  GeglVectorPath *newp;
+  GeglPathList *newp;
   gint i;
-  head = path_append (head, &newp);
+  head = gegl_path_list_append_item (head, &newp);
   newp->d = self->d;
   for (i=0;i<4;i++)
     {
@@ -161,25 +168,19 @@
     }
   switch (newp->d.type)
     {
-      case 'l':
-        newp->d.type = 'L';
-        break;
-      case 'm':
-        newp->d.type = 'M';
-        break;
-      case 'c':
-        newp->d.type = 'C';
-        break;
+      case 'l': newp->d.type = 'L'; break;
+      case 'm': newp->d.type = 'M'; break;
+      case 'c': newp->d.type = 'C'; break;
     }
   return head;
 }
 
 /* linear interpolation between two points */
 static void
-lerp (Point *dest,
-      Point *a,
-      Point *b,
-      gfloat   t)
+lerp (Point  *dest,
+      Point  *a,
+      Point  *b,
+      gfloat  t)
 {
   dest->x = a->x + (b->x-a->x) * t;
   dest->y = a->y + (b->y-a->y) * t;
@@ -194,8 +195,8 @@
 }
 
 static void
-bezier2 (GeglVectorPath  *prev,/* we need the previous node as well when rendering a path */
-         GeglVectorPath  *curve,
+bezier2 (GeglPathList  *prev,
+         GeglPathList  *curve,
          Point *dest,
          gfloat t)
 {
@@ -214,7 +215,9 @@
 
 
 
-static GeglVectorPath *flatten_curve (GeglVectorPath *head, GeglVectorPath *prev, GeglVectorPath *self)
+static GeglPathList *flatten_curve (GeglPathList *head,
+                                    GeglPathList *prev,
+                                    GeglPathList *self)
 { /* create piecevise linear approximation of bezier curve */
   gfloat f;
 
@@ -224,27 +227,27 @@
 
       bezier2 (prev, self, &res, f);
 
-      head = gegl_vector_path_add (head, 'L', res.x, res.y);
+      head = gegl_path_list_append (head, 'L', res.x, res.y);
     }
-  head = gegl_vector_path_add (head, 'L', self->d.point[2].x, self->d.point[2].y);
+  head = gegl_path_list_append (head, 'L', self->d.point[2].x, self->d.point[2].y);
   return head;
 }
 
-GeglVectorPath *
-gegl_vector_path_flatten (GeglVectorPath *original)
+static GeglPathList *
+gegl_path_list_flatten (GeglPathList *original)
 {
-  GeglVectorPath *iter;
-  GeglVectorPath *prev = NULL;
-  GeglVectorPath *self = NULL;
+  GeglPathList *iter;
+  GeglPathList *prev = NULL;
+  GeglPathList *self = NULL;
 
-  GeglVectorPath *endp = NULL;
+  GeglPathList *endp = NULL;
 
   if (!original)
     return NULL;
   
   for (iter=original; iter; iter=iter->next)
     {
-      KnotInfo *info = find_knot_type (iter->d.type);
+      InstructionInfo *info = lookup_instruction_info (iter->d.type);
       if(info)
         self = info->flatten (self, endp, iter);
       if (!endp)
@@ -256,44 +259,21 @@
   return self;
 }
 
-static gdouble path_get_length (GeglVectorPath *path);
-
-static GeglVectorPath *
-path_append (GeglVectorPath  *head,
-             GeglVectorPath **res)
-{
-  GeglVectorPath *iter = head;
-  while (iter && iter->next)
-    iter=iter->next;
-
-  if (iter)
-    {
-      iter->next = g_slice_new0 (GeglVectorPath);
-      iter = iter->next;
-    }
-  else /* creating new path */
-    {
-      head = g_slice_new0 (GeglVectorPath);
-      iter=head;
-    }
-  g_assert (res);
-    *res = iter;
+static gdouble path_get_length (GeglPathList *path);
 
-  return head;
-}
 
-GeglVectorPath *
-gegl_vector_path_destroy (GeglVectorPath *path)
+GeglPathList *
+gegl_path_list_destroy (GeglPathList *path)
 {
-  g_slice_free_chain (GeglVectorPath, path, next);
+  g_slice_free_chain (GeglPathList, path, next);
   return NULL;
 }
 
-GeglVectorPath * gegl_vector_path_add (GeglVectorPath *head,
+GeglPathList * gegl_path_list_append (GeglPathList *head,
                                        ...)
 {
-  KnotInfo *info;
-  GeglVectorPath *iter;
+  InstructionInfo *info;
+  GeglPathList *iter;
   gchar type;
   gint pair_no;
 
@@ -301,11 +281,11 @@
   va_start (var_args, head);
   type = va_arg (var_args, int); /* we pass in a char, but it is promoted to int by varargs*/
 
-  info = find_knot_type(type);
+  info = lookup_instruction_info(type);
   if (!info)
     g_error ("didn't find [%c]", type);
 
-  head = path_append (head, &iter);
+  head = gegl_path_list_append_item (head, &iter);
 
   iter->d.type       = type;
   for (pair_no=0;pair_no<info->pairs;pair_no++)
@@ -318,12 +298,12 @@
 }
 
 static void
-path_calc (GeglVectorPath       *path,
-           gdouble     pos,
-           gdouble    *xd,
-           gdouble    *yd)
+path_calc (GeglPathList *path,
+           gdouble       pos,
+           gdouble      *xd,
+           gdouble      *yd)
 {
-  GeglVectorPath *iter = path;
+  GeglPathList *iter = path;
   gfloat traveled_length = 0;
   gfloat need_to_travel = 0;
   gfloat x = 0, y = 0;
@@ -406,10 +386,10 @@
 }
 
 static void
-path_calc_values (GeglVectorPath    *path,
-                  guint    num_samples,
-                  gdouble *xs,
-                  gdouble *ys)
+path_calc_values (GeglPathList *path,
+                  guint         num_samples,
+                  gdouble      *xs,
+                  gdouble      *ys)
 {
   gdouble length = path_get_length (path);
   gint i;
@@ -424,9 +404,9 @@
 }
 
 static gdouble
-path_get_length (GeglVectorPath *path)
+path_get_length (GeglPathList *path)
 {
-  GeglVectorPath *iter = path;
+  GeglPathList *iter = path;
   gfloat traveled_length = 0;
   gfloat x = 0, y = 0;
 
@@ -474,17 +454,22 @@
 
 /******************/
 
+struct _GeglPathClass
+{
+  GObjectClass parent_class;
+  GeglPathList *(*flattener[8]) (GeglPathList *original);
+};
 
-typedef struct _GeglVectorPrivate GeglVectorPrivate;
-typedef struct _VectorNameEntity  VectorNameEntity;
+typedef struct _GeglPathPrivate GeglPathPrivate;
+typedef struct _PathNameEntity  PathNameEntity;
 
-struct _GeglVectorPrivate
+struct _GeglPathPrivate
 {
-  GeglVectorPath     *path;
-  GeglVectorPath     *flat_path;
+  GeglPathList     *path;
+  GeglPathList     *flat_path;
   gboolean  flat_path_clean;
 
-  GeglVectorPath *axis[8];
+  GeglPathList *axis[8];
   gint  n_axes;
 
   GeglRectangle dirtied;
@@ -500,11 +485,11 @@
 
 enum
 {
-  GEGL_VECTOR_CHANGED,
-  GEGL_VECTOR_LAST_SIGNAL
+  GEGL_PATH_CHANGED,
+  GEGL_PATH_LAST_SIGNAL
 };
 
-guint gegl_vector_signals[GEGL_VECTOR_LAST_SIGNAL] = { 0 };
+guint gegl_path_signals[GEGL_PATH_LAST_SIGNAL] = { 0 };
 
 
 static void finalize     (GObject      *self);
@@ -517,10 +502,10 @@
                           GValue       *value,
                           GParamSpec   *pspec);
 
-G_DEFINE_TYPE (GeglVector, gegl_vector, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GeglPath, gegl_path, G_TYPE_OBJECT);
 
-#define GEGL_VECTOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),\
-                                   GEGL_TYPE_VECTOR, GeglVectorPrivate))
+#define GEGL_PATH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),\
+                                   GEGL_TYPE_PATH, GeglPathPrivate))
 
 
 
@@ -532,49 +517,18 @@
   return GPOINTER_TO_INT (a)-GPOINTER_TO_INT (b);
 }
 
-static void gegl_buffer_accumulate (GeglBuffer    *buffer,
-                                    GeglRectangle *roi,
-                                    const gfloat  *col)
-{
-  static Babl   *format = NULL;
-  static gfloat *buf = NULL;
-  static gint len = 0;
-  gint i;
-
-  if (!format)
-    format = babl_format ("RaGaBaA float");
-
-  if (!buf || len < roi->width)
-    {
-      len = roi->width;
-      if (buf)
-        g_free (buf);
-      buf = g_malloc (len * 4 *4);
-      /* final scratch buf will be "leaked" */
-    }
-
-  gegl_buffer_get (buffer, 1.0, roi, format, buf, 0);
-  for (i=0; i< roi->width; i++)
-    {
-      gint j;
-      for (j=0; j<4; j++)
-        buf[i*4 + j] += col[j];
-    }
-  gegl_buffer_set (buffer, roi, format, buf, 0);
-}
-
-static void ensure_flattened (GeglVector *vector)
+static void ensure_flattened (GeglPath *vector)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
   gint i;
-  GeglVectorPath *path = priv->path;
-  GeglVectorPath *new_path;
-  GeglVectorClass *klass= GEGL_VECTOR_GET_CLASS (vector);
+  GeglPathList *path = priv->path;
+  GeglPathList *new_path;
+  GeglPathClass *klass= GEGL_PATH_GET_CLASS (vector);
 
   if (priv->flat_path_clean)
     return;
   if (priv->flat_path)
-    gegl_vector_path_destroy (priv->flat_path);
+    gegl_path_list_destroy (priv->flat_path);
 
   for (i=0;klass->flattener[i];i++)
     {
@@ -582,656 +536,294 @@
       if (new_path != path)
         {
           if (path != priv->path)
-            gegl_vector_path_destroy (path);
+            gegl_path_list_destroy (path);
           path = new_path;
         }
     }
 
-  priv->flat_path = gegl_vector_path_flatten (path);
+  priv->flat_path = gegl_path_list_flatten (path);
   if (path != priv->path)
-    gegl_vector_path_destroy (path);
+    gegl_path_list_destroy (path);
   priv->flat_path_clean = TRUE;
 }
 
 static void
-path_calc_values (GeglVectorPath *path,
-                  guint      num_samples,
-                  gdouble   *xs,
-                  gdouble   *ys);
+path_calc_values (GeglPathList *path,
+                  guint         num_samples,
+                  gdouble      *xs,
+                  gdouble      *ys);
 
 
-void gegl_vector_fill (GeglBuffer *buffer,
-                       GeglVector *vector,
-                       GeglColor  *color,
-                       gboolean    winding)
-{
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
-  gdouble xmin, xmax, ymin, ymax;
-  GeglRectangle extent;
-  gfloat  horsub = AA;
-  gint    versubi = horsub;
-  gfloat  versub = versubi;
-  gint    samples;
 
-  if (!vector)
-    return;
 
-  ensure_flattened (vector);
-  samples = path_get_length (priv->flat_path);
-  gegl_vector_get_bounds (vector, &xmin, &xmax, &ymin, &ymax);
+static void
+gegl_path_init (GeglPath *self)
+{
+  GeglPathPrivate *priv;
+  priv = GEGL_PATH_GET_PRIVATE (self);
+}
 
-  extent.x = floor (xmin);
-  extent.y = floor (ymin);
-  extent.width = ceil (xmax) - extent.x;
-  extent.height = ceil (ymax) - extent.y;
+static void
+gegl_path_class_init (GeglPathClass *klass)
+{
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-  {
-    GSList *scanlines[extent.height * versubi];
+  gobject_class->finalize     = finalize;
+  gobject_class->set_property = set_property;
+  gobject_class->get_property = get_property;
 
-    gdouble xs[samples];
-    gdouble ys[samples];
+  g_type_class_add_private (klass, sizeof (GeglPathPrivate));
 
-    gint i;
-    gdouble prev_x;
-    gint    prev_y;
-    gdouble first_x;
-    gint    first_y;
-    gint    lastline=-1;
-    gint    lastdir=-2;
+  gegl_path_signals[GEGL_PATH_CHANGED] =
+    g_signal_new ("changed", G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+                  0    /* class offset */,
+                  NULL /* accumulator */,
+                  NULL /* accu_data */,
+                  g_cclosure_marshal_VOID__POINTER,
+                  G_TYPE_NONE, /*return type */
+                  1, G_TYPE_POINTER);
+}
 
-    path_calc_values (priv->flat_path, samples, xs, ys);
+static void
+gegl_path_emit_changed (GeglPath            *self,
+                        const GeglRectangle *bounds)
+{
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
+  GeglRectangle rect;
+  GeglRectangle temp;
+  if (!bounds)
+    {
+       gdouble min_x;
+       gdouble max_x;
+       gdouble min_y;
+       gdouble max_y;
+       gegl_path_get_bounds (self, &min_x, &max_x, &min_y, &max_y);
+       rect.x = min_x;
+       rect.y = min_y;
+       rect.width = max_x - min_x;
+       rect.height = max_y - min_y;
 
-    /* clear scanline intersection lists */
-    for (i=0; i < extent.height * versub; i++)
-      scanlines[i]=NULL;
+       temp = priv->cached_extent;
+       priv->cached_extent = rect;
 
-    first_x = prev_x = xs[0] * horsub;
-    first_y = prev_y = ys[0] * versub;
-    
-    /* saturate scanline intersection list */
-    for (i=1; i<samples; i++)
-      {
-        gint dest_x = xs[i] * horsub;
-        gint dest_y = ys[i] * versub;
-        gint ydir;
-        gint dx;
-        gint dy;
-        gint y;
-fill_close:  /* label used for goto to close last segment */
-        dx = dest_x - prev_x;
-        dy = dest_y - prev_y;
+       gegl_rectangle_bounding_box (&temp, &temp, &rect);
+       bounds = &temp;
+    }
+  g_signal_emit (self, gegl_path_signals[GEGL_PATH_CHANGED], 0,
+                 bounds, NULL);
+}
 
-        if (dy < 0)
-          ydir = -1;
-        else
-          ydir = 1;
+static void
+finalize (GObject *gobject)
+{
+  GeglPath        *self = GEGL_PATH (gobject);
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
 
-        /* do linear interpolation between vertexes */
-        for (y=prev_y; y!= dest_y; y += ydir)
-          {
-            if (y-extent.y * versub >= 0 &&
-                y-extent.y * versub < extent.height * versub &&
-                lastline != y)
-              {
-                gint x = prev_x + (dx * (y-prev_y)) / dy;
-                /* XXX: * clamp the spans to the width/height of the buffer ? */
+  self = NULL;
+  if (priv->path)
+    gegl_path_list_destroy (priv->path);
+  if (priv->flat_path)
+    gegl_path_list_destroy (priv->flat_path);
+  priv = NULL;
 
-                scanlines[ y - extent.y * versubi]=
-                  g_slist_insert_sorted (scanlines[ y - extent.y * versubi],
-                                         GINT_TO_POINTER(x),
-                                         compare_ints);
-                if (ydir != lastdir &&
-                    lastdir != -2)
-                  scanlines[ y - extent.y * versubi]=
-                    g_slist_insert_sorted (scanlines[ y - extent.y * versubi],
-                                           GINT_TO_POINTER(x),
-                                           compare_ints);
-                lastdir = ydir;
-                lastline = y;
-              }
-          }
+  G_OBJECT_CLASS (gegl_path_parent_class)->finalize (gobject);
+}
 
-        prev_x = dest_x;
-        prev_y = dest_y;
+static void
+set_property (GObject      *gobject,
+              guint         property_id,
+              const GValue *value,
+              GParamSpec   *pspec)
+{
+  switch (property_id)
+    {
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
+        break;
+    }
+}
 
-        /* if we're on the last knot, fake the first vertex being a next one */
-        if (i+1 == samples)
-          {
-            dest_x = first_x;
-            dest_y = first_y;
-            i++; /* to make the loop finally end */
-            goto fill_close;
-          }
-      }
+static void
+get_property (GObject    *gobject,
+              guint       property_id,
+              GValue     *value,
+              GParamSpec *pspec)
+{
+  switch (property_id)
+    {
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
+        break;
+    }
+}
 
-    /* Fill the spans */
+GeglPath *
+gegl_path_new (void)
 {
-    const gfloat *colc = gegl_color_float4 (color);
-    gfloat col[4] = {colc[0],colc[1],colc[2],colc[3]};
-    gfloat factor = 1.0/(horsub * versub);
+  GeglPath        *self = GEGL_PATH (g_object_new (GEGL_TYPE_PATH, NULL));
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
 
-    col[0] *= factor;
-    col[1] *= factor;
-    col[2] *= factor;
-    col[3] *= factor;
-
-    if (gegl_buffer_is_shared (buffer))
-    while (!gegl_buffer_try_lock (buffer));
-
-    for (i=0; i < extent.height * versub; i++)
-      {
-        GSList *iter = scanlines[i];
-        while (iter)
-          {
-            GSList *next = iter->next;
-            gint    j;
-            gint startx, endx;
-            if (!next)
-              break;
-
-            startx = GPOINTER_TO_INT (iter->data);
-            endx   = GPOINTER_TO_INT (next->data);
-
-            for (j=0;j<horsub;j++)
-            {
-              GeglRectangle roi={(startx+j)/horsub, extent.y + i/versub, (endx - startx-j + horsub) / horsub, 1};
-              gegl_buffer_accumulate (buffer, &roi, col);
-            }
-
-            iter = next->next;
-          }
-        if (scanlines[i])
-          g_slist_free (scanlines[i]);
-      }
+  gegl_path_init (self);
+  priv->flat_path_clean = FALSE;
 
-    if (gegl_buffer_is_shared (buffer))
-    gegl_buffer_unlock (buffer);
-  }
-  }
+  return self;
 }
 
-typedef struct StampStatic {
-  gboolean  valid;
-  Babl     *format;
-  gfloat   *buf;
-  gdouble   radius;
-}StampStatic;
 
-void gegl_vector_stamp (GeglBuffer *buffer,
-                        gdouble     x,
-                        gdouble     y,
-                        gdouble     radius,
-                        gdouble     hardness,
-                        GeglColor  *color);
-
-void gegl_vector_stamp (GeglBuffer *buffer,
-                        gdouble     x,
-                        gdouble     y,
-                        gdouble     radius,
-                        gdouble     hardness,
-                        GeglColor  *color)
+gdouble
+gegl_path_get_length (GeglPath *self)
 {
-  const gfloat *col = gegl_color_float4 (color);
-  static StampStatic s = {FALSE,}; /* XXX: 
-                                      we will ultimately leak the last valid
-                                      cached brush. */
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
+  if (!self)
+    return 0.0;
+  ensure_flattened (self);
+  return path_get_length (priv->flat_path);
+}
 
-  GeglRectangle roi = {floor(x-radius),
-                       floor(y-radius),
-                       ceil (x+radius) - floor (x-radius),
-                       ceil (y+radius) - floor (y-radius)};
+void gegl_path_get_bounds (GeglPath *self,
+                           gdouble  *min_x,
+                           gdouble  *max_x,
+                           gdouble  *min_y,
+                           gdouble  *max_y)
+{
+  GeglPathPrivate *priv;
+  GeglPathList *iter;
 
-  GeglRectangle temp;
+  *min_x = 256.0;
+  *min_y = 256.0;
+  *max_x = -256.0;
+  *max_y = -256.0;
 
-  /* bail out if we wouldn't leave a mark on the buffer */
-  if (!gegl_rectangle_intersect (&temp, &roi, gegl_buffer_get_extent (buffer)))
-      return;
+  if (!self)
+    return;
 
-  if (s.format == NULL)
-    s.format = babl_format ("RGBA float");
+  priv = GEGL_PATH_GET_PRIVATE (self);
+ 
 
-  if (s.buf == NULL ||
-      s.radius != radius)
-    {
-      if (s.buf != NULL)
-        g_free (s.buf);
-      /* allocate a little bit more, just in case due to rounding errors and
-       * such */
-      s.buf = g_malloc (4*4* (roi.width + 2 ) * (roi.height + 2));
-      s.radius = radius;
-      s.valid = TRUE;  
-    }
-  g_assert (s.buf);
+  ensure_flattened (self);
+  iter = priv->flat_path;
 
-  gegl_buffer_get (buffer, 1.0, &roi, s.format, s.buf, 0);
+  if (*max_x < *min_x)
+    *max_x = *min_x;
+  if (*max_y < *min_y)
+    *max_y = *min_y;
 
-  {
-    gint u, v;
-    gint i=0;
+  while (iter)
+    {
+      gint i;
+      gint max = 0;
 
-    gfloat radius_squared = radius * radius;
-    gfloat inner_radius_squared = (radius * hardness)*(radius * hardness);
-    gfloat soft_range = radius_squared - inner_radius_squared;
+      if (iter->d.type == 'M')
+        max = 1;
+      else if (iter->d.type == 'L')
+        max = 1;
+      else if (iter->d.type == 'C')
+        max = 3;
 
-    for (v= roi.y; v < roi.y + roi.height ; v++)
-    {
-      gfloat vy2 = (v-y)*(v-y);
-      for (u= roi.x; u < roi.x + roi.width; u++)
+      for (i=0;i<max;i++)
         {
-          gfloat o = (u-x) * (u-x) + vy2;
-
-          if (o < inner_radius_squared)
-             o = col[3];
-          else if (o < radius_squared)
-            {
-              o = (1.0 - (o-inner_radius_squared) / (soft_range)) * col[3];
-            }
-          else
-            {
-              o=0.0;
-            }
-         if (o!=0.0)
-           {
-             gint c;
-             for (c=0;c<4;c++)
-               s.buf[i*4+c] = (s.buf[i*4+c] * (1.0-o) + col[c] * o);
-           }
-         i++;
+          if (iter->d.point[i].x < *min_x)
+            *min_x = iter->d.point[i].x;
+          if (iter->d.point[i].x > *max_x)
+            *max_x = iter->d.point[i].x;
+          if (iter->d.point[i].y < *min_y)
+            *min_y = iter->d.point[i].y;
+          if (iter->d.point[i].y > *max_y)
+            *max_y = iter->d.point[i].y;
         }
+      iter=iter->next;
     }
-  }
-  gegl_buffer_set (buffer, &roi, s.format, s.buf, 0);
 }
 
 
-void gegl_vector_stroke (GeglBuffer *buffer,
-                         GeglVector *vector,
-                         GeglColor  *color,
-                         gdouble     linewidth,
-                         gdouble     hardness)
-{
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
-  GeglRectangle bufext;
-  gfloat traveled_length = 0;
-  gfloat need_to_travel = 0;
-  gfloat x = 0,y = 0;
-  gboolean had_move_to = FALSE;
-  GeglVectorPath *iter;
-  gdouble       xmin, xmax, ymin, ymax;
-  GeglRectangle extent;
 
-  if (!vector)
+void
+gegl_path_calc (GeglPath   *self,
+                gdouble     pos,
+                gdouble    *xd,
+                gdouble    *yd)
+{
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
+  if (!self)
     return;
+  ensure_flattened (self);
+  return path_calc (priv->flat_path, pos, xd, yd);
+}
 
-  ensure_flattened (vector);
-
-  iter = priv->flat_path;
-  gegl_vector_get_bounds (vector, &xmin, &xmax, &ymin, &ymax);
-  extent.x = floor (xmin);
-  extent.y = floor (ymin);
-  extent.width = ceil (xmax) - extent.x;
-  extent.height = ceil (ymax) - extent.y;
-
-  bufext = *gegl_buffer_get_extent (buffer);
-
-  if (gegl_buffer_is_shared (buffer))
-  while (!gegl_buffer_try_lock (buffer));
 
-  if (!gegl_rectangle_intersect (&extent, &bufext, &bufext))
+void
+gegl_path_calc_values (GeglPath *self,
+                         guint      num_samples,
+                         gdouble   *xs,
+                         gdouble   *ys)
+{
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
+  if (!self)
     return;
-  gegl_buffer_clear (buffer, &extent);
+  ensure_flattened (self);
+  return path_calc_values (priv->flat_path, num_samples, xs, ys);
+}
 
-  while (iter)
-    {
-      //fprintf (stderr, "%c, %i %i\n", iter->d.type, iter->d.point[0].x, iter->d.point[0].y);
-      switch (iter->d.type)
-        {
-          case 'M':
-            x = iter->d.point[0].x;
-            y = iter->d.point[0].y;
-            need_to_travel = 0;
-            traveled_length = 0;
-            had_move_to = TRUE;
-            break;
-          case 'L':
-            {
-              Point a,b;
 
-              gfloat spacing;
-              gfloat local_pos;
-              gfloat distance;
-              gfloat offset;
-              gfloat leftover;
-              gfloat radius = linewidth / 2.0;
+/* --------------------------------------------------------------------------
+ * A GParamSpec class to describe behavior of GeglPath as an object property
+ * follows.
+ * --------------------------------------------------------------------------
+ */
 
+#define GEGL_PARAM_PATH(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_PARAM_PATH, GeglParamPath))
+#define GEGL_IS_PARAM_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_PARAM_PATH))
 
-              a.x = x;
-              a.y = y;
+typedef struct _GeglParamPath GeglParamPath;
 
-              b.x = iter->d.point[0].x;
-              b.y = iter->d.point[0].y;
+struct _GeglParamPath
+{
+  GParamSpec parent_instance;
 
-              spacing = 0.2 * radius;
+  GeglPath *default_vector;
+};
 
-              distance = point_dist (&a, &b);
+static void
+gegl_param_vector_init (GParamSpec *self)
+{
+  GEGL_PARAM_PATH (self)->default_vector = NULL;
+}
 
-              leftover = need_to_travel - traveled_length;
-              offset = spacing - leftover;
+static void
+gegl_param_vector_finalize (GParamSpec *self)
+{
+  GeglParamPath  *param_vector  = GEGL_PARAM_PATH (self);
+  GParamSpecClass *parent_class = g_type_class_peek (g_type_parent (
+                                                       GEGL_TYPE_PARAM_PATH));
 
-              local_pos = offset;
+  if (param_vector->default_vector)
+    {
+      g_object_unref (param_vector->default_vector);
+      param_vector->default_vector = NULL;
+    }
 
-              if (distance > 0)
-                for (;
-                     local_pos <= distance;
-                     local_pos += spacing)
-                  {
-                    Point spot;
-                    gfloat ratio = local_pos / distance;
-                    gfloat radius = linewidth / 2;
-                                 /* horizon used to refetch the radius
-                                  * for each step from the tool, to be
-                                  * able to have variable line width
-                                  */
-                    lerp (&spot, &a, &b, ratio);
+  parent_class->finalize (self);
+}
 
-                    gegl_vector_stamp (buffer,
-                      spot.x, spot.y, radius, hardness, color);
+static void
+value_set_default (GParamSpec *param_spec,
+                   GValue     *value)
+{
+  GeglParamPath *gegl_vector = GEGL_PARAM_PATH (param_spec);
 
-                    traveled_length += spacing;
-                  }
+  g_value_set_object (value, gegl_vector->default_vector);
+}
 
-              need_to_travel += distance;
-
-              x = b.x;
-              y = b.y;
-            }
-
-            break;
-          case 'u':
-            g_error ("stroking uninitialized path\n");
-            break;
-          case 's':
-            break;
-          default:
-            g_error ("can't stroke for instruction: %i\n", iter->d.type);
-            break;
-        }
-      iter=iter->next;
-    }
-
-  if (gegl_buffer_is_shared (buffer))
-  gegl_buffer_unlock (buffer);
-}
-
-
-static void
-gegl_vector_init (GeglVector *self)
-{
-  GeglVectorPrivate *priv;
-  priv = GEGL_VECTOR_GET_PRIVATE (self);
-}
-
-static void
-gegl_vector_class_init (GeglVectorClass *klass)
-{
-  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
-  gobject_class->finalize     = finalize;
-  gobject_class->set_property = set_property;
-  gobject_class->get_property = get_property;
-
-  g_type_class_add_private (klass, sizeof (GeglVectorPrivate));
-
-  gegl_vector_signals[GEGL_VECTOR_CHANGED] =
-    g_signal_new ("changed", G_TYPE_FROM_CLASS (klass),
-                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
-                  0    /* class offset */,
-                  NULL /* accumulator */,
-                  NULL /* accu_data */,
-                  g_cclosure_marshal_VOID__POINTER,
-                  G_TYPE_NONE, /*return type */
-                  1, G_TYPE_POINTER);
-}
-
-static void
-gegl_vector_emit_changed (GeglVector          *vector,
-                          const GeglRectangle *bounds)
-{
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
-  GeglRectangle rect;
-  GeglRectangle temp;
-  if (!bounds)
-    {
-       gdouble min_x;
-       gdouble max_x;
-       gdouble min_y;
-       gdouble max_y;
-       gegl_vector_get_bounds (vector, &min_x, &max_x, &min_y, &max_y);
-       rect.x = min_x;
-       rect.y = min_y;
-       rect.width = max_x - min_x;
-       rect.height = max_y - min_y;
-
-       temp = priv->cached_extent;
-       priv->cached_extent = rect;
-
-       gegl_rectangle_bounding_box (&temp, &temp, &rect);
-       bounds = &temp;
-    }
-  g_signal_emit (vector, gegl_vector_signals[GEGL_VECTOR_CHANGED], 0,
-                 bounds, NULL);
-}
-
-static void
-finalize (GObject *gobject)
-{
-  GeglVector        *self = GEGL_VECTOR (gobject);
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (self);
-
-  self = NULL;
-  if (priv->path)
-    gegl_vector_path_destroy (priv->path);
-  if (priv->flat_path)
-    gegl_vector_path_destroy (priv->flat_path);
-  priv = NULL;
-
-  G_OBJECT_CLASS (gegl_vector_parent_class)->finalize (gobject);
-}
-
-static void
-set_property (GObject      *gobject,
-              guint         property_id,
-              const GValue *value,
-              GParamSpec   *pspec)
-{
-  switch (property_id)
-    {
-      default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
-        break;
-    }
-}
-
-static void
-get_property (GObject    *gobject,
-              guint       property_id,
-              GValue     *value,
-              GParamSpec *pspec)
-{
-  switch (property_id)
-    {
-      default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
-        break;
-    }
-}
-
-GeglVector *
-gegl_vector_new (void)
-{
-  GeglVector        *self = GEGL_VECTOR (g_object_new (GEGL_TYPE_VECTOR, NULL));
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (self);
-
-  gegl_vector_init (self);
-  priv->flat_path_clean = FALSE;
-
-  return self;
-}
-
-
-gdouble
-gegl_vector_get_length (GeglVector *self)
-{
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (self);
-  if (!self)
-    return 0.0;
-  ensure_flattened (self);
-  return path_get_length (priv->flat_path);
-}
-
-void         gegl_vector_get_bounds   (GeglVector   *self,
-                                       gdouble      *min_x,
-                                       gdouble      *max_x,
-                                       gdouble      *min_y,
-                                       gdouble      *max_y)
-{
-  GeglVectorPrivate *priv;
-  GeglVectorPath *iter;
-
-  *min_x = 256.0;
-  *min_y = 256.0;
-  *max_x = -256.0;
-  *max_y = -256.0;
-
-  if (!self)
-    return;
-
-  priv = GEGL_VECTOR_GET_PRIVATE (self);
- 
-
-  ensure_flattened (self);
-  iter = priv->flat_path;
-
-  if (*max_x < *min_x)
-    *max_x = *min_x;
-  if (*max_y < *min_y)
-    *max_y = *min_y;
-
-  while (iter)
-    {
-      gint i;
-      gint max = 0;
-
-      if (iter->d.type == 'M')
-        max = 1;
-      else if (iter->d.type == 'L')
-        max = 1;
-      else if (iter->d.type == 'C')
-        max = 3;
-
-      for (i=0;i<max;i++)
-        {
-          if (iter->d.point[i].x < *min_x)
-            *min_x = iter->d.point[i].x;
-          if (iter->d.point[i].x > *max_x)
-            *max_x = iter->d.point[i].x;
-          if (iter->d.point[i].y < *min_y)
-            *min_y = iter->d.point[i].y;
-          if (iter->d.point[i].y > *max_y)
-            *max_y = iter->d.point[i].y;
-        }
-      iter=iter->next;
-    }
-}
-
-
-
-void
-gegl_vector_calc (GeglVector *self,
-                  gdouble     pos,
-                  gdouble    *xd,
-                  gdouble    *yd)
-{
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (self);
-  if (!self)
-    return;
-  ensure_flattened (self);
-  return path_calc (priv->flat_path, pos, xd, yd);
-}
-
-
-void
-gegl_vector_calc_values (GeglVector *self,
-                         guint      num_samples,
-                         gdouble   *xs,
-                         gdouble   *ys)
-{
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (self);
-  if (!self)
-    return;
-  ensure_flattened (self);
-  return path_calc_values (priv->flat_path, num_samples, xs, ys);
-}
-
-
-/* --------------------------------------------------------------------------
- * A GParamSpec class to describe behavior of GeglVector as an object property
- * follows.
- * --------------------------------------------------------------------------
- */
-
-#define GEGL_PARAM_VECTOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_PARAM_VECTOR, GeglParamVector))
-#define GEGL_IS_PARAM_VECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_PARAM_VECTOR))
-
-typedef struct _GeglParamVector GeglParamVector;
-
-struct _GeglParamVector
-{
-  GParamSpec parent_instance;
-
-  GeglVector *default_vector;
-};
-
-static void
-gegl_param_vector_init (GParamSpec *self)
-{
-  GEGL_PARAM_VECTOR (self)->default_vector = NULL;
-}
-
-static void
-gegl_param_vector_finalize (GParamSpec *self)
-{
-  GeglParamVector  *param_vector  = GEGL_PARAM_VECTOR (self);
-  GParamSpecClass *parent_class = g_type_class_peek (g_type_parent (
-                                                       GEGL_TYPE_PARAM_VECTOR));
-
-  if (param_vector->default_vector)
-    {
-      g_object_unref (param_vector->default_vector);
-      param_vector->default_vector = NULL;
-    }
-
-  parent_class->finalize (self);
-}
-
-static void
-value_set_default (GParamSpec *param_spec,
-                   GValue     *value)
-{
-  GeglParamVector *gegl_vector = GEGL_PARAM_VECTOR (param_spec);
-
-  g_value_set_object (value, gegl_vector->default_vector);
-}
-
-GType
-gegl_param_vector_get_type (void)
-{
-  static GType param_vector_type = 0;
+GType
+gegl_param_path_get_type (void)
+{
+  static GType param_vector_type = 0;
 
   if (G_UNLIKELY (param_vector_type == 0))
     {
       static GParamSpecTypeInfo param_vector_type_info = {
-        sizeof (GeglParamVector),
+        sizeof (GeglParamPath),
         0,
         gegl_param_vector_init,
         0,
@@ -1240,20 +832,20 @@
         NULL,
         NULL
       };
-      param_vector_type_info.value_type = GEGL_TYPE_VECTOR;
+      param_vector_type_info.value_type = GEGL_TYPE_PATH;
 
-      param_vector_type = g_param_type_register_static ("GeglParamVector",
+      param_vector_type = g_param_type_register_static ("GeglParamPath",
                                                        &param_vector_type_info);
     }
 
   return param_vector_type;
 }
 
-const GeglRectangle *gegl_vector_changed_rect (GeglVector *vector);
+const GeglRectangle *gegl_path_changed_rect (GeglPath *vector);
 
-const GeglRectangle *gegl_vector_changed_rect (GeglVector *vector)
+const GeglRectangle *gegl_path_changed_rect (GeglPath *vector)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
   return &priv->dirtied;
 }
 
@@ -1263,14 +855,14 @@
                             const GeglRectangle *roi);
 
 void
-gegl_operation_vector_prop_changed (GeglVector          *vector,
-                                    const GeglRectangle *roi,
-                                    GeglOperation       *operation);
+gegl_operation_path_prop_changed (GeglPath          *vector,
+                                  const GeglRectangle *roi,
+                                  GeglOperation       *operation);
 
 void
-gegl_operation_vector_prop_changed (GeglVector          *vector,
-                                    const GeglRectangle *roi,
-                                    GeglOperation       *operation)
+gegl_operation_path_prop_changed (GeglPath            *vector,
+                                  const GeglRectangle *roi,
+                                  GeglOperation       *operation)
 {
   /* In the end forces a re-render, should be adapted to
    * allow a smaller region to be forced for re-rendering
@@ -1292,22 +884,20 @@
         rect.width += (align-x);
     }
 #endif
-
   gegl_operation_invalidate (operation, &rect);
 }
 
 
-
 GParamSpec *
-gegl_param_spec_vector (const gchar *name,
+gegl_param_spec_path   (const gchar *name,
                         const gchar *nick,
                         const gchar *blurb,
-                        GeglVector  *default_vector,
+                        GeglPath  *default_vector,
                         GParamFlags  flags)
 {
-  GeglParamVector *param_vector;
+  GeglParamPath *param_vector;
 
-  param_vector = g_param_spec_internal (GEGL_TYPE_PARAM_VECTOR,
+  param_vector = g_param_spec_internal (GEGL_TYPE_PARAM_PATH,
                                        name, nick, blurb, flags);
 
   param_vector->default_vector = default_vector;
@@ -1336,16 +926,16 @@
  * new knot types to the infrastructure
  */
 gchar *
-gegl_vector_to_svg_path (GeglVector  *vector)
+gegl_path_to_string (GeglPath  *vector)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
   GString *str = g_string_new ("");
   gchar *ret;
-  GeglVectorPath *iter;
+  GeglPathList *iter;
   for (iter = priv->path; iter; iter=iter->next)
     {
       gint i;
-      KnotInfo *info = find_knot_type(iter->d.type);
+      InstructionInfo *info = lookup_instruction_info(iter->d.type);
 
       g_string_append_c (str, iter->d.type);
       for (i=0;i<info->pairs;i++)
@@ -1374,26 +964,26 @@
   return ret;
 }
 
-void gegl_vector_clear (GeglVector *vector)
+void gegl_path_clear (GeglPath *vector)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
   if (priv->path)
-    gegl_vector_path_destroy (priv->path);
+    gegl_path_list_destroy (priv->path);
   priv->path = NULL;
 }
 
-void gegl_vector_parse_svg_path (GeglVector *vector,
+void gegl_path_parse_string (GeglPath *vector,
                                  const gchar *path)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
   const gchar *p = path;
-  KnotInfo *previnfo = NULL;
+  InstructionInfo *previnfo = NULL;
   gdouble x0, y0, x1, y1, x2, y2;
 
   while (*p)
     {
       gchar     type = *p;
-      KnotInfo *info = find_knot_type(type);
+      InstructionInfo *info = lookup_instruction_info(type);
       if (!info && type!= ' ')
         {
           /* FIXME: make L/l follow M/m */
@@ -1405,23 +995,23 @@
         switch (info->pairs)
           {
             case 0:
-              priv->path = gegl_vector_path_add (priv->path, type, x0, y0);
+              priv->path = gegl_path_list_append (priv->path, type, x0, y0);
               /* coordinates are ignored, all of these could have used add3)*/
               break;
             case 1:
               p = parse_float_pair (p, &x0, &y0);
-              priv->path = gegl_vector_path_add (priv->path, type, x0, y0);
+              priv->path = gegl_path_list_append (priv->path, type, x0, y0);
               break;
             case 2:
               p = parse_float_pair (p, &x0, &y0);
               p = parse_float_pair (p, &x1, &y1);
-              priv->path = gegl_vector_path_add (priv->path, type, x0, y0, x1, y1);
+              priv->path = gegl_path_list_append (priv->path, type, x0, y0, x1, y1);
               break;
             case 3:
               p = parse_float_pair (p, &x0, &y0);
               p = parse_float_pair (p, &x1, &y1);
               p = parse_float_pair (p, &x2, &y2);
-              priv->path = gegl_vector_path_add (priv->path, type, x0, y0, x1, y1, x2, y2);
+              priv->path = gegl_path_list_append (priv->path, type, x0, y0, x1, y1, x2, y2);
               break;
           }
         previnfo = info;
@@ -1431,17 +1021,17 @@
 
   priv->flat_path_clean = FALSE;
   {
-   gegl_vector_emit_changed (vector, NULL);
+   gegl_path_emit_changed (vector, NULL);
   }
 }
 
 
 
 gint
-gegl_vector_get_knot_count  (GeglVector *vector)
+gegl_path_get_count  (GeglPath *vector)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
-  GeglVectorPath *iter;
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
+  GeglPathList *iter;
   gint count=0;
   for (iter = priv->path; iter; iter=iter->next)
     {
@@ -1451,13 +1041,13 @@
 
 }
 
-const GeglVectorKnot *
-gegl_vector_get_knot (GeglVector *vector,
+const GeglPathItem *
+gegl_path_get (GeglPath *vector,
                       gint        pos)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
-  GeglVectorPath *iter;
-  GeglVectorKnot *last = NULL;
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
+  GeglPathList *iter;
+  GeglPathItem *last = NULL;
   gint count=0;
   for (iter = priv->path; iter; iter=iter->next)
     {
@@ -1479,13 +1069,13 @@
  * passing -1 means add at end
  */
 
-void  gegl_vector_remove_knot  (GeglVector *vector,
+void  gegl_path_remove  (GeglPath *vector,
                                 gint        pos)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
-  GeglVectorPath *iter;
-  GeglVectorPath *prev = NULL;
-  GeglVectorPath *last = NULL;
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
+  GeglPathList *iter;
+  GeglPathList *prev = NULL;
+  GeglPathList *last = NULL;
 
   gint count=0;
   for (iter = priv->path; iter; iter=iter->next)
@@ -1493,7 +1083,7 @@
       if (count == pos)
         {
           prev->next = iter->next;
-          g_slice_free (GeglVectorPath, iter);
+          g_slice_free (GeglPathList, iter);
         }
       prev = iter;
       if (prev->next)
@@ -1503,33 +1093,33 @@
   if (count==-1)
     {
       last->next = NULL;
-      g_slice_free (GeglVectorPath, prev);
+      g_slice_free (GeglPathList, prev);
     }
   priv->flat_path_clean = FALSE;
-  gegl_vector_emit_changed (vector, NULL);
+  gegl_path_emit_changed (vector, NULL);
 }
 
-void  gegl_vector_add_knot     (GeglVector           *vector,
+void  gegl_path_insert     (GeglPath           *vector,
                                 gint                  pos,
-                                const GeglVectorKnot *knot)
+                                const GeglPathItem *knot)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
-  GeglVectorPath *iter;
-  GeglVectorPath *prev = NULL;
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
+  GeglPathList *iter;
+  GeglPathList *prev = NULL;
 
   gint count=0;
   for (iter = priv->path; iter; iter=iter->next)
     {
       if (count == pos)
         {
-          GeglVectorPath *new = g_slice_new (GeglVectorPath);
+          GeglPathList *new = g_slice_new (GeglPathList);
           new->d = *knot;
           new->next = iter->next;
           /*if (prev)
             prev->next = new;*/
           iter->next = new;
           priv->flat_path_clean = FALSE;
-          gegl_vector_emit_changed (vector, NULL);
+          gegl_path_emit_changed (vector, NULL);
           return;
         }
       prev = iter;
@@ -1537,7 +1127,7 @@
     }
   if (pos==-1)
     {
-      GeglVectorPath *new = g_slice_new0(GeglVectorPath);
+      GeglPathList *new = g_slice_new0(GeglPathList);
       new->d = *knot;
       new->next = NULL;
       if (prev)
@@ -1546,16 +1136,16 @@
         priv->path = new;
     }
   priv->flat_path_clean = FALSE;
-  gegl_vector_emit_changed (vector, NULL);
+  gegl_path_emit_changed (vector, NULL);
 }
 
-void  gegl_vector_replace_knot (GeglVector           *vector,
+void  gegl_path_replace_knot (GeglPath           *vector,
                                 gint                  pos,
-                                const GeglVectorKnot *knot)
+                                const GeglPathItem *knot)
 {
-  GeglVectorPrivate *priv = GEGL_VECTOR_GET_PRIVATE (vector);
-  GeglVectorPath *iter;
-  GeglVectorPath *prev = NULL;
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
+  GeglPathList *iter;
+  GeglPathList *prev = NULL;
 
   gint count=0;
   for (iter = priv->path; iter; iter=iter->next)
@@ -1564,7 +1154,7 @@
         {
           iter->d = *knot;
           priv->flat_path_clean = FALSE;
-          gegl_vector_emit_changed (vector, NULL);
+          gegl_path_emit_changed (vector, NULL);
           return;
         }
       prev = iter;
@@ -1576,19 +1166,19 @@
         prev->d = *knot;
     }
   priv->flat_path_clean = FALSE;
-  gegl_vector_emit_changed (vector, NULL);
+  gegl_path_emit_changed (vector, NULL);
 }
 
-void  gegl_vector_knot_foreach (GeglVector *vector,
-                                void (*func) (const GeglVectorKnot *knot,
+void  gegl_path_foreach (GeglPath *vector,
+                                void (*func) (const GeglPathItem *knot,
                                               gpointer              data),
                                 gpointer    data)
 {
-  GeglVectorPrivate *priv;
-  GeglVectorPath *iter;
+  GeglPathPrivate *priv;
+  GeglPathList *iter;
   if (!vector)
     return;
-  priv = GEGL_VECTOR_GET_PRIVATE (vector);
+  priv = GEGL_PATH_GET_PRIVATE (vector);
   for (iter = priv->path; iter; iter=iter->next)
     {
       func (&(iter->d), data);
@@ -1596,16 +1186,16 @@
 }
 
 
-void  gegl_vector_flat_knot_foreach (GeglVector *vector,
-                                     void (*func) (const GeglVectorKnot *knot,
+void  gegl_path_foreach_flat (GeglPath *vector,
+                                     void (*func) (const GeglPathItem *knot,
                                                    gpointer              data),
                                      gpointer    data)
 {
-  GeglVectorPrivate *priv;
-  GeglVectorPath *iter;
+  GeglPathPrivate *priv;
+  GeglPathList *iter;
   if (!vector)
     return;
-  priv = GEGL_VECTOR_GET_PRIVATE (vector);
+  priv = GEGL_PATH_GET_PRIVATE (vector);
   ensure_flattened (vector);
   for (iter = priv->flat_path; iter; iter=iter->next)
     {
@@ -1613,10 +1203,10 @@
     }
 }
 
-void  gegl_vector_add_flattener (GeglVectorPath *(*flattener) (GeglVectorPath *original))
+void  gegl_path_add_flattener (GeglPathList *(*flattener) (GeglPathList *original))
 {
-  GeglVector *vector = g_object_new (GEGL_TYPE_VECTOR, NULL);
-  GeglVectorClass *klass= GEGL_VECTOR_GET_CLASS (vector);
+  GeglPath *vector = g_object_new (GEGL_TYPE_PATH, NULL);
+  GeglPathClass *klass= GEGL_PATH_GET_CLASS (vector);
   gint i;
   g_object_unref (vector);
   /* currently only one additional flattener is supported, this should be fixed,
@@ -1636,25 +1226,25 @@
 
 
 void
-gegl_vector_add (GeglVector *self,
+gegl_path_append (GeglPath *self,
                  ...)
 {
-  GeglVectorPrivate *priv;
-  KnotInfo *info;
-  GeglVectorPath *iter;
+  GeglPathPrivate *priv;
+  InstructionInfo *info;
+  GeglPathList *iter;
   gchar type;
   gint pair_no;
   va_list var_args;
 
-  priv = GEGL_VECTOR_GET_PRIVATE (self);
+  priv = GEGL_PATH_GET_PRIVATE (self);
   va_start (var_args, self);
   type = va_arg (var_args, int); /* we pass in a char, but it is promoted to int by varargs*/
 
-  info = find_knot_type(type);
+  info = lookup_instruction_info(type);
   if (!info)
     g_error ("didn't find [%c]", type);
 
-  priv->path = path_append (priv->path, &iter);
+  priv->path = gegl_path_list_append_item (priv->path, &iter);
 
   iter->d.type       = type;
   for (pair_no=0;pair_no<info->pairs;pair_no++)
@@ -1664,14 +1254,16 @@
     }
   va_end (var_args);
   priv->flat_path_clean = FALSE;
-  gegl_vector_emit_changed (self, NULL);
+  gegl_path_emit_changed (self, NULL);
 }
 
+/**************************************/
+
 #if 0
-const GeglMatrix *gegl_vector_get_matrix (GeglVector *vector)
+const GeglMatrix *gegl_path_get_matrix (GeglPath *vector)
 {
 }
-GeglMatrix gegl_vector_set_matrix (GeglVector *vector,
+GeglMatrix gegl_path_set_matrix (GeglPath *vector,
                                    const GeglMatrix *matrix)
 {
 }
@@ -1706,3 +1298,399 @@
   r->height=y2-y1;
 }
 #endif
+
+#define AA 3
+
+static void gegl_buffer_accumulate (GeglBuffer    *buffer,
+                                    GeglRectangle *roi,
+                                    const gfloat  *col)
+{
+  static Babl   *format = NULL;
+  static gfloat *buf = NULL;
+  static gint len = 0;
+  gint i;
+
+  if (!format)
+    format = babl_format ("RaGaBaA float");
+
+  if (!buf || len < roi->width)
+    {
+      len = roi->width;
+      if (buf)
+        g_free (buf);
+      buf = g_malloc (len * 4 *4);
+      /* final scratch buf will be "leaked" */
+    }
+
+  gegl_buffer_get (buffer, 1.0, roi, format, buf, 0);
+  for (i=0; i< roi->width; i++)
+    {
+      gint j;
+      for (j=0; j<4; j++)
+        buf[i*4 + j] += col[j];
+    }
+  gegl_buffer_set (buffer, roi, format, buf, 0);
+}
+
+void gegl_path_fill (GeglBuffer *buffer,
+                     GeglPath   *vector,
+                     GeglColor  *color,
+                     gboolean    winding)
+{
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
+  gdouble xmin, xmax, ymin, ymax;
+  GeglRectangle extent;
+  gfloat  horsub = AA;
+  gint    versubi = horsub;
+  gfloat  versub = versubi;
+  gint    samples;
+
+  if (!vector)
+    return;
+
+  ensure_flattened (vector);
+  samples = path_get_length (priv->flat_path);
+  gegl_path_get_bounds (vector, &xmin, &xmax, &ymin, &ymax);
+
+  extent.x = floor (xmin);
+  extent.y = floor (ymin);
+  extent.width = ceil (xmax) - extent.x;
+  extent.height = ceil (ymax) - extent.y;
+
+  {
+    GSList *scanlines[extent.height * versubi];
+
+    gdouble xs[samples];
+    gdouble ys[samples];
+
+    gint i;
+    gdouble prev_x;
+    gint    prev_y;
+    gdouble first_x;
+    gint    first_y;
+    gint    lastline=-1;
+    gint    lastdir=-2;
+
+    path_calc_values (priv->flat_path, samples, xs, ys);
+
+    /* clear scanline intersection lists */
+    for (i=0; i < extent.height * versub; i++)
+      scanlines[i]=NULL;
+
+    first_x = prev_x = xs[0] * horsub;
+    first_y = prev_y = ys[0] * versub;
+    
+    /* saturate scanline intersection list */
+    for (i=1; i<samples; i++)
+      {
+        gint dest_x = xs[i] * horsub;
+        gint dest_y = ys[i] * versub;
+        gint ydir;
+        gint dx;
+        gint dy;
+        gint y;
+fill_close:  /* label used for goto to close last segment */
+        dx = dest_x - prev_x;
+        dy = dest_y - prev_y;
+
+        if (dy < 0)
+          ydir = -1;
+        else
+          ydir = 1;
+
+        /* do linear interpolation between vertexes */
+        for (y=prev_y; y!= dest_y; y += ydir)
+          {
+            if (y-extent.y * versub >= 0 &&
+                y-extent.y * versub < extent.height * versub &&
+                lastline != y)
+              {
+                gint x = prev_x + (dx * (y-prev_y)) / dy;
+                /* XXX: * clamp the spans to the width/height of the buffer ? */
+
+                scanlines[ y - extent.y * versubi]=
+                  g_slist_insert_sorted (scanlines[ y - extent.y * versubi],
+                                         GINT_TO_POINTER(x),
+                                         compare_ints);
+                if (ydir != lastdir &&
+                    lastdir != -2)
+                  scanlines[ y - extent.y * versubi]=
+                    g_slist_insert_sorted (scanlines[ y - extent.y * versubi],
+                                           GINT_TO_POINTER(x),
+                                           compare_ints);
+                lastdir = ydir;
+                lastline = y;
+              }
+          }
+
+        prev_x = dest_x;
+        prev_y = dest_y;
+
+        /* if we're on the last knot, fake the first vertex being a next one */
+        if (i+1 == samples)
+          {
+            dest_x = first_x;
+            dest_y = first_y;
+            i++; /* to make the loop finally end */
+            goto fill_close;
+          }
+      }
+
+    /* Fill the spans */
+{
+    const gfloat *colc = gegl_color_float4 (color);
+    gfloat col[4] = {colc[0],colc[1],colc[2],colc[3]};
+    gfloat factor = 1.0/(horsub * versub);
+
+    col[0] *= factor;
+    col[1] *= factor;
+    col[2] *= factor;
+    col[3] *= factor;
+
+    if (gegl_buffer_is_shared (buffer))
+    while (!gegl_buffer_try_lock (buffer));
+
+    for (i=0; i < extent.height * versub; i++)
+      {
+        GSList *iter = scanlines[i];
+        while (iter)
+          {
+            GSList *next = iter->next;
+            gint    j;
+            gint startx, endx;
+            if (!next)
+              break;
+
+            startx = GPOINTER_TO_INT (iter->data);
+            endx   = GPOINTER_TO_INT (next->data);
+
+            for (j=0;j<horsub;j++)
+            {
+              GeglRectangle roi={(startx+j)/horsub, extent.y + i/versub, (endx - startx-j + horsub) / horsub, 1};
+              gegl_buffer_accumulate (buffer, &roi, col);
+            }
+
+            iter = next->next;
+          }
+        if (scanlines[i])
+          g_slist_free (scanlines[i]);
+      }
+
+    if (gegl_buffer_is_shared (buffer))
+    gegl_buffer_unlock (buffer);
+  }
+  }
+}
+
+typedef struct StampStatic {
+  gboolean  valid;
+  Babl     *format;
+  gfloat   *buf;
+  gdouble   radius;
+}StampStatic;
+
+void gegl_path_stamp (GeglBuffer *buffer,
+                      gdouble     x,
+                      gdouble     y,
+                      gdouble     radius,
+                      gdouble     hardness,
+                      GeglColor  *color);
+
+void gegl_path_stamp (GeglBuffer *buffer,
+                      gdouble     x,
+                      gdouble     y,
+                      gdouble     radius,
+                      gdouble     hardness,
+                      GeglColor  *color)
+{
+  const gfloat *col = gegl_color_float4 (color);
+  static StampStatic s = {FALSE,}; /* XXX: 
+                                      we will ultimately leak the last valid
+                                      cached brush. */
+
+  GeglRectangle roi = {floor(x-radius),
+                       floor(y-radius),
+                       ceil (x+radius) - floor (x-radius),
+                       ceil (y+radius) - floor (y-radius)};
+
+  GeglRectangle temp;
+
+  /* bail out if we wouldn't leave a mark on the buffer */
+  if (!gegl_rectangle_intersect (&temp, &roi, gegl_buffer_get_extent (buffer)))
+      return;
+
+  if (s.format == NULL)
+    s.format = babl_format ("RGBA float");
+
+  if (s.buf == NULL ||
+      s.radius != radius)
+    {
+      if (s.buf != NULL)
+        g_free (s.buf);
+      /* allocate a little bit more, just in case due to rounding errors and
+       * such */
+      s.buf = g_malloc (4*4* (roi.width + 2 ) * (roi.height + 2));
+      s.radius = radius;
+      s.valid = TRUE;  
+    }
+  g_assert (s.buf);
+
+  gegl_buffer_get (buffer, 1.0, &roi, s.format, s.buf, 0);
+
+  {
+    gint u, v;
+    gint i=0;
+
+    gfloat radius_squared = radius * radius;
+    gfloat inner_radius_squared = (radius * hardness)*(radius * hardness);
+    gfloat soft_range = radius_squared - inner_radius_squared;
+
+    for (v= roi.y; v < roi.y + roi.height ; v++)
+    {
+      gfloat vy2 = (v-y)*(v-y);
+      for (u= roi.x; u < roi.x + roi.width; u++)
+        {
+          gfloat o = (u-x) * (u-x) + vy2;
+
+          if (o < inner_radius_squared)
+             o = col[3];
+          else if (o < radius_squared)
+            {
+              o = (1.0 - (o-inner_radius_squared) / (soft_range)) * col[3];
+            }
+          else
+            {
+              o=0.0;
+            }
+         if (o!=0.0)
+           {
+             gint c;
+             for (c=0;c<4;c++)
+               s.buf[i*4+c] = (s.buf[i*4+c] * (1.0-o) + col[c] * o);
+           }
+         i++;
+        }
+    }
+  }
+  gegl_buffer_set (buffer, &roi, s.format, s.buf, 0);
+}
+
+
+void gegl_path_stroke (GeglBuffer *buffer,
+                       GeglPath *vector,
+                       GeglColor  *color,
+                       gdouble     linewidth,
+                       gdouble     hardness)
+{
+  GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
+  GeglRectangle bufext;
+  gfloat traveled_length = 0;
+  gfloat need_to_travel = 0;
+  gfloat x = 0,y = 0;
+  gboolean had_move_to = FALSE;
+  GeglPathList *iter;
+  gdouble       xmin, xmax, ymin, ymax;
+  GeglRectangle extent;
+
+  if (!vector)
+    return;
+
+  ensure_flattened (vector);
+
+  iter = priv->flat_path;
+  gegl_path_get_bounds (vector, &xmin, &xmax, &ymin, &ymax);
+  extent.x = floor (xmin);
+  extent.y = floor (ymin);
+  extent.width = ceil (xmax) - extent.x;
+  extent.height = ceil (ymax) - extent.y;
+
+  bufext = *gegl_buffer_get_extent (buffer);
+
+  if (gegl_buffer_is_shared (buffer))
+  while (!gegl_buffer_try_lock (buffer));
+
+  if (!gegl_rectangle_intersect (&extent, &bufext, &bufext))
+    return;
+  gegl_buffer_clear (buffer, &extent);
+
+  while (iter)
+    {
+      //fprintf (stderr, "%c, %i %i\n", iter->d.type, iter->d.point[0].x, iter->d.point[0].y);
+      switch (iter->d.type)
+        {
+          case 'M':
+            x = iter->d.point[0].x;
+            y = iter->d.point[0].y;
+            need_to_travel = 0;
+            traveled_length = 0;
+            had_move_to = TRUE;
+            break;
+          case 'L':
+            {
+              Point a,b;
+
+              gfloat spacing;
+              gfloat local_pos;
+              gfloat distance;
+              gfloat offset;
+              gfloat leftover;
+              gfloat radius = linewidth / 2.0;
+
+
+              a.x = x;
+              a.y = y;
+
+              b.x = iter->d.point[0].x;
+              b.y = iter->d.point[0].y;
+
+              spacing = 0.2 * radius;
+
+              distance = point_dist (&a, &b);
+
+              leftover = need_to_travel - traveled_length;
+              offset = spacing - leftover;
+
+              local_pos = offset;
+
+              if (distance > 0)
+                for (;
+                     local_pos <= distance;
+                     local_pos += spacing)
+                  {
+                    Point spot;
+                    gfloat ratio = local_pos / distance;
+                    gfloat radius = linewidth / 2;
+                                 /* horizon used to refetch the radius
+                                  * for each step from the tool, to be
+                                  * able to have variable line width
+                                  */
+                    lerp (&spot, &a, &b, ratio);
+
+                    gegl_path_stamp (buffer,
+                      spot.x, spot.y, radius, hardness, color);
+
+                    traveled_length += spacing;
+                  }
+
+              need_to_travel += distance;
+
+              x = b.x;
+              y = b.y;
+            }
+
+            break;
+          case 'u':
+            g_error ("stroking uninitialized path\n");
+            break;
+          case 's':
+            break;
+          default:
+            g_error ("can't stroke for instruction: %i\n", iter->d.type);
+            break;
+        }
+      iter=iter->next;
+    }
+
+  if (gegl_buffer_is_shared (buffer))
+  gegl_buffer_unlock (buffer);
+}

Copied: trunk/gegl/property-types/gegl-path.h (from r2651, /trunk/gegl/property-types/gegl-vector.h)
==============================================================================
--- /trunk/gegl/property-types/gegl-vector.h	(original)
+++ trunk/gegl/property-types/gegl-path.h	Mon Oct 20 22:51:24 2008
@@ -16,23 +16,23 @@
  * Copyright 2007 Ãyvind KolÃs <pippin gimp org>
  */
 
-#ifndef __GEGL_VECTOR_H__
-#define __GEGL_VECTOR_H__
+#ifndef __GEGL_PATH_H__
+#define __GEGL_PATH_H__
 
 #include <glib-object.h>
 
 G_BEGIN_DECLS
 
-#define GEGL_TYPE_VECTOR            (gegl_vector_get_type ())
-#define GEGL_VECTOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_VECTOR, GeglVector))
-#define GEGL_VECTOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_VECTOR, GeglVectorClass))
-#define GEGL_IS_VECTOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_VECTOR))
-#define GEGL_IS_VECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_VECTOR))
-#define GEGL_VECTOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_VECTOR, GeglVectorClass))
+#define GEGL_TYPE_PATH            (gegl_path_get_type ())
+#define GEGL_PATH(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_PATH, GeglPath))
+#define GEGL_PATH_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_PATH, GeglPathClass))
+#define GEGL_IS_PATH(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_PATH))
+#define GEGL_IS_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_PATH))
+#define GEGL_PATH_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_PATH, GeglPathClass))
 
-typedef struct _GeglVectorClass  GeglVectorClass;
+typedef struct _GeglPathClass  GeglPathClass;
 
-struct _GeglVector
+struct _GeglPath
 {
   GObject parent_instance;
 };
@@ -50,144 +50,129 @@
   gfloat y;
 } Point;
 
-typedef struct GeglVectorKnot
+typedef struct GeglPathItem
 {
   gchar  type; /* should perhaps be padded out? */
   Point  point[4];
-} GeglVectorKnot;
+} GeglPathItem;
 
-typedef struct GeglVectorPath
-{
-  GeglVectorKnot         d;
-  struct GeglVectorPath *next;
-} GeglVectorPath;
-
-struct _GeglVectorClass
-{
-  GObjectClass parent_class;
-  GeglVectorPath *(*flattener[8]) (GeglVectorPath *original);
-};
-
-
-GType        gegl_vector_get_type       (void) G_GNUC_CONST;
-
-GeglVector * gegl_vector_new            (void);
-
-/* Adds a path knot/instuction,. e.g:
- *
- *  gegl_vector_add ('m', 10.0, 10.0);  for a relative move_to 10, 10
- *  the number of arguments are determined automatically through the
- *  command used, for language bindings append knots at position -1
- *  with gegl_vector_add_knot
- *
- */
-void         gegl_vector_add            (GeglVector *self, ...);
 
-void         gegl_vector_get_bounds     (GeglVector   *self,
-                                         gdouble      *min_x,
-                                         gdouble      *max_x,
-                                         gdouble      *min_y,
-                                         gdouble      *max_y);
+GType                gegl_path_get_type       (void) G_GNUC_CONST;
+GeglPath           * gegl_path_new            (void);
 
-gdouble      gegl_vector_get_length     (GeglVector  *self);
+void                 gegl_path_parse_string   (GeglPath    *path,
+                                               const gchar *path_string);
+gchar              * gegl_path_to_string      (GeglPath    *path);
+
+gint                 gegl_path_get_count      (GeglPath    *path);
+
+void                 gegl_path_clear          (GeglPath    *path);
+void                 gegl_path_append         (GeglPath    *self,
+                                                            ...);
+void                 gegl_path_insert         (GeglPath    *path,
+                                               gint         pos,
+                                               const GeglPathItem *knot);
+const GeglPathItem * gegl_path_get            (GeglPath    *path,
+                                               gint         pos);
+void                 gegl_path_replace_knot   (GeglPath    *path,
+                                               gint         pos,
+                                               const GeglPathItem *knot);
+void                 gegl_path_remove         (GeglPath    *path,
+                                               gint         pos);
+
+void                 gegl_path_foreach        (GeglPath    *path,
+                                               void       (*each_item) (
+                                                     const GeglPathItem *knot,
+                                                     gpointer            data),
+                                               gpointer     data);
+void                 gegl_path_foreach_flat   (GeglPath   *path,
+                                               void       (*each_item) (
+                                                     const GeglPathItem *knot,
+                                                     gpointer            data),
+                                               gpointer     data);
+
+gdouble              gegl_path_get_length     (GeglPath     *self);
+void                 gegl_path_calc           (GeglPath     *path,
+                                               gdouble       pos,
+                                               gdouble      *dest_x,
+                                               gdouble      *dest_y);
+void                 gegl_path_get_bounds     (GeglPath     *self,
+                                               gdouble      *min_x,
+                                               gdouble      *max_x,
+                                               gdouble      *min_y,
+                                               gdouble      *max_y);
+void                 gegl_path_calc_values    (GeglPath    *self,
+                                               guint        num_samples,
+                                               gdouble     *dest_xs,
+                                               gdouble     *dest_ys);
+
+GParamSpec         * gegl_param_spec_path     (const gchar *name,
+                                               const gchar *nick,
+                                               const gchar *blurb,
+                                               GeglPath    *default_path,
+                                               GParamFlags  flags);
+
+#define GEGL_TYPE_PARAM_PATH    (gegl_param_path_get_type ())
+#define GEGL_IS_PARAM_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_PARAM_PATH))
+GType                gegl_param_path_get_type (void) G_GNUC_CONST;
 
-/*
- * compute x,y coordinates at pos along the path (0.0 to gegl_vector_length() is valid positions
- */
-void         gegl_vector_calc           (GeglVector  *self,
-                                         gdouble      pos,
-                                         gdouble     *x,
-                                         gdouble     *y);
 
-/*
- * compute a set of samples for the entire path
+/* Linked list used internally, and for the plug-in API for new path
+ * interpolators.
  */
-void         gegl_vector_calc_values    (GeglVector  *self,
-                                         guint        num_samples,
-                                         gdouble     *xs,
-                                         gdouble     *ys);
-
-
-GParamSpec * gegl_param_spec_vector     (const gchar *name,
-                                         const gchar *nick,
-                                         const gchar *blurb,
-                                         GeglVector  *default_vector,
-                                         GParamFlags  flags);
-
-/* parse an SVG path (or any other path with additional valid path instructions */
-void gegl_vector_parse_svg_path (GeglVector *vector,
-                                 const gchar *path);
-
-/* serialie the path in an SVG manner (not yet flattened to any specified level) */
-gchar * gegl_vector_to_svg_path (GeglVector  *vector);
-
-
-/* clear path for all knots */
-void gegl_vector_clear (GeglVector *vector);
-
-
-/* for pos parameters -1 can be used to indicate the end of the path */
-
-gint                  gegl_vector_get_knot_count  (GeglVector *vector);
-const GeglVectorKnot *gegl_vector_get_knot        (GeglVector *vector,
-                                                   gint        pos);
-void  gegl_vector_remove_knot  (GeglVector           *vector,
-                                gint                  pos);
-void  gegl_vector_add_knot     (GeglVector           *vector,
-                                gint                  pos,
-                                const GeglVectorKnot *knot);
-void  gegl_vector_replace_knot (GeglVector           *vector,
-                                gint                  pos,
-                                const GeglVectorKnot *knot);
-void  gegl_vector_knot_foreach (GeglVector           *vector,
-                                void (*func) (const GeglVectorKnot *knot,
-                                              gpointer              data),
-                                gpointer              data);
-void  gegl_vector_flat_knot_foreach (GeglVector *vector,
-                                     void (*func) (const GeglVectorKnot *knot,
-                                                   gpointer              data),
-                                     gpointer    data);
-
-
-#define GEGL_TYPE_PARAM_VECTOR    (gegl_param_vector_get_type ())
-#define GEGL_IS_PARAM_VECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_PARAM_VECTOR))
-
-GType        gegl_param_vector_get_type (void) G_GNUC_CONST;
-
-
-/* the following API is for hooking in additional path types, that can be flattened by
- * external flatterners, it allows acces to a linked list version of the paths, which
- * is what is used internally
+typedef struct GeglPathList
+{
+  GeglPathItem         d;
+  struct GeglPathList *next;
+} GeglPathList;
+
+/* appends to path list, if head is NULL a new list is created */
+GeglPathList       * gegl_path_list_append    (GeglPathList *head, ...);
+/* frees up a path list */
+GeglPathList       * gegl_path_list_destroy   (GeglPathList *path);
+
+
+/* add a new control point type to GeglPath, this new type works in everything
+ * from the _add () functions (number of arguments determined automatically)
+ * to the string parsing and serialization functions.
+ */
+void gegl_path_add_type (gchar        type,
+                         gint         pairs,
+                         const gchar *description);
+
+/* Add a new flattener, the flattener should produce a type of path that
+ * GeglPath already understands, if the flattener is unable to flatten
+ * the incoming path (doesn't understand the instructions), the original
+ * path should be returned.
  */
+void gegl_path_add_flattener (GeglPathList *(*func) (GeglPathList *original));
 
 
-void gegl_vector_add_flattener (GeglVectorPath *(*func) (GeglVectorPath *original));
-void gegl_vector_add_knot_type (gchar type, gint pairs, const gchar *description);
-
-GeglVectorPath * gegl_vector_path_add     (GeglVectorPath *head, ...);
-GeglVectorPath * gegl_vector_path_destroy (GeglVectorPath *path);
-GeglVectorPath * gegl_vector_path_flatten (GeglVectorPath *original);
 #if 0
-const GeglMatrix *gegl_vector_get_matrix (GeglVector *vector);
-GeglMatrix gegl_vector_set_matrix (GeglVector *vector,
+const GeglMatrix *gegl_path_get_matrix (GeglPath *path);
+GeglMatrix gegl_path_set_matrix (GeglPath *path,
                                    const GeglMatrix *matrix);
 #endif
 
-/* this can and should be the responsiblity of cairo */
 #include <gegl-buffer.h>
 
-void gegl_vector_fill (GeglBuffer *buffer,
-                       GeglVector *vector,
+/* this can and should be the responsiblity of cairo */
+void gegl_path_fill (GeglBuffer *buffer,
+                     GeglPath   *path,
+                     GeglColor  *color,
+                     gboolean    winding);
+
+/* Stroke the path with a brush having the specified attributes
+ * (code from horizon)
+ */
+void gegl_path_stroke (GeglBuffer *buffer,
+                       GeglPath   *path,
                        GeglColor  *color,
-                       gboolean    winding);
+                       gdouble     linewidth,
+                       gdouble     hardness);
+
 
-/* this will go away, it is the stroke routines */
-void gegl_vector_stroke (GeglBuffer *buffer,
-                         GeglVector *vector,
-                         GeglColor  *color,
-                         gdouble     linewidth,
-                         gdouble     hardness);
 
 G_END_DECLS
 
-#endif /* __GEGL_VECTOR_H__ */
+#endif /* __GEGL_PATH_H__ */

Modified: trunk/operations/common/layer.c
==============================================================================
--- trunk/operations/common/layer.c	(original)
+++ trunk/operations/common/layer.c	Mon Oct 20 22:51:24 2008
@@ -37,7 +37,7 @@
                   _("Vertical position"))
 gegl_chant_double(scale, _("scale"), -G_MAXDOUBLE, G_MAXDOUBLE, 1.0,
                   _("Scale 1:1 size"))
-gegl_chant_path(src, _("Source"), "",
+gegl_chant_file_path(src, _("Source"), "",
                 _("Source datafile (png, jpg, raw, svg, bmp, tif, ...)"))
 
 #else

Modified: trunk/operations/common/load.c
==============================================================================
--- trunk/operations/common/load.c	(original)
+++ trunk/operations/common/load.c	Mon Oct 20 22:51:24 2008
@@ -22,7 +22,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path, _("File"), "", _("Path of file to load."))
+gegl_chant_file_path (path, _("File"), "", _("Path of file to load."))
 
 #else
 

Modified: trunk/operations/common/magick-load.c
==============================================================================
--- trunk/operations/common/magick-load.c	(original)
+++ trunk/operations/common/magick-load.c	Mon Oct 20 22:51:24 2008
@@ -22,7 +22,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path, _("File"), "/tmp/gegl-logo.svg", _("Path of file to load."))
+gegl_chant_file_path (path, _("File"), "/tmp/gegl-logo.svg", _("Path of file to load."))
 
 #else
 

Modified: trunk/operations/common/raw-load.c
==============================================================================
--- trunk/operations/common/raw-load.c	(original)
+++ trunk/operations/common/raw-load.c	Mon Oct 20 22:51:24 2008
@@ -24,7 +24,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path, _("File"), "/tmp/test.raw", _("Path of file to load."))
+gegl_chant_file_path (path, _("File"), "/tmp/test.raw", _("Path of file to load."))
 
 #else
 

Modified: trunk/operations/external/ff-load.c
==============================================================================
--- trunk/operations/external/ff-load.c	(original)
+++ trunk/operations/external/ff-load.c	Mon Oct 20 22:51:24 2008
@@ -22,7 +22,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path, _("File"), "/home/pippin/input.avi", _("Path of file to load."))
+gegl_chant_file_path (path, _("File"), "/home/pippin/input.avi", _("Path of file to load."))
 gegl_chant_int (frame, _("Frame"), 0, 1000000, 0, _("frame number"))
 
 #else

Modified: trunk/operations/external/fill.c
==============================================================================
--- trunk/operations/external/fill.c	(original)
+++ trunk/operations/external/fill.c	Mon Oct 20 22:51:24 2008
@@ -23,8 +23,8 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_vector (vector,   _("Vector"),
-                             _("A GeglVector representing the path of the fill"))
+gegl_chant_path   (path,   _("Path"),
+                             _("A GeglPath representing the path of the fill"))
 gegl_chant_color  (color,    _("Color"),      "rgba(0.1,0.2,0.3,1.0)",
                              _("Color of paint to use"))
 gegl_chant_boolean(winding,  _("Winding"),    TRUE,
@@ -36,9 +36,7 @@
 #define GEGL_CHANT_C_FILE "fill.c"
 
 #include "gegl-plugin.h"
-
-/* the vector api isn't public yet */
-#include "property-types/gegl-vector.h"
+#include "property-types/gegl-path.h"
 
 #include "gegl-chant.h"
 #include <cairo/cairo.h>
@@ -56,7 +54,7 @@
   GeglRectangle  defined = { 0, 0, 512, 512 };
   gdouble        x0, x1, y0, y1;
 
-  gegl_vector_get_bounds (o->vector, &x0, &x1, &y0, &y1);
+  gegl_path_get_bounds (o->path, &x0, &x1, &y0, &y1);
   defined.x      = x0;
   defined.y      = y0;
   defined.width  = x1 - x0;
@@ -66,7 +64,7 @@
 }
 
 
-static void foreach_cairo (const GeglVectorKnot *knot,
+static void foreach_cairo (const GeglPathItem *knot,
                            gpointer              cr)
 {
   switch (knot->type)
@@ -90,10 +88,10 @@
     }
 }
 
-static void gegl_vector_cairo_play (GeglVector *vector,
+static void gegl_path_cairo_play (GeglPath *path,
                                     cairo_t *cr)
 {
-  gegl_vector_flat_knot_foreach (vector, foreach_cairo, cr);
+  gegl_path_foreach_flat (path, foreach_cairo, cr);
 }
 
 static gboolean
@@ -116,7 +114,7 @@
   cr = cairo_create (surface);
   cairo_translate (cr, -result->x, -result->y);
 
-  gegl_vector_cairo_play (o->vector, cr);
+  gegl_path_cairo_play (o->path, cr);
   gegl_color_get_rgba (o->color, &r,&g,&b,&a);
   cairo_set_source_rgba (cr, r,g,b,a);
   cairo_fill (cr);
@@ -139,7 +137,7 @@
                                                  1,1,4);
   cr = cairo_create (surface);
   /*cairo_translate (cr, -result->x, -result->y);*/
-  gegl_vector_cairo_play (o->vector, cr);
+  gegl_path_cairo_play (o->path, cr);
   result = cairo_in_fill (cr, x, y);
   cairo_destroy (cr);
 
@@ -165,7 +163,7 @@
 
   operation_class->name        = "gegl:fill";
   operation_class->categories  = "render";
-  operation_class->description = _("Renders a fill of the provided GeglVector in a given color");
+  operation_class->description = _("Renders a fill of the provided GeglPath in a given color");
 
  /* operation_class->get_cached_region = get_cached_region;*/
 }

Modified: trunk/operations/external/jpg-load.c
==============================================================================
--- trunk/operations/external/jpg-load.c	(original)
+++ trunk/operations/external/jpg-load.c	Mon Oct 20 22:51:24 2008
@@ -22,7 +22,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path, _("File"), "", _("Path of file to load."))
+gegl_chant_file_path (path, _("File"), "", _("Path of file to load."))
 
 #else
 

Modified: trunk/operations/external/openraw.c
==============================================================================
--- trunk/operations/external/openraw.c	(original)
+++ trunk/operations/external/openraw.c	Mon Oct 20 22:51:24 2008
@@ -20,7 +20,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path, "File", "", "Path of file to load.")
+gegl_chant_file_path (path, "File", "", "Path of file to load.")
 
 #else
 

Modified: trunk/operations/external/png-load.c
==============================================================================
--- trunk/operations/external/png-load.c	(original)
+++ trunk/operations/external/png-load.c	Mon Oct 20 22:51:24 2008
@@ -24,7 +24,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path, _("File"), "", _("Path of file to load."))
+gegl_chant_file_path (path, _("File"), "", _("Path of file to load."))
 
 #else
 

Modified: trunk/operations/external/svg-load.c
==============================================================================
--- trunk/operations/external/svg-load.c	(original)
+++ trunk/operations/external/svg-load.c	Mon Oct 20 22:51:24 2008
@@ -22,7 +22,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path, _("File"), "",
+gegl_chant_file_path (path, _("File"), "",
                  _("Path to SVG file to load"))
 gegl_chant_int (width,  _("Width"),  1, G_MAXINT, 100,
                 _("Width for rendered image"))

Modified: trunk/operations/external/v4l.c
==============================================================================
--- trunk/operations/external/v4l.c	(original)
+++ trunk/operations/external/v4l.c	Mon Oct 20 22:51:24 2008
@@ -23,7 +23,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_path (path,   _("Path"), "/dev/video0", _("Path to v4l device"))
+gegl_chant_file_path (path,   _("Path"), "/dev/video0", _("Path to v4l device"))
 gegl_chant_int  (width,  _("Width"),  0, G_MAXINT, 320, _("Width for rendered image"))
 gegl_chant_int  (height, _("Height"), 0, G_MAXINT, 240, _("Height for rendered image"))
 gegl_chant_int  (frame,  _("Frame"),  0, G_MAXINT, 0, 

Modified: trunk/operations/workshop/stroke.c
==============================================================================
--- trunk/operations/workshop/stroke.c	(original)
+++ trunk/operations/workshop/stroke.c	Mon Oct 20 22:51:24 2008
@@ -23,7 +23,7 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_vector (vector,   _("Vector"),
+gegl_chant_path   (path,   _("Vector"),
                              _("A GeglVector representing the path of the stroke"))
 gegl_chant_color  (color,    _("Color"),      "rgba(0.1,0.2,0.3,1.0)",
                              _("Color of paint to use"))
@@ -39,8 +39,8 @@
 
 #include "gegl-plugin.h"
 
-/* the vector api isn't public yet */
-#include "property-types/gegl-vector.h"
+/* the path api isn't public yet */
+#include "property-types/gegl-path.h"
 
 #include "gegl-chant.h"
 
@@ -57,7 +57,7 @@
   GeglRectangle  defined = { 0, 0, 512, 512 };
   gdouble        x0, x1, y0, y1;
 
-  gegl_vector_get_bounds (o->vector, &x0, &x1, &y0, &y1);
+  gegl_path_get_bounds (o->path, &x0, &x1, &y0, &y1);
   defined.x      = x0 - o->linewidth;
   defined.y      = y0 - o->linewidth;
   defined.width  = x1 - x0 + o->linewidth * 2;
@@ -66,6 +66,12 @@
   return defined;
 }
 
+static GeglRectangle
+get_cached_region (GeglOperation *operation)
+{
+  return get_bounding_box (operation);
+}
+
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
@@ -75,8 +81,8 @@
   GeglRectangle box = get_bounding_box (operation);
 
   gegl_buffer_clear (output, &box);
-  g_object_set_data (operation, "vector-radius", GINT_TO_POINTER((gint)(o->linewidth+1)/2));
-  gegl_vector_stroke (output, o->vector, o->color, o->linewidth, o->hardness);
+  g_object_set_data (operation, "path-radius", GINT_TO_POINTER((gint)(o->linewidth+1)/2));
+  gegl_path_stroke (output, o->path, o->color, o->linewidth, o->hardness);
 
   return  TRUE;
 }
@@ -98,7 +104,7 @@
   operation_class->name        = "gegl:stroke";
   operation_class->categories  = "render";
   operation_class->description = _("Renders a brush stroke");
-  operation_class->get_cached_region = NULL;
+  operation_class->get_cached_region = get_cached_region;
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]