Lines Matching refs:error

98 get_repr_by_name (SPDocument *doc, gchar *name, GError **error)
106 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OBJECT, "Object '%s' not found in document.", name);
116 get_object_by_name (SPDocument *doc, gchar *name, GError **error)
121 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OBJECT, "Object '%s' not found in document.", name);
128 * Tests for NULL strings and throws an appropriate error.
133 dbus_check_string (gchar *string, GError ** error, const gchar * errorstr)
137 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "%s", errorstr);
190 selection_swap(Inkscape::Selection *sel, gchar *name, GError **error)
194 sel->set(get_object_by_name(sel->layers()->getDocument(), name, error));
227 gchar *finish_create_shape (DocumentInterface *doc_interface, GError ** /*error*/, Inkscape::XML::Node *newNode, gchar *desc)
255 * It handles error reporting and update pausing (which needs some work.)
261 dbus_call_verb (DocumentInterface *doc_interface, int verbid, GError **error)
277 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_VERB, "Verb failed to execute");
282 * Check that the desktop is not NULL. If it is NULL, set the error to a useful message.
285 ensure_desktop_valid(SPDesktop* desk, GError **error)
291 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Document interface action requires a GUI");
343 gboolean document_interface_delete_all(DocumentInterface *doc_interface, GError ** /*error*/)
350 document_interface_call_verb (DocumentInterface *doc_interface, gchar *verbid, GError **error)
367 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_VERB, "Verb '%s' failed to execute or was not found.", verbid);
378 int width, int height, GError **error)
387 return finish_create_shape (doc_interface, error, newNode, (gchar *)"create rectangle");
392 int rx, int ry, GError **error)
400 return finish_create_shape (doc_interface, error, newNode, (gchar *)"create circle");
406 GError **error)
422 return finish_create_shape (doc_interface, error, newNode, (gchar *)"create polygon");
428 gdouble arg1, gdouble arg2, GError **error)
443 return finish_create_shape (doc_interface, error, newNode, (gchar *)"create star");
448 int width, int height, GError **error)
452 return document_interface_ellipse_center (doc_interface, x+rx, y+ry, rx, ry, error);
457 int x2, int y2, GError **error)
464 return finish_create_shape (doc_interface, error, newNode, (gchar *)"create line");
469 int r, int revolutions, GError **error)
480 gchar * retval = finish_create_shape (doc_interface, error, newNode, (gchar *)"create spiral");
489 document_interface_text (DocumentInterface *doc_interface, int x, int y, gchar *text, GError **error)
496 gchar *name = finish_create_shape (doc_interface, error, text_node, (gchar *)"create text");
498 SPItem* text_obj=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error);
505 document_interface_image (DocumentInterface *doc_interface, int x, int y, gchar *filename, GError **error)
507 gchar * uri = g_filename_to_uri (filename, FALSE, error);
526 gchar *document_interface_node(DocumentInterface *doc_interface, gchar *type, GError ** /*error*/)
558 gchar *document_interface_document_get_css(DocumentInterface *doc_interface, GError ** error)
561 g_return_val_if_fail(ensure_desktop_valid(desk, error), NULL);
569 gchar *stylestring, GError ** error)
572 g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE);
580 gchar *stylestring, GError ** error)
583 g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE);
593 GError **error)
595 return dbus_call_verb (doc_interface, SP_VERB_FIT_CANVAS_TO_SELECTION, error);
605 GError **error)
608 g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE);
648 char *attribute, char *newval, GError **error)
650 Inkscape::XML::Node *newNode = get_repr_by_name(doc_interface->target.getDocument(), shape, error);
655 if (!dbus_check_string(newval, error, "New value string was empty."))
668 int newval, GError **error)
670 Inkscape::XML::Node *newNode = get_repr_by_name (doc_interface->target.getDocument(), shape, error);
682 double newval, GError **error)
684 Inkscape::XML::Node *newNode = get_repr_by_name (doc_interface->target.getDocument(), shape, error);
686 if (!dbus_check_string (attribute, error, "New value string was empty."))
697 char *attribute, GError **error)
699 Inkscape::XML::Node *newNode = get_repr_by_name(doc_interface->target.getDocument(), shape, error);
701 if (!dbus_check_string (attribute, error, "Attribute name empty."))
711 gdouble y, GError **error)
713 std::vector<SPObject*> oldsel = selection_swap(doc_interface->target.getSelection(), name, error);
723 gdouble y, GError **error)
725 std::vector<SPObject*> oldsel = selection_swap(doc_interface->target.getSelection(), name, error);
737 char *shape, GError **error)
739 std::vector<SPObject*> oldsel = selection_swap(doc_interface->target.getSelection(), shape, error);
742 dbus_call_verb (doc_interface, SP_VERB_OBJECT_TO_CURVE, error);
748 document_interface_get_path (DocumentInterface *doc_interface, char *pathname, GError **error)
750 Inkscape::XML::Node *node = get_repr_by_name(doc_interface->target.getDocument(), pathname, error);
757 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OBJECT, "Object is not a path.");
765 gchar *transformstr, GError **error)
769 document_interface_set_attribute (doc_interface, shape, trans, transformstr, error);
775 GError **error)
778 return document_interface_get_attribute (doc_interface, shape, style, error);
783 gchar *cssattrb, gchar *newval, GError **error)
787 Inkscape::XML::Node *node = get_repr_by_name(doc_interface->target.getDocument(), shape, error);
789 if (!dbus_check_string (cssattrb, error, "Attribute string empty."))
804 gchar *stylestring, GError **error)
808 Inkscape::XML::Node *node = get_repr_by_name(doc_interface->target.getDocument(), shape, error);
810 if (!dbus_check_string (stylestring, error, "Style string empty."))
830 int r, int g, int b, gboolean fill, GError **error)
835 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Given (%d,%d,%d). All values must be between 0-255 inclusive.", r, g, b);
845 return document_interface_document_merge_css (doc_interface, style, error);
847 return document_interface_merge_css (doc_interface, shape, style, error);
852 gchar *layerstr, GError **error)
854 std::vector<SPObject*> oldsel = selection_swap(doc_interface->target.getSelection(), shape, error);
858 document_interface_selection_move_to_layer(doc_interface, layerstr, error);
867 Inkscape::XML::Node *shapenode = get_repr_by_name (doc_interface->target.getDocument(), shape, error);
882 document_interface_set_text (DocumentInterface *doc_interface, gchar *name, gchar *text, GError **error)
885 SPItem* text_obj=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error);
899 GError **error)
902 SPItem* text_obj=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error);
929 document_interface_save (DocumentInterface *doc_interface, GError **error)
934 return document_interface_save_as (doc_interface, doc->getURI(), error);
939 gchar *filename, GError ** /*error*/)
955 gchar *filename, GError **error)
971 const gchar *filename, GError **error)
994 gboolean document_interface_mark_as_unmodified(DocumentInterface *doc_interface, GError ** /*error*/)
1005 document_interface_print_to_file (DocumentInterface *doc_interface, GError **error)
1018 document_interface_close (DocumentInterface *doc_interface, GError **error)
1020 return dbus_call_verb (doc_interface, SP_VERB_FILE_CLOSE_VIEW, error);
1024 document_interface_exit (DocumentInterface *doc_interface, GError **error)
1026 return dbus_call_verb (doc_interface, SP_VERB_FILE_QUIT, error);
1030 document_interface_undo (DocumentInterface *doc_interface, GError **error)
1032 return dbus_call_verb (doc_interface, SP_VERB_EDIT_UNDO, error);
1036 document_interface_redo (DocumentInterface *doc_interface, GError **error)
1038 return dbus_call_verb (doc_interface, SP_VERB_EDIT_REDO, error);
1050 void document_interface_pause_updates(DocumentInterface *doc_interface, GError ** error)
1053 g_return_if_fail(ensure_desktop_valid(desk, error));
1058 void document_interface_resume_updates(DocumentInterface *doc_interface, GError ** error)
1061 g_return_if_fail(ensure_desktop_valid(desk, error));
1068 void document_interface_update(DocumentInterface *doc_interface, GError ** error)
1071 g_return_if_fail(ensure_desktop_valid(desk, error));
1087 gboolean document_interface_selection_get(DocumentInterface *doc_interface, char ***out, GError ** /*error*/)
1107 document_interface_selection_add (DocumentInterface *doc_interface, char *name, GError **error)
1109 SPObject * obj = get_object_by_name(doc_interface->target.getDocument(), name, error);
1121 char **names, GError **error)
1125 document_interface_selection_add(doc_interface, names[i], error);
1130 gboolean document_interface_selection_set(DocumentInterface *doc_interface, char *name, GError ** /*error*/)
1140 gchar **names, GError **error)
1145 document_interface_selection_add(doc_interface, names[i], error);
1150 gboolean document_interface_selection_rotate(DocumentInterface *doc_interface, int angle, GError ** /*error*/)
1158 document_interface_selection_delete (DocumentInterface *doc_interface, GError **error)
1160 return dbus_call_verb (doc_interface, SP_VERB_EDIT_DELETE, error);
1163 gboolean document_interface_selection_clear(DocumentInterface *doc_interface, GError ** /*error*/)
1170 document_interface_select_all (DocumentInterface *doc_interface, GError **error)
1172 return dbus_call_verb (doc_interface, SP_VERB_EDIT_SELECT_ALL, error);
1177 GError **error)
1179 return dbus_call_verb (doc_interface, SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, error);
1184 GError ** /*error*/)
1191 document_interface_selection_invert (DocumentInterface *doc_interface, GError **error)
1193 return dbus_call_verb (doc_interface, SP_VERB_EDIT_INVERT, error);
1197 document_interface_selection_group (DocumentInterface *doc_interface, GError **error)
1199 return dbus_call_verb (doc_interface, SP_VERB_SELECTION_GROUP, error);
1202 document_interface_selection_ungroup (DocumentInterface *doc_interface, GError **error)
1204 return dbus_call_verb (doc_interface, SP_VERB_SELECTION_UNGROUP, error);
1208 document_interface_selection_cut (DocumentInterface *doc_interface, GError **error)
1211 g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE);
1212 return dbus_call_verb (doc_interface, SP_VERB_EDIT_CUT, error);
1216 document_interface_selection_copy (DocumentInterface *doc_interface, GError **error)
1219 g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE);
1220 return dbus_call_verb (doc_interface, SP_VERB_EDIT_COPY, error);
1224 document_interface_selection_paste (DocumentInterface *doc_interface, GError **error)
1227 g_return_val_if_fail(ensure_desktop_valid(desk, error), FALSE);
1228 return dbus_call_verb (doc_interface, SP_VERB_EDIT_PASTE, error);
1231 gboolean document_interface_selection_scale(DocumentInterface *doc_interface, gdouble grow, GError ** /*error*/)
1242 gboolean document_interface_selection_move(DocumentInterface *doc_interface, gdouble x, gdouble y, GError ** /*error*/)
1248 gboolean document_interface_selection_move_to(DocumentInterface *doc_interface, gdouble x, gdouble y, GError ** /*error*/)
1265 gchar *layerstr, GError **error)
1268 g_return_val_if_fail(ensure_desktop_valid(dt, error), FALSE);
1276 SPObject *next = get_object_by_name(doc_interface->target.getDocument(), layerstr, error);
1312 document_interface_selection_to_path (DocumentInterface *doc_interface, GError **error)
1314 return dbus_call_verb (doc_interface, SP_VERB_OBJECT_TO_CURVE, error);
1320 GError **error)
1323 dbus_call_verb (doc_interface, SP_VERB_SELECTION_UNION, error);
1325 dbus_call_verb (doc_interface, SP_VERB_SELECTION_INTERSECT, error);
1327 dbus_call_verb (doc_interface, SP_VERB_SELECTION_DIFF, error);
1329 dbus_call_verb (doc_interface, SP_VERB_SELECTION_SYMDIFF, error);
1331 dbus_call_verb (doc_interface, SP_VERB_SELECTION_CUT, error);
1333 g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Operation command not recognised");
1337 return document_interface_selection_get (doc_interface, newpaths, error);
1342 GError **error)
1345 return dbus_call_verb (doc_interface, SP_VERB_SELECTION_RAISE, error);
1347 return dbus_call_verb (doc_interface, SP_VERB_SELECTION_LOWER, error);
1349 return dbus_call_verb (doc_interface, SP_VERB_SELECTION_TO_FRONT, error);
1351 return dbus_call_verb (doc_interface, SP_VERB_SELECTION_TO_BACK, error);
1359 gchar *document_interface_layer_new(DocumentInterface *doc_interface, GError ** /*error*/)
1369 gchar *layerstr, GError **error)
1371 SPObject * obj = get_object_by_name (doc_interface->target.getDocument(), layerstr, error);
1388 gchar *cmd, GError **error)
1391 return dbus_call_verb (doc_interface, SP_VERB_LAYER_RAISE, error);
1393 return dbus_call_verb (doc_interface, SP_VERB_LAYER_LOWER, error);
1395 return dbus_call_verb (doc_interface, SP_VERB_LAYER_TO_TOP, error);
1397 return dbus_call_verb (doc_interface, SP_VERB_LAYER_TO_BOTTOM, error);
1402 document_interface_layer_next (DocumentInterface *doc_interface, GError **error)
1404 return dbus_call_verb (doc_interface, SP_VERB_LAYER_NEXT, error);
1408 document_interface_layer_previous (DocumentInterface *doc_interface, GError **error)
1410 return dbus_call_verb (doc_interface, SP_VERB_LAYER_PREV, error);
1429 document_interface_get_children (DocumentInterface *doc_interface, char *name, char ***out, GError **error)
1431 SPItem* parent=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error);
1450 document_interface_get_parent (DocumentInterface *doc_interface, char *name, GError **error)
1452 SPItem* node=(SPItem* )get_object_by_name(doc_interface->target.getDocument(), name, error);
1463 document_interface_get_xpath (DocumentInterface *doc_interface, char *xpath_expression, char ***out, GError **error){