Coverage Report

Created: 2025-07-11 07:03

/work/build/subprojects/glib-2.76.5/gio/xdp-dbus.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * This file is generated by gdbus-codegen, do not modify it.
3
 *
4
 * The license of this code is the same as for the D-Bus interface description
5
 * it was derived from. Note that it links to GLib, so must comply with the
6
 * LGPL linking clauses.
7
 */
8
9
#ifdef HAVE_CONFIG_H
10
#  include "config.h"
11
#endif
12
13
#include "xdp-dbus.h"
14
15
#include <string.h>
16
#ifdef G_OS_UNIX
17
#  include <gio/gunixfdlist.h>
18
#endif
19
20
typedef struct
21
{
22
  GDBusArgInfo parent_struct;
23
  gboolean use_gvariant;
24
} _ExtendedGDBusArgInfo;
25
26
typedef struct
27
{
28
  GDBusMethodInfo parent_struct;
29
  const gchar *signal_name;
30
  gboolean pass_fdlist;
31
} _ExtendedGDBusMethodInfo;
32
33
typedef struct
34
{
35
  GDBusSignalInfo parent_struct;
36
  const gchar *signal_name;
37
} _ExtendedGDBusSignalInfo;
38
39
typedef struct
40
{
41
  GDBusPropertyInfo parent_struct;
42
  const gchar *hyphen_name;
43
  guint use_gvariant : 1;
44
  guint emits_changed_signal : 1;
45
} _ExtendedGDBusPropertyInfo;
46
47
typedef struct
48
{
49
  GDBusInterfaceInfo parent_struct;
50
  const gchar *hyphen_name;
51
} _ExtendedGDBusInterfaceInfo;
52
53
typedef struct
54
{
55
  const _ExtendedGDBusPropertyInfo *info;
56
  guint prop_id;
57
  GValue orig_value; /* the value before the change */
58
} ChangedProperty;
59
60
static void
61
_changed_property_free (ChangedProperty *data)
62
0
{
63
0
  g_value_unset (&data->orig_value);
64
0
  g_free (data);
65
0
}
66
67
static gboolean
68
_g_strv_equal0 (gchar **a, gchar **b)
69
0
{
70
0
  gboolean ret = FALSE;
71
0
  guint n;
72
0
  if (a == NULL && b == NULL)
73
0
    {
74
0
      ret = TRUE;
75
0
      goto out;
76
0
    }
77
0
  if (a == NULL || b == NULL)
78
0
    goto out;
79
0
  if (g_strv_length (a) != g_strv_length (b))
80
0
    goto out;
81
0
  for (n = 0; a[n] != NULL; n++)
82
0
    if (g_strcmp0 (a[n], b[n]) != 0)
83
0
      goto out;
84
0
  ret = TRUE;
85
0
out:
86
0
  return ret;
87
0
}
88
89
static gboolean
90
_g_variant_equal0 (GVariant *a, GVariant *b)
91
0
{
92
0
  gboolean ret = FALSE;
93
0
  if (a == NULL && b == NULL)
94
0
    {
95
0
      ret = TRUE;
96
0
      goto out;
97
0
    }
98
0
  if (a == NULL || b == NULL)
99
0
    goto out;
100
0
  ret = g_variant_equal (a, b);
101
0
out:
102
0
  return ret;
103
0
}
104
105
G_GNUC_UNUSED static gboolean
106
_g_value_equal (const GValue *a, const GValue *b)
107
0
{
108
0
  gboolean ret = FALSE;
109
0
  g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
110
0
  switch (G_VALUE_TYPE (a))
111
0
    {
112
0
      case G_TYPE_BOOLEAN:
113
0
        ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
114
0
        break;
115
0
      case G_TYPE_UCHAR:
116
0
        ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
117
0
        break;
118
0
      case G_TYPE_INT:
119
0
        ret = (g_value_get_int (a) == g_value_get_int (b));
120
0
        break;
121
0
      case G_TYPE_UINT:
122
0
        ret = (g_value_get_uint (a) == g_value_get_uint (b));
123
0
        break;
124
0
      case G_TYPE_INT64:
125
0
        ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
126
0
        break;
127
0
      case G_TYPE_UINT64:
128
0
        ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
129
0
        break;
130
0
      case G_TYPE_DOUBLE:
131
0
        {
132
          /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
133
0
          gdouble da = g_value_get_double (a);
134
0
          gdouble db = g_value_get_double (b);
135
0
          ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
136
0
        }
137
0
        break;
138
0
      case G_TYPE_STRING:
139
0
        ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
140
0
        break;
141
0
      case G_TYPE_VARIANT:
142
0
        ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
143
0
        break;
144
0
      default:
145
0
        if (G_VALUE_TYPE (a) == G_TYPE_STRV)
146
0
          ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
147
0
        else
148
0
          g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
149
0
        break;
150
0
    }
151
0
  return ret;
152
0
}
153
154
/* ------------------------------------------------------------------------
155
 * Code for interface org.freedesktop.portal.Documents
156
 * ------------------------------------------------------------------------
157
 */
158
159
/**
160
 * SECTION:GXdpDocuments
161
 * @title: GXdpDocuments
162
 * @short_description: Generated C code for the org.freedesktop.portal.Documents D-Bus interface
163
 *
164
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link> D-Bus interface in C.
165
 */
166
167
/* ---- Introspection data for org.freedesktop.portal.Documents ---- */
168
169
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_get_mount_point_OUT_ARG_path =
170
{
171
  {
172
    -1,
173
    (gchar *) "path",
174
    (gchar *) "ay",
175
    NULL
176
  },
177
  FALSE
178
};
179
180
static const GDBusArgInfo * const _gxdp_documents_method_info_get_mount_point_OUT_ARG_pointers[] =
181
{
182
  &_gxdp_documents_method_info_get_mount_point_OUT_ARG_path.parent_struct,
183
  NULL
184
};
185
186
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_get_mount_point =
187
{
188
  {
189
    -1,
190
    (gchar *) "GetMountPoint",
191
    NULL,
192
    (GDBusArgInfo **) &_gxdp_documents_method_info_get_mount_point_OUT_ARG_pointers,
193
    NULL
194
  },
195
  "handle-get-mount-point",
196
  FALSE
197
};
198
199
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_IN_ARG_o_path_fd =
200
{
201
  {
202
    -1,
203
    (gchar *) "o_path_fd",
204
    (gchar *) "h",
205
    NULL
206
  },
207
  FALSE
208
};
209
210
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_IN_ARG_reuse_existing =
211
{
212
  {
213
    -1,
214
    (gchar *) "reuse_existing",
215
    (gchar *) "b",
216
    NULL
217
  },
218
  FALSE
219
};
220
221
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_IN_ARG_persistent =
222
{
223
  {
224
    -1,
225
    (gchar *) "persistent",
226
    (gchar *) "b",
227
    NULL
228
  },
229
  FALSE
230
};
231
232
static const GDBusArgInfo * const _gxdp_documents_method_info_add_IN_ARG_pointers[] =
233
{
234
  &_gxdp_documents_method_info_add_IN_ARG_o_path_fd.parent_struct,
235
  &_gxdp_documents_method_info_add_IN_ARG_reuse_existing.parent_struct,
236
  &_gxdp_documents_method_info_add_IN_ARG_persistent.parent_struct,
237
  NULL
238
};
239
240
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_OUT_ARG_doc_id =
241
{
242
  {
243
    -1,
244
    (gchar *) "doc_id",
245
    (gchar *) "s",
246
    NULL
247
  },
248
  FALSE
249
};
250
251
static const GDBusArgInfo * const _gxdp_documents_method_info_add_OUT_ARG_pointers[] =
252
{
253
  &_gxdp_documents_method_info_add_OUT_ARG_doc_id.parent_struct,
254
  NULL
255
};
256
257
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_add =
258
{
259
  {
260
    -1,
261
    (gchar *) "Add",
262
    (GDBusArgInfo **) &_gxdp_documents_method_info_add_IN_ARG_pointers,
263
    (GDBusArgInfo **) &_gxdp_documents_method_info_add_OUT_ARG_pointers,
264
    NULL
265
  },
266
  "handle-add",
267
  TRUE
268
};
269
270
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_IN_ARG_o_path_parent_fd =
271
{
272
  {
273
    -1,
274
    (gchar *) "o_path_parent_fd",
275
    (gchar *) "h",
276
    NULL
277
  },
278
  FALSE
279
};
280
281
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_IN_ARG_filename =
282
{
283
  {
284
    -1,
285
    (gchar *) "filename",
286
    (gchar *) "ay",
287
    NULL
288
  },
289
  FALSE
290
};
291
292
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_IN_ARG_reuse_existing =
293
{
294
  {
295
    -1,
296
    (gchar *) "reuse_existing",
297
    (gchar *) "b",
298
    NULL
299
  },
300
  FALSE
301
};
302
303
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_IN_ARG_persistent =
304
{
305
  {
306
    -1,
307
    (gchar *) "persistent",
308
    (gchar *) "b",
309
    NULL
310
  },
311
  FALSE
312
};
313
314
static const GDBusArgInfo * const _gxdp_documents_method_info_add_named_IN_ARG_pointers[] =
315
{
316
  &_gxdp_documents_method_info_add_named_IN_ARG_o_path_parent_fd.parent_struct,
317
  &_gxdp_documents_method_info_add_named_IN_ARG_filename.parent_struct,
318
  &_gxdp_documents_method_info_add_named_IN_ARG_reuse_existing.parent_struct,
319
  &_gxdp_documents_method_info_add_named_IN_ARG_persistent.parent_struct,
320
  NULL
321
};
322
323
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_OUT_ARG_doc_id =
324
{
325
  {
326
    -1,
327
    (gchar *) "doc_id",
328
    (gchar *) "s",
329
    NULL
330
  },
331
  FALSE
332
};
333
334
static const GDBusArgInfo * const _gxdp_documents_method_info_add_named_OUT_ARG_pointers[] =
335
{
336
  &_gxdp_documents_method_info_add_named_OUT_ARG_doc_id.parent_struct,
337
  NULL
338
};
339
340
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_add_named =
341
{
342
  {
343
    -1,
344
    (gchar *) "AddNamed",
345
    (GDBusArgInfo **) &_gxdp_documents_method_info_add_named_IN_ARG_pointers,
346
    (GDBusArgInfo **) &_gxdp_documents_method_info_add_named_OUT_ARG_pointers,
347
    NULL
348
  },
349
  "handle-add-named",
350
  TRUE
351
};
352
353
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_IN_ARG_o_path_fds =
354
{
355
  {
356
    -1,
357
    (gchar *) "o_path_fds",
358
    (gchar *) "ah",
359
    NULL
360
  },
361
  FALSE
362
};
363
364
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_IN_ARG_flags =
365
{
366
  {
367
    -1,
368
    (gchar *) "flags",
369
    (gchar *) "u",
370
    NULL
371
  },
372
  FALSE
373
};
374
375
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_IN_ARG_app_id =
376
{
377
  {
378
    -1,
379
    (gchar *) "app_id",
380
    (gchar *) "s",
381
    NULL
382
  },
383
  FALSE
384
};
385
386
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_IN_ARG_permissions =
387
{
388
  {
389
    -1,
390
    (gchar *) "permissions",
391
    (gchar *) "as",
392
    NULL
393
  },
394
  FALSE
395
};
396
397
static const GDBusArgInfo * const _gxdp_documents_method_info_add_full_IN_ARG_pointers[] =
398
{
399
  &_gxdp_documents_method_info_add_full_IN_ARG_o_path_fds.parent_struct,
400
  &_gxdp_documents_method_info_add_full_IN_ARG_flags.parent_struct,
401
  &_gxdp_documents_method_info_add_full_IN_ARG_app_id.parent_struct,
402
  &_gxdp_documents_method_info_add_full_IN_ARG_permissions.parent_struct,
403
  NULL
404
};
405
406
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_OUT_ARG_doc_ids =
407
{
408
  {
409
    -1,
410
    (gchar *) "doc_ids",
411
    (gchar *) "as",
412
    NULL
413
  },
414
  FALSE
415
};
416
417
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_full_OUT_ARG_extra_out =
418
{
419
  {
420
    -1,
421
    (gchar *) "extra_out",
422
    (gchar *) "a{sv}",
423
    NULL
424
  },
425
  FALSE
426
};
427
428
static const GDBusArgInfo * const _gxdp_documents_method_info_add_full_OUT_ARG_pointers[] =
429
{
430
  &_gxdp_documents_method_info_add_full_OUT_ARG_doc_ids.parent_struct,
431
  &_gxdp_documents_method_info_add_full_OUT_ARG_extra_out.parent_struct,
432
  NULL
433
};
434
435
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_add_full =
436
{
437
  {
438
    -1,
439
    (gchar *) "AddFull",
440
    (GDBusArgInfo **) &_gxdp_documents_method_info_add_full_IN_ARG_pointers,
441
    (GDBusArgInfo **) &_gxdp_documents_method_info_add_full_OUT_ARG_pointers,
442
    NULL
443
  },
444
  "handle-add-full",
445
  TRUE
446
};
447
448
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_o_path_fd =
449
{
450
  {
451
    -1,
452
    (gchar *) "o_path_fd",
453
    (gchar *) "h",
454
    NULL
455
  },
456
  FALSE
457
};
458
459
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_filename =
460
{
461
  {
462
    -1,
463
    (gchar *) "filename",
464
    (gchar *) "ay",
465
    NULL
466
  },
467
  FALSE
468
};
469
470
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_flags =
471
{
472
  {
473
    -1,
474
    (gchar *) "flags",
475
    (gchar *) "u",
476
    NULL
477
  },
478
  FALSE
479
};
480
481
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_app_id =
482
{
483
  {
484
    -1,
485
    (gchar *) "app_id",
486
    (gchar *) "s",
487
    NULL
488
  },
489
  FALSE
490
};
491
492
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_IN_ARG_permissions =
493
{
494
  {
495
    -1,
496
    (gchar *) "permissions",
497
    (gchar *) "as",
498
    NULL
499
  },
500
  FALSE
501
};
502
503
static const GDBusArgInfo * const _gxdp_documents_method_info_add_named_full_IN_ARG_pointers[] =
504
{
505
  &_gxdp_documents_method_info_add_named_full_IN_ARG_o_path_fd.parent_struct,
506
  &_gxdp_documents_method_info_add_named_full_IN_ARG_filename.parent_struct,
507
  &_gxdp_documents_method_info_add_named_full_IN_ARG_flags.parent_struct,
508
  &_gxdp_documents_method_info_add_named_full_IN_ARG_app_id.parent_struct,
509
  &_gxdp_documents_method_info_add_named_full_IN_ARG_permissions.parent_struct,
510
  NULL
511
};
512
513
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_OUT_ARG_doc_id =
514
{
515
  {
516
    -1,
517
    (gchar *) "doc_id",
518
    (gchar *) "s",
519
    NULL
520
  },
521
  FALSE
522
};
523
524
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_add_named_full_OUT_ARG_extra_out =
525
{
526
  {
527
    -1,
528
    (gchar *) "extra_out",
529
    (gchar *) "a{sv}",
530
    NULL
531
  },
532
  FALSE
533
};
534
535
static const GDBusArgInfo * const _gxdp_documents_method_info_add_named_full_OUT_ARG_pointers[] =
536
{
537
  &_gxdp_documents_method_info_add_named_full_OUT_ARG_doc_id.parent_struct,
538
  &_gxdp_documents_method_info_add_named_full_OUT_ARG_extra_out.parent_struct,
539
  NULL
540
};
541
542
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_add_named_full =
543
{
544
  {
545
    -1,
546
    (gchar *) "AddNamedFull",
547
    (GDBusArgInfo **) &_gxdp_documents_method_info_add_named_full_IN_ARG_pointers,
548
    (GDBusArgInfo **) &_gxdp_documents_method_info_add_named_full_OUT_ARG_pointers,
549
    NULL
550
  },
551
  "handle-add-named-full",
552
  TRUE
553
};
554
555
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_grant_permissions_IN_ARG_doc_id =
556
{
557
  {
558
    -1,
559
    (gchar *) "doc_id",
560
    (gchar *) "s",
561
    NULL
562
  },
563
  FALSE
564
};
565
566
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_grant_permissions_IN_ARG_app_id =
567
{
568
  {
569
    -1,
570
    (gchar *) "app_id",
571
    (gchar *) "s",
572
    NULL
573
  },
574
  FALSE
575
};
576
577
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_grant_permissions_IN_ARG_permissions =
578
{
579
  {
580
    -1,
581
    (gchar *) "permissions",
582
    (gchar *) "as",
583
    NULL
584
  },
585
  FALSE
586
};
587
588
static const GDBusArgInfo * const _gxdp_documents_method_info_grant_permissions_IN_ARG_pointers[] =
589
{
590
  &_gxdp_documents_method_info_grant_permissions_IN_ARG_doc_id.parent_struct,
591
  &_gxdp_documents_method_info_grant_permissions_IN_ARG_app_id.parent_struct,
592
  &_gxdp_documents_method_info_grant_permissions_IN_ARG_permissions.parent_struct,
593
  NULL
594
};
595
596
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_grant_permissions =
597
{
598
  {
599
    -1,
600
    (gchar *) "GrantPermissions",
601
    (GDBusArgInfo **) &_gxdp_documents_method_info_grant_permissions_IN_ARG_pointers,
602
    NULL,
603
    NULL
604
  },
605
  "handle-grant-permissions",
606
  FALSE
607
};
608
609
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_revoke_permissions_IN_ARG_doc_id =
610
{
611
  {
612
    -1,
613
    (gchar *) "doc_id",
614
    (gchar *) "s",
615
    NULL
616
  },
617
  FALSE
618
};
619
620
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_revoke_permissions_IN_ARG_app_id =
621
{
622
  {
623
    -1,
624
    (gchar *) "app_id",
625
    (gchar *) "s",
626
    NULL
627
  },
628
  FALSE
629
};
630
631
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_revoke_permissions_IN_ARG_permissions =
632
{
633
  {
634
    -1,
635
    (gchar *) "permissions",
636
    (gchar *) "as",
637
    NULL
638
  },
639
  FALSE
640
};
641
642
static const GDBusArgInfo * const _gxdp_documents_method_info_revoke_permissions_IN_ARG_pointers[] =
643
{
644
  &_gxdp_documents_method_info_revoke_permissions_IN_ARG_doc_id.parent_struct,
645
  &_gxdp_documents_method_info_revoke_permissions_IN_ARG_app_id.parent_struct,
646
  &_gxdp_documents_method_info_revoke_permissions_IN_ARG_permissions.parent_struct,
647
  NULL
648
};
649
650
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_revoke_permissions =
651
{
652
  {
653
    -1,
654
    (gchar *) "RevokePermissions",
655
    (GDBusArgInfo **) &_gxdp_documents_method_info_revoke_permissions_IN_ARG_pointers,
656
    NULL,
657
    NULL
658
  },
659
  "handle-revoke-permissions",
660
  FALSE
661
};
662
663
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_delete_IN_ARG_doc_id =
664
{
665
  {
666
    -1,
667
    (gchar *) "doc_id",
668
    (gchar *) "s",
669
    NULL
670
  },
671
  FALSE
672
};
673
674
static const GDBusArgInfo * const _gxdp_documents_method_info_delete_IN_ARG_pointers[] =
675
{
676
  &_gxdp_documents_method_info_delete_IN_ARG_doc_id.parent_struct,
677
  NULL
678
};
679
680
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_delete =
681
{
682
  {
683
    -1,
684
    (gchar *) "Delete",
685
    (GDBusArgInfo **) &_gxdp_documents_method_info_delete_IN_ARG_pointers,
686
    NULL,
687
    NULL
688
  },
689
  "handle-delete",
690
  FALSE
691
};
692
693
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_lookup_IN_ARG_filename =
694
{
695
  {
696
    -1,
697
    (gchar *) "filename",
698
    (gchar *) "ay",
699
    NULL
700
  },
701
  FALSE
702
};
703
704
static const GDBusArgInfo * const _gxdp_documents_method_info_lookup_IN_ARG_pointers[] =
705
{
706
  &_gxdp_documents_method_info_lookup_IN_ARG_filename.parent_struct,
707
  NULL
708
};
709
710
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_lookup_OUT_ARG_doc_id =
711
{
712
  {
713
    -1,
714
    (gchar *) "doc_id",
715
    (gchar *) "s",
716
    NULL
717
  },
718
  FALSE
719
};
720
721
static const GDBusArgInfo * const _gxdp_documents_method_info_lookup_OUT_ARG_pointers[] =
722
{
723
  &_gxdp_documents_method_info_lookup_OUT_ARG_doc_id.parent_struct,
724
  NULL
725
};
726
727
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_lookup =
728
{
729
  {
730
    -1,
731
    (gchar *) "Lookup",
732
    (GDBusArgInfo **) &_gxdp_documents_method_info_lookup_IN_ARG_pointers,
733
    (GDBusArgInfo **) &_gxdp_documents_method_info_lookup_OUT_ARG_pointers,
734
    NULL
735
  },
736
  "handle-lookup",
737
  FALSE
738
};
739
740
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_info_IN_ARG_doc_id =
741
{
742
  {
743
    -1,
744
    (gchar *) "doc_id",
745
    (gchar *) "s",
746
    NULL
747
  },
748
  FALSE
749
};
750
751
static const GDBusArgInfo * const _gxdp_documents_method_info_info_IN_ARG_pointers[] =
752
{
753
  &_gxdp_documents_method_info_info_IN_ARG_doc_id.parent_struct,
754
  NULL
755
};
756
757
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_info_OUT_ARG_path =
758
{
759
  {
760
    -1,
761
    (gchar *) "path",
762
    (gchar *) "ay",
763
    NULL
764
  },
765
  FALSE
766
};
767
768
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_info_OUT_ARG_apps =
769
{
770
  {
771
    -1,
772
    (gchar *) "apps",
773
    (gchar *) "a{sas}",
774
    NULL
775
  },
776
  FALSE
777
};
778
779
static const GDBusArgInfo * const _gxdp_documents_method_info_info_OUT_ARG_pointers[] =
780
{
781
  &_gxdp_documents_method_info_info_OUT_ARG_path.parent_struct,
782
  &_gxdp_documents_method_info_info_OUT_ARG_apps.parent_struct,
783
  NULL
784
};
785
786
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_info =
787
{
788
  {
789
    -1,
790
    (gchar *) "Info",
791
    (GDBusArgInfo **) &_gxdp_documents_method_info_info_IN_ARG_pointers,
792
    (GDBusArgInfo **) &_gxdp_documents_method_info_info_OUT_ARG_pointers,
793
    NULL
794
  },
795
  "handle-info",
796
  FALSE
797
};
798
799
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_list_IN_ARG_app_id =
800
{
801
  {
802
    -1,
803
    (gchar *) "app_id",
804
    (gchar *) "s",
805
    NULL
806
  },
807
  FALSE
808
};
809
810
static const GDBusArgInfo * const _gxdp_documents_method_info_list_IN_ARG_pointers[] =
811
{
812
  &_gxdp_documents_method_info_list_IN_ARG_app_id.parent_struct,
813
  NULL
814
};
815
816
static const _ExtendedGDBusArgInfo _gxdp_documents_method_info_list_OUT_ARG_docs =
817
{
818
  {
819
    -1,
820
    (gchar *) "docs",
821
    (gchar *) "a{say}",
822
    NULL
823
  },
824
  FALSE
825
};
826
827
static const GDBusArgInfo * const _gxdp_documents_method_info_list_OUT_ARG_pointers[] =
828
{
829
  &_gxdp_documents_method_info_list_OUT_ARG_docs.parent_struct,
830
  NULL
831
};
832
833
static const _ExtendedGDBusMethodInfo _gxdp_documents_method_info_list =
834
{
835
  {
836
    -1,
837
    (gchar *) "List",
838
    (GDBusArgInfo **) &_gxdp_documents_method_info_list_IN_ARG_pointers,
839
    (GDBusArgInfo **) &_gxdp_documents_method_info_list_OUT_ARG_pointers,
840
    NULL
841
  },
842
  "handle-list",
843
  FALSE
844
};
845
846
static const GDBusMethodInfo * const _gxdp_documents_method_info_pointers[] =
847
{
848
  &_gxdp_documents_method_info_get_mount_point.parent_struct,
849
  &_gxdp_documents_method_info_add.parent_struct,
850
  &_gxdp_documents_method_info_add_named.parent_struct,
851
  &_gxdp_documents_method_info_add_full.parent_struct,
852
  &_gxdp_documents_method_info_add_named_full.parent_struct,
853
  &_gxdp_documents_method_info_grant_permissions.parent_struct,
854
  &_gxdp_documents_method_info_revoke_permissions.parent_struct,
855
  &_gxdp_documents_method_info_delete.parent_struct,
856
  &_gxdp_documents_method_info_lookup.parent_struct,
857
  &_gxdp_documents_method_info_info.parent_struct,
858
  &_gxdp_documents_method_info_list.parent_struct,
859
  NULL
860
};
861
862
static const _ExtendedGDBusPropertyInfo _gxdp_documents_property_info_version =
863
{
864
  {
865
    -1,
866
    (gchar *) "version",
867
    (gchar *) "u",
868
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
869
    NULL
870
  },
871
  "version",
872
  FALSE,
873
  TRUE
874
};
875
876
static const GDBusPropertyInfo * const _gxdp_documents_property_info_pointers[] =
877
{
878
  &_gxdp_documents_property_info_version.parent_struct,
879
  NULL
880
};
881
882
static const _ExtendedGDBusInterfaceInfo _gxdp_documents_interface_info =
883
{
884
  {
885
    -1,
886
    (gchar *) "org.freedesktop.portal.Documents",
887
    (GDBusMethodInfo **) &_gxdp_documents_method_info_pointers,
888
    NULL,
889
    (GDBusPropertyInfo **) &_gxdp_documents_property_info_pointers,
890
    NULL
891
  },
892
  "documents",
893
};
894
895
896
/**
897
 * gxdp_documents_interface_info:
898
 *
899
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link> D-Bus interface.
900
 *
901
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
902
 */
903
GDBusInterfaceInfo *
904
gxdp_documents_interface_info (void)
905
0
{
906
0
  return (GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct;
907
0
}
908
909
/**
910
 * gxdp_documents_override_properties:
911
 * @klass: The class structure for a #GObject derived class.
912
 * @property_id_begin: The property id to assign to the first overridden property.
913
 *
914
 * Overrides all #GObject properties in the #GXdpDocuments interface for a concrete class.
915
 * The properties are overridden in the order they are defined.
916
 *
917
 * Returns: The last property id.
918
 */
919
guint
920
gxdp_documents_override_properties (GObjectClass *klass, guint property_id_begin)
921
0
{
922
0
  g_object_class_override_property (klass, property_id_begin++, "version");
923
0
  return property_id_begin - 1;
924
0
}
925
926
927
928
/**
929
 * GXdpDocuments:
930
 *
931
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link>.
932
 */
933
934
/**
935
 * GXdpDocumentsIface:
936
 * @parent_iface: The parent interface.
937
 * @handle_add: Handler for the #GXdpDocuments::handle-add signal.
938
 * @handle_add_full: Handler for the #GXdpDocuments::handle-add-full signal.
939
 * @handle_add_named: Handler for the #GXdpDocuments::handle-add-named signal.
940
 * @handle_add_named_full: Handler for the #GXdpDocuments::handle-add-named-full signal.
941
 * @handle_delete: Handler for the #GXdpDocuments::handle-delete signal.
942
 * @handle_get_mount_point: Handler for the #GXdpDocuments::handle-get-mount-point signal.
943
 * @handle_grant_permissions: Handler for the #GXdpDocuments::handle-grant-permissions signal.
944
 * @handle_info: Handler for the #GXdpDocuments::handle-info signal.
945
 * @handle_list: Handler for the #GXdpDocuments::handle-list signal.
946
 * @handle_lookup: Handler for the #GXdpDocuments::handle-lookup signal.
947
 * @handle_revoke_permissions: Handler for the #GXdpDocuments::handle-revoke-permissions signal.
948
 * @get_version: Getter for the #GXdpDocuments:version property.
949
 *
950
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link>.
951
 */
952
953
typedef GXdpDocumentsIface GXdpDocumentsInterface;
954
G_DEFINE_INTERFACE (GXdpDocuments, gxdp_documents, G_TYPE_OBJECT)
955
956
static void
957
gxdp_documents_default_init (GXdpDocumentsIface *iface)
958
0
{
959
  /* GObject signals for incoming D-Bus method calls: */
960
  /**
961
   * GXdpDocuments::handle-get-mount-point:
962
   * @object: A #GXdpDocuments.
963
   * @invocation: A #GDBusMethodInvocation.
964
   *
965
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GetMountPoint">GetMountPoint()</link> D-Bus method.
966
   *
967
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_get_mount_point() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
968
   *
969
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
970
   */
971
0
  g_signal_new ("handle-get-mount-point",
972
0
    G_TYPE_FROM_INTERFACE (iface),
973
0
    G_SIGNAL_RUN_LAST,
974
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_get_mount_point),
975
0
    g_signal_accumulator_true_handled,
976
0
    NULL,
977
0
    g_cclosure_marshal_generic,
978
0
    G_TYPE_BOOLEAN,
979
0
    1,
980
0
    G_TYPE_DBUS_METHOD_INVOCATION);
981
982
  /**
983
   * GXdpDocuments::handle-add:
984
   * @object: A #GXdpDocuments.
985
   * @invocation: A #GDBusMethodInvocation.
986
   * @fd_list: (nullable): A #GUnixFDList or %NULL.
987
   * @arg_o_path_fd: Argument passed by remote caller.
988
   * @arg_reuse_existing: Argument passed by remote caller.
989
   * @arg_persistent: Argument passed by remote caller.
990
   *
991
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Add">Add()</link> D-Bus method.
992
   *
993
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_add() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
994
   *
995
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
996
   */
997
0
  g_signal_new ("handle-add",
998
0
    G_TYPE_FROM_INTERFACE (iface),
999
0
    G_SIGNAL_RUN_LAST,
1000
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_add),
1001
0
    g_signal_accumulator_true_handled,
1002
0
    NULL,
1003
0
    g_cclosure_marshal_generic,
1004
0
    G_TYPE_BOOLEAN,
1005
0
    5,
1006
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
1007
1008
  /**
1009
   * GXdpDocuments::handle-add-named:
1010
   * @object: A #GXdpDocuments.
1011
   * @invocation: A #GDBusMethodInvocation.
1012
   * @fd_list: (nullable): A #GUnixFDList or %NULL.
1013
   * @arg_o_path_parent_fd: Argument passed by remote caller.
1014
   * @arg_filename: Argument passed by remote caller.
1015
   * @arg_reuse_existing: Argument passed by remote caller.
1016
   * @arg_persistent: Argument passed by remote caller.
1017
   *
1018
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamed">AddNamed()</link> D-Bus method.
1019
   *
1020
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_add_named() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1021
   *
1022
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1023
   */
1024
0
  g_signal_new ("handle-add-named",
1025
0
    G_TYPE_FROM_INTERFACE (iface),
1026
0
    G_SIGNAL_RUN_LAST,
1027
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_add_named),
1028
0
    g_signal_accumulator_true_handled,
1029
0
    NULL,
1030
0
    g_cclosure_marshal_generic,
1031
0
    G_TYPE_BOOLEAN,
1032
0
    6,
1033
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
1034
1035
  /**
1036
   * GXdpDocuments::handle-add-full:
1037
   * @object: A #GXdpDocuments.
1038
   * @invocation: A #GDBusMethodInvocation.
1039
   * @fd_list: (nullable): A #GUnixFDList or %NULL.
1040
   * @arg_o_path_fds: Argument passed by remote caller.
1041
   * @arg_flags: Argument passed by remote caller.
1042
   * @arg_app_id: Argument passed by remote caller.
1043
   * @arg_permissions: Argument passed by remote caller.
1044
   *
1045
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddFull">AddFull()</link> D-Bus method.
1046
   *
1047
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_add_full() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1048
   *
1049
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1050
   */
1051
0
  g_signal_new ("handle-add-full",
1052
0
    G_TYPE_FROM_INTERFACE (iface),
1053
0
    G_SIGNAL_RUN_LAST,
1054
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_add_full),
1055
0
    g_signal_accumulator_true_handled,
1056
0
    NULL,
1057
0
    g_cclosure_marshal_generic,
1058
0
    G_TYPE_BOOLEAN,
1059
0
    6,
1060
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRV);
1061
1062
  /**
1063
   * GXdpDocuments::handle-add-named-full:
1064
   * @object: A #GXdpDocuments.
1065
   * @invocation: A #GDBusMethodInvocation.
1066
   * @fd_list: (nullable): A #GUnixFDList or %NULL.
1067
   * @arg_o_path_fd: Argument passed by remote caller.
1068
   * @arg_filename: Argument passed by remote caller.
1069
   * @arg_flags: Argument passed by remote caller.
1070
   * @arg_app_id: Argument passed by remote caller.
1071
   * @arg_permissions: Argument passed by remote caller.
1072
   *
1073
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamedFull">AddNamedFull()</link> D-Bus method.
1074
   *
1075
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_add_named_full() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1076
   *
1077
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1078
   */
1079
0
  g_signal_new ("handle-add-named-full",
1080
0
    G_TYPE_FROM_INTERFACE (iface),
1081
0
    G_SIGNAL_RUN_LAST,
1082
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_add_named_full),
1083
0
    g_signal_accumulator_true_handled,
1084
0
    NULL,
1085
0
    g_cclosure_marshal_generic,
1086
0
    G_TYPE_BOOLEAN,
1087
0
    7,
1088
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRV);
1089
1090
  /**
1091
   * GXdpDocuments::handle-grant-permissions:
1092
   * @object: A #GXdpDocuments.
1093
   * @invocation: A #GDBusMethodInvocation.
1094
   * @arg_doc_id: Argument passed by remote caller.
1095
   * @arg_app_id: Argument passed by remote caller.
1096
   * @arg_permissions: Argument passed by remote caller.
1097
   *
1098
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GrantPermissions">GrantPermissions()</link> D-Bus method.
1099
   *
1100
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_grant_permissions() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1101
   *
1102
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1103
   */
1104
0
  g_signal_new ("handle-grant-permissions",
1105
0
    G_TYPE_FROM_INTERFACE (iface),
1106
0
    G_SIGNAL_RUN_LAST,
1107
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_grant_permissions),
1108
0
    g_signal_accumulator_true_handled,
1109
0
    NULL,
1110
0
    g_cclosure_marshal_generic,
1111
0
    G_TYPE_BOOLEAN,
1112
0
    4,
1113
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV);
1114
1115
  /**
1116
   * GXdpDocuments::handle-revoke-permissions:
1117
   * @object: A #GXdpDocuments.
1118
   * @invocation: A #GDBusMethodInvocation.
1119
   * @arg_doc_id: Argument passed by remote caller.
1120
   * @arg_app_id: Argument passed by remote caller.
1121
   * @arg_permissions: Argument passed by remote caller.
1122
   *
1123
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.RevokePermissions">RevokePermissions()</link> D-Bus method.
1124
   *
1125
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_revoke_permissions() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1126
   *
1127
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1128
   */
1129
0
  g_signal_new ("handle-revoke-permissions",
1130
0
    G_TYPE_FROM_INTERFACE (iface),
1131
0
    G_SIGNAL_RUN_LAST,
1132
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_revoke_permissions),
1133
0
    g_signal_accumulator_true_handled,
1134
0
    NULL,
1135
0
    g_cclosure_marshal_generic,
1136
0
    G_TYPE_BOOLEAN,
1137
0
    4,
1138
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV);
1139
1140
  /**
1141
   * GXdpDocuments::handle-delete:
1142
   * @object: A #GXdpDocuments.
1143
   * @invocation: A #GDBusMethodInvocation.
1144
   * @arg_doc_id: Argument passed by remote caller.
1145
   *
1146
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Delete">Delete()</link> D-Bus method.
1147
   *
1148
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_delete() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1149
   *
1150
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1151
   */
1152
0
  g_signal_new ("handle-delete",
1153
0
    G_TYPE_FROM_INTERFACE (iface),
1154
0
    G_SIGNAL_RUN_LAST,
1155
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_delete),
1156
0
    g_signal_accumulator_true_handled,
1157
0
    NULL,
1158
0
    g_cclosure_marshal_generic,
1159
0
    G_TYPE_BOOLEAN,
1160
0
    2,
1161
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
1162
1163
  /**
1164
   * GXdpDocuments::handle-lookup:
1165
   * @object: A #GXdpDocuments.
1166
   * @invocation: A #GDBusMethodInvocation.
1167
   * @arg_filename: Argument passed by remote caller.
1168
   *
1169
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Lookup">Lookup()</link> D-Bus method.
1170
   *
1171
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_lookup() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1172
   *
1173
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1174
   */
1175
0
  g_signal_new ("handle-lookup",
1176
0
    G_TYPE_FROM_INTERFACE (iface),
1177
0
    G_SIGNAL_RUN_LAST,
1178
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_lookup),
1179
0
    g_signal_accumulator_true_handled,
1180
0
    NULL,
1181
0
    g_cclosure_marshal_generic,
1182
0
    G_TYPE_BOOLEAN,
1183
0
    2,
1184
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
1185
1186
  /**
1187
   * GXdpDocuments::handle-info:
1188
   * @object: A #GXdpDocuments.
1189
   * @invocation: A #GDBusMethodInvocation.
1190
   * @arg_doc_id: Argument passed by remote caller.
1191
   *
1192
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Info">Info()</link> D-Bus method.
1193
   *
1194
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_info() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1195
   *
1196
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1197
   */
1198
0
  g_signal_new ("handle-info",
1199
0
    G_TYPE_FROM_INTERFACE (iface),
1200
0
    G_SIGNAL_RUN_LAST,
1201
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_info),
1202
0
    g_signal_accumulator_true_handled,
1203
0
    NULL,
1204
0
    g_cclosure_marshal_generic,
1205
0
    G_TYPE_BOOLEAN,
1206
0
    2,
1207
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
1208
1209
  /**
1210
   * GXdpDocuments::handle-list:
1211
   * @object: A #GXdpDocuments.
1212
   * @invocation: A #GDBusMethodInvocation.
1213
   * @arg_app_id: Argument passed by remote caller.
1214
   *
1215
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.List">List()</link> D-Bus method.
1216
   *
1217
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_documents_complete_list() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
1218
   *
1219
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
1220
   */
1221
0
  g_signal_new ("handle-list",
1222
0
    G_TYPE_FROM_INTERFACE (iface),
1223
0
    G_SIGNAL_RUN_LAST,
1224
0
    G_STRUCT_OFFSET (GXdpDocumentsIface, handle_list),
1225
0
    g_signal_accumulator_true_handled,
1226
0
    NULL,
1227
0
    g_cclosure_marshal_generic,
1228
0
    G_TYPE_BOOLEAN,
1229
0
    2,
1230
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
1231
1232
  /* GObject properties for D-Bus properties: */
1233
  /**
1234
   * GXdpDocuments:version:
1235
   *
1236
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-Documents.version">"version"</link>.
1237
   *
1238
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
1239
   */
1240
0
  g_object_interface_install_property (iface,
1241
0
    g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1242
0
}
1243
1244
/**
1245
 * gxdp_documents_get_version: (skip)
1246
 * @object: A #GXdpDocuments.
1247
 *
1248
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-Documents.version">"version"</link> D-Bus property.
1249
 *
1250
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1251
 *
1252
 * Returns: The property value.
1253
 */
1254
guint 
1255
gxdp_documents_get_version (GXdpDocuments *object)
1256
0
{
1257
0
  g_return_val_if_fail (GXDP_IS_DOCUMENTS (object), 0);
1258
1259
0
  return GXDP_DOCUMENTS_GET_IFACE (object)->get_version (object);
1260
0
}
1261
1262
/**
1263
 * gxdp_documents_set_version: (skip)
1264
 * @object: A #GXdpDocuments.
1265
 * @value: The value to set.
1266
 *
1267
 * Sets the <link linkend="gdbus-property-org-freedesktop-portal-Documents.version">"version"</link> D-Bus property to @value.
1268
 *
1269
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1270
 */
1271
void
1272
gxdp_documents_set_version (GXdpDocuments *object, guint value)
1273
0
{
1274
0
  g_object_set (G_OBJECT (object), "version", value, NULL);
1275
0
}
1276
1277
/**
1278
 * gxdp_documents_call_get_mount_point:
1279
 * @proxy: A #GXdpDocumentsProxy.
1280
 * @cancellable: (nullable): A #GCancellable or %NULL.
1281
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1282
 * @user_data: User data to pass to @callback.
1283
 *
1284
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GetMountPoint">GetMountPoint()</link> D-Bus method on @proxy.
1285
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
1286
 * You can then call gxdp_documents_call_get_mount_point_finish() to get the result of the operation.
1287
 *
1288
 * See gxdp_documents_call_get_mount_point_sync() for the synchronous, blocking version of this method.
1289
 */
1290
void
1291
gxdp_documents_call_get_mount_point (
1292
    GXdpDocuments *proxy,
1293
    GCancellable *cancellable,
1294
    GAsyncReadyCallback callback,
1295
    gpointer user_data)
1296
0
{
1297
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1298
0
    "GetMountPoint",
1299
0
    g_variant_new ("()"),
1300
0
    G_DBUS_CALL_FLAGS_NONE,
1301
0
    -1,
1302
0
    cancellable,
1303
0
    callback,
1304
0
    user_data);
1305
0
}
1306
1307
/**
1308
 * gxdp_documents_call_get_mount_point_finish:
1309
 * @proxy: A #GXdpDocumentsProxy.
1310
 * @out_path: (out) (optional): Return location for return parameter or %NULL to ignore.
1311
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_get_mount_point().
1312
 * @error: Return location for error or %NULL.
1313
 *
1314
 * Finishes an operation started with gxdp_documents_call_get_mount_point().
1315
 *
1316
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1317
 */
1318
gboolean
1319
gxdp_documents_call_get_mount_point_finish (
1320
    GXdpDocuments *proxy,
1321
    gchar **out_path,
1322
    GAsyncResult *res,
1323
    GError **error)
1324
0
{
1325
0
  GVariant *_ret;
1326
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1327
0
  if (_ret == NULL)
1328
0
    goto _out;
1329
0
  g_variant_get (_ret,
1330
0
                 "(^ay)",
1331
0
                 out_path);
1332
0
  g_variant_unref (_ret);
1333
0
_out:
1334
0
  return _ret != NULL;
1335
0
}
1336
1337
/**
1338
 * gxdp_documents_call_get_mount_point_sync:
1339
 * @proxy: A #GXdpDocumentsProxy.
1340
 * @out_path: (out) (optional): Return location for return parameter or %NULL to ignore.
1341
 * @cancellable: (nullable): A #GCancellable or %NULL.
1342
 * @error: Return location for error or %NULL.
1343
 *
1344
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GetMountPoint">GetMountPoint()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1345
 *
1346
 * See gxdp_documents_call_get_mount_point() for the asynchronous version of this method.
1347
 *
1348
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1349
 */
1350
gboolean
1351
gxdp_documents_call_get_mount_point_sync (
1352
    GXdpDocuments *proxy,
1353
    gchar **out_path,
1354
    GCancellable *cancellable,
1355
    GError **error)
1356
0
{
1357
0
  GVariant *_ret;
1358
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
1359
0
    "GetMountPoint",
1360
0
    g_variant_new ("()"),
1361
0
    G_DBUS_CALL_FLAGS_NONE,
1362
0
    -1,
1363
0
    cancellable,
1364
0
    error);
1365
0
  if (_ret == NULL)
1366
0
    goto _out;
1367
0
  g_variant_get (_ret,
1368
0
                 "(^ay)",
1369
0
                 out_path);
1370
0
  g_variant_unref (_ret);
1371
0
_out:
1372
0
  return _ret != NULL;
1373
0
}
1374
1375
/**
1376
 * gxdp_documents_call_add:
1377
 * @proxy: A #GXdpDocumentsProxy.
1378
 * @arg_o_path_fd: Argument to pass with the method invocation.
1379
 * @arg_reuse_existing: Argument to pass with the method invocation.
1380
 * @arg_persistent: Argument to pass with the method invocation.
1381
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
1382
 * @cancellable: (nullable): A #GCancellable or %NULL.
1383
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1384
 * @user_data: User data to pass to @callback.
1385
 *
1386
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Add">Add()</link> D-Bus method on @proxy.
1387
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
1388
 * You can then call gxdp_documents_call_add_finish() to get the result of the operation.
1389
 *
1390
 * See gxdp_documents_call_add_sync() for the synchronous, blocking version of this method.
1391
 */
1392
void
1393
gxdp_documents_call_add (
1394
    GXdpDocuments *proxy,
1395
    GVariant *arg_o_path_fd,
1396
    gboolean arg_reuse_existing,
1397
    gboolean arg_persistent,
1398
    GUnixFDList *fd_list,
1399
    GCancellable *cancellable,
1400
    GAsyncReadyCallback callback,
1401
    gpointer user_data)
1402
0
{
1403
0
  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
1404
0
    "Add",
1405
0
    g_variant_new ("(@hbb)",
1406
0
                   arg_o_path_fd,
1407
0
                   arg_reuse_existing,
1408
0
                   arg_persistent),
1409
0
    G_DBUS_CALL_FLAGS_NONE,
1410
0
    -1,
1411
0
    fd_list,
1412
0
    cancellable,
1413
0
    callback,
1414
0
    user_data);
1415
0
}
1416
1417
/**
1418
 * gxdp_documents_call_add_finish:
1419
 * @proxy: A #GXdpDocumentsProxy.
1420
 * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore.
1421
 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
1422
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add().
1423
 * @error: Return location for error or %NULL.
1424
 *
1425
 * Finishes an operation started with gxdp_documents_call_add().
1426
 *
1427
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1428
 */
1429
gboolean
1430
gxdp_documents_call_add_finish (
1431
    GXdpDocuments *proxy,
1432
    gchar **out_doc_id,
1433
    GUnixFDList **out_fd_list,
1434
    GAsyncResult *res,
1435
    GError **error)
1436
0
{
1437
0
  GVariant *_ret;
1438
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
1439
0
  if (_ret == NULL)
1440
0
    goto _out;
1441
0
  g_variant_get (_ret,
1442
0
                 "(s)",
1443
0
                 out_doc_id);
1444
0
  g_variant_unref (_ret);
1445
0
_out:
1446
0
  return _ret != NULL;
1447
0
}
1448
1449
/**
1450
 * gxdp_documents_call_add_sync:
1451
 * @proxy: A #GXdpDocumentsProxy.
1452
 * @arg_o_path_fd: Argument to pass with the method invocation.
1453
 * @arg_reuse_existing: Argument to pass with the method invocation.
1454
 * @arg_persistent: Argument to pass with the method invocation.
1455
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
1456
 * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore.
1457
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
1458
 * @cancellable: (nullable): A #GCancellable or %NULL.
1459
 * @error: Return location for error or %NULL.
1460
 *
1461
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Add">Add()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1462
 *
1463
 * See gxdp_documents_call_add() for the asynchronous version of this method.
1464
 *
1465
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1466
 */
1467
gboolean
1468
gxdp_documents_call_add_sync (
1469
    GXdpDocuments *proxy,
1470
    GVariant *arg_o_path_fd,
1471
    gboolean arg_reuse_existing,
1472
    gboolean arg_persistent,
1473
    GUnixFDList  *fd_list,
1474
    gchar **out_doc_id,
1475
    GUnixFDList **out_fd_list,
1476
    GCancellable *cancellable,
1477
    GError **error)
1478
0
{
1479
0
  GVariant *_ret;
1480
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
1481
0
    "Add",
1482
0
    g_variant_new ("(@hbb)",
1483
0
                   arg_o_path_fd,
1484
0
                   arg_reuse_existing,
1485
0
                   arg_persistent),
1486
0
    G_DBUS_CALL_FLAGS_NONE,
1487
0
    -1,
1488
0
    fd_list,
1489
0
    out_fd_list,
1490
0
    cancellable,
1491
0
    error);
1492
0
  if (_ret == NULL)
1493
0
    goto _out;
1494
0
  g_variant_get (_ret,
1495
0
                 "(s)",
1496
0
                 out_doc_id);
1497
0
  g_variant_unref (_ret);
1498
0
_out:
1499
0
  return _ret != NULL;
1500
0
}
1501
1502
/**
1503
 * gxdp_documents_call_add_named:
1504
 * @proxy: A #GXdpDocumentsProxy.
1505
 * @arg_o_path_parent_fd: Argument to pass with the method invocation.
1506
 * @arg_filename: Argument to pass with the method invocation.
1507
 * @arg_reuse_existing: Argument to pass with the method invocation.
1508
 * @arg_persistent: Argument to pass with the method invocation.
1509
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
1510
 * @cancellable: (nullable): A #GCancellable or %NULL.
1511
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1512
 * @user_data: User data to pass to @callback.
1513
 *
1514
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamed">AddNamed()</link> D-Bus method on @proxy.
1515
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
1516
 * You can then call gxdp_documents_call_add_named_finish() to get the result of the operation.
1517
 *
1518
 * See gxdp_documents_call_add_named_sync() for the synchronous, blocking version of this method.
1519
 */
1520
void
1521
gxdp_documents_call_add_named (
1522
    GXdpDocuments *proxy,
1523
    GVariant *arg_o_path_parent_fd,
1524
    const gchar *arg_filename,
1525
    gboolean arg_reuse_existing,
1526
    gboolean arg_persistent,
1527
    GUnixFDList *fd_list,
1528
    GCancellable *cancellable,
1529
    GAsyncReadyCallback callback,
1530
    gpointer user_data)
1531
0
{
1532
0
  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
1533
0
    "AddNamed",
1534
0
    g_variant_new ("(@h^aybb)",
1535
0
                   arg_o_path_parent_fd,
1536
0
                   arg_filename,
1537
0
                   arg_reuse_existing,
1538
0
                   arg_persistent),
1539
0
    G_DBUS_CALL_FLAGS_NONE,
1540
0
    -1,
1541
0
    fd_list,
1542
0
    cancellable,
1543
0
    callback,
1544
0
    user_data);
1545
0
}
1546
1547
/**
1548
 * gxdp_documents_call_add_named_finish:
1549
 * @proxy: A #GXdpDocumentsProxy.
1550
 * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore.
1551
 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
1552
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add_named().
1553
 * @error: Return location for error or %NULL.
1554
 *
1555
 * Finishes an operation started with gxdp_documents_call_add_named().
1556
 *
1557
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1558
 */
1559
gboolean
1560
gxdp_documents_call_add_named_finish (
1561
    GXdpDocuments *proxy,
1562
    gchar **out_doc_id,
1563
    GUnixFDList **out_fd_list,
1564
    GAsyncResult *res,
1565
    GError **error)
1566
0
{
1567
0
  GVariant *_ret;
1568
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
1569
0
  if (_ret == NULL)
1570
0
    goto _out;
1571
0
  g_variant_get (_ret,
1572
0
                 "(s)",
1573
0
                 out_doc_id);
1574
0
  g_variant_unref (_ret);
1575
0
_out:
1576
0
  return _ret != NULL;
1577
0
}
1578
1579
/**
1580
 * gxdp_documents_call_add_named_sync:
1581
 * @proxy: A #GXdpDocumentsProxy.
1582
 * @arg_o_path_parent_fd: Argument to pass with the method invocation.
1583
 * @arg_filename: Argument to pass with the method invocation.
1584
 * @arg_reuse_existing: Argument to pass with the method invocation.
1585
 * @arg_persistent: Argument to pass with the method invocation.
1586
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
1587
 * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore.
1588
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
1589
 * @cancellable: (nullable): A #GCancellable or %NULL.
1590
 * @error: Return location for error or %NULL.
1591
 *
1592
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamed">AddNamed()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1593
 *
1594
 * See gxdp_documents_call_add_named() for the asynchronous version of this method.
1595
 *
1596
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1597
 */
1598
gboolean
1599
gxdp_documents_call_add_named_sync (
1600
    GXdpDocuments *proxy,
1601
    GVariant *arg_o_path_parent_fd,
1602
    const gchar *arg_filename,
1603
    gboolean arg_reuse_existing,
1604
    gboolean arg_persistent,
1605
    GUnixFDList  *fd_list,
1606
    gchar **out_doc_id,
1607
    GUnixFDList **out_fd_list,
1608
    GCancellable *cancellable,
1609
    GError **error)
1610
0
{
1611
0
  GVariant *_ret;
1612
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
1613
0
    "AddNamed",
1614
0
    g_variant_new ("(@h^aybb)",
1615
0
                   arg_o_path_parent_fd,
1616
0
                   arg_filename,
1617
0
                   arg_reuse_existing,
1618
0
                   arg_persistent),
1619
0
    G_DBUS_CALL_FLAGS_NONE,
1620
0
    -1,
1621
0
    fd_list,
1622
0
    out_fd_list,
1623
0
    cancellable,
1624
0
    error);
1625
0
  if (_ret == NULL)
1626
0
    goto _out;
1627
0
  g_variant_get (_ret,
1628
0
                 "(s)",
1629
0
                 out_doc_id);
1630
0
  g_variant_unref (_ret);
1631
0
_out:
1632
0
  return _ret != NULL;
1633
0
}
1634
1635
/**
1636
 * gxdp_documents_call_add_full:
1637
 * @proxy: A #GXdpDocumentsProxy.
1638
 * @arg_o_path_fds: Argument to pass with the method invocation.
1639
 * @arg_flags: Argument to pass with the method invocation.
1640
 * @arg_app_id: Argument to pass with the method invocation.
1641
 * @arg_permissions: Argument to pass with the method invocation.
1642
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
1643
 * @cancellable: (nullable): A #GCancellable or %NULL.
1644
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1645
 * @user_data: User data to pass to @callback.
1646
 *
1647
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddFull">AddFull()</link> D-Bus method on @proxy.
1648
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
1649
 * You can then call gxdp_documents_call_add_full_finish() to get the result of the operation.
1650
 *
1651
 * See gxdp_documents_call_add_full_sync() for the synchronous, blocking version of this method.
1652
 */
1653
void
1654
gxdp_documents_call_add_full (
1655
    GXdpDocuments *proxy,
1656
    GVariant *arg_o_path_fds,
1657
    guint arg_flags,
1658
    const gchar *arg_app_id,
1659
    const gchar *const *arg_permissions,
1660
    GUnixFDList *fd_list,
1661
    GCancellable *cancellable,
1662
    GAsyncReadyCallback callback,
1663
    gpointer user_data)
1664
0
{
1665
0
  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
1666
0
    "AddFull",
1667
0
    g_variant_new ("(@ahus^as)",
1668
0
                   arg_o_path_fds,
1669
0
                   arg_flags,
1670
0
                   arg_app_id,
1671
0
                   arg_permissions),
1672
0
    G_DBUS_CALL_FLAGS_NONE,
1673
0
    -1,
1674
0
    fd_list,
1675
0
    cancellable,
1676
0
    callback,
1677
0
    user_data);
1678
0
}
1679
1680
/**
1681
 * gxdp_documents_call_add_full_finish:
1682
 * @proxy: A #GXdpDocumentsProxy.
1683
 * @out_doc_ids: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1684
 * @out_extra_out: (out) (optional): Return location for return parameter or %NULL to ignore.
1685
 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
1686
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add_full().
1687
 * @error: Return location for error or %NULL.
1688
 *
1689
 * Finishes an operation started with gxdp_documents_call_add_full().
1690
 *
1691
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1692
 */
1693
gboolean
1694
gxdp_documents_call_add_full_finish (
1695
    GXdpDocuments *proxy,
1696
    gchar ***out_doc_ids,
1697
    GVariant **out_extra_out,
1698
    GUnixFDList **out_fd_list,
1699
    GAsyncResult *res,
1700
    GError **error)
1701
0
{
1702
0
  GVariant *_ret;
1703
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
1704
0
  if (_ret == NULL)
1705
0
    goto _out;
1706
0
  g_variant_get (_ret,
1707
0
                 "(^as@a{sv})",
1708
0
                 out_doc_ids,
1709
0
                 out_extra_out);
1710
0
  g_variant_unref (_ret);
1711
0
_out:
1712
0
  return _ret != NULL;
1713
0
}
1714
1715
/**
1716
 * gxdp_documents_call_add_full_sync:
1717
 * @proxy: A #GXdpDocumentsProxy.
1718
 * @arg_o_path_fds: Argument to pass with the method invocation.
1719
 * @arg_flags: Argument to pass with the method invocation.
1720
 * @arg_app_id: Argument to pass with the method invocation.
1721
 * @arg_permissions: Argument to pass with the method invocation.
1722
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
1723
 * @out_doc_ids: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
1724
 * @out_extra_out: (out) (optional): Return location for return parameter or %NULL to ignore.
1725
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
1726
 * @cancellable: (nullable): A #GCancellable or %NULL.
1727
 * @error: Return location for error or %NULL.
1728
 *
1729
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddFull">AddFull()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1730
 *
1731
 * See gxdp_documents_call_add_full() for the asynchronous version of this method.
1732
 *
1733
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1734
 */
1735
gboolean
1736
gxdp_documents_call_add_full_sync (
1737
    GXdpDocuments *proxy,
1738
    GVariant *arg_o_path_fds,
1739
    guint arg_flags,
1740
    const gchar *arg_app_id,
1741
    const gchar *const *arg_permissions,
1742
    GUnixFDList  *fd_list,
1743
    gchar ***out_doc_ids,
1744
    GVariant **out_extra_out,
1745
    GUnixFDList **out_fd_list,
1746
    GCancellable *cancellable,
1747
    GError **error)
1748
0
{
1749
0
  GVariant *_ret;
1750
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
1751
0
    "AddFull",
1752
0
    g_variant_new ("(@ahus^as)",
1753
0
                   arg_o_path_fds,
1754
0
                   arg_flags,
1755
0
                   arg_app_id,
1756
0
                   arg_permissions),
1757
0
    G_DBUS_CALL_FLAGS_NONE,
1758
0
    -1,
1759
0
    fd_list,
1760
0
    out_fd_list,
1761
0
    cancellable,
1762
0
    error);
1763
0
  if (_ret == NULL)
1764
0
    goto _out;
1765
0
  g_variant_get (_ret,
1766
0
                 "(^as@a{sv})",
1767
0
                 out_doc_ids,
1768
0
                 out_extra_out);
1769
0
  g_variant_unref (_ret);
1770
0
_out:
1771
0
  return _ret != NULL;
1772
0
}
1773
1774
/**
1775
 * gxdp_documents_call_add_named_full:
1776
 * @proxy: A #GXdpDocumentsProxy.
1777
 * @arg_o_path_fd: Argument to pass with the method invocation.
1778
 * @arg_filename: Argument to pass with the method invocation.
1779
 * @arg_flags: Argument to pass with the method invocation.
1780
 * @arg_app_id: Argument to pass with the method invocation.
1781
 * @arg_permissions: Argument to pass with the method invocation.
1782
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
1783
 * @cancellable: (nullable): A #GCancellable or %NULL.
1784
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1785
 * @user_data: User data to pass to @callback.
1786
 *
1787
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamedFull">AddNamedFull()</link> D-Bus method on @proxy.
1788
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
1789
 * You can then call gxdp_documents_call_add_named_full_finish() to get the result of the operation.
1790
 *
1791
 * See gxdp_documents_call_add_named_full_sync() for the synchronous, blocking version of this method.
1792
 */
1793
void
1794
gxdp_documents_call_add_named_full (
1795
    GXdpDocuments *proxy,
1796
    GVariant *arg_o_path_fd,
1797
    const gchar *arg_filename,
1798
    guint arg_flags,
1799
    const gchar *arg_app_id,
1800
    const gchar *const *arg_permissions,
1801
    GUnixFDList *fd_list,
1802
    GCancellable *cancellable,
1803
    GAsyncReadyCallback callback,
1804
    gpointer user_data)
1805
0
{
1806
0
  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
1807
0
    "AddNamedFull",
1808
0
    g_variant_new ("(@h^ayus^as)",
1809
0
                   arg_o_path_fd,
1810
0
                   arg_filename,
1811
0
                   arg_flags,
1812
0
                   arg_app_id,
1813
0
                   arg_permissions),
1814
0
    G_DBUS_CALL_FLAGS_NONE,
1815
0
    -1,
1816
0
    fd_list,
1817
0
    cancellable,
1818
0
    callback,
1819
0
    user_data);
1820
0
}
1821
1822
/**
1823
 * gxdp_documents_call_add_named_full_finish:
1824
 * @proxy: A #GXdpDocumentsProxy.
1825
 * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore.
1826
 * @out_extra_out: (out) (optional): Return location for return parameter or %NULL to ignore.
1827
 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
1828
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add_named_full().
1829
 * @error: Return location for error or %NULL.
1830
 *
1831
 * Finishes an operation started with gxdp_documents_call_add_named_full().
1832
 *
1833
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1834
 */
1835
gboolean
1836
gxdp_documents_call_add_named_full_finish (
1837
    GXdpDocuments *proxy,
1838
    gchar **out_doc_id,
1839
    GVariant **out_extra_out,
1840
    GUnixFDList **out_fd_list,
1841
    GAsyncResult *res,
1842
    GError **error)
1843
0
{
1844
0
  GVariant *_ret;
1845
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
1846
0
  if (_ret == NULL)
1847
0
    goto _out;
1848
0
  g_variant_get (_ret,
1849
0
                 "(s@a{sv})",
1850
0
                 out_doc_id,
1851
0
                 out_extra_out);
1852
0
  g_variant_unref (_ret);
1853
0
_out:
1854
0
  return _ret != NULL;
1855
0
}
1856
1857
/**
1858
 * gxdp_documents_call_add_named_full_sync:
1859
 * @proxy: A #GXdpDocumentsProxy.
1860
 * @arg_o_path_fd: Argument to pass with the method invocation.
1861
 * @arg_filename: Argument to pass with the method invocation.
1862
 * @arg_flags: Argument to pass with the method invocation.
1863
 * @arg_app_id: Argument to pass with the method invocation.
1864
 * @arg_permissions: Argument to pass with the method invocation.
1865
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
1866
 * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore.
1867
 * @out_extra_out: (out) (optional): Return location for return parameter or %NULL to ignore.
1868
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
1869
 * @cancellable: (nullable): A #GCancellable or %NULL.
1870
 * @error: Return location for error or %NULL.
1871
 *
1872
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamedFull">AddNamedFull()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1873
 *
1874
 * See gxdp_documents_call_add_named_full() for the asynchronous version of this method.
1875
 *
1876
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1877
 */
1878
gboolean
1879
gxdp_documents_call_add_named_full_sync (
1880
    GXdpDocuments *proxy,
1881
    GVariant *arg_o_path_fd,
1882
    const gchar *arg_filename,
1883
    guint arg_flags,
1884
    const gchar *arg_app_id,
1885
    const gchar *const *arg_permissions,
1886
    GUnixFDList  *fd_list,
1887
    gchar **out_doc_id,
1888
    GVariant **out_extra_out,
1889
    GUnixFDList **out_fd_list,
1890
    GCancellable *cancellable,
1891
    GError **error)
1892
0
{
1893
0
  GVariant *_ret;
1894
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
1895
0
    "AddNamedFull",
1896
0
    g_variant_new ("(@h^ayus^as)",
1897
0
                   arg_o_path_fd,
1898
0
                   arg_filename,
1899
0
                   arg_flags,
1900
0
                   arg_app_id,
1901
0
                   arg_permissions),
1902
0
    G_DBUS_CALL_FLAGS_NONE,
1903
0
    -1,
1904
0
    fd_list,
1905
0
    out_fd_list,
1906
0
    cancellable,
1907
0
    error);
1908
0
  if (_ret == NULL)
1909
0
    goto _out;
1910
0
  g_variant_get (_ret,
1911
0
                 "(s@a{sv})",
1912
0
                 out_doc_id,
1913
0
                 out_extra_out);
1914
0
  g_variant_unref (_ret);
1915
0
_out:
1916
0
  return _ret != NULL;
1917
0
}
1918
1919
/**
1920
 * gxdp_documents_call_grant_permissions:
1921
 * @proxy: A #GXdpDocumentsProxy.
1922
 * @arg_doc_id: Argument to pass with the method invocation.
1923
 * @arg_app_id: Argument to pass with the method invocation.
1924
 * @arg_permissions: Argument to pass with the method invocation.
1925
 * @cancellable: (nullable): A #GCancellable or %NULL.
1926
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
1927
 * @user_data: User data to pass to @callback.
1928
 *
1929
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GrantPermissions">GrantPermissions()</link> D-Bus method on @proxy.
1930
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
1931
 * You can then call gxdp_documents_call_grant_permissions_finish() to get the result of the operation.
1932
 *
1933
 * See gxdp_documents_call_grant_permissions_sync() for the synchronous, blocking version of this method.
1934
 */
1935
void
1936
gxdp_documents_call_grant_permissions (
1937
    GXdpDocuments *proxy,
1938
    const gchar *arg_doc_id,
1939
    const gchar *arg_app_id,
1940
    const gchar *const *arg_permissions,
1941
    GCancellable *cancellable,
1942
    GAsyncReadyCallback callback,
1943
    gpointer user_data)
1944
0
{
1945
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
1946
0
    "GrantPermissions",
1947
0
    g_variant_new ("(ss^as)",
1948
0
                   arg_doc_id,
1949
0
                   arg_app_id,
1950
0
                   arg_permissions),
1951
0
    G_DBUS_CALL_FLAGS_NONE,
1952
0
    -1,
1953
0
    cancellable,
1954
0
    callback,
1955
0
    user_data);
1956
0
}
1957
1958
/**
1959
 * gxdp_documents_call_grant_permissions_finish:
1960
 * @proxy: A #GXdpDocumentsProxy.
1961
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_grant_permissions().
1962
 * @error: Return location for error or %NULL.
1963
 *
1964
 * Finishes an operation started with gxdp_documents_call_grant_permissions().
1965
 *
1966
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1967
 */
1968
gboolean
1969
gxdp_documents_call_grant_permissions_finish (
1970
    GXdpDocuments *proxy,
1971
    GAsyncResult *res,
1972
    GError **error)
1973
0
{
1974
0
  GVariant *_ret;
1975
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
1976
0
  if (_ret == NULL)
1977
0
    goto _out;
1978
0
  g_variant_get (_ret,
1979
0
                 "()");
1980
0
  g_variant_unref (_ret);
1981
0
_out:
1982
0
  return _ret != NULL;
1983
0
}
1984
1985
/**
1986
 * gxdp_documents_call_grant_permissions_sync:
1987
 * @proxy: A #GXdpDocumentsProxy.
1988
 * @arg_doc_id: Argument to pass with the method invocation.
1989
 * @arg_app_id: Argument to pass with the method invocation.
1990
 * @arg_permissions: Argument to pass with the method invocation.
1991
 * @cancellable: (nullable): A #GCancellable or %NULL.
1992
 * @error: Return location for error or %NULL.
1993
 *
1994
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GrantPermissions">GrantPermissions()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
1995
 *
1996
 * See gxdp_documents_call_grant_permissions() for the asynchronous version of this method.
1997
 *
1998
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
1999
 */
2000
gboolean
2001
gxdp_documents_call_grant_permissions_sync (
2002
    GXdpDocuments *proxy,
2003
    const gchar *arg_doc_id,
2004
    const gchar *arg_app_id,
2005
    const gchar *const *arg_permissions,
2006
    GCancellable *cancellable,
2007
    GError **error)
2008
0
{
2009
0
  GVariant *_ret;
2010
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2011
0
    "GrantPermissions",
2012
0
    g_variant_new ("(ss^as)",
2013
0
                   arg_doc_id,
2014
0
                   arg_app_id,
2015
0
                   arg_permissions),
2016
0
    G_DBUS_CALL_FLAGS_NONE,
2017
0
    -1,
2018
0
    cancellable,
2019
0
    error);
2020
0
  if (_ret == NULL)
2021
0
    goto _out;
2022
0
  g_variant_get (_ret,
2023
0
                 "()");
2024
0
  g_variant_unref (_ret);
2025
0
_out:
2026
0
  return _ret != NULL;
2027
0
}
2028
2029
/**
2030
 * gxdp_documents_call_revoke_permissions:
2031
 * @proxy: A #GXdpDocumentsProxy.
2032
 * @arg_doc_id: Argument to pass with the method invocation.
2033
 * @arg_app_id: Argument to pass with the method invocation.
2034
 * @arg_permissions: Argument to pass with the method invocation.
2035
 * @cancellable: (nullable): A #GCancellable or %NULL.
2036
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2037
 * @user_data: User data to pass to @callback.
2038
 *
2039
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.RevokePermissions">RevokePermissions()</link> D-Bus method on @proxy.
2040
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2041
 * You can then call gxdp_documents_call_revoke_permissions_finish() to get the result of the operation.
2042
 *
2043
 * See gxdp_documents_call_revoke_permissions_sync() for the synchronous, blocking version of this method.
2044
 */
2045
void
2046
gxdp_documents_call_revoke_permissions (
2047
    GXdpDocuments *proxy,
2048
    const gchar *arg_doc_id,
2049
    const gchar *arg_app_id,
2050
    const gchar *const *arg_permissions,
2051
    GCancellable *cancellable,
2052
    GAsyncReadyCallback callback,
2053
    gpointer user_data)
2054
0
{
2055
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2056
0
    "RevokePermissions",
2057
0
    g_variant_new ("(ss^as)",
2058
0
                   arg_doc_id,
2059
0
                   arg_app_id,
2060
0
                   arg_permissions),
2061
0
    G_DBUS_CALL_FLAGS_NONE,
2062
0
    -1,
2063
0
    cancellable,
2064
0
    callback,
2065
0
    user_data);
2066
0
}
2067
2068
/**
2069
 * gxdp_documents_call_revoke_permissions_finish:
2070
 * @proxy: A #GXdpDocumentsProxy.
2071
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_revoke_permissions().
2072
 * @error: Return location for error or %NULL.
2073
 *
2074
 * Finishes an operation started with gxdp_documents_call_revoke_permissions().
2075
 *
2076
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2077
 */
2078
gboolean
2079
gxdp_documents_call_revoke_permissions_finish (
2080
    GXdpDocuments *proxy,
2081
    GAsyncResult *res,
2082
    GError **error)
2083
0
{
2084
0
  GVariant *_ret;
2085
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2086
0
  if (_ret == NULL)
2087
0
    goto _out;
2088
0
  g_variant_get (_ret,
2089
0
                 "()");
2090
0
  g_variant_unref (_ret);
2091
0
_out:
2092
0
  return _ret != NULL;
2093
0
}
2094
2095
/**
2096
 * gxdp_documents_call_revoke_permissions_sync:
2097
 * @proxy: A #GXdpDocumentsProxy.
2098
 * @arg_doc_id: Argument to pass with the method invocation.
2099
 * @arg_app_id: Argument to pass with the method invocation.
2100
 * @arg_permissions: Argument to pass with the method invocation.
2101
 * @cancellable: (nullable): A #GCancellable or %NULL.
2102
 * @error: Return location for error or %NULL.
2103
 *
2104
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.RevokePermissions">RevokePermissions()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2105
 *
2106
 * See gxdp_documents_call_revoke_permissions() for the asynchronous version of this method.
2107
 *
2108
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2109
 */
2110
gboolean
2111
gxdp_documents_call_revoke_permissions_sync (
2112
    GXdpDocuments *proxy,
2113
    const gchar *arg_doc_id,
2114
    const gchar *arg_app_id,
2115
    const gchar *const *arg_permissions,
2116
    GCancellable *cancellable,
2117
    GError **error)
2118
0
{
2119
0
  GVariant *_ret;
2120
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2121
0
    "RevokePermissions",
2122
0
    g_variant_new ("(ss^as)",
2123
0
                   arg_doc_id,
2124
0
                   arg_app_id,
2125
0
                   arg_permissions),
2126
0
    G_DBUS_CALL_FLAGS_NONE,
2127
0
    -1,
2128
0
    cancellable,
2129
0
    error);
2130
0
  if (_ret == NULL)
2131
0
    goto _out;
2132
0
  g_variant_get (_ret,
2133
0
                 "()");
2134
0
  g_variant_unref (_ret);
2135
0
_out:
2136
0
  return _ret != NULL;
2137
0
}
2138
2139
/**
2140
 * gxdp_documents_call_delete:
2141
 * @proxy: A #GXdpDocumentsProxy.
2142
 * @arg_doc_id: Argument to pass with the method invocation.
2143
 * @cancellable: (nullable): A #GCancellable or %NULL.
2144
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2145
 * @user_data: User data to pass to @callback.
2146
 *
2147
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Delete">Delete()</link> D-Bus method on @proxy.
2148
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2149
 * You can then call gxdp_documents_call_delete_finish() to get the result of the operation.
2150
 *
2151
 * See gxdp_documents_call_delete_sync() for the synchronous, blocking version of this method.
2152
 */
2153
void
2154
gxdp_documents_call_delete (
2155
    GXdpDocuments *proxy,
2156
    const gchar *arg_doc_id,
2157
    GCancellable *cancellable,
2158
    GAsyncReadyCallback callback,
2159
    gpointer user_data)
2160
0
{
2161
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2162
0
    "Delete",
2163
0
    g_variant_new ("(s)",
2164
0
                   arg_doc_id),
2165
0
    G_DBUS_CALL_FLAGS_NONE,
2166
0
    -1,
2167
0
    cancellable,
2168
0
    callback,
2169
0
    user_data);
2170
0
}
2171
2172
/**
2173
 * gxdp_documents_call_delete_finish:
2174
 * @proxy: A #GXdpDocumentsProxy.
2175
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_delete().
2176
 * @error: Return location for error or %NULL.
2177
 *
2178
 * Finishes an operation started with gxdp_documents_call_delete().
2179
 *
2180
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2181
 */
2182
gboolean
2183
gxdp_documents_call_delete_finish (
2184
    GXdpDocuments *proxy,
2185
    GAsyncResult *res,
2186
    GError **error)
2187
0
{
2188
0
  GVariant *_ret;
2189
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2190
0
  if (_ret == NULL)
2191
0
    goto _out;
2192
0
  g_variant_get (_ret,
2193
0
                 "()");
2194
0
  g_variant_unref (_ret);
2195
0
_out:
2196
0
  return _ret != NULL;
2197
0
}
2198
2199
/**
2200
 * gxdp_documents_call_delete_sync:
2201
 * @proxy: A #GXdpDocumentsProxy.
2202
 * @arg_doc_id: Argument to pass with the method invocation.
2203
 * @cancellable: (nullable): A #GCancellable or %NULL.
2204
 * @error: Return location for error or %NULL.
2205
 *
2206
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Delete">Delete()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2207
 *
2208
 * See gxdp_documents_call_delete() for the asynchronous version of this method.
2209
 *
2210
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2211
 */
2212
gboolean
2213
gxdp_documents_call_delete_sync (
2214
    GXdpDocuments *proxy,
2215
    const gchar *arg_doc_id,
2216
    GCancellable *cancellable,
2217
    GError **error)
2218
0
{
2219
0
  GVariant *_ret;
2220
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2221
0
    "Delete",
2222
0
    g_variant_new ("(s)",
2223
0
                   arg_doc_id),
2224
0
    G_DBUS_CALL_FLAGS_NONE,
2225
0
    -1,
2226
0
    cancellable,
2227
0
    error);
2228
0
  if (_ret == NULL)
2229
0
    goto _out;
2230
0
  g_variant_get (_ret,
2231
0
                 "()");
2232
0
  g_variant_unref (_ret);
2233
0
_out:
2234
0
  return _ret != NULL;
2235
0
}
2236
2237
/**
2238
 * gxdp_documents_call_lookup:
2239
 * @proxy: A #GXdpDocumentsProxy.
2240
 * @arg_filename: Argument to pass with the method invocation.
2241
 * @cancellable: (nullable): A #GCancellable or %NULL.
2242
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2243
 * @user_data: User data to pass to @callback.
2244
 *
2245
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Lookup">Lookup()</link> D-Bus method on @proxy.
2246
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2247
 * You can then call gxdp_documents_call_lookup_finish() to get the result of the operation.
2248
 *
2249
 * See gxdp_documents_call_lookup_sync() for the synchronous, blocking version of this method.
2250
 */
2251
void
2252
gxdp_documents_call_lookup (
2253
    GXdpDocuments *proxy,
2254
    const gchar *arg_filename,
2255
    GCancellable *cancellable,
2256
    GAsyncReadyCallback callback,
2257
    gpointer user_data)
2258
0
{
2259
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2260
0
    "Lookup",
2261
0
    g_variant_new ("(^ay)",
2262
0
                   arg_filename),
2263
0
    G_DBUS_CALL_FLAGS_NONE,
2264
0
    -1,
2265
0
    cancellable,
2266
0
    callback,
2267
0
    user_data);
2268
0
}
2269
2270
/**
2271
 * gxdp_documents_call_lookup_finish:
2272
 * @proxy: A #GXdpDocumentsProxy.
2273
 * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore.
2274
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_lookup().
2275
 * @error: Return location for error or %NULL.
2276
 *
2277
 * Finishes an operation started with gxdp_documents_call_lookup().
2278
 *
2279
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2280
 */
2281
gboolean
2282
gxdp_documents_call_lookup_finish (
2283
    GXdpDocuments *proxy,
2284
    gchar **out_doc_id,
2285
    GAsyncResult *res,
2286
    GError **error)
2287
0
{
2288
0
  GVariant *_ret;
2289
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2290
0
  if (_ret == NULL)
2291
0
    goto _out;
2292
0
  g_variant_get (_ret,
2293
0
                 "(s)",
2294
0
                 out_doc_id);
2295
0
  g_variant_unref (_ret);
2296
0
_out:
2297
0
  return _ret != NULL;
2298
0
}
2299
2300
/**
2301
 * gxdp_documents_call_lookup_sync:
2302
 * @proxy: A #GXdpDocumentsProxy.
2303
 * @arg_filename: Argument to pass with the method invocation.
2304
 * @out_doc_id: (out) (optional): Return location for return parameter or %NULL to ignore.
2305
 * @cancellable: (nullable): A #GCancellable or %NULL.
2306
 * @error: Return location for error or %NULL.
2307
 *
2308
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Lookup">Lookup()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2309
 *
2310
 * See gxdp_documents_call_lookup() for the asynchronous version of this method.
2311
 *
2312
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2313
 */
2314
gboolean
2315
gxdp_documents_call_lookup_sync (
2316
    GXdpDocuments *proxy,
2317
    const gchar *arg_filename,
2318
    gchar **out_doc_id,
2319
    GCancellable *cancellable,
2320
    GError **error)
2321
0
{
2322
0
  GVariant *_ret;
2323
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2324
0
    "Lookup",
2325
0
    g_variant_new ("(^ay)",
2326
0
                   arg_filename),
2327
0
    G_DBUS_CALL_FLAGS_NONE,
2328
0
    -1,
2329
0
    cancellable,
2330
0
    error);
2331
0
  if (_ret == NULL)
2332
0
    goto _out;
2333
0
  g_variant_get (_ret,
2334
0
                 "(s)",
2335
0
                 out_doc_id);
2336
0
  g_variant_unref (_ret);
2337
0
_out:
2338
0
  return _ret != NULL;
2339
0
}
2340
2341
/**
2342
 * gxdp_documents_call_info:
2343
 * @proxy: A #GXdpDocumentsProxy.
2344
 * @arg_doc_id: Argument to pass with the method invocation.
2345
 * @cancellable: (nullable): A #GCancellable or %NULL.
2346
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2347
 * @user_data: User data to pass to @callback.
2348
 *
2349
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Info">Info()</link> D-Bus method on @proxy.
2350
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2351
 * You can then call gxdp_documents_call_info_finish() to get the result of the operation.
2352
 *
2353
 * See gxdp_documents_call_info_sync() for the synchronous, blocking version of this method.
2354
 */
2355
void
2356
gxdp_documents_call_info (
2357
    GXdpDocuments *proxy,
2358
    const gchar *arg_doc_id,
2359
    GCancellable *cancellable,
2360
    GAsyncReadyCallback callback,
2361
    gpointer user_data)
2362
0
{
2363
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2364
0
    "Info",
2365
0
    g_variant_new ("(s)",
2366
0
                   arg_doc_id),
2367
0
    G_DBUS_CALL_FLAGS_NONE,
2368
0
    -1,
2369
0
    cancellable,
2370
0
    callback,
2371
0
    user_data);
2372
0
}
2373
2374
/**
2375
 * gxdp_documents_call_info_finish:
2376
 * @proxy: A #GXdpDocumentsProxy.
2377
 * @out_path: (out) (optional): Return location for return parameter or %NULL to ignore.
2378
 * @out_apps: (out) (optional): Return location for return parameter or %NULL to ignore.
2379
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_info().
2380
 * @error: Return location for error or %NULL.
2381
 *
2382
 * Finishes an operation started with gxdp_documents_call_info().
2383
 *
2384
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2385
 */
2386
gboolean
2387
gxdp_documents_call_info_finish (
2388
    GXdpDocuments *proxy,
2389
    gchar **out_path,
2390
    GVariant **out_apps,
2391
    GAsyncResult *res,
2392
    GError **error)
2393
0
{
2394
0
  GVariant *_ret;
2395
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2396
0
  if (_ret == NULL)
2397
0
    goto _out;
2398
0
  g_variant_get (_ret,
2399
0
                 "(^ay@a{sas})",
2400
0
                 out_path,
2401
0
                 out_apps);
2402
0
  g_variant_unref (_ret);
2403
0
_out:
2404
0
  return _ret != NULL;
2405
0
}
2406
2407
/**
2408
 * gxdp_documents_call_info_sync:
2409
 * @proxy: A #GXdpDocumentsProxy.
2410
 * @arg_doc_id: Argument to pass with the method invocation.
2411
 * @out_path: (out) (optional): Return location for return parameter or %NULL to ignore.
2412
 * @out_apps: (out) (optional): Return location for return parameter or %NULL to ignore.
2413
 * @cancellable: (nullable): A #GCancellable or %NULL.
2414
 * @error: Return location for error or %NULL.
2415
 *
2416
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Info">Info()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2417
 *
2418
 * See gxdp_documents_call_info() for the asynchronous version of this method.
2419
 *
2420
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2421
 */
2422
gboolean
2423
gxdp_documents_call_info_sync (
2424
    GXdpDocuments *proxy,
2425
    const gchar *arg_doc_id,
2426
    gchar **out_path,
2427
    GVariant **out_apps,
2428
    GCancellable *cancellable,
2429
    GError **error)
2430
0
{
2431
0
  GVariant *_ret;
2432
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2433
0
    "Info",
2434
0
    g_variant_new ("(s)",
2435
0
                   arg_doc_id),
2436
0
    G_DBUS_CALL_FLAGS_NONE,
2437
0
    -1,
2438
0
    cancellable,
2439
0
    error);
2440
0
  if (_ret == NULL)
2441
0
    goto _out;
2442
0
  g_variant_get (_ret,
2443
0
                 "(^ay@a{sas})",
2444
0
                 out_path,
2445
0
                 out_apps);
2446
0
  g_variant_unref (_ret);
2447
0
_out:
2448
0
  return _ret != NULL;
2449
0
}
2450
2451
/**
2452
 * gxdp_documents_call_list:
2453
 * @proxy: A #GXdpDocumentsProxy.
2454
 * @arg_app_id: Argument to pass with the method invocation.
2455
 * @cancellable: (nullable): A #GCancellable or %NULL.
2456
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2457
 * @user_data: User data to pass to @callback.
2458
 *
2459
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.List">List()</link> D-Bus method on @proxy.
2460
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
2461
 * You can then call gxdp_documents_call_list_finish() to get the result of the operation.
2462
 *
2463
 * See gxdp_documents_call_list_sync() for the synchronous, blocking version of this method.
2464
 */
2465
void
2466
gxdp_documents_call_list (
2467
    GXdpDocuments *proxy,
2468
    const gchar *arg_app_id,
2469
    GCancellable *cancellable,
2470
    GAsyncReadyCallback callback,
2471
    gpointer user_data)
2472
0
{
2473
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2474
0
    "List",
2475
0
    g_variant_new ("(s)",
2476
0
                   arg_app_id),
2477
0
    G_DBUS_CALL_FLAGS_NONE,
2478
0
    -1,
2479
0
    cancellable,
2480
0
    callback,
2481
0
    user_data);
2482
0
}
2483
2484
/**
2485
 * gxdp_documents_call_list_finish:
2486
 * @proxy: A #GXdpDocumentsProxy.
2487
 * @out_docs: (out) (optional): Return location for return parameter or %NULL to ignore.
2488
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_list().
2489
 * @error: Return location for error or %NULL.
2490
 *
2491
 * Finishes an operation started with gxdp_documents_call_list().
2492
 *
2493
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2494
 */
2495
gboolean
2496
gxdp_documents_call_list_finish (
2497
    GXdpDocuments *proxy,
2498
    GVariant **out_docs,
2499
    GAsyncResult *res,
2500
    GError **error)
2501
0
{
2502
0
  GVariant *_ret;
2503
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2504
0
  if (_ret == NULL)
2505
0
    goto _out;
2506
0
  g_variant_get (_ret,
2507
0
                 "(@a{say})",
2508
0
                 out_docs);
2509
0
  g_variant_unref (_ret);
2510
0
_out:
2511
0
  return _ret != NULL;
2512
0
}
2513
2514
/**
2515
 * gxdp_documents_call_list_sync:
2516
 * @proxy: A #GXdpDocumentsProxy.
2517
 * @arg_app_id: Argument to pass with the method invocation.
2518
 * @out_docs: (out) (optional): Return location for return parameter or %NULL to ignore.
2519
 * @cancellable: (nullable): A #GCancellable or %NULL.
2520
 * @error: Return location for error or %NULL.
2521
 *
2522
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.List">List()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2523
 *
2524
 * See gxdp_documents_call_list() for the asynchronous version of this method.
2525
 *
2526
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2527
 */
2528
gboolean
2529
gxdp_documents_call_list_sync (
2530
    GXdpDocuments *proxy,
2531
    const gchar *arg_app_id,
2532
    GVariant **out_docs,
2533
    GCancellable *cancellable,
2534
    GError **error)
2535
0
{
2536
0
  GVariant *_ret;
2537
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2538
0
    "List",
2539
0
    g_variant_new ("(s)",
2540
0
                   arg_app_id),
2541
0
    G_DBUS_CALL_FLAGS_NONE,
2542
0
    -1,
2543
0
    cancellable,
2544
0
    error);
2545
0
  if (_ret == NULL)
2546
0
    goto _out;
2547
0
  g_variant_get (_ret,
2548
0
                 "(@a{say})",
2549
0
                 out_docs);
2550
0
  g_variant_unref (_ret);
2551
0
_out:
2552
0
  return _ret != NULL;
2553
0
}
2554
2555
/**
2556
 * gxdp_documents_complete_get_mount_point:
2557
 * @object: A #GXdpDocuments.
2558
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2559
 * @path: Parameter to return.
2560
 *
2561
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GetMountPoint">GetMountPoint()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2562
 *
2563
 * This method will free @invocation, you cannot use it afterwards.
2564
 */
2565
void
2566
gxdp_documents_complete_get_mount_point (
2567
    GXdpDocuments *object G_GNUC_UNUSED,
2568
    GDBusMethodInvocation *invocation,
2569
    const gchar *path)
2570
0
{
2571
0
  g_dbus_method_invocation_return_value (invocation,
2572
0
    g_variant_new ("(^ay)",
2573
0
                   path));
2574
0
}
2575
2576
/**
2577
 * gxdp_documents_complete_add:
2578
 * @object: A #GXdpDocuments.
2579
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2580
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
2581
 * @doc_id: Parameter to return.
2582
 *
2583
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Add">Add()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2584
 *
2585
 * This method will free @invocation, you cannot use it afterwards.
2586
 */
2587
void
2588
gxdp_documents_complete_add (
2589
    GXdpDocuments *object G_GNUC_UNUSED,
2590
    GDBusMethodInvocation *invocation,
2591
    GUnixFDList *fd_list,
2592
    const gchar *doc_id)
2593
0
{
2594
0
  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
2595
0
    g_variant_new ("(s)",
2596
0
                   doc_id),
2597
0
    fd_list);
2598
0
}
2599
2600
/**
2601
 * gxdp_documents_complete_add_named:
2602
 * @object: A #GXdpDocuments.
2603
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2604
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
2605
 * @doc_id: Parameter to return.
2606
 *
2607
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamed">AddNamed()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2608
 *
2609
 * This method will free @invocation, you cannot use it afterwards.
2610
 */
2611
void
2612
gxdp_documents_complete_add_named (
2613
    GXdpDocuments *object G_GNUC_UNUSED,
2614
    GDBusMethodInvocation *invocation,
2615
    GUnixFDList *fd_list,
2616
    const gchar *doc_id)
2617
0
{
2618
0
  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
2619
0
    g_variant_new ("(s)",
2620
0
                   doc_id),
2621
0
    fd_list);
2622
0
}
2623
2624
/**
2625
 * gxdp_documents_complete_add_full:
2626
 * @object: A #GXdpDocuments.
2627
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2628
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
2629
 * @doc_ids: Parameter to return.
2630
 * @extra_out: Parameter to return.
2631
 *
2632
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddFull">AddFull()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2633
 *
2634
 * This method will free @invocation, you cannot use it afterwards.
2635
 */
2636
void
2637
gxdp_documents_complete_add_full (
2638
    GXdpDocuments *object G_GNUC_UNUSED,
2639
    GDBusMethodInvocation *invocation,
2640
    GUnixFDList *fd_list,
2641
    const gchar *const *doc_ids,
2642
    GVariant *extra_out)
2643
0
{
2644
0
  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
2645
0
    g_variant_new ("(^as@a{sv})",
2646
0
                   doc_ids,
2647
0
                   extra_out),
2648
0
    fd_list);
2649
0
}
2650
2651
/**
2652
 * gxdp_documents_complete_add_named_full:
2653
 * @object: A #GXdpDocuments.
2654
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2655
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
2656
 * @doc_id: Parameter to return.
2657
 * @extra_out: Parameter to return.
2658
 *
2659
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamedFull">AddNamedFull()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2660
 *
2661
 * This method will free @invocation, you cannot use it afterwards.
2662
 */
2663
void
2664
gxdp_documents_complete_add_named_full (
2665
    GXdpDocuments *object G_GNUC_UNUSED,
2666
    GDBusMethodInvocation *invocation,
2667
    GUnixFDList *fd_list,
2668
    const gchar *doc_id,
2669
    GVariant *extra_out)
2670
0
{
2671
0
  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
2672
0
    g_variant_new ("(s@a{sv})",
2673
0
                   doc_id,
2674
0
                   extra_out),
2675
0
    fd_list);
2676
0
}
2677
2678
/**
2679
 * gxdp_documents_complete_grant_permissions:
2680
 * @object: A #GXdpDocuments.
2681
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2682
 *
2683
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GrantPermissions">GrantPermissions()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2684
 *
2685
 * This method will free @invocation, you cannot use it afterwards.
2686
 */
2687
void
2688
gxdp_documents_complete_grant_permissions (
2689
    GXdpDocuments *object G_GNUC_UNUSED,
2690
    GDBusMethodInvocation *invocation)
2691
0
{
2692
0
  g_dbus_method_invocation_return_value (invocation,
2693
0
    g_variant_new ("()"));
2694
0
}
2695
2696
/**
2697
 * gxdp_documents_complete_revoke_permissions:
2698
 * @object: A #GXdpDocuments.
2699
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2700
 *
2701
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.RevokePermissions">RevokePermissions()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2702
 *
2703
 * This method will free @invocation, you cannot use it afterwards.
2704
 */
2705
void
2706
gxdp_documents_complete_revoke_permissions (
2707
    GXdpDocuments *object G_GNUC_UNUSED,
2708
    GDBusMethodInvocation *invocation)
2709
0
{
2710
0
  g_dbus_method_invocation_return_value (invocation,
2711
0
    g_variant_new ("()"));
2712
0
}
2713
2714
/**
2715
 * gxdp_documents_complete_delete:
2716
 * @object: A #GXdpDocuments.
2717
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2718
 *
2719
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Delete">Delete()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2720
 *
2721
 * This method will free @invocation, you cannot use it afterwards.
2722
 */
2723
void
2724
gxdp_documents_complete_delete (
2725
    GXdpDocuments *object G_GNUC_UNUSED,
2726
    GDBusMethodInvocation *invocation)
2727
0
{
2728
0
  g_dbus_method_invocation_return_value (invocation,
2729
0
    g_variant_new ("()"));
2730
0
}
2731
2732
/**
2733
 * gxdp_documents_complete_lookup:
2734
 * @object: A #GXdpDocuments.
2735
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2736
 * @doc_id: Parameter to return.
2737
 *
2738
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Lookup">Lookup()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2739
 *
2740
 * This method will free @invocation, you cannot use it afterwards.
2741
 */
2742
void
2743
gxdp_documents_complete_lookup (
2744
    GXdpDocuments *object G_GNUC_UNUSED,
2745
    GDBusMethodInvocation *invocation,
2746
    const gchar *doc_id)
2747
0
{
2748
0
  g_dbus_method_invocation_return_value (invocation,
2749
0
    g_variant_new ("(s)",
2750
0
                   doc_id));
2751
0
}
2752
2753
/**
2754
 * gxdp_documents_complete_info:
2755
 * @object: A #GXdpDocuments.
2756
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2757
 * @path: Parameter to return.
2758
 * @apps: Parameter to return.
2759
 *
2760
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Info">Info()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2761
 *
2762
 * This method will free @invocation, you cannot use it afterwards.
2763
 */
2764
void
2765
gxdp_documents_complete_info (
2766
    GXdpDocuments *object G_GNUC_UNUSED,
2767
    GDBusMethodInvocation *invocation,
2768
    const gchar *path,
2769
    GVariant *apps)
2770
0
{
2771
0
  g_dbus_method_invocation_return_value (invocation,
2772
0
    g_variant_new ("(^ay@a{sas})",
2773
0
                   path,
2774
0
                   apps));
2775
0
}
2776
2777
/**
2778
 * gxdp_documents_complete_list:
2779
 * @object: A #GXdpDocuments.
2780
 * @invocation: (transfer full): A #GDBusMethodInvocation.
2781
 * @docs: Parameter to return.
2782
 *
2783
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.List">List()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
2784
 *
2785
 * This method will free @invocation, you cannot use it afterwards.
2786
 */
2787
void
2788
gxdp_documents_complete_list (
2789
    GXdpDocuments *object G_GNUC_UNUSED,
2790
    GDBusMethodInvocation *invocation,
2791
    GVariant *docs)
2792
0
{
2793
0
  g_dbus_method_invocation_return_value (invocation,
2794
0
    g_variant_new ("(@a{say})",
2795
0
                   docs));
2796
0
}
2797
2798
/* ------------------------------------------------------------------------ */
2799
2800
/**
2801
 * GXdpDocumentsProxy:
2802
 *
2803
 * The #GXdpDocumentsProxy structure contains only private data and should only be accessed using the provided API.
2804
 */
2805
2806
/**
2807
 * GXdpDocumentsProxyClass:
2808
 * @parent_class: The parent class.
2809
 *
2810
 * Class structure for #GXdpDocumentsProxy.
2811
 */
2812
2813
struct _GXdpDocumentsProxyPrivate
2814
{
2815
  GData *qdata;
2816
};
2817
2818
static void gxdp_documents_proxy_iface_init (GXdpDocumentsIface *iface);
2819
2820
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2821
G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsProxy, gxdp_documents_proxy, G_TYPE_DBUS_PROXY,
2822
                         G_ADD_PRIVATE (GXdpDocumentsProxy)
2823
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_proxy_iface_init))
2824
2825
#else
2826
G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsProxy, gxdp_documents_proxy, G_TYPE_DBUS_PROXY,
2827
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_proxy_iface_init))
2828
2829
#endif
2830
static void
2831
gxdp_documents_proxy_finalize (GObject *object)
2832
0
{
2833
0
  GXdpDocumentsProxy *proxy = GXDP_DOCUMENTS_PROXY (object);
2834
0
  g_datalist_clear (&proxy->priv->qdata);
2835
0
  G_OBJECT_CLASS (gxdp_documents_proxy_parent_class)->finalize (object);
2836
0
}
2837
2838
static void
2839
gxdp_documents_proxy_get_property (GObject      *object,
2840
  guint         prop_id,
2841
  GValue       *value,
2842
  GParamSpec   *pspec G_GNUC_UNUSED)
2843
0
{
2844
0
  const _ExtendedGDBusPropertyInfo *info;
2845
0
  GVariant *variant;
2846
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
2847
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_documents_property_info_pointers[prop_id - 1];
2848
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
2849
0
  if (info->use_gvariant)
2850
0
    {
2851
0
      g_value_set_variant (value, variant);
2852
0
    }
2853
0
  else
2854
0
    {
2855
0
      if (variant != NULL)
2856
0
        g_dbus_gvariant_to_gvalue (variant, value);
2857
0
    }
2858
0
  if (variant != NULL)
2859
0
    g_variant_unref (variant);
2860
0
}
2861
2862
static void
2863
gxdp_documents_proxy_set_property_cb (GDBusProxy *proxy,
2864
  GAsyncResult *res,
2865
  gpointer      user_data)
2866
0
{
2867
0
  const _ExtendedGDBusPropertyInfo *info = user_data;
2868
0
  GError *error;
2869
0
  GVariant *_ret;
2870
0
  error = NULL;
2871
0
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
2872
0
  if (!_ret)
2873
0
    {
2874
0
      g_warning ("Error setting property '%s' on interface org.freedesktop.portal.Documents: %s (%s, %d)",
2875
0
                 info->parent_struct.name, 
2876
0
                 error->message, g_quark_to_string (error->domain), error->code);
2877
0
      g_error_free (error);
2878
0
    }
2879
0
  else
2880
0
    {
2881
0
      g_variant_unref (_ret);
2882
0
    }
2883
0
}
2884
2885
static void
2886
gxdp_documents_proxy_set_property (GObject      *object,
2887
  guint         prop_id,
2888
  const GValue *value,
2889
  GParamSpec   *pspec G_GNUC_UNUSED)
2890
0
{
2891
0
  const _ExtendedGDBusPropertyInfo *info;
2892
0
  GVariant *variant;
2893
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
2894
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_documents_property_info_pointers[prop_id - 1];
2895
0
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
2896
0
  g_dbus_proxy_call (G_DBUS_PROXY (object),
2897
0
    "org.freedesktop.DBus.Properties.Set",
2898
0
    g_variant_new ("(ssv)", "org.freedesktop.portal.Documents", info->parent_struct.name, variant),
2899
0
    G_DBUS_CALL_FLAGS_NONE,
2900
0
    -1,
2901
0
    NULL, (GAsyncReadyCallback) gxdp_documents_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
2902
0
  g_variant_unref (variant);
2903
0
}
2904
2905
static void
2906
gxdp_documents_proxy_g_signal (GDBusProxy *proxy,
2907
  const gchar *sender_name G_GNUC_UNUSED,
2908
  const gchar *signal_name,
2909
  GVariant *parameters)
2910
0
{
2911
0
  _ExtendedGDBusSignalInfo *info;
2912
0
  GVariantIter iter;
2913
0
  GVariant *child;
2914
0
  GValue *paramv;
2915
0
  gsize num_params;
2916
0
  gsize n;
2917
0
  guint signal_id;
2918
0
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, signal_name);
2919
0
  if (info == NULL)
2920
0
    return;
2921
0
  num_params = g_variant_n_children (parameters);
2922
0
  paramv = g_new0 (GValue, num_params + 1);
2923
0
  g_value_init (&paramv[0], GXDP_TYPE_DOCUMENTS);
2924
0
  g_value_set_object (&paramv[0], proxy);
2925
0
  g_variant_iter_init (&iter, parameters);
2926
0
  n = 1;
2927
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
2928
0
    {
2929
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
2930
0
      if (arg_info->use_gvariant)
2931
0
        {
2932
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
2933
0
          g_value_set_variant (&paramv[n], child);
2934
0
          n++;
2935
0
        }
2936
0
      else
2937
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
2938
0
      g_variant_unref (child);
2939
0
    }
2940
0
  signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_DOCUMENTS);
2941
0
  g_signal_emitv (paramv, signal_id, 0, NULL);
2942
0
  for (n = 0; n < num_params + 1; n++)
2943
0
    g_value_unset (&paramv[n]);
2944
0
  g_free (paramv);
2945
0
}
2946
2947
static void
2948
gxdp_documents_proxy_g_properties_changed (GDBusProxy *_proxy,
2949
  GVariant *changed_properties,
2950
  const gchar *const *invalidated_properties)
2951
0
{
2952
0
  GXdpDocumentsProxy *proxy = GXDP_DOCUMENTS_PROXY (_proxy);
2953
0
  guint n;
2954
0
  const gchar *key;
2955
0
  GVariantIter *iter;
2956
0
  _ExtendedGDBusPropertyInfo *info;
2957
0
  g_variant_get (changed_properties, "a{sv}", &iter);
2958
0
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
2959
0
    {
2960
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, key);
2961
0
      g_datalist_remove_data (&proxy->priv->qdata, key);
2962
0
      if (info != NULL)
2963
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
2964
0
    }
2965
0
  g_variant_iter_free (iter);
2966
0
  for (n = 0; invalidated_properties[n] != NULL; n++)
2967
0
    {
2968
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, invalidated_properties[n]);
2969
0
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
2970
0
      if (info != NULL)
2971
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
2972
0
    }
2973
0
}
2974
2975
static guint 
2976
gxdp_documents_proxy_get_version (GXdpDocuments *object)
2977
0
{
2978
0
  GXdpDocumentsProxy *proxy = GXDP_DOCUMENTS_PROXY (object);
2979
0
  GVariant *variant;
2980
0
  guint value = 0;
2981
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version");
2982
0
  if (variant != NULL)
2983
0
    {
2984
0
      value = g_variant_get_uint32 (variant);
2985
0
      g_variant_unref (variant);
2986
0
    }
2987
0
  return value;
2988
0
}
2989
2990
static void
2991
gxdp_documents_proxy_init (GXdpDocumentsProxy *proxy)
2992
0
{
2993
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2994
0
  proxy->priv = gxdp_documents_proxy_get_instance_private (proxy);
2995
#else
2996
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_DOCUMENTS_PROXY, GXdpDocumentsProxyPrivate);
2997
#endif
2998
2999
0
  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_documents_interface_info ());
3000
0
}
3001
3002
static void
3003
gxdp_documents_proxy_class_init (GXdpDocumentsProxyClass *klass)
3004
0
{
3005
0
  GObjectClass *gobject_class;
3006
0
  GDBusProxyClass *proxy_class;
3007
3008
0
  gobject_class = G_OBJECT_CLASS (klass);
3009
0
  gobject_class->finalize     = gxdp_documents_proxy_finalize;
3010
0
  gobject_class->get_property = gxdp_documents_proxy_get_property;
3011
0
  gobject_class->set_property = gxdp_documents_proxy_set_property;
3012
3013
0
  proxy_class = G_DBUS_PROXY_CLASS (klass);
3014
0
  proxy_class->g_signal = gxdp_documents_proxy_g_signal;
3015
0
  proxy_class->g_properties_changed = gxdp_documents_proxy_g_properties_changed;
3016
3017
0
  gxdp_documents_override_properties (gobject_class, 1);
3018
3019
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3020
  g_type_class_add_private (klass, sizeof (GXdpDocumentsProxyPrivate));
3021
#endif
3022
0
}
3023
3024
static void
3025
gxdp_documents_proxy_iface_init (GXdpDocumentsIface *iface)
3026
0
{
3027
0
  iface->get_version = gxdp_documents_proxy_get_version;
3028
0
}
3029
3030
/**
3031
 * gxdp_documents_proxy_new:
3032
 * @connection: A #GDBusConnection.
3033
 * @flags: Flags from the #GDBusProxyFlags enumeration.
3034
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3035
 * @object_path: An object path.
3036
 * @cancellable: (nullable): A #GCancellable or %NULL.
3037
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3038
 * @user_data: User data to pass to @callback.
3039
 *
3040
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link>. See g_dbus_proxy_new() for more details.
3041
 *
3042
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
3043
 * You can then call gxdp_documents_proxy_new_finish() to get the result of the operation.
3044
 *
3045
 * See gxdp_documents_proxy_new_sync() for the synchronous, blocking version of this constructor.
3046
 */
3047
void
3048
gxdp_documents_proxy_new (
3049
    GDBusConnection     *connection,
3050
    GDBusProxyFlags      flags,
3051
    const gchar         *name,
3052
    const gchar         *object_path,
3053
    GCancellable        *cancellable,
3054
    GAsyncReadyCallback  callback,
3055
    gpointer             user_data)
3056
0
{
3057
0
  g_async_initable_new_async (GXDP_TYPE_DOCUMENTS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Documents", NULL);
3058
0
}
3059
3060
/**
3061
 * gxdp_documents_proxy_new_finish:
3062
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_proxy_new().
3063
 * @error: Return location for error or %NULL
3064
 *
3065
 * Finishes an operation started with gxdp_documents_proxy_new().
3066
 *
3067
 * Returns: (transfer full) (type GXdpDocumentsProxy): The constructed proxy object or %NULL if @error is set.
3068
 */
3069
GXdpDocuments *
3070
gxdp_documents_proxy_new_finish (
3071
    GAsyncResult        *res,
3072
    GError             **error)
3073
0
{
3074
0
  GObject *ret;
3075
0
  GObject *source_object;
3076
0
  source_object = g_async_result_get_source_object (res);
3077
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3078
0
  g_object_unref (source_object);
3079
0
  if (ret != NULL)
3080
0
    return GXDP_DOCUMENTS (ret);
3081
0
  else
3082
0
    return NULL;
3083
0
}
3084
3085
/**
3086
 * gxdp_documents_proxy_new_sync:
3087
 * @connection: A #GDBusConnection.
3088
 * @flags: Flags from the #GDBusProxyFlags enumeration.
3089
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3090
 * @object_path: An object path.
3091
 * @cancellable: (nullable): A #GCancellable or %NULL.
3092
 * @error: Return location for error or %NULL
3093
 *
3094
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link>. See g_dbus_proxy_new_sync() for more details.
3095
 *
3096
 * The calling thread is blocked until a reply is received.
3097
 *
3098
 * See gxdp_documents_proxy_new() for the asynchronous version of this constructor.
3099
 *
3100
 * Returns: (transfer full) (type GXdpDocumentsProxy): The constructed proxy object or %NULL if @error is set.
3101
 */
3102
GXdpDocuments *
3103
gxdp_documents_proxy_new_sync (
3104
    GDBusConnection     *connection,
3105
    GDBusProxyFlags      flags,
3106
    const gchar         *name,
3107
    const gchar         *object_path,
3108
    GCancellable        *cancellable,
3109
    GError             **error)
3110
0
{
3111
0
  GInitable *ret;
3112
0
  ret = g_initable_new (GXDP_TYPE_DOCUMENTS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Documents", NULL);
3113
0
  if (ret != NULL)
3114
0
    return GXDP_DOCUMENTS (ret);
3115
0
  else
3116
0
    return NULL;
3117
0
}
3118
3119
3120
/**
3121
 * gxdp_documents_proxy_new_for_bus:
3122
 * @bus_type: A #GBusType.
3123
 * @flags: Flags from the #GDBusProxyFlags enumeration.
3124
 * @name: A bus name (well-known or unique).
3125
 * @object_path: An object path.
3126
 * @cancellable: (nullable): A #GCancellable or %NULL.
3127
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3128
 * @user_data: User data to pass to @callback.
3129
 *
3130
 * Like gxdp_documents_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
3131
 *
3132
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
3133
 * You can then call gxdp_documents_proxy_new_for_bus_finish() to get the result of the operation.
3134
 *
3135
 * See gxdp_documents_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
3136
 */
3137
void
3138
gxdp_documents_proxy_new_for_bus (
3139
    GBusType             bus_type,
3140
    GDBusProxyFlags      flags,
3141
    const gchar         *name,
3142
    const gchar         *object_path,
3143
    GCancellable        *cancellable,
3144
    GAsyncReadyCallback  callback,
3145
    gpointer             user_data)
3146
0
{
3147
0
  g_async_initable_new_async (GXDP_TYPE_DOCUMENTS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Documents", NULL);
3148
0
}
3149
3150
/**
3151
 * gxdp_documents_proxy_new_for_bus_finish:
3152
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_proxy_new_for_bus().
3153
 * @error: Return location for error or %NULL
3154
 *
3155
 * Finishes an operation started with gxdp_documents_proxy_new_for_bus().
3156
 *
3157
 * Returns: (transfer full) (type GXdpDocumentsProxy): The constructed proxy object or %NULL if @error is set.
3158
 */
3159
GXdpDocuments *
3160
gxdp_documents_proxy_new_for_bus_finish (
3161
    GAsyncResult        *res,
3162
    GError             **error)
3163
0
{
3164
0
  GObject *ret;
3165
0
  GObject *source_object;
3166
0
  source_object = g_async_result_get_source_object (res);
3167
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3168
0
  g_object_unref (source_object);
3169
0
  if (ret != NULL)
3170
0
    return GXDP_DOCUMENTS (ret);
3171
0
  else
3172
0
    return NULL;
3173
0
}
3174
3175
/**
3176
 * gxdp_documents_proxy_new_for_bus_sync:
3177
 * @bus_type: A #GBusType.
3178
 * @flags: Flags from the #GDBusProxyFlags enumeration.
3179
 * @name: A bus name (well-known or unique).
3180
 * @object_path: An object path.
3181
 * @cancellable: (nullable): A #GCancellable or %NULL.
3182
 * @error: Return location for error or %NULL
3183
 *
3184
 * Like gxdp_documents_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
3185
 *
3186
 * The calling thread is blocked until a reply is received.
3187
 *
3188
 * See gxdp_documents_proxy_new_for_bus() for the asynchronous version of this constructor.
3189
 *
3190
 * Returns: (transfer full) (type GXdpDocumentsProxy): The constructed proxy object or %NULL if @error is set.
3191
 */
3192
GXdpDocuments *
3193
gxdp_documents_proxy_new_for_bus_sync (
3194
    GBusType             bus_type,
3195
    GDBusProxyFlags      flags,
3196
    const gchar         *name,
3197
    const gchar         *object_path,
3198
    GCancellable        *cancellable,
3199
    GError             **error)
3200
0
{
3201
0
  GInitable *ret;
3202
0
  ret = g_initable_new (GXDP_TYPE_DOCUMENTS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Documents", NULL);
3203
0
  if (ret != NULL)
3204
0
    return GXDP_DOCUMENTS (ret);
3205
0
  else
3206
0
    return NULL;
3207
0
}
3208
3209
3210
/* ------------------------------------------------------------------------ */
3211
3212
/**
3213
 * GXdpDocumentsSkeleton:
3214
 *
3215
 * The #GXdpDocumentsSkeleton structure contains only private data and should only be accessed using the provided API.
3216
 */
3217
3218
/**
3219
 * GXdpDocumentsSkeletonClass:
3220
 * @parent_class: The parent class.
3221
 *
3222
 * Class structure for #GXdpDocumentsSkeleton.
3223
 */
3224
3225
struct _GXdpDocumentsSkeletonPrivate
3226
{
3227
  GValue *properties;
3228
  GList *changed_properties;
3229
  GSource *changed_properties_idle_source;
3230
  GMainContext *context;
3231
  GMutex lock;
3232
};
3233
3234
static void
3235
_gxdp_documents_skeleton_handle_method_call (
3236
  GDBusConnection *connection G_GNUC_UNUSED,
3237
  const gchar *sender G_GNUC_UNUSED,
3238
  const gchar *object_path G_GNUC_UNUSED,
3239
  const gchar *interface_name,
3240
  const gchar *method_name,
3241
  GVariant *parameters,
3242
  GDBusMethodInvocation *invocation,
3243
  gpointer user_data)
3244
0
{
3245
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data);
3246
0
  _ExtendedGDBusMethodInfo *info;
3247
0
  GVariantIter iter;
3248
0
  GVariant *child;
3249
0
  GValue *paramv;
3250
0
  gsize num_params;
3251
0
  guint num_extra;
3252
0
  gsize n;
3253
0
  guint signal_id;
3254
0
  GValue return_value = G_VALUE_INIT;
3255
0
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
3256
0
  g_assert (info != NULL);
3257
0
  num_params = g_variant_n_children (parameters);
3258
0
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
3259
0
  n = 0;
3260
0
  g_value_init (&paramv[n], GXDP_TYPE_DOCUMENTS);
3261
0
  g_value_set_object (&paramv[n++], skeleton);
3262
0
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
3263
0
  g_value_set_object (&paramv[n++], invocation);
3264
0
  if (info->pass_fdlist)
3265
0
    {
3266
0
#ifdef G_OS_UNIX
3267
0
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
3268
0
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
3269
#else
3270
      g_assert_not_reached ();
3271
#endif
3272
0
    }
3273
0
  g_variant_iter_init (&iter, parameters);
3274
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
3275
0
    {
3276
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
3277
0
      if (arg_info->use_gvariant)
3278
0
        {
3279
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
3280
0
          g_value_set_variant (&paramv[n], child);
3281
0
          n++;
3282
0
        }
3283
0
      else
3284
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
3285
0
      g_variant_unref (child);
3286
0
    }
3287
0
  signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_DOCUMENTS);
3288
0
  g_value_init (&return_value, G_TYPE_BOOLEAN);
3289
0
  g_signal_emitv (paramv, signal_id, 0, &return_value);
3290
0
  if (!g_value_get_boolean (&return_value))
3291
0
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
3292
0
  g_value_unset (&return_value);
3293
0
  for (n = 0; n < num_params + num_extra; n++)
3294
0
    g_value_unset (&paramv[n]);
3295
0
  g_free (paramv);
3296
0
}
3297
3298
static GVariant *
3299
_gxdp_documents_skeleton_handle_get_property (
3300
  GDBusConnection *connection G_GNUC_UNUSED,
3301
  const gchar *sender G_GNUC_UNUSED,
3302
  const gchar *object_path G_GNUC_UNUSED,
3303
  const gchar *interface_name G_GNUC_UNUSED,
3304
  const gchar *property_name,
3305
  GError **error,
3306
  gpointer user_data)
3307
0
{
3308
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data);
3309
0
  GValue value = G_VALUE_INIT;
3310
0
  GParamSpec *pspec;
3311
0
  _ExtendedGDBusPropertyInfo *info;
3312
0
  GVariant *ret;
3313
0
  ret = NULL;
3314
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, property_name);
3315
0
  g_assert (info != NULL);
3316
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
3317
0
  if (pspec == NULL)
3318
0
    {
3319
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3320
0
    }
3321
0
  else
3322
0
    {
3323
0
      g_value_init (&value, pspec->value_type);
3324
0
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
3325
0
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
3326
0
      g_value_unset (&value);
3327
0
    }
3328
0
  return ret;
3329
0
}
3330
3331
static gboolean
3332
_gxdp_documents_skeleton_handle_set_property (
3333
  GDBusConnection *connection G_GNUC_UNUSED,
3334
  const gchar *sender G_GNUC_UNUSED,
3335
  const gchar *object_path G_GNUC_UNUSED,
3336
  const gchar *interface_name G_GNUC_UNUSED,
3337
  const gchar *property_name,
3338
  GVariant *variant,
3339
  GError **error,
3340
  gpointer user_data)
3341
0
{
3342
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data);
3343
0
  GValue value = G_VALUE_INIT;
3344
0
  GParamSpec *pspec;
3345
0
  _ExtendedGDBusPropertyInfo *info;
3346
0
  gboolean ret;
3347
0
  ret = FALSE;
3348
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_documents_interface_info.parent_struct, property_name);
3349
0
  g_assert (info != NULL);
3350
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
3351
0
  if (pspec == NULL)
3352
0
    {
3353
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3354
0
    }
3355
0
  else
3356
0
    {
3357
0
      if (info->use_gvariant)
3358
0
        g_value_set_variant (&value, variant);
3359
0
      else
3360
0
        g_dbus_gvariant_to_gvalue (variant, &value);
3361
0
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
3362
0
      g_value_unset (&value);
3363
0
      ret = TRUE;
3364
0
    }
3365
0
  return ret;
3366
0
}
3367
3368
static const GDBusInterfaceVTable _gxdp_documents_skeleton_vtable =
3369
{
3370
  _gxdp_documents_skeleton_handle_method_call,
3371
  _gxdp_documents_skeleton_handle_get_property,
3372
  _gxdp_documents_skeleton_handle_set_property,
3373
  {NULL}
3374
};
3375
3376
static GDBusInterfaceInfo *
3377
gxdp_documents_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3378
0
{
3379
0
  return gxdp_documents_interface_info ();
3380
0
}
3381
3382
static GDBusInterfaceVTable *
3383
gxdp_documents_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3384
0
{
3385
0
  return (GDBusInterfaceVTable *) &_gxdp_documents_skeleton_vtable;
3386
0
}
3387
3388
static GVariant *
3389
gxdp_documents_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
3390
0
{
3391
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (_skeleton);
3392
3393
0
  GVariantBuilder builder;
3394
0
  guint n;
3395
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
3396
0
  if (_gxdp_documents_interface_info.parent_struct.properties == NULL)
3397
0
    goto out;
3398
0
  for (n = 0; _gxdp_documents_interface_info.parent_struct.properties[n] != NULL; n++)
3399
0
    {
3400
0
      GDBusPropertyInfo *info = _gxdp_documents_interface_info.parent_struct.properties[n];
3401
0
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
3402
0
        {
3403
0
          GVariant *value;
3404
0
          value = _gxdp_documents_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.portal.Documents", info->name, NULL, skeleton);
3405
0
          if (value != NULL)
3406
0
            {
3407
0
              g_variant_take_ref (value);
3408
0
              g_variant_builder_add (&builder, "{sv}", info->name, value);
3409
0
              g_variant_unref (value);
3410
0
            }
3411
0
        }
3412
0
    }
3413
0
out:
3414
0
  return g_variant_builder_end (&builder);
3415
0
}
3416
3417
static gboolean _gxdp_documents_emit_changed (gpointer user_data);
3418
3419
static void
3420
gxdp_documents_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
3421
0
{
3422
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (_skeleton);
3423
0
  gboolean emit_changed = FALSE;
3424
3425
0
  g_mutex_lock (&skeleton->priv->lock);
3426
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
3427
0
    {
3428
0
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
3429
0
      skeleton->priv->changed_properties_idle_source = NULL;
3430
0
      emit_changed = TRUE;
3431
0
    }
3432
0
  g_mutex_unlock (&skeleton->priv->lock);
3433
3434
0
  if (emit_changed)
3435
0
    _gxdp_documents_emit_changed (skeleton);
3436
0
}
3437
3438
static void gxdp_documents_skeleton_iface_init (GXdpDocumentsIface *iface);
3439
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3440
G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsSkeleton, gxdp_documents_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
3441
                         G_ADD_PRIVATE (GXdpDocumentsSkeleton)
3442
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_skeleton_iface_init))
3443
3444
#else
3445
G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsSkeleton, gxdp_documents_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
3446
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_skeleton_iface_init))
3447
3448
#endif
3449
static void
3450
gxdp_documents_skeleton_finalize (GObject *object)
3451
0
{
3452
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object);
3453
0
  guint n;
3454
0
  for (n = 0; n < 1; n++)
3455
0
    g_value_unset (&skeleton->priv->properties[n]);
3456
0
  g_free (skeleton->priv->properties);
3457
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
3458
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
3459
0
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
3460
0
  g_main_context_unref (skeleton->priv->context);
3461
0
  g_mutex_clear (&skeleton->priv->lock);
3462
0
  G_OBJECT_CLASS (gxdp_documents_skeleton_parent_class)->finalize (object);
3463
0
}
3464
3465
static void
3466
gxdp_documents_skeleton_get_property (GObject      *object,
3467
  guint         prop_id,
3468
  GValue       *value,
3469
  GParamSpec   *pspec G_GNUC_UNUSED)
3470
0
{
3471
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object);
3472
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
3473
0
  g_mutex_lock (&skeleton->priv->lock);
3474
0
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
3475
0
  g_mutex_unlock (&skeleton->priv->lock);
3476
0
}
3477
3478
static gboolean
3479
_gxdp_documents_emit_changed (gpointer user_data)
3480
0
{
3481
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data);
3482
0
  GList *l;
3483
0
  GVariantBuilder builder;
3484
0
  GVariantBuilder invalidated_builder;
3485
0
  guint num_changes;
3486
3487
0
  g_mutex_lock (&skeleton->priv->lock);
3488
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
3489
0
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
3490
0
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
3491
0
    {
3492
0
      ChangedProperty *cp = l->data;
3493
0
      GVariant *variant;
3494
0
      const GValue *cur_value;
3495
3496
0
      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
3497
0
      if (!_g_value_equal (cur_value, &cp->orig_value))
3498
0
        {
3499
0
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
3500
0
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
3501
0
          g_variant_unref (variant);
3502
0
          num_changes++;
3503
0
        }
3504
0
    }
3505
0
  if (num_changes > 0)
3506
0
    {
3507
0
      GList *connections, *ll;
3508
0
      GVariant *signal_variant;
3509
0
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.Documents",
3510
0
                                           &builder, &invalidated_builder));
3511
0
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
3512
0
      for (ll = connections; ll != NULL; ll = ll->next)
3513
0
        {
3514
0
          GDBusConnection *connection = ll->data;
3515
3516
0
          g_dbus_connection_emit_signal (connection,
3517
0
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
3518
0
                                         "org.freedesktop.DBus.Properties",
3519
0
                                         "PropertiesChanged",
3520
0
                                         signal_variant,
3521
0
                                         NULL);
3522
0
        }
3523
0
      g_variant_unref (signal_variant);
3524
0
      g_list_free_full (connections, g_object_unref);
3525
0
    }
3526
0
  else
3527
0
    {
3528
0
      g_variant_builder_clear (&builder);
3529
0
      g_variant_builder_clear (&invalidated_builder);
3530
0
    }
3531
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
3532
0
  skeleton->priv->changed_properties = NULL;
3533
0
  skeleton->priv->changed_properties_idle_source = NULL;
3534
0
  g_mutex_unlock (&skeleton->priv->lock);
3535
0
  return FALSE;
3536
0
}
3537
3538
static void
3539
_gxdp_documents_schedule_emit_changed (GXdpDocumentsSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
3540
0
{
3541
0
  ChangedProperty *cp;
3542
0
  GList *l;
3543
0
  cp = NULL;
3544
0
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
3545
0
    {
3546
0
      ChangedProperty *i_cp = l->data;
3547
0
      if (i_cp->info == info)
3548
0
        {
3549
0
          cp = i_cp;
3550
0
          break;
3551
0
        }
3552
0
    }
3553
0
  if (cp == NULL)
3554
0
    {
3555
0
      cp = g_new0 (ChangedProperty, 1);
3556
0
      cp->prop_id = prop_id;
3557
0
      cp->info = info;
3558
0
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
3559
0
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
3560
0
      g_value_copy (orig_value, &cp->orig_value);
3561
0
    }
3562
0
}
3563
3564
static void
3565
gxdp_documents_skeleton_notify (GObject      *object,
3566
  GParamSpec *pspec G_GNUC_UNUSED)
3567
0
{
3568
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object);
3569
0
  g_mutex_lock (&skeleton->priv->lock);
3570
0
  if (skeleton->priv->changed_properties != NULL &&
3571
0
      skeleton->priv->changed_properties_idle_source == NULL)
3572
0
    {
3573
0
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
3574
0
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
3575
0
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_documents_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
3576
0
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_documents_emit_changed");
3577
0
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
3578
0
      g_source_unref (skeleton->priv->changed_properties_idle_source);
3579
0
    }
3580
0
  g_mutex_unlock (&skeleton->priv->lock);
3581
0
}
3582
3583
static void
3584
gxdp_documents_skeleton_set_property (GObject      *object,
3585
  guint         prop_id,
3586
  const GValue *value,
3587
  GParamSpec   *pspec)
3588
0
{
3589
0
  const _ExtendedGDBusPropertyInfo *info;
3590
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object);
3591
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
3592
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_documents_property_info_pointers[prop_id - 1];
3593
0
  g_mutex_lock (&skeleton->priv->lock);
3594
0
  g_object_freeze_notify (object);
3595
0
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
3596
0
    {
3597
0
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
3598
0
          info->emits_changed_signal)
3599
0
        _gxdp_documents_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
3600
0
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
3601
0
      g_object_notify_by_pspec (object, pspec);
3602
0
    }
3603
0
  g_mutex_unlock (&skeleton->priv->lock);
3604
0
  g_object_thaw_notify (object);
3605
0
}
3606
3607
static void
3608
gxdp_documents_skeleton_init (GXdpDocumentsSkeleton *skeleton)
3609
0
{
3610
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3611
0
  skeleton->priv = gxdp_documents_skeleton_get_instance_private (skeleton);
3612
#else
3613
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_DOCUMENTS_SKELETON, GXdpDocumentsSkeletonPrivate);
3614
#endif
3615
3616
0
  g_mutex_init (&skeleton->priv->lock);
3617
0
  skeleton->priv->context = g_main_context_ref_thread_default ();
3618
0
  skeleton->priv->properties = g_new0 (GValue, 1);
3619
0
  g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT);
3620
0
}
3621
3622
static guint 
3623
gxdp_documents_skeleton_get_version (GXdpDocuments *object)
3624
0
{
3625
0
  GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object);
3626
0
  guint value;
3627
0
  g_mutex_lock (&skeleton->priv->lock);
3628
0
  value = g_value_get_uint (&(skeleton->priv->properties[0]));
3629
0
  g_mutex_unlock (&skeleton->priv->lock);
3630
0
  return value;
3631
0
}
3632
3633
static void
3634
gxdp_documents_skeleton_class_init (GXdpDocumentsSkeletonClass *klass)
3635
0
{
3636
0
  GObjectClass *gobject_class;
3637
0
  GDBusInterfaceSkeletonClass *skeleton_class;
3638
3639
0
  gobject_class = G_OBJECT_CLASS (klass);
3640
0
  gobject_class->finalize = gxdp_documents_skeleton_finalize;
3641
0
  gobject_class->get_property = gxdp_documents_skeleton_get_property;
3642
0
  gobject_class->set_property = gxdp_documents_skeleton_set_property;
3643
0
  gobject_class->notify       = gxdp_documents_skeleton_notify;
3644
3645
3646
0
  gxdp_documents_override_properties (gobject_class, 1);
3647
3648
0
  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
3649
0
  skeleton_class->get_info = gxdp_documents_skeleton_dbus_interface_get_info;
3650
0
  skeleton_class->get_properties = gxdp_documents_skeleton_dbus_interface_get_properties;
3651
0
  skeleton_class->flush = gxdp_documents_skeleton_dbus_interface_flush;
3652
0
  skeleton_class->get_vtable = gxdp_documents_skeleton_dbus_interface_get_vtable;
3653
3654
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3655
  g_type_class_add_private (klass, sizeof (GXdpDocumentsSkeletonPrivate));
3656
#endif
3657
0
}
3658
3659
static void
3660
gxdp_documents_skeleton_iface_init (GXdpDocumentsIface *iface)
3661
0
{
3662
0
  iface->get_version = gxdp_documents_skeleton_get_version;
3663
0
}
3664
3665
/**
3666
 * gxdp_documents_skeleton_new:
3667
 *
3668
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link>.
3669
 *
3670
 * Returns: (transfer full) (type GXdpDocumentsSkeleton): The skeleton object.
3671
 */
3672
GXdpDocuments *
3673
gxdp_documents_skeleton_new (void)
3674
0
{
3675
0
  return GXDP_DOCUMENTS (g_object_new (GXDP_TYPE_DOCUMENTS_SKELETON, NULL));
3676
0
}
3677
3678
/* ------------------------------------------------------------------------
3679
 * Code for interface org.freedesktop.portal.OpenURI
3680
 * ------------------------------------------------------------------------
3681
 */
3682
3683
/**
3684
 * SECTION:GXdpOpenURI
3685
 * @title: GXdpOpenURI
3686
 * @short_description: Generated C code for the org.freedesktop.portal.OpenURI D-Bus interface
3687
 *
3688
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link> D-Bus interface in C.
3689
 */
3690
3691
/* ---- Introspection data for org.freedesktop.portal.OpenURI ---- */
3692
3693
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_parent_window =
3694
{
3695
  {
3696
    -1,
3697
    (gchar *) "parent_window",
3698
    (gchar *) "s",
3699
    NULL
3700
  },
3701
  FALSE
3702
};
3703
3704
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_uri =
3705
{
3706
  {
3707
    -1,
3708
    (gchar *) "uri",
3709
    (gchar *) "s",
3710
    NULL
3711
  },
3712
  FALSE
3713
};
3714
3715
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_options =
3716
{
3717
  {
3718
    -1,
3719
    (gchar *) "options",
3720
    (gchar *) "a{sv}",
3721
    NULL
3722
  },
3723
  FALSE
3724
};
3725
3726
static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_uri_IN_ARG_pointers[] =
3727
{
3728
  &_gxdp_open_uri_method_info_open_uri_IN_ARG_parent_window.parent_struct,
3729
  &_gxdp_open_uri_method_info_open_uri_IN_ARG_uri.parent_struct,
3730
  &_gxdp_open_uri_method_info_open_uri_IN_ARG_options.parent_struct,
3731
  NULL
3732
};
3733
3734
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_OUT_ARG_handle =
3735
{
3736
  {
3737
    -1,
3738
    (gchar *) "handle",
3739
    (gchar *) "o",
3740
    NULL
3741
  },
3742
  FALSE
3743
};
3744
3745
static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_uri_OUT_ARG_pointers[] =
3746
{
3747
  &_gxdp_open_uri_method_info_open_uri_OUT_ARG_handle.parent_struct,
3748
  NULL
3749
};
3750
3751
static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_uri =
3752
{
3753
  {
3754
    -1,
3755
    (gchar *) "OpenURI",
3756
    (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_uri_IN_ARG_pointers,
3757
    (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_uri_OUT_ARG_pointers,
3758
    NULL
3759
  },
3760
  "handle-open-uri",
3761
  FALSE
3762
};
3763
3764
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_parent_window =
3765
{
3766
  {
3767
    -1,
3768
    (gchar *) "parent_window",
3769
    (gchar *) "s",
3770
    NULL
3771
  },
3772
  FALSE
3773
};
3774
3775
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_fd =
3776
{
3777
  {
3778
    -1,
3779
    (gchar *) "fd",
3780
    (gchar *) "h",
3781
    NULL
3782
  },
3783
  FALSE
3784
};
3785
3786
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_options =
3787
{
3788
  {
3789
    -1,
3790
    (gchar *) "options",
3791
    (gchar *) "a{sv}",
3792
    NULL
3793
  },
3794
  FALSE
3795
};
3796
3797
static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_file_IN_ARG_pointers[] =
3798
{
3799
  &_gxdp_open_uri_method_info_open_file_IN_ARG_parent_window.parent_struct,
3800
  &_gxdp_open_uri_method_info_open_file_IN_ARG_fd.parent_struct,
3801
  &_gxdp_open_uri_method_info_open_file_IN_ARG_options.parent_struct,
3802
  NULL
3803
};
3804
3805
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_OUT_ARG_handle =
3806
{
3807
  {
3808
    -1,
3809
    (gchar *) "handle",
3810
    (gchar *) "o",
3811
    NULL
3812
  },
3813
  FALSE
3814
};
3815
3816
static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_file_OUT_ARG_pointers[] =
3817
{
3818
  &_gxdp_open_uri_method_info_open_file_OUT_ARG_handle.parent_struct,
3819
  NULL
3820
};
3821
3822
static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_file =
3823
{
3824
  {
3825
    -1,
3826
    (gchar *) "OpenFile",
3827
    (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_file_IN_ARG_pointers,
3828
    (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_file_OUT_ARG_pointers,
3829
    NULL
3830
  },
3831
  "handle-open-file",
3832
  TRUE
3833
};
3834
3835
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_parent_window =
3836
{
3837
  {
3838
    -1,
3839
    (gchar *) "parent_window",
3840
    (gchar *) "s",
3841
    NULL
3842
  },
3843
  FALSE
3844
};
3845
3846
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_fd =
3847
{
3848
  {
3849
    -1,
3850
    (gchar *) "fd",
3851
    (gchar *) "h",
3852
    NULL
3853
  },
3854
  FALSE
3855
};
3856
3857
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_options =
3858
{
3859
  {
3860
    -1,
3861
    (gchar *) "options",
3862
    (gchar *) "a{sv}",
3863
    NULL
3864
  },
3865
  FALSE
3866
};
3867
3868
static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_directory_IN_ARG_pointers[] =
3869
{
3870
  &_gxdp_open_uri_method_info_open_directory_IN_ARG_parent_window.parent_struct,
3871
  &_gxdp_open_uri_method_info_open_directory_IN_ARG_fd.parent_struct,
3872
  &_gxdp_open_uri_method_info_open_directory_IN_ARG_options.parent_struct,
3873
  NULL
3874
};
3875
3876
static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_OUT_ARG_handle =
3877
{
3878
  {
3879
    -1,
3880
    (gchar *) "handle",
3881
    (gchar *) "o",
3882
    NULL
3883
  },
3884
  FALSE
3885
};
3886
3887
static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_directory_OUT_ARG_pointers[] =
3888
{
3889
  &_gxdp_open_uri_method_info_open_directory_OUT_ARG_handle.parent_struct,
3890
  NULL
3891
};
3892
3893
static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_directory =
3894
{
3895
  {
3896
    -1,
3897
    (gchar *) "OpenDirectory",
3898
    (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_directory_IN_ARG_pointers,
3899
    (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_directory_OUT_ARG_pointers,
3900
    NULL
3901
  },
3902
  "handle-open-directory",
3903
  TRUE
3904
};
3905
3906
static const GDBusMethodInfo * const _gxdp_open_uri_method_info_pointers[] =
3907
{
3908
  &_gxdp_open_uri_method_info_open_uri.parent_struct,
3909
  &_gxdp_open_uri_method_info_open_file.parent_struct,
3910
  &_gxdp_open_uri_method_info_open_directory.parent_struct,
3911
  NULL
3912
};
3913
3914
static const _ExtendedGDBusPropertyInfo _gxdp_open_uri_property_info_version =
3915
{
3916
  {
3917
    -1,
3918
    (gchar *) "version",
3919
    (gchar *) "u",
3920
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
3921
    NULL
3922
  },
3923
  "version",
3924
  FALSE,
3925
  TRUE
3926
};
3927
3928
static const GDBusPropertyInfo * const _gxdp_open_uri_property_info_pointers[] =
3929
{
3930
  &_gxdp_open_uri_property_info_version.parent_struct,
3931
  NULL
3932
};
3933
3934
static const _ExtendedGDBusInterfaceInfo _gxdp_open_uri_interface_info =
3935
{
3936
  {
3937
    -1,
3938
    (gchar *) "org.freedesktop.portal.OpenURI",
3939
    (GDBusMethodInfo **) &_gxdp_open_uri_method_info_pointers,
3940
    NULL,
3941
    (GDBusPropertyInfo **) &_gxdp_open_uri_property_info_pointers,
3942
    NULL
3943
  },
3944
  "open-uri",
3945
};
3946
3947
3948
/**
3949
 * gxdp_open_uri_interface_info:
3950
 *
3951
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link> D-Bus interface.
3952
 *
3953
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
3954
 */
3955
GDBusInterfaceInfo *
3956
gxdp_open_uri_interface_info (void)
3957
0
{
3958
0
  return (GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct;
3959
0
}
3960
3961
/**
3962
 * gxdp_open_uri_override_properties:
3963
 * @klass: The class structure for a #GObject derived class.
3964
 * @property_id_begin: The property id to assign to the first overridden property.
3965
 *
3966
 * Overrides all #GObject properties in the #GXdpOpenURI interface for a concrete class.
3967
 * The properties are overridden in the order they are defined.
3968
 *
3969
 * Returns: The last property id.
3970
 */
3971
guint
3972
gxdp_open_uri_override_properties (GObjectClass *klass, guint property_id_begin)
3973
0
{
3974
0
  g_object_class_override_property (klass, property_id_begin++, "version");
3975
0
  return property_id_begin - 1;
3976
0
}
3977
3978
3979
3980
/**
3981
 * GXdpOpenURI:
3982
 *
3983
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>.
3984
 */
3985
3986
/**
3987
 * GXdpOpenURIIface:
3988
 * @parent_iface: The parent interface.
3989
 * @handle_open_directory: Handler for the #GXdpOpenURI::handle-open-directory signal.
3990
 * @handle_open_file: Handler for the #GXdpOpenURI::handle-open-file signal.
3991
 * @handle_open_uri: Handler for the #GXdpOpenURI::handle-open-uri signal.
3992
 * @get_version: Getter for the #GXdpOpenURI:version property.
3993
 *
3994
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>.
3995
 */
3996
3997
typedef GXdpOpenURIIface GXdpOpenURIInterface;
3998
G_DEFINE_INTERFACE (GXdpOpenURI, gxdp_open_uri, G_TYPE_OBJECT)
3999
4000
static void
4001
gxdp_open_uri_default_init (GXdpOpenURIIface *iface)
4002
0
{
4003
  /* GObject signals for incoming D-Bus method calls: */
4004
  /**
4005
   * GXdpOpenURI::handle-open-uri:
4006
   * @object: A #GXdpOpenURI.
4007
   * @invocation: A #GDBusMethodInvocation.
4008
   * @arg_parent_window: Argument passed by remote caller.
4009
   * @arg_uri: Argument passed by remote caller.
4010
   * @arg_options: Argument passed by remote caller.
4011
   *
4012
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</link> D-Bus method.
4013
   *
4014
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_open_uri_complete_open_uri() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
4015
   *
4016
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
4017
   */
4018
0
  g_signal_new ("handle-open-uri",
4019
0
    G_TYPE_FROM_INTERFACE (iface),
4020
0
    G_SIGNAL_RUN_LAST,
4021
0
    G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_uri),
4022
0
    g_signal_accumulator_true_handled,
4023
0
    NULL,
4024
0
    g_cclosure_marshal_generic,
4025
0
    G_TYPE_BOOLEAN,
4026
0
    4,
4027
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);
4028
4029
  /**
4030
   * GXdpOpenURI::handle-open-file:
4031
   * @object: A #GXdpOpenURI.
4032
   * @invocation: A #GDBusMethodInvocation.
4033
   * @fd_list: (nullable): A #GUnixFDList or %NULL.
4034
   * @arg_parent_window: Argument passed by remote caller.
4035
   * @arg_fd: Argument passed by remote caller.
4036
   * @arg_options: Argument passed by remote caller.
4037
   *
4038
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</link> D-Bus method.
4039
   *
4040
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_open_uri_complete_open_file() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
4041
   *
4042
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
4043
   */
4044
0
  g_signal_new ("handle-open-file",
4045
0
    G_TYPE_FROM_INTERFACE (iface),
4046
0
    G_SIGNAL_RUN_LAST,
4047
0
    G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_file),
4048
0
    g_signal_accumulator_true_handled,
4049
0
    NULL,
4050
0
    g_cclosure_marshal_generic,
4051
0
    G_TYPE_BOOLEAN,
4052
0
    5,
4053
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT);
4054
4055
  /**
4056
   * GXdpOpenURI::handle-open-directory:
4057
   * @object: A #GXdpOpenURI.
4058
   * @invocation: A #GDBusMethodInvocation.
4059
   * @fd_list: (nullable): A #GUnixFDList or %NULL.
4060
   * @arg_parent_window: Argument passed by remote caller.
4061
   * @arg_fd: Argument passed by remote caller.
4062
   * @arg_options: Argument passed by remote caller.
4063
   *
4064
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenDirectory">OpenDirectory()</link> D-Bus method.
4065
   *
4066
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_open_uri_complete_open_directory() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
4067
   *
4068
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
4069
   */
4070
0
  g_signal_new ("handle-open-directory",
4071
0
    G_TYPE_FROM_INTERFACE (iface),
4072
0
    G_SIGNAL_RUN_LAST,
4073
0
    G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_directory),
4074
0
    g_signal_accumulator_true_handled,
4075
0
    NULL,
4076
0
    g_cclosure_marshal_generic,
4077
0
    G_TYPE_BOOLEAN,
4078
0
    5,
4079
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT);
4080
4081
  /* GObject properties for D-Bus properties: */
4082
  /**
4083
   * GXdpOpenURI:version:
4084
   *
4085
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</link>.
4086
   *
4087
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
4088
   */
4089
0
  g_object_interface_install_property (iface,
4090
0
    g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4091
0
}
4092
4093
/**
4094
 * gxdp_open_uri_get_version: (skip)
4095
 * @object: A #GXdpOpenURI.
4096
 *
4097
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</link> D-Bus property.
4098
 *
4099
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4100
 *
4101
 * Returns: The property value.
4102
 */
4103
guint 
4104
gxdp_open_uri_get_version (GXdpOpenURI *object)
4105
0
{
4106
0
  g_return_val_if_fail (GXDP_IS_OPEN_URI (object), 0);
4107
4108
0
  return GXDP_OPEN_URI_GET_IFACE (object)->get_version (object);
4109
0
}
4110
4111
/**
4112
 * gxdp_open_uri_set_version: (skip)
4113
 * @object: A #GXdpOpenURI.
4114
 * @value: The value to set.
4115
 *
4116
 * Sets the <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</link> D-Bus property to @value.
4117
 *
4118
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4119
 */
4120
void
4121
gxdp_open_uri_set_version (GXdpOpenURI *object, guint value)
4122
0
{
4123
0
  g_object_set (G_OBJECT (object), "version", value, NULL);
4124
0
}
4125
4126
/**
4127
 * gxdp_open_uri_call_open_uri:
4128
 * @proxy: A #GXdpOpenURIProxy.
4129
 * @arg_parent_window: Argument to pass with the method invocation.
4130
 * @arg_uri: Argument to pass with the method invocation.
4131
 * @arg_options: Argument to pass with the method invocation.
4132
 * @cancellable: (nullable): A #GCancellable or %NULL.
4133
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4134
 * @user_data: User data to pass to @callback.
4135
 *
4136
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</link> D-Bus method on @proxy.
4137
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
4138
 * You can then call gxdp_open_uri_call_open_uri_finish() to get the result of the operation.
4139
 *
4140
 * See gxdp_open_uri_call_open_uri_sync() for the synchronous, blocking version of this method.
4141
 */
4142
void
4143
gxdp_open_uri_call_open_uri (
4144
    GXdpOpenURI *proxy,
4145
    const gchar *arg_parent_window,
4146
    const gchar *arg_uri,
4147
    GVariant *arg_options,
4148
    GCancellable *cancellable,
4149
    GAsyncReadyCallback callback,
4150
    gpointer user_data)
4151
0
{
4152
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
4153
0
    "OpenURI",
4154
0
    g_variant_new ("(ss@a{sv})",
4155
0
                   arg_parent_window,
4156
0
                   arg_uri,
4157
0
                   arg_options),
4158
0
    G_DBUS_CALL_FLAGS_NONE,
4159
0
    -1,
4160
0
    cancellable,
4161
0
    callback,
4162
0
    user_data);
4163
0
}
4164
4165
/**
4166
 * gxdp_open_uri_call_open_uri_finish:
4167
 * @proxy: A #GXdpOpenURIProxy.
4168
 * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore.
4169
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_uri().
4170
 * @error: Return location for error or %NULL.
4171
 *
4172
 * Finishes an operation started with gxdp_open_uri_call_open_uri().
4173
 *
4174
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
4175
 */
4176
gboolean
4177
gxdp_open_uri_call_open_uri_finish (
4178
    GXdpOpenURI *proxy,
4179
    gchar **out_handle,
4180
    GAsyncResult *res,
4181
    GError **error)
4182
0
{
4183
0
  GVariant *_ret;
4184
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
4185
0
  if (_ret == NULL)
4186
0
    goto _out;
4187
0
  g_variant_get (_ret,
4188
0
                 "(o)",
4189
0
                 out_handle);
4190
0
  g_variant_unref (_ret);
4191
0
_out:
4192
0
  return _ret != NULL;
4193
0
}
4194
4195
/**
4196
 * gxdp_open_uri_call_open_uri_sync:
4197
 * @proxy: A #GXdpOpenURIProxy.
4198
 * @arg_parent_window: Argument to pass with the method invocation.
4199
 * @arg_uri: Argument to pass with the method invocation.
4200
 * @arg_options: Argument to pass with the method invocation.
4201
 * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore.
4202
 * @cancellable: (nullable): A #GCancellable or %NULL.
4203
 * @error: Return location for error or %NULL.
4204
 *
4205
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
4206
 *
4207
 * See gxdp_open_uri_call_open_uri() for the asynchronous version of this method.
4208
 *
4209
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
4210
 */
4211
gboolean
4212
gxdp_open_uri_call_open_uri_sync (
4213
    GXdpOpenURI *proxy,
4214
    const gchar *arg_parent_window,
4215
    const gchar *arg_uri,
4216
    GVariant *arg_options,
4217
    gchar **out_handle,
4218
    GCancellable *cancellable,
4219
    GError **error)
4220
0
{
4221
0
  GVariant *_ret;
4222
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
4223
0
    "OpenURI",
4224
0
    g_variant_new ("(ss@a{sv})",
4225
0
                   arg_parent_window,
4226
0
                   arg_uri,
4227
0
                   arg_options),
4228
0
    G_DBUS_CALL_FLAGS_NONE,
4229
0
    -1,
4230
0
    cancellable,
4231
0
    error);
4232
0
  if (_ret == NULL)
4233
0
    goto _out;
4234
0
  g_variant_get (_ret,
4235
0
                 "(o)",
4236
0
                 out_handle);
4237
0
  g_variant_unref (_ret);
4238
0
_out:
4239
0
  return _ret != NULL;
4240
0
}
4241
4242
/**
4243
 * gxdp_open_uri_call_open_file:
4244
 * @proxy: A #GXdpOpenURIProxy.
4245
 * @arg_parent_window: Argument to pass with the method invocation.
4246
 * @arg_fd: Argument to pass with the method invocation.
4247
 * @arg_options: Argument to pass with the method invocation.
4248
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
4249
 * @cancellable: (nullable): A #GCancellable or %NULL.
4250
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4251
 * @user_data: User data to pass to @callback.
4252
 *
4253
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</link> D-Bus method on @proxy.
4254
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
4255
 * You can then call gxdp_open_uri_call_open_file_finish() to get the result of the operation.
4256
 *
4257
 * See gxdp_open_uri_call_open_file_sync() for the synchronous, blocking version of this method.
4258
 */
4259
void
4260
gxdp_open_uri_call_open_file (
4261
    GXdpOpenURI *proxy,
4262
    const gchar *arg_parent_window,
4263
    GVariant *arg_fd,
4264
    GVariant *arg_options,
4265
    GUnixFDList *fd_list,
4266
    GCancellable *cancellable,
4267
    GAsyncReadyCallback callback,
4268
    gpointer user_data)
4269
0
{
4270
0
  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
4271
0
    "OpenFile",
4272
0
    g_variant_new ("(s@h@a{sv})",
4273
0
                   arg_parent_window,
4274
0
                   arg_fd,
4275
0
                   arg_options),
4276
0
    G_DBUS_CALL_FLAGS_NONE,
4277
0
    -1,
4278
0
    fd_list,
4279
0
    cancellable,
4280
0
    callback,
4281
0
    user_data);
4282
0
}
4283
4284
/**
4285
 * gxdp_open_uri_call_open_file_finish:
4286
 * @proxy: A #GXdpOpenURIProxy.
4287
 * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore.
4288
 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
4289
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_file().
4290
 * @error: Return location for error or %NULL.
4291
 *
4292
 * Finishes an operation started with gxdp_open_uri_call_open_file().
4293
 *
4294
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
4295
 */
4296
gboolean
4297
gxdp_open_uri_call_open_file_finish (
4298
    GXdpOpenURI *proxy,
4299
    gchar **out_handle,
4300
    GUnixFDList **out_fd_list,
4301
    GAsyncResult *res,
4302
    GError **error)
4303
0
{
4304
0
  GVariant *_ret;
4305
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
4306
0
  if (_ret == NULL)
4307
0
    goto _out;
4308
0
  g_variant_get (_ret,
4309
0
                 "(o)",
4310
0
                 out_handle);
4311
0
  g_variant_unref (_ret);
4312
0
_out:
4313
0
  return _ret != NULL;
4314
0
}
4315
4316
/**
4317
 * gxdp_open_uri_call_open_file_sync:
4318
 * @proxy: A #GXdpOpenURIProxy.
4319
 * @arg_parent_window: Argument to pass with the method invocation.
4320
 * @arg_fd: Argument to pass with the method invocation.
4321
 * @arg_options: Argument to pass with the method invocation.
4322
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
4323
 * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore.
4324
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
4325
 * @cancellable: (nullable): A #GCancellable or %NULL.
4326
 * @error: Return location for error or %NULL.
4327
 *
4328
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
4329
 *
4330
 * See gxdp_open_uri_call_open_file() for the asynchronous version of this method.
4331
 *
4332
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
4333
 */
4334
gboolean
4335
gxdp_open_uri_call_open_file_sync (
4336
    GXdpOpenURI *proxy,
4337
    const gchar *arg_parent_window,
4338
    GVariant *arg_fd,
4339
    GVariant *arg_options,
4340
    GUnixFDList  *fd_list,
4341
    gchar **out_handle,
4342
    GUnixFDList **out_fd_list,
4343
    GCancellable *cancellable,
4344
    GError **error)
4345
0
{
4346
0
  GVariant *_ret;
4347
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
4348
0
    "OpenFile",
4349
0
    g_variant_new ("(s@h@a{sv})",
4350
0
                   arg_parent_window,
4351
0
                   arg_fd,
4352
0
                   arg_options),
4353
0
    G_DBUS_CALL_FLAGS_NONE,
4354
0
    -1,
4355
0
    fd_list,
4356
0
    out_fd_list,
4357
0
    cancellable,
4358
0
    error);
4359
0
  if (_ret == NULL)
4360
0
    goto _out;
4361
0
  g_variant_get (_ret,
4362
0
                 "(o)",
4363
0
                 out_handle);
4364
0
  g_variant_unref (_ret);
4365
0
_out:
4366
0
  return _ret != NULL;
4367
0
}
4368
4369
/**
4370
 * gxdp_open_uri_call_open_directory:
4371
 * @proxy: A #GXdpOpenURIProxy.
4372
 * @arg_parent_window: Argument to pass with the method invocation.
4373
 * @arg_fd: Argument to pass with the method invocation.
4374
 * @arg_options: Argument to pass with the method invocation.
4375
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
4376
 * @cancellable: (nullable): A #GCancellable or %NULL.
4377
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
4378
 * @user_data: User data to pass to @callback.
4379
 *
4380
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenDirectory">OpenDirectory()</link> D-Bus method on @proxy.
4381
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
4382
 * You can then call gxdp_open_uri_call_open_directory_finish() to get the result of the operation.
4383
 *
4384
 * See gxdp_open_uri_call_open_directory_sync() for the synchronous, blocking version of this method.
4385
 */
4386
void
4387
gxdp_open_uri_call_open_directory (
4388
    GXdpOpenURI *proxy,
4389
    const gchar *arg_parent_window,
4390
    GVariant *arg_fd,
4391
    GVariant *arg_options,
4392
    GUnixFDList *fd_list,
4393
    GCancellable *cancellable,
4394
    GAsyncReadyCallback callback,
4395
    gpointer user_data)
4396
0
{
4397
0
  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
4398
0
    "OpenDirectory",
4399
0
    g_variant_new ("(s@h@a{sv})",
4400
0
                   arg_parent_window,
4401
0
                   arg_fd,
4402
0
                   arg_options),
4403
0
    G_DBUS_CALL_FLAGS_NONE,
4404
0
    -1,
4405
0
    fd_list,
4406
0
    cancellable,
4407
0
    callback,
4408
0
    user_data);
4409
0
}
4410
4411
/**
4412
 * gxdp_open_uri_call_open_directory_finish:
4413
 * @proxy: A #GXdpOpenURIProxy.
4414
 * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore.
4415
 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
4416
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_directory().
4417
 * @error: Return location for error or %NULL.
4418
 *
4419
 * Finishes an operation started with gxdp_open_uri_call_open_directory().
4420
 *
4421
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
4422
 */
4423
gboolean
4424
gxdp_open_uri_call_open_directory_finish (
4425
    GXdpOpenURI *proxy,
4426
    gchar **out_handle,
4427
    GUnixFDList **out_fd_list,
4428
    GAsyncResult *res,
4429
    GError **error)
4430
0
{
4431
0
  GVariant *_ret;
4432
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
4433
0
  if (_ret == NULL)
4434
0
    goto _out;
4435
0
  g_variant_get (_ret,
4436
0
                 "(o)",
4437
0
                 out_handle);
4438
0
  g_variant_unref (_ret);
4439
0
_out:
4440
0
  return _ret != NULL;
4441
0
}
4442
4443
/**
4444
 * gxdp_open_uri_call_open_directory_sync:
4445
 * @proxy: A #GXdpOpenURIProxy.
4446
 * @arg_parent_window: Argument to pass with the method invocation.
4447
 * @arg_fd: Argument to pass with the method invocation.
4448
 * @arg_options: Argument to pass with the method invocation.
4449
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
4450
 * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore.
4451
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
4452
 * @cancellable: (nullable): A #GCancellable or %NULL.
4453
 * @error: Return location for error or %NULL.
4454
 *
4455
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenDirectory">OpenDirectory()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
4456
 *
4457
 * See gxdp_open_uri_call_open_directory() for the asynchronous version of this method.
4458
 *
4459
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
4460
 */
4461
gboolean
4462
gxdp_open_uri_call_open_directory_sync (
4463
    GXdpOpenURI *proxy,
4464
    const gchar *arg_parent_window,
4465
    GVariant *arg_fd,
4466
    GVariant *arg_options,
4467
    GUnixFDList  *fd_list,
4468
    gchar **out_handle,
4469
    GUnixFDList **out_fd_list,
4470
    GCancellable *cancellable,
4471
    GError **error)
4472
0
{
4473
0
  GVariant *_ret;
4474
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
4475
0
    "OpenDirectory",
4476
0
    g_variant_new ("(s@h@a{sv})",
4477
0
                   arg_parent_window,
4478
0
                   arg_fd,
4479
0
                   arg_options),
4480
0
    G_DBUS_CALL_FLAGS_NONE,
4481
0
    -1,
4482
0
    fd_list,
4483
0
    out_fd_list,
4484
0
    cancellable,
4485
0
    error);
4486
0
  if (_ret == NULL)
4487
0
    goto _out;
4488
0
  g_variant_get (_ret,
4489
0
                 "(o)",
4490
0
                 out_handle);
4491
0
  g_variant_unref (_ret);
4492
0
_out:
4493
0
  return _ret != NULL;
4494
0
}
4495
4496
/**
4497
 * gxdp_open_uri_complete_open_uri:
4498
 * @object: A #GXdpOpenURI.
4499
 * @invocation: (transfer full): A #GDBusMethodInvocation.
4500
 * @handle: Parameter to return.
4501
 *
4502
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
4503
 *
4504
 * This method will free @invocation, you cannot use it afterwards.
4505
 */
4506
void
4507
gxdp_open_uri_complete_open_uri (
4508
    GXdpOpenURI *object G_GNUC_UNUSED,
4509
    GDBusMethodInvocation *invocation,
4510
    const gchar *handle)
4511
0
{
4512
0
  g_dbus_method_invocation_return_value (invocation,
4513
0
    g_variant_new ("(o)",
4514
0
                   handle));
4515
0
}
4516
4517
/**
4518
 * gxdp_open_uri_complete_open_file:
4519
 * @object: A #GXdpOpenURI.
4520
 * @invocation: (transfer full): A #GDBusMethodInvocation.
4521
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
4522
 * @handle: Parameter to return.
4523
 *
4524
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
4525
 *
4526
 * This method will free @invocation, you cannot use it afterwards.
4527
 */
4528
void
4529
gxdp_open_uri_complete_open_file (
4530
    GXdpOpenURI *object G_GNUC_UNUSED,
4531
    GDBusMethodInvocation *invocation,
4532
    GUnixFDList *fd_list,
4533
    const gchar *handle)
4534
0
{
4535
0
  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
4536
0
    g_variant_new ("(o)",
4537
0
                   handle),
4538
0
    fd_list);
4539
0
}
4540
4541
/**
4542
 * gxdp_open_uri_complete_open_directory:
4543
 * @object: A #GXdpOpenURI.
4544
 * @invocation: (transfer full): A #GDBusMethodInvocation.
4545
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
4546
 * @handle: Parameter to return.
4547
 *
4548
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenDirectory">OpenDirectory()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
4549
 *
4550
 * This method will free @invocation, you cannot use it afterwards.
4551
 */
4552
void
4553
gxdp_open_uri_complete_open_directory (
4554
    GXdpOpenURI *object G_GNUC_UNUSED,
4555
    GDBusMethodInvocation *invocation,
4556
    GUnixFDList *fd_list,
4557
    const gchar *handle)
4558
0
{
4559
0
  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
4560
0
    g_variant_new ("(o)",
4561
0
                   handle),
4562
0
    fd_list);
4563
0
}
4564
4565
/* ------------------------------------------------------------------------ */
4566
4567
/**
4568
 * GXdpOpenURIProxy:
4569
 *
4570
 * The #GXdpOpenURIProxy structure contains only private data and should only be accessed using the provided API.
4571
 */
4572
4573
/**
4574
 * GXdpOpenURIProxyClass:
4575
 * @parent_class: The parent class.
4576
 *
4577
 * Class structure for #GXdpOpenURIProxy.
4578
 */
4579
4580
struct _GXdpOpenURIProxyPrivate
4581
{
4582
  GData *qdata;
4583
};
4584
4585
static void gxdp_open_uri_proxy_iface_init (GXdpOpenURIIface *iface);
4586
4587
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4588
G_DEFINE_TYPE_WITH_CODE (GXdpOpenURIProxy, gxdp_open_uri_proxy, G_TYPE_DBUS_PROXY,
4589
                         G_ADD_PRIVATE (GXdpOpenURIProxy)
4590
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_proxy_iface_init))
4591
4592
#else
4593
G_DEFINE_TYPE_WITH_CODE (GXdpOpenURIProxy, gxdp_open_uri_proxy, G_TYPE_DBUS_PROXY,
4594
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_proxy_iface_init))
4595
4596
#endif
4597
static void
4598
gxdp_open_uri_proxy_finalize (GObject *object)
4599
0
{
4600
0
  GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (object);
4601
0
  g_datalist_clear (&proxy->priv->qdata);
4602
0
  G_OBJECT_CLASS (gxdp_open_uri_proxy_parent_class)->finalize (object);
4603
0
}
4604
4605
static void
4606
gxdp_open_uri_proxy_get_property (GObject      *object,
4607
  guint         prop_id,
4608
  GValue       *value,
4609
  GParamSpec   *pspec G_GNUC_UNUSED)
4610
0
{
4611
0
  const _ExtendedGDBusPropertyInfo *info;
4612
0
  GVariant *variant;
4613
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
4614
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1];
4615
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
4616
0
  if (info->use_gvariant)
4617
0
    {
4618
0
      g_value_set_variant (value, variant);
4619
0
    }
4620
0
  else
4621
0
    {
4622
0
      if (variant != NULL)
4623
0
        g_dbus_gvariant_to_gvalue (variant, value);
4624
0
    }
4625
0
  if (variant != NULL)
4626
0
    g_variant_unref (variant);
4627
0
}
4628
4629
static void
4630
gxdp_open_uri_proxy_set_property_cb (GDBusProxy *proxy,
4631
  GAsyncResult *res,
4632
  gpointer      user_data)
4633
0
{
4634
0
  const _ExtendedGDBusPropertyInfo *info = user_data;
4635
0
  GError *error;
4636
0
  GVariant *_ret;
4637
0
  error = NULL;
4638
0
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
4639
0
  if (!_ret)
4640
0
    {
4641
0
      g_warning ("Error setting property '%s' on interface org.freedesktop.portal.OpenURI: %s (%s, %d)",
4642
0
                 info->parent_struct.name, 
4643
0
                 error->message, g_quark_to_string (error->domain), error->code);
4644
0
      g_error_free (error);
4645
0
    }
4646
0
  else
4647
0
    {
4648
0
      g_variant_unref (_ret);
4649
0
    }
4650
0
}
4651
4652
static void
4653
gxdp_open_uri_proxy_set_property (GObject      *object,
4654
  guint         prop_id,
4655
  const GValue *value,
4656
  GParamSpec   *pspec G_GNUC_UNUSED)
4657
0
{
4658
0
  const _ExtendedGDBusPropertyInfo *info;
4659
0
  GVariant *variant;
4660
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
4661
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1];
4662
0
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
4663
0
  g_dbus_proxy_call (G_DBUS_PROXY (object),
4664
0
    "org.freedesktop.DBus.Properties.Set",
4665
0
    g_variant_new ("(ssv)", "org.freedesktop.portal.OpenURI", info->parent_struct.name, variant),
4666
0
    G_DBUS_CALL_FLAGS_NONE,
4667
0
    -1,
4668
0
    NULL, (GAsyncReadyCallback) gxdp_open_uri_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
4669
0
  g_variant_unref (variant);
4670
0
}
4671
4672
static void
4673
gxdp_open_uri_proxy_g_signal (GDBusProxy *proxy,
4674
  const gchar *sender_name G_GNUC_UNUSED,
4675
  const gchar *signal_name,
4676
  GVariant *parameters)
4677
0
{
4678
0
  _ExtendedGDBusSignalInfo *info;
4679
0
  GVariantIter iter;
4680
0
  GVariant *child;
4681
0
  GValue *paramv;
4682
0
  gsize num_params;
4683
0
  gsize n;
4684
0
  guint signal_id;
4685
0
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, signal_name);
4686
0
  if (info == NULL)
4687
0
    return;
4688
0
  num_params = g_variant_n_children (parameters);
4689
0
  paramv = g_new0 (GValue, num_params + 1);
4690
0
  g_value_init (&paramv[0], GXDP_TYPE_OPEN_URI);
4691
0
  g_value_set_object (&paramv[0], proxy);
4692
0
  g_variant_iter_init (&iter, parameters);
4693
0
  n = 1;
4694
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
4695
0
    {
4696
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
4697
0
      if (arg_info->use_gvariant)
4698
0
        {
4699
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
4700
0
          g_value_set_variant (&paramv[n], child);
4701
0
          n++;
4702
0
        }
4703
0
      else
4704
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
4705
0
      g_variant_unref (child);
4706
0
    }
4707
0
  signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_OPEN_URI);
4708
0
  g_signal_emitv (paramv, signal_id, 0, NULL);
4709
0
  for (n = 0; n < num_params + 1; n++)
4710
0
    g_value_unset (&paramv[n]);
4711
0
  g_free (paramv);
4712
0
}
4713
4714
static void
4715
gxdp_open_uri_proxy_g_properties_changed (GDBusProxy *_proxy,
4716
  GVariant *changed_properties,
4717
  const gchar *const *invalidated_properties)
4718
0
{
4719
0
  GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (_proxy);
4720
0
  guint n;
4721
0
  const gchar *key;
4722
0
  GVariantIter *iter;
4723
0
  _ExtendedGDBusPropertyInfo *info;
4724
0
  g_variant_get (changed_properties, "a{sv}", &iter);
4725
0
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
4726
0
    {
4727
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, key);
4728
0
      g_datalist_remove_data (&proxy->priv->qdata, key);
4729
0
      if (info != NULL)
4730
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4731
0
    }
4732
0
  g_variant_iter_free (iter);
4733
0
  for (n = 0; invalidated_properties[n] != NULL; n++)
4734
0
    {
4735
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, invalidated_properties[n]);
4736
0
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
4737
0
      if (info != NULL)
4738
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4739
0
    }
4740
0
}
4741
4742
static guint 
4743
gxdp_open_uri_proxy_get_version (GXdpOpenURI *object)
4744
0
{
4745
0
  GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (object);
4746
0
  GVariant *variant;
4747
0
  guint value = 0;
4748
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version");
4749
0
  if (variant != NULL)
4750
0
    {
4751
0
      value = g_variant_get_uint32 (variant);
4752
0
      g_variant_unref (variant);
4753
0
    }
4754
0
  return value;
4755
0
}
4756
4757
static void
4758
gxdp_open_uri_proxy_init (GXdpOpenURIProxy *proxy)
4759
0
{
4760
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4761
0
  proxy->priv = gxdp_open_uri_proxy_get_instance_private (proxy);
4762
#else
4763
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_OPEN_URI_PROXY, GXdpOpenURIProxyPrivate);
4764
#endif
4765
4766
0
  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_open_uri_interface_info ());
4767
0
}
4768
4769
static void
4770
gxdp_open_uri_proxy_class_init (GXdpOpenURIProxyClass *klass)
4771
0
{
4772
0
  GObjectClass *gobject_class;
4773
0
  GDBusProxyClass *proxy_class;
4774
4775
0
  gobject_class = G_OBJECT_CLASS (klass);
4776
0
  gobject_class->finalize     = gxdp_open_uri_proxy_finalize;
4777
0
  gobject_class->get_property = gxdp_open_uri_proxy_get_property;
4778
0
  gobject_class->set_property = gxdp_open_uri_proxy_set_property;
4779
4780
0
  proxy_class = G_DBUS_PROXY_CLASS (klass);
4781
0
  proxy_class->g_signal = gxdp_open_uri_proxy_g_signal;
4782
0
  proxy_class->g_properties_changed = gxdp_open_uri_proxy_g_properties_changed;
4783
4784
0
  gxdp_open_uri_override_properties (gobject_class, 1);
4785
4786
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
4787
  g_type_class_add_private (klass, sizeof (GXdpOpenURIProxyPrivate));
4788
#endif
4789
0
}
4790
4791
static void
4792
gxdp_open_uri_proxy_iface_init (GXdpOpenURIIface *iface)
4793
0
{
4794
0
  iface->get_version = gxdp_open_uri_proxy_get_version;
4795
0
}
4796
4797
/**
4798
 * gxdp_open_uri_proxy_new:
4799
 * @connection: A #GDBusConnection.
4800
 * @flags: Flags from the #GDBusProxyFlags enumeration.
4801
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
4802
 * @object_path: An object path.
4803
 * @cancellable: (nullable): A #GCancellable or %NULL.
4804
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
4805
 * @user_data: User data to pass to @callback.
4806
 *
4807
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>. See g_dbus_proxy_new() for more details.
4808
 *
4809
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
4810
 * You can then call gxdp_open_uri_proxy_new_finish() to get the result of the operation.
4811
 *
4812
 * See gxdp_open_uri_proxy_new_sync() for the synchronous, blocking version of this constructor.
4813
 */
4814
void
4815
gxdp_open_uri_proxy_new (
4816
    GDBusConnection     *connection,
4817
    GDBusProxyFlags      flags,
4818
    const gchar         *name,
4819
    const gchar         *object_path,
4820
    GCancellable        *cancellable,
4821
    GAsyncReadyCallback  callback,
4822
    gpointer             user_data)
4823
0
{
4824
0
  g_async_initable_new_async (GXDP_TYPE_OPEN_URI_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.OpenURI", NULL);
4825
0
}
4826
4827
/**
4828
 * gxdp_open_uri_proxy_new_finish:
4829
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_proxy_new().
4830
 * @error: Return location for error or %NULL
4831
 *
4832
 * Finishes an operation started with gxdp_open_uri_proxy_new().
4833
 *
4834
 * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set.
4835
 */
4836
GXdpOpenURI *
4837
gxdp_open_uri_proxy_new_finish (
4838
    GAsyncResult        *res,
4839
    GError             **error)
4840
0
{
4841
0
  GObject *ret;
4842
0
  GObject *source_object;
4843
0
  source_object = g_async_result_get_source_object (res);
4844
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
4845
0
  g_object_unref (source_object);
4846
0
  if (ret != NULL)
4847
0
    return GXDP_OPEN_URI (ret);
4848
0
  else
4849
0
    return NULL;
4850
0
}
4851
4852
/**
4853
 * gxdp_open_uri_proxy_new_sync:
4854
 * @connection: A #GDBusConnection.
4855
 * @flags: Flags from the #GDBusProxyFlags enumeration.
4856
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
4857
 * @object_path: An object path.
4858
 * @cancellable: (nullable): A #GCancellable or %NULL.
4859
 * @error: Return location for error or %NULL
4860
 *
4861
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>. See g_dbus_proxy_new_sync() for more details.
4862
 *
4863
 * The calling thread is blocked until a reply is received.
4864
 *
4865
 * See gxdp_open_uri_proxy_new() for the asynchronous version of this constructor.
4866
 *
4867
 * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set.
4868
 */
4869
GXdpOpenURI *
4870
gxdp_open_uri_proxy_new_sync (
4871
    GDBusConnection     *connection,
4872
    GDBusProxyFlags      flags,
4873
    const gchar         *name,
4874
    const gchar         *object_path,
4875
    GCancellable        *cancellable,
4876
    GError             **error)
4877
0
{
4878
0
  GInitable *ret;
4879
0
  ret = g_initable_new (GXDP_TYPE_OPEN_URI_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.OpenURI", NULL);
4880
0
  if (ret != NULL)
4881
0
    return GXDP_OPEN_URI (ret);
4882
0
  else
4883
0
    return NULL;
4884
0
}
4885
4886
4887
/**
4888
 * gxdp_open_uri_proxy_new_for_bus:
4889
 * @bus_type: A #GBusType.
4890
 * @flags: Flags from the #GDBusProxyFlags enumeration.
4891
 * @name: A bus name (well-known or unique).
4892
 * @object_path: An object path.
4893
 * @cancellable: (nullable): A #GCancellable or %NULL.
4894
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
4895
 * @user_data: User data to pass to @callback.
4896
 *
4897
 * Like gxdp_open_uri_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
4898
 *
4899
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
4900
 * You can then call gxdp_open_uri_proxy_new_for_bus_finish() to get the result of the operation.
4901
 *
4902
 * See gxdp_open_uri_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
4903
 */
4904
void
4905
gxdp_open_uri_proxy_new_for_bus (
4906
    GBusType             bus_type,
4907
    GDBusProxyFlags      flags,
4908
    const gchar         *name,
4909
    const gchar         *object_path,
4910
    GCancellable        *cancellable,
4911
    GAsyncReadyCallback  callback,
4912
    gpointer             user_data)
4913
0
{
4914
0
  g_async_initable_new_async (GXDP_TYPE_OPEN_URI_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.OpenURI", NULL);
4915
0
}
4916
4917
/**
4918
 * gxdp_open_uri_proxy_new_for_bus_finish:
4919
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_proxy_new_for_bus().
4920
 * @error: Return location for error or %NULL
4921
 *
4922
 * Finishes an operation started with gxdp_open_uri_proxy_new_for_bus().
4923
 *
4924
 * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set.
4925
 */
4926
GXdpOpenURI *
4927
gxdp_open_uri_proxy_new_for_bus_finish (
4928
    GAsyncResult        *res,
4929
    GError             **error)
4930
0
{
4931
0
  GObject *ret;
4932
0
  GObject *source_object;
4933
0
  source_object = g_async_result_get_source_object (res);
4934
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
4935
0
  g_object_unref (source_object);
4936
0
  if (ret != NULL)
4937
0
    return GXDP_OPEN_URI (ret);
4938
0
  else
4939
0
    return NULL;
4940
0
}
4941
4942
/**
4943
 * gxdp_open_uri_proxy_new_for_bus_sync:
4944
 * @bus_type: A #GBusType.
4945
 * @flags: Flags from the #GDBusProxyFlags enumeration.
4946
 * @name: A bus name (well-known or unique).
4947
 * @object_path: An object path.
4948
 * @cancellable: (nullable): A #GCancellable or %NULL.
4949
 * @error: Return location for error or %NULL
4950
 *
4951
 * Like gxdp_open_uri_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
4952
 *
4953
 * The calling thread is blocked until a reply is received.
4954
 *
4955
 * See gxdp_open_uri_proxy_new_for_bus() for the asynchronous version of this constructor.
4956
 *
4957
 * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set.
4958
 */
4959
GXdpOpenURI *
4960
gxdp_open_uri_proxy_new_for_bus_sync (
4961
    GBusType             bus_type,
4962
    GDBusProxyFlags      flags,
4963
    const gchar         *name,
4964
    const gchar         *object_path,
4965
    GCancellable        *cancellable,
4966
    GError             **error)
4967
0
{
4968
0
  GInitable *ret;
4969
0
  ret = g_initable_new (GXDP_TYPE_OPEN_URI_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.OpenURI", NULL);
4970
0
  if (ret != NULL)
4971
0
    return GXDP_OPEN_URI (ret);
4972
0
  else
4973
0
    return NULL;
4974
0
}
4975
4976
4977
/* ------------------------------------------------------------------------ */
4978
4979
/**
4980
 * GXdpOpenURISkeleton:
4981
 *
4982
 * The #GXdpOpenURISkeleton structure contains only private data and should only be accessed using the provided API.
4983
 */
4984
4985
/**
4986
 * GXdpOpenURISkeletonClass:
4987
 * @parent_class: The parent class.
4988
 *
4989
 * Class structure for #GXdpOpenURISkeleton.
4990
 */
4991
4992
struct _GXdpOpenURISkeletonPrivate
4993
{
4994
  GValue *properties;
4995
  GList *changed_properties;
4996
  GSource *changed_properties_idle_source;
4997
  GMainContext *context;
4998
  GMutex lock;
4999
};
5000
5001
static void
5002
_gxdp_open_uri_skeleton_handle_method_call (
5003
  GDBusConnection *connection G_GNUC_UNUSED,
5004
  const gchar *sender G_GNUC_UNUSED,
5005
  const gchar *object_path G_GNUC_UNUSED,
5006
  const gchar *interface_name,
5007
  const gchar *method_name,
5008
  GVariant *parameters,
5009
  GDBusMethodInvocation *invocation,
5010
  gpointer user_data)
5011
0
{
5012
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data);
5013
0
  _ExtendedGDBusMethodInfo *info;
5014
0
  GVariantIter iter;
5015
0
  GVariant *child;
5016
0
  GValue *paramv;
5017
0
  gsize num_params;
5018
0
  guint num_extra;
5019
0
  gsize n;
5020
0
  guint signal_id;
5021
0
  GValue return_value = G_VALUE_INIT;
5022
0
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
5023
0
  g_assert (info != NULL);
5024
0
  num_params = g_variant_n_children (parameters);
5025
0
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
5026
0
  n = 0;
5027
0
  g_value_init (&paramv[n], GXDP_TYPE_OPEN_URI);
5028
0
  g_value_set_object (&paramv[n++], skeleton);
5029
0
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
5030
0
  g_value_set_object (&paramv[n++], invocation);
5031
0
  if (info->pass_fdlist)
5032
0
    {
5033
0
#ifdef G_OS_UNIX
5034
0
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
5035
0
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
5036
#else
5037
      g_assert_not_reached ();
5038
#endif
5039
0
    }
5040
0
  g_variant_iter_init (&iter, parameters);
5041
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
5042
0
    {
5043
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
5044
0
      if (arg_info->use_gvariant)
5045
0
        {
5046
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
5047
0
          g_value_set_variant (&paramv[n], child);
5048
0
          n++;
5049
0
        }
5050
0
      else
5051
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
5052
0
      g_variant_unref (child);
5053
0
    }
5054
0
  signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_OPEN_URI);
5055
0
  g_value_init (&return_value, G_TYPE_BOOLEAN);
5056
0
  g_signal_emitv (paramv, signal_id, 0, &return_value);
5057
0
  if (!g_value_get_boolean (&return_value))
5058
0
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
5059
0
  g_value_unset (&return_value);
5060
0
  for (n = 0; n < num_params + num_extra; n++)
5061
0
    g_value_unset (&paramv[n]);
5062
0
  g_free (paramv);
5063
0
}
5064
5065
static GVariant *
5066
_gxdp_open_uri_skeleton_handle_get_property (
5067
  GDBusConnection *connection G_GNUC_UNUSED,
5068
  const gchar *sender G_GNUC_UNUSED,
5069
  const gchar *object_path G_GNUC_UNUSED,
5070
  const gchar *interface_name G_GNUC_UNUSED,
5071
  const gchar *property_name,
5072
  GError **error,
5073
  gpointer user_data)
5074
0
{
5075
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data);
5076
0
  GValue value = G_VALUE_INIT;
5077
0
  GParamSpec *pspec;
5078
0
  _ExtendedGDBusPropertyInfo *info;
5079
0
  GVariant *ret;
5080
0
  ret = NULL;
5081
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, property_name);
5082
0
  g_assert (info != NULL);
5083
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
5084
0
  if (pspec == NULL)
5085
0
    {
5086
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
5087
0
    }
5088
0
  else
5089
0
    {
5090
0
      g_value_init (&value, pspec->value_type);
5091
0
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
5092
0
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
5093
0
      g_value_unset (&value);
5094
0
    }
5095
0
  return ret;
5096
0
}
5097
5098
static gboolean
5099
_gxdp_open_uri_skeleton_handle_set_property (
5100
  GDBusConnection *connection G_GNUC_UNUSED,
5101
  const gchar *sender G_GNUC_UNUSED,
5102
  const gchar *object_path G_GNUC_UNUSED,
5103
  const gchar *interface_name G_GNUC_UNUSED,
5104
  const gchar *property_name,
5105
  GVariant *variant,
5106
  GError **error,
5107
  gpointer user_data)
5108
0
{
5109
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data);
5110
0
  GValue value = G_VALUE_INIT;
5111
0
  GParamSpec *pspec;
5112
0
  _ExtendedGDBusPropertyInfo *info;
5113
0
  gboolean ret;
5114
0
  ret = FALSE;
5115
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, property_name);
5116
0
  g_assert (info != NULL);
5117
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
5118
0
  if (pspec == NULL)
5119
0
    {
5120
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
5121
0
    }
5122
0
  else
5123
0
    {
5124
0
      if (info->use_gvariant)
5125
0
        g_value_set_variant (&value, variant);
5126
0
      else
5127
0
        g_dbus_gvariant_to_gvalue (variant, &value);
5128
0
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
5129
0
      g_value_unset (&value);
5130
0
      ret = TRUE;
5131
0
    }
5132
0
  return ret;
5133
0
}
5134
5135
static const GDBusInterfaceVTable _gxdp_open_uri_skeleton_vtable =
5136
{
5137
  _gxdp_open_uri_skeleton_handle_method_call,
5138
  _gxdp_open_uri_skeleton_handle_get_property,
5139
  _gxdp_open_uri_skeleton_handle_set_property,
5140
  {NULL}
5141
};
5142
5143
static GDBusInterfaceInfo *
5144
gxdp_open_uri_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5145
0
{
5146
0
  return gxdp_open_uri_interface_info ();
5147
0
}
5148
5149
static GDBusInterfaceVTable *
5150
gxdp_open_uri_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5151
0
{
5152
0
  return (GDBusInterfaceVTable *) &_gxdp_open_uri_skeleton_vtable;
5153
0
}
5154
5155
static GVariant *
5156
gxdp_open_uri_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
5157
0
{
5158
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (_skeleton);
5159
5160
0
  GVariantBuilder builder;
5161
0
  guint n;
5162
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
5163
0
  if (_gxdp_open_uri_interface_info.parent_struct.properties == NULL)
5164
0
    goto out;
5165
0
  for (n = 0; _gxdp_open_uri_interface_info.parent_struct.properties[n] != NULL; n++)
5166
0
    {
5167
0
      GDBusPropertyInfo *info = _gxdp_open_uri_interface_info.parent_struct.properties[n];
5168
0
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
5169
0
        {
5170
0
          GVariant *value;
5171
0
          value = _gxdp_open_uri_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.portal.OpenURI", info->name, NULL, skeleton);
5172
0
          if (value != NULL)
5173
0
            {
5174
0
              g_variant_take_ref (value);
5175
0
              g_variant_builder_add (&builder, "{sv}", info->name, value);
5176
0
              g_variant_unref (value);
5177
0
            }
5178
0
        }
5179
0
    }
5180
0
out:
5181
0
  return g_variant_builder_end (&builder);
5182
0
}
5183
5184
static gboolean _gxdp_open_uri_emit_changed (gpointer user_data);
5185
5186
static void
5187
gxdp_open_uri_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
5188
0
{
5189
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (_skeleton);
5190
0
  gboolean emit_changed = FALSE;
5191
5192
0
  g_mutex_lock (&skeleton->priv->lock);
5193
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
5194
0
    {
5195
0
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
5196
0
      skeleton->priv->changed_properties_idle_source = NULL;
5197
0
      emit_changed = TRUE;
5198
0
    }
5199
0
  g_mutex_unlock (&skeleton->priv->lock);
5200
5201
0
  if (emit_changed)
5202
0
    _gxdp_open_uri_emit_changed (skeleton);
5203
0
}
5204
5205
static void gxdp_open_uri_skeleton_iface_init (GXdpOpenURIIface *iface);
5206
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5207
G_DEFINE_TYPE_WITH_CODE (GXdpOpenURISkeleton, gxdp_open_uri_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
5208
                         G_ADD_PRIVATE (GXdpOpenURISkeleton)
5209
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_skeleton_iface_init))
5210
5211
#else
5212
G_DEFINE_TYPE_WITH_CODE (GXdpOpenURISkeleton, gxdp_open_uri_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
5213
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_skeleton_iface_init))
5214
5215
#endif
5216
static void
5217
gxdp_open_uri_skeleton_finalize (GObject *object)
5218
0
{
5219
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object);
5220
0
  guint n;
5221
0
  for (n = 0; n < 1; n++)
5222
0
    g_value_unset (&skeleton->priv->properties[n]);
5223
0
  g_free (skeleton->priv->properties);
5224
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
5225
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
5226
0
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
5227
0
  g_main_context_unref (skeleton->priv->context);
5228
0
  g_mutex_clear (&skeleton->priv->lock);
5229
0
  G_OBJECT_CLASS (gxdp_open_uri_skeleton_parent_class)->finalize (object);
5230
0
}
5231
5232
static void
5233
gxdp_open_uri_skeleton_get_property (GObject      *object,
5234
  guint         prop_id,
5235
  GValue       *value,
5236
  GParamSpec   *pspec G_GNUC_UNUSED)
5237
0
{
5238
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object);
5239
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
5240
0
  g_mutex_lock (&skeleton->priv->lock);
5241
0
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
5242
0
  g_mutex_unlock (&skeleton->priv->lock);
5243
0
}
5244
5245
static gboolean
5246
_gxdp_open_uri_emit_changed (gpointer user_data)
5247
0
{
5248
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data);
5249
0
  GList *l;
5250
0
  GVariantBuilder builder;
5251
0
  GVariantBuilder invalidated_builder;
5252
0
  guint num_changes;
5253
5254
0
  g_mutex_lock (&skeleton->priv->lock);
5255
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
5256
0
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
5257
0
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
5258
0
    {
5259
0
      ChangedProperty *cp = l->data;
5260
0
      GVariant *variant;
5261
0
      const GValue *cur_value;
5262
5263
0
      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
5264
0
      if (!_g_value_equal (cur_value, &cp->orig_value))
5265
0
        {
5266
0
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
5267
0
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
5268
0
          g_variant_unref (variant);
5269
0
          num_changes++;
5270
0
        }
5271
0
    }
5272
0
  if (num_changes > 0)
5273
0
    {
5274
0
      GList *connections, *ll;
5275
0
      GVariant *signal_variant;
5276
0
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.OpenURI",
5277
0
                                           &builder, &invalidated_builder));
5278
0
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
5279
0
      for (ll = connections; ll != NULL; ll = ll->next)
5280
0
        {
5281
0
          GDBusConnection *connection = ll->data;
5282
5283
0
          g_dbus_connection_emit_signal (connection,
5284
0
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
5285
0
                                         "org.freedesktop.DBus.Properties",
5286
0
                                         "PropertiesChanged",
5287
0
                                         signal_variant,
5288
0
                                         NULL);
5289
0
        }
5290
0
      g_variant_unref (signal_variant);
5291
0
      g_list_free_full (connections, g_object_unref);
5292
0
    }
5293
0
  else
5294
0
    {
5295
0
      g_variant_builder_clear (&builder);
5296
0
      g_variant_builder_clear (&invalidated_builder);
5297
0
    }
5298
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
5299
0
  skeleton->priv->changed_properties = NULL;
5300
0
  skeleton->priv->changed_properties_idle_source = NULL;
5301
0
  g_mutex_unlock (&skeleton->priv->lock);
5302
0
  return FALSE;
5303
0
}
5304
5305
static void
5306
_gxdp_open_uri_schedule_emit_changed (GXdpOpenURISkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
5307
0
{
5308
0
  ChangedProperty *cp;
5309
0
  GList *l;
5310
0
  cp = NULL;
5311
0
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
5312
0
    {
5313
0
      ChangedProperty *i_cp = l->data;
5314
0
      if (i_cp->info == info)
5315
0
        {
5316
0
          cp = i_cp;
5317
0
          break;
5318
0
        }
5319
0
    }
5320
0
  if (cp == NULL)
5321
0
    {
5322
0
      cp = g_new0 (ChangedProperty, 1);
5323
0
      cp->prop_id = prop_id;
5324
0
      cp->info = info;
5325
0
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
5326
0
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
5327
0
      g_value_copy (orig_value, &cp->orig_value);
5328
0
    }
5329
0
}
5330
5331
static void
5332
gxdp_open_uri_skeleton_notify (GObject      *object,
5333
  GParamSpec *pspec G_GNUC_UNUSED)
5334
0
{
5335
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object);
5336
0
  g_mutex_lock (&skeleton->priv->lock);
5337
0
  if (skeleton->priv->changed_properties != NULL &&
5338
0
      skeleton->priv->changed_properties_idle_source == NULL)
5339
0
    {
5340
0
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
5341
0
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
5342
0
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_open_uri_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
5343
0
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_open_uri_emit_changed");
5344
0
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
5345
0
      g_source_unref (skeleton->priv->changed_properties_idle_source);
5346
0
    }
5347
0
  g_mutex_unlock (&skeleton->priv->lock);
5348
0
}
5349
5350
static void
5351
gxdp_open_uri_skeleton_set_property (GObject      *object,
5352
  guint         prop_id,
5353
  const GValue *value,
5354
  GParamSpec   *pspec)
5355
0
{
5356
0
  const _ExtendedGDBusPropertyInfo *info;
5357
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object);
5358
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
5359
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1];
5360
0
  g_mutex_lock (&skeleton->priv->lock);
5361
0
  g_object_freeze_notify (object);
5362
0
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
5363
0
    {
5364
0
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
5365
0
          info->emits_changed_signal)
5366
0
        _gxdp_open_uri_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
5367
0
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
5368
0
      g_object_notify_by_pspec (object, pspec);
5369
0
    }
5370
0
  g_mutex_unlock (&skeleton->priv->lock);
5371
0
  g_object_thaw_notify (object);
5372
0
}
5373
5374
static void
5375
gxdp_open_uri_skeleton_init (GXdpOpenURISkeleton *skeleton)
5376
0
{
5377
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5378
0
  skeleton->priv = gxdp_open_uri_skeleton_get_instance_private (skeleton);
5379
#else
5380
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_OPEN_URI_SKELETON, GXdpOpenURISkeletonPrivate);
5381
#endif
5382
5383
0
  g_mutex_init (&skeleton->priv->lock);
5384
0
  skeleton->priv->context = g_main_context_ref_thread_default ();
5385
0
  skeleton->priv->properties = g_new0 (GValue, 1);
5386
0
  g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT);
5387
0
}
5388
5389
static guint 
5390
gxdp_open_uri_skeleton_get_version (GXdpOpenURI *object)
5391
0
{
5392
0
  GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object);
5393
0
  guint value;
5394
0
  g_mutex_lock (&skeleton->priv->lock);
5395
0
  value = g_value_get_uint (&(skeleton->priv->properties[0]));
5396
0
  g_mutex_unlock (&skeleton->priv->lock);
5397
0
  return value;
5398
0
}
5399
5400
static void
5401
gxdp_open_uri_skeleton_class_init (GXdpOpenURISkeletonClass *klass)
5402
0
{
5403
0
  GObjectClass *gobject_class;
5404
0
  GDBusInterfaceSkeletonClass *skeleton_class;
5405
5406
0
  gobject_class = G_OBJECT_CLASS (klass);
5407
0
  gobject_class->finalize = gxdp_open_uri_skeleton_finalize;
5408
0
  gobject_class->get_property = gxdp_open_uri_skeleton_get_property;
5409
0
  gobject_class->set_property = gxdp_open_uri_skeleton_set_property;
5410
0
  gobject_class->notify       = gxdp_open_uri_skeleton_notify;
5411
5412
5413
0
  gxdp_open_uri_override_properties (gobject_class, 1);
5414
5415
0
  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
5416
0
  skeleton_class->get_info = gxdp_open_uri_skeleton_dbus_interface_get_info;
5417
0
  skeleton_class->get_properties = gxdp_open_uri_skeleton_dbus_interface_get_properties;
5418
0
  skeleton_class->flush = gxdp_open_uri_skeleton_dbus_interface_flush;
5419
0
  skeleton_class->get_vtable = gxdp_open_uri_skeleton_dbus_interface_get_vtable;
5420
5421
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5422
  g_type_class_add_private (klass, sizeof (GXdpOpenURISkeletonPrivate));
5423
#endif
5424
0
}
5425
5426
static void
5427
gxdp_open_uri_skeleton_iface_init (GXdpOpenURIIface *iface)
5428
0
{
5429
0
  iface->get_version = gxdp_open_uri_skeleton_get_version;
5430
0
}
5431
5432
/**
5433
 * gxdp_open_uri_skeleton_new:
5434
 *
5435
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>.
5436
 *
5437
 * Returns: (transfer full) (type GXdpOpenURISkeleton): The skeleton object.
5438
 */
5439
GXdpOpenURI *
5440
gxdp_open_uri_skeleton_new (void)
5441
0
{
5442
0
  return GXDP_OPEN_URI (g_object_new (GXDP_TYPE_OPEN_URI_SKELETON, NULL));
5443
0
}
5444
5445
/* ------------------------------------------------------------------------
5446
 * Code for interface org.freedesktop.portal.ProxyResolver
5447
 * ------------------------------------------------------------------------
5448
 */
5449
5450
/**
5451
 * SECTION:GXdpProxyResolver
5452
 * @title: GXdpProxyResolver
5453
 * @short_description: Generated C code for the org.freedesktop.portal.ProxyResolver D-Bus interface
5454
 *
5455
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link> D-Bus interface in C.
5456
 */
5457
5458
/* ---- Introspection data for org.freedesktop.portal.ProxyResolver ---- */
5459
5460
static const _ExtendedGDBusArgInfo _gxdp_proxy_resolver_method_info_lookup_IN_ARG_uri =
5461
{
5462
  {
5463
    -1,
5464
    (gchar *) "uri",
5465
    (gchar *) "s",
5466
    NULL
5467
  },
5468
  FALSE
5469
};
5470
5471
static const GDBusArgInfo * const _gxdp_proxy_resolver_method_info_lookup_IN_ARG_pointers[] =
5472
{
5473
  &_gxdp_proxy_resolver_method_info_lookup_IN_ARG_uri.parent_struct,
5474
  NULL
5475
};
5476
5477
static const _ExtendedGDBusArgInfo _gxdp_proxy_resolver_method_info_lookup_OUT_ARG_proxies =
5478
{
5479
  {
5480
    -1,
5481
    (gchar *) "proxies",
5482
    (gchar *) "as",
5483
    NULL
5484
  },
5485
  FALSE
5486
};
5487
5488
static const GDBusArgInfo * const _gxdp_proxy_resolver_method_info_lookup_OUT_ARG_pointers[] =
5489
{
5490
  &_gxdp_proxy_resolver_method_info_lookup_OUT_ARG_proxies.parent_struct,
5491
  NULL
5492
};
5493
5494
static const _ExtendedGDBusMethodInfo _gxdp_proxy_resolver_method_info_lookup =
5495
{
5496
  {
5497
    -1,
5498
    (gchar *) "Lookup",
5499
    (GDBusArgInfo **) &_gxdp_proxy_resolver_method_info_lookup_IN_ARG_pointers,
5500
    (GDBusArgInfo **) &_gxdp_proxy_resolver_method_info_lookup_OUT_ARG_pointers,
5501
    NULL
5502
  },
5503
  "handle-lookup",
5504
  FALSE
5505
};
5506
5507
static const GDBusMethodInfo * const _gxdp_proxy_resolver_method_info_pointers[] =
5508
{
5509
  &_gxdp_proxy_resolver_method_info_lookup.parent_struct,
5510
  NULL
5511
};
5512
5513
static const _ExtendedGDBusPropertyInfo _gxdp_proxy_resolver_property_info_version =
5514
{
5515
  {
5516
    -1,
5517
    (gchar *) "version",
5518
    (gchar *) "u",
5519
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
5520
    NULL
5521
  },
5522
  "version",
5523
  FALSE,
5524
  TRUE
5525
};
5526
5527
static const GDBusPropertyInfo * const _gxdp_proxy_resolver_property_info_pointers[] =
5528
{
5529
  &_gxdp_proxy_resolver_property_info_version.parent_struct,
5530
  NULL
5531
};
5532
5533
static const _ExtendedGDBusInterfaceInfo _gxdp_proxy_resolver_interface_info =
5534
{
5535
  {
5536
    -1,
5537
    (gchar *) "org.freedesktop.portal.ProxyResolver",
5538
    (GDBusMethodInfo **) &_gxdp_proxy_resolver_method_info_pointers,
5539
    NULL,
5540
    (GDBusPropertyInfo **) &_gxdp_proxy_resolver_property_info_pointers,
5541
    NULL
5542
  },
5543
  "proxy-resolver",
5544
};
5545
5546
5547
/**
5548
 * gxdp_proxy_resolver_interface_info:
5549
 *
5550
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link> D-Bus interface.
5551
 *
5552
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
5553
 */
5554
GDBusInterfaceInfo *
5555
gxdp_proxy_resolver_interface_info (void)
5556
0
{
5557
0
  return (GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct;
5558
0
}
5559
5560
/**
5561
 * gxdp_proxy_resolver_override_properties:
5562
 * @klass: The class structure for a #GObject derived class.
5563
 * @property_id_begin: The property id to assign to the first overridden property.
5564
 *
5565
 * Overrides all #GObject properties in the #GXdpProxyResolver interface for a concrete class.
5566
 * The properties are overridden in the order they are defined.
5567
 *
5568
 * Returns: The last property id.
5569
 */
5570
guint
5571
gxdp_proxy_resolver_override_properties (GObjectClass *klass, guint property_id_begin)
5572
0
{
5573
0
  g_object_class_override_property (klass, property_id_begin++, "version");
5574
0
  return property_id_begin - 1;
5575
0
}
5576
5577
5578
5579
/**
5580
 * GXdpProxyResolver:
5581
 *
5582
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>.
5583
 */
5584
5585
/**
5586
 * GXdpProxyResolverIface:
5587
 * @parent_iface: The parent interface.
5588
 * @handle_lookup: Handler for the #GXdpProxyResolver::handle-lookup signal.
5589
 * @get_version: Getter for the #GXdpProxyResolver:version property.
5590
 *
5591
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>.
5592
 */
5593
5594
typedef GXdpProxyResolverIface GXdpProxyResolverInterface;
5595
G_DEFINE_INTERFACE (GXdpProxyResolver, gxdp_proxy_resolver, G_TYPE_OBJECT)
5596
5597
static void
5598
gxdp_proxy_resolver_default_init (GXdpProxyResolverIface *iface)
5599
0
{
5600
  /* GObject signals for incoming D-Bus method calls: */
5601
  /**
5602
   * GXdpProxyResolver::handle-lookup:
5603
   * @object: A #GXdpProxyResolver.
5604
   * @invocation: A #GDBusMethodInvocation.
5605
   * @arg_uri: Argument passed by remote caller.
5606
   *
5607
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</link> D-Bus method.
5608
   *
5609
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_proxy_resolver_complete_lookup() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
5610
   *
5611
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
5612
   */
5613
0
  g_signal_new ("handle-lookup",
5614
0
    G_TYPE_FROM_INTERFACE (iface),
5615
0
    G_SIGNAL_RUN_LAST,
5616
0
    G_STRUCT_OFFSET (GXdpProxyResolverIface, handle_lookup),
5617
0
    g_signal_accumulator_true_handled,
5618
0
    NULL,
5619
0
    g_cclosure_marshal_generic,
5620
0
    G_TYPE_BOOLEAN,
5621
0
    2,
5622
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
5623
5624
  /* GObject properties for D-Bus properties: */
5625
  /**
5626
   * GXdpProxyResolver:version:
5627
   *
5628
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-ProxyResolver.version">"version"</link>.
5629
   *
5630
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
5631
   */
5632
0
  g_object_interface_install_property (iface,
5633
0
    g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
5634
0
}
5635
5636
/**
5637
 * gxdp_proxy_resolver_get_version: (skip)
5638
 * @object: A #GXdpProxyResolver.
5639
 *
5640
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-ProxyResolver.version">"version"</link> D-Bus property.
5641
 *
5642
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
5643
 *
5644
 * Returns: The property value.
5645
 */
5646
guint 
5647
gxdp_proxy_resolver_get_version (GXdpProxyResolver *object)
5648
0
{
5649
0
  g_return_val_if_fail (GXDP_IS_PROXY_RESOLVER (object), 0);
5650
5651
0
  return GXDP_PROXY_RESOLVER_GET_IFACE (object)->get_version (object);
5652
0
}
5653
5654
/**
5655
 * gxdp_proxy_resolver_set_version: (skip)
5656
 * @object: A #GXdpProxyResolver.
5657
 * @value: The value to set.
5658
 *
5659
 * Sets the <link linkend="gdbus-property-org-freedesktop-portal-ProxyResolver.version">"version"</link> D-Bus property to @value.
5660
 *
5661
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
5662
 */
5663
void
5664
gxdp_proxy_resolver_set_version (GXdpProxyResolver *object, guint value)
5665
0
{
5666
0
  g_object_set (G_OBJECT (object), "version", value, NULL);
5667
0
}
5668
5669
/**
5670
 * gxdp_proxy_resolver_call_lookup:
5671
 * @proxy: A #GXdpProxyResolverProxy.
5672
 * @arg_uri: Argument to pass with the method invocation.
5673
 * @cancellable: (nullable): A #GCancellable or %NULL.
5674
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
5675
 * @user_data: User data to pass to @callback.
5676
 *
5677
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</link> D-Bus method on @proxy.
5678
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
5679
 * You can then call gxdp_proxy_resolver_call_lookup_finish() to get the result of the operation.
5680
 *
5681
 * See gxdp_proxy_resolver_call_lookup_sync() for the synchronous, blocking version of this method.
5682
 */
5683
void
5684
gxdp_proxy_resolver_call_lookup (
5685
    GXdpProxyResolver *proxy,
5686
    const gchar *arg_uri,
5687
    GCancellable *cancellable,
5688
    GAsyncReadyCallback callback,
5689
    gpointer user_data)
5690
0
{
5691
0
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
5692
0
    "Lookup",
5693
0
    g_variant_new ("(s)",
5694
0
                   arg_uri),
5695
0
    G_DBUS_CALL_FLAGS_NONE,
5696
0
    -1,
5697
0
    cancellable,
5698
0
    callback,
5699
0
    user_data);
5700
0
}
5701
5702
/**
5703
 * gxdp_proxy_resolver_call_lookup_finish:
5704
 * @proxy: A #GXdpProxyResolverProxy.
5705
 * @out_proxies: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
5706
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_call_lookup().
5707
 * @error: Return location for error or %NULL.
5708
 *
5709
 * Finishes an operation started with gxdp_proxy_resolver_call_lookup().
5710
 *
5711
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
5712
 */
5713
gboolean
5714
gxdp_proxy_resolver_call_lookup_finish (
5715
    GXdpProxyResolver *proxy,
5716
    gchar ***out_proxies,
5717
    GAsyncResult *res,
5718
    GError **error)
5719
0
{
5720
0
  GVariant *_ret;
5721
0
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
5722
0
  if (_ret == NULL)
5723
0
    goto _out;
5724
0
  g_variant_get (_ret,
5725
0
                 "(^as)",
5726
0
                 out_proxies);
5727
0
  g_variant_unref (_ret);
5728
0
_out:
5729
0
  return _ret != NULL;
5730
0
}
5731
5732
/**
5733
 * gxdp_proxy_resolver_call_lookup_sync:
5734
 * @proxy: A #GXdpProxyResolverProxy.
5735
 * @arg_uri: Argument to pass with the method invocation.
5736
 * @out_proxies: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
5737
 * @cancellable: (nullable): A #GCancellable or %NULL.
5738
 * @error: Return location for error or %NULL.
5739
 *
5740
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
5741
 *
5742
 * See gxdp_proxy_resolver_call_lookup() for the asynchronous version of this method.
5743
 *
5744
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
5745
 */
5746
gboolean
5747
gxdp_proxy_resolver_call_lookup_sync (
5748
    GXdpProxyResolver *proxy,
5749
    const gchar *arg_uri,
5750
    gchar ***out_proxies,
5751
    GCancellable *cancellable,
5752
    GError **error)
5753
0
{
5754
0
  GVariant *_ret;
5755
0
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
5756
0
    "Lookup",
5757
0
    g_variant_new ("(s)",
5758
0
                   arg_uri),
5759
0
    G_DBUS_CALL_FLAGS_NONE,
5760
0
    -1,
5761
0
    cancellable,
5762
0
    error);
5763
0
  if (_ret == NULL)
5764
0
    goto _out;
5765
0
  g_variant_get (_ret,
5766
0
                 "(^as)",
5767
0
                 out_proxies);
5768
0
  g_variant_unref (_ret);
5769
0
_out:
5770
0
  return _ret != NULL;
5771
0
}
5772
5773
/**
5774
 * gxdp_proxy_resolver_complete_lookup:
5775
 * @object: A #GXdpProxyResolver.
5776
 * @invocation: (transfer full): A #GDBusMethodInvocation.
5777
 * @proxies: Parameter to return.
5778
 *
5779
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
5780
 *
5781
 * This method will free @invocation, you cannot use it afterwards.
5782
 */
5783
void
5784
gxdp_proxy_resolver_complete_lookup (
5785
    GXdpProxyResolver *object G_GNUC_UNUSED,
5786
    GDBusMethodInvocation *invocation,
5787
    const gchar *const *proxies)
5788
0
{
5789
0
  g_dbus_method_invocation_return_value (invocation,
5790
0
    g_variant_new ("(^as)",
5791
0
                   proxies));
5792
0
}
5793
5794
/* ------------------------------------------------------------------------ */
5795
5796
/**
5797
 * GXdpProxyResolverProxy:
5798
 *
5799
 * The #GXdpProxyResolverProxy structure contains only private data and should only be accessed using the provided API.
5800
 */
5801
5802
/**
5803
 * GXdpProxyResolverProxyClass:
5804
 * @parent_class: The parent class.
5805
 *
5806
 * Class structure for #GXdpProxyResolverProxy.
5807
 */
5808
5809
struct _GXdpProxyResolverProxyPrivate
5810
{
5811
  GData *qdata;
5812
};
5813
5814
static void gxdp_proxy_resolver_proxy_iface_init (GXdpProxyResolverIface *iface);
5815
5816
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5817
G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverProxy, gxdp_proxy_resolver_proxy, G_TYPE_DBUS_PROXY,
5818
                         G_ADD_PRIVATE (GXdpProxyResolverProxy)
5819
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_proxy_iface_init))
5820
5821
#else
5822
G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverProxy, gxdp_proxy_resolver_proxy, G_TYPE_DBUS_PROXY,
5823
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_proxy_iface_init))
5824
5825
#endif
5826
static void
5827
gxdp_proxy_resolver_proxy_finalize (GObject *object)
5828
0
{
5829
0
  GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (object);
5830
0
  g_datalist_clear (&proxy->priv->qdata);
5831
0
  G_OBJECT_CLASS (gxdp_proxy_resolver_proxy_parent_class)->finalize (object);
5832
0
}
5833
5834
static void
5835
gxdp_proxy_resolver_proxy_get_property (GObject      *object,
5836
  guint         prop_id,
5837
  GValue       *value,
5838
  GParamSpec   *pspec G_GNUC_UNUSED)
5839
0
{
5840
0
  const _ExtendedGDBusPropertyInfo *info;
5841
0
  GVariant *variant;
5842
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
5843
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1];
5844
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
5845
0
  if (info->use_gvariant)
5846
0
    {
5847
0
      g_value_set_variant (value, variant);
5848
0
    }
5849
0
  else
5850
0
    {
5851
0
      if (variant != NULL)
5852
0
        g_dbus_gvariant_to_gvalue (variant, value);
5853
0
    }
5854
0
  if (variant != NULL)
5855
0
    g_variant_unref (variant);
5856
0
}
5857
5858
static void
5859
gxdp_proxy_resolver_proxy_set_property_cb (GDBusProxy *proxy,
5860
  GAsyncResult *res,
5861
  gpointer      user_data)
5862
0
{
5863
0
  const _ExtendedGDBusPropertyInfo *info = user_data;
5864
0
  GError *error;
5865
0
  GVariant *_ret;
5866
0
  error = NULL;
5867
0
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
5868
0
  if (!_ret)
5869
0
    {
5870
0
      g_warning ("Error setting property '%s' on interface org.freedesktop.portal.ProxyResolver: %s (%s, %d)",
5871
0
                 info->parent_struct.name, 
5872
0
                 error->message, g_quark_to_string (error->domain), error->code);
5873
0
      g_error_free (error);
5874
0
    }
5875
0
  else
5876
0
    {
5877
0
      g_variant_unref (_ret);
5878
0
    }
5879
0
}
5880
5881
static void
5882
gxdp_proxy_resolver_proxy_set_property (GObject      *object,
5883
  guint         prop_id,
5884
  const GValue *value,
5885
  GParamSpec   *pspec G_GNUC_UNUSED)
5886
0
{
5887
0
  const _ExtendedGDBusPropertyInfo *info;
5888
0
  GVariant *variant;
5889
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
5890
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1];
5891
0
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
5892
0
  g_dbus_proxy_call (G_DBUS_PROXY (object),
5893
0
    "org.freedesktop.DBus.Properties.Set",
5894
0
    g_variant_new ("(ssv)", "org.freedesktop.portal.ProxyResolver", info->parent_struct.name, variant),
5895
0
    G_DBUS_CALL_FLAGS_NONE,
5896
0
    -1,
5897
0
    NULL, (GAsyncReadyCallback) gxdp_proxy_resolver_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
5898
0
  g_variant_unref (variant);
5899
0
}
5900
5901
static void
5902
gxdp_proxy_resolver_proxy_g_signal (GDBusProxy *proxy,
5903
  const gchar *sender_name G_GNUC_UNUSED,
5904
  const gchar *signal_name,
5905
  GVariant *parameters)
5906
0
{
5907
0
  _ExtendedGDBusSignalInfo *info;
5908
0
  GVariantIter iter;
5909
0
  GVariant *child;
5910
0
  GValue *paramv;
5911
0
  gsize num_params;
5912
0
  gsize n;
5913
0
  guint signal_id;
5914
0
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, signal_name);
5915
0
  if (info == NULL)
5916
0
    return;
5917
0
  num_params = g_variant_n_children (parameters);
5918
0
  paramv = g_new0 (GValue, num_params + 1);
5919
0
  g_value_init (&paramv[0], GXDP_TYPE_PROXY_RESOLVER);
5920
0
  g_value_set_object (&paramv[0], proxy);
5921
0
  g_variant_iter_init (&iter, parameters);
5922
0
  n = 1;
5923
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
5924
0
    {
5925
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
5926
0
      if (arg_info->use_gvariant)
5927
0
        {
5928
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
5929
0
          g_value_set_variant (&paramv[n], child);
5930
0
          n++;
5931
0
        }
5932
0
      else
5933
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
5934
0
      g_variant_unref (child);
5935
0
    }
5936
0
  signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_PROXY_RESOLVER);
5937
0
  g_signal_emitv (paramv, signal_id, 0, NULL);
5938
0
  for (n = 0; n < num_params + 1; n++)
5939
0
    g_value_unset (&paramv[n]);
5940
0
  g_free (paramv);
5941
0
}
5942
5943
static void
5944
gxdp_proxy_resolver_proxy_g_properties_changed (GDBusProxy *_proxy,
5945
  GVariant *changed_properties,
5946
  const gchar *const *invalidated_properties)
5947
0
{
5948
0
  GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (_proxy);
5949
0
  guint n;
5950
0
  const gchar *key;
5951
0
  GVariantIter *iter;
5952
0
  _ExtendedGDBusPropertyInfo *info;
5953
0
  g_variant_get (changed_properties, "a{sv}", &iter);
5954
0
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
5955
0
    {
5956
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, key);
5957
0
      g_datalist_remove_data (&proxy->priv->qdata, key);
5958
0
      if (info != NULL)
5959
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
5960
0
    }
5961
0
  g_variant_iter_free (iter);
5962
0
  for (n = 0; invalidated_properties[n] != NULL; n++)
5963
0
    {
5964
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, invalidated_properties[n]);
5965
0
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
5966
0
      if (info != NULL)
5967
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
5968
0
    }
5969
0
}
5970
5971
static guint 
5972
gxdp_proxy_resolver_proxy_get_version (GXdpProxyResolver *object)
5973
0
{
5974
0
  GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (object);
5975
0
  GVariant *variant;
5976
0
  guint value = 0;
5977
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version");
5978
0
  if (variant != NULL)
5979
0
    {
5980
0
      value = g_variant_get_uint32 (variant);
5981
0
      g_variant_unref (variant);
5982
0
    }
5983
0
  return value;
5984
0
}
5985
5986
static void
5987
gxdp_proxy_resolver_proxy_init (GXdpProxyResolverProxy *proxy)
5988
0
{
5989
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5990
0
  proxy->priv = gxdp_proxy_resolver_proxy_get_instance_private (proxy);
5991
#else
5992
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_PROXY_RESOLVER_PROXY, GXdpProxyResolverProxyPrivate);
5993
#endif
5994
5995
0
  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_proxy_resolver_interface_info ());
5996
0
}
5997
5998
static void
5999
gxdp_proxy_resolver_proxy_class_init (GXdpProxyResolverProxyClass *klass)
6000
0
{
6001
0
  GObjectClass *gobject_class;
6002
0
  GDBusProxyClass *proxy_class;
6003
6004
0
  gobject_class = G_OBJECT_CLASS (klass);
6005
0
  gobject_class->finalize     = gxdp_proxy_resolver_proxy_finalize;
6006
0
  gobject_class->get_property = gxdp_proxy_resolver_proxy_get_property;
6007
0
  gobject_class->set_property = gxdp_proxy_resolver_proxy_set_property;
6008
6009
0
  proxy_class = G_DBUS_PROXY_CLASS (klass);
6010
0
  proxy_class->g_signal = gxdp_proxy_resolver_proxy_g_signal;
6011
0
  proxy_class->g_properties_changed = gxdp_proxy_resolver_proxy_g_properties_changed;
6012
6013
0
  gxdp_proxy_resolver_override_properties (gobject_class, 1);
6014
6015
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
6016
  g_type_class_add_private (klass, sizeof (GXdpProxyResolverProxyPrivate));
6017
#endif
6018
0
}
6019
6020
static void
6021
gxdp_proxy_resolver_proxy_iface_init (GXdpProxyResolverIface *iface)
6022
0
{
6023
0
  iface->get_version = gxdp_proxy_resolver_proxy_get_version;
6024
0
}
6025
6026
/**
6027
 * gxdp_proxy_resolver_proxy_new:
6028
 * @connection: A #GDBusConnection.
6029
 * @flags: Flags from the #GDBusProxyFlags enumeration.
6030
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6031
 * @object_path: An object path.
6032
 * @cancellable: (nullable): A #GCancellable or %NULL.
6033
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
6034
 * @user_data: User data to pass to @callback.
6035
 *
6036
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>. See g_dbus_proxy_new() for more details.
6037
 *
6038
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
6039
 * You can then call gxdp_proxy_resolver_proxy_new_finish() to get the result of the operation.
6040
 *
6041
 * See gxdp_proxy_resolver_proxy_new_sync() for the synchronous, blocking version of this constructor.
6042
 */
6043
void
6044
gxdp_proxy_resolver_proxy_new (
6045
    GDBusConnection     *connection,
6046
    GDBusProxyFlags      flags,
6047
    const gchar         *name,
6048
    const gchar         *object_path,
6049
    GCancellable        *cancellable,
6050
    GAsyncReadyCallback  callback,
6051
    gpointer             user_data)
6052
0
{
6053
0
  g_async_initable_new_async (GXDP_TYPE_PROXY_RESOLVER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.ProxyResolver", NULL);
6054
0
}
6055
6056
/**
6057
 * gxdp_proxy_resolver_proxy_new_finish:
6058
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_proxy_new().
6059
 * @error: Return location for error or %NULL
6060
 *
6061
 * Finishes an operation started with gxdp_proxy_resolver_proxy_new().
6062
 *
6063
 * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set.
6064
 */
6065
GXdpProxyResolver *
6066
gxdp_proxy_resolver_proxy_new_finish (
6067
    GAsyncResult        *res,
6068
    GError             **error)
6069
0
{
6070
0
  GObject *ret;
6071
0
  GObject *source_object;
6072
0
  source_object = g_async_result_get_source_object (res);
6073
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
6074
0
  g_object_unref (source_object);
6075
0
  if (ret != NULL)
6076
0
    return GXDP_PROXY_RESOLVER (ret);
6077
0
  else
6078
0
    return NULL;
6079
0
}
6080
6081
/**
6082
 * gxdp_proxy_resolver_proxy_new_sync:
6083
 * @connection: A #GDBusConnection.
6084
 * @flags: Flags from the #GDBusProxyFlags enumeration.
6085
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6086
 * @object_path: An object path.
6087
 * @cancellable: (nullable): A #GCancellable or %NULL.
6088
 * @error: Return location for error or %NULL
6089
 *
6090
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>. See g_dbus_proxy_new_sync() for more details.
6091
 *
6092
 * The calling thread is blocked until a reply is received.
6093
 *
6094
 * See gxdp_proxy_resolver_proxy_new() for the asynchronous version of this constructor.
6095
 *
6096
 * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set.
6097
 */
6098
GXdpProxyResolver *
6099
gxdp_proxy_resolver_proxy_new_sync (
6100
    GDBusConnection     *connection,
6101
    GDBusProxyFlags      flags,
6102
    const gchar         *name,
6103
    const gchar         *object_path,
6104
    GCancellable        *cancellable,
6105
    GError             **error)
6106
0
{
6107
0
  GInitable *ret;
6108
0
  ret = g_initable_new (GXDP_TYPE_PROXY_RESOLVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.ProxyResolver", NULL);
6109
0
  if (ret != NULL)
6110
0
    return GXDP_PROXY_RESOLVER (ret);
6111
0
  else
6112
0
    return NULL;
6113
0
}
6114
6115
6116
/**
6117
 * gxdp_proxy_resolver_proxy_new_for_bus:
6118
 * @bus_type: A #GBusType.
6119
 * @flags: Flags from the #GDBusProxyFlags enumeration.
6120
 * @name: A bus name (well-known or unique).
6121
 * @object_path: An object path.
6122
 * @cancellable: (nullable): A #GCancellable or %NULL.
6123
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
6124
 * @user_data: User data to pass to @callback.
6125
 *
6126
 * Like gxdp_proxy_resolver_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
6127
 *
6128
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
6129
 * You can then call gxdp_proxy_resolver_proxy_new_for_bus_finish() to get the result of the operation.
6130
 *
6131
 * See gxdp_proxy_resolver_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
6132
 */
6133
void
6134
gxdp_proxy_resolver_proxy_new_for_bus (
6135
    GBusType             bus_type,
6136
    GDBusProxyFlags      flags,
6137
    const gchar         *name,
6138
    const gchar         *object_path,
6139
    GCancellable        *cancellable,
6140
    GAsyncReadyCallback  callback,
6141
    gpointer             user_data)
6142
0
{
6143
0
  g_async_initable_new_async (GXDP_TYPE_PROXY_RESOLVER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.ProxyResolver", NULL);
6144
0
}
6145
6146
/**
6147
 * gxdp_proxy_resolver_proxy_new_for_bus_finish:
6148
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_proxy_new_for_bus().
6149
 * @error: Return location for error or %NULL
6150
 *
6151
 * Finishes an operation started with gxdp_proxy_resolver_proxy_new_for_bus().
6152
 *
6153
 * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set.
6154
 */
6155
GXdpProxyResolver *
6156
gxdp_proxy_resolver_proxy_new_for_bus_finish (
6157
    GAsyncResult        *res,
6158
    GError             **error)
6159
0
{
6160
0
  GObject *ret;
6161
0
  GObject *source_object;
6162
0
  source_object = g_async_result_get_source_object (res);
6163
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
6164
0
  g_object_unref (source_object);
6165
0
  if (ret != NULL)
6166
0
    return GXDP_PROXY_RESOLVER (ret);
6167
0
  else
6168
0
    return NULL;
6169
0
}
6170
6171
/**
6172
 * gxdp_proxy_resolver_proxy_new_for_bus_sync:
6173
 * @bus_type: A #GBusType.
6174
 * @flags: Flags from the #GDBusProxyFlags enumeration.
6175
 * @name: A bus name (well-known or unique).
6176
 * @object_path: An object path.
6177
 * @cancellable: (nullable): A #GCancellable or %NULL.
6178
 * @error: Return location for error or %NULL
6179
 *
6180
 * Like gxdp_proxy_resolver_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
6181
 *
6182
 * The calling thread is blocked until a reply is received.
6183
 *
6184
 * See gxdp_proxy_resolver_proxy_new_for_bus() for the asynchronous version of this constructor.
6185
 *
6186
 * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set.
6187
 */
6188
GXdpProxyResolver *
6189
gxdp_proxy_resolver_proxy_new_for_bus_sync (
6190
    GBusType             bus_type,
6191
    GDBusProxyFlags      flags,
6192
    const gchar         *name,
6193
    const gchar         *object_path,
6194
    GCancellable        *cancellable,
6195
    GError             **error)
6196
0
{
6197
0
  GInitable *ret;
6198
0
  ret = g_initable_new (GXDP_TYPE_PROXY_RESOLVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.ProxyResolver", NULL);
6199
0
  if (ret != NULL)
6200
0
    return GXDP_PROXY_RESOLVER (ret);
6201
0
  else
6202
0
    return NULL;
6203
0
}
6204
6205
6206
/* ------------------------------------------------------------------------ */
6207
6208
/**
6209
 * GXdpProxyResolverSkeleton:
6210
 *
6211
 * The #GXdpProxyResolverSkeleton structure contains only private data and should only be accessed using the provided API.
6212
 */
6213
6214
/**
6215
 * GXdpProxyResolverSkeletonClass:
6216
 * @parent_class: The parent class.
6217
 *
6218
 * Class structure for #GXdpProxyResolverSkeleton.
6219
 */
6220
6221
struct _GXdpProxyResolverSkeletonPrivate
6222
{
6223
  GValue *properties;
6224
  GList *changed_properties;
6225
  GSource *changed_properties_idle_source;
6226
  GMainContext *context;
6227
  GMutex lock;
6228
};
6229
6230
static void
6231
_gxdp_proxy_resolver_skeleton_handle_method_call (
6232
  GDBusConnection *connection G_GNUC_UNUSED,
6233
  const gchar *sender G_GNUC_UNUSED,
6234
  const gchar *object_path G_GNUC_UNUSED,
6235
  const gchar *interface_name,
6236
  const gchar *method_name,
6237
  GVariant *parameters,
6238
  GDBusMethodInvocation *invocation,
6239
  gpointer user_data)
6240
0
{
6241
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data);
6242
0
  _ExtendedGDBusMethodInfo *info;
6243
0
  GVariantIter iter;
6244
0
  GVariant *child;
6245
0
  GValue *paramv;
6246
0
  gsize num_params;
6247
0
  guint num_extra;
6248
0
  gsize n;
6249
0
  guint signal_id;
6250
0
  GValue return_value = G_VALUE_INIT;
6251
0
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
6252
0
  g_assert (info != NULL);
6253
0
  num_params = g_variant_n_children (parameters);
6254
0
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
6255
0
  n = 0;
6256
0
  g_value_init (&paramv[n], GXDP_TYPE_PROXY_RESOLVER);
6257
0
  g_value_set_object (&paramv[n++], skeleton);
6258
0
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
6259
0
  g_value_set_object (&paramv[n++], invocation);
6260
0
  if (info->pass_fdlist)
6261
0
    {
6262
0
#ifdef G_OS_UNIX
6263
0
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
6264
0
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
6265
#else
6266
      g_assert_not_reached ();
6267
#endif
6268
0
    }
6269
0
  g_variant_iter_init (&iter, parameters);
6270
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
6271
0
    {
6272
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
6273
0
      if (arg_info->use_gvariant)
6274
0
        {
6275
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
6276
0
          g_value_set_variant (&paramv[n], child);
6277
0
          n++;
6278
0
        }
6279
0
      else
6280
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
6281
0
      g_variant_unref (child);
6282
0
    }
6283
0
  signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_PROXY_RESOLVER);
6284
0
  g_value_init (&return_value, G_TYPE_BOOLEAN);
6285
0
  g_signal_emitv (paramv, signal_id, 0, &return_value);
6286
0
  if (!g_value_get_boolean (&return_value))
6287
0
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
6288
0
  g_value_unset (&return_value);
6289
0
  for (n = 0; n < num_params + num_extra; n++)
6290
0
    g_value_unset (&paramv[n]);
6291
0
  g_free (paramv);
6292
0
}
6293
6294
static GVariant *
6295
_gxdp_proxy_resolver_skeleton_handle_get_property (
6296
  GDBusConnection *connection G_GNUC_UNUSED,
6297
  const gchar *sender G_GNUC_UNUSED,
6298
  const gchar *object_path G_GNUC_UNUSED,
6299
  const gchar *interface_name G_GNUC_UNUSED,
6300
  const gchar *property_name,
6301
  GError **error,
6302
  gpointer user_data)
6303
0
{
6304
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data);
6305
0
  GValue value = G_VALUE_INIT;
6306
0
  GParamSpec *pspec;
6307
0
  _ExtendedGDBusPropertyInfo *info;
6308
0
  GVariant *ret;
6309
0
  ret = NULL;
6310
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, property_name);
6311
0
  g_assert (info != NULL);
6312
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
6313
0
  if (pspec == NULL)
6314
0
    {
6315
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
6316
0
    }
6317
0
  else
6318
0
    {
6319
0
      g_value_init (&value, pspec->value_type);
6320
0
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
6321
0
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
6322
0
      g_value_unset (&value);
6323
0
    }
6324
0
  return ret;
6325
0
}
6326
6327
static gboolean
6328
_gxdp_proxy_resolver_skeleton_handle_set_property (
6329
  GDBusConnection *connection G_GNUC_UNUSED,
6330
  const gchar *sender G_GNUC_UNUSED,
6331
  const gchar *object_path G_GNUC_UNUSED,
6332
  const gchar *interface_name G_GNUC_UNUSED,
6333
  const gchar *property_name,
6334
  GVariant *variant,
6335
  GError **error,
6336
  gpointer user_data)
6337
0
{
6338
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data);
6339
0
  GValue value = G_VALUE_INIT;
6340
0
  GParamSpec *pspec;
6341
0
  _ExtendedGDBusPropertyInfo *info;
6342
0
  gboolean ret;
6343
0
  ret = FALSE;
6344
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, property_name);
6345
0
  g_assert (info != NULL);
6346
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
6347
0
  if (pspec == NULL)
6348
0
    {
6349
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
6350
0
    }
6351
0
  else
6352
0
    {
6353
0
      if (info->use_gvariant)
6354
0
        g_value_set_variant (&value, variant);
6355
0
      else
6356
0
        g_dbus_gvariant_to_gvalue (variant, &value);
6357
0
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
6358
0
      g_value_unset (&value);
6359
0
      ret = TRUE;
6360
0
    }
6361
0
  return ret;
6362
0
}
6363
6364
static const GDBusInterfaceVTable _gxdp_proxy_resolver_skeleton_vtable =
6365
{
6366
  _gxdp_proxy_resolver_skeleton_handle_method_call,
6367
  _gxdp_proxy_resolver_skeleton_handle_get_property,
6368
  _gxdp_proxy_resolver_skeleton_handle_set_property,
6369
  {NULL}
6370
};
6371
6372
static GDBusInterfaceInfo *
6373
gxdp_proxy_resolver_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
6374
0
{
6375
0
  return gxdp_proxy_resolver_interface_info ();
6376
0
}
6377
6378
static GDBusInterfaceVTable *
6379
gxdp_proxy_resolver_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
6380
0
{
6381
0
  return (GDBusInterfaceVTable *) &_gxdp_proxy_resolver_skeleton_vtable;
6382
0
}
6383
6384
static GVariant *
6385
gxdp_proxy_resolver_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
6386
0
{
6387
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (_skeleton);
6388
6389
0
  GVariantBuilder builder;
6390
0
  guint n;
6391
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
6392
0
  if (_gxdp_proxy_resolver_interface_info.parent_struct.properties == NULL)
6393
0
    goto out;
6394
0
  for (n = 0; _gxdp_proxy_resolver_interface_info.parent_struct.properties[n] != NULL; n++)
6395
0
    {
6396
0
      GDBusPropertyInfo *info = _gxdp_proxy_resolver_interface_info.parent_struct.properties[n];
6397
0
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
6398
0
        {
6399
0
          GVariant *value;
6400
0
          value = _gxdp_proxy_resolver_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.portal.ProxyResolver", info->name, NULL, skeleton);
6401
0
          if (value != NULL)
6402
0
            {
6403
0
              g_variant_take_ref (value);
6404
0
              g_variant_builder_add (&builder, "{sv}", info->name, value);
6405
0
              g_variant_unref (value);
6406
0
            }
6407
0
        }
6408
0
    }
6409
0
out:
6410
0
  return g_variant_builder_end (&builder);
6411
0
}
6412
6413
static gboolean _gxdp_proxy_resolver_emit_changed (gpointer user_data);
6414
6415
static void
6416
gxdp_proxy_resolver_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
6417
0
{
6418
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (_skeleton);
6419
0
  gboolean emit_changed = FALSE;
6420
6421
0
  g_mutex_lock (&skeleton->priv->lock);
6422
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
6423
0
    {
6424
0
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
6425
0
      skeleton->priv->changed_properties_idle_source = NULL;
6426
0
      emit_changed = TRUE;
6427
0
    }
6428
0
  g_mutex_unlock (&skeleton->priv->lock);
6429
6430
0
  if (emit_changed)
6431
0
    _gxdp_proxy_resolver_emit_changed (skeleton);
6432
0
}
6433
6434
static void gxdp_proxy_resolver_skeleton_iface_init (GXdpProxyResolverIface *iface);
6435
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
6436
G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverSkeleton, gxdp_proxy_resolver_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
6437
                         G_ADD_PRIVATE (GXdpProxyResolverSkeleton)
6438
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_skeleton_iface_init))
6439
6440
#else
6441
G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverSkeleton, gxdp_proxy_resolver_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
6442
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_skeleton_iface_init))
6443
6444
#endif
6445
static void
6446
gxdp_proxy_resolver_skeleton_finalize (GObject *object)
6447
0
{
6448
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object);
6449
0
  guint n;
6450
0
  for (n = 0; n < 1; n++)
6451
0
    g_value_unset (&skeleton->priv->properties[n]);
6452
0
  g_free (skeleton->priv->properties);
6453
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
6454
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
6455
0
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
6456
0
  g_main_context_unref (skeleton->priv->context);
6457
0
  g_mutex_clear (&skeleton->priv->lock);
6458
0
  G_OBJECT_CLASS (gxdp_proxy_resolver_skeleton_parent_class)->finalize (object);
6459
0
}
6460
6461
static void
6462
gxdp_proxy_resolver_skeleton_get_property (GObject      *object,
6463
  guint         prop_id,
6464
  GValue       *value,
6465
  GParamSpec   *pspec G_GNUC_UNUSED)
6466
0
{
6467
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object);
6468
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
6469
0
  g_mutex_lock (&skeleton->priv->lock);
6470
0
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
6471
0
  g_mutex_unlock (&skeleton->priv->lock);
6472
0
}
6473
6474
static gboolean
6475
_gxdp_proxy_resolver_emit_changed (gpointer user_data)
6476
0
{
6477
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data);
6478
0
  GList *l;
6479
0
  GVariantBuilder builder;
6480
0
  GVariantBuilder invalidated_builder;
6481
0
  guint num_changes;
6482
6483
0
  g_mutex_lock (&skeleton->priv->lock);
6484
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
6485
0
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
6486
0
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
6487
0
    {
6488
0
      ChangedProperty *cp = l->data;
6489
0
      GVariant *variant;
6490
0
      const GValue *cur_value;
6491
6492
0
      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
6493
0
      if (!_g_value_equal (cur_value, &cp->orig_value))
6494
0
        {
6495
0
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
6496
0
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
6497
0
          g_variant_unref (variant);
6498
0
          num_changes++;
6499
0
        }
6500
0
    }
6501
0
  if (num_changes > 0)
6502
0
    {
6503
0
      GList *connections, *ll;
6504
0
      GVariant *signal_variant;
6505
0
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.ProxyResolver",
6506
0
                                           &builder, &invalidated_builder));
6507
0
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
6508
0
      for (ll = connections; ll != NULL; ll = ll->next)
6509
0
        {
6510
0
          GDBusConnection *connection = ll->data;
6511
6512
0
          g_dbus_connection_emit_signal (connection,
6513
0
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
6514
0
                                         "org.freedesktop.DBus.Properties",
6515
0
                                         "PropertiesChanged",
6516
0
                                         signal_variant,
6517
0
                                         NULL);
6518
0
        }
6519
0
      g_variant_unref (signal_variant);
6520
0
      g_list_free_full (connections, g_object_unref);
6521
0
    }
6522
0
  else
6523
0
    {
6524
0
      g_variant_builder_clear (&builder);
6525
0
      g_variant_builder_clear (&invalidated_builder);
6526
0
    }
6527
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
6528
0
  skeleton->priv->changed_properties = NULL;
6529
0
  skeleton->priv->changed_properties_idle_source = NULL;
6530
0
  g_mutex_unlock (&skeleton->priv->lock);
6531
0
  return FALSE;
6532
0
}
6533
6534
static void
6535
_gxdp_proxy_resolver_schedule_emit_changed (GXdpProxyResolverSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
6536
0
{
6537
0
  ChangedProperty *cp;
6538
0
  GList *l;
6539
0
  cp = NULL;
6540
0
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
6541
0
    {
6542
0
      ChangedProperty *i_cp = l->data;
6543
0
      if (i_cp->info == info)
6544
0
        {
6545
0
          cp = i_cp;
6546
0
          break;
6547
0
        }
6548
0
    }
6549
0
  if (cp == NULL)
6550
0
    {
6551
0
      cp = g_new0 (ChangedProperty, 1);
6552
0
      cp->prop_id = prop_id;
6553
0
      cp->info = info;
6554
0
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
6555
0
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
6556
0
      g_value_copy (orig_value, &cp->orig_value);
6557
0
    }
6558
0
}
6559
6560
static void
6561
gxdp_proxy_resolver_skeleton_notify (GObject      *object,
6562
  GParamSpec *pspec G_GNUC_UNUSED)
6563
0
{
6564
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object);
6565
0
  g_mutex_lock (&skeleton->priv->lock);
6566
0
  if (skeleton->priv->changed_properties != NULL &&
6567
0
      skeleton->priv->changed_properties_idle_source == NULL)
6568
0
    {
6569
0
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
6570
0
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
6571
0
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_proxy_resolver_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
6572
0
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_proxy_resolver_emit_changed");
6573
0
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
6574
0
      g_source_unref (skeleton->priv->changed_properties_idle_source);
6575
0
    }
6576
0
  g_mutex_unlock (&skeleton->priv->lock);
6577
0
}
6578
6579
static void
6580
gxdp_proxy_resolver_skeleton_set_property (GObject      *object,
6581
  guint         prop_id,
6582
  const GValue *value,
6583
  GParamSpec   *pspec)
6584
0
{
6585
0
  const _ExtendedGDBusPropertyInfo *info;
6586
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object);
6587
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
6588
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1];
6589
0
  g_mutex_lock (&skeleton->priv->lock);
6590
0
  g_object_freeze_notify (object);
6591
0
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
6592
0
    {
6593
0
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
6594
0
          info->emits_changed_signal)
6595
0
        _gxdp_proxy_resolver_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
6596
0
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
6597
0
      g_object_notify_by_pspec (object, pspec);
6598
0
    }
6599
0
  g_mutex_unlock (&skeleton->priv->lock);
6600
0
  g_object_thaw_notify (object);
6601
0
}
6602
6603
static void
6604
gxdp_proxy_resolver_skeleton_init (GXdpProxyResolverSkeleton *skeleton)
6605
0
{
6606
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
6607
0
  skeleton->priv = gxdp_proxy_resolver_skeleton_get_instance_private (skeleton);
6608
#else
6609
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_PROXY_RESOLVER_SKELETON, GXdpProxyResolverSkeletonPrivate);
6610
#endif
6611
6612
0
  g_mutex_init (&skeleton->priv->lock);
6613
0
  skeleton->priv->context = g_main_context_ref_thread_default ();
6614
0
  skeleton->priv->properties = g_new0 (GValue, 1);
6615
0
  g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT);
6616
0
}
6617
6618
static guint 
6619
gxdp_proxy_resolver_skeleton_get_version (GXdpProxyResolver *object)
6620
0
{
6621
0
  GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object);
6622
0
  guint value;
6623
0
  g_mutex_lock (&skeleton->priv->lock);
6624
0
  value = g_value_get_uint (&(skeleton->priv->properties[0]));
6625
0
  g_mutex_unlock (&skeleton->priv->lock);
6626
0
  return value;
6627
0
}
6628
6629
static void
6630
gxdp_proxy_resolver_skeleton_class_init (GXdpProxyResolverSkeletonClass *klass)
6631
0
{
6632
0
  GObjectClass *gobject_class;
6633
0
  GDBusInterfaceSkeletonClass *skeleton_class;
6634
6635
0
  gobject_class = G_OBJECT_CLASS (klass);
6636
0
  gobject_class->finalize = gxdp_proxy_resolver_skeleton_finalize;
6637
0
  gobject_class->get_property = gxdp_proxy_resolver_skeleton_get_property;
6638
0
  gobject_class->set_property = gxdp_proxy_resolver_skeleton_set_property;
6639
0
  gobject_class->notify       = gxdp_proxy_resolver_skeleton_notify;
6640
6641
6642
0
  gxdp_proxy_resolver_override_properties (gobject_class, 1);
6643
6644
0
  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
6645
0
  skeleton_class->get_info = gxdp_proxy_resolver_skeleton_dbus_interface_get_info;
6646
0
  skeleton_class->get_properties = gxdp_proxy_resolver_skeleton_dbus_interface_get_properties;
6647
0
  skeleton_class->flush = gxdp_proxy_resolver_skeleton_dbus_interface_flush;
6648
0
  skeleton_class->get_vtable = gxdp_proxy_resolver_skeleton_dbus_interface_get_vtable;
6649
6650
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
6651
  g_type_class_add_private (klass, sizeof (GXdpProxyResolverSkeletonPrivate));
6652
#endif
6653
0
}
6654
6655
static void
6656
gxdp_proxy_resolver_skeleton_iface_init (GXdpProxyResolverIface *iface)
6657
0
{
6658
0
  iface->get_version = gxdp_proxy_resolver_skeleton_get_version;
6659
0
}
6660
6661
/**
6662
 * gxdp_proxy_resolver_skeleton_new:
6663
 *
6664
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>.
6665
 *
6666
 * Returns: (transfer full) (type GXdpProxyResolverSkeleton): The skeleton object.
6667
 */
6668
GXdpProxyResolver *
6669
gxdp_proxy_resolver_skeleton_new (void)
6670
0
{
6671
0
  return GXDP_PROXY_RESOLVER (g_object_new (GXDP_TYPE_PROXY_RESOLVER_SKELETON, NULL));
6672
0
}
6673
6674
/* ------------------------------------------------------------------------
6675
 * Code for interface org.freedesktop.portal.Trash
6676
 * ------------------------------------------------------------------------
6677
 */
6678
6679
/**
6680
 * SECTION:GXdpTrash
6681
 * @title: GXdpTrash
6682
 * @short_description: Generated C code for the org.freedesktop.portal.Trash D-Bus interface
6683
 *
6684
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link> D-Bus interface in C.
6685
 */
6686
6687
/* ---- Introspection data for org.freedesktop.portal.Trash ---- */
6688
6689
static const _ExtendedGDBusArgInfo _gxdp_trash_method_info_trash_file_IN_ARG_fd =
6690
{
6691
  {
6692
    -1,
6693
    (gchar *) "fd",
6694
    (gchar *) "h",
6695
    NULL
6696
  },
6697
  FALSE
6698
};
6699
6700
static const GDBusArgInfo * const _gxdp_trash_method_info_trash_file_IN_ARG_pointers[] =
6701
{
6702
  &_gxdp_trash_method_info_trash_file_IN_ARG_fd.parent_struct,
6703
  NULL
6704
};
6705
6706
static const _ExtendedGDBusArgInfo _gxdp_trash_method_info_trash_file_OUT_ARG_result =
6707
{
6708
  {
6709
    -1,
6710
    (gchar *) "result",
6711
    (gchar *) "u",
6712
    NULL
6713
  },
6714
  FALSE
6715
};
6716
6717
static const GDBusArgInfo * const _gxdp_trash_method_info_trash_file_OUT_ARG_pointers[] =
6718
{
6719
  &_gxdp_trash_method_info_trash_file_OUT_ARG_result.parent_struct,
6720
  NULL
6721
};
6722
6723
static const _ExtendedGDBusMethodInfo _gxdp_trash_method_info_trash_file =
6724
{
6725
  {
6726
    -1,
6727
    (gchar *) "TrashFile",
6728
    (GDBusArgInfo **) &_gxdp_trash_method_info_trash_file_IN_ARG_pointers,
6729
    (GDBusArgInfo **) &_gxdp_trash_method_info_trash_file_OUT_ARG_pointers,
6730
    NULL
6731
  },
6732
  "handle-trash-file",
6733
  TRUE
6734
};
6735
6736
static const GDBusMethodInfo * const _gxdp_trash_method_info_pointers[] =
6737
{
6738
  &_gxdp_trash_method_info_trash_file.parent_struct,
6739
  NULL
6740
};
6741
6742
static const _ExtendedGDBusPropertyInfo _gxdp_trash_property_info_version =
6743
{
6744
  {
6745
    -1,
6746
    (gchar *) "version",
6747
    (gchar *) "u",
6748
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
6749
    NULL
6750
  },
6751
  "version",
6752
  FALSE,
6753
  TRUE
6754
};
6755
6756
static const GDBusPropertyInfo * const _gxdp_trash_property_info_pointers[] =
6757
{
6758
  &_gxdp_trash_property_info_version.parent_struct,
6759
  NULL
6760
};
6761
6762
static const _ExtendedGDBusInterfaceInfo _gxdp_trash_interface_info =
6763
{
6764
  {
6765
    -1,
6766
    (gchar *) "org.freedesktop.portal.Trash",
6767
    (GDBusMethodInfo **) &_gxdp_trash_method_info_pointers,
6768
    NULL,
6769
    (GDBusPropertyInfo **) &_gxdp_trash_property_info_pointers,
6770
    NULL
6771
  },
6772
  "trash",
6773
};
6774
6775
6776
/**
6777
 * gxdp_trash_interface_info:
6778
 *
6779
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link> D-Bus interface.
6780
 *
6781
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
6782
 */
6783
GDBusInterfaceInfo *
6784
gxdp_trash_interface_info (void)
6785
0
{
6786
0
  return (GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct;
6787
0
}
6788
6789
/**
6790
 * gxdp_trash_override_properties:
6791
 * @klass: The class structure for a #GObject derived class.
6792
 * @property_id_begin: The property id to assign to the first overridden property.
6793
 *
6794
 * Overrides all #GObject properties in the #GXdpTrash interface for a concrete class.
6795
 * The properties are overridden in the order they are defined.
6796
 *
6797
 * Returns: The last property id.
6798
 */
6799
guint
6800
gxdp_trash_override_properties (GObjectClass *klass, guint property_id_begin)
6801
0
{
6802
0
  g_object_class_override_property (klass, property_id_begin++, "version");
6803
0
  return property_id_begin - 1;
6804
0
}
6805
6806
6807
6808
/**
6809
 * GXdpTrash:
6810
 *
6811
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link>.
6812
 */
6813
6814
/**
6815
 * GXdpTrashIface:
6816
 * @parent_iface: The parent interface.
6817
 * @handle_trash_file: Handler for the #GXdpTrash::handle-trash-file signal.
6818
 * @get_version: Getter for the #GXdpTrash:version property.
6819
 *
6820
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link>.
6821
 */
6822
6823
typedef GXdpTrashIface GXdpTrashInterface;
6824
G_DEFINE_INTERFACE (GXdpTrash, gxdp_trash, G_TYPE_OBJECT)
6825
6826
static void
6827
gxdp_trash_default_init (GXdpTrashIface *iface)
6828
0
{
6829
  /* GObject signals for incoming D-Bus method calls: */
6830
  /**
6831
   * GXdpTrash::handle-trash-file:
6832
   * @object: A #GXdpTrash.
6833
   * @invocation: A #GDBusMethodInvocation.
6834
   * @fd_list: (nullable): A #GUnixFDList or %NULL.
6835
   * @arg_fd: Argument passed by remote caller.
6836
   *
6837
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Trash.TrashFile">TrashFile()</link> D-Bus method.
6838
   *
6839
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call gxdp_trash_complete_trash_file() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
6840
   *
6841
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
6842
   */
6843
0
  g_signal_new ("handle-trash-file",
6844
0
    G_TYPE_FROM_INTERFACE (iface),
6845
0
    G_SIGNAL_RUN_LAST,
6846
0
    G_STRUCT_OFFSET (GXdpTrashIface, handle_trash_file),
6847
0
    g_signal_accumulator_true_handled,
6848
0
    NULL,
6849
0
    g_cclosure_marshal_generic,
6850
0
    G_TYPE_BOOLEAN,
6851
0
    3,
6852
0
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT);
6853
6854
  /* GObject properties for D-Bus properties: */
6855
  /**
6856
   * GXdpTrash:version:
6857
   *
6858
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-Trash.version">"version"</link>.
6859
   *
6860
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
6861
   */
6862
0
  g_object_interface_install_property (iface,
6863
0
    g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
6864
0
}
6865
6866
/**
6867
 * gxdp_trash_get_version: (skip)
6868
 * @object: A #GXdpTrash.
6869
 *
6870
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-Trash.version">"version"</link> D-Bus property.
6871
 *
6872
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
6873
 *
6874
 * Returns: The property value.
6875
 */
6876
guint 
6877
gxdp_trash_get_version (GXdpTrash *object)
6878
0
{
6879
0
  g_return_val_if_fail (GXDP_IS_TRASH (object), 0);
6880
6881
0
  return GXDP_TRASH_GET_IFACE (object)->get_version (object);
6882
0
}
6883
6884
/**
6885
 * gxdp_trash_set_version: (skip)
6886
 * @object: A #GXdpTrash.
6887
 * @value: The value to set.
6888
 *
6889
 * Sets the <link linkend="gdbus-property-org-freedesktop-portal-Trash.version">"version"</link> D-Bus property to @value.
6890
 *
6891
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
6892
 */
6893
void
6894
gxdp_trash_set_version (GXdpTrash *object, guint value)
6895
0
{
6896
0
  g_object_set (G_OBJECT (object), "version", value, NULL);
6897
0
}
6898
6899
/**
6900
 * gxdp_trash_call_trash_file:
6901
 * @proxy: A #GXdpTrashProxy.
6902
 * @arg_fd: Argument to pass with the method invocation.
6903
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
6904
 * @cancellable: (nullable): A #GCancellable or %NULL.
6905
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
6906
 * @user_data: User data to pass to @callback.
6907
 *
6908
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Trash.TrashFile">TrashFile()</link> D-Bus method on @proxy.
6909
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
6910
 * You can then call gxdp_trash_call_trash_file_finish() to get the result of the operation.
6911
 *
6912
 * See gxdp_trash_call_trash_file_sync() for the synchronous, blocking version of this method.
6913
 */
6914
void
6915
gxdp_trash_call_trash_file (
6916
    GXdpTrash *proxy,
6917
    GVariant *arg_fd,
6918
    GUnixFDList *fd_list,
6919
    GCancellable *cancellable,
6920
    GAsyncReadyCallback callback,
6921
    gpointer user_data)
6922
0
{
6923
0
  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
6924
0
    "TrashFile",
6925
0
    g_variant_new ("(@h)",
6926
0
                   arg_fd),
6927
0
    G_DBUS_CALL_FLAGS_NONE,
6928
0
    -1,
6929
0
    fd_list,
6930
0
    cancellable,
6931
0
    callback,
6932
0
    user_data);
6933
0
}
6934
6935
/**
6936
 * gxdp_trash_call_trash_file_finish:
6937
 * @proxy: A #GXdpTrashProxy.
6938
 * @out_result: (out) (optional): Return location for return parameter or %NULL to ignore.
6939
 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
6940
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_call_trash_file().
6941
 * @error: Return location for error or %NULL.
6942
 *
6943
 * Finishes an operation started with gxdp_trash_call_trash_file().
6944
 *
6945
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
6946
 */
6947
gboolean
6948
gxdp_trash_call_trash_file_finish (
6949
    GXdpTrash *proxy,
6950
    guint *out_result,
6951
    GUnixFDList **out_fd_list,
6952
    GAsyncResult *res,
6953
    GError **error)
6954
0
{
6955
0
  GVariant *_ret;
6956
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
6957
0
  if (_ret == NULL)
6958
0
    goto _out;
6959
0
  g_variant_get (_ret,
6960
0
                 "(u)",
6961
0
                 out_result);
6962
0
  g_variant_unref (_ret);
6963
0
_out:
6964
0
  return _ret != NULL;
6965
0
}
6966
6967
/**
6968
 * gxdp_trash_call_trash_file_sync:
6969
 * @proxy: A #GXdpTrashProxy.
6970
 * @arg_fd: Argument to pass with the method invocation.
6971
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
6972
 * @out_result: (out) (optional): Return location for return parameter or %NULL to ignore.
6973
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
6974
 * @cancellable: (nullable): A #GCancellable or %NULL.
6975
 * @error: Return location for error or %NULL.
6976
 *
6977
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Trash.TrashFile">TrashFile()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
6978
 *
6979
 * See gxdp_trash_call_trash_file() for the asynchronous version of this method.
6980
 *
6981
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
6982
 */
6983
gboolean
6984
gxdp_trash_call_trash_file_sync (
6985
    GXdpTrash *proxy,
6986
    GVariant *arg_fd,
6987
    GUnixFDList  *fd_list,
6988
    guint *out_result,
6989
    GUnixFDList **out_fd_list,
6990
    GCancellable *cancellable,
6991
    GError **error)
6992
0
{
6993
0
  GVariant *_ret;
6994
0
  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
6995
0
    "TrashFile",
6996
0
    g_variant_new ("(@h)",
6997
0
                   arg_fd),
6998
0
    G_DBUS_CALL_FLAGS_NONE,
6999
0
    -1,
7000
0
    fd_list,
7001
0
    out_fd_list,
7002
0
    cancellable,
7003
0
    error);
7004
0
  if (_ret == NULL)
7005
0
    goto _out;
7006
0
  g_variant_get (_ret,
7007
0
                 "(u)",
7008
0
                 out_result);
7009
0
  g_variant_unref (_ret);
7010
0
_out:
7011
0
  return _ret != NULL;
7012
0
}
7013
7014
/**
7015
 * gxdp_trash_complete_trash_file:
7016
 * @object: A #GXdpTrash.
7017
 * @invocation: (transfer full): A #GDBusMethodInvocation.
7018
 * @fd_list: (nullable): A #GUnixFDList or %NULL.
7019
 * @result: Parameter to return.
7020
 *
7021
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Trash.TrashFile">TrashFile()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
7022
 *
7023
 * This method will free @invocation, you cannot use it afterwards.
7024
 */
7025
void
7026
gxdp_trash_complete_trash_file (
7027
    GXdpTrash *object G_GNUC_UNUSED,
7028
    GDBusMethodInvocation *invocation,
7029
    GUnixFDList *fd_list,
7030
    guint result)
7031
0
{
7032
0
  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
7033
0
    g_variant_new ("(u)",
7034
0
                   result),
7035
0
    fd_list);
7036
0
}
7037
7038
/* ------------------------------------------------------------------------ */
7039
7040
/**
7041
 * GXdpTrashProxy:
7042
 *
7043
 * The #GXdpTrashProxy structure contains only private data and should only be accessed using the provided API.
7044
 */
7045
7046
/**
7047
 * GXdpTrashProxyClass:
7048
 * @parent_class: The parent class.
7049
 *
7050
 * Class structure for #GXdpTrashProxy.
7051
 */
7052
7053
struct _GXdpTrashProxyPrivate
7054
{
7055
  GData *qdata;
7056
};
7057
7058
static void gxdp_trash_proxy_iface_init (GXdpTrashIface *iface);
7059
7060
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7061
G_DEFINE_TYPE_WITH_CODE (GXdpTrashProxy, gxdp_trash_proxy, G_TYPE_DBUS_PROXY,
7062
                         G_ADD_PRIVATE (GXdpTrashProxy)
7063
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_proxy_iface_init))
7064
7065
#else
7066
G_DEFINE_TYPE_WITH_CODE (GXdpTrashProxy, gxdp_trash_proxy, G_TYPE_DBUS_PROXY,
7067
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_proxy_iface_init))
7068
7069
#endif
7070
static void
7071
gxdp_trash_proxy_finalize (GObject *object)
7072
0
{
7073
0
  GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (object);
7074
0
  g_datalist_clear (&proxy->priv->qdata);
7075
0
  G_OBJECT_CLASS (gxdp_trash_proxy_parent_class)->finalize (object);
7076
0
}
7077
7078
static void
7079
gxdp_trash_proxy_get_property (GObject      *object,
7080
  guint         prop_id,
7081
  GValue       *value,
7082
  GParamSpec   *pspec G_GNUC_UNUSED)
7083
0
{
7084
0
  const _ExtendedGDBusPropertyInfo *info;
7085
0
  GVariant *variant;
7086
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
7087
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1];
7088
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
7089
0
  if (info->use_gvariant)
7090
0
    {
7091
0
      g_value_set_variant (value, variant);
7092
0
    }
7093
0
  else
7094
0
    {
7095
0
      if (variant != NULL)
7096
0
        g_dbus_gvariant_to_gvalue (variant, value);
7097
0
    }
7098
0
  if (variant != NULL)
7099
0
    g_variant_unref (variant);
7100
0
}
7101
7102
static void
7103
gxdp_trash_proxy_set_property_cb (GDBusProxy *proxy,
7104
  GAsyncResult *res,
7105
  gpointer      user_data)
7106
0
{
7107
0
  const _ExtendedGDBusPropertyInfo *info = user_data;
7108
0
  GError *error;
7109
0
  GVariant *_ret;
7110
0
  error = NULL;
7111
0
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
7112
0
  if (!_ret)
7113
0
    {
7114
0
      g_warning ("Error setting property '%s' on interface org.freedesktop.portal.Trash: %s (%s, %d)",
7115
0
                 info->parent_struct.name, 
7116
0
                 error->message, g_quark_to_string (error->domain), error->code);
7117
0
      g_error_free (error);
7118
0
    }
7119
0
  else
7120
0
    {
7121
0
      g_variant_unref (_ret);
7122
0
    }
7123
0
}
7124
7125
static void
7126
gxdp_trash_proxy_set_property (GObject      *object,
7127
  guint         prop_id,
7128
  const GValue *value,
7129
  GParamSpec   *pspec G_GNUC_UNUSED)
7130
0
{
7131
0
  const _ExtendedGDBusPropertyInfo *info;
7132
0
  GVariant *variant;
7133
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
7134
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1];
7135
0
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
7136
0
  g_dbus_proxy_call (G_DBUS_PROXY (object),
7137
0
    "org.freedesktop.DBus.Properties.Set",
7138
0
    g_variant_new ("(ssv)", "org.freedesktop.portal.Trash", info->parent_struct.name, variant),
7139
0
    G_DBUS_CALL_FLAGS_NONE,
7140
0
    -1,
7141
0
    NULL, (GAsyncReadyCallback) gxdp_trash_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
7142
0
  g_variant_unref (variant);
7143
0
}
7144
7145
static void
7146
gxdp_trash_proxy_g_signal (GDBusProxy *proxy,
7147
  const gchar *sender_name G_GNUC_UNUSED,
7148
  const gchar *signal_name,
7149
  GVariant *parameters)
7150
0
{
7151
0
  _ExtendedGDBusSignalInfo *info;
7152
0
  GVariantIter iter;
7153
0
  GVariant *child;
7154
0
  GValue *paramv;
7155
0
  gsize num_params;
7156
0
  gsize n;
7157
0
  guint signal_id;
7158
0
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, signal_name);
7159
0
  if (info == NULL)
7160
0
    return;
7161
0
  num_params = g_variant_n_children (parameters);
7162
0
  paramv = g_new0 (GValue, num_params + 1);
7163
0
  g_value_init (&paramv[0], GXDP_TYPE_TRASH);
7164
0
  g_value_set_object (&paramv[0], proxy);
7165
0
  g_variant_iter_init (&iter, parameters);
7166
0
  n = 1;
7167
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
7168
0
    {
7169
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
7170
0
      if (arg_info->use_gvariant)
7171
0
        {
7172
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
7173
0
          g_value_set_variant (&paramv[n], child);
7174
0
          n++;
7175
0
        }
7176
0
      else
7177
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
7178
0
      g_variant_unref (child);
7179
0
    }
7180
0
  signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_TRASH);
7181
0
  g_signal_emitv (paramv, signal_id, 0, NULL);
7182
0
  for (n = 0; n < num_params + 1; n++)
7183
0
    g_value_unset (&paramv[n]);
7184
0
  g_free (paramv);
7185
0
}
7186
7187
static void
7188
gxdp_trash_proxy_g_properties_changed (GDBusProxy *_proxy,
7189
  GVariant *changed_properties,
7190
  const gchar *const *invalidated_properties)
7191
0
{
7192
0
  GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (_proxy);
7193
0
  guint n;
7194
0
  const gchar *key;
7195
0
  GVariantIter *iter;
7196
0
  _ExtendedGDBusPropertyInfo *info;
7197
0
  g_variant_get (changed_properties, "a{sv}", &iter);
7198
0
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
7199
0
    {
7200
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, key);
7201
0
      g_datalist_remove_data (&proxy->priv->qdata, key);
7202
0
      if (info != NULL)
7203
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
7204
0
    }
7205
0
  g_variant_iter_free (iter);
7206
0
  for (n = 0; invalidated_properties[n] != NULL; n++)
7207
0
    {
7208
0
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, invalidated_properties[n]);
7209
0
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
7210
0
      if (info != NULL)
7211
0
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
7212
0
    }
7213
0
}
7214
7215
static guint 
7216
gxdp_trash_proxy_get_version (GXdpTrash *object)
7217
0
{
7218
0
  GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (object);
7219
0
  GVariant *variant;
7220
0
  guint value = 0;
7221
0
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version");
7222
0
  if (variant != NULL)
7223
0
    {
7224
0
      value = g_variant_get_uint32 (variant);
7225
0
      g_variant_unref (variant);
7226
0
    }
7227
0
  return value;
7228
0
}
7229
7230
static void
7231
gxdp_trash_proxy_init (GXdpTrashProxy *proxy)
7232
0
{
7233
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7234
0
  proxy->priv = gxdp_trash_proxy_get_instance_private (proxy);
7235
#else
7236
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_TRASH_PROXY, GXdpTrashProxyPrivate);
7237
#endif
7238
7239
0
  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_trash_interface_info ());
7240
0
}
7241
7242
static void
7243
gxdp_trash_proxy_class_init (GXdpTrashProxyClass *klass)
7244
0
{
7245
0
  GObjectClass *gobject_class;
7246
0
  GDBusProxyClass *proxy_class;
7247
7248
0
  gobject_class = G_OBJECT_CLASS (klass);
7249
0
  gobject_class->finalize     = gxdp_trash_proxy_finalize;
7250
0
  gobject_class->get_property = gxdp_trash_proxy_get_property;
7251
0
  gobject_class->set_property = gxdp_trash_proxy_set_property;
7252
7253
0
  proxy_class = G_DBUS_PROXY_CLASS (klass);
7254
0
  proxy_class->g_signal = gxdp_trash_proxy_g_signal;
7255
0
  proxy_class->g_properties_changed = gxdp_trash_proxy_g_properties_changed;
7256
7257
0
  gxdp_trash_override_properties (gobject_class, 1);
7258
7259
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
7260
  g_type_class_add_private (klass, sizeof (GXdpTrashProxyPrivate));
7261
#endif
7262
0
}
7263
7264
static void
7265
gxdp_trash_proxy_iface_init (GXdpTrashIface *iface)
7266
0
{
7267
0
  iface->get_version = gxdp_trash_proxy_get_version;
7268
0
}
7269
7270
/**
7271
 * gxdp_trash_proxy_new:
7272
 * @connection: A #GDBusConnection.
7273
 * @flags: Flags from the #GDBusProxyFlags enumeration.
7274
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
7275
 * @object_path: An object path.
7276
 * @cancellable: (nullable): A #GCancellable or %NULL.
7277
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
7278
 * @user_data: User data to pass to @callback.
7279
 *
7280
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link>. See g_dbus_proxy_new() for more details.
7281
 *
7282
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
7283
 * You can then call gxdp_trash_proxy_new_finish() to get the result of the operation.
7284
 *
7285
 * See gxdp_trash_proxy_new_sync() for the synchronous, blocking version of this constructor.
7286
 */
7287
void
7288
gxdp_trash_proxy_new (
7289
    GDBusConnection     *connection,
7290
    GDBusProxyFlags      flags,
7291
    const gchar         *name,
7292
    const gchar         *object_path,
7293
    GCancellable        *cancellable,
7294
    GAsyncReadyCallback  callback,
7295
    gpointer             user_data)
7296
0
{
7297
0
  g_async_initable_new_async (GXDP_TYPE_TRASH_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Trash", NULL);
7298
0
}
7299
7300
/**
7301
 * gxdp_trash_proxy_new_finish:
7302
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_proxy_new().
7303
 * @error: Return location for error or %NULL
7304
 *
7305
 * Finishes an operation started with gxdp_trash_proxy_new().
7306
 *
7307
 * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set.
7308
 */
7309
GXdpTrash *
7310
gxdp_trash_proxy_new_finish (
7311
    GAsyncResult        *res,
7312
    GError             **error)
7313
0
{
7314
0
  GObject *ret;
7315
0
  GObject *source_object;
7316
0
  source_object = g_async_result_get_source_object (res);
7317
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
7318
0
  g_object_unref (source_object);
7319
0
  if (ret != NULL)
7320
0
    return GXDP_TRASH (ret);
7321
0
  else
7322
0
    return NULL;
7323
0
}
7324
7325
/**
7326
 * gxdp_trash_proxy_new_sync:
7327
 * @connection: A #GDBusConnection.
7328
 * @flags: Flags from the #GDBusProxyFlags enumeration.
7329
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
7330
 * @object_path: An object path.
7331
 * @cancellable: (nullable): A #GCancellable or %NULL.
7332
 * @error: Return location for error or %NULL
7333
 *
7334
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link>. See g_dbus_proxy_new_sync() for more details.
7335
 *
7336
 * The calling thread is blocked until a reply is received.
7337
 *
7338
 * See gxdp_trash_proxy_new() for the asynchronous version of this constructor.
7339
 *
7340
 * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set.
7341
 */
7342
GXdpTrash *
7343
gxdp_trash_proxy_new_sync (
7344
    GDBusConnection     *connection,
7345
    GDBusProxyFlags      flags,
7346
    const gchar         *name,
7347
    const gchar         *object_path,
7348
    GCancellable        *cancellable,
7349
    GError             **error)
7350
0
{
7351
0
  GInitable *ret;
7352
0
  ret = g_initable_new (GXDP_TYPE_TRASH_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Trash", NULL);
7353
0
  if (ret != NULL)
7354
0
    return GXDP_TRASH (ret);
7355
0
  else
7356
0
    return NULL;
7357
0
}
7358
7359
7360
/**
7361
 * gxdp_trash_proxy_new_for_bus:
7362
 * @bus_type: A #GBusType.
7363
 * @flags: Flags from the #GDBusProxyFlags enumeration.
7364
 * @name: A bus name (well-known or unique).
7365
 * @object_path: An object path.
7366
 * @cancellable: (nullable): A #GCancellable or %NULL.
7367
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
7368
 * @user_data: User data to pass to @callback.
7369
 *
7370
 * Like gxdp_trash_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
7371
 *
7372
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
7373
 * You can then call gxdp_trash_proxy_new_for_bus_finish() to get the result of the operation.
7374
 *
7375
 * See gxdp_trash_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
7376
 */
7377
void
7378
gxdp_trash_proxy_new_for_bus (
7379
    GBusType             bus_type,
7380
    GDBusProxyFlags      flags,
7381
    const gchar         *name,
7382
    const gchar         *object_path,
7383
    GCancellable        *cancellable,
7384
    GAsyncReadyCallback  callback,
7385
    gpointer             user_data)
7386
0
{
7387
0
  g_async_initable_new_async (GXDP_TYPE_TRASH_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Trash", NULL);
7388
0
}
7389
7390
/**
7391
 * gxdp_trash_proxy_new_for_bus_finish:
7392
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_proxy_new_for_bus().
7393
 * @error: Return location for error or %NULL
7394
 *
7395
 * Finishes an operation started with gxdp_trash_proxy_new_for_bus().
7396
 *
7397
 * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set.
7398
 */
7399
GXdpTrash *
7400
gxdp_trash_proxy_new_for_bus_finish (
7401
    GAsyncResult        *res,
7402
    GError             **error)
7403
0
{
7404
0
  GObject *ret;
7405
0
  GObject *source_object;
7406
0
  source_object = g_async_result_get_source_object (res);
7407
0
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
7408
0
  g_object_unref (source_object);
7409
0
  if (ret != NULL)
7410
0
    return GXDP_TRASH (ret);
7411
0
  else
7412
0
    return NULL;
7413
0
}
7414
7415
/**
7416
 * gxdp_trash_proxy_new_for_bus_sync:
7417
 * @bus_type: A #GBusType.
7418
 * @flags: Flags from the #GDBusProxyFlags enumeration.
7419
 * @name: A bus name (well-known or unique).
7420
 * @object_path: An object path.
7421
 * @cancellable: (nullable): A #GCancellable or %NULL.
7422
 * @error: Return location for error or %NULL
7423
 *
7424
 * Like gxdp_trash_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
7425
 *
7426
 * The calling thread is blocked until a reply is received.
7427
 *
7428
 * See gxdp_trash_proxy_new_for_bus() for the asynchronous version of this constructor.
7429
 *
7430
 * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set.
7431
 */
7432
GXdpTrash *
7433
gxdp_trash_proxy_new_for_bus_sync (
7434
    GBusType             bus_type,
7435
    GDBusProxyFlags      flags,
7436
    const gchar         *name,
7437
    const gchar         *object_path,
7438
    GCancellable        *cancellable,
7439
    GError             **error)
7440
0
{
7441
0
  GInitable *ret;
7442
0
  ret = g_initable_new (GXDP_TYPE_TRASH_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.portal.Trash", NULL);
7443
0
  if (ret != NULL)
7444
0
    return GXDP_TRASH (ret);
7445
0
  else
7446
0
    return NULL;
7447
0
}
7448
7449
7450
/* ------------------------------------------------------------------------ */
7451
7452
/**
7453
 * GXdpTrashSkeleton:
7454
 *
7455
 * The #GXdpTrashSkeleton structure contains only private data and should only be accessed using the provided API.
7456
 */
7457
7458
/**
7459
 * GXdpTrashSkeletonClass:
7460
 * @parent_class: The parent class.
7461
 *
7462
 * Class structure for #GXdpTrashSkeleton.
7463
 */
7464
7465
struct _GXdpTrashSkeletonPrivate
7466
{
7467
  GValue *properties;
7468
  GList *changed_properties;
7469
  GSource *changed_properties_idle_source;
7470
  GMainContext *context;
7471
  GMutex lock;
7472
};
7473
7474
static void
7475
_gxdp_trash_skeleton_handle_method_call (
7476
  GDBusConnection *connection G_GNUC_UNUSED,
7477
  const gchar *sender G_GNUC_UNUSED,
7478
  const gchar *object_path G_GNUC_UNUSED,
7479
  const gchar *interface_name,
7480
  const gchar *method_name,
7481
  GVariant *parameters,
7482
  GDBusMethodInvocation *invocation,
7483
  gpointer user_data)
7484
0
{
7485
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data);
7486
0
  _ExtendedGDBusMethodInfo *info;
7487
0
  GVariantIter iter;
7488
0
  GVariant *child;
7489
0
  GValue *paramv;
7490
0
  gsize num_params;
7491
0
  guint num_extra;
7492
0
  gsize n;
7493
0
  guint signal_id;
7494
0
  GValue return_value = G_VALUE_INIT;
7495
0
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
7496
0
  g_assert (info != NULL);
7497
0
  num_params = g_variant_n_children (parameters);
7498
0
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
7499
0
  n = 0;
7500
0
  g_value_init (&paramv[n], GXDP_TYPE_TRASH);
7501
0
  g_value_set_object (&paramv[n++], skeleton);
7502
0
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
7503
0
  g_value_set_object (&paramv[n++], invocation);
7504
0
  if (info->pass_fdlist)
7505
0
    {
7506
0
#ifdef G_OS_UNIX
7507
0
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
7508
0
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
7509
#else
7510
      g_assert_not_reached ();
7511
#endif
7512
0
    }
7513
0
  g_variant_iter_init (&iter, parameters);
7514
0
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
7515
0
    {
7516
0
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
7517
0
      if (arg_info->use_gvariant)
7518
0
        {
7519
0
          g_value_init (&paramv[n], G_TYPE_VARIANT);
7520
0
          g_value_set_variant (&paramv[n], child);
7521
0
          n++;
7522
0
        }
7523
0
      else
7524
0
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
7525
0
      g_variant_unref (child);
7526
0
    }
7527
0
  signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_TRASH);
7528
0
  g_value_init (&return_value, G_TYPE_BOOLEAN);
7529
0
  g_signal_emitv (paramv, signal_id, 0, &return_value);
7530
0
  if (!g_value_get_boolean (&return_value))
7531
0
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
7532
0
  g_value_unset (&return_value);
7533
0
  for (n = 0; n < num_params + num_extra; n++)
7534
0
    g_value_unset (&paramv[n]);
7535
0
  g_free (paramv);
7536
0
}
7537
7538
static GVariant *
7539
_gxdp_trash_skeleton_handle_get_property (
7540
  GDBusConnection *connection G_GNUC_UNUSED,
7541
  const gchar *sender G_GNUC_UNUSED,
7542
  const gchar *object_path G_GNUC_UNUSED,
7543
  const gchar *interface_name G_GNUC_UNUSED,
7544
  const gchar *property_name,
7545
  GError **error,
7546
  gpointer user_data)
7547
0
{
7548
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data);
7549
0
  GValue value = G_VALUE_INIT;
7550
0
  GParamSpec *pspec;
7551
0
  _ExtendedGDBusPropertyInfo *info;
7552
0
  GVariant *ret;
7553
0
  ret = NULL;
7554
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, property_name);
7555
0
  g_assert (info != NULL);
7556
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
7557
0
  if (pspec == NULL)
7558
0
    {
7559
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
7560
0
    }
7561
0
  else
7562
0
    {
7563
0
      g_value_init (&value, pspec->value_type);
7564
0
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
7565
0
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
7566
0
      g_value_unset (&value);
7567
0
    }
7568
0
  return ret;
7569
0
}
7570
7571
static gboolean
7572
_gxdp_trash_skeleton_handle_set_property (
7573
  GDBusConnection *connection G_GNUC_UNUSED,
7574
  const gchar *sender G_GNUC_UNUSED,
7575
  const gchar *object_path G_GNUC_UNUSED,
7576
  const gchar *interface_name G_GNUC_UNUSED,
7577
  const gchar *property_name,
7578
  GVariant *variant,
7579
  GError **error,
7580
  gpointer user_data)
7581
0
{
7582
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data);
7583
0
  GValue value = G_VALUE_INIT;
7584
0
  GParamSpec *pspec;
7585
0
  _ExtendedGDBusPropertyInfo *info;
7586
0
  gboolean ret;
7587
0
  ret = FALSE;
7588
0
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, property_name);
7589
0
  g_assert (info != NULL);
7590
0
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
7591
0
  if (pspec == NULL)
7592
0
    {
7593
0
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
7594
0
    }
7595
0
  else
7596
0
    {
7597
0
      if (info->use_gvariant)
7598
0
        g_value_set_variant (&value, variant);
7599
0
      else
7600
0
        g_dbus_gvariant_to_gvalue (variant, &value);
7601
0
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
7602
0
      g_value_unset (&value);
7603
0
      ret = TRUE;
7604
0
    }
7605
0
  return ret;
7606
0
}
7607
7608
static const GDBusInterfaceVTable _gxdp_trash_skeleton_vtable =
7609
{
7610
  _gxdp_trash_skeleton_handle_method_call,
7611
  _gxdp_trash_skeleton_handle_get_property,
7612
  _gxdp_trash_skeleton_handle_set_property,
7613
  {NULL}
7614
};
7615
7616
static GDBusInterfaceInfo *
7617
gxdp_trash_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
7618
0
{
7619
0
  return gxdp_trash_interface_info ();
7620
0
}
7621
7622
static GDBusInterfaceVTable *
7623
gxdp_trash_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
7624
0
{
7625
0
  return (GDBusInterfaceVTable *) &_gxdp_trash_skeleton_vtable;
7626
0
}
7627
7628
static GVariant *
7629
gxdp_trash_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
7630
0
{
7631
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (_skeleton);
7632
7633
0
  GVariantBuilder builder;
7634
0
  guint n;
7635
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
7636
0
  if (_gxdp_trash_interface_info.parent_struct.properties == NULL)
7637
0
    goto out;
7638
0
  for (n = 0; _gxdp_trash_interface_info.parent_struct.properties[n] != NULL; n++)
7639
0
    {
7640
0
      GDBusPropertyInfo *info = _gxdp_trash_interface_info.parent_struct.properties[n];
7641
0
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
7642
0
        {
7643
0
          GVariant *value;
7644
0
          value = _gxdp_trash_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.portal.Trash", info->name, NULL, skeleton);
7645
0
          if (value != NULL)
7646
0
            {
7647
0
              g_variant_take_ref (value);
7648
0
              g_variant_builder_add (&builder, "{sv}", info->name, value);
7649
0
              g_variant_unref (value);
7650
0
            }
7651
0
        }
7652
0
    }
7653
0
out:
7654
0
  return g_variant_builder_end (&builder);
7655
0
}
7656
7657
static gboolean _gxdp_trash_emit_changed (gpointer user_data);
7658
7659
static void
7660
gxdp_trash_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
7661
0
{
7662
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (_skeleton);
7663
0
  gboolean emit_changed = FALSE;
7664
7665
0
  g_mutex_lock (&skeleton->priv->lock);
7666
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
7667
0
    {
7668
0
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
7669
0
      skeleton->priv->changed_properties_idle_source = NULL;
7670
0
      emit_changed = TRUE;
7671
0
    }
7672
0
  g_mutex_unlock (&skeleton->priv->lock);
7673
7674
0
  if (emit_changed)
7675
0
    _gxdp_trash_emit_changed (skeleton);
7676
0
}
7677
7678
static void gxdp_trash_skeleton_iface_init (GXdpTrashIface *iface);
7679
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7680
G_DEFINE_TYPE_WITH_CODE (GXdpTrashSkeleton, gxdp_trash_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
7681
                         G_ADD_PRIVATE (GXdpTrashSkeleton)
7682
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_skeleton_iface_init))
7683
7684
#else
7685
G_DEFINE_TYPE_WITH_CODE (GXdpTrashSkeleton, gxdp_trash_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
7686
                         G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_skeleton_iface_init))
7687
7688
#endif
7689
static void
7690
gxdp_trash_skeleton_finalize (GObject *object)
7691
0
{
7692
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object);
7693
0
  guint n;
7694
0
  for (n = 0; n < 1; n++)
7695
0
    g_value_unset (&skeleton->priv->properties[n]);
7696
0
  g_free (skeleton->priv->properties);
7697
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
7698
0
  if (skeleton->priv->changed_properties_idle_source != NULL)
7699
0
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
7700
0
  g_main_context_unref (skeleton->priv->context);
7701
0
  g_mutex_clear (&skeleton->priv->lock);
7702
0
  G_OBJECT_CLASS (gxdp_trash_skeleton_parent_class)->finalize (object);
7703
0
}
7704
7705
static void
7706
gxdp_trash_skeleton_get_property (GObject      *object,
7707
  guint         prop_id,
7708
  GValue       *value,
7709
  GParamSpec   *pspec G_GNUC_UNUSED)
7710
0
{
7711
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object);
7712
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
7713
0
  g_mutex_lock (&skeleton->priv->lock);
7714
0
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
7715
0
  g_mutex_unlock (&skeleton->priv->lock);
7716
0
}
7717
7718
static gboolean
7719
_gxdp_trash_emit_changed (gpointer user_data)
7720
0
{
7721
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data);
7722
0
  GList *l;
7723
0
  GVariantBuilder builder;
7724
0
  GVariantBuilder invalidated_builder;
7725
0
  guint num_changes;
7726
7727
0
  g_mutex_lock (&skeleton->priv->lock);
7728
0
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
7729
0
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
7730
0
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
7731
0
    {
7732
0
      ChangedProperty *cp = l->data;
7733
0
      GVariant *variant;
7734
0
      const GValue *cur_value;
7735
7736
0
      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
7737
0
      if (!_g_value_equal (cur_value, &cp->orig_value))
7738
0
        {
7739
0
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
7740
0
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
7741
0
          g_variant_unref (variant);
7742
0
          num_changes++;
7743
0
        }
7744
0
    }
7745
0
  if (num_changes > 0)
7746
0
    {
7747
0
      GList *connections, *ll;
7748
0
      GVariant *signal_variant;
7749
0
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.Trash",
7750
0
                                           &builder, &invalidated_builder));
7751
0
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
7752
0
      for (ll = connections; ll != NULL; ll = ll->next)
7753
0
        {
7754
0
          GDBusConnection *connection = ll->data;
7755
7756
0
          g_dbus_connection_emit_signal (connection,
7757
0
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
7758
0
                                         "org.freedesktop.DBus.Properties",
7759
0
                                         "PropertiesChanged",
7760
0
                                         signal_variant,
7761
0
                                         NULL);
7762
0
        }
7763
0
      g_variant_unref (signal_variant);
7764
0
      g_list_free_full (connections, g_object_unref);
7765
0
    }
7766
0
  else
7767
0
    {
7768
0
      g_variant_builder_clear (&builder);
7769
0
      g_variant_builder_clear (&invalidated_builder);
7770
0
    }
7771
0
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
7772
0
  skeleton->priv->changed_properties = NULL;
7773
0
  skeleton->priv->changed_properties_idle_source = NULL;
7774
0
  g_mutex_unlock (&skeleton->priv->lock);
7775
0
  return FALSE;
7776
0
}
7777
7778
static void
7779
_gxdp_trash_schedule_emit_changed (GXdpTrashSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
7780
0
{
7781
0
  ChangedProperty *cp;
7782
0
  GList *l;
7783
0
  cp = NULL;
7784
0
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
7785
0
    {
7786
0
      ChangedProperty *i_cp = l->data;
7787
0
      if (i_cp->info == info)
7788
0
        {
7789
0
          cp = i_cp;
7790
0
          break;
7791
0
        }
7792
0
    }
7793
0
  if (cp == NULL)
7794
0
    {
7795
0
      cp = g_new0 (ChangedProperty, 1);
7796
0
      cp->prop_id = prop_id;
7797
0
      cp->info = info;
7798
0
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
7799
0
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
7800
0
      g_value_copy (orig_value, &cp->orig_value);
7801
0
    }
7802
0
}
7803
7804
static void
7805
gxdp_trash_skeleton_notify (GObject      *object,
7806
  GParamSpec *pspec G_GNUC_UNUSED)
7807
0
{
7808
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object);
7809
0
  g_mutex_lock (&skeleton->priv->lock);
7810
0
  if (skeleton->priv->changed_properties != NULL &&
7811
0
      skeleton->priv->changed_properties_idle_source == NULL)
7812
0
    {
7813
0
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
7814
0
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
7815
0
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_trash_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
7816
0
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_trash_emit_changed");
7817
0
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
7818
0
      g_source_unref (skeleton->priv->changed_properties_idle_source);
7819
0
    }
7820
0
  g_mutex_unlock (&skeleton->priv->lock);
7821
0
}
7822
7823
static void
7824
gxdp_trash_skeleton_set_property (GObject      *object,
7825
  guint         prop_id,
7826
  const GValue *value,
7827
  GParamSpec   *pspec)
7828
0
{
7829
0
  const _ExtendedGDBusPropertyInfo *info;
7830
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object);
7831
0
  g_assert (prop_id != 0 && prop_id - 1 < 1);
7832
0
  info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1];
7833
0
  g_mutex_lock (&skeleton->priv->lock);
7834
0
  g_object_freeze_notify (object);
7835
0
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
7836
0
    {
7837
0
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
7838
0
          info->emits_changed_signal)
7839
0
        _gxdp_trash_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
7840
0
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
7841
0
      g_object_notify_by_pspec (object, pspec);
7842
0
    }
7843
0
  g_mutex_unlock (&skeleton->priv->lock);
7844
0
  g_object_thaw_notify (object);
7845
0
}
7846
7847
static void
7848
gxdp_trash_skeleton_init (GXdpTrashSkeleton *skeleton)
7849
0
{
7850
0
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7851
0
  skeleton->priv = gxdp_trash_skeleton_get_instance_private (skeleton);
7852
#else
7853
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_TRASH_SKELETON, GXdpTrashSkeletonPrivate);
7854
#endif
7855
7856
0
  g_mutex_init (&skeleton->priv->lock);
7857
0
  skeleton->priv->context = g_main_context_ref_thread_default ();
7858
0
  skeleton->priv->properties = g_new0 (GValue, 1);
7859
0
  g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT);
7860
0
}
7861
7862
static guint 
7863
gxdp_trash_skeleton_get_version (GXdpTrash *object)
7864
0
{
7865
0
  GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object);
7866
0
  guint value;
7867
0
  g_mutex_lock (&skeleton->priv->lock);
7868
0
  value = g_value_get_uint (&(skeleton->priv->properties[0]));
7869
0
  g_mutex_unlock (&skeleton->priv->lock);
7870
0
  return value;
7871
0
}
7872
7873
static void
7874
gxdp_trash_skeleton_class_init (GXdpTrashSkeletonClass *klass)
7875
0
{
7876
0
  GObjectClass *gobject_class;
7877
0
  GDBusInterfaceSkeletonClass *skeleton_class;
7878
7879
0
  gobject_class = G_OBJECT_CLASS (klass);
7880
0
  gobject_class->finalize = gxdp_trash_skeleton_finalize;
7881
0
  gobject_class->get_property = gxdp_trash_skeleton_get_property;
7882
0
  gobject_class->set_property = gxdp_trash_skeleton_set_property;
7883
0
  gobject_class->notify       = gxdp_trash_skeleton_notify;
7884
7885
7886
0
  gxdp_trash_override_properties (gobject_class, 1);
7887
7888
0
  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
7889
0
  skeleton_class->get_info = gxdp_trash_skeleton_dbus_interface_get_info;
7890
0
  skeleton_class->get_properties = gxdp_trash_skeleton_dbus_interface_get_properties;
7891
0
  skeleton_class->flush = gxdp_trash_skeleton_dbus_interface_flush;
7892
0
  skeleton_class->get_vtable = gxdp_trash_skeleton_dbus_interface_get_vtable;
7893
7894
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
7895
  g_type_class_add_private (klass, sizeof (GXdpTrashSkeletonPrivate));
7896
#endif
7897
0
}
7898
7899
static void
7900
gxdp_trash_skeleton_iface_init (GXdpTrashIface *iface)
7901
0
{
7902
0
  iface->get_version = gxdp_trash_skeleton_get_version;
7903
0
}
7904
7905
/**
7906
 * gxdp_trash_skeleton_new:
7907
 *
7908
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link>.
7909
 *
7910
 * Returns: (transfer full) (type GXdpTrashSkeleton): The skeleton object.
7911
 */
7912
GXdpTrash *
7913
gxdp_trash_skeleton_new (void)
7914
0
{
7915
0
  return GXDP_TRASH (g_object_new (GXDP_TYPE_TRASH_SKELETON, NULL));
7916
0
}
7917