Code

Core Dbus files.
authorglimmer07 <glimmer07@users.sourceforge.net>
Sun, 12 Jul 2009 16:02:09 +0000 (16:02 +0000)
committerglimmer07 <glimmer07@users.sourceforge.net>
Sun, 12 Jul 2009 16:02:09 +0000 (16:02 +0000)
Init creates interfaces on Inkscape startup.
Application and document interface provide API functions over Dbus.
service.in file makes sure Inkscape starts automatically when someone connects to it over Dbus.

src/extension/dbus/Makefile_insert [new file with mode: 0644]
src/extension/dbus/application-interface.cpp [new file with mode: 0644]
src/extension/dbus/application-interface.h [new file with mode: 0644]
src/extension/dbus/application-interface.xml [new file with mode: 0644]
src/extension/dbus/dbus-init.cpp [new file with mode: 0644]
src/extension/dbus/dbus-init.h [new file with mode: 0644]
src/extension/dbus/document-interface.cpp [new file with mode: 0644]
src/extension/dbus/document-interface.xml [new file with mode: 0644]
src/extension/dbus/org.inkscape.service.in [new file with mode: 0644]

diff --git a/src/extension/dbus/Makefile_insert b/src/extension/dbus/Makefile_insert
new file mode 100644 (file)
index 0000000..c8bee0c
--- /dev/null
@@ -0,0 +1,31 @@
+## Makefile.am fragment sourced by src/Makefile.am.
+
+ink_common_sources +=  \
+       extension/dbus/dbus-init.cpp  \
+       extension/dbus/dbus-init.h  \
+       extension/dbus/application-interface.cpp  \
+       extension/dbus/application-interface.h  \
+       extension/dbus/document-interface.cpp  \
+       extension/dbus/document-interface.h
+
+## Slightly concerned about this.
+## Would use += but it has to be set first.
+BUILT_SOURCES =   \
+       extension/dbus/application-server-glue.h   \
+       extension/dbus/document-server-glue.h
+
+extension/dbus/application-server-glue.h: extension/dbus/application-interface.xml
+       dbus-binding-tool --mode=glib-server --output=$@ --prefix=application_interface $^
+
+extension/dbus/document-server-glue.h: extension/dbus/document-interface.xml
+       dbus-binding-tool --mode=glib-server --output=$@ --prefix=document_interface $^
+
+# Dbus service file
+servicedir = "/usr/share/dbus-1/services"
+service_in_files = extension/dbus/org.inkscape.service.in
+service_DATA = $(service_in_files:.service.in=.service)
+
+# Rule to make the service file with bindir expanded
+$(service_DATA): $(service_in_files) Makefile
+       @sed -e "s|@bindir@|$(bindir)|" $<> $@
+
diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp
new file mode 100644 (file)
index 0000000..06e41ec
--- /dev/null
@@ -0,0 +1,112 @@
+#include "application-interface.h"
+#include <string.h>
+#include "dbus-init.h"
+
+G_DEFINE_TYPE(ApplicationInterface, application_interface, G_TYPE_OBJECT)
+
+static void
+application_interface_finalize (GObject *object)
+{
+        G_OBJECT_CLASS (application_interface_parent_class)->finalize (object);
+}
+
+
+static void
+application_interface_class_init (ApplicationInterfaceClass *klass)
+{
+        GObjectClass *object_class;
+        object_class = G_OBJECT_CLASS (klass);
+        object_class->finalize = application_interface_finalize;
+}
+
+static void
+application_interface_init (ApplicationInterface *object)
+{
+}
+
+
+ApplicationInterface *
+application_interface_new (void)
+{
+        return (ApplicationInterface*)g_object_new (TYPE_APPLICATION_INTERFACE, NULL);
+}
+
+/****************************************************************************
+     DESKTOP FUNCTIONS
+****************************************************************************/
+
+gchar* 
+application_interface_desktop_new (ApplicationInterface *object, 
+                                   GError **error) 
+{
+  return (gchar*)Inkscape::Extension::Dbus::init_desktop();
+}
+
+gchar** 
+application_interface_get_desktop_list (ApplicationInterface *object)
+{
+  return NULL;
+}
+
+gchar* 
+application_interface_get_active_desktop (ApplicationInterface *object,
+                                          GError **error)
+{
+  return NULL;
+}
+
+gboolean
+application_interface_set_active_desktop (ApplicationInterface *object, 
+                                          gchar* document_name,
+                                          GError **error)
+{
+  return TRUE;
+}
+
+gboolean
+application_interface_desktop_close_all (ApplicationInterface *object,
+                                          GError **error) 
+{
+  return TRUE;
+}
+
+gboolean
+application_interface_exit (ApplicationInterface *object, GError **error)
+{
+    return TRUE;
+}
+
+/****************************************************************************
+     DOCUMENT FUNCTIONS
+****************************************************************************/
+
+gchar* application_interface_document_new (ApplicationInterface *object,
+                                           GError **error)
+{
+  return (gchar*)Inkscape::Extension::Dbus::init_document();
+}
+
+gchar** 
+application_interface_get_document_list (ApplicationInterface *object)
+{
+  return NULL;
+}
+
+gboolean
+application_interface_document_close_all (ApplicationInterface *object,
+                                          GError **error) 
+{
+  return TRUE;
+}
+
+/* INTERESTING FUNCTIONS
+    SPDesktop  *desktop = SP_ACTIVE_DESKTOP;
+    g_assert(desktop != NULL);
+
+    SPDocument *doc = sp_desktop_document(desktop);
+    g_assert(doc != NULL);
+
+    Inkscape::XML::Node     *repr = sp_document_repr_root(doc);
+    g_assert(repr != NULL);
+*/
+
diff --git a/src/extension/dbus/application-interface.h b/src/extension/dbus/application-interface.h
new file mode 100644 (file)
index 0000000..a04c992
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef INKSCAPE_EXTENSION_APPLICATION_INTERFACE_H_
+#define INKSCAPE_EXTENSION_APPLICATION_INTERFACE_H_
+
+#include <glib.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-bindings.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+#define DBUS_APPLICATION_INTERFACE_PATH  "/org/inkscape/application"
+        
+#define TYPE_APPLICATION_INTERFACE            (application_interface_get_type ())
+#define APPLICATION_INTERFACE(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_APPLICATION_INTERFACE, ApplicationInterface))
+#define APPLICATION_INTERFACE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APPLICATION_INTERFACE, ApplicationInterfaceClass))
+#define IS_APPLICATION_INTERFACE(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_APPLICATION_INTERFACE))
+#define IS_APPLICATION_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APPLICATION_INTERFACE))
+#define APPLICATION_INTERFACE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APPLICATION_INTERFACE, ApplicationInterfaceClass))
+
+G_BEGIN_DECLS
+
+typedef struct _ApplicationInterface ApplicationInterface;
+typedef struct _ApplicationInterfaceClass ApplicationInterfaceClass;
+
+struct _ApplicationInterface {
+        GObject parent;
+};
+
+struct _ApplicationInterfaceClass {
+        GObjectClass parent;
+};
+
+/****************************************************************************
+     DESKTOP FUNCTIONS
+****************************************************************************/
+
+gchar* 
+application_interface_desktop_new (ApplicationInterface *object, 
+                                   GError **error);
+
+gchar** 
+application_interface_get_desktop_list (ApplicationInterface *object);
+
+gchar* 
+application_interface_get_active_desktop (ApplicationInterface *object, 
+                                          GError **error);
+
+gboolean
+application_interface_set_active_desktop (ApplicationInterface *object,
+                                          gchar* document_name, 
+                                          GError **error);
+
+gboolean
+application_interface_desktop_close_all (ApplicationInterface *object, 
+                                         GError **error);
+
+gboolean
+application_interface_exit (ApplicationInterface *object, GError **error);
+
+/****************************************************************************
+     DOCUMENT FUNCTIONS
+****************************************************************************/
+
+gchar* 
+application_interface_document_new (ApplicationInterface *object, 
+                                    GError **error);
+
+gchar** 
+application_interface_get_document_list (ApplicationInterface *object);
+
+gboolean
+application_interface_document_close_all (ApplicationInterface *object,
+                                          GError **error);
+
+
+/****************************************************************************
+     SETUP
+****************************************************************************/
+
+ApplicationInterface *application_interface_new (void);
+GType application_interface_get_type (void);
+
+
+G_END_DECLS
+
+#endif // INKSCAPE_EXTENSION_APPLICATION_INTERFACE_H_
diff --git a/src/extension/dbus/application-interface.xml b/src/extension/dbus/application-interface.xml
new file mode 100644 (file)
index 0000000..9b55a9b
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<node name="/org/inkscape/application"
+  xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"
+>
+  <interface name="org.inkscape.application">
+
+    <!-- DESKTOP FUNCTIONS -->
+    <method name="desktop_new">
+      <arg type="s" name="desktop_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>This string can be used to connect to the new interface that was created.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Create a new document interface and return it's location.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+    <method name="get_desktop_list">
+      <arg type="as" name="document_list" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
+        <doc:doc>
+          <doc:summary>A list of interfaces being provided by Inkscape.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>List all the interfaces that it is possible to connect to.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+    <method name="desktop_close_all">
+      <doc:doc>
+        <doc:description>
+          <doc:para>Close all document interfaces without saving.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+    <method name="exit">
+      <doc:doc>
+        <doc:description>
+          <doc:para>Exit Inkscape without saving.  Fairly straightforward. </doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <!-- DOCUMENT FUNCTIONS -->
+    <method name="document_new">
+      <arg type="s" name="document_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>This string can be used to connect to the new interface that was created.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Originally, there were going to be two interfaces.  A desktop and a document.  Desktops would be used when the user wanted to see the result of their code and documents would be used when less overhead was desired.  Unfortunately as more and more of the code can to rely on the desktop and it's associated support code (including selections and verbs) the document interface was looking more and more limited.  Ultimately I decided to just go with the desktop interface since I didn't have a compelling reason for keeping the other one and having two similar interfaces could be very confusing.  The desktop interface inherited the document name because I believe it's more familiar to people.</doc:para>
+          <doc:para>Perhaps it would be best to have an option as to whether or not to create a window and fail with a good error message when they call a function that requires one.  Or have a second interface for different use cases but have it be completely different, rather than a subset of the first if there are use cases that support it.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+  </interface>
+</node>
diff --git a/src/extension/dbus/dbus-init.cpp b/src/extension/dbus/dbus-init.cpp
new file mode 100644 (file)
index 0000000..a30bb8f
--- /dev/null
@@ -0,0 +1,153 @@
+
+#include <dbus/dbus-glib.h>
+#include "dbus-init.h"
+
+#include "application-interface.h"
+#include "application-server-glue.h"
+
+#include "document-interface.h"
+#include "document-server-glue.h"
+
+#include "inkscape.h"
+#include "document.h"
+#include "desktop.h"
+#include "file.h"
+#include "verbs.h"
+#include "helper/action.h"
+
+#include <algorithm>
+#include <iostream>
+#include <sstream>
+
+
+
+
+namespace Inkscape {
+namespace Extension {
+namespace Dbus {
+
+/* PRIVATE get a connection to the session bus */
+DBusGConnection *
+dbus_get_connection() {
+       GError *error = NULL;
+       DBusGConnection *connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+       if (error) {
+               fprintf(stderr, "Failed to get connection");
+               return NULL;
+       }
+       else
+               return connection;
+}
+
+/* PRIVATE create a proxy object for a bus.*/
+DBusGProxy *
+dbus_get_proxy(DBusGConnection *connection) {
+       return dbus_g_proxy_new_for_name (connection,
+                DBUS_SERVICE_DBUS,
+                DBUS_PATH_DBUS,
+                DBUS_INTERFACE_DBUS);
+}
+
+/* PRIVATE register an object on a bus */
+static gpointer
+dbus_register_object (DBusGConnection *connection,
+                      DBusGProxy *proxy,
+                      GType object_type,
+                      const DBusGObjectInfo *info,
+                      const gchar *path)
+{
+        GObject *object = (GObject*)g_object_new (object_type, NULL);
+        dbus_g_object_type_install_info (object_type, info);
+        dbus_g_connection_register_g_object (connection, path, object);
+        return object;
+}
+
+/* Initialize a Dbus service */
+void 
+init (void)
+{
+        guint   result;
+        GError *error = NULL;
+        DBusGConnection *connection;
+        DBusGProxy *proxy;
+           DocumentInterface *obj;
+        connection = dbus_get_connection();
+        proxy = dbus_get_proxy(connection);
+        org_freedesktop_DBus_request_name (proxy,
+                "org.inkscape",
+                DBUS_NAME_FLAG_DO_NOT_QUEUE, &result, &error);
+        //create interface for application
+        dbus_register_object (connection, 
+                proxy,
+                TYPE_APPLICATION_INTERFACE,
+                &dbus_glib_application_interface_object_info,
+                DBUS_APPLICATION_INTERFACE_PATH);
+} //init
+
+gchar *
+init_document (void) {
+        guint   result;
+        GError *error = NULL;
+        DBusGConnection *connection;
+        DBusGProxy *proxy;
+       SPDocument *doc;
+
+       doc = sp_document_new(NULL, 1, TRUE);
+
+        std::string name("/org/inkscape/");
+       name.append(doc->name);
+        std::replace(name.begin(), name.end(), ' ', '_');
+
+        connection = dbus_get_connection();
+        proxy = dbus_get_proxy(connection);
+
+        dbus_register_object (connection, 
+                proxy,
+                TYPE_DOCUMENT_INTERFACE,
+                &dbus_glib_document_interface_object_info,
+                name.c_str());
+       return strdup(name.c_str());
+} //init_document
+
+gchar *
+dbus_init_desktop_interface (SPDesktop * dt)
+{
+    DBusGConnection *connection;
+    DBusGProxy *proxy;
+       DocumentInterface *obj;
+
+    std::string name("/org/inkscape/desktop_");
+       std::stringstream out;
+       out << dt->dkey;
+       name.append(out.str());
+
+       //printf("DKEY: %d\n, NUMBER %d\n NAME: %s\n", dt->dkey, dt->number, name.c_str());
+
+    connection = dbus_get_connection();
+    proxy = dbus_get_proxy(connection);
+
+    obj = (DocumentInterface*) dbus_register_object (connection, 
+          proxy, TYPE_DOCUMENT_INTERFACE,
+          &dbus_glib_document_interface_object_info, name.c_str());
+       obj->desk = dt;
+    obj->updates = TRUE;
+
+    return strdup(name.c_str());
+}
+
+gchar *
+init_desktop (void) {
+    //this function will create a new desktop and call
+    //dbus_init_desktop_interface.
+       SPDesktop * dt = sp_file_new_default();
+
+    std::string name("/org/inkscape/desktop_");
+       std::stringstream out;
+       out << dt->dkey;
+       name.append(out.str());
+    return strdup(name.c_str());
+} //init_desktop
+
+
+
+} } } /* namespace Inkscape::Extension::Dbus */
diff --git a/src/extension/dbus/dbus-init.h b/src/extension/dbus/dbus-init.h
new file mode 100644 (file)
index 0000000..f764831
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Authors:
+ *   Soren Berg <glimmer07@gmail.com>
+ *
+ * Copyright (C) 2004 Authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#ifndef INKSCAPE_EXTENSION_DBUS_INIT_H__
+#define INKSCAPE_EXTENSION_DBUS_INIT_H__
+
+#include "desktop.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Dbus {
+
+/** \brief  Dbus stuff.  For registering objects on the bus. */
+
+void init (void);
+
+gchar * init_document (void);
+
+gchar * init_desktop (void);
+
+gchar * dbus_init_desktop_interface (SPDesktop * dt);
+
+} } }  /* namespace Dbus, Extension, Inkscape */
+
+#endif /* INKSCAPE_EXTENSION_DBUS_INIT_H__ */
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp
new file mode 100644 (file)
index 0000000..94f4428
--- /dev/null
@@ -0,0 +1,936 @@
+#include "document-interface.h"
+#include <string.h>
+
+#include "verbs.h"
+#include "helper/action.h" //sp_action_perform
+
+#include "inkscape.h" //inkscape_find_desktop_by_dkey, activate desktops
+
+#include "desktop-handles.h" //sp_desktop_document()
+#include "xml/repr.h" //sp_repr_document_new
+
+#include "sp-object.h"
+
+#include "document.h" // sp_document_repr_doc
+
+#include "desktop-style.h" //sp_desktop_get_style
+
+#include "selection.h" //selection struct
+#include "selection-chemistry.h"// lots of selection functions
+
+#include "sp-ellipse.h"
+
+#include "layer-fns.h" //LPOS_BELOW
+
+#include "style.h" //style_write
+
+/****************************************************************************
+     HELPER / SHORTCUT FUNCTIONS
+****************************************************************************/
+
+const gchar* intToCString(int i)
+{
+    std::stringstream ss;
+    ss << i;
+    return ss.str().c_str();
+}
+
+SPObject *
+get_object_by_name (SPDesktop *desk, gchar *name)
+{
+    return sp_desktop_document(desk)->getObjectById(name);
+}
+
+const gchar *
+get_name_from_object (SPObject * obj)
+{
+    return obj->repr->attribute("id");
+}
+
+void
+desktop_ensure_active (SPDesktop* desk) {
+    if (desk != SP_ACTIVE_DESKTOP)
+        inkscape_activate_desktop (desk);
+    return;
+}
+
+Inkscape::XML::Node *
+document_retrive_node (SPDocument *doc, gchar *name) {
+    return (doc->getObjectById(name))->repr;
+}
+
+gdouble
+selection_get_center_x (Inkscape::Selection *sel){
+    NRRect *box = g_new(NRRect, 1);;
+    box = sel->boundsInDocument(box);
+    return box->x0 + ((box->x1 - box->x0)/2);
+}
+
+gdouble
+selection_get_center_y (Inkscape::Selection *sel){
+    NRRect *box = g_new(NRRect, 1);;
+    box = sel->boundsInDocument(box);
+    return box->y0 + ((box->y1 - box->y0)/2);
+}
+//move_to etc
+const GSList *
+selection_swap(SPDesktop *desk, gchar *name)
+{
+    Inkscape::Selection *sel = sp_desktop_selection(desk);
+    const GSList *oldsel = g_slist_copy((GSList *)sel->list());
+    
+    sel->set(get_object_by_name(desk, name));
+    return oldsel;
+}
+
+void
+selection_restore(SPDesktop *desk, const GSList * oldsel)
+{
+    Inkscape::Selection *sel = sp_desktop_selection(desk);
+    sel->setList(oldsel);
+}
+
+Inkscape::XML::Node *
+dbus_create_node (SPDesktop *desk, gboolean isrect)
+{
+    SPDocument * doc = sp_desktop_document (desk);
+    Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
+    gchar *type;
+    if (isrect)
+        type = (gchar *)"svg:rect";
+    else
+        type = (gchar *)"svg:path";
+    return xml_doc->createElement(type);
+}
+
+gchar *
+finish_create_shape (DocumentInterface *object, GError **error, Inkscape::XML::Node *newNode, gchar *desc)
+{
+
+    SPCSSAttr *style = sp_desktop_get_style(object->desk, TRUE);
+    
+    if (style) {
+        newNode->setAttribute("style", sp_repr_css_write_string(style), TRUE);
+    }
+    else {
+        newNode->setAttribute("style", "fill:#0000ff;fill-opacity:1;stroke:#c900b9;stroke-width:0;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none", TRUE);
+    }
+
+    object->desk->currentLayer()->appendChildRepr(newNode);
+    object->desk->currentLayer()->updateRepr();
+
+    if (object->updates)
+        sp_document_done(sp_desktop_document(object->desk), 0, (gchar *)desc);
+    else
+        document_interface_pause_updates(object, error);
+
+    return strdup(newNode->attribute("id"));
+}
+
+gboolean
+dbus_call_verb (DocumentInterface *object, int verbid, GError **error)
+{    
+    SPDesktop *desk2 = object->desk;
+
+    if ( desk2 ) {
+        Inkscape::Verb *verb = Inkscape::Verb::get( verbid );
+        if ( verb ) {
+            SPAction *action = verb->get_action(desk2);
+            if ( action ) {
+                sp_action_perform( action, NULL );
+                if (object->updates) {
+                    sp_document_done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip()));
+                }
+                return TRUE;
+            }
+        }
+    }
+    return FALSE;
+}
+
+/****************************************************************************
+     DOCUMENT INTERFACE CLASS STUFF
+****************************************************************************/
+
+G_DEFINE_TYPE(DocumentInterface, document_interface, G_TYPE_OBJECT)
+
+static void
+document_interface_finalize (GObject *object)
+{
+        G_OBJECT_CLASS (document_interface_parent_class)->finalize (object);
+}
+
+
+static void
+document_interface_class_init (DocumentInterfaceClass *klass)
+{
+        GObjectClass *object_class;
+        object_class = G_OBJECT_CLASS (klass);
+        object_class->finalize = document_interface_finalize;
+}
+
+static void
+document_interface_init (DocumentInterface *object)
+{
+       object->desk = NULL;
+}
+
+
+DocumentInterface *
+document_interface_new (void)
+{
+        return (DocumentInterface*)g_object_new (TYPE_DOCUMENT_INTERFACE, NULL);
+}
+
+/****************************************************************************
+     MISC FUNCTIONS
+****************************************************************************/
+
+gboolean
+document_interface_delete_all (DocumentInterface *object, GError **error)
+{
+    sp_edit_clear_all (object->desk);
+    return TRUE;
+}
+
+void
+document_interface_call_verb (DocumentInterface *object, gchar *verbid, GError **error)
+{
+    SPDesktop *desk2 = object->desk;
+    desktop_ensure_active (object->desk);
+    if ( desk2 ) {
+        Inkscape::Verb *verb = Inkscape::Verb::getbyid( verbid );
+        if ( verb ) {
+            SPAction *action = verb->get_action(desk2);
+            if ( action ) {
+                sp_action_perform( action, NULL );
+                if (object->updates) {
+                    sp_document_done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip()));
+                }
+            }
+        }
+    }
+}
+
+
+/****************************************************************************
+     CREATION FUNCTIONS
+****************************************************************************/
+
+gchar* 
+document_interface_rectangle (DocumentInterface *object, int x, int y, 
+                              int width, int height, GError **error)
+{
+
+
+    Inkscape::XML::Node *newNode = dbus_create_node(object->desk, TRUE);
+    sp_repr_set_int(newNode, "x", x);  //could also use newNode->setAttribute()
+    sp_repr_set_int(newNode, "y", y);
+    sp_repr_set_int(newNode, "width", width);
+    sp_repr_set_int(newNode, "height", height);
+    return finish_create_shape (object, error, newNode, (gchar *)"create rectangle");
+}
+
+gchar*
+document_interface_ellipse_center (DocumentInterface *object, int cx, int cy, 
+                                   int rx, int ry, GError **error)
+{
+    Inkscape::XML::Node *newNode = dbus_create_node(object->desk, FALSE);
+    newNode->setAttribute("sodipodi:type", "arc");
+    sp_repr_set_int(newNode, "sodipodi:cx", cx);
+    sp_repr_set_int(newNode, "sodipodi:cy", cy);
+    sp_repr_set_int(newNode, "sodipodi:rx", rx);
+    sp_repr_set_int(newNode, "sodipodi:ry", ry);
+    return finish_create_shape (object, error, newNode, (gchar *)"create circle");
+}
+
+gchar* 
+document_interface_polygon (DocumentInterface *object, int cx, int cy, 
+                            int radius, int rotation, int sides, 
+                            GError **error)
+{
+    gdouble rot = ((rotation / 180.0) * 3.14159265) - ( 3.14159265 / 2.0);
+    Inkscape::XML::Node *newNode = dbus_create_node(object->desk, FALSE);
+    newNode->setAttribute("inkscape:flatsided", "true");
+    newNode->setAttribute("sodipodi:type", "star");
+    sp_repr_set_int(newNode, "sodipodi:cx", cx);
+    sp_repr_set_int(newNode, "sodipodi:cy", cy);
+    sp_repr_set_int(newNode, "sodipodi:r1", radius);
+    sp_repr_set_int(newNode, "sodipodi:r2", radius);
+    sp_repr_set_int(newNode, "sodipodi:sides", sides);
+    sp_repr_set_int(newNode, "inkscape:randomized", 0);
+    sp_repr_set_svg_double(newNode, "sodipodi:arg1", rot);
+    sp_repr_set_svg_double(newNode, "sodipodi:arg2", rot);
+    sp_repr_set_svg_double(newNode, "inkscape:rounded", 0);
+
+    return finish_create_shape (object, error, newNode, (gchar *)"create polygon");
+}
+
+gchar* 
+document_interface_star (DocumentInterface *object, int cx, int cy, 
+                         int r1, int r2, int sides, gdouble rounded,
+                         gdouble arg1, gdouble arg2, GError **error)
+{
+    Inkscape::XML::Node *newNode = dbus_create_node(object->desk, FALSE);
+    newNode->setAttribute("inkscape:flatsided", "false");
+    newNode->setAttribute("sodipodi:type", "star");
+    sp_repr_set_int(newNode, "sodipodi:cx", cx);
+    sp_repr_set_int(newNode, "sodipodi:cy", cy);
+    sp_repr_set_int(newNode, "sodipodi:r1", r1);
+    sp_repr_set_int(newNode, "sodipodi:r2", r2);
+    sp_repr_set_int(newNode, "sodipodi:sides", sides);
+    sp_repr_set_int(newNode, "inkscape:randomized", 0);
+    sp_repr_set_svg_double(newNode, "sodipodi:arg1", arg1);
+    sp_repr_set_svg_double(newNode, "sodipodi:arg2", arg2);
+    sp_repr_set_svg_double(newNode, "inkscape:rounded", rounded);
+
+    return finish_create_shape (object, error, newNode, (gchar *)"create star");
+}
+
+gchar* 
+document_interface_ellipse (DocumentInterface *object, int x, int y, 
+                            int width, int height, GError **error)
+{
+    int rx = width/2;
+    int ry = height/2;
+    return document_interface_ellipse_center (object, x+rx, y+ry, rx, ry, error);
+}
+
+gchar* 
+document_interface_line (DocumentInterface *object, int x, int y, 
+                              int x2, int y2, GError **error)
+{
+    Inkscape::XML::Node *newNode = dbus_create_node(object->desk, FALSE);
+    std::stringstream out;
+    printf("X2: %d\nY2 %d\n", x2, y2);
+       out << "m " << x << "," << y << " " << x2 << "," << y2;
+    printf ("PATH: %s\n", out.str().c_str());
+    newNode->setAttribute("d", out.str().c_str());
+    return finish_create_shape (object, error, newNode, (gchar *)"create line");
+}
+
+gchar* 
+document_interface_spiral (DocumentInterface *object, int cx, int cy, 
+                           int r, int revolutions, GError **error)
+{
+    Inkscape::XML::Node *newNode = dbus_create_node(object->desk, FALSE);
+    newNode->setAttribute("sodipodi:type", "spiral");
+    sp_repr_set_int(newNode, "sodipodi:cx", cx);
+    sp_repr_set_int(newNode, "sodipodi:cy", cy);
+    sp_repr_set_int(newNode, "sodipodi:radius", r);
+    sp_repr_set_int(newNode, "sodipodi:revolution", revolutions);
+    sp_repr_set_int(newNode, "sodipodi:t0", 0);
+    sp_repr_set_int(newNode, "sodipodi:argument", 0);
+    sp_repr_set_int(newNode, "sodipodi:expansion", 1);
+    gchar * retval = finish_create_shape (object, error, newNode, (gchar *)"create spiral");
+    newNode->setAttribute("style", "fill:none");
+    return retval;
+}
+
+gchar* 
+document_interface_text (DocumentInterface *object, gchar *text, GError **error)
+{
+    return NULL;
+}
+
+gchar* 
+document_interface_node (DocumentInterface *object, gchar *type, GError **error)
+{
+    return NULL;
+}
+
+/****************************************************************************
+     ENVIORNMENT FUNCTIONS
+****************************************************************************/
+gdouble
+document_interface_document_get_width (DocumentInterface *object)
+{
+    return sp_document_width(sp_desktop_document(object->desk));
+}
+
+gdouble
+document_interface_document_get_height (DocumentInterface *object)
+{
+    return sp_document_height(sp_desktop_document(object->desk));
+}
+
+gchar *
+document_interface_document_get_css (DocumentInterface *object, GError **error)
+{
+    SPCSSAttr *current = (object->desk)->current;
+    return sp_repr_css_write_string(current);
+}
+
+gboolean 
+document_interface_document_merge_css (DocumentInterface *object,
+                                       gchar *stylestring, GError **error)
+{
+    return FALSE;
+}
+
+gboolean 
+document_interface_document_set_css (DocumentInterface *object,
+                                     gchar *stylestring, GError **error)
+{
+    return FALSE;
+}
+
+gboolean 
+document_interface_document_resize_to_fit_selection (DocumentInterface *object,
+                                                     GError **error)
+{
+    return FALSE;
+}
+
+/****************************************************************************
+     OBJECT FUNCTIONS
+****************************************************************************/
+
+gboolean
+document_interface_set_attribute (DocumentInterface *object, char *shape, 
+                                  char *attribute, char *newval, GError **error)
+{
+    Inkscape::XML::Node *newNode = get_object_by_name(object->desk, shape)->repr;
+
+    /* ALTERNATIVE
+    Inkscape::XML::Node *repr2 = sp_repr_lookup_name((doc->root)->repr, name);
+    */
+    if (newNode)
+    {
+        newNode->setAttribute(attribute, newval, TRUE);
+        return TRUE;
+    }
+    return FALSE;
+}
+
+void 
+document_interface_set_int_attribute (DocumentInterface *object, 
+                                      char *shape, char *attribute, 
+                                      int newval, GError **error)
+{
+    Inkscape::XML::Node *newNode = get_object_by_name (object->desk, shape)->repr;
+    if (newNode)
+        sp_repr_set_int (newNode, attribute, newval);
+}
+
+
+void 
+document_interface_set_double_attribute (DocumentInterface *object, 
+                                         char *shape, char *attribute, 
+                                         double newval, GError **error)
+{
+    Inkscape::XML::Node *newNode = get_object_by_name (object->desk, shape)->repr;
+    if (newNode)
+        sp_repr_set_svg_double (newNode, attribute, newval);
+}
+
+gchar *
+document_interface_get_attribute (DocumentInterface *object, char *shape, 
+                                  char *attribute, GError **error)
+{
+    SPDesktop *desk2 = object->desk;
+    SPDocument * doc = sp_desktop_document (desk2);
+
+    // FIXME: Not sure if this is the most efficient way.
+    Inkscape::XML::Node *newNode = doc->getObjectById(shape)->repr;
+
+    /* WORKS
+    Inkscape::XML::Node *repr2 = sp_repr_lookup_name((doc->root)->repr, name);
+    */
+    if (newNode)
+        return g_strdup(newNode->attribute(attribute));
+    return FALSE;
+}
+
+gboolean
+document_interface_move (DocumentInterface *object, gchar *name, gdouble x, 
+                         gdouble y, GError **error)
+{
+    const GSList *oldsel = selection_swap(object->desk, name);
+    sp_selection_move (object->desk, x, 0 - y);
+    selection_restore(object->desk, oldsel);
+    return TRUE;
+}
+
+gboolean
+document_interface_move_to (DocumentInterface *object, gchar *name, gdouble x, 
+                         gdouble y, GError **error)
+{
+    const GSList *oldsel = selection_swap(object->desk, name);
+    Inkscape::Selection * sel = sp_desktop_selection(object->desk);
+    sp_selection_move (object->desk, x - selection_get_center_x(sel),
+                                     0 - (y - selection_get_center_y(sel)));
+    selection_restore(object->desk, oldsel);
+    return TRUE;
+}
+
+void 
+document_interface_object_to_path (DocumentInterface *object, 
+                                   char *shape, GError **error)
+{
+    const GSList *oldsel = selection_swap(object->desk, shape);
+    dbus_call_verb (object, SP_VERB_OBJECT_TO_CURVE, error);
+    selection_restore(object->desk, oldsel);
+}
+
+gboolean
+document_interface_get_path (DocumentInterface *object, char *pathname, GError **error)
+{
+    Inkscape::XML::Node *node = document_retrive_node (sp_desktop_document (object->desk), pathname);
+    if (node == NULL || node->attribute("d") == NULL) {
+        g_set_error(error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION, "Object is not a path or does not exist.");
+        return FALSE;
+    }
+    gchar *pathstr = strdup(node->attribute("d"));
+    printf("PATH: %s\n", pathstr);
+    //gfree (pathstr);
+    std::istringstream iss(pathstr);
+    std::copy(std::istream_iterator<std::string>(iss),
+             std::istream_iterator<std::string>(),
+             std::ostream_iterator<std::string>(std::cout, "\n"));
+
+    return TRUE;
+}
+
+gboolean 
+document_interface_transform (DocumentInterface *object, gchar *shape,
+                              gchar *transformstr, GError **error)
+{
+    //FIXME: This should merge transformations.
+    gchar trans[] = "transform";
+    document_interface_set_attribute (object, shape, trans, transformstr, error);
+    return TRUE;
+}
+
+gchar *
+document_interface_get_css (DocumentInterface *object, gchar *shape,
+                            GError **error)
+{
+return NULL;
+}
+
+gboolean 
+document_interface_modify_css (DocumentInterface *object, gchar *shape,
+                               gchar *cssattrb, gchar *newval, GError **error)
+{
+    return FALSE;
+}
+
+gboolean 
+document_interface_merge_css (DocumentInterface *object, gchar *shape,
+                               gchar *stylestring, GError **error)
+{
+    return FALSE;
+}
+
+gboolean 
+document_interface_move_to_layer (DocumentInterface *object, gchar *shape, 
+                              gchar *layerstr, GError **error)
+{
+    return FALSE;
+}
+
+DBUSPoint ** 
+document_interface_get_node_coordinates (DocumentInterface *object, gchar *shape)
+{
+    return NULL;
+}
+
+
+/****************************************************************************
+     FILE I/O FUNCTIONS
+****************************************************************************/
+
+gboolean 
+document_interface_save (DocumentInterface *object, GError **error){
+    return FALSE;
+}
+
+gboolean 
+document_interface_load (DocumentInterface *object, 
+                        gchar *filename, GError **error){
+    return FALSE;
+}
+
+gboolean 
+document_interface_save_as (DocumentInterface *object, 
+                           gchar *filename, GError **error){
+    return FALSE;
+}
+
+gboolean 
+document_interface_print (DocumentInterface *object, GError **error){
+    return FALSE;
+}
+
+/****************************************************************************
+     PROGRAM CONTROL FUNCTIONS
+****************************************************************************/
+
+gboolean
+document_interface_close (DocumentInterface *object, GError **error){
+    return dbus_call_verb (object, SP_VERB_FILE_CLOSE_VIEW, error);
+}
+
+gboolean
+document_interface_exit (DocumentInterface *object, GError **error){
+    return dbus_call_verb (object, SP_VERB_FILE_QUIT, error);
+}
+
+gboolean
+document_interface_undo (DocumentInterface *object, GError **error){
+    return dbus_call_verb (object, SP_VERB_EDIT_UNDO, error);
+}
+
+gboolean
+document_interface_redo (DocumentInterface *object, GError **error){
+    return dbus_call_verb (object, SP_VERB_EDIT_REDO, error);
+}
+
+
+
+/****************************************************************************
+     UPDATE FUNCTIONS
+****************************************************************************/
+
+void
+document_interface_pause_updates (DocumentInterface *object, GError **error)
+{
+    object->updates = FALSE;
+    sp_desktop_document(object->desk)->root->uflags = FALSE;
+    sp_desktop_document(object->desk)->root->mflags = FALSE;
+}
+
+void
+document_interface_resume_updates (DocumentInterface *object, GError **error)
+{
+    object->updates = TRUE;
+    sp_desktop_document(object->desk)->root->uflags = TRUE;
+    sp_desktop_document(object->desk)->root->mflags = TRUE;
+    //sp_desktop_document(object->desk)->_updateDocument();
+    sp_document_done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions");
+}
+
+void
+document_interface_update (DocumentInterface *object, GError **error)
+{
+    sp_desktop_document(object->desk)->root->uflags = TRUE;
+    sp_desktop_document(object->desk)->root->mflags = TRUE;
+    sp_desktop_document(object->desk)->_updateDocument();
+    sp_desktop_document(object->desk)->root->uflags = FALSE;
+    sp_desktop_document(object->desk)->root->mflags = FALSE;
+    //sp_document_done(sp_desktop_document(object->desk), SP_VERB_CONTEXT_RECT, "Multiple actions");
+}
+
+/****************************************************************************
+     SELECTION FUNCTIONS FIXME: use call_verb where appropriate.
+****************************************************************************/
+
+gchar **
+document_interface_selection_get (DocumentInterface *object)
+{
+    Inkscape::Selection * sel = sp_desktop_selection(object->desk);
+    GSList const *oldsel = sel->list();
+
+    int size = g_slist_length((GSList *) oldsel);
+    int i;
+    printf("premalloc\n");
+    gchar **list = (gchar **)malloc(size);
+        printf("postmalloc\n");
+    for(i = 0; i < size; i++)
+        list[i] = (gchar *)malloc(sizeof(gchar) * 10);
+        printf("postmalloc2\n");
+    i=0;
+        printf("prealloc\n");
+    for (GSList const *iter = oldsel; iter != NULL; iter = iter->next) {
+        strcpy (list[i], SP_OBJECT(iter->data)->repr->attribute("id"));
+        i++;
+    }
+            printf("postalloc\n");
+    for (i=0; i<size; i++) {
+        printf("%d = %s\n", i, list[i]);
+    }
+    
+    return list;
+}
+
+gboolean
+document_interface_selection_add (DocumentInterface *object, char *name, GError **error)
+{
+    if (name == NULL) 
+        return FALSE;
+    //FIXME: This gets called a lot.  Efficient? 
+    SPDocument * doc = sp_desktop_document (object->desk);
+    Inkscape::Selection *selection = sp_desktop_selection(object->desk);
+    /* WORKS
+    Inkscape::XML::Node *repr2 = sp_repr_lookup_name((doc->root)->repr, name);
+    selection->add(repr2, TRUE);
+    */
+    selection->add(doc->getObjectById(name));
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_add_list (DocumentInterface *object, 
+                                       char **names, GError **error)
+{
+    return FALSE;
+}
+
+gboolean
+document_interface_selection_set (DocumentInterface *object, char *name, GError **error)
+{
+    SPDocument * doc = sp_desktop_document (object->desk);
+    Inkscape::Selection *selection = sp_desktop_selection(object->desk);
+    selection->set(doc->getObjectById(name));
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_set_list (DocumentInterface *object, 
+                                       gchar **names, GError **error)
+{
+    sp_desktop_selection(object->desk)->clear();
+    int i;
+    for (i=0;((i<30000) && (names[i] != NULL));i++) {
+        printf("NAME: %s\n", names[i]);
+        document_interface_selection_add(object, names[i], error);       
+    }
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_rotate (DocumentInterface *object, int angle, GError **error)
+{
+    Inkscape::Selection *selection = sp_desktop_selection(object->desk);
+    sp_selection_rotate(selection, angle);
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_delete (DocumentInterface *object, GError **error)
+{
+    sp_selection_delete (object->desk);
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_clear (DocumentInterface *object, GError **error)
+{
+    sp_desktop_selection(object->desk)->clear();
+    return TRUE;
+}
+
+gboolean
+document_interface_select_all (DocumentInterface *object, GError **error)
+{
+    sp_edit_select_all (object->desk);
+    return TRUE;
+}
+
+gboolean
+document_interface_select_all_in_all_layers(DocumentInterface *object, 
+                                            GError **error)
+{
+    sp_edit_select_all_in_all_layers (object->desk);
+}
+
+gboolean
+document_interface_selection_box (DocumentInterface *object, int x, int y,
+                                  int x2, int y2, gboolean replace, 
+                                  GError **error)
+{
+    return FALSE;
+}
+
+gboolean
+document_interface_selection_invert (DocumentInterface *object, GError **error)
+{
+    sp_edit_invert (object->desk);
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_group (DocumentInterface *object, GError **error)
+{
+    sp_selection_group (object->desk);
+    return TRUE;
+}
+gboolean
+document_interface_selection_ungroup (DocumentInterface *object, GError **error)
+{
+    sp_selection_ungroup (object->desk);
+    return TRUE;
+}
+gboolean
+document_interface_selection_cut (DocumentInterface *object, GError **error)
+{
+    sp_selection_cut (object->desk);
+    return TRUE;
+}
+gboolean
+document_interface_selection_copy (DocumentInterface *object, GError **error)
+{
+    desktop_ensure_active (object->desk);
+    sp_selection_copy ();
+    return TRUE;
+}
+gboolean
+document_interface_selection_paste (DocumentInterface *object, GError **error)
+{
+    desktop_ensure_active (object->desk);
+    sp_selection_paste (object->desk, TRUE);
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_scale (DocumentInterface *object, gdouble grow, GError **error)
+{
+    Inkscape::Selection *selection = sp_desktop_selection(object->desk);
+    sp_selection_scale (selection, grow);
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_move (DocumentInterface *object, gdouble x, gdouble y, GError **error)
+{
+    sp_selection_move (object->desk, x, 0 - y); //switching coordinate systems.
+    return TRUE;
+}
+
+gboolean
+document_interface_selection_move_to (DocumentInterface *object, gdouble x, gdouble y, GError **error)
+{
+    Inkscape::Selection * sel = sp_desktop_selection(object->desk);
+
+    Geom::OptRect sel_bbox = sel->bounds();
+    if (sel_bbox) {
+        //Geom::Point m( (object->desk)->point() - sel_bbox->midpoint() );
+        Geom::Point m( x - selection_get_center_x(sel) , 0 - (y - selection_get_center_y(sel)) );
+        sp_selection_move_relative(sel, m, true);
+
+    }
+
+    //FIXME: dosn't work with transformations
+    //sp_selection_move (object->desk, x - selection_get_center_x(sel),
+    //                                 0 - (y - selection_get_center_y(sel)));
+    return TRUE;
+}
+
+gboolean 
+document_interface_selection_move_to_layer (DocumentInterface *object,
+                                            gchar *layerstr, GError **error)
+{
+    return FALSE;
+}
+
+gboolean 
+document_interface_selection_get_center (DocumentInterface *object)
+{
+    return FALSE;
+}
+
+gboolean 
+document_interface_selection_to_path (DocumentInterface *object, GError **error)
+{
+    return dbus_call_verb (object, SP_VERB_OBJECT_TO_CURVE, error);    
+}
+
+
+gchar *
+document_interface_selection_combine (DocumentInterface *object, gchar *cmd,
+                                      GError **error)
+{
+
+    if (strcmp(cmd, "union") == 0)
+        dbus_call_verb (object, SP_VERB_SELECTION_UNION, error);
+    else if (strcmp(cmd, "intersection") == 0)
+        dbus_call_verb (object, SP_VERB_SELECTION_INTERSECT, error);
+    else if (strcmp(cmd, "difference") == 0)
+        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 if (strcmp(cmd, "division") == 0)
+        dbus_call_verb (object, SP_VERB_SELECTION_CUT, error);
+    else
+        return NULL;
+
+    //FIXME: this WILL cause problems with division
+    return g_strdup((sp_desktop_selection(object->desk)->singleRepr())->attribute("id"));
+}
+
+gboolean
+document_interface_selection_change_level (DocumentInterface *object, gchar *cmd,
+                                      GError **error)
+{
+    if (strcmp(cmd, "raise") == 0)
+        return dbus_call_verb (object, SP_VERB_SELECTION_RAISE, error);
+    if (strcmp(cmd, "lower") == 0)
+        return dbus_call_verb (object, SP_VERB_SELECTION_LOWER, error);
+    if ((strcmp(cmd, "to_top") == 0) || (strcmp(cmd, "to_front") == 0))
+        return dbus_call_verb (object, SP_VERB_SELECTION_TO_FRONT, error);
+    if ((strcmp(cmd, "to_bottom") == 0) || (strcmp(cmd, "to_back") == 0))
+        return dbus_call_verb (object, SP_VERB_SELECTION_TO_BACK, error);
+    return TRUE;
+}
+
+/****************************************************************************
+     LAYER FUNCTIONS
+****************************************************************************/
+
+gchar *
+document_interface_layer_new (DocumentInterface *object, GError **error)
+{
+    SPDesktop * dt = object->desk;
+    SPObject *new_layer = Inkscape::create_layer(dt->currentRoot(), dt->currentLayer(), Inkscape::LPOS_BELOW);
+    dt->setCurrentLayer(new_layer);
+    return g_strdup(get_name_from_object (new_layer));
+}
+
+gboolean 
+document_interface_layer_set (DocumentInterface *object,
+                              gchar *layerstr, GError **error)
+{
+    object->desk->setCurrentLayer (get_object_by_name (object->desk, layerstr));
+    return TRUE;
+}
+
+gchar **
+document_interface_layer_get_all (DocumentInterface *object)
+{
+    return NULL;
+}
+
+gboolean 
+document_interface_layer_change_level (DocumentInterface *object,
+                                       gchar *cmd, GError **error)
+{
+    if (strcmp(cmd, "raise") == 0)
+        return dbus_call_verb (object, SP_VERB_LAYER_RAISE, error);
+    if (strcmp(cmd, "lower") == 0)
+        return dbus_call_verb (object, SP_VERB_LAYER_LOWER, error);
+    if ((strcmp(cmd, "to_top") == 0) || (strcmp(cmd, "to_front") == 0))
+        return dbus_call_verb (object, SP_VERB_LAYER_TO_TOP, error);
+    if ((strcmp(cmd, "to_bottom") == 0) || (strcmp(cmd, "to_back") == 0))
+        return dbus_call_verb (object, SP_VERB_LAYER_TO_BOTTOM, error);
+    return TRUE;
+}
+
+gboolean 
+document_interface_layer_next (DocumentInterface *object, GError **error)
+{
+    return dbus_call_verb (object, SP_VERB_LAYER_NEXT, error);
+}
+
+gboolean 
+document_interface_layer_previous (DocumentInterface *object, GError **error)
+{
+    return dbus_call_verb (object, SP_VERB_LAYER_PREV, error);
+}
+
+
+
+
+
+
diff --git a/src/extension/dbus/document-interface.xml b/src/extension/dbus/document-interface.xml
new file mode 100644 (file)
index 0000000..ba8c7e2
--- /dev/null
@@ -0,0 +1,1223 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<node name="/org/inkscape/document"
+  xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"
+>
+
+  <interface name="org.inkscape.document">
+
+    <!-- MISC FUNCTIONS -->
+
+    <method name="delete_all" >
+    </method>
+
+    <method name="call_verb">
+      <arg type="s" name="verbid" direction="in">
+        <doc:doc>
+          <doc:summary>The string id of a verb.  For example: "EditSelectAll".</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method allows you to call any Inkscape verb using it's associated string.  Every button and menu item has an associated verb, so this allows access to some extra functionality if one is willing to do the prerequisite research.  The list of verbs can be found at:</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <!-- CREATION FUNCTIONS -->
+
+    <method name="rectangle">
+      <arg type="i" name="x" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the top left corner of the rectangle.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="y" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the top left corner of the rectangle.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="width" direction="in" >
+        <doc:doc>
+          <doc:summary>Width of the rectangle.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="height" direction="in" >
+        <doc:doc>
+          <doc:summary>Height of the rectangle.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="object_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new rectangle.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method creates a rectangle in the current layer using the current document style.</doc:para>
+          <doc:para>It is recommended that you save the return value if you will want to modify this particular shape later.</doc:para>
+          <doc:para>Additional variables include:</doc:para>
+          <doc:para>cx and cy: set these anywhere from zero to half the width or height respectively of the rectangle to give it rounded corners.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="ellipse">
+      <arg type="i" name="x" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the top left corner of the ellipse.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="y" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the top left corner of the ellipse.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="width" direction="in" >
+        <doc:doc>
+          <doc:summary>Width of the ellipse.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="height" direction="in" >
+        <doc:doc>
+          <doc:summary>Height of the ellipse.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="object_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new ellipse.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method creates a ellipse in the current layer using the current document style.</doc:para>
+          <doc:para>It is recommended that you save the return value if you will want to modify this particular shape later.</doc:para>
+          <doc:para>Additional variables include:</doc:para>
+          <doc:para>"sodipodi:start" and "sodipodi:end": set these between 0 and Pi to create wedges or Pacman like shapes.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="polygon">
+      <arg type="i" name="cx" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the center of the polygon.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="cy" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the center of the polygon.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="radius" direction="in" >
+        <doc:doc>
+          <doc:summary>Radius from the center to one of the points.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="rotation" direction="in" >
+        <doc:doc>
+          <doc:summary>Angle in degrees to rotate.  0 will have the first point pointing straight up.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="sides" direction="in" >
+        <doc:doc>
+          <doc:summary>Number of sides of the polygon.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="object_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new polygon.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method creates a polygon in the current layer using the current document style.</doc:para>
+          <doc:para>It is recommended that you save the return value if you will want to modify this particular shape later.</doc:para>
+          <doc:para>Note: this is actually a <doc:ref type="method" to="document.star">star</doc:ref> with "sodipodi:flatsided" set to true, which causes it to ignore the arg2 and r2 values.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="star">
+      <arg type="i" name="cx" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the center of the star.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="cy" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the center of the star.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="r1" direction="in" >
+        <doc:doc>
+          <doc:summary>distance from the center for the first point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="r2" direction="in" >
+        <doc:doc>
+          <doc:summary>distance from the center for the second point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="arg1" direction="in" >
+        <doc:doc>
+          <doc:summary>Angle in radians for the first point.  0 is 90 degrees to the right of straight up.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="arg2" direction="in" >
+        <doc:doc>
+          <doc:summary>Angle in radians for the second point. 0 is 90 degrees to the right of straight up.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="sides" direction="in" >
+        <doc:doc>
+          <doc:summary>Number of times to repeat the points around the star.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="rounded" direction="in" >
+        <doc:doc>
+          <doc:summary>How rounded to make the star.  0 to 1 recommended for moderate to medium curves.  10 for extreme curves.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="object_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new star.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method creates a star in the current layer using the current document style.</doc:para>
+          <doc:para>It is recommended that you save the return value if you will want to modify this particular shape later.</doc:para>
+          <doc:para>Stars are quite complicated.  Here is how they are represented:  There are two points, represented by sodipodi:arg1 and sodipodi:arg2 for angle in radians and sodipodi:r1 and sodipodi:r2 for respective radius from the center point.  The further one is a point of the star, the shorter one one of the valleys.  This point and valley are repeated according to sodipodi:sides.  sodipodi:rounded controls their control handles.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="spiral">
+      <arg type="i" name="cx" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the center of the spiral.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="cy" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the center of the spiral.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="r" direction="in" >
+        <doc:doc>
+          <doc:summary>Radius of the spiral.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="revolutions" direction="in" >
+        <doc:doc>
+          <doc:summary>Number of revolutions.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="object_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new spiral.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method creates a spiral in the current layer using the current document style.  However, fill is automatically set to "none".  Stroke is unmodified.</doc:para>
+          <doc:para>It is recommended that you save the return value if you will want to modify this particular shape later.</doc:para>
+          <doc:para>Additional variables include:</doc:para>
+          <doc:para>"sodipodi:expansion": at 1 the spiral gets bigger at a constant rate.  Less than one and the loops get tighter and tighter as it goes.  More than one and they get looser and looser.  This affects the number of revolutions so that it might not actually match the "sodipodi:revolutions" argument.</doc:para>
+          <doc:para>"sodipodi:t0": at 0 the entire spiral is drawn, at 0.5 it is only drawn %50 of the way (starting from the outside) etc.</doc:para>
+          <doc:para>"sodipodi:argument": Rotates the spiral.  In radians.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="line">
+      <arg type="i" name="x" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the first point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="y" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the first point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="x2" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the second point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="y2" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the second point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="object_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new line.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method creates a line in the current layer using the current document style.  It's a path, so the only attribute it will pay any attention to is "transform".</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="text">
+      <arg type="s" name="text" direction="in" >
+        <doc:doc>
+          <doc:summary>The text you want.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="object_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new text object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method creates some text in the current layer.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="node">
+      <arg type="s" name="svgtype" direction="in" >
+        <doc:doc>
+          <doc:summary>The type of node, probably "svg:path"</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="node_name" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new node.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Make any kind of node you want.  Mostly for making paths.  (May need to allow updateRepr to be called for it to show up.)</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <!-- ENVIRONMENT FUNCTIONS -->
+
+    <method name="document_get_width">
+      <arg type="d" name="val" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
+        <doc:doc>
+          <doc:summary>Document width.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Retrieve the width of the current document. anything outside the boundary will not be printed or exported but will be saved.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="document_get_height">
+      <arg type="d" name="val" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
+        <doc:doc>
+          <doc:summary>Document height.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Retrieve the height of the current document. anything outside the boundary will not be printed or exported but will be saved.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="document_get_css">
+      <arg type="s" name="css" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>CSS attribute string for the document.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Get the current style for the document.  All new shapes will use this style if it exists.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Style Strings">Style Strings</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="document_set_css">
+      <arg type="s" name="stylestring" direction="in" >
+        <doc:doc>
+          <doc:summary>A new CSS attribute string for the document.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Set the current style for the document.  All new shapes will use this style if it exists.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Style Strings">Style Strings</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="document_merge_css">
+      <arg type="s" name="stylestring" direction="in" >
+        <doc:doc>
+          <doc:summary>A new CSS attribute string for the document.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Merge this this string with the current style for the document.  All new shapes will use this style if it exists.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Style Strings">Style Strings</doc:ref>, <doc:ref type="method" to="document.merge_css">merge_css()</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="document_resize_to_fit_selection">
+      <doc:doc>
+        <doc:description>
+          <doc:para>Resize the document to contain all of the currently selected objects.</doc:para>
+          <doc:para>This ensures that the image is not clipped when printing or exporting.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <!-- OBJECT FUNCTIONS -->
+
+    <method name="set_attribute">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of an object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="attribute" direction="in" >
+        <doc:doc>
+          <doc:summary>The name of the attribute.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="newval" direction="in" >
+        <doc:doc>
+          <doc:summary>The new value of the attribute.  This will overwrite anything already set.  To merge styles, see <doc:ref type="method" to="document.merge_css">merge_css()</doc:ref>. </doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Set any attribute, the available attributes depend on what kind of shape the object node represents.  See <doc:ref type="method" to="document.rectangle">shape creation functions</doc:ref> for more details.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="set_int_attribute">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of an object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="attribute" direction="in" >
+        <doc:doc>
+          <doc:summary>The name of the attribute.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="newval" direction="in" >
+        <doc:doc>
+          <doc:summary>The new value of the attribute.  This will overwrite anything already set.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Set any attribute, the available attributes depend on what kind of shape the object node represents.  See <doc:ref type="method" to="document.rectangle">shape creation functions</doc:ref> for more details.</doc:para>
+          <doc:para>This is a convenience function for <doc:ref type="method" to="document.set_attribute">set_attribute()</doc:ref>.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="set_double_attribute">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of an object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="attribute" direction="in" >
+        <doc:doc>
+          <doc:summary>The name of the attribute.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="newval" direction="in" >
+        <doc:doc>
+          <doc:summary>The new value of the attribute.  This will overwrite anything already set.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Set any attribute, the available attributes depend on what kind of shape the node represents.  See <doc:ref type="method" to="document.rectangle">shape creation functions</doc:ref> for more details.</doc:para>
+          <doc:para>This is a convenience function for <doc:ref type="method" to="document.set_attribute">set_attribute()</doc:ref>.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="get_attribute">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of an object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="attribute" direction="in" >
+        <doc:doc>
+          <doc:summary>The name of the attribute.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="val" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The current value of the attribute.  String is a copy and must be freed.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Get the value of any attribute.  Not all objects will have every attribute their type supports, some are optional.   See <doc:ref type="method" to="document.rectangle">shape creation functions</doc:ref> for more details.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="move">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of an object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="x" direction="in" >
+        <doc:doc>
+          <doc:summary>Distance to move along the x axis.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="y" direction="in" >
+        <doc:doc>
+          <doc:summary>Distance to move along the y axis.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This will move a shape (or any object) relative to it's current location.</doc:para>
+          <doc:para>This may be accomplished with transformation attributes or by changing x and y attributes depending on the state of the object.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="move_to">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of an object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="x" direction="in" >
+        <doc:doc>
+          <doc:summary>the x coordinate of the desired location.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="y" direction="in" >
+        <doc:doc>
+          <doc:summary>the y coordinate of the desired location.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This will move a shape (or any object) to an absolute location.  The point moved is the center of the bounding box, which is usually similar to the center of the shape.</doc:para>
+          <doc:para>Note that creating a rectangle or ellipse at 100,100 and calling move_to to move it to 100,100 will not produce the same results.</doc:para>
+          <doc:para>This may be accomplished with transformation attributes or by changing x and y attributes depending on the state of the object.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="object_to_path">
+      <arg type="s" name="objectname" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of an object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Turns an object into a path.  Most objects contain paths (except rectangles) but are not paths themselves. </doc:para>
+          <doc:para>This will remove every attribute except d (the path attribute) style and id.  id will not change.  The appearance will be the same as well, it essentially encodes all information about the shape into the path.</doc:para>
+          <doc:para>After doing this you will no longer be able to modify the shape using shape specific attributes (cx, radius etc.) except transform</doc:para>
+          <doc:para>Required for certain functions that work on paths (not yet present in this API.)</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="transform">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of any node or object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="transformstr" direction="in" >
+        <doc:doc>
+          <doc:summary>A string that represents a transformation.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Takes a transformation string ("matrix(0.96629885,0.25742286,-0.25742286,0.96629885,0,0)" or "rotate(45)") and applies it to any shape or path.</doc:para>
+          <doc:para>Will merge with existing transformations.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="get_css">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>Any object with a style attribute.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="css" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>A CSS Style string</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Retrieve the style of a object.  Equivalent to calling <doc:ref type="method" to="document.get_attribute">get_attribute()</doc:ref> for "style".</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Style Strings">Style Strings</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="modify_css">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>Any object with a style attribute.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="cssattrib" direction="in" >
+        <doc:doc>
+          <doc:summary>An attribute such as "fill" or "stroke-width".</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="newval" direction="in" >
+        <doc:doc>
+          <doc:summary>The new value.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Set a particular attribute of a style string.  Overwrites just that part of the style.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Style Strings">Style Strings</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="merge_css">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>Any object with a style attribute.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="stylestring" direction="in" >
+        <doc:doc>
+          <doc:summary>A full or partial CSS Style string.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Takes a CSS Style string and merges it with the objects current style, overwriting only the elements present in stylestring.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Style Strings">Style Strings</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="move_to_layer">
+      <arg type="s" name="objectname" direction="in" >
+        <doc:doc>
+          <doc:summary>The id of an object.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="layername" direction="in" >
+        <doc:doc>
+          <doc:summary>A layer name.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Moves an object to a different layer.</doc:para>
+          <doc:para>Will error if layer does not exist.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="document.layer_new">layer_new()</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="get_node_coordinates">
+      <arg type="s" name="shape" direction="in" >
+        <doc:doc>
+          <doc:summary>A object that contains a path ("d") attribute.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="a(ii)" name="points" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
+        <doc:doc>
+          <doc:summary>An array of points.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Returns an array of all of the X,Y coordinates of the points in the objects path.</doc:para>
+          <doc:para>If the path is a closed loop the first point is repeated at the end.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <!-- FILE I/O FUNCTIONS -->
+
+    <method name="save" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Saves the current document with current name or a default name if has not been saved before.</doc:para>
+          <doc:para>Will overwrite without confirmation.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="save_as">
+      <arg type="s" name="pathname" direction="in" >
+        <doc:doc>
+          <doc:summary>The path for the file to be saved as.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Saves the current document as pathname.</doc:para>
+          <doc:para>Will overwrite without confirmation.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="load">
+      <arg type="s" name="pathname" direction="in" >
+        <doc:doc>
+          <doc:summary>The path to a valid svg file.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Loads the file at pathname.</doc:para>
+          <doc:para>Will lose all unsaved work in current document.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="print" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Prints the current document with default settings.</doc:para>
+          <doc:para>Will only print things visible within the document boundaries.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="document.document_resize_to_fit_selection">document_resize_to_fit_selection()</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <!-- PROGRAM CONTROL FUNCTIONS -->
+
+    <method name="close" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Close this document.</doc:para>
+          <doc:para>You will not be able to send any more commands on this interface.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="exit" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Exit Inkscape.</doc:para>
+          <doc:para>You will not be able to send any more commands on any interface.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="undo" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Undo the last action.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="redo" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Redo the last undone action.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <!-- UPDATE FUNCTIONS -->
+
+    <method name="pause_updates" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>When updates are paused Inkscape will not draw every change as it is made.  Also you will not be able to undo individual actions made while updates were paused and will only be able to undo them in a group.  Inkscape may refresh the screen every couple of seconds even with updates off.</doc:para>
+          <doc:para>The advantage is a 2-5x speed increase, depending on the type of functions being called.  This is most useful when creating large numbers of shapes.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="resume_updates" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Resume updates after they have been paused.  If undo is called at this point it will undo everything that happened since pause_updates() was called.</doc:para>
+          <doc:para>This will update the display to show any changes that happened while updates were paused, a separate call to update() is not necessary.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="update" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>This will update the document once if updates are paused but it will not resume updates.</doc:para>
+          <doc:para>This could be used to check on the progress of a complex drawing function, or to add in undo steps at certain points in a render.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <!-- SELECTION FUNCTIONS -->
+
+    <method name="selection_get">
+      <arg type="as" name="list" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
+        <doc:doc>
+          <doc:summary>List of the ids of currently selected objects.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Returns the current selection in the form of a list of ids of selected objects.</doc:para>
+          <doc:para>Manipulating this list will not affect the selection.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_add">
+      <arg type="s" name="name" direction="in" >
+        <doc:doc>
+          <doc:summary>A object to add to the selection.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Adds a single object to the selection.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_add_list">
+      <arg type="as" name="name" direction="in" >
+        <doc:doc>
+          <doc:summary>An array of object ids to add to the selection.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Adds a list of objects to the selection.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_set">
+      <arg type="s" name="name" direction="in" >
+        <doc:doc>
+          <doc:summary>A object to select.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Replaces the selection with one containing just this object.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_set_list">
+      <arg type="as" name="name" direction="in" >
+        <doc:doc>
+          <doc:summary>A list of objects to select.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Replaces the selection with one containing just these objects.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_rotate">
+      <arg type="i" name="angle" direction="in" >
+        <doc:doc>
+          <doc:summary>Angle in degrees to rotate.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Rotates the selection around the center of it's bounding box.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_delete" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Delete all objects in the selection.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_clear" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Deselect everything.  Selection will be empty.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="select_all" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Select all objects in current layer.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="select_all_in_all_layers" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Select all objects in every layer.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_box">
+      <arg type="i" name="x" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the first point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="y" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the first point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="x2" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate for the second point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="i" name="y2" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate for the second point.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="b" name="replace" direction="in" >
+        <doc:doc>
+          <doc:summary>True to replace selection, false to add to selection.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This method finds all of the objects inside the box and adds them to the current selection.  If replace is true it will clear the old selection first.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_invert" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Invert the selection in the current layer.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_group" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Group the selection.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Groups">Groups</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="selection_ungroup" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Ungroup the selection.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Groups">Groups</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="selection_cut" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Cut the current selection.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_copy" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Copy the current selection.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_paste" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Paste the current selection at the same location it was cut from.</doc:para>
+          <doc:para>To paste to a particular location, simply use selection_paste() followed by <doc:ref type="method" to="document.selection_move_to">selection_move_to()</doc:ref>.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_scale">
+      <arg type="d" name="grow" direction="in" >
+        <doc:doc>
+          <doc:summary>The amount to scale the selection, 1 has no effect. Between 0 and 1 will shrink it proportionally.  Greater than one will grow it proportionally.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Scale the selection relative to it's current size.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_move">
+      <arg type="d" name="x" direction="in" >
+        <doc:doc>
+          <doc:summary>Amount to move in the x direction.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="y" direction="in" >
+        <doc:doc>
+          <doc:summary>Amount to move in the y direction.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This will move the selection relative to it's current location.</doc:para>
+          <doc:para>This may be accomplished with transformation attributes or by changing x and y attributes depending on the state of the objects in the selection.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="selection_move_to">
+      <arg type="d" name="x" direction="in" >
+        <doc:doc>
+          <doc:summary>X coordinate to move to.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="d" name="y" direction="in" >
+        <doc:doc>
+          <doc:summary>Y coordinate to move to.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>This will move the center of the selection to a specific location.</doc:para>
+          <doc:para>This may be accomplished with transformation attributes or by changing x and y attributes depending on the state of the objects in the selection.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="selection_move_to_layer">
+      <arg type="s" name="layer" direction="in" >
+        <doc:doc>
+          <doc:summary>layer to move the selection to.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Move every item in the selection to a different layer.</doc:para>
+          <doc:para>Will error if layer does not exist.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Layers and Levels">Layers and Levels</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="selection_get_center">
+      <arg type="(ii)" name="centerpoint" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
+        <doc:doc>
+          <doc:summary>Center of the selection.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Gets the center of the selections bounding box in X,Y coordinates.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Coordinate System">Coordinate System</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="selection_to_path" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Turns all the objects in the selection into paths.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="method" to="document.object_to_path">object_to_path()</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="selection_combine" >
+      <arg type="s" name="type" direction="in" >
+        <doc:doc>
+          <doc:summary>Type of combination.</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="s" name="newpath" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The new path created, if there is one.  NULL otherwise.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Will erase all objects in the selection and replace with a single aggregate path.</doc:para>
+          <doc:para>There are 5 types that can be passed in:</doc:para>
+          <doc:para>Union: The new shape is all of the other shapes put together, even if they don't overlap (paths can have multiple non-contiguous areas.)</doc:para>
+          <doc:para>Intersection:  The new shape is composed of the area where ALL the objects in the selection overlap.  If there is no area where all shapes overlap the new shape will be empty.</doc:para>
+          <doc:para>Difference: The area of the second shape is subtracted from the first, only works with two objects.</doc:para>
+          <doc:para>Exclusion: The new shape is the area(s) where none of the objects in the selection overlaped.  Only works with two objects.</doc:para>
+          <doc:para>Division: the first object is split into multiple segments by the second object.  Only works with two objects and if multiple paths result they are grouped and the group id is returned.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="selection_change_level" >
+      <arg type="s" name="command" direction="in" >
+        <doc:doc>
+          <doc:summary>How to change the level</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="b" name="objectsmoved" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>True if the objects changed levels.  False if they don't(if they were already on top when being raised for example.)</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Will change the level of a selection, respective of other objects in the same layer.  Will not affect the overlap of objects in different layers.  Will do nothing if the selection contains objects in multiple layers.</doc:para>
+          <doc:para>There are 4 commands that can be passed in:</doc:para>
+          <doc:para>"raise" or "lower": Move the selection one level up, or one level down.</doc:para>
+          <doc:para>"to_top" of "to_bottom": Move the selection above all other objects or below all other objects.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <!-- LAYER FUNCTIONS -->
+
+    <method name="layer_new">
+      <arg type="s" name="layername" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>The name of the new layer.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Turns all the objects in the selection into paths.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Layers and Levels">Layers and Levels</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="layer_set">
+      <arg type="s" name="layer" direction="in" >
+        <doc:doc>
+          <doc:summary>The name of any layer.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Sets the layer given as the current layer</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Layers and Levels">Layers and Levels</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="layer_get_all">
+      <arg type="as" name="layers" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
+        <doc:doc>
+          <doc:summary>list of layers.</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Get a list of all the layers in this document.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Layers and Levels">Layers and Levels</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="layer_change_level" >
+      <arg type="s" name="command" direction="in" >
+        <doc:doc>
+          <doc:summary>How to change the level</doc:summary>
+        </doc:doc>
+      </arg>
+      <arg type="b" name="layermoved" direction="out" >
+        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
+        <doc:doc>
+          <doc:summary>True if the layer was moved.  False if it was not (if it was already on top when being raised for example.)</doc:summary>
+        </doc:doc>
+      </arg>
+      <doc:doc>
+        <doc:description>
+          <doc:para>Will change the level of a layer, respective of other layers.  Will not affect the relative level of objects within the layer.</doc:para>
+          <doc:para>There are 4 commands that can be passed in:</doc:para>
+          <doc:para>"raise" or "lower": Move the layer one level up, or one level down.</doc:para>
+          <doc:para>"to_top" of "to_bottom": Move the layer above all other layers or below all other layers.</doc:para>
+        </doc:description>
+      </doc:doc>
+    </method>
+
+    <method name="layer_next" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Sets the next (or higher) layer as active.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Layers and Levels">Layers and Levels</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+    <method name="layer_previous" >
+      <doc:doc>
+        <doc:description>
+          <doc:para>Sets the previous (or lower) layer as active.</doc:para>
+        </doc:description>
+        <doc:seealso><doc:ref type="interface" to="Layers and Levels">Layers and Levels</doc:ref></doc:seealso>
+      </doc:doc>
+    </method>
+
+
+  </interface>
+</node>
diff --git a/src/extension/dbus/org.inkscape.service.in b/src/extension/dbus/org.inkscape.service.in
new file mode 100644 (file)
index 0000000..401d2d3
--- /dev/null
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.inkscape
+Exec=/usr/local/bin/inkscape
+