/work/meson/gio/xdp-dbus.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * This file is generated by gdbus-codegen, do not modify it. |
3 | | * |
4 | | * The license of this code is the same as for the D-Bus interface description |
5 | | * it was derived from. Note that it links to GLib, so must comply with the |
6 | | * LGPL linking clauses. |
7 | | */ |
8 | | |
9 | | #ifdef HAVE_CONFIG_H |
10 | | # include "config.h" |
11 | | #endif |
12 | | |
13 | | #include "xdp-dbus.h" |
14 | | |
15 | | #include <string.h> |
16 | | #ifdef G_OS_UNIX |
17 | | # include <gio/gunixfdlist.h> |
18 | | #endif |
19 | | |
20 | | #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 | | G_DEFINE_INTERFACE (GXdpDocuments, gxdp_documents, G_TYPE_OBJECT) |
1640 | | |
1641 | | static void |
1642 | | 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 | | G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsProxy, gxdp_documents_proxy, G_TYPE_DBUS_PROXY, |
3507 | | G_ADD_PRIVATE (GXdpDocumentsProxy) |
3508 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_proxy_iface_init)) |
3509 | | |
3510 | | #else |
3511 | | G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsProxy, gxdp_documents_proxy, G_TYPE_DBUS_PROXY, |
3512 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_proxy_iface_init)) |
3513 | | |
3514 | | #endif |
3515 | | static void |
3516 | | 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 (¶mv[0], GXDP_TYPE_DOCUMENTS); |
3609 | 0 | g_value_set_object (¶mv[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 (¶mv[n], G_TYPE_VARIANT); |
3618 | 0 | g_value_set_variant (¶mv[n], child); |
3619 | 0 | n++; |
3620 | 0 | } |
3621 | 0 | else |
3622 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[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 (¶mv[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 (¶mv[n], GXDP_TYPE_DOCUMENTS); |
3946 | 0 | g_value_set_object (¶mv[n++], skeleton); |
3947 | 0 | g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); |
3948 | 0 | g_value_set_object (¶mv[n++], invocation); |
3949 | 0 | if (info->pass_fdlist) |
3950 | 0 | { |
3951 | 0 | #ifdef G_OS_UNIX |
3952 | 0 | g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); |
3953 | 0 | g_value_set_object (¶mv[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 (¶mv[n], G_TYPE_VARIANT); |
3965 | 0 | g_value_set_variant (¶mv[n], child); |
3966 | 0 | n++; |
3967 | 0 | } |
3968 | 0 | else |
3969 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[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 (¶mv[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 | | G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsSkeleton, gxdp_documents_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
4130 | | G_ADD_PRIVATE (GXdpDocumentsSkeleton) |
4131 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_skeleton_iface_init)) |
4132 | | |
4133 | | #else |
4134 | | G_DEFINE_TYPE_WITH_CODE (GXdpDocumentsSkeleton, gxdp_documents_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
4135 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_DOCUMENTS, gxdp_documents_skeleton_iface_init)) |
4136 | | |
4137 | | #endif |
4138 | | static void |
4139 | | 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 (skeleton->priv->changed_properties_idle_source != NULL) |
4148 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
4149 | 0 | g_main_context_unref (skeleton->priv->context); |
4150 | 0 | g_mutex_clear (&skeleton->priv->lock); |
4151 | 0 | G_OBJECT_CLASS (gxdp_documents_skeleton_parent_class)->finalize (object); |
4152 | 0 | } |
4153 | | |
4154 | | static void |
4155 | | gxdp_documents_skeleton_get_property (GObject *object, |
4156 | | guint prop_id, |
4157 | | GValue *value, |
4158 | | GParamSpec *pspec G_GNUC_UNUSED) |
4159 | 0 | { |
4160 | 0 | GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); |
4161 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
4162 | 0 | g_mutex_lock (&skeleton->priv->lock); |
4163 | 0 | g_value_copy (&skeleton->priv->properties[prop_id - 1], value); |
4164 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
4165 | 0 | } |
4166 | | |
4167 | | static gboolean |
4168 | | _gxdp_documents_emit_changed (gpointer user_data) |
4169 | 0 | { |
4170 | 0 | GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (user_data); |
4171 | 0 | GList *l; |
4172 | 0 | GVariantBuilder builder; |
4173 | 0 | GVariantBuilder invalidated_builder; |
4174 | 0 | guint num_changes; |
4175 | |
|
4176 | 0 | g_mutex_lock (&skeleton->priv->lock); |
4177 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 |
4178 | 0 | g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); |
4179 | 0 | g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as")); |
4180 | | #else |
4181 | | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
4182 | | g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); |
4183 | | #endif |
4184 | 0 | for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) |
4185 | 0 | { |
4186 | 0 | ChangedProperty *cp = l->data; |
4187 | 0 | GVariant *variant; |
4188 | 0 | const GValue *cur_value; |
4189 | |
|
4190 | 0 | cur_value = &skeleton->priv->properties[cp->prop_id - 1]; |
4191 | 0 | if (!_g_value_equal (cur_value, &cp->orig_value)) |
4192 | 0 | { |
4193 | 0 | variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); |
4194 | 0 | g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); |
4195 | 0 | g_variant_unref (variant); |
4196 | 0 | num_changes++; |
4197 | 0 | } |
4198 | 0 | } |
4199 | 0 | if (num_changes > 0) |
4200 | 0 | { |
4201 | 0 | GList *connections, *ll; |
4202 | 0 | GVariant *signal_variant; |
4203 | 0 | signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.Documents", |
4204 | 0 | &builder, &invalidated_builder)); |
4205 | 0 | connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); |
4206 | 0 | for (ll = connections; ll != NULL; ll = ll->next) |
4207 | 0 | { |
4208 | 0 | GDBusConnection *connection = ll->data; |
4209 | |
|
4210 | 0 | g_dbus_connection_emit_signal (connection, |
4211 | 0 | NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), |
4212 | 0 | "org.freedesktop.DBus.Properties", |
4213 | 0 | "PropertiesChanged", |
4214 | 0 | signal_variant, |
4215 | 0 | NULL); |
4216 | 0 | } |
4217 | 0 | g_variant_unref (signal_variant); |
4218 | 0 | g_list_free_full (connections, g_object_unref); |
4219 | 0 | } |
4220 | 0 | else |
4221 | 0 | { |
4222 | 0 | g_variant_builder_clear (&builder); |
4223 | 0 | g_variant_builder_clear (&invalidated_builder); |
4224 | 0 | } |
4225 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
4226 | 0 | skeleton->priv->changed_properties = NULL; |
4227 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
4228 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
4229 | 0 | return FALSE; |
4230 | 0 | } |
4231 | | |
4232 | | static void |
4233 | | _gxdp_documents_schedule_emit_changed (GXdpDocumentsSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) |
4234 | 0 | { |
4235 | 0 | ChangedProperty *cp; |
4236 | 0 | GList *l; |
4237 | 0 | cp = NULL; |
4238 | 0 | for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) |
4239 | 0 | { |
4240 | 0 | ChangedProperty *i_cp = l->data; |
4241 | 0 | if (i_cp->info == info) |
4242 | 0 | { |
4243 | 0 | cp = i_cp; |
4244 | 0 | break; |
4245 | 0 | } |
4246 | 0 | } |
4247 | 0 | if (cp == NULL) |
4248 | 0 | { |
4249 | 0 | cp = g_new0 (ChangedProperty, 1); |
4250 | 0 | cp->prop_id = prop_id; |
4251 | 0 | cp->info = info; |
4252 | 0 | skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); |
4253 | 0 | g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); |
4254 | 0 | g_value_copy (orig_value, &cp->orig_value); |
4255 | 0 | } |
4256 | 0 | } |
4257 | | |
4258 | | static void |
4259 | | gxdp_documents_skeleton_notify (GObject *object, |
4260 | | GParamSpec *pspec G_GNUC_UNUSED) |
4261 | 0 | { |
4262 | 0 | GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); |
4263 | 0 | g_mutex_lock (&skeleton->priv->lock); |
4264 | 0 | if (skeleton->priv->changed_properties != NULL && |
4265 | 0 | skeleton->priv->changed_properties_idle_source == NULL) |
4266 | 0 | { |
4267 | 0 | skeleton->priv->changed_properties_idle_source = g_idle_source_new (); |
4268 | 0 | g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); |
4269 | 0 | g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_documents_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); |
4270 | 0 | g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_documents_emit_changed"); |
4271 | 0 | g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); |
4272 | 0 | g_source_unref (skeleton->priv->changed_properties_idle_source); |
4273 | 0 | } |
4274 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
4275 | 0 | } |
4276 | | |
4277 | | static void |
4278 | | gxdp_documents_skeleton_set_property (GObject *object, |
4279 | | guint prop_id, |
4280 | | const GValue *value, |
4281 | | GParamSpec *pspec) |
4282 | 0 | { |
4283 | 0 | const _ExtendedGDBusPropertyInfo *info; |
4284 | 0 | GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); |
4285 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
4286 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_documents_property_info_pointers[prop_id - 1]; |
4287 | 0 | g_mutex_lock (&skeleton->priv->lock); |
4288 | 0 | g_object_freeze_notify (object); |
4289 | 0 | if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) |
4290 | 0 | { |
4291 | 0 | if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && |
4292 | 0 | info->emits_changed_signal) |
4293 | 0 | _gxdp_documents_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); |
4294 | 0 | g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); |
4295 | 0 | g_object_notify_by_pspec (object, pspec); |
4296 | 0 | } |
4297 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
4298 | 0 | g_object_thaw_notify (object); |
4299 | 0 | } |
4300 | | |
4301 | | static void |
4302 | | gxdp_documents_skeleton_init (GXdpDocumentsSkeleton *skeleton) |
4303 | 0 | { |
4304 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
4305 | 0 | skeleton->priv = gxdp_documents_skeleton_get_instance_private (skeleton); |
4306 | | #else |
4307 | | skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_DOCUMENTS_SKELETON, GXdpDocumentsSkeletonPrivate); |
4308 | | #endif |
4309 | |
|
4310 | 0 | g_mutex_init (&skeleton->priv->lock); |
4311 | 0 | skeleton->priv->context = g_main_context_ref_thread_default (); |
4312 | 0 | skeleton->priv->properties = g_new0 (GValue, 1); |
4313 | 0 | g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT); |
4314 | 0 | } |
4315 | | |
4316 | | static guint |
4317 | | gxdp_documents_skeleton_get_version (GXdpDocuments *object) |
4318 | 0 | { |
4319 | 0 | GXdpDocumentsSkeleton *skeleton = GXDP_DOCUMENTS_SKELETON (object); |
4320 | 0 | guint value; |
4321 | 0 | g_mutex_lock (&skeleton->priv->lock); |
4322 | 0 | value = g_marshal_value_peek_uint (&(skeleton->priv->properties[0])); |
4323 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
4324 | 0 | return value; |
4325 | 0 | } |
4326 | | |
4327 | | static void |
4328 | | gxdp_documents_skeleton_class_init (GXdpDocumentsSkeletonClass *klass) |
4329 | 0 | { |
4330 | 0 | GObjectClass *gobject_class; |
4331 | 0 | GDBusInterfaceSkeletonClass *skeleton_class; |
4332 | |
|
4333 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
4334 | 0 | gobject_class->finalize = gxdp_documents_skeleton_finalize; |
4335 | 0 | gobject_class->get_property = gxdp_documents_skeleton_get_property; |
4336 | 0 | gobject_class->set_property = gxdp_documents_skeleton_set_property; |
4337 | 0 | gobject_class->notify = gxdp_documents_skeleton_notify; |
4338 | | |
4339 | |
|
4340 | 0 | gxdp_documents_override_properties (gobject_class, 1); |
4341 | |
|
4342 | 0 | skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); |
4343 | 0 | skeleton_class->get_info = gxdp_documents_skeleton_dbus_interface_get_info; |
4344 | 0 | skeleton_class->get_properties = gxdp_documents_skeleton_dbus_interface_get_properties; |
4345 | 0 | skeleton_class->flush = gxdp_documents_skeleton_dbus_interface_flush; |
4346 | 0 | skeleton_class->get_vtable = gxdp_documents_skeleton_dbus_interface_get_vtable; |
4347 | |
|
4348 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
4349 | | g_type_class_add_private (klass, sizeof (GXdpDocumentsSkeletonPrivate)); |
4350 | | #endif |
4351 | 0 | } |
4352 | | |
4353 | | static void |
4354 | | gxdp_documents_skeleton_iface_init (GXdpDocumentsIface *iface) |
4355 | 0 | { |
4356 | 0 | iface->get_version = gxdp_documents_skeleton_get_version; |
4357 | 0 | } |
4358 | | |
4359 | | /** |
4360 | | * gxdp_documents_skeleton_new: |
4361 | | * |
4362 | | * 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>. |
4363 | | * |
4364 | | * Returns: (transfer full) (type GXdpDocumentsSkeleton): The skeleton object. |
4365 | | */ |
4366 | | GXdpDocuments * |
4367 | | gxdp_documents_skeleton_new (void) |
4368 | 0 | { |
4369 | 0 | return GXDP_DOCUMENTS (g_object_new (GXDP_TYPE_DOCUMENTS_SKELETON, NULL)); |
4370 | 0 | } |
4371 | | |
4372 | | /* ------------------------------------------------------------------------ |
4373 | | * Code for interface org.freedesktop.portal.OpenURI |
4374 | | * ------------------------------------------------------------------------ |
4375 | | */ |
4376 | | |
4377 | | /** |
4378 | | * SECTION:GXdpOpenURI |
4379 | | * @title: GXdpOpenURI |
4380 | | * @short_description: Generated C code for the org.freedesktop.portal.OpenURI D-Bus interface |
4381 | | * |
4382 | | * 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. |
4383 | | */ |
4384 | | |
4385 | | /* ---- Introspection data for org.freedesktop.portal.OpenURI ---- */ |
4386 | | |
4387 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_parent_window = |
4388 | | { |
4389 | | { |
4390 | | -1, |
4391 | | (gchar *) "parent_window", |
4392 | | (gchar *) "s", |
4393 | | NULL |
4394 | | }, |
4395 | | FALSE |
4396 | | }; |
4397 | | |
4398 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_uri = |
4399 | | { |
4400 | | { |
4401 | | -1, |
4402 | | (gchar *) "uri", |
4403 | | (gchar *) "s", |
4404 | | NULL |
4405 | | }, |
4406 | | FALSE |
4407 | | }; |
4408 | | |
4409 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_IN_ARG_options = |
4410 | | { |
4411 | | { |
4412 | | -1, |
4413 | | (gchar *) "options", |
4414 | | (gchar *) "a{sv}", |
4415 | | NULL |
4416 | | }, |
4417 | | FALSE |
4418 | | }; |
4419 | | |
4420 | | static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_uri_IN_ARG_pointers[] = |
4421 | | { |
4422 | | &_gxdp_open_uri_method_info_open_uri_IN_ARG_parent_window.parent_struct, |
4423 | | &_gxdp_open_uri_method_info_open_uri_IN_ARG_uri.parent_struct, |
4424 | | &_gxdp_open_uri_method_info_open_uri_IN_ARG_options.parent_struct, |
4425 | | NULL |
4426 | | }; |
4427 | | |
4428 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_uri_OUT_ARG_handle = |
4429 | | { |
4430 | | { |
4431 | | -1, |
4432 | | (gchar *) "handle", |
4433 | | (gchar *) "o", |
4434 | | NULL |
4435 | | }, |
4436 | | FALSE |
4437 | | }; |
4438 | | |
4439 | | static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_uri_OUT_ARG_pointers[] = |
4440 | | { |
4441 | | &_gxdp_open_uri_method_info_open_uri_OUT_ARG_handle.parent_struct, |
4442 | | NULL |
4443 | | }; |
4444 | | |
4445 | | static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_uri = |
4446 | | { |
4447 | | { |
4448 | | -1, |
4449 | | (gchar *) "OpenURI", |
4450 | | (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_uri_IN_ARG_pointers, |
4451 | | (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_uri_OUT_ARG_pointers, |
4452 | | NULL |
4453 | | }, |
4454 | | "handle-open-uri", |
4455 | | FALSE |
4456 | | }; |
4457 | | |
4458 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_parent_window = |
4459 | | { |
4460 | | { |
4461 | | -1, |
4462 | | (gchar *) "parent_window", |
4463 | | (gchar *) "s", |
4464 | | NULL |
4465 | | }, |
4466 | | FALSE |
4467 | | }; |
4468 | | |
4469 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_fd = |
4470 | | { |
4471 | | { |
4472 | | -1, |
4473 | | (gchar *) "fd", |
4474 | | (gchar *) "h", |
4475 | | NULL |
4476 | | }, |
4477 | | FALSE |
4478 | | }; |
4479 | | |
4480 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_IN_ARG_options = |
4481 | | { |
4482 | | { |
4483 | | -1, |
4484 | | (gchar *) "options", |
4485 | | (gchar *) "a{sv}", |
4486 | | NULL |
4487 | | }, |
4488 | | FALSE |
4489 | | }; |
4490 | | |
4491 | | static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_file_IN_ARG_pointers[] = |
4492 | | { |
4493 | | &_gxdp_open_uri_method_info_open_file_IN_ARG_parent_window.parent_struct, |
4494 | | &_gxdp_open_uri_method_info_open_file_IN_ARG_fd.parent_struct, |
4495 | | &_gxdp_open_uri_method_info_open_file_IN_ARG_options.parent_struct, |
4496 | | NULL |
4497 | | }; |
4498 | | |
4499 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_file_OUT_ARG_handle = |
4500 | | { |
4501 | | { |
4502 | | -1, |
4503 | | (gchar *) "handle", |
4504 | | (gchar *) "o", |
4505 | | NULL |
4506 | | }, |
4507 | | FALSE |
4508 | | }; |
4509 | | |
4510 | | static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_file_OUT_ARG_pointers[] = |
4511 | | { |
4512 | | &_gxdp_open_uri_method_info_open_file_OUT_ARG_handle.parent_struct, |
4513 | | NULL |
4514 | | }; |
4515 | | |
4516 | | static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_file = |
4517 | | { |
4518 | | { |
4519 | | -1, |
4520 | | (gchar *) "OpenFile", |
4521 | | (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_file_IN_ARG_pointers, |
4522 | | (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_file_OUT_ARG_pointers, |
4523 | | NULL |
4524 | | }, |
4525 | | "handle-open-file", |
4526 | | TRUE |
4527 | | }; |
4528 | | |
4529 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_parent_window = |
4530 | | { |
4531 | | { |
4532 | | -1, |
4533 | | (gchar *) "parent_window", |
4534 | | (gchar *) "s", |
4535 | | NULL |
4536 | | }, |
4537 | | FALSE |
4538 | | }; |
4539 | | |
4540 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_fd = |
4541 | | { |
4542 | | { |
4543 | | -1, |
4544 | | (gchar *) "fd", |
4545 | | (gchar *) "h", |
4546 | | NULL |
4547 | | }, |
4548 | | FALSE |
4549 | | }; |
4550 | | |
4551 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_IN_ARG_options = |
4552 | | { |
4553 | | { |
4554 | | -1, |
4555 | | (gchar *) "options", |
4556 | | (gchar *) "a{sv}", |
4557 | | NULL |
4558 | | }, |
4559 | | FALSE |
4560 | | }; |
4561 | | |
4562 | | static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_directory_IN_ARG_pointers[] = |
4563 | | { |
4564 | | &_gxdp_open_uri_method_info_open_directory_IN_ARG_parent_window.parent_struct, |
4565 | | &_gxdp_open_uri_method_info_open_directory_IN_ARG_fd.parent_struct, |
4566 | | &_gxdp_open_uri_method_info_open_directory_IN_ARG_options.parent_struct, |
4567 | | NULL |
4568 | | }; |
4569 | | |
4570 | | static const _ExtendedGDBusArgInfo _gxdp_open_uri_method_info_open_directory_OUT_ARG_handle = |
4571 | | { |
4572 | | { |
4573 | | -1, |
4574 | | (gchar *) "handle", |
4575 | | (gchar *) "o", |
4576 | | NULL |
4577 | | }, |
4578 | | FALSE |
4579 | | }; |
4580 | | |
4581 | | static const GDBusArgInfo * const _gxdp_open_uri_method_info_open_directory_OUT_ARG_pointers[] = |
4582 | | { |
4583 | | &_gxdp_open_uri_method_info_open_directory_OUT_ARG_handle.parent_struct, |
4584 | | NULL |
4585 | | }; |
4586 | | |
4587 | | static const _ExtendedGDBusMethodInfo _gxdp_open_uri_method_info_open_directory = |
4588 | | { |
4589 | | { |
4590 | | -1, |
4591 | | (gchar *) "OpenDirectory", |
4592 | | (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_directory_IN_ARG_pointers, |
4593 | | (GDBusArgInfo **) &_gxdp_open_uri_method_info_open_directory_OUT_ARG_pointers, |
4594 | | NULL |
4595 | | }, |
4596 | | "handle-open-directory", |
4597 | | TRUE |
4598 | | }; |
4599 | | |
4600 | | static const GDBusMethodInfo * const _gxdp_open_uri_method_info_pointers[] = |
4601 | | { |
4602 | | &_gxdp_open_uri_method_info_open_uri.parent_struct, |
4603 | | &_gxdp_open_uri_method_info_open_file.parent_struct, |
4604 | | &_gxdp_open_uri_method_info_open_directory.parent_struct, |
4605 | | NULL |
4606 | | }; |
4607 | | |
4608 | | static const _ExtendedGDBusPropertyInfo _gxdp_open_uri_property_info_version = |
4609 | | { |
4610 | | { |
4611 | | -1, |
4612 | | (gchar *) "version", |
4613 | | (gchar *) "u", |
4614 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
4615 | | NULL |
4616 | | }, |
4617 | | "version", |
4618 | | FALSE, |
4619 | | TRUE |
4620 | | }; |
4621 | | |
4622 | | static const GDBusPropertyInfo * const _gxdp_open_uri_property_info_pointers[] = |
4623 | | { |
4624 | | &_gxdp_open_uri_property_info_version.parent_struct, |
4625 | | NULL |
4626 | | }; |
4627 | | |
4628 | | static const _ExtendedGDBusInterfaceInfo _gxdp_open_uri_interface_info = |
4629 | | { |
4630 | | { |
4631 | | -1, |
4632 | | (gchar *) "org.freedesktop.portal.OpenURI", |
4633 | | (GDBusMethodInfo **) &_gxdp_open_uri_method_info_pointers, |
4634 | | NULL, |
4635 | | (GDBusPropertyInfo **) &_gxdp_open_uri_property_info_pointers, |
4636 | | NULL |
4637 | | }, |
4638 | | "open-uri", |
4639 | | }; |
4640 | | |
4641 | | |
4642 | | /** |
4643 | | * gxdp_open_uri_interface_info: |
4644 | | * |
4645 | | * 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. |
4646 | | * |
4647 | | * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. |
4648 | | */ |
4649 | | GDBusInterfaceInfo * |
4650 | | gxdp_open_uri_interface_info (void) |
4651 | 0 | { |
4652 | 0 | return (GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct; |
4653 | 0 | } |
4654 | | |
4655 | | /** |
4656 | | * gxdp_open_uri_override_properties: |
4657 | | * @klass: The class structure for a #GObject derived class. |
4658 | | * @property_id_begin: The property id to assign to the first overridden property. |
4659 | | * |
4660 | | * Overrides all #GObject properties in the #GXdpOpenURI interface for a concrete class. |
4661 | | * The properties are overridden in the order they are defined. |
4662 | | * |
4663 | | * Returns: The last property id. |
4664 | | */ |
4665 | | guint |
4666 | | gxdp_open_uri_override_properties (GObjectClass *klass, guint property_id_begin) |
4667 | 0 | { |
4668 | 0 | g_object_class_override_property (klass, property_id_begin++, "version"); |
4669 | 0 | return property_id_begin - 1; |
4670 | 0 | } |
4671 | | |
4672 | | |
4673 | | inline static void |
4674 | | gxdp_open_uri_method_marshal_open_uri ( |
4675 | | GClosure *closure, |
4676 | | GValue *return_value, |
4677 | | unsigned int n_param_values, |
4678 | | const GValue *param_values, |
4679 | | void *invocation_hint, |
4680 | | void *marshal_data) |
4681 | 0 | { |
4682 | 0 | _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_STRING_VARIANT (closure, |
4683 | 0 | return_value, n_param_values, param_values, invocation_hint, marshal_data); |
4684 | 0 | } |
4685 | | |
4686 | | inline static void |
4687 | | gxdp_open_uri_method_marshal_open_file ( |
4688 | | GClosure *closure, |
4689 | | GValue *return_value, |
4690 | | unsigned int n_param_values, |
4691 | | const GValue *param_values, |
4692 | | void *invocation_hint, |
4693 | | void *marshal_data) |
4694 | 0 | { |
4695 | 0 | _g_dbus_codegen_marshal_BOOLEAN__OBJECT_OBJECT_STRING_VARIANT_VARIANT (closure, |
4696 | 0 | return_value, n_param_values, param_values, invocation_hint, marshal_data); |
4697 | 0 | } |
4698 | | |
4699 | | inline static void |
4700 | | gxdp_open_uri_method_marshal_open_directory ( |
4701 | | GClosure *closure, |
4702 | | GValue *return_value, |
4703 | | unsigned int n_param_values, |
4704 | | const GValue *param_values, |
4705 | | void *invocation_hint, |
4706 | | void *marshal_data) |
4707 | 0 | { |
4708 | 0 | _g_dbus_codegen_marshal_BOOLEAN__OBJECT_OBJECT_STRING_VARIANT_VARIANT (closure, |
4709 | 0 | return_value, n_param_values, param_values, invocation_hint, marshal_data); |
4710 | 0 | } |
4711 | | |
4712 | | |
4713 | | /** |
4714 | | * GXdpOpenURI: |
4715 | | * |
4716 | | * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>. |
4717 | | */ |
4718 | | |
4719 | | /** |
4720 | | * GXdpOpenURIIface: |
4721 | | * @parent_iface: The parent interface. |
4722 | | * @handle_open_directory: Handler for the #GXdpOpenURI::handle-open-directory signal. |
4723 | | * @handle_open_file: Handler for the #GXdpOpenURI::handle-open-file signal. |
4724 | | * @handle_open_uri: Handler for the #GXdpOpenURI::handle-open-uri signal. |
4725 | | * @get_version: Getter for the #GXdpOpenURI:version property. |
4726 | | * |
4727 | | * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>. |
4728 | | */ |
4729 | | |
4730 | | typedef GXdpOpenURIIface GXdpOpenURIInterface; |
4731 | | G_DEFINE_INTERFACE (GXdpOpenURI, gxdp_open_uri, G_TYPE_OBJECT) |
4732 | | |
4733 | | static void |
4734 | | gxdp_open_uri_default_init (GXdpOpenURIIface *iface) |
4735 | 0 | { |
4736 | | /* GObject signals for incoming D-Bus method calls: */ |
4737 | | /** |
4738 | | * GXdpOpenURI::handle-open-uri: |
4739 | | * @object: A #GXdpOpenURI. |
4740 | | * @invocation: A #GDBusMethodInvocation. |
4741 | | * @arg_parent_window: Argument passed by remote caller. |
4742 | | * @arg_uri: Argument passed by remote caller. |
4743 | | * @arg_options: Argument passed by remote caller. |
4744 | | * |
4745 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</link> D-Bus method. |
4746 | | * |
4747 | | * 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. |
4748 | | * |
4749 | | * 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. |
4750 | | */ |
4751 | 0 | g_signal_new ("handle-open-uri", |
4752 | 0 | G_TYPE_FROM_INTERFACE (iface), |
4753 | 0 | G_SIGNAL_RUN_LAST, |
4754 | 0 | G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_uri), |
4755 | 0 | g_signal_accumulator_true_handled, |
4756 | 0 | NULL, |
4757 | 0 | gxdp_open_uri_method_marshal_open_uri, |
4758 | 0 | G_TYPE_BOOLEAN, |
4759 | 0 | 4, |
4760 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT); |
4761 | | |
4762 | | /** |
4763 | | * GXdpOpenURI::handle-open-file: |
4764 | | * @object: A #GXdpOpenURI. |
4765 | | * @invocation: A #GDBusMethodInvocation. |
4766 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
4767 | | * @arg_parent_window: Argument passed by remote caller. |
4768 | | * @arg_fd: Argument passed by remote caller. |
4769 | | * @arg_options: Argument passed by remote caller. |
4770 | | * |
4771 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</link> D-Bus method. |
4772 | | * |
4773 | | * 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. |
4774 | | * |
4775 | | * 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. |
4776 | | */ |
4777 | 0 | g_signal_new ("handle-open-file", |
4778 | 0 | G_TYPE_FROM_INTERFACE (iface), |
4779 | 0 | G_SIGNAL_RUN_LAST, |
4780 | 0 | G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_file), |
4781 | 0 | g_signal_accumulator_true_handled, |
4782 | 0 | NULL, |
4783 | 0 | gxdp_open_uri_method_marshal_open_file, |
4784 | 0 | G_TYPE_BOOLEAN, |
4785 | 0 | 5, |
4786 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT); |
4787 | | |
4788 | | /** |
4789 | | * GXdpOpenURI::handle-open-directory: |
4790 | | * @object: A #GXdpOpenURI. |
4791 | | * @invocation: A #GDBusMethodInvocation. |
4792 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
4793 | | * @arg_parent_window: Argument passed by remote caller. |
4794 | | * @arg_fd: Argument passed by remote caller. |
4795 | | * @arg_options: Argument passed by remote caller. |
4796 | | * |
4797 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenDirectory">OpenDirectory()</link> D-Bus method. |
4798 | | * |
4799 | | * 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. |
4800 | | * |
4801 | | * 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. |
4802 | | */ |
4803 | 0 | g_signal_new ("handle-open-directory", |
4804 | 0 | G_TYPE_FROM_INTERFACE (iface), |
4805 | 0 | G_SIGNAL_RUN_LAST, |
4806 | 0 | G_STRUCT_OFFSET (GXdpOpenURIIface, handle_open_directory), |
4807 | 0 | g_signal_accumulator_true_handled, |
4808 | 0 | NULL, |
4809 | 0 | gxdp_open_uri_method_marshal_open_directory, |
4810 | 0 | G_TYPE_BOOLEAN, |
4811 | 0 | 5, |
4812 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT); |
4813 | | |
4814 | | /* GObject properties for D-Bus properties: */ |
4815 | | /** |
4816 | | * GXdpOpenURI:version: |
4817 | | * |
4818 | | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</link>. |
4819 | | * |
4820 | | * 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. |
4821 | | */ |
4822 | 0 | g_object_interface_install_property (iface, |
4823 | 0 | g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
4824 | 0 | } |
4825 | | |
4826 | | /** |
4827 | | * gxdp_open_uri_get_version: (skip) |
4828 | | * @object: A #GXdpOpenURI. |
4829 | | * |
4830 | | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</link> D-Bus property. |
4831 | | * |
4832 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
4833 | | * |
4834 | | * Returns: The property value. |
4835 | | */ |
4836 | | guint |
4837 | | gxdp_open_uri_get_version (GXdpOpenURI *object) |
4838 | 0 | { |
4839 | 0 | g_return_val_if_fail (GXDP_IS_OPEN_URI (object), 0); |
4840 | | |
4841 | 0 | return GXDP_OPEN_URI_GET_IFACE (object)->get_version (object); |
4842 | 0 | } |
4843 | | |
4844 | | /** |
4845 | | * gxdp_open_uri_set_version: (skip) |
4846 | | * @object: A #GXdpOpenURI. |
4847 | | * @value: The value to set. |
4848 | | * |
4849 | | * Sets the <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</link> D-Bus property to @value. |
4850 | | * |
4851 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
4852 | | */ |
4853 | | void |
4854 | | gxdp_open_uri_set_version (GXdpOpenURI *object, guint value) |
4855 | 0 | { |
4856 | 0 | g_object_set (G_OBJECT (object), "version", value, NULL); |
4857 | 0 | } |
4858 | | |
4859 | | /** |
4860 | | * gxdp_open_uri_call_open_uri: |
4861 | | * @proxy: A #GXdpOpenURIProxy. |
4862 | | * @arg_parent_window: Argument to pass with the method invocation. |
4863 | | * @arg_uri: Argument to pass with the method invocation. |
4864 | | * @arg_options: Argument to pass with the method invocation. |
4865 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
4866 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
4867 | | * @user_data: User data to pass to @callback. |
4868 | | * |
4869 | | * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</link> D-Bus method on @proxy. |
4870 | | * 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()). |
4871 | | * You can then call gxdp_open_uri_call_open_uri_finish() to get the result of the operation. |
4872 | | * |
4873 | | * See gxdp_open_uri_call_open_uri_sync() for the synchronous, blocking version of this method. |
4874 | | */ |
4875 | | void |
4876 | | gxdp_open_uri_call_open_uri ( |
4877 | | GXdpOpenURI *proxy, |
4878 | | const gchar *arg_parent_window, |
4879 | | const gchar *arg_uri, |
4880 | | GVariant *arg_options, |
4881 | | GCancellable *cancellable, |
4882 | | GAsyncReadyCallback callback, |
4883 | | gpointer user_data) |
4884 | 0 | { |
4885 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
4886 | 0 | "OpenURI", |
4887 | 0 | g_variant_new ("(ss@a{sv})", |
4888 | 0 | arg_parent_window, |
4889 | 0 | arg_uri, |
4890 | 0 | arg_options), |
4891 | 0 | G_DBUS_CALL_FLAGS_NONE, |
4892 | 0 | -1, |
4893 | 0 | cancellable, |
4894 | 0 | callback, |
4895 | 0 | user_data); |
4896 | 0 | } |
4897 | | |
4898 | | /** |
4899 | | * gxdp_open_uri_call_open_uri_finish: |
4900 | | * @proxy: A #GXdpOpenURIProxy. |
4901 | | * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. |
4902 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_uri(). |
4903 | | * @error: Return location for error or %NULL. |
4904 | | * |
4905 | | * Finishes an operation started with gxdp_open_uri_call_open_uri(). |
4906 | | * |
4907 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
4908 | | */ |
4909 | | gboolean |
4910 | | gxdp_open_uri_call_open_uri_finish ( |
4911 | | GXdpOpenURI *proxy, |
4912 | | gchar **out_handle, |
4913 | | GAsyncResult *res, |
4914 | | GError **error) |
4915 | 0 | { |
4916 | 0 | GVariant *_ret; |
4917 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
4918 | 0 | if (_ret == NULL) |
4919 | 0 | goto _out; |
4920 | 0 | g_variant_get (_ret, |
4921 | 0 | "(o)", |
4922 | 0 | out_handle); |
4923 | 0 | g_variant_unref (_ret); |
4924 | 0 | _out: |
4925 | 0 | return _ret != NULL; |
4926 | 0 | } |
4927 | | |
4928 | | /** |
4929 | | * gxdp_open_uri_call_open_uri_sync: |
4930 | | * @proxy: A #GXdpOpenURIProxy. |
4931 | | * @arg_parent_window: Argument to pass with the method invocation. |
4932 | | * @arg_uri: Argument to pass with the method invocation. |
4933 | | * @arg_options: Argument to pass with the method invocation. |
4934 | | * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. |
4935 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
4936 | | * @error: Return location for error or %NULL. |
4937 | | * |
4938 | | * 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. |
4939 | | * |
4940 | | * See gxdp_open_uri_call_open_uri() for the asynchronous version of this method. |
4941 | | * |
4942 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
4943 | | */ |
4944 | | gboolean |
4945 | | gxdp_open_uri_call_open_uri_sync ( |
4946 | | GXdpOpenURI *proxy, |
4947 | | const gchar *arg_parent_window, |
4948 | | const gchar *arg_uri, |
4949 | | GVariant *arg_options, |
4950 | | gchar **out_handle, |
4951 | | GCancellable *cancellable, |
4952 | | GError **error) |
4953 | 0 | { |
4954 | 0 | GVariant *_ret; |
4955 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
4956 | 0 | "OpenURI", |
4957 | 0 | g_variant_new ("(ss@a{sv})", |
4958 | 0 | arg_parent_window, |
4959 | 0 | arg_uri, |
4960 | 0 | arg_options), |
4961 | 0 | G_DBUS_CALL_FLAGS_NONE, |
4962 | 0 | -1, |
4963 | 0 | cancellable, |
4964 | 0 | error); |
4965 | 0 | if (_ret == NULL) |
4966 | 0 | goto _out; |
4967 | 0 | g_variant_get (_ret, |
4968 | 0 | "(o)", |
4969 | 0 | out_handle); |
4970 | 0 | g_variant_unref (_ret); |
4971 | 0 | _out: |
4972 | 0 | return _ret != NULL; |
4973 | 0 | } |
4974 | | |
4975 | | /** |
4976 | | * gxdp_open_uri_call_open_file: |
4977 | | * @proxy: A #GXdpOpenURIProxy. |
4978 | | * @arg_parent_window: Argument to pass with the method invocation. |
4979 | | * @arg_fd: Argument to pass with the method invocation. |
4980 | | * @arg_options: Argument to pass with the method invocation. |
4981 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
4982 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
4983 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
4984 | | * @user_data: User data to pass to @callback. |
4985 | | * |
4986 | | * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</link> D-Bus method on @proxy. |
4987 | | * 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()). |
4988 | | * You can then call gxdp_open_uri_call_open_file_finish() to get the result of the operation. |
4989 | | * |
4990 | | * See gxdp_open_uri_call_open_file_sync() for the synchronous, blocking version of this method. |
4991 | | */ |
4992 | | void |
4993 | | gxdp_open_uri_call_open_file ( |
4994 | | GXdpOpenURI *proxy, |
4995 | | const gchar *arg_parent_window, |
4996 | | GVariant *arg_fd, |
4997 | | GVariant *arg_options, |
4998 | | GUnixFDList *fd_list, |
4999 | | GCancellable *cancellable, |
5000 | | GAsyncReadyCallback callback, |
5001 | | gpointer user_data) |
5002 | 0 | { |
5003 | 0 | g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), |
5004 | 0 | "OpenFile", |
5005 | 0 | g_variant_new ("(s@h@a{sv})", |
5006 | 0 | arg_parent_window, |
5007 | 0 | arg_fd, |
5008 | 0 | arg_options), |
5009 | 0 | G_DBUS_CALL_FLAGS_NONE, |
5010 | 0 | -1, |
5011 | 0 | fd_list, |
5012 | 0 | cancellable, |
5013 | 0 | callback, |
5014 | 0 | user_data); |
5015 | 0 | } |
5016 | | |
5017 | | /** |
5018 | | * gxdp_open_uri_call_open_file_finish: |
5019 | | * @proxy: A #GXdpOpenURIProxy. |
5020 | | * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. |
5021 | | * @out_fd_list: (out) (optional) (nullable): Return location for a #GUnixFDList or %NULL to ignore. |
5022 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_file(). |
5023 | | * @error: Return location for error or %NULL. |
5024 | | * |
5025 | | * Finishes an operation started with gxdp_open_uri_call_open_file(). |
5026 | | * |
5027 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
5028 | | */ |
5029 | | gboolean |
5030 | | gxdp_open_uri_call_open_file_finish ( |
5031 | | GXdpOpenURI *proxy, |
5032 | | gchar **out_handle, |
5033 | | GUnixFDList **out_fd_list, |
5034 | | GAsyncResult *res, |
5035 | | GError **error) |
5036 | 0 | { |
5037 | 0 | GVariant *_ret; |
5038 | 0 | _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); |
5039 | 0 | if (_ret == NULL) |
5040 | 0 | goto _out; |
5041 | 0 | g_variant_get (_ret, |
5042 | 0 | "(o)", |
5043 | 0 | out_handle); |
5044 | 0 | g_variant_unref (_ret); |
5045 | 0 | _out: |
5046 | 0 | return _ret != NULL; |
5047 | 0 | } |
5048 | | |
5049 | | /** |
5050 | | * gxdp_open_uri_call_open_file_sync: |
5051 | | * @proxy: A #GXdpOpenURIProxy. |
5052 | | * @arg_parent_window: Argument to pass with the method invocation. |
5053 | | * @arg_fd: Argument to pass with the method invocation. |
5054 | | * @arg_options: Argument to pass with the method invocation. |
5055 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
5056 | | * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. |
5057 | | * @out_fd_list: (out) (optional) (nullable): Return location for a #GUnixFDList or %NULL. |
5058 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
5059 | | * @error: Return location for error or %NULL. |
5060 | | * |
5061 | | * 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. |
5062 | | * |
5063 | | * See gxdp_open_uri_call_open_file() for the asynchronous version of this method. |
5064 | | * |
5065 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
5066 | | */ |
5067 | | gboolean |
5068 | | gxdp_open_uri_call_open_file_sync ( |
5069 | | GXdpOpenURI *proxy, |
5070 | | const gchar *arg_parent_window, |
5071 | | GVariant *arg_fd, |
5072 | | GVariant *arg_options, |
5073 | | GUnixFDList *fd_list, |
5074 | | gchar **out_handle, |
5075 | | GUnixFDList **out_fd_list, |
5076 | | GCancellable *cancellable, |
5077 | | GError **error) |
5078 | 0 | { |
5079 | 0 | GVariant *_ret; |
5080 | 0 | _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), |
5081 | 0 | "OpenFile", |
5082 | 0 | g_variant_new ("(s@h@a{sv})", |
5083 | 0 | arg_parent_window, |
5084 | 0 | arg_fd, |
5085 | 0 | arg_options), |
5086 | 0 | G_DBUS_CALL_FLAGS_NONE, |
5087 | 0 | -1, |
5088 | 0 | fd_list, |
5089 | 0 | out_fd_list, |
5090 | 0 | cancellable, |
5091 | 0 | error); |
5092 | 0 | if (_ret == NULL) |
5093 | 0 | goto _out; |
5094 | 0 | g_variant_get (_ret, |
5095 | 0 | "(o)", |
5096 | 0 | out_handle); |
5097 | 0 | g_variant_unref (_ret); |
5098 | 0 | _out: |
5099 | 0 | return _ret != NULL; |
5100 | 0 | } |
5101 | | |
5102 | | /** |
5103 | | * gxdp_open_uri_call_open_directory: |
5104 | | * @proxy: A #GXdpOpenURIProxy. |
5105 | | * @arg_parent_window: Argument to pass with the method invocation. |
5106 | | * @arg_fd: Argument to pass with the method invocation. |
5107 | | * @arg_options: Argument to pass with the method invocation. |
5108 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
5109 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
5110 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
5111 | | * @user_data: User data to pass to @callback. |
5112 | | * |
5113 | | * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenDirectory">OpenDirectory()</link> D-Bus method on @proxy. |
5114 | | * 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()). |
5115 | | * You can then call gxdp_open_uri_call_open_directory_finish() to get the result of the operation. |
5116 | | * |
5117 | | * See gxdp_open_uri_call_open_directory_sync() for the synchronous, blocking version of this method. |
5118 | | */ |
5119 | | void |
5120 | | gxdp_open_uri_call_open_directory ( |
5121 | | GXdpOpenURI *proxy, |
5122 | | const gchar *arg_parent_window, |
5123 | | GVariant *arg_fd, |
5124 | | GVariant *arg_options, |
5125 | | GUnixFDList *fd_list, |
5126 | | GCancellable *cancellable, |
5127 | | GAsyncReadyCallback callback, |
5128 | | gpointer user_data) |
5129 | 0 | { |
5130 | 0 | g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), |
5131 | 0 | "OpenDirectory", |
5132 | 0 | g_variant_new ("(s@h@a{sv})", |
5133 | 0 | arg_parent_window, |
5134 | 0 | arg_fd, |
5135 | 0 | arg_options), |
5136 | 0 | G_DBUS_CALL_FLAGS_NONE, |
5137 | 0 | -1, |
5138 | 0 | fd_list, |
5139 | 0 | cancellable, |
5140 | 0 | callback, |
5141 | 0 | user_data); |
5142 | 0 | } |
5143 | | |
5144 | | /** |
5145 | | * gxdp_open_uri_call_open_directory_finish: |
5146 | | * @proxy: A #GXdpOpenURIProxy. |
5147 | | * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. |
5148 | | * @out_fd_list: (out) (optional) (nullable): Return location for a #GUnixFDList or %NULL to ignore. |
5149 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_directory(). |
5150 | | * @error: Return location for error or %NULL. |
5151 | | * |
5152 | | * Finishes an operation started with gxdp_open_uri_call_open_directory(). |
5153 | | * |
5154 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
5155 | | */ |
5156 | | gboolean |
5157 | | gxdp_open_uri_call_open_directory_finish ( |
5158 | | GXdpOpenURI *proxy, |
5159 | | gchar **out_handle, |
5160 | | GUnixFDList **out_fd_list, |
5161 | | GAsyncResult *res, |
5162 | | GError **error) |
5163 | 0 | { |
5164 | 0 | GVariant *_ret; |
5165 | 0 | _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); |
5166 | 0 | if (_ret == NULL) |
5167 | 0 | goto _out; |
5168 | 0 | g_variant_get (_ret, |
5169 | 0 | "(o)", |
5170 | 0 | out_handle); |
5171 | 0 | g_variant_unref (_ret); |
5172 | 0 | _out: |
5173 | 0 | return _ret != NULL; |
5174 | 0 | } |
5175 | | |
5176 | | /** |
5177 | | * gxdp_open_uri_call_open_directory_sync: |
5178 | | * @proxy: A #GXdpOpenURIProxy. |
5179 | | * @arg_parent_window: Argument to pass with the method invocation. |
5180 | | * @arg_fd: Argument to pass with the method invocation. |
5181 | | * @arg_options: Argument to pass with the method invocation. |
5182 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
5183 | | * @out_handle: (out) (optional): Return location for return parameter or %NULL to ignore. |
5184 | | * @out_fd_list: (out) (optional) (nullable): Return location for a #GUnixFDList or %NULL. |
5185 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
5186 | | * @error: Return location for error or %NULL. |
5187 | | * |
5188 | | * 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. |
5189 | | * |
5190 | | * See gxdp_open_uri_call_open_directory() for the asynchronous version of this method. |
5191 | | * |
5192 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
5193 | | */ |
5194 | | gboolean |
5195 | | gxdp_open_uri_call_open_directory_sync ( |
5196 | | GXdpOpenURI *proxy, |
5197 | | const gchar *arg_parent_window, |
5198 | | GVariant *arg_fd, |
5199 | | GVariant *arg_options, |
5200 | | GUnixFDList *fd_list, |
5201 | | gchar **out_handle, |
5202 | | GUnixFDList **out_fd_list, |
5203 | | GCancellable *cancellable, |
5204 | | GError **error) |
5205 | 0 | { |
5206 | 0 | GVariant *_ret; |
5207 | 0 | _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), |
5208 | 0 | "OpenDirectory", |
5209 | 0 | g_variant_new ("(s@h@a{sv})", |
5210 | 0 | arg_parent_window, |
5211 | 0 | arg_fd, |
5212 | 0 | arg_options), |
5213 | 0 | G_DBUS_CALL_FLAGS_NONE, |
5214 | 0 | -1, |
5215 | 0 | fd_list, |
5216 | 0 | out_fd_list, |
5217 | 0 | cancellable, |
5218 | 0 | error); |
5219 | 0 | if (_ret == NULL) |
5220 | 0 | goto _out; |
5221 | 0 | g_variant_get (_ret, |
5222 | 0 | "(o)", |
5223 | 0 | out_handle); |
5224 | 0 | g_variant_unref (_ret); |
5225 | 0 | _out: |
5226 | 0 | return _ret != NULL; |
5227 | 0 | } |
5228 | | |
5229 | | /** |
5230 | | * gxdp_open_uri_complete_open_uri: |
5231 | | * @object: A #GXdpOpenURI. |
5232 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
5233 | | * @handle: Parameter to return. |
5234 | | * |
5235 | | * 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. |
5236 | | * |
5237 | | * This method will free @invocation, you cannot use it afterwards. |
5238 | | */ |
5239 | | void |
5240 | | gxdp_open_uri_complete_open_uri ( |
5241 | | GXdpOpenURI *object G_GNUC_UNUSED, |
5242 | | GDBusMethodInvocation *invocation, |
5243 | | const gchar *handle) |
5244 | 0 | { |
5245 | 0 | g_dbus_method_invocation_return_value (invocation, |
5246 | 0 | g_variant_new ("(o)", |
5247 | 0 | handle)); |
5248 | 0 | } |
5249 | | |
5250 | | /** |
5251 | | * gxdp_open_uri_complete_open_file: |
5252 | | * @object: A #GXdpOpenURI. |
5253 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
5254 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
5255 | | * @handle: Parameter to return. |
5256 | | * |
5257 | | * 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. |
5258 | | * |
5259 | | * This method will free @invocation, you cannot use it afterwards. |
5260 | | */ |
5261 | | void |
5262 | | gxdp_open_uri_complete_open_file ( |
5263 | | GXdpOpenURI *object G_GNUC_UNUSED, |
5264 | | GDBusMethodInvocation *invocation, |
5265 | | GUnixFDList *fd_list, |
5266 | | const gchar *handle) |
5267 | 0 | { |
5268 | 0 | g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, |
5269 | 0 | g_variant_new ("(o)", |
5270 | 0 | handle), |
5271 | 0 | fd_list); |
5272 | 0 | } |
5273 | | |
5274 | | /** |
5275 | | * gxdp_open_uri_complete_open_directory: |
5276 | | * @object: A #GXdpOpenURI. |
5277 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
5278 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
5279 | | * @handle: Parameter to return. |
5280 | | * |
5281 | | * 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. |
5282 | | * |
5283 | | * This method will free @invocation, you cannot use it afterwards. |
5284 | | */ |
5285 | | void |
5286 | | gxdp_open_uri_complete_open_directory ( |
5287 | | GXdpOpenURI *object G_GNUC_UNUSED, |
5288 | | GDBusMethodInvocation *invocation, |
5289 | | GUnixFDList *fd_list, |
5290 | | const gchar *handle) |
5291 | 0 | { |
5292 | 0 | g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, |
5293 | 0 | g_variant_new ("(o)", |
5294 | 0 | handle), |
5295 | 0 | fd_list); |
5296 | 0 | } |
5297 | | |
5298 | | /* ------------------------------------------------------------------------ */ |
5299 | | |
5300 | | /** |
5301 | | * GXdpOpenURIProxy: |
5302 | | * |
5303 | | * The #GXdpOpenURIProxy structure contains only private data and should only be accessed using the provided API. |
5304 | | */ |
5305 | | |
5306 | | /** |
5307 | | * GXdpOpenURIProxyClass: |
5308 | | * @parent_class: The parent class. |
5309 | | * |
5310 | | * Class structure for #GXdpOpenURIProxy. |
5311 | | */ |
5312 | | |
5313 | | struct _GXdpOpenURIProxyPrivate |
5314 | | { |
5315 | | GData *qdata; |
5316 | | }; |
5317 | | |
5318 | | static void gxdp_open_uri_proxy_iface_init (GXdpOpenURIIface *iface); |
5319 | | |
5320 | | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
5321 | | G_DEFINE_TYPE_WITH_CODE (GXdpOpenURIProxy, gxdp_open_uri_proxy, G_TYPE_DBUS_PROXY, |
5322 | | G_ADD_PRIVATE (GXdpOpenURIProxy) |
5323 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_proxy_iface_init)) |
5324 | | |
5325 | | #else |
5326 | | G_DEFINE_TYPE_WITH_CODE (GXdpOpenURIProxy, gxdp_open_uri_proxy, G_TYPE_DBUS_PROXY, |
5327 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_proxy_iface_init)) |
5328 | | |
5329 | | #endif |
5330 | | static void |
5331 | | gxdp_open_uri_proxy_finalize (GObject *object) |
5332 | 0 | { |
5333 | 0 | GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (object); |
5334 | 0 | g_datalist_clear (&proxy->priv->qdata); |
5335 | 0 | G_OBJECT_CLASS (gxdp_open_uri_proxy_parent_class)->finalize (object); |
5336 | 0 | } |
5337 | | |
5338 | | static void |
5339 | | gxdp_open_uri_proxy_get_property (GObject *object, |
5340 | | guint prop_id, |
5341 | | GValue *value, |
5342 | | GParamSpec *pspec G_GNUC_UNUSED) |
5343 | 0 | { |
5344 | 0 | const _ExtendedGDBusPropertyInfo *info; |
5345 | 0 | GVariant *variant; |
5346 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
5347 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1]; |
5348 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); |
5349 | 0 | if (info->use_gvariant) |
5350 | 0 | { |
5351 | 0 | g_value_set_variant (value, variant); |
5352 | 0 | } |
5353 | 0 | else |
5354 | 0 | { |
5355 | 0 | if (variant != NULL) |
5356 | 0 | g_dbus_gvariant_to_gvalue (variant, value); |
5357 | 0 | } |
5358 | 0 | if (variant != NULL) |
5359 | 0 | g_variant_unref (variant); |
5360 | 0 | } |
5361 | | |
5362 | | static void |
5363 | | gxdp_open_uri_proxy_set_property_cb (GDBusProxy *proxy, |
5364 | | GAsyncResult *res, |
5365 | | gpointer user_data) |
5366 | 0 | { |
5367 | 0 | const _ExtendedGDBusPropertyInfo *info = user_data; |
5368 | 0 | GError *error; |
5369 | 0 | GVariant *_ret; |
5370 | 0 | error = NULL; |
5371 | 0 | _ret = g_dbus_proxy_call_finish (proxy, res, &error); |
5372 | 0 | if (!_ret) |
5373 | 0 | { |
5374 | 0 | g_warning ("Error setting property '%s' on interface org.freedesktop.portal.OpenURI: %s (%s, %d)", |
5375 | 0 | info->parent_struct.name, |
5376 | 0 | error->message, g_quark_to_string (error->domain), error->code); |
5377 | 0 | g_error_free (error); |
5378 | 0 | } |
5379 | 0 | else |
5380 | 0 | { |
5381 | 0 | g_variant_unref (_ret); |
5382 | 0 | } |
5383 | 0 | } |
5384 | | |
5385 | | static void |
5386 | | gxdp_open_uri_proxy_set_property (GObject *object, |
5387 | | guint prop_id, |
5388 | | const GValue *value, |
5389 | | GParamSpec *pspec G_GNUC_UNUSED) |
5390 | 0 | { |
5391 | 0 | const _ExtendedGDBusPropertyInfo *info; |
5392 | 0 | GVariant *variant; |
5393 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
5394 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1]; |
5395 | 0 | variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); |
5396 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (object), |
5397 | 0 | "org.freedesktop.DBus.Properties.Set", |
5398 | 0 | g_variant_new ("(ssv)", "org.freedesktop.portal.OpenURI", info->parent_struct.name, variant), |
5399 | 0 | G_DBUS_CALL_FLAGS_NONE, |
5400 | 0 | -1, |
5401 | 0 | NULL, (GAsyncReadyCallback) gxdp_open_uri_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); |
5402 | 0 | g_variant_unref (variant); |
5403 | 0 | } |
5404 | | |
5405 | | static void |
5406 | | gxdp_open_uri_proxy_g_signal (GDBusProxy *proxy, |
5407 | | const gchar *sender_name G_GNUC_UNUSED, |
5408 | | const gchar *signal_name, |
5409 | | GVariant *parameters) |
5410 | 0 | { |
5411 | 0 | _ExtendedGDBusSignalInfo *info; |
5412 | 0 | GVariantIter iter; |
5413 | 0 | GVariant *child; |
5414 | 0 | GValue *paramv; |
5415 | 0 | gsize num_params; |
5416 | 0 | gsize n; |
5417 | 0 | guint signal_id; |
5418 | 0 | info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, signal_name); |
5419 | 0 | if (info == NULL) |
5420 | 0 | return; |
5421 | 0 | num_params = g_variant_n_children (parameters); |
5422 | 0 | paramv = g_new0 (GValue, num_params + 1); |
5423 | 0 | g_value_init (¶mv[0], GXDP_TYPE_OPEN_URI); |
5424 | 0 | g_value_set_object (¶mv[0], proxy); |
5425 | 0 | g_variant_iter_init (&iter, parameters); |
5426 | 0 | n = 1; |
5427 | 0 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
5428 | 0 | { |
5429 | 0 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; |
5430 | 0 | if (arg_info->use_gvariant) |
5431 | 0 | { |
5432 | 0 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
5433 | 0 | g_value_set_variant (¶mv[n], child); |
5434 | 0 | n++; |
5435 | 0 | } |
5436 | 0 | else |
5437 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
5438 | 0 | g_variant_unref (child); |
5439 | 0 | } |
5440 | 0 | signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_OPEN_URI); |
5441 | 0 | g_signal_emitv (paramv, signal_id, 0, NULL); |
5442 | 0 | for (n = 0; n < num_params + 1; n++) |
5443 | 0 | g_value_unset (¶mv[n]); |
5444 | 0 | g_free (paramv); |
5445 | 0 | } |
5446 | | |
5447 | | static void |
5448 | | gxdp_open_uri_proxy_g_properties_changed (GDBusProxy *_proxy, |
5449 | | GVariant *changed_properties, |
5450 | | const gchar *const *invalidated_properties) |
5451 | 0 | { |
5452 | 0 | GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (_proxy); |
5453 | 0 | guint n; |
5454 | 0 | const gchar *key; |
5455 | 0 | GVariantIter *iter; |
5456 | 0 | _ExtendedGDBusPropertyInfo *info; |
5457 | 0 | g_variant_get (changed_properties, "a{sv}", &iter); |
5458 | 0 | while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) |
5459 | 0 | { |
5460 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, key); |
5461 | 0 | g_datalist_remove_data (&proxy->priv->qdata, key); |
5462 | 0 | if (info != NULL) |
5463 | 0 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
5464 | 0 | } |
5465 | 0 | g_variant_iter_free (iter); |
5466 | 0 | for (n = 0; invalidated_properties[n] != NULL; n++) |
5467 | 0 | { |
5468 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, invalidated_properties[n]); |
5469 | 0 | g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); |
5470 | 0 | if (info != NULL) |
5471 | 0 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
5472 | 0 | } |
5473 | 0 | } |
5474 | | |
5475 | | static guint |
5476 | | gxdp_open_uri_proxy_get_version (GXdpOpenURI *object) |
5477 | 0 | { |
5478 | 0 | GXdpOpenURIProxy *proxy = GXDP_OPEN_URI_PROXY (object); |
5479 | 0 | GVariant *variant; |
5480 | 0 | guint value = 0; |
5481 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version"); |
5482 | 0 | if (variant != NULL) |
5483 | 0 | { |
5484 | 0 | value = g_variant_get_uint32 (variant); |
5485 | 0 | g_variant_unref (variant); |
5486 | 0 | } |
5487 | 0 | return value; |
5488 | 0 | } |
5489 | | |
5490 | | static void |
5491 | | gxdp_open_uri_proxy_init (GXdpOpenURIProxy *proxy) |
5492 | 0 | { |
5493 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
5494 | 0 | proxy->priv = gxdp_open_uri_proxy_get_instance_private (proxy); |
5495 | | #else |
5496 | | proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_OPEN_URI_PROXY, GXdpOpenURIProxyPrivate); |
5497 | | #endif |
5498 | |
|
5499 | 0 | g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_open_uri_interface_info ()); |
5500 | 0 | } |
5501 | | |
5502 | | static void |
5503 | | gxdp_open_uri_proxy_class_init (GXdpOpenURIProxyClass *klass) |
5504 | 0 | { |
5505 | 0 | GObjectClass *gobject_class; |
5506 | 0 | GDBusProxyClass *proxy_class; |
5507 | |
|
5508 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
5509 | 0 | gobject_class->finalize = gxdp_open_uri_proxy_finalize; |
5510 | 0 | gobject_class->get_property = gxdp_open_uri_proxy_get_property; |
5511 | 0 | gobject_class->set_property = gxdp_open_uri_proxy_set_property; |
5512 | |
|
5513 | 0 | proxy_class = G_DBUS_PROXY_CLASS (klass); |
5514 | 0 | proxy_class->g_signal = gxdp_open_uri_proxy_g_signal; |
5515 | 0 | proxy_class->g_properties_changed = gxdp_open_uri_proxy_g_properties_changed; |
5516 | |
|
5517 | 0 | gxdp_open_uri_override_properties (gobject_class, 1); |
5518 | |
|
5519 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
5520 | | g_type_class_add_private (klass, sizeof (GXdpOpenURIProxyPrivate)); |
5521 | | #endif |
5522 | 0 | } |
5523 | | |
5524 | | static void |
5525 | | gxdp_open_uri_proxy_iface_init (GXdpOpenURIIface *iface) |
5526 | 0 | { |
5527 | 0 | iface->get_version = gxdp_open_uri_proxy_get_version; |
5528 | 0 | } |
5529 | | |
5530 | | /** |
5531 | | * gxdp_open_uri_proxy_new: |
5532 | | * @connection: A #GDBusConnection. |
5533 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
5534 | | * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
5535 | | * @object_path: An object path. |
5536 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
5537 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
5538 | | * @user_data: User data to pass to @callback. |
5539 | | * |
5540 | | * 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. |
5541 | | * |
5542 | | * 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()). |
5543 | | * You can then call gxdp_open_uri_proxy_new_finish() to get the result of the operation. |
5544 | | * |
5545 | | * See gxdp_open_uri_proxy_new_sync() for the synchronous, blocking version of this constructor. |
5546 | | */ |
5547 | | void |
5548 | | gxdp_open_uri_proxy_new ( |
5549 | | GDBusConnection *connection, |
5550 | | GDBusProxyFlags flags, |
5551 | | const gchar *name, |
5552 | | const gchar *object_path, |
5553 | | GCancellable *cancellable, |
5554 | | GAsyncReadyCallback callback, |
5555 | | gpointer user_data) |
5556 | 0 | { |
5557 | 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); |
5558 | 0 | } |
5559 | | |
5560 | | /** |
5561 | | * gxdp_open_uri_proxy_new_finish: |
5562 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_proxy_new(). |
5563 | | * @error: Return location for error or %NULL |
5564 | | * |
5565 | | * Finishes an operation started with gxdp_open_uri_proxy_new(). |
5566 | | * |
5567 | | * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set. |
5568 | | */ |
5569 | | GXdpOpenURI * |
5570 | | gxdp_open_uri_proxy_new_finish ( |
5571 | | GAsyncResult *res, |
5572 | | GError **error) |
5573 | 0 | { |
5574 | 0 | GObject *ret; |
5575 | 0 | GObject *source_object; |
5576 | 0 | source_object = g_async_result_get_source_object (res); |
5577 | 0 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
5578 | 0 | g_object_unref (source_object); |
5579 | 0 | if (ret != NULL) |
5580 | 0 | return GXDP_OPEN_URI (ret); |
5581 | 0 | else |
5582 | 0 | return NULL; |
5583 | 0 | } |
5584 | | |
5585 | | /** |
5586 | | * gxdp_open_uri_proxy_new_sync: |
5587 | | * @connection: A #GDBusConnection. |
5588 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
5589 | | * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
5590 | | * @object_path: An object path. |
5591 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
5592 | | * @error: Return location for error or %NULL |
5593 | | * |
5594 | | * 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. |
5595 | | * |
5596 | | * The calling thread is blocked until a reply is received. |
5597 | | * |
5598 | | * See gxdp_open_uri_proxy_new() for the asynchronous version of this constructor. |
5599 | | * |
5600 | | * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set. |
5601 | | */ |
5602 | | GXdpOpenURI * |
5603 | | gxdp_open_uri_proxy_new_sync ( |
5604 | | GDBusConnection *connection, |
5605 | | GDBusProxyFlags flags, |
5606 | | const gchar *name, |
5607 | | const gchar *object_path, |
5608 | | GCancellable *cancellable, |
5609 | | GError **error) |
5610 | 0 | { |
5611 | 0 | GInitable *ret; |
5612 | 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); |
5613 | 0 | if (ret != NULL) |
5614 | 0 | return GXDP_OPEN_URI (ret); |
5615 | 0 | else |
5616 | 0 | return NULL; |
5617 | 0 | } |
5618 | | |
5619 | | |
5620 | | /** |
5621 | | * gxdp_open_uri_proxy_new_for_bus: |
5622 | | * @bus_type: A #GBusType. |
5623 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
5624 | | * @name: A bus name (well-known or unique). |
5625 | | * @object_path: An object path. |
5626 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
5627 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
5628 | | * @user_data: User data to pass to @callback. |
5629 | | * |
5630 | | * Like gxdp_open_uri_proxy_new() but takes a #GBusType instead of a #GDBusConnection. |
5631 | | * |
5632 | | * 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()). |
5633 | | * You can then call gxdp_open_uri_proxy_new_for_bus_finish() to get the result of the operation. |
5634 | | * |
5635 | | * See gxdp_open_uri_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. |
5636 | | */ |
5637 | | void |
5638 | | gxdp_open_uri_proxy_new_for_bus ( |
5639 | | GBusType bus_type, |
5640 | | GDBusProxyFlags flags, |
5641 | | const gchar *name, |
5642 | | const gchar *object_path, |
5643 | | GCancellable *cancellable, |
5644 | | GAsyncReadyCallback callback, |
5645 | | gpointer user_data) |
5646 | 0 | { |
5647 | 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); |
5648 | 0 | } |
5649 | | |
5650 | | /** |
5651 | | * gxdp_open_uri_proxy_new_for_bus_finish: |
5652 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_proxy_new_for_bus(). |
5653 | | * @error: Return location for error or %NULL |
5654 | | * |
5655 | | * Finishes an operation started with gxdp_open_uri_proxy_new_for_bus(). |
5656 | | * |
5657 | | * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set. |
5658 | | */ |
5659 | | GXdpOpenURI * |
5660 | | gxdp_open_uri_proxy_new_for_bus_finish ( |
5661 | | GAsyncResult *res, |
5662 | | GError **error) |
5663 | 0 | { |
5664 | 0 | GObject *ret; |
5665 | 0 | GObject *source_object; |
5666 | 0 | source_object = g_async_result_get_source_object (res); |
5667 | 0 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
5668 | 0 | g_object_unref (source_object); |
5669 | 0 | if (ret != NULL) |
5670 | 0 | return GXDP_OPEN_URI (ret); |
5671 | 0 | else |
5672 | 0 | return NULL; |
5673 | 0 | } |
5674 | | |
5675 | | /** |
5676 | | * gxdp_open_uri_proxy_new_for_bus_sync: |
5677 | | * @bus_type: A #GBusType. |
5678 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
5679 | | * @name: A bus name (well-known or unique). |
5680 | | * @object_path: An object path. |
5681 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
5682 | | * @error: Return location for error or %NULL |
5683 | | * |
5684 | | * Like gxdp_open_uri_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. |
5685 | | * |
5686 | | * The calling thread is blocked until a reply is received. |
5687 | | * |
5688 | | * See gxdp_open_uri_proxy_new_for_bus() for the asynchronous version of this constructor. |
5689 | | * |
5690 | | * Returns: (transfer full) (type GXdpOpenURIProxy): The constructed proxy object or %NULL if @error is set. |
5691 | | */ |
5692 | | GXdpOpenURI * |
5693 | | gxdp_open_uri_proxy_new_for_bus_sync ( |
5694 | | GBusType bus_type, |
5695 | | GDBusProxyFlags flags, |
5696 | | const gchar *name, |
5697 | | const gchar *object_path, |
5698 | | GCancellable *cancellable, |
5699 | | GError **error) |
5700 | 0 | { |
5701 | 0 | GInitable *ret; |
5702 | 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); |
5703 | 0 | if (ret != NULL) |
5704 | 0 | return GXDP_OPEN_URI (ret); |
5705 | 0 | else |
5706 | 0 | return NULL; |
5707 | 0 | } |
5708 | | |
5709 | | |
5710 | | /* ------------------------------------------------------------------------ */ |
5711 | | |
5712 | | /** |
5713 | | * GXdpOpenURISkeleton: |
5714 | | * |
5715 | | * The #GXdpOpenURISkeleton structure contains only private data and should only be accessed using the provided API. |
5716 | | */ |
5717 | | |
5718 | | /** |
5719 | | * GXdpOpenURISkeletonClass: |
5720 | | * @parent_class: The parent class. |
5721 | | * |
5722 | | * Class structure for #GXdpOpenURISkeleton. |
5723 | | */ |
5724 | | |
5725 | | struct _GXdpOpenURISkeletonPrivate |
5726 | | { |
5727 | | GValue *properties; |
5728 | | GList *changed_properties; |
5729 | | GSource *changed_properties_idle_source; |
5730 | | GMainContext *context; |
5731 | | GMutex lock; |
5732 | | }; |
5733 | | |
5734 | | static void |
5735 | | _gxdp_open_uri_skeleton_handle_method_call ( |
5736 | | GDBusConnection *connection G_GNUC_UNUSED, |
5737 | | const gchar *sender G_GNUC_UNUSED, |
5738 | | const gchar *object_path G_GNUC_UNUSED, |
5739 | | const gchar *interface_name, |
5740 | | const gchar *method_name, |
5741 | | GVariant *parameters, |
5742 | | GDBusMethodInvocation *invocation, |
5743 | | gpointer user_data) |
5744 | 0 | { |
5745 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data); |
5746 | 0 | _ExtendedGDBusMethodInfo *info; |
5747 | 0 | GVariantIter iter; |
5748 | 0 | GVariant *child; |
5749 | 0 | GValue *paramv; |
5750 | 0 | gsize num_params; |
5751 | 0 | guint num_extra; |
5752 | 0 | gsize n; |
5753 | 0 | guint signal_id; |
5754 | 0 | GValue return_value = G_VALUE_INIT; |
5755 | 0 | info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); |
5756 | 0 | g_assert (info != NULL); |
5757 | 0 | num_params = g_variant_n_children (parameters); |
5758 | 0 | num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); |
5759 | 0 | n = 0; |
5760 | 0 | g_value_init (¶mv[n], GXDP_TYPE_OPEN_URI); |
5761 | 0 | g_value_set_object (¶mv[n++], skeleton); |
5762 | 0 | g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); |
5763 | 0 | g_value_set_object (¶mv[n++], invocation); |
5764 | 0 | if (info->pass_fdlist) |
5765 | 0 | { |
5766 | 0 | #ifdef G_OS_UNIX |
5767 | 0 | g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); |
5768 | 0 | g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); |
5769 | | #else |
5770 | | g_assert_not_reached (); |
5771 | | #endif |
5772 | 0 | } |
5773 | 0 | g_variant_iter_init (&iter, parameters); |
5774 | 0 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
5775 | 0 | { |
5776 | 0 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; |
5777 | 0 | if (arg_info->use_gvariant) |
5778 | 0 | { |
5779 | 0 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
5780 | 0 | g_value_set_variant (¶mv[n], child); |
5781 | 0 | n++; |
5782 | 0 | } |
5783 | 0 | else |
5784 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
5785 | 0 | g_variant_unref (child); |
5786 | 0 | } |
5787 | 0 | signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_OPEN_URI); |
5788 | 0 | g_value_init (&return_value, G_TYPE_BOOLEAN); |
5789 | 0 | g_signal_emitv (paramv, signal_id, 0, &return_value); |
5790 | 0 | if (!g_value_get_boolean (&return_value)) |
5791 | 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); |
5792 | 0 | g_value_unset (&return_value); |
5793 | 0 | for (n = 0; n < num_params + num_extra; n++) |
5794 | 0 | g_value_unset (¶mv[n]); |
5795 | 0 | g_free (paramv); |
5796 | 0 | } |
5797 | | |
5798 | | static GVariant * |
5799 | | _gxdp_open_uri_skeleton_handle_get_property ( |
5800 | | GDBusConnection *connection G_GNUC_UNUSED, |
5801 | | const gchar *sender G_GNUC_UNUSED, |
5802 | | const gchar *object_path G_GNUC_UNUSED, |
5803 | | const gchar *interface_name G_GNUC_UNUSED, |
5804 | | const gchar *property_name, |
5805 | | GError **error, |
5806 | | gpointer user_data) |
5807 | 0 | { |
5808 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data); |
5809 | 0 | GValue value = G_VALUE_INIT; |
5810 | 0 | GParamSpec *pspec; |
5811 | 0 | _ExtendedGDBusPropertyInfo *info; |
5812 | 0 | GVariant *ret; |
5813 | 0 | ret = NULL; |
5814 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, property_name); |
5815 | 0 | g_assert (info != NULL); |
5816 | 0 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
5817 | 0 | if (pspec == NULL) |
5818 | 0 | { |
5819 | 0 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
5820 | 0 | } |
5821 | 0 | else |
5822 | 0 | { |
5823 | 0 | g_value_init (&value, pspec->value_type); |
5824 | 0 | g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
5825 | 0 | ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); |
5826 | 0 | g_value_unset (&value); |
5827 | 0 | } |
5828 | 0 | return ret; |
5829 | 0 | } |
5830 | | |
5831 | | static gboolean |
5832 | | _gxdp_open_uri_skeleton_handle_set_property ( |
5833 | | GDBusConnection *connection G_GNUC_UNUSED, |
5834 | | const gchar *sender G_GNUC_UNUSED, |
5835 | | const gchar *object_path G_GNUC_UNUSED, |
5836 | | const gchar *interface_name G_GNUC_UNUSED, |
5837 | | const gchar *property_name, |
5838 | | GVariant *variant, |
5839 | | GError **error, |
5840 | | gpointer user_data) |
5841 | 0 | { |
5842 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data); |
5843 | 0 | GValue value = G_VALUE_INIT; |
5844 | 0 | GParamSpec *pspec; |
5845 | 0 | _ExtendedGDBusPropertyInfo *info; |
5846 | 0 | gboolean ret; |
5847 | 0 | ret = FALSE; |
5848 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_open_uri_interface_info.parent_struct, property_name); |
5849 | 0 | g_assert (info != NULL); |
5850 | 0 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
5851 | 0 | if (pspec == NULL) |
5852 | 0 | { |
5853 | 0 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
5854 | 0 | } |
5855 | 0 | else |
5856 | 0 | { |
5857 | 0 | if (info->use_gvariant) |
5858 | 0 | g_value_set_variant (&value, variant); |
5859 | 0 | else |
5860 | 0 | g_dbus_gvariant_to_gvalue (variant, &value); |
5861 | 0 | g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
5862 | 0 | g_value_unset (&value); |
5863 | 0 | ret = TRUE; |
5864 | 0 | } |
5865 | 0 | return ret; |
5866 | 0 | } |
5867 | | |
5868 | | static const GDBusInterfaceVTable _gxdp_open_uri_skeleton_vtable = |
5869 | | { |
5870 | | _gxdp_open_uri_skeleton_handle_method_call, |
5871 | | _gxdp_open_uri_skeleton_handle_get_property, |
5872 | | _gxdp_open_uri_skeleton_handle_set_property, |
5873 | | {NULL} |
5874 | | }; |
5875 | | |
5876 | | static GDBusInterfaceInfo * |
5877 | | gxdp_open_uri_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
5878 | 0 | { |
5879 | 0 | return gxdp_open_uri_interface_info (); |
5880 | 0 | } |
5881 | | |
5882 | | static GDBusInterfaceVTable * |
5883 | | gxdp_open_uri_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
5884 | 0 | { |
5885 | 0 | return (GDBusInterfaceVTable *) &_gxdp_open_uri_skeleton_vtable; |
5886 | 0 | } |
5887 | | |
5888 | | static GVariant * |
5889 | | gxdp_open_uri_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) |
5890 | 0 | { |
5891 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (_skeleton); |
5892 | |
|
5893 | 0 | GVariantBuilder builder; |
5894 | 0 | guint n; |
5895 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 |
5896 | 0 | g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); |
5897 | | #else |
5898 | | g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}")); |
5899 | | #endif |
5900 | 0 | if (_gxdp_open_uri_interface_info.parent_struct.properties == NULL) |
5901 | 0 | goto out; |
5902 | 0 | for (n = 0; _gxdp_open_uri_interface_info.parent_struct.properties[n] != NULL; n++) |
5903 | 0 | { |
5904 | 0 | GDBusPropertyInfo *info = _gxdp_open_uri_interface_info.parent_struct.properties[n]; |
5905 | 0 | if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) |
5906 | 0 | { |
5907 | 0 | GVariant *value; |
5908 | 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); |
5909 | 0 | if (value != NULL) |
5910 | 0 | { |
5911 | 0 | g_variant_take_ref (value); |
5912 | 0 | g_variant_builder_add (&builder, "{sv}", info->name, value); |
5913 | 0 | g_variant_unref (value); |
5914 | 0 | } |
5915 | 0 | } |
5916 | 0 | } |
5917 | 0 | out: |
5918 | 0 | return g_variant_builder_end (&builder); |
5919 | 0 | } |
5920 | | |
5921 | | static gboolean _gxdp_open_uri_emit_changed (gpointer user_data); |
5922 | | |
5923 | | static void |
5924 | | gxdp_open_uri_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) |
5925 | 0 | { |
5926 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (_skeleton); |
5927 | 0 | gboolean emit_changed = FALSE; |
5928 | |
|
5929 | 0 | g_mutex_lock (&skeleton->priv->lock); |
5930 | 0 | if (skeleton->priv->changed_properties_idle_source != NULL) |
5931 | 0 | { |
5932 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
5933 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
5934 | 0 | emit_changed = TRUE; |
5935 | 0 | } |
5936 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
5937 | |
|
5938 | 0 | if (emit_changed) |
5939 | 0 | _gxdp_open_uri_emit_changed (skeleton); |
5940 | 0 | } |
5941 | | |
5942 | | static void gxdp_open_uri_skeleton_iface_init (GXdpOpenURIIface *iface); |
5943 | | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
5944 | | G_DEFINE_TYPE_WITH_CODE (GXdpOpenURISkeleton, gxdp_open_uri_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
5945 | | G_ADD_PRIVATE (GXdpOpenURISkeleton) |
5946 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_skeleton_iface_init)) |
5947 | | |
5948 | | #else |
5949 | | G_DEFINE_TYPE_WITH_CODE (GXdpOpenURISkeleton, gxdp_open_uri_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
5950 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_OPEN_URI, gxdp_open_uri_skeleton_iface_init)) |
5951 | | |
5952 | | #endif |
5953 | | static void |
5954 | | gxdp_open_uri_skeleton_finalize (GObject *object) |
5955 | 0 | { |
5956 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); |
5957 | 0 | guint n; |
5958 | 0 | for (n = 0; n < 1; n++) |
5959 | 0 | g_value_unset (&skeleton->priv->properties[n]); |
5960 | 0 | g_free (skeleton->priv->properties); |
5961 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
5962 | 0 | if (skeleton->priv->changed_properties_idle_source != NULL) |
5963 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
5964 | 0 | g_main_context_unref (skeleton->priv->context); |
5965 | 0 | g_mutex_clear (&skeleton->priv->lock); |
5966 | 0 | G_OBJECT_CLASS (gxdp_open_uri_skeleton_parent_class)->finalize (object); |
5967 | 0 | } |
5968 | | |
5969 | | static void |
5970 | | gxdp_open_uri_skeleton_get_property (GObject *object, |
5971 | | guint prop_id, |
5972 | | GValue *value, |
5973 | | GParamSpec *pspec G_GNUC_UNUSED) |
5974 | 0 | { |
5975 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); |
5976 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
5977 | 0 | g_mutex_lock (&skeleton->priv->lock); |
5978 | 0 | g_value_copy (&skeleton->priv->properties[prop_id - 1], value); |
5979 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
5980 | 0 | } |
5981 | | |
5982 | | static gboolean |
5983 | | _gxdp_open_uri_emit_changed (gpointer user_data) |
5984 | 0 | { |
5985 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (user_data); |
5986 | 0 | GList *l; |
5987 | 0 | GVariantBuilder builder; |
5988 | 0 | GVariantBuilder invalidated_builder; |
5989 | 0 | guint num_changes; |
5990 | |
|
5991 | 0 | g_mutex_lock (&skeleton->priv->lock); |
5992 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 |
5993 | 0 | g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); |
5994 | 0 | g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as")); |
5995 | | #else |
5996 | | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
5997 | | g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); |
5998 | | #endif |
5999 | 0 | for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) |
6000 | 0 | { |
6001 | 0 | ChangedProperty *cp = l->data; |
6002 | 0 | GVariant *variant; |
6003 | 0 | const GValue *cur_value; |
6004 | |
|
6005 | 0 | cur_value = &skeleton->priv->properties[cp->prop_id - 1]; |
6006 | 0 | if (!_g_value_equal (cur_value, &cp->orig_value)) |
6007 | 0 | { |
6008 | 0 | variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); |
6009 | 0 | g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); |
6010 | 0 | g_variant_unref (variant); |
6011 | 0 | num_changes++; |
6012 | 0 | } |
6013 | 0 | } |
6014 | 0 | if (num_changes > 0) |
6015 | 0 | { |
6016 | 0 | GList *connections, *ll; |
6017 | 0 | GVariant *signal_variant; |
6018 | 0 | signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.OpenURI", |
6019 | 0 | &builder, &invalidated_builder)); |
6020 | 0 | connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); |
6021 | 0 | for (ll = connections; ll != NULL; ll = ll->next) |
6022 | 0 | { |
6023 | 0 | GDBusConnection *connection = ll->data; |
6024 | |
|
6025 | 0 | g_dbus_connection_emit_signal (connection, |
6026 | 0 | NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), |
6027 | 0 | "org.freedesktop.DBus.Properties", |
6028 | 0 | "PropertiesChanged", |
6029 | 0 | signal_variant, |
6030 | 0 | NULL); |
6031 | 0 | } |
6032 | 0 | g_variant_unref (signal_variant); |
6033 | 0 | g_list_free_full (connections, g_object_unref); |
6034 | 0 | } |
6035 | 0 | else |
6036 | 0 | { |
6037 | 0 | g_variant_builder_clear (&builder); |
6038 | 0 | g_variant_builder_clear (&invalidated_builder); |
6039 | 0 | } |
6040 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
6041 | 0 | skeleton->priv->changed_properties = NULL; |
6042 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
6043 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
6044 | 0 | return FALSE; |
6045 | 0 | } |
6046 | | |
6047 | | static void |
6048 | | _gxdp_open_uri_schedule_emit_changed (GXdpOpenURISkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) |
6049 | 0 | { |
6050 | 0 | ChangedProperty *cp; |
6051 | 0 | GList *l; |
6052 | 0 | cp = NULL; |
6053 | 0 | for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) |
6054 | 0 | { |
6055 | 0 | ChangedProperty *i_cp = l->data; |
6056 | 0 | if (i_cp->info == info) |
6057 | 0 | { |
6058 | 0 | cp = i_cp; |
6059 | 0 | break; |
6060 | 0 | } |
6061 | 0 | } |
6062 | 0 | if (cp == NULL) |
6063 | 0 | { |
6064 | 0 | cp = g_new0 (ChangedProperty, 1); |
6065 | 0 | cp->prop_id = prop_id; |
6066 | 0 | cp->info = info; |
6067 | 0 | skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); |
6068 | 0 | g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); |
6069 | 0 | g_value_copy (orig_value, &cp->orig_value); |
6070 | 0 | } |
6071 | 0 | } |
6072 | | |
6073 | | static void |
6074 | | gxdp_open_uri_skeleton_notify (GObject *object, |
6075 | | GParamSpec *pspec G_GNUC_UNUSED) |
6076 | 0 | { |
6077 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); |
6078 | 0 | g_mutex_lock (&skeleton->priv->lock); |
6079 | 0 | if (skeleton->priv->changed_properties != NULL && |
6080 | 0 | skeleton->priv->changed_properties_idle_source == NULL) |
6081 | 0 | { |
6082 | 0 | skeleton->priv->changed_properties_idle_source = g_idle_source_new (); |
6083 | 0 | g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); |
6084 | 0 | g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_open_uri_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); |
6085 | 0 | g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_open_uri_emit_changed"); |
6086 | 0 | g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); |
6087 | 0 | g_source_unref (skeleton->priv->changed_properties_idle_source); |
6088 | 0 | } |
6089 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
6090 | 0 | } |
6091 | | |
6092 | | static void |
6093 | | gxdp_open_uri_skeleton_set_property (GObject *object, |
6094 | | guint prop_id, |
6095 | | const GValue *value, |
6096 | | GParamSpec *pspec) |
6097 | 0 | { |
6098 | 0 | const _ExtendedGDBusPropertyInfo *info; |
6099 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); |
6100 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
6101 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_open_uri_property_info_pointers[prop_id - 1]; |
6102 | 0 | g_mutex_lock (&skeleton->priv->lock); |
6103 | 0 | g_object_freeze_notify (object); |
6104 | 0 | if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) |
6105 | 0 | { |
6106 | 0 | if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && |
6107 | 0 | info->emits_changed_signal) |
6108 | 0 | _gxdp_open_uri_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); |
6109 | 0 | g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); |
6110 | 0 | g_object_notify_by_pspec (object, pspec); |
6111 | 0 | } |
6112 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
6113 | 0 | g_object_thaw_notify (object); |
6114 | 0 | } |
6115 | | |
6116 | | static void |
6117 | | gxdp_open_uri_skeleton_init (GXdpOpenURISkeleton *skeleton) |
6118 | 0 | { |
6119 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
6120 | 0 | skeleton->priv = gxdp_open_uri_skeleton_get_instance_private (skeleton); |
6121 | | #else |
6122 | | skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_OPEN_URI_SKELETON, GXdpOpenURISkeletonPrivate); |
6123 | | #endif |
6124 | |
|
6125 | 0 | g_mutex_init (&skeleton->priv->lock); |
6126 | 0 | skeleton->priv->context = g_main_context_ref_thread_default (); |
6127 | 0 | skeleton->priv->properties = g_new0 (GValue, 1); |
6128 | 0 | g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT); |
6129 | 0 | } |
6130 | | |
6131 | | static guint |
6132 | | gxdp_open_uri_skeleton_get_version (GXdpOpenURI *object) |
6133 | 0 | { |
6134 | 0 | GXdpOpenURISkeleton *skeleton = GXDP_OPEN_URI_SKELETON (object); |
6135 | 0 | guint value; |
6136 | 0 | g_mutex_lock (&skeleton->priv->lock); |
6137 | 0 | value = g_marshal_value_peek_uint (&(skeleton->priv->properties[0])); |
6138 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
6139 | 0 | return value; |
6140 | 0 | } |
6141 | | |
6142 | | static void |
6143 | | gxdp_open_uri_skeleton_class_init (GXdpOpenURISkeletonClass *klass) |
6144 | 0 | { |
6145 | 0 | GObjectClass *gobject_class; |
6146 | 0 | GDBusInterfaceSkeletonClass *skeleton_class; |
6147 | |
|
6148 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
6149 | 0 | gobject_class->finalize = gxdp_open_uri_skeleton_finalize; |
6150 | 0 | gobject_class->get_property = gxdp_open_uri_skeleton_get_property; |
6151 | 0 | gobject_class->set_property = gxdp_open_uri_skeleton_set_property; |
6152 | 0 | gobject_class->notify = gxdp_open_uri_skeleton_notify; |
6153 | | |
6154 | |
|
6155 | 0 | gxdp_open_uri_override_properties (gobject_class, 1); |
6156 | |
|
6157 | 0 | skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); |
6158 | 0 | skeleton_class->get_info = gxdp_open_uri_skeleton_dbus_interface_get_info; |
6159 | 0 | skeleton_class->get_properties = gxdp_open_uri_skeleton_dbus_interface_get_properties; |
6160 | 0 | skeleton_class->flush = gxdp_open_uri_skeleton_dbus_interface_flush; |
6161 | 0 | skeleton_class->get_vtable = gxdp_open_uri_skeleton_dbus_interface_get_vtable; |
6162 | |
|
6163 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
6164 | | g_type_class_add_private (klass, sizeof (GXdpOpenURISkeletonPrivate)); |
6165 | | #endif |
6166 | 0 | } |
6167 | | |
6168 | | static void |
6169 | | gxdp_open_uri_skeleton_iface_init (GXdpOpenURIIface *iface) |
6170 | 0 | { |
6171 | 0 | iface->get_version = gxdp_open_uri_skeleton_get_version; |
6172 | 0 | } |
6173 | | |
6174 | | /** |
6175 | | * gxdp_open_uri_skeleton_new: |
6176 | | * |
6177 | | * 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>. |
6178 | | * |
6179 | | * Returns: (transfer full) (type GXdpOpenURISkeleton): The skeleton object. |
6180 | | */ |
6181 | | GXdpOpenURI * |
6182 | | gxdp_open_uri_skeleton_new (void) |
6183 | 0 | { |
6184 | 0 | return GXDP_OPEN_URI (g_object_new (GXDP_TYPE_OPEN_URI_SKELETON, NULL)); |
6185 | 0 | } |
6186 | | |
6187 | | /* ------------------------------------------------------------------------ |
6188 | | * Code for interface org.freedesktop.portal.ProxyResolver |
6189 | | * ------------------------------------------------------------------------ |
6190 | | */ |
6191 | | |
6192 | | /** |
6193 | | * SECTION:GXdpProxyResolver |
6194 | | * @title: GXdpProxyResolver |
6195 | | * @short_description: Generated C code for the org.freedesktop.portal.ProxyResolver D-Bus interface |
6196 | | * |
6197 | | * 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. |
6198 | | */ |
6199 | | |
6200 | | /* ---- Introspection data for org.freedesktop.portal.ProxyResolver ---- */ |
6201 | | |
6202 | | static const _ExtendedGDBusArgInfo _gxdp_proxy_resolver_method_info_lookup_IN_ARG_uri = |
6203 | | { |
6204 | | { |
6205 | | -1, |
6206 | | (gchar *) "uri", |
6207 | | (gchar *) "s", |
6208 | | NULL |
6209 | | }, |
6210 | | FALSE |
6211 | | }; |
6212 | | |
6213 | | static const GDBusArgInfo * const _gxdp_proxy_resolver_method_info_lookup_IN_ARG_pointers[] = |
6214 | | { |
6215 | | &_gxdp_proxy_resolver_method_info_lookup_IN_ARG_uri.parent_struct, |
6216 | | NULL |
6217 | | }; |
6218 | | |
6219 | | static const _ExtendedGDBusArgInfo _gxdp_proxy_resolver_method_info_lookup_OUT_ARG_proxies = |
6220 | | { |
6221 | | { |
6222 | | -1, |
6223 | | (gchar *) "proxies", |
6224 | | (gchar *) "as", |
6225 | | NULL |
6226 | | }, |
6227 | | FALSE |
6228 | | }; |
6229 | | |
6230 | | static const GDBusArgInfo * const _gxdp_proxy_resolver_method_info_lookup_OUT_ARG_pointers[] = |
6231 | | { |
6232 | | &_gxdp_proxy_resolver_method_info_lookup_OUT_ARG_proxies.parent_struct, |
6233 | | NULL |
6234 | | }; |
6235 | | |
6236 | | static const _ExtendedGDBusMethodInfo _gxdp_proxy_resolver_method_info_lookup = |
6237 | | { |
6238 | | { |
6239 | | -1, |
6240 | | (gchar *) "Lookup", |
6241 | | (GDBusArgInfo **) &_gxdp_proxy_resolver_method_info_lookup_IN_ARG_pointers, |
6242 | | (GDBusArgInfo **) &_gxdp_proxy_resolver_method_info_lookup_OUT_ARG_pointers, |
6243 | | NULL |
6244 | | }, |
6245 | | "handle-lookup", |
6246 | | FALSE |
6247 | | }; |
6248 | | |
6249 | | static const GDBusMethodInfo * const _gxdp_proxy_resolver_method_info_pointers[] = |
6250 | | { |
6251 | | &_gxdp_proxy_resolver_method_info_lookup.parent_struct, |
6252 | | NULL |
6253 | | }; |
6254 | | |
6255 | | static const _ExtendedGDBusPropertyInfo _gxdp_proxy_resolver_property_info_version = |
6256 | | { |
6257 | | { |
6258 | | -1, |
6259 | | (gchar *) "version", |
6260 | | (gchar *) "u", |
6261 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
6262 | | NULL |
6263 | | }, |
6264 | | "version", |
6265 | | FALSE, |
6266 | | TRUE |
6267 | | }; |
6268 | | |
6269 | | static const GDBusPropertyInfo * const _gxdp_proxy_resolver_property_info_pointers[] = |
6270 | | { |
6271 | | &_gxdp_proxy_resolver_property_info_version.parent_struct, |
6272 | | NULL |
6273 | | }; |
6274 | | |
6275 | | static const _ExtendedGDBusInterfaceInfo _gxdp_proxy_resolver_interface_info = |
6276 | | { |
6277 | | { |
6278 | | -1, |
6279 | | (gchar *) "org.freedesktop.portal.ProxyResolver", |
6280 | | (GDBusMethodInfo **) &_gxdp_proxy_resolver_method_info_pointers, |
6281 | | NULL, |
6282 | | (GDBusPropertyInfo **) &_gxdp_proxy_resolver_property_info_pointers, |
6283 | | NULL |
6284 | | }, |
6285 | | "proxy-resolver", |
6286 | | }; |
6287 | | |
6288 | | |
6289 | | /** |
6290 | | * gxdp_proxy_resolver_interface_info: |
6291 | | * |
6292 | | * 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. |
6293 | | * |
6294 | | * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. |
6295 | | */ |
6296 | | GDBusInterfaceInfo * |
6297 | | gxdp_proxy_resolver_interface_info (void) |
6298 | 0 | { |
6299 | 0 | return (GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct; |
6300 | 0 | } |
6301 | | |
6302 | | /** |
6303 | | * gxdp_proxy_resolver_override_properties: |
6304 | | * @klass: The class structure for a #GObject derived class. |
6305 | | * @property_id_begin: The property id to assign to the first overridden property. |
6306 | | * |
6307 | | * Overrides all #GObject properties in the #GXdpProxyResolver interface for a concrete class. |
6308 | | * The properties are overridden in the order they are defined. |
6309 | | * |
6310 | | * Returns: The last property id. |
6311 | | */ |
6312 | | guint |
6313 | | gxdp_proxy_resolver_override_properties (GObjectClass *klass, guint property_id_begin) |
6314 | 0 | { |
6315 | 0 | g_object_class_override_property (klass, property_id_begin++, "version"); |
6316 | 0 | return property_id_begin - 1; |
6317 | 0 | } |
6318 | | |
6319 | | |
6320 | | inline static void |
6321 | | gxdp_proxy_resolver_method_marshal_lookup ( |
6322 | | GClosure *closure, |
6323 | | GValue *return_value, |
6324 | | unsigned int n_param_values, |
6325 | | const GValue *param_values, |
6326 | | void *invocation_hint, |
6327 | | void *marshal_data) |
6328 | 0 | { |
6329 | 0 | _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING (closure, |
6330 | 0 | return_value, n_param_values, param_values, invocation_hint, marshal_data); |
6331 | 0 | } |
6332 | | |
6333 | | |
6334 | | /** |
6335 | | * GXdpProxyResolver: |
6336 | | * |
6337 | | * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>. |
6338 | | */ |
6339 | | |
6340 | | /** |
6341 | | * GXdpProxyResolverIface: |
6342 | | * @parent_iface: The parent interface. |
6343 | | * @handle_lookup: Handler for the #GXdpProxyResolver::handle-lookup signal. |
6344 | | * @get_version: Getter for the #GXdpProxyResolver:version property. |
6345 | | * |
6346 | | * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>. |
6347 | | */ |
6348 | | |
6349 | | typedef GXdpProxyResolverIface GXdpProxyResolverInterface; |
6350 | | G_DEFINE_INTERFACE (GXdpProxyResolver, gxdp_proxy_resolver, G_TYPE_OBJECT) |
6351 | | |
6352 | | static void |
6353 | | gxdp_proxy_resolver_default_init (GXdpProxyResolverIface *iface) |
6354 | 0 | { |
6355 | | /* GObject signals for incoming D-Bus method calls: */ |
6356 | | /** |
6357 | | * GXdpProxyResolver::handle-lookup: |
6358 | | * @object: A #GXdpProxyResolver. |
6359 | | * @invocation: A #GDBusMethodInvocation. |
6360 | | * @arg_uri: Argument passed by remote caller. |
6361 | | * |
6362 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</link> D-Bus method. |
6363 | | * |
6364 | | * 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. |
6365 | | * |
6366 | | * 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. |
6367 | | */ |
6368 | 0 | g_signal_new ("handle-lookup", |
6369 | 0 | G_TYPE_FROM_INTERFACE (iface), |
6370 | 0 | G_SIGNAL_RUN_LAST, |
6371 | 0 | G_STRUCT_OFFSET (GXdpProxyResolverIface, handle_lookup), |
6372 | 0 | g_signal_accumulator_true_handled, |
6373 | 0 | NULL, |
6374 | 0 | gxdp_proxy_resolver_method_marshal_lookup, |
6375 | 0 | G_TYPE_BOOLEAN, |
6376 | 0 | 2, |
6377 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); |
6378 | | |
6379 | | /* GObject properties for D-Bus properties: */ |
6380 | | /** |
6381 | | * GXdpProxyResolver:version: |
6382 | | * |
6383 | | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-ProxyResolver.version">"version"</link>. |
6384 | | * |
6385 | | * 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. |
6386 | | */ |
6387 | 0 | g_object_interface_install_property (iface, |
6388 | 0 | g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
6389 | 0 | } |
6390 | | |
6391 | | /** |
6392 | | * gxdp_proxy_resolver_get_version: (skip) |
6393 | | * @object: A #GXdpProxyResolver. |
6394 | | * |
6395 | | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-ProxyResolver.version">"version"</link> D-Bus property. |
6396 | | * |
6397 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
6398 | | * |
6399 | | * Returns: The property value. |
6400 | | */ |
6401 | | guint |
6402 | | gxdp_proxy_resolver_get_version (GXdpProxyResolver *object) |
6403 | 0 | { |
6404 | 0 | g_return_val_if_fail (GXDP_IS_PROXY_RESOLVER (object), 0); |
6405 | | |
6406 | 0 | return GXDP_PROXY_RESOLVER_GET_IFACE (object)->get_version (object); |
6407 | 0 | } |
6408 | | |
6409 | | /** |
6410 | | * gxdp_proxy_resolver_set_version: (skip) |
6411 | | * @object: A #GXdpProxyResolver. |
6412 | | * @value: The value to set. |
6413 | | * |
6414 | | * Sets the <link linkend="gdbus-property-org-freedesktop-portal-ProxyResolver.version">"version"</link> D-Bus property to @value. |
6415 | | * |
6416 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
6417 | | */ |
6418 | | void |
6419 | | gxdp_proxy_resolver_set_version (GXdpProxyResolver *object, guint value) |
6420 | 0 | { |
6421 | 0 | g_object_set (G_OBJECT (object), "version", value, NULL); |
6422 | 0 | } |
6423 | | |
6424 | | /** |
6425 | | * gxdp_proxy_resolver_call_lookup: |
6426 | | * @proxy: A #GXdpProxyResolverProxy. |
6427 | | * @arg_uri: Argument to pass with the method invocation. |
6428 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
6429 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
6430 | | * @user_data: User data to pass to @callback. |
6431 | | * |
6432 | | * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</link> D-Bus method on @proxy. |
6433 | | * 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()). |
6434 | | * You can then call gxdp_proxy_resolver_call_lookup_finish() to get the result of the operation. |
6435 | | * |
6436 | | * See gxdp_proxy_resolver_call_lookup_sync() for the synchronous, blocking version of this method. |
6437 | | */ |
6438 | | void |
6439 | | gxdp_proxy_resolver_call_lookup ( |
6440 | | GXdpProxyResolver *proxy, |
6441 | | const gchar *arg_uri, |
6442 | | GCancellable *cancellable, |
6443 | | GAsyncReadyCallback callback, |
6444 | | gpointer user_data) |
6445 | 0 | { |
6446 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (proxy), |
6447 | 0 | "Lookup", |
6448 | 0 | g_variant_new ("(s)", |
6449 | 0 | arg_uri), |
6450 | 0 | G_DBUS_CALL_FLAGS_NONE, |
6451 | 0 | -1, |
6452 | 0 | cancellable, |
6453 | 0 | callback, |
6454 | 0 | user_data); |
6455 | 0 | } |
6456 | | |
6457 | | /** |
6458 | | * gxdp_proxy_resolver_call_lookup_finish: |
6459 | | * @proxy: A #GXdpProxyResolverProxy. |
6460 | | * @out_proxies: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. |
6461 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_call_lookup(). |
6462 | | * @error: Return location for error or %NULL. |
6463 | | * |
6464 | | * Finishes an operation started with gxdp_proxy_resolver_call_lookup(). |
6465 | | * |
6466 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
6467 | | */ |
6468 | | gboolean |
6469 | | gxdp_proxy_resolver_call_lookup_finish ( |
6470 | | GXdpProxyResolver *proxy, |
6471 | | gchar ***out_proxies, |
6472 | | GAsyncResult *res, |
6473 | | GError **error) |
6474 | 0 | { |
6475 | 0 | GVariant *_ret; |
6476 | 0 | _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); |
6477 | 0 | if (_ret == NULL) |
6478 | 0 | goto _out; |
6479 | 0 | g_variant_get (_ret, |
6480 | 0 | "(^as)", |
6481 | 0 | out_proxies); |
6482 | 0 | g_variant_unref (_ret); |
6483 | 0 | _out: |
6484 | 0 | return _ret != NULL; |
6485 | 0 | } |
6486 | | |
6487 | | /** |
6488 | | * gxdp_proxy_resolver_call_lookup_sync: |
6489 | | * @proxy: A #GXdpProxyResolverProxy. |
6490 | | * @arg_uri: Argument to pass with the method invocation. |
6491 | | * @out_proxies: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. |
6492 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
6493 | | * @error: Return location for error or %NULL. |
6494 | | * |
6495 | | * 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. |
6496 | | * |
6497 | | * See gxdp_proxy_resolver_call_lookup() for the asynchronous version of this method. |
6498 | | * |
6499 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
6500 | | */ |
6501 | | gboolean |
6502 | | gxdp_proxy_resolver_call_lookup_sync ( |
6503 | | GXdpProxyResolver *proxy, |
6504 | | const gchar *arg_uri, |
6505 | | gchar ***out_proxies, |
6506 | | GCancellable *cancellable, |
6507 | | GError **error) |
6508 | 0 | { |
6509 | 0 | GVariant *_ret; |
6510 | 0 | _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), |
6511 | 0 | "Lookup", |
6512 | 0 | g_variant_new ("(s)", |
6513 | 0 | arg_uri), |
6514 | 0 | G_DBUS_CALL_FLAGS_NONE, |
6515 | 0 | -1, |
6516 | 0 | cancellable, |
6517 | 0 | error); |
6518 | 0 | if (_ret == NULL) |
6519 | 0 | goto _out; |
6520 | 0 | g_variant_get (_ret, |
6521 | 0 | "(^as)", |
6522 | 0 | out_proxies); |
6523 | 0 | g_variant_unref (_ret); |
6524 | 0 | _out: |
6525 | 0 | return _ret != NULL; |
6526 | 0 | } |
6527 | | |
6528 | | /** |
6529 | | * gxdp_proxy_resolver_complete_lookup: |
6530 | | * @object: A #GXdpProxyResolver. |
6531 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
6532 | | * @proxies: Parameter to return. |
6533 | | * |
6534 | | * 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. |
6535 | | * |
6536 | | * This method will free @invocation, you cannot use it afterwards. |
6537 | | */ |
6538 | | void |
6539 | | gxdp_proxy_resolver_complete_lookup ( |
6540 | | GXdpProxyResolver *object G_GNUC_UNUSED, |
6541 | | GDBusMethodInvocation *invocation, |
6542 | | const gchar *const *proxies) |
6543 | 0 | { |
6544 | 0 | g_dbus_method_invocation_return_value (invocation, |
6545 | 0 | g_variant_new ("(^as)", |
6546 | 0 | proxies)); |
6547 | 0 | } |
6548 | | |
6549 | | /* ------------------------------------------------------------------------ */ |
6550 | | |
6551 | | /** |
6552 | | * GXdpProxyResolverProxy: |
6553 | | * |
6554 | | * The #GXdpProxyResolverProxy structure contains only private data and should only be accessed using the provided API. |
6555 | | */ |
6556 | | |
6557 | | /** |
6558 | | * GXdpProxyResolverProxyClass: |
6559 | | * @parent_class: The parent class. |
6560 | | * |
6561 | | * Class structure for #GXdpProxyResolverProxy. |
6562 | | */ |
6563 | | |
6564 | | struct _GXdpProxyResolverProxyPrivate |
6565 | | { |
6566 | | GData *qdata; |
6567 | | }; |
6568 | | |
6569 | | static void gxdp_proxy_resolver_proxy_iface_init (GXdpProxyResolverIface *iface); |
6570 | | |
6571 | | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
6572 | | G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverProxy, gxdp_proxy_resolver_proxy, G_TYPE_DBUS_PROXY, |
6573 | | G_ADD_PRIVATE (GXdpProxyResolverProxy) |
6574 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_proxy_iface_init)) |
6575 | | |
6576 | | #else |
6577 | | G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverProxy, gxdp_proxy_resolver_proxy, G_TYPE_DBUS_PROXY, |
6578 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_proxy_iface_init)) |
6579 | | |
6580 | | #endif |
6581 | | static void |
6582 | | gxdp_proxy_resolver_proxy_finalize (GObject *object) |
6583 | 0 | { |
6584 | 0 | GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (object); |
6585 | 0 | g_datalist_clear (&proxy->priv->qdata); |
6586 | 0 | G_OBJECT_CLASS (gxdp_proxy_resolver_proxy_parent_class)->finalize (object); |
6587 | 0 | } |
6588 | | |
6589 | | static void |
6590 | | gxdp_proxy_resolver_proxy_get_property (GObject *object, |
6591 | | guint prop_id, |
6592 | | GValue *value, |
6593 | | GParamSpec *pspec G_GNUC_UNUSED) |
6594 | 0 | { |
6595 | 0 | const _ExtendedGDBusPropertyInfo *info; |
6596 | 0 | GVariant *variant; |
6597 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
6598 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1]; |
6599 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); |
6600 | 0 | if (info->use_gvariant) |
6601 | 0 | { |
6602 | 0 | g_value_set_variant (value, variant); |
6603 | 0 | } |
6604 | 0 | else |
6605 | 0 | { |
6606 | 0 | if (variant != NULL) |
6607 | 0 | g_dbus_gvariant_to_gvalue (variant, value); |
6608 | 0 | } |
6609 | 0 | if (variant != NULL) |
6610 | 0 | g_variant_unref (variant); |
6611 | 0 | } |
6612 | | |
6613 | | static void |
6614 | | gxdp_proxy_resolver_proxy_set_property_cb (GDBusProxy *proxy, |
6615 | | GAsyncResult *res, |
6616 | | gpointer user_data) |
6617 | 0 | { |
6618 | 0 | const _ExtendedGDBusPropertyInfo *info = user_data; |
6619 | 0 | GError *error; |
6620 | 0 | GVariant *_ret; |
6621 | 0 | error = NULL; |
6622 | 0 | _ret = g_dbus_proxy_call_finish (proxy, res, &error); |
6623 | 0 | if (!_ret) |
6624 | 0 | { |
6625 | 0 | g_warning ("Error setting property '%s' on interface org.freedesktop.portal.ProxyResolver: %s (%s, %d)", |
6626 | 0 | info->parent_struct.name, |
6627 | 0 | error->message, g_quark_to_string (error->domain), error->code); |
6628 | 0 | g_error_free (error); |
6629 | 0 | } |
6630 | 0 | else |
6631 | 0 | { |
6632 | 0 | g_variant_unref (_ret); |
6633 | 0 | } |
6634 | 0 | } |
6635 | | |
6636 | | static void |
6637 | | gxdp_proxy_resolver_proxy_set_property (GObject *object, |
6638 | | guint prop_id, |
6639 | | const GValue *value, |
6640 | | GParamSpec *pspec G_GNUC_UNUSED) |
6641 | 0 | { |
6642 | 0 | const _ExtendedGDBusPropertyInfo *info; |
6643 | 0 | GVariant *variant; |
6644 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
6645 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1]; |
6646 | 0 | variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); |
6647 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (object), |
6648 | 0 | "org.freedesktop.DBus.Properties.Set", |
6649 | 0 | g_variant_new ("(ssv)", "org.freedesktop.portal.ProxyResolver", info->parent_struct.name, variant), |
6650 | 0 | G_DBUS_CALL_FLAGS_NONE, |
6651 | 0 | -1, |
6652 | 0 | NULL, (GAsyncReadyCallback) gxdp_proxy_resolver_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); |
6653 | 0 | g_variant_unref (variant); |
6654 | 0 | } |
6655 | | |
6656 | | static void |
6657 | | gxdp_proxy_resolver_proxy_g_signal (GDBusProxy *proxy, |
6658 | | const gchar *sender_name G_GNUC_UNUSED, |
6659 | | const gchar *signal_name, |
6660 | | GVariant *parameters) |
6661 | 0 | { |
6662 | 0 | _ExtendedGDBusSignalInfo *info; |
6663 | 0 | GVariantIter iter; |
6664 | 0 | GVariant *child; |
6665 | 0 | GValue *paramv; |
6666 | 0 | gsize num_params; |
6667 | 0 | gsize n; |
6668 | 0 | guint signal_id; |
6669 | 0 | info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, signal_name); |
6670 | 0 | if (info == NULL) |
6671 | 0 | return; |
6672 | 0 | num_params = g_variant_n_children (parameters); |
6673 | 0 | paramv = g_new0 (GValue, num_params + 1); |
6674 | 0 | g_value_init (¶mv[0], GXDP_TYPE_PROXY_RESOLVER); |
6675 | 0 | g_value_set_object (¶mv[0], proxy); |
6676 | 0 | g_variant_iter_init (&iter, parameters); |
6677 | 0 | n = 1; |
6678 | 0 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
6679 | 0 | { |
6680 | 0 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; |
6681 | 0 | if (arg_info->use_gvariant) |
6682 | 0 | { |
6683 | 0 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
6684 | 0 | g_value_set_variant (¶mv[n], child); |
6685 | 0 | n++; |
6686 | 0 | } |
6687 | 0 | else |
6688 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
6689 | 0 | g_variant_unref (child); |
6690 | 0 | } |
6691 | 0 | signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_PROXY_RESOLVER); |
6692 | 0 | g_signal_emitv (paramv, signal_id, 0, NULL); |
6693 | 0 | for (n = 0; n < num_params + 1; n++) |
6694 | 0 | g_value_unset (¶mv[n]); |
6695 | 0 | g_free (paramv); |
6696 | 0 | } |
6697 | | |
6698 | | static void |
6699 | | gxdp_proxy_resolver_proxy_g_properties_changed (GDBusProxy *_proxy, |
6700 | | GVariant *changed_properties, |
6701 | | const gchar *const *invalidated_properties) |
6702 | 0 | { |
6703 | 0 | GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (_proxy); |
6704 | 0 | guint n; |
6705 | 0 | const gchar *key; |
6706 | 0 | GVariantIter *iter; |
6707 | 0 | _ExtendedGDBusPropertyInfo *info; |
6708 | 0 | g_variant_get (changed_properties, "a{sv}", &iter); |
6709 | 0 | while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) |
6710 | 0 | { |
6711 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, key); |
6712 | 0 | g_datalist_remove_data (&proxy->priv->qdata, key); |
6713 | 0 | if (info != NULL) |
6714 | 0 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
6715 | 0 | } |
6716 | 0 | g_variant_iter_free (iter); |
6717 | 0 | for (n = 0; invalidated_properties[n] != NULL; n++) |
6718 | 0 | { |
6719 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, invalidated_properties[n]); |
6720 | 0 | g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); |
6721 | 0 | if (info != NULL) |
6722 | 0 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
6723 | 0 | } |
6724 | 0 | } |
6725 | | |
6726 | | static guint |
6727 | | gxdp_proxy_resolver_proxy_get_version (GXdpProxyResolver *object) |
6728 | 0 | { |
6729 | 0 | GXdpProxyResolverProxy *proxy = GXDP_PROXY_RESOLVER_PROXY (object); |
6730 | 0 | GVariant *variant; |
6731 | 0 | guint value = 0; |
6732 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version"); |
6733 | 0 | if (variant != NULL) |
6734 | 0 | { |
6735 | 0 | value = g_variant_get_uint32 (variant); |
6736 | 0 | g_variant_unref (variant); |
6737 | 0 | } |
6738 | 0 | return value; |
6739 | 0 | } |
6740 | | |
6741 | | static void |
6742 | | gxdp_proxy_resolver_proxy_init (GXdpProxyResolverProxy *proxy) |
6743 | 0 | { |
6744 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
6745 | 0 | proxy->priv = gxdp_proxy_resolver_proxy_get_instance_private (proxy); |
6746 | | #else |
6747 | | proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_PROXY_RESOLVER_PROXY, GXdpProxyResolverProxyPrivate); |
6748 | | #endif |
6749 | |
|
6750 | 0 | g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_proxy_resolver_interface_info ()); |
6751 | 0 | } |
6752 | | |
6753 | | static void |
6754 | | gxdp_proxy_resolver_proxy_class_init (GXdpProxyResolverProxyClass *klass) |
6755 | 0 | { |
6756 | 0 | GObjectClass *gobject_class; |
6757 | 0 | GDBusProxyClass *proxy_class; |
6758 | |
|
6759 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
6760 | 0 | gobject_class->finalize = gxdp_proxy_resolver_proxy_finalize; |
6761 | 0 | gobject_class->get_property = gxdp_proxy_resolver_proxy_get_property; |
6762 | 0 | gobject_class->set_property = gxdp_proxy_resolver_proxy_set_property; |
6763 | |
|
6764 | 0 | proxy_class = G_DBUS_PROXY_CLASS (klass); |
6765 | 0 | proxy_class->g_signal = gxdp_proxy_resolver_proxy_g_signal; |
6766 | 0 | proxy_class->g_properties_changed = gxdp_proxy_resolver_proxy_g_properties_changed; |
6767 | |
|
6768 | 0 | gxdp_proxy_resolver_override_properties (gobject_class, 1); |
6769 | |
|
6770 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
6771 | | g_type_class_add_private (klass, sizeof (GXdpProxyResolverProxyPrivate)); |
6772 | | #endif |
6773 | 0 | } |
6774 | | |
6775 | | static void |
6776 | | gxdp_proxy_resolver_proxy_iface_init (GXdpProxyResolverIface *iface) |
6777 | 0 | { |
6778 | 0 | iface->get_version = gxdp_proxy_resolver_proxy_get_version; |
6779 | 0 | } |
6780 | | |
6781 | | /** |
6782 | | * gxdp_proxy_resolver_proxy_new: |
6783 | | * @connection: A #GDBusConnection. |
6784 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
6785 | | * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
6786 | | * @object_path: An object path. |
6787 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
6788 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
6789 | | * @user_data: User data to pass to @callback. |
6790 | | * |
6791 | | * 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. |
6792 | | * |
6793 | | * 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()). |
6794 | | * You can then call gxdp_proxy_resolver_proxy_new_finish() to get the result of the operation. |
6795 | | * |
6796 | | * See gxdp_proxy_resolver_proxy_new_sync() for the synchronous, blocking version of this constructor. |
6797 | | */ |
6798 | | void |
6799 | | gxdp_proxy_resolver_proxy_new ( |
6800 | | GDBusConnection *connection, |
6801 | | GDBusProxyFlags flags, |
6802 | | const gchar *name, |
6803 | | const gchar *object_path, |
6804 | | GCancellable *cancellable, |
6805 | | GAsyncReadyCallback callback, |
6806 | | gpointer user_data) |
6807 | 0 | { |
6808 | 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); |
6809 | 0 | } |
6810 | | |
6811 | | /** |
6812 | | * gxdp_proxy_resolver_proxy_new_finish: |
6813 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_proxy_new(). |
6814 | | * @error: Return location for error or %NULL |
6815 | | * |
6816 | | * Finishes an operation started with gxdp_proxy_resolver_proxy_new(). |
6817 | | * |
6818 | | * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set. |
6819 | | */ |
6820 | | GXdpProxyResolver * |
6821 | | gxdp_proxy_resolver_proxy_new_finish ( |
6822 | | GAsyncResult *res, |
6823 | | GError **error) |
6824 | 0 | { |
6825 | 0 | GObject *ret; |
6826 | 0 | GObject *source_object; |
6827 | 0 | source_object = g_async_result_get_source_object (res); |
6828 | 0 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
6829 | 0 | g_object_unref (source_object); |
6830 | 0 | if (ret != NULL) |
6831 | 0 | return GXDP_PROXY_RESOLVER (ret); |
6832 | 0 | else |
6833 | 0 | return NULL; |
6834 | 0 | } |
6835 | | |
6836 | | /** |
6837 | | * gxdp_proxy_resolver_proxy_new_sync: |
6838 | | * @connection: A #GDBusConnection. |
6839 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
6840 | | * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
6841 | | * @object_path: An object path. |
6842 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
6843 | | * @error: Return location for error or %NULL |
6844 | | * |
6845 | | * 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. |
6846 | | * |
6847 | | * The calling thread is blocked until a reply is received. |
6848 | | * |
6849 | | * See gxdp_proxy_resolver_proxy_new() for the asynchronous version of this constructor. |
6850 | | * |
6851 | | * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set. |
6852 | | */ |
6853 | | GXdpProxyResolver * |
6854 | | gxdp_proxy_resolver_proxy_new_sync ( |
6855 | | GDBusConnection *connection, |
6856 | | GDBusProxyFlags flags, |
6857 | | const gchar *name, |
6858 | | const gchar *object_path, |
6859 | | GCancellable *cancellable, |
6860 | | GError **error) |
6861 | 0 | { |
6862 | 0 | GInitable *ret; |
6863 | 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); |
6864 | 0 | if (ret != NULL) |
6865 | 0 | return GXDP_PROXY_RESOLVER (ret); |
6866 | 0 | else |
6867 | 0 | return NULL; |
6868 | 0 | } |
6869 | | |
6870 | | |
6871 | | /** |
6872 | | * gxdp_proxy_resolver_proxy_new_for_bus: |
6873 | | * @bus_type: A #GBusType. |
6874 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
6875 | | * @name: A bus name (well-known or unique). |
6876 | | * @object_path: An object path. |
6877 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
6878 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
6879 | | * @user_data: User data to pass to @callback. |
6880 | | * |
6881 | | * Like gxdp_proxy_resolver_proxy_new() but takes a #GBusType instead of a #GDBusConnection. |
6882 | | * |
6883 | | * 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()). |
6884 | | * You can then call gxdp_proxy_resolver_proxy_new_for_bus_finish() to get the result of the operation. |
6885 | | * |
6886 | | * See gxdp_proxy_resolver_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. |
6887 | | */ |
6888 | | void |
6889 | | gxdp_proxy_resolver_proxy_new_for_bus ( |
6890 | | GBusType bus_type, |
6891 | | GDBusProxyFlags flags, |
6892 | | const gchar *name, |
6893 | | const gchar *object_path, |
6894 | | GCancellable *cancellable, |
6895 | | GAsyncReadyCallback callback, |
6896 | | gpointer user_data) |
6897 | 0 | { |
6898 | 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); |
6899 | 0 | } |
6900 | | |
6901 | | /** |
6902 | | * gxdp_proxy_resolver_proxy_new_for_bus_finish: |
6903 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_proxy_new_for_bus(). |
6904 | | * @error: Return location for error or %NULL |
6905 | | * |
6906 | | * Finishes an operation started with gxdp_proxy_resolver_proxy_new_for_bus(). |
6907 | | * |
6908 | | * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set. |
6909 | | */ |
6910 | | GXdpProxyResolver * |
6911 | | gxdp_proxy_resolver_proxy_new_for_bus_finish ( |
6912 | | GAsyncResult *res, |
6913 | | GError **error) |
6914 | 0 | { |
6915 | 0 | GObject *ret; |
6916 | 0 | GObject *source_object; |
6917 | 0 | source_object = g_async_result_get_source_object (res); |
6918 | 0 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
6919 | 0 | g_object_unref (source_object); |
6920 | 0 | if (ret != NULL) |
6921 | 0 | return GXDP_PROXY_RESOLVER (ret); |
6922 | 0 | else |
6923 | 0 | return NULL; |
6924 | 0 | } |
6925 | | |
6926 | | /** |
6927 | | * gxdp_proxy_resolver_proxy_new_for_bus_sync: |
6928 | | * @bus_type: A #GBusType. |
6929 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
6930 | | * @name: A bus name (well-known or unique). |
6931 | | * @object_path: An object path. |
6932 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
6933 | | * @error: Return location for error or %NULL |
6934 | | * |
6935 | | * Like gxdp_proxy_resolver_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. |
6936 | | * |
6937 | | * The calling thread is blocked until a reply is received. |
6938 | | * |
6939 | | * See gxdp_proxy_resolver_proxy_new_for_bus() for the asynchronous version of this constructor. |
6940 | | * |
6941 | | * Returns: (transfer full) (type GXdpProxyResolverProxy): The constructed proxy object or %NULL if @error is set. |
6942 | | */ |
6943 | | GXdpProxyResolver * |
6944 | | gxdp_proxy_resolver_proxy_new_for_bus_sync ( |
6945 | | GBusType bus_type, |
6946 | | GDBusProxyFlags flags, |
6947 | | const gchar *name, |
6948 | | const gchar *object_path, |
6949 | | GCancellable *cancellable, |
6950 | | GError **error) |
6951 | 0 | { |
6952 | 0 | GInitable *ret; |
6953 | 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); |
6954 | 0 | if (ret != NULL) |
6955 | 0 | return GXDP_PROXY_RESOLVER (ret); |
6956 | 0 | else |
6957 | 0 | return NULL; |
6958 | 0 | } |
6959 | | |
6960 | | |
6961 | | /* ------------------------------------------------------------------------ */ |
6962 | | |
6963 | | /** |
6964 | | * GXdpProxyResolverSkeleton: |
6965 | | * |
6966 | | * The #GXdpProxyResolverSkeleton structure contains only private data and should only be accessed using the provided API. |
6967 | | */ |
6968 | | |
6969 | | /** |
6970 | | * GXdpProxyResolverSkeletonClass: |
6971 | | * @parent_class: The parent class. |
6972 | | * |
6973 | | * Class structure for #GXdpProxyResolverSkeleton. |
6974 | | */ |
6975 | | |
6976 | | struct _GXdpProxyResolverSkeletonPrivate |
6977 | | { |
6978 | | GValue *properties; |
6979 | | GList *changed_properties; |
6980 | | GSource *changed_properties_idle_source; |
6981 | | GMainContext *context; |
6982 | | GMutex lock; |
6983 | | }; |
6984 | | |
6985 | | static void |
6986 | | _gxdp_proxy_resolver_skeleton_handle_method_call ( |
6987 | | GDBusConnection *connection G_GNUC_UNUSED, |
6988 | | const gchar *sender G_GNUC_UNUSED, |
6989 | | const gchar *object_path G_GNUC_UNUSED, |
6990 | | const gchar *interface_name, |
6991 | | const gchar *method_name, |
6992 | | GVariant *parameters, |
6993 | | GDBusMethodInvocation *invocation, |
6994 | | gpointer user_data) |
6995 | 0 | { |
6996 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data); |
6997 | 0 | _ExtendedGDBusMethodInfo *info; |
6998 | 0 | GVariantIter iter; |
6999 | 0 | GVariant *child; |
7000 | 0 | GValue *paramv; |
7001 | 0 | gsize num_params; |
7002 | 0 | guint num_extra; |
7003 | 0 | gsize n; |
7004 | 0 | guint signal_id; |
7005 | 0 | GValue return_value = G_VALUE_INIT; |
7006 | 0 | info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); |
7007 | 0 | g_assert (info != NULL); |
7008 | 0 | num_params = g_variant_n_children (parameters); |
7009 | 0 | num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); |
7010 | 0 | n = 0; |
7011 | 0 | g_value_init (¶mv[n], GXDP_TYPE_PROXY_RESOLVER); |
7012 | 0 | g_value_set_object (¶mv[n++], skeleton); |
7013 | 0 | g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); |
7014 | 0 | g_value_set_object (¶mv[n++], invocation); |
7015 | 0 | if (info->pass_fdlist) |
7016 | 0 | { |
7017 | 0 | #ifdef G_OS_UNIX |
7018 | 0 | g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); |
7019 | 0 | g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); |
7020 | | #else |
7021 | | g_assert_not_reached (); |
7022 | | #endif |
7023 | 0 | } |
7024 | 0 | g_variant_iter_init (&iter, parameters); |
7025 | 0 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
7026 | 0 | { |
7027 | 0 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; |
7028 | 0 | if (arg_info->use_gvariant) |
7029 | 0 | { |
7030 | 0 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
7031 | 0 | g_value_set_variant (¶mv[n], child); |
7032 | 0 | n++; |
7033 | 0 | } |
7034 | 0 | else |
7035 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
7036 | 0 | g_variant_unref (child); |
7037 | 0 | } |
7038 | 0 | signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_PROXY_RESOLVER); |
7039 | 0 | g_value_init (&return_value, G_TYPE_BOOLEAN); |
7040 | 0 | g_signal_emitv (paramv, signal_id, 0, &return_value); |
7041 | 0 | if (!g_value_get_boolean (&return_value)) |
7042 | 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); |
7043 | 0 | g_value_unset (&return_value); |
7044 | 0 | for (n = 0; n < num_params + num_extra; n++) |
7045 | 0 | g_value_unset (¶mv[n]); |
7046 | 0 | g_free (paramv); |
7047 | 0 | } |
7048 | | |
7049 | | static GVariant * |
7050 | | _gxdp_proxy_resolver_skeleton_handle_get_property ( |
7051 | | GDBusConnection *connection G_GNUC_UNUSED, |
7052 | | const gchar *sender G_GNUC_UNUSED, |
7053 | | const gchar *object_path G_GNUC_UNUSED, |
7054 | | const gchar *interface_name G_GNUC_UNUSED, |
7055 | | const gchar *property_name, |
7056 | | GError **error, |
7057 | | gpointer user_data) |
7058 | 0 | { |
7059 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data); |
7060 | 0 | GValue value = G_VALUE_INIT; |
7061 | 0 | GParamSpec *pspec; |
7062 | 0 | _ExtendedGDBusPropertyInfo *info; |
7063 | 0 | GVariant *ret; |
7064 | 0 | ret = NULL; |
7065 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, property_name); |
7066 | 0 | g_assert (info != NULL); |
7067 | 0 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
7068 | 0 | if (pspec == NULL) |
7069 | 0 | { |
7070 | 0 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
7071 | 0 | } |
7072 | 0 | else |
7073 | 0 | { |
7074 | 0 | g_value_init (&value, pspec->value_type); |
7075 | 0 | g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
7076 | 0 | ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); |
7077 | 0 | g_value_unset (&value); |
7078 | 0 | } |
7079 | 0 | return ret; |
7080 | 0 | } |
7081 | | |
7082 | | static gboolean |
7083 | | _gxdp_proxy_resolver_skeleton_handle_set_property ( |
7084 | | GDBusConnection *connection G_GNUC_UNUSED, |
7085 | | const gchar *sender G_GNUC_UNUSED, |
7086 | | const gchar *object_path G_GNUC_UNUSED, |
7087 | | const gchar *interface_name G_GNUC_UNUSED, |
7088 | | const gchar *property_name, |
7089 | | GVariant *variant, |
7090 | | GError **error, |
7091 | | gpointer user_data) |
7092 | 0 | { |
7093 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data); |
7094 | 0 | GValue value = G_VALUE_INIT; |
7095 | 0 | GParamSpec *pspec; |
7096 | 0 | _ExtendedGDBusPropertyInfo *info; |
7097 | 0 | gboolean ret; |
7098 | 0 | ret = FALSE; |
7099 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_proxy_resolver_interface_info.parent_struct, property_name); |
7100 | 0 | g_assert (info != NULL); |
7101 | 0 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
7102 | 0 | if (pspec == NULL) |
7103 | 0 | { |
7104 | 0 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
7105 | 0 | } |
7106 | 0 | else |
7107 | 0 | { |
7108 | 0 | if (info->use_gvariant) |
7109 | 0 | g_value_set_variant (&value, variant); |
7110 | 0 | else |
7111 | 0 | g_dbus_gvariant_to_gvalue (variant, &value); |
7112 | 0 | g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
7113 | 0 | g_value_unset (&value); |
7114 | 0 | ret = TRUE; |
7115 | 0 | } |
7116 | 0 | return ret; |
7117 | 0 | } |
7118 | | |
7119 | | static const GDBusInterfaceVTable _gxdp_proxy_resolver_skeleton_vtable = |
7120 | | { |
7121 | | _gxdp_proxy_resolver_skeleton_handle_method_call, |
7122 | | _gxdp_proxy_resolver_skeleton_handle_get_property, |
7123 | | _gxdp_proxy_resolver_skeleton_handle_set_property, |
7124 | | {NULL} |
7125 | | }; |
7126 | | |
7127 | | static GDBusInterfaceInfo * |
7128 | | gxdp_proxy_resolver_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
7129 | 0 | { |
7130 | 0 | return gxdp_proxy_resolver_interface_info (); |
7131 | 0 | } |
7132 | | |
7133 | | static GDBusInterfaceVTable * |
7134 | | gxdp_proxy_resolver_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
7135 | 0 | { |
7136 | 0 | return (GDBusInterfaceVTable *) &_gxdp_proxy_resolver_skeleton_vtable; |
7137 | 0 | } |
7138 | | |
7139 | | static GVariant * |
7140 | | gxdp_proxy_resolver_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) |
7141 | 0 | { |
7142 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (_skeleton); |
7143 | |
|
7144 | 0 | GVariantBuilder builder; |
7145 | 0 | guint n; |
7146 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 |
7147 | 0 | g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); |
7148 | | #else |
7149 | | g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}")); |
7150 | | #endif |
7151 | 0 | if (_gxdp_proxy_resolver_interface_info.parent_struct.properties == NULL) |
7152 | 0 | goto out; |
7153 | 0 | for (n = 0; _gxdp_proxy_resolver_interface_info.parent_struct.properties[n] != NULL; n++) |
7154 | 0 | { |
7155 | 0 | GDBusPropertyInfo *info = _gxdp_proxy_resolver_interface_info.parent_struct.properties[n]; |
7156 | 0 | if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) |
7157 | 0 | { |
7158 | 0 | GVariant *value; |
7159 | 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); |
7160 | 0 | if (value != NULL) |
7161 | 0 | { |
7162 | 0 | g_variant_take_ref (value); |
7163 | 0 | g_variant_builder_add (&builder, "{sv}", info->name, value); |
7164 | 0 | g_variant_unref (value); |
7165 | 0 | } |
7166 | 0 | } |
7167 | 0 | } |
7168 | 0 | out: |
7169 | 0 | return g_variant_builder_end (&builder); |
7170 | 0 | } |
7171 | | |
7172 | | static gboolean _gxdp_proxy_resolver_emit_changed (gpointer user_data); |
7173 | | |
7174 | | static void |
7175 | | gxdp_proxy_resolver_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) |
7176 | 0 | { |
7177 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (_skeleton); |
7178 | 0 | gboolean emit_changed = FALSE; |
7179 | |
|
7180 | 0 | g_mutex_lock (&skeleton->priv->lock); |
7181 | 0 | if (skeleton->priv->changed_properties_idle_source != NULL) |
7182 | 0 | { |
7183 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
7184 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
7185 | 0 | emit_changed = TRUE; |
7186 | 0 | } |
7187 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
7188 | |
|
7189 | 0 | if (emit_changed) |
7190 | 0 | _gxdp_proxy_resolver_emit_changed (skeleton); |
7191 | 0 | } |
7192 | | |
7193 | | static void gxdp_proxy_resolver_skeleton_iface_init (GXdpProxyResolverIface *iface); |
7194 | | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
7195 | | G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverSkeleton, gxdp_proxy_resolver_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
7196 | | G_ADD_PRIVATE (GXdpProxyResolverSkeleton) |
7197 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_skeleton_iface_init)) |
7198 | | |
7199 | | #else |
7200 | | G_DEFINE_TYPE_WITH_CODE (GXdpProxyResolverSkeleton, gxdp_proxy_resolver_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
7201 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_PROXY_RESOLVER, gxdp_proxy_resolver_skeleton_iface_init)) |
7202 | | |
7203 | | #endif |
7204 | | static void |
7205 | | gxdp_proxy_resolver_skeleton_finalize (GObject *object) |
7206 | 0 | { |
7207 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); |
7208 | 0 | guint n; |
7209 | 0 | for (n = 0; n < 1; n++) |
7210 | 0 | g_value_unset (&skeleton->priv->properties[n]); |
7211 | 0 | g_free (skeleton->priv->properties); |
7212 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
7213 | 0 | if (skeleton->priv->changed_properties_idle_source != NULL) |
7214 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
7215 | 0 | g_main_context_unref (skeleton->priv->context); |
7216 | 0 | g_mutex_clear (&skeleton->priv->lock); |
7217 | 0 | G_OBJECT_CLASS (gxdp_proxy_resolver_skeleton_parent_class)->finalize (object); |
7218 | 0 | } |
7219 | | |
7220 | | static void |
7221 | | gxdp_proxy_resolver_skeleton_get_property (GObject *object, |
7222 | | guint prop_id, |
7223 | | GValue *value, |
7224 | | GParamSpec *pspec G_GNUC_UNUSED) |
7225 | 0 | { |
7226 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); |
7227 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
7228 | 0 | g_mutex_lock (&skeleton->priv->lock); |
7229 | 0 | g_value_copy (&skeleton->priv->properties[prop_id - 1], value); |
7230 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
7231 | 0 | } |
7232 | | |
7233 | | static gboolean |
7234 | | _gxdp_proxy_resolver_emit_changed (gpointer user_data) |
7235 | 0 | { |
7236 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (user_data); |
7237 | 0 | GList *l; |
7238 | 0 | GVariantBuilder builder; |
7239 | 0 | GVariantBuilder invalidated_builder; |
7240 | 0 | guint num_changes; |
7241 | |
|
7242 | 0 | g_mutex_lock (&skeleton->priv->lock); |
7243 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 |
7244 | 0 | g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); |
7245 | 0 | g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as")); |
7246 | | #else |
7247 | | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
7248 | | g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); |
7249 | | #endif |
7250 | 0 | for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) |
7251 | 0 | { |
7252 | 0 | ChangedProperty *cp = l->data; |
7253 | 0 | GVariant *variant; |
7254 | 0 | const GValue *cur_value; |
7255 | |
|
7256 | 0 | cur_value = &skeleton->priv->properties[cp->prop_id - 1]; |
7257 | 0 | if (!_g_value_equal (cur_value, &cp->orig_value)) |
7258 | 0 | { |
7259 | 0 | variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); |
7260 | 0 | g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); |
7261 | 0 | g_variant_unref (variant); |
7262 | 0 | num_changes++; |
7263 | 0 | } |
7264 | 0 | } |
7265 | 0 | if (num_changes > 0) |
7266 | 0 | { |
7267 | 0 | GList *connections, *ll; |
7268 | 0 | GVariant *signal_variant; |
7269 | 0 | signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.ProxyResolver", |
7270 | 0 | &builder, &invalidated_builder)); |
7271 | 0 | connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); |
7272 | 0 | for (ll = connections; ll != NULL; ll = ll->next) |
7273 | 0 | { |
7274 | 0 | GDBusConnection *connection = ll->data; |
7275 | |
|
7276 | 0 | g_dbus_connection_emit_signal (connection, |
7277 | 0 | NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), |
7278 | 0 | "org.freedesktop.DBus.Properties", |
7279 | 0 | "PropertiesChanged", |
7280 | 0 | signal_variant, |
7281 | 0 | NULL); |
7282 | 0 | } |
7283 | 0 | g_variant_unref (signal_variant); |
7284 | 0 | g_list_free_full (connections, g_object_unref); |
7285 | 0 | } |
7286 | 0 | else |
7287 | 0 | { |
7288 | 0 | g_variant_builder_clear (&builder); |
7289 | 0 | g_variant_builder_clear (&invalidated_builder); |
7290 | 0 | } |
7291 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
7292 | 0 | skeleton->priv->changed_properties = NULL; |
7293 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
7294 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
7295 | 0 | return FALSE; |
7296 | 0 | } |
7297 | | |
7298 | | static void |
7299 | | _gxdp_proxy_resolver_schedule_emit_changed (GXdpProxyResolverSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) |
7300 | 0 | { |
7301 | 0 | ChangedProperty *cp; |
7302 | 0 | GList *l; |
7303 | 0 | cp = NULL; |
7304 | 0 | for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) |
7305 | 0 | { |
7306 | 0 | ChangedProperty *i_cp = l->data; |
7307 | 0 | if (i_cp->info == info) |
7308 | 0 | { |
7309 | 0 | cp = i_cp; |
7310 | 0 | break; |
7311 | 0 | } |
7312 | 0 | } |
7313 | 0 | if (cp == NULL) |
7314 | 0 | { |
7315 | 0 | cp = g_new0 (ChangedProperty, 1); |
7316 | 0 | cp->prop_id = prop_id; |
7317 | 0 | cp->info = info; |
7318 | 0 | skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); |
7319 | 0 | g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); |
7320 | 0 | g_value_copy (orig_value, &cp->orig_value); |
7321 | 0 | } |
7322 | 0 | } |
7323 | | |
7324 | | static void |
7325 | | gxdp_proxy_resolver_skeleton_notify (GObject *object, |
7326 | | GParamSpec *pspec G_GNUC_UNUSED) |
7327 | 0 | { |
7328 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); |
7329 | 0 | g_mutex_lock (&skeleton->priv->lock); |
7330 | 0 | if (skeleton->priv->changed_properties != NULL && |
7331 | 0 | skeleton->priv->changed_properties_idle_source == NULL) |
7332 | 0 | { |
7333 | 0 | skeleton->priv->changed_properties_idle_source = g_idle_source_new (); |
7334 | 0 | g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); |
7335 | 0 | g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_proxy_resolver_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); |
7336 | 0 | g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_proxy_resolver_emit_changed"); |
7337 | 0 | g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); |
7338 | 0 | g_source_unref (skeleton->priv->changed_properties_idle_source); |
7339 | 0 | } |
7340 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
7341 | 0 | } |
7342 | | |
7343 | | static void |
7344 | | gxdp_proxy_resolver_skeleton_set_property (GObject *object, |
7345 | | guint prop_id, |
7346 | | const GValue *value, |
7347 | | GParamSpec *pspec) |
7348 | 0 | { |
7349 | 0 | const _ExtendedGDBusPropertyInfo *info; |
7350 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); |
7351 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
7352 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_proxy_resolver_property_info_pointers[prop_id - 1]; |
7353 | 0 | g_mutex_lock (&skeleton->priv->lock); |
7354 | 0 | g_object_freeze_notify (object); |
7355 | 0 | if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) |
7356 | 0 | { |
7357 | 0 | if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && |
7358 | 0 | info->emits_changed_signal) |
7359 | 0 | _gxdp_proxy_resolver_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); |
7360 | 0 | g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); |
7361 | 0 | g_object_notify_by_pspec (object, pspec); |
7362 | 0 | } |
7363 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
7364 | 0 | g_object_thaw_notify (object); |
7365 | 0 | } |
7366 | | |
7367 | | static void |
7368 | | gxdp_proxy_resolver_skeleton_init (GXdpProxyResolverSkeleton *skeleton) |
7369 | 0 | { |
7370 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
7371 | 0 | skeleton->priv = gxdp_proxy_resolver_skeleton_get_instance_private (skeleton); |
7372 | | #else |
7373 | | skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_PROXY_RESOLVER_SKELETON, GXdpProxyResolverSkeletonPrivate); |
7374 | | #endif |
7375 | |
|
7376 | 0 | g_mutex_init (&skeleton->priv->lock); |
7377 | 0 | skeleton->priv->context = g_main_context_ref_thread_default (); |
7378 | 0 | skeleton->priv->properties = g_new0 (GValue, 1); |
7379 | 0 | g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT); |
7380 | 0 | } |
7381 | | |
7382 | | static guint |
7383 | | gxdp_proxy_resolver_skeleton_get_version (GXdpProxyResolver *object) |
7384 | 0 | { |
7385 | 0 | GXdpProxyResolverSkeleton *skeleton = GXDP_PROXY_RESOLVER_SKELETON (object); |
7386 | 0 | guint value; |
7387 | 0 | g_mutex_lock (&skeleton->priv->lock); |
7388 | 0 | value = g_marshal_value_peek_uint (&(skeleton->priv->properties[0])); |
7389 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
7390 | 0 | return value; |
7391 | 0 | } |
7392 | | |
7393 | | static void |
7394 | | gxdp_proxy_resolver_skeleton_class_init (GXdpProxyResolverSkeletonClass *klass) |
7395 | 0 | { |
7396 | 0 | GObjectClass *gobject_class; |
7397 | 0 | GDBusInterfaceSkeletonClass *skeleton_class; |
7398 | |
|
7399 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
7400 | 0 | gobject_class->finalize = gxdp_proxy_resolver_skeleton_finalize; |
7401 | 0 | gobject_class->get_property = gxdp_proxy_resolver_skeleton_get_property; |
7402 | 0 | gobject_class->set_property = gxdp_proxy_resolver_skeleton_set_property; |
7403 | 0 | gobject_class->notify = gxdp_proxy_resolver_skeleton_notify; |
7404 | | |
7405 | |
|
7406 | 0 | gxdp_proxy_resolver_override_properties (gobject_class, 1); |
7407 | |
|
7408 | 0 | skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); |
7409 | 0 | skeleton_class->get_info = gxdp_proxy_resolver_skeleton_dbus_interface_get_info; |
7410 | 0 | skeleton_class->get_properties = gxdp_proxy_resolver_skeleton_dbus_interface_get_properties; |
7411 | 0 | skeleton_class->flush = gxdp_proxy_resolver_skeleton_dbus_interface_flush; |
7412 | 0 | skeleton_class->get_vtable = gxdp_proxy_resolver_skeleton_dbus_interface_get_vtable; |
7413 | |
|
7414 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
7415 | | g_type_class_add_private (klass, sizeof (GXdpProxyResolverSkeletonPrivate)); |
7416 | | #endif |
7417 | 0 | } |
7418 | | |
7419 | | static void |
7420 | | gxdp_proxy_resolver_skeleton_iface_init (GXdpProxyResolverIface *iface) |
7421 | 0 | { |
7422 | 0 | iface->get_version = gxdp_proxy_resolver_skeleton_get_version; |
7423 | 0 | } |
7424 | | |
7425 | | /** |
7426 | | * gxdp_proxy_resolver_skeleton_new: |
7427 | | * |
7428 | | * 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>. |
7429 | | * |
7430 | | * Returns: (transfer full) (type GXdpProxyResolverSkeleton): The skeleton object. |
7431 | | */ |
7432 | | GXdpProxyResolver * |
7433 | | gxdp_proxy_resolver_skeleton_new (void) |
7434 | 0 | { |
7435 | 0 | return GXDP_PROXY_RESOLVER (g_object_new (GXDP_TYPE_PROXY_RESOLVER_SKELETON, NULL)); |
7436 | 0 | } |
7437 | | |
7438 | | /* ------------------------------------------------------------------------ |
7439 | | * Code for interface org.freedesktop.portal.Trash |
7440 | | * ------------------------------------------------------------------------ |
7441 | | */ |
7442 | | |
7443 | | /** |
7444 | | * SECTION:GXdpTrash |
7445 | | * @title: GXdpTrash |
7446 | | * @short_description: Generated C code for the org.freedesktop.portal.Trash D-Bus interface |
7447 | | * |
7448 | | * 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. |
7449 | | */ |
7450 | | |
7451 | | /* ---- Introspection data for org.freedesktop.portal.Trash ---- */ |
7452 | | |
7453 | | static const _ExtendedGDBusArgInfo _gxdp_trash_method_info_trash_file_IN_ARG_fd = |
7454 | | { |
7455 | | { |
7456 | | -1, |
7457 | | (gchar *) "fd", |
7458 | | (gchar *) "h", |
7459 | | NULL |
7460 | | }, |
7461 | | FALSE |
7462 | | }; |
7463 | | |
7464 | | static const GDBusArgInfo * const _gxdp_trash_method_info_trash_file_IN_ARG_pointers[] = |
7465 | | { |
7466 | | &_gxdp_trash_method_info_trash_file_IN_ARG_fd.parent_struct, |
7467 | | NULL |
7468 | | }; |
7469 | | |
7470 | | static const _ExtendedGDBusArgInfo _gxdp_trash_method_info_trash_file_OUT_ARG_result = |
7471 | | { |
7472 | | { |
7473 | | -1, |
7474 | | (gchar *) "result", |
7475 | | (gchar *) "u", |
7476 | | NULL |
7477 | | }, |
7478 | | FALSE |
7479 | | }; |
7480 | | |
7481 | | static const GDBusArgInfo * const _gxdp_trash_method_info_trash_file_OUT_ARG_pointers[] = |
7482 | | { |
7483 | | &_gxdp_trash_method_info_trash_file_OUT_ARG_result.parent_struct, |
7484 | | NULL |
7485 | | }; |
7486 | | |
7487 | | static const _ExtendedGDBusMethodInfo _gxdp_trash_method_info_trash_file = |
7488 | | { |
7489 | | { |
7490 | | -1, |
7491 | | (gchar *) "TrashFile", |
7492 | | (GDBusArgInfo **) &_gxdp_trash_method_info_trash_file_IN_ARG_pointers, |
7493 | | (GDBusArgInfo **) &_gxdp_trash_method_info_trash_file_OUT_ARG_pointers, |
7494 | | NULL |
7495 | | }, |
7496 | | "handle-trash-file", |
7497 | | TRUE |
7498 | | }; |
7499 | | |
7500 | | static const GDBusMethodInfo * const _gxdp_trash_method_info_pointers[] = |
7501 | | { |
7502 | | &_gxdp_trash_method_info_trash_file.parent_struct, |
7503 | | NULL |
7504 | | }; |
7505 | | |
7506 | | static const _ExtendedGDBusPropertyInfo _gxdp_trash_property_info_version = |
7507 | | { |
7508 | | { |
7509 | | -1, |
7510 | | (gchar *) "version", |
7511 | | (gchar *) "u", |
7512 | | G_DBUS_PROPERTY_INFO_FLAGS_READABLE, |
7513 | | NULL |
7514 | | }, |
7515 | | "version", |
7516 | | FALSE, |
7517 | | TRUE |
7518 | | }; |
7519 | | |
7520 | | static const GDBusPropertyInfo * const _gxdp_trash_property_info_pointers[] = |
7521 | | { |
7522 | | &_gxdp_trash_property_info_version.parent_struct, |
7523 | | NULL |
7524 | | }; |
7525 | | |
7526 | | static const _ExtendedGDBusInterfaceInfo _gxdp_trash_interface_info = |
7527 | | { |
7528 | | { |
7529 | | -1, |
7530 | | (gchar *) "org.freedesktop.portal.Trash", |
7531 | | (GDBusMethodInfo **) &_gxdp_trash_method_info_pointers, |
7532 | | NULL, |
7533 | | (GDBusPropertyInfo **) &_gxdp_trash_property_info_pointers, |
7534 | | NULL |
7535 | | }, |
7536 | | "trash", |
7537 | | }; |
7538 | | |
7539 | | |
7540 | | /** |
7541 | | * gxdp_trash_interface_info: |
7542 | | * |
7543 | | * 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. |
7544 | | * |
7545 | | * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. |
7546 | | */ |
7547 | | GDBusInterfaceInfo * |
7548 | | gxdp_trash_interface_info (void) |
7549 | 0 | { |
7550 | 0 | return (GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct; |
7551 | 0 | } |
7552 | | |
7553 | | /** |
7554 | | * gxdp_trash_override_properties: |
7555 | | * @klass: The class structure for a #GObject derived class. |
7556 | | * @property_id_begin: The property id to assign to the first overridden property. |
7557 | | * |
7558 | | * Overrides all #GObject properties in the #GXdpTrash interface for a concrete class. |
7559 | | * The properties are overridden in the order they are defined. |
7560 | | * |
7561 | | * Returns: The last property id. |
7562 | | */ |
7563 | | guint |
7564 | | gxdp_trash_override_properties (GObjectClass *klass, guint property_id_begin) |
7565 | 0 | { |
7566 | 0 | g_object_class_override_property (klass, property_id_begin++, "version"); |
7567 | 0 | return property_id_begin - 1; |
7568 | 0 | } |
7569 | | |
7570 | | |
7571 | | inline static void |
7572 | | gxdp_trash_method_marshal_trash_file ( |
7573 | | GClosure *closure, |
7574 | | GValue *return_value, |
7575 | | unsigned int n_param_values, |
7576 | | const GValue *param_values, |
7577 | | void *invocation_hint, |
7578 | | void *marshal_data) |
7579 | 0 | { |
7580 | 0 | _g_dbus_codegen_marshal_BOOLEAN__OBJECT_OBJECT_VARIANT (closure, |
7581 | 0 | return_value, n_param_values, param_values, invocation_hint, marshal_data); |
7582 | 0 | } |
7583 | | |
7584 | | |
7585 | | /** |
7586 | | * GXdpTrash: |
7587 | | * |
7588 | | * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link>. |
7589 | | */ |
7590 | | |
7591 | | /** |
7592 | | * GXdpTrashIface: |
7593 | | * @parent_iface: The parent interface. |
7594 | | * @handle_trash_file: Handler for the #GXdpTrash::handle-trash-file signal. |
7595 | | * @get_version: Getter for the #GXdpTrash:version property. |
7596 | | * |
7597 | | * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Trash.top_of_page">org.freedesktop.portal.Trash</link>. |
7598 | | */ |
7599 | | |
7600 | | typedef GXdpTrashIface GXdpTrashInterface; |
7601 | | G_DEFINE_INTERFACE (GXdpTrash, gxdp_trash, G_TYPE_OBJECT) |
7602 | | |
7603 | | static void |
7604 | | gxdp_trash_default_init (GXdpTrashIface *iface) |
7605 | 0 | { |
7606 | | /* GObject signals for incoming D-Bus method calls: */ |
7607 | | /** |
7608 | | * GXdpTrash::handle-trash-file: |
7609 | | * @object: A #GXdpTrash. |
7610 | | * @invocation: A #GDBusMethodInvocation. |
7611 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
7612 | | * @arg_fd: Argument passed by remote caller. |
7613 | | * |
7614 | | * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Trash.TrashFile">TrashFile()</link> D-Bus method. |
7615 | | * |
7616 | | * 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. |
7617 | | * |
7618 | | * 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. |
7619 | | */ |
7620 | 0 | g_signal_new ("handle-trash-file", |
7621 | 0 | G_TYPE_FROM_INTERFACE (iface), |
7622 | 0 | G_SIGNAL_RUN_LAST, |
7623 | 0 | G_STRUCT_OFFSET (GXdpTrashIface, handle_trash_file), |
7624 | 0 | g_signal_accumulator_true_handled, |
7625 | 0 | NULL, |
7626 | 0 | gxdp_trash_method_marshal_trash_file, |
7627 | 0 | G_TYPE_BOOLEAN, |
7628 | 0 | 3, |
7629 | 0 | G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT); |
7630 | | |
7631 | | /* GObject properties for D-Bus properties: */ |
7632 | | /** |
7633 | | * GXdpTrash:version: |
7634 | | * |
7635 | | * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-Trash.version">"version"</link>. |
7636 | | * |
7637 | | * 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. |
7638 | | */ |
7639 | 0 | g_object_interface_install_property (iface, |
7640 | 0 | g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
7641 | 0 | } |
7642 | | |
7643 | | /** |
7644 | | * gxdp_trash_get_version: (skip) |
7645 | | * @object: A #GXdpTrash. |
7646 | | * |
7647 | | * Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-Trash.version">"version"</link> D-Bus property. |
7648 | | * |
7649 | | * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. |
7650 | | * |
7651 | | * Returns: The property value. |
7652 | | */ |
7653 | | guint |
7654 | | gxdp_trash_get_version (GXdpTrash *object) |
7655 | 0 | { |
7656 | 0 | g_return_val_if_fail (GXDP_IS_TRASH (object), 0); |
7657 | | |
7658 | 0 | return GXDP_TRASH_GET_IFACE (object)->get_version (object); |
7659 | 0 | } |
7660 | | |
7661 | | /** |
7662 | | * gxdp_trash_set_version: (skip) |
7663 | | * @object: A #GXdpTrash. |
7664 | | * @value: The value to set. |
7665 | | * |
7666 | | * Sets the <link linkend="gdbus-property-org-freedesktop-portal-Trash.version">"version"</link> D-Bus property to @value. |
7667 | | * |
7668 | | * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. |
7669 | | */ |
7670 | | void |
7671 | | gxdp_trash_set_version (GXdpTrash *object, guint value) |
7672 | 0 | { |
7673 | 0 | g_object_set (G_OBJECT (object), "version", value, NULL); |
7674 | 0 | } |
7675 | | |
7676 | | /** |
7677 | | * gxdp_trash_call_trash_file: |
7678 | | * @proxy: A #GXdpTrashProxy. |
7679 | | * @arg_fd: Argument to pass with the method invocation. |
7680 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
7681 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
7682 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. |
7683 | | * @user_data: User data to pass to @callback. |
7684 | | * |
7685 | | * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Trash.TrashFile">TrashFile()</link> D-Bus method on @proxy. |
7686 | | * 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()). |
7687 | | * You can then call gxdp_trash_call_trash_file_finish() to get the result of the operation. |
7688 | | * |
7689 | | * See gxdp_trash_call_trash_file_sync() for the synchronous, blocking version of this method. |
7690 | | */ |
7691 | | void |
7692 | | gxdp_trash_call_trash_file ( |
7693 | | GXdpTrash *proxy, |
7694 | | GVariant *arg_fd, |
7695 | | GUnixFDList *fd_list, |
7696 | | GCancellable *cancellable, |
7697 | | GAsyncReadyCallback callback, |
7698 | | gpointer user_data) |
7699 | 0 | { |
7700 | 0 | g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy), |
7701 | 0 | "TrashFile", |
7702 | 0 | g_variant_new ("(@h)", |
7703 | 0 | arg_fd), |
7704 | 0 | G_DBUS_CALL_FLAGS_NONE, |
7705 | 0 | -1, |
7706 | 0 | fd_list, |
7707 | 0 | cancellable, |
7708 | 0 | callback, |
7709 | 0 | user_data); |
7710 | 0 | } |
7711 | | |
7712 | | /** |
7713 | | * gxdp_trash_call_trash_file_finish: |
7714 | | * @proxy: A #GXdpTrashProxy. |
7715 | | * @out_result: (out) (optional): Return location for return parameter or %NULL to ignore. |
7716 | | * @out_fd_list: (out) (optional) (nullable): Return location for a #GUnixFDList or %NULL to ignore. |
7717 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_call_trash_file(). |
7718 | | * @error: Return location for error or %NULL. |
7719 | | * |
7720 | | * Finishes an operation started with gxdp_trash_call_trash_file(). |
7721 | | * |
7722 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
7723 | | */ |
7724 | | gboolean |
7725 | | gxdp_trash_call_trash_file_finish ( |
7726 | | GXdpTrash *proxy, |
7727 | | guint *out_result, |
7728 | | GUnixFDList **out_fd_list, |
7729 | | GAsyncResult *res, |
7730 | | GError **error) |
7731 | 0 | { |
7732 | 0 | GVariant *_ret; |
7733 | 0 | _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error); |
7734 | 0 | if (_ret == NULL) |
7735 | 0 | goto _out; |
7736 | 0 | g_variant_get (_ret, |
7737 | 0 | "(u)", |
7738 | 0 | out_result); |
7739 | 0 | g_variant_unref (_ret); |
7740 | 0 | _out: |
7741 | 0 | return _ret != NULL; |
7742 | 0 | } |
7743 | | |
7744 | | /** |
7745 | | * gxdp_trash_call_trash_file_sync: |
7746 | | * @proxy: A #GXdpTrashProxy. |
7747 | | * @arg_fd: Argument to pass with the method invocation. |
7748 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
7749 | | * @out_result: (out) (optional): Return location for return parameter or %NULL to ignore. |
7750 | | * @out_fd_list: (out) (optional) (nullable): Return location for a #GUnixFDList or %NULL. |
7751 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
7752 | | * @error: Return location for error or %NULL. |
7753 | | * |
7754 | | * 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. |
7755 | | * |
7756 | | * See gxdp_trash_call_trash_file() for the asynchronous version of this method. |
7757 | | * |
7758 | | * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set. |
7759 | | */ |
7760 | | gboolean |
7761 | | gxdp_trash_call_trash_file_sync ( |
7762 | | GXdpTrash *proxy, |
7763 | | GVariant *arg_fd, |
7764 | | GUnixFDList *fd_list, |
7765 | | guint *out_result, |
7766 | | GUnixFDList **out_fd_list, |
7767 | | GCancellable *cancellable, |
7768 | | GError **error) |
7769 | 0 | { |
7770 | 0 | GVariant *_ret; |
7771 | 0 | _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy), |
7772 | 0 | "TrashFile", |
7773 | 0 | g_variant_new ("(@h)", |
7774 | 0 | arg_fd), |
7775 | 0 | G_DBUS_CALL_FLAGS_NONE, |
7776 | 0 | -1, |
7777 | 0 | fd_list, |
7778 | 0 | out_fd_list, |
7779 | 0 | cancellable, |
7780 | 0 | error); |
7781 | 0 | if (_ret == NULL) |
7782 | 0 | goto _out; |
7783 | 0 | g_variant_get (_ret, |
7784 | 0 | "(u)", |
7785 | 0 | out_result); |
7786 | 0 | g_variant_unref (_ret); |
7787 | 0 | _out: |
7788 | 0 | return _ret != NULL; |
7789 | 0 | } |
7790 | | |
7791 | | /** |
7792 | | * gxdp_trash_complete_trash_file: |
7793 | | * @object: A #GXdpTrash. |
7794 | | * @invocation: (transfer full): A #GDBusMethodInvocation. |
7795 | | * @fd_list: (nullable): A #GUnixFDList or %NULL. |
7796 | | * @result: Parameter to return. |
7797 | | * |
7798 | | * 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. |
7799 | | * |
7800 | | * This method will free @invocation, you cannot use it afterwards. |
7801 | | */ |
7802 | | void |
7803 | | gxdp_trash_complete_trash_file ( |
7804 | | GXdpTrash *object G_GNUC_UNUSED, |
7805 | | GDBusMethodInvocation *invocation, |
7806 | | GUnixFDList *fd_list, |
7807 | | guint result) |
7808 | 0 | { |
7809 | 0 | g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, |
7810 | 0 | g_variant_new ("(u)", |
7811 | 0 | result), |
7812 | 0 | fd_list); |
7813 | 0 | } |
7814 | | |
7815 | | /* ------------------------------------------------------------------------ */ |
7816 | | |
7817 | | /** |
7818 | | * GXdpTrashProxy: |
7819 | | * |
7820 | | * The #GXdpTrashProxy structure contains only private data and should only be accessed using the provided API. |
7821 | | */ |
7822 | | |
7823 | | /** |
7824 | | * GXdpTrashProxyClass: |
7825 | | * @parent_class: The parent class. |
7826 | | * |
7827 | | * Class structure for #GXdpTrashProxy. |
7828 | | */ |
7829 | | |
7830 | | struct _GXdpTrashProxyPrivate |
7831 | | { |
7832 | | GData *qdata; |
7833 | | }; |
7834 | | |
7835 | | static void gxdp_trash_proxy_iface_init (GXdpTrashIface *iface); |
7836 | | |
7837 | | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
7838 | | G_DEFINE_TYPE_WITH_CODE (GXdpTrashProxy, gxdp_trash_proxy, G_TYPE_DBUS_PROXY, |
7839 | | G_ADD_PRIVATE (GXdpTrashProxy) |
7840 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_proxy_iface_init)) |
7841 | | |
7842 | | #else |
7843 | | G_DEFINE_TYPE_WITH_CODE (GXdpTrashProxy, gxdp_trash_proxy, G_TYPE_DBUS_PROXY, |
7844 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_proxy_iface_init)) |
7845 | | |
7846 | | #endif |
7847 | | static void |
7848 | | gxdp_trash_proxy_finalize (GObject *object) |
7849 | 0 | { |
7850 | 0 | GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (object); |
7851 | 0 | g_datalist_clear (&proxy->priv->qdata); |
7852 | 0 | G_OBJECT_CLASS (gxdp_trash_proxy_parent_class)->finalize (object); |
7853 | 0 | } |
7854 | | |
7855 | | static void |
7856 | | gxdp_trash_proxy_get_property (GObject *object, |
7857 | | guint prop_id, |
7858 | | GValue *value, |
7859 | | GParamSpec *pspec G_GNUC_UNUSED) |
7860 | 0 | { |
7861 | 0 | const _ExtendedGDBusPropertyInfo *info; |
7862 | 0 | GVariant *variant; |
7863 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
7864 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1]; |
7865 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); |
7866 | 0 | if (info->use_gvariant) |
7867 | 0 | { |
7868 | 0 | g_value_set_variant (value, variant); |
7869 | 0 | } |
7870 | 0 | else |
7871 | 0 | { |
7872 | 0 | if (variant != NULL) |
7873 | 0 | g_dbus_gvariant_to_gvalue (variant, value); |
7874 | 0 | } |
7875 | 0 | if (variant != NULL) |
7876 | 0 | g_variant_unref (variant); |
7877 | 0 | } |
7878 | | |
7879 | | static void |
7880 | | gxdp_trash_proxy_set_property_cb (GDBusProxy *proxy, |
7881 | | GAsyncResult *res, |
7882 | | gpointer user_data) |
7883 | 0 | { |
7884 | 0 | const _ExtendedGDBusPropertyInfo *info = user_data; |
7885 | 0 | GError *error; |
7886 | 0 | GVariant *_ret; |
7887 | 0 | error = NULL; |
7888 | 0 | _ret = g_dbus_proxy_call_finish (proxy, res, &error); |
7889 | 0 | if (!_ret) |
7890 | 0 | { |
7891 | 0 | g_warning ("Error setting property '%s' on interface org.freedesktop.portal.Trash: %s (%s, %d)", |
7892 | 0 | info->parent_struct.name, |
7893 | 0 | error->message, g_quark_to_string (error->domain), error->code); |
7894 | 0 | g_error_free (error); |
7895 | 0 | } |
7896 | 0 | else |
7897 | 0 | { |
7898 | 0 | g_variant_unref (_ret); |
7899 | 0 | } |
7900 | 0 | } |
7901 | | |
7902 | | static void |
7903 | | gxdp_trash_proxy_set_property (GObject *object, |
7904 | | guint prop_id, |
7905 | | const GValue *value, |
7906 | | GParamSpec *pspec G_GNUC_UNUSED) |
7907 | 0 | { |
7908 | 0 | const _ExtendedGDBusPropertyInfo *info; |
7909 | 0 | GVariant *variant; |
7910 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
7911 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1]; |
7912 | 0 | variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); |
7913 | 0 | g_dbus_proxy_call (G_DBUS_PROXY (object), |
7914 | 0 | "org.freedesktop.DBus.Properties.Set", |
7915 | 0 | g_variant_new ("(ssv)", "org.freedesktop.portal.Trash", info->parent_struct.name, variant), |
7916 | 0 | G_DBUS_CALL_FLAGS_NONE, |
7917 | 0 | -1, |
7918 | 0 | NULL, (GAsyncReadyCallback) gxdp_trash_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct); |
7919 | 0 | g_variant_unref (variant); |
7920 | 0 | } |
7921 | | |
7922 | | static void |
7923 | | gxdp_trash_proxy_g_signal (GDBusProxy *proxy, |
7924 | | const gchar *sender_name G_GNUC_UNUSED, |
7925 | | const gchar *signal_name, |
7926 | | GVariant *parameters) |
7927 | 0 | { |
7928 | 0 | _ExtendedGDBusSignalInfo *info; |
7929 | 0 | GVariantIter iter; |
7930 | 0 | GVariant *child; |
7931 | 0 | GValue *paramv; |
7932 | 0 | gsize num_params; |
7933 | 0 | gsize n; |
7934 | 0 | guint signal_id; |
7935 | 0 | info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, signal_name); |
7936 | 0 | if (info == NULL) |
7937 | 0 | return; |
7938 | 0 | num_params = g_variant_n_children (parameters); |
7939 | 0 | paramv = g_new0 (GValue, num_params + 1); |
7940 | 0 | g_value_init (¶mv[0], GXDP_TYPE_TRASH); |
7941 | 0 | g_value_set_object (¶mv[0], proxy); |
7942 | 0 | g_variant_iter_init (&iter, parameters); |
7943 | 0 | n = 1; |
7944 | 0 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
7945 | 0 | { |
7946 | 0 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; |
7947 | 0 | if (arg_info->use_gvariant) |
7948 | 0 | { |
7949 | 0 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
7950 | 0 | g_value_set_variant (¶mv[n], child); |
7951 | 0 | n++; |
7952 | 0 | } |
7953 | 0 | else |
7954 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
7955 | 0 | g_variant_unref (child); |
7956 | 0 | } |
7957 | 0 | signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_TRASH); |
7958 | 0 | g_signal_emitv (paramv, signal_id, 0, NULL); |
7959 | 0 | for (n = 0; n < num_params + 1; n++) |
7960 | 0 | g_value_unset (¶mv[n]); |
7961 | 0 | g_free (paramv); |
7962 | 0 | } |
7963 | | |
7964 | | static void |
7965 | | gxdp_trash_proxy_g_properties_changed (GDBusProxy *_proxy, |
7966 | | GVariant *changed_properties, |
7967 | | const gchar *const *invalidated_properties) |
7968 | 0 | { |
7969 | 0 | GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (_proxy); |
7970 | 0 | guint n; |
7971 | 0 | const gchar *key; |
7972 | 0 | GVariantIter *iter; |
7973 | 0 | _ExtendedGDBusPropertyInfo *info; |
7974 | 0 | g_variant_get (changed_properties, "a{sv}", &iter); |
7975 | 0 | while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) |
7976 | 0 | { |
7977 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, key); |
7978 | 0 | g_datalist_remove_data (&proxy->priv->qdata, key); |
7979 | 0 | if (info != NULL) |
7980 | 0 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
7981 | 0 | } |
7982 | 0 | g_variant_iter_free (iter); |
7983 | 0 | for (n = 0; invalidated_properties[n] != NULL; n++) |
7984 | 0 | { |
7985 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, invalidated_properties[n]); |
7986 | 0 | g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); |
7987 | 0 | if (info != NULL) |
7988 | 0 | g_object_notify (G_OBJECT (proxy), info->hyphen_name); |
7989 | 0 | } |
7990 | 0 | } |
7991 | | |
7992 | | static guint |
7993 | | gxdp_trash_proxy_get_version (GXdpTrash *object) |
7994 | 0 | { |
7995 | 0 | GXdpTrashProxy *proxy = GXDP_TRASH_PROXY (object); |
7996 | 0 | GVariant *variant; |
7997 | 0 | guint value = 0; |
7998 | 0 | variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "version"); |
7999 | 0 | if (variant != NULL) |
8000 | 0 | { |
8001 | 0 | value = g_variant_get_uint32 (variant); |
8002 | 0 | g_variant_unref (variant); |
8003 | 0 | } |
8004 | 0 | return value; |
8005 | 0 | } |
8006 | | |
8007 | | static void |
8008 | | gxdp_trash_proxy_init (GXdpTrashProxy *proxy) |
8009 | 0 | { |
8010 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
8011 | 0 | proxy->priv = gxdp_trash_proxy_get_instance_private (proxy); |
8012 | | #else |
8013 | | proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GXDP_TYPE_TRASH_PROXY, GXdpTrashProxyPrivate); |
8014 | | #endif |
8015 | |
|
8016 | 0 | g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gxdp_trash_interface_info ()); |
8017 | 0 | } |
8018 | | |
8019 | | static void |
8020 | | gxdp_trash_proxy_class_init (GXdpTrashProxyClass *klass) |
8021 | 0 | { |
8022 | 0 | GObjectClass *gobject_class; |
8023 | 0 | GDBusProxyClass *proxy_class; |
8024 | |
|
8025 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
8026 | 0 | gobject_class->finalize = gxdp_trash_proxy_finalize; |
8027 | 0 | gobject_class->get_property = gxdp_trash_proxy_get_property; |
8028 | 0 | gobject_class->set_property = gxdp_trash_proxy_set_property; |
8029 | |
|
8030 | 0 | proxy_class = G_DBUS_PROXY_CLASS (klass); |
8031 | 0 | proxy_class->g_signal = gxdp_trash_proxy_g_signal; |
8032 | 0 | proxy_class->g_properties_changed = gxdp_trash_proxy_g_properties_changed; |
8033 | |
|
8034 | 0 | gxdp_trash_override_properties (gobject_class, 1); |
8035 | |
|
8036 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
8037 | | g_type_class_add_private (klass, sizeof (GXdpTrashProxyPrivate)); |
8038 | | #endif |
8039 | 0 | } |
8040 | | |
8041 | | static void |
8042 | | gxdp_trash_proxy_iface_init (GXdpTrashIface *iface) |
8043 | 0 | { |
8044 | 0 | iface->get_version = gxdp_trash_proxy_get_version; |
8045 | 0 | } |
8046 | | |
8047 | | /** |
8048 | | * gxdp_trash_proxy_new: |
8049 | | * @connection: A #GDBusConnection. |
8050 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
8051 | | * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
8052 | | * @object_path: An object path. |
8053 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
8054 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
8055 | | * @user_data: User data to pass to @callback. |
8056 | | * |
8057 | | * 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. |
8058 | | * |
8059 | | * 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()). |
8060 | | * You can then call gxdp_trash_proxy_new_finish() to get the result of the operation. |
8061 | | * |
8062 | | * See gxdp_trash_proxy_new_sync() for the synchronous, blocking version of this constructor. |
8063 | | */ |
8064 | | void |
8065 | | gxdp_trash_proxy_new ( |
8066 | | GDBusConnection *connection, |
8067 | | GDBusProxyFlags flags, |
8068 | | const gchar *name, |
8069 | | const gchar *object_path, |
8070 | | GCancellable *cancellable, |
8071 | | GAsyncReadyCallback callback, |
8072 | | gpointer user_data) |
8073 | 0 | { |
8074 | 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); |
8075 | 0 | } |
8076 | | |
8077 | | /** |
8078 | | * gxdp_trash_proxy_new_finish: |
8079 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_proxy_new(). |
8080 | | * @error: Return location for error or %NULL |
8081 | | * |
8082 | | * Finishes an operation started with gxdp_trash_proxy_new(). |
8083 | | * |
8084 | | * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set. |
8085 | | */ |
8086 | | GXdpTrash * |
8087 | | gxdp_trash_proxy_new_finish ( |
8088 | | GAsyncResult *res, |
8089 | | GError **error) |
8090 | 0 | { |
8091 | 0 | GObject *ret; |
8092 | 0 | GObject *source_object; |
8093 | 0 | source_object = g_async_result_get_source_object (res); |
8094 | 0 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
8095 | 0 | g_object_unref (source_object); |
8096 | 0 | if (ret != NULL) |
8097 | 0 | return GXDP_TRASH (ret); |
8098 | 0 | else |
8099 | 0 | return NULL; |
8100 | 0 | } |
8101 | | |
8102 | | /** |
8103 | | * gxdp_trash_proxy_new_sync: |
8104 | | * @connection: A #GDBusConnection. |
8105 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
8106 | | * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. |
8107 | | * @object_path: An object path. |
8108 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
8109 | | * @error: Return location for error or %NULL |
8110 | | * |
8111 | | * 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. |
8112 | | * |
8113 | | * The calling thread is blocked until a reply is received. |
8114 | | * |
8115 | | * See gxdp_trash_proxy_new() for the asynchronous version of this constructor. |
8116 | | * |
8117 | | * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set. |
8118 | | */ |
8119 | | GXdpTrash * |
8120 | | gxdp_trash_proxy_new_sync ( |
8121 | | GDBusConnection *connection, |
8122 | | GDBusProxyFlags flags, |
8123 | | const gchar *name, |
8124 | | const gchar *object_path, |
8125 | | GCancellable *cancellable, |
8126 | | GError **error) |
8127 | 0 | { |
8128 | 0 | GInitable *ret; |
8129 | 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); |
8130 | 0 | if (ret != NULL) |
8131 | 0 | return GXDP_TRASH (ret); |
8132 | 0 | else |
8133 | 0 | return NULL; |
8134 | 0 | } |
8135 | | |
8136 | | |
8137 | | /** |
8138 | | * gxdp_trash_proxy_new_for_bus: |
8139 | | * @bus_type: A #GBusType. |
8140 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
8141 | | * @name: A bus name (well-known or unique). |
8142 | | * @object_path: An object path. |
8143 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
8144 | | * @callback: A #GAsyncReadyCallback to call when the request is satisfied. |
8145 | | * @user_data: User data to pass to @callback. |
8146 | | * |
8147 | | * Like gxdp_trash_proxy_new() but takes a #GBusType instead of a #GDBusConnection. |
8148 | | * |
8149 | | * 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()). |
8150 | | * You can then call gxdp_trash_proxy_new_for_bus_finish() to get the result of the operation. |
8151 | | * |
8152 | | * See gxdp_trash_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. |
8153 | | */ |
8154 | | void |
8155 | | gxdp_trash_proxy_new_for_bus ( |
8156 | | GBusType bus_type, |
8157 | | GDBusProxyFlags flags, |
8158 | | const gchar *name, |
8159 | | const gchar *object_path, |
8160 | | GCancellable *cancellable, |
8161 | | GAsyncReadyCallback callback, |
8162 | | gpointer user_data) |
8163 | 0 | { |
8164 | 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); |
8165 | 0 | } |
8166 | | |
8167 | | /** |
8168 | | * gxdp_trash_proxy_new_for_bus_finish: |
8169 | | * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_trash_proxy_new_for_bus(). |
8170 | | * @error: Return location for error or %NULL |
8171 | | * |
8172 | | * Finishes an operation started with gxdp_trash_proxy_new_for_bus(). |
8173 | | * |
8174 | | * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set. |
8175 | | */ |
8176 | | GXdpTrash * |
8177 | | gxdp_trash_proxy_new_for_bus_finish ( |
8178 | | GAsyncResult *res, |
8179 | | GError **error) |
8180 | 0 | { |
8181 | 0 | GObject *ret; |
8182 | 0 | GObject *source_object; |
8183 | 0 | source_object = g_async_result_get_source_object (res); |
8184 | 0 | ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); |
8185 | 0 | g_object_unref (source_object); |
8186 | 0 | if (ret != NULL) |
8187 | 0 | return GXDP_TRASH (ret); |
8188 | 0 | else |
8189 | 0 | return NULL; |
8190 | 0 | } |
8191 | | |
8192 | | /** |
8193 | | * gxdp_trash_proxy_new_for_bus_sync: |
8194 | | * @bus_type: A #GBusType. |
8195 | | * @flags: Flags from the #GDBusProxyFlags enumeration. |
8196 | | * @name: A bus name (well-known or unique). |
8197 | | * @object_path: An object path. |
8198 | | * @cancellable: (nullable): A #GCancellable or %NULL. |
8199 | | * @error: Return location for error or %NULL |
8200 | | * |
8201 | | * Like gxdp_trash_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. |
8202 | | * |
8203 | | * The calling thread is blocked until a reply is received. |
8204 | | * |
8205 | | * See gxdp_trash_proxy_new_for_bus() for the asynchronous version of this constructor. |
8206 | | * |
8207 | | * Returns: (transfer full) (type GXdpTrashProxy): The constructed proxy object or %NULL if @error is set. |
8208 | | */ |
8209 | | GXdpTrash * |
8210 | | gxdp_trash_proxy_new_for_bus_sync ( |
8211 | | GBusType bus_type, |
8212 | | GDBusProxyFlags flags, |
8213 | | const gchar *name, |
8214 | | const gchar *object_path, |
8215 | | GCancellable *cancellable, |
8216 | | GError **error) |
8217 | 0 | { |
8218 | 0 | GInitable *ret; |
8219 | 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); |
8220 | 0 | if (ret != NULL) |
8221 | 0 | return GXDP_TRASH (ret); |
8222 | 0 | else |
8223 | 0 | return NULL; |
8224 | 0 | } |
8225 | | |
8226 | | |
8227 | | /* ------------------------------------------------------------------------ */ |
8228 | | |
8229 | | /** |
8230 | | * GXdpTrashSkeleton: |
8231 | | * |
8232 | | * The #GXdpTrashSkeleton structure contains only private data and should only be accessed using the provided API. |
8233 | | */ |
8234 | | |
8235 | | /** |
8236 | | * GXdpTrashSkeletonClass: |
8237 | | * @parent_class: The parent class. |
8238 | | * |
8239 | | * Class structure for #GXdpTrashSkeleton. |
8240 | | */ |
8241 | | |
8242 | | struct _GXdpTrashSkeletonPrivate |
8243 | | { |
8244 | | GValue *properties; |
8245 | | GList *changed_properties; |
8246 | | GSource *changed_properties_idle_source; |
8247 | | GMainContext *context; |
8248 | | GMutex lock; |
8249 | | }; |
8250 | | |
8251 | | static void |
8252 | | _gxdp_trash_skeleton_handle_method_call ( |
8253 | | GDBusConnection *connection G_GNUC_UNUSED, |
8254 | | const gchar *sender G_GNUC_UNUSED, |
8255 | | const gchar *object_path G_GNUC_UNUSED, |
8256 | | const gchar *interface_name, |
8257 | | const gchar *method_name, |
8258 | | GVariant *parameters, |
8259 | | GDBusMethodInvocation *invocation, |
8260 | | gpointer user_data) |
8261 | 0 | { |
8262 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data); |
8263 | 0 | _ExtendedGDBusMethodInfo *info; |
8264 | 0 | GVariantIter iter; |
8265 | 0 | GVariant *child; |
8266 | 0 | GValue *paramv; |
8267 | 0 | gsize num_params; |
8268 | 0 | guint num_extra; |
8269 | 0 | gsize n; |
8270 | 0 | guint signal_id; |
8271 | 0 | GValue return_value = G_VALUE_INIT; |
8272 | 0 | info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); |
8273 | 0 | g_assert (info != NULL); |
8274 | 0 | num_params = g_variant_n_children (parameters); |
8275 | 0 | num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); |
8276 | 0 | n = 0; |
8277 | 0 | g_value_init (¶mv[n], GXDP_TYPE_TRASH); |
8278 | 0 | g_value_set_object (¶mv[n++], skeleton); |
8279 | 0 | g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); |
8280 | 0 | g_value_set_object (¶mv[n++], invocation); |
8281 | 0 | if (info->pass_fdlist) |
8282 | 0 | { |
8283 | 0 | #ifdef G_OS_UNIX |
8284 | 0 | g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); |
8285 | 0 | g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); |
8286 | | #else |
8287 | | g_assert_not_reached (); |
8288 | | #endif |
8289 | 0 | } |
8290 | 0 | g_variant_iter_init (&iter, parameters); |
8291 | 0 | while ((child = g_variant_iter_next_value (&iter)) != NULL) |
8292 | 0 | { |
8293 | 0 | _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; |
8294 | 0 | if (arg_info->use_gvariant) |
8295 | 0 | { |
8296 | 0 | g_value_init (¶mv[n], G_TYPE_VARIANT); |
8297 | 0 | g_value_set_variant (¶mv[n], child); |
8298 | 0 | n++; |
8299 | 0 | } |
8300 | 0 | else |
8301 | 0 | g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); |
8302 | 0 | g_variant_unref (child); |
8303 | 0 | } |
8304 | 0 | signal_id = g_signal_lookup (info->signal_name, GXDP_TYPE_TRASH); |
8305 | 0 | g_value_init (&return_value, G_TYPE_BOOLEAN); |
8306 | 0 | g_signal_emitv (paramv, signal_id, 0, &return_value); |
8307 | 0 | if (!g_value_get_boolean (&return_value)) |
8308 | 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); |
8309 | 0 | g_value_unset (&return_value); |
8310 | 0 | for (n = 0; n < num_params + num_extra; n++) |
8311 | 0 | g_value_unset (¶mv[n]); |
8312 | 0 | g_free (paramv); |
8313 | 0 | } |
8314 | | |
8315 | | static GVariant * |
8316 | | _gxdp_trash_skeleton_handle_get_property ( |
8317 | | GDBusConnection *connection G_GNUC_UNUSED, |
8318 | | const gchar *sender G_GNUC_UNUSED, |
8319 | | const gchar *object_path G_GNUC_UNUSED, |
8320 | | const gchar *interface_name G_GNUC_UNUSED, |
8321 | | const gchar *property_name, |
8322 | | GError **error, |
8323 | | gpointer user_data) |
8324 | 0 | { |
8325 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data); |
8326 | 0 | GValue value = G_VALUE_INIT; |
8327 | 0 | GParamSpec *pspec; |
8328 | 0 | _ExtendedGDBusPropertyInfo *info; |
8329 | 0 | GVariant *ret; |
8330 | 0 | ret = NULL; |
8331 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, property_name); |
8332 | 0 | g_assert (info != NULL); |
8333 | 0 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
8334 | 0 | if (pspec == NULL) |
8335 | 0 | { |
8336 | 0 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
8337 | 0 | } |
8338 | 0 | else |
8339 | 0 | { |
8340 | 0 | g_value_init (&value, pspec->value_type); |
8341 | 0 | g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
8342 | 0 | ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); |
8343 | 0 | g_value_unset (&value); |
8344 | 0 | } |
8345 | 0 | return ret; |
8346 | 0 | } |
8347 | | |
8348 | | static gboolean |
8349 | | _gxdp_trash_skeleton_handle_set_property ( |
8350 | | GDBusConnection *connection G_GNUC_UNUSED, |
8351 | | const gchar *sender G_GNUC_UNUSED, |
8352 | | const gchar *object_path G_GNUC_UNUSED, |
8353 | | const gchar *interface_name G_GNUC_UNUSED, |
8354 | | const gchar *property_name, |
8355 | | GVariant *variant, |
8356 | | GError **error, |
8357 | | gpointer user_data) |
8358 | 0 | { |
8359 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data); |
8360 | 0 | GValue value = G_VALUE_INIT; |
8361 | 0 | GParamSpec *pspec; |
8362 | 0 | _ExtendedGDBusPropertyInfo *info; |
8363 | 0 | gboolean ret; |
8364 | 0 | ret = FALSE; |
8365 | 0 | info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gxdp_trash_interface_info.parent_struct, property_name); |
8366 | 0 | g_assert (info != NULL); |
8367 | 0 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); |
8368 | 0 | if (pspec == NULL) |
8369 | 0 | { |
8370 | 0 | g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); |
8371 | 0 | } |
8372 | 0 | else |
8373 | 0 | { |
8374 | 0 | if (info->use_gvariant) |
8375 | 0 | g_value_set_variant (&value, variant); |
8376 | 0 | else |
8377 | 0 | g_dbus_gvariant_to_gvalue (variant, &value); |
8378 | 0 | g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); |
8379 | 0 | g_value_unset (&value); |
8380 | 0 | ret = TRUE; |
8381 | 0 | } |
8382 | 0 | return ret; |
8383 | 0 | } |
8384 | | |
8385 | | static const GDBusInterfaceVTable _gxdp_trash_skeleton_vtable = |
8386 | | { |
8387 | | _gxdp_trash_skeleton_handle_method_call, |
8388 | | _gxdp_trash_skeleton_handle_get_property, |
8389 | | _gxdp_trash_skeleton_handle_set_property, |
8390 | | {NULL} |
8391 | | }; |
8392 | | |
8393 | | static GDBusInterfaceInfo * |
8394 | | gxdp_trash_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
8395 | 0 | { |
8396 | 0 | return gxdp_trash_interface_info (); |
8397 | 0 | } |
8398 | | |
8399 | | static GDBusInterfaceVTable * |
8400 | | gxdp_trash_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED) |
8401 | 0 | { |
8402 | 0 | return (GDBusInterfaceVTable *) &_gxdp_trash_skeleton_vtable; |
8403 | 0 | } |
8404 | | |
8405 | | static GVariant * |
8406 | | gxdp_trash_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) |
8407 | 0 | { |
8408 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (_skeleton); |
8409 | |
|
8410 | 0 | GVariantBuilder builder; |
8411 | 0 | guint n; |
8412 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 |
8413 | 0 | g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); |
8414 | | #else |
8415 | | g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}")); |
8416 | | #endif |
8417 | 0 | if (_gxdp_trash_interface_info.parent_struct.properties == NULL) |
8418 | 0 | goto out; |
8419 | 0 | for (n = 0; _gxdp_trash_interface_info.parent_struct.properties[n] != NULL; n++) |
8420 | 0 | { |
8421 | 0 | GDBusPropertyInfo *info = _gxdp_trash_interface_info.parent_struct.properties[n]; |
8422 | 0 | if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) |
8423 | 0 | { |
8424 | 0 | GVariant *value; |
8425 | 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); |
8426 | 0 | if (value != NULL) |
8427 | 0 | { |
8428 | 0 | g_variant_take_ref (value); |
8429 | 0 | g_variant_builder_add (&builder, "{sv}", info->name, value); |
8430 | 0 | g_variant_unref (value); |
8431 | 0 | } |
8432 | 0 | } |
8433 | 0 | } |
8434 | 0 | out: |
8435 | 0 | return g_variant_builder_end (&builder); |
8436 | 0 | } |
8437 | | |
8438 | | static gboolean _gxdp_trash_emit_changed (gpointer user_data); |
8439 | | |
8440 | | static void |
8441 | | gxdp_trash_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) |
8442 | 0 | { |
8443 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (_skeleton); |
8444 | 0 | gboolean emit_changed = FALSE; |
8445 | |
|
8446 | 0 | g_mutex_lock (&skeleton->priv->lock); |
8447 | 0 | if (skeleton->priv->changed_properties_idle_source != NULL) |
8448 | 0 | { |
8449 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
8450 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
8451 | 0 | emit_changed = TRUE; |
8452 | 0 | } |
8453 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
8454 | |
|
8455 | 0 | if (emit_changed) |
8456 | 0 | _gxdp_trash_emit_changed (skeleton); |
8457 | 0 | } |
8458 | | |
8459 | | static void gxdp_trash_skeleton_iface_init (GXdpTrashIface *iface); |
8460 | | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
8461 | | G_DEFINE_TYPE_WITH_CODE (GXdpTrashSkeleton, gxdp_trash_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
8462 | | G_ADD_PRIVATE (GXdpTrashSkeleton) |
8463 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_skeleton_iface_init)) |
8464 | | |
8465 | | #else |
8466 | | G_DEFINE_TYPE_WITH_CODE (GXdpTrashSkeleton, gxdp_trash_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, |
8467 | | G_IMPLEMENT_INTERFACE (GXDP_TYPE_TRASH, gxdp_trash_skeleton_iface_init)) |
8468 | | |
8469 | | #endif |
8470 | | static void |
8471 | | gxdp_trash_skeleton_finalize (GObject *object) |
8472 | 0 | { |
8473 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); |
8474 | 0 | guint n; |
8475 | 0 | for (n = 0; n < 1; n++) |
8476 | 0 | g_value_unset (&skeleton->priv->properties[n]); |
8477 | 0 | g_free (skeleton->priv->properties); |
8478 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
8479 | 0 | if (skeleton->priv->changed_properties_idle_source != NULL) |
8480 | 0 | g_source_destroy (skeleton->priv->changed_properties_idle_source); |
8481 | 0 | g_main_context_unref (skeleton->priv->context); |
8482 | 0 | g_mutex_clear (&skeleton->priv->lock); |
8483 | 0 | G_OBJECT_CLASS (gxdp_trash_skeleton_parent_class)->finalize (object); |
8484 | 0 | } |
8485 | | |
8486 | | static void |
8487 | | gxdp_trash_skeleton_get_property (GObject *object, |
8488 | | guint prop_id, |
8489 | | GValue *value, |
8490 | | GParamSpec *pspec G_GNUC_UNUSED) |
8491 | 0 | { |
8492 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); |
8493 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
8494 | 0 | g_mutex_lock (&skeleton->priv->lock); |
8495 | 0 | g_value_copy (&skeleton->priv->properties[prop_id - 1], value); |
8496 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
8497 | 0 | } |
8498 | | |
8499 | | static gboolean |
8500 | | _gxdp_trash_emit_changed (gpointer user_data) |
8501 | 0 | { |
8502 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (user_data); |
8503 | 0 | GList *l; |
8504 | 0 | GVariantBuilder builder; |
8505 | 0 | GVariantBuilder invalidated_builder; |
8506 | 0 | guint num_changes; |
8507 | |
|
8508 | 0 | g_mutex_lock (&skeleton->priv->lock); |
8509 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84 |
8510 | 0 | g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}")); |
8511 | 0 | g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as")); |
8512 | | #else |
8513 | | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); |
8514 | | g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); |
8515 | | #endif |
8516 | 0 | for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next) |
8517 | 0 | { |
8518 | 0 | ChangedProperty *cp = l->data; |
8519 | 0 | GVariant *variant; |
8520 | 0 | const GValue *cur_value; |
8521 | |
|
8522 | 0 | cur_value = &skeleton->priv->properties[cp->prop_id - 1]; |
8523 | 0 | if (!_g_value_equal (cur_value, &cp->orig_value)) |
8524 | 0 | { |
8525 | 0 | variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature)); |
8526 | 0 | g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant); |
8527 | 0 | g_variant_unref (variant); |
8528 | 0 | num_changes++; |
8529 | 0 | } |
8530 | 0 | } |
8531 | 0 | if (num_changes > 0) |
8532 | 0 | { |
8533 | 0 | GList *connections, *ll; |
8534 | 0 | GVariant *signal_variant; |
8535 | 0 | signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.portal.Trash", |
8536 | 0 | &builder, &invalidated_builder)); |
8537 | 0 | connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); |
8538 | 0 | for (ll = connections; ll != NULL; ll = ll->next) |
8539 | 0 | { |
8540 | 0 | GDBusConnection *connection = ll->data; |
8541 | |
|
8542 | 0 | g_dbus_connection_emit_signal (connection, |
8543 | 0 | NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), |
8544 | 0 | "org.freedesktop.DBus.Properties", |
8545 | 0 | "PropertiesChanged", |
8546 | 0 | signal_variant, |
8547 | 0 | NULL); |
8548 | 0 | } |
8549 | 0 | g_variant_unref (signal_variant); |
8550 | 0 | g_list_free_full (connections, g_object_unref); |
8551 | 0 | } |
8552 | 0 | else |
8553 | 0 | { |
8554 | 0 | g_variant_builder_clear (&builder); |
8555 | 0 | g_variant_builder_clear (&invalidated_builder); |
8556 | 0 | } |
8557 | 0 | g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); |
8558 | 0 | skeleton->priv->changed_properties = NULL; |
8559 | 0 | skeleton->priv->changed_properties_idle_source = NULL; |
8560 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
8561 | 0 | return FALSE; |
8562 | 0 | } |
8563 | | |
8564 | | static void |
8565 | | _gxdp_trash_schedule_emit_changed (GXdpTrashSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value) |
8566 | 0 | { |
8567 | 0 | ChangedProperty *cp; |
8568 | 0 | GList *l; |
8569 | 0 | cp = NULL; |
8570 | 0 | for (l = skeleton->priv->changed_properties; l != NULL; l = l->next) |
8571 | 0 | { |
8572 | 0 | ChangedProperty *i_cp = l->data; |
8573 | 0 | if (i_cp->info == info) |
8574 | 0 | { |
8575 | 0 | cp = i_cp; |
8576 | 0 | break; |
8577 | 0 | } |
8578 | 0 | } |
8579 | 0 | if (cp == NULL) |
8580 | 0 | { |
8581 | 0 | cp = g_new0 (ChangedProperty, 1); |
8582 | 0 | cp->prop_id = prop_id; |
8583 | 0 | cp->info = info; |
8584 | 0 | skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp); |
8585 | 0 | g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value)); |
8586 | 0 | g_value_copy (orig_value, &cp->orig_value); |
8587 | 0 | } |
8588 | 0 | } |
8589 | | |
8590 | | static void |
8591 | | gxdp_trash_skeleton_notify (GObject *object, |
8592 | | GParamSpec *pspec G_GNUC_UNUSED) |
8593 | 0 | { |
8594 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); |
8595 | 0 | g_mutex_lock (&skeleton->priv->lock); |
8596 | 0 | if (skeleton->priv->changed_properties != NULL && |
8597 | 0 | skeleton->priv->changed_properties_idle_source == NULL) |
8598 | 0 | { |
8599 | 0 | skeleton->priv->changed_properties_idle_source = g_idle_source_new (); |
8600 | 0 | g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT); |
8601 | 0 | g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gxdp_trash_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref); |
8602 | 0 | g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gxdp_trash_emit_changed"); |
8603 | 0 | g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context); |
8604 | 0 | g_source_unref (skeleton->priv->changed_properties_idle_source); |
8605 | 0 | } |
8606 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
8607 | 0 | } |
8608 | | |
8609 | | static void |
8610 | | gxdp_trash_skeleton_set_property (GObject *object, |
8611 | | guint prop_id, |
8612 | | const GValue *value, |
8613 | | GParamSpec *pspec) |
8614 | 0 | { |
8615 | 0 | const _ExtendedGDBusPropertyInfo *info; |
8616 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); |
8617 | 0 | g_assert (prop_id != 0 && prop_id - 1 < 1); |
8618 | 0 | info = (const _ExtendedGDBusPropertyInfo *) _gxdp_trash_property_info_pointers[prop_id - 1]; |
8619 | 0 | g_mutex_lock (&skeleton->priv->lock); |
8620 | 0 | g_object_freeze_notify (object); |
8621 | 0 | if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) |
8622 | 0 | { |
8623 | 0 | if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL && |
8624 | 0 | info->emits_changed_signal) |
8625 | 0 | _gxdp_trash_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]); |
8626 | 0 | g_value_copy (value, &skeleton->priv->properties[prop_id - 1]); |
8627 | 0 | g_object_notify_by_pspec (object, pspec); |
8628 | 0 | } |
8629 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
8630 | 0 | g_object_thaw_notify (object); |
8631 | 0 | } |
8632 | | |
8633 | | static void |
8634 | | gxdp_trash_skeleton_init (GXdpTrashSkeleton *skeleton) |
8635 | 0 | { |
8636 | 0 | #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 |
8637 | 0 | skeleton->priv = gxdp_trash_skeleton_get_instance_private (skeleton); |
8638 | | #else |
8639 | | skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GXDP_TYPE_TRASH_SKELETON, GXdpTrashSkeletonPrivate); |
8640 | | #endif |
8641 | |
|
8642 | 0 | g_mutex_init (&skeleton->priv->lock); |
8643 | 0 | skeleton->priv->context = g_main_context_ref_thread_default (); |
8644 | 0 | skeleton->priv->properties = g_new0 (GValue, 1); |
8645 | 0 | g_value_init (&skeleton->priv->properties[0], G_TYPE_UINT); |
8646 | 0 | } |
8647 | | |
8648 | | static guint |
8649 | | gxdp_trash_skeleton_get_version (GXdpTrash *object) |
8650 | 0 | { |
8651 | 0 | GXdpTrashSkeleton *skeleton = GXDP_TRASH_SKELETON (object); |
8652 | 0 | guint value; |
8653 | 0 | g_mutex_lock (&skeleton->priv->lock); |
8654 | 0 | value = g_marshal_value_peek_uint (&(skeleton->priv->properties[0])); |
8655 | 0 | g_mutex_unlock (&skeleton->priv->lock); |
8656 | 0 | return value; |
8657 | 0 | } |
8658 | | |
8659 | | static void |
8660 | | gxdp_trash_skeleton_class_init (GXdpTrashSkeletonClass *klass) |
8661 | 0 | { |
8662 | 0 | GObjectClass *gobject_class; |
8663 | 0 | GDBusInterfaceSkeletonClass *skeleton_class; |
8664 | |
|
8665 | 0 | gobject_class = G_OBJECT_CLASS (klass); |
8666 | 0 | gobject_class->finalize = gxdp_trash_skeleton_finalize; |
8667 | 0 | gobject_class->get_property = gxdp_trash_skeleton_get_property; |
8668 | 0 | gobject_class->set_property = gxdp_trash_skeleton_set_property; |
8669 | 0 | gobject_class->notify = gxdp_trash_skeleton_notify; |
8670 | | |
8671 | |
|
8672 | 0 | gxdp_trash_override_properties (gobject_class, 1); |
8673 | |
|
8674 | 0 | skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); |
8675 | 0 | skeleton_class->get_info = gxdp_trash_skeleton_dbus_interface_get_info; |
8676 | 0 | skeleton_class->get_properties = gxdp_trash_skeleton_dbus_interface_get_properties; |
8677 | 0 | skeleton_class->flush = gxdp_trash_skeleton_dbus_interface_flush; |
8678 | 0 | skeleton_class->get_vtable = gxdp_trash_skeleton_dbus_interface_get_vtable; |
8679 | |
|
8680 | | #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 |
8681 | | g_type_class_add_private (klass, sizeof (GXdpTrashSkeletonPrivate)); |
8682 | | #endif |
8683 | 0 | } |
8684 | | |
8685 | | static void |
8686 | | gxdp_trash_skeleton_iface_init (GXdpTrashIface *iface) |
8687 | 0 | { |
8688 | 0 | iface->get_version = gxdp_trash_skeleton_get_version; |
8689 | 0 | } |
8690 | | |
8691 | | /** |
8692 | | * gxdp_trash_skeleton_new: |
8693 | | * |
8694 | | * 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>. |
8695 | | * |
8696 | | * Returns: (transfer full) (type GXdpTrashSkeleton): The skeleton object. |
8697 | | */ |
8698 | | GXdpTrash * |
8699 | | gxdp_trash_skeleton_new (void) |
8700 | 0 | { |
8701 | 0 | return GXDP_TRASH (g_object_new (GXDP_TYPE_TRASH_SKELETON, NULL)); |
8702 | 0 | } |
8703 | | |