Coverage Report

Created: 2025-09-27 07:50

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