1 #include "inkscape-dbus-wrapper.h"
2 #include <string.h>
3 #include <stdio.h>
4 #include <stdlib.h>
8 #include "document-client-glue.h"
9 #include <dbus/dbus-glib.h>
10 #include <dbus/dbus.h>
12 // (static.*(\n[^}]*)*(async)+.*(\n[^}]*)*})|typedef void .*;
13 // http://www.josephkahn.com/music/index.xml
15 /* PRIVATE get a connection to the session bus */
16 DBusGConnection *
17 dbus_get_connection() {
18 GError *error = NULL;
19 DBusGConnection *connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
20 if (error) {
21 fprintf(stderr, "Failed to get connection");
22 return NULL;
23 }
24 else
25 return connection;
26 }
28 /* PRIVATE create a proxy object for a bus.*/
29 DBusGProxy *
30 dbus_get_proxy(DBusGConnection *connection) {
31 return dbus_g_proxy_new_for_name (connection,
32 DBUS_SERVICE_DBUS,
33 DBUS_PATH_DBUS,
34 DBUS_INTERFACE_DBUS);
35 }
37 /* PRIVATE register an object on a bus */
38 static gpointer
39 dbus_register_object (DBusGConnection *connection,
40 DBusGProxy *proxy,
41 GType object_type,
42 const DBusGObjectInfo *info,
43 const gchar *path)
44 {
45 GObject *object = (GObject*)g_object_new (object_type, NULL);
46 dbus_g_object_type_install_info (object_type, info);
47 dbus_g_connection_register_g_object (connection, path, object);
48 return object;
49 }
51 /****************************************************************************
52 DOCUMENT INTERFACE CLASS STUFF
53 ****************************************************************************/
55 struct _DocumentInterface {
56 GObject parent;
57 DBusGProxy * proxy;
58 };
60 G_DEFINE_TYPE(DocumentInterface, document_interface, G_TYPE_OBJECT)
62 static void
63 document_interface_finalize (GObject *object)
64 {
65 G_OBJECT_CLASS (document_interface_parent_class)->finalize (object);
66 }
69 static void
70 document_interface_class_init (DocumentInterfaceClass *klass)
71 {
72 GObjectClass *object_class;
73 object_class = G_OBJECT_CLASS (klass);
74 object_class->finalize = document_interface_finalize;
75 }
77 static void
78 document_interface_init (DocumentInterface *object)
79 {
80 object->proxy = NULL;
81 }
84 DocumentInterface *
85 document_interface_new (void)
86 {
87 return (DocumentInterface*)g_object_new (TYPE_DOCUMENT_INTERFACE, NULL);
88 }
90 DocumentInterface *
91 inkscape_desktop_init_dbus ()
92 {
93 DBusGConnection *connection;
94 GError *error;
95 DBusGProxy *proxy;
97 g_type_init ();
99 error = NULL;
100 connection = dbus_g_bus_get (DBUS_BUS_SESSION,
101 &error);
102 if (connection == NULL)
103 {
104 g_printerr ("Failed to open connection to bus: %s\n",
105 error->message);
106 g_error_free (error);
107 exit (1);
108 }
110 proxy = dbus_g_proxy_new_for_name (connection,
111 "org.inkscape",
112 "/org/inkscape/desktop_0",
113 "org.inkscape.document");
115 DocumentInterface * inkdesk = (DocumentInterface *)g_object_new (TYPE_DOCUMENT_INTERFACE, NULL);
116 inkdesk->proxy = proxy;
117 return inkdesk;
118 }
121 //static
122 gboolean
123 inkscape_delete_all (DocumentInterface *doc, GError **error)
124 {
125 DBusGProxy *proxy = doc->proxy;
126 return org_inkscape_document_delete_all (proxy, error);
127 }
129 //static
130 gboolean
131 inkscape_call_verb (DocumentInterface *doc, const char * IN_verbid, GError **error)
132 {
133 DBusGProxy *proxy = doc->proxy;
134 return org_inkscape_document_call_verb(proxy, IN_verbid, error);
135 }
138 //static
139 gchar *
140 inkscape_rectangle (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_width, const gint IN_height, GError **error)
141 {
142 char * OUT_object_name;
143 DBusGProxy *proxy = doc->proxy;
144 org_inkscape_document_rectangle (proxy, IN_x, IN_y, IN_width, IN_height, &OUT_object_name, error);
145 return OUT_object_name;
146 }
148 //static
149 char *
150 inkscape_ellipse (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_width, const gint IN_height, GError **error)
151 {
152 char * OUT_object_name;
153 DBusGProxy *proxy = doc->proxy;
154 org_inkscape_document_ellipse (proxy, IN_x, IN_y, IN_width, IN_height, &OUT_object_name, error);
155 return OUT_object_name;
156 }
158 //static
159 char *
160 inkscape_polygon (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_radius, const gint IN_rotation, const gint IN_sides, GError **error)
161 {
162 char * OUT_object_name;
163 DBusGProxy *proxy = doc->proxy;
164 org_inkscape_document_polygon (proxy, IN_cx, IN_cy, IN_radius, IN_rotation, IN_sides, &OUT_object_name, error);
165 return OUT_object_name;
166 }
168 //static
169 char *
170 inkscape_star (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_r1, const gint IN_r2, const gdouble IN_arg1, const gdouble IN_arg2, const gint IN_sides, const gdouble IN_rounded, GError **error)
171 {
172 char * OUT_object_name;
173 DBusGProxy *proxy = doc->proxy;
174 org_inkscape_document_star (proxy, IN_cx, IN_cy, IN_r1, IN_r2, IN_arg1, IN_arg2, IN_sides, IN_rounded, &OUT_object_name, error);
175 return OUT_object_name;
176 }
178 //static
179 char *
180 inkscape_spiral (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_r, const gint IN_revolutions, GError **error)
181 {
182 char * OUT_object_name;
183 DBusGProxy *proxy = doc->proxy;
184 org_inkscape_document_spiral (proxy, IN_cx, IN_cy, IN_r, IN_revolutions, &OUT_object_name, error);
185 return OUT_object_name;
186 }
188 //static
189 char *
190 inkscape_line (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_x2, const gint IN_y2, GError **error)
191 {
192 char * OUT_object_name;
193 DBusGProxy *proxy = doc->proxy;
194 org_inkscape_document_line (proxy, IN_x, IN_y, IN_x2, IN_y2, &OUT_object_name, error);
195 return OUT_object_name;
196 }
198 //static
199 gboolean
200 inkscape_text (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error)
201 {
202 DBusGProxy *proxy = doc->proxy;
203 return org_inkscape_document_text (proxy, IN_x, IN_y, IN_text, error);
204 }
206 //static
207 char *
208 inkscape_image (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error)
209 {
210 char * OUT_object_name;
211 DBusGProxy *proxy = doc->proxy;
212 org_inkscape_document_image (proxy, IN_x, IN_y, IN_text, &OUT_object_name, error);
213 return OUT_object_name;
214 }
216 //static
217 char *
218 inkscape_node (DocumentInterface *doc, const char * IN_svgtype, GError **error)
219 {
220 char *OUT_node_name;
221 DBusGProxy *proxy = doc->proxy;
222 org_inkscape_document_node (proxy, IN_svgtype, &OUT_node_name, error);
223 return OUT_node_name;
224 }
226 //static
227 gdouble
228 inkscape_document_get_width (DocumentInterface *doc, GError **error)
229 {
230 gdouble OUT_val;
231 DBusGProxy *proxy = doc->proxy;
232 org_inkscape_document_document_document_get_width (proxy, &OUT_val, error);
233 return OUT_val;
234 }
236 //static
237 gdouble
238 inkscape_document_get_height (DocumentInterface *doc, GError **error)
239 {
240 gdouble OUT_val;
241 DBusGProxy *proxy = doc->proxy;
242 org_inkscape_document_document_document_get_height (proxy, &OUT_val, error);
243 return OUT_val;
244 }
246 //static
247 char *
248 inkscape_document_get_css (DocumentInterface *doc, GError **error)
249 {
250 char * OUT_css;
251 DBusGProxy *proxy = doc->proxy;
252 org_inkscape_document_document_document_get_css (proxy, &OUT_css, error);
253 return OUT_css;
254 }
256 //static
257 gboolean
258 inkscape_document_set_css (DocumentInterface *doc, const char * IN_stylestring, GError **error)
259 {
260 DBusGProxy *proxy = doc->proxy;
261 return org_inkscape_document_document_document_set_css (proxy, IN_stylestring, error);
262 }
264 //static
265 gboolean
266 inkscape_document_merge_css (DocumentInterface *doc, const char * IN_stylestring, GError **error)
267 {
268 DBusGProxy *proxy = doc->proxy;
269 return org_inkscape_document_document_document_merge_css (proxy, IN_stylestring, error);
270 }
272 //static
273 gboolean
274 inkscape_document_resize_to_fit_selection (DocumentInterface *doc, GError **error)
275 {
276 DBusGProxy *proxy = doc->proxy;
277 return org_inkscape_document_document_document_resize_to_fit_selection (proxy, error);
278 }
280 //static
281 gboolean
282 inkscape_set_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const char * IN_newval, GError **error)
283 {
284 DBusGProxy *proxy = doc->proxy;
285 return org_inkscape_document_set_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
286 }
288 //static
289 gboolean
290 inkscape_set_int_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gint IN_newval, GError **error)
291 {
292 DBusGProxy *proxy = doc->proxy;
293 return org_inkscape_document_set_int_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
294 }
296 //static
297 gboolean
298 inkscape_set_double_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gdouble IN_newval, GError **error)
299 {
300 DBusGProxy *proxy = doc->proxy;
301 return org_inkscape_document_set_double_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
302 }
304 //static
305 char *
306 inkscape_get_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, GError **error)
307 {
308 char * OUT_val;
309 DBusGProxy *proxy = doc->proxy;
310 org_inkscape_document_get_attribute (proxy, IN_shape, IN_attribute, &OUT_val, error);
311 return OUT_val;
312 }
314 //static
315 gboolean
316 inkscape_move (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error)
317 {
318 DBusGProxy *proxy = doc->proxy;
319 return org_inkscape_document_move (proxy, IN_shape, IN_x, IN_y, error);
320 }
322 //static
323 gboolean
324 inkscape_move_to (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error)
325 {
326 DBusGProxy *proxy = doc->proxy;
327 return org_inkscape_document_move_to (proxy, IN_shape, IN_x, IN_y, error);
328 }
330 //static
331 gboolean
332 inkscape_object_to_path (DocumentInterface *doc, const char * IN_objectname, GError **error)
333 {
334 DBusGProxy *proxy = doc->proxy;
335 return org_inkscape_document_object_to_path (proxy, IN_objectname, error);
336 }
338 //static
339 char *
340 inkscape_get_path (DocumentInterface *doc, const char * IN_shape, GError **error)
341 {
342 char * OUT_val;
343 DBusGProxy *proxy = doc->proxy;
344 org_inkscape_document_get_path (proxy, IN_shape, &OUT_val, error);
345 return OUT_val;
346 }
348 //static
349 gboolean
350 inkscape_transform (DocumentInterface *doc, const char * IN_shape, const char * IN_transformstr, GError **error)
351 {
352 DBusGProxy *proxy = doc->proxy;
353 return org_inkscape_document_transform (proxy, IN_shape, IN_transformstr, error);
354 }
356 //static
357 char *
358 inkscape_get_css (DocumentInterface *doc, const char * IN_shape, GError **error)
359 {
360 char * OUT_css;
361 DBusGProxy *proxy = doc->proxy;
362 org_inkscape_document_get_css (proxy, IN_shape, &OUT_css, error);
363 return OUT_css;
364 }
366 //static
367 gboolean
368 inkscape_modify_css (DocumentInterface *doc, const char * IN_shape, const char * IN_cssattrib, const char * IN_newval, GError **error)
369 {
370 DBusGProxy *proxy = doc->proxy;
371 return org_inkscape_document_modify_css (proxy, IN_shape, IN_cssattrib, IN_newval, error);
372 }
374 //static
375 gboolean
376 inkscape_merge_css (DocumentInterface *doc, const char * IN_shape, const char * IN_stylestring, GError **error)
377 {
378 DBusGProxy *proxy = doc->proxy;
379 return org_inkscape_document_merge_css (proxy, IN_shape, IN_stylestring, error);
380 }
382 //static
383 gboolean
384 inkscape_set_color (DocumentInterface *doc, const char * IN_shape, const gint IN_red, const gint IN_green, const gint IN_blue, const gboolean IN_fill, GError **error)
385 {
386 DBusGProxy *proxy = doc->proxy;
387 return org_inkscape_document_set_color (proxy, IN_shape, IN_red, IN_green, IN_blue, IN_fill, error);
388 }
390 //static
391 gboolean
392 inkscape_move_to_layer (DocumentInterface *doc, const char * IN_objectname, const char * IN_layername, GError **error)
393 {
394 DBusGProxy *proxy = doc->proxy;
395 return org_inkscape_document_move_to_layer (proxy, IN_objectname, IN_layername, error);
396 }
398 //static
399 GArray*
400 inkscape_get_node_coordinates (DocumentInterface *doc, const char * IN_shape, GError **error)
401 {
402 GArray* OUT_points;
403 DBusGProxy *proxy = doc->proxy;
404 org_inkscape_document_get_node_coordinates (proxy, IN_shape, &OUT_points, error);
405 return OUT_points;
406 }
408 //static
409 gboolean
410 inkscape_save (DocumentInterface *doc, GError **error)
411 {
412 DBusGProxy *proxy = doc->proxy;
413 return org_inkscape_document_save (proxy, error);
414 }
416 //static
417 gboolean
418 inkscape_save_as (DocumentInterface *doc, const char * IN_pathname, GError **error)
419 {
420 DBusGProxy *proxy = doc->proxy;
421 return org_inkscape_document_save_as (proxy, IN_pathname, error);
422 }
424 //static
425 gboolean
426 inkscape_load (DocumentInterface *doc, const char * IN_pathname, GError **error)
427 {
428 DBusGProxy *proxy = doc->proxy;
429 return org_inkscape_document_load (proxy, IN_pathname, error);
430 }
432 //static
433 gboolean
434 inkscape_mark_as_unmodified (DocumentInterface *doc, GError **error)
435 {
436 DBusGProxy *proxy = doc->proxy;
437 return org_inkscape_document_mark_as_unmodified (proxy, error);
438 }
440 //static
441 gboolean
442 inkscape_close (DocumentInterface *doc, GError **error)
443 {
444 DBusGProxy *proxy = doc->proxy;
445 return org_inkscape_document_close (proxy, error);
446 }
448 //static
449 gboolean
450 inkscape_inkscape_exit (DocumentInterface *doc, GError **error)
451 {
452 DBusGProxy *proxy = doc->proxy;
453 return org_inkscape_document_exit (proxy, error);
454 }
456 //static
457 gboolean
458 inkscape_undo (DocumentInterface *doc, GError **error)
459 {
460 DBusGProxy *proxy = doc->proxy;
461 return org_inkscape_document_undo (proxy, error);
462 }
464 //static
465 gboolean
466 inkscape_redo (DocumentInterface *doc, GError **error)
467 {
468 DBusGProxy *proxy = doc->proxy;
469 return org_inkscape_document_redo (proxy, error);
470 }
472 //static
473 gboolean
474 inkscape_pause_updates (DocumentInterface *doc, GError **error)
475 {
476 DBusGProxy *proxy = doc->proxy;
477 return org_inkscape_document_pause_updates (proxy, error);
478 }
480 //static
481 gboolean
482 inkscape_resume_updates (DocumentInterface *doc, GError **error)
483 {
484 DBusGProxy *proxy = doc->proxy;
485 return org_inkscape_document_resume_updates (proxy, error);
486 }
488 //static
489 gboolean
490 inkscape_update (DocumentInterface *doc, GError **error)
491 {
492 DBusGProxy *proxy = doc->proxy;
493 return org_inkscape_document_update (proxy, error);
494 }
496 //static
497 char **
498 inkscape_selection_get (DocumentInterface *doc, GError **error)
499 {
500 char ** OUT_listy;
501 DBusGProxy *proxy = doc->proxy;
502 org_inkscape_document_selection_get (proxy, &OUT_listy, error);
503 return OUT_listy;
504 }
506 //static
507 gboolean
508 inkscape_selection_add (DocumentInterface *doc, const char * IN_name, GError **error)
509 {
510 DBusGProxy *proxy = doc->proxy;
511 return org_inkscape_document_selection_add (proxy, IN_name, error);
512 }
514 //static
515 gboolean
516 inkscape_selection_add_list (DocumentInterface *doc, const char ** IN_name, GError **error)
517 {
518 DBusGProxy *proxy = doc->proxy;
519 return org_inkscape_document_selection_add_list (proxy, IN_name, error);
520 }
522 //static
523 gboolean
524 inkscape_selection_set (DocumentInterface *doc, const char * IN_name, GError **error)
525 {
526 DBusGProxy *proxy = doc->proxy;
527 return org_inkscape_document_selection_set (proxy, IN_name, error);
528 }
530 //static
531 gboolean
532 inkscape_selection_set_list (DocumentInterface *doc, const char ** IN_name, GError **error)
533 {
534 DBusGProxy *proxy = doc->proxy;
535 return org_inkscape_document_selection_set_list (proxy, IN_name, error);
536 }
538 //static
539 gboolean
540 inkscape_selection_rotate (DocumentInterface *doc, const gint IN_angle, GError **error)
541 {
542 DBusGProxy *proxy = doc->proxy;
543 return org_inkscape_document_selection_rotate (proxy, IN_angle, error);
544 }
546 //static
547 gboolean
548 inkscape_selection_delete (DocumentInterface *doc, GError **error)
549 {
550 DBusGProxy *proxy = doc->proxy;
551 return org_inkscape_document_selection_delete (proxy, error);
552 }
554 //static
555 gboolean
556 inkscape_selection_clear (DocumentInterface *doc, GError **error)
557 {
558 DBusGProxy *proxy = doc->proxy;
559 return org_inkscape_document_selection_clear (proxy, error);
560 }
562 //static
563 gboolean
564 inkscape_select_all (DocumentInterface *doc, GError **error)
565 {
566 DBusGProxy *proxy = doc->proxy;
567 return org_inkscape_document_select_all (proxy, error);
568 }
570 //static
571 gboolean
572 inkscape_select_all_in_all_layers (DocumentInterface *doc, GError **error)
573 {
574 DBusGProxy *proxy = doc->proxy;
575 return org_inkscape_document_select_all_in_all_layers (proxy, error);
576 }
578 //static
579 gboolean
580 inkscape_selection_box (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_x2, const gint IN_y2, const gboolean IN_replace, GError **error)
581 {
582 DBusGProxy *proxy = doc->proxy;
583 return org_inkscape_document_selection_box (proxy, IN_x, IN_y, IN_x2, IN_y2, IN_replace, error);
584 }
586 //static
587 gboolean
588 inkscape_selection_invert (DocumentInterface *doc, GError **error)
589 {
590 DBusGProxy *proxy = doc->proxy;
591 return org_inkscape_document_selection_invert (proxy, error);
592 }
594 //static
595 gboolean
596 inkscape_selection_group (DocumentInterface *doc, GError **error)
597 {
598 DBusGProxy *proxy = doc->proxy;
599 return org_inkscape_document_selection_group (proxy, error);
600 }
602 //static
603 gboolean
604 inkscape_selection_ungroup (DocumentInterface *doc, GError **error)
605 {
606 DBusGProxy *proxy = doc->proxy;
607 return org_inkscape_document_selection_ungroup (proxy, error);
608 }
610 //static
611 gboolean
612 inkscape_selection_cut (DocumentInterface *doc, GError **error)
613 {
614 DBusGProxy *proxy = doc->proxy;
615 return org_inkscape_document_selection_cut (proxy, error);
616 }
618 //static
619 gboolean
620 inkscape_selection_copy (DocumentInterface *doc, GError **error)
621 {
622 DBusGProxy *proxy = doc->proxy;
623 return org_inkscape_document_selection_copy (proxy, error);
624 }
626 //static
627 gboolean
628 inkscape_selection_paste (DocumentInterface *doc, GError **error)
629 {
630 DBusGProxy *proxy = doc->proxy;
631 return org_inkscape_document_selection_paste (proxy, error);
632 }
634 //static
635 gboolean
636 inkscape_selection_scale (DocumentInterface *doc, const gdouble IN_grow, GError **error)
637 {
638 DBusGProxy *proxy = doc->proxy;
639 return org_inkscape_document_selection_scale (proxy, IN_grow, error);
640 }
642 //static
643 gboolean
644 inkscape_selection_move (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error)
645 {
646 DBusGProxy *proxy = doc->proxy;
647 return org_inkscape_document_selection_move (proxy, IN_x, IN_y, error);
648 }
650 //static
651 gboolean
652 inkscape_selection_move_to (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error)
653 {
654 DBusGProxy *proxy = doc->proxy;
655 return org_inkscape_document_selection_move_to (proxy, IN_x, IN_y, error);
656 }
658 //static
659 gboolean
660 inkscape_selection_move_to_layer (DocumentInterface *doc, const char * IN_layer, GError **error)
661 {
662 DBusGProxy *proxy = doc->proxy;
663 return org_inkscape_document_selection_move_to_layer (proxy, IN_layer, error);
664 }
666 //static
667 GArray *
668 inkscape_selection_get_center (DocumentInterface *doc, GError **error)
669 {
670 GArray* OUT_centerpoint;
671 DBusGProxy *proxy = doc->proxy;
672 org_inkscape_document_selection_get_center (proxy, &OUT_centerpoint, error);
673 return OUT_centerpoint;
674 }
676 //static
677 gboolean
678 inkscape_selection_to_path (DocumentInterface *doc, GError **error)
679 {
680 DBusGProxy *proxy = doc->proxy;
681 return org_inkscape_document_selection_to_path (proxy, error);
682 }
684 //static
685 char *
686 inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error)
687 {
688 char * OUT_newpath;
689 DBusGProxy *proxy = doc->proxy;
690 org_inkscape_document_selection_combine (proxy, IN_type, &OUT_newpath, error);
691 return OUT_newpath;
692 }
694 //static
695 char **
696 inkscape_selection_divide (DocumentInterface *doc, GError **error)
697 {
698 char ** OUT_pieces;
699 DBusGProxy *proxy = doc->proxy;
700 org_inkscape_document_selection_divide (proxy, &OUT_pieces, error);
701 return OUT_pieces;
702 }
704 //static
705 gboolean
706 inkscape_selection_change_level (DocumentInterface *doc, const char * IN_command, GError **error)
707 {
708 gboolean OUT_objectsmoved;
709 DBusGProxy *proxy = doc->proxy;
710 org_inkscape_document_selection_change_level (proxy, IN_command, &OUT_objectsmoved, error);
711 return OUT_objectsmoved;
712 }
714 //static
715 char *
716 inkscape_layer_new (DocumentInterface *doc, GError **error)
717 {
718 char * OUT_layername;
719 DBusGProxy *proxy = doc->proxy;
720 org_inkscape_document_layer_new (proxy, &OUT_layername, error);
721 return OUT_layername;
722 }
724 //static
725 gboolean
726 inkscape_layer_set (DocumentInterface *doc, const char * IN_layer, GError **error)
727 {
728 DBusGProxy *proxy = doc->proxy;
729 return org_inkscape_document_layer_set (proxy, IN_layer, error);
730 }
732 //static
733 char **
734 inkscape_layer_get_all (DocumentInterface *doc, GError **error)
735 {
736 char ** OUT_layers;
737 DBusGProxy *proxy = doc->proxy;
738 org_inkscape_document_layer_get_all (proxy, &OUT_layers, error);
739 return OUT_layers;
740 }
742 //static
743 gboolean
744 inkscape_layer_change_level (DocumentInterface *doc, const char * IN_command, GError **error)
745 {
746 gboolean OUT_layermoved;
747 DBusGProxy *proxy = doc->proxy;
748 org_inkscape_document_layer_change_level (proxy, IN_command, &OUT_layermoved, error);
749 return OUT_layermoved;
750 }
752 //static
753 gboolean
754 inkscape_layer_next (DocumentInterface *doc, GError **error)
755 {
756 DBusGProxy *proxy = doc->proxy;
757 return org_inkscape_document_layer_next (proxy, error);
758 }
760 //static
761 gboolean
762 inkscape_layer_previous (DocumentInterface *doc, GError **error)
763 {
764 DBusGProxy *proxy = doc->proxy;
765 return org_inkscape_document_layer_previous (proxy, error);
766 }
768 /*
769 int
770 main (int argc, char** argv)
771 {
772 gchar * result;
773 GError *error = NULL;
774 DocumentInterface * doc = inkscape_desktop_init_dbus ();
775 result = rectangle (doc->proxy, 10, 10, 100, 100, &error);
776 printf("RESULT: %s\n", result);
778 //dbus_g_proxy_call(doc->proxy, "rectangle", &error, G_TYPE_INT, 100, G_TYPE_INT, 100, G_TYPE_INT, 100, G_TYPE_INT, 100, G_TYPE_INVALID, G_TYPE_INVALID);
779 printf("yes\n");
780 }
781 */