1 /*
2 * This file is generated by gdbus-codegen, do not modify it.
3 *
4 * The license of this code is the same as for the D-Bus interface description
5 * it was derived from. Note that it links to GLib, so must comply with the
6 * LGPL linking clauses.
7 */
8
9 #ifdef HAVE_CONFIG_H
10 # include "config.h"
11 #endif
12
13 #include "org.gnome.Identity.h"
14
15 #include <string.h>
16 #ifdef G_OS_UNIX
17 # include <gio/gunixfdlist.h>
18 #endif
19
20 typedef struct
21 {
22 GDBusArgInfo parent_struct;
23 gboolean use_gvariant;
24 } _ExtendedGDBusArgInfo;
25
26 typedef struct
27 {
28 GDBusMethodInfo parent_struct;
29 const gchar *signal_name;
30 gboolean pass_fdlist;
31 } _ExtendedGDBusMethodInfo;
32
33 typedef struct
34 {
35 GDBusSignalInfo parent_struct;
36 const gchar *signal_name;
37 } _ExtendedGDBusSignalInfo;
38
39 typedef struct
40 {
41 GDBusPropertyInfo parent_struct;
42 const gchar *hyphen_name;
43 guint use_gvariant : 1;
44 guint emits_changed_signal : 1;
45 } _ExtendedGDBusPropertyInfo;
46
47 typedef struct
48 {
49 GDBusInterfaceInfo parent_struct;
50 const gchar *hyphen_name;
51 } _ExtendedGDBusInterfaceInfo;
52
53 typedef struct
54 {
55 const _ExtendedGDBusPropertyInfo *info;
56 guint prop_id;
57 GValue orig_value; /* the value before the change */
58 } ChangedProperty;
59
60 static void
_changed_property_free(ChangedProperty * data)61 _changed_property_free (ChangedProperty *data)
62 {
63 g_value_unset (&data->orig_value);
64 g_free (data);
65 }
66
67 static gboolean
_g_strv_equal0(gchar ** a,gchar ** b)68 _g_strv_equal0 (gchar **a, gchar **b)
69 {
70 gboolean ret = FALSE;
71 guint n;
72 if (a == NULL && b == NULL)
73 {
74 ret = TRUE;
75 goto out;
76 }
77 if (a == NULL || b == NULL)
78 goto out;
79 if (g_strv_length (a) != g_strv_length (b))
80 goto out;
81 for (n = 0; a[n] != NULL; n++)
82 if (g_strcmp0 (a[n], b[n]) != 0)
83 goto out;
84 ret = TRUE;
85 out:
86 return ret;
87 }
88
89 static gboolean
_g_variant_equal0(GVariant * a,GVariant * b)90 _g_variant_equal0 (GVariant *a, GVariant *b)
91 {
92 gboolean ret = FALSE;
93 if (a == NULL && b == NULL)
94 {
95 ret = TRUE;
96 goto out;
97 }
98 if (a == NULL || b == NULL)
99 goto out;
100 ret = g_variant_equal (a, b);
101 out:
102 return ret;
103 }
104
105 G_GNUC_UNUSED static gboolean
_g_value_equal(const GValue * a,const GValue * b)106 _g_value_equal (const GValue *a, const GValue *b)
107 {
108 gboolean ret = FALSE;
109 g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
110 switch (G_VALUE_TYPE (a))
111 {
112 case G_TYPE_BOOLEAN:
113 ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
114 break;
115 case G_TYPE_UCHAR:
116 ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
117 break;
118 case G_TYPE_INT:
119 ret = (g_value_get_int (a) == g_value_get_int (b));
120 break;
121 case G_TYPE_UINT:
122 ret = (g_value_get_uint (a) == g_value_get_uint (b));
123 break;
124 case G_TYPE_INT64:
125 ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
126 break;
127 case G_TYPE_UINT64:
128 ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
129 break;
130 case G_TYPE_DOUBLE:
131 {
132 /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
133 gdouble da = g_value_get_double (a);
134 gdouble db = g_value_get_double (b);
135 ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
136 }
137 break;
138 case G_TYPE_STRING:
139 ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
140 break;
141 case G_TYPE_VARIANT:
142 ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
143 break;
144 default:
145 if (G_VALUE_TYPE (a) == G_TYPE_STRV)
146 ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
147 else
148 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
149 break;
150 }
151 return ret;
152 }
153
154 /* ------------------------------------------------------------------------
155 * Code for interface org.gnome.Identity.Manager
156 * ------------------------------------------------------------------------
157 */
158
159 /**
160 * SECTION:GoaIdentityServiceManager
161 * @title: GoaIdentityServiceManager
162 * @short_description: Generated C code for the org.gnome.Identity.Manager D-Bus interface
163 *
164 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link> D-Bus interface in C.
165 */
166
167 /* ---- Introspection data for org.gnome.Identity.Manager ---- */
168
169 static const _ExtendedGDBusArgInfo _goa_identity_service_manager_method_info_exchange_secret_keys_IN_ARG_identifier =
170 {
171 {
172 -1,
173 (gchar *) "identifier",
174 (gchar *) "s",
175 NULL
176 },
177 FALSE
178 };
179
180 static const _ExtendedGDBusArgInfo _goa_identity_service_manager_method_info_exchange_secret_keys_IN_ARG_input_key =
181 {
182 {
183 -1,
184 (gchar *) "input_key",
185 (gchar *) "s",
186 NULL
187 },
188 FALSE
189 };
190
191 static const GDBusArgInfo * const _goa_identity_service_manager_method_info_exchange_secret_keys_IN_ARG_pointers[] =
192 {
193 &_goa_identity_service_manager_method_info_exchange_secret_keys_IN_ARG_identifier.parent_struct,
194 &_goa_identity_service_manager_method_info_exchange_secret_keys_IN_ARG_input_key.parent_struct,
195 NULL
196 };
197
198 static const _ExtendedGDBusArgInfo _goa_identity_service_manager_method_info_exchange_secret_keys_OUT_ARG_output_key =
199 {
200 {
201 -1,
202 (gchar *) "output_key",
203 (gchar *) "s",
204 NULL
205 },
206 FALSE
207 };
208
209 static const GDBusArgInfo * const _goa_identity_service_manager_method_info_exchange_secret_keys_OUT_ARG_pointers[] =
210 {
211 &_goa_identity_service_manager_method_info_exchange_secret_keys_OUT_ARG_output_key.parent_struct,
212 NULL
213 };
214
215 static const _ExtendedGDBusMethodInfo _goa_identity_service_manager_method_info_exchange_secret_keys =
216 {
217 {
218 -1,
219 (gchar *) "ExchangeSecretKeys",
220 (GDBusArgInfo **) &_goa_identity_service_manager_method_info_exchange_secret_keys_IN_ARG_pointers,
221 (GDBusArgInfo **) &_goa_identity_service_manager_method_info_exchange_secret_keys_OUT_ARG_pointers,
222 NULL
223 },
224 "handle-exchange-secret-keys",
225 FALSE
226 };
227
228 static const _ExtendedGDBusArgInfo _goa_identity_service_manager_method_info_sign_in_IN_ARG_identifier =
229 {
230 {
231 -1,
232 (gchar *) "identifier",
233 (gchar *) "s",
234 NULL
235 },
236 FALSE
237 };
238
239 static const _ExtendedGDBusArgInfo _goa_identity_service_manager_method_info_sign_in_IN_ARG_details =
240 {
241 {
242 -1,
243 (gchar *) "details",
244 (gchar *) "a{ss}",
245 NULL
246 },
247 FALSE
248 };
249
250 static const GDBusArgInfo * const _goa_identity_service_manager_method_info_sign_in_IN_ARG_pointers[] =
251 {
252 &_goa_identity_service_manager_method_info_sign_in_IN_ARG_identifier.parent_struct,
253 &_goa_identity_service_manager_method_info_sign_in_IN_ARG_details.parent_struct,
254 NULL
255 };
256
257 static const _ExtendedGDBusArgInfo _goa_identity_service_manager_method_info_sign_in_OUT_ARG_identity_object_path =
258 {
259 {
260 -1,
261 (gchar *) "identity_object_path",
262 (gchar *) "o",
263 NULL
264 },
265 FALSE
266 };
267
268 static const GDBusArgInfo * const _goa_identity_service_manager_method_info_sign_in_OUT_ARG_pointers[] =
269 {
270 &_goa_identity_service_manager_method_info_sign_in_OUT_ARG_identity_object_path.parent_struct,
271 NULL
272 };
273
274 static const _ExtendedGDBusMethodInfo _goa_identity_service_manager_method_info_sign_in =
275 {
276 {
277 -1,
278 (gchar *) "SignIn",
279 (GDBusArgInfo **) &_goa_identity_service_manager_method_info_sign_in_IN_ARG_pointers,
280 (GDBusArgInfo **) &_goa_identity_service_manager_method_info_sign_in_OUT_ARG_pointers,
281 NULL
282 },
283 "handle-sign-in",
284 FALSE
285 };
286
287 static const _ExtendedGDBusArgInfo _goa_identity_service_manager_method_info_sign_out_IN_ARG_identity =
288 {
289 {
290 -1,
291 (gchar *) "identity",
292 (gchar *) "s",
293 NULL
294 },
295 FALSE
296 };
297
298 static const GDBusArgInfo * const _goa_identity_service_manager_method_info_sign_out_IN_ARG_pointers[] =
299 {
300 &_goa_identity_service_manager_method_info_sign_out_IN_ARG_identity.parent_struct,
301 NULL
302 };
303
304 static const _ExtendedGDBusMethodInfo _goa_identity_service_manager_method_info_sign_out =
305 {
306 {
307 -1,
308 (gchar *) "SignOut",
309 (GDBusArgInfo **) &_goa_identity_service_manager_method_info_sign_out_IN_ARG_pointers,
310 NULL,
311 NULL
312 },
313 "handle-sign-out",
314 FALSE
315 };
316
317 static const GDBusMethodInfo * const _goa_identity_service_manager_method_info_pointers[] =
318 {
319 &_goa_identity_service_manager_method_info_exchange_secret_keys.parent_struct,
320 &_goa_identity_service_manager_method_info_sign_in.parent_struct,
321 &_goa_identity_service_manager_method_info_sign_out.parent_struct,
322 NULL
323 };
324
325 static const _ExtendedGDBusInterfaceInfo _goa_identity_service_manager_interface_info =
326 {
327 {
328 -1,
329 (gchar *) "org.gnome.Identity.Manager",
330 (GDBusMethodInfo **) &_goa_identity_service_manager_method_info_pointers,
331 NULL,
332 NULL,
333 NULL
334 },
335 "manager",
336 };
337
338
339 /**
340 * goa_identity_service_manager_interface_info:
341 *
342 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link> D-Bus interface.
343 *
344 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
345 */
346 GDBusInterfaceInfo *
goa_identity_service_manager_interface_info(void)347 goa_identity_service_manager_interface_info (void)
348 {
349 return (GDBusInterfaceInfo *) &_goa_identity_service_manager_interface_info.parent_struct;
350 }
351
352 /**
353 * goa_identity_service_manager_override_properties:
354 * @klass: The class structure for a #GObject derived class.
355 * @property_id_begin: The property id to assign to the first overridden property.
356 *
357 * Overrides all #GObject properties in the #GoaIdentityServiceManager interface for a concrete class.
358 * The properties are overridden in the order they are defined.
359 *
360 * Returns: The last property id.
361 */
362 guint
goa_identity_service_manager_override_properties(GObjectClass * klass,guint property_id_begin)363 goa_identity_service_manager_override_properties (GObjectClass *klass, guint property_id_begin)
364 {
365 return property_id_begin - 1;
366 }
367
368
369
370 /**
371 * GoaIdentityServiceManager:
372 *
373 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link>.
374 */
375
376 /**
377 * GoaIdentityServiceManagerIface:
378 * @parent_iface: The parent interface.
379 * @handle_exchange_secret_keys: Handler for the #GoaIdentityServiceManager::handle-exchange-secret-keys signal.
380 * @handle_sign_in: Handler for the #GoaIdentityServiceManager::handle-sign-in signal.
381 * @handle_sign_out: Handler for the #GoaIdentityServiceManager::handle-sign-out signal.
382 *
383 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link>.
384 */
385
386 typedef GoaIdentityServiceManagerIface GoaIdentityServiceManagerInterface;
G_DEFINE_INTERFACE(GoaIdentityServiceManager,goa_identity_service_manager,G_TYPE_OBJECT)387 G_DEFINE_INTERFACE (GoaIdentityServiceManager, goa_identity_service_manager, G_TYPE_OBJECT)
388
389 static void
390 goa_identity_service_manager_default_init (GoaIdentityServiceManagerIface *iface)
391 {
392 /* GObject signals for incoming D-Bus method calls: */
393 /**
394 * GoaIdentityServiceManager::handle-exchange-secret-keys:
395 * @object: A #GoaIdentityServiceManager.
396 * @invocation: A #GDBusMethodInvocation.
397 * @arg_identifier: Argument passed by remote caller.
398 * @arg_input_key: Argument passed by remote caller.
399 *
400 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Identity-Manager.ExchangeSecretKeys">ExchangeSecretKeys()</link> D-Bus method.
401 *
402 * 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 goa_identity_service_manager_complete_exchange_secret_keys() 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.
403 *
404 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
405 */
406 g_signal_new ("handle-exchange-secret-keys",
407 G_TYPE_FROM_INTERFACE (iface),
408 G_SIGNAL_RUN_LAST,
409 G_STRUCT_OFFSET (GoaIdentityServiceManagerIface, handle_exchange_secret_keys),
410 g_signal_accumulator_true_handled,
411 NULL,
412 g_cclosure_marshal_generic,
413 G_TYPE_BOOLEAN,
414 3,
415 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING);
416
417 /**
418 * GoaIdentityServiceManager::handle-sign-in:
419 * @object: A #GoaIdentityServiceManager.
420 * @invocation: A #GDBusMethodInvocation.
421 * @arg_identifier: Argument passed by remote caller.
422 * @arg_details: Argument passed by remote caller.
423 *
424 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Identity-Manager.SignIn">SignIn()</link> D-Bus method.
425 *
426 * 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 goa_identity_service_manager_complete_sign_in() 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.
427 *
428 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
429 */
430 g_signal_new ("handle-sign-in",
431 G_TYPE_FROM_INTERFACE (iface),
432 G_SIGNAL_RUN_LAST,
433 G_STRUCT_OFFSET (GoaIdentityServiceManagerIface, handle_sign_in),
434 g_signal_accumulator_true_handled,
435 NULL,
436 g_cclosure_marshal_generic,
437 G_TYPE_BOOLEAN,
438 3,
439 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT);
440
441 /**
442 * GoaIdentityServiceManager::handle-sign-out:
443 * @object: A #GoaIdentityServiceManager.
444 * @invocation: A #GDBusMethodInvocation.
445 * @arg_identity: Argument passed by remote caller.
446 *
447 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Identity-Manager.SignOut">SignOut()</link> D-Bus method.
448 *
449 * 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 goa_identity_service_manager_complete_sign_out() 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.
450 *
451 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
452 */
453 g_signal_new ("handle-sign-out",
454 G_TYPE_FROM_INTERFACE (iface),
455 G_SIGNAL_RUN_LAST,
456 G_STRUCT_OFFSET (GoaIdentityServiceManagerIface, handle_sign_out),
457 g_signal_accumulator_true_handled,
458 NULL,
459 g_cclosure_marshal_generic,
460 G_TYPE_BOOLEAN,
461 2,
462 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
463
464 }
465
466 /**
467 * goa_identity_service_manager_call_exchange_secret_keys:
468 * @proxy: A #GoaIdentityServiceManagerProxy.
469 * @arg_identifier: Argument to pass with the method invocation.
470 * @arg_input_key: Argument to pass with the method invocation.
471 * @cancellable: (nullable): A #GCancellable or %NULL.
472 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
473 * @user_data: User data to pass to @callback.
474 *
475 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-Identity-Manager.ExchangeSecretKeys">ExchangeSecretKeys()</link> D-Bus method on @proxy.
476 * 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()).
477 * You can then call goa_identity_service_manager_call_exchange_secret_keys_finish() to get the result of the operation.
478 *
479 * See goa_identity_service_manager_call_exchange_secret_keys_sync() for the synchronous, blocking version of this method.
480 */
481 void
goa_identity_service_manager_call_exchange_secret_keys(GoaIdentityServiceManager * proxy,const gchar * arg_identifier,const gchar * arg_input_key,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)482 goa_identity_service_manager_call_exchange_secret_keys (
483 GoaIdentityServiceManager *proxy,
484 const gchar *arg_identifier,
485 const gchar *arg_input_key,
486 GCancellable *cancellable,
487 GAsyncReadyCallback callback,
488 gpointer user_data)
489 {
490 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
491 "ExchangeSecretKeys",
492 g_variant_new ("(ss)",
493 arg_identifier,
494 arg_input_key),
495 G_DBUS_CALL_FLAGS_NONE,
496 -1,
497 cancellable,
498 callback,
499 user_data);
500 }
501
502 /**
503 * goa_identity_service_manager_call_exchange_secret_keys_finish:
504 * @proxy: A #GoaIdentityServiceManagerProxy.
505 * @out_output_key: (out) (optional): Return location for return parameter or %NULL to ignore.
506 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_manager_call_exchange_secret_keys().
507 * @error: Return location for error or %NULL.
508 *
509 * Finishes an operation started with goa_identity_service_manager_call_exchange_secret_keys().
510 *
511 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
512 */
513 gboolean
goa_identity_service_manager_call_exchange_secret_keys_finish(GoaIdentityServiceManager * proxy,gchar ** out_output_key,GAsyncResult * res,GError ** error)514 goa_identity_service_manager_call_exchange_secret_keys_finish (
515 GoaIdentityServiceManager *proxy,
516 gchar **out_output_key,
517 GAsyncResult *res,
518 GError **error)
519 {
520 GVariant *_ret;
521 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
522 if (_ret == NULL)
523 goto _out;
524 g_variant_get (_ret,
525 "(s)",
526 out_output_key);
527 g_variant_unref (_ret);
528 _out:
529 return _ret != NULL;
530 }
531
532 /**
533 * goa_identity_service_manager_call_exchange_secret_keys_sync:
534 * @proxy: A #GoaIdentityServiceManagerProxy.
535 * @arg_identifier: Argument to pass with the method invocation.
536 * @arg_input_key: Argument to pass with the method invocation.
537 * @out_output_key: (out) (optional): Return location for return parameter or %NULL to ignore.
538 * @cancellable: (nullable): A #GCancellable or %NULL.
539 * @error: Return location for error or %NULL.
540 *
541 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-Identity-Manager.ExchangeSecretKeys">ExchangeSecretKeys()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
542 *
543 * See goa_identity_service_manager_call_exchange_secret_keys() for the asynchronous version of this method.
544 *
545 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
546 */
547 gboolean
goa_identity_service_manager_call_exchange_secret_keys_sync(GoaIdentityServiceManager * proxy,const gchar * arg_identifier,const gchar * arg_input_key,gchar ** out_output_key,GCancellable * cancellable,GError ** error)548 goa_identity_service_manager_call_exchange_secret_keys_sync (
549 GoaIdentityServiceManager *proxy,
550 const gchar *arg_identifier,
551 const gchar *arg_input_key,
552 gchar **out_output_key,
553 GCancellable *cancellable,
554 GError **error)
555 {
556 GVariant *_ret;
557 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
558 "ExchangeSecretKeys",
559 g_variant_new ("(ss)",
560 arg_identifier,
561 arg_input_key),
562 G_DBUS_CALL_FLAGS_NONE,
563 -1,
564 cancellable,
565 error);
566 if (_ret == NULL)
567 goto _out;
568 g_variant_get (_ret,
569 "(s)",
570 out_output_key);
571 g_variant_unref (_ret);
572 _out:
573 return _ret != NULL;
574 }
575
576 /**
577 * goa_identity_service_manager_call_sign_in:
578 * @proxy: A #GoaIdentityServiceManagerProxy.
579 * @arg_identifier: Argument to pass with the method invocation.
580 * @arg_details: Argument to pass with the method invocation.
581 * @cancellable: (nullable): A #GCancellable or %NULL.
582 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
583 * @user_data: User data to pass to @callback.
584 *
585 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-Identity-Manager.SignIn">SignIn()</link> D-Bus method on @proxy.
586 * 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()).
587 * You can then call goa_identity_service_manager_call_sign_in_finish() to get the result of the operation.
588 *
589 * See goa_identity_service_manager_call_sign_in_sync() for the synchronous, blocking version of this method.
590 */
591 void
goa_identity_service_manager_call_sign_in(GoaIdentityServiceManager * proxy,const gchar * arg_identifier,GVariant * arg_details,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)592 goa_identity_service_manager_call_sign_in (
593 GoaIdentityServiceManager *proxy,
594 const gchar *arg_identifier,
595 GVariant *arg_details,
596 GCancellable *cancellable,
597 GAsyncReadyCallback callback,
598 gpointer user_data)
599 {
600 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
601 "SignIn",
602 g_variant_new ("(s@a{ss})",
603 arg_identifier,
604 arg_details),
605 G_DBUS_CALL_FLAGS_NONE,
606 -1,
607 cancellable,
608 callback,
609 user_data);
610 }
611
612 /**
613 * goa_identity_service_manager_call_sign_in_finish:
614 * @proxy: A #GoaIdentityServiceManagerProxy.
615 * @out_identity_object_path: (out) (optional): Return location for return parameter or %NULL to ignore.
616 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_manager_call_sign_in().
617 * @error: Return location for error or %NULL.
618 *
619 * Finishes an operation started with goa_identity_service_manager_call_sign_in().
620 *
621 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
622 */
623 gboolean
goa_identity_service_manager_call_sign_in_finish(GoaIdentityServiceManager * proxy,gchar ** out_identity_object_path,GAsyncResult * res,GError ** error)624 goa_identity_service_manager_call_sign_in_finish (
625 GoaIdentityServiceManager *proxy,
626 gchar **out_identity_object_path,
627 GAsyncResult *res,
628 GError **error)
629 {
630 GVariant *_ret;
631 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
632 if (_ret == NULL)
633 goto _out;
634 g_variant_get (_ret,
635 "(o)",
636 out_identity_object_path);
637 g_variant_unref (_ret);
638 _out:
639 return _ret != NULL;
640 }
641
642 /**
643 * goa_identity_service_manager_call_sign_in_sync:
644 * @proxy: A #GoaIdentityServiceManagerProxy.
645 * @arg_identifier: Argument to pass with the method invocation.
646 * @arg_details: Argument to pass with the method invocation.
647 * @out_identity_object_path: (out) (optional): Return location for return parameter or %NULL to ignore.
648 * @cancellable: (nullable): A #GCancellable or %NULL.
649 * @error: Return location for error or %NULL.
650 *
651 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-Identity-Manager.SignIn">SignIn()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
652 *
653 * See goa_identity_service_manager_call_sign_in() for the asynchronous version of this method.
654 *
655 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
656 */
657 gboolean
goa_identity_service_manager_call_sign_in_sync(GoaIdentityServiceManager * proxy,const gchar * arg_identifier,GVariant * arg_details,gchar ** out_identity_object_path,GCancellable * cancellable,GError ** error)658 goa_identity_service_manager_call_sign_in_sync (
659 GoaIdentityServiceManager *proxy,
660 const gchar *arg_identifier,
661 GVariant *arg_details,
662 gchar **out_identity_object_path,
663 GCancellable *cancellable,
664 GError **error)
665 {
666 GVariant *_ret;
667 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
668 "SignIn",
669 g_variant_new ("(s@a{ss})",
670 arg_identifier,
671 arg_details),
672 G_DBUS_CALL_FLAGS_NONE,
673 -1,
674 cancellable,
675 error);
676 if (_ret == NULL)
677 goto _out;
678 g_variant_get (_ret,
679 "(o)",
680 out_identity_object_path);
681 g_variant_unref (_ret);
682 _out:
683 return _ret != NULL;
684 }
685
686 /**
687 * goa_identity_service_manager_call_sign_out:
688 * @proxy: A #GoaIdentityServiceManagerProxy.
689 * @arg_identity: Argument to pass with the method invocation.
690 * @cancellable: (nullable): A #GCancellable or %NULL.
691 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
692 * @user_data: User data to pass to @callback.
693 *
694 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-Identity-Manager.SignOut">SignOut()</link> D-Bus method on @proxy.
695 * 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()).
696 * You can then call goa_identity_service_manager_call_sign_out_finish() to get the result of the operation.
697 *
698 * See goa_identity_service_manager_call_sign_out_sync() for the synchronous, blocking version of this method.
699 */
700 void
goa_identity_service_manager_call_sign_out(GoaIdentityServiceManager * proxy,const gchar * arg_identity,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)701 goa_identity_service_manager_call_sign_out (
702 GoaIdentityServiceManager *proxy,
703 const gchar *arg_identity,
704 GCancellable *cancellable,
705 GAsyncReadyCallback callback,
706 gpointer user_data)
707 {
708 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
709 "SignOut",
710 g_variant_new ("(s)",
711 arg_identity),
712 G_DBUS_CALL_FLAGS_NONE,
713 -1,
714 cancellable,
715 callback,
716 user_data);
717 }
718
719 /**
720 * goa_identity_service_manager_call_sign_out_finish:
721 * @proxy: A #GoaIdentityServiceManagerProxy.
722 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_manager_call_sign_out().
723 * @error: Return location for error or %NULL.
724 *
725 * Finishes an operation started with goa_identity_service_manager_call_sign_out().
726 *
727 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
728 */
729 gboolean
goa_identity_service_manager_call_sign_out_finish(GoaIdentityServiceManager * proxy,GAsyncResult * res,GError ** error)730 goa_identity_service_manager_call_sign_out_finish (
731 GoaIdentityServiceManager *proxy,
732 GAsyncResult *res,
733 GError **error)
734 {
735 GVariant *_ret;
736 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
737 if (_ret == NULL)
738 goto _out;
739 g_variant_get (_ret,
740 "()");
741 g_variant_unref (_ret);
742 _out:
743 return _ret != NULL;
744 }
745
746 /**
747 * goa_identity_service_manager_call_sign_out_sync:
748 * @proxy: A #GoaIdentityServiceManagerProxy.
749 * @arg_identity: Argument to pass with the method invocation.
750 * @cancellable: (nullable): A #GCancellable or %NULL.
751 * @error: Return location for error or %NULL.
752 *
753 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-Identity-Manager.SignOut">SignOut()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
754 *
755 * See goa_identity_service_manager_call_sign_out() for the asynchronous version of this method.
756 *
757 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
758 */
759 gboolean
goa_identity_service_manager_call_sign_out_sync(GoaIdentityServiceManager * proxy,const gchar * arg_identity,GCancellable * cancellable,GError ** error)760 goa_identity_service_manager_call_sign_out_sync (
761 GoaIdentityServiceManager *proxy,
762 const gchar *arg_identity,
763 GCancellable *cancellable,
764 GError **error)
765 {
766 GVariant *_ret;
767 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
768 "SignOut",
769 g_variant_new ("(s)",
770 arg_identity),
771 G_DBUS_CALL_FLAGS_NONE,
772 -1,
773 cancellable,
774 error);
775 if (_ret == NULL)
776 goto _out;
777 g_variant_get (_ret,
778 "()");
779 g_variant_unref (_ret);
780 _out:
781 return _ret != NULL;
782 }
783
784 /**
785 * goa_identity_service_manager_complete_exchange_secret_keys:
786 * @object: A #GoaIdentityServiceManager.
787 * @invocation: (transfer full): A #GDBusMethodInvocation.
788 * @output_key: Parameter to return.
789 *
790 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-Identity-Manager.ExchangeSecretKeys">ExchangeSecretKeys()</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.
791 *
792 * This method will free @invocation, you cannot use it afterwards.
793 */
794 void
goa_identity_service_manager_complete_exchange_secret_keys(GoaIdentityServiceManager * object,GDBusMethodInvocation * invocation,const gchar * output_key)795 goa_identity_service_manager_complete_exchange_secret_keys (
796 GoaIdentityServiceManager *object,
797 GDBusMethodInvocation *invocation,
798 const gchar *output_key)
799 {
800 g_dbus_method_invocation_return_value (invocation,
801 g_variant_new ("(s)",
802 output_key));
803 }
804
805 /**
806 * goa_identity_service_manager_complete_sign_in:
807 * @object: A #GoaIdentityServiceManager.
808 * @invocation: (transfer full): A #GDBusMethodInvocation.
809 * @identity_object_path: Parameter to return.
810 *
811 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-Identity-Manager.SignIn">SignIn()</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.
812 *
813 * This method will free @invocation, you cannot use it afterwards.
814 */
815 void
goa_identity_service_manager_complete_sign_in(GoaIdentityServiceManager * object,GDBusMethodInvocation * invocation,const gchar * identity_object_path)816 goa_identity_service_manager_complete_sign_in (
817 GoaIdentityServiceManager *object,
818 GDBusMethodInvocation *invocation,
819 const gchar *identity_object_path)
820 {
821 g_dbus_method_invocation_return_value (invocation,
822 g_variant_new ("(o)",
823 identity_object_path));
824 }
825
826 /**
827 * goa_identity_service_manager_complete_sign_out:
828 * @object: A #GoaIdentityServiceManager.
829 * @invocation: (transfer full): A #GDBusMethodInvocation.
830 *
831 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-Identity-Manager.SignOut">SignOut()</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.
832 *
833 * This method will free @invocation, you cannot use it afterwards.
834 */
835 void
goa_identity_service_manager_complete_sign_out(GoaIdentityServiceManager * object,GDBusMethodInvocation * invocation)836 goa_identity_service_manager_complete_sign_out (
837 GoaIdentityServiceManager *object,
838 GDBusMethodInvocation *invocation)
839 {
840 g_dbus_method_invocation_return_value (invocation,
841 g_variant_new ("()"));
842 }
843
844 /* ------------------------------------------------------------------------ */
845
846 /**
847 * GoaIdentityServiceManagerProxy:
848 *
849 * The #GoaIdentityServiceManagerProxy structure contains only private data and should only be accessed using the provided API.
850 */
851
852 /**
853 * GoaIdentityServiceManagerProxyClass:
854 * @parent_class: The parent class.
855 *
856 * Class structure for #GoaIdentityServiceManagerProxy.
857 */
858
859 struct _GoaIdentityServiceManagerProxyPrivate
860 {
861 GData *qdata;
862 };
863
864 static void goa_identity_service_manager_proxy_iface_init (GoaIdentityServiceManagerIface *iface);
865
866 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(GoaIdentityServiceManagerProxy,goa_identity_service_manager_proxy,G_TYPE_DBUS_PROXY,G_ADD_PRIVATE (GoaIdentityServiceManagerProxy)G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_MANAGER,goa_identity_service_manager_proxy_iface_init))867 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceManagerProxy, goa_identity_service_manager_proxy, G_TYPE_DBUS_PROXY,
868 G_ADD_PRIVATE (GoaIdentityServiceManagerProxy)
869 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_MANAGER, goa_identity_service_manager_proxy_iface_init))
870
871 #else
872 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceManagerProxy, goa_identity_service_manager_proxy, G_TYPE_DBUS_PROXY,
873 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_MANAGER, goa_identity_service_manager_proxy_iface_init))
874
875 #endif
876 static void
877 goa_identity_service_manager_proxy_finalize (GObject *object)
878 {
879 GoaIdentityServiceManagerProxy *proxy = GOA_IDENTITY_SERVICE_MANAGER_PROXY (object);
880 g_datalist_clear (&proxy->priv->qdata);
881 G_OBJECT_CLASS (goa_identity_service_manager_proxy_parent_class)->finalize (object);
882 }
883
884 static void
goa_identity_service_manager_proxy_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)885 goa_identity_service_manager_proxy_get_property (GObject *object,
886 guint prop_id,
887 GValue *value,
888 GParamSpec *pspec G_GNUC_UNUSED)
889 {
890 }
891
892 static void
goa_identity_service_manager_proxy_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec G_GNUC_UNUSED)893 goa_identity_service_manager_proxy_set_property (GObject *object,
894 guint prop_id,
895 const GValue *value,
896 GParamSpec *pspec G_GNUC_UNUSED)
897 {
898 }
899
900 static void
goa_identity_service_manager_proxy_g_signal(GDBusProxy * proxy,const gchar * sender_name G_GNUC_UNUSED,const gchar * signal_name,GVariant * parameters)901 goa_identity_service_manager_proxy_g_signal (GDBusProxy *proxy,
902 const gchar *sender_name G_GNUC_UNUSED,
903 const gchar *signal_name,
904 GVariant *parameters)
905 {
906 _ExtendedGDBusSignalInfo *info;
907 GVariantIter iter;
908 GVariant *child;
909 GValue *paramv;
910 gsize num_params;
911 gsize n;
912 guint signal_id;
913 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_goa_identity_service_manager_interface_info.parent_struct, signal_name);
914 if (info == NULL)
915 return;
916 num_params = g_variant_n_children (parameters);
917 paramv = g_new0 (GValue, num_params + 1);
918 g_value_init (¶mv[0], GOA_IDENTITY_SERVICE_TYPE_MANAGER);
919 g_value_set_object (¶mv[0], proxy);
920 g_variant_iter_init (&iter, parameters);
921 n = 1;
922 while ((child = g_variant_iter_next_value (&iter)) != NULL)
923 {
924 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
925 if (arg_info->use_gvariant)
926 {
927 g_value_init (¶mv[n], G_TYPE_VARIANT);
928 g_value_set_variant (¶mv[n], child);
929 n++;
930 }
931 else
932 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
933 g_variant_unref (child);
934 }
935 signal_id = g_signal_lookup (info->signal_name, GOA_IDENTITY_SERVICE_TYPE_MANAGER);
936 g_signal_emitv (paramv, signal_id, 0, NULL);
937 for (n = 0; n < num_params + 1; n++)
938 g_value_unset (¶mv[n]);
939 g_free (paramv);
940 }
941
942 static void
goa_identity_service_manager_proxy_g_properties_changed(GDBusProxy * _proxy,GVariant * changed_properties,const gchar * const * invalidated_properties)943 goa_identity_service_manager_proxy_g_properties_changed (GDBusProxy *_proxy,
944 GVariant *changed_properties,
945 const gchar *const *invalidated_properties)
946 {
947 GoaIdentityServiceManagerProxy *proxy = GOA_IDENTITY_SERVICE_MANAGER_PROXY (_proxy);
948 guint n;
949 const gchar *key;
950 GVariantIter *iter;
951 _ExtendedGDBusPropertyInfo *info;
952 g_variant_get (changed_properties, "a{sv}", &iter);
953 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
954 {
955 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_identity_service_manager_interface_info.parent_struct, key);
956 g_datalist_remove_data (&proxy->priv->qdata, key);
957 if (info != NULL)
958 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
959 }
960 g_variant_iter_free (iter);
961 for (n = 0; invalidated_properties[n] != NULL; n++)
962 {
963 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_identity_service_manager_interface_info.parent_struct, invalidated_properties[n]);
964 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
965 if (info != NULL)
966 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
967 }
968 }
969
970 static void
goa_identity_service_manager_proxy_init(GoaIdentityServiceManagerProxy * proxy)971 goa_identity_service_manager_proxy_init (GoaIdentityServiceManagerProxy *proxy)
972 {
973 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
974 proxy->priv = goa_identity_service_manager_proxy_get_instance_private (proxy);
975 #else
976 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GOA_IDENTITY_SERVICE_TYPE_MANAGER_PROXY, GoaIdentityServiceManagerProxyPrivate);
977 #endif
978
979 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), goa_identity_service_manager_interface_info ());
980 }
981
982 static void
goa_identity_service_manager_proxy_class_init(GoaIdentityServiceManagerProxyClass * klass)983 goa_identity_service_manager_proxy_class_init (GoaIdentityServiceManagerProxyClass *klass)
984 {
985 GObjectClass *gobject_class;
986 GDBusProxyClass *proxy_class;
987
988 gobject_class = G_OBJECT_CLASS (klass);
989 gobject_class->finalize = goa_identity_service_manager_proxy_finalize;
990 gobject_class->get_property = goa_identity_service_manager_proxy_get_property;
991 gobject_class->set_property = goa_identity_service_manager_proxy_set_property;
992
993 proxy_class = G_DBUS_PROXY_CLASS (klass);
994 proxy_class->g_signal = goa_identity_service_manager_proxy_g_signal;
995 proxy_class->g_properties_changed = goa_identity_service_manager_proxy_g_properties_changed;
996
997 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
998 g_type_class_add_private (klass, sizeof (GoaIdentityServiceManagerProxyPrivate));
999 #endif
1000 }
1001
1002 static void
goa_identity_service_manager_proxy_iface_init(GoaIdentityServiceManagerIface * iface)1003 goa_identity_service_manager_proxy_iface_init (GoaIdentityServiceManagerIface *iface)
1004 {
1005 }
1006
1007 /**
1008 * goa_identity_service_manager_proxy_new:
1009 * @connection: A #GDBusConnection.
1010 * @flags: Flags from the #GDBusProxyFlags enumeration.
1011 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1012 * @object_path: An object path.
1013 * @cancellable: (nullable): A #GCancellable or %NULL.
1014 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1015 * @user_data: User data to pass to @callback.
1016 *
1017 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link>. See g_dbus_proxy_new() for more details.
1018 *
1019 * 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()).
1020 * You can then call goa_identity_service_manager_proxy_new_finish() to get the result of the operation.
1021 *
1022 * See goa_identity_service_manager_proxy_new_sync() for the synchronous, blocking version of this constructor.
1023 */
1024 void
goa_identity_service_manager_proxy_new(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1025 goa_identity_service_manager_proxy_new (
1026 GDBusConnection *connection,
1027 GDBusProxyFlags flags,
1028 const gchar *name,
1029 const gchar *object_path,
1030 GCancellable *cancellable,
1031 GAsyncReadyCallback callback,
1032 gpointer user_data)
1033 {
1034 g_async_initable_new_async (GOA_IDENTITY_SERVICE_TYPE_MANAGER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.Identity.Manager", NULL);
1035 }
1036
1037 /**
1038 * goa_identity_service_manager_proxy_new_finish:
1039 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_manager_proxy_new().
1040 * @error: Return location for error or %NULL
1041 *
1042 * Finishes an operation started with goa_identity_service_manager_proxy_new().
1043 *
1044 * Returns: (transfer full) (type GoaIdentityServiceManagerProxy): The constructed proxy object or %NULL if @error is set.
1045 */
1046 GoaIdentityServiceManager *
goa_identity_service_manager_proxy_new_finish(GAsyncResult * res,GError ** error)1047 goa_identity_service_manager_proxy_new_finish (
1048 GAsyncResult *res,
1049 GError **error)
1050 {
1051 GObject *ret;
1052 GObject *source_object;
1053 source_object = g_async_result_get_source_object (res);
1054 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1055 g_object_unref (source_object);
1056 if (ret != NULL)
1057 return GOA_IDENTITY_SERVICE_MANAGER (ret);
1058 else
1059 return NULL;
1060 }
1061
1062 /**
1063 * goa_identity_service_manager_proxy_new_sync:
1064 * @connection: A #GDBusConnection.
1065 * @flags: Flags from the #GDBusProxyFlags enumeration.
1066 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1067 * @object_path: An object path.
1068 * @cancellable: (nullable): A #GCancellable or %NULL.
1069 * @error: Return location for error or %NULL
1070 *
1071 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link>. See g_dbus_proxy_new_sync() for more details.
1072 *
1073 * The calling thread is blocked until a reply is received.
1074 *
1075 * See goa_identity_service_manager_proxy_new() for the asynchronous version of this constructor.
1076 *
1077 * Returns: (transfer full) (type GoaIdentityServiceManagerProxy): The constructed proxy object or %NULL if @error is set.
1078 */
1079 GoaIdentityServiceManager *
goa_identity_service_manager_proxy_new_sync(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1080 goa_identity_service_manager_proxy_new_sync (
1081 GDBusConnection *connection,
1082 GDBusProxyFlags flags,
1083 const gchar *name,
1084 const gchar *object_path,
1085 GCancellable *cancellable,
1086 GError **error)
1087 {
1088 GInitable *ret;
1089 ret = g_initable_new (GOA_IDENTITY_SERVICE_TYPE_MANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.Identity.Manager", NULL);
1090 if (ret != NULL)
1091 return GOA_IDENTITY_SERVICE_MANAGER (ret);
1092 else
1093 return NULL;
1094 }
1095
1096
1097 /**
1098 * goa_identity_service_manager_proxy_new_for_bus:
1099 * @bus_type: A #GBusType.
1100 * @flags: Flags from the #GDBusProxyFlags enumeration.
1101 * @name: A bus name (well-known or unique).
1102 * @object_path: An object path.
1103 * @cancellable: (nullable): A #GCancellable or %NULL.
1104 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1105 * @user_data: User data to pass to @callback.
1106 *
1107 * Like goa_identity_service_manager_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1108 *
1109 * 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()).
1110 * You can then call goa_identity_service_manager_proxy_new_for_bus_finish() to get the result of the operation.
1111 *
1112 * See goa_identity_service_manager_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1113 */
1114 void
goa_identity_service_manager_proxy_new_for_bus(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1115 goa_identity_service_manager_proxy_new_for_bus (
1116 GBusType bus_type,
1117 GDBusProxyFlags flags,
1118 const gchar *name,
1119 const gchar *object_path,
1120 GCancellable *cancellable,
1121 GAsyncReadyCallback callback,
1122 gpointer user_data)
1123 {
1124 g_async_initable_new_async (GOA_IDENTITY_SERVICE_TYPE_MANAGER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.Identity.Manager", NULL);
1125 }
1126
1127 /**
1128 * goa_identity_service_manager_proxy_new_for_bus_finish:
1129 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_manager_proxy_new_for_bus().
1130 * @error: Return location for error or %NULL
1131 *
1132 * Finishes an operation started with goa_identity_service_manager_proxy_new_for_bus().
1133 *
1134 * Returns: (transfer full) (type GoaIdentityServiceManagerProxy): The constructed proxy object or %NULL if @error is set.
1135 */
1136 GoaIdentityServiceManager *
goa_identity_service_manager_proxy_new_for_bus_finish(GAsyncResult * res,GError ** error)1137 goa_identity_service_manager_proxy_new_for_bus_finish (
1138 GAsyncResult *res,
1139 GError **error)
1140 {
1141 GObject *ret;
1142 GObject *source_object;
1143 source_object = g_async_result_get_source_object (res);
1144 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1145 g_object_unref (source_object);
1146 if (ret != NULL)
1147 return GOA_IDENTITY_SERVICE_MANAGER (ret);
1148 else
1149 return NULL;
1150 }
1151
1152 /**
1153 * goa_identity_service_manager_proxy_new_for_bus_sync:
1154 * @bus_type: A #GBusType.
1155 * @flags: Flags from the #GDBusProxyFlags enumeration.
1156 * @name: A bus name (well-known or unique).
1157 * @object_path: An object path.
1158 * @cancellable: (nullable): A #GCancellable or %NULL.
1159 * @error: Return location for error or %NULL
1160 *
1161 * Like goa_identity_service_manager_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1162 *
1163 * The calling thread is blocked until a reply is received.
1164 *
1165 * See goa_identity_service_manager_proxy_new_for_bus() for the asynchronous version of this constructor.
1166 *
1167 * Returns: (transfer full) (type GoaIdentityServiceManagerProxy): The constructed proxy object or %NULL if @error is set.
1168 */
1169 GoaIdentityServiceManager *
goa_identity_service_manager_proxy_new_for_bus_sync(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1170 goa_identity_service_manager_proxy_new_for_bus_sync (
1171 GBusType bus_type,
1172 GDBusProxyFlags flags,
1173 const gchar *name,
1174 const gchar *object_path,
1175 GCancellable *cancellable,
1176 GError **error)
1177 {
1178 GInitable *ret;
1179 ret = g_initable_new (GOA_IDENTITY_SERVICE_TYPE_MANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.Identity.Manager", NULL);
1180 if (ret != NULL)
1181 return GOA_IDENTITY_SERVICE_MANAGER (ret);
1182 else
1183 return NULL;
1184 }
1185
1186
1187 /* ------------------------------------------------------------------------ */
1188
1189 /**
1190 * GoaIdentityServiceManagerSkeleton:
1191 *
1192 * The #GoaIdentityServiceManagerSkeleton structure contains only private data and should only be accessed using the provided API.
1193 */
1194
1195 /**
1196 * GoaIdentityServiceManagerSkeletonClass:
1197 * @parent_class: The parent class.
1198 *
1199 * Class structure for #GoaIdentityServiceManagerSkeleton.
1200 */
1201
1202 struct _GoaIdentityServiceManagerSkeletonPrivate
1203 {
1204 GValue *properties;
1205 GList *changed_properties;
1206 GSource *changed_properties_idle_source;
1207 GMainContext *context;
1208 GMutex lock;
1209 };
1210
1211 static void
_goa_identity_service_manager_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)1212 _goa_identity_service_manager_skeleton_handle_method_call (
1213 GDBusConnection *connection G_GNUC_UNUSED,
1214 const gchar *sender G_GNUC_UNUSED,
1215 const gchar *object_path G_GNUC_UNUSED,
1216 const gchar *interface_name,
1217 const gchar *method_name,
1218 GVariant *parameters,
1219 GDBusMethodInvocation *invocation,
1220 gpointer user_data)
1221 {
1222 GoaIdentityServiceManagerSkeleton *skeleton = GOA_IDENTITY_SERVICE_MANAGER_SKELETON (user_data);
1223 _ExtendedGDBusMethodInfo *info;
1224 GVariantIter iter;
1225 GVariant *child;
1226 GValue *paramv;
1227 gsize num_params;
1228 guint num_extra;
1229 gsize n;
1230 guint signal_id;
1231 GValue return_value = G_VALUE_INIT;
1232 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1233 g_assert (info != NULL);
1234 num_params = g_variant_n_children (parameters);
1235 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
1236 n = 0;
1237 g_value_init (¶mv[n], GOA_IDENTITY_SERVICE_TYPE_MANAGER);
1238 g_value_set_object (¶mv[n++], skeleton);
1239 g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1240 g_value_set_object (¶mv[n++], invocation);
1241 if (info->pass_fdlist)
1242 {
1243 #ifdef G_OS_UNIX
1244 g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
1245 g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1246 #else
1247 g_assert_not_reached ();
1248 #endif
1249 }
1250 g_variant_iter_init (&iter, parameters);
1251 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1252 {
1253 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1254 if (arg_info->use_gvariant)
1255 {
1256 g_value_init (¶mv[n], G_TYPE_VARIANT);
1257 g_value_set_variant (¶mv[n], child);
1258 n++;
1259 }
1260 else
1261 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1262 g_variant_unref (child);
1263 }
1264 signal_id = g_signal_lookup (info->signal_name, GOA_IDENTITY_SERVICE_TYPE_MANAGER);
1265 g_value_init (&return_value, G_TYPE_BOOLEAN);
1266 g_signal_emitv (paramv, signal_id, 0, &return_value);
1267 if (!g_value_get_boolean (&return_value))
1268 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);
1269 g_value_unset (&return_value);
1270 for (n = 0; n < num_params + num_extra; n++)
1271 g_value_unset (¶mv[n]);
1272 g_free (paramv);
1273 }
1274
1275 static GVariant *
_goa_identity_service_manager_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)1276 _goa_identity_service_manager_skeleton_handle_get_property (
1277 GDBusConnection *connection G_GNUC_UNUSED,
1278 const gchar *sender G_GNUC_UNUSED,
1279 const gchar *object_path G_GNUC_UNUSED,
1280 const gchar *interface_name G_GNUC_UNUSED,
1281 const gchar *property_name,
1282 GError **error,
1283 gpointer user_data)
1284 {
1285 GoaIdentityServiceManagerSkeleton *skeleton = GOA_IDENTITY_SERVICE_MANAGER_SKELETON (user_data);
1286 GValue value = G_VALUE_INIT;
1287 GParamSpec *pspec;
1288 _ExtendedGDBusPropertyInfo *info;
1289 GVariant *ret;
1290 ret = NULL;
1291 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_identity_service_manager_interface_info.parent_struct, property_name);
1292 g_assert (info != NULL);
1293 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1294 if (pspec == NULL)
1295 {
1296 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1297 }
1298 else
1299 {
1300 g_value_init (&value, pspec->value_type);
1301 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1302 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
1303 g_value_unset (&value);
1304 }
1305 return ret;
1306 }
1307
1308 static gboolean
_goa_identity_service_manager_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)1309 _goa_identity_service_manager_skeleton_handle_set_property (
1310 GDBusConnection *connection G_GNUC_UNUSED,
1311 const gchar *sender G_GNUC_UNUSED,
1312 const gchar *object_path G_GNUC_UNUSED,
1313 const gchar *interface_name G_GNUC_UNUSED,
1314 const gchar *property_name,
1315 GVariant *variant,
1316 GError **error,
1317 gpointer user_data)
1318 {
1319 GoaIdentityServiceManagerSkeleton *skeleton = GOA_IDENTITY_SERVICE_MANAGER_SKELETON (user_data);
1320 GValue value = G_VALUE_INIT;
1321 GParamSpec *pspec;
1322 _ExtendedGDBusPropertyInfo *info;
1323 gboolean ret;
1324 ret = FALSE;
1325 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_identity_service_manager_interface_info.parent_struct, property_name);
1326 g_assert (info != NULL);
1327 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1328 if (pspec == NULL)
1329 {
1330 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1331 }
1332 else
1333 {
1334 if (info->use_gvariant)
1335 g_value_set_variant (&value, variant);
1336 else
1337 g_dbus_gvariant_to_gvalue (variant, &value);
1338 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1339 g_value_unset (&value);
1340 ret = TRUE;
1341 }
1342 return ret;
1343 }
1344
1345 static const GDBusInterfaceVTable _goa_identity_service_manager_skeleton_vtable =
1346 {
1347 _goa_identity_service_manager_skeleton_handle_method_call,
1348 _goa_identity_service_manager_skeleton_handle_get_property,
1349 _goa_identity_service_manager_skeleton_handle_set_property,
1350 {NULL}
1351 };
1352
1353 static GDBusInterfaceInfo *
goa_identity_service_manager_skeleton_dbus_interface_get_info(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)1354 goa_identity_service_manager_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1355 {
1356 return goa_identity_service_manager_interface_info ();
1357 }
1358
1359 static GDBusInterfaceVTable *
goa_identity_service_manager_skeleton_dbus_interface_get_vtable(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)1360 goa_identity_service_manager_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1361 {
1362 return (GDBusInterfaceVTable *) &_goa_identity_service_manager_skeleton_vtable;
1363 }
1364
1365 static GVariant *
goa_identity_service_manager_skeleton_dbus_interface_get_properties(GDBusInterfaceSkeleton * _skeleton)1366 goa_identity_service_manager_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1367 {
1368 GoaIdentityServiceManagerSkeleton *skeleton = GOA_IDENTITY_SERVICE_MANAGER_SKELETON (_skeleton);
1369
1370 GVariantBuilder builder;
1371 guint n;
1372 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1373 if (_goa_identity_service_manager_interface_info.parent_struct.properties == NULL)
1374 goto out;
1375 for (n = 0; _goa_identity_service_manager_interface_info.parent_struct.properties[n] != NULL; n++)
1376 {
1377 GDBusPropertyInfo *info = _goa_identity_service_manager_interface_info.parent_struct.properties[n];
1378 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1379 {
1380 GVariant *value;
1381 value = _goa_identity_service_manager_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.gnome.Identity.Manager", info->name, NULL, skeleton);
1382 if (value != NULL)
1383 {
1384 g_variant_take_ref (value);
1385 g_variant_builder_add (&builder, "{sv}", info->name, value);
1386 g_variant_unref (value);
1387 }
1388 }
1389 }
1390 out:
1391 return g_variant_builder_end (&builder);
1392 }
1393
1394 static void
goa_identity_service_manager_skeleton_dbus_interface_flush(GDBusInterfaceSkeleton * _skeleton)1395 goa_identity_service_manager_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1396 {
1397 }
1398
1399 static void goa_identity_service_manager_skeleton_iface_init (GoaIdentityServiceManagerIface *iface);
1400 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(GoaIdentityServiceManagerSkeleton,goa_identity_service_manager_skeleton,G_TYPE_DBUS_INTERFACE_SKELETON,G_ADD_PRIVATE (GoaIdentityServiceManagerSkeleton)G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_MANAGER,goa_identity_service_manager_skeleton_iface_init))1401 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceManagerSkeleton, goa_identity_service_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1402 G_ADD_PRIVATE (GoaIdentityServiceManagerSkeleton)
1403 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_MANAGER, goa_identity_service_manager_skeleton_iface_init))
1404
1405 #else
1406 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceManagerSkeleton, goa_identity_service_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1407 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_MANAGER, goa_identity_service_manager_skeleton_iface_init))
1408
1409 #endif
1410 static void
1411 goa_identity_service_manager_skeleton_finalize (GObject *object)
1412 {
1413 GoaIdentityServiceManagerSkeleton *skeleton = GOA_IDENTITY_SERVICE_MANAGER_SKELETON (object);
1414 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1415 if (skeleton->priv->changed_properties_idle_source != NULL)
1416 g_source_destroy (skeleton->priv->changed_properties_idle_source);
1417 g_main_context_unref (skeleton->priv->context);
1418 g_mutex_clear (&skeleton->priv->lock);
1419 G_OBJECT_CLASS (goa_identity_service_manager_skeleton_parent_class)->finalize (object);
1420 }
1421
1422 static void
goa_identity_service_manager_skeleton_init(GoaIdentityServiceManagerSkeleton * skeleton)1423 goa_identity_service_manager_skeleton_init (GoaIdentityServiceManagerSkeleton *skeleton)
1424 {
1425 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1426 skeleton->priv = goa_identity_service_manager_skeleton_get_instance_private (skeleton);
1427 #else
1428 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GOA_IDENTITY_SERVICE_TYPE_MANAGER_SKELETON, GoaIdentityServiceManagerSkeletonPrivate);
1429 #endif
1430
1431 g_mutex_init (&skeleton->priv->lock);
1432 skeleton->priv->context = g_main_context_ref_thread_default ();
1433 }
1434
1435 static void
goa_identity_service_manager_skeleton_class_init(GoaIdentityServiceManagerSkeletonClass * klass)1436 goa_identity_service_manager_skeleton_class_init (GoaIdentityServiceManagerSkeletonClass *klass)
1437 {
1438 GObjectClass *gobject_class;
1439 GDBusInterfaceSkeletonClass *skeleton_class;
1440
1441 gobject_class = G_OBJECT_CLASS (klass);
1442 gobject_class->finalize = goa_identity_service_manager_skeleton_finalize;
1443
1444 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1445 skeleton_class->get_info = goa_identity_service_manager_skeleton_dbus_interface_get_info;
1446 skeleton_class->get_properties = goa_identity_service_manager_skeleton_dbus_interface_get_properties;
1447 skeleton_class->flush = goa_identity_service_manager_skeleton_dbus_interface_flush;
1448 skeleton_class->get_vtable = goa_identity_service_manager_skeleton_dbus_interface_get_vtable;
1449
1450 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1451 g_type_class_add_private (klass, sizeof (GoaIdentityServiceManagerSkeletonPrivate));
1452 #endif
1453 }
1454
1455 static void
goa_identity_service_manager_skeleton_iface_init(GoaIdentityServiceManagerIface * iface)1456 goa_identity_service_manager_skeleton_iface_init (GoaIdentityServiceManagerIface *iface)
1457 {
1458 }
1459
1460 /**
1461 * goa_identity_service_manager_skeleton_new:
1462 *
1463 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link>.
1464 *
1465 * Returns: (transfer full) (type GoaIdentityServiceManagerSkeleton): The skeleton object.
1466 */
1467 GoaIdentityServiceManager *
goa_identity_service_manager_skeleton_new(void)1468 goa_identity_service_manager_skeleton_new (void)
1469 {
1470 return GOA_IDENTITY_SERVICE_MANAGER (g_object_new (GOA_IDENTITY_SERVICE_TYPE_MANAGER_SKELETON, NULL));
1471 }
1472
1473 /* ------------------------------------------------------------------------
1474 * Code for interface org.gnome.Identity
1475 * ------------------------------------------------------------------------
1476 */
1477
1478 /**
1479 * SECTION:GoaIdentityServiceIdentity
1480 * @title: GoaIdentityServiceIdentity
1481 * @short_description: Generated C code for the org.gnome.Identity D-Bus interface
1482 *
1483 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link> D-Bus interface in C.
1484 */
1485
1486 /* ---- Introspection data for org.gnome.Identity ---- */
1487
1488 static const _ExtendedGDBusPropertyInfo _goa_identity_service_identity_property_info_identifier =
1489 {
1490 {
1491 -1,
1492 (gchar *) "Identifier",
1493 (gchar *) "s",
1494 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1495 NULL
1496 },
1497 "identifier",
1498 FALSE,
1499 TRUE
1500 };
1501
1502 static const _ExtendedGDBusPropertyInfo _goa_identity_service_identity_property_info_expiration_timestamp =
1503 {
1504 {
1505 -1,
1506 (gchar *) "ExpirationTimestamp",
1507 (gchar *) "x",
1508 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1509 NULL
1510 },
1511 "expiration-timestamp",
1512 FALSE,
1513 TRUE
1514 };
1515
1516 static const _ExtendedGDBusPropertyInfo _goa_identity_service_identity_property_info_is_signed_in =
1517 {
1518 {
1519 -1,
1520 (gchar *) "IsSignedIn",
1521 (gchar *) "b",
1522 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1523 NULL
1524 },
1525 "is-signed-in",
1526 FALSE,
1527 TRUE
1528 };
1529
1530 static const GDBusPropertyInfo * const _goa_identity_service_identity_property_info_pointers[] =
1531 {
1532 &_goa_identity_service_identity_property_info_identifier.parent_struct,
1533 &_goa_identity_service_identity_property_info_expiration_timestamp.parent_struct,
1534 &_goa_identity_service_identity_property_info_is_signed_in.parent_struct,
1535 NULL
1536 };
1537
1538 static const _ExtendedGDBusInterfaceInfo _goa_identity_service_identity_interface_info =
1539 {
1540 {
1541 -1,
1542 (gchar *) "org.gnome.Identity",
1543 NULL,
1544 NULL,
1545 (GDBusPropertyInfo **) &_goa_identity_service_identity_property_info_pointers,
1546 NULL
1547 },
1548 "identity",
1549 };
1550
1551
1552 /**
1553 * goa_identity_service_identity_interface_info:
1554 *
1555 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link> D-Bus interface.
1556 *
1557 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
1558 */
1559 GDBusInterfaceInfo *
goa_identity_service_identity_interface_info(void)1560 goa_identity_service_identity_interface_info (void)
1561 {
1562 return (GDBusInterfaceInfo *) &_goa_identity_service_identity_interface_info.parent_struct;
1563 }
1564
1565 /**
1566 * goa_identity_service_identity_override_properties:
1567 * @klass: The class structure for a #GObject derived class.
1568 * @property_id_begin: The property id to assign to the first overridden property.
1569 *
1570 * Overrides all #GObject properties in the #GoaIdentityServiceIdentity interface for a concrete class.
1571 * The properties are overridden in the order they are defined.
1572 *
1573 * Returns: The last property id.
1574 */
1575 guint
goa_identity_service_identity_override_properties(GObjectClass * klass,guint property_id_begin)1576 goa_identity_service_identity_override_properties (GObjectClass *klass, guint property_id_begin)
1577 {
1578 g_object_class_override_property (klass, property_id_begin++, "identifier");
1579 g_object_class_override_property (klass, property_id_begin++, "expiration-timestamp");
1580 g_object_class_override_property (klass, property_id_begin++, "is-signed-in");
1581 return property_id_begin - 1;
1582 }
1583
1584
1585
1586 /**
1587 * GoaIdentityServiceIdentity:
1588 *
1589 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link>.
1590 */
1591
1592 /**
1593 * GoaIdentityServiceIdentityIface:
1594 * @parent_iface: The parent interface.
1595 * @get_expiration_timestamp: Getter for the #GoaIdentityServiceIdentity:expiration-timestamp property.
1596 * @get_identifier: Getter for the #GoaIdentityServiceIdentity:identifier property.
1597 * @get_is_signed_in: Getter for the #GoaIdentityServiceIdentity:is-signed-in property.
1598 *
1599 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link>.
1600 */
1601
1602 typedef GoaIdentityServiceIdentityIface GoaIdentityServiceIdentityInterface;
G_DEFINE_INTERFACE(GoaIdentityServiceIdentity,goa_identity_service_identity,G_TYPE_OBJECT)1603 G_DEFINE_INTERFACE (GoaIdentityServiceIdentity, goa_identity_service_identity, G_TYPE_OBJECT)
1604
1605 static void
1606 goa_identity_service_identity_default_init (GoaIdentityServiceIdentityIface *iface)
1607 {
1608 /* GObject properties for D-Bus properties: */
1609 /**
1610 * GoaIdentityServiceIdentity:identifier:
1611 *
1612 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-Identity.Identifier">"Identifier"</link>.
1613 *
1614 * 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.
1615 */
1616 g_object_interface_install_property (iface,
1617 g_param_spec_string ("identifier", "Identifier", "Identifier", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1618 /**
1619 * GoaIdentityServiceIdentity:expiration-timestamp:
1620 *
1621 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-Identity.ExpirationTimestamp">"ExpirationTimestamp"</link>.
1622 *
1623 * 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.
1624 */
1625 g_object_interface_install_property (iface,
1626 g_param_spec_int64 ("expiration-timestamp", "ExpirationTimestamp", "ExpirationTimestamp", G_MININT64, G_MAXINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1627 /**
1628 * GoaIdentityServiceIdentity:is-signed-in:
1629 *
1630 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-Identity.IsSignedIn">"IsSignedIn"</link>.
1631 *
1632 * 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.
1633 */
1634 g_object_interface_install_property (iface,
1635 g_param_spec_boolean ("is-signed-in", "IsSignedIn", "IsSignedIn", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
1636 }
1637
1638 /**
1639 * goa_identity_service_identity_get_identifier: (skip)
1640 * @object: A #GoaIdentityServiceIdentity.
1641 *
1642 * Gets the value of the <link linkend="gdbus-property-org-gnome-Identity.Identifier">"Identifier"</link> D-Bus property.
1643 *
1644 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1645 *
1646 * 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 goa_identity_service_identity_dup_identifier() if on another thread.
1647 *
1648 * 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.
1649 */
1650 const gchar *
goa_identity_service_identity_get_identifier(GoaIdentityServiceIdentity * object)1651 goa_identity_service_identity_get_identifier (GoaIdentityServiceIdentity *object)
1652 {
1653 return GOA_IDENTITY_SERVICE_IDENTITY_GET_IFACE (object)->get_identifier (object);
1654 }
1655
1656 /**
1657 * goa_identity_service_identity_dup_identifier: (skip)
1658 * @object: A #GoaIdentityServiceIdentity.
1659 *
1660 * Gets a copy of the <link linkend="gdbus-property-org-gnome-Identity.Identifier">"Identifier"</link> D-Bus property.
1661 *
1662 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1663 *
1664 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
1665 */
1666 gchar *
goa_identity_service_identity_dup_identifier(GoaIdentityServiceIdentity * object)1667 goa_identity_service_identity_dup_identifier (GoaIdentityServiceIdentity *object)
1668 {
1669 gchar *value;
1670 g_object_get (G_OBJECT (object), "identifier", &value, NULL);
1671 return value;
1672 }
1673
1674 /**
1675 * goa_identity_service_identity_set_identifier: (skip)
1676 * @object: A #GoaIdentityServiceIdentity.
1677 * @value: The value to set.
1678 *
1679 * Sets the <link linkend="gdbus-property-org-gnome-Identity.Identifier">"Identifier"</link> D-Bus property to @value.
1680 *
1681 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1682 */
1683 void
goa_identity_service_identity_set_identifier(GoaIdentityServiceIdentity * object,const gchar * value)1684 goa_identity_service_identity_set_identifier (GoaIdentityServiceIdentity *object, const gchar *value)
1685 {
1686 g_object_set (G_OBJECT (object), "identifier", value, NULL);
1687 }
1688
1689 /**
1690 * goa_identity_service_identity_get_expiration_timestamp: (skip)
1691 * @object: A #GoaIdentityServiceIdentity.
1692 *
1693 * Gets the value of the <link linkend="gdbus-property-org-gnome-Identity.ExpirationTimestamp">"ExpirationTimestamp"</link> D-Bus property.
1694 *
1695 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1696 *
1697 * Returns: The property value.
1698 */
1699 gint64
goa_identity_service_identity_get_expiration_timestamp(GoaIdentityServiceIdentity * object)1700 goa_identity_service_identity_get_expiration_timestamp (GoaIdentityServiceIdentity *object)
1701 {
1702 return GOA_IDENTITY_SERVICE_IDENTITY_GET_IFACE (object)->get_expiration_timestamp (object);
1703 }
1704
1705 /**
1706 * goa_identity_service_identity_set_expiration_timestamp: (skip)
1707 * @object: A #GoaIdentityServiceIdentity.
1708 * @value: The value to set.
1709 *
1710 * Sets the <link linkend="gdbus-property-org-gnome-Identity.ExpirationTimestamp">"ExpirationTimestamp"</link> D-Bus property to @value.
1711 *
1712 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1713 */
1714 void
goa_identity_service_identity_set_expiration_timestamp(GoaIdentityServiceIdentity * object,gint64 value)1715 goa_identity_service_identity_set_expiration_timestamp (GoaIdentityServiceIdentity *object, gint64 value)
1716 {
1717 g_object_set (G_OBJECT (object), "expiration-timestamp", value, NULL);
1718 }
1719
1720 /**
1721 * goa_identity_service_identity_get_is_signed_in: (skip)
1722 * @object: A #GoaIdentityServiceIdentity.
1723 *
1724 * Gets the value of the <link linkend="gdbus-property-org-gnome-Identity.IsSignedIn">"IsSignedIn"</link> D-Bus property.
1725 *
1726 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
1727 *
1728 * Returns: The property value.
1729 */
1730 gboolean
goa_identity_service_identity_get_is_signed_in(GoaIdentityServiceIdentity * object)1731 goa_identity_service_identity_get_is_signed_in (GoaIdentityServiceIdentity *object)
1732 {
1733 return GOA_IDENTITY_SERVICE_IDENTITY_GET_IFACE (object)->get_is_signed_in (object);
1734 }
1735
1736 /**
1737 * goa_identity_service_identity_set_is_signed_in: (skip)
1738 * @object: A #GoaIdentityServiceIdentity.
1739 * @value: The value to set.
1740 *
1741 * Sets the <link linkend="gdbus-property-org-gnome-Identity.IsSignedIn">"IsSignedIn"</link> D-Bus property to @value.
1742 *
1743 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
1744 */
1745 void
goa_identity_service_identity_set_is_signed_in(GoaIdentityServiceIdentity * object,gboolean value)1746 goa_identity_service_identity_set_is_signed_in (GoaIdentityServiceIdentity *object, gboolean value)
1747 {
1748 g_object_set (G_OBJECT (object), "is-signed-in", value, NULL);
1749 }
1750
1751 /* ------------------------------------------------------------------------ */
1752
1753 /**
1754 * GoaIdentityServiceIdentityProxy:
1755 *
1756 * The #GoaIdentityServiceIdentityProxy structure contains only private data and should only be accessed using the provided API.
1757 */
1758
1759 /**
1760 * GoaIdentityServiceIdentityProxyClass:
1761 * @parent_class: The parent class.
1762 *
1763 * Class structure for #GoaIdentityServiceIdentityProxy.
1764 */
1765
1766 struct _GoaIdentityServiceIdentityProxyPrivate
1767 {
1768 GData *qdata;
1769 };
1770
1771 static void goa_identity_service_identity_proxy_iface_init (GoaIdentityServiceIdentityIface *iface);
1772
1773 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(GoaIdentityServiceIdentityProxy,goa_identity_service_identity_proxy,G_TYPE_DBUS_PROXY,G_ADD_PRIVATE (GoaIdentityServiceIdentityProxy)G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_IDENTITY,goa_identity_service_identity_proxy_iface_init))1774 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceIdentityProxy, goa_identity_service_identity_proxy, G_TYPE_DBUS_PROXY,
1775 G_ADD_PRIVATE (GoaIdentityServiceIdentityProxy)
1776 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_IDENTITY, goa_identity_service_identity_proxy_iface_init))
1777
1778 #else
1779 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceIdentityProxy, goa_identity_service_identity_proxy, G_TYPE_DBUS_PROXY,
1780 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_IDENTITY, goa_identity_service_identity_proxy_iface_init))
1781
1782 #endif
1783 static void
1784 goa_identity_service_identity_proxy_finalize (GObject *object)
1785 {
1786 GoaIdentityServiceIdentityProxy *proxy = GOA_IDENTITY_SERVICE_IDENTITY_PROXY (object);
1787 g_datalist_clear (&proxy->priv->qdata);
1788 G_OBJECT_CLASS (goa_identity_service_identity_proxy_parent_class)->finalize (object);
1789 }
1790
1791 static void
goa_identity_service_identity_proxy_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)1792 goa_identity_service_identity_proxy_get_property (GObject *object,
1793 guint prop_id,
1794 GValue *value,
1795 GParamSpec *pspec G_GNUC_UNUSED)
1796 {
1797 const _ExtendedGDBusPropertyInfo *info;
1798 GVariant *variant;
1799 g_assert (prop_id != 0 && prop_id - 1 < 3);
1800 info = (const _ExtendedGDBusPropertyInfo *) _goa_identity_service_identity_property_info_pointers[prop_id - 1];
1801 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
1802 if (info->use_gvariant)
1803 {
1804 g_value_set_variant (value, variant);
1805 }
1806 else
1807 {
1808 if (variant != NULL)
1809 g_dbus_gvariant_to_gvalue (variant, value);
1810 }
1811 if (variant != NULL)
1812 g_variant_unref (variant);
1813 }
1814
1815 static void
goa_identity_service_identity_proxy_set_property_cb(GDBusProxy * proxy,GAsyncResult * res,gpointer user_data)1816 goa_identity_service_identity_proxy_set_property_cb (GDBusProxy *proxy,
1817 GAsyncResult *res,
1818 gpointer user_data)
1819 {
1820 const _ExtendedGDBusPropertyInfo *info = user_data;
1821 GError *error;
1822 GVariant *_ret;
1823 error = NULL;
1824 _ret = g_dbus_proxy_call_finish (proxy, res, &error);
1825 if (!_ret)
1826 {
1827 g_warning ("Error setting property '%s' on interface org.gnome.Identity: %s (%s, %d)",
1828 info->parent_struct.name,
1829 error->message, g_quark_to_string (error->domain), error->code);
1830 g_error_free (error);
1831 }
1832 else
1833 {
1834 g_variant_unref (_ret);
1835 }
1836 }
1837
1838 static void
goa_identity_service_identity_proxy_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec G_GNUC_UNUSED)1839 goa_identity_service_identity_proxy_set_property (GObject *object,
1840 guint prop_id,
1841 const GValue *value,
1842 GParamSpec *pspec G_GNUC_UNUSED)
1843 {
1844 const _ExtendedGDBusPropertyInfo *info;
1845 GVariant *variant;
1846 g_assert (prop_id != 0 && prop_id - 1 < 3);
1847 info = (const _ExtendedGDBusPropertyInfo *) _goa_identity_service_identity_property_info_pointers[prop_id - 1];
1848 variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
1849 g_dbus_proxy_call (G_DBUS_PROXY (object),
1850 "org.freedesktop.DBus.Properties.Set",
1851 g_variant_new ("(ssv)", "org.gnome.Identity", info->parent_struct.name, variant),
1852 G_DBUS_CALL_FLAGS_NONE,
1853 -1,
1854 NULL, (GAsyncReadyCallback) goa_identity_service_identity_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
1855 g_variant_unref (variant);
1856 }
1857
1858 static void
goa_identity_service_identity_proxy_g_signal(GDBusProxy * proxy,const gchar * sender_name G_GNUC_UNUSED,const gchar * signal_name,GVariant * parameters)1859 goa_identity_service_identity_proxy_g_signal (GDBusProxy *proxy,
1860 const gchar *sender_name G_GNUC_UNUSED,
1861 const gchar *signal_name,
1862 GVariant *parameters)
1863 {
1864 _ExtendedGDBusSignalInfo *info;
1865 GVariantIter iter;
1866 GVariant *child;
1867 GValue *paramv;
1868 gsize num_params;
1869 gsize n;
1870 guint signal_id;
1871 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_goa_identity_service_identity_interface_info.parent_struct, signal_name);
1872 if (info == NULL)
1873 return;
1874 num_params = g_variant_n_children (parameters);
1875 paramv = g_new0 (GValue, num_params + 1);
1876 g_value_init (¶mv[0], GOA_IDENTITY_SERVICE_TYPE_IDENTITY);
1877 g_value_set_object (¶mv[0], proxy);
1878 g_variant_iter_init (&iter, parameters);
1879 n = 1;
1880 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1881 {
1882 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1883 if (arg_info->use_gvariant)
1884 {
1885 g_value_init (¶mv[n], G_TYPE_VARIANT);
1886 g_value_set_variant (¶mv[n], child);
1887 n++;
1888 }
1889 else
1890 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1891 g_variant_unref (child);
1892 }
1893 signal_id = g_signal_lookup (info->signal_name, GOA_IDENTITY_SERVICE_TYPE_IDENTITY);
1894 g_signal_emitv (paramv, signal_id, 0, NULL);
1895 for (n = 0; n < num_params + 1; n++)
1896 g_value_unset (¶mv[n]);
1897 g_free (paramv);
1898 }
1899
1900 static void
goa_identity_service_identity_proxy_g_properties_changed(GDBusProxy * _proxy,GVariant * changed_properties,const gchar * const * invalidated_properties)1901 goa_identity_service_identity_proxy_g_properties_changed (GDBusProxy *_proxy,
1902 GVariant *changed_properties,
1903 const gchar *const *invalidated_properties)
1904 {
1905 GoaIdentityServiceIdentityProxy *proxy = GOA_IDENTITY_SERVICE_IDENTITY_PROXY (_proxy);
1906 guint n;
1907 const gchar *key;
1908 GVariantIter *iter;
1909 _ExtendedGDBusPropertyInfo *info;
1910 g_variant_get (changed_properties, "a{sv}", &iter);
1911 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1912 {
1913 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_identity_service_identity_interface_info.parent_struct, key);
1914 g_datalist_remove_data (&proxy->priv->qdata, key);
1915 if (info != NULL)
1916 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1917 }
1918 g_variant_iter_free (iter);
1919 for (n = 0; invalidated_properties[n] != NULL; n++)
1920 {
1921 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_identity_service_identity_interface_info.parent_struct, invalidated_properties[n]);
1922 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
1923 if (info != NULL)
1924 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1925 }
1926 }
1927
1928 static const gchar *
goa_identity_service_identity_proxy_get_identifier(GoaIdentityServiceIdentity * object)1929 goa_identity_service_identity_proxy_get_identifier (GoaIdentityServiceIdentity *object)
1930 {
1931 GoaIdentityServiceIdentityProxy *proxy = GOA_IDENTITY_SERVICE_IDENTITY_PROXY (object);
1932 GVariant *variant;
1933 const gchar *value = NULL;
1934 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Identifier");
1935 if (variant != NULL)
1936 {
1937 value = g_variant_get_string (variant, NULL);
1938 g_variant_unref (variant);
1939 }
1940 return value;
1941 }
1942
1943 static gint64
goa_identity_service_identity_proxy_get_expiration_timestamp(GoaIdentityServiceIdentity * object)1944 goa_identity_service_identity_proxy_get_expiration_timestamp (GoaIdentityServiceIdentity *object)
1945 {
1946 GoaIdentityServiceIdentityProxy *proxy = GOA_IDENTITY_SERVICE_IDENTITY_PROXY (object);
1947 GVariant *variant;
1948 gint64 value = 0;
1949 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ExpirationTimestamp");
1950 if (variant != NULL)
1951 {
1952 value = g_variant_get_int64 (variant);
1953 g_variant_unref (variant);
1954 }
1955 return value;
1956 }
1957
1958 static gboolean
goa_identity_service_identity_proxy_get_is_signed_in(GoaIdentityServiceIdentity * object)1959 goa_identity_service_identity_proxy_get_is_signed_in (GoaIdentityServiceIdentity *object)
1960 {
1961 GoaIdentityServiceIdentityProxy *proxy = GOA_IDENTITY_SERVICE_IDENTITY_PROXY (object);
1962 GVariant *variant;
1963 gboolean value = 0;
1964 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "IsSignedIn");
1965 if (variant != NULL)
1966 {
1967 value = g_variant_get_boolean (variant);
1968 g_variant_unref (variant);
1969 }
1970 return value;
1971 }
1972
1973 static void
goa_identity_service_identity_proxy_init(GoaIdentityServiceIdentityProxy * proxy)1974 goa_identity_service_identity_proxy_init (GoaIdentityServiceIdentityProxy *proxy)
1975 {
1976 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1977 proxy->priv = goa_identity_service_identity_proxy_get_instance_private (proxy);
1978 #else
1979 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GOA_IDENTITY_SERVICE_TYPE_IDENTITY_PROXY, GoaIdentityServiceIdentityProxyPrivate);
1980 #endif
1981
1982 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), goa_identity_service_identity_interface_info ());
1983 }
1984
1985 static void
goa_identity_service_identity_proxy_class_init(GoaIdentityServiceIdentityProxyClass * klass)1986 goa_identity_service_identity_proxy_class_init (GoaIdentityServiceIdentityProxyClass *klass)
1987 {
1988 GObjectClass *gobject_class;
1989 GDBusProxyClass *proxy_class;
1990
1991 gobject_class = G_OBJECT_CLASS (klass);
1992 gobject_class->finalize = goa_identity_service_identity_proxy_finalize;
1993 gobject_class->get_property = goa_identity_service_identity_proxy_get_property;
1994 gobject_class->set_property = goa_identity_service_identity_proxy_set_property;
1995
1996 proxy_class = G_DBUS_PROXY_CLASS (klass);
1997 proxy_class->g_signal = goa_identity_service_identity_proxy_g_signal;
1998 proxy_class->g_properties_changed = goa_identity_service_identity_proxy_g_properties_changed;
1999
2000 goa_identity_service_identity_override_properties (gobject_class, 1);
2001
2002 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2003 g_type_class_add_private (klass, sizeof (GoaIdentityServiceIdentityProxyPrivate));
2004 #endif
2005 }
2006
2007 static void
goa_identity_service_identity_proxy_iface_init(GoaIdentityServiceIdentityIface * iface)2008 goa_identity_service_identity_proxy_iface_init (GoaIdentityServiceIdentityIface *iface)
2009 {
2010 iface->get_identifier = goa_identity_service_identity_proxy_get_identifier;
2011 iface->get_expiration_timestamp = goa_identity_service_identity_proxy_get_expiration_timestamp;
2012 iface->get_is_signed_in = goa_identity_service_identity_proxy_get_is_signed_in;
2013 }
2014
2015 /**
2016 * goa_identity_service_identity_proxy_new:
2017 * @connection: A #GDBusConnection.
2018 * @flags: Flags from the #GDBusProxyFlags enumeration.
2019 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2020 * @object_path: An object path.
2021 * @cancellable: (nullable): A #GCancellable or %NULL.
2022 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2023 * @user_data: User data to pass to @callback.
2024 *
2025 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link>. See g_dbus_proxy_new() for more details.
2026 *
2027 * 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()).
2028 * You can then call goa_identity_service_identity_proxy_new_finish() to get the result of the operation.
2029 *
2030 * See goa_identity_service_identity_proxy_new_sync() for the synchronous, blocking version of this constructor.
2031 */
2032 void
goa_identity_service_identity_proxy_new(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)2033 goa_identity_service_identity_proxy_new (
2034 GDBusConnection *connection,
2035 GDBusProxyFlags flags,
2036 const gchar *name,
2037 const gchar *object_path,
2038 GCancellable *cancellable,
2039 GAsyncReadyCallback callback,
2040 gpointer user_data)
2041 {
2042 g_async_initable_new_async (GOA_IDENTITY_SERVICE_TYPE_IDENTITY_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.Identity", NULL);
2043 }
2044
2045 /**
2046 * goa_identity_service_identity_proxy_new_finish:
2047 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_identity_proxy_new().
2048 * @error: Return location for error or %NULL
2049 *
2050 * Finishes an operation started with goa_identity_service_identity_proxy_new().
2051 *
2052 * Returns: (transfer full) (type GoaIdentityServiceIdentityProxy): The constructed proxy object or %NULL if @error is set.
2053 */
2054 GoaIdentityServiceIdentity *
goa_identity_service_identity_proxy_new_finish(GAsyncResult * res,GError ** error)2055 goa_identity_service_identity_proxy_new_finish (
2056 GAsyncResult *res,
2057 GError **error)
2058 {
2059 GObject *ret;
2060 GObject *source_object;
2061 source_object = g_async_result_get_source_object (res);
2062 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2063 g_object_unref (source_object);
2064 if (ret != NULL)
2065 return GOA_IDENTITY_SERVICE_IDENTITY (ret);
2066 else
2067 return NULL;
2068 }
2069
2070 /**
2071 * goa_identity_service_identity_proxy_new_sync:
2072 * @connection: A #GDBusConnection.
2073 * @flags: Flags from the #GDBusProxyFlags enumeration.
2074 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2075 * @object_path: An object path.
2076 * @cancellable: (nullable): A #GCancellable or %NULL.
2077 * @error: Return location for error or %NULL
2078 *
2079 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link>. See g_dbus_proxy_new_sync() for more details.
2080 *
2081 * The calling thread is blocked until a reply is received.
2082 *
2083 * See goa_identity_service_identity_proxy_new() for the asynchronous version of this constructor.
2084 *
2085 * Returns: (transfer full) (type GoaIdentityServiceIdentityProxy): The constructed proxy object or %NULL if @error is set.
2086 */
2087 GoaIdentityServiceIdentity *
goa_identity_service_identity_proxy_new_sync(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)2088 goa_identity_service_identity_proxy_new_sync (
2089 GDBusConnection *connection,
2090 GDBusProxyFlags flags,
2091 const gchar *name,
2092 const gchar *object_path,
2093 GCancellable *cancellable,
2094 GError **error)
2095 {
2096 GInitable *ret;
2097 ret = g_initable_new (GOA_IDENTITY_SERVICE_TYPE_IDENTITY_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.Identity", NULL);
2098 if (ret != NULL)
2099 return GOA_IDENTITY_SERVICE_IDENTITY (ret);
2100 else
2101 return NULL;
2102 }
2103
2104
2105 /**
2106 * goa_identity_service_identity_proxy_new_for_bus:
2107 * @bus_type: A #GBusType.
2108 * @flags: Flags from the #GDBusProxyFlags enumeration.
2109 * @name: A bus name (well-known or unique).
2110 * @object_path: An object path.
2111 * @cancellable: (nullable): A #GCancellable or %NULL.
2112 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2113 * @user_data: User data to pass to @callback.
2114 *
2115 * Like goa_identity_service_identity_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
2116 *
2117 * 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()).
2118 * You can then call goa_identity_service_identity_proxy_new_for_bus_finish() to get the result of the operation.
2119 *
2120 * See goa_identity_service_identity_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
2121 */
2122 void
goa_identity_service_identity_proxy_new_for_bus(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)2123 goa_identity_service_identity_proxy_new_for_bus (
2124 GBusType bus_type,
2125 GDBusProxyFlags flags,
2126 const gchar *name,
2127 const gchar *object_path,
2128 GCancellable *cancellable,
2129 GAsyncReadyCallback callback,
2130 gpointer user_data)
2131 {
2132 g_async_initable_new_async (GOA_IDENTITY_SERVICE_TYPE_IDENTITY_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.Identity", NULL);
2133 }
2134
2135 /**
2136 * goa_identity_service_identity_proxy_new_for_bus_finish:
2137 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_identity_proxy_new_for_bus().
2138 * @error: Return location for error or %NULL
2139 *
2140 * Finishes an operation started with goa_identity_service_identity_proxy_new_for_bus().
2141 *
2142 * Returns: (transfer full) (type GoaIdentityServiceIdentityProxy): The constructed proxy object or %NULL if @error is set.
2143 */
2144 GoaIdentityServiceIdentity *
goa_identity_service_identity_proxy_new_for_bus_finish(GAsyncResult * res,GError ** error)2145 goa_identity_service_identity_proxy_new_for_bus_finish (
2146 GAsyncResult *res,
2147 GError **error)
2148 {
2149 GObject *ret;
2150 GObject *source_object;
2151 source_object = g_async_result_get_source_object (res);
2152 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2153 g_object_unref (source_object);
2154 if (ret != NULL)
2155 return GOA_IDENTITY_SERVICE_IDENTITY (ret);
2156 else
2157 return NULL;
2158 }
2159
2160 /**
2161 * goa_identity_service_identity_proxy_new_for_bus_sync:
2162 * @bus_type: A #GBusType.
2163 * @flags: Flags from the #GDBusProxyFlags enumeration.
2164 * @name: A bus name (well-known or unique).
2165 * @object_path: An object path.
2166 * @cancellable: (nullable): A #GCancellable or %NULL.
2167 * @error: Return location for error or %NULL
2168 *
2169 * Like goa_identity_service_identity_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
2170 *
2171 * The calling thread is blocked until a reply is received.
2172 *
2173 * See goa_identity_service_identity_proxy_new_for_bus() for the asynchronous version of this constructor.
2174 *
2175 * Returns: (transfer full) (type GoaIdentityServiceIdentityProxy): The constructed proxy object or %NULL if @error is set.
2176 */
2177 GoaIdentityServiceIdentity *
goa_identity_service_identity_proxy_new_for_bus_sync(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)2178 goa_identity_service_identity_proxy_new_for_bus_sync (
2179 GBusType bus_type,
2180 GDBusProxyFlags flags,
2181 const gchar *name,
2182 const gchar *object_path,
2183 GCancellable *cancellable,
2184 GError **error)
2185 {
2186 GInitable *ret;
2187 ret = g_initable_new (GOA_IDENTITY_SERVICE_TYPE_IDENTITY_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.Identity", NULL);
2188 if (ret != NULL)
2189 return GOA_IDENTITY_SERVICE_IDENTITY (ret);
2190 else
2191 return NULL;
2192 }
2193
2194
2195 /* ------------------------------------------------------------------------ */
2196
2197 /**
2198 * GoaIdentityServiceIdentitySkeleton:
2199 *
2200 * The #GoaIdentityServiceIdentitySkeleton structure contains only private data and should only be accessed using the provided API.
2201 */
2202
2203 /**
2204 * GoaIdentityServiceIdentitySkeletonClass:
2205 * @parent_class: The parent class.
2206 *
2207 * Class structure for #GoaIdentityServiceIdentitySkeleton.
2208 */
2209
2210 struct _GoaIdentityServiceIdentitySkeletonPrivate
2211 {
2212 GValue *properties;
2213 GList *changed_properties;
2214 GSource *changed_properties_idle_source;
2215 GMainContext *context;
2216 GMutex lock;
2217 };
2218
2219 static void
_goa_identity_service_identity_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)2220 _goa_identity_service_identity_skeleton_handle_method_call (
2221 GDBusConnection *connection G_GNUC_UNUSED,
2222 const gchar *sender G_GNUC_UNUSED,
2223 const gchar *object_path G_GNUC_UNUSED,
2224 const gchar *interface_name,
2225 const gchar *method_name,
2226 GVariant *parameters,
2227 GDBusMethodInvocation *invocation,
2228 gpointer user_data)
2229 {
2230 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (user_data);
2231 _ExtendedGDBusMethodInfo *info;
2232 GVariantIter iter;
2233 GVariant *child;
2234 GValue *paramv;
2235 gsize num_params;
2236 guint num_extra;
2237 gsize n;
2238 guint signal_id;
2239 GValue return_value = G_VALUE_INIT;
2240 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
2241 g_assert (info != NULL);
2242 num_params = g_variant_n_children (parameters);
2243 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
2244 n = 0;
2245 g_value_init (¶mv[n], GOA_IDENTITY_SERVICE_TYPE_IDENTITY);
2246 g_value_set_object (¶mv[n++], skeleton);
2247 g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
2248 g_value_set_object (¶mv[n++], invocation);
2249 if (info->pass_fdlist)
2250 {
2251 #ifdef G_OS_UNIX
2252 g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
2253 g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
2254 #else
2255 g_assert_not_reached ();
2256 #endif
2257 }
2258 g_variant_iter_init (&iter, parameters);
2259 while ((child = g_variant_iter_next_value (&iter)) != NULL)
2260 {
2261 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
2262 if (arg_info->use_gvariant)
2263 {
2264 g_value_init (¶mv[n], G_TYPE_VARIANT);
2265 g_value_set_variant (¶mv[n], child);
2266 n++;
2267 }
2268 else
2269 g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
2270 g_variant_unref (child);
2271 }
2272 signal_id = g_signal_lookup (info->signal_name, GOA_IDENTITY_SERVICE_TYPE_IDENTITY);
2273 g_value_init (&return_value, G_TYPE_BOOLEAN);
2274 g_signal_emitv (paramv, signal_id, 0, &return_value);
2275 if (!g_value_get_boolean (&return_value))
2276 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);
2277 g_value_unset (&return_value);
2278 for (n = 0; n < num_params + num_extra; n++)
2279 g_value_unset (¶mv[n]);
2280 g_free (paramv);
2281 }
2282
2283 static GVariant *
_goa_identity_service_identity_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)2284 _goa_identity_service_identity_skeleton_handle_get_property (
2285 GDBusConnection *connection G_GNUC_UNUSED,
2286 const gchar *sender G_GNUC_UNUSED,
2287 const gchar *object_path G_GNUC_UNUSED,
2288 const gchar *interface_name G_GNUC_UNUSED,
2289 const gchar *property_name,
2290 GError **error,
2291 gpointer user_data)
2292 {
2293 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (user_data);
2294 GValue value = G_VALUE_INIT;
2295 GParamSpec *pspec;
2296 _ExtendedGDBusPropertyInfo *info;
2297 GVariant *ret;
2298 ret = NULL;
2299 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_identity_service_identity_interface_info.parent_struct, property_name);
2300 g_assert (info != NULL);
2301 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2302 if (pspec == NULL)
2303 {
2304 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2305 }
2306 else
2307 {
2308 g_value_init (&value, pspec->value_type);
2309 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2310 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
2311 g_value_unset (&value);
2312 }
2313 return ret;
2314 }
2315
2316 static gboolean
_goa_identity_service_identity_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)2317 _goa_identity_service_identity_skeleton_handle_set_property (
2318 GDBusConnection *connection G_GNUC_UNUSED,
2319 const gchar *sender G_GNUC_UNUSED,
2320 const gchar *object_path G_GNUC_UNUSED,
2321 const gchar *interface_name G_GNUC_UNUSED,
2322 const gchar *property_name,
2323 GVariant *variant,
2324 GError **error,
2325 gpointer user_data)
2326 {
2327 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (user_data);
2328 GValue value = G_VALUE_INIT;
2329 GParamSpec *pspec;
2330 _ExtendedGDBusPropertyInfo *info;
2331 gboolean ret;
2332 ret = FALSE;
2333 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_identity_service_identity_interface_info.parent_struct, property_name);
2334 g_assert (info != NULL);
2335 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
2336 if (pspec == NULL)
2337 {
2338 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
2339 }
2340 else
2341 {
2342 if (info->use_gvariant)
2343 g_value_set_variant (&value, variant);
2344 else
2345 g_dbus_gvariant_to_gvalue (variant, &value);
2346 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
2347 g_value_unset (&value);
2348 ret = TRUE;
2349 }
2350 return ret;
2351 }
2352
2353 static const GDBusInterfaceVTable _goa_identity_service_identity_skeleton_vtable =
2354 {
2355 _goa_identity_service_identity_skeleton_handle_method_call,
2356 _goa_identity_service_identity_skeleton_handle_get_property,
2357 _goa_identity_service_identity_skeleton_handle_set_property,
2358 {NULL}
2359 };
2360
2361 static GDBusInterfaceInfo *
goa_identity_service_identity_skeleton_dbus_interface_get_info(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)2362 goa_identity_service_identity_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2363 {
2364 return goa_identity_service_identity_interface_info ();
2365 }
2366
2367 static GDBusInterfaceVTable *
goa_identity_service_identity_skeleton_dbus_interface_get_vtable(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)2368 goa_identity_service_identity_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
2369 {
2370 return (GDBusInterfaceVTable *) &_goa_identity_service_identity_skeleton_vtable;
2371 }
2372
2373 static GVariant *
goa_identity_service_identity_skeleton_dbus_interface_get_properties(GDBusInterfaceSkeleton * _skeleton)2374 goa_identity_service_identity_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
2375 {
2376 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (_skeleton);
2377
2378 GVariantBuilder builder;
2379 guint n;
2380 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
2381 if (_goa_identity_service_identity_interface_info.parent_struct.properties == NULL)
2382 goto out;
2383 for (n = 0; _goa_identity_service_identity_interface_info.parent_struct.properties[n] != NULL; n++)
2384 {
2385 GDBusPropertyInfo *info = _goa_identity_service_identity_interface_info.parent_struct.properties[n];
2386 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
2387 {
2388 GVariant *value;
2389 value = _goa_identity_service_identity_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.gnome.Identity", info->name, NULL, skeleton);
2390 if (value != NULL)
2391 {
2392 g_variant_take_ref (value);
2393 g_variant_builder_add (&builder, "{sv}", info->name, value);
2394 g_variant_unref (value);
2395 }
2396 }
2397 }
2398 out:
2399 return g_variant_builder_end (&builder);
2400 }
2401
2402 static gboolean _goa_identity_service_identity_emit_changed (gpointer user_data);
2403
2404 static void
goa_identity_service_identity_skeleton_dbus_interface_flush(GDBusInterfaceSkeleton * _skeleton)2405 goa_identity_service_identity_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
2406 {
2407 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (_skeleton);
2408 gboolean emit_changed = FALSE;
2409
2410 g_mutex_lock (&skeleton->priv->lock);
2411 if (skeleton->priv->changed_properties_idle_source != NULL)
2412 {
2413 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2414 skeleton->priv->changed_properties_idle_source = NULL;
2415 emit_changed = TRUE;
2416 }
2417 g_mutex_unlock (&skeleton->priv->lock);
2418
2419 if (emit_changed)
2420 _goa_identity_service_identity_emit_changed (skeleton);
2421 }
2422
2423 static void goa_identity_service_identity_skeleton_iface_init (GoaIdentityServiceIdentityIface *iface);
2424 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(GoaIdentityServiceIdentitySkeleton,goa_identity_service_identity_skeleton,G_TYPE_DBUS_INTERFACE_SKELETON,G_ADD_PRIVATE (GoaIdentityServiceIdentitySkeleton)G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_IDENTITY,goa_identity_service_identity_skeleton_iface_init))2425 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceIdentitySkeleton, goa_identity_service_identity_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2426 G_ADD_PRIVATE (GoaIdentityServiceIdentitySkeleton)
2427 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_IDENTITY, goa_identity_service_identity_skeleton_iface_init))
2428
2429 #else
2430 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceIdentitySkeleton, goa_identity_service_identity_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
2431 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_IDENTITY, goa_identity_service_identity_skeleton_iface_init))
2432
2433 #endif
2434 static void
2435 goa_identity_service_identity_skeleton_finalize (GObject *object)
2436 {
2437 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (object);
2438 guint n;
2439 for (n = 0; n < 3; n++)
2440 g_value_unset (&skeleton->priv->properties[n]);
2441 g_free (skeleton->priv->properties);
2442 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
2443 if (skeleton->priv->changed_properties_idle_source != NULL)
2444 g_source_destroy (skeleton->priv->changed_properties_idle_source);
2445 g_main_context_unref (skeleton->priv->context);
2446 g_mutex_clear (&skeleton->priv->lock);
2447 G_OBJECT_CLASS (goa_identity_service_identity_skeleton_parent_class)->finalize (object);
2448 }
2449
2450 static void
goa_identity_service_identity_skeleton_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)2451 goa_identity_service_identity_skeleton_get_property (GObject *object,
2452 guint prop_id,
2453 GValue *value,
2454 GParamSpec *pspec G_GNUC_UNUSED)
2455 {
2456 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (object);
2457 g_assert (prop_id != 0 && prop_id - 1 < 3);
2458 g_mutex_lock (&skeleton->priv->lock);
2459 g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
2460 g_mutex_unlock (&skeleton->priv->lock);
2461 }
2462
2463 static gboolean
_goa_identity_service_identity_emit_changed(gpointer user_data)2464 _goa_identity_service_identity_emit_changed (gpointer user_data)
2465 {
2466 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (user_data);
2467 GList *l;
2468 GVariantBuilder builder;
2469 GVariantBuilder invalidated_builder;
2470 guint num_changes;
2471
2472 g_mutex_lock (&skeleton->priv->lock);
2473 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
2474 g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
2475 for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
2476 {
2477 ChangedProperty *cp = l->data;
2478 GVariant *variant;
2479 const GValue *cur_value;
2480
2481 cur_value = &skeleton->priv->properties[cp->prop_id - 1];
2482 if (!_g_value_equal (cur_value, &cp->orig_value))
2483 {
2484 variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
2485 g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
2486 g_variant_unref (variant);
2487 num_changes++;
2488 }
2489 }
2490 if (num_changes > 0)
2491 {
2492 GList *connections, *ll;
2493 GVariant *signal_variant;
2494 signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.gnome.Identity",
2495 &builder, &invalidated_builder));
2496 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
2497 for (ll = connections; ll != NULL; ll = ll->next)
2498 {
2499 GDBusConnection *connection = ll->data;
2500
2501 g_dbus_connection_emit_signal (connection,
2502 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
2503 "org.freedesktop.DBus.Properties",
2504 "PropertiesChanged",
2505 signal_variant,
2506 NULL);
2507 }
2508 g_variant_unref (signal_variant);
2509 g_list_free_full (connections, g_object_unref);
2510 }
2511 else
2512 {
2513 g_variant_builder_clear (&builder);
2514 g_variant_builder_clear (&invalidated_builder);
2515 }
2516 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
2517 skeleton->priv->changed_properties = NULL;
2518 skeleton->priv->changed_properties_idle_source = NULL;
2519 g_mutex_unlock (&skeleton->priv->lock);
2520 return FALSE;
2521 }
2522
2523 static void
_goa_identity_service_identity_schedule_emit_changed(GoaIdentityServiceIdentitySkeleton * skeleton,const _ExtendedGDBusPropertyInfo * info,guint prop_id,const GValue * orig_value)2524 _goa_identity_service_identity_schedule_emit_changed (GoaIdentityServiceIdentitySkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
2525 {
2526 ChangedProperty *cp;
2527 GList *l;
2528 cp = NULL;
2529 for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
2530 {
2531 ChangedProperty *i_cp = l->data;
2532 if (i_cp->info == info)
2533 {
2534 cp = i_cp;
2535 break;
2536 }
2537 }
2538 if (cp == NULL)
2539 {
2540 cp = g_new0 (ChangedProperty, 1);
2541 cp->prop_id = prop_id;
2542 cp->info = info;
2543 skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
2544 g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
2545 g_value_copy (orig_value, &cp->orig_value);
2546 }
2547 }
2548
2549 static void
goa_identity_service_identity_skeleton_notify(GObject * object,GParamSpec * pspec G_GNUC_UNUSED)2550 goa_identity_service_identity_skeleton_notify (GObject *object,
2551 GParamSpec *pspec G_GNUC_UNUSED)
2552 {
2553 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (object);
2554 g_mutex_lock (&skeleton->priv->lock);
2555 if (skeleton->priv->changed_properties != NULL &&
2556 skeleton->priv->changed_properties_idle_source == NULL)
2557 {
2558 skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
2559 g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
2560 g_source_set_callback (skeleton->priv->changed_properties_idle_source, _goa_identity_service_identity_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
2561 g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _goa_identity_service_identity_emit_changed");
2562 g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
2563 g_source_unref (skeleton->priv->changed_properties_idle_source);
2564 }
2565 g_mutex_unlock (&skeleton->priv->lock);
2566 }
2567
2568 static void
goa_identity_service_identity_skeleton_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec)2569 goa_identity_service_identity_skeleton_set_property (GObject *object,
2570 guint prop_id,
2571 const GValue *value,
2572 GParamSpec *pspec)
2573 {
2574 const _ExtendedGDBusPropertyInfo *info;
2575 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (object);
2576 g_assert (prop_id != 0 && prop_id - 1 < 3);
2577 info = (const _ExtendedGDBusPropertyInfo *) _goa_identity_service_identity_property_info_pointers[prop_id - 1];
2578 g_mutex_lock (&skeleton->priv->lock);
2579 g_object_freeze_notify (object);
2580 if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
2581 {
2582 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
2583 info->emits_changed_signal)
2584 _goa_identity_service_identity_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
2585 g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
2586 g_object_notify_by_pspec (object, pspec);
2587 }
2588 g_mutex_unlock (&skeleton->priv->lock);
2589 g_object_thaw_notify (object);
2590 }
2591
2592 static void
goa_identity_service_identity_skeleton_init(GoaIdentityServiceIdentitySkeleton * skeleton)2593 goa_identity_service_identity_skeleton_init (GoaIdentityServiceIdentitySkeleton *skeleton)
2594 {
2595 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
2596 skeleton->priv = goa_identity_service_identity_skeleton_get_instance_private (skeleton);
2597 #else
2598 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GOA_IDENTITY_SERVICE_TYPE_IDENTITY_SKELETON, GoaIdentityServiceIdentitySkeletonPrivate);
2599 #endif
2600
2601 g_mutex_init (&skeleton->priv->lock);
2602 skeleton->priv->context = g_main_context_ref_thread_default ();
2603 skeleton->priv->properties = g_new0 (GValue, 3);
2604 g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
2605 g_value_init (&skeleton->priv->properties[1], G_TYPE_INT64);
2606 g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN);
2607 }
2608
2609 static const gchar *
goa_identity_service_identity_skeleton_get_identifier(GoaIdentityServiceIdentity * object)2610 goa_identity_service_identity_skeleton_get_identifier (GoaIdentityServiceIdentity *object)
2611 {
2612 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (object);
2613 const gchar *value;
2614 g_mutex_lock (&skeleton->priv->lock);
2615 value = g_value_get_string (&(skeleton->priv->properties[0]));
2616 g_mutex_unlock (&skeleton->priv->lock);
2617 return value;
2618 }
2619
2620 static gint64
goa_identity_service_identity_skeleton_get_expiration_timestamp(GoaIdentityServiceIdentity * object)2621 goa_identity_service_identity_skeleton_get_expiration_timestamp (GoaIdentityServiceIdentity *object)
2622 {
2623 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (object);
2624 gint64 value;
2625 g_mutex_lock (&skeleton->priv->lock);
2626 value = g_value_get_int64 (&(skeleton->priv->properties[1]));
2627 g_mutex_unlock (&skeleton->priv->lock);
2628 return value;
2629 }
2630
2631 static gboolean
goa_identity_service_identity_skeleton_get_is_signed_in(GoaIdentityServiceIdentity * object)2632 goa_identity_service_identity_skeleton_get_is_signed_in (GoaIdentityServiceIdentity *object)
2633 {
2634 GoaIdentityServiceIdentitySkeleton *skeleton = GOA_IDENTITY_SERVICE_IDENTITY_SKELETON (object);
2635 gboolean value;
2636 g_mutex_lock (&skeleton->priv->lock);
2637 value = g_value_get_boolean (&(skeleton->priv->properties[2]));
2638 g_mutex_unlock (&skeleton->priv->lock);
2639 return value;
2640 }
2641
2642 static void
goa_identity_service_identity_skeleton_class_init(GoaIdentityServiceIdentitySkeletonClass * klass)2643 goa_identity_service_identity_skeleton_class_init (GoaIdentityServiceIdentitySkeletonClass *klass)
2644 {
2645 GObjectClass *gobject_class;
2646 GDBusInterfaceSkeletonClass *skeleton_class;
2647
2648 gobject_class = G_OBJECT_CLASS (klass);
2649 gobject_class->finalize = goa_identity_service_identity_skeleton_finalize;
2650 gobject_class->get_property = goa_identity_service_identity_skeleton_get_property;
2651 gobject_class->set_property = goa_identity_service_identity_skeleton_set_property;
2652 gobject_class->notify = goa_identity_service_identity_skeleton_notify;
2653
2654
2655 goa_identity_service_identity_override_properties (gobject_class, 1);
2656
2657 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
2658 skeleton_class->get_info = goa_identity_service_identity_skeleton_dbus_interface_get_info;
2659 skeleton_class->get_properties = goa_identity_service_identity_skeleton_dbus_interface_get_properties;
2660 skeleton_class->flush = goa_identity_service_identity_skeleton_dbus_interface_flush;
2661 skeleton_class->get_vtable = goa_identity_service_identity_skeleton_dbus_interface_get_vtable;
2662
2663 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
2664 g_type_class_add_private (klass, sizeof (GoaIdentityServiceIdentitySkeletonPrivate));
2665 #endif
2666 }
2667
2668 static void
goa_identity_service_identity_skeleton_iface_init(GoaIdentityServiceIdentityIface * iface)2669 goa_identity_service_identity_skeleton_iface_init (GoaIdentityServiceIdentityIface *iface)
2670 {
2671 iface->get_identifier = goa_identity_service_identity_skeleton_get_identifier;
2672 iface->get_expiration_timestamp = goa_identity_service_identity_skeleton_get_expiration_timestamp;
2673 iface->get_is_signed_in = goa_identity_service_identity_skeleton_get_is_signed_in;
2674 }
2675
2676 /**
2677 * goa_identity_service_identity_skeleton_new:
2678 *
2679 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link>.
2680 *
2681 * Returns: (transfer full) (type GoaIdentityServiceIdentitySkeleton): The skeleton object.
2682 */
2683 GoaIdentityServiceIdentity *
goa_identity_service_identity_skeleton_new(void)2684 goa_identity_service_identity_skeleton_new (void)
2685 {
2686 return GOA_IDENTITY_SERVICE_IDENTITY (g_object_new (GOA_IDENTITY_SERVICE_TYPE_IDENTITY_SKELETON, NULL));
2687 }
2688
2689 /* ------------------------------------------------------------------------
2690 * Code for Object, ObjectProxy and ObjectSkeleton
2691 * ------------------------------------------------------------------------
2692 */
2693
2694 /**
2695 * SECTION:GoaIdentityServiceObject
2696 * @title: GoaIdentityServiceObject
2697 * @short_description: Specialized GDBusObject types
2698 *
2699 * This section contains the #GoaIdentityServiceObject, #GoaIdentityServiceObjectProxy, and #GoaIdentityServiceObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
2700 */
2701
2702 /**
2703 * GoaIdentityServiceObject:
2704 *
2705 * The #GoaIdentityServiceObject type is a specialized container of interfaces.
2706 */
2707
2708 /**
2709 * GoaIdentityServiceObjectIface:
2710 * @parent_iface: The parent interface.
2711 *
2712 * Virtual table for the #GoaIdentityServiceObject interface.
2713 */
2714
2715 typedef GoaIdentityServiceObjectIface GoaIdentityServiceObjectInterface;
G_DEFINE_INTERFACE_WITH_CODE(GoaIdentityServiceObject,goa_identity_service_object,G_TYPE_OBJECT,g_type_interface_add_prerequisite (g_define_type_id,G_TYPE_DBUS_OBJECT);)2716 G_DEFINE_INTERFACE_WITH_CODE (GoaIdentityServiceObject, goa_identity_service_object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT);)
2717
2718 static void
2719 goa_identity_service_object_default_init (GoaIdentityServiceObjectIface *iface)
2720 {
2721 /**
2722 * GoaIdentityServiceObject:manager:
2723 *
2724 * The #GoaIdentityServiceManager instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link>, if any.
2725 *
2726 * Connect to the #GObject::notify signal to get informed of property changes.
2727 */
2728 g_object_interface_install_property (iface, g_param_spec_object ("manager", "manager", "manager", GOA_IDENTITY_SERVICE_TYPE_MANAGER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2729
2730 /**
2731 * GoaIdentityServiceObject:identity:
2732 *
2733 * The #GoaIdentityServiceIdentity instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link>, if any.
2734 *
2735 * Connect to the #GObject::notify signal to get informed of property changes.
2736 */
2737 g_object_interface_install_property (iface, g_param_spec_object ("identity", "identity", "identity", GOA_IDENTITY_SERVICE_TYPE_IDENTITY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2738
2739 }
2740
2741 /**
2742 * goa_identity_service_object_get_manager:
2743 * @object: A #GoaIdentityServiceObject.
2744 *
2745 * Gets the #GoaIdentityServiceManager instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link> on @object, if any.
2746 *
2747 * Returns: (transfer full) (nullable): A #GoaIdentityServiceManager that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
2748 */
goa_identity_service_object_get_manager(GoaIdentityServiceObject * object)2749 GoaIdentityServiceManager *goa_identity_service_object_get_manager (GoaIdentityServiceObject *object)
2750 {
2751 GDBusInterface *ret;
2752 ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Identity.Manager");
2753 if (ret == NULL)
2754 return NULL;
2755 return GOA_IDENTITY_SERVICE_MANAGER (ret);
2756 }
2757
2758 /**
2759 * goa_identity_service_object_get_identity:
2760 * @object: A #GoaIdentityServiceObject.
2761 *
2762 * Gets the #GoaIdentityServiceIdentity instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link> on @object, if any.
2763 *
2764 * Returns: (transfer full) (nullable): A #GoaIdentityServiceIdentity that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
2765 */
goa_identity_service_object_get_identity(GoaIdentityServiceObject * object)2766 GoaIdentityServiceIdentity *goa_identity_service_object_get_identity (GoaIdentityServiceObject *object)
2767 {
2768 GDBusInterface *ret;
2769 ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Identity");
2770 if (ret == NULL)
2771 return NULL;
2772 return GOA_IDENTITY_SERVICE_IDENTITY (ret);
2773 }
2774
2775
2776 /**
2777 * goa_identity_service_object_peek_manager: (skip)
2778 * @object: A #GoaIdentityServiceObject.
2779 *
2780 * Like goa_identity_service_object_get_manager() but doesn't increase the reference count on the returned object.
2781 *
2782 * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.
2783 *
2784 * Returns: (transfer none) (nullable): A #GoaIdentityServiceManager or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
2785 */
goa_identity_service_object_peek_manager(GoaIdentityServiceObject * object)2786 GoaIdentityServiceManager *goa_identity_service_object_peek_manager (GoaIdentityServiceObject *object)
2787 {
2788 GDBusInterface *ret;
2789 ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Identity.Manager");
2790 if (ret == NULL)
2791 return NULL;
2792 g_object_unref (ret);
2793 return GOA_IDENTITY_SERVICE_MANAGER (ret);
2794 }
2795
2796 /**
2797 * goa_identity_service_object_peek_identity: (skip)
2798 * @object: A #GoaIdentityServiceObject.
2799 *
2800 * Like goa_identity_service_object_get_identity() but doesn't increase the reference count on the returned object.
2801 *
2802 * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.
2803 *
2804 * Returns: (transfer none) (nullable): A #GoaIdentityServiceIdentity or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
2805 */
goa_identity_service_object_peek_identity(GoaIdentityServiceObject * object)2806 GoaIdentityServiceIdentity *goa_identity_service_object_peek_identity (GoaIdentityServiceObject *object)
2807 {
2808 GDBusInterface *ret;
2809 ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Identity");
2810 if (ret == NULL)
2811 return NULL;
2812 g_object_unref (ret);
2813 return GOA_IDENTITY_SERVICE_IDENTITY (ret);
2814 }
2815
2816
2817 static void
goa_identity_service_object_notify(GDBusObject * object,GDBusInterface * interface)2818 goa_identity_service_object_notify (GDBusObject *object, GDBusInterface *interface)
2819 {
2820 _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
2821 /* info can be NULL if the other end is using a D-Bus interface we don't know
2822 * anything about, for example old generated code in this process talking to
2823 * newer generated code in the other process. */
2824 if (info != NULL)
2825 g_object_notify (G_OBJECT (object), info->hyphen_name);
2826 }
2827
2828 /**
2829 * GoaIdentityServiceObjectProxy:
2830 *
2831 * The #GoaIdentityServiceObjectProxy structure contains only private data and should only be accessed using the provided API.
2832 */
2833
2834 /**
2835 * GoaIdentityServiceObjectProxyClass:
2836 * @parent_class: The parent class.
2837 *
2838 * Class structure for #GoaIdentityServiceObjectProxy.
2839 */
2840
2841 static void
goa_identity_service_object_proxy__goa_identity_service_object_iface_init(GoaIdentityServiceObjectIface * iface G_GNUC_UNUSED)2842 goa_identity_service_object_proxy__goa_identity_service_object_iface_init (GoaIdentityServiceObjectIface *iface G_GNUC_UNUSED)
2843 {
2844 }
2845
2846 static void
goa_identity_service_object_proxy__g_dbus_object_iface_init(GDBusObjectIface * iface)2847 goa_identity_service_object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
2848 {
2849 iface->interface_added = goa_identity_service_object_notify;
2850 iface->interface_removed = goa_identity_service_object_notify;
2851 }
2852
2853
G_DEFINE_TYPE_WITH_CODE(GoaIdentityServiceObjectProxy,goa_identity_service_object_proxy,G_TYPE_DBUS_OBJECT_PROXY,G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_OBJECT,goa_identity_service_object_proxy__goa_identity_service_object_iface_init)G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT,goa_identity_service_object_proxy__g_dbus_object_iface_init))2854 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceObjectProxy, goa_identity_service_object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
2855 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_OBJECT, goa_identity_service_object_proxy__goa_identity_service_object_iface_init)
2856 G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, goa_identity_service_object_proxy__g_dbus_object_iface_init))
2857
2858 static void
2859 goa_identity_service_object_proxy_init (GoaIdentityServiceObjectProxy *object G_GNUC_UNUSED)
2860 {
2861 }
2862
2863 static void
goa_identity_service_object_proxy_set_property(GObject * gobject,guint prop_id,const GValue * value G_GNUC_UNUSED,GParamSpec * pspec)2864 goa_identity_service_object_proxy_set_property (GObject *gobject,
2865 guint prop_id,
2866 const GValue *value G_GNUC_UNUSED,
2867 GParamSpec *pspec)
2868 {
2869 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
2870 }
2871
2872 static void
goa_identity_service_object_proxy_get_property(GObject * gobject,guint prop_id,GValue * value,GParamSpec * pspec)2873 goa_identity_service_object_proxy_get_property (GObject *gobject,
2874 guint prop_id,
2875 GValue *value,
2876 GParamSpec *pspec)
2877 {
2878 GoaIdentityServiceObjectProxy *object = GOA_IDENTITY_SERVICE_OBJECT_PROXY (gobject);
2879 GDBusInterface *interface;
2880
2881 switch (prop_id)
2882 {
2883 case 1:
2884 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Identity.Manager");
2885 g_value_take_object (value, interface);
2886 break;
2887
2888 case 2:
2889 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Identity");
2890 g_value_take_object (value, interface);
2891 break;
2892
2893 default:
2894 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
2895 break;
2896 }
2897 }
2898
2899 static void
goa_identity_service_object_proxy_class_init(GoaIdentityServiceObjectProxyClass * klass)2900 goa_identity_service_object_proxy_class_init (GoaIdentityServiceObjectProxyClass *klass)
2901 {
2902 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
2903
2904 gobject_class->set_property = goa_identity_service_object_proxy_set_property;
2905 gobject_class->get_property = goa_identity_service_object_proxy_get_property;
2906
2907 g_object_class_override_property (gobject_class, 1, "manager");
2908 g_object_class_override_property (gobject_class, 2, "identity");
2909 }
2910
2911 /**
2912 * goa_identity_service_object_proxy_new:
2913 * @connection: A #GDBusConnection.
2914 * @object_path: An object path.
2915 *
2916 * Creates a new proxy object.
2917 *
2918 * Returns: (transfer full): The proxy object.
2919 */
2920 GoaIdentityServiceObjectProxy *
goa_identity_service_object_proxy_new(GDBusConnection * connection,const gchar * object_path)2921 goa_identity_service_object_proxy_new (GDBusConnection *connection,
2922 const gchar *object_path)
2923 {
2924 g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
2925 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
2926 return GOA_IDENTITY_SERVICE_OBJECT_PROXY (g_object_new (GOA_IDENTITY_SERVICE_TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
2927 }
2928
2929 /**
2930 * GoaIdentityServiceObjectSkeleton:
2931 *
2932 * The #GoaIdentityServiceObjectSkeleton structure contains only private data and should only be accessed using the provided API.
2933 */
2934
2935 /**
2936 * GoaIdentityServiceObjectSkeletonClass:
2937 * @parent_class: The parent class.
2938 *
2939 * Class structure for #GoaIdentityServiceObjectSkeleton.
2940 */
2941
2942 static void
goa_identity_service_object_skeleton__goa_identity_service_object_iface_init(GoaIdentityServiceObjectIface * iface G_GNUC_UNUSED)2943 goa_identity_service_object_skeleton__goa_identity_service_object_iface_init (GoaIdentityServiceObjectIface *iface G_GNUC_UNUSED)
2944 {
2945 }
2946
2947
2948 static void
goa_identity_service_object_skeleton__g_dbus_object_iface_init(GDBusObjectIface * iface)2949 goa_identity_service_object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
2950 {
2951 iface->interface_added = goa_identity_service_object_notify;
2952 iface->interface_removed = goa_identity_service_object_notify;
2953 }
2954
G_DEFINE_TYPE_WITH_CODE(GoaIdentityServiceObjectSkeleton,goa_identity_service_object_skeleton,G_TYPE_DBUS_OBJECT_SKELETON,G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_OBJECT,goa_identity_service_object_skeleton__goa_identity_service_object_iface_init)G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT,goa_identity_service_object_skeleton__g_dbus_object_iface_init))2955 G_DEFINE_TYPE_WITH_CODE (GoaIdentityServiceObjectSkeleton, goa_identity_service_object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
2956 G_IMPLEMENT_INTERFACE (GOA_IDENTITY_SERVICE_TYPE_OBJECT, goa_identity_service_object_skeleton__goa_identity_service_object_iface_init)
2957 G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, goa_identity_service_object_skeleton__g_dbus_object_iface_init))
2958
2959 static void
2960 goa_identity_service_object_skeleton_init (GoaIdentityServiceObjectSkeleton *object G_GNUC_UNUSED)
2961 {
2962 }
2963
2964 static void
goa_identity_service_object_skeleton_set_property(GObject * gobject,guint prop_id,const GValue * value,GParamSpec * pspec)2965 goa_identity_service_object_skeleton_set_property (GObject *gobject,
2966 guint prop_id,
2967 const GValue *value,
2968 GParamSpec *pspec)
2969 {
2970 GoaIdentityServiceObjectSkeleton *object = GOA_IDENTITY_SERVICE_OBJECT_SKELETON (gobject);
2971 GDBusInterfaceSkeleton *interface;
2972
2973 switch (prop_id)
2974 {
2975 case 1:
2976 interface = g_value_get_object (value);
2977 if (interface != NULL)
2978 {
2979 g_warn_if_fail (GOA_IDENTITY_SERVICE_IS_MANAGER (interface));
2980 g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
2981 }
2982 else
2983 {
2984 g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.gnome.Identity.Manager");
2985 }
2986 break;
2987
2988 case 2:
2989 interface = g_value_get_object (value);
2990 if (interface != NULL)
2991 {
2992 g_warn_if_fail (GOA_IDENTITY_SERVICE_IS_IDENTITY (interface));
2993 g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
2994 }
2995 else
2996 {
2997 g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.gnome.Identity");
2998 }
2999 break;
3000
3001 default:
3002 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
3003 break;
3004 }
3005 }
3006
3007 static void
goa_identity_service_object_skeleton_get_property(GObject * gobject,guint prop_id,GValue * value,GParamSpec * pspec)3008 goa_identity_service_object_skeleton_get_property (GObject *gobject,
3009 guint prop_id,
3010 GValue *value,
3011 GParamSpec *pspec)
3012 {
3013 GoaIdentityServiceObjectSkeleton *object = GOA_IDENTITY_SERVICE_OBJECT_SKELETON (gobject);
3014 GDBusInterface *interface;
3015
3016 switch (prop_id)
3017 {
3018 case 1:
3019 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Identity.Manager");
3020 g_value_take_object (value, interface);
3021 break;
3022
3023 case 2:
3024 interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Identity");
3025 g_value_take_object (value, interface);
3026 break;
3027
3028 default:
3029 G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
3030 break;
3031 }
3032 }
3033
3034 static void
goa_identity_service_object_skeleton_class_init(GoaIdentityServiceObjectSkeletonClass * klass)3035 goa_identity_service_object_skeleton_class_init (GoaIdentityServiceObjectSkeletonClass *klass)
3036 {
3037 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
3038
3039 gobject_class->set_property = goa_identity_service_object_skeleton_set_property;
3040 gobject_class->get_property = goa_identity_service_object_skeleton_get_property;
3041
3042 g_object_class_override_property (gobject_class, 1, "manager");
3043 g_object_class_override_property (gobject_class, 2, "identity");
3044 }
3045
3046 /**
3047 * goa_identity_service_object_skeleton_new:
3048 * @object_path: An object path.
3049 *
3050 * Creates a new skeleton object.
3051 *
3052 * Returns: (transfer full): The skeleton object.
3053 */
3054 GoaIdentityServiceObjectSkeleton *
goa_identity_service_object_skeleton_new(const gchar * object_path)3055 goa_identity_service_object_skeleton_new (const gchar *object_path)
3056 {
3057 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
3058 return GOA_IDENTITY_SERVICE_OBJECT_SKELETON (g_object_new (GOA_IDENTITY_SERVICE_TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
3059 }
3060
3061 /**
3062 * goa_identity_service_object_skeleton_set_manager:
3063 * @object: A #GoaIdentityServiceObjectSkeleton.
3064 * @interface_: (nullable): A #GoaIdentityServiceManager or %NULL to clear the interface.
3065 *
3066 * Sets the #GoaIdentityServiceManager instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity-Manager.top_of_page">org.gnome.Identity.Manager</link> on @object.
3067 */
goa_identity_service_object_skeleton_set_manager(GoaIdentityServiceObjectSkeleton * object,GoaIdentityServiceManager * interface_)3068 void goa_identity_service_object_skeleton_set_manager (GoaIdentityServiceObjectSkeleton *object, GoaIdentityServiceManager *interface_)
3069 {
3070 g_object_set (G_OBJECT (object), "manager", interface_, NULL);
3071 }
3072
3073 /**
3074 * goa_identity_service_object_skeleton_set_identity:
3075 * @object: A #GoaIdentityServiceObjectSkeleton.
3076 * @interface_: (nullable): A #GoaIdentityServiceIdentity or %NULL to clear the interface.
3077 *
3078 * Sets the #GoaIdentityServiceIdentity instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Identity.top_of_page">org.gnome.Identity</link> on @object.
3079 */
goa_identity_service_object_skeleton_set_identity(GoaIdentityServiceObjectSkeleton * object,GoaIdentityServiceIdentity * interface_)3080 void goa_identity_service_object_skeleton_set_identity (GoaIdentityServiceObjectSkeleton *object, GoaIdentityServiceIdentity *interface_)
3081 {
3082 g_object_set (G_OBJECT (object), "identity", interface_, NULL);
3083 }
3084
3085
3086 /* ------------------------------------------------------------------------
3087 * Code for ObjectManager client
3088 * ------------------------------------------------------------------------
3089 */
3090
3091 /**
3092 * SECTION:GoaIdentityServiceObjectManagerClient
3093 * @title: GoaIdentityServiceObjectManagerClient
3094 * @short_description: Generated GDBusObjectManagerClient type
3095 *
3096 * This section contains a #GDBusObjectManagerClient that uses goa_identity_service_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
3097 */
3098
3099 /**
3100 * GoaIdentityServiceObjectManagerClient:
3101 *
3102 * The #GoaIdentityServiceObjectManagerClient structure contains only private data and should only be accessed using the provided API.
3103 */
3104
3105 /**
3106 * GoaIdentityServiceObjectManagerClientClass:
3107 * @parent_class: The parent class.
3108 *
3109 * Class structure for #GoaIdentityServiceObjectManagerClient.
3110 */
3111
G_DEFINE_TYPE(GoaIdentityServiceObjectManagerClient,goa_identity_service_object_manager_client,G_TYPE_DBUS_OBJECT_MANAGER_CLIENT)3112 G_DEFINE_TYPE (GoaIdentityServiceObjectManagerClient, goa_identity_service_object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT)
3113
3114 static void
3115 goa_identity_service_object_manager_client_init (GoaIdentityServiceObjectManagerClient *manager G_GNUC_UNUSED)
3116 {
3117 }
3118
3119 static void
goa_identity_service_object_manager_client_class_init(GoaIdentityServiceObjectManagerClientClass * klass G_GNUC_UNUSED)3120 goa_identity_service_object_manager_client_class_init (GoaIdentityServiceObjectManagerClientClass *klass G_GNUC_UNUSED)
3121 {
3122 }
3123
3124 /**
3125 * goa_identity_service_object_manager_client_get_proxy_type:
3126 * @manager: A #GDBusObjectManagerClient.
3127 * @object_path: The object path of the remote object (unused).
3128 * @interface_name: (nullable): Interface name of the remote object or %NULL to get the object proxy #GType.
3129 * @user_data: User data (unused).
3130 *
3131 * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy derived and #GDBusProxy derived types.
3132 *
3133 * Returns: A #GDBusProxy derived #GType if @interface_name is not %NULL, otherwise the #GType for #GoaIdentityServiceObjectProxy.
3134 */
3135 GType
goa_identity_service_object_manager_client_get_proxy_type(GDBusObjectManagerClient * manager G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name,gpointer user_data G_GNUC_UNUSED)3136 goa_identity_service_object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
3137 {
3138 static gsize once_init_value = 0;
3139 static GHashTable *lookup_hash;
3140 GType ret;
3141
3142 if (interface_name == NULL)
3143 return GOA_IDENTITY_SERVICE_TYPE_OBJECT_PROXY;
3144 if (g_once_init_enter (&once_init_value))
3145 {
3146 lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
3147 g_hash_table_insert (lookup_hash, (gpointer) "org.gnome.Identity.Manager", GSIZE_TO_POINTER (GOA_IDENTITY_SERVICE_TYPE_MANAGER_PROXY));
3148 g_hash_table_insert (lookup_hash, (gpointer) "org.gnome.Identity", GSIZE_TO_POINTER (GOA_IDENTITY_SERVICE_TYPE_IDENTITY_PROXY));
3149 g_once_init_leave (&once_init_value, 1);
3150 }
3151 ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
3152 if (ret == (GType) 0)
3153 ret = G_TYPE_DBUS_PROXY;
3154 return ret;
3155 }
3156
3157 /**
3158 * goa_identity_service_object_manager_client_new:
3159 * @connection: A #GDBusConnection.
3160 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3161 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3162 * @object_path: An object path.
3163 * @cancellable: (nullable): A #GCancellable or %NULL.
3164 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3165 * @user_data: User data to pass to @callback.
3166 *
3167 * Asynchronously creates #GDBusObjectManagerClient using goa_identity_service_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
3168 *
3169 * 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()).
3170 * You can then call goa_identity_service_object_manager_client_new_finish() to get the result of the operation.
3171 *
3172 * See goa_identity_service_object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
3173 */
3174 void
goa_identity_service_object_manager_client_new(GDBusConnection * connection,GDBusObjectManagerClientFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)3175 goa_identity_service_object_manager_client_new (
3176 GDBusConnection *connection,
3177 GDBusObjectManagerClientFlags flags,
3178 const gchar *name,
3179 const gchar *object_path,
3180 GCancellable *cancellable,
3181 GAsyncReadyCallback callback,
3182 gpointer user_data)
3183 {
3184 g_async_initable_new_async (GOA_IDENTITY_SERVICE_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", goa_identity_service_object_manager_client_get_proxy_type, NULL);
3185 }
3186
3187 /**
3188 * goa_identity_service_object_manager_client_new_finish:
3189 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_object_manager_client_new().
3190 * @error: Return location for error or %NULL
3191 *
3192 * Finishes an operation started with goa_identity_service_object_manager_client_new().
3193 *
3194 * Returns: (transfer full) (type GoaIdentityServiceObjectManagerClient): The constructed object manager client or %NULL if @error is set.
3195 */
3196 GDBusObjectManager *
goa_identity_service_object_manager_client_new_finish(GAsyncResult * res,GError ** error)3197 goa_identity_service_object_manager_client_new_finish (
3198 GAsyncResult *res,
3199 GError **error)
3200 {
3201 GObject *ret;
3202 GObject *source_object;
3203 source_object = g_async_result_get_source_object (res);
3204 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3205 g_object_unref (source_object);
3206 if (ret != NULL)
3207 return G_DBUS_OBJECT_MANAGER (ret);
3208 else
3209 return NULL;
3210 }
3211
3212 /**
3213 * goa_identity_service_object_manager_client_new_sync:
3214 * @connection: A #GDBusConnection.
3215 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3216 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3217 * @object_path: An object path.
3218 * @cancellable: (nullable): A #GCancellable or %NULL.
3219 * @error: Return location for error or %NULL
3220 *
3221 * Synchronously creates #GDBusObjectManagerClient using goa_identity_service_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
3222 *
3223 * The calling thread is blocked until a reply is received.
3224 *
3225 * See goa_identity_service_object_manager_client_new() for the asynchronous version of this constructor.
3226 *
3227 * Returns: (transfer full) (type GoaIdentityServiceObjectManagerClient): The constructed object manager client or %NULL if @error is set.
3228 */
3229 GDBusObjectManager *
goa_identity_service_object_manager_client_new_sync(GDBusConnection * connection,GDBusObjectManagerClientFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)3230 goa_identity_service_object_manager_client_new_sync (
3231 GDBusConnection *connection,
3232 GDBusObjectManagerClientFlags flags,
3233 const gchar *name,
3234 const gchar *object_path,
3235 GCancellable *cancellable,
3236 GError **error)
3237 {
3238 GInitable *ret;
3239 ret = g_initable_new (GOA_IDENTITY_SERVICE_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", goa_identity_service_object_manager_client_get_proxy_type, NULL);
3240 if (ret != NULL)
3241 return G_DBUS_OBJECT_MANAGER (ret);
3242 else
3243 return NULL;
3244 }
3245
3246
3247 /**
3248 * goa_identity_service_object_manager_client_new_for_bus:
3249 * @bus_type: A #GBusType.
3250 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3251 * @name: A bus name (well-known or unique).
3252 * @object_path: An object path.
3253 * @cancellable: (nullable): A #GCancellable or %NULL.
3254 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3255 * @user_data: User data to pass to @callback.
3256 *
3257 * Like goa_identity_service_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
3258 *
3259 * 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()).
3260 * You can then call goa_identity_service_object_manager_client_new_for_bus_finish() to get the result of the operation.
3261 *
3262 * See goa_identity_service_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
3263 */
3264 void
goa_identity_service_object_manager_client_new_for_bus(GBusType bus_type,GDBusObjectManagerClientFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)3265 goa_identity_service_object_manager_client_new_for_bus (
3266 GBusType bus_type,
3267 GDBusObjectManagerClientFlags flags,
3268 const gchar *name,
3269 const gchar *object_path,
3270 GCancellable *cancellable,
3271 GAsyncReadyCallback callback,
3272 gpointer user_data)
3273 {
3274 g_async_initable_new_async (GOA_IDENTITY_SERVICE_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", goa_identity_service_object_manager_client_get_proxy_type, NULL);
3275 }
3276
3277 /**
3278 * goa_identity_service_object_manager_client_new_for_bus_finish:
3279 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_identity_service_object_manager_client_new_for_bus().
3280 * @error: Return location for error or %NULL
3281 *
3282 * Finishes an operation started with goa_identity_service_object_manager_client_new_for_bus().
3283 *
3284 * Returns: (transfer full) (type GoaIdentityServiceObjectManagerClient): The constructed object manager client or %NULL if @error is set.
3285 */
3286 GDBusObjectManager *
goa_identity_service_object_manager_client_new_for_bus_finish(GAsyncResult * res,GError ** error)3287 goa_identity_service_object_manager_client_new_for_bus_finish (
3288 GAsyncResult *res,
3289 GError **error)
3290 {
3291 GObject *ret;
3292 GObject *source_object;
3293 source_object = g_async_result_get_source_object (res);
3294 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3295 g_object_unref (source_object);
3296 if (ret != NULL)
3297 return G_DBUS_OBJECT_MANAGER (ret);
3298 else
3299 return NULL;
3300 }
3301
3302 /**
3303 * goa_identity_service_object_manager_client_new_for_bus_sync:
3304 * @bus_type: A #GBusType.
3305 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
3306 * @name: A bus name (well-known or unique).
3307 * @object_path: An object path.
3308 * @cancellable: (nullable): A #GCancellable or %NULL.
3309 * @error: Return location for error or %NULL
3310 *
3311 * Like goa_identity_service_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
3312 *
3313 * The calling thread is blocked until a reply is received.
3314 *
3315 * See goa_identity_service_object_manager_client_new_for_bus() for the asynchronous version of this constructor.
3316 *
3317 * Returns: (transfer full) (type GoaIdentityServiceObjectManagerClient): The constructed object manager client or %NULL if @error is set.
3318 */
3319 GDBusObjectManager *
goa_identity_service_object_manager_client_new_for_bus_sync(GBusType bus_type,GDBusObjectManagerClientFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)3320 goa_identity_service_object_manager_client_new_for_bus_sync (
3321 GBusType bus_type,
3322 GDBusObjectManagerClientFlags flags,
3323 const gchar *name,
3324 const gchar *object_path,
3325 GCancellable *cancellable,
3326 GError **error)
3327 {
3328 GInitable *ret;
3329 ret = g_initable_new (GOA_IDENTITY_SERVICE_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", goa_identity_service_object_manager_client_get_proxy_type, NULL);
3330 if (ret != NULL)
3331 return G_DBUS_OBJECT_MANAGER (ret);
3332 else
3333 return NULL;
3334 }
3335
3336
3337