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 "./daemon/dbus/gkd-internal-generated.h"
14
15 #include <string.h>
16 #ifdef G_OS_UNIX
17 # include <gio/gunixfdlist.h>
18 #endif
19
20 typedef struct
21 {
22 GDBusArgInfo parent_struct;
23 gboolean use_gvariant;
24 } _ExtendedGDBusArgInfo;
25
26 typedef struct
27 {
28 GDBusMethodInfo parent_struct;
29 const gchar *signal_name;
30 gboolean pass_fdlist;
31 } _ExtendedGDBusMethodInfo;
32
33 typedef struct
34 {
35 GDBusSignalInfo parent_struct;
36 const gchar *signal_name;
37 } _ExtendedGDBusSignalInfo;
38
39 typedef struct
40 {
41 GDBusPropertyInfo parent_struct;
42 const gchar *hyphen_name;
43 guint use_gvariant : 1;
44 guint emits_changed_signal : 1;
45 } _ExtendedGDBusPropertyInfo;
46
47 typedef struct
48 {
49 GDBusInterfaceInfo parent_struct;
50 const gchar *hyphen_name;
51 } _ExtendedGDBusInterfaceInfo;
52
53 typedef struct
54 {
55 const _ExtendedGDBusPropertyInfo *info;
56 guint prop_id;
57 GValue orig_value; /* the value before the change */
58 } ChangedProperty;
59
60 static void
_changed_property_free(ChangedProperty * data)61 _changed_property_free (ChangedProperty *data)
62 {
63 g_value_unset (&data->orig_value);
64 g_free (data);
65 }
66
67 static gboolean
_g_strv_equal0(gchar ** a,gchar ** b)68 _g_strv_equal0 (gchar **a, gchar **b)
69 {
70 gboolean ret = FALSE;
71 guint n;
72 if (a == NULL && b == NULL)
73 {
74 ret = TRUE;
75 goto out;
76 }
77 if (a == NULL || b == NULL)
78 goto out;
79 if (g_strv_length (a) != g_strv_length (b))
80 goto out;
81 for (n = 0; a[n] != NULL; n++)
82 if (g_strcmp0 (a[n], b[n]) != 0)
83 goto out;
84 ret = TRUE;
85 out:
86 return ret;
87 }
88
89 static gboolean
_g_variant_equal0(GVariant * a,GVariant * b)90 _g_variant_equal0 (GVariant *a, GVariant *b)
91 {
92 gboolean ret = FALSE;
93 if (a == NULL && b == NULL)
94 {
95 ret = TRUE;
96 goto out;
97 }
98 if (a == NULL || b == NULL)
99 goto out;
100 ret = g_variant_equal (a, b);
101 out:
102 return ret;
103 }
104
105 G_GNUC_UNUSED static gboolean
_g_value_equal(const GValue * a,const GValue * b)106 _g_value_equal (const GValue *a, const GValue *b)
107 {
108 gboolean ret = FALSE;
109 g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
110 switch (G_VALUE_TYPE (a))
111 {
112 case G_TYPE_BOOLEAN:
113 ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
114 break;
115 case G_TYPE_UCHAR:
116 ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
117 break;
118 case G_TYPE_INT:
119 ret = (g_value_get_int (a) == g_value_get_int (b));
120 break;
121 case G_TYPE_UINT:
122 ret = (g_value_get_uint (a) == g_value_get_uint (b));
123 break;
124 case G_TYPE_INT64:
125 ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
126 break;
127 case G_TYPE_UINT64:
128 ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
129 break;
130 case G_TYPE_DOUBLE:
131 {
132 /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
133 gdouble da = g_value_get_double (a);
134 gdouble db = g_value_get_double (b);
135 ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
136 }
137 break;
138 case G_TYPE_STRING:
139 ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
140 break;
141 case G_TYPE_VARIANT:
142 ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
143 break;
144 default:
145 if (G_VALUE_TYPE (a) == G_TYPE_STRV)
146 ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
147 else
148 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
149 break;
150 }
151 return ret;
152 }
153
154 /* ------------------------------------------------------------------------
155 * Code for interface org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface
156 * ------------------------------------------------------------------------
157 */
158
159 /**
160 * SECTION:GkdExportedInternal
161 * @title: GkdExportedInternal
162 * @short_description: Generated C code for the org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface D-Bus interface
163 *
164 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.top_of_page">org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface</link> D-Bus interface in C.
165 */
166
167 /* ---- Introspection data for org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface ---- */
168
169 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_change_with_master_password_IN_ARG_collection =
170 {
171 {
172 -1,
173 (gchar *) "collection",
174 (gchar *) "o",
175 NULL
176 },
177 FALSE
178 };
179
180 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_change_with_master_password_IN_ARG_original =
181 {
182 {
183 -1,
184 (gchar *) "original",
185 (gchar *) "(oayays)",
186 NULL
187 },
188 FALSE
189 };
190
191 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_change_with_master_password_IN_ARG_master =
192 {
193 {
194 -1,
195 (gchar *) "master",
196 (gchar *) "(oayays)",
197 NULL
198 },
199 FALSE
200 };
201
202 static const GDBusArgInfo * const _gkd_exported_internal_method_info_change_with_master_password_IN_ARG_pointers[] =
203 {
204 &_gkd_exported_internal_method_info_change_with_master_password_IN_ARG_collection.parent_struct,
205 &_gkd_exported_internal_method_info_change_with_master_password_IN_ARG_original.parent_struct,
206 &_gkd_exported_internal_method_info_change_with_master_password_IN_ARG_master.parent_struct,
207 NULL
208 };
209
210 static const _ExtendedGDBusMethodInfo _gkd_exported_internal_method_info_change_with_master_password =
211 {
212 {
213 -1,
214 (gchar *) "ChangeWithMasterPassword",
215 (GDBusArgInfo **) &_gkd_exported_internal_method_info_change_with_master_password_IN_ARG_pointers,
216 NULL,
217 NULL
218 },
219 "handle-change-with-master-password",
220 FALSE
221 };
222
223 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_change_with_prompt_IN_ARG_collection =
224 {
225 {
226 -1,
227 (gchar *) "collection",
228 (gchar *) "o",
229 NULL
230 },
231 FALSE
232 };
233
234 static const GDBusArgInfo * const _gkd_exported_internal_method_info_change_with_prompt_IN_ARG_pointers[] =
235 {
236 &_gkd_exported_internal_method_info_change_with_prompt_IN_ARG_collection.parent_struct,
237 NULL
238 };
239
240 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_change_with_prompt_OUT_ARG_prompt =
241 {
242 {
243 -1,
244 (gchar *) "prompt",
245 (gchar *) "o",
246 NULL
247 },
248 FALSE
249 };
250
251 static const GDBusArgInfo * const _gkd_exported_internal_method_info_change_with_prompt_OUT_ARG_pointers[] =
252 {
253 &_gkd_exported_internal_method_info_change_with_prompt_OUT_ARG_prompt.parent_struct,
254 NULL
255 };
256
257 static const _ExtendedGDBusMethodInfo _gkd_exported_internal_method_info_change_with_prompt =
258 {
259 {
260 -1,
261 (gchar *) "ChangeWithPrompt",
262 (GDBusArgInfo **) &_gkd_exported_internal_method_info_change_with_prompt_IN_ARG_pointers,
263 (GDBusArgInfo **) &_gkd_exported_internal_method_info_change_with_prompt_OUT_ARG_pointers,
264 NULL
265 },
266 "handle-change-with-prompt",
267 FALSE
268 };
269
270 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_create_with_master_password_IN_ARG_attributes =
271 {
272 {
273 -1,
274 (gchar *) "attributes",
275 (gchar *) "a{sv}",
276 NULL
277 },
278 FALSE
279 };
280
281 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_create_with_master_password_IN_ARG_master =
282 {
283 {
284 -1,
285 (gchar *) "master",
286 (gchar *) "(oayays)",
287 NULL
288 },
289 FALSE
290 };
291
292 static const GDBusArgInfo * const _gkd_exported_internal_method_info_create_with_master_password_IN_ARG_pointers[] =
293 {
294 &_gkd_exported_internal_method_info_create_with_master_password_IN_ARG_attributes.parent_struct,
295 &_gkd_exported_internal_method_info_create_with_master_password_IN_ARG_master.parent_struct,
296 NULL
297 };
298
299 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_create_with_master_password_OUT_ARG_collection =
300 {
301 {
302 -1,
303 (gchar *) "collection",
304 (gchar *) "o",
305 NULL
306 },
307 FALSE
308 };
309
310 static const GDBusArgInfo * const _gkd_exported_internal_method_info_create_with_master_password_OUT_ARG_pointers[] =
311 {
312 &_gkd_exported_internal_method_info_create_with_master_password_OUT_ARG_collection.parent_struct,
313 NULL
314 };
315
316 static const _ExtendedGDBusMethodInfo _gkd_exported_internal_method_info_create_with_master_password =
317 {
318 {
319 -1,
320 (gchar *) "CreateWithMasterPassword",
321 (GDBusArgInfo **) &_gkd_exported_internal_method_info_create_with_master_password_IN_ARG_pointers,
322 (GDBusArgInfo **) &_gkd_exported_internal_method_info_create_with_master_password_OUT_ARG_pointers,
323 NULL
324 },
325 "handle-create-with-master-password",
326 FALSE
327 };
328
329 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_unlock_with_master_password_IN_ARG_collection =
330 {
331 {
332 -1,
333 (gchar *) "collection",
334 (gchar *) "o",
335 NULL
336 },
337 FALSE
338 };
339
340 static const _ExtendedGDBusArgInfo _gkd_exported_internal_method_info_unlock_with_master_password_IN_ARG_master =
341 {
342 {
343 -1,
344 (gchar *) "master",
345 (gchar *) "(oayays)",
346 NULL
347 },
348 FALSE
349 };
350
351 static const GDBusArgInfo * const _gkd_exported_internal_method_info_unlock_with_master_password_IN_ARG_pointers[] =
352 {
353 &_gkd_exported_internal_method_info_unlock_with_master_password_IN_ARG_collection.parent_struct,
354 &_gkd_exported_internal_method_info_unlock_with_master_password_IN_ARG_master.parent_struct,
355 NULL
356 };
357
358 static const _ExtendedGDBusMethodInfo _gkd_exported_internal_method_info_unlock_with_master_password =
359 {
360 {
361 -1,
362 (gchar *) "UnlockWithMasterPassword",
363 (GDBusArgInfo **) &_gkd_exported_internal_method_info_unlock_with_master_password_IN_ARG_pointers,
364 NULL,
365 NULL
366 },
367 "handle-unlock-with-master-password",
368 FALSE
369 };
370
371 static const GDBusMethodInfo * const _gkd_exported_internal_method_info_pointers[] =
372 {
373 &_gkd_exported_internal_method_info_change_with_master_password.parent_struct,
374 &_gkd_exported_internal_method_info_change_with_prompt.parent_struct,
375 &_gkd_exported_internal_method_info_create_with_master_password.parent_struct,
376 &_gkd_exported_internal_method_info_unlock_with_master_password.parent_struct,
377 NULL
378 };
379
380 static const _ExtendedGDBusInterfaceInfo _gkd_exported_internal_interface_info =
381 {
382 {
383 -1,
384 (gchar *) "org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface",
385 (GDBusMethodInfo **) &_gkd_exported_internal_method_info_pointers,
386 NULL,
387 NULL,
388 NULL
389 },
390 "exported-internal",
391 };
392
393
394 /**
395 * gkd_exported_internal_interface_info:
396 *
397 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.top_of_page">org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface</link> D-Bus interface.
398 *
399 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
400 */
401 GDBusInterfaceInfo *
gkd_exported_internal_interface_info(void)402 gkd_exported_internal_interface_info (void)
403 {
404 return (GDBusInterfaceInfo *) &_gkd_exported_internal_interface_info.parent_struct;
405 }
406
407 /**
408 * gkd_exported_internal_override_properties:
409 * @klass: The class structure for a #GObject derived class.
410 * @property_id_begin: The property id to assign to the first overridden property.
411 *
412 * Overrides all #GObject properties in the #GkdExportedInternal interface for a concrete class.
413 * The properties are overridden in the order they are defined.
414 *
415 * Returns: The last property id.
416 */
417 guint
gkd_exported_internal_override_properties(GObjectClass * klass,guint property_id_begin)418 gkd_exported_internal_override_properties (GObjectClass *klass, guint property_id_begin)
419 {
420 return property_id_begin - 1;
421 }
422
423
424
425 /**
426 * GkdExportedInternal:
427 *
428 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.top_of_page">org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface</link>.
429 */
430
431 /**
432 * GkdExportedInternalIface:
433 * @parent_iface: The parent interface.
434 * @handle_change_with_master_password: Handler for the #GkdExportedInternal::handle-change-with-master-password signal.
435 * @handle_change_with_prompt: Handler for the #GkdExportedInternal::handle-change-with-prompt signal.
436 * @handle_create_with_master_password: Handler for the #GkdExportedInternal::handle-create-with-master-password signal.
437 * @handle_unlock_with_master_password: Handler for the #GkdExportedInternal::handle-unlock-with-master-password signal.
438 *
439 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.top_of_page">org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface</link>.
440 */
441
442 typedef GkdExportedInternalIface GkdExportedInternalInterface;
G_DEFINE_INTERFACE(GkdExportedInternal,gkd_exported_internal,G_TYPE_OBJECT)443 G_DEFINE_INTERFACE (GkdExportedInternal, gkd_exported_internal, G_TYPE_OBJECT)
444
445 static void
446 gkd_exported_internal_default_init (GkdExportedInternalIface *iface)
447 {
448 /* GObject signals for incoming D-Bus method calls: */
449 /**
450 * GkdExportedInternal::handle-change-with-master-password:
451 * @object: A #GkdExportedInternal.
452 * @invocation: A #GDBusMethodInvocation.
453 * @arg_collection: Argument passed by remote caller.
454 * @arg_original: Argument passed by remote caller.
455 * @arg_master: Argument passed by remote caller.
456 *
457 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.ChangeWithMasterPassword">ChangeWithMasterPassword()</link> D-Bus method.
458 *
459 * 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 gkd_exported_internal_complete_change_with_master_password() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
460 *
461 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
462 */
463 g_signal_new ("handle-change-with-master-password",
464 G_TYPE_FROM_INTERFACE (iface),
465 G_SIGNAL_RUN_LAST,
466 G_STRUCT_OFFSET (GkdExportedInternalIface, handle_change_with_master_password),
467 g_signal_accumulator_true_handled,
468 NULL,
469 g_cclosure_marshal_generic,
470 G_TYPE_BOOLEAN,
471 4,
472 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT);
473
474 /**
475 * GkdExportedInternal::handle-change-with-prompt:
476 * @object: A #GkdExportedInternal.
477 * @invocation: A #GDBusMethodInvocation.
478 * @arg_collection: Argument passed by remote caller.
479 *
480 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.ChangeWithPrompt">ChangeWithPrompt()</link> D-Bus method.
481 *
482 * 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 gkd_exported_internal_complete_change_with_prompt() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
483 *
484 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
485 */
486 g_signal_new ("handle-change-with-prompt",
487 G_TYPE_FROM_INTERFACE (iface),
488 G_SIGNAL_RUN_LAST,
489 G_STRUCT_OFFSET (GkdExportedInternalIface, handle_change_with_prompt),
490 g_signal_accumulator_true_handled,
491 NULL,
492 g_cclosure_marshal_generic,
493 G_TYPE_BOOLEAN,
494 2,
495 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
496
497 /**
498 * GkdExportedInternal::handle-create-with-master-password:
499 * @object: A #GkdExportedInternal.
500 * @invocation: A #GDBusMethodInvocation.
501 * @arg_attributes: Argument passed by remote caller.
502 * @arg_master: Argument passed by remote caller.
503 *
504 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.CreateWithMasterPassword">CreateWithMasterPassword()</link> D-Bus method.
505 *
506 * 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 gkd_exported_internal_complete_create_with_master_password() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
507 *
508 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
509 */
510 g_signal_new ("handle-create-with-master-password",
511 G_TYPE_FROM_INTERFACE (iface),
512 G_SIGNAL_RUN_LAST,
513 G_STRUCT_OFFSET (GkdExportedInternalIface, handle_create_with_master_password),
514 g_signal_accumulator_true_handled,
515 NULL,
516 g_cclosure_marshal_generic,
517 G_TYPE_BOOLEAN,
518 3,
519 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
520
521 /**
522 * GkdExportedInternal::handle-unlock-with-master-password:
523 * @object: A #GkdExportedInternal.
524 * @invocation: A #GDBusMethodInvocation.
525 * @arg_collection: Argument passed by remote caller.
526 * @arg_master: Argument passed by remote caller.
527 *
528 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.UnlockWithMasterPassword">UnlockWithMasterPassword()</link> D-Bus method.
529 *
530 * 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 gkd_exported_internal_complete_unlock_with_master_password() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
531 *
532 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
533 */
534 g_signal_new ("handle-unlock-with-master-password",
535 G_TYPE_FROM_INTERFACE (iface),
536 G_SIGNAL_RUN_LAST,
537 G_STRUCT_OFFSET (GkdExportedInternalIface, handle_unlock_with_master_password),
538 g_signal_accumulator_true_handled,
539 NULL,
540 g_cclosure_marshal_generic,
541 G_TYPE_BOOLEAN,
542 3,
543 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT);
544
545 }
546
547 /**
548 * gkd_exported_internal_call_change_with_master_password:
549 * @proxy: A #GkdExportedInternalProxy.
550 * @arg_collection: Argument to pass with the method invocation.
551 * @arg_original: Argument to pass with the method invocation.
552 * @arg_master: Argument to pass with the method invocation.
553 * @cancellable: (nullable): A #GCancellable or %NULL.
554 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
555 * @user_data: User data to pass to @callback.
556 *
557 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.ChangeWithMasterPassword">ChangeWithMasterPassword()</link> D-Bus method on @proxy.
558 * 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()).
559 * You can then call gkd_exported_internal_call_change_with_master_password_finish() to get the result of the operation.
560 *
561 * See gkd_exported_internal_call_change_with_master_password_sync() for the synchronous, blocking version of this method.
562 */
563 void
gkd_exported_internal_call_change_with_master_password(GkdExportedInternal * proxy,const gchar * arg_collection,GVariant * arg_original,GVariant * arg_master,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)564 gkd_exported_internal_call_change_with_master_password (
565 GkdExportedInternal *proxy,
566 const gchar *arg_collection,
567 GVariant *arg_original,
568 GVariant *arg_master,
569 GCancellable *cancellable,
570 GAsyncReadyCallback callback,
571 gpointer user_data)
572 {
573 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
574 "ChangeWithMasterPassword",
575 g_variant_new ("(o@(oayays)@(oayays))",
576 arg_collection,
577 arg_original,
578 arg_master),
579 G_DBUS_CALL_FLAGS_NONE,
580 -1,
581 cancellable,
582 callback,
583 user_data);
584 }
585
586 /**
587 * gkd_exported_internal_call_change_with_master_password_finish:
588 * @proxy: A #GkdExportedInternalProxy.
589 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gkd_exported_internal_call_change_with_master_password().
590 * @error: Return location for error or %NULL.
591 *
592 * Finishes an operation started with gkd_exported_internal_call_change_with_master_password().
593 *
594 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
595 */
596 gboolean
gkd_exported_internal_call_change_with_master_password_finish(GkdExportedInternal * proxy,GAsyncResult * res,GError ** error)597 gkd_exported_internal_call_change_with_master_password_finish (
598 GkdExportedInternal *proxy,
599 GAsyncResult *res,
600 GError **error)
601 {
602 GVariant *_ret;
603 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
604 if (_ret == NULL)
605 goto _out;
606 g_variant_get (_ret,
607 "()");
608 g_variant_unref (_ret);
609 _out:
610 return _ret != NULL;
611 }
612
613 /**
614 * gkd_exported_internal_call_change_with_master_password_sync:
615 * @proxy: A #GkdExportedInternalProxy.
616 * @arg_collection: Argument to pass with the method invocation.
617 * @arg_original: Argument to pass with the method invocation.
618 * @arg_master: Argument to pass with the method invocation.
619 * @cancellable: (nullable): A #GCancellable or %NULL.
620 * @error: Return location for error or %NULL.
621 *
622 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.ChangeWithMasterPassword">ChangeWithMasterPassword()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
623 *
624 * See gkd_exported_internal_call_change_with_master_password() for the asynchronous version of this method.
625 *
626 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
627 */
628 gboolean
gkd_exported_internal_call_change_with_master_password_sync(GkdExportedInternal * proxy,const gchar * arg_collection,GVariant * arg_original,GVariant * arg_master,GCancellable * cancellable,GError ** error)629 gkd_exported_internal_call_change_with_master_password_sync (
630 GkdExportedInternal *proxy,
631 const gchar *arg_collection,
632 GVariant *arg_original,
633 GVariant *arg_master,
634 GCancellable *cancellable,
635 GError **error)
636 {
637 GVariant *_ret;
638 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
639 "ChangeWithMasterPassword",
640 g_variant_new ("(o@(oayays)@(oayays))",
641 arg_collection,
642 arg_original,
643 arg_master),
644 G_DBUS_CALL_FLAGS_NONE,
645 -1,
646 cancellable,
647 error);
648 if (_ret == NULL)
649 goto _out;
650 g_variant_get (_ret,
651 "()");
652 g_variant_unref (_ret);
653 _out:
654 return _ret != NULL;
655 }
656
657 /**
658 * gkd_exported_internal_call_change_with_prompt:
659 * @proxy: A #GkdExportedInternalProxy.
660 * @arg_collection: Argument to pass with the method invocation.
661 * @cancellable: (nullable): A #GCancellable or %NULL.
662 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
663 * @user_data: User data to pass to @callback.
664 *
665 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.ChangeWithPrompt">ChangeWithPrompt()</link> D-Bus method on @proxy.
666 * 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()).
667 * You can then call gkd_exported_internal_call_change_with_prompt_finish() to get the result of the operation.
668 *
669 * See gkd_exported_internal_call_change_with_prompt_sync() for the synchronous, blocking version of this method.
670 */
671 void
gkd_exported_internal_call_change_with_prompt(GkdExportedInternal * proxy,const gchar * arg_collection,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)672 gkd_exported_internal_call_change_with_prompt (
673 GkdExportedInternal *proxy,
674 const gchar *arg_collection,
675 GCancellable *cancellable,
676 GAsyncReadyCallback callback,
677 gpointer user_data)
678 {
679 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
680 "ChangeWithPrompt",
681 g_variant_new ("(o)",
682 arg_collection),
683 G_DBUS_CALL_FLAGS_NONE,
684 -1,
685 cancellable,
686 callback,
687 user_data);
688 }
689
690 /**
691 * gkd_exported_internal_call_change_with_prompt_finish:
692 * @proxy: A #GkdExportedInternalProxy.
693 * @out_prompt: (out) (optional): Return location for return parameter or %NULL to ignore.
694 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gkd_exported_internal_call_change_with_prompt().
695 * @error: Return location for error or %NULL.
696 *
697 * Finishes an operation started with gkd_exported_internal_call_change_with_prompt().
698 *
699 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
700 */
701 gboolean
gkd_exported_internal_call_change_with_prompt_finish(GkdExportedInternal * proxy,gchar ** out_prompt,GAsyncResult * res,GError ** error)702 gkd_exported_internal_call_change_with_prompt_finish (
703 GkdExportedInternal *proxy,
704 gchar **out_prompt,
705 GAsyncResult *res,
706 GError **error)
707 {
708 GVariant *_ret;
709 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
710 if (_ret == NULL)
711 goto _out;
712 g_variant_get (_ret,
713 "(o)",
714 out_prompt);
715 g_variant_unref (_ret);
716 _out:
717 return _ret != NULL;
718 }
719
720 /**
721 * gkd_exported_internal_call_change_with_prompt_sync:
722 * @proxy: A #GkdExportedInternalProxy.
723 * @arg_collection: Argument to pass with the method invocation.
724 * @out_prompt: (out) (optional): Return location for return parameter or %NULL to ignore.
725 * @cancellable: (nullable): A #GCancellable or %NULL.
726 * @error: Return location for error or %NULL.
727 *
728 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.ChangeWithPrompt">ChangeWithPrompt()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
729 *
730 * See gkd_exported_internal_call_change_with_prompt() for the asynchronous version of this method.
731 *
732 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
733 */
734 gboolean
gkd_exported_internal_call_change_with_prompt_sync(GkdExportedInternal * proxy,const gchar * arg_collection,gchar ** out_prompt,GCancellable * cancellable,GError ** error)735 gkd_exported_internal_call_change_with_prompt_sync (
736 GkdExportedInternal *proxy,
737 const gchar *arg_collection,
738 gchar **out_prompt,
739 GCancellable *cancellable,
740 GError **error)
741 {
742 GVariant *_ret;
743 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
744 "ChangeWithPrompt",
745 g_variant_new ("(o)",
746 arg_collection),
747 G_DBUS_CALL_FLAGS_NONE,
748 -1,
749 cancellable,
750 error);
751 if (_ret == NULL)
752 goto _out;
753 g_variant_get (_ret,
754 "(o)",
755 out_prompt);
756 g_variant_unref (_ret);
757 _out:
758 return _ret != NULL;
759 }
760
761 /**
762 * gkd_exported_internal_call_create_with_master_password:
763 * @proxy: A #GkdExportedInternalProxy.
764 * @arg_attributes: Argument to pass with the method invocation.
765 * @arg_master: Argument to pass with the method invocation.
766 * @cancellable: (nullable): A #GCancellable or %NULL.
767 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
768 * @user_data: User data to pass to @callback.
769 *
770 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.CreateWithMasterPassword">CreateWithMasterPassword()</link> D-Bus method on @proxy.
771 * 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()).
772 * You can then call gkd_exported_internal_call_create_with_master_password_finish() to get the result of the operation.
773 *
774 * See gkd_exported_internal_call_create_with_master_password_sync() for the synchronous, blocking version of this method.
775 */
776 void
gkd_exported_internal_call_create_with_master_password(GkdExportedInternal * proxy,GVariant * arg_attributes,GVariant * arg_master,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)777 gkd_exported_internal_call_create_with_master_password (
778 GkdExportedInternal *proxy,
779 GVariant *arg_attributes,
780 GVariant *arg_master,
781 GCancellable *cancellable,
782 GAsyncReadyCallback callback,
783 gpointer user_data)
784 {
785 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
786 "CreateWithMasterPassword",
787 g_variant_new ("(@a{sv}@(oayays))",
788 arg_attributes,
789 arg_master),
790 G_DBUS_CALL_FLAGS_NONE,
791 -1,
792 cancellable,
793 callback,
794 user_data);
795 }
796
797 /**
798 * gkd_exported_internal_call_create_with_master_password_finish:
799 * @proxy: A #GkdExportedInternalProxy.
800 * @out_collection: (out) (optional): Return location for return parameter or %NULL to ignore.
801 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gkd_exported_internal_call_create_with_master_password().
802 * @error: Return location for error or %NULL.
803 *
804 * Finishes an operation started with gkd_exported_internal_call_create_with_master_password().
805 *
806 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
807 */
808 gboolean
gkd_exported_internal_call_create_with_master_password_finish(GkdExportedInternal * proxy,gchar ** out_collection,GAsyncResult * res,GError ** error)809 gkd_exported_internal_call_create_with_master_password_finish (
810 GkdExportedInternal *proxy,
811 gchar **out_collection,
812 GAsyncResult *res,
813 GError **error)
814 {
815 GVariant *_ret;
816 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
817 if (_ret == NULL)
818 goto _out;
819 g_variant_get (_ret,
820 "(o)",
821 out_collection);
822 g_variant_unref (_ret);
823 _out:
824 return _ret != NULL;
825 }
826
827 /**
828 * gkd_exported_internal_call_create_with_master_password_sync:
829 * @proxy: A #GkdExportedInternalProxy.
830 * @arg_attributes: Argument to pass with the method invocation.
831 * @arg_master: Argument to pass with the method invocation.
832 * @out_collection: (out) (optional): Return location for return parameter or %NULL to ignore.
833 * @cancellable: (nullable): A #GCancellable or %NULL.
834 * @error: Return location for error or %NULL.
835 *
836 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.CreateWithMasterPassword">CreateWithMasterPassword()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
837 *
838 * See gkd_exported_internal_call_create_with_master_password() for the asynchronous version of this method.
839 *
840 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
841 */
842 gboolean
gkd_exported_internal_call_create_with_master_password_sync(GkdExportedInternal * proxy,GVariant * arg_attributes,GVariant * arg_master,gchar ** out_collection,GCancellable * cancellable,GError ** error)843 gkd_exported_internal_call_create_with_master_password_sync (
844 GkdExportedInternal *proxy,
845 GVariant *arg_attributes,
846 GVariant *arg_master,
847 gchar **out_collection,
848 GCancellable *cancellable,
849 GError **error)
850 {
851 GVariant *_ret;
852 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
853 "CreateWithMasterPassword",
854 g_variant_new ("(@a{sv}@(oayays))",
855 arg_attributes,
856 arg_master),
857 G_DBUS_CALL_FLAGS_NONE,
858 -1,
859 cancellable,
860 error);
861 if (_ret == NULL)
862 goto _out;
863 g_variant_get (_ret,
864 "(o)",
865 out_collection);
866 g_variant_unref (_ret);
867 _out:
868 return _ret != NULL;
869 }
870
871 /**
872 * gkd_exported_internal_call_unlock_with_master_password:
873 * @proxy: A #GkdExportedInternalProxy.
874 * @arg_collection: Argument to pass with the method invocation.
875 * @arg_master: Argument to pass with the method invocation.
876 * @cancellable: (nullable): A #GCancellable or %NULL.
877 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
878 * @user_data: User data to pass to @callback.
879 *
880 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.UnlockWithMasterPassword">UnlockWithMasterPassword()</link> D-Bus method on @proxy.
881 * 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()).
882 * You can then call gkd_exported_internal_call_unlock_with_master_password_finish() to get the result of the operation.
883 *
884 * See gkd_exported_internal_call_unlock_with_master_password_sync() for the synchronous, blocking version of this method.
885 */
886 void
gkd_exported_internal_call_unlock_with_master_password(GkdExportedInternal * proxy,const gchar * arg_collection,GVariant * arg_master,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)887 gkd_exported_internal_call_unlock_with_master_password (
888 GkdExportedInternal *proxy,
889 const gchar *arg_collection,
890 GVariant *arg_master,
891 GCancellable *cancellable,
892 GAsyncReadyCallback callback,
893 gpointer user_data)
894 {
895 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
896 "UnlockWithMasterPassword",
897 g_variant_new ("(o@(oayays))",
898 arg_collection,
899 arg_master),
900 G_DBUS_CALL_FLAGS_NONE,
901 -1,
902 cancellable,
903 callback,
904 user_data);
905 }
906
907 /**
908 * gkd_exported_internal_call_unlock_with_master_password_finish:
909 * @proxy: A #GkdExportedInternalProxy.
910 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gkd_exported_internal_call_unlock_with_master_password().
911 * @error: Return location for error or %NULL.
912 *
913 * Finishes an operation started with gkd_exported_internal_call_unlock_with_master_password().
914 *
915 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
916 */
917 gboolean
gkd_exported_internal_call_unlock_with_master_password_finish(GkdExportedInternal * proxy,GAsyncResult * res,GError ** error)918 gkd_exported_internal_call_unlock_with_master_password_finish (
919 GkdExportedInternal *proxy,
920 GAsyncResult *res,
921 GError **error)
922 {
923 GVariant *_ret;
924 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
925 if (_ret == NULL)
926 goto _out;
927 g_variant_get (_ret,
928 "()");
929 g_variant_unref (_ret);
930 _out:
931 return _ret != NULL;
932 }
933
934 /**
935 * gkd_exported_internal_call_unlock_with_master_password_sync:
936 * @proxy: A #GkdExportedInternalProxy.
937 * @arg_collection: Argument to pass with the method invocation.
938 * @arg_master: Argument to pass with the method invocation.
939 * @cancellable: (nullable): A #GCancellable or %NULL.
940 * @error: Return location for error or %NULL.
941 *
942 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.UnlockWithMasterPassword">UnlockWithMasterPassword()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
943 *
944 * See gkd_exported_internal_call_unlock_with_master_password() for the asynchronous version of this method.
945 *
946 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
947 */
948 gboolean
gkd_exported_internal_call_unlock_with_master_password_sync(GkdExportedInternal * proxy,const gchar * arg_collection,GVariant * arg_master,GCancellable * cancellable,GError ** error)949 gkd_exported_internal_call_unlock_with_master_password_sync (
950 GkdExportedInternal *proxy,
951 const gchar *arg_collection,
952 GVariant *arg_master,
953 GCancellable *cancellable,
954 GError **error)
955 {
956 GVariant *_ret;
957 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
958 "UnlockWithMasterPassword",
959 g_variant_new ("(o@(oayays))",
960 arg_collection,
961 arg_master),
962 G_DBUS_CALL_FLAGS_NONE,
963 -1,
964 cancellable,
965 error);
966 if (_ret == NULL)
967 goto _out;
968 g_variant_get (_ret,
969 "()");
970 g_variant_unref (_ret);
971 _out:
972 return _ret != NULL;
973 }
974
975 /**
976 * gkd_exported_internal_complete_change_with_master_password:
977 * @object: A #GkdExportedInternal.
978 * @invocation: (transfer full): A #GDBusMethodInvocation.
979 *
980 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.ChangeWithMasterPassword">ChangeWithMasterPassword()</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.
981 *
982 * This method will free @invocation, you cannot use it afterwards.
983 */
984 void
gkd_exported_internal_complete_change_with_master_password(GkdExportedInternal * object,GDBusMethodInvocation * invocation)985 gkd_exported_internal_complete_change_with_master_password (
986 GkdExportedInternal *object,
987 GDBusMethodInvocation *invocation)
988 {
989 g_dbus_method_invocation_return_value (invocation,
990 g_variant_new ("()"));
991 }
992
993 /**
994 * gkd_exported_internal_complete_change_with_prompt:
995 * @object: A #GkdExportedInternal.
996 * @invocation: (transfer full): A #GDBusMethodInvocation.
997 * @prompt: Parameter to return.
998 *
999 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.ChangeWithPrompt">ChangeWithPrompt()</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.
1000 *
1001 * This method will free @invocation, you cannot use it afterwards.
1002 */
1003 void
gkd_exported_internal_complete_change_with_prompt(GkdExportedInternal * object,GDBusMethodInvocation * invocation,const gchar * prompt)1004 gkd_exported_internal_complete_change_with_prompt (
1005 GkdExportedInternal *object,
1006 GDBusMethodInvocation *invocation,
1007 const gchar *prompt)
1008 {
1009 g_dbus_method_invocation_return_value (invocation,
1010 g_variant_new ("(o)",
1011 prompt));
1012 }
1013
1014 /**
1015 * gkd_exported_internal_complete_create_with_master_password:
1016 * @object: A #GkdExportedInternal.
1017 * @invocation: (transfer full): A #GDBusMethodInvocation.
1018 * @collection: Parameter to return.
1019 *
1020 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.CreateWithMasterPassword">CreateWithMasterPassword()</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.
1021 *
1022 * This method will free @invocation, you cannot use it afterwards.
1023 */
1024 void
gkd_exported_internal_complete_create_with_master_password(GkdExportedInternal * object,GDBusMethodInvocation * invocation,const gchar * collection)1025 gkd_exported_internal_complete_create_with_master_password (
1026 GkdExportedInternal *object,
1027 GDBusMethodInvocation *invocation,
1028 const gchar *collection)
1029 {
1030 g_dbus_method_invocation_return_value (invocation,
1031 g_variant_new ("(o)",
1032 collection));
1033 }
1034
1035 /**
1036 * gkd_exported_internal_complete_unlock_with_master_password:
1037 * @object: A #GkdExportedInternal.
1038 * @invocation: (transfer full): A #GDBusMethodInvocation.
1039 *
1040 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.UnlockWithMasterPassword">UnlockWithMasterPassword()</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.
1041 *
1042 * This method will free @invocation, you cannot use it afterwards.
1043 */
1044 void
gkd_exported_internal_complete_unlock_with_master_password(GkdExportedInternal * object,GDBusMethodInvocation * invocation)1045 gkd_exported_internal_complete_unlock_with_master_password (
1046 GkdExportedInternal *object,
1047 GDBusMethodInvocation *invocation)
1048 {
1049 g_dbus_method_invocation_return_value (invocation,
1050 g_variant_new ("()"));
1051 }
1052
1053 /* ------------------------------------------------------------------------ */
1054
1055 /**
1056 * GkdExportedInternalProxy:
1057 *
1058 * The #GkdExportedInternalProxy structure contains only private data and should only be accessed using the provided API.
1059 */
1060
1061 /**
1062 * GkdExportedInternalProxyClass:
1063 * @parent_class: The parent class.
1064 *
1065 * Class structure for #GkdExportedInternalProxy.
1066 */
1067
1068 struct _GkdExportedInternalProxyPrivate
1069 {
1070 GData *qdata;
1071 };
1072
1073 static void gkd_exported_internal_proxy_iface_init (GkdExportedInternalIface *iface);
1074
1075 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(GkdExportedInternalProxy,gkd_exported_internal_proxy,G_TYPE_DBUS_PROXY,G_ADD_PRIVATE (GkdExportedInternalProxy)G_IMPLEMENT_INTERFACE (GKD_TYPE_EXPORTED_INTERNAL,gkd_exported_internal_proxy_iface_init))1076 G_DEFINE_TYPE_WITH_CODE (GkdExportedInternalProxy, gkd_exported_internal_proxy, G_TYPE_DBUS_PROXY,
1077 G_ADD_PRIVATE (GkdExportedInternalProxy)
1078 G_IMPLEMENT_INTERFACE (GKD_TYPE_EXPORTED_INTERNAL, gkd_exported_internal_proxy_iface_init))
1079
1080 #else
1081 G_DEFINE_TYPE_WITH_CODE (GkdExportedInternalProxy, gkd_exported_internal_proxy, G_TYPE_DBUS_PROXY,
1082 G_IMPLEMENT_INTERFACE (GKD_TYPE_EXPORTED_INTERNAL, gkd_exported_internal_proxy_iface_init))
1083
1084 #endif
1085 static void
1086 gkd_exported_internal_proxy_finalize (GObject *object)
1087 {
1088 GkdExportedInternalProxy *proxy = GKD_EXPORTED_INTERNAL_PROXY (object);
1089 g_datalist_clear (&proxy->priv->qdata);
1090 G_OBJECT_CLASS (gkd_exported_internal_proxy_parent_class)->finalize (object);
1091 }
1092
1093 static void
gkd_exported_internal_proxy_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)1094 gkd_exported_internal_proxy_get_property (GObject *object,
1095 guint prop_id,
1096 GValue *value,
1097 GParamSpec *pspec G_GNUC_UNUSED)
1098 {
1099 }
1100
1101 static void
gkd_exported_internal_proxy_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec G_GNUC_UNUSED)1102 gkd_exported_internal_proxy_set_property (GObject *object,
1103 guint prop_id,
1104 const GValue *value,
1105 GParamSpec *pspec G_GNUC_UNUSED)
1106 {
1107 }
1108
1109 static void
gkd_exported_internal_proxy_g_signal(GDBusProxy * proxy,const gchar * sender_name G_GNUC_UNUSED,const gchar * signal_name,GVariant * parameters)1110 gkd_exported_internal_proxy_g_signal (GDBusProxy *proxy,
1111 const gchar *sender_name G_GNUC_UNUSED,
1112 const gchar *signal_name,
1113 GVariant *parameters)
1114 {
1115 _ExtendedGDBusSignalInfo *info;
1116 GVariantIter iter;
1117 GVariant *child;
1118 GValue *paramv;
1119 gsize num_params;
1120 gsize n;
1121 guint signal_id;
1122 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gkd_exported_internal_interface_info.parent_struct, signal_name);
1123 if (info == NULL)
1124 return;
1125 num_params = g_variant_n_children (parameters);
1126 paramv = g_new0 (GValue, num_params + 1);
1127 g_value_init (¶mv[0], GKD_TYPE_EXPORTED_INTERNAL);
1128 g_value_set_object (¶mv[0], proxy);
1129 g_variant_iter_init (&iter, parameters);
1130 n = 1;
1131 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1132 {
1133 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1134 if (arg_info->use_gvariant)
1135 {
1136 g_value_init (¶mv[n], G_TYPE_VARIANT);
1137 g_value_set_variant (¶mv[n], child);
1138 n++;
1139 }
1140 else
1141 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1142 g_variant_unref (child);
1143 }
1144 signal_id = g_signal_lookup (info->signal_name, GKD_TYPE_EXPORTED_INTERNAL);
1145 g_signal_emitv (paramv, signal_id, 0, NULL);
1146 for (n = 0; n < num_params + 1; n++)
1147 g_value_unset (¶mv[n]);
1148 g_free (paramv);
1149 }
1150
1151 static void
gkd_exported_internal_proxy_g_properties_changed(GDBusProxy * _proxy,GVariant * changed_properties,const gchar * const * invalidated_properties)1152 gkd_exported_internal_proxy_g_properties_changed (GDBusProxy *_proxy,
1153 GVariant *changed_properties,
1154 const gchar *const *invalidated_properties)
1155 {
1156 GkdExportedInternalProxy *proxy = GKD_EXPORTED_INTERNAL_PROXY (_proxy);
1157 guint n;
1158 const gchar *key;
1159 GVariantIter *iter;
1160 _ExtendedGDBusPropertyInfo *info;
1161 g_variant_get (changed_properties, "a{sv}", &iter);
1162 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1163 {
1164 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gkd_exported_internal_interface_info.parent_struct, key);
1165 g_datalist_remove_data (&proxy->priv->qdata, key);
1166 if (info != NULL)
1167 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1168 }
1169 g_variant_iter_free (iter);
1170 for (n = 0; invalidated_properties[n] != NULL; n++)
1171 {
1172 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gkd_exported_internal_interface_info.parent_struct, invalidated_properties[n]);
1173 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
1174 if (info != NULL)
1175 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1176 }
1177 }
1178
1179 static void
gkd_exported_internal_proxy_init(GkdExportedInternalProxy * proxy)1180 gkd_exported_internal_proxy_init (GkdExportedInternalProxy *proxy)
1181 {
1182 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1183 proxy->priv = gkd_exported_internal_proxy_get_instance_private (proxy);
1184 #else
1185 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GKD_TYPE_EXPORTED_INTERNAL_PROXY, GkdExportedInternalProxyPrivate);
1186 #endif
1187
1188 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gkd_exported_internal_interface_info ());
1189 }
1190
1191 static void
gkd_exported_internal_proxy_class_init(GkdExportedInternalProxyClass * klass)1192 gkd_exported_internal_proxy_class_init (GkdExportedInternalProxyClass *klass)
1193 {
1194 GObjectClass *gobject_class;
1195 GDBusProxyClass *proxy_class;
1196
1197 gobject_class = G_OBJECT_CLASS (klass);
1198 gobject_class->finalize = gkd_exported_internal_proxy_finalize;
1199 gobject_class->get_property = gkd_exported_internal_proxy_get_property;
1200 gobject_class->set_property = gkd_exported_internal_proxy_set_property;
1201
1202 proxy_class = G_DBUS_PROXY_CLASS (klass);
1203 proxy_class->g_signal = gkd_exported_internal_proxy_g_signal;
1204 proxy_class->g_properties_changed = gkd_exported_internal_proxy_g_properties_changed;
1205
1206 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1207 g_type_class_add_private (klass, sizeof (GkdExportedInternalProxyPrivate));
1208 #endif
1209 }
1210
1211 static void
gkd_exported_internal_proxy_iface_init(GkdExportedInternalIface * iface)1212 gkd_exported_internal_proxy_iface_init (GkdExportedInternalIface *iface)
1213 {
1214 }
1215
1216 /**
1217 * gkd_exported_internal_proxy_new:
1218 * @connection: A #GDBusConnection.
1219 * @flags: Flags from the #GDBusProxyFlags enumeration.
1220 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1221 * @object_path: An object path.
1222 * @cancellable: (nullable): A #GCancellable or %NULL.
1223 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1224 * @user_data: User data to pass to @callback.
1225 *
1226 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.top_of_page">org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface</link>. See g_dbus_proxy_new() for more details.
1227 *
1228 * 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()).
1229 * You can then call gkd_exported_internal_proxy_new_finish() to get the result of the operation.
1230 *
1231 * See gkd_exported_internal_proxy_new_sync() for the synchronous, blocking version of this constructor.
1232 */
1233 void
gkd_exported_internal_proxy_new(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1234 gkd_exported_internal_proxy_new (
1235 GDBusConnection *connection,
1236 GDBusProxyFlags flags,
1237 const gchar *name,
1238 const gchar *object_path,
1239 GCancellable *cancellable,
1240 GAsyncReadyCallback callback,
1241 gpointer user_data)
1242 {
1243 g_async_initable_new_async (GKD_TYPE_EXPORTED_INTERNAL_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.gnome.keyring.InternalUnsupportedGuiltRiddenInterface", NULL);
1244 }
1245
1246 /**
1247 * gkd_exported_internal_proxy_new_finish:
1248 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gkd_exported_internal_proxy_new().
1249 * @error: Return location for error or %NULL
1250 *
1251 * Finishes an operation started with gkd_exported_internal_proxy_new().
1252 *
1253 * Returns: (transfer full) (type GkdExportedInternalProxy): The constructed proxy object or %NULL if @error is set.
1254 */
1255 GkdExportedInternal *
gkd_exported_internal_proxy_new_finish(GAsyncResult * res,GError ** error)1256 gkd_exported_internal_proxy_new_finish (
1257 GAsyncResult *res,
1258 GError **error)
1259 {
1260 GObject *ret;
1261 GObject *source_object;
1262 source_object = g_async_result_get_source_object (res);
1263 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1264 g_object_unref (source_object);
1265 if (ret != NULL)
1266 return GKD_EXPORTED_INTERNAL (ret);
1267 else
1268 return NULL;
1269 }
1270
1271 /**
1272 * gkd_exported_internal_proxy_new_sync:
1273 * @connection: A #GDBusConnection.
1274 * @flags: Flags from the #GDBusProxyFlags enumeration.
1275 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1276 * @object_path: An object path.
1277 * @cancellable: (nullable): A #GCancellable or %NULL.
1278 * @error: Return location for error or %NULL
1279 *
1280 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.top_of_page">org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface</link>. See g_dbus_proxy_new_sync() for more details.
1281 *
1282 * The calling thread is blocked until a reply is received.
1283 *
1284 * See gkd_exported_internal_proxy_new() for the asynchronous version of this constructor.
1285 *
1286 * Returns: (transfer full) (type GkdExportedInternalProxy): The constructed proxy object or %NULL if @error is set.
1287 */
1288 GkdExportedInternal *
gkd_exported_internal_proxy_new_sync(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1289 gkd_exported_internal_proxy_new_sync (
1290 GDBusConnection *connection,
1291 GDBusProxyFlags flags,
1292 const gchar *name,
1293 const gchar *object_path,
1294 GCancellable *cancellable,
1295 GError **error)
1296 {
1297 GInitable *ret;
1298 ret = g_initable_new (GKD_TYPE_EXPORTED_INTERNAL_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface", NULL);
1299 if (ret != NULL)
1300 return GKD_EXPORTED_INTERNAL (ret);
1301 else
1302 return NULL;
1303 }
1304
1305
1306 /**
1307 * gkd_exported_internal_proxy_new_for_bus:
1308 * @bus_type: A #GBusType.
1309 * @flags: Flags from the #GDBusProxyFlags enumeration.
1310 * @name: A bus name (well-known or unique).
1311 * @object_path: An object path.
1312 * @cancellable: (nullable): A #GCancellable or %NULL.
1313 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1314 * @user_data: User data to pass to @callback.
1315 *
1316 * Like gkd_exported_internal_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1317 *
1318 * 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()).
1319 * You can then call gkd_exported_internal_proxy_new_for_bus_finish() to get the result of the operation.
1320 *
1321 * See gkd_exported_internal_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1322 */
1323 void
gkd_exported_internal_proxy_new_for_bus(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1324 gkd_exported_internal_proxy_new_for_bus (
1325 GBusType bus_type,
1326 GDBusProxyFlags flags,
1327 const gchar *name,
1328 const gchar *object_path,
1329 GCancellable *cancellable,
1330 GAsyncReadyCallback callback,
1331 gpointer user_data)
1332 {
1333 g_async_initable_new_async (GKD_TYPE_EXPORTED_INTERNAL_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.gnome.keyring.InternalUnsupportedGuiltRiddenInterface", NULL);
1334 }
1335
1336 /**
1337 * gkd_exported_internal_proxy_new_for_bus_finish:
1338 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gkd_exported_internal_proxy_new_for_bus().
1339 * @error: Return location for error or %NULL
1340 *
1341 * Finishes an operation started with gkd_exported_internal_proxy_new_for_bus().
1342 *
1343 * Returns: (transfer full) (type GkdExportedInternalProxy): The constructed proxy object or %NULL if @error is set.
1344 */
1345 GkdExportedInternal *
gkd_exported_internal_proxy_new_for_bus_finish(GAsyncResult * res,GError ** error)1346 gkd_exported_internal_proxy_new_for_bus_finish (
1347 GAsyncResult *res,
1348 GError **error)
1349 {
1350 GObject *ret;
1351 GObject *source_object;
1352 source_object = g_async_result_get_source_object (res);
1353 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1354 g_object_unref (source_object);
1355 if (ret != NULL)
1356 return GKD_EXPORTED_INTERNAL (ret);
1357 else
1358 return NULL;
1359 }
1360
1361 /**
1362 * gkd_exported_internal_proxy_new_for_bus_sync:
1363 * @bus_type: A #GBusType.
1364 * @flags: Flags from the #GDBusProxyFlags enumeration.
1365 * @name: A bus name (well-known or unique).
1366 * @object_path: An object path.
1367 * @cancellable: (nullable): A #GCancellable or %NULL.
1368 * @error: Return location for error or %NULL
1369 *
1370 * Like gkd_exported_internal_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1371 *
1372 * The calling thread is blocked until a reply is received.
1373 *
1374 * See gkd_exported_internal_proxy_new_for_bus() for the asynchronous version of this constructor.
1375 *
1376 * Returns: (transfer full) (type GkdExportedInternalProxy): The constructed proxy object or %NULL if @error is set.
1377 */
1378 GkdExportedInternal *
gkd_exported_internal_proxy_new_for_bus_sync(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1379 gkd_exported_internal_proxy_new_for_bus_sync (
1380 GBusType bus_type,
1381 GDBusProxyFlags flags,
1382 const gchar *name,
1383 const gchar *object_path,
1384 GCancellable *cancellable,
1385 GError **error)
1386 {
1387 GInitable *ret;
1388 ret = g_initable_new (GKD_TYPE_EXPORTED_INTERNAL_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface", NULL);
1389 if (ret != NULL)
1390 return GKD_EXPORTED_INTERNAL (ret);
1391 else
1392 return NULL;
1393 }
1394
1395
1396 /* ------------------------------------------------------------------------ */
1397
1398 /**
1399 * GkdExportedInternalSkeleton:
1400 *
1401 * The #GkdExportedInternalSkeleton structure contains only private data and should only be accessed using the provided API.
1402 */
1403
1404 /**
1405 * GkdExportedInternalSkeletonClass:
1406 * @parent_class: The parent class.
1407 *
1408 * Class structure for #GkdExportedInternalSkeleton.
1409 */
1410
1411 struct _GkdExportedInternalSkeletonPrivate
1412 {
1413 GValue *properties;
1414 GList *changed_properties;
1415 GSource *changed_properties_idle_source;
1416 GMainContext *context;
1417 GMutex lock;
1418 };
1419
1420 static void
_gkd_exported_internal_skeleton_handle_method_call(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name,const gchar * method_name,GVariant * parameters,GDBusMethodInvocation * invocation,gpointer user_data)1421 _gkd_exported_internal_skeleton_handle_method_call (
1422 GDBusConnection *connection G_GNUC_UNUSED,
1423 const gchar *sender G_GNUC_UNUSED,
1424 const gchar *object_path G_GNUC_UNUSED,
1425 const gchar *interface_name,
1426 const gchar *method_name,
1427 GVariant *parameters,
1428 GDBusMethodInvocation *invocation,
1429 gpointer user_data)
1430 {
1431 GkdExportedInternalSkeleton *skeleton = GKD_EXPORTED_INTERNAL_SKELETON (user_data);
1432 _ExtendedGDBusMethodInfo *info;
1433 GVariantIter iter;
1434 GVariant *child;
1435 GValue *paramv;
1436 gsize num_params;
1437 guint num_extra;
1438 gsize n;
1439 guint signal_id;
1440 GValue return_value = G_VALUE_INIT;
1441 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1442 g_assert (info != NULL);
1443 num_params = g_variant_n_children (parameters);
1444 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
1445 n = 0;
1446 g_value_init (¶mv[n], GKD_TYPE_EXPORTED_INTERNAL);
1447 g_value_set_object (¶mv[n++], skeleton);
1448 g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1449 g_value_set_object (¶mv[n++], invocation);
1450 if (info->pass_fdlist)
1451 {
1452 #ifdef G_OS_UNIX
1453 g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
1454 g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1455 #else
1456 g_assert_not_reached ();
1457 #endif
1458 }
1459 g_variant_iter_init (&iter, parameters);
1460 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1461 {
1462 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1463 if (arg_info->use_gvariant)
1464 {
1465 g_value_init (¶mv[n], G_TYPE_VARIANT);
1466 g_value_set_variant (¶mv[n], child);
1467 n++;
1468 }
1469 else
1470 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1471 g_variant_unref (child);
1472 }
1473 signal_id = g_signal_lookup (info->signal_name, GKD_TYPE_EXPORTED_INTERNAL);
1474 g_value_init (&return_value, G_TYPE_BOOLEAN);
1475 g_signal_emitv (paramv, signal_id, 0, &return_value);
1476 if (!g_value_get_boolean (&return_value))
1477 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);
1478 g_value_unset (&return_value);
1479 for (n = 0; n < num_params + num_extra; n++)
1480 g_value_unset (¶mv[n]);
1481 g_free (paramv);
1482 }
1483
1484 static GVariant *
_gkd_exported_internal_skeleton_handle_get_property(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name G_GNUC_UNUSED,const gchar * property_name,GError ** error,gpointer user_data)1485 _gkd_exported_internal_skeleton_handle_get_property (
1486 GDBusConnection *connection G_GNUC_UNUSED,
1487 const gchar *sender G_GNUC_UNUSED,
1488 const gchar *object_path G_GNUC_UNUSED,
1489 const gchar *interface_name G_GNUC_UNUSED,
1490 const gchar *property_name,
1491 GError **error,
1492 gpointer user_data)
1493 {
1494 GkdExportedInternalSkeleton *skeleton = GKD_EXPORTED_INTERNAL_SKELETON (user_data);
1495 GValue value = G_VALUE_INIT;
1496 GParamSpec *pspec;
1497 _ExtendedGDBusPropertyInfo *info;
1498 GVariant *ret;
1499 ret = NULL;
1500 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gkd_exported_internal_interface_info.parent_struct, property_name);
1501 g_assert (info != NULL);
1502 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1503 if (pspec == NULL)
1504 {
1505 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1506 }
1507 else
1508 {
1509 g_value_init (&value, pspec->value_type);
1510 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1511 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
1512 g_value_unset (&value);
1513 }
1514 return ret;
1515 }
1516
1517 static gboolean
_gkd_exported_internal_skeleton_handle_set_property(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name G_GNUC_UNUSED,const gchar * property_name,GVariant * variant,GError ** error,gpointer user_data)1518 _gkd_exported_internal_skeleton_handle_set_property (
1519 GDBusConnection *connection G_GNUC_UNUSED,
1520 const gchar *sender G_GNUC_UNUSED,
1521 const gchar *object_path G_GNUC_UNUSED,
1522 const gchar *interface_name G_GNUC_UNUSED,
1523 const gchar *property_name,
1524 GVariant *variant,
1525 GError **error,
1526 gpointer user_data)
1527 {
1528 GkdExportedInternalSkeleton *skeleton = GKD_EXPORTED_INTERNAL_SKELETON (user_data);
1529 GValue value = G_VALUE_INIT;
1530 GParamSpec *pspec;
1531 _ExtendedGDBusPropertyInfo *info;
1532 gboolean ret;
1533 ret = FALSE;
1534 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gkd_exported_internal_interface_info.parent_struct, property_name);
1535 g_assert (info != NULL);
1536 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1537 if (pspec == NULL)
1538 {
1539 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1540 }
1541 else
1542 {
1543 if (info->use_gvariant)
1544 g_value_set_variant (&value, variant);
1545 else
1546 g_dbus_gvariant_to_gvalue (variant, &value);
1547 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1548 g_value_unset (&value);
1549 ret = TRUE;
1550 }
1551 return ret;
1552 }
1553
1554 static const GDBusInterfaceVTable _gkd_exported_internal_skeleton_vtable =
1555 {
1556 _gkd_exported_internal_skeleton_handle_method_call,
1557 _gkd_exported_internal_skeleton_handle_get_property,
1558 _gkd_exported_internal_skeleton_handle_set_property,
1559 {NULL}
1560 };
1561
1562 static GDBusInterfaceInfo *
gkd_exported_internal_skeleton_dbus_interface_get_info(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)1563 gkd_exported_internal_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1564 {
1565 return gkd_exported_internal_interface_info ();
1566 }
1567
1568 static GDBusInterfaceVTable *
gkd_exported_internal_skeleton_dbus_interface_get_vtable(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)1569 gkd_exported_internal_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1570 {
1571 return (GDBusInterfaceVTable *) &_gkd_exported_internal_skeleton_vtable;
1572 }
1573
1574 static GVariant *
gkd_exported_internal_skeleton_dbus_interface_get_properties(GDBusInterfaceSkeleton * _skeleton)1575 gkd_exported_internal_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1576 {
1577 GkdExportedInternalSkeleton *skeleton = GKD_EXPORTED_INTERNAL_SKELETON (_skeleton);
1578
1579 GVariantBuilder builder;
1580 guint n;
1581 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1582 if (_gkd_exported_internal_interface_info.parent_struct.properties == NULL)
1583 goto out;
1584 for (n = 0; _gkd_exported_internal_interface_info.parent_struct.properties[n] != NULL; n++)
1585 {
1586 GDBusPropertyInfo *info = _gkd_exported_internal_interface_info.parent_struct.properties[n];
1587 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1588 {
1589 GVariant *value;
1590 value = _gkd_exported_internal_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.gnome.keyring.InternalUnsupportedGuiltRiddenInterface", info->name, NULL, skeleton);
1591 if (value != NULL)
1592 {
1593 g_variant_take_ref (value);
1594 g_variant_builder_add (&builder, "{sv}", info->name, value);
1595 g_variant_unref (value);
1596 }
1597 }
1598 }
1599 out:
1600 return g_variant_builder_end (&builder);
1601 }
1602
1603 static void
gkd_exported_internal_skeleton_dbus_interface_flush(GDBusInterfaceSkeleton * _skeleton)1604 gkd_exported_internal_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1605 {
1606 }
1607
1608 static void gkd_exported_internal_skeleton_iface_init (GkdExportedInternalIface *iface);
1609 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(GkdExportedInternalSkeleton,gkd_exported_internal_skeleton,G_TYPE_DBUS_INTERFACE_SKELETON,G_ADD_PRIVATE (GkdExportedInternalSkeleton)G_IMPLEMENT_INTERFACE (GKD_TYPE_EXPORTED_INTERNAL,gkd_exported_internal_skeleton_iface_init))1610 G_DEFINE_TYPE_WITH_CODE (GkdExportedInternalSkeleton, gkd_exported_internal_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1611 G_ADD_PRIVATE (GkdExportedInternalSkeleton)
1612 G_IMPLEMENT_INTERFACE (GKD_TYPE_EXPORTED_INTERNAL, gkd_exported_internal_skeleton_iface_init))
1613
1614 #else
1615 G_DEFINE_TYPE_WITH_CODE (GkdExportedInternalSkeleton, gkd_exported_internal_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1616 G_IMPLEMENT_INTERFACE (GKD_TYPE_EXPORTED_INTERNAL, gkd_exported_internal_skeleton_iface_init))
1617
1618 #endif
1619 static void
1620 gkd_exported_internal_skeleton_finalize (GObject *object)
1621 {
1622 GkdExportedInternalSkeleton *skeleton = GKD_EXPORTED_INTERNAL_SKELETON (object);
1623 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1624 if (skeleton->priv->changed_properties_idle_source != NULL)
1625 g_source_destroy (skeleton->priv->changed_properties_idle_source);
1626 g_main_context_unref (skeleton->priv->context);
1627 g_mutex_clear (&skeleton->priv->lock);
1628 G_OBJECT_CLASS (gkd_exported_internal_skeleton_parent_class)->finalize (object);
1629 }
1630
1631 static void
gkd_exported_internal_skeleton_init(GkdExportedInternalSkeleton * skeleton)1632 gkd_exported_internal_skeleton_init (GkdExportedInternalSkeleton *skeleton)
1633 {
1634 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1635 skeleton->priv = gkd_exported_internal_skeleton_get_instance_private (skeleton);
1636 #else
1637 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GKD_TYPE_EXPORTED_INTERNAL_SKELETON, GkdExportedInternalSkeletonPrivate);
1638 #endif
1639
1640 g_mutex_init (&skeleton->priv->lock);
1641 skeleton->priv->context = g_main_context_ref_thread_default ();
1642 }
1643
1644 static void
gkd_exported_internal_skeleton_class_init(GkdExportedInternalSkeletonClass * klass)1645 gkd_exported_internal_skeleton_class_init (GkdExportedInternalSkeletonClass *klass)
1646 {
1647 GObjectClass *gobject_class;
1648 GDBusInterfaceSkeletonClass *skeleton_class;
1649
1650 gobject_class = G_OBJECT_CLASS (klass);
1651 gobject_class->finalize = gkd_exported_internal_skeleton_finalize;
1652
1653 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1654 skeleton_class->get_info = gkd_exported_internal_skeleton_dbus_interface_get_info;
1655 skeleton_class->get_properties = gkd_exported_internal_skeleton_dbus_interface_get_properties;
1656 skeleton_class->flush = gkd_exported_internal_skeleton_dbus_interface_flush;
1657 skeleton_class->get_vtable = gkd_exported_internal_skeleton_dbus_interface_get_vtable;
1658
1659 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1660 g_type_class_add_private (klass, sizeof (GkdExportedInternalSkeletonPrivate));
1661 #endif
1662 }
1663
1664 static void
gkd_exported_internal_skeleton_iface_init(GkdExportedInternalIface * iface)1665 gkd_exported_internal_skeleton_iface_init (GkdExportedInternalIface *iface)
1666 {
1667 }
1668
1669 /**
1670 * gkd_exported_internal_skeleton_new:
1671 *
1672 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-keyring-InternalUnsupportedGuiltRiddenInterface.top_of_page">org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface</link>.
1673 *
1674 * Returns: (transfer full) (type GkdExportedInternalSkeleton): The skeleton object.
1675 */
1676 GkdExportedInternal *
gkd_exported_internal_skeleton_new(void)1677 gkd_exported_internal_skeleton_new (void)
1678 {
1679 return GKD_EXPORTED_INTERNAL (g_object_new (GKD_TYPE_EXPORTED_INTERNAL_SKELETON, NULL));
1680 }
1681
1682