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 #if 0
38 /* PRIVATE register an object on a bus */
39 static gpointer
40 dbus_register_object (DBusGConnection *connection,
41 DBusGProxy * proxy,
42 GType object_type,
43 const DBusGObjectInfo *info,
44 const gchar *path)
45 {
46 GObject *object = (GObject*)g_object_new (object_type, NULL);
47 dbus_g_object_type_install_info (object_type, info);
48 dbus_g_connection_register_g_object (connection, path, object);
49 return object;
50 }
51 #endif
53 /****************************************************************************
54 DOCUMENT INTERFACE CLASS STUFF
55 ****************************************************************************/
57 struct _DocumentInterface {
58 GObject parent;
59 DBusGProxy * proxy;
60 };
62 G_DEFINE_TYPE(DocumentInterface, document_interface, G_TYPE_OBJECT)
64 static void
65 document_interface_finalize (GObject *object)
66 {
67 G_OBJECT_CLASS (document_interface_parent_class)->finalize (object);
68 }
71 static void
72 document_interface_class_init (DocumentInterfaceClass *klass)
73 {
74 GObjectClass *object_class;
75 object_class = G_OBJECT_CLASS (klass);
76 object_class->finalize = document_interface_finalize;
77 }
79 static void
80 document_interface_init (DocumentInterface *object)
81 {
82 object->proxy = NULL;
83 }
86 DocumentInterface *
87 document_interface_new (void)
88 {
89 return (DocumentInterface*)g_object_new (TYPE_DOCUMENT_INTERFACE, NULL);
90 }
92 DocumentInterface *
93 inkscape_desktop_init_dbus ()
94 {
95 DBusGConnection *connection;
96 GError *error;
97 DBusGProxy *proxy;
99 g_type_init ();
101 error = NULL;
102 connection = dbus_g_bus_get (DBUS_BUS_SESSION,
103 &error);
104 if (connection == NULL)
105 {
106 g_printerr ("Failed to open connection to bus: %s\n",
107 error->message);
108 g_error_free (error);
109 exit (1);
110 }
112 proxy = dbus_g_proxy_new_for_name (connection,
113 "org.inkscape",
114 "/org/inkscape/desktop_0",
115 "org.inkscape.document");
117 DocumentInterface * inkdesk = (DocumentInterface *)g_object_new (TYPE_DOCUMENT_INTERFACE, NULL);
118 inkdesk->proxy = proxy;
119 return inkdesk;
120 }
123 //static
124 gboolean
125 inkscape_delete_all (DocumentInterface *doc, GError **error)
126 {
127 DBusGProxy *proxy = doc->proxy;
128 return org_inkscape_document_delete_all (proxy, error);
129 }
131 //static
132 gboolean
133 inkscape_call_verb (DocumentInterface *doc, const char * IN_verbid, GError **error)
134 {
135 DBusGProxy *proxy = doc->proxy;
136 return org_inkscape_document_call_verb(proxy, IN_verbid, error);
137 }
140 //static
141 gchar *
142 inkscape_rectangle (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_width, const gint IN_height, GError **error)
143 {
144 char * OUT_object_name;
145 DBusGProxy *proxy = doc->proxy;
146 org_inkscape_document_rectangle (proxy, IN_x, IN_y, IN_width, IN_height, &OUT_object_name, error);
147 return OUT_object_name;
148 }
150 //static
151 char *
152 inkscape_ellipse (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_width, const gint IN_height, GError **error)
153 {
154 char * OUT_object_name;
155 DBusGProxy *proxy = doc->proxy;
156 org_inkscape_document_ellipse (proxy, IN_x, IN_y, IN_width, IN_height, &OUT_object_name, error);
157 return OUT_object_name;
158 }
160 //static
161 char *
162 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)
163 {
164 char * OUT_object_name;
165 DBusGProxy *proxy = doc->proxy;
166 org_inkscape_document_polygon (proxy, IN_cx, IN_cy, IN_radius, IN_rotation, IN_sides, &OUT_object_name, error);
167 return OUT_object_name;
168 }
170 //static
171 char *
172 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)
173 {
174 char * OUT_object_name;
175 DBusGProxy *proxy = doc->proxy;
176 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);
177 return OUT_object_name;
178 }
180 //static
181 char *
182 inkscape_spiral (DocumentInterface *doc, const gint IN_cx, const gint IN_cy, const gint IN_r, const gint IN_revolutions, GError **error)
183 {
184 char * OUT_object_name;
185 DBusGProxy *proxy = doc->proxy;
186 org_inkscape_document_spiral (proxy, IN_cx, IN_cy, IN_r, IN_revolutions, &OUT_object_name, error);
187 return OUT_object_name;
188 }
190 //static
191 char *
192 inkscape_line (DocumentInterface *doc, const gint IN_x, const gint IN_y, const gint IN_x2, const gint IN_y2, GError **error)
193 {
194 char * OUT_object_name;
195 DBusGProxy *proxy = doc->proxy;
196 org_inkscape_document_line (proxy, IN_x, IN_y, IN_x2, IN_y2, &OUT_object_name, error);
197 return OUT_object_name;
198 }
200 //static
201 gboolean
202 inkscape_text (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error)
203 {
204 DBusGProxy *proxy = doc->proxy;
205 return org_inkscape_document_text (proxy, IN_x, IN_y, IN_text, error);
206 }
208 //static
209 char *
210 inkscape_image (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error)
211 {
212 char * OUT_object_name;
213 DBusGProxy *proxy = doc->proxy;
214 org_inkscape_document_image (proxy, IN_x, IN_y, IN_text, &OUT_object_name, error);
215 return OUT_object_name;
216 }
218 //static
219 char *
220 inkscape_node (DocumentInterface *doc, const char * IN_svgtype, GError **error)
221 {
222 char *OUT_node_name;
223 DBusGProxy *proxy = doc->proxy;
224 org_inkscape_document_node (proxy, IN_svgtype, &OUT_node_name, error);
225 return OUT_node_name;
226 }
228 //static
229 gdouble
230 inkscape_document_get_width (DocumentInterface *doc, GError **error)
231 {
232 gdouble OUT_val;
233 DBusGProxy *proxy = doc->proxy;
234 org_inkscape_document_document_get_width (proxy, &OUT_val, error);
235 return OUT_val;
236 }
238 //static
239 gdouble
240 inkscape_document_get_height (DocumentInterface *doc, GError **error)
241 {
242 gdouble OUT_val;
243 DBusGProxy *proxy = doc->proxy;
244 org_inkscape_document_document_get_height (proxy, &OUT_val, error);
245 return OUT_val;
246 }
248 //static
249 char *
250 inkscape_document_get_css (DocumentInterface *doc, GError **error)
251 {
252 char * OUT_css;
253 DBusGProxy *proxy = doc->proxy;
254 org_inkscape_document_document_get_css (proxy, &OUT_css, error);
255 return OUT_css;
256 }
258 //static
259 gboolean
260 inkscape_document_set_css (DocumentInterface *doc, const char * IN_stylestring, GError **error)
261 {
262 DBusGProxy *proxy = doc->proxy;
263 return org_inkscape_document_document_set_css (proxy, IN_stylestring, error);
264 }
266 //static
267 gboolean
268 inkscape_document_merge_css (DocumentInterface *doc, const char * IN_stylestring, GError **error)
269 {
270 DBusGProxy *proxy = doc->proxy;
271 return org_inkscape_document_document_merge_css (proxy, IN_stylestring, error);
272 }
274 //static
275 gboolean
276 inkscape_document_resize_to_fit_selection (DocumentInterface *doc, GError **error)
277 {
278 DBusGProxy *proxy = doc->proxy;
279 return org_inkscape_document_document_resize_to_fit_selection (proxy, error);
280 }
282 //static
283 gboolean
284 inkscape_set_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const char * IN_newval, GError **error)
285 {
286 DBusGProxy *proxy = doc->proxy;
287 return org_inkscape_document_set_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
288 }
290 //static
291 gboolean
292 inkscape_set_int_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gint IN_newval, GError **error)
293 {
294 DBusGProxy *proxy = doc->proxy;
295 return org_inkscape_document_set_int_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
296 }
298 //static
299 gboolean
300 inkscape_set_double_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gdouble IN_newval, GError **error)
301 {
302 DBusGProxy *proxy = doc->proxy;
303 return org_inkscape_document_set_double_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
304 }
306 //static
307 char *
308 inkscape_get_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, GError **error)
309 {
310 char * OUT_val;
311 DBusGProxy *proxy = doc->proxy;
312 org_inkscape_document_get_attribute (proxy, IN_shape, IN_attribute, &OUT_val, error);
313 return OUT_val;
314 }
316 //static
317 gboolean
318 inkscape_move (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error)
319 {
320 DBusGProxy *proxy = doc->proxy;
321 return org_inkscape_document_move (proxy, IN_shape, IN_x, IN_y, error);
322 }
324 //static
325 gboolean
326 inkscape_move_to (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error)
327 {
328 DBusGProxy *proxy = doc->proxy;
329 return org_inkscape_document_move_to (proxy, IN_shape, IN_x, IN_y, error);
330 }
332 //static
333 gboolean
334 inkscape_object_to_path (DocumentInterface *doc, const char * IN_objectname, GError **error)
335 {
336 DBusGProxy *proxy = doc->proxy;
337 return org_inkscape_document_object_to_path (proxy, IN_objectname, error);
338 }
340 //static
341 char *
342 inkscape_get_path (DocumentInterface *doc, const char * IN_shape, GError **error)
343 {
344 char * OUT_val;
345 DBusGProxy *proxy = doc->proxy;
346 org_inkscape_document_get_path (proxy, IN_shape, &OUT_val, error);
347 return OUT_val;
348 }
350 //static
351 gboolean
352 inkscape_transform (DocumentInterface *doc, const char * IN_shape, const char * IN_transformstr, GError **error)
353 {
354 DBusGProxy *proxy = doc->proxy;
355 return org_inkscape_document_transform (proxy, IN_shape, IN_transformstr, error);
356 }
358 //static
359 char *
360 inkscape_get_css (DocumentInterface *doc, const char * IN_shape, GError **error)
361 {
362 char * OUT_css;
363 DBusGProxy *proxy = doc->proxy;
364 org_inkscape_document_get_css (proxy, IN_shape, &OUT_css, error);
365 return OUT_css;
366 }
368 //static
369 gboolean
370 inkscape_modify_css (DocumentInterface *doc, const char * IN_shape, const char * IN_cssattrib, const char * IN_newval, GError **error)
371 {
372 DBusGProxy *proxy = doc->proxy;
373 return org_inkscape_document_modify_css (proxy, IN_shape, IN_cssattrib, IN_newval, error);
374 }
376 //static
377 gboolean
378 inkscape_merge_css (DocumentInterface *doc, const char * IN_shape, const char * IN_stylestring, GError **error)
379 {
380 DBusGProxy *proxy = doc->proxy;
381 return org_inkscape_document_merge_css (proxy, IN_shape, IN_stylestring, error);
382 }
384 //static
385 gboolean
386 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)
387 {
388 DBusGProxy *proxy = doc->proxy;
389 return org_inkscape_document_set_color (proxy, IN_shape, IN_red, IN_green, IN_blue, IN_fill, error);
390 }
392 //static
393 gboolean
394 inkscape_move_to_layer (DocumentInterface *doc, const char * IN_objectname, const char * IN_layername, GError **error)
395 {
396 DBusGProxy *proxy = doc->proxy;
397 return org_inkscape_document_move_to_layer (proxy, IN_objectname, IN_layername, error);
398 }
400 //static
401 GArray*
402 inkscape_get_node_coordinates (DocumentInterface *doc, const char * IN_shape, GError **error)
403 {
404 GArray* OUT_points;
405 DBusGProxy *proxy = doc->proxy;
406 org_inkscape_document_get_node_coordinates (proxy, IN_shape, &OUT_points, error);
407 return OUT_points;
408 }
410 //static
411 gboolean
412 inkscape_save (DocumentInterface *doc, GError **error)
413 {
414 DBusGProxy *proxy = doc->proxy;
415 return org_inkscape_document_save (proxy, error);
416 }
418 //static
419 gboolean
420 inkscape_save_as (DocumentInterface *doc, const char * IN_pathname, GError **error)
421 {
422 DBusGProxy *proxy = doc->proxy;
423 return org_inkscape_document_save_as (proxy, IN_pathname, error);
424 }
426 //static
427 gboolean
428 inkscape_load (DocumentInterface *doc, const char * IN_pathname, GError **error)
429 {
430 DBusGProxy *proxy = doc->proxy;
431 return org_inkscape_document_load (proxy, IN_pathname, error);
432 }
434 //static
435 gboolean
436 inkscape_mark_as_unmodified (DocumentInterface *doc, GError **error)
437 {
438 DBusGProxy *proxy = doc->proxy;
439 return org_inkscape_document_mark_as_unmodified (proxy, error);
440 }
442 //static
443 gboolean
444 inkscape_close (DocumentInterface *doc, GError **error)
445 {
446 DBusGProxy *proxy = doc->proxy;
447 return org_inkscape_document_close (proxy, error);
448 }
450 //static
451 gboolean
452 inkscape_inkscape_exit (DocumentInterface *doc, GError **error)
453 {
454 DBusGProxy *proxy = doc->proxy;
455 return org_inkscape_document_exit (proxy, error);
456 }
458 //static
459 gboolean
460 inkscape_undo (DocumentInterface *doc, GError **error)
461 {
462 DBusGProxy *proxy = doc->proxy;
463 return org_inkscape_document_undo (proxy, error);
464 }
466 //static
467 gboolean
468 inkscape_redo (DocumentInterface *doc, GError **error)
469 {
470 DBusGProxy *proxy = doc->proxy;
471 return org_inkscape_document_redo (proxy, error);
472 }
474 //static
475 gboolean
476 inkscape_pause_updates (DocumentInterface *doc, GError **error)
477 {
478 DBusGProxy *proxy = doc->proxy;
479 return org_inkscape_document_pause_updates (proxy, error);
480 }
482 //static
483 gboolean
484 inkscape_resume_updates (DocumentInterface *doc, GError **error)
485 {
486 DBusGProxy *proxy = doc->proxy;
487 return org_inkscape_document_resume_updates (proxy, error);
488 }
490 //static
491 gboolean
492 inkscape_update (DocumentInterface *doc, GError **error)
493 {
494 DBusGProxy *proxy = doc->proxy;
495 return org_inkscape_document_update (proxy, error);
496 }
498 //static
499 char **
500 inkscape_selection_get (DocumentInterface *doc, GError **error)
501 {
502 char ** OUT_listy;
503 DBusGProxy *proxy = doc->proxy;
504 org_inkscape_document_selection_get (proxy, &OUT_listy, error);
505 return OUT_listy;
506 }
508 //static
509 gboolean
510 inkscape_selection_add (DocumentInterface *doc, const char * IN_name, GError **error)
511 {
512 DBusGProxy *proxy = doc->proxy;
513 return org_inkscape_document_selection_add (proxy, IN_name, error);
514 }
516 //static
517 gboolean
518 inkscape_selection_add_list (DocumentInterface *doc, const char ** IN_name, GError **error)
519 {
520 DBusGProxy *proxy = doc->proxy;
521 return org_inkscape_document_selection_add_list (proxy, IN_name, error);
522 }
524 //static
525 gboolean
526 inkscape_selection_set (DocumentInterface *doc, const char * IN_name, GError **error)
527 {
528 DBusGProxy *proxy = doc->proxy;
529 return org_inkscape_document_selection_set (proxy, IN_name, error);
530 }
532 //static
533 gboolean
534 inkscape_selection_set_list (DocumentInterface *doc, const char ** IN_name, GError **error)
535 {
536 DBusGProxy *proxy = doc->proxy;
537 return org_inkscape_document_selection_set_list (proxy, IN_name, error);
538 }
540 //static
541 gboolean
542 inkscape_selection_rotate (DocumentInterface *doc, const gint IN_angle, GError **error)
543 {
544 DBusGProxy *proxy = doc->proxy;
545 return org_inkscape_document_selection_rotate (proxy, IN_angle, error);
546 }
548 //static
549 gboolean
550 inkscape_selection_delete (DocumentInterface *doc, GError **error)
551 {
552 DBusGProxy *proxy = doc->proxy;
553 return org_inkscape_document_selection_delete (proxy, error);
554 }
556 //static
557 gboolean
558 inkscape_selection_clear (DocumentInterface *doc, GError **error)
559 {
560 DBusGProxy *proxy = doc->proxy;
561 return org_inkscape_document_selection_clear (proxy, error);
562 }
564 //static
565 gboolean
566 inkscape_select_all (DocumentInterface *doc, GError **error)
567 {
568 DBusGProxy *proxy = doc->proxy;
569 return org_inkscape_document_select_all (proxy, error);
570 }
572 //static
573 gboolean
574 inkscape_select_all_in_all_layers (DocumentInterface *doc, GError **error)
575 {
576 DBusGProxy *proxy = doc->proxy;
577 return org_inkscape_document_select_all_in_all_layers (proxy, error);
578 }
580 //static
581 gboolean
582 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)
583 {
584 DBusGProxy *proxy = doc->proxy;
585 return org_inkscape_document_selection_box (proxy, IN_x, IN_y, IN_x2, IN_y2, IN_replace, error);
586 }
588 //static
589 gboolean
590 inkscape_selection_invert (DocumentInterface *doc, GError **error)
591 {
592 DBusGProxy *proxy = doc->proxy;
593 return org_inkscape_document_selection_invert (proxy, error);
594 }
596 //static
597 gboolean
598 inkscape_selection_group (DocumentInterface *doc, GError **error)
599 {
600 DBusGProxy *proxy = doc->proxy;
601 return org_inkscape_document_selection_group (proxy, error);
602 }
604 //static
605 gboolean
606 inkscape_selection_ungroup (DocumentInterface *doc, GError **error)
607 {
608 DBusGProxy *proxy = doc->proxy;
609 return org_inkscape_document_selection_ungroup (proxy, error);
610 }
612 //static
613 gboolean
614 inkscape_selection_cut (DocumentInterface *doc, GError **error)
615 {
616 DBusGProxy *proxy = doc->proxy;
617 return org_inkscape_document_selection_cut (proxy, error);
618 }
620 //static
621 gboolean
622 inkscape_selection_copy (DocumentInterface *doc, GError **error)
623 {
624 DBusGProxy *proxy = doc->proxy;
625 return org_inkscape_document_selection_copy (proxy, error);
626 }
628 //static
629 gboolean
630 inkscape_selection_paste (DocumentInterface *doc, GError **error)
631 {
632 DBusGProxy *proxy = doc->proxy;
633 return org_inkscape_document_selection_paste (proxy, error);
634 }
636 //static
637 gboolean
638 inkscape_selection_scale (DocumentInterface *doc, const gdouble IN_grow, GError **error)
639 {
640 DBusGProxy *proxy = doc->proxy;
641 return org_inkscape_document_selection_scale (proxy, IN_grow, error);
642 }
644 //static
645 gboolean
646 inkscape_selection_move (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error)
647 {
648 DBusGProxy *proxy = doc->proxy;
649 return org_inkscape_document_selection_move (proxy, IN_x, IN_y, error);
650 }
652 //static
653 gboolean
654 inkscape_selection_move_to (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error)
655 {
656 DBusGProxy *proxy = doc->proxy;
657 return org_inkscape_document_selection_move_to (proxy, IN_x, IN_y, error);
658 }
660 //static
661 gboolean
662 inkscape_selection_move_to_layer (DocumentInterface *doc, const char * IN_layer, GError **error)
663 {
664 DBusGProxy *proxy = doc->proxy;
665 return org_inkscape_document_selection_move_to_layer (proxy, IN_layer, error);
666 }
668 //static
669 GArray *
670 inkscape_selection_get_center (DocumentInterface *doc, GError **error)
671 {
672 GArray* OUT_centerpoint;
673 DBusGProxy *proxy = doc->proxy;
674 org_inkscape_document_selection_get_center (proxy, &OUT_centerpoint, error);
675 return OUT_centerpoint;
676 }
678 //static
679 gboolean
680 inkscape_selection_to_path (DocumentInterface *doc, GError **error)
681 {
682 DBusGProxy *proxy = doc->proxy;
683 return org_inkscape_document_selection_to_path (proxy, error);
684 }
686 //static
687 char *
688 inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error)
689 {
690 char * OUT_newpath;
691 DBusGProxy *proxy = doc->proxy;
692 org_inkscape_document_selection_combine (proxy, IN_type, &OUT_newpath, error);
693 return OUT_newpath;
694 }
696 //static
697 char **
698 inkscape_selection_divide (DocumentInterface *doc, GError **error)
699 {
700 char ** OUT_pieces;
701 DBusGProxy *proxy = doc->proxy;
702 org_inkscape_document_selection_divide (proxy, &OUT_pieces, error);
703 return OUT_pieces;
704 }
706 //static
707 gboolean
708 inkscape_selection_change_level (DocumentInterface *doc, const char * IN_command, GError **error)
709 {
710 gboolean OUT_objectsmoved;
711 DBusGProxy *proxy = doc->proxy;
712 org_inkscape_document_selection_change_level (proxy, IN_command, &OUT_objectsmoved, error);
713 return OUT_objectsmoved;
714 }
716 //static
717 char *
718 inkscape_layer_new (DocumentInterface *doc, GError **error)
719 {
720 char * OUT_layername;
721 DBusGProxy *proxy = doc->proxy;
722 org_inkscape_document_layer_new (proxy, &OUT_layername, error);
723 return OUT_layername;
724 }
726 //static
727 gboolean
728 inkscape_layer_set (DocumentInterface *doc, const char * IN_layer, GError **error)
729 {
730 DBusGProxy *proxy = doc->proxy;
731 return org_inkscape_document_layer_set (proxy, IN_layer, error);
732 }
734 //static
735 char **
736 inkscape_layer_get_all (DocumentInterface *doc, GError **error)
737 {
738 char ** OUT_layers;
739 DBusGProxy *proxy = doc->proxy;
740 org_inkscape_document_layer_get_all (proxy, &OUT_layers, error);
741 return OUT_layers;
742 }
744 //static
745 gboolean
746 inkscape_layer_change_level (DocumentInterface *doc, const char * IN_command, GError **error)
747 {
748 gboolean OUT_layermoved;
749 DBusGProxy *proxy = doc->proxy;
750 org_inkscape_document_layer_change_level (proxy, IN_command, &OUT_layermoved, error);
751 return OUT_layermoved;
752 }
754 //static
755 gboolean
756 inkscape_layer_next (DocumentInterface *doc, GError **error)
757 {
758 DBusGProxy *proxy = doc->proxy;
759 return org_inkscape_document_layer_next (proxy, error);
760 }
762 //static
763 gboolean
764 inkscape_layer_previous (DocumentInterface *doc, GError **error)
765 {
766 DBusGProxy *proxy = doc->proxy;
767 return org_inkscape_document_layer_previous (proxy, error);
768 }
770 /*
771 int
772 main (int argc, char** argv)
773 {
774 gchar * result;
775 GError *error = NULL;
776 DocumentInterface * doc = inkscape_desktop_init_dbus ();
777 result = rectangle (doc->proxy, 10, 10, 100, 100, &error);
778 printf("RESULT: %s\n", result);
780 //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);
781 printf("yes\n");
782 }
783 */