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