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
=== modified file 'src/2geom/transforms.h'
--- src/2geom/transforms.h 2011-05-08 22:43:56 +0000
+++ src/2geom/transforms.h 2011-06-22 20:34:40 +0000
@@ -209,7 +209,11 @@
209public:209public:
210 Coord factor() const { return f; }210 Coord factor() const { return f; }
211 void setFactor(Coord nf) { f = nf; }211 void setFactor(Coord nf) { f = nf; }
212
213 // S &operator*=(S const &s) { f += s.f; return *static_cast<S *>(this); }
214
212 S &operator*=(S const &s) { f += s.f; return static_cast<S &>(*this); }215 S &operator*=(S const &s) { f += s.f; return static_cast<S &>(*this); }
216
213 bool operator==(S const &s) const { return f == s.f; }217 bool operator==(S const &s) const { return f == s.f; }
214 S inverse() const { return S(-f); }218 S inverse() const { return S(-f); }
215 static S identity() { return S(0); }219 static S identity() { return S(0); }
216220
=== modified file 'src/2geom/utils.h'
--- src/2geom/utils.h 2011-05-04 20:45:08 +0000
+++ src/2geom/utils.h 2011-06-22 20:34:40 +0000
@@ -35,6 +35,7 @@
3535
36#include <cstddef>36#include <cstddef>
37#include <vector>37#include <vector>
38#include <stddef.h>
3839
39namespace Geom {40namespace Geom {
4041
4142
=== modified file 'src/desktop.h'
--- src/desktop.h 2011-06-03 10:44:52 +0000
+++ src/desktop.h 2011-06-22 20:34:40 +0000
@@ -50,6 +50,7 @@
50struct SPNamedView;50struct SPNamedView;
51struct SPObject;51struct SPObject;
52struct SPStyle;52struct SPStyle;
53typedef struct _DocumentInterface DocumentInterface;//struct DocumentInterface;
5354
54namespace Gtk55namespace Gtk
55{56{
@@ -98,7 +99,7 @@
98 SPEventContext *event_context;99 SPEventContext *event_context;
99 Inkscape::LayerManager *layer_manager;100 Inkscape::LayerManager *layer_manager;
100 Inkscape::EventLog *event_log;101 Inkscape::EventLog *event_log;
101102 DocumentInterface *dbus_document_interface;
102 Inkscape::Display::TemporaryItemList *temporary_item_list;103 Inkscape::Display::TemporaryItemList *temporary_item_list;
103 Inkscape::Display::SnapIndicator *snapindicator;104 Inkscape::Display::SnapIndicator *snapindicator;
104105
105106
=== modified file 'src/extension/dbus/dbus-init.cpp'
--- src/extension/dbus/dbus-init.cpp 2011-03-18 20:29:06 +0000
+++ src/extension/dbus/dbus-init.cpp 2011-06-22 20:34:40 +0000
@@ -147,7 +147,7 @@
147 &dbus_glib_document_interface_object_info, name.c_str());147 &dbus_glib_document_interface_object_info, name.c_str());
148 obj->desk = dt;148 obj->desk = dt;
149 obj->updates = TRUE;149 obj->updates = TRUE;
150150 dt->dbus_document_interface=obj;
151 return strdup(name.c_str());151 return strdup(name.c_str());
152}152}
153153
154154
=== modified file 'src/extension/dbus/document-interface.cpp'
--- src/extension/dbus/document-interface.cpp 2011-06-11 04:47:26 +0000
+++ src/extension/dbus/document-interface.cpp 2011-06-22 20:34:40 +0000
@@ -17,7 +17,7 @@
1717
18#include "document-interface.h"18#include "document-interface.h"
19#include <string.h>19#include <string.h>
2020#include <dbus/dbus-glib.h>
21#include "desktop-handles.h" //sp_desktop_document()21#include "desktop-handles.h" //sp_desktop_document()
22#include "desktop-style.h" //sp_desktop_get_style22#include "desktop-style.h" //sp_desktop_get_style
23#include "display/canvas-text.h" //text23#include "display/canvas-text.h" //text
@@ -56,6 +56,25 @@
5656
57//#include "2geom/svg-path-parser.h" //get_node_coordinates57//#include "2geom/svg-path-parser.h" //get_node_coordinates
5858
59#include <glib.h>
60#include <dbus/dbus-glib.h>
61
62#if 0
63#include <libxml/tree.h>
64#include <libxml/parser.h>
65#include <libxml/xpath.h>
66#include <libxml/xpathInternals.h>
67#endif
68
69 enum
70 {
71 OBJECT_MOVED_SIGNAL,
72 LAST_SIGNAL
73 };
74
75 static guint signals[LAST_SIGNAL] = { 0 };
76
77
59/****************************************************************************78/****************************************************************************
60 HELPER / SHORTCUT FUNCTIONS79 HELPER / SHORTCUT FUNCTIONS
61****************************************************************************/80****************************************************************************/
@@ -280,6 +299,14 @@
280 GObjectClass *object_class;299 GObjectClass *object_class;
281 object_class = G_OBJECT_CLASS (klass);300 object_class = G_OBJECT_CLASS (klass);
282 object_class->finalize = document_interface_finalize;301 object_class->finalize = document_interface_finalize;
302 signals[OBJECT_MOVED_SIGNAL] =
303 g_signal_new ("object_moved",
304 G_OBJECT_CLASS_TYPE (klass),
305 G_SIGNAL_RUN_LAST,
306 0,
307 NULL, NULL,
308 g_cclosure_marshal_VOID__STRING,
309 G_TYPE_NONE, 1, G_TYPE_STRING);
283}310}
284311
285static void312static void
@@ -587,6 +614,44 @@
587 return TRUE;614 return TRUE;
588}615}
589616
617gboolean
618document_interface_document_set_display_area (DocumentInterface *object,
619 double x0,
620 double y0,
621 double x1,
622 double y1,
623 double border,
624 GError **error)
625{
626 object->desk->set_display_area (x0,
627 y0,
628 x1,
629 y1,
630 border, false);
631 return TRUE;
632}
633
634
635GArray *
636document_interface_document_get_display_area (DocumentInterface *object)
637{
638 Geom::Rect const d = object->desk->get_display_area();
639
640 GArray * dArr = g_array_new (TRUE, TRUE, sizeof(double));
641
642 double x0 = d.min()[Geom::X];
643 double y0 = d.min()[Geom::Y];
644 double x1 = d.max()[Geom::X];
645 double y1 = d.max()[Geom::Y];
646 g_array_append_val (dArr, x0); //
647 g_array_append_val (dArr, y0);
648 g_array_append_val (dArr, x1);
649 g_array_append_val (dArr, y1);
650 return dArr;
651
652}
653
654
590/****************************************************************************655/****************************************************************************
591 OBJECT FUNCTIONS656 OBJECT FUNCTIONS
592****************************************************************************/657****************************************************************************/
@@ -835,6 +900,35 @@
835}900}
836901
837902
903
904gboolean
905document_interface_text_apply_style (DocumentInterface *object, gchar *name,
906 int start_pos, int end_pos, gchar *style, gchar *styleval,
907 GError **error)
908{
909
910 SPItem* text_obj=(SPItem* )get_object_by_name(object->desk, name, error);
911
912 //void sp_te_apply_style(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPCSSAttr const *css)
913 //TODO verify object type
914 if (!text_obj)
915 return FALSE;
916 Inkscape::Text::Layout const *layout = te_get_layout(text_obj);
917 Inkscape::Text::Layout::iterator start = layout->charIndexToIterator (start_pos);
918 Inkscape::Text::Layout::iterator end = layout->charIndexToIterator (end_pos);
919
920 SPCSSAttr *css = sp_repr_css_attr_new();
921 sp_repr_css_set_property(css, style, styleval);
922
923 sp_te_apply_style(text_obj,
924 start,
925 end,
926 css);
927 return TRUE;
928
929}
930
931
838/****************************************************************************932/****************************************************************************
839 FILE I/O FUNCTIONS933 FILE I/O FUNCTIONS
840****************************************************************************/934****************************************************************************/
@@ -861,8 +955,22 @@
861 return TRUE;955 return TRUE;
862}956}
863957
864gboolean document_interface_save_as(DocumentInterface *object, 958gchar *
865 const gchar *filename, GError ** /*error*/)959document_interface_import (DocumentInterface *object,
960 gchar *filename, GError **error)
961{
962 desktop_ensure_active (object->desk);
963 const Glib::ustring file(filename);
964 SPDocument * doc = sp_desktop_document(object->desk);
965
966 SPObject *new_obj = NULL;
967 new_obj = file_import(doc, file, NULL);
968 return strdup(new_obj->getRepr()->attribute("id"));
969}
970
971gboolean
972document_interface_save_as (DocumentInterface *object,
973 const gchar *filename, GError **error)
866{974{
867 SPDocument * doc = sp_desktop_document(object->desk);975 SPDocument * doc = sp_desktop_document(object->desk);
868 #ifdef WITH_GNOME_VFS976 #ifdef WITH_GNOME_VFS
@@ -1329,6 +1437,73 @@
1329 return dbus_call_verb (object, SP_VERB_LAYER_PREV, error);1437 return dbus_call_verb (object, SP_VERB_LAYER_PREV, error);
1330}1438}
13311439
1440
1441//////////////signals
1442
1443
1444DocumentInterface *fugly;
1445gboolean dbus_send_ping (SPDesktop* desk, SPItem *item)
1446{
1447 //DocumentInterface *obj;
1448 g_signal_emit (desk->dbus_document_interface, signals[OBJECT_MOVED_SIGNAL], 0, item->getId());
1449 g_print("Ping!\n");
1450 return TRUE;
1451}
1452
1453//////////tree
1454
1455
1456gboolean
1457document_interface_get_children (DocumentInterface *object, char *name, char ***out, GError **error)
1458{
1459 SPItem* parent=(SPItem* )get_object_by_name(object->desk, name, error);
1460
1461 GSList const *children = parent->childList(false);
1462
1463 int size = g_slist_length((GSList *) children);
1464
1465 *out = g_new0 (char *, size + 1);
1466
1467 int i = 0;
1468 for (GSList const *iter = children; iter != NULL; iter = iter->next) {
1469 (*out)[i] = g_strdup(SP_OBJECT(iter->data)->getRepr()->attribute("id"));
1470 i++;
1471 }
1472 (*out)[i] = NULL;
1473
1474 return TRUE;
1475
1476}
1477
1478
1479gchar*
1480document_interface_get_parent (DocumentInterface *object, char *name, GError **error)
1481{
1482 SPItem* node=(SPItem* )get_object_by_name(object->desk, name, error);
1483
1484 SPObject* parent=node->parent;
1485
1486 return g_strdup(parent->getRepr()->attribute("id"));
1487
1488}
1489
1490#if 0
1491//just pseudo code
1492gboolean
1493document_interface_get_xpath (DocumentInterface *object, char *xpath_expression, char ***out, GError **error){
1494 SPDocument * doc = sp_desktop_document (object->desk);
1495 Inkscape::XML::Document *repr = doc->getReprDoc();
1496
1497 xmlXPathObjectPtr xpathObj;
1498 xmlXPathContextPtr xpathCtx;
1499 xpathCtx = xmlXPathNewContext(repr);//XmlDocPtr
1500 xpathObj = xmlXPathEvalExpression(xmlCharStrdup(xpath_expression), xpathCtx);
1501
1502 //xpathresult result = xpatheval(repr, xpath_selection);
1503 //convert resut to a string array we can return via dbus
1504 return TRUE;
1505}
1506#endif
1332/*1507/*
1333 Local Variables:1508 Local Variables:
1334 mode:c++1509 mode:c++
13351510
=== modified file 'src/extension/dbus/document-interface.h'
--- src/extension/dbus/document-interface.h 2011-03-18 20:29:06 +0000
+++ src/extension/dbus/document-interface.h 2011-06-22 20:34:40 +0000
@@ -121,6 +121,10 @@
121gboolean121gboolean
122document_interface_set_text (DocumentInterface *object, gchar *name,122document_interface_set_text (DocumentInterface *object, gchar *name,
123 gchar *text, GError **error);123 gchar *text, GError **error);
124gboolean
125document_interface_text_apply_style (DocumentInterface *object, gchar *name,
126 int start_pos, int end_pos, gchar *style, gchar *styleval,
127 GError **error);
124128
125gchar *129gchar *
126document_interface_image (DocumentInterface *object, int x, int y, 130document_interface_image (DocumentInterface *object, int x, int y,
@@ -154,6 +158,16 @@
154gboolean 158gboolean
155document_interface_document_resize_to_fit_selection (DocumentInterface *object,159document_interface_document_resize_to_fit_selection (DocumentInterface *object,
156 GError **error);160 GError **error);
161gboolean
162document_interface_document_set_display_area (DocumentInterface *object,
163 double x0,
164 double y0,
165 double x1,
166 double y1,
167 double border,
168 GError **error);
169GArray *
170document_interface_document_get_display_area (DocumentInterface *object);
157171
158/****************************************************************************172/****************************************************************************
159 OBJECT FUNCTIONS173 OBJECT FUNCTIONS
@@ -404,6 +418,18 @@
404DocumentInterface *document_interface_new (void);418DocumentInterface *document_interface_new (void);
405GType document_interface_get_type (void);419GType document_interface_get_type (void);
406420
421extern DocumentInterface *fugly;
422gboolean dbus_send_ping (SPDesktop* desk, SPItem *item);
423
424gboolean
425document_interface_get_children (DocumentInterface *object, char *name, char ***out, GError **error);
426
427gchar*
428document_interface_get_parent (DocumentInterface *object, char *name, GError **error);
429
430gchar*
431document_interface_import (DocumentInterface *object,
432 gchar *filename, GError **error);
407433
408G_END_DECLS434G_END_DECLS
409435
410436
=== modified file 'src/extension/dbus/document-interface.xml'
--- src/extension/dbus/document-interface.xml 2011-03-18 20:29:06 +0000
+++ src/extension/dbus/document-interface.xml 2011-06-22 20:34:40 +0000
@@ -352,6 +352,27 @@
352 </doc:doc>352 </doc:doc>
353 </method>353 </method>
354354
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
355 <method name="node">376 <method name="node">
356 <arg type="s" name="svgtype" direction="in" >377 <arg type="s" name="svgtype" direction="in" >
357 <doc:doc>378 <doc:doc>
@@ -453,6 +474,56 @@
453 </doc:doc>474 </doc:doc>
454 </method>475 </method>
455476
477
478
479 <method name="document_set_display_area">
480 <arg type="d" name="x0" direction="in" >
481 <doc:doc>
482 <doc:summary></doc:summary>
483 </doc:doc>
484 </arg>
485 <arg type="d" name="y0" direction="in" >
486 <doc:doc>
487 <doc:summary></doc:summary>
488 </doc:doc>
489 </arg>
490 <arg type="d" name="x1" direction="in" >
491 <doc:doc>
492 <doc:summary></doc:summary>
493 </doc:doc>
494 </arg>
495 <arg type="d" name="y1" direction="in" >
496 <doc:doc>
497 <doc:summary></doc:summary>
498 </doc:doc>
499 </arg>
500 <arg type="d" name="border" direction="in" >
501 <doc:doc>
502 <doc:summary></doc:summary>
503 </doc:doc>
504 </arg>
505 <doc:doc>
506 <doc:description>
507 <doc:para>Set display area.</doc:para>
508 </doc:description>
509 </doc:doc>
510 </method>
511
512 <method name="document_get_display_area">
513 <doc:doc>
514 <doc:description>
515 <doc:para>Get display area.</doc:para>
516 </doc:description>
517 </doc:doc>
518 <arg type="ad" name="area" direction="out" >
519 <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
520 <doc:doc>
521 <doc:summary>area</doc:summary>
522 </doc:doc>
523 </arg>
524 </method>
525
526
456 <!-- OBJECT FUNCTIONS -->527 <!-- OBJECT FUNCTIONS -->
457528
458 <method name="set_attribute">529 <method name="set_attribute">
@@ -499,6 +570,43 @@
499 </method>570 </method>
500571
501572
573 <method name="text_apply_style">
574 <arg type="s" name="shape" direction="in" >
575 <doc:doc>
576 <doc:summary>The id of an object.</doc:summary>
577 </doc:doc>
578 </arg>
579
580 <arg type="i" name="start" direction="in" >
581 <doc:doc>
582 <doc:summary>start text pos.</doc:summary>
583 </doc:doc>
584 </arg>
585 <arg type="i" name="end" direction="in" >
586 <doc:doc>
587 <doc:summary>end text pos.</doc:summary>
588 </doc:doc>
589 </arg>
590
591 <arg type="s" name="css_attrib" direction="in" >
592 <doc:doc>
593 <doc:summary>css attribute.</doc:summary>
594 </doc:doc>
595 </arg>
596
597 <arg type="s" name="css_attrib_val" direction="in" >
598 <doc:doc>
599 <doc:summary>css attribute value.</doc:summary>
600 </doc:doc>
601 </arg>
602
603
604 <doc:doc>
605 <doc:description>
606 <doc:para>set styling of partial text object.</doc:para>
607 </doc:description>
608 </doc:doc>
609 </method>
502 610
503611
504 <method name="set_int_attribute">612 <method name="set_int_attribute">
@@ -864,6 +972,9 @@
864 </doc:description>972 </doc:description>
865 </doc:doc>973 </doc:doc>
866 </method>974 </method>
975
976
977
867 <!--978 <!--
868 <method name="print_to_file" >979 <method name="print_to_file" >
869 <doc:doc>980 <doc:doc>
@@ -1379,6 +1490,56 @@
1379 </doc:doc>1490 </doc:doc>
1380 </method>1491 </method>
13811492
13821493<!-- signals -->
1383 </interface>1494 <signal name="ObjectMoved">
1495 <arg name="object_name" type="s">
1496 <doc:doc>
1497 <doc:summary>The id of the object.</doc:summary>
1498 </doc:doc>
1499 </arg>
1500 <doc:doc>
1501 <doc:description>
1502 <doc:para>Emitted when an object has been moved.</doc:para>
1503 </doc:description>
1504 </doc:doc>
1505 </signal>
1506<!-- tree -->
1507
1508 <method name="get_children" >
1509 <arg type="s" name="type" direction="in" >
1510 <doc:doc>
1511 <doc:summary>Any node with an "id" attribute.</doc:summary>
1512 </doc:doc>
1513 </arg>
1514 <arg type="as" name="parentid" direction="out" >
1515 <doc:doc>
1516 <doc:summary>The ids of this nodes children, NULL if bottom level.</doc:summary>
1517 </doc:doc>
1518 </arg>
1519 <doc:doc>
1520 <doc:description>
1521 <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>
1522 </doc:description>
1523 </doc:doc>
1524 </method>
1525 <method name="get_parent" >
1526 <arg type="s" name="type" direction="in" >
1527 <doc:doc>
1528 <doc:summary>Any node with an "id" attribute.</doc:summary>
1529 </doc:doc>
1530 </arg>
1531 <arg type="s" name="parentid" direction="out" >
1532 <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
1533 <doc:doc>
1534 <doc:summary>The id of this nodes parent, NULL if toplevel.</doc:summary>
1535 </doc:doc>
1536 </arg>
1537 <doc:doc>
1538 <doc:description>
1539 <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>
1540 </doc:description>
1541 </doc:doc>
1542 </method>
1543
1544</interface>
1384</node>1545</node>
13851546
=== modified file 'src/extension/dbus/proposed-interface.xml'
--- src/extension/dbus/proposed-interface.xml 2009-08-15 18:29:16 +0000
+++ src/extension/dbus/proposed-interface.xml 2011-06-22 20:34:40 +0000
@@ -40,19 +40,6 @@
40 </doc:doc>40 </doc:doc>
41 </signal>41 </signal>
4242
43 <signal name="ObjectMoved">
44 <arg name="object_name" type="s">
45 <doc:doc>
46 <doc:summary>The id of the object.</doc:summary>
47 </doc:doc>
48 </arg>
49 <doc:doc>
50 <doc:description>
51 <doc:para>Emitted when an object has been moved.</doc:para>
52 </doc:description>
53 </doc:doc>
54 </signal>
55
56 <signal name="ObjectStyleModified">43 <signal name="ObjectStyleModified">
57 <arg name="object_name" type="s">44 <arg name="object_name" type="s">
58 <doc:doc>45 <doc:doc>
@@ -136,43 +123,6 @@
136123
137124
138<!-- USE document-subset.h FILES -->125<!-- USE document-subset.h FILES -->
139 <method name="get_parent" >
140 <arg type="s" name="type" direction="in" >
141 <doc:doc>
142 <doc:summary>Any node with an "id" attribute.</doc:summary>
143 </doc:doc>
144 </arg>
145 <arg type="s" name="parentid" direction="out" >
146 <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
147 <doc:doc>
148 <doc:summary>The id of this nodes parent, NULL if toplevel.</doc:summary>
149 </doc:doc>
150 </arg>
151 <doc:doc>
152 <doc:description>
153 <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>
154 </doc:description>
155 </doc:doc>
156 </method>
157
158 <method name="get_children" >
159 <arg type="s" name="type" direction="in" >
160 <doc:doc>
161 <doc:summary>Any node with an "id" attribute.</doc:summary>
162 </doc:doc>
163 </arg>
164 <arg type="as" name="parentid" direction="out" >
165 <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
166 <doc:doc>
167 <doc:summary>The ids of this nodes children, NULL if bottom level.</doc:summary>
168 </doc:doc>
169 </arg>
170 <doc:doc>
171 <doc:description>
172 <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>
173 </doc:description>
174 </doc:doc>
175 </method>
176126
177 <method name="selection_remove">127 <method name="selection_remove">
178 <arg type="s" name="name" direction="in" >128 <arg type="s" name="name" direction="in" >
179129
=== modified file 'src/file.cpp'
--- src/file.cpp 2011-06-19 10:00:24 +0000
+++ src/file.cpp 2011-06-22 20:34:40 +0000
@@ -952,7 +952,7 @@
952/**952/**
953 * Import a resource. Called by sp_file_import()953 * Import a resource. Called by sp_file_import()
954 */954 */
955void955SPObject *
956file_import(SPDocument *in_doc, const Glib::ustring &uri,956file_import(SPDocument *in_doc, const Glib::ustring &uri,
957 Inkscape::Extension::Extension *key)957 Inkscape::Extension::Extension *key)
958{958{
@@ -1067,14 +1067,14 @@
1067 doc->doUnref();1067 doc->doUnref();
1068 DocumentUndo::done(in_doc, SP_VERB_FILE_IMPORT,1068 DocumentUndo::done(in_doc, SP_VERB_FILE_IMPORT,
1069 _("Import"));1069 _("Import"));
10701070 return new_obj;
1071 } else {1071 } else {
1072 gchar *text = g_strdup_printf(_("Failed to load the requested file %s"), uri.c_str());1072 gchar *text = g_strdup_printf(_("Failed to load the requested file %s"), uri.c_str());
1073 sp_ui_error_dialog(text);1073 sp_ui_error_dialog(text);
1074 g_free(text);1074 g_free(text);
1075 }1075 }
10761076
1077 return;1077 return NULL;
1078}1078}
10791079
10801080
10811081
=== modified file 'src/file.h'
--- src/file.h 2011-06-19 10:00:24 +0000
+++ src/file.h 2011-06-22 20:34:40 +0000
@@ -129,7 +129,7 @@
129/**129/**
130 * Imports a resource130 * Imports a resource
131 */131 */
132void file_import(SPDocument *in_doc, const Glib::ustring &uri,132SPObject* file_import(SPDocument *in_doc, const Glib::ustring &uri,
133 Inkscape::Extension::Extension *key);133 Inkscape::Extension::Extension *key);
134134
135/*######################135/*######################
136136
=== modified file 'src/select-context.cpp'
--- src/select-context.cpp 2011-04-17 12:51:06 +0000
+++ src/select-context.cpp 2011-06-22 20:34:40 +0000
@@ -33,6 +33,9 @@
3333
34#include "select-context.h"34#include "select-context.h"
35#include "selection-chemistry.h"35#include "selection-chemistry.h"
36#ifdef WITH_DBUS
37#include "extension/dbus/document-interface.h"
38#endif
36#include "desktop.h"39#include "desktop.h"
37#include "desktop-handles.h"40#include "desktop-handles.h"
38#include "sp-root.h"41#include "sp-root.h"
@@ -47,6 +50,7 @@
4750
48using Inkscape::DocumentUndo;51using Inkscape::DocumentUndo;
4952
53
50static void sp_select_context_class_init(SPSelectContextClass *klass);54static void sp_select_context_class_init(SPSelectContextClass *klass);
51static void sp_select_context_init(SPSelectContext *select_context);55static void sp_select_context_init(SPSelectContext *select_context);
52static void sp_select_context_dispose(GObject *object);56static void sp_select_context_dispose(GObject *object);
@@ -622,6 +626,10 @@
622 // item has been moved626 // item has been moved
623 seltrans->ungrab();627 seltrans->ungrab();
624 sc->moved = FALSE;628 sc->moved = FALSE;
629#ifdef WITH_DBUS
630 g_print("moved!\n");//JAVE
631 dbus_send_ping(desktop, sc->item);
632#endif
625 } else if (sc->item && !drag_escaped) {633 } else if (sc->item && !drag_escaped) {
626 // item has not been moved -> simply a click, do selecting634 // item has not been moved -> simply a click, do selecting
627 if (!selection->isEmpty()) {635 if (!selection->isEmpty()) {