~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/extension/dbus/wrapper/inkscape-dbus-wrapper.c

  • Committer: JazzyNico
  • Date: 2011-08-29 20:25:30 UTC
  • Revision ID: nicoduf@yahoo.fr-20110829202530-6deuoz11q90usldv
Code refactoring and merging with trunk (revision 10599).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "inkscape-dbus-wrapper.h"
 
2
#include <string.h>
 
3
#include <stdio.h>
 
4
#include <stdlib.h>
 
5
 
 
6
 
 
7
 
 
8
#include "document-client-glue.h"
 
9
#include <dbus/dbus-glib.h>
 
10
#include <dbus/dbus.h>
 
11
 
 
12
// (static.*(\n[^}]*)*(async)+.*(\n[^}]*)*})|typedef void .*;
 
13
// http://www.josephkahn.com/music/index.xml
 
14
 
 
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
}
 
27
 
 
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
}
 
36
 
 
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
 
52
 
 
53
/****************************************************************************
 
54
     DOCUMENT INTERFACE CLASS STUFF
 
55
****************************************************************************/
 
56
 
 
57
struct _DocumentInterface {
 
58
        GObject parent;
 
59
        DBusGProxy * proxy;
 
60
};
 
61
 
 
62
G_DEFINE_TYPE(DocumentInterface, document_interface, G_TYPE_OBJECT)
 
63
 
 
64
static void
 
65
document_interface_finalize (GObject *object)
 
66
{
 
67
        G_OBJECT_CLASS (document_interface_parent_class)->finalize (object);
 
68
}
 
69
 
 
70
 
 
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
}
 
78
 
 
79
static void
 
80
document_interface_init (DocumentInterface *object)
 
81
{
 
82
        object->proxy = NULL;
 
83
}
 
84
 
 
85
 
 
86
DocumentInterface *
 
87
document_interface_new (void)
 
88
{
 
89
        return (DocumentInterface*)g_object_new (TYPE_DOCUMENT_INTERFACE, NULL);
 
90
}
 
91
 
 
92
DocumentInterface *
 
93
inkscape_desktop_init_dbus ()
 
94
{
 
95
    DBusGConnection *connection;
 
96
    GError *error;
 
97
    DBusGProxy *proxy;
 
98
  
 
99
    g_type_init ();
 
100
 
 
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
        }
 
111
  
 
112
    proxy = dbus_g_proxy_new_for_name (connection,
 
113
                                     "org.inkscape",
 
114
                                     "/org/inkscape/desktop_0",
 
115
                                     "org.inkscape.document");
 
116
 
 
117
     DocumentInterface * inkdesk = (DocumentInterface *)g_object_new (TYPE_DOCUMENT_INTERFACE, NULL);
 
118
    inkdesk->proxy = proxy;
 
119
    return inkdesk;
 
120
}
 
121
 
 
122
 
 
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
}
 
130
 
 
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
}
 
138
 
 
139
 
 
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
}
 
149
 
 
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
}
 
159
 
 
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
}
 
169
 
 
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
}
 
179
 
 
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
}
 
189
 
 
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
}
 
199
 
 
200
//static
 
201
char *
 
202
inkscape_text (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error)
 
203
{
 
204
  char * OUT_object_name;
 
205
  DBusGProxy *proxy = doc->proxy;
 
206
  org_inkscape_document_text (proxy, IN_x, IN_y, IN_text, &OUT_object_name, error);
 
207
  return OUT_object_name;
 
208
}
 
209
 
 
210
//static
 
211
char *
 
212
inkscape_image (DocumentInterface *doc, const gint IN_x, const gint IN_y, const char * IN_text, GError **error)
 
213
{
 
214
  char * OUT_object_name;
 
215
  DBusGProxy *proxy = doc->proxy;
 
216
  org_inkscape_document_image (proxy, IN_x, IN_y, IN_text, &OUT_object_name, error);
 
217
  return OUT_object_name;
 
218
}
 
219
 
 
220
//static
 
221
char *
 
222
inkscape_node (DocumentInterface *doc, const char * IN_svgtype, GError **error)
 
223
{
 
224
  char *OUT_node_name;
 
225
  DBusGProxy *proxy = doc->proxy;
 
226
  org_inkscape_document_node (proxy, IN_svgtype, &OUT_node_name, error);
 
227
  return OUT_node_name;
 
228
}
 
229
 
 
230
//static
 
231
gdouble
 
232
inkscape_document_get_width (DocumentInterface *doc, GError **error)
 
233
{
 
234
  gdouble OUT_val;
 
235
  DBusGProxy *proxy = doc->proxy;
 
236
  org_inkscape_document_document_get_width (proxy, &OUT_val, error);
 
237
  return OUT_val;
 
238
}
 
239
 
 
240
//static
 
241
gdouble
 
242
inkscape_document_get_height (DocumentInterface *doc, GError **error)
 
243
{
 
244
  gdouble OUT_val;
 
245
  DBusGProxy *proxy = doc->proxy;
 
246
  org_inkscape_document_document_get_height (proxy, &OUT_val, error);
 
247
  return OUT_val;
 
248
}
 
249
 
 
250
//static
 
251
char *
 
252
inkscape_document_get_css (DocumentInterface *doc, GError **error)
 
253
{
 
254
  char * OUT_css;
 
255
  DBusGProxy *proxy = doc->proxy;
 
256
  org_inkscape_document_document_get_css (proxy, &OUT_css, error);
 
257
  return OUT_css;
 
258
}
 
259
 
 
260
//static
 
261
gboolean
 
262
inkscape_document_set_css (DocumentInterface *doc, const char * IN_stylestring, GError **error)
 
263
{
 
264
  DBusGProxy *proxy = doc->proxy;
 
265
  return org_inkscape_document_document_set_css (proxy, IN_stylestring, error);
 
266
}
 
267
 
 
268
//static
 
269
gboolean
 
270
inkscape_document_merge_css (DocumentInterface *doc, const char * IN_stylestring, GError **error)
 
271
{
 
272
  DBusGProxy *proxy = doc->proxy;
 
273
  return org_inkscape_document_document_merge_css (proxy, IN_stylestring, error);
 
274
}
 
275
 
 
276
//static
 
277
gboolean
 
278
inkscape_document_resize_to_fit_selection (DocumentInterface *doc, GError **error)
 
279
{
 
280
  DBusGProxy *proxy = doc->proxy;
 
281
  return org_inkscape_document_document_resize_to_fit_selection (proxy, error);
 
282
}
 
283
 
 
284
//static
 
285
gboolean
 
286
inkscape_set_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const char * IN_newval, GError **error)
 
287
{
 
288
  DBusGProxy *proxy = doc->proxy;
 
289
  return org_inkscape_document_set_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
 
290
}
 
291
 
 
292
//static
 
293
gboolean
 
294
inkscape_set_int_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gint IN_newval, GError **error)
 
295
{
 
296
  DBusGProxy *proxy = doc->proxy;
 
297
  return org_inkscape_document_set_int_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
 
298
}
 
299
 
 
300
//static
 
301
gboolean
 
302
inkscape_set_double_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, const gdouble IN_newval, GError **error)
 
303
{
 
304
  DBusGProxy *proxy = doc->proxy;
 
305
  return org_inkscape_document_set_double_attribute (proxy, IN_shape, IN_attribute, IN_newval, error);
 
306
}
 
307
 
 
308
//static
 
309
char *
 
310
inkscape_get_attribute (DocumentInterface *doc, const char * IN_shape, const char * IN_attribute, GError **error)
 
311
{
 
312
  char * OUT_val;
 
313
  DBusGProxy *proxy = doc->proxy;
 
314
  org_inkscape_document_get_attribute (proxy, IN_shape, IN_attribute, &OUT_val, error);
 
315
  return OUT_val;
 
316
}
 
317
 
 
318
//static
 
319
gboolean
 
320
inkscape_move (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error)
 
321
{
 
322
  DBusGProxy *proxy = doc->proxy;
 
323
  return org_inkscape_document_move (proxy, IN_shape, IN_x, IN_y, error);
 
324
}
 
325
 
 
326
//static
 
327
gboolean
 
328
inkscape_move_to (DocumentInterface *doc, const char * IN_shape, const gdouble IN_x, const gdouble IN_y, GError **error)
 
329
{
 
330
  DBusGProxy *proxy = doc->proxy;
 
331
  return org_inkscape_document_move_to (proxy, IN_shape, IN_x, IN_y, error);
 
332
}
 
333
 
 
334
//static
 
335
gboolean
 
336
inkscape_object_to_path (DocumentInterface *doc, const char * IN_objectname, GError **error)
 
337
{
 
338
  DBusGProxy *proxy = doc->proxy;
 
339
  return org_inkscape_document_object_to_path (proxy, IN_objectname, error);
 
340
}
 
341
 
 
342
//static
 
343
char *
 
344
inkscape_get_path (DocumentInterface *doc, const char * IN_shape, GError **error)
 
345
{
 
346
  char * OUT_val;
 
347
  DBusGProxy *proxy = doc->proxy;
 
348
  org_inkscape_document_get_path (proxy, IN_shape, &OUT_val, error);
 
349
  return OUT_val;
 
350
}
 
351
 
 
352
//static
 
353
gboolean
 
354
inkscape_transform (DocumentInterface *doc, const char * IN_shape, const char * IN_transformstr, GError **error)
 
355
{
 
356
  DBusGProxy *proxy = doc->proxy;
 
357
  return org_inkscape_document_transform (proxy, IN_shape, IN_transformstr, error);
 
358
}
 
359
 
 
360
//static
 
361
char *
 
362
inkscape_get_css (DocumentInterface *doc, const char * IN_shape, GError **error)
 
363
{
 
364
  char * OUT_css;
 
365
  DBusGProxy *proxy = doc->proxy;
 
366
  org_inkscape_document_get_css (proxy, IN_shape, &OUT_css, error);
 
367
  return OUT_css;
 
368
}
 
369
 
 
370
//static
 
371
gboolean
 
372
inkscape_modify_css (DocumentInterface *doc, const char * IN_shape, const char * IN_cssattrib, const char * IN_newval, GError **error)
 
373
{
 
374
  DBusGProxy *proxy = doc->proxy;
 
375
  return org_inkscape_document_modify_css (proxy, IN_shape, IN_cssattrib, IN_newval, error);
 
376
}
 
377
 
 
378
//static
 
379
gboolean
 
380
inkscape_merge_css (DocumentInterface *doc, const char * IN_shape, const char * IN_stylestring, GError **error)
 
381
{
 
382
  DBusGProxy *proxy = doc->proxy;
 
383
  return org_inkscape_document_merge_css (proxy, IN_shape, IN_stylestring, error);
 
384
}
 
385
 
 
386
//static
 
387
gboolean
 
388
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)
 
389
{
 
390
  DBusGProxy *proxy = doc->proxy;
 
391
  return org_inkscape_document_set_color (proxy, IN_shape, IN_red, IN_green, IN_blue, IN_fill, error);
 
392
}
 
393
 
 
394
//static
 
395
gboolean
 
396
inkscape_move_to_layer (DocumentInterface *doc, const char * IN_objectname, const char * IN_layername, GError **error)
 
397
{
 
398
  DBusGProxy *proxy = doc->proxy;
 
399
  return org_inkscape_document_move_to_layer (proxy, IN_objectname, IN_layername, error);
 
400
}
 
401
 
 
402
//static
 
403
GArray*
 
404
inkscape_get_node_coordinates (DocumentInterface *doc, const char * IN_shape, GError **error)
 
405
{
 
406
  GArray* OUT_points;
 
407
  DBusGProxy *proxy = doc->proxy;
 
408
  org_inkscape_document_get_node_coordinates (proxy, IN_shape, &OUT_points, error);
 
409
  return OUT_points;
 
410
}
 
411
 
 
412
//static
 
413
gboolean
 
414
inkscape_save (DocumentInterface *doc, GError **error)
 
415
{
 
416
  DBusGProxy *proxy = doc->proxy;
 
417
  return org_inkscape_document_save (proxy, error);
 
418
}
 
419
 
 
420
//static
 
421
gboolean
 
422
inkscape_save_as (DocumentInterface *doc, const char * IN_pathname, GError **error)
 
423
{
 
424
  DBusGProxy *proxy = doc->proxy;
 
425
  return org_inkscape_document_save_as (proxy, IN_pathname, error);
 
426
}
 
427
 
 
428
//static
 
429
gboolean
 
430
inkscape_load (DocumentInterface *doc, const char * IN_pathname, GError **error)
 
431
{
 
432
  DBusGProxy *proxy = doc->proxy;
 
433
  return org_inkscape_document_load (proxy, IN_pathname, error);
 
434
}
 
435
 
 
436
//static
 
437
gboolean
 
438
inkscape_mark_as_unmodified (DocumentInterface *doc, GError **error)
 
439
{
 
440
  DBusGProxy *proxy = doc->proxy;
 
441
  return org_inkscape_document_mark_as_unmodified (proxy, error);
 
442
}
 
443
 
 
444
//static
 
445
gboolean
 
446
inkscape_close (DocumentInterface *doc, GError **error)
 
447
{
 
448
  DBusGProxy *proxy = doc->proxy;
 
449
  return org_inkscape_document_close (proxy, error);
 
450
}
 
451
 
 
452
//static
 
453
gboolean
 
454
inkscape_inkscape_exit (DocumentInterface *doc, GError **error)
 
455
{
 
456
  DBusGProxy *proxy = doc->proxy;
 
457
  return org_inkscape_document_exit (proxy, error);
 
458
}
 
459
 
 
460
//static
 
461
gboolean
 
462
inkscape_undo (DocumentInterface *doc, GError **error)
 
463
{
 
464
  DBusGProxy *proxy = doc->proxy;
 
465
  return org_inkscape_document_undo (proxy, error);
 
466
}
 
467
 
 
468
//static
 
469
gboolean
 
470
inkscape_redo (DocumentInterface *doc, GError **error)
 
471
{
 
472
  DBusGProxy *proxy = doc->proxy;
 
473
  return org_inkscape_document_redo (proxy, error);
 
474
}
 
475
 
 
476
//static
 
477
gboolean
 
478
inkscape_pause_updates (DocumentInterface *doc, GError **error)
 
479
{
 
480
  DBusGProxy *proxy = doc->proxy;
 
481
  return org_inkscape_document_pause_updates (proxy, error);
 
482
}
 
483
 
 
484
//static
 
485
gboolean
 
486
inkscape_resume_updates (DocumentInterface *doc, GError **error)
 
487
{
 
488
  DBusGProxy *proxy = doc->proxy;
 
489
  return org_inkscape_document_resume_updates (proxy, error);
 
490
}
 
491
 
 
492
//static
 
493
gboolean
 
494
inkscape_update (DocumentInterface *doc, GError **error)
 
495
{
 
496
  DBusGProxy *proxy = doc->proxy;
 
497
  return org_inkscape_document_update (proxy, error);
 
498
}
 
499
 
 
500
//static
 
501
char **
 
502
inkscape_selection_get (DocumentInterface *doc, GError **error)
 
503
{
 
504
  char ** OUT_listy;
 
505
  DBusGProxy *proxy = doc->proxy;
 
506
  org_inkscape_document_selection_get (proxy, &OUT_listy, error);
 
507
  return OUT_listy;
 
508
}
 
509
 
 
510
//static
 
511
gboolean
 
512
inkscape_selection_add (DocumentInterface *doc, const char * IN_name, GError **error)
 
513
{
 
514
  DBusGProxy *proxy = doc->proxy;
 
515
  return org_inkscape_document_selection_add (proxy, IN_name, error);
 
516
}
 
517
 
 
518
//static
 
519
gboolean
 
520
inkscape_selection_add_list (DocumentInterface *doc, const char ** IN_name, GError **error)
 
521
{
 
522
  DBusGProxy *proxy = doc->proxy;
 
523
  return org_inkscape_document_selection_add_list (proxy, IN_name, error);
 
524
}
 
525
 
 
526
//static
 
527
gboolean
 
528
inkscape_selection_set (DocumentInterface *doc, const char * IN_name, GError **error)
 
529
{
 
530
  DBusGProxy *proxy = doc->proxy;
 
531
  return org_inkscape_document_selection_set (proxy, IN_name, error);
 
532
}
 
533
 
 
534
//static
 
535
gboolean
 
536
inkscape_selection_set_list (DocumentInterface *doc, const char ** IN_name, GError **error)
 
537
{
 
538
  DBusGProxy *proxy = doc->proxy;
 
539
  return org_inkscape_document_selection_set_list (proxy, IN_name, error);
 
540
}
 
541
 
 
542
//static
 
543
gboolean
 
544
inkscape_selection_rotate (DocumentInterface *doc, const gint IN_angle, GError **error)
 
545
{
 
546
  DBusGProxy *proxy = doc->proxy;
 
547
  return org_inkscape_document_selection_rotate (proxy, IN_angle, error);
 
548
}
 
549
 
 
550
//static
 
551
gboolean
 
552
inkscape_selection_delete (DocumentInterface *doc, GError **error)
 
553
{
 
554
  DBusGProxy *proxy = doc->proxy;
 
555
  return org_inkscape_document_selection_delete (proxy, error);
 
556
}
 
557
 
 
558
//static
 
559
gboolean
 
560
inkscape_selection_clear (DocumentInterface *doc, GError **error)
 
561
{
 
562
  DBusGProxy *proxy = doc->proxy;
 
563
  return org_inkscape_document_selection_clear (proxy, error);
 
564
}
 
565
 
 
566
//static
 
567
gboolean
 
568
inkscape_select_all (DocumentInterface *doc, GError **error)
 
569
{
 
570
  DBusGProxy *proxy = doc->proxy;
 
571
  return org_inkscape_document_select_all (proxy, error);
 
572
}
 
573
 
 
574
//static
 
575
gboolean
 
576
inkscape_select_all_in_all_layers (DocumentInterface *doc, GError **error)
 
577
{
 
578
  DBusGProxy *proxy = doc->proxy;
 
579
  return org_inkscape_document_select_all_in_all_layers (proxy, error);
 
580
}
 
581
 
 
582
//static
 
583
gboolean
 
584
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)
 
585
{
 
586
  DBusGProxy *proxy = doc->proxy;
 
587
  return org_inkscape_document_selection_box (proxy, IN_x, IN_y, IN_x2, IN_y2, IN_replace, error);
 
588
}
 
589
 
 
590
//static
 
591
gboolean
 
592
inkscape_selection_invert (DocumentInterface *doc, GError **error)
 
593
{
 
594
  DBusGProxy *proxy = doc->proxy;
 
595
  return org_inkscape_document_selection_invert (proxy, error);
 
596
}
 
597
 
 
598
//static
 
599
gboolean
 
600
inkscape_selection_group (DocumentInterface *doc, GError **error)
 
601
{
 
602
  DBusGProxy *proxy = doc->proxy;
 
603
  return org_inkscape_document_selection_group (proxy, error);
 
604
}
 
605
 
 
606
//static
 
607
gboolean
 
608
inkscape_selection_ungroup (DocumentInterface *doc, GError **error)
 
609
{
 
610
  DBusGProxy *proxy = doc->proxy;
 
611
  return org_inkscape_document_selection_ungroup (proxy, error);
 
612
}
 
613
 
 
614
//static
 
615
gboolean
 
616
inkscape_selection_cut (DocumentInterface *doc, GError **error)
 
617
{
 
618
  DBusGProxy *proxy = doc->proxy;
 
619
  return org_inkscape_document_selection_cut (proxy, error);
 
620
}
 
621
 
 
622
//static
 
623
gboolean
 
624
inkscape_selection_copy (DocumentInterface *doc, GError **error)
 
625
{
 
626
  DBusGProxy *proxy = doc->proxy;
 
627
  return org_inkscape_document_selection_copy (proxy, error);
 
628
}
 
629
 
 
630
//static
 
631
gboolean
 
632
inkscape_selection_paste (DocumentInterface *doc, GError **error)
 
633
{
 
634
  DBusGProxy *proxy = doc->proxy;
 
635
  return org_inkscape_document_selection_paste (proxy, error);
 
636
}
 
637
 
 
638
//static
 
639
gboolean
 
640
inkscape_selection_scale (DocumentInterface *doc, const gdouble IN_grow, GError **error)
 
641
{
 
642
  DBusGProxy *proxy = doc->proxy;
 
643
  return org_inkscape_document_selection_scale (proxy, IN_grow, error);
 
644
}
 
645
 
 
646
//static
 
647
gboolean
 
648
inkscape_selection_move (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error)
 
649
{
 
650
  DBusGProxy *proxy = doc->proxy;
 
651
  return org_inkscape_document_selection_move (proxy, IN_x, IN_y, error);
 
652
}
 
653
 
 
654
//static
 
655
gboolean
 
656
inkscape_selection_move_to (DocumentInterface *doc, const gdouble IN_x, const gdouble IN_y, GError **error)
 
657
{
 
658
  DBusGProxy *proxy = doc->proxy;
 
659
  return org_inkscape_document_selection_move_to (proxy, IN_x, IN_y, error);
 
660
}
 
661
 
 
662
//static
 
663
gboolean
 
664
inkscape_selection_move_to_layer (DocumentInterface *doc, const char * IN_layer, GError **error)
 
665
{
 
666
  DBusGProxy *proxy = doc->proxy;
 
667
  return org_inkscape_document_selection_move_to_layer (proxy, IN_layer, error);
 
668
}
 
669
 
 
670
//static
 
671
GArray *
 
672
inkscape_selection_get_center (DocumentInterface *doc, GError **error)
 
673
{
 
674
  GArray* OUT_centerpoint;
 
675
  DBusGProxy *proxy = doc->proxy;
 
676
  org_inkscape_document_selection_get_center (proxy, &OUT_centerpoint, error);
 
677
  return OUT_centerpoint;
 
678
}
 
679
 
 
680
//static
 
681
gboolean
 
682
inkscape_selection_to_path (DocumentInterface *doc, GError **error)
 
683
{
 
684
  DBusGProxy *proxy = doc->proxy;
 
685
  return org_inkscape_document_selection_to_path (proxy, error);
 
686
}
 
687
 
 
688
//static
 
689
char *
 
690
inkscape_selection_combine (DocumentInterface *doc, const char * IN_type, GError **error)
 
691
{
 
692
  char * OUT_newpath;
 
693
  DBusGProxy *proxy = doc->proxy;
 
694
  org_inkscape_document_selection_combine (proxy, IN_type, &OUT_newpath, error);
 
695
  return OUT_newpath;
 
696
}
 
697
 
 
698
//static
 
699
char **
 
700
inkscape_selection_divide (DocumentInterface *doc, GError **error)
 
701
{
 
702
  char ** OUT_pieces; 
 
703
  DBusGProxy *proxy = doc->proxy;
 
704
  org_inkscape_document_selection_divide (proxy, &OUT_pieces, error);
 
705
  return OUT_pieces;
 
706
}
 
707
 
 
708
//static
 
709
gboolean
 
710
inkscape_selection_change_level (DocumentInterface *doc, const char * IN_command, GError **error)
 
711
{
 
712
  gboolean OUT_objectsmoved; 
 
713
  DBusGProxy *proxy = doc->proxy;
 
714
  org_inkscape_document_selection_change_level (proxy, IN_command, &OUT_objectsmoved, error);
 
715
  return OUT_objectsmoved;
 
716
}
 
717
 
 
718
//static
 
719
char *
 
720
inkscape_layer_new (DocumentInterface *doc, GError **error)
 
721
{
 
722
  char * OUT_layername;
 
723
  DBusGProxy *proxy = doc->proxy;
 
724
  org_inkscape_document_layer_new (proxy, &OUT_layername, error);
 
725
  return OUT_layername;
 
726
}
 
727
 
 
728
//static
 
729
gboolean
 
730
inkscape_layer_set (DocumentInterface *doc, const char * IN_layer, GError **error)
 
731
{
 
732
  DBusGProxy *proxy = doc->proxy;
 
733
  return org_inkscape_document_layer_set (proxy, IN_layer, error);
 
734
}
 
735
 
 
736
//static
 
737
char **
 
738
inkscape_layer_get_all (DocumentInterface *doc, GError **error)
 
739
{
 
740
  char ** OUT_layers;
 
741
  DBusGProxy *proxy = doc->proxy;
 
742
  org_inkscape_document_layer_get_all (proxy, &OUT_layers, error);
 
743
  return OUT_layers;
 
744
}
 
745
 
 
746
//static
 
747
gboolean
 
748
inkscape_layer_change_level (DocumentInterface *doc, const char * IN_command, GError **error)
 
749
{
 
750
  gboolean OUT_layermoved;
 
751
  DBusGProxy *proxy = doc->proxy;
 
752
  org_inkscape_document_layer_change_level (proxy, IN_command, &OUT_layermoved, error);
 
753
  return OUT_layermoved;
 
754
}
 
755
 
 
756
//static
 
757
gboolean
 
758
inkscape_layer_next (DocumentInterface *doc, GError **error)
 
759
{
 
760
  DBusGProxy *proxy = doc->proxy;
 
761
  return org_inkscape_document_layer_next (proxy, error);
 
762
}
 
763
 
 
764
//static
 
765
gboolean
 
766
inkscape_layer_previous (DocumentInterface *doc, GError **error)
 
767
{
 
768
  DBusGProxy *proxy = doc->proxy;
 
769
  return org_inkscape_document_layer_previous (proxy, error);
 
770
}
 
771
 
 
772
/*
 
773
int
 
774
main (int argc, char** argv) 
 
775
{
 
776
    gchar * result;
 
777
    GError *error = NULL;
 
778
    DocumentInterface * doc = inkscape_desktop_init_dbus ();
 
779
    result = rectangle (doc->proxy, 10, 10, 100, 100, &error);
 
780
    printf("RESULT: %s\n", result);
 
781
     
 
782
    //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);
 
783
    printf("yes\n");
 
784
}
 
785
*/
 
786