From f24f34bd713c7a26fbb6e13c2a44111223950738 Mon Sep 17 00:00:00 2001 From: Soren Berg Date: Sun, 12 Jul 2009 16:02:09 +0000 Subject: Core Dbus files. 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. (bzr r8254.1.3) --- src/extension/dbus/application-interface.cpp | 112 +++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/extension/dbus/application-interface.cpp (limited to 'src/extension/dbus/application-interface.cpp') diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp new file mode 100644 index 000000000..06e41ecf3 --- /dev/null +++ b/src/extension/dbus/application-interface.cpp @@ -0,0 +1,112 @@ +#include "application-interface.h" +#include +#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); +*/ + -- cgit v1.2.3 From f49ab91f16c96e3e4ed84ea021b54946e7c08006 Mon Sep 17 00:00:00 2001 From: Soren Berg Date: Thu, 13 Aug 2009 20:53:03 +0000 Subject: Made wrapper functions non static. Added lots of documentation. (bzr r8254.1.24) --- src/extension/dbus/application-interface.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/extension/dbus/application-interface.cpp') diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp index 06e41ecf3..b183be93c 100644 --- a/src/extension/dbus/application-interface.cpp +++ b/src/extension/dbus/application-interface.cpp @@ -1,3 +1,20 @@ +/* + * This is where the implementation of the DBus based application API lives. + * All the methods in here are designed to be called remotly via DBus. + * document-interface.cpp has all of the actual manipulation methods. + * This interface is just for creating new document interfaces. + * + * Documentation for these methods is in application-interface.xml + * which is the "gold standard" as to how the interface should work. + * + * Authors: + * Soren Berg + * + * Copyright (C) 2009 Soren Berg + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + #include "application-interface.h" #include #include "dbus-init.h" -- cgit v1.2.3