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