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