summaryrefslogtreecommitdiffstats
path: root/src/extension/dbus/document-interface.cpp
diff options
context:
space:
mode:
authorEric Greveson <eric@greveson.co.uk>2013-07-03 22:00:06 +0000
committerEric Greveson <eric@greveson.co.uk>2013-07-03 22:00:06 +0000
commit1c75594f5c37e86dec195ec1975254315ef180e9 (patch)
treea2ef00ceb7bd72b60c61c61ece4dcfe413fac9f5 /src/extension/dbus/document-interface.cpp
parentModified dbus interface so that it works in console mode (--dbus-listen) (diff)
downloadinkscape-1c75594f5c37e86dec195ec1975254315ef180e9.tar.gz
inkscape-1c75594f5c37e86dec195ec1975254315ef180e9.zip
Changed dbus interface to treat 'division' like other boolops, with a new
return type for selection_combine to support this (array of string). This also fixes a bug with not setting the error flag when returning NULL from this method. Refactored some more selection verbs to allow use in no-GUI mode. (bzr r12387.1.5)
Diffstat (limited to 'src/extension/dbus/document-interface.cpp')
-rw-r--r--src/extension/dbus/document-interface.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp
index f0cc71de1..87b769e26 100644
--- a/src/extension/dbus/document-interface.cpp
+++ b/src/extension/dbus/document-interface.cpp
@@ -1222,13 +1222,11 @@ document_interface_selection_invert (DocumentInterface *object, GError **error)
gboolean
document_interface_selection_group (DocumentInterface *object, GError **error)
{
- //sp_selection_group (object->desk);
return dbus_call_verb (object, SP_VERB_SELECTION_GROUP, error);
}
gboolean
document_interface_selection_ungroup (DocumentInterface *object, GError **error)
{
- //sp_selection_ungroup (object->desk);
return dbus_call_verb (object, SP_VERB_SELECTION_UNGROUP, error);
}
@@ -1362,8 +1360,8 @@ document_interface_selection_to_path (DocumentInterface *object, GError **error)
}
-gchar *
-document_interface_selection_combine (DocumentInterface *object, gchar *cmd,
+gboolean
+document_interface_selection_combine (DocumentInterface *object, gchar *cmd, char ***newpaths,
GError **error)
{
if (strcmp(cmd, "union") == 0)
@@ -1374,20 +1372,14 @@ document_interface_selection_combine (DocumentInterface *object, gchar *cmd,
dbus_call_verb (object, SP_VERB_SELECTION_DIFF, error);
else if (strcmp(cmd, "exclusion") == 0)
dbus_call_verb (object, SP_VERB_SELECTION_SYMDIFF, error);
- else
- return NULL;
-
- if (object->context.getSelection()->singleRepr() != NULL)
- return g_strdup(object->context.getSelection()->singleRepr()->attribute("id"));
- return NULL;
-}
-
-gboolean
-document_interface_selection_divide (DocumentInterface *object, char ***out, GError **error)
-{
- dbus_call_verb (object, SP_VERB_SELECTION_CUT, error);
+ else if (strcmp(cmd, "division") == 0)
+ dbus_call_verb (object, SP_VERB_SELECTION_CUT, error);
+ else {
+ g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Operation command not recognised");
+ return FALSE;
+ }
- return document_interface_selection_get (object, out, error);
+ return document_interface_selection_get (object, newpaths, error);
}
gboolean