node creation API

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

 



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 : 

---- anim.c ----
      GeglGraph *gegl = g_object_new (GEGL_TYPE_GRAPH, NULL);

      GeglNode  *display = gegl_graph_create_node (gegl,
                       "class",        "display",
                       "window_title", "GEGL demo",
                       NULL);
      GeglNode  *background = gegl_graph_create_node (gegl,
                       "class", "jpg-load",
                       "path",  "data/vinci-womb.jpg",
                       "name",  "background",
                       NULL);
      GeglNode *load = gegl_graph_create_node (gegl,
                       "class", "png-load",
                       "path",  "data/gegl.png",
                       NULL);
--------

I think that this function should receive the "class" as a first
parameter. So this would become : 

---- alternative.c ----
       GeglGraph *gegl = g_object_new (GEGL_TYPE_GRAPH, NULL);

      GeglNode  *display = gegl_graph_create_node (gegl, "display",
                       "window_title", "GEGL demo",
                       NULL);
      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-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer

[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux