Merge lp:~joakim-verona/inkscape/dbus-fixes into lp:~inkscape.dev/inkscape/trunk

Proposed by jazzynico
Status: Merged
Approved by: jazzynico
Approved revision: 10032
Merged at revision: 10559
Proposed branch: lp:~joakim-verona/inkscape/dbus-fixes
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 692 lines (+387/-61)
11 files modified
src/2geom/transforms.h (+4/-0)
src/2geom/utils.h (+1/-0)
src/desktop.h (+2/-1)
src/extension/dbus/dbus-init.cpp (+1/-1)
src/extension/dbus/document-interface.cpp (+178/-3)
src/extension/dbus/document-interface.h (+26/-0)
src/extension/dbus/document-interface.xml (+163/-2)
src/extension/dbus/proposed-interface.xml (+0/-50)
src/file.cpp (+3/-3)
src/file.h (+1/-1)
src/select-context.cpp (+8/-0)
To merge this branch: bzr merge lp:~joakim-verona/inkscape/dbus-fixes
Reviewer Review Type Date Requested Status
jazzynico (community) Approve
Review via email: mp+59877@code.launchpad.net

Description of the change

allow text formatting via dbus

To post a comment you must log in.
Revision history for this message
jazzynico (jazzynico) wrote :

Apparently you have removed the inkscape.pot file (by doing bzr clean, I guess).
Could you please use bzr revert po/inkscape.pot so that the diff file is a bit cleaner?
Thanks!

review: Needs Fixing
Revision history for this message
joakim@verona.se (joakim-verona) wrote :

> Apparently you have removed the inkscape.pot file (by doing bzr clean, I
> guess).
> Could you please use bzr revert po/inkscape.pot so that the diff file is a bit
> cleaner?
> Thanks!

bzr revert po/inkscape.pot
bzr: ERROR: Path(s) are not versioned: po/inkscape.pot

hmm what now?

Revision history for this message
jazzynico (jazzynico) wrote :

> bzr: ERROR: Path(s) are not versioned: po/inkscape.pot

Apparently, you've removed this file (I don't know why, but it is automatically suppressed when you run # make clean) and committed the change in your branch. To fix it, run:
# cd po/
# make inkscape.pot
# bzr add inkscape.pot
And then commit to your branch.

10021. By joakim@verona.se

missing pot file restored

Revision history for this message
joakim@verona.se (joakim-verona) wrote :

qk i did the above now.

Revision history for this message
jazzynico (jazzynico) wrote :

Well, it's not exactly what I expected, but it's my fault...
The file is still in the diff because it is different from the one you had when you started the branch.
As I first guessed, bzr revert should work correctly if you give it the revision number:
# bzr revert -r 10012 po/inkscape.pot

10022. By joakim@verona.se

restore pot file

Revision history for this message
joakim@verona.se (joakim-verona) wrote :

well, still seems like the diff is gigantic. What now?

10023. By joakim@verona.se

dbus functions for display area

10024. By joakim@verona.se

again trying to fix pot file

10025. By joakim@verona.se

first stab at signal support. works, but only for 1 document window

10026. By joakim@verona.se

removed the global singleton hack for dbus signals so now each dacument can generate signals

10027. By joakim@verona.se

an implementation of the proposed get_children. briefly tested to work

10028. By joakim@verona.se

an implementation of the proposed get_parent orhtogonal to get_children. briefly tested to work

10029. By joakim@verona.se

removed stuff that I implemented

10030. By joakim@verona.se

an implementation of file import via dbus

10031. By joakim@verona.se

changed the import method to return the id of the newly imported object. should probably be changed again to be more like the image method. the diff also contains some irelevant pseudo code.

10032. By joakim@verona.se

merge from upstream, tiny conflict fix

Revision history for this message
jazzynico (jazzynico) wrote :

Are the 2geom changes absolutely necessary (one of them is a comment, and the other an include)? If I understand correctly, we should consider it as an external lib, and fix things upstreams. Maybe someone else could validate this point?

Revision history for this message
jazzynico (jazzynico) wrote :

Apart from the 2geom stuff, file import and text formating work as expected (tested on Ubuntu 10.10, inkscape revision 10558).

Revision history for this message
jazzynico (jazzynico) wrote :

Removing the 2geom changes doesn't seem to break anything, and text formating and image import still work without them.
Could you please confirm and fix the branch so that we can merge?
Thanks!

review: Needs Fixing
Revision history for this message
jazzynico (jazzynico) wrote :

Just seen your comment about 2geom in "Bug #739453: allow text formatting via dbus"...
Since everything else is ok, the branch can be merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/2geom/transforms.h'
2--- src/2geom/transforms.h 2011-05-08 22:43:56 +0000
3+++ src/2geom/transforms.h 2011-06-22 20:34:40 +0000
4@@ -209,7 +209,11 @@
5 public:
6 Coord factor() const { return f; }
7 void setFactor(Coord nf) { f = nf; }
8+
9+ // S &operator*=(S const &s) { f += s.f; return *static_cast<S *>(this); }
10+
11 S &operator*=(S const &s) { f += s.f; return static_cast<S &>(*this); }
12+
13 bool operator==(S const &s) const { return f == s.f; }
14 S inverse() const { return S(-f); }
15 static S identity() { return S(0); }
16
17=== modified file 'src/2geom/utils.h'
18--- src/2geom/utils.h 2011-05-04 20:45:08 +0000
19+++ src/2geom/utils.h 2011-06-22 20:34:40 +0000
20@@ -35,6 +35,7 @@
21
22 #include <cstddef>
23 #include <vector>
24+#include <stddef.h>
25
26 namespace Geom {
27
28
29=== modified file 'src/desktop.h'
30--- src/desktop.h 2011-06-03 10:44:52 +0000
31+++ src/desktop.h 2011-06-22 20:34:40 +0000
32@@ -50,6 +50,7 @@
33 struct SPNamedView;
34 struct SPObject;
35 struct SPStyle;
36+typedef struct _DocumentInterface DocumentInterface;//struct DocumentInterface;
37
38 namespace Gtk
39 {
40@@ -98,7 +99,7 @@
41 SPEventContext *event_context;
42 Inkscape::LayerManager *layer_manager;
43 Inkscape::EventLog *event_log;
44-
45+ DocumentInterface *dbus_document_interface;
46 Inkscape::Display::TemporaryItemList *temporary_item_list;
47 Inkscape::Display::SnapIndicator *snapindicator;
48
49
50=== modified file 'src/extension/dbus/dbus-init.cpp'
51--- src/extension/dbus/dbus-init.cpp 2011-03-18 20:29:06 +0000
52+++ src/extension/dbus/dbus-init.cpp 2011-06-22 20:34:40 +0000
53@@ -147,7 +147,7 @@
54 &dbus_glib_document_interface_object_info, name.c_str());
55 obj->desk = dt;
56 obj->updates = TRUE;
57-
58+ dt->dbus_document_interface=obj;
59 return strdup(name.c_str());
60 }
61
62
63=== modified file 'src/extension/dbus/document-interface.cpp'
64--- src/extension/dbus/document-interface.cpp 2011-06-11 04:47:26 +0000
65+++ src/extension/dbus/document-interface.cpp 2011-06-22 20:34:40 +0000
66@@ -17,7 +17,7 @@
67
68 #include "document-interface.h"
69 #include <string.h>
70-
71+#include <dbus/dbus-glib.h>
72 #include "desktop-handles.h" //sp_desktop_document()
73 #include "desktop-style.h" //sp_desktop_get_style
74 #include "display/canvas-text.h" //text
75@@ -56,6 +56,25 @@
76
77 //#include "2geom/svg-path-parser.h" //get_node_coordinates
78
79+#include <glib.h>
80+#include <dbus/dbus-glib.h>
81+
82+#if 0
83+#include <libxml/tree.h>
84+#include <libxml/parser.h>
85+#include <libxml/xpath.h>
86+#include <libxml/xpathInternals.h>
87+#endif
88+
89+ enum
90+ {
91+ OBJECT_MOVED_SIGNAL,
92+ LAST_SIGNAL
93+ };
94+
95+ static guint signals[LAST_SIGNAL] = { 0 };
96+
97+
98 /****************************************************************************
99 HELPER / SHORTCUT FUNCTIONS
100 ****************************************************************************/
101@@ -280,6 +299,14 @@
102 GObjectClass *object_class;
103 object_class = G_OBJECT_CLASS (klass);
104 object_class->finalize = document_interface_finalize;
105+ signals[OBJECT_MOVED_SIGNAL] =
106+ g_signal_new ("object_moved",
107+ G_OBJECT_CLASS_TYPE (klass),
108+ G_SIGNAL_RUN_LAST,
109+ 0,
110+ NULL, NULL,
111+ g_cclosure_marshal_VOID__STRING,
112+ G_TYPE_NONE, 1, G_TYPE_STRING);
113 }
114
115 static void
116@@ -587,6 +614,44 @@
117 return TRUE;
118 }
119
120+gboolean
121+document_interface_document_set_display_area (DocumentInterface *object,
122+ double x0,
123+ double y0,
124+ double x1,
125+ double y1,
126+ double border,
127+ GError **error)
128+{
129+ object->desk->set_display_area (x0,
130+ y0,
131+ x1,
132+ y1,
133+ border, false);
134+ return TRUE;
135+}
136+
137+
138+GArray *
139+document_interface_document_get_display_area (DocumentInterface *object)
140+{
141+ Geom::Rect const d = object->desk->get_display_area();
142+
143+ GArray * dArr = g_array_new (TRUE, TRUE, sizeof(double));
144+
145+ double x0 = d.min()[Geom::X];
146+ double y0 = d.min()[Geom::Y];
147+ double x1 = d.max()[Geom::X];
148+ double y1 = d.max()[Geom::Y];
149+ g_array_append_val (dArr, x0); //
150+ g_array_append_val (dArr, y0);
151+ g_array_append_val (dArr, x1);
152+ g_array_append_val (dArr, y1);
153+ return dArr;
154+
155+}
156+
157+
158 /****************************************************************************
159 OBJECT FUNCTIONS
160 ****************************************************************************/
161@@ -835,6 +900,35 @@
162 }
163
164
165+
166+gboolean
167+document_interface_text_apply_style (DocumentInterface *object, gchar *name,
168+ int start_pos, int end_pos, gchar *style, gchar *styleval,
169+ GError **error)
170+{
171+
172+ SPItem* text_obj=(SPItem* )get_object_by_name(object->desk, name, error);
173+
174+ //void sp_te_apply_style(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPCSSAttr const *css)
175+ //TODO verify object type
176+ if (!text_obj)
177+ return FALSE;
178+ Inkscape::Text::Layout const *layout = te_get_layout(text_obj);
179+ Inkscape::Text::Layout::iterator start = layout->charIndexToIterator (start_pos);
180+ Inkscape::Text::Layout::iterator end = layout->charIndexToIterator (end_pos);
181+
182+ SPCSSAttr *css = sp_repr_css_attr_new();
183+ sp_repr_css_set_property(css, style, styleval);
184+
185+ sp_te_apply_style(text_obj,
186+ start,
187+ end,
188+ css);
189+ return TRUE;
190+
191+}
192+
193+
194 /****************************************************************************
195 FILE I/O FUNCTIONS
196 ****************************************************************************/
197@@ -861,8 +955,22 @@
198 return TRUE;
199 }
200
201-gboolean document_interface_save_as(DocumentInterface *object,
202- const gchar *filename, GError ** /*error*/)
203+gchar *
204+document_interface_import (DocumentInterface *object,
205+ gchar *filename, GError **error)
206+{
207+ desktop_ensure_active (object->desk);
208+ const Glib::ustring file(filename);
209+ SPDocument * doc = sp_desktop_document(object->desk);
210+
211+ SPObject *new_obj = NULL;
212+ new_obj = file_import(doc, file, NULL);
213+ return strdup(new_obj->getRepr()->attribute("id"));
214+}
215+
216+gboolean
217+document_interface_save_as (DocumentInterface *object,
218+ const gchar *filename, GError **error)
219 {
220 SPDocument * doc = sp_desktop_document(object->desk);
221 #ifdef WITH_GNOME_VFS
222@@ -1329,6 +1437,73 @@
223 return dbus_call_verb (object, SP_VERB_LAYER_PREV, error);
224 }
225
226+
227+//////////////signals
228+
229+
230+DocumentInterface *fugly;
231+gboolean dbus_send_ping (SPDesktop* desk, SPItem *item)
232+{
233+ //DocumentInterface *obj;
234+ g_signal_emit (desk->dbus_document_interface, signals[OBJECT_MOVED_SIGNAL], 0, item->getId());
235+ g_print("Ping!\n");
236+ return TRUE;
237+}
238+
239+//////////tree
240+
241+
242+gboolean
243+document_interface_get_children (DocumentInterface *object, char *name, char ***out, GError **error)
244+{
245+ SPItem* parent=(SPItem* )get_object_by_name(object->desk, name, error);
246+
247+ GSList const *children = parent->childList(false);
248+
249+ int size = g_slist_length((GSList *) children);
250+
251+ *out = g_new0 (char *, size + 1);
252+
253+ int i = 0;
254+ for (GSList const *iter = children; iter != NULL; iter = iter->next) {
255+ (*out)[i] = g_strdup(SP_OBJECT(iter->data)->getRepr()->attribute("id"));
256+ i++;
257+ }
258+ (*out)[i] = NULL;
259+
260+ return TRUE;
261+
262+}
263+
264+
265+gchar*
266+document_interface_get_parent (DocumentInterface *object, char *name, GError **error)
267+{
268+ SPItem* node=(SPItem* )get_object_by_name(object->desk, name, error);
269+
270+ SPObject* parent=node->parent;
271+
272+ return g_strdup(parent->getRepr()->attribute("id"));
273+
274+}
275+
276+#if 0
277+//just pseudo code
278+gboolean
279+document_interface_get_xpath (DocumentInterface *object, char *xpath_expression, char ***out, GError **error){
280+ SPDocument * doc = sp_desktop_document (object->desk);
281+ Inkscape::XML::Document *repr = doc->getReprDoc();
282+
283+ xmlXPathObjectPtr xpathObj;
284+ xmlXPathContextPtr xpathCtx;
285+ xpathCtx = xmlXPathNewContext(repr);//XmlDocPtr
286+ xpathObj = xmlXPathEvalExpression(xmlCharStrdup(xpath_expression), xpathCtx);
287+
288+ //xpathresult result = xpatheval(repr, xpath_selection);
289+ //convert resut to a string array we can return via dbus
290+ return TRUE;
291+}
292+#endif
293 /*
294 Local Variables:
295 mode:c++
296
297=== modified file 'src/extension/dbus/document-interface.h'
298--- src/extension/dbus/document-interface.h 2011-03-18 20:29:06 +0000
299+++ src/extension/dbus/document-interface.h 2011-06-22 20:34:40 +0000
300@@ -121,6 +121,10 @@
301 gboolean
302 document_interface_set_text (DocumentInterface *object, gchar *name,
303 gchar *text, GError **error);
304+gboolean
305+document_interface_text_apply_style (DocumentInterface *object, gchar *name,
306+ int start_pos, int end_pos, gchar *style, gchar *styleval,
307+ GError **error);
308
309 gchar *
310 document_interface_image (DocumentInterface *object, int x, int y,
311@@ -154,6 +158,16 @@
312 gboolean
313 document_interface_document_resize_to_fit_selection (DocumentInterface *object,
314 GError **error);
315+gboolean
316+document_interface_document_set_display_area (DocumentInterface *object,
317+ double x0,
318+ double y0,
319+ double x1,
320+ double y1,
321+ double border,
322+ GError **error);
323+GArray *
324+document_interface_document_get_display_area (DocumentInterface *object);
325
326 /****************************************************************************
327 OBJECT FUNCTIONS
328@@ -404,6 +418,18 @@
329 DocumentInterface *document_interface_new (void);
330 GType document_interface_get_type (void);
331
332+extern DocumentInterface *fugly;
333+gboolean dbus_send_ping (SPDesktop* desk, SPItem *item);
334+
335+gboolean
336+document_interface_get_children (DocumentInterface *object, char *name, char ***out, GError **error);
337+
338+gchar*
339+document_interface_get_parent (DocumentInterface *object, char *name, GError **error);
340+
341+gchar*
342+document_interface_import (DocumentInterface *object,
343+ gchar *filename, GError **error);
344
345 G_END_DECLS
346
347
348=== modified file 'src/extension/dbus/document-interface.xml'
349--- src/extension/dbus/document-interface.xml 2011-03-18 20:29:06 +0000
350+++ src/extension/dbus/document-interface.xml 2011-06-22 20:34:40 +0000
351@@ -352,6 +352,27 @@
352 </doc:doc>
353 </method>
354
355+ <method name="import">
356+ <arg type="s" name="pathname" direction="in" >
357+ <doc:doc>
358+ <doc:summary>The path to a valid svg file.</doc:summary>
359+ </doc:doc>
360+ </arg>
361+ <arg type="s" name="object_name" direction="out" >
362+ <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
363+ <doc:doc>
364+ <doc:summary>The name of the new image.</doc:summary>
365+ </doc:doc>
366+ </arg>
367+ <doc:doc>
368+ <doc:description>
369+ <doc:para>Imports the file at pathname. Similar to the image
370+ method.</doc:para>
371+ </doc:description>
372+ </doc:doc>
373+ </method>
374+
375+
376 <method name="node">
377 <arg type="s" name="svgtype" direction="in" >
378 <doc:doc>
379@@ -453,6 +474,56 @@
380 </doc:doc>
381 </method>
382
383+
384+
385+ <method name="document_set_display_area">
386+ <arg type="d" name="x0" direction="in" >
387+ <doc:doc>
388+ <doc:summary></doc:summary>
389+ </doc:doc>
390+ </arg>
391+ <arg type="d" name="y0" direction="in" >
392+ <doc:doc>
393+ <doc:summary></doc:summary>
394+ </doc:doc>
395+ </arg>
396+ <arg type="d" name="x1" direction="in" >
397+ <doc:doc>
398+ <doc:summary></doc:summary>
399+ </doc:doc>
400+ </arg>
401+ <arg type="d" name="y1" direction="in" >
402+ <doc:doc>
403+ <doc:summary></doc:summary>
404+ </doc:doc>
405+ </arg>
406+ <arg type="d" name="border" direction="in" >
407+ <doc:doc>
408+ <doc:summary></doc:summary>
409+ </doc:doc>
410+ </arg>
411+ <doc:doc>
412+ <doc:description>
413+ <doc:para>Set display area.</doc:para>
414+ </doc:description>
415+ </doc:doc>
416+ </method>
417+
418+ <method name="document_get_display_area">
419+ <doc:doc>
420+ <doc:description>
421+ <doc:para>Get display area.</doc:para>
422+ </doc:description>
423+ </doc:doc>
424+ <arg type="ad" name="area" direction="out" >
425+ <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
426+ <doc:doc>
427+ <doc:summary>area</doc:summary>
428+ </doc:doc>
429+ </arg>
430+ </method>
431+
432+
433 <!-- OBJECT FUNCTIONS -->
434
435 <method name="set_attribute">
436@@ -499,6 +570,43 @@
437 </method>
438
439
440+ <method name="text_apply_style">
441+ <arg type="s" name="shape" direction="in" >
442+ <doc:doc>
443+ <doc:summary>The id of an object.</doc:summary>
444+ </doc:doc>
445+ </arg>
446+
447+ <arg type="i" name="start" direction="in" >
448+ <doc:doc>
449+ <doc:summary>start text pos.</doc:summary>
450+ </doc:doc>
451+ </arg>
452+ <arg type="i" name="end" direction="in" >
453+ <doc:doc>
454+ <doc:summary>end text pos.</doc:summary>
455+ </doc:doc>
456+ </arg>
457+
458+ <arg type="s" name="css_attrib" direction="in" >
459+ <doc:doc>
460+ <doc:summary>css attribute.</doc:summary>
461+ </doc:doc>
462+ </arg>
463+
464+ <arg type="s" name="css_attrib_val" direction="in" >
465+ <doc:doc>
466+ <doc:summary>css attribute value.</doc:summary>
467+ </doc:doc>
468+ </arg>
469+
470+
471+ <doc:doc>
472+ <doc:description>
473+ <doc:para>set styling of partial text object.</doc:para>
474+ </doc:description>
475+ </doc:doc>
476+ </method>
477
478
479 <method name="set_int_attribute">
480@@ -864,6 +972,9 @@
481 </doc:description>
482 </doc:doc>
483 </method>
484+
485+
486+
487 <!--
488 <method name="print_to_file" >
489 <doc:doc>
490@@ -1379,6 +1490,56 @@
491 </doc:doc>
492 </method>
493
494-
495- </interface>
496+<!-- signals -->
497+ <signal name="ObjectMoved">
498+ <arg name="object_name" type="s">
499+ <doc:doc>
500+ <doc:summary>The id of the object.</doc:summary>
501+ </doc:doc>
502+ </arg>
503+ <doc:doc>
504+ <doc:description>
505+ <doc:para>Emitted when an object has been moved.</doc:para>
506+ </doc:description>
507+ </doc:doc>
508+ </signal>
509+<!-- tree -->
510+
511+ <method name="get_children" >
512+ <arg type="s" name="type" direction="in" >
513+ <doc:doc>
514+ <doc:summary>Any node with an "id" attribute.</doc:summary>
515+ </doc:doc>
516+ </arg>
517+ <arg type="as" name="parentid" direction="out" >
518+ <doc:doc>
519+ <doc:summary>The ids of this nodes children, NULL if bottom level.</doc:summary>
520+ </doc:doc>
521+ </arg>
522+ <doc:doc>
523+ <doc:description>
524+ <doc:para>Returns the children of any node. This function along with <doc:ref type="method" to="get_parent">get_parent()</doc:ref> can be used to navigate the XML tree. </doc:para>
525+ </doc:description>
526+ </doc:doc>
527+ </method>
528+ <method name="get_parent" >
529+ <arg type="s" name="type" direction="in" >
530+ <doc:doc>
531+ <doc:summary>Any node with an "id" attribute.</doc:summary>
532+ </doc:doc>
533+ </arg>
534+ <arg type="s" name="parentid" direction="out" >
535+ <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
536+ <doc:doc>
537+ <doc:summary>The id of this nodes parent, NULL if toplevel.</doc:summary>
538+ </doc:doc>
539+ </arg>
540+ <doc:doc>
541+ <doc:description>
542+ <doc:para>Returns the parent of any node. This function along with <doc:ref type="method" to="get_children">get_children()</doc:ref> can be used to navigate the XML tree. </doc:para>
543+ </doc:description>
544+ </doc:doc>
545+ </method>
546+
547+</interface>
548 </node>
549
550=== modified file 'src/extension/dbus/proposed-interface.xml'
551--- src/extension/dbus/proposed-interface.xml 2009-08-15 18:29:16 +0000
552+++ src/extension/dbus/proposed-interface.xml 2011-06-22 20:34:40 +0000
553@@ -40,19 +40,6 @@
554 </doc:doc>
555 </signal>
556
557- <signal name="ObjectMoved">
558- <arg name="object_name" type="s">
559- <doc:doc>
560- <doc:summary>The id of the object.</doc:summary>
561- </doc:doc>
562- </arg>
563- <doc:doc>
564- <doc:description>
565- <doc:para>Emitted when an object has been moved.</doc:para>
566- </doc:description>
567- </doc:doc>
568- </signal>
569-
570 <signal name="ObjectStyleModified">
571 <arg name="object_name" type="s">
572 <doc:doc>
573@@ -136,43 +123,6 @@
574
575
576 <!-- USE document-subset.h FILES -->
577- <method name="get_parent" >
578- <arg type="s" name="type" direction="in" >
579- <doc:doc>
580- <doc:summary>Any node with an "id" attribute.</doc:summary>
581- </doc:doc>
582- </arg>
583- <arg type="s" name="parentid" direction="out" >
584- <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
585- <doc:doc>
586- <doc:summary>The id of this nodes parent, NULL if toplevel.</doc:summary>
587- </doc:doc>
588- </arg>
589- <doc:doc>
590- <doc:description>
591- <doc:para>Returns the parent of any node. This function along with <doc:ref type="method" to="proposed.get_children">get_children()</doc:ref> can be used to navigate the XML tree. In proposed because I think it might confuse users who don't know about the SVG tree structure. In the main API I have de-emphasized nodes and required no knowledge of internal representation.</doc:para>
592- </doc:description>
593- </doc:doc>
594- </method>
595-
596- <method name="get_children" >
597- <arg type="s" name="type" direction="in" >
598- <doc:doc>
599- <doc:summary>Any node with an "id" attribute.</doc:summary>
600- </doc:doc>
601- </arg>
602- <arg type="as" name="parentid" direction="out" >
603- <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
604- <doc:doc>
605- <doc:summary>The ids of this nodes children, NULL if bottom level.</doc:summary>
606- </doc:doc>
607- </arg>
608- <doc:doc>
609- <doc:description>
610- <doc:para>Returns the children of any node. This function along with <doc:ref type="method" to="proposed.get_parent">get_parent()</doc:ref> can be used to navigate the XML tree. In proposed because I think it might confuse users who don't know about the SVG tree structure. In the main API I have de-emphasized nodes and required no knowledge of internal representation.</doc:para>
611- </doc:description>
612- </doc:doc>
613- </method>
614
615 <method name="selection_remove">
616 <arg type="s" name="name" direction="in" >
617
618=== modified file 'src/file.cpp'
619--- src/file.cpp 2011-06-19 10:00:24 +0000
620+++ src/file.cpp 2011-06-22 20:34:40 +0000
621@@ -952,7 +952,7 @@
622 /**
623 * Import a resource. Called by sp_file_import()
624 */
625-void
626+SPObject *
627 file_import(SPDocument *in_doc, const Glib::ustring &uri,
628 Inkscape::Extension::Extension *key)
629 {
630@@ -1067,14 +1067,14 @@
631 doc->doUnref();
632 DocumentUndo::done(in_doc, SP_VERB_FILE_IMPORT,
633 _("Import"));
634-
635+ return new_obj;
636 } else {
637 gchar *text = g_strdup_printf(_("Failed to load the requested file %s"), uri.c_str());
638 sp_ui_error_dialog(text);
639 g_free(text);
640 }
641
642- return;
643+ return NULL;
644 }
645
646
647
648=== modified file 'src/file.h'
649--- src/file.h 2011-06-19 10:00:24 +0000
650+++ src/file.h 2011-06-22 20:34:40 +0000
651@@ -129,7 +129,7 @@
652 /**
653 * Imports a resource
654 */
655-void file_import(SPDocument *in_doc, const Glib::ustring &uri,
656+SPObject* file_import(SPDocument *in_doc, const Glib::ustring &uri,
657 Inkscape::Extension::Extension *key);
658
659 /*######################
660
661=== modified file 'src/select-context.cpp'
662--- src/select-context.cpp 2011-04-17 12:51:06 +0000
663+++ src/select-context.cpp 2011-06-22 20:34:40 +0000
664@@ -33,6 +33,9 @@
665
666 #include "select-context.h"
667 #include "selection-chemistry.h"
668+#ifdef WITH_DBUS
669+#include "extension/dbus/document-interface.h"
670+#endif
671 #include "desktop.h"
672 #include "desktop-handles.h"
673 #include "sp-root.h"
674@@ -47,6 +50,7 @@
675
676 using Inkscape::DocumentUndo;
677
678+
679 static void sp_select_context_class_init(SPSelectContextClass *klass);
680 static void sp_select_context_init(SPSelectContext *select_context);
681 static void sp_select_context_dispose(GObject *object);
682@@ -622,6 +626,10 @@
683 // item has been moved
684 seltrans->ungrab();
685 sc->moved = FALSE;
686+#ifdef WITH_DBUS
687+ g_print("moved!\n");//JAVE
688+ dbus_send_ping(desktop, sc->item);
689+#endif
690 } else if (sc->item && !drag_escaped) {
691 // item has not been moved -> simply a click, do selecting
692 if (!selection->isEmpty()) {