1 /*
2 * This is where the implementation of the DBus based application API lives.
3 * All the methods in here are designed to be called remotly via DBus.
4 * document-interface.cpp has all of the actual manipulation methods.
5 * This interface is just for creating new document interfaces.
6 *
7 * Documentation for these methods is in application-interface.xml
8 * which is the "gold standard" as to how the interface should work.
9 *
10 * Authors:
11 * Soren Berg <Glimmer07@gmail.com>
12 *
13 * Copyright (C) 2009 Soren Berg
14 *
15 * Released under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include "application-interface.h"
19 #include <string.h>
20 #include "dbus-init.h"
22 G_DEFINE_TYPE(ApplicationInterface, application_interface, G_TYPE_OBJECT)
24 static void
25 application_interface_finalize (GObject *object)
26 {
27 G_OBJECT_CLASS (application_interface_parent_class)->finalize (object);
28 }
31 static void
32 application_interface_class_init (ApplicationInterfaceClass *klass)
33 {
34 GObjectClass *object_class;
35 object_class = G_OBJECT_CLASS (klass);
36 object_class->finalize = application_interface_finalize;
37 }
39 static void
40 application_interface_init (ApplicationInterface *object)
41 {
42 }
45 ApplicationInterface *
46 application_interface_new (void)
47 {
48 return (ApplicationInterface*)g_object_new (TYPE_APPLICATION_INTERFACE, NULL);
49 }
51 /****************************************************************************
52 DESKTOP FUNCTIONS
53 ****************************************************************************/
55 gchar*
56 application_interface_desktop_new (ApplicationInterface *object,
57 GError **error)
58 {
59 return (gchar*)Inkscape::Extension::Dbus::init_desktop();
60 }
62 gchar**
63 application_interface_get_desktop_list (ApplicationInterface *object)
64 {
65 return NULL;
66 }
68 gchar*
69 application_interface_get_active_desktop (ApplicationInterface *object,
70 GError **error)
71 {
72 return NULL;
73 }
75 gboolean
76 application_interface_set_active_desktop (ApplicationInterface *object,
77 gchar* document_name,
78 GError **error)
79 {
80 return TRUE;
81 }
83 gboolean
84 application_interface_desktop_close_all (ApplicationInterface *object,
85 GError **error)
86 {
87 return TRUE;
88 }
90 gboolean
91 application_interface_exit (ApplicationInterface *object, GError **error)
92 {
93 return TRUE;
94 }
96 /****************************************************************************
97 DOCUMENT FUNCTIONS
98 ****************************************************************************/
100 gchar* application_interface_document_new (ApplicationInterface *object,
101 GError **error)
102 {
103 return (gchar*)Inkscape::Extension::Dbus::init_document();
104 }
106 gchar**
107 application_interface_get_document_list (ApplicationInterface *object)
108 {
109 return NULL;
110 }
112 gboolean
113 application_interface_document_close_all (ApplicationInterface *object,
114 GError **error)
115 {
116 return TRUE;
117 }
119 /* INTERESTING FUNCTIONS
120 SPDesktop *desktop = SP_ACTIVE_DESKTOP;
121 g_assert(desktop != NULL);
123 SPDocument *doc = sp_desktop_document(desktop);
124 g_assert(doc != NULL);
126 Inkscape::XML::Node *repr = sp_document_repr_root(doc);
127 g_assert(repr != NULL);
128 */