[Gegl-developer] node creation API
Øyvind Kolås
pippin at gimp.org
Fri Sep 1 06:03:51 PDT 2006
On 9/1/06, Victor Bogado <bogado at bogado.net> wrote:
> It seems to me that when creating a gegl_node the user will always set
> the class, and more he will need to this before setting any other
> property.
>
> Since this is always required why do he need to state this verbosely? I
> mean, look at this code, from the gegl-demo :
>
> GeglNode *background = gegl_graph_create_node (gegl,
> "class", "jpg-load",
> "path", "data/vinci-womb.jpg",
> "name", "background",
> NULL);
> I think that this function should receive the "class" as a first
> parameter. So this would become :
>
> GeglNode *background = gegl_graph_create_node (gegl, "jpg-load",
> "path", "data/vinci-womb.jpg",
> "name", "background",
> NULL);
> This would not only keep the string "class" from appearing several times
> in the code, but it would prevent the user from committing the mistake
> of not setting the class, or setting the class out of the order.
gegl_graph_create_node and gegl_node_set currently have the same
constraint that class should appear as the first key/value pair if it
is present (it is mandatory for gegl_graph_create_node). Making the
API for these diverge is probably not a good thing to do. If GEGL
doesn't already complain if the class is not the first property being
set, it should be changed to do so.
Allowing to change the "class" of a node (it might be better to rename
this to either "type" or "operation") is a design decision that makes
it a lot easier to change what kind of processing is done without
having to replace the node in the graph (and thus rewire the
connections).
/Øyvind K.
--
«The future is already here. It's just not very evenly distributed»
-- William Gibson
http://pippin.gimp.org/ http://ffii.org/
More information about the Gegl-developer
mailing list