From 69879b63ae4fb3da90263808c133a39ed2b770f8 Mon Sep 17 00:00:00 2001 From: glimmer07 Date: Thu, 13 Aug 2009 20:53:03 +0000 Subject: [PATCH] Made wrapper functions non static. Added lots of documentation. --- src/extension/dbus/application-interface.cpp | 17 ++ src/extension/dbus/application-interface.h | 17 ++ src/extension/dbus/application-interface.xml | 19 +++ src/extension/dbus/document-interface.cpp | 96 +++++++++-- src/extension/dbus/document-interface.h | 17 ++ src/extension/dbus/document-interface.xml | 18 ++ src/extension/dbus/wrapper/Makefile | 8 +- .../dbus/wrapper/inkscape-dbus-wrapper.c | 157 +++++++++-------- .../dbus/wrapper/inkscape-dbus-wrapper.h | 161 +++++++++--------- 9 files changed, 342 insertions(+), 168 deletions(-) diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp index 06e41ecf3..b183be93c 100644 --- a/src/extension/dbus/application-interface.cpp +++ b/src/extension/dbus/application-interface.cpp @@ -1,3 +1,20 @@ +/* + * This is where the implementation of the DBus based application API lives. + * All the methods in here are designed to be called remotly via DBus. + * document-interface.cpp has all of the actual manipulation methods. + * This interface is just for creating new document interfaces. + * + * Documentation for these methods is in application-interface.xml + * which is the "gold standard" as to how the interface should work. + * + * Authors: + * Soren Berg + * + * Copyright (C) 2009 Soren Berg + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #include "application-interface.h" #include #include "dbus-init.h" diff --git a/src/extension/dbus/application-interface.h b/src/extension/dbus/application-interface.h index a04c992c3..e782bd1ad 100644 --- a/src/extension/dbus/application-interface.h +++ b/src/extension/dbus/application-interface.h @@ -1,3 +1,20 @@ +/* + * This is where the implementation of the DBus based application API lives. + * All the methods in here are designed to be called remotly via DBus. + * document-interface.cpp has all of the actual manipulation methods. + * This interface is just for creating new document interfaces. + * + * Documentation for these methods is in application-interface.xml + * which is the "gold standard" as to how the interface should work. + * + * Authors: + * Soren Berg + * + * Copyright (C) 2009 Soren Berg + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #ifndef INKSCAPE_EXTENSION_APPLICATION_INTERFACE_H_ #define INKSCAPE_EXTENSION_APPLICATION_INTERFACE_H_ diff --git a/src/extension/dbus/application-interface.xml b/src/extension/dbus/application-interface.xml index 9b55a9b2b..e942117d6 100644 --- a/src/extension/dbus/application-interface.xml +++ b/src/extension/dbus/application-interface.xml @@ -1,3 +1,22 @@ + + + * + * Copyright (C) 2009 Soren Berg + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #include "document-interface.h" #include @@ -41,13 +58,16 @@ HELPER / SHORTCUT FUNCTIONS ****************************************************************************/ -const gchar* intToCString(int i) -{ - std::stringstream ss; - ss << i; - return ss.str().c_str(); -} - +/* + * This function or the one below it translates the user input for an object + * into Inkscapes internal representation. It is called by almost every + * method so it should be as fast as possible. + * + * (eg turns "rect2234" to an SPObject or Inkscape::XML::Node) + * + * If the internal representation changes (No more 'id' attributes) this is the + * place to adjust things. + */ Inkscape::XML::Node * get_repr_by_name (SPDesktop *desk, gchar *name, GError **error) { @@ -63,6 +83,9 @@ get_repr_by_name (SPDesktop *desk, gchar *name, GError **error) return node; } +/* + * See comment for get_repr_by_name, above. + */ SPObject * get_object_by_name (SPDesktop *desk, gchar *name, GError **error) { @@ -75,6 +98,11 @@ get_object_by_name (SPDesktop *desk, gchar *name, GError **error) return obj; } +/* + * Tests for NULL strings and throws an appropriate error. + * Every method that takes a string parameter (other than the + * name of an object, that's tested seperatly) should call this. + */ gboolean dbus_check_string (gchar *string, GError ** error, const gchar * errorstr) { @@ -86,12 +114,19 @@ dbus_check_string (gchar *string, GError ** error, const gchar * errorstr) return TRUE; } +/* + * This is used to return object values to the user + */ const gchar * get_name_from_object (SPObject * obj) { return obj->repr->attribute("id"); } +/* + * Some verbs (cut, paste) only work on the active layer. + * This makes sure that the document that is about to recive a command is active. + */ void desktop_ensure_active (SPDesktop* desk) { if (desk != SP_ACTIVE_DESKTOP) @@ -112,7 +147,21 @@ selection_get_center_y (Inkscape::Selection *sel){ box = sel->boundsInDocument(box); return box->y0 + ((box->y1 - box->y0)/2); } -//move_to etc + +/* + * This function is used along with selection_restore to + * take advantage of functionality provided by a selection + * for a single object. + * + * It saves the current selection and sets the selection to + * the object specified. Any selection verb can be used on the + * object and then selection_restore is called, restoring the + * original selection. + * + * This should be mostly transparent to the user who need never + * know we never bothered to implement it seperatly. Although + * they might see the selection box flicker if used in a loop. + */ const GSList * selection_swap(SPDesktop *desk, gchar *name, GError **error) { @@ -123,6 +172,9 @@ selection_swap(SPDesktop *desk, gchar *name, GError **error) return oldsel; } +/* + * See selection_swap, above + */ void selection_restore(SPDesktop *desk, const GSList * oldsel) { @@ -130,6 +182,9 @@ selection_restore(SPDesktop *desk, const GSList * oldsel) sel->setList(oldsel); } +/* + * Shortcut for creating a Node. + */ Inkscape::XML::Node * dbus_create_node (SPDesktop *desk, const gchar *type) { @@ -139,6 +194,13 @@ dbus_create_node (SPDesktop *desk, const gchar *type) return xml_doc->createElement(type); } +/* + * Called by the shape creation functions. Gets the default style for the doc + * or sets it arbitrarily if none. + * + * There is probably a better way to do this (use the shape tools default styles) + * but I'm not sure how. + */ gchar * finish_create_shape (DocumentInterface *object, GError **error, Inkscape::XML::Node *newNode, gchar *desc) { @@ -163,6 +225,14 @@ finish_create_shape (DocumentInterface *object, GError **error, Inkscape::XML::N return strdup(newNode->attribute("id")); } +/* + * This is the code used internally to call all the verbs. + * + * It handles error reporting and update pausing (which needs some work.) + * This is a good place to improve efficiency as it is called a lot. + * + * document_interface_call_verb is similar but is called by the user. + */ gboolean dbus_call_verb (DocumentInterface *object, int verbid, GError **error) { @@ -223,6 +293,11 @@ document_interface_new (void) return (DocumentInterface*)g_object_new (TYPE_DOCUMENT_INTERFACE, NULL); } +/* + * Error stuff... + * + * To add a new error type, edit here and in the .h InkscapeError enum. + */ GQuark inkscape_error_quark (void) { @@ -233,7 +308,6 @@ inkscape_error_quark (void) return quark; } -/* This should really be standard. */ #define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } GType @@ -409,7 +483,7 @@ document_interface_spiral (DocumentInterface *object, int cx, int cy, gboolean document_interface_text (DocumentInterface *object, int x, int y, gchar *text, GError **error) { - //FIXME: Not selectable. + //FIXME: Not selectable (aka broken). Needs to be rewritten completely. SPDesktop *desktop = object->desk; SPCanvasText * canvas_text = (SPCanvasText *) sp_canvastext_new(sp_desktop_tempgroup(desktop), desktop, Geom::Point(0,0), ""); @@ -1094,6 +1168,8 @@ document_interface_selection_move_to (DocumentInterface *object, gdouble x, gdou } //FIXME: does not paste in new layer. +// This needs to use lower level cut_impl and paste_impl (messy) +// See the built-in sp_selection_to_next_layer and duplicate. gboolean document_interface_selection_move_to_layer (DocumentInterface *object, gchar *layerstr, GError **error) diff --git a/src/extension/dbus/document-interface.h b/src/extension/dbus/document-interface.h index 436f6b118..8cf9b7ec1 100644 --- a/src/extension/dbus/document-interface.h +++ b/src/extension/dbus/document-interface.h @@ -1,3 +1,20 @@ +/* + * This is where the implementation of the DBus based document API lives. + * All the methods in here (except in the helper section) are + * designed to be called remotly via DBus. application-interface.cpp + * has the methods used to connect to the bus and get a document instance. + * + * Documentation for these methods is in document-interface.xml + * which is the "gold standard" as to how the interface should work. + * + * Authors: + * Soren Berg + * + * Copyright (C) 2009 Soren Berg + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #ifndef INKSCAPE_EXTENSION_DOCUMENT_INTERFACE_H_ #define INKSCAPE_EXTENSION_DOCUMENT_INTERFACE_H_ diff --git a/src/extension/dbus/document-interface.xml b/src/extension/dbus/document-interface.xml index c9cd8aa69..2f1549488 100644 --- a/src/extension/dbus/document-interface.xml +++ b/src/extension/dbus/document-interface.xml @@ -1,3 +1,21 @@ + + +#include // (static.*(\n[^}]*)*(async)+.*(\n[^}]*)*})|typedef void .*; // http://www.josephkahn.com/music/index.xml @@ -50,6 +52,11 @@ dbus_register_object (DBusGConnection *connection, DOCUMENT INTERFACE CLASS STUFF ****************************************************************************/ +struct _DocumentInterface { + GObject parent; + DBusGProxy * proxy; +}; + G_DEFINE_TYPE(DocumentInterface, document_interface, G_TYPE_OBJECT) static void @@ -111,7 +118,7 @@ inkscape_desktop_init_dbus () } -static +//static gboolean inkscape_delete_all (DocumentInterface *doc, GError **error) { @@ -119,7 +126,7 @@ inkscape_delete_all (DocumentInterface *doc, GError **error) return org_inkscape_document_delete_all (proxy, error); } -static +//static gboolean inkscape_call_verb (DocumentInterface *doc, const char * IN_verbid, GError **error) { @@ -128,7 +135,7 @@ inkscape_call_verb (DocumentInterface *doc, const char * IN_verbid, GError **err } -static +//static gchar * inkscape_rectangle (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_width, const gint IN_height, GError **error) { @@ -138,7 +145,7 @@ inkscape_rectangle (DocumentInterface *doc, const gint IN_x, const gint IN_y, co return OUT_object_name; } -static +//static char * inkscape_ellipse (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_width, const gint IN_height, GError **error) { @@ -148,7 +155,7 @@ inkscape_ellipse (DocumentInterface *doc, const gint IN_x, const gint IN_y, cons return OUT_object_name; } -static +//static char * inkscape_polygon (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_radius, const gint IN_rotation, const gint IN_sides, GError **error) { @@ -158,7 +165,7 @@ inkscape_polygon (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, co return OUT_object_name; } -static +//static char * inkscape_star (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_r1, const gint IN_r2, const gdouble IN_arg1, const gdouble IN_arg2, const gint IN_sides, const gdouble IN_rounded, GError **error) { @@ -168,7 +175,7 @@ inkscape_star (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const return OUT_object_name; } -static +//static char * inkscape_spiral (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_r, const gint IN_revolutions, GError **error) { @@ -178,7 +185,7 @@ inkscape_spiral (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, con return OUT_object_name; } -static +//static char * inkscape_line (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_x2, const gint IN_y2, GError **error) { @@ -188,7 +195,7 @@ inkscape_line (DocumentInterface *doc, const gint IN_x, const gint IN_y, const g return OUT_object_name; } -static +//static gboolean inkscape_text (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error) { @@ -196,7 +203,7 @@ inkscape_text (DocumentInterface *doc, const gint IN_x, const gint IN_y, const c return org_inkscape_document_text (proxy, IN_x, IN_y, IN_text, error); } -static +//static char * inkscape_image (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error) { @@ -206,7 +213,7 @@ inkscape_image (DocumentInterface *doc, const gint IN_x, const gint IN_y, const return OUT_object_name; } -static +//static char * inkscape_node (DocumentInterface *doc, const char * IN_svgtype, GError **error) { @@ -216,7 +223,7 @@ inkscape_node (DocumentInterface *doc, const char * IN_svgtype, GError **error) return OUT_node_name; } -static +//static gdouble inkscape_document_get_width (DocumentInterface *doc, GError **error) { @@ -226,7 +233,7 @@ inkscape_document_get_width (DocumentInterface *doc, GError **error) return OUT_val; } -static +//static gdouble inkscape_document_get_height (DocumentInterface *doc, GError **error) { @@ -236,7 +243,7 @@ inkscape_document_get_height (DocumentInterface *doc, GError **error) return OUT_val; } -static +//static char * inkscape_document_get_css (DocumentInterface *doc, GError **error) { @@ -246,7 +253,7 @@ inkscape_document_get_css (DocumentInterface *doc, GError **error) return OUT_css; } -static +//static gboolean inkscape_document_set_css (DocumentInterface *doc, const char * IN_stylestring, GError **error) { @@ -254,7 +261,7 @@ inkscape_document_set_css (DocumentInterface *doc, const char * IN_stylestring, return org_inkscape_document_document_document_set_css (proxy, IN_stylestring, error); } -static +//static gboolean inkscape_document_merge_css (DocumentInterface *doc, const char * IN_stylestring, GError **error) { @@ -262,7 +269,7 @@ inkscape_document_merge_css (DocumentInterface *doc, const char * IN_stylestring return org_inkscape_document_document_document_merge_css (proxy, IN_stylestring, error); } -static +//static gboolean inkscape_document_resize_to_fit_selection (DocumentInterface *doc, GError **error) { @@ -270,7 +277,7 @@ inkscape_document_resize_to_fit_selection (DocumentInterface *doc, GError **erro return org_inkscape_document_document_document_resize_to_fit_selection (proxy, error); } -static +//static gboolean inkscape_set_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const char * IN_newval, GError **error) { @@ -278,7 +285,7 @@ inkscape_set_attribute (DocumentInterface *doc, const char * IN_shape, const cha return org_inkscape_document_set_attribute (proxy, IN_shape, IN_attribute, IN_newval, error); } -static +//static gboolean inkscape_set_int_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gint IN_newval, GError **error) { @@ -286,7 +293,7 @@ inkscape_set_int_attribute (DocumentInterface *doc, const char * IN_shape, const return org_inkscape_document_set_int_attribute (proxy, IN_shape, IN_attribute, IN_newval, error); } -static +//static gboolean inkscape_set_double_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gdouble IN_newval, GError **error) { @@ -294,7 +301,7 @@ inkscape_set_double_attribute (DocumentInterface *doc, const char * IN_shape, co return org_inkscape_document_set_double_attribute (proxy, IN_shape, IN_attribute, IN_newval, error); } -static +//static char * inkscape_get_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, GError **error) { @@ -304,7 +311,7 @@ inkscape_get_attribute (DocumentInterface *doc, const char * IN_shape, const cha return OUT_val; } -static +//static gboolean inkscape_move (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error) { @@ -312,7 +319,7 @@ inkscape_move (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x return org_inkscape_document_move (proxy, IN_shape, IN_x, IN_y, error); } -static +//static gboolean inkscape_move_to (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error) { @@ -320,7 +327,7 @@ inkscape_move_to (DocumentInterface *doc, const char * IN_shape, const gdouble I return org_inkscape_document_move_to (proxy, IN_shape, IN_x, IN_y, error); } -static +//static gboolean inkscape_object_to_path (DocumentInterface *doc, const char * IN_objectname, GError **error) { @@ -328,7 +335,7 @@ inkscape_object_to_path (DocumentInterface *doc, const char * IN_objectname, GEr return org_inkscape_document_object_to_path (proxy, IN_objectname, error); } -static +//static char * inkscape_get_path (DocumentInterface *doc, const char * IN_shape, GError **error) { @@ -338,7 +345,7 @@ inkscape_get_path (DocumentInterface *doc, const char * IN_shape, GError **error return OUT_val; } -static +//static gboolean inkscape_transform (DocumentInterface *doc, const char * IN_shape, const char * IN_transformstr, GError **error) { @@ -346,7 +353,7 @@ inkscape_transform (DocumentInterface *doc, const char * IN_shape, const char * return org_inkscape_document_transform (proxy, IN_shape, IN_transformstr, error); } -static +//static char * inkscape_get_css (DocumentInterface *doc, const char * IN_shape, GError **error) { @@ -356,7 +363,7 @@ inkscape_get_css (DocumentInterface *doc, const char * IN_shape, GError **error) return OUT_css; } -static +//static gboolean inkscape_modify_css (DocumentInterface *doc, const char * IN_shape, const char * IN_cssattrib, const char * IN_newval, GError **error) { @@ -364,7 +371,7 @@ inkscape_modify_css (DocumentInterface *doc, const char * IN_shape, const char * return org_inkscape_document_modify_css (proxy, IN_shape, IN_cssattrib, IN_newval, error); } -static +//static gboolean inkscape_merge_css (DocumentInterface *doc, const char * IN_shape, const char * IN_stylestring, GError **error) { @@ -372,7 +379,7 @@ inkscape_merge_css (DocumentInterface *doc, const char * IN_shape, const char * return org_inkscape_document_merge_css (proxy, IN_shape, IN_stylestring, error); } -static +//static gboolean inkscape_set_color (DocumentInterface *doc, const char * IN_shape, const gint IN_red, const gint IN_green, const gint IN_blue, const gboolean IN_fill, GError **error) { @@ -380,7 +387,7 @@ inkscape_set_color (DocumentInterface *doc, const char * IN_shape, const gint IN return org_inkscape_document_set_color (proxy, IN_shape, IN_red, IN_green, IN_blue, IN_fill, error); } -static +//static gboolean inkscape_move_to_layer (DocumentInterface *doc, const char * IN_objectname, const char * IN_layername, GError **error) { @@ -388,7 +395,7 @@ inkscape_move_to_layer (DocumentInterface *doc, const char * IN_objectname, cons return org_inkscape_document_move_to_layer (proxy, IN_objectname, IN_layername, error); } -static +//static GArray* inkscape_get_node_coordinates (DocumentInterface *doc, const char * IN_shape, GError **error) { @@ -398,7 +405,7 @@ inkscape_get_node_coordinates (DocumentInterface *doc, const char * IN_shape, GE return OUT_points; } -static +//static gboolean inkscape_save (DocumentInterface *doc, GError **error) { @@ -406,7 +413,7 @@ inkscape_save (DocumentInterface *doc, GError **error) return org_inkscape_document_save (proxy, error); } -static +//static gboolean inkscape_save_as (DocumentInterface *doc, const char * IN_pathname, GError **error) { @@ -414,7 +421,7 @@ inkscape_save_as (DocumentInterface *doc, const char * IN_pathname, GError **err return org_inkscape_document_save_as (proxy, IN_pathname, error); } -static +//static gboolean inkscape_load (DocumentInterface *doc, const char * IN_pathname, GError **error) { @@ -422,7 +429,7 @@ inkscape_load (DocumentInterface *doc, const char * IN_pathname, GError **error) return org_inkscape_document_load (proxy, IN_pathname, error); } -static +//static gboolean inkscape_mark_as_unmodified (DocumentInterface *doc, GError **error) { @@ -430,7 +437,7 @@ inkscape_mark_as_unmodified (DocumentInterface *doc, GError **error) return org_inkscape_document_mark_as_unmodified (proxy, error); } -static +//static gboolean inkscape_close (DocumentInterface *doc, GError **error) { @@ -438,7 +445,7 @@ inkscape_close (DocumentInterface *doc, GError **error) return org_inkscape_document_close (proxy, error); } -static +//static gboolean inkscape_inkscape_exit (DocumentInterface *doc, GError **error) { @@ -446,7 +453,7 @@ inkscape_inkscape_exit (DocumentInterface *doc, GError **error) return org_inkscape_document_exit (proxy, error); } -static +//static gboolean inkscape_undo (DocumentInterface *doc, GError **error) { @@ -454,7 +461,7 @@ inkscape_undo (DocumentInterface *doc, GError **error) return org_inkscape_document_undo (proxy, error); } -static +//static gboolean inkscape_redo (DocumentInterface *doc, GError **error) { @@ -462,7 +469,7 @@ inkscape_redo (DocumentInterface *doc, GError **error) return org_inkscape_document_redo (proxy, error); } -static +//static gboolean inkscape_pause_updates (DocumentInterface *doc, GError **error) { @@ -470,7 +477,7 @@ inkscape_pause_updates (DocumentInterface *doc, GError **error) return org_inkscape_document_pause_updates (proxy, error); } -static +//static gboolean inkscape_resume_updates (DocumentInterface *doc, GError **error) { @@ -478,7 +485,7 @@ inkscape_resume_updates (DocumentInterface *doc, GError **error) return org_inkscape_document_resume_updates (proxy, error); } -static +//static gboolean inkscape_update (DocumentInterface *doc, GError **error) { @@ -486,7 +493,7 @@ inkscape_update (DocumentInterface *doc, GError **error) return org_inkscape_document_update (proxy, error); } -static +//static char ** inkscape_selection_get (DocumentInterface *doc, GError **error) { @@ -496,7 +503,7 @@ inkscape_selection_get (DocumentInterface *doc, GError **error) return OUT_listy; } -static +//static gboolean inkscape_selection_add (DocumentInterface *doc, const char * IN_name, GError **error) { @@ -504,7 +511,7 @@ inkscape_selection_add (DocumentInterface *doc, const char * IN_name, GError **e return org_inkscape_document_selection_add (proxy, IN_name, error); } -static +//static gboolean inkscape_selection_add_list (DocumentInterface *doc, const char ** IN_name, GError **error) { @@ -512,7 +519,7 @@ inkscape_selection_add_list (DocumentInterface *doc, const char ** IN_name, GErr return org_inkscape_document_selection_add_list (proxy, IN_name, error); } -static +//static gboolean inkscape_selection_set (DocumentInterface *doc, const char * IN_name, GError **error) { @@ -520,7 +527,7 @@ inkscape_selection_set (DocumentInterface *doc, const char * IN_name, GError **e return org_inkscape_document_selection_set (proxy, IN_name, error); } -static +//static gboolean inkscape_selection_set_list (DocumentInterface *doc, const char ** IN_name, GError **error) { @@ -528,7 +535,7 @@ inkscape_selection_set_list (DocumentInterface *doc, const char ** IN_name, GErr return org_inkscape_document_selection_set_list (proxy, IN_name, error); } -static +//static gboolean inkscape_selection_rotate (DocumentInterface *doc, const gint IN_angle, GError **error) { @@ -536,7 +543,7 @@ inkscape_selection_rotate (DocumentInterface *doc, const gint IN_angle, GError * return org_inkscape_document_selection_rotate (proxy, IN_angle, error); } -static +//static gboolean inkscape_selection_delete (DocumentInterface *doc, GError **error) { @@ -544,7 +551,7 @@ inkscape_selection_delete (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_delete (proxy, error); } -static +//static gboolean inkscape_selection_clear (DocumentInterface *doc, GError **error) { @@ -552,7 +559,7 @@ inkscape_selection_clear (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_clear (proxy, error); } -static +//static gboolean inkscape_select_all (DocumentInterface *doc, GError **error) { @@ -560,7 +567,7 @@ inkscape_select_all (DocumentInterface *doc, GError **error) return org_inkscape_document_select_all (proxy, error); } -static +//static gboolean inkscape_select_all_in_all_layers (DocumentInterface *doc, GError **error) { @@ -568,7 +575,7 @@ inkscape_select_all_in_all_layers (DocumentInterface *doc, GError **error) return org_inkscape_document_select_all_in_all_layers (proxy, error); } -static +//static gboolean inkscape_selection_box (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_x2, const gint IN_y2, const gboolean IN_replace, GError **error) { @@ -576,7 +583,7 @@ inkscape_selection_box (DocumentInterface *doc, const gint IN_x, const gint IN_y return org_inkscape_document_selection_box (proxy, IN_x, IN_y, IN_x2, IN_y2, IN_replace, error); } -static +//static gboolean inkscape_selection_invert (DocumentInterface *doc, GError **error) { @@ -584,7 +591,7 @@ inkscape_selection_invert (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_invert (proxy, error); } -static +//static gboolean inkscape_selection_group (DocumentInterface *doc, GError **error) { @@ -592,7 +599,7 @@ inkscape_selection_group (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_group (proxy, error); } -static +//static gboolean inkscape_selection_ungroup (DocumentInterface *doc, GError **error) { @@ -600,7 +607,7 @@ inkscape_selection_ungroup (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_ungroup (proxy, error); } -static +//static gboolean inkscape_selection_cut (DocumentInterface *doc, GError **error) { @@ -608,7 +615,7 @@ inkscape_selection_cut (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_cut (proxy, error); } -static +//static gboolean inkscape_selection_copy (DocumentInterface *doc, GError **error) { @@ -616,7 +623,7 @@ inkscape_selection_copy (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_copy (proxy, error); } -static +//static gboolean inkscape_selection_paste (DocumentInterface *doc, GError **error) { @@ -624,7 +631,7 @@ inkscape_selection_paste (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_paste (proxy, error); } -static +//static gboolean inkscape_selection_scale (DocumentInterface *doc, const gdouble IN_grow, GError **error) { @@ -632,7 +639,7 @@ inkscape_selection_scale (DocumentInterface *doc, const gdouble IN_grow, GError return org_inkscape_document_selection_scale (proxy, IN_grow, error); } -static +//static gboolean inkscape_selection_move (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error) { @@ -640,7 +647,7 @@ inkscape_selection_move (DocumentInterface *doc, const gdouble IN_x, const gdoub return org_inkscape_document_selection_move (proxy, IN_x, IN_y, error); } -static +//static gboolean inkscape_selection_move_to (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error) { @@ -648,7 +655,7 @@ inkscape_selection_move_to (DocumentInterface *doc, const gdouble IN_x, const gd return org_inkscape_document_selection_move_to (proxy, IN_x, IN_y, error); } -static +//static gboolean inkscape_selection_move_to_layer (DocumentInterface *doc, const char * IN_layer, GError **error) { @@ -656,7 +663,7 @@ inkscape_selection_move_to_layer (DocumentInterface *doc, const char * IN_layer, return org_inkscape_document_selection_move_to_layer (proxy, IN_layer, error); } -static +//static GArray * inkscape_selection_get_center (DocumentInterface *doc, GError **error) { @@ -666,7 +673,7 @@ inkscape_selection_get_center (DocumentInterface *doc, GError **error) return OUT_centerpoint; } -static +//static gboolean inkscape_selection_to_path (DocumentInterface *doc, GError **error) { @@ -674,7 +681,7 @@ inkscape_selection_to_path (DocumentInterface *doc, GError **error) return org_inkscape_document_selection_to_path (proxy, error); } -static +//static char * inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error) { @@ -684,7 +691,7 @@ inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError return OUT_newpath; } -static +//static char ** inkscape_selection_divide (DocumentInterface *doc, GError **error) { @@ -694,7 +701,7 @@ inkscape_selection_divide (DocumentInterface *doc, GError **error) return OUT_pieces; } -static +//static gboolean inkscape_selection_change_level (DocumentInterface *doc, const char * IN_command, GError **error) { @@ -704,7 +711,7 @@ inkscape_selection_change_level (DocumentInterface *doc, const char * IN_command return OUT_objectsmoved; } -static +//static char * inkscape_layer_new (DocumentInterface *doc, GError **error) { @@ -714,7 +721,7 @@ inkscape_layer_new (DocumentInterface *doc, GError **error) return OUT_layername; } -static +//static gboolean inkscape_layer_set (DocumentInterface *doc, const char * IN_layer, GError **error) { @@ -722,7 +729,7 @@ inkscape_layer_set (DocumentInterface *doc, const char * IN_layer, GError **erro return org_inkscape_document_layer_set (proxy, IN_layer, error); } -static +//static char ** inkscape_layer_get_all (DocumentInterface *doc, GError **error) { @@ -732,7 +739,7 @@ inkscape_layer_get_all (DocumentInterface *doc, GError **error) return OUT_layers; } -static +//static gboolean inkscape_layer_change_level (DocumentInterface *doc, const char * IN_command, GError **error) { @@ -742,7 +749,7 @@ inkscape_layer_change_level (DocumentInterface *doc, const char * IN_command, GE return OUT_layermoved; } -static +//static gboolean inkscape_layer_next (DocumentInterface *doc, GError **error) { @@ -750,7 +757,7 @@ inkscape_layer_next (DocumentInterface *doc, GError **error) return org_inkscape_document_layer_next (proxy, error); } -static +//static gboolean inkscape_layer_previous (DocumentInterface *doc, GError **error) { diff --git a/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h b/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h index c48a712b4..c314bf6f8 100644 --- a/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h +++ b/src/extension/dbus/wrapper/inkscape-dbus-wrapper.h @@ -4,8 +4,6 @@ #include #include -#include - //#include "document-client-glue-mod.h" //#include @@ -25,10 +23,7 @@ G_BEGIN_DECLS typedef struct _DocumentInterface DocumentInterface; typedef struct _DocumentInterfaceClass DocumentInterfaceClass; -struct _DocumentInterface { - GObject parent; - DBusGProxy * proxy; -}; +struct _DocumentInterface; struct _DocumentInterfaceClass { GObjectClass parent; @@ -40,305 +35,307 @@ GType document_interface_get_type (void); -DocumentInterface * inkscape_desktop_init_dbus (); -static +DocumentInterface * +inkscape_desktop_init_dbus (); + +//static gboolean inkscape_delete_all (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_call_verb (DocumentInterface *doc, const char * IN_verbid, GError **error); -static +//static gchar * inkscape_rectangle (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_width, const gint IN_height, GError **error); -static +//static char * inkscape_ellipse (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_width, const gint IN_height, GError **error); -static +//static char * inkscape_polygon (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_radius, const gint IN_rotation, const gint IN_sides, GError **error); -static +//static char * inkscape_star (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_r1, const gint IN_r2, const gdouble IN_arg1, const gdouble IN_arg2, const gint IN_sides, const gdouble IN_rounded, GError **error); -static +//static char * inkscape_spiral (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_r, const gint IN_revolutions, GError **error); -static +//static char * inkscape_line (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_x2, const gint IN_y2, GError **error); -static +//static gboolean inkscape_text (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error); -static +//static char * inkscape_image (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error); -static +//static char * inkscape_node (DocumentInterface *doc, const char * IN_svgtype, GError **error); -static +//static gdouble inkscape_document_get_width (DocumentInterface *doc, GError **error); -static +//static gdouble inkscape_document_get_height (DocumentInterface *doc, GError **error); -static +//static char * inkscape_document_get_css (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_document_set_css (DocumentInterface *doc, const char * IN_stylestring, GError **error); -static +//static gboolean inkscape_document_merge_css (DocumentInterface *doc, const char * IN_stylestring, GError **error); -static +//static gboolean inkscape_document_resize_to_fit_selection (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_set_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const char * IN_newval, GError **error); -static +//static gboolean inkscape_set_int_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gint IN_newval, GError **error); -static +//static gboolean inkscape_set_double_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gdouble IN_newval, GError **error); -static +//static char * inkscape_get_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, GError **error); -static +//static gboolean inkscape_move (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error); -static +//static gboolean inkscape_move_to (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error); -static +//static gboolean inkscape_object_to_path (DocumentInterface *doc, const char * IN_objectname, GError **error); -static +//static char * inkscape_get_path (DocumentInterface *doc, const char * IN_shape, GError **error); -static +//static gboolean inkscape_transform (DocumentInterface *doc, const char * IN_shape, const char * IN_transformstr, GError **error); -static +//static char * inkscape_get_css (DocumentInterface *doc, const char * IN_shape, GError **error); -static +//static gboolean inkscape_modify_css (DocumentInterface *doc, const char * IN_shape, const char * IN_cssattrib, const char * IN_newval, GError **error); -static +//static gboolean inkscape_inkscape_merge_css (DocumentInterface *doc, const char * IN_shape, const char * IN_stylestring, GError **error); -static +//static gboolean inkscape_set_color (DocumentInterface *doc, const char * IN_shape, const gint IN_red, const gint IN_green, const gint IN_blue, const gboolean IN_fill, GError **error); -static +//static gboolean inkscape_move_to_layer (DocumentInterface *doc, const char * IN_objectname, const char * IN_layername, GError **error); -static +//static GArray* inkscape_get_node_coordinates (DocumentInterface *doc, const char * IN_shape, GError **error); -static +//static gboolean inkscape_save (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_save_as (DocumentInterface *doc, const char * IN_pathname, GError **error); -static +//static gboolean inkscape_load (DocumentInterface *doc, const char * IN_pathname, GError **error); -static +//static gboolean inkscape_mark_as_unmodified (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_close (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_inkscape_exit (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_undo (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_redo (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_pause_updates (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_resume_updates (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_update (DocumentInterface *doc, GError **error); -static +//static char ** inkscape_selection_get (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_add (DocumentInterface *doc, const char * IN_name, GError **error); -static +//static gboolean inkscape_selection_add_list (DocumentInterface *doc, const char ** IN_name, GError **error); -static +//static gboolean inkscape_selection_set (DocumentInterface *doc, const char * IN_name, GError **error); -static +//static gboolean inkscape_selection_set_list (DocumentInterface *doc, const char ** IN_name, GError **error); -static +//static gboolean inkscape_selection_rotate (DocumentInterface *doc, const gint IN_angle, GError **error); -static +//static gboolean inkscape_selection_delete (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_clear (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_select_all (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_select_all_in_all_layers (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_box (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_x2, const gint IN_y2, const gboolean IN_replace, GError **error); -static +//static gboolean inkscape_selection_invert (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_group (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_ungroup (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_cut (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_copy (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_paste (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_scale (DocumentInterface *doc, const gdouble IN_grow, GError **error); -static +//static gboolean inkscape_selection_move (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error); -static +//static gboolean inkscape_selection_move_to (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error); -static +//static gboolean inkscape_selection_move_to_layer (DocumentInterface *doc, const char * IN_layer, GError **error); -static +//static GArray * inkscape_selection_get_center (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_to_path (DocumentInterface *doc, GError **error); -static +//static char * inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error); -static +//static char ** inkscape_selection_divide (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_selection_change_level (DocumentInterface *doc, const char * IN_command, GError **error); -static +//static char * inkscape_layer_new (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_layer_set (DocumentInterface *doc, const char * IN_layer, GError **error); -static +//static char ** inkscape_layer_get_all (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_layer_change_level (DocumentInterface *doc, const char * IN_command, GError **error); -static +//static gboolean inkscape_layer_next (DocumentInterface *doc, GError **error); -static +//static gboolean inkscape_layer_previous (DocumentInterface *doc, GError **error); -- 2.30.2