From: Thomas V. S. <tho...@us...> - 2003-06-13 22:02:55
|
CVS Root: /cvsroot/gstreamer Module: gst-editor Changes by: thomasvs Date: Fri Jun 13 2003 15:02:55 PDT Log message: adding gst-editor namespace Modified files: libs/gst/editor : gsteditor.c gsteditorbin.c gsteditorelement.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/gsteditor.c.diff?r1=1.34&r2=1.35 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/gsteditorbin.c.diff?r1=1.32&r2=1.33 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-editor/libs/gst/editor/gsteditorelement.c.diff?r1=1.46&r2=1.47 ====Begin Diffs==== Index: gsteditor.c =================================================================== RCS file: /cvsroot/gstreamer/gst-editor/libs/gst/editor/gsteditor.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- gsteditor.c 9 Jun 2003 12:54:33 -0000 1.34 +++ gsteditor.c 13 Jun 2003 22:02:42 -0000 1.35 @@ -707,8 +707,6 @@ xmlNodePtr children = self->xmlChildrenNode; GstEditorItemAttr *attr = NULL; /* GUI attributes in editor canvas */ - g_print ("xml loaded !\n"); - attr = g_malloc (sizeof (GstEditorItemAttr)); while (children) { Index: gsteditorbin.c =================================================================== RCS file: /cvsroot/gstreamer/gst-editor/libs/gst/editor/gsteditorbin.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- gsteditorbin.c 9 Jun 2003 12:54:33 -0000 1.32 +++ gsteditorbin.c 13 Jun 2003 22:02:42 -0000 1.33 @@ -330,17 +330,18 @@ if (editorbin->attributes) { GstEditorItemAttr *attr; + const gchar *name = GST_OBJECT_NAME (child); - GST_DEBUG (GST_CAT_APPLICATION, "Trying to get attributes for %s", - GST_OBJECT_NAME (child)); - attr = g_datalist_get_data (&(editorbin->attributes), GST_OBJECT_NAME (child)); + GST_DEBUG (GST_CAT_APPLICATION, "Trying to get attributes for %s", name); + attr = g_datalist_get_data (&(editorbin->attributes), name); if (attr) { - GST_DEBUG (GST_CAT_APPLICATION, "Getting attributes for %s", - GST_OBJECT_NAME (child)); + GST_DEBUG (GST_CAT_APPLICATION, "Getting attributes for %s", name); x = attr->x; y = attr->y; + g_datalist_remove_data (&(editorbin->attributes), name); + g_free (attr); } } Index: gsteditorelement.c =================================================================== RCS file: /cvsroot/gstreamer/gst-editor/libs/gst/editor/gsteditorelement.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- gsteditorelement.c 13 Jun 2003 21:57:52 -0000 1.46 +++ gsteditorelement.c 13 Jun 2003 22:02:42 -0000 1.47 @@ -705,13 +705,19 @@ static void on_object_saved (GstObject *object, xmlNodePtr parent, GstEditorItem *item) { - static xmlNsPtr ns = NULL; + xmlNsPtr ns; xmlNodePtr child; gchar *value; gdouble x, y, width, height; - if (ns == NULL) - ns = xmlNewNs (NULL, "http://gstreamer.net/gst-editor/1.0/", "gst-editor"); + /* first see if the namespace is already known */ + ns = xmlSearchNsByHref (parent->doc, parent, + "http://gstreamer.net/gst-editor/1.0/"); + if (ns == NULL) { + xmlNodePtr root = xmlDocGetRootElement (parent->doc); + /* add namespace to root node */ + ns = xmlNewNs (root, "http://gstreamer.net/gst-editor/1.0/", "gst-editor"); + } child = xmlNewChild (parent, ns, "item", NULL); g_object_get (G_OBJECT (item), "x", &x, "y", &y, |