GCC Code Coverage Report


Directory: ./
File: _build/panels/system/remote-desktop/org.gnome.RemoteDesktop.c
Date: 2024-05-04 07:58:27
Exec Total Coverage
Lines: 0 2250 0.0%
Functions: 0 334 0.0%
Branches: 0 810 0.0%

Line Branch Exec Source
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.RemoteDesktop.h"
14
15 #include <string.h>
16 #ifdef G_OS_UNIX
17 # include <gio/gunixfdlist.h>
18 #endif
19
20 #ifdef G_ENABLE_DEBUG
21 #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
22 #define g_marshal_value_peek_char(v) g_value_get_schar (v)
23 #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
24 #define g_marshal_value_peek_int(v) g_value_get_int (v)
25 #define g_marshal_value_peek_uint(v) g_value_get_uint (v)
26 #define g_marshal_value_peek_long(v) g_value_get_long (v)
27 #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
28 #define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
29 #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
30 #define g_marshal_value_peek_enum(v) g_value_get_enum (v)
31 #define g_marshal_value_peek_flags(v) g_value_get_flags (v)
32 #define g_marshal_value_peek_float(v) g_value_get_float (v)
33 #define g_marshal_value_peek_double(v) g_value_get_double (v)
34 #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
35 #define g_marshal_value_peek_param(v) g_value_get_param (v)
36 #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
37 #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
38 #define g_marshal_value_peek_object(v) g_value_get_object (v)
39 #define g_marshal_value_peek_variant(v) g_value_get_variant (v)
40 #else /* !G_ENABLE_DEBUG */
41 /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
42 * Do not access GValues directly in your code. Instead, use the
43 * g_value_get_*() functions
44 */
45 #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
46 #define g_marshal_value_peek_char(v) (v)->data[0].v_int
47 #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
48 #define g_marshal_value_peek_int(v) (v)->data[0].v_int
49 #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
50 #define g_marshal_value_peek_long(v) (v)->data[0].v_long
51 #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
52 #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
53 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
54 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long
55 #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
56 #define g_marshal_value_peek_float(v) (v)->data[0].v_float
57 #define g_marshal_value_peek_double(v) (v)->data[0].v_double
58 #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
59 #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
60 #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
61 #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
62 #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
63 #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer
64 #endif /* !G_ENABLE_DEBUG */
65
66 typedef struct
67 {
68 GDBusArgInfo parent_struct;
69 gboolean use_gvariant;
70 } _ExtendedGDBusArgInfo;
71
72 typedef struct
73 {
74 GDBusMethodInfo parent_struct;
75 const gchar *signal_name;
76 gboolean pass_fdlist;
77 } _ExtendedGDBusMethodInfo;
78
79 typedef struct
80 {
81 GDBusSignalInfo parent_struct;
82 const gchar *signal_name;
83 } _ExtendedGDBusSignalInfo;
84
85 typedef struct
86 {
87 GDBusPropertyInfo parent_struct;
88 const gchar *hyphen_name;
89 guint use_gvariant : 1;
90 guint emits_changed_signal : 1;
91 } _ExtendedGDBusPropertyInfo;
92
93 typedef struct
94 {
95 GDBusInterfaceInfo parent_struct;
96 const gchar *hyphen_name;
97 } _ExtendedGDBusInterfaceInfo;
98
99 typedef struct
100 {
101 const _ExtendedGDBusPropertyInfo *info;
102 guint prop_id;
103 GValue orig_value; /* the value before the change */
104 } ChangedProperty;
105
106 static void
107 _changed_property_free (ChangedProperty *data)
108 {
109 g_value_unset (&data->orig_value);
110 g_free (data);
111 }
112
113 static gboolean
114 _g_strv_equal0 (gchar **a, gchar **b)
115 {
116 gboolean ret = FALSE;
117 guint n;
118 if (a == NULL && b == NULL)
119 {
120 ret = TRUE;
121 goto out;
122 }
123 if (a == NULL || b == NULL)
124 goto out;
125 if (g_strv_length (a) != g_strv_length (b))
126 goto out;
127 for (n = 0; a[n] != NULL; n++)
128 if (g_strcmp0 (a[n], b[n]) != 0)
129 goto out;
130 ret = TRUE;
131 out:
132 return ret;
133 }
134
135 static gboolean
136 _g_variant_equal0 (GVariant *a, GVariant *b)
137 {
138 gboolean ret = FALSE;
139 if (a == NULL && b == NULL)
140 {
141 ret = TRUE;
142 goto out;
143 }
144 if (a == NULL || b == NULL)
145 goto out;
146 ret = g_variant_equal (a, b);
147 out:
148 return ret;
149 }
150
151 G_GNUC_UNUSED static gboolean
152 _g_value_equal (const GValue *a, const GValue *b)
153 {
154 gboolean ret = FALSE;
155 g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
156 switch (G_VALUE_TYPE (a))
157 {
158 case G_TYPE_BOOLEAN:
159 ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
160 break;
161 case G_TYPE_UCHAR:
162 ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
163 break;
164 case G_TYPE_INT:
165 ret = (g_value_get_int (a) == g_value_get_int (b));
166 break;
167 case G_TYPE_UINT:
168 ret = (g_value_get_uint (a) == g_value_get_uint (b));
169 break;
170 case G_TYPE_INT64:
171 ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
172 break;
173 case G_TYPE_UINT64:
174 ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
175 break;
176 case G_TYPE_DOUBLE:
177 {
178 /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
179 gdouble da = g_value_get_double (a);
180 gdouble db = g_value_get_double (b);
181 ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
182 }
183 break;
184 case G_TYPE_STRING:
185 ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
186 break;
187 case G_TYPE_VARIANT:
188 ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
189 break;
190 default:
191 if (G_VALUE_TYPE (a) == G_TYPE_STRV)
192 ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
193 else
194 g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
195 break;
196 }
197 return ret;
198 }
199
200 static void
201 _g_dbus_codegen_marshal_BOOLEAN__OBJECT (
202 GClosure *closure,
203 GValue *return_value,
204 unsigned int n_param_values,
205 const GValue *param_values,
206 void *invocation_hint G_GNUC_UNUSED,
207 void *marshal_data)
208 {
209 typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectFunc)
210 (void *data1,
211 GDBusMethodInvocation *arg_method_invocation,
212 void *data2);
213 _GDbusCodegenMarshalBoolean_ObjectFunc callback;
214 GCClosure *cc = (GCClosure*) closure;
215 void *data1, *data2;
216 gboolean v_return;
217
218 g_return_if_fail (return_value != NULL);
219 g_return_if_fail (n_param_values == 2);
220
221 if (G_CCLOSURE_SWAP_DATA (closure))
222 {
223 data1 = closure->data;
224 data2 = g_value_peek_pointer (param_values + 0);
225 }
226 else
227 {
228 data1 = g_value_peek_pointer (param_values + 0);
229 data2 = closure->data;
230 }
231
232 callback = (_GDbusCodegenMarshalBoolean_ObjectFunc)
233 (marshal_data ? marshal_data : cc->callback);
234
235 v_return =
236 callback (data1,
237 g_marshal_value_peek_object (param_values + 1),
238 data2);
239
240 g_value_set_boolean (return_value, v_return);
241 }
242
243 static void
244 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_VARIANT (
245 GClosure *closure,
246 GValue *return_value,
247 unsigned int n_param_values,
248 const GValue *param_values,
249 void *invocation_hint G_GNUC_UNUSED,
250 void *marshal_data)
251 {
252 typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectVariantFunc)
253 (void *data1,
254 GDBusMethodInvocation *arg_method_invocation,
255 GVariant *arg_credentials,
256 void *data2);
257 _GDbusCodegenMarshalBoolean_ObjectVariantFunc callback;
258 GCClosure *cc = (GCClosure*) closure;
259 void *data1, *data2;
260 gboolean v_return;
261
262 g_return_if_fail (return_value != NULL);
263 g_return_if_fail (n_param_values == 3);
264
265 if (G_CCLOSURE_SWAP_DATA (closure))
266 {
267 data1 = closure->data;
268 data2 = g_value_peek_pointer (param_values + 0);
269 }
270 else
271 {
272 data1 = g_value_peek_pointer (param_values + 0);
273 data2 = closure->data;
274 }
275
276 callback = (_GDbusCodegenMarshalBoolean_ObjectVariantFunc)
277 (marshal_data ? marshal_data : cc->callback);
278
279 v_return =
280 callback (data1,
281 g_marshal_value_peek_object (param_values + 1),
282 g_marshal_value_peek_variant (param_values + 2),
283 data2);
284
285 g_value_set_boolean (return_value, v_return);
286 }
287
288 static void
289 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_OBJECT (
290 GClosure *closure,
291 GValue *return_value,
292 unsigned int n_param_values,
293 const GValue *param_values,
294 void *invocation_hint G_GNUC_UNUSED,
295 void *marshal_data)
296 {
297 typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectObjectFunc)
298 (void *data1,
299 GUnixFDList *arg_fd_list,
300 GDBusMethodInvocation *arg_method_invocation,
301 void *data2);
302 _GDbusCodegenMarshalBoolean_ObjectObjectFunc callback;
303 GCClosure *cc = (GCClosure*) closure;
304 void *data1, *data2;
305 gboolean v_return;
306
307 g_return_if_fail (return_value != NULL);
308 g_return_if_fail (n_param_values == 3);
309
310 if (G_CCLOSURE_SWAP_DATA (closure))
311 {
312 data1 = closure->data;
313 data2 = g_value_peek_pointer (param_values + 0);
314 }
315 else
316 {
317 data1 = g_value_peek_pointer (param_values + 0);
318 data2 = closure->data;
319 }
320
321 callback = (_GDbusCodegenMarshalBoolean_ObjectObjectFunc)
322 (marshal_data ? marshal_data : cc->callback);
323
324 v_return =
325 callback (data1,
326 g_marshal_value_peek_object (param_values + 1),
327 g_marshal_value_peek_object (param_values + 2),
328 data2);
329
330 g_value_set_boolean (return_value, v_return);
331 }
332
333 static void
334 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_OBJECT_VARIANT_VARIANT (
335 GClosure *closure,
336 GValue *return_value,
337 unsigned int n_param_values,
338 const GValue *param_values,
339 void *invocation_hint G_GNUC_UNUSED,
340 void *marshal_data)
341 {
342 typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectObjectVariantVariantFunc)
343 (void *data1,
344 GUnixFDList *arg_fd_list,
345 GDBusMethodInvocation *arg_method_invocation,
346 GVariant *arg_Certificate,
347 GVariant *arg_PrivateKey,
348 void *data2);
349 _GDbusCodegenMarshalBoolean_ObjectObjectVariantVariantFunc callback;
350 GCClosure *cc = (GCClosure*) closure;
351 void *data1, *data2;
352 gboolean v_return;
353
354 g_return_if_fail (return_value != NULL);
355 g_return_if_fail (n_param_values == 5);
356
357 if (G_CCLOSURE_SWAP_DATA (closure))
358 {
359 data1 = closure->data;
360 data2 = g_value_peek_pointer (param_values + 0);
361 }
362 else
363 {
364 data1 = g_value_peek_pointer (param_values + 0);
365 data2 = closure->data;
366 }
367
368 callback = (_GDbusCodegenMarshalBoolean_ObjectObjectVariantVariantFunc)
369 (marshal_data ? marshal_data : cc->callback);
370
371 v_return =
372 callback (data1,
373 g_marshal_value_peek_object (param_values + 1),
374 g_marshal_value_peek_object (param_values + 2),
375 g_marshal_value_peek_variant (param_values + 3),
376 g_marshal_value_peek_variant (param_values + 4),
377 data2);
378
379 g_value_set_boolean (return_value, v_return);
380 }
381
382 static void
383 _g_dbus_codegen_marshal_VOID__STRING_STRING_STRING (
384 GClosure *closure,
385 GValue *return_value G_GNUC_UNUSED,
386 unsigned int n_param_values,
387 const GValue *param_values,
388 void *invocation_hint G_GNUC_UNUSED,
389 void *marshal_data)
390 {
391 typedef void (*_GDbusCodegenMarshalVoid_StringStringStringFunc)
392 (void *data1,
393 const gchar *arg_routing_token,
394 const gchar *arg_username,
395 const gchar *arg_password,
396 void *data2);
397 _GDbusCodegenMarshalVoid_StringStringStringFunc callback;
398 GCClosure *cc = (GCClosure*) closure;
399 void *data1, *data2;
400
401 g_return_if_fail (n_param_values == 4);
402
403 if (G_CCLOSURE_SWAP_DATA (closure))
404 {
405 data1 = closure->data;
406 data2 = g_value_peek_pointer (param_values + 0);
407 }
408 else
409 {
410 data1 = g_value_peek_pointer (param_values + 0);
411 data2 = closure->data;
412 }
413
414 callback = (_GDbusCodegenMarshalVoid_StringStringStringFunc)
415 (marshal_data ? marshal_data : cc->callback);
416
417 callback (data1,
418 g_marshal_value_peek_string (param_values + 1),
419 g_marshal_value_peek_string (param_values + 2),
420 g_marshal_value_peek_string (param_values + 3),
421 data2);
422 }
423
424 static void
425 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_STRING (
426 GClosure *closure,
427 GValue *return_value,
428 unsigned int n_param_values,
429 const GValue *param_values,
430 void *invocation_hint G_GNUC_UNUSED,
431 void *marshal_data)
432 {
433 typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectStringStringFunc)
434 (void *data1,
435 GDBusMethodInvocation *arg_method_invocation,
436 const gchar *arg_username,
437 const gchar *arg_password,
438 void *data2);
439 _GDbusCodegenMarshalBoolean_ObjectStringStringFunc callback;
440 GCClosure *cc = (GCClosure*) closure;
441 void *data1, *data2;
442 gboolean v_return;
443
444 g_return_if_fail (return_value != NULL);
445 g_return_if_fail (n_param_values == 4);
446
447 if (G_CCLOSURE_SWAP_DATA (closure))
448 {
449 data1 = closure->data;
450 data2 = g_value_peek_pointer (param_values + 0);
451 }
452 else
453 {
454 data1 = g_value_peek_pointer (param_values + 0);
455 data2 = closure->data;
456 }
457
458 callback = (_GDbusCodegenMarshalBoolean_ObjectStringStringFunc)
459 (marshal_data ? marshal_data : cc->callback);
460
461 v_return =
462 callback (data1,
463 g_marshal_value_peek_object (param_values + 1),
464 g_marshal_value_peek_string (param_values + 2),
465 g_marshal_value_peek_string (param_values + 3),
466 data2);
467
468 g_value_set_boolean (return_value, v_return);
469 }
470
471 /* ------------------------------------------------------------------------
472 * Code for interface org.gnome.RemoteDesktop
473 * ------------------------------------------------------------------------
474 */
475
476 /**
477 * SECTION:GsdRemoteDesktop
478 * @title: GsdRemoteDesktop
479 * @short_description: Generated C code for the org.gnome.RemoteDesktop D-Bus interface
480 *
481 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-RemoteDesktop.top_of_page">org.gnome.RemoteDesktop</link> D-Bus interface in C.
482 */
483
484 /* ---- Introspection data for org.gnome.RemoteDesktop ---- */
485
486 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_property_info_runtime_mode =
487 {
488 {
489 -1,
490 (gchar *) "RuntimeMode",
491 (gchar *) "s",
492 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
493 NULL
494 },
495 "runtime-mode",
496 FALSE,
497 TRUE
498 };
499
500 static const GDBusPropertyInfo * const _gsd_remote_desktop_property_info_pointers[] =
501 {
502 &_gsd_remote_desktop_property_info_runtime_mode.parent_struct,
503 NULL
504 };
505
506 static const _ExtendedGDBusInterfaceInfo _gsd_remote_desktop_interface_info =
507 {
508 {
509 -1,
510 (gchar *) "org.gnome.RemoteDesktop",
511 NULL,
512 NULL,
513 (GDBusPropertyInfo **) &_gsd_remote_desktop_property_info_pointers,
514 NULL
515 },
516 "remote-desktop",
517 };
518
519
520 /**
521 * gsd_remote_desktop_interface_info:
522 *
523 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-RemoteDesktop.top_of_page">org.gnome.RemoteDesktop</link> D-Bus interface.
524 *
525 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
526 */
527 GDBusInterfaceInfo *
528 gsd_remote_desktop_interface_info (void)
529 {
530 return (GDBusInterfaceInfo *) &_gsd_remote_desktop_interface_info.parent_struct;
531 }
532
533 /**
534 * gsd_remote_desktop_override_properties:
535 * @klass: The class structure for a #GObject derived class.
536 * @property_id_begin: The property id to assign to the first overridden property.
537 *
538 * Overrides all #GObject properties in the #GsdRemoteDesktop interface for a concrete class.
539 * The properties are overridden in the order they are defined.
540 *
541 * Returns: The last property id.
542 */
543 guint
544 gsd_remote_desktop_override_properties (GObjectClass *klass, guint property_id_begin)
545 {
546 g_object_class_override_property (klass, property_id_begin++, "runtime-mode");
547 return property_id_begin - 1;
548 }
549
550
551
552 /**
553 * GsdRemoteDesktop:
554 *
555 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop.top_of_page">org.gnome.RemoteDesktop</link>.
556 */
557
558 /**
559 * GsdRemoteDesktopIface:
560 * @parent_iface: The parent interface.
561 * @get_runtime_mode: Getter for the #GsdRemoteDesktop:runtime-mode property.
562 *
563 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop.top_of_page">org.gnome.RemoteDesktop</link>.
564 */
565
566 typedef GsdRemoteDesktopIface GsdRemoteDesktopInterface;
567 G_DEFINE_INTERFACE (GsdRemoteDesktop, gsd_remote_desktop, G_TYPE_OBJECT)
568
569 static void
570 gsd_remote_desktop_default_init (GsdRemoteDesktopIface *iface)
571 {
572 /* GObject properties for D-Bus properties: */
573 /**
574 * GsdRemoteDesktop:runtime-mode:
575 *
576 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop.RuntimeMode">"RuntimeMode"</link>.
577 *
578 * 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.
579 */
580 g_object_interface_install_property (iface,
581 g_param_spec_string ("runtime-mode", "RuntimeMode", "RuntimeMode", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
582 }
583
584 /**
585 * gsd_remote_desktop_get_runtime_mode: (skip)
586 * @object: A #GsdRemoteDesktop.
587 *
588 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop.RuntimeMode">"RuntimeMode"</link> D-Bus property.
589 *
590 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
591 *
592 * 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 gsd_remote_desktop_dup_runtime_mode() if on another thread.
593 *
594 * 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.
595 */
596 const gchar *
597 gsd_remote_desktop_get_runtime_mode (GsdRemoteDesktop *object)
598 {
599 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP (object), NULL);
600
601 return GSD_REMOTE_DESKTOP_GET_IFACE (object)->get_runtime_mode (object);
602 }
603
604 /**
605 * gsd_remote_desktop_dup_runtime_mode: (skip)
606 * @object: A #GsdRemoteDesktop.
607 *
608 * Gets a copy of the <link linkend="gdbus-property-org-gnome-RemoteDesktop.RuntimeMode">"RuntimeMode"</link> D-Bus property.
609 *
610 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
611 *
612 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
613 */
614 gchar *
615 gsd_remote_desktop_dup_runtime_mode (GsdRemoteDesktop *object)
616 {
617 gchar *value;
618 g_object_get (G_OBJECT (object), "runtime-mode", &value, NULL);
619 return value;
620 }
621
622 /**
623 * gsd_remote_desktop_set_runtime_mode: (skip)
624 * @object: A #GsdRemoteDesktop.
625 * @value: The value to set.
626 *
627 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop.RuntimeMode">"RuntimeMode"</link> D-Bus property to @value.
628 *
629 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
630 */
631 void
632 gsd_remote_desktop_set_runtime_mode (GsdRemoteDesktop *object, const gchar *value)
633 {
634 g_object_set (G_OBJECT (object), "runtime-mode", value, NULL);
635 }
636
637 /* ------------------------------------------------------------------------ */
638
639 /**
640 * GsdRemoteDesktopProxy:
641 *
642 * The #GsdRemoteDesktopProxy structure contains only private data and should only be accessed using the provided API.
643 */
644
645 /**
646 * GsdRemoteDesktopProxyClass:
647 * @parent_class: The parent class.
648 *
649 * Class structure for #GsdRemoteDesktopProxy.
650 */
651
652 struct _GsdRemoteDesktopProxyPrivate
653 {
654 GData *qdata;
655 };
656
657 static void gsd_remote_desktop_proxy_iface_init (GsdRemoteDesktopIface *iface);
658
659 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
660 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopProxy, gsd_remote_desktop_proxy, G_TYPE_DBUS_PROXY,
661 G_ADD_PRIVATE (GsdRemoteDesktopProxy)
662 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP, gsd_remote_desktop_proxy_iface_init))
663
664 #else
665 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopProxy, gsd_remote_desktop_proxy, G_TYPE_DBUS_PROXY,
666 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP, gsd_remote_desktop_proxy_iface_init))
667
668 #endif
669 static void
670 gsd_remote_desktop_proxy_finalize (GObject *object)
671 {
672 GsdRemoteDesktopProxy *proxy = GSD_REMOTE_DESKTOP_PROXY (object);
673 g_datalist_clear (&proxy->priv->qdata);
674 G_OBJECT_CLASS (gsd_remote_desktop_proxy_parent_class)->finalize (object);
675 }
676
677 static void
678 gsd_remote_desktop_proxy_get_property (GObject *object,
679 guint prop_id,
680 GValue *value,
681 GParamSpec *pspec G_GNUC_UNUSED)
682 {
683 const _ExtendedGDBusPropertyInfo *info;
684 GVariant *variant;
685 g_assert (prop_id != 0 && prop_id - 1 < 1);
686 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_property_info_pointers[prop_id - 1];
687 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
688 if (info->use_gvariant)
689 {
690 g_value_set_variant (value, variant);
691 }
692 else
693 {
694 if (variant != NULL)
695 g_dbus_gvariant_to_gvalue (variant, value);
696 }
697 if (variant != NULL)
698 g_variant_unref (variant);
699 }
700
701 static void
702 gsd_remote_desktop_proxy_set_property_cb (GDBusProxy *proxy,
703 GAsyncResult *res,
704 gpointer user_data)
705 {
706 const _ExtendedGDBusPropertyInfo *info = user_data;
707 GError *error;
708 GVariant *_ret;
709 error = NULL;
710 _ret = g_dbus_proxy_call_finish (proxy, res, &error);
711 if (!_ret)
712 {
713 g_warning ("Error setting property '%s' on interface org.gnome.RemoteDesktop: %s (%s, %d)",
714 info->parent_struct.name,
715 error->message, g_quark_to_string (error->domain), error->code);
716 g_error_free (error);
717 }
718 else
719 {
720 g_variant_unref (_ret);
721 }
722 }
723
724 static void
725 gsd_remote_desktop_proxy_set_property (GObject *object,
726 guint prop_id,
727 const GValue *value,
728 GParamSpec *pspec G_GNUC_UNUSED)
729 {
730 const _ExtendedGDBusPropertyInfo *info;
731 GVariant *variant;
732 g_assert (prop_id != 0 && prop_id - 1 < 1);
733 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_property_info_pointers[prop_id - 1];
734 variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
735 g_dbus_proxy_call (G_DBUS_PROXY (object),
736 "org.freedesktop.DBus.Properties.Set",
737 g_variant_new ("(ssv)", "org.gnome.RemoteDesktop", info->parent_struct.name, variant),
738 G_DBUS_CALL_FLAGS_NONE,
739 -1,
740 NULL, (GAsyncReadyCallback) gsd_remote_desktop_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
741 g_variant_unref (variant);
742 }
743
744 static void
745 gsd_remote_desktop_proxy_g_signal (GDBusProxy *proxy,
746 const gchar *sender_name G_GNUC_UNUSED,
747 const gchar *signal_name,
748 GVariant *parameters)
749 {
750 _ExtendedGDBusSignalInfo *info;
751 GVariantIter iter;
752 GVariant *child;
753 GValue *paramv;
754 gsize num_params;
755 gsize n;
756 guint signal_id;
757 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsd_remote_desktop_interface_info.parent_struct, signal_name);
758 if (info == NULL)
759 return;
760 num_params = g_variant_n_children (parameters);
761 paramv = g_new0 (GValue, num_params + 1);
762 g_value_init (&paramv[0], GSD_TYPE_REMOTE_DESKTOP);
763 g_value_set_object (&paramv[0], proxy);
764 g_variant_iter_init (&iter, parameters);
765 n = 1;
766 while ((child = g_variant_iter_next_value (&iter)) != NULL)
767 {
768 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
769 if (arg_info->use_gvariant)
770 {
771 g_value_init (&paramv[n], G_TYPE_VARIANT);
772 g_value_set_variant (&paramv[n], child);
773 n++;
774 }
775 else
776 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
777 g_variant_unref (child);
778 }
779 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP);
780 g_signal_emitv (paramv, signal_id, 0, NULL);
781 for (n = 0; n < num_params + 1; n++)
782 g_value_unset (&paramv[n]);
783 g_free (paramv);
784 }
785
786 static void
787 gsd_remote_desktop_proxy_g_properties_changed (GDBusProxy *_proxy,
788 GVariant *changed_properties,
789 const gchar *const *invalidated_properties)
790 {
791 GsdRemoteDesktopProxy *proxy = GSD_REMOTE_DESKTOP_PROXY (_proxy);
792 guint n;
793 const gchar *key;
794 GVariantIter *iter;
795 _ExtendedGDBusPropertyInfo *info;
796 g_variant_get (changed_properties, "a{sv}", &iter);
797 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
798 {
799 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_interface_info.parent_struct, key);
800 g_datalist_remove_data (&proxy->priv->qdata, key);
801 if (info != NULL)
802 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
803 }
804 g_variant_iter_free (iter);
805 for (n = 0; invalidated_properties[n] != NULL; n++)
806 {
807 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_interface_info.parent_struct, invalidated_properties[n]);
808 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
809 if (info != NULL)
810 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
811 }
812 }
813
814 static const gchar *
815 gsd_remote_desktop_proxy_get_runtime_mode (GsdRemoteDesktop *object)
816 {
817 GsdRemoteDesktopProxy *proxy = GSD_REMOTE_DESKTOP_PROXY (object);
818 GVariant *variant;
819 const gchar *value = NULL;
820 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "RuntimeMode");
821 if (variant != NULL)
822 {
823 value = g_variant_get_string (variant, NULL);
824 g_variant_unref (variant);
825 }
826 return value;
827 }
828
829 static void
830 gsd_remote_desktop_proxy_init (GsdRemoteDesktopProxy *proxy)
831 {
832 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
833 proxy->priv = gsd_remote_desktop_proxy_get_instance_private (proxy);
834 #else
835 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_TYPE_REMOTE_DESKTOP_PROXY, GsdRemoteDesktopProxyPrivate);
836 #endif
837
838 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsd_remote_desktop_interface_info ());
839 }
840
841 static void
842 gsd_remote_desktop_proxy_class_init (GsdRemoteDesktopProxyClass *klass)
843 {
844 GObjectClass *gobject_class;
845 GDBusProxyClass *proxy_class;
846
847 gobject_class = G_OBJECT_CLASS (klass);
848 gobject_class->finalize = gsd_remote_desktop_proxy_finalize;
849 gobject_class->get_property = gsd_remote_desktop_proxy_get_property;
850 gobject_class->set_property = gsd_remote_desktop_proxy_set_property;
851
852 proxy_class = G_DBUS_PROXY_CLASS (klass);
853 proxy_class->g_signal = gsd_remote_desktop_proxy_g_signal;
854 proxy_class->g_properties_changed = gsd_remote_desktop_proxy_g_properties_changed;
855
856 gsd_remote_desktop_override_properties (gobject_class, 1);
857
858 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
859 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopProxyPrivate));
860 #endif
861 }
862
863 static void
864 gsd_remote_desktop_proxy_iface_init (GsdRemoteDesktopIface *iface)
865 {
866 iface->get_runtime_mode = gsd_remote_desktop_proxy_get_runtime_mode;
867 }
868
869 /**
870 * gsd_remote_desktop_proxy_new:
871 * @connection: A #GDBusConnection.
872 * @flags: Flags from the #GDBusProxyFlags enumeration.
873 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
874 * @object_path: An object path.
875 * @cancellable: (nullable): A #GCancellable or %NULL.
876 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
877 * @user_data: User data to pass to @callback.
878 *
879 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop.top_of_page">org.gnome.RemoteDesktop</link>. See g_dbus_proxy_new() for more details.
880 *
881 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
882 * You can then call gsd_remote_desktop_proxy_new_finish() to get the result of the operation.
883 *
884 * See gsd_remote_desktop_proxy_new_sync() for the synchronous, blocking version of this constructor.
885 */
886 void
887 gsd_remote_desktop_proxy_new (
888 GDBusConnection *connection,
889 GDBusProxyFlags flags,
890 const gchar *name,
891 const gchar *object_path,
892 GCancellable *cancellable,
893 GAsyncReadyCallback callback,
894 gpointer user_data)
895 {
896 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_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.RemoteDesktop", NULL);
897 }
898
899 /**
900 * gsd_remote_desktop_proxy_new_finish:
901 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_proxy_new().
902 * @error: Return location for error or %NULL
903 *
904 * Finishes an operation started with gsd_remote_desktop_proxy_new().
905 *
906 * Returns: (transfer full) (type GsdRemoteDesktopProxy): The constructed proxy object or %NULL if @error is set.
907 */
908 GsdRemoteDesktop *
909 gsd_remote_desktop_proxy_new_finish (
910 GAsyncResult *res,
911 GError **error)
912 {
913 GObject *ret;
914 GObject *source_object;
915 source_object = g_async_result_get_source_object (res);
916 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
917 g_object_unref (source_object);
918 if (ret != NULL)
919 return GSD_REMOTE_DESKTOP (ret);
920 else
921 return NULL;
922 }
923
924 /**
925 * gsd_remote_desktop_proxy_new_sync:
926 * @connection: A #GDBusConnection.
927 * @flags: Flags from the #GDBusProxyFlags enumeration.
928 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
929 * @object_path: An object path.
930 * @cancellable: (nullable): A #GCancellable or %NULL.
931 * @error: Return location for error or %NULL
932 *
933 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop.top_of_page">org.gnome.RemoteDesktop</link>. See g_dbus_proxy_new_sync() for more details.
934 *
935 * The calling thread is blocked until a reply is received.
936 *
937 * See gsd_remote_desktop_proxy_new() for the asynchronous version of this constructor.
938 *
939 * Returns: (transfer full) (type GsdRemoteDesktopProxy): The constructed proxy object or %NULL if @error is set.
940 */
941 GsdRemoteDesktop *
942 gsd_remote_desktop_proxy_new_sync (
943 GDBusConnection *connection,
944 GDBusProxyFlags flags,
945 const gchar *name,
946 const gchar *object_path,
947 GCancellable *cancellable,
948 GError **error)
949 {
950 GInitable *ret;
951 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop", NULL);
952 if (ret != NULL)
953 return GSD_REMOTE_DESKTOP (ret);
954 else
955 return NULL;
956 }
957
958
959 /**
960 * gsd_remote_desktop_proxy_new_for_bus:
961 * @bus_type: A #GBusType.
962 * @flags: Flags from the #GDBusProxyFlags enumeration.
963 * @name: A bus name (well-known or unique).
964 * @object_path: An object path.
965 * @cancellable: (nullable): A #GCancellable or %NULL.
966 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
967 * @user_data: User data to pass to @callback.
968 *
969 * Like gsd_remote_desktop_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
970 *
971 * 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()).
972 * You can then call gsd_remote_desktop_proxy_new_for_bus_finish() to get the result of the operation.
973 *
974 * See gsd_remote_desktop_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
975 */
976 void
977 gsd_remote_desktop_proxy_new_for_bus (
978 GBusType bus_type,
979 GDBusProxyFlags flags,
980 const gchar *name,
981 const gchar *object_path,
982 GCancellable *cancellable,
983 GAsyncReadyCallback callback,
984 gpointer user_data)
985 {
986 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_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.RemoteDesktop", NULL);
987 }
988
989 /**
990 * gsd_remote_desktop_proxy_new_for_bus_finish:
991 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_proxy_new_for_bus().
992 * @error: Return location for error or %NULL
993 *
994 * Finishes an operation started with gsd_remote_desktop_proxy_new_for_bus().
995 *
996 * Returns: (transfer full) (type GsdRemoteDesktopProxy): The constructed proxy object or %NULL if @error is set.
997 */
998 GsdRemoteDesktop *
999 gsd_remote_desktop_proxy_new_for_bus_finish (
1000 GAsyncResult *res,
1001 GError **error)
1002 {
1003 GObject *ret;
1004 GObject *source_object;
1005 source_object = g_async_result_get_source_object (res);
1006 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1007 g_object_unref (source_object);
1008 if (ret != NULL)
1009 return GSD_REMOTE_DESKTOP (ret);
1010 else
1011 return NULL;
1012 }
1013
1014 /**
1015 * gsd_remote_desktop_proxy_new_for_bus_sync:
1016 * @bus_type: A #GBusType.
1017 * @flags: Flags from the #GDBusProxyFlags enumeration.
1018 * @name: A bus name (well-known or unique).
1019 * @object_path: An object path.
1020 * @cancellable: (nullable): A #GCancellable or %NULL.
1021 * @error: Return location for error or %NULL
1022 *
1023 * Like gsd_remote_desktop_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1024 *
1025 * The calling thread is blocked until a reply is received.
1026 *
1027 * See gsd_remote_desktop_proxy_new_for_bus() for the asynchronous version of this constructor.
1028 *
1029 * Returns: (transfer full) (type GsdRemoteDesktopProxy): The constructed proxy object or %NULL if @error is set.
1030 */
1031 GsdRemoteDesktop *
1032 gsd_remote_desktop_proxy_new_for_bus_sync (
1033 GBusType bus_type,
1034 GDBusProxyFlags flags,
1035 const gchar *name,
1036 const gchar *object_path,
1037 GCancellable *cancellable,
1038 GError **error)
1039 {
1040 GInitable *ret;
1041 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop", NULL);
1042 if (ret != NULL)
1043 return GSD_REMOTE_DESKTOP (ret);
1044 else
1045 return NULL;
1046 }
1047
1048
1049 /* ------------------------------------------------------------------------ */
1050
1051 /**
1052 * GsdRemoteDesktopSkeleton:
1053 *
1054 * The #GsdRemoteDesktopSkeleton structure contains only private data and should only be accessed using the provided API.
1055 */
1056
1057 /**
1058 * GsdRemoteDesktopSkeletonClass:
1059 * @parent_class: The parent class.
1060 *
1061 * Class structure for #GsdRemoteDesktopSkeleton.
1062 */
1063
1064 struct _GsdRemoteDesktopSkeletonPrivate
1065 {
1066 GValue *properties;
1067 GList *changed_properties;
1068 GSource *changed_properties_idle_source;
1069 GMainContext *context;
1070 GMutex lock;
1071 };
1072
1073 static void
1074 _gsd_remote_desktop_skeleton_handle_method_call (
1075 GDBusConnection *connection G_GNUC_UNUSED,
1076 const gchar *sender G_GNUC_UNUSED,
1077 const gchar *object_path G_GNUC_UNUSED,
1078 const gchar *interface_name,
1079 const gchar *method_name,
1080 GVariant *parameters,
1081 GDBusMethodInvocation *invocation,
1082 gpointer user_data)
1083 {
1084 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (user_data);
1085 _ExtendedGDBusMethodInfo *info;
1086 GVariantIter iter;
1087 GVariant *child;
1088 GValue *paramv;
1089 gsize num_params;
1090 guint num_extra;
1091 gsize n;
1092 guint signal_id;
1093 GValue return_value = G_VALUE_INIT;
1094 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1095 g_assert (info != NULL);
1096 num_params = g_variant_n_children (parameters);
1097 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
1098 n = 0;
1099 g_value_init (&paramv[n], GSD_TYPE_REMOTE_DESKTOP);
1100 g_value_set_object (&paramv[n++], skeleton);
1101 g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1102 g_value_set_object (&paramv[n++], invocation);
1103 if (info->pass_fdlist)
1104 {
1105 #ifdef G_OS_UNIX
1106 g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
1107 g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1108 #else
1109 g_assert_not_reached ();
1110 #endif
1111 }
1112 g_variant_iter_init (&iter, parameters);
1113 while ((child = g_variant_iter_next_value (&iter)) != NULL)
1114 {
1115 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1116 if (arg_info->use_gvariant)
1117 {
1118 g_value_init (&paramv[n], G_TYPE_VARIANT);
1119 g_value_set_variant (&paramv[n], child);
1120 n++;
1121 }
1122 else
1123 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1124 g_variant_unref (child);
1125 }
1126 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP);
1127 g_value_init (&return_value, G_TYPE_BOOLEAN);
1128 g_signal_emitv (paramv, signal_id, 0, &return_value);
1129 if (!g_value_get_boolean (&return_value))
1130 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);
1131 g_value_unset (&return_value);
1132 for (n = 0; n < num_params + num_extra; n++)
1133 g_value_unset (&paramv[n]);
1134 g_free (paramv);
1135 }
1136
1137 static GVariant *
1138 _gsd_remote_desktop_skeleton_handle_get_property (
1139 GDBusConnection *connection G_GNUC_UNUSED,
1140 const gchar *sender G_GNUC_UNUSED,
1141 const gchar *object_path G_GNUC_UNUSED,
1142 const gchar *interface_name G_GNUC_UNUSED,
1143 const gchar *property_name,
1144 GError **error,
1145 gpointer user_data)
1146 {
1147 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (user_data);
1148 GValue value = G_VALUE_INIT;
1149 GParamSpec *pspec;
1150 _ExtendedGDBusPropertyInfo *info;
1151 GVariant *ret;
1152 ret = NULL;
1153 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_interface_info.parent_struct, property_name);
1154 g_assert (info != NULL);
1155 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1156 if (pspec == NULL)
1157 {
1158 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1159 }
1160 else
1161 {
1162 g_value_init (&value, pspec->value_type);
1163 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1164 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
1165 g_value_unset (&value);
1166 }
1167 return ret;
1168 }
1169
1170 static gboolean
1171 _gsd_remote_desktop_skeleton_handle_set_property (
1172 GDBusConnection *connection G_GNUC_UNUSED,
1173 const gchar *sender G_GNUC_UNUSED,
1174 const gchar *object_path G_GNUC_UNUSED,
1175 const gchar *interface_name G_GNUC_UNUSED,
1176 const gchar *property_name,
1177 GVariant *variant,
1178 GError **error,
1179 gpointer user_data)
1180 {
1181 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (user_data);
1182 GValue value = G_VALUE_INIT;
1183 GParamSpec *pspec;
1184 _ExtendedGDBusPropertyInfo *info;
1185 gboolean ret;
1186 ret = FALSE;
1187 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_interface_info.parent_struct, property_name);
1188 g_assert (info != NULL);
1189 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1190 if (pspec == NULL)
1191 {
1192 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1193 }
1194 else
1195 {
1196 if (info->use_gvariant)
1197 g_value_set_variant (&value, variant);
1198 else
1199 g_dbus_gvariant_to_gvalue (variant, &value);
1200 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1201 g_value_unset (&value);
1202 ret = TRUE;
1203 }
1204 return ret;
1205 }
1206
1207 static const GDBusInterfaceVTable _gsd_remote_desktop_skeleton_vtable =
1208 {
1209 _gsd_remote_desktop_skeleton_handle_method_call,
1210 _gsd_remote_desktop_skeleton_handle_get_property,
1211 _gsd_remote_desktop_skeleton_handle_set_property,
1212 {NULL}
1213 };
1214
1215 static GDBusInterfaceInfo *
1216 gsd_remote_desktop_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1217 {
1218 return gsd_remote_desktop_interface_info ();
1219 }
1220
1221 static GDBusInterfaceVTable *
1222 gsd_remote_desktop_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1223 {
1224 return (GDBusInterfaceVTable *) &_gsd_remote_desktop_skeleton_vtable;
1225 }
1226
1227 static GVariant *
1228 gsd_remote_desktop_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1229 {
1230 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (_skeleton);
1231
1232 GVariantBuilder builder;
1233 guint n;
1234 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1235 if (_gsd_remote_desktop_interface_info.parent_struct.properties == NULL)
1236 goto out;
1237 for (n = 0; _gsd_remote_desktop_interface_info.parent_struct.properties[n] != NULL; n++)
1238 {
1239 GDBusPropertyInfo *info = _gsd_remote_desktop_interface_info.parent_struct.properties[n];
1240 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1241 {
1242 GVariant *value;
1243 value = _gsd_remote_desktop_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.RemoteDesktop", info->name, NULL, skeleton);
1244 if (value != NULL)
1245 {
1246 g_variant_take_ref (value);
1247 g_variant_builder_add (&builder, "{sv}", info->name, value);
1248 g_variant_unref (value);
1249 }
1250 }
1251 }
1252 out:
1253 return g_variant_builder_end (&builder);
1254 }
1255
1256 static gboolean _gsd_remote_desktop_emit_changed (gpointer user_data);
1257
1258 static void
1259 gsd_remote_desktop_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1260 {
1261 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (_skeleton);
1262 gboolean emit_changed = FALSE;
1263
1264 g_mutex_lock (&skeleton->priv->lock);
1265 if (skeleton->priv->changed_properties_idle_source != NULL)
1266 {
1267 g_source_destroy (skeleton->priv->changed_properties_idle_source);
1268 skeleton->priv->changed_properties_idle_source = NULL;
1269 emit_changed = TRUE;
1270 }
1271 g_mutex_unlock (&skeleton->priv->lock);
1272
1273 if (emit_changed)
1274 _gsd_remote_desktop_emit_changed (skeleton);
1275 }
1276
1277 static void gsd_remote_desktop_skeleton_iface_init (GsdRemoteDesktopIface *iface);
1278 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1279 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopSkeleton, gsd_remote_desktop_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1280 G_ADD_PRIVATE (GsdRemoteDesktopSkeleton)
1281 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP, gsd_remote_desktop_skeleton_iface_init))
1282
1283 #else
1284 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopSkeleton, gsd_remote_desktop_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1285 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP, gsd_remote_desktop_skeleton_iface_init))
1286
1287 #endif
1288 static void
1289 gsd_remote_desktop_skeleton_finalize (GObject *object)
1290 {
1291 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (object);
1292 guint n;
1293 for (n = 0; n < 1; n++)
1294 g_value_unset (&skeleton->priv->properties[n]);
1295 g_free (skeleton->priv->properties);
1296 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1297 if (skeleton->priv->changed_properties_idle_source != NULL)
1298 g_source_destroy (skeleton->priv->changed_properties_idle_source);
1299 g_main_context_unref (skeleton->priv->context);
1300 g_mutex_clear (&skeleton->priv->lock);
1301 G_OBJECT_CLASS (gsd_remote_desktop_skeleton_parent_class)->finalize (object);
1302 }
1303
1304 static void
1305 gsd_remote_desktop_skeleton_get_property (GObject *object,
1306 guint prop_id,
1307 GValue *value,
1308 GParamSpec *pspec G_GNUC_UNUSED)
1309 {
1310 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (object);
1311 g_assert (prop_id != 0 && prop_id - 1 < 1);
1312 g_mutex_lock (&skeleton->priv->lock);
1313 g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
1314 g_mutex_unlock (&skeleton->priv->lock);
1315 }
1316
1317 static gboolean
1318 _gsd_remote_desktop_emit_changed (gpointer user_data)
1319 {
1320 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (user_data);
1321 GList *l;
1322 GVariantBuilder builder;
1323 GVariantBuilder invalidated_builder;
1324 guint num_changes;
1325
1326 g_mutex_lock (&skeleton->priv->lock);
1327 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1328 g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
1329 for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
1330 {
1331 ChangedProperty *cp = l->data;
1332 GVariant *variant;
1333 const GValue *cur_value;
1334
1335 cur_value = &skeleton->priv->properties[cp->prop_id - 1];
1336 if (!_g_value_equal (cur_value, &cp->orig_value))
1337 {
1338 variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
1339 g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
1340 g_variant_unref (variant);
1341 num_changes++;
1342 }
1343 }
1344 if (num_changes > 0)
1345 {
1346 GList *connections, *ll;
1347 GVariant *signal_variant;
1348 signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.gnome.RemoteDesktop",
1349 &builder, &invalidated_builder));
1350 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
1351 for (ll = connections; ll != NULL; ll = ll->next)
1352 {
1353 GDBusConnection *connection = ll->data;
1354
1355 g_dbus_connection_emit_signal (connection,
1356 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
1357 "org.freedesktop.DBus.Properties",
1358 "PropertiesChanged",
1359 signal_variant,
1360 NULL);
1361 }
1362 g_variant_unref (signal_variant);
1363 g_list_free_full (connections, g_object_unref);
1364 }
1365 else
1366 {
1367 g_variant_builder_clear (&builder);
1368 g_variant_builder_clear (&invalidated_builder);
1369 }
1370 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1371 skeleton->priv->changed_properties = NULL;
1372 skeleton->priv->changed_properties_idle_source = NULL;
1373 g_mutex_unlock (&skeleton->priv->lock);
1374 return FALSE;
1375 }
1376
1377 static void
1378 _gsd_remote_desktop_schedule_emit_changed (GsdRemoteDesktopSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
1379 {
1380 ChangedProperty *cp;
1381 GList *l;
1382 cp = NULL;
1383 for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
1384 {
1385 ChangedProperty *i_cp = l->data;
1386 if (i_cp->info == info)
1387 {
1388 cp = i_cp;
1389 break;
1390 }
1391 }
1392 if (cp == NULL)
1393 {
1394 cp = g_new0 (ChangedProperty, 1);
1395 cp->prop_id = prop_id;
1396 cp->info = info;
1397 skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
1398 g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
1399 g_value_copy (orig_value, &cp->orig_value);
1400 }
1401 }
1402
1403 static void
1404 gsd_remote_desktop_skeleton_notify (GObject *object,
1405 GParamSpec *pspec G_GNUC_UNUSED)
1406 {
1407 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (object);
1408 g_mutex_lock (&skeleton->priv->lock);
1409 if (skeleton->priv->changed_properties != NULL &&
1410 skeleton->priv->changed_properties_idle_source == NULL)
1411 {
1412 skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
1413 g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
1414 g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gsd_remote_desktop_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
1415 g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gsd_remote_desktop_emit_changed");
1416 g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
1417 g_source_unref (skeleton->priv->changed_properties_idle_source);
1418 }
1419 g_mutex_unlock (&skeleton->priv->lock);
1420 }
1421
1422 static void
1423 gsd_remote_desktop_skeleton_set_property (GObject *object,
1424 guint prop_id,
1425 const GValue *value,
1426 GParamSpec *pspec)
1427 {
1428 const _ExtendedGDBusPropertyInfo *info;
1429 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (object);
1430 g_assert (prop_id != 0 && prop_id - 1 < 1);
1431 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_property_info_pointers[prop_id - 1];
1432 g_mutex_lock (&skeleton->priv->lock);
1433 g_object_freeze_notify (object);
1434 if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
1435 {
1436 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
1437 info->emits_changed_signal)
1438 _gsd_remote_desktop_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
1439 g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
1440 g_object_notify_by_pspec (object, pspec);
1441 }
1442 g_mutex_unlock (&skeleton->priv->lock);
1443 g_object_thaw_notify (object);
1444 }
1445
1446 static void
1447 gsd_remote_desktop_skeleton_init (GsdRemoteDesktopSkeleton *skeleton)
1448 {
1449 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1450 skeleton->priv = gsd_remote_desktop_skeleton_get_instance_private (skeleton);
1451 #else
1452 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_TYPE_REMOTE_DESKTOP_SKELETON, GsdRemoteDesktopSkeletonPrivate);
1453 #endif
1454
1455 g_mutex_init (&skeleton->priv->lock);
1456 skeleton->priv->context = g_main_context_ref_thread_default ();
1457 skeleton->priv->properties = g_new0 (GValue, 1);
1458 g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
1459 }
1460
1461 static const gchar *
1462 gsd_remote_desktop_skeleton_get_runtime_mode (GsdRemoteDesktop *object)
1463 {
1464 GsdRemoteDesktopSkeleton *skeleton = GSD_REMOTE_DESKTOP_SKELETON (object);
1465 const gchar *value;
1466 g_mutex_lock (&skeleton->priv->lock);
1467 value = g_marshal_value_peek_string (&(skeleton->priv->properties[0]));
1468 g_mutex_unlock (&skeleton->priv->lock);
1469 return value;
1470 }
1471
1472 static void
1473 gsd_remote_desktop_skeleton_class_init (GsdRemoteDesktopSkeletonClass *klass)
1474 {
1475 GObjectClass *gobject_class;
1476 GDBusInterfaceSkeletonClass *skeleton_class;
1477
1478 gobject_class = G_OBJECT_CLASS (klass);
1479 gobject_class->finalize = gsd_remote_desktop_skeleton_finalize;
1480 gobject_class->get_property = gsd_remote_desktop_skeleton_get_property;
1481 gobject_class->set_property = gsd_remote_desktop_skeleton_set_property;
1482 gobject_class->notify = gsd_remote_desktop_skeleton_notify;
1483
1484
1485 gsd_remote_desktop_override_properties (gobject_class, 1);
1486
1487 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1488 skeleton_class->get_info = gsd_remote_desktop_skeleton_dbus_interface_get_info;
1489 skeleton_class->get_properties = gsd_remote_desktop_skeleton_dbus_interface_get_properties;
1490 skeleton_class->flush = gsd_remote_desktop_skeleton_dbus_interface_flush;
1491 skeleton_class->get_vtable = gsd_remote_desktop_skeleton_dbus_interface_get_vtable;
1492
1493 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1494 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopSkeletonPrivate));
1495 #endif
1496 }
1497
1498 static void
1499 gsd_remote_desktop_skeleton_iface_init (GsdRemoteDesktopIface *iface)
1500 {
1501 iface->get_runtime_mode = gsd_remote_desktop_skeleton_get_runtime_mode;
1502 }
1503
1504 /**
1505 * gsd_remote_desktop_skeleton_new:
1506 *
1507 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop.top_of_page">org.gnome.RemoteDesktop</link>.
1508 *
1509 * Returns: (transfer full) (type GsdRemoteDesktopSkeleton): The skeleton object.
1510 */
1511 GsdRemoteDesktop *
1512 gsd_remote_desktop_skeleton_new (void)
1513 {
1514 return GSD_REMOTE_DESKTOP (g_object_new (GSD_TYPE_REMOTE_DESKTOP_SKELETON, NULL));
1515 }
1516
1517 /* ------------------------------------------------------------------------
1518 * Code for interface org.gnome.RemoteDesktop.Rdp.Server
1519 * ------------------------------------------------------------------------
1520 */
1521
1522 /**
1523 * SECTION:GsdRemoteDesktopRdpServer
1524 * @title: GsdRemoteDesktopRdpServer
1525 * @short_description: Generated C code for the org.gnome.RemoteDesktop.Rdp.Server D-Bus interface
1526 *
1527 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Server.top_of_page">org.gnome.RemoteDesktop.Rdp.Server</link> D-Bus interface in C.
1528 */
1529
1530 enum
1531 {
1532 GSD__REMOTE_DESKTOP_RDP_SERVER_BINDING,
1533 };
1534
1535 static unsigned GSD__REMOTE_DESKTOP_RDP_SERVER_SIGNALS[1] = { 0 };
1536
1537 /* ---- Introspection data for org.gnome.RemoteDesktop.Rdp.Server ---- */
1538
1539 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_server_method_info_enable =
1540 {
1541 {
1542 -1,
1543 (gchar *) "Enable",
1544 NULL,
1545 NULL,
1546 NULL
1547 },
1548 "handle-enable",
1549 FALSE
1550 };
1551
1552 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_server_method_info_disable =
1553 {
1554 {
1555 -1,
1556 (gchar *) "Disable",
1557 NULL,
1558 NULL,
1559 NULL
1560 },
1561 "handle-disable",
1562 FALSE
1563 };
1564
1565 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_server_method_info_get_credentials_OUT_ARG_credentials =
1566 {
1567 {
1568 -1,
1569 (gchar *) "credentials",
1570 (gchar *) "a{sv}",
1571 NULL
1572 },
1573 FALSE
1574 };
1575
1576 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_server_method_info_get_credentials_OUT_ARG_pointers[] =
1577 {
1578 &_gsd_remote_desktop_rdp_server_method_info_get_credentials_OUT_ARG_credentials.parent_struct,
1579 NULL
1580 };
1581
1582 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_server_method_info_get_credentials =
1583 {
1584 {
1585 -1,
1586 (gchar *) "GetCredentials",
1587 NULL,
1588 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_server_method_info_get_credentials_OUT_ARG_pointers,
1589 NULL
1590 },
1591 "handle-get-credentials",
1592 FALSE
1593 };
1594
1595 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_server_method_info_set_credentials_IN_ARG_credentials =
1596 {
1597 {
1598 -1,
1599 (gchar *) "credentials",
1600 (gchar *) "a{sv}",
1601 NULL
1602 },
1603 FALSE
1604 };
1605
1606 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_server_method_info_set_credentials_IN_ARG_pointers[] =
1607 {
1608 &_gsd_remote_desktop_rdp_server_method_info_set_credentials_IN_ARG_credentials.parent_struct,
1609 NULL
1610 };
1611
1612 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_server_method_info_set_credentials =
1613 {
1614 {
1615 -1,
1616 (gchar *) "SetCredentials",
1617 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_server_method_info_set_credentials_IN_ARG_pointers,
1618 NULL,
1619 NULL
1620 },
1621 "handle-set-credentials",
1622 FALSE
1623 };
1624
1625 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_server_method_info_export_certificate_OUT_ARG_Certificate =
1626 {
1627 {
1628 -1,
1629 (gchar *) "Certificate",
1630 (gchar *) "(sh)",
1631 NULL
1632 },
1633 FALSE
1634 };
1635
1636 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_server_method_info_export_certificate_OUT_ARG_PrivateKey =
1637 {
1638 {
1639 -1,
1640 (gchar *) "PrivateKey",
1641 (gchar *) "(sh)",
1642 NULL
1643 },
1644 FALSE
1645 };
1646
1647 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_server_method_info_export_certificate_OUT_ARG_pointers[] =
1648 {
1649 &_gsd_remote_desktop_rdp_server_method_info_export_certificate_OUT_ARG_Certificate.parent_struct,
1650 &_gsd_remote_desktop_rdp_server_method_info_export_certificate_OUT_ARG_PrivateKey.parent_struct,
1651 NULL
1652 };
1653
1654 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_server_method_info_export_certificate =
1655 {
1656 {
1657 -1,
1658 (gchar *) "ExportCertificate",
1659 NULL,
1660 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_server_method_info_export_certificate_OUT_ARG_pointers,
1661 NULL
1662 },
1663 "handle-export-certificate",
1664 TRUE
1665 };
1666
1667 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_server_method_info_import_certificate_IN_ARG_Certificate =
1668 {
1669 {
1670 -1,
1671 (gchar *) "Certificate",
1672 (gchar *) "(sh)",
1673 NULL
1674 },
1675 FALSE
1676 };
1677
1678 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_server_method_info_import_certificate_IN_ARG_PrivateKey =
1679 {
1680 {
1681 -1,
1682 (gchar *) "PrivateKey",
1683 (gchar *) "(sh)",
1684 NULL
1685 },
1686 FALSE
1687 };
1688
1689 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_server_method_info_import_certificate_IN_ARG_pointers[] =
1690 {
1691 &_gsd_remote_desktop_rdp_server_method_info_import_certificate_IN_ARG_Certificate.parent_struct,
1692 &_gsd_remote_desktop_rdp_server_method_info_import_certificate_IN_ARG_PrivateKey.parent_struct,
1693 NULL
1694 };
1695
1696 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_server_method_info_import_certificate =
1697 {
1698 {
1699 -1,
1700 (gchar *) "ImportCertificate",
1701 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_server_method_info_import_certificate_IN_ARG_pointers,
1702 NULL,
1703 NULL
1704 },
1705 "handle-import-certificate",
1706 TRUE
1707 };
1708
1709 static const GDBusMethodInfo * const _gsd_remote_desktop_rdp_server_method_info_pointers[] =
1710 {
1711 &_gsd_remote_desktop_rdp_server_method_info_enable.parent_struct,
1712 &_gsd_remote_desktop_rdp_server_method_info_disable.parent_struct,
1713 &_gsd_remote_desktop_rdp_server_method_info_get_credentials.parent_struct,
1714 &_gsd_remote_desktop_rdp_server_method_info_set_credentials.parent_struct,
1715 &_gsd_remote_desktop_rdp_server_method_info_export_certificate.parent_struct,
1716 &_gsd_remote_desktop_rdp_server_method_info_import_certificate.parent_struct,
1717 NULL
1718 };
1719
1720 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_server_signal_info_binding_ARG_port =
1721 {
1722 {
1723 -1,
1724 (gchar *) "port",
1725 (gchar *) "i",
1726 NULL
1727 },
1728 FALSE
1729 };
1730
1731 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_server_signal_info_binding_ARG_pointers[] =
1732 {
1733 &_gsd_remote_desktop_rdp_server_signal_info_binding_ARG_port.parent_struct,
1734 NULL
1735 };
1736
1737 static const _ExtendedGDBusSignalInfo _gsd_remote_desktop_rdp_server_signal_info_binding =
1738 {
1739 {
1740 -1,
1741 (gchar *) "Binding",
1742 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_server_signal_info_binding_ARG_pointers,
1743 NULL
1744 },
1745 "binding"
1746 };
1747
1748 static const GDBusSignalInfo * const _gsd_remote_desktop_rdp_server_signal_info_pointers[] =
1749 {
1750 &_gsd_remote_desktop_rdp_server_signal_info_binding.parent_struct,
1751 NULL
1752 };
1753
1754 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_rdp_server_property_info_enabled =
1755 {
1756 {
1757 -1,
1758 (gchar *) "Enabled",
1759 (gchar *) "b",
1760 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1761 NULL
1762 },
1763 "enabled",
1764 FALSE,
1765 TRUE
1766 };
1767
1768 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_rdp_server_property_info_port =
1769 {
1770 {
1771 -1,
1772 (gchar *) "Port",
1773 (gchar *) "i",
1774 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1775 NULL
1776 },
1777 "port",
1778 FALSE,
1779 TRUE
1780 };
1781
1782 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_rdp_server_property_info_negotiate_port =
1783 {
1784 {
1785 -1,
1786 (gchar *) "NegotiatePort",
1787 (gchar *) "b",
1788 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1789 NULL
1790 },
1791 "negotiate-port",
1792 FALSE,
1793 TRUE
1794 };
1795
1796 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_rdp_server_property_info_tls_cert =
1797 {
1798 {
1799 -1,
1800 (gchar *) "TlsCert",
1801 (gchar *) "s",
1802 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1803 NULL
1804 },
1805 "tls-cert",
1806 FALSE,
1807 TRUE
1808 };
1809
1810 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_rdp_server_property_info_tls_fingerprint =
1811 {
1812 {
1813 -1,
1814 (gchar *) "TlsFingerprint",
1815 (gchar *) "s",
1816 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1817 NULL
1818 },
1819 "tls-fingerprint",
1820 FALSE,
1821 TRUE
1822 };
1823
1824 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_rdp_server_property_info_tls_key =
1825 {
1826 {
1827 -1,
1828 (gchar *) "TlsKey",
1829 (gchar *) "s",
1830 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1831 NULL
1832 },
1833 "tls-key",
1834 FALSE,
1835 TRUE
1836 };
1837
1838 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_rdp_server_property_info_view_only =
1839 {
1840 {
1841 -1,
1842 (gchar *) "ViewOnly",
1843 (gchar *) "b",
1844 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
1845 NULL
1846 },
1847 "view-only",
1848 FALSE,
1849 TRUE
1850 };
1851
1852 static const GDBusPropertyInfo * const _gsd_remote_desktop_rdp_server_property_info_pointers[] =
1853 {
1854 &_gsd_remote_desktop_rdp_server_property_info_enabled.parent_struct,
1855 &_gsd_remote_desktop_rdp_server_property_info_port.parent_struct,
1856 &_gsd_remote_desktop_rdp_server_property_info_negotiate_port.parent_struct,
1857 &_gsd_remote_desktop_rdp_server_property_info_tls_cert.parent_struct,
1858 &_gsd_remote_desktop_rdp_server_property_info_tls_fingerprint.parent_struct,
1859 &_gsd_remote_desktop_rdp_server_property_info_tls_key.parent_struct,
1860 &_gsd_remote_desktop_rdp_server_property_info_view_only.parent_struct,
1861 NULL
1862 };
1863
1864 static const _ExtendedGDBusInterfaceInfo _gsd_remote_desktop_rdp_server_interface_info =
1865 {
1866 {
1867 -1,
1868 (gchar *) "org.gnome.RemoteDesktop.Rdp.Server",
1869 (GDBusMethodInfo **) &_gsd_remote_desktop_rdp_server_method_info_pointers,
1870 (GDBusSignalInfo **) &_gsd_remote_desktop_rdp_server_signal_info_pointers,
1871 (GDBusPropertyInfo **) &_gsd_remote_desktop_rdp_server_property_info_pointers,
1872 NULL
1873 },
1874 "remote-desktop-rdp-server",
1875 };
1876
1877
1878 /**
1879 * gsd_remote_desktop_rdp_server_interface_info:
1880 *
1881 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Server.top_of_page">org.gnome.RemoteDesktop.Rdp.Server</link> D-Bus interface.
1882 *
1883 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
1884 */
1885 GDBusInterfaceInfo *
1886 gsd_remote_desktop_rdp_server_interface_info (void)
1887 {
1888 return (GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_server_interface_info.parent_struct;
1889 }
1890
1891 /**
1892 * gsd_remote_desktop_rdp_server_override_properties:
1893 * @klass: The class structure for a #GObject derived class.
1894 * @property_id_begin: The property id to assign to the first overridden property.
1895 *
1896 * Overrides all #GObject properties in the #GsdRemoteDesktopRdpServer interface for a concrete class.
1897 * The properties are overridden in the order they are defined.
1898 *
1899 * Returns: The last property id.
1900 */
1901 guint
1902 gsd_remote_desktop_rdp_server_override_properties (GObjectClass *klass, guint property_id_begin)
1903 {
1904 g_object_class_override_property (klass, property_id_begin++, "enabled");
1905 g_object_class_override_property (klass, property_id_begin++, "port");
1906 g_object_class_override_property (klass, property_id_begin++, "negotiate-port");
1907 g_object_class_override_property (klass, property_id_begin++, "tls-cert");
1908 g_object_class_override_property (klass, property_id_begin++, "tls-fingerprint");
1909 g_object_class_override_property (klass, property_id_begin++, "tls-key");
1910 g_object_class_override_property (klass, property_id_begin++, "view-only");
1911 return property_id_begin - 1;
1912 }
1913
1914
1915 inline static void
1916 gsd_remote_desktop_rdp_server_signal_marshal_binding (
1917 GClosure *closure,
1918 GValue *return_value,
1919 unsigned int n_param_values,
1920 const GValue *param_values,
1921 void *invocation_hint,
1922 void *marshal_data)
1923 {
1924 g_cclosure_marshal_VOID__INT (closure,
1925 return_value, n_param_values, param_values, invocation_hint, marshal_data);
1926 }
1927
1928 inline static void
1929 gsd_remote_desktop_rdp_server_method_marshal_enable (
1930 GClosure *closure,
1931 GValue *return_value,
1932 unsigned int n_param_values,
1933 const GValue *param_values,
1934 void *invocation_hint,
1935 void *marshal_data)
1936 {
1937 _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
1938 return_value, n_param_values, param_values, invocation_hint, marshal_data);
1939 }
1940
1941 inline static void
1942 gsd_remote_desktop_rdp_server_method_marshal_disable (
1943 GClosure *closure,
1944 GValue *return_value,
1945 unsigned int n_param_values,
1946 const GValue *param_values,
1947 void *invocation_hint,
1948 void *marshal_data)
1949 {
1950 _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
1951 return_value, n_param_values, param_values, invocation_hint, marshal_data);
1952 }
1953
1954 inline static void
1955 gsd_remote_desktop_rdp_server_method_marshal_get_credentials (
1956 GClosure *closure,
1957 GValue *return_value,
1958 unsigned int n_param_values,
1959 const GValue *param_values,
1960 void *invocation_hint,
1961 void *marshal_data)
1962 {
1963 _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
1964 return_value, n_param_values, param_values, invocation_hint, marshal_data);
1965 }
1966
1967 inline static void
1968 gsd_remote_desktop_rdp_server_method_marshal_set_credentials (
1969 GClosure *closure,
1970 GValue *return_value,
1971 unsigned int n_param_values,
1972 const GValue *param_values,
1973 void *invocation_hint,
1974 void *marshal_data)
1975 {
1976 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_VARIANT (closure,
1977 return_value, n_param_values, param_values, invocation_hint, marshal_data);
1978 }
1979
1980 inline static void
1981 gsd_remote_desktop_rdp_server_method_marshal_export_certificate (
1982 GClosure *closure,
1983 GValue *return_value,
1984 unsigned int n_param_values,
1985 const GValue *param_values,
1986 void *invocation_hint,
1987 void *marshal_data)
1988 {
1989 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_OBJECT (closure,
1990 return_value, n_param_values, param_values, invocation_hint, marshal_data);
1991 }
1992
1993 inline static void
1994 gsd_remote_desktop_rdp_server_method_marshal_import_certificate (
1995 GClosure *closure,
1996 GValue *return_value,
1997 unsigned int n_param_values,
1998 const GValue *param_values,
1999 void *invocation_hint,
2000 void *marshal_data)
2001 {
2002 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_OBJECT_VARIANT_VARIANT (closure,
2003 return_value, n_param_values, param_values, invocation_hint, marshal_data);
2004 }
2005
2006
2007 /**
2008 * GsdRemoteDesktopRdpServer:
2009 *
2010 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Server.top_of_page">org.gnome.RemoteDesktop.Rdp.Server</link>.
2011 */
2012
2013 /**
2014 * GsdRemoteDesktopRdpServerIface:
2015 * @parent_iface: The parent interface.
2016 * @handle_disable: Handler for the #GsdRemoteDesktopRdpServer::handle-disable signal.
2017 * @handle_enable: Handler for the #GsdRemoteDesktopRdpServer::handle-enable signal.
2018 * @handle_export_certificate: Handler for the #GsdRemoteDesktopRdpServer::handle-export-certificate signal.
2019 * @handle_get_credentials: Handler for the #GsdRemoteDesktopRdpServer::handle-get-credentials signal.
2020 * @handle_import_certificate: Handler for the #GsdRemoteDesktopRdpServer::handle-import-certificate signal.
2021 * @handle_set_credentials: Handler for the #GsdRemoteDesktopRdpServer::handle-set-credentials signal.
2022 * @get_enabled: Getter for the #GsdRemoteDesktopRdpServer:enabled property.
2023 * @get_negotiate_port: Getter for the #GsdRemoteDesktopRdpServer:negotiate-port property.
2024 * @get_port: Getter for the #GsdRemoteDesktopRdpServer:port property.
2025 * @get_tls_cert: Getter for the #GsdRemoteDesktopRdpServer:tls-cert property.
2026 * @get_tls_fingerprint: Getter for the #GsdRemoteDesktopRdpServer:tls-fingerprint property.
2027 * @get_tls_key: Getter for the #GsdRemoteDesktopRdpServer:tls-key property.
2028 * @get_view_only: Getter for the #GsdRemoteDesktopRdpServer:view-only property.
2029 * @binding: Handler for the #GsdRemoteDesktopRdpServer::binding signal.
2030 *
2031 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Server.top_of_page">org.gnome.RemoteDesktop.Rdp.Server</link>.
2032 */
2033
2034 typedef GsdRemoteDesktopRdpServerIface GsdRemoteDesktopRdpServerInterface;
2035 G_DEFINE_INTERFACE (GsdRemoteDesktopRdpServer, gsd_remote_desktop_rdp_server, G_TYPE_OBJECT)
2036
2037 static void
2038 gsd_remote_desktop_rdp_server_default_init (GsdRemoteDesktopRdpServerIface *iface)
2039 {
2040 /* GObject signals for incoming D-Bus method calls: */
2041 /**
2042 * GsdRemoteDesktopRdpServer::handle-enable:
2043 * @object: A #GsdRemoteDesktopRdpServer.
2044 * @invocation: A #GDBusMethodInvocation.
2045 *
2046 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.Enable">Enable()</link> D-Bus method.
2047 *
2048 * 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 gsd_remote_desktop_rdp_server_complete_enable() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
2049 *
2050 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
2051 */
2052 g_signal_new ("handle-enable",
2053 G_TYPE_FROM_INTERFACE (iface),
2054 G_SIGNAL_RUN_LAST,
2055 G_STRUCT_OFFSET (GsdRemoteDesktopRdpServerIface, handle_enable),
2056 g_signal_accumulator_true_handled,
2057 NULL,
2058 gsd_remote_desktop_rdp_server_method_marshal_enable,
2059 G_TYPE_BOOLEAN,
2060 1,
2061 G_TYPE_DBUS_METHOD_INVOCATION);
2062
2063 /**
2064 * GsdRemoteDesktopRdpServer::handle-disable:
2065 * @object: A #GsdRemoteDesktopRdpServer.
2066 * @invocation: A #GDBusMethodInvocation.
2067 *
2068 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.Disable">Disable()</link> D-Bus method.
2069 *
2070 * 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 gsd_remote_desktop_rdp_server_complete_disable() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
2071 *
2072 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
2073 */
2074 g_signal_new ("handle-disable",
2075 G_TYPE_FROM_INTERFACE (iface),
2076 G_SIGNAL_RUN_LAST,
2077 G_STRUCT_OFFSET (GsdRemoteDesktopRdpServerIface, handle_disable),
2078 g_signal_accumulator_true_handled,
2079 NULL,
2080 gsd_remote_desktop_rdp_server_method_marshal_disable,
2081 G_TYPE_BOOLEAN,
2082 1,
2083 G_TYPE_DBUS_METHOD_INVOCATION);
2084
2085 /**
2086 * GsdRemoteDesktopRdpServer::handle-get-credentials:
2087 * @object: A #GsdRemoteDesktopRdpServer.
2088 * @invocation: A #GDBusMethodInvocation.
2089 *
2090 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.GetCredentials">GetCredentials()</link> D-Bus method.
2091 *
2092 * 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 gsd_remote_desktop_rdp_server_complete_get_credentials() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
2093 *
2094 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
2095 */
2096 g_signal_new ("handle-get-credentials",
2097 G_TYPE_FROM_INTERFACE (iface),
2098 G_SIGNAL_RUN_LAST,
2099 G_STRUCT_OFFSET (GsdRemoteDesktopRdpServerIface, handle_get_credentials),
2100 g_signal_accumulator_true_handled,
2101 NULL,
2102 gsd_remote_desktop_rdp_server_method_marshal_get_credentials,
2103 G_TYPE_BOOLEAN,
2104 1,
2105 G_TYPE_DBUS_METHOD_INVOCATION);
2106
2107 /**
2108 * GsdRemoteDesktopRdpServer::handle-set-credentials:
2109 * @object: A #GsdRemoteDesktopRdpServer.
2110 * @invocation: A #GDBusMethodInvocation.
2111 * @arg_credentials: Argument passed by remote caller.
2112 *
2113 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.SetCredentials">SetCredentials()</link> D-Bus method.
2114 *
2115 * 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 gsd_remote_desktop_rdp_server_complete_set_credentials() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
2116 *
2117 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
2118 */
2119 g_signal_new ("handle-set-credentials",
2120 G_TYPE_FROM_INTERFACE (iface),
2121 G_SIGNAL_RUN_LAST,
2122 G_STRUCT_OFFSET (GsdRemoteDesktopRdpServerIface, handle_set_credentials),
2123 g_signal_accumulator_true_handled,
2124 NULL,
2125 gsd_remote_desktop_rdp_server_method_marshal_set_credentials,
2126 G_TYPE_BOOLEAN,
2127 2,
2128 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT);
2129
2130 /**
2131 * GsdRemoteDesktopRdpServer::handle-export-certificate:
2132 * @object: A #GsdRemoteDesktopRdpServer.
2133 * @invocation: A #GDBusMethodInvocation.
2134 * @fd_list: (nullable): A #GUnixFDList or %NULL.
2135 *
2136 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.ExportCertificate">ExportCertificate()</link> D-Bus method.
2137 *
2138 * 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 gsd_remote_desktop_rdp_server_complete_export_certificate() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
2139 *
2140 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
2141 */
2142 g_signal_new ("handle-export-certificate",
2143 G_TYPE_FROM_INTERFACE (iface),
2144 G_SIGNAL_RUN_LAST,
2145 G_STRUCT_OFFSET (GsdRemoteDesktopRdpServerIface, handle_export_certificate),
2146 g_signal_accumulator_true_handled,
2147 NULL,
2148 gsd_remote_desktop_rdp_server_method_marshal_export_certificate,
2149 G_TYPE_BOOLEAN,
2150 2,
2151 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST);
2152
2153 /**
2154 * GsdRemoteDesktopRdpServer::handle-import-certificate:
2155 * @object: A #GsdRemoteDesktopRdpServer.
2156 * @invocation: A #GDBusMethodInvocation.
2157 * @fd_list: (nullable): A #GUnixFDList or %NULL.
2158 * @arg_Certificate: Argument passed by remote caller.
2159 * @arg_PrivateKey: Argument passed by remote caller.
2160 *
2161 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.ImportCertificate">ImportCertificate()</link> D-Bus method.
2162 *
2163 * 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 gsd_remote_desktop_rdp_server_complete_import_certificate() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
2164 *
2165 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
2166 */
2167 g_signal_new ("handle-import-certificate",
2168 G_TYPE_FROM_INTERFACE (iface),
2169 G_SIGNAL_RUN_LAST,
2170 G_STRUCT_OFFSET (GsdRemoteDesktopRdpServerIface, handle_import_certificate),
2171 g_signal_accumulator_true_handled,
2172 NULL,
2173 gsd_remote_desktop_rdp_server_method_marshal_import_certificate,
2174 G_TYPE_BOOLEAN,
2175 4,
2176 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_VARIANT, G_TYPE_VARIANT);
2177
2178 /* GObject signals for received D-Bus signals: */
2179 /**
2180 * GsdRemoteDesktopRdpServer::binding:
2181 * @object: A #GsdRemoteDesktopRdpServer.
2182 * @arg_port: Argument.
2183 *
2184 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-gnome-RemoteDesktop-Rdp-Server.Binding">"Binding"</link> is received.
2185 *
2186 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
2187 */
2188 GSD__REMOTE_DESKTOP_RDP_SERVER_SIGNALS[GSD__REMOTE_DESKTOP_RDP_SERVER_BINDING] =
2189 g_signal_new ("binding",
2190 G_TYPE_FROM_INTERFACE (iface),
2191 G_SIGNAL_RUN_LAST,
2192 G_STRUCT_OFFSET (GsdRemoteDesktopRdpServerIface, binding),
2193 NULL,
2194 NULL,
2195 gsd_remote_desktop_rdp_server_signal_marshal_binding,
2196 G_TYPE_NONE,
2197 1, G_TYPE_INT);
2198
2199 /* GObject properties for D-Bus properties: */
2200 /**
2201 * GsdRemoteDesktopRdpServer:enabled:
2202 *
2203 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.Enabled">"Enabled"</link>.
2204 *
2205 * 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.
2206 */
2207 g_object_interface_install_property (iface,
2208 g_param_spec_boolean ("enabled", "Enabled", "Enabled", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2209 /**
2210 * GsdRemoteDesktopRdpServer:port:
2211 *
2212 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.Port">"Port"</link>.
2213 *
2214 * 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.
2215 */
2216 g_object_interface_install_property (iface,
2217 g_param_spec_int ("port", "Port", "Port", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2218 /**
2219 * GsdRemoteDesktopRdpServer:negotiate-port:
2220 *
2221 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.NegotiatePort">"NegotiatePort"</link>.
2222 *
2223 * 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.
2224 */
2225 g_object_interface_install_property (iface,
2226 g_param_spec_boolean ("negotiate-port", "NegotiatePort", "NegotiatePort", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2227 /**
2228 * GsdRemoteDesktopRdpServer:tls-cert:
2229 *
2230 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsCert">"TlsCert"</link>.
2231 *
2232 * 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.
2233 */
2234 g_object_interface_install_property (iface,
2235 g_param_spec_string ("tls-cert", "TlsCert", "TlsCert", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2236 /**
2237 * GsdRemoteDesktopRdpServer:tls-fingerprint:
2238 *
2239 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsFingerprint">"TlsFingerprint"</link>.
2240 *
2241 * 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.
2242 */
2243 g_object_interface_install_property (iface,
2244 g_param_spec_string ("tls-fingerprint", "TlsFingerprint", "TlsFingerprint", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2245 /**
2246 * GsdRemoteDesktopRdpServer:tls-key:
2247 *
2248 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsKey">"TlsKey"</link>.
2249 *
2250 * 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.
2251 */
2252 g_object_interface_install_property (iface,
2253 g_param_spec_string ("tls-key", "TlsKey", "TlsKey", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2254 /**
2255 * GsdRemoteDesktopRdpServer:view-only:
2256 *
2257 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.ViewOnly">"ViewOnly"</link>.
2258 *
2259 * 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.
2260 */
2261 g_object_interface_install_property (iface,
2262 g_param_spec_boolean ("view-only", "ViewOnly", "ViewOnly", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
2263 }
2264
2265 /**
2266 * gsd_remote_desktop_rdp_server_get_enabled: (skip)
2267 * @object: A #GsdRemoteDesktopRdpServer.
2268 *
2269 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.Enabled">"Enabled"</link> D-Bus property.
2270 *
2271 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2272 *
2273 * Returns: The property value.
2274 */
2275 gboolean
2276 gsd_remote_desktop_rdp_server_get_enabled (GsdRemoteDesktopRdpServer *object)
2277 {
2278 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_RDP_SERVER (object), FALSE);
2279
2280 return GSD_REMOTE_DESKTOP_RDP_SERVER_GET_IFACE (object)->get_enabled (object);
2281 }
2282
2283 /**
2284 * gsd_remote_desktop_rdp_server_set_enabled: (skip)
2285 * @object: A #GsdRemoteDesktopRdpServer.
2286 * @value: The value to set.
2287 *
2288 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.Enabled">"Enabled"</link> D-Bus property to @value.
2289 *
2290 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
2291 */
2292 void
2293 gsd_remote_desktop_rdp_server_set_enabled (GsdRemoteDesktopRdpServer *object, gboolean value)
2294 {
2295 g_object_set (G_OBJECT (object), "enabled", value, NULL);
2296 }
2297
2298 /**
2299 * gsd_remote_desktop_rdp_server_get_port: (skip)
2300 * @object: A #GsdRemoteDesktopRdpServer.
2301 *
2302 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.Port">"Port"</link> D-Bus property.
2303 *
2304 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2305 *
2306 * Returns: The property value.
2307 */
2308 gint
2309 gsd_remote_desktop_rdp_server_get_port (GsdRemoteDesktopRdpServer *object)
2310 {
2311 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_RDP_SERVER (object), 0);
2312
2313 return GSD_REMOTE_DESKTOP_RDP_SERVER_GET_IFACE (object)->get_port (object);
2314 }
2315
2316 /**
2317 * gsd_remote_desktop_rdp_server_set_port: (skip)
2318 * @object: A #GsdRemoteDesktopRdpServer.
2319 * @value: The value to set.
2320 *
2321 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.Port">"Port"</link> D-Bus property to @value.
2322 *
2323 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
2324 */
2325 void
2326 gsd_remote_desktop_rdp_server_set_port (GsdRemoteDesktopRdpServer *object, gint value)
2327 {
2328 g_object_set (G_OBJECT (object), "port", value, NULL);
2329 }
2330
2331 /**
2332 * gsd_remote_desktop_rdp_server_get_negotiate_port: (skip)
2333 * @object: A #GsdRemoteDesktopRdpServer.
2334 *
2335 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.NegotiatePort">"NegotiatePort"</link> D-Bus property.
2336 *
2337 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2338 *
2339 * Returns: The property value.
2340 */
2341 gboolean
2342 gsd_remote_desktop_rdp_server_get_negotiate_port (GsdRemoteDesktopRdpServer *object)
2343 {
2344 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_RDP_SERVER (object), FALSE);
2345
2346 return GSD_REMOTE_DESKTOP_RDP_SERVER_GET_IFACE (object)->get_negotiate_port (object);
2347 }
2348
2349 /**
2350 * gsd_remote_desktop_rdp_server_set_negotiate_port: (skip)
2351 * @object: A #GsdRemoteDesktopRdpServer.
2352 * @value: The value to set.
2353 *
2354 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.NegotiatePort">"NegotiatePort"</link> D-Bus property to @value.
2355 *
2356 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
2357 */
2358 void
2359 gsd_remote_desktop_rdp_server_set_negotiate_port (GsdRemoteDesktopRdpServer *object, gboolean value)
2360 {
2361 g_object_set (G_OBJECT (object), "negotiate-port", value, NULL);
2362 }
2363
2364 /**
2365 * gsd_remote_desktop_rdp_server_get_tls_cert: (skip)
2366 * @object: A #GsdRemoteDesktopRdpServer.
2367 *
2368 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsCert">"TlsCert"</link> D-Bus property.
2369 *
2370 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2371 *
2372 * 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 gsd_remote_desktop_rdp_server_dup_tls_cert() if on another thread.
2373 *
2374 * 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.
2375 */
2376 const gchar *
2377 gsd_remote_desktop_rdp_server_get_tls_cert (GsdRemoteDesktopRdpServer *object)
2378 {
2379 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_RDP_SERVER (object), NULL);
2380
2381 return GSD_REMOTE_DESKTOP_RDP_SERVER_GET_IFACE (object)->get_tls_cert (object);
2382 }
2383
2384 /**
2385 * gsd_remote_desktop_rdp_server_dup_tls_cert: (skip)
2386 * @object: A #GsdRemoteDesktopRdpServer.
2387 *
2388 * Gets a copy of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsCert">"TlsCert"</link> D-Bus property.
2389 *
2390 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2391 *
2392 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
2393 */
2394 gchar *
2395 gsd_remote_desktop_rdp_server_dup_tls_cert (GsdRemoteDesktopRdpServer *object)
2396 {
2397 gchar *value;
2398 g_object_get (G_OBJECT (object), "tls-cert", &value, NULL);
2399 return value;
2400 }
2401
2402 /**
2403 * gsd_remote_desktop_rdp_server_set_tls_cert: (skip)
2404 * @object: A #GsdRemoteDesktopRdpServer.
2405 * @value: The value to set.
2406 *
2407 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsCert">"TlsCert"</link> D-Bus property to @value.
2408 *
2409 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
2410 */
2411 void
2412 gsd_remote_desktop_rdp_server_set_tls_cert (GsdRemoteDesktopRdpServer *object, const gchar *value)
2413 {
2414 g_object_set (G_OBJECT (object), "tls-cert", value, NULL);
2415 }
2416
2417 /**
2418 * gsd_remote_desktop_rdp_server_get_tls_fingerprint: (skip)
2419 * @object: A #GsdRemoteDesktopRdpServer.
2420 *
2421 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsFingerprint">"TlsFingerprint"</link> D-Bus property.
2422 *
2423 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2424 *
2425 * 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 gsd_remote_desktop_rdp_server_dup_tls_fingerprint() if on another thread.
2426 *
2427 * 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.
2428 */
2429 const gchar *
2430 gsd_remote_desktop_rdp_server_get_tls_fingerprint (GsdRemoteDesktopRdpServer *object)
2431 {
2432 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_RDP_SERVER (object), NULL);
2433
2434 return GSD_REMOTE_DESKTOP_RDP_SERVER_GET_IFACE (object)->get_tls_fingerprint (object);
2435 }
2436
2437 /**
2438 * gsd_remote_desktop_rdp_server_dup_tls_fingerprint: (skip)
2439 * @object: A #GsdRemoteDesktopRdpServer.
2440 *
2441 * Gets a copy of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsFingerprint">"TlsFingerprint"</link> D-Bus property.
2442 *
2443 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2444 *
2445 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
2446 */
2447 gchar *
2448 gsd_remote_desktop_rdp_server_dup_tls_fingerprint (GsdRemoteDesktopRdpServer *object)
2449 {
2450 gchar *value;
2451 g_object_get (G_OBJECT (object), "tls-fingerprint", &value, NULL);
2452 return value;
2453 }
2454
2455 /**
2456 * gsd_remote_desktop_rdp_server_set_tls_fingerprint: (skip)
2457 * @object: A #GsdRemoteDesktopRdpServer.
2458 * @value: The value to set.
2459 *
2460 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsFingerprint">"TlsFingerprint"</link> D-Bus property to @value.
2461 *
2462 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
2463 */
2464 void
2465 gsd_remote_desktop_rdp_server_set_tls_fingerprint (GsdRemoteDesktopRdpServer *object, const gchar *value)
2466 {
2467 g_object_set (G_OBJECT (object), "tls-fingerprint", value, NULL);
2468 }
2469
2470 /**
2471 * gsd_remote_desktop_rdp_server_get_tls_key: (skip)
2472 * @object: A #GsdRemoteDesktopRdpServer.
2473 *
2474 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsKey">"TlsKey"</link> D-Bus property.
2475 *
2476 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2477 *
2478 * 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 gsd_remote_desktop_rdp_server_dup_tls_key() if on another thread.
2479 *
2480 * 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.
2481 */
2482 const gchar *
2483 gsd_remote_desktop_rdp_server_get_tls_key (GsdRemoteDesktopRdpServer *object)
2484 {
2485 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_RDP_SERVER (object), NULL);
2486
2487 return GSD_REMOTE_DESKTOP_RDP_SERVER_GET_IFACE (object)->get_tls_key (object);
2488 }
2489
2490 /**
2491 * gsd_remote_desktop_rdp_server_dup_tls_key: (skip)
2492 * @object: A #GsdRemoteDesktopRdpServer.
2493 *
2494 * Gets a copy of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsKey">"TlsKey"</link> D-Bus property.
2495 *
2496 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2497 *
2498 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
2499 */
2500 gchar *
2501 gsd_remote_desktop_rdp_server_dup_tls_key (GsdRemoteDesktopRdpServer *object)
2502 {
2503 gchar *value;
2504 g_object_get (G_OBJECT (object), "tls-key", &value, NULL);
2505 return value;
2506 }
2507
2508 /**
2509 * gsd_remote_desktop_rdp_server_set_tls_key: (skip)
2510 * @object: A #GsdRemoteDesktopRdpServer.
2511 * @value: The value to set.
2512 *
2513 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.TlsKey">"TlsKey"</link> D-Bus property to @value.
2514 *
2515 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
2516 */
2517 void
2518 gsd_remote_desktop_rdp_server_set_tls_key (GsdRemoteDesktopRdpServer *object, const gchar *value)
2519 {
2520 g_object_set (G_OBJECT (object), "tls-key", value, NULL);
2521 }
2522
2523 /**
2524 * gsd_remote_desktop_rdp_server_get_view_only: (skip)
2525 * @object: A #GsdRemoteDesktopRdpServer.
2526 *
2527 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.ViewOnly">"ViewOnly"</link> D-Bus property.
2528 *
2529 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
2530 *
2531 * Returns: The property value.
2532 */
2533 gboolean
2534 gsd_remote_desktop_rdp_server_get_view_only (GsdRemoteDesktopRdpServer *object)
2535 {
2536 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_RDP_SERVER (object), FALSE);
2537
2538 return GSD_REMOTE_DESKTOP_RDP_SERVER_GET_IFACE (object)->get_view_only (object);
2539 }
2540
2541 /**
2542 * gsd_remote_desktop_rdp_server_set_view_only: (skip)
2543 * @object: A #GsdRemoteDesktopRdpServer.
2544 * @value: The value to set.
2545 *
2546 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Rdp-Server.ViewOnly">"ViewOnly"</link> D-Bus property to @value.
2547 *
2548 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
2549 */
2550 void
2551 gsd_remote_desktop_rdp_server_set_view_only (GsdRemoteDesktopRdpServer *object, gboolean value)
2552 {
2553 g_object_set (G_OBJECT (object), "view-only", value, NULL);
2554 }
2555
2556 /**
2557 * gsd_remote_desktop_rdp_server_emit_binding:
2558 * @object: A #GsdRemoteDesktopRdpServer.
2559 * @arg_port: Argument to pass with the signal.
2560 *
2561 * Emits the <link linkend="gdbus-signal-org-gnome-RemoteDesktop-Rdp-Server.Binding">"Binding"</link> D-Bus signal.
2562 */
2563 void
2564 gsd_remote_desktop_rdp_server_emit_binding (
2565 GsdRemoteDesktopRdpServer *object,
2566 gint arg_port)
2567 {
2568 g_signal_emit (object, GSD__REMOTE_DESKTOP_RDP_SERVER_SIGNALS[GSD__REMOTE_DESKTOP_RDP_SERVER_BINDING], 0, arg_port);
2569 }
2570
2571 /**
2572 * gsd_remote_desktop_rdp_server_call_enable:
2573 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2574 * @cancellable: (nullable): A #GCancellable or %NULL.
2575 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2576 * @user_data: User data to pass to @callback.
2577 *
2578 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.Enable">Enable()</link> D-Bus method on @proxy.
2579 * 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()).
2580 * You can then call gsd_remote_desktop_rdp_server_call_enable_finish() to get the result of the operation.
2581 *
2582 * See gsd_remote_desktop_rdp_server_call_enable_sync() for the synchronous, blocking version of this method.
2583 */
2584 void
2585 gsd_remote_desktop_rdp_server_call_enable (
2586 GsdRemoteDesktopRdpServer *proxy,
2587 GCancellable *cancellable,
2588 GAsyncReadyCallback callback,
2589 gpointer user_data)
2590 {
2591 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2592 "Enable",
2593 g_variant_new ("()"),
2594 G_DBUS_CALL_FLAGS_NONE,
2595 -1,
2596 cancellable,
2597 callback,
2598 user_data);
2599 }
2600
2601 /**
2602 * gsd_remote_desktop_rdp_server_call_enable_finish:
2603 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2604 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_server_call_enable().
2605 * @error: Return location for error or %NULL.
2606 *
2607 * Finishes an operation started with gsd_remote_desktop_rdp_server_call_enable().
2608 *
2609 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2610 */
2611 gboolean
2612 gsd_remote_desktop_rdp_server_call_enable_finish (
2613 GsdRemoteDesktopRdpServer *proxy,
2614 GAsyncResult *res,
2615 GError **error)
2616 {
2617 GVariant *_ret;
2618 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2619 if (_ret == NULL)
2620 goto _out;
2621 g_variant_get (_ret,
2622 "()");
2623 g_variant_unref (_ret);
2624 _out:
2625 return _ret != NULL;
2626 }
2627
2628 /**
2629 * gsd_remote_desktop_rdp_server_call_enable_sync:
2630 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2631 * @cancellable: (nullable): A #GCancellable or %NULL.
2632 * @error: Return location for error or %NULL.
2633 *
2634 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.Enable">Enable()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2635 *
2636 * See gsd_remote_desktop_rdp_server_call_enable() for the asynchronous version of this method.
2637 *
2638 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2639 */
2640 gboolean
2641 gsd_remote_desktop_rdp_server_call_enable_sync (
2642 GsdRemoteDesktopRdpServer *proxy,
2643 GCancellable *cancellable,
2644 GError **error)
2645 {
2646 GVariant *_ret;
2647 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2648 "Enable",
2649 g_variant_new ("()"),
2650 G_DBUS_CALL_FLAGS_NONE,
2651 -1,
2652 cancellable,
2653 error);
2654 if (_ret == NULL)
2655 goto _out;
2656 g_variant_get (_ret,
2657 "()");
2658 g_variant_unref (_ret);
2659 _out:
2660 return _ret != NULL;
2661 }
2662
2663 /**
2664 * gsd_remote_desktop_rdp_server_call_disable:
2665 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2666 * @cancellable: (nullable): A #GCancellable or %NULL.
2667 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2668 * @user_data: User data to pass to @callback.
2669 *
2670 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.Disable">Disable()</link> D-Bus method on @proxy.
2671 * 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()).
2672 * You can then call gsd_remote_desktop_rdp_server_call_disable_finish() to get the result of the operation.
2673 *
2674 * See gsd_remote_desktop_rdp_server_call_disable_sync() for the synchronous, blocking version of this method.
2675 */
2676 void
2677 gsd_remote_desktop_rdp_server_call_disable (
2678 GsdRemoteDesktopRdpServer *proxy,
2679 GCancellable *cancellable,
2680 GAsyncReadyCallback callback,
2681 gpointer user_data)
2682 {
2683 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2684 "Disable",
2685 g_variant_new ("()"),
2686 G_DBUS_CALL_FLAGS_NONE,
2687 -1,
2688 cancellable,
2689 callback,
2690 user_data);
2691 }
2692
2693 /**
2694 * gsd_remote_desktop_rdp_server_call_disable_finish:
2695 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2696 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_server_call_disable().
2697 * @error: Return location for error or %NULL.
2698 *
2699 * Finishes an operation started with gsd_remote_desktop_rdp_server_call_disable().
2700 *
2701 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2702 */
2703 gboolean
2704 gsd_remote_desktop_rdp_server_call_disable_finish (
2705 GsdRemoteDesktopRdpServer *proxy,
2706 GAsyncResult *res,
2707 GError **error)
2708 {
2709 GVariant *_ret;
2710 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2711 if (_ret == NULL)
2712 goto _out;
2713 g_variant_get (_ret,
2714 "()");
2715 g_variant_unref (_ret);
2716 _out:
2717 return _ret != NULL;
2718 }
2719
2720 /**
2721 * gsd_remote_desktop_rdp_server_call_disable_sync:
2722 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2723 * @cancellable: (nullable): A #GCancellable or %NULL.
2724 * @error: Return location for error or %NULL.
2725 *
2726 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.Disable">Disable()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2727 *
2728 * See gsd_remote_desktop_rdp_server_call_disable() for the asynchronous version of this method.
2729 *
2730 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2731 */
2732 gboolean
2733 gsd_remote_desktop_rdp_server_call_disable_sync (
2734 GsdRemoteDesktopRdpServer *proxy,
2735 GCancellable *cancellable,
2736 GError **error)
2737 {
2738 GVariant *_ret;
2739 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2740 "Disable",
2741 g_variant_new ("()"),
2742 G_DBUS_CALL_FLAGS_NONE,
2743 -1,
2744 cancellable,
2745 error);
2746 if (_ret == NULL)
2747 goto _out;
2748 g_variant_get (_ret,
2749 "()");
2750 g_variant_unref (_ret);
2751 _out:
2752 return _ret != NULL;
2753 }
2754
2755 /**
2756 * gsd_remote_desktop_rdp_server_call_get_credentials:
2757 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2758 * @cancellable: (nullable): A #GCancellable or %NULL.
2759 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2760 * @user_data: User data to pass to @callback.
2761 *
2762 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.GetCredentials">GetCredentials()</link> D-Bus method on @proxy.
2763 * 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()).
2764 * You can then call gsd_remote_desktop_rdp_server_call_get_credentials_finish() to get the result of the operation.
2765 *
2766 * See gsd_remote_desktop_rdp_server_call_get_credentials_sync() for the synchronous, blocking version of this method.
2767 */
2768 void
2769 gsd_remote_desktop_rdp_server_call_get_credentials (
2770 GsdRemoteDesktopRdpServer *proxy,
2771 GCancellable *cancellable,
2772 GAsyncReadyCallback callback,
2773 gpointer user_data)
2774 {
2775 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2776 "GetCredentials",
2777 g_variant_new ("()"),
2778 G_DBUS_CALL_FLAGS_NONE,
2779 -1,
2780 cancellable,
2781 callback,
2782 user_data);
2783 }
2784
2785 /**
2786 * gsd_remote_desktop_rdp_server_call_get_credentials_finish:
2787 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2788 * @out_credentials: (out) (optional): Return location for return parameter or %NULL to ignore.
2789 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_server_call_get_credentials().
2790 * @error: Return location for error or %NULL.
2791 *
2792 * Finishes an operation started with gsd_remote_desktop_rdp_server_call_get_credentials().
2793 *
2794 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2795 */
2796 gboolean
2797 gsd_remote_desktop_rdp_server_call_get_credentials_finish (
2798 GsdRemoteDesktopRdpServer *proxy,
2799 GVariant **out_credentials,
2800 GAsyncResult *res,
2801 GError **error)
2802 {
2803 GVariant *_ret;
2804 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2805 if (_ret == NULL)
2806 goto _out;
2807 g_variant_get (_ret,
2808 "(@a{sv})",
2809 out_credentials);
2810 g_variant_unref (_ret);
2811 _out:
2812 return _ret != NULL;
2813 }
2814
2815 /**
2816 * gsd_remote_desktop_rdp_server_call_get_credentials_sync:
2817 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2818 * @out_credentials: (out) (optional): Return location for return parameter or %NULL to ignore.
2819 * @cancellable: (nullable): A #GCancellable or %NULL.
2820 * @error: Return location for error or %NULL.
2821 *
2822 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.GetCredentials">GetCredentials()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2823 *
2824 * See gsd_remote_desktop_rdp_server_call_get_credentials() for the asynchronous version of this method.
2825 *
2826 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2827 */
2828 gboolean
2829 gsd_remote_desktop_rdp_server_call_get_credentials_sync (
2830 GsdRemoteDesktopRdpServer *proxy,
2831 GVariant **out_credentials,
2832 GCancellable *cancellable,
2833 GError **error)
2834 {
2835 GVariant *_ret;
2836 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2837 "GetCredentials",
2838 g_variant_new ("()"),
2839 G_DBUS_CALL_FLAGS_NONE,
2840 -1,
2841 cancellable,
2842 error);
2843 if (_ret == NULL)
2844 goto _out;
2845 g_variant_get (_ret,
2846 "(@a{sv})",
2847 out_credentials);
2848 g_variant_unref (_ret);
2849 _out:
2850 return _ret != NULL;
2851 }
2852
2853 /**
2854 * gsd_remote_desktop_rdp_server_call_set_credentials:
2855 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2856 * @arg_credentials: Argument to pass with the method invocation.
2857 * @cancellable: (nullable): A #GCancellable or %NULL.
2858 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2859 * @user_data: User data to pass to @callback.
2860 *
2861 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.SetCredentials">SetCredentials()</link> D-Bus method on @proxy.
2862 * 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()).
2863 * You can then call gsd_remote_desktop_rdp_server_call_set_credentials_finish() to get the result of the operation.
2864 *
2865 * See gsd_remote_desktop_rdp_server_call_set_credentials_sync() for the synchronous, blocking version of this method.
2866 */
2867 void
2868 gsd_remote_desktop_rdp_server_call_set_credentials (
2869 GsdRemoteDesktopRdpServer *proxy,
2870 GVariant *arg_credentials,
2871 GCancellable *cancellable,
2872 GAsyncReadyCallback callback,
2873 gpointer user_data)
2874 {
2875 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
2876 "SetCredentials",
2877 g_variant_new ("(@a{sv})",
2878 arg_credentials),
2879 G_DBUS_CALL_FLAGS_NONE,
2880 -1,
2881 cancellable,
2882 callback,
2883 user_data);
2884 }
2885
2886 /**
2887 * gsd_remote_desktop_rdp_server_call_set_credentials_finish:
2888 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2889 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_server_call_set_credentials().
2890 * @error: Return location for error or %NULL.
2891 *
2892 * Finishes an operation started with gsd_remote_desktop_rdp_server_call_set_credentials().
2893 *
2894 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2895 */
2896 gboolean
2897 gsd_remote_desktop_rdp_server_call_set_credentials_finish (
2898 GsdRemoteDesktopRdpServer *proxy,
2899 GAsyncResult *res,
2900 GError **error)
2901 {
2902 GVariant *_ret;
2903 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
2904 if (_ret == NULL)
2905 goto _out;
2906 g_variant_get (_ret,
2907 "()");
2908 g_variant_unref (_ret);
2909 _out:
2910 return _ret != NULL;
2911 }
2912
2913 /**
2914 * gsd_remote_desktop_rdp_server_call_set_credentials_sync:
2915 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2916 * @arg_credentials: Argument to pass with the method invocation.
2917 * @cancellable: (nullable): A #GCancellable or %NULL.
2918 * @error: Return location for error or %NULL.
2919 *
2920 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.SetCredentials">SetCredentials()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
2921 *
2922 * See gsd_remote_desktop_rdp_server_call_set_credentials() for the asynchronous version of this method.
2923 *
2924 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2925 */
2926 gboolean
2927 gsd_remote_desktop_rdp_server_call_set_credentials_sync (
2928 GsdRemoteDesktopRdpServer *proxy,
2929 GVariant *arg_credentials,
2930 GCancellable *cancellable,
2931 GError **error)
2932 {
2933 GVariant *_ret;
2934 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
2935 "SetCredentials",
2936 g_variant_new ("(@a{sv})",
2937 arg_credentials),
2938 G_DBUS_CALL_FLAGS_NONE,
2939 -1,
2940 cancellable,
2941 error);
2942 if (_ret == NULL)
2943 goto _out;
2944 g_variant_get (_ret,
2945 "()");
2946 g_variant_unref (_ret);
2947 _out:
2948 return _ret != NULL;
2949 }
2950
2951 /**
2952 * gsd_remote_desktop_rdp_server_call_export_certificate:
2953 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2954 * @fd_list: (nullable): A #GUnixFDList or %NULL.
2955 * @cancellable: (nullable): A #GCancellable or %NULL.
2956 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
2957 * @user_data: User data to pass to @callback.
2958 *
2959 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.ExportCertificate">ExportCertificate()</link> D-Bus method on @proxy.
2960 * 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()).
2961 * You can then call gsd_remote_desktop_rdp_server_call_export_certificate_finish() to get the result of the operation.
2962 *
2963 * See gsd_remote_desktop_rdp_server_call_export_certificate_sync() for the synchronous, blocking version of this method.
2964 */
2965 void
2966 gsd_remote_desktop_rdp_server_call_export_certificate (
2967 GsdRemoteDesktopRdpServer *proxy,
2968 GUnixFDList *fd_list,
2969 GCancellable *cancellable,
2970 GAsyncReadyCallback callback,
2971 gpointer user_data)
2972 {
2973 g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
2974 "ExportCertificate",
2975 g_variant_new ("()"),
2976 G_DBUS_CALL_FLAGS_NONE,
2977 -1,
2978 fd_list,
2979 cancellable,
2980 callback,
2981 user_data);
2982 }
2983
2984 /**
2985 * gsd_remote_desktop_rdp_server_call_export_certificate_finish:
2986 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
2987 * @out_Certificate: (out) (optional): Return location for return parameter or %NULL to ignore.
2988 * @out_PrivateKey: (out) (optional): Return location for return parameter or %NULL to ignore.
2989 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
2990 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_server_call_export_certificate().
2991 * @error: Return location for error or %NULL.
2992 *
2993 * Finishes an operation started with gsd_remote_desktop_rdp_server_call_export_certificate().
2994 *
2995 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
2996 */
2997 gboolean
2998 gsd_remote_desktop_rdp_server_call_export_certificate_finish (
2999 GsdRemoteDesktopRdpServer *proxy,
3000 GVariant **out_Certificate,
3001 GVariant **out_PrivateKey,
3002 GUnixFDList **out_fd_list,
3003 GAsyncResult *res,
3004 GError **error)
3005 {
3006 GVariant *_ret;
3007 _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
3008 if (_ret == NULL)
3009 goto _out;
3010 g_variant_get (_ret,
3011 "(@(sh)@(sh))",
3012 out_Certificate,
3013 out_PrivateKey);
3014 g_variant_unref (_ret);
3015 _out:
3016 return _ret != NULL;
3017 }
3018
3019 /**
3020 * gsd_remote_desktop_rdp_server_call_export_certificate_sync:
3021 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
3022 * @fd_list: (nullable): A #GUnixFDList or %NULL.
3023 * @out_Certificate: (out) (optional): Return location for return parameter or %NULL to ignore.
3024 * @out_PrivateKey: (out) (optional): Return location for return parameter or %NULL to ignore.
3025 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
3026 * @cancellable: (nullable): A #GCancellable or %NULL.
3027 * @error: Return location for error or %NULL.
3028 *
3029 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.ExportCertificate">ExportCertificate()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
3030 *
3031 * See gsd_remote_desktop_rdp_server_call_export_certificate() for the asynchronous version of this method.
3032 *
3033 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
3034 */
3035 gboolean
3036 gsd_remote_desktop_rdp_server_call_export_certificate_sync (
3037 GsdRemoteDesktopRdpServer *proxy,
3038 GUnixFDList *fd_list,
3039 GVariant **out_Certificate,
3040 GVariant **out_PrivateKey,
3041 GUnixFDList **out_fd_list,
3042 GCancellable *cancellable,
3043 GError **error)
3044 {
3045 GVariant *_ret;
3046 _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
3047 "ExportCertificate",
3048 g_variant_new ("()"),
3049 G_DBUS_CALL_FLAGS_NONE,
3050 -1,
3051 fd_list,
3052 out_fd_list,
3053 cancellable,
3054 error);
3055 if (_ret == NULL)
3056 goto _out;
3057 g_variant_get (_ret,
3058 "(@(sh)@(sh))",
3059 out_Certificate,
3060 out_PrivateKey);
3061 g_variant_unref (_ret);
3062 _out:
3063 return _ret != NULL;
3064 }
3065
3066 /**
3067 * gsd_remote_desktop_rdp_server_call_import_certificate:
3068 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
3069 * @arg_Certificate: Argument to pass with the method invocation.
3070 * @arg_PrivateKey: Argument to pass with the method invocation.
3071 * @fd_list: (nullable): A #GUnixFDList or %NULL.
3072 * @cancellable: (nullable): A #GCancellable or %NULL.
3073 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
3074 * @user_data: User data to pass to @callback.
3075 *
3076 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.ImportCertificate">ImportCertificate()</link> D-Bus method on @proxy.
3077 * 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()).
3078 * You can then call gsd_remote_desktop_rdp_server_call_import_certificate_finish() to get the result of the operation.
3079 *
3080 * See gsd_remote_desktop_rdp_server_call_import_certificate_sync() for the synchronous, blocking version of this method.
3081 */
3082 void
3083 gsd_remote_desktop_rdp_server_call_import_certificate (
3084 GsdRemoteDesktopRdpServer *proxy,
3085 GVariant *arg_Certificate,
3086 GVariant *arg_PrivateKey,
3087 GUnixFDList *fd_list,
3088 GCancellable *cancellable,
3089 GAsyncReadyCallback callback,
3090 gpointer user_data)
3091 {
3092 g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
3093 "ImportCertificate",
3094 g_variant_new ("(@(sh)@(sh))",
3095 arg_Certificate,
3096 arg_PrivateKey),
3097 G_DBUS_CALL_FLAGS_NONE,
3098 -1,
3099 fd_list,
3100 cancellable,
3101 callback,
3102 user_data);
3103 }
3104
3105 /**
3106 * gsd_remote_desktop_rdp_server_call_import_certificate_finish:
3107 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
3108 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
3109 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_server_call_import_certificate().
3110 * @error: Return location for error or %NULL.
3111 *
3112 * Finishes an operation started with gsd_remote_desktop_rdp_server_call_import_certificate().
3113 *
3114 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
3115 */
3116 gboolean
3117 gsd_remote_desktop_rdp_server_call_import_certificate_finish (
3118 GsdRemoteDesktopRdpServer *proxy,
3119 GUnixFDList **out_fd_list,
3120 GAsyncResult *res,
3121 GError **error)
3122 {
3123 GVariant *_ret;
3124 _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
3125 if (_ret == NULL)
3126 goto _out;
3127 g_variant_get (_ret,
3128 "()");
3129 g_variant_unref (_ret);
3130 _out:
3131 return _ret != NULL;
3132 }
3133
3134 /**
3135 * gsd_remote_desktop_rdp_server_call_import_certificate_sync:
3136 * @proxy: A #GsdRemoteDesktopRdpServerProxy.
3137 * @arg_Certificate: Argument to pass with the method invocation.
3138 * @arg_PrivateKey: Argument to pass with the method invocation.
3139 * @fd_list: (nullable): A #GUnixFDList or %NULL.
3140 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
3141 * @cancellable: (nullable): A #GCancellable or %NULL.
3142 * @error: Return location for error or %NULL.
3143 *
3144 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.ImportCertificate">ImportCertificate()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
3145 *
3146 * See gsd_remote_desktop_rdp_server_call_import_certificate() for the asynchronous version of this method.
3147 *
3148 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
3149 */
3150 gboolean
3151 gsd_remote_desktop_rdp_server_call_import_certificate_sync (
3152 GsdRemoteDesktopRdpServer *proxy,
3153 GVariant *arg_Certificate,
3154 GVariant *arg_PrivateKey,
3155 GUnixFDList *fd_list,
3156 GUnixFDList **out_fd_list,
3157 GCancellable *cancellable,
3158 GError **error)
3159 {
3160 GVariant *_ret;
3161 _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
3162 "ImportCertificate",
3163 g_variant_new ("(@(sh)@(sh))",
3164 arg_Certificate,
3165 arg_PrivateKey),
3166 G_DBUS_CALL_FLAGS_NONE,
3167 -1,
3168 fd_list,
3169 out_fd_list,
3170 cancellable,
3171 error);
3172 if (_ret == NULL)
3173 goto _out;
3174 g_variant_get (_ret,
3175 "()");
3176 g_variant_unref (_ret);
3177 _out:
3178 return _ret != NULL;
3179 }
3180
3181 /**
3182 * gsd_remote_desktop_rdp_server_complete_enable:
3183 * @object: A #GsdRemoteDesktopRdpServer.
3184 * @invocation: (transfer full): A #GDBusMethodInvocation.
3185 *
3186 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.Enable">Enable()</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.
3187 *
3188 * This method will free @invocation, you cannot use it afterwards.
3189 */
3190 void
3191 gsd_remote_desktop_rdp_server_complete_enable (
3192 GsdRemoteDesktopRdpServer *object G_GNUC_UNUSED,
3193 GDBusMethodInvocation *invocation)
3194 {
3195 g_dbus_method_invocation_return_value (invocation,
3196 g_variant_new ("()"));
3197 }
3198
3199 /**
3200 * gsd_remote_desktop_rdp_server_complete_disable:
3201 * @object: A #GsdRemoteDesktopRdpServer.
3202 * @invocation: (transfer full): A #GDBusMethodInvocation.
3203 *
3204 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.Disable">Disable()</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.
3205 *
3206 * This method will free @invocation, you cannot use it afterwards.
3207 */
3208 void
3209 gsd_remote_desktop_rdp_server_complete_disable (
3210 GsdRemoteDesktopRdpServer *object G_GNUC_UNUSED,
3211 GDBusMethodInvocation *invocation)
3212 {
3213 g_dbus_method_invocation_return_value (invocation,
3214 g_variant_new ("()"));
3215 }
3216
3217 /**
3218 * gsd_remote_desktop_rdp_server_complete_get_credentials:
3219 * @object: A #GsdRemoteDesktopRdpServer.
3220 * @invocation: (transfer full): A #GDBusMethodInvocation.
3221 * @credentials: Parameter to return.
3222 *
3223 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.GetCredentials">GetCredentials()</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.
3224 *
3225 * This method will free @invocation, you cannot use it afterwards.
3226 */
3227 void
3228 gsd_remote_desktop_rdp_server_complete_get_credentials (
3229 GsdRemoteDesktopRdpServer *object G_GNUC_UNUSED,
3230 GDBusMethodInvocation *invocation,
3231 GVariant *credentials)
3232 {
3233 g_dbus_method_invocation_return_value (invocation,
3234 g_variant_new ("(@a{sv})",
3235 credentials));
3236 }
3237
3238 /**
3239 * gsd_remote_desktop_rdp_server_complete_set_credentials:
3240 * @object: A #GsdRemoteDesktopRdpServer.
3241 * @invocation: (transfer full): A #GDBusMethodInvocation.
3242 *
3243 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.SetCredentials">SetCredentials()</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.
3244 *
3245 * This method will free @invocation, you cannot use it afterwards.
3246 */
3247 void
3248 gsd_remote_desktop_rdp_server_complete_set_credentials (
3249 GsdRemoteDesktopRdpServer *object G_GNUC_UNUSED,
3250 GDBusMethodInvocation *invocation)
3251 {
3252 g_dbus_method_invocation_return_value (invocation,
3253 g_variant_new ("()"));
3254 }
3255
3256 /**
3257 * gsd_remote_desktop_rdp_server_complete_export_certificate:
3258 * @object: A #GsdRemoteDesktopRdpServer.
3259 * @invocation: (transfer full): A #GDBusMethodInvocation.
3260 * @fd_list: (nullable): A #GUnixFDList or %NULL.
3261 * @Certificate: Parameter to return.
3262 * @PrivateKey: Parameter to return.
3263 *
3264 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.ExportCertificate">ExportCertificate()</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.
3265 *
3266 * This method will free @invocation, you cannot use it afterwards.
3267 */
3268 void
3269 gsd_remote_desktop_rdp_server_complete_export_certificate (
3270 GsdRemoteDesktopRdpServer *object G_GNUC_UNUSED,
3271 GDBusMethodInvocation *invocation,
3272 GUnixFDList *fd_list,
3273 GVariant *Certificate,
3274 GVariant *PrivateKey)
3275 {
3276 g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
3277 g_variant_new ("(@(sh)@(sh))",
3278 Certificate,
3279 PrivateKey),
3280 fd_list);
3281 }
3282
3283 /**
3284 * gsd_remote_desktop_rdp_server_complete_import_certificate:
3285 * @object: A #GsdRemoteDesktopRdpServer.
3286 * @invocation: (transfer full): A #GDBusMethodInvocation.
3287 * @fd_list: (nullable): A #GUnixFDList or %NULL.
3288 *
3289 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Server.ImportCertificate">ImportCertificate()</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.
3290 *
3291 * This method will free @invocation, you cannot use it afterwards.
3292 */
3293 void
3294 gsd_remote_desktop_rdp_server_complete_import_certificate (
3295 GsdRemoteDesktopRdpServer *object G_GNUC_UNUSED,
3296 GDBusMethodInvocation *invocation,
3297 GUnixFDList *fd_list)
3298 {
3299 g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
3300 g_variant_new ("()"),
3301 fd_list);
3302 }
3303
3304 /* ------------------------------------------------------------------------ */
3305
3306 /**
3307 * GsdRemoteDesktopRdpServerProxy:
3308 *
3309 * The #GsdRemoteDesktopRdpServerProxy structure contains only private data and should only be accessed using the provided API.
3310 */
3311
3312 /**
3313 * GsdRemoteDesktopRdpServerProxyClass:
3314 * @parent_class: The parent class.
3315 *
3316 * Class structure for #GsdRemoteDesktopRdpServerProxy.
3317 */
3318
3319 struct _GsdRemoteDesktopRdpServerProxyPrivate
3320 {
3321 GData *qdata;
3322 };
3323
3324 static void gsd_remote_desktop_rdp_server_proxy_iface_init (GsdRemoteDesktopRdpServerIface *iface);
3325
3326 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3327 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpServerProxy, gsd_remote_desktop_rdp_server_proxy, G_TYPE_DBUS_PROXY,
3328 G_ADD_PRIVATE (GsdRemoteDesktopRdpServerProxy)
3329 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER, gsd_remote_desktop_rdp_server_proxy_iface_init))
3330
3331 #else
3332 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpServerProxy, gsd_remote_desktop_rdp_server_proxy, G_TYPE_DBUS_PROXY,
3333 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER, gsd_remote_desktop_rdp_server_proxy_iface_init))
3334
3335 #endif
3336 static void
3337 gsd_remote_desktop_rdp_server_proxy_finalize (GObject *object)
3338 {
3339 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (object);
3340 g_datalist_clear (&proxy->priv->qdata);
3341 G_OBJECT_CLASS (gsd_remote_desktop_rdp_server_proxy_parent_class)->finalize (object);
3342 }
3343
3344 static void
3345 gsd_remote_desktop_rdp_server_proxy_get_property (GObject *object,
3346 guint prop_id,
3347 GValue *value,
3348 GParamSpec *pspec G_GNUC_UNUSED)
3349 {
3350 const _ExtendedGDBusPropertyInfo *info;
3351 GVariant *variant;
3352 g_assert (prop_id != 0 && prop_id - 1 < 7);
3353 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_rdp_server_property_info_pointers[prop_id - 1];
3354 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
3355 if (info->use_gvariant)
3356 {
3357 g_value_set_variant (value, variant);
3358 }
3359 else
3360 {
3361 if (variant != NULL)
3362 g_dbus_gvariant_to_gvalue (variant, value);
3363 }
3364 if (variant != NULL)
3365 g_variant_unref (variant);
3366 }
3367
3368 static void
3369 gsd_remote_desktop_rdp_server_proxy_set_property_cb (GDBusProxy *proxy,
3370 GAsyncResult *res,
3371 gpointer user_data)
3372 {
3373 const _ExtendedGDBusPropertyInfo *info = user_data;
3374 GError *error;
3375 GVariant *_ret;
3376 error = NULL;
3377 _ret = g_dbus_proxy_call_finish (proxy, res, &error);
3378 if (!_ret)
3379 {
3380 g_warning ("Error setting property '%s' on interface org.gnome.RemoteDesktop.Rdp.Server: %s (%s, %d)",
3381 info->parent_struct.name,
3382 error->message, g_quark_to_string (error->domain), error->code);
3383 g_error_free (error);
3384 }
3385 else
3386 {
3387 g_variant_unref (_ret);
3388 }
3389 }
3390
3391 static void
3392 gsd_remote_desktop_rdp_server_proxy_set_property (GObject *object,
3393 guint prop_id,
3394 const GValue *value,
3395 GParamSpec *pspec G_GNUC_UNUSED)
3396 {
3397 const _ExtendedGDBusPropertyInfo *info;
3398 GVariant *variant;
3399 g_assert (prop_id != 0 && prop_id - 1 < 7);
3400 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_rdp_server_property_info_pointers[prop_id - 1];
3401 variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
3402 g_dbus_proxy_call (G_DBUS_PROXY (object),
3403 "org.freedesktop.DBus.Properties.Set",
3404 g_variant_new ("(ssv)", "org.gnome.RemoteDesktop.Rdp.Server", info->parent_struct.name, variant),
3405 G_DBUS_CALL_FLAGS_NONE,
3406 -1,
3407 NULL, (GAsyncReadyCallback) gsd_remote_desktop_rdp_server_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
3408 g_variant_unref (variant);
3409 }
3410
3411 static void
3412 gsd_remote_desktop_rdp_server_proxy_g_signal (GDBusProxy *proxy,
3413 const gchar *sender_name G_GNUC_UNUSED,
3414 const gchar *signal_name,
3415 GVariant *parameters)
3416 {
3417 _ExtendedGDBusSignalInfo *info;
3418 GVariantIter iter;
3419 GVariant *child;
3420 GValue *paramv;
3421 gsize num_params;
3422 gsize n;
3423 guint signal_id;
3424 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_server_interface_info.parent_struct, signal_name);
3425 if (info == NULL)
3426 return;
3427 num_params = g_variant_n_children (parameters);
3428 paramv = g_new0 (GValue, num_params + 1);
3429 g_value_init (&paramv[0], GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER);
3430 g_value_set_object (&paramv[0], proxy);
3431 g_variant_iter_init (&iter, parameters);
3432 n = 1;
3433 while ((child = g_variant_iter_next_value (&iter)) != NULL)
3434 {
3435 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
3436 if (arg_info->use_gvariant)
3437 {
3438 g_value_init (&paramv[n], G_TYPE_VARIANT);
3439 g_value_set_variant (&paramv[n], child);
3440 n++;
3441 }
3442 else
3443 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
3444 g_variant_unref (child);
3445 }
3446 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER);
3447 g_signal_emitv (paramv, signal_id, 0, NULL);
3448 for (n = 0; n < num_params + 1; n++)
3449 g_value_unset (&paramv[n]);
3450 g_free (paramv);
3451 }
3452
3453 static void
3454 gsd_remote_desktop_rdp_server_proxy_g_properties_changed (GDBusProxy *_proxy,
3455 GVariant *changed_properties,
3456 const gchar *const *invalidated_properties)
3457 {
3458 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (_proxy);
3459 guint n;
3460 const gchar *key;
3461 GVariantIter *iter;
3462 _ExtendedGDBusPropertyInfo *info;
3463 g_variant_get (changed_properties, "a{sv}", &iter);
3464 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
3465 {
3466 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_server_interface_info.parent_struct, key);
3467 g_datalist_remove_data (&proxy->priv->qdata, key);
3468 if (info != NULL)
3469 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
3470 }
3471 g_variant_iter_free (iter);
3472 for (n = 0; invalidated_properties[n] != NULL; n++)
3473 {
3474 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_server_interface_info.parent_struct, invalidated_properties[n]);
3475 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
3476 if (info != NULL)
3477 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
3478 }
3479 }
3480
3481 static gboolean
3482 gsd_remote_desktop_rdp_server_proxy_get_enabled (GsdRemoteDesktopRdpServer *object)
3483 {
3484 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (object);
3485 GVariant *variant;
3486 gboolean value = FALSE;
3487 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Enabled");
3488 if (variant != NULL)
3489 {
3490 value = g_variant_get_boolean (variant);
3491 g_variant_unref (variant);
3492 }
3493 return value;
3494 }
3495
3496 static gint
3497 gsd_remote_desktop_rdp_server_proxy_get_port (GsdRemoteDesktopRdpServer *object)
3498 {
3499 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (object);
3500 GVariant *variant;
3501 gint value = 0;
3502 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Port");
3503 if (variant != NULL)
3504 {
3505 value = g_variant_get_int32 (variant);
3506 g_variant_unref (variant);
3507 }
3508 return value;
3509 }
3510
3511 static gboolean
3512 gsd_remote_desktop_rdp_server_proxy_get_negotiate_port (GsdRemoteDesktopRdpServer *object)
3513 {
3514 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (object);
3515 GVariant *variant;
3516 gboolean value = FALSE;
3517 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "NegotiatePort");
3518 if (variant != NULL)
3519 {
3520 value = g_variant_get_boolean (variant);
3521 g_variant_unref (variant);
3522 }
3523 return value;
3524 }
3525
3526 static const gchar *
3527 gsd_remote_desktop_rdp_server_proxy_get_tls_cert (GsdRemoteDesktopRdpServer *object)
3528 {
3529 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (object);
3530 GVariant *variant;
3531 const gchar *value = NULL;
3532 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "TlsCert");
3533 if (variant != NULL)
3534 {
3535 value = g_variant_get_string (variant, NULL);
3536 g_variant_unref (variant);
3537 }
3538 return value;
3539 }
3540
3541 static const gchar *
3542 gsd_remote_desktop_rdp_server_proxy_get_tls_fingerprint (GsdRemoteDesktopRdpServer *object)
3543 {
3544 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (object);
3545 GVariant *variant;
3546 const gchar *value = NULL;
3547 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "TlsFingerprint");
3548 if (variant != NULL)
3549 {
3550 value = g_variant_get_string (variant, NULL);
3551 g_variant_unref (variant);
3552 }
3553 return value;
3554 }
3555
3556 static const gchar *
3557 gsd_remote_desktop_rdp_server_proxy_get_tls_key (GsdRemoteDesktopRdpServer *object)
3558 {
3559 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (object);
3560 GVariant *variant;
3561 const gchar *value = NULL;
3562 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "TlsKey");
3563 if (variant != NULL)
3564 {
3565 value = g_variant_get_string (variant, NULL);
3566 g_variant_unref (variant);
3567 }
3568 return value;
3569 }
3570
3571 static gboolean
3572 gsd_remote_desktop_rdp_server_proxy_get_view_only (GsdRemoteDesktopRdpServer *object)
3573 {
3574 GsdRemoteDesktopRdpServerProxy *proxy = GSD_REMOTE_DESKTOP_RDP_SERVER_PROXY (object);
3575 GVariant *variant;
3576 gboolean value = FALSE;
3577 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ViewOnly");
3578 if (variant != NULL)
3579 {
3580 value = g_variant_get_boolean (variant);
3581 g_variant_unref (variant);
3582 }
3583 return value;
3584 }
3585
3586 static void
3587 gsd_remote_desktop_rdp_server_proxy_init (GsdRemoteDesktopRdpServerProxy *proxy)
3588 {
3589 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
3590 proxy->priv = gsd_remote_desktop_rdp_server_proxy_get_instance_private (proxy);
3591 #else
3592 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER_PROXY, GsdRemoteDesktopRdpServerProxyPrivate);
3593 #endif
3594
3595 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsd_remote_desktop_rdp_server_interface_info ());
3596 }
3597
3598 static void
3599 gsd_remote_desktop_rdp_server_proxy_class_init (GsdRemoteDesktopRdpServerProxyClass *klass)
3600 {
3601 GObjectClass *gobject_class;
3602 GDBusProxyClass *proxy_class;
3603
3604 gobject_class = G_OBJECT_CLASS (klass);
3605 gobject_class->finalize = gsd_remote_desktop_rdp_server_proxy_finalize;
3606 gobject_class->get_property = gsd_remote_desktop_rdp_server_proxy_get_property;
3607 gobject_class->set_property = gsd_remote_desktop_rdp_server_proxy_set_property;
3608
3609 proxy_class = G_DBUS_PROXY_CLASS (klass);
3610 proxy_class->g_signal = gsd_remote_desktop_rdp_server_proxy_g_signal;
3611 proxy_class->g_properties_changed = gsd_remote_desktop_rdp_server_proxy_g_properties_changed;
3612
3613 gsd_remote_desktop_rdp_server_override_properties (gobject_class, 1);
3614
3615 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
3616 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopRdpServerProxyPrivate));
3617 #endif
3618 }
3619
3620 static void
3621 gsd_remote_desktop_rdp_server_proxy_iface_init (GsdRemoteDesktopRdpServerIface *iface)
3622 {
3623 iface->get_enabled = gsd_remote_desktop_rdp_server_proxy_get_enabled;
3624 iface->get_port = gsd_remote_desktop_rdp_server_proxy_get_port;
3625 iface->get_negotiate_port = gsd_remote_desktop_rdp_server_proxy_get_negotiate_port;
3626 iface->get_tls_cert = gsd_remote_desktop_rdp_server_proxy_get_tls_cert;
3627 iface->get_tls_fingerprint = gsd_remote_desktop_rdp_server_proxy_get_tls_fingerprint;
3628 iface->get_tls_key = gsd_remote_desktop_rdp_server_proxy_get_tls_key;
3629 iface->get_view_only = gsd_remote_desktop_rdp_server_proxy_get_view_only;
3630 }
3631
3632 /**
3633 * gsd_remote_desktop_rdp_server_proxy_new:
3634 * @connection: A #GDBusConnection.
3635 * @flags: Flags from the #GDBusProxyFlags enumeration.
3636 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3637 * @object_path: An object path.
3638 * @cancellable: (nullable): A #GCancellable or %NULL.
3639 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3640 * @user_data: User data to pass to @callback.
3641 *
3642 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Server.top_of_page">org.gnome.RemoteDesktop.Rdp.Server</link>. See g_dbus_proxy_new() for more details.
3643 *
3644 * 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()).
3645 * You can then call gsd_remote_desktop_rdp_server_proxy_new_finish() to get the result of the operation.
3646 *
3647 * See gsd_remote_desktop_rdp_server_proxy_new_sync() for the synchronous, blocking version of this constructor.
3648 */
3649 void
3650 gsd_remote_desktop_rdp_server_proxy_new (
3651 GDBusConnection *connection,
3652 GDBusProxyFlags flags,
3653 const gchar *name,
3654 const gchar *object_path,
3655 GCancellable *cancellable,
3656 GAsyncReadyCallback callback,
3657 gpointer user_data)
3658 {
3659 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER_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.RemoteDesktop.Rdp.Server", NULL);
3660 }
3661
3662 /**
3663 * gsd_remote_desktop_rdp_server_proxy_new_finish:
3664 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_server_proxy_new().
3665 * @error: Return location for error or %NULL
3666 *
3667 * Finishes an operation started with gsd_remote_desktop_rdp_server_proxy_new().
3668 *
3669 * Returns: (transfer full) (type GsdRemoteDesktopRdpServerProxy): The constructed proxy object or %NULL if @error is set.
3670 */
3671 GsdRemoteDesktopRdpServer *
3672 gsd_remote_desktop_rdp_server_proxy_new_finish (
3673 GAsyncResult *res,
3674 GError **error)
3675 {
3676 GObject *ret;
3677 GObject *source_object;
3678 source_object = g_async_result_get_source_object (res);
3679 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3680 g_object_unref (source_object);
3681 if (ret != NULL)
3682 return GSD_REMOTE_DESKTOP_RDP_SERVER (ret);
3683 else
3684 return NULL;
3685 }
3686
3687 /**
3688 * gsd_remote_desktop_rdp_server_proxy_new_sync:
3689 * @connection: A #GDBusConnection.
3690 * @flags: Flags from the #GDBusProxyFlags enumeration.
3691 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
3692 * @object_path: An object path.
3693 * @cancellable: (nullable): A #GCancellable or %NULL.
3694 * @error: Return location for error or %NULL
3695 *
3696 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Server.top_of_page">org.gnome.RemoteDesktop.Rdp.Server</link>. See g_dbus_proxy_new_sync() for more details.
3697 *
3698 * The calling thread is blocked until a reply is received.
3699 *
3700 * See gsd_remote_desktop_rdp_server_proxy_new() for the asynchronous version of this constructor.
3701 *
3702 * Returns: (transfer full) (type GsdRemoteDesktopRdpServerProxy): The constructed proxy object or %NULL if @error is set.
3703 */
3704 GsdRemoteDesktopRdpServer *
3705 gsd_remote_desktop_rdp_server_proxy_new_sync (
3706 GDBusConnection *connection,
3707 GDBusProxyFlags flags,
3708 const gchar *name,
3709 const gchar *object_path,
3710 GCancellable *cancellable,
3711 GError **error)
3712 {
3713 GInitable *ret;
3714 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop.Rdp.Server", NULL);
3715 if (ret != NULL)
3716 return GSD_REMOTE_DESKTOP_RDP_SERVER (ret);
3717 else
3718 return NULL;
3719 }
3720
3721
3722 /**
3723 * gsd_remote_desktop_rdp_server_proxy_new_for_bus:
3724 * @bus_type: A #GBusType.
3725 * @flags: Flags from the #GDBusProxyFlags enumeration.
3726 * @name: A bus name (well-known or unique).
3727 * @object_path: An object path.
3728 * @cancellable: (nullable): A #GCancellable or %NULL.
3729 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
3730 * @user_data: User data to pass to @callback.
3731 *
3732 * Like gsd_remote_desktop_rdp_server_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
3733 *
3734 * 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()).
3735 * You can then call gsd_remote_desktop_rdp_server_proxy_new_for_bus_finish() to get the result of the operation.
3736 *
3737 * See gsd_remote_desktop_rdp_server_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
3738 */
3739 void
3740 gsd_remote_desktop_rdp_server_proxy_new_for_bus (
3741 GBusType bus_type,
3742 GDBusProxyFlags flags,
3743 const gchar *name,
3744 const gchar *object_path,
3745 GCancellable *cancellable,
3746 GAsyncReadyCallback callback,
3747 gpointer user_data)
3748 {
3749 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER_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.RemoteDesktop.Rdp.Server", NULL);
3750 }
3751
3752 /**
3753 * gsd_remote_desktop_rdp_server_proxy_new_for_bus_finish:
3754 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_server_proxy_new_for_bus().
3755 * @error: Return location for error or %NULL
3756 *
3757 * Finishes an operation started with gsd_remote_desktop_rdp_server_proxy_new_for_bus().
3758 *
3759 * Returns: (transfer full) (type GsdRemoteDesktopRdpServerProxy): The constructed proxy object or %NULL if @error is set.
3760 */
3761 GsdRemoteDesktopRdpServer *
3762 gsd_remote_desktop_rdp_server_proxy_new_for_bus_finish (
3763 GAsyncResult *res,
3764 GError **error)
3765 {
3766 GObject *ret;
3767 GObject *source_object;
3768 source_object = g_async_result_get_source_object (res);
3769 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
3770 g_object_unref (source_object);
3771 if (ret != NULL)
3772 return GSD_REMOTE_DESKTOP_RDP_SERVER (ret);
3773 else
3774 return NULL;
3775 }
3776
3777 /**
3778 * gsd_remote_desktop_rdp_server_proxy_new_for_bus_sync:
3779 * @bus_type: A #GBusType.
3780 * @flags: Flags from the #GDBusProxyFlags enumeration.
3781 * @name: A bus name (well-known or unique).
3782 * @object_path: An object path.
3783 * @cancellable: (nullable): A #GCancellable or %NULL.
3784 * @error: Return location for error or %NULL
3785 *
3786 * Like gsd_remote_desktop_rdp_server_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
3787 *
3788 * The calling thread is blocked until a reply is received.
3789 *
3790 * See gsd_remote_desktop_rdp_server_proxy_new_for_bus() for the asynchronous version of this constructor.
3791 *
3792 * Returns: (transfer full) (type GsdRemoteDesktopRdpServerProxy): The constructed proxy object or %NULL if @error is set.
3793 */
3794 GsdRemoteDesktopRdpServer *
3795 gsd_remote_desktop_rdp_server_proxy_new_for_bus_sync (
3796 GBusType bus_type,
3797 GDBusProxyFlags flags,
3798 const gchar *name,
3799 const gchar *object_path,
3800 GCancellable *cancellable,
3801 GError **error)
3802 {
3803 GInitable *ret;
3804 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop.Rdp.Server", NULL);
3805 if (ret != NULL)
3806 return GSD_REMOTE_DESKTOP_RDP_SERVER (ret);
3807 else
3808 return NULL;
3809 }
3810
3811
3812 /* ------------------------------------------------------------------------ */
3813
3814 /**
3815 * GsdRemoteDesktopRdpServerSkeleton:
3816 *
3817 * The #GsdRemoteDesktopRdpServerSkeleton structure contains only private data and should only be accessed using the provided API.
3818 */
3819
3820 /**
3821 * GsdRemoteDesktopRdpServerSkeletonClass:
3822 * @parent_class: The parent class.
3823 *
3824 * Class structure for #GsdRemoteDesktopRdpServerSkeleton.
3825 */
3826
3827 struct _GsdRemoteDesktopRdpServerSkeletonPrivate
3828 {
3829 GValue *properties;
3830 GList *changed_properties;
3831 GSource *changed_properties_idle_source;
3832 GMainContext *context;
3833 GMutex lock;
3834 };
3835
3836 static void
3837 _gsd_remote_desktop_rdp_server_skeleton_handle_method_call (
3838 GDBusConnection *connection G_GNUC_UNUSED,
3839 const gchar *sender G_GNUC_UNUSED,
3840 const gchar *object_path G_GNUC_UNUSED,
3841 const gchar *interface_name,
3842 const gchar *method_name,
3843 GVariant *parameters,
3844 GDBusMethodInvocation *invocation,
3845 gpointer user_data)
3846 {
3847 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (user_data);
3848 _ExtendedGDBusMethodInfo *info;
3849 GVariantIter iter;
3850 GVariant *child;
3851 GValue *paramv;
3852 gsize num_params;
3853 guint num_extra;
3854 gsize n;
3855 guint signal_id;
3856 GValue return_value = G_VALUE_INIT;
3857 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
3858 g_assert (info != NULL);
3859 num_params = g_variant_n_children (parameters);
3860 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
3861 n = 0;
3862 g_value_init (&paramv[n], GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER);
3863 g_value_set_object (&paramv[n++], skeleton);
3864 g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
3865 g_value_set_object (&paramv[n++], invocation);
3866 if (info->pass_fdlist)
3867 {
3868 #ifdef G_OS_UNIX
3869 g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
3870 g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
3871 #else
3872 g_assert_not_reached ();
3873 #endif
3874 }
3875 g_variant_iter_init (&iter, parameters);
3876 while ((child = g_variant_iter_next_value (&iter)) != NULL)
3877 {
3878 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
3879 if (arg_info->use_gvariant)
3880 {
3881 g_value_init (&paramv[n], G_TYPE_VARIANT);
3882 g_value_set_variant (&paramv[n], child);
3883 n++;
3884 }
3885 else
3886 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
3887 g_variant_unref (child);
3888 }
3889 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER);
3890 g_value_init (&return_value, G_TYPE_BOOLEAN);
3891 g_signal_emitv (paramv, signal_id, 0, &return_value);
3892 if (!g_value_get_boolean (&return_value))
3893 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);
3894 g_value_unset (&return_value);
3895 for (n = 0; n < num_params + num_extra; n++)
3896 g_value_unset (&paramv[n]);
3897 g_free (paramv);
3898 }
3899
3900 static GVariant *
3901 _gsd_remote_desktop_rdp_server_skeleton_handle_get_property (
3902 GDBusConnection *connection G_GNUC_UNUSED,
3903 const gchar *sender G_GNUC_UNUSED,
3904 const gchar *object_path G_GNUC_UNUSED,
3905 const gchar *interface_name G_GNUC_UNUSED,
3906 const gchar *property_name,
3907 GError **error,
3908 gpointer user_data)
3909 {
3910 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (user_data);
3911 GValue value = G_VALUE_INIT;
3912 GParamSpec *pspec;
3913 _ExtendedGDBusPropertyInfo *info;
3914 GVariant *ret;
3915 ret = NULL;
3916 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_server_interface_info.parent_struct, property_name);
3917 g_assert (info != NULL);
3918 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
3919 if (pspec == NULL)
3920 {
3921 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3922 }
3923 else
3924 {
3925 g_value_init (&value, pspec->value_type);
3926 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
3927 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
3928 g_value_unset (&value);
3929 }
3930 return ret;
3931 }
3932
3933 static gboolean
3934 _gsd_remote_desktop_rdp_server_skeleton_handle_set_property (
3935 GDBusConnection *connection G_GNUC_UNUSED,
3936 const gchar *sender G_GNUC_UNUSED,
3937 const gchar *object_path G_GNUC_UNUSED,
3938 const gchar *interface_name G_GNUC_UNUSED,
3939 const gchar *property_name,
3940 GVariant *variant,
3941 GError **error,
3942 gpointer user_data)
3943 {
3944 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (user_data);
3945 GValue value = G_VALUE_INIT;
3946 GParamSpec *pspec;
3947 _ExtendedGDBusPropertyInfo *info;
3948 gboolean ret;
3949 ret = FALSE;
3950 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_server_interface_info.parent_struct, property_name);
3951 g_assert (info != NULL);
3952 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
3953 if (pspec == NULL)
3954 {
3955 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
3956 }
3957 else
3958 {
3959 if (info->use_gvariant)
3960 g_value_set_variant (&value, variant);
3961 else
3962 g_dbus_gvariant_to_gvalue (variant, &value);
3963 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
3964 g_value_unset (&value);
3965 ret = TRUE;
3966 }
3967 return ret;
3968 }
3969
3970 static const GDBusInterfaceVTable _gsd_remote_desktop_rdp_server_skeleton_vtable =
3971 {
3972 _gsd_remote_desktop_rdp_server_skeleton_handle_method_call,
3973 _gsd_remote_desktop_rdp_server_skeleton_handle_get_property,
3974 _gsd_remote_desktop_rdp_server_skeleton_handle_set_property,
3975 {NULL}
3976 };
3977
3978 static GDBusInterfaceInfo *
3979 gsd_remote_desktop_rdp_server_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3980 {
3981 return gsd_remote_desktop_rdp_server_interface_info ();
3982 }
3983
3984 static GDBusInterfaceVTable *
3985 gsd_remote_desktop_rdp_server_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
3986 {
3987 return (GDBusInterfaceVTable *) &_gsd_remote_desktop_rdp_server_skeleton_vtable;
3988 }
3989
3990 static GVariant *
3991 gsd_remote_desktop_rdp_server_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
3992 {
3993 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (_skeleton);
3994
3995 GVariantBuilder builder;
3996 guint n;
3997 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
3998 if (_gsd_remote_desktop_rdp_server_interface_info.parent_struct.properties == NULL)
3999 goto out;
4000 for (n = 0; _gsd_remote_desktop_rdp_server_interface_info.parent_struct.properties[n] != NULL; n++)
4001 {
4002 GDBusPropertyInfo *info = _gsd_remote_desktop_rdp_server_interface_info.parent_struct.properties[n];
4003 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
4004 {
4005 GVariant *value;
4006 value = _gsd_remote_desktop_rdp_server_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.RemoteDesktop.Rdp.Server", info->name, NULL, skeleton);
4007 if (value != NULL)
4008 {
4009 g_variant_take_ref (value);
4010 g_variant_builder_add (&builder, "{sv}", info->name, value);
4011 g_variant_unref (value);
4012 }
4013 }
4014 }
4015 out:
4016 return g_variant_builder_end (&builder);
4017 }
4018
4019 static gboolean _gsd_remote_desktop_rdp_server_emit_changed (gpointer user_data);
4020
4021 static void
4022 gsd_remote_desktop_rdp_server_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
4023 {
4024 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (_skeleton);
4025 gboolean emit_changed = FALSE;
4026
4027 g_mutex_lock (&skeleton->priv->lock);
4028 if (skeleton->priv->changed_properties_idle_source != NULL)
4029 {
4030 g_source_destroy (skeleton->priv->changed_properties_idle_source);
4031 skeleton->priv->changed_properties_idle_source = NULL;
4032 emit_changed = TRUE;
4033 }
4034 g_mutex_unlock (&skeleton->priv->lock);
4035
4036 if (emit_changed)
4037 _gsd_remote_desktop_rdp_server_emit_changed (skeleton);
4038 }
4039
4040 static void
4041 _gsd_remote_desktop_rdp_server_on_signal_binding (
4042 GsdRemoteDesktopRdpServer *object,
4043 gint arg_port)
4044 {
4045 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4046
4047 GList *connections, *l;
4048 GVariant *signal_variant;
4049 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
4050
4051 signal_variant = g_variant_ref_sink (g_variant_new ("(i)",
4052 arg_port));
4053 for (l = connections; l != NULL; l = l->next)
4054 {
4055 GDBusConnection *connection = l->data;
4056 g_dbus_connection_emit_signal (connection,
4057 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.gnome.RemoteDesktop.Rdp.Server", "Binding",
4058 signal_variant, NULL);
4059 }
4060 g_variant_unref (signal_variant);
4061 g_list_free_full (connections, g_object_unref);
4062 }
4063
4064 static void gsd_remote_desktop_rdp_server_skeleton_iface_init (GsdRemoteDesktopRdpServerIface *iface);
4065 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4066 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpServerSkeleton, gsd_remote_desktop_rdp_server_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
4067 G_ADD_PRIVATE (GsdRemoteDesktopRdpServerSkeleton)
4068 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER, gsd_remote_desktop_rdp_server_skeleton_iface_init))
4069
4070 #else
4071 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpServerSkeleton, gsd_remote_desktop_rdp_server_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
4072 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER, gsd_remote_desktop_rdp_server_skeleton_iface_init))
4073
4074 #endif
4075 static void
4076 gsd_remote_desktop_rdp_server_skeleton_finalize (GObject *object)
4077 {
4078 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4079 guint n;
4080 for (n = 0; n < 7; n++)
4081 g_value_unset (&skeleton->priv->properties[n]);
4082 g_free (skeleton->priv->properties);
4083 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
4084 if (skeleton->priv->changed_properties_idle_source != NULL)
4085 g_source_destroy (skeleton->priv->changed_properties_idle_source);
4086 g_main_context_unref (skeleton->priv->context);
4087 g_mutex_clear (&skeleton->priv->lock);
4088 G_OBJECT_CLASS (gsd_remote_desktop_rdp_server_skeleton_parent_class)->finalize (object);
4089 }
4090
4091 static void
4092 gsd_remote_desktop_rdp_server_skeleton_get_property (GObject *object,
4093 guint prop_id,
4094 GValue *value,
4095 GParamSpec *pspec G_GNUC_UNUSED)
4096 {
4097 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4098 g_assert (prop_id != 0 && prop_id - 1 < 7);
4099 g_mutex_lock (&skeleton->priv->lock);
4100 g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
4101 g_mutex_unlock (&skeleton->priv->lock);
4102 }
4103
4104 static gboolean
4105 _gsd_remote_desktop_rdp_server_emit_changed (gpointer user_data)
4106 {
4107 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (user_data);
4108 GList *l;
4109 GVariantBuilder builder;
4110 GVariantBuilder invalidated_builder;
4111 guint num_changes;
4112
4113 g_mutex_lock (&skeleton->priv->lock);
4114 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
4115 g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
4116 for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
4117 {
4118 ChangedProperty *cp = l->data;
4119 GVariant *variant;
4120 const GValue *cur_value;
4121
4122 cur_value = &skeleton->priv->properties[cp->prop_id - 1];
4123 if (!_g_value_equal (cur_value, &cp->orig_value))
4124 {
4125 variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
4126 g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
4127 g_variant_unref (variant);
4128 num_changes++;
4129 }
4130 }
4131 if (num_changes > 0)
4132 {
4133 GList *connections, *ll;
4134 GVariant *signal_variant;
4135 signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.gnome.RemoteDesktop.Rdp.Server",
4136 &builder, &invalidated_builder));
4137 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
4138 for (ll = connections; ll != NULL; ll = ll->next)
4139 {
4140 GDBusConnection *connection = ll->data;
4141
4142 g_dbus_connection_emit_signal (connection,
4143 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
4144 "org.freedesktop.DBus.Properties",
4145 "PropertiesChanged",
4146 signal_variant,
4147 NULL);
4148 }
4149 g_variant_unref (signal_variant);
4150 g_list_free_full (connections, g_object_unref);
4151 }
4152 else
4153 {
4154 g_variant_builder_clear (&builder);
4155 g_variant_builder_clear (&invalidated_builder);
4156 }
4157 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
4158 skeleton->priv->changed_properties = NULL;
4159 skeleton->priv->changed_properties_idle_source = NULL;
4160 g_mutex_unlock (&skeleton->priv->lock);
4161 return FALSE;
4162 }
4163
4164 static void
4165 _gsd_remote_desktop_rdp_server_schedule_emit_changed (GsdRemoteDesktopRdpServerSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
4166 {
4167 ChangedProperty *cp;
4168 GList *l;
4169 cp = NULL;
4170 for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
4171 {
4172 ChangedProperty *i_cp = l->data;
4173 if (i_cp->info == info)
4174 {
4175 cp = i_cp;
4176 break;
4177 }
4178 }
4179 if (cp == NULL)
4180 {
4181 cp = g_new0 (ChangedProperty, 1);
4182 cp->prop_id = prop_id;
4183 cp->info = info;
4184 skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
4185 g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
4186 g_value_copy (orig_value, &cp->orig_value);
4187 }
4188 }
4189
4190 static void
4191 gsd_remote_desktop_rdp_server_skeleton_notify (GObject *object,
4192 GParamSpec *pspec G_GNUC_UNUSED)
4193 {
4194 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4195 g_mutex_lock (&skeleton->priv->lock);
4196 if (skeleton->priv->changed_properties != NULL &&
4197 skeleton->priv->changed_properties_idle_source == NULL)
4198 {
4199 skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
4200 g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
4201 g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gsd_remote_desktop_rdp_server_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
4202 g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gsd_remote_desktop_rdp_server_emit_changed");
4203 g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
4204 g_source_unref (skeleton->priv->changed_properties_idle_source);
4205 }
4206 g_mutex_unlock (&skeleton->priv->lock);
4207 }
4208
4209 static void
4210 gsd_remote_desktop_rdp_server_skeleton_set_property (GObject *object,
4211 guint prop_id,
4212 const GValue *value,
4213 GParamSpec *pspec)
4214 {
4215 const _ExtendedGDBusPropertyInfo *info;
4216 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4217 g_assert (prop_id != 0 && prop_id - 1 < 7);
4218 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_rdp_server_property_info_pointers[prop_id - 1];
4219 g_mutex_lock (&skeleton->priv->lock);
4220 g_object_freeze_notify (object);
4221 if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
4222 {
4223 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
4224 info->emits_changed_signal)
4225 _gsd_remote_desktop_rdp_server_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
4226 g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
4227 g_object_notify_by_pspec (object, pspec);
4228 }
4229 g_mutex_unlock (&skeleton->priv->lock);
4230 g_object_thaw_notify (object);
4231 }
4232
4233 static void
4234 gsd_remote_desktop_rdp_server_skeleton_init (GsdRemoteDesktopRdpServerSkeleton *skeleton)
4235 {
4236 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4237 skeleton->priv = gsd_remote_desktop_rdp_server_skeleton_get_instance_private (skeleton);
4238 #else
4239 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER_SKELETON, GsdRemoteDesktopRdpServerSkeletonPrivate);
4240 #endif
4241
4242 g_mutex_init (&skeleton->priv->lock);
4243 skeleton->priv->context = g_main_context_ref_thread_default ();
4244 skeleton->priv->properties = g_new0 (GValue, 7);
4245 g_value_init (&skeleton->priv->properties[0], G_TYPE_BOOLEAN);
4246 g_value_init (&skeleton->priv->properties[1], G_TYPE_INT);
4247 g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN);
4248 g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING);
4249 g_value_init (&skeleton->priv->properties[4], G_TYPE_STRING);
4250 g_value_init (&skeleton->priv->properties[5], G_TYPE_STRING);
4251 g_value_init (&skeleton->priv->properties[6], G_TYPE_BOOLEAN);
4252 }
4253
4254 static gboolean
4255 gsd_remote_desktop_rdp_server_skeleton_get_enabled (GsdRemoteDesktopRdpServer *object)
4256 {
4257 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4258 gboolean value;
4259 g_mutex_lock (&skeleton->priv->lock);
4260 value = g_marshal_value_peek_boolean (&(skeleton->priv->properties[0]));
4261 g_mutex_unlock (&skeleton->priv->lock);
4262 return value;
4263 }
4264
4265 static gint
4266 gsd_remote_desktop_rdp_server_skeleton_get_port (GsdRemoteDesktopRdpServer *object)
4267 {
4268 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4269 gint value;
4270 g_mutex_lock (&skeleton->priv->lock);
4271 value = g_marshal_value_peek_int (&(skeleton->priv->properties[1]));
4272 g_mutex_unlock (&skeleton->priv->lock);
4273 return value;
4274 }
4275
4276 static gboolean
4277 gsd_remote_desktop_rdp_server_skeleton_get_negotiate_port (GsdRemoteDesktopRdpServer *object)
4278 {
4279 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4280 gboolean value;
4281 g_mutex_lock (&skeleton->priv->lock);
4282 value = g_marshal_value_peek_boolean (&(skeleton->priv->properties[2]));
4283 g_mutex_unlock (&skeleton->priv->lock);
4284 return value;
4285 }
4286
4287 static const gchar *
4288 gsd_remote_desktop_rdp_server_skeleton_get_tls_cert (GsdRemoteDesktopRdpServer *object)
4289 {
4290 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4291 const gchar *value;
4292 g_mutex_lock (&skeleton->priv->lock);
4293 value = g_marshal_value_peek_string (&(skeleton->priv->properties[3]));
4294 g_mutex_unlock (&skeleton->priv->lock);
4295 return value;
4296 }
4297
4298 static const gchar *
4299 gsd_remote_desktop_rdp_server_skeleton_get_tls_fingerprint (GsdRemoteDesktopRdpServer *object)
4300 {
4301 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4302 const gchar *value;
4303 g_mutex_lock (&skeleton->priv->lock);
4304 value = g_marshal_value_peek_string (&(skeleton->priv->properties[4]));
4305 g_mutex_unlock (&skeleton->priv->lock);
4306 return value;
4307 }
4308
4309 static const gchar *
4310 gsd_remote_desktop_rdp_server_skeleton_get_tls_key (GsdRemoteDesktopRdpServer *object)
4311 {
4312 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4313 const gchar *value;
4314 g_mutex_lock (&skeleton->priv->lock);
4315 value = g_marshal_value_peek_string (&(skeleton->priv->properties[5]));
4316 g_mutex_unlock (&skeleton->priv->lock);
4317 return value;
4318 }
4319
4320 static gboolean
4321 gsd_remote_desktop_rdp_server_skeleton_get_view_only (GsdRemoteDesktopRdpServer *object)
4322 {
4323 GsdRemoteDesktopRdpServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_SERVER_SKELETON (object);
4324 gboolean value;
4325 g_mutex_lock (&skeleton->priv->lock);
4326 value = g_marshal_value_peek_boolean (&(skeleton->priv->properties[6]));
4327 g_mutex_unlock (&skeleton->priv->lock);
4328 return value;
4329 }
4330
4331 static void
4332 gsd_remote_desktop_rdp_server_skeleton_class_init (GsdRemoteDesktopRdpServerSkeletonClass *klass)
4333 {
4334 GObjectClass *gobject_class;
4335 GDBusInterfaceSkeletonClass *skeleton_class;
4336
4337 gobject_class = G_OBJECT_CLASS (klass);
4338 gobject_class->finalize = gsd_remote_desktop_rdp_server_skeleton_finalize;
4339 gobject_class->get_property = gsd_remote_desktop_rdp_server_skeleton_get_property;
4340 gobject_class->set_property = gsd_remote_desktop_rdp_server_skeleton_set_property;
4341 gobject_class->notify = gsd_remote_desktop_rdp_server_skeleton_notify;
4342
4343
4344 gsd_remote_desktop_rdp_server_override_properties (gobject_class, 1);
4345
4346 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
4347 skeleton_class->get_info = gsd_remote_desktop_rdp_server_skeleton_dbus_interface_get_info;
4348 skeleton_class->get_properties = gsd_remote_desktop_rdp_server_skeleton_dbus_interface_get_properties;
4349 skeleton_class->flush = gsd_remote_desktop_rdp_server_skeleton_dbus_interface_flush;
4350 skeleton_class->get_vtable = gsd_remote_desktop_rdp_server_skeleton_dbus_interface_get_vtable;
4351
4352 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
4353 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopRdpServerSkeletonPrivate));
4354 #endif
4355 }
4356
4357 static void
4358 gsd_remote_desktop_rdp_server_skeleton_iface_init (GsdRemoteDesktopRdpServerIface *iface)
4359 {
4360 iface->binding = _gsd_remote_desktop_rdp_server_on_signal_binding;
4361 iface->get_enabled = gsd_remote_desktop_rdp_server_skeleton_get_enabled;
4362 iface->get_port = gsd_remote_desktop_rdp_server_skeleton_get_port;
4363 iface->get_negotiate_port = gsd_remote_desktop_rdp_server_skeleton_get_negotiate_port;
4364 iface->get_tls_cert = gsd_remote_desktop_rdp_server_skeleton_get_tls_cert;
4365 iface->get_tls_fingerprint = gsd_remote_desktop_rdp_server_skeleton_get_tls_fingerprint;
4366 iface->get_tls_key = gsd_remote_desktop_rdp_server_skeleton_get_tls_key;
4367 iface->get_view_only = gsd_remote_desktop_rdp_server_skeleton_get_view_only;
4368 }
4369
4370 /**
4371 * gsd_remote_desktop_rdp_server_skeleton_new:
4372 *
4373 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Server.top_of_page">org.gnome.RemoteDesktop.Rdp.Server</link>.
4374 *
4375 * Returns: (transfer full) (type GsdRemoteDesktopRdpServerSkeleton): The skeleton object.
4376 */
4377 GsdRemoteDesktopRdpServer *
4378 gsd_remote_desktop_rdp_server_skeleton_new (void)
4379 {
4380 return GSD_REMOTE_DESKTOP_RDP_SERVER (g_object_new (GSD_TYPE_REMOTE_DESKTOP_RDP_SERVER_SKELETON, NULL));
4381 }
4382
4383 /* ------------------------------------------------------------------------
4384 * Code for interface org.gnome.RemoteDesktop.Vnc.Server
4385 * ------------------------------------------------------------------------
4386 */
4387
4388 /**
4389 * SECTION:GsdRemoteDesktopVncServer
4390 * @title: GsdRemoteDesktopVncServer
4391 * @short_description: Generated C code for the org.gnome.RemoteDesktop.Vnc.Server D-Bus interface
4392 *
4393 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Vnc-Server.top_of_page">org.gnome.RemoteDesktop.Vnc.Server</link> D-Bus interface in C.
4394 */
4395
4396 /* ---- Introspection data for org.gnome.RemoteDesktop.Vnc.Server ---- */
4397
4398 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_vnc_server_property_info_enabled =
4399 {
4400 {
4401 -1,
4402 (gchar *) "Enabled",
4403 (gchar *) "b",
4404 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
4405 NULL
4406 },
4407 "enabled",
4408 FALSE,
4409 TRUE
4410 };
4411
4412 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_vnc_server_property_info_port =
4413 {
4414 {
4415 -1,
4416 (gchar *) "Port",
4417 (gchar *) "i",
4418 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
4419 NULL
4420 },
4421 "port",
4422 FALSE,
4423 TRUE
4424 };
4425
4426 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_vnc_server_property_info_negotiate_port =
4427 {
4428 {
4429 -1,
4430 (gchar *) "NegotiatePort",
4431 (gchar *) "b",
4432 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
4433 NULL
4434 },
4435 "negotiate-port",
4436 FALSE,
4437 TRUE
4438 };
4439
4440 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_vnc_server_property_info_auth_method =
4441 {
4442 {
4443 -1,
4444 (gchar *) "AuthMethod",
4445 (gchar *) "s",
4446 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
4447 NULL
4448 },
4449 "auth-method",
4450 FALSE,
4451 TRUE
4452 };
4453
4454 static const _ExtendedGDBusPropertyInfo _gsd_remote_desktop_vnc_server_property_info_view_only =
4455 {
4456 {
4457 -1,
4458 (gchar *) "ViewOnly",
4459 (gchar *) "b",
4460 G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
4461 NULL
4462 },
4463 "view-only",
4464 FALSE,
4465 TRUE
4466 };
4467
4468 static const GDBusPropertyInfo * const _gsd_remote_desktop_vnc_server_property_info_pointers[] =
4469 {
4470 &_gsd_remote_desktop_vnc_server_property_info_enabled.parent_struct,
4471 &_gsd_remote_desktop_vnc_server_property_info_port.parent_struct,
4472 &_gsd_remote_desktop_vnc_server_property_info_negotiate_port.parent_struct,
4473 &_gsd_remote_desktop_vnc_server_property_info_auth_method.parent_struct,
4474 &_gsd_remote_desktop_vnc_server_property_info_view_only.parent_struct,
4475 NULL
4476 };
4477
4478 static const _ExtendedGDBusInterfaceInfo _gsd_remote_desktop_vnc_server_interface_info =
4479 {
4480 {
4481 -1,
4482 (gchar *) "org.gnome.RemoteDesktop.Vnc.Server",
4483 NULL,
4484 NULL,
4485 (GDBusPropertyInfo **) &_gsd_remote_desktop_vnc_server_property_info_pointers,
4486 NULL
4487 },
4488 "remote-desktop-vnc-server",
4489 };
4490
4491
4492 /**
4493 * gsd_remote_desktop_vnc_server_interface_info:
4494 *
4495 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Vnc-Server.top_of_page">org.gnome.RemoteDesktop.Vnc.Server</link> D-Bus interface.
4496 *
4497 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
4498 */
4499 GDBusInterfaceInfo *
4500 gsd_remote_desktop_vnc_server_interface_info (void)
4501 {
4502 return (GDBusInterfaceInfo *) &_gsd_remote_desktop_vnc_server_interface_info.parent_struct;
4503 }
4504
4505 /**
4506 * gsd_remote_desktop_vnc_server_override_properties:
4507 * @klass: The class structure for a #GObject derived class.
4508 * @property_id_begin: The property id to assign to the first overridden property.
4509 *
4510 * Overrides all #GObject properties in the #GsdRemoteDesktopVncServer interface for a concrete class.
4511 * The properties are overridden in the order they are defined.
4512 *
4513 * Returns: The last property id.
4514 */
4515 guint
4516 gsd_remote_desktop_vnc_server_override_properties (GObjectClass *klass, guint property_id_begin)
4517 {
4518 g_object_class_override_property (klass, property_id_begin++, "enabled");
4519 g_object_class_override_property (klass, property_id_begin++, "port");
4520 g_object_class_override_property (klass, property_id_begin++, "negotiate-port");
4521 g_object_class_override_property (klass, property_id_begin++, "auth-method");
4522 g_object_class_override_property (klass, property_id_begin++, "view-only");
4523 return property_id_begin - 1;
4524 }
4525
4526
4527
4528 /**
4529 * GsdRemoteDesktopVncServer:
4530 *
4531 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Vnc-Server.top_of_page">org.gnome.RemoteDesktop.Vnc.Server</link>.
4532 */
4533
4534 /**
4535 * GsdRemoteDesktopVncServerIface:
4536 * @parent_iface: The parent interface.
4537 * @get_auth_method: Getter for the #GsdRemoteDesktopVncServer:auth-method property.
4538 * @get_enabled: Getter for the #GsdRemoteDesktopVncServer:enabled property.
4539 * @get_negotiate_port: Getter for the #GsdRemoteDesktopVncServer:negotiate-port property.
4540 * @get_port: Getter for the #GsdRemoteDesktopVncServer:port property.
4541 * @get_view_only: Getter for the #GsdRemoteDesktopVncServer:view-only property.
4542 *
4543 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Vnc-Server.top_of_page">org.gnome.RemoteDesktop.Vnc.Server</link>.
4544 */
4545
4546 typedef GsdRemoteDesktopVncServerIface GsdRemoteDesktopVncServerInterface;
4547 G_DEFINE_INTERFACE (GsdRemoteDesktopVncServer, gsd_remote_desktop_vnc_server, G_TYPE_OBJECT)
4548
4549 static void
4550 gsd_remote_desktop_vnc_server_default_init (GsdRemoteDesktopVncServerIface *iface)
4551 {
4552 /* GObject properties for D-Bus properties: */
4553 /**
4554 * GsdRemoteDesktopVncServer:enabled:
4555 *
4556 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.Enabled">"Enabled"</link>.
4557 *
4558 * 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.
4559 */
4560 g_object_interface_install_property (iface,
4561 g_param_spec_boolean ("enabled", "Enabled", "Enabled", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4562 /**
4563 * GsdRemoteDesktopVncServer:port:
4564 *
4565 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.Port">"Port"</link>.
4566 *
4567 * 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.
4568 */
4569 g_object_interface_install_property (iface,
4570 g_param_spec_int ("port", "Port", "Port", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4571 /**
4572 * GsdRemoteDesktopVncServer:negotiate-port:
4573 *
4574 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.NegotiatePort">"NegotiatePort"</link>.
4575 *
4576 * 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.
4577 */
4578 g_object_interface_install_property (iface,
4579 g_param_spec_boolean ("negotiate-port", "NegotiatePort", "NegotiatePort", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4580 /**
4581 * GsdRemoteDesktopVncServer:auth-method:
4582 *
4583 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.AuthMethod">"AuthMethod"</link>.
4584 *
4585 * 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.
4586 */
4587 g_object_interface_install_property (iface,
4588 g_param_spec_string ("auth-method", "AuthMethod", "AuthMethod", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4589 /**
4590 * GsdRemoteDesktopVncServer:view-only:
4591 *
4592 * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.ViewOnly">"ViewOnly"</link>.
4593 *
4594 * 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.
4595 */
4596 g_object_interface_install_property (iface,
4597 g_param_spec_boolean ("view-only", "ViewOnly", "ViewOnly", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
4598 }
4599
4600 /**
4601 * gsd_remote_desktop_vnc_server_get_enabled: (skip)
4602 * @object: A #GsdRemoteDesktopVncServer.
4603 *
4604 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.Enabled">"Enabled"</link> D-Bus property.
4605 *
4606 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4607 *
4608 * Returns: The property value.
4609 */
4610 gboolean
4611 gsd_remote_desktop_vnc_server_get_enabled (GsdRemoteDesktopVncServer *object)
4612 {
4613 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_VNC_SERVER (object), FALSE);
4614
4615 return GSD_REMOTE_DESKTOP_VNC_SERVER_GET_IFACE (object)->get_enabled (object);
4616 }
4617
4618 /**
4619 * gsd_remote_desktop_vnc_server_set_enabled: (skip)
4620 * @object: A #GsdRemoteDesktopVncServer.
4621 * @value: The value to set.
4622 *
4623 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.Enabled">"Enabled"</link> D-Bus property to @value.
4624 *
4625 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4626 */
4627 void
4628 gsd_remote_desktop_vnc_server_set_enabled (GsdRemoteDesktopVncServer *object, gboolean value)
4629 {
4630 g_object_set (G_OBJECT (object), "enabled", value, NULL);
4631 }
4632
4633 /**
4634 * gsd_remote_desktop_vnc_server_get_port: (skip)
4635 * @object: A #GsdRemoteDesktopVncServer.
4636 *
4637 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.Port">"Port"</link> D-Bus property.
4638 *
4639 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4640 *
4641 * Returns: The property value.
4642 */
4643 gint
4644 gsd_remote_desktop_vnc_server_get_port (GsdRemoteDesktopVncServer *object)
4645 {
4646 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_VNC_SERVER (object), 0);
4647
4648 return GSD_REMOTE_DESKTOP_VNC_SERVER_GET_IFACE (object)->get_port (object);
4649 }
4650
4651 /**
4652 * gsd_remote_desktop_vnc_server_set_port: (skip)
4653 * @object: A #GsdRemoteDesktopVncServer.
4654 * @value: The value to set.
4655 *
4656 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.Port">"Port"</link> D-Bus property to @value.
4657 *
4658 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4659 */
4660 void
4661 gsd_remote_desktop_vnc_server_set_port (GsdRemoteDesktopVncServer *object, gint value)
4662 {
4663 g_object_set (G_OBJECT (object), "port", value, NULL);
4664 }
4665
4666 /**
4667 * gsd_remote_desktop_vnc_server_get_negotiate_port: (skip)
4668 * @object: A #GsdRemoteDesktopVncServer.
4669 *
4670 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.NegotiatePort">"NegotiatePort"</link> D-Bus property.
4671 *
4672 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4673 *
4674 * Returns: The property value.
4675 */
4676 gboolean
4677 gsd_remote_desktop_vnc_server_get_negotiate_port (GsdRemoteDesktopVncServer *object)
4678 {
4679 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_VNC_SERVER (object), FALSE);
4680
4681 return GSD_REMOTE_DESKTOP_VNC_SERVER_GET_IFACE (object)->get_negotiate_port (object);
4682 }
4683
4684 /**
4685 * gsd_remote_desktop_vnc_server_set_negotiate_port: (skip)
4686 * @object: A #GsdRemoteDesktopVncServer.
4687 * @value: The value to set.
4688 *
4689 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.NegotiatePort">"NegotiatePort"</link> D-Bus property to @value.
4690 *
4691 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4692 */
4693 void
4694 gsd_remote_desktop_vnc_server_set_negotiate_port (GsdRemoteDesktopVncServer *object, gboolean value)
4695 {
4696 g_object_set (G_OBJECT (object), "negotiate-port", value, NULL);
4697 }
4698
4699 /**
4700 * gsd_remote_desktop_vnc_server_get_auth_method: (skip)
4701 * @object: A #GsdRemoteDesktopVncServer.
4702 *
4703 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.AuthMethod">"AuthMethod"</link> D-Bus property.
4704 *
4705 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4706 *
4707 * 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 gsd_remote_desktop_vnc_server_dup_auth_method() if on another thread.
4708 *
4709 * 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.
4710 */
4711 const gchar *
4712 gsd_remote_desktop_vnc_server_get_auth_method (GsdRemoteDesktopVncServer *object)
4713 {
4714 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_VNC_SERVER (object), NULL);
4715
4716 return GSD_REMOTE_DESKTOP_VNC_SERVER_GET_IFACE (object)->get_auth_method (object);
4717 }
4718
4719 /**
4720 * gsd_remote_desktop_vnc_server_dup_auth_method: (skip)
4721 * @object: A #GsdRemoteDesktopVncServer.
4722 *
4723 * Gets a copy of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.AuthMethod">"AuthMethod"</link> D-Bus property.
4724 *
4725 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4726 *
4727 * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
4728 */
4729 gchar *
4730 gsd_remote_desktop_vnc_server_dup_auth_method (GsdRemoteDesktopVncServer *object)
4731 {
4732 gchar *value;
4733 g_object_get (G_OBJECT (object), "auth-method", &value, NULL);
4734 return value;
4735 }
4736
4737 /**
4738 * gsd_remote_desktop_vnc_server_set_auth_method: (skip)
4739 * @object: A #GsdRemoteDesktopVncServer.
4740 * @value: The value to set.
4741 *
4742 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.AuthMethod">"AuthMethod"</link> D-Bus property to @value.
4743 *
4744 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4745 */
4746 void
4747 gsd_remote_desktop_vnc_server_set_auth_method (GsdRemoteDesktopVncServer *object, const gchar *value)
4748 {
4749 g_object_set (G_OBJECT (object), "auth-method", value, NULL);
4750 }
4751
4752 /**
4753 * gsd_remote_desktop_vnc_server_get_view_only: (skip)
4754 * @object: A #GsdRemoteDesktopVncServer.
4755 *
4756 * Gets the value of the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.ViewOnly">"ViewOnly"</link> D-Bus property.
4757 *
4758 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
4759 *
4760 * Returns: The property value.
4761 */
4762 gboolean
4763 gsd_remote_desktop_vnc_server_get_view_only (GsdRemoteDesktopVncServer *object)
4764 {
4765 g_return_val_if_fail (GSD_IS_REMOTE_DESKTOP_VNC_SERVER (object), FALSE);
4766
4767 return GSD_REMOTE_DESKTOP_VNC_SERVER_GET_IFACE (object)->get_view_only (object);
4768 }
4769
4770 /**
4771 * gsd_remote_desktop_vnc_server_set_view_only: (skip)
4772 * @object: A #GsdRemoteDesktopVncServer.
4773 * @value: The value to set.
4774 *
4775 * Sets the <link linkend="gdbus-property-org-gnome-RemoteDesktop-Vnc-Server.ViewOnly">"ViewOnly"</link> D-Bus property to @value.
4776 *
4777 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
4778 */
4779 void
4780 gsd_remote_desktop_vnc_server_set_view_only (GsdRemoteDesktopVncServer *object, gboolean value)
4781 {
4782 g_object_set (G_OBJECT (object), "view-only", value, NULL);
4783 }
4784
4785 /* ------------------------------------------------------------------------ */
4786
4787 /**
4788 * GsdRemoteDesktopVncServerProxy:
4789 *
4790 * The #GsdRemoteDesktopVncServerProxy structure contains only private data and should only be accessed using the provided API.
4791 */
4792
4793 /**
4794 * GsdRemoteDesktopVncServerProxyClass:
4795 * @parent_class: The parent class.
4796 *
4797 * Class structure for #GsdRemoteDesktopVncServerProxy.
4798 */
4799
4800 struct _GsdRemoteDesktopVncServerProxyPrivate
4801 {
4802 GData *qdata;
4803 };
4804
4805 static void gsd_remote_desktop_vnc_server_proxy_iface_init (GsdRemoteDesktopVncServerIface *iface);
4806
4807 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
4808 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopVncServerProxy, gsd_remote_desktop_vnc_server_proxy, G_TYPE_DBUS_PROXY,
4809 G_ADD_PRIVATE (GsdRemoteDesktopVncServerProxy)
4810 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER, gsd_remote_desktop_vnc_server_proxy_iface_init))
4811
4812 #else
4813 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopVncServerProxy, gsd_remote_desktop_vnc_server_proxy, G_TYPE_DBUS_PROXY,
4814 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER, gsd_remote_desktop_vnc_server_proxy_iface_init))
4815
4816 #endif
4817 static void
4818 gsd_remote_desktop_vnc_server_proxy_finalize (GObject *object)
4819 {
4820 GsdRemoteDesktopVncServerProxy *proxy = GSD_REMOTE_DESKTOP_VNC_SERVER_PROXY (object);
4821 g_datalist_clear (&proxy->priv->qdata);
4822 G_OBJECT_CLASS (gsd_remote_desktop_vnc_server_proxy_parent_class)->finalize (object);
4823 }
4824
4825 static void
4826 gsd_remote_desktop_vnc_server_proxy_get_property (GObject *object,
4827 guint prop_id,
4828 GValue *value,
4829 GParamSpec *pspec G_GNUC_UNUSED)
4830 {
4831 const _ExtendedGDBusPropertyInfo *info;
4832 GVariant *variant;
4833 g_assert (prop_id != 0 && prop_id - 1 < 5);
4834 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_vnc_server_property_info_pointers[prop_id - 1];
4835 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
4836 if (info->use_gvariant)
4837 {
4838 g_value_set_variant (value, variant);
4839 }
4840 else
4841 {
4842 if (variant != NULL)
4843 g_dbus_gvariant_to_gvalue (variant, value);
4844 }
4845 if (variant != NULL)
4846 g_variant_unref (variant);
4847 }
4848
4849 static void
4850 gsd_remote_desktop_vnc_server_proxy_set_property_cb (GDBusProxy *proxy,
4851 GAsyncResult *res,
4852 gpointer user_data)
4853 {
4854 const _ExtendedGDBusPropertyInfo *info = user_data;
4855 GError *error;
4856 GVariant *_ret;
4857 error = NULL;
4858 _ret = g_dbus_proxy_call_finish (proxy, res, &error);
4859 if (!_ret)
4860 {
4861 g_warning ("Error setting property '%s' on interface org.gnome.RemoteDesktop.Vnc.Server: %s (%s, %d)",
4862 info->parent_struct.name,
4863 error->message, g_quark_to_string (error->domain), error->code);
4864 g_error_free (error);
4865 }
4866 else
4867 {
4868 g_variant_unref (_ret);
4869 }
4870 }
4871
4872 static void
4873 gsd_remote_desktop_vnc_server_proxy_set_property (GObject *object,
4874 guint prop_id,
4875 const GValue *value,
4876 GParamSpec *pspec G_GNUC_UNUSED)
4877 {
4878 const _ExtendedGDBusPropertyInfo *info;
4879 GVariant *variant;
4880 g_assert (prop_id != 0 && prop_id - 1 < 5);
4881 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_vnc_server_property_info_pointers[prop_id - 1];
4882 variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
4883 g_dbus_proxy_call (G_DBUS_PROXY (object),
4884 "org.freedesktop.DBus.Properties.Set",
4885 g_variant_new ("(ssv)", "org.gnome.RemoteDesktop.Vnc.Server", info->parent_struct.name, variant),
4886 G_DBUS_CALL_FLAGS_NONE,
4887 -1,
4888 NULL, (GAsyncReadyCallback) gsd_remote_desktop_vnc_server_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
4889 g_variant_unref (variant);
4890 }
4891
4892 static void
4893 gsd_remote_desktop_vnc_server_proxy_g_signal (GDBusProxy *proxy,
4894 const gchar *sender_name G_GNUC_UNUSED,
4895 const gchar *signal_name,
4896 GVariant *parameters)
4897 {
4898 _ExtendedGDBusSignalInfo *info;
4899 GVariantIter iter;
4900 GVariant *child;
4901 GValue *paramv;
4902 gsize num_params;
4903 gsize n;
4904 guint signal_id;
4905 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsd_remote_desktop_vnc_server_interface_info.parent_struct, signal_name);
4906 if (info == NULL)
4907 return;
4908 num_params = g_variant_n_children (parameters);
4909 paramv = g_new0 (GValue, num_params + 1);
4910 g_value_init (&paramv[0], GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER);
4911 g_value_set_object (&paramv[0], proxy);
4912 g_variant_iter_init (&iter, parameters);
4913 n = 1;
4914 while ((child = g_variant_iter_next_value (&iter)) != NULL)
4915 {
4916 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
4917 if (arg_info->use_gvariant)
4918 {
4919 g_value_init (&paramv[n], G_TYPE_VARIANT);
4920 g_value_set_variant (&paramv[n], child);
4921 n++;
4922 }
4923 else
4924 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
4925 g_variant_unref (child);
4926 }
4927 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER);
4928 g_signal_emitv (paramv, signal_id, 0, NULL);
4929 for (n = 0; n < num_params + 1; n++)
4930 g_value_unset (&paramv[n]);
4931 g_free (paramv);
4932 }
4933
4934 static void
4935 gsd_remote_desktop_vnc_server_proxy_g_properties_changed (GDBusProxy *_proxy,
4936 GVariant *changed_properties,
4937 const gchar *const *invalidated_properties)
4938 {
4939 GsdRemoteDesktopVncServerProxy *proxy = GSD_REMOTE_DESKTOP_VNC_SERVER_PROXY (_proxy);
4940 guint n;
4941 const gchar *key;
4942 GVariantIter *iter;
4943 _ExtendedGDBusPropertyInfo *info;
4944 g_variant_get (changed_properties, "a{sv}", &iter);
4945 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
4946 {
4947 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_vnc_server_interface_info.parent_struct, key);
4948 g_datalist_remove_data (&proxy->priv->qdata, key);
4949 if (info != NULL)
4950 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4951 }
4952 g_variant_iter_free (iter);
4953 for (n = 0; invalidated_properties[n] != NULL; n++)
4954 {
4955 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_vnc_server_interface_info.parent_struct, invalidated_properties[n]);
4956 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
4957 if (info != NULL)
4958 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
4959 }
4960 }
4961
4962 static gboolean
4963 gsd_remote_desktop_vnc_server_proxy_get_enabled (GsdRemoteDesktopVncServer *object)
4964 {
4965 GsdRemoteDesktopVncServerProxy *proxy = GSD_REMOTE_DESKTOP_VNC_SERVER_PROXY (object);
4966 GVariant *variant;
4967 gboolean value = FALSE;
4968 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Enabled");
4969 if (variant != NULL)
4970 {
4971 value = g_variant_get_boolean (variant);
4972 g_variant_unref (variant);
4973 }
4974 return value;
4975 }
4976
4977 static gint
4978 gsd_remote_desktop_vnc_server_proxy_get_port (GsdRemoteDesktopVncServer *object)
4979 {
4980 GsdRemoteDesktopVncServerProxy *proxy = GSD_REMOTE_DESKTOP_VNC_SERVER_PROXY (object);
4981 GVariant *variant;
4982 gint value = 0;
4983 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Port");
4984 if (variant != NULL)
4985 {
4986 value = g_variant_get_int32 (variant);
4987 g_variant_unref (variant);
4988 }
4989 return value;
4990 }
4991
4992 static gboolean
4993 gsd_remote_desktop_vnc_server_proxy_get_negotiate_port (GsdRemoteDesktopVncServer *object)
4994 {
4995 GsdRemoteDesktopVncServerProxy *proxy = GSD_REMOTE_DESKTOP_VNC_SERVER_PROXY (object);
4996 GVariant *variant;
4997 gboolean value = FALSE;
4998 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "NegotiatePort");
4999 if (variant != NULL)
5000 {
5001 value = g_variant_get_boolean (variant);
5002 g_variant_unref (variant);
5003 }
5004 return value;
5005 }
5006
5007 static const gchar *
5008 gsd_remote_desktop_vnc_server_proxy_get_auth_method (GsdRemoteDesktopVncServer *object)
5009 {
5010 GsdRemoteDesktopVncServerProxy *proxy = GSD_REMOTE_DESKTOP_VNC_SERVER_PROXY (object);
5011 GVariant *variant;
5012 const gchar *value = NULL;
5013 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "AuthMethod");
5014 if (variant != NULL)
5015 {
5016 value = g_variant_get_string (variant, NULL);
5017 g_variant_unref (variant);
5018 }
5019 return value;
5020 }
5021
5022 static gboolean
5023 gsd_remote_desktop_vnc_server_proxy_get_view_only (GsdRemoteDesktopVncServer *object)
5024 {
5025 GsdRemoteDesktopVncServerProxy *proxy = GSD_REMOTE_DESKTOP_VNC_SERVER_PROXY (object);
5026 GVariant *variant;
5027 gboolean value = FALSE;
5028 variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ViewOnly");
5029 if (variant != NULL)
5030 {
5031 value = g_variant_get_boolean (variant);
5032 g_variant_unref (variant);
5033 }
5034 return value;
5035 }
5036
5037 static void
5038 gsd_remote_desktop_vnc_server_proxy_init (GsdRemoteDesktopVncServerProxy *proxy)
5039 {
5040 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5041 proxy->priv = gsd_remote_desktop_vnc_server_proxy_get_instance_private (proxy);
5042 #else
5043 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER_PROXY, GsdRemoteDesktopVncServerProxyPrivate);
5044 #endif
5045
5046 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsd_remote_desktop_vnc_server_interface_info ());
5047 }
5048
5049 static void
5050 gsd_remote_desktop_vnc_server_proxy_class_init (GsdRemoteDesktopVncServerProxyClass *klass)
5051 {
5052 GObjectClass *gobject_class;
5053 GDBusProxyClass *proxy_class;
5054
5055 gobject_class = G_OBJECT_CLASS (klass);
5056 gobject_class->finalize = gsd_remote_desktop_vnc_server_proxy_finalize;
5057 gobject_class->get_property = gsd_remote_desktop_vnc_server_proxy_get_property;
5058 gobject_class->set_property = gsd_remote_desktop_vnc_server_proxy_set_property;
5059
5060 proxy_class = G_DBUS_PROXY_CLASS (klass);
5061 proxy_class->g_signal = gsd_remote_desktop_vnc_server_proxy_g_signal;
5062 proxy_class->g_properties_changed = gsd_remote_desktop_vnc_server_proxy_g_properties_changed;
5063
5064 gsd_remote_desktop_vnc_server_override_properties (gobject_class, 1);
5065
5066 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5067 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopVncServerProxyPrivate));
5068 #endif
5069 }
5070
5071 static void
5072 gsd_remote_desktop_vnc_server_proxy_iface_init (GsdRemoteDesktopVncServerIface *iface)
5073 {
5074 iface->get_enabled = gsd_remote_desktop_vnc_server_proxy_get_enabled;
5075 iface->get_port = gsd_remote_desktop_vnc_server_proxy_get_port;
5076 iface->get_negotiate_port = gsd_remote_desktop_vnc_server_proxy_get_negotiate_port;
5077 iface->get_auth_method = gsd_remote_desktop_vnc_server_proxy_get_auth_method;
5078 iface->get_view_only = gsd_remote_desktop_vnc_server_proxy_get_view_only;
5079 }
5080
5081 /**
5082 * gsd_remote_desktop_vnc_server_proxy_new:
5083 * @connection: A #GDBusConnection.
5084 * @flags: Flags from the #GDBusProxyFlags enumeration.
5085 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
5086 * @object_path: An object path.
5087 * @cancellable: (nullable): A #GCancellable or %NULL.
5088 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
5089 * @user_data: User data to pass to @callback.
5090 *
5091 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Vnc-Server.top_of_page">org.gnome.RemoteDesktop.Vnc.Server</link>. See g_dbus_proxy_new() for more details.
5092 *
5093 * 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()).
5094 * You can then call gsd_remote_desktop_vnc_server_proxy_new_finish() to get the result of the operation.
5095 *
5096 * See gsd_remote_desktop_vnc_server_proxy_new_sync() for the synchronous, blocking version of this constructor.
5097 */
5098 void
5099 gsd_remote_desktop_vnc_server_proxy_new (
5100 GDBusConnection *connection,
5101 GDBusProxyFlags flags,
5102 const gchar *name,
5103 const gchar *object_path,
5104 GCancellable *cancellable,
5105 GAsyncReadyCallback callback,
5106 gpointer user_data)
5107 {
5108 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER_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.RemoteDesktop.Vnc.Server", NULL);
5109 }
5110
5111 /**
5112 * gsd_remote_desktop_vnc_server_proxy_new_finish:
5113 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_vnc_server_proxy_new().
5114 * @error: Return location for error or %NULL
5115 *
5116 * Finishes an operation started with gsd_remote_desktop_vnc_server_proxy_new().
5117 *
5118 * Returns: (transfer full) (type GsdRemoteDesktopVncServerProxy): The constructed proxy object or %NULL if @error is set.
5119 */
5120 GsdRemoteDesktopVncServer *
5121 gsd_remote_desktop_vnc_server_proxy_new_finish (
5122 GAsyncResult *res,
5123 GError **error)
5124 {
5125 GObject *ret;
5126 GObject *source_object;
5127 source_object = g_async_result_get_source_object (res);
5128 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
5129 g_object_unref (source_object);
5130 if (ret != NULL)
5131 return GSD_REMOTE_DESKTOP_VNC_SERVER (ret);
5132 else
5133 return NULL;
5134 }
5135
5136 /**
5137 * gsd_remote_desktop_vnc_server_proxy_new_sync:
5138 * @connection: A #GDBusConnection.
5139 * @flags: Flags from the #GDBusProxyFlags enumeration.
5140 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
5141 * @object_path: An object path.
5142 * @cancellable: (nullable): A #GCancellable or %NULL.
5143 * @error: Return location for error or %NULL
5144 *
5145 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Vnc-Server.top_of_page">org.gnome.RemoteDesktop.Vnc.Server</link>. See g_dbus_proxy_new_sync() for more details.
5146 *
5147 * The calling thread is blocked until a reply is received.
5148 *
5149 * See gsd_remote_desktop_vnc_server_proxy_new() for the asynchronous version of this constructor.
5150 *
5151 * Returns: (transfer full) (type GsdRemoteDesktopVncServerProxy): The constructed proxy object or %NULL if @error is set.
5152 */
5153 GsdRemoteDesktopVncServer *
5154 gsd_remote_desktop_vnc_server_proxy_new_sync (
5155 GDBusConnection *connection,
5156 GDBusProxyFlags flags,
5157 const gchar *name,
5158 const gchar *object_path,
5159 GCancellable *cancellable,
5160 GError **error)
5161 {
5162 GInitable *ret;
5163 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop.Vnc.Server", NULL);
5164 if (ret != NULL)
5165 return GSD_REMOTE_DESKTOP_VNC_SERVER (ret);
5166 else
5167 return NULL;
5168 }
5169
5170
5171 /**
5172 * gsd_remote_desktop_vnc_server_proxy_new_for_bus:
5173 * @bus_type: A #GBusType.
5174 * @flags: Flags from the #GDBusProxyFlags enumeration.
5175 * @name: A bus name (well-known or unique).
5176 * @object_path: An object path.
5177 * @cancellable: (nullable): A #GCancellable or %NULL.
5178 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
5179 * @user_data: User data to pass to @callback.
5180 *
5181 * Like gsd_remote_desktop_vnc_server_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
5182 *
5183 * 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()).
5184 * You can then call gsd_remote_desktop_vnc_server_proxy_new_for_bus_finish() to get the result of the operation.
5185 *
5186 * See gsd_remote_desktop_vnc_server_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
5187 */
5188 void
5189 gsd_remote_desktop_vnc_server_proxy_new_for_bus (
5190 GBusType bus_type,
5191 GDBusProxyFlags flags,
5192 const gchar *name,
5193 const gchar *object_path,
5194 GCancellable *cancellable,
5195 GAsyncReadyCallback callback,
5196 gpointer user_data)
5197 {
5198 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER_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.RemoteDesktop.Vnc.Server", NULL);
5199 }
5200
5201 /**
5202 * gsd_remote_desktop_vnc_server_proxy_new_for_bus_finish:
5203 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_vnc_server_proxy_new_for_bus().
5204 * @error: Return location for error or %NULL
5205 *
5206 * Finishes an operation started with gsd_remote_desktop_vnc_server_proxy_new_for_bus().
5207 *
5208 * Returns: (transfer full) (type GsdRemoteDesktopVncServerProxy): The constructed proxy object or %NULL if @error is set.
5209 */
5210 GsdRemoteDesktopVncServer *
5211 gsd_remote_desktop_vnc_server_proxy_new_for_bus_finish (
5212 GAsyncResult *res,
5213 GError **error)
5214 {
5215 GObject *ret;
5216 GObject *source_object;
5217 source_object = g_async_result_get_source_object (res);
5218 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
5219 g_object_unref (source_object);
5220 if (ret != NULL)
5221 return GSD_REMOTE_DESKTOP_VNC_SERVER (ret);
5222 else
5223 return NULL;
5224 }
5225
5226 /**
5227 * gsd_remote_desktop_vnc_server_proxy_new_for_bus_sync:
5228 * @bus_type: A #GBusType.
5229 * @flags: Flags from the #GDBusProxyFlags enumeration.
5230 * @name: A bus name (well-known or unique).
5231 * @object_path: An object path.
5232 * @cancellable: (nullable): A #GCancellable or %NULL.
5233 * @error: Return location for error or %NULL
5234 *
5235 * Like gsd_remote_desktop_vnc_server_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
5236 *
5237 * The calling thread is blocked until a reply is received.
5238 *
5239 * See gsd_remote_desktop_vnc_server_proxy_new_for_bus() for the asynchronous version of this constructor.
5240 *
5241 * Returns: (transfer full) (type GsdRemoteDesktopVncServerProxy): The constructed proxy object or %NULL if @error is set.
5242 */
5243 GsdRemoteDesktopVncServer *
5244 gsd_remote_desktop_vnc_server_proxy_new_for_bus_sync (
5245 GBusType bus_type,
5246 GDBusProxyFlags flags,
5247 const gchar *name,
5248 const gchar *object_path,
5249 GCancellable *cancellable,
5250 GError **error)
5251 {
5252 GInitable *ret;
5253 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop.Vnc.Server", NULL);
5254 if (ret != NULL)
5255 return GSD_REMOTE_DESKTOP_VNC_SERVER (ret);
5256 else
5257 return NULL;
5258 }
5259
5260
5261 /* ------------------------------------------------------------------------ */
5262
5263 /**
5264 * GsdRemoteDesktopVncServerSkeleton:
5265 *
5266 * The #GsdRemoteDesktopVncServerSkeleton structure contains only private data and should only be accessed using the provided API.
5267 */
5268
5269 /**
5270 * GsdRemoteDesktopVncServerSkeletonClass:
5271 * @parent_class: The parent class.
5272 *
5273 * Class structure for #GsdRemoteDesktopVncServerSkeleton.
5274 */
5275
5276 struct _GsdRemoteDesktopVncServerSkeletonPrivate
5277 {
5278 GValue *properties;
5279 GList *changed_properties;
5280 GSource *changed_properties_idle_source;
5281 GMainContext *context;
5282 GMutex lock;
5283 };
5284
5285 static void
5286 _gsd_remote_desktop_vnc_server_skeleton_handle_method_call (
5287 GDBusConnection *connection G_GNUC_UNUSED,
5288 const gchar *sender G_GNUC_UNUSED,
5289 const gchar *object_path G_GNUC_UNUSED,
5290 const gchar *interface_name,
5291 const gchar *method_name,
5292 GVariant *parameters,
5293 GDBusMethodInvocation *invocation,
5294 gpointer user_data)
5295 {
5296 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (user_data);
5297 _ExtendedGDBusMethodInfo *info;
5298 GVariantIter iter;
5299 GVariant *child;
5300 GValue *paramv;
5301 gsize num_params;
5302 guint num_extra;
5303 gsize n;
5304 guint signal_id;
5305 GValue return_value = G_VALUE_INIT;
5306 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
5307 g_assert (info != NULL);
5308 num_params = g_variant_n_children (parameters);
5309 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
5310 n = 0;
5311 g_value_init (&paramv[n], GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER);
5312 g_value_set_object (&paramv[n++], skeleton);
5313 g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
5314 g_value_set_object (&paramv[n++], invocation);
5315 if (info->pass_fdlist)
5316 {
5317 #ifdef G_OS_UNIX
5318 g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
5319 g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
5320 #else
5321 g_assert_not_reached ();
5322 #endif
5323 }
5324 g_variant_iter_init (&iter, parameters);
5325 while ((child = g_variant_iter_next_value (&iter)) != NULL)
5326 {
5327 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
5328 if (arg_info->use_gvariant)
5329 {
5330 g_value_init (&paramv[n], G_TYPE_VARIANT);
5331 g_value_set_variant (&paramv[n], child);
5332 n++;
5333 }
5334 else
5335 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
5336 g_variant_unref (child);
5337 }
5338 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER);
5339 g_value_init (&return_value, G_TYPE_BOOLEAN);
5340 g_signal_emitv (paramv, signal_id, 0, &return_value);
5341 if (!g_value_get_boolean (&return_value))
5342 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);
5343 g_value_unset (&return_value);
5344 for (n = 0; n < num_params + num_extra; n++)
5345 g_value_unset (&paramv[n]);
5346 g_free (paramv);
5347 }
5348
5349 static GVariant *
5350 _gsd_remote_desktop_vnc_server_skeleton_handle_get_property (
5351 GDBusConnection *connection G_GNUC_UNUSED,
5352 const gchar *sender G_GNUC_UNUSED,
5353 const gchar *object_path G_GNUC_UNUSED,
5354 const gchar *interface_name G_GNUC_UNUSED,
5355 const gchar *property_name,
5356 GError **error,
5357 gpointer user_data)
5358 {
5359 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (user_data);
5360 GValue value = G_VALUE_INIT;
5361 GParamSpec *pspec;
5362 _ExtendedGDBusPropertyInfo *info;
5363 GVariant *ret;
5364 ret = NULL;
5365 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_vnc_server_interface_info.parent_struct, property_name);
5366 g_assert (info != NULL);
5367 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
5368 if (pspec == NULL)
5369 {
5370 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
5371 }
5372 else
5373 {
5374 g_value_init (&value, pspec->value_type);
5375 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
5376 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
5377 g_value_unset (&value);
5378 }
5379 return ret;
5380 }
5381
5382 static gboolean
5383 _gsd_remote_desktop_vnc_server_skeleton_handle_set_property (
5384 GDBusConnection *connection G_GNUC_UNUSED,
5385 const gchar *sender G_GNUC_UNUSED,
5386 const gchar *object_path G_GNUC_UNUSED,
5387 const gchar *interface_name G_GNUC_UNUSED,
5388 const gchar *property_name,
5389 GVariant *variant,
5390 GError **error,
5391 gpointer user_data)
5392 {
5393 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (user_data);
5394 GValue value = G_VALUE_INIT;
5395 GParamSpec *pspec;
5396 _ExtendedGDBusPropertyInfo *info;
5397 gboolean ret;
5398 ret = FALSE;
5399 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_vnc_server_interface_info.parent_struct, property_name);
5400 g_assert (info != NULL);
5401 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
5402 if (pspec == NULL)
5403 {
5404 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
5405 }
5406 else
5407 {
5408 if (info->use_gvariant)
5409 g_value_set_variant (&value, variant);
5410 else
5411 g_dbus_gvariant_to_gvalue (variant, &value);
5412 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
5413 g_value_unset (&value);
5414 ret = TRUE;
5415 }
5416 return ret;
5417 }
5418
5419 static const GDBusInterfaceVTable _gsd_remote_desktop_vnc_server_skeleton_vtable =
5420 {
5421 _gsd_remote_desktop_vnc_server_skeleton_handle_method_call,
5422 _gsd_remote_desktop_vnc_server_skeleton_handle_get_property,
5423 _gsd_remote_desktop_vnc_server_skeleton_handle_set_property,
5424 {NULL}
5425 };
5426
5427 static GDBusInterfaceInfo *
5428 gsd_remote_desktop_vnc_server_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5429 {
5430 return gsd_remote_desktop_vnc_server_interface_info ();
5431 }
5432
5433 static GDBusInterfaceVTable *
5434 gsd_remote_desktop_vnc_server_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
5435 {
5436 return (GDBusInterfaceVTable *) &_gsd_remote_desktop_vnc_server_skeleton_vtable;
5437 }
5438
5439 static GVariant *
5440 gsd_remote_desktop_vnc_server_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
5441 {
5442 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (_skeleton);
5443
5444 GVariantBuilder builder;
5445 guint n;
5446 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
5447 if (_gsd_remote_desktop_vnc_server_interface_info.parent_struct.properties == NULL)
5448 goto out;
5449 for (n = 0; _gsd_remote_desktop_vnc_server_interface_info.parent_struct.properties[n] != NULL; n++)
5450 {
5451 GDBusPropertyInfo *info = _gsd_remote_desktop_vnc_server_interface_info.parent_struct.properties[n];
5452 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
5453 {
5454 GVariant *value;
5455 value = _gsd_remote_desktop_vnc_server_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.RemoteDesktop.Vnc.Server", info->name, NULL, skeleton);
5456 if (value != NULL)
5457 {
5458 g_variant_take_ref (value);
5459 g_variant_builder_add (&builder, "{sv}", info->name, value);
5460 g_variant_unref (value);
5461 }
5462 }
5463 }
5464 out:
5465 return g_variant_builder_end (&builder);
5466 }
5467
5468 static gboolean _gsd_remote_desktop_vnc_server_emit_changed (gpointer user_data);
5469
5470 static void
5471 gsd_remote_desktop_vnc_server_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
5472 {
5473 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (_skeleton);
5474 gboolean emit_changed = FALSE;
5475
5476 g_mutex_lock (&skeleton->priv->lock);
5477 if (skeleton->priv->changed_properties_idle_source != NULL)
5478 {
5479 g_source_destroy (skeleton->priv->changed_properties_idle_source);
5480 skeleton->priv->changed_properties_idle_source = NULL;
5481 emit_changed = TRUE;
5482 }
5483 g_mutex_unlock (&skeleton->priv->lock);
5484
5485 if (emit_changed)
5486 _gsd_remote_desktop_vnc_server_emit_changed (skeleton);
5487 }
5488
5489 static void gsd_remote_desktop_vnc_server_skeleton_iface_init (GsdRemoteDesktopVncServerIface *iface);
5490 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5491 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopVncServerSkeleton, gsd_remote_desktop_vnc_server_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
5492 G_ADD_PRIVATE (GsdRemoteDesktopVncServerSkeleton)
5493 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER, gsd_remote_desktop_vnc_server_skeleton_iface_init))
5494
5495 #else
5496 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopVncServerSkeleton, gsd_remote_desktop_vnc_server_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
5497 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER, gsd_remote_desktop_vnc_server_skeleton_iface_init))
5498
5499 #endif
5500 static void
5501 gsd_remote_desktop_vnc_server_skeleton_finalize (GObject *object)
5502 {
5503 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5504 guint n;
5505 for (n = 0; n < 5; n++)
5506 g_value_unset (&skeleton->priv->properties[n]);
5507 g_free (skeleton->priv->properties);
5508 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
5509 if (skeleton->priv->changed_properties_idle_source != NULL)
5510 g_source_destroy (skeleton->priv->changed_properties_idle_source);
5511 g_main_context_unref (skeleton->priv->context);
5512 g_mutex_clear (&skeleton->priv->lock);
5513 G_OBJECT_CLASS (gsd_remote_desktop_vnc_server_skeleton_parent_class)->finalize (object);
5514 }
5515
5516 static void
5517 gsd_remote_desktop_vnc_server_skeleton_get_property (GObject *object,
5518 guint prop_id,
5519 GValue *value,
5520 GParamSpec *pspec G_GNUC_UNUSED)
5521 {
5522 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5523 g_assert (prop_id != 0 && prop_id - 1 < 5);
5524 g_mutex_lock (&skeleton->priv->lock);
5525 g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
5526 g_mutex_unlock (&skeleton->priv->lock);
5527 }
5528
5529 static gboolean
5530 _gsd_remote_desktop_vnc_server_emit_changed (gpointer user_data)
5531 {
5532 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (user_data);
5533 GList *l;
5534 GVariantBuilder builder;
5535 GVariantBuilder invalidated_builder;
5536 guint num_changes;
5537
5538 g_mutex_lock (&skeleton->priv->lock);
5539 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
5540 g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
5541 for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
5542 {
5543 ChangedProperty *cp = l->data;
5544 GVariant *variant;
5545 const GValue *cur_value;
5546
5547 cur_value = &skeleton->priv->properties[cp->prop_id - 1];
5548 if (!_g_value_equal (cur_value, &cp->orig_value))
5549 {
5550 variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
5551 g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
5552 g_variant_unref (variant);
5553 num_changes++;
5554 }
5555 }
5556 if (num_changes > 0)
5557 {
5558 GList *connections, *ll;
5559 GVariant *signal_variant;
5560 signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.gnome.RemoteDesktop.Vnc.Server",
5561 &builder, &invalidated_builder));
5562 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
5563 for (ll = connections; ll != NULL; ll = ll->next)
5564 {
5565 GDBusConnection *connection = ll->data;
5566
5567 g_dbus_connection_emit_signal (connection,
5568 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
5569 "org.freedesktop.DBus.Properties",
5570 "PropertiesChanged",
5571 signal_variant,
5572 NULL);
5573 }
5574 g_variant_unref (signal_variant);
5575 g_list_free_full (connections, g_object_unref);
5576 }
5577 else
5578 {
5579 g_variant_builder_clear (&builder);
5580 g_variant_builder_clear (&invalidated_builder);
5581 }
5582 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
5583 skeleton->priv->changed_properties = NULL;
5584 skeleton->priv->changed_properties_idle_source = NULL;
5585 g_mutex_unlock (&skeleton->priv->lock);
5586 return FALSE;
5587 }
5588
5589 static void
5590 _gsd_remote_desktop_vnc_server_schedule_emit_changed (GsdRemoteDesktopVncServerSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
5591 {
5592 ChangedProperty *cp;
5593 GList *l;
5594 cp = NULL;
5595 for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
5596 {
5597 ChangedProperty *i_cp = l->data;
5598 if (i_cp->info == info)
5599 {
5600 cp = i_cp;
5601 break;
5602 }
5603 }
5604 if (cp == NULL)
5605 {
5606 cp = g_new0 (ChangedProperty, 1);
5607 cp->prop_id = prop_id;
5608 cp->info = info;
5609 skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
5610 g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
5611 g_value_copy (orig_value, &cp->orig_value);
5612 }
5613 }
5614
5615 static void
5616 gsd_remote_desktop_vnc_server_skeleton_notify (GObject *object,
5617 GParamSpec *pspec G_GNUC_UNUSED)
5618 {
5619 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5620 g_mutex_lock (&skeleton->priv->lock);
5621 if (skeleton->priv->changed_properties != NULL &&
5622 skeleton->priv->changed_properties_idle_source == NULL)
5623 {
5624 skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
5625 g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
5626 g_source_set_callback (skeleton->priv->changed_properties_idle_source, _gsd_remote_desktop_vnc_server_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
5627 g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gsd_remote_desktop_vnc_server_emit_changed");
5628 g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
5629 g_source_unref (skeleton->priv->changed_properties_idle_source);
5630 }
5631 g_mutex_unlock (&skeleton->priv->lock);
5632 }
5633
5634 static void
5635 gsd_remote_desktop_vnc_server_skeleton_set_property (GObject *object,
5636 guint prop_id,
5637 const GValue *value,
5638 GParamSpec *pspec)
5639 {
5640 const _ExtendedGDBusPropertyInfo *info;
5641 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5642 g_assert (prop_id != 0 && prop_id - 1 < 5);
5643 info = (const _ExtendedGDBusPropertyInfo *) _gsd_remote_desktop_vnc_server_property_info_pointers[prop_id - 1];
5644 g_mutex_lock (&skeleton->priv->lock);
5645 g_object_freeze_notify (object);
5646 if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
5647 {
5648 if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
5649 info->emits_changed_signal)
5650 _gsd_remote_desktop_vnc_server_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
5651 g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
5652 g_object_notify_by_pspec (object, pspec);
5653 }
5654 g_mutex_unlock (&skeleton->priv->lock);
5655 g_object_thaw_notify (object);
5656 }
5657
5658 static void
5659 gsd_remote_desktop_vnc_server_skeleton_init (GsdRemoteDesktopVncServerSkeleton *skeleton)
5660 {
5661 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
5662 skeleton->priv = gsd_remote_desktop_vnc_server_skeleton_get_instance_private (skeleton);
5663 #else
5664 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER_SKELETON, GsdRemoteDesktopVncServerSkeletonPrivate);
5665 #endif
5666
5667 g_mutex_init (&skeleton->priv->lock);
5668 skeleton->priv->context = g_main_context_ref_thread_default ();
5669 skeleton->priv->properties = g_new0 (GValue, 5);
5670 g_value_init (&skeleton->priv->properties[0], G_TYPE_BOOLEAN);
5671 g_value_init (&skeleton->priv->properties[1], G_TYPE_INT);
5672 g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN);
5673 g_value_init (&skeleton->priv->properties[3], G_TYPE_STRING);
5674 g_value_init (&skeleton->priv->properties[4], G_TYPE_BOOLEAN);
5675 }
5676
5677 static gboolean
5678 gsd_remote_desktop_vnc_server_skeleton_get_enabled (GsdRemoteDesktopVncServer *object)
5679 {
5680 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5681 gboolean value;
5682 g_mutex_lock (&skeleton->priv->lock);
5683 value = g_marshal_value_peek_boolean (&(skeleton->priv->properties[0]));
5684 g_mutex_unlock (&skeleton->priv->lock);
5685 return value;
5686 }
5687
5688 static gint
5689 gsd_remote_desktop_vnc_server_skeleton_get_port (GsdRemoteDesktopVncServer *object)
5690 {
5691 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5692 gint value;
5693 g_mutex_lock (&skeleton->priv->lock);
5694 value = g_marshal_value_peek_int (&(skeleton->priv->properties[1]));
5695 g_mutex_unlock (&skeleton->priv->lock);
5696 return value;
5697 }
5698
5699 static gboolean
5700 gsd_remote_desktop_vnc_server_skeleton_get_negotiate_port (GsdRemoteDesktopVncServer *object)
5701 {
5702 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5703 gboolean value;
5704 g_mutex_lock (&skeleton->priv->lock);
5705 value = g_marshal_value_peek_boolean (&(skeleton->priv->properties[2]));
5706 g_mutex_unlock (&skeleton->priv->lock);
5707 return value;
5708 }
5709
5710 static const gchar *
5711 gsd_remote_desktop_vnc_server_skeleton_get_auth_method (GsdRemoteDesktopVncServer *object)
5712 {
5713 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5714 const gchar *value;
5715 g_mutex_lock (&skeleton->priv->lock);
5716 value = g_marshal_value_peek_string (&(skeleton->priv->properties[3]));
5717 g_mutex_unlock (&skeleton->priv->lock);
5718 return value;
5719 }
5720
5721 static gboolean
5722 gsd_remote_desktop_vnc_server_skeleton_get_view_only (GsdRemoteDesktopVncServer *object)
5723 {
5724 GsdRemoteDesktopVncServerSkeleton *skeleton = GSD_REMOTE_DESKTOP_VNC_SERVER_SKELETON (object);
5725 gboolean value;
5726 g_mutex_lock (&skeleton->priv->lock);
5727 value = g_marshal_value_peek_boolean (&(skeleton->priv->properties[4]));
5728 g_mutex_unlock (&skeleton->priv->lock);
5729 return value;
5730 }
5731
5732 static void
5733 gsd_remote_desktop_vnc_server_skeleton_class_init (GsdRemoteDesktopVncServerSkeletonClass *klass)
5734 {
5735 GObjectClass *gobject_class;
5736 GDBusInterfaceSkeletonClass *skeleton_class;
5737
5738 gobject_class = G_OBJECT_CLASS (klass);
5739 gobject_class->finalize = gsd_remote_desktop_vnc_server_skeleton_finalize;
5740 gobject_class->get_property = gsd_remote_desktop_vnc_server_skeleton_get_property;
5741 gobject_class->set_property = gsd_remote_desktop_vnc_server_skeleton_set_property;
5742 gobject_class->notify = gsd_remote_desktop_vnc_server_skeleton_notify;
5743
5744
5745 gsd_remote_desktop_vnc_server_override_properties (gobject_class, 1);
5746
5747 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
5748 skeleton_class->get_info = gsd_remote_desktop_vnc_server_skeleton_dbus_interface_get_info;
5749 skeleton_class->get_properties = gsd_remote_desktop_vnc_server_skeleton_dbus_interface_get_properties;
5750 skeleton_class->flush = gsd_remote_desktop_vnc_server_skeleton_dbus_interface_flush;
5751 skeleton_class->get_vtable = gsd_remote_desktop_vnc_server_skeleton_dbus_interface_get_vtable;
5752
5753 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
5754 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopVncServerSkeletonPrivate));
5755 #endif
5756 }
5757
5758 static void
5759 gsd_remote_desktop_vnc_server_skeleton_iface_init (GsdRemoteDesktopVncServerIface *iface)
5760 {
5761 iface->get_enabled = gsd_remote_desktop_vnc_server_skeleton_get_enabled;
5762 iface->get_port = gsd_remote_desktop_vnc_server_skeleton_get_port;
5763 iface->get_negotiate_port = gsd_remote_desktop_vnc_server_skeleton_get_negotiate_port;
5764 iface->get_auth_method = gsd_remote_desktop_vnc_server_skeleton_get_auth_method;
5765 iface->get_view_only = gsd_remote_desktop_vnc_server_skeleton_get_view_only;
5766 }
5767
5768 /**
5769 * gsd_remote_desktop_vnc_server_skeleton_new:
5770 *
5771 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Vnc-Server.top_of_page">org.gnome.RemoteDesktop.Vnc.Server</link>.
5772 *
5773 * Returns: (transfer full) (type GsdRemoteDesktopVncServerSkeleton): The skeleton object.
5774 */
5775 GsdRemoteDesktopVncServer *
5776 gsd_remote_desktop_vnc_server_skeleton_new (void)
5777 {
5778 return GSD_REMOTE_DESKTOP_VNC_SERVER (g_object_new (GSD_TYPE_REMOTE_DESKTOP_VNC_SERVER_SKELETON, NULL));
5779 }
5780
5781 /* ------------------------------------------------------------------------
5782 * Code for interface org.gnome.RemoteDesktop.Rdp.Dispatcher
5783 * ------------------------------------------------------------------------
5784 */
5785
5786 /**
5787 * SECTION:GsdRemoteDesktopRdpDispatcher
5788 * @title: GsdRemoteDesktopRdpDispatcher
5789 * @short_description: Generated C code for the org.gnome.RemoteDesktop.Rdp.Dispatcher D-Bus interface
5790 *
5791 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Dispatcher.top_of_page">org.gnome.RemoteDesktop.Rdp.Dispatcher</link> D-Bus interface in C.
5792 */
5793
5794 /* ---- Introspection data for org.gnome.RemoteDesktop.Rdp.Dispatcher ---- */
5795
5796 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_dispatcher_method_info_request_handover_OUT_ARG_handover =
5797 {
5798 {
5799 -1,
5800 (gchar *) "handover",
5801 (gchar *) "o",
5802 NULL
5803 },
5804 FALSE
5805 };
5806
5807 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_dispatcher_method_info_request_handover_OUT_ARG_pointers[] =
5808 {
5809 &_gsd_remote_desktop_rdp_dispatcher_method_info_request_handover_OUT_ARG_handover.parent_struct,
5810 NULL
5811 };
5812
5813 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_dispatcher_method_info_request_handover =
5814 {
5815 {
5816 -1,
5817 (gchar *) "RequestHandover",
5818 NULL,
5819 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_dispatcher_method_info_request_handover_OUT_ARG_pointers,
5820 NULL
5821 },
5822 "handle-request-handover",
5823 FALSE
5824 };
5825
5826 static const GDBusMethodInfo * const _gsd_remote_desktop_rdp_dispatcher_method_info_pointers[] =
5827 {
5828 &_gsd_remote_desktop_rdp_dispatcher_method_info_request_handover.parent_struct,
5829 NULL
5830 };
5831
5832 static const _ExtendedGDBusInterfaceInfo _gsd_remote_desktop_rdp_dispatcher_interface_info =
5833 {
5834 {
5835 -1,
5836 (gchar *) "org.gnome.RemoteDesktop.Rdp.Dispatcher",
5837 (GDBusMethodInfo **) &_gsd_remote_desktop_rdp_dispatcher_method_info_pointers,
5838 NULL,
5839 NULL,
5840 NULL
5841 },
5842 "remote-desktop-rdp-dispatcher",
5843 };
5844
5845
5846 /**
5847 * gsd_remote_desktop_rdp_dispatcher_interface_info:
5848 *
5849 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Dispatcher.top_of_page">org.gnome.RemoteDesktop.Rdp.Dispatcher</link> D-Bus interface.
5850 *
5851 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
5852 */
5853 GDBusInterfaceInfo *
5854 gsd_remote_desktop_rdp_dispatcher_interface_info (void)
5855 {
5856 return (GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct;
5857 }
5858
5859 /**
5860 * gsd_remote_desktop_rdp_dispatcher_override_properties:
5861 * @klass: The class structure for a #GObject derived class.
5862 * @property_id_begin: The property id to assign to the first overridden property.
5863 *
5864 * Overrides all #GObject properties in the #GsdRemoteDesktopRdpDispatcher interface for a concrete class.
5865 * The properties are overridden in the order they are defined.
5866 *
5867 * Returns: The last property id.
5868 */
5869 guint
5870 gsd_remote_desktop_rdp_dispatcher_override_properties (GObjectClass *klass G_GNUC_UNUSED, guint property_id_begin)
5871 {
5872 return property_id_begin - 1;
5873 }
5874
5875
5876 inline static void
5877 gsd_remote_desktop_rdp_dispatcher_method_marshal_request_handover (
5878 GClosure *closure,
5879 GValue *return_value,
5880 unsigned int n_param_values,
5881 const GValue *param_values,
5882 void *invocation_hint,
5883 void *marshal_data)
5884 {
5885 _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
5886 return_value, n_param_values, param_values, invocation_hint, marshal_data);
5887 }
5888
5889
5890 /**
5891 * GsdRemoteDesktopRdpDispatcher:
5892 *
5893 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Dispatcher.top_of_page">org.gnome.RemoteDesktop.Rdp.Dispatcher</link>.
5894 */
5895
5896 /**
5897 * GsdRemoteDesktopRdpDispatcherIface:
5898 * @parent_iface: The parent interface.
5899 * @handle_request_handover: Handler for the #GsdRemoteDesktopRdpDispatcher::handle-request-handover signal.
5900 *
5901 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Dispatcher.top_of_page">org.gnome.RemoteDesktop.Rdp.Dispatcher</link>.
5902 */
5903
5904 typedef GsdRemoteDesktopRdpDispatcherIface GsdRemoteDesktopRdpDispatcherInterface;
5905 G_DEFINE_INTERFACE (GsdRemoteDesktopRdpDispatcher, gsd_remote_desktop_rdp_dispatcher, G_TYPE_OBJECT)
5906
5907 static void
5908 gsd_remote_desktop_rdp_dispatcher_default_init (GsdRemoteDesktopRdpDispatcherIface *iface)
5909 {
5910 /* GObject signals for incoming D-Bus method calls: */
5911 /**
5912 * GsdRemoteDesktopRdpDispatcher::handle-request-handover:
5913 * @object: A #GsdRemoteDesktopRdpDispatcher.
5914 * @invocation: A #GDBusMethodInvocation.
5915 *
5916 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Dispatcher.RequestHandover">RequestHandover()</link> D-Bus method.
5917 *
5918 * 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 gsd_remote_desktop_rdp_dispatcher_complete_request_handover() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
5919 *
5920 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
5921 */
5922 g_signal_new ("handle-request-handover",
5923 G_TYPE_FROM_INTERFACE (iface),
5924 G_SIGNAL_RUN_LAST,
5925 G_STRUCT_OFFSET (GsdRemoteDesktopRdpDispatcherIface, handle_request_handover),
5926 g_signal_accumulator_true_handled,
5927 NULL,
5928 gsd_remote_desktop_rdp_dispatcher_method_marshal_request_handover,
5929 G_TYPE_BOOLEAN,
5930 1,
5931 G_TYPE_DBUS_METHOD_INVOCATION);
5932
5933 }
5934
5935 /**
5936 * gsd_remote_desktop_rdp_dispatcher_call_request_handover:
5937 * @proxy: A #GsdRemoteDesktopRdpDispatcherProxy.
5938 * @cancellable: (nullable): A #GCancellable or %NULL.
5939 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
5940 * @user_data: User data to pass to @callback.
5941 *
5942 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Dispatcher.RequestHandover">RequestHandover()</link> D-Bus method on @proxy.
5943 * 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()).
5944 * You can then call gsd_remote_desktop_rdp_dispatcher_call_request_handover_finish() to get the result of the operation.
5945 *
5946 * See gsd_remote_desktop_rdp_dispatcher_call_request_handover_sync() for the synchronous, blocking version of this method.
5947 */
5948 void
5949 gsd_remote_desktop_rdp_dispatcher_call_request_handover (
5950 GsdRemoteDesktopRdpDispatcher *proxy,
5951 GCancellable *cancellable,
5952 GAsyncReadyCallback callback,
5953 gpointer user_data)
5954 {
5955 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
5956 "RequestHandover",
5957 g_variant_new ("()"),
5958 G_DBUS_CALL_FLAGS_NONE,
5959 -1,
5960 cancellable,
5961 callback,
5962 user_data);
5963 }
5964
5965 /**
5966 * gsd_remote_desktop_rdp_dispatcher_call_request_handover_finish:
5967 * @proxy: A #GsdRemoteDesktopRdpDispatcherProxy.
5968 * @out_handover: (out) (optional): Return location for return parameter or %NULL to ignore.
5969 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_dispatcher_call_request_handover().
5970 * @error: Return location for error or %NULL.
5971 *
5972 * Finishes an operation started with gsd_remote_desktop_rdp_dispatcher_call_request_handover().
5973 *
5974 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
5975 */
5976 gboolean
5977 gsd_remote_desktop_rdp_dispatcher_call_request_handover_finish (
5978 GsdRemoteDesktopRdpDispatcher *proxy,
5979 gchar **out_handover,
5980 GAsyncResult *res,
5981 GError **error)
5982 {
5983 GVariant *_ret;
5984 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
5985 if (_ret == NULL)
5986 goto _out;
5987 g_variant_get (_ret,
5988 "(o)",
5989 out_handover);
5990 g_variant_unref (_ret);
5991 _out:
5992 return _ret != NULL;
5993 }
5994
5995 /**
5996 * gsd_remote_desktop_rdp_dispatcher_call_request_handover_sync:
5997 * @proxy: A #GsdRemoteDesktopRdpDispatcherProxy.
5998 * @out_handover: (out) (optional): Return location for return parameter or %NULL to ignore.
5999 * @cancellable: (nullable): A #GCancellable or %NULL.
6000 * @error: Return location for error or %NULL.
6001 *
6002 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Dispatcher.RequestHandover">RequestHandover()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
6003 *
6004 * See gsd_remote_desktop_rdp_dispatcher_call_request_handover() for the asynchronous version of this method.
6005 *
6006 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
6007 */
6008 gboolean
6009 gsd_remote_desktop_rdp_dispatcher_call_request_handover_sync (
6010 GsdRemoteDesktopRdpDispatcher *proxy,
6011 gchar **out_handover,
6012 GCancellable *cancellable,
6013 GError **error)
6014 {
6015 GVariant *_ret;
6016 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
6017 "RequestHandover",
6018 g_variant_new ("()"),
6019 G_DBUS_CALL_FLAGS_NONE,
6020 -1,
6021 cancellable,
6022 error);
6023 if (_ret == NULL)
6024 goto _out;
6025 g_variant_get (_ret,
6026 "(o)",
6027 out_handover);
6028 g_variant_unref (_ret);
6029 _out:
6030 return _ret != NULL;
6031 }
6032
6033 /**
6034 * gsd_remote_desktop_rdp_dispatcher_complete_request_handover:
6035 * @object: A #GsdRemoteDesktopRdpDispatcher.
6036 * @invocation: (transfer full): A #GDBusMethodInvocation.
6037 * @handover: Parameter to return.
6038 *
6039 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Dispatcher.RequestHandover">RequestHandover()</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.
6040 *
6041 * This method will free @invocation, you cannot use it afterwards.
6042 */
6043 void
6044 gsd_remote_desktop_rdp_dispatcher_complete_request_handover (
6045 GsdRemoteDesktopRdpDispatcher *object G_GNUC_UNUSED,
6046 GDBusMethodInvocation *invocation,
6047 const gchar *handover)
6048 {
6049 g_dbus_method_invocation_return_value (invocation,
6050 g_variant_new ("(o)",
6051 handover));
6052 }
6053
6054 /* ------------------------------------------------------------------------ */
6055
6056 /**
6057 * GsdRemoteDesktopRdpDispatcherProxy:
6058 *
6059 * The #GsdRemoteDesktopRdpDispatcherProxy structure contains only private data and should only be accessed using the provided API.
6060 */
6061
6062 /**
6063 * GsdRemoteDesktopRdpDispatcherProxyClass:
6064 * @parent_class: The parent class.
6065 *
6066 * Class structure for #GsdRemoteDesktopRdpDispatcherProxy.
6067 */
6068
6069 struct _GsdRemoteDesktopRdpDispatcherProxyPrivate
6070 {
6071 GData *qdata;
6072 };
6073
6074 static void gsd_remote_desktop_rdp_dispatcher_proxy_iface_init (GsdRemoteDesktopRdpDispatcherIface *iface);
6075
6076 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
6077 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpDispatcherProxy, gsd_remote_desktop_rdp_dispatcher_proxy, G_TYPE_DBUS_PROXY,
6078 G_ADD_PRIVATE (GsdRemoteDesktopRdpDispatcherProxy)
6079 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER, gsd_remote_desktop_rdp_dispatcher_proxy_iface_init))
6080
6081 #else
6082 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpDispatcherProxy, gsd_remote_desktop_rdp_dispatcher_proxy, G_TYPE_DBUS_PROXY,
6083 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER, gsd_remote_desktop_rdp_dispatcher_proxy_iface_init))
6084
6085 #endif
6086 static void
6087 gsd_remote_desktop_rdp_dispatcher_proxy_finalize (GObject *object)
6088 {
6089 GsdRemoteDesktopRdpDispatcherProxy *proxy = GSD_REMOTE_DESKTOP_RDP_DISPATCHER_PROXY (object);
6090 g_datalist_clear (&proxy->priv->qdata);
6091 G_OBJECT_CLASS (gsd_remote_desktop_rdp_dispatcher_proxy_parent_class)->finalize (object);
6092 }
6093
6094 static void
6095 gsd_remote_desktop_rdp_dispatcher_proxy_get_property (GObject *object G_GNUC_UNUSED,
6096 guint prop_id G_GNUC_UNUSED,
6097 GValue *value G_GNUC_UNUSED,
6098 GParamSpec *pspec G_GNUC_UNUSED)
6099 {
6100 }
6101
6102 static void
6103 gsd_remote_desktop_rdp_dispatcher_proxy_set_property (GObject *object G_GNUC_UNUSED,
6104 guint prop_id G_GNUC_UNUSED,
6105 const GValue *value G_GNUC_UNUSED,
6106 GParamSpec *pspec G_GNUC_UNUSED)
6107 {
6108 }
6109
6110 static void
6111 gsd_remote_desktop_rdp_dispatcher_proxy_g_signal (GDBusProxy *proxy,
6112 const gchar *sender_name G_GNUC_UNUSED,
6113 const gchar *signal_name,
6114 GVariant *parameters)
6115 {
6116 _ExtendedGDBusSignalInfo *info;
6117 GVariantIter iter;
6118 GVariant *child;
6119 GValue *paramv;
6120 gsize num_params;
6121 gsize n;
6122 guint signal_id;
6123 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct, signal_name);
6124 if (info == NULL)
6125 return;
6126 num_params = g_variant_n_children (parameters);
6127 paramv = g_new0 (GValue, num_params + 1);
6128 g_value_init (&paramv[0], GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER);
6129 g_value_set_object (&paramv[0], proxy);
6130 g_variant_iter_init (&iter, parameters);
6131 n = 1;
6132 while ((child = g_variant_iter_next_value (&iter)) != NULL)
6133 {
6134 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
6135 if (arg_info->use_gvariant)
6136 {
6137 g_value_init (&paramv[n], G_TYPE_VARIANT);
6138 g_value_set_variant (&paramv[n], child);
6139 n++;
6140 }
6141 else
6142 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
6143 g_variant_unref (child);
6144 }
6145 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER);
6146 g_signal_emitv (paramv, signal_id, 0, NULL);
6147 for (n = 0; n < num_params + 1; n++)
6148 g_value_unset (&paramv[n]);
6149 g_free (paramv);
6150 }
6151
6152 static void
6153 gsd_remote_desktop_rdp_dispatcher_proxy_g_properties_changed (GDBusProxy *_proxy,
6154 GVariant *changed_properties,
6155 const gchar *const *invalidated_properties)
6156 {
6157 GsdRemoteDesktopRdpDispatcherProxy *proxy = GSD_REMOTE_DESKTOP_RDP_DISPATCHER_PROXY (_proxy);
6158 guint n;
6159 const gchar *key;
6160 GVariantIter *iter;
6161 _ExtendedGDBusPropertyInfo *info;
6162 g_variant_get (changed_properties, "a{sv}", &iter);
6163 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
6164 {
6165 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct, key);
6166 g_datalist_remove_data (&proxy->priv->qdata, key);
6167 if (info != NULL)
6168 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
6169 }
6170 g_variant_iter_free (iter);
6171 for (n = 0; invalidated_properties[n] != NULL; n++)
6172 {
6173 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct, invalidated_properties[n]);
6174 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
6175 if (info != NULL)
6176 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
6177 }
6178 }
6179
6180 static void
6181 gsd_remote_desktop_rdp_dispatcher_proxy_init (GsdRemoteDesktopRdpDispatcherProxy *proxy)
6182 {
6183 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
6184 proxy->priv = gsd_remote_desktop_rdp_dispatcher_proxy_get_instance_private (proxy);
6185 #else
6186 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER_PROXY, GsdRemoteDesktopRdpDispatcherProxyPrivate);
6187 #endif
6188
6189 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsd_remote_desktop_rdp_dispatcher_interface_info ());
6190 }
6191
6192 static void
6193 gsd_remote_desktop_rdp_dispatcher_proxy_class_init (GsdRemoteDesktopRdpDispatcherProxyClass *klass)
6194 {
6195 GObjectClass *gobject_class;
6196 GDBusProxyClass *proxy_class;
6197
6198 gobject_class = G_OBJECT_CLASS (klass);
6199 gobject_class->finalize = gsd_remote_desktop_rdp_dispatcher_proxy_finalize;
6200 gobject_class->get_property = gsd_remote_desktop_rdp_dispatcher_proxy_get_property;
6201 gobject_class->set_property = gsd_remote_desktop_rdp_dispatcher_proxy_set_property;
6202
6203 proxy_class = G_DBUS_PROXY_CLASS (klass);
6204 proxy_class->g_signal = gsd_remote_desktop_rdp_dispatcher_proxy_g_signal;
6205 proxy_class->g_properties_changed = gsd_remote_desktop_rdp_dispatcher_proxy_g_properties_changed;
6206
6207 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
6208 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopRdpDispatcherProxyPrivate));
6209 #endif
6210 }
6211
6212 static void
6213 gsd_remote_desktop_rdp_dispatcher_proxy_iface_init (GsdRemoteDesktopRdpDispatcherIface *iface G_GNUC_UNUSED)
6214 {
6215 }
6216
6217 /**
6218 * gsd_remote_desktop_rdp_dispatcher_proxy_new:
6219 * @connection: A #GDBusConnection.
6220 * @flags: Flags from the #GDBusProxyFlags enumeration.
6221 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6222 * @object_path: An object path.
6223 * @cancellable: (nullable): A #GCancellable or %NULL.
6224 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
6225 * @user_data: User data to pass to @callback.
6226 *
6227 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Dispatcher.top_of_page">org.gnome.RemoteDesktop.Rdp.Dispatcher</link>. See g_dbus_proxy_new() for more details.
6228 *
6229 * 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()).
6230 * You can then call gsd_remote_desktop_rdp_dispatcher_proxy_new_finish() to get the result of the operation.
6231 *
6232 * See gsd_remote_desktop_rdp_dispatcher_proxy_new_sync() for the synchronous, blocking version of this constructor.
6233 */
6234 void
6235 gsd_remote_desktop_rdp_dispatcher_proxy_new (
6236 GDBusConnection *connection,
6237 GDBusProxyFlags flags,
6238 const gchar *name,
6239 const gchar *object_path,
6240 GCancellable *cancellable,
6241 GAsyncReadyCallback callback,
6242 gpointer user_data)
6243 {
6244 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER_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.RemoteDesktop.Rdp.Dispatcher", NULL);
6245 }
6246
6247 /**
6248 * gsd_remote_desktop_rdp_dispatcher_proxy_new_finish:
6249 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_dispatcher_proxy_new().
6250 * @error: Return location for error or %NULL
6251 *
6252 * Finishes an operation started with gsd_remote_desktop_rdp_dispatcher_proxy_new().
6253 *
6254 * Returns: (transfer full) (type GsdRemoteDesktopRdpDispatcherProxy): The constructed proxy object or %NULL if @error is set.
6255 */
6256 GsdRemoteDesktopRdpDispatcher *
6257 gsd_remote_desktop_rdp_dispatcher_proxy_new_finish (
6258 GAsyncResult *res,
6259 GError **error)
6260 {
6261 GObject *ret;
6262 GObject *source_object;
6263 source_object = g_async_result_get_source_object (res);
6264 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
6265 g_object_unref (source_object);
6266 if (ret != NULL)
6267 return GSD_REMOTE_DESKTOP_RDP_DISPATCHER (ret);
6268 else
6269 return NULL;
6270 }
6271
6272 /**
6273 * gsd_remote_desktop_rdp_dispatcher_proxy_new_sync:
6274 * @connection: A #GDBusConnection.
6275 * @flags: Flags from the #GDBusProxyFlags enumeration.
6276 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6277 * @object_path: An object path.
6278 * @cancellable: (nullable): A #GCancellable or %NULL.
6279 * @error: Return location for error or %NULL
6280 *
6281 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Dispatcher.top_of_page">org.gnome.RemoteDesktop.Rdp.Dispatcher</link>. See g_dbus_proxy_new_sync() for more details.
6282 *
6283 * The calling thread is blocked until a reply is received.
6284 *
6285 * See gsd_remote_desktop_rdp_dispatcher_proxy_new() for the asynchronous version of this constructor.
6286 *
6287 * Returns: (transfer full) (type GsdRemoteDesktopRdpDispatcherProxy): The constructed proxy object or %NULL if @error is set.
6288 */
6289 GsdRemoteDesktopRdpDispatcher *
6290 gsd_remote_desktop_rdp_dispatcher_proxy_new_sync (
6291 GDBusConnection *connection,
6292 GDBusProxyFlags flags,
6293 const gchar *name,
6294 const gchar *object_path,
6295 GCancellable *cancellable,
6296 GError **error)
6297 {
6298 GInitable *ret;
6299 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop.Rdp.Dispatcher", NULL);
6300 if (ret != NULL)
6301 return GSD_REMOTE_DESKTOP_RDP_DISPATCHER (ret);
6302 else
6303 return NULL;
6304 }
6305
6306
6307 /**
6308 * gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus:
6309 * @bus_type: A #GBusType.
6310 * @flags: Flags from the #GDBusProxyFlags enumeration.
6311 * @name: A bus name (well-known or unique).
6312 * @object_path: An object path.
6313 * @cancellable: (nullable): A #GCancellable or %NULL.
6314 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
6315 * @user_data: User data to pass to @callback.
6316 *
6317 * Like gsd_remote_desktop_rdp_dispatcher_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
6318 *
6319 * 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()).
6320 * You can then call gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus_finish() to get the result of the operation.
6321 *
6322 * See gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
6323 */
6324 void
6325 gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus (
6326 GBusType bus_type,
6327 GDBusProxyFlags flags,
6328 const gchar *name,
6329 const gchar *object_path,
6330 GCancellable *cancellable,
6331 GAsyncReadyCallback callback,
6332 gpointer user_data)
6333 {
6334 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER_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.RemoteDesktop.Rdp.Dispatcher", NULL);
6335 }
6336
6337 /**
6338 * gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus_finish:
6339 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus().
6340 * @error: Return location for error or %NULL
6341 *
6342 * Finishes an operation started with gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus().
6343 *
6344 * Returns: (transfer full) (type GsdRemoteDesktopRdpDispatcherProxy): The constructed proxy object or %NULL if @error is set.
6345 */
6346 GsdRemoteDesktopRdpDispatcher *
6347 gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus_finish (
6348 GAsyncResult *res,
6349 GError **error)
6350 {
6351 GObject *ret;
6352 GObject *source_object;
6353 source_object = g_async_result_get_source_object (res);
6354 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
6355 g_object_unref (source_object);
6356 if (ret != NULL)
6357 return GSD_REMOTE_DESKTOP_RDP_DISPATCHER (ret);
6358 else
6359 return NULL;
6360 }
6361
6362 /**
6363 * gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus_sync:
6364 * @bus_type: A #GBusType.
6365 * @flags: Flags from the #GDBusProxyFlags enumeration.
6366 * @name: A bus name (well-known or unique).
6367 * @object_path: An object path.
6368 * @cancellable: (nullable): A #GCancellable or %NULL.
6369 * @error: Return location for error or %NULL
6370 *
6371 * Like gsd_remote_desktop_rdp_dispatcher_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
6372 *
6373 * The calling thread is blocked until a reply is received.
6374 *
6375 * See gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus() for the asynchronous version of this constructor.
6376 *
6377 * Returns: (transfer full) (type GsdRemoteDesktopRdpDispatcherProxy): The constructed proxy object or %NULL if @error is set.
6378 */
6379 GsdRemoteDesktopRdpDispatcher *
6380 gsd_remote_desktop_rdp_dispatcher_proxy_new_for_bus_sync (
6381 GBusType bus_type,
6382 GDBusProxyFlags flags,
6383 const gchar *name,
6384 const gchar *object_path,
6385 GCancellable *cancellable,
6386 GError **error)
6387 {
6388 GInitable *ret;
6389 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop.Rdp.Dispatcher", NULL);
6390 if (ret != NULL)
6391 return GSD_REMOTE_DESKTOP_RDP_DISPATCHER (ret);
6392 else
6393 return NULL;
6394 }
6395
6396
6397 /* ------------------------------------------------------------------------ */
6398
6399 /**
6400 * GsdRemoteDesktopRdpDispatcherSkeleton:
6401 *
6402 * The #GsdRemoteDesktopRdpDispatcherSkeleton structure contains only private data and should only be accessed using the provided API.
6403 */
6404
6405 /**
6406 * GsdRemoteDesktopRdpDispatcherSkeletonClass:
6407 * @parent_class: The parent class.
6408 *
6409 * Class structure for #GsdRemoteDesktopRdpDispatcherSkeleton.
6410 */
6411
6412 struct _GsdRemoteDesktopRdpDispatcherSkeletonPrivate
6413 {
6414 GValue *properties;
6415 GList *changed_properties;
6416 GSource *changed_properties_idle_source;
6417 GMainContext *context;
6418 GMutex lock;
6419 };
6420
6421 static void
6422 _gsd_remote_desktop_rdp_dispatcher_skeleton_handle_method_call (
6423 GDBusConnection *connection G_GNUC_UNUSED,
6424 const gchar *sender G_GNUC_UNUSED,
6425 const gchar *object_path G_GNUC_UNUSED,
6426 const gchar *interface_name,
6427 const gchar *method_name,
6428 GVariant *parameters,
6429 GDBusMethodInvocation *invocation,
6430 gpointer user_data)
6431 {
6432 GsdRemoteDesktopRdpDispatcherSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_DISPATCHER_SKELETON (user_data);
6433 _ExtendedGDBusMethodInfo *info;
6434 GVariantIter iter;
6435 GVariant *child;
6436 GValue *paramv;
6437 gsize num_params;
6438 guint num_extra;
6439 gsize n;
6440 guint signal_id;
6441 GValue return_value = G_VALUE_INIT;
6442 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
6443 g_assert (info != NULL);
6444 num_params = g_variant_n_children (parameters);
6445 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
6446 n = 0;
6447 g_value_init (&paramv[n], GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER);
6448 g_value_set_object (&paramv[n++], skeleton);
6449 g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
6450 g_value_set_object (&paramv[n++], invocation);
6451 if (info->pass_fdlist)
6452 {
6453 #ifdef G_OS_UNIX
6454 g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
6455 g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
6456 #else
6457 g_assert_not_reached ();
6458 #endif
6459 }
6460 g_variant_iter_init (&iter, parameters);
6461 while ((child = g_variant_iter_next_value (&iter)) != NULL)
6462 {
6463 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
6464 if (arg_info->use_gvariant)
6465 {
6466 g_value_init (&paramv[n], G_TYPE_VARIANT);
6467 g_value_set_variant (&paramv[n], child);
6468 n++;
6469 }
6470 else
6471 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
6472 g_variant_unref (child);
6473 }
6474 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER);
6475 g_value_init (&return_value, G_TYPE_BOOLEAN);
6476 g_signal_emitv (paramv, signal_id, 0, &return_value);
6477 if (!g_value_get_boolean (&return_value))
6478 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);
6479 g_value_unset (&return_value);
6480 for (n = 0; n < num_params + num_extra; n++)
6481 g_value_unset (&paramv[n]);
6482 g_free (paramv);
6483 }
6484
6485 static GVariant *
6486 _gsd_remote_desktop_rdp_dispatcher_skeleton_handle_get_property (
6487 GDBusConnection *connection G_GNUC_UNUSED,
6488 const gchar *sender G_GNUC_UNUSED,
6489 const gchar *object_path G_GNUC_UNUSED,
6490 const gchar *interface_name G_GNUC_UNUSED,
6491 const gchar *property_name,
6492 GError **error,
6493 gpointer user_data)
6494 {
6495 GsdRemoteDesktopRdpDispatcherSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_DISPATCHER_SKELETON (user_data);
6496 GValue value = G_VALUE_INIT;
6497 GParamSpec *pspec;
6498 _ExtendedGDBusPropertyInfo *info;
6499 GVariant *ret;
6500 ret = NULL;
6501 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct, property_name);
6502 g_assert (info != NULL);
6503 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
6504 if (pspec == NULL)
6505 {
6506 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
6507 }
6508 else
6509 {
6510 g_value_init (&value, pspec->value_type);
6511 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
6512 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
6513 g_value_unset (&value);
6514 }
6515 return ret;
6516 }
6517
6518 static gboolean
6519 _gsd_remote_desktop_rdp_dispatcher_skeleton_handle_set_property (
6520 GDBusConnection *connection G_GNUC_UNUSED,
6521 const gchar *sender G_GNUC_UNUSED,
6522 const gchar *object_path G_GNUC_UNUSED,
6523 const gchar *interface_name G_GNUC_UNUSED,
6524 const gchar *property_name,
6525 GVariant *variant,
6526 GError **error,
6527 gpointer user_data)
6528 {
6529 GsdRemoteDesktopRdpDispatcherSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_DISPATCHER_SKELETON (user_data);
6530 GValue value = G_VALUE_INIT;
6531 GParamSpec *pspec;
6532 _ExtendedGDBusPropertyInfo *info;
6533 gboolean ret;
6534 ret = FALSE;
6535 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct, property_name);
6536 g_assert (info != NULL);
6537 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
6538 if (pspec == NULL)
6539 {
6540 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
6541 }
6542 else
6543 {
6544 if (info->use_gvariant)
6545 g_value_set_variant (&value, variant);
6546 else
6547 g_dbus_gvariant_to_gvalue (variant, &value);
6548 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
6549 g_value_unset (&value);
6550 ret = TRUE;
6551 }
6552 return ret;
6553 }
6554
6555 static const GDBusInterfaceVTable _gsd_remote_desktop_rdp_dispatcher_skeleton_vtable =
6556 {
6557 _gsd_remote_desktop_rdp_dispatcher_skeleton_handle_method_call,
6558 _gsd_remote_desktop_rdp_dispatcher_skeleton_handle_get_property,
6559 _gsd_remote_desktop_rdp_dispatcher_skeleton_handle_set_property,
6560 {NULL}
6561 };
6562
6563 static GDBusInterfaceInfo *
6564 gsd_remote_desktop_rdp_dispatcher_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
6565 {
6566 return gsd_remote_desktop_rdp_dispatcher_interface_info ();
6567 }
6568
6569 static GDBusInterfaceVTable *
6570 gsd_remote_desktop_rdp_dispatcher_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
6571 {
6572 return (GDBusInterfaceVTable *) &_gsd_remote_desktop_rdp_dispatcher_skeleton_vtable;
6573 }
6574
6575 static GVariant *
6576 gsd_remote_desktop_rdp_dispatcher_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
6577 {
6578 GsdRemoteDesktopRdpDispatcherSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_DISPATCHER_SKELETON (_skeleton);
6579
6580 GVariantBuilder builder;
6581 guint n;
6582 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
6583 if (_gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct.properties == NULL)
6584 goto out;
6585 for (n = 0; _gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct.properties[n] != NULL; n++)
6586 {
6587 GDBusPropertyInfo *info = _gsd_remote_desktop_rdp_dispatcher_interface_info.parent_struct.properties[n];
6588 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
6589 {
6590 GVariant *value;
6591 value = _gsd_remote_desktop_rdp_dispatcher_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.RemoteDesktop.Rdp.Dispatcher", info->name, NULL, skeleton);
6592 if (value != NULL)
6593 {
6594 g_variant_take_ref (value);
6595 g_variant_builder_add (&builder, "{sv}", info->name, value);
6596 g_variant_unref (value);
6597 }
6598 }
6599 }
6600 out:
6601 return g_variant_builder_end (&builder);
6602 }
6603
6604 static void
6605 gsd_remote_desktop_rdp_dispatcher_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton G_GNUC_UNUSED)
6606 {
6607 }
6608
6609 static void gsd_remote_desktop_rdp_dispatcher_skeleton_iface_init (GsdRemoteDesktopRdpDispatcherIface *iface);
6610 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
6611 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpDispatcherSkeleton, gsd_remote_desktop_rdp_dispatcher_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
6612 G_ADD_PRIVATE (GsdRemoteDesktopRdpDispatcherSkeleton)
6613 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER, gsd_remote_desktop_rdp_dispatcher_skeleton_iface_init))
6614
6615 #else
6616 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpDispatcherSkeleton, gsd_remote_desktop_rdp_dispatcher_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
6617 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER, gsd_remote_desktop_rdp_dispatcher_skeleton_iface_init))
6618
6619 #endif
6620 static void
6621 gsd_remote_desktop_rdp_dispatcher_skeleton_finalize (GObject *object)
6622 {
6623 GsdRemoteDesktopRdpDispatcherSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_DISPATCHER_SKELETON (object);
6624 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
6625 if (skeleton->priv->changed_properties_idle_source != NULL)
6626 g_source_destroy (skeleton->priv->changed_properties_idle_source);
6627 g_main_context_unref (skeleton->priv->context);
6628 g_mutex_clear (&skeleton->priv->lock);
6629 G_OBJECT_CLASS (gsd_remote_desktop_rdp_dispatcher_skeleton_parent_class)->finalize (object);
6630 }
6631
6632 static void
6633 gsd_remote_desktop_rdp_dispatcher_skeleton_init (GsdRemoteDesktopRdpDispatcherSkeleton *skeleton)
6634 {
6635 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
6636 skeleton->priv = gsd_remote_desktop_rdp_dispatcher_skeleton_get_instance_private (skeleton);
6637 #else
6638 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER_SKELETON, GsdRemoteDesktopRdpDispatcherSkeletonPrivate);
6639 #endif
6640
6641 g_mutex_init (&skeleton->priv->lock);
6642 skeleton->priv->context = g_main_context_ref_thread_default ();
6643 }
6644
6645 static void
6646 gsd_remote_desktop_rdp_dispatcher_skeleton_class_init (GsdRemoteDesktopRdpDispatcherSkeletonClass *klass)
6647 {
6648 GObjectClass *gobject_class;
6649 GDBusInterfaceSkeletonClass *skeleton_class;
6650
6651 gobject_class = G_OBJECT_CLASS (klass);
6652 gobject_class->finalize = gsd_remote_desktop_rdp_dispatcher_skeleton_finalize;
6653
6654 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
6655 skeleton_class->get_info = gsd_remote_desktop_rdp_dispatcher_skeleton_dbus_interface_get_info;
6656 skeleton_class->get_properties = gsd_remote_desktop_rdp_dispatcher_skeleton_dbus_interface_get_properties;
6657 skeleton_class->flush = gsd_remote_desktop_rdp_dispatcher_skeleton_dbus_interface_flush;
6658 skeleton_class->get_vtable = gsd_remote_desktop_rdp_dispatcher_skeleton_dbus_interface_get_vtable;
6659
6660 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
6661 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopRdpDispatcherSkeletonPrivate));
6662 #endif
6663 }
6664
6665 static void
6666 gsd_remote_desktop_rdp_dispatcher_skeleton_iface_init (GsdRemoteDesktopRdpDispatcherIface *iface G_GNUC_UNUSED)
6667 {
6668 }
6669
6670 /**
6671 * gsd_remote_desktop_rdp_dispatcher_skeleton_new:
6672 *
6673 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Dispatcher.top_of_page">org.gnome.RemoteDesktop.Rdp.Dispatcher</link>.
6674 *
6675 * Returns: (transfer full) (type GsdRemoteDesktopRdpDispatcherSkeleton): The skeleton object.
6676 */
6677 GsdRemoteDesktopRdpDispatcher *
6678 gsd_remote_desktop_rdp_dispatcher_skeleton_new (void)
6679 {
6680 return GSD_REMOTE_DESKTOP_RDP_DISPATCHER (g_object_new (GSD_TYPE_REMOTE_DESKTOP_RDP_DISPATCHER_SKELETON, NULL));
6681 }
6682
6683 /* ------------------------------------------------------------------------
6684 * Code for interface org.gnome.RemoteDesktop.Rdp.Handover
6685 * ------------------------------------------------------------------------
6686 */
6687
6688 /**
6689 * SECTION:GsdRemoteDesktopRdpHandover
6690 * @title: GsdRemoteDesktopRdpHandover
6691 * @short_description: Generated C code for the org.gnome.RemoteDesktop.Rdp.Handover D-Bus interface
6692 *
6693 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Handover.top_of_page">org.gnome.RemoteDesktop.Rdp.Handover</link> D-Bus interface in C.
6694 */
6695
6696 enum
6697 {
6698 GSD__REMOTE_DESKTOP_RDP_HANDOVER_REDIRECT_CLIENT,
6699 GSD__REMOTE_DESKTOP_RDP_HANDOVER_TAKE_CLIENT_READY,
6700 };
6701
6702 static unsigned GSD__REMOTE_DESKTOP_RDP_HANDOVER_SIGNALS[2] = { 0 };
6703
6704 /* ---- Introspection data for org.gnome.RemoteDesktop.Rdp.Handover ---- */
6705
6706 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_method_info_start_handover_IN_ARG_username =
6707 {
6708 {
6709 -1,
6710 (gchar *) "username",
6711 (gchar *) "s",
6712 NULL
6713 },
6714 FALSE
6715 };
6716
6717 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_method_info_start_handover_IN_ARG_password =
6718 {
6719 {
6720 -1,
6721 (gchar *) "password",
6722 (gchar *) "s",
6723 NULL
6724 },
6725 FALSE
6726 };
6727
6728 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_handover_method_info_start_handover_IN_ARG_pointers[] =
6729 {
6730 &_gsd_remote_desktop_rdp_handover_method_info_start_handover_IN_ARG_username.parent_struct,
6731 &_gsd_remote_desktop_rdp_handover_method_info_start_handover_IN_ARG_password.parent_struct,
6732 NULL
6733 };
6734
6735 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_method_info_start_handover_OUT_ARG_certificate =
6736 {
6737 {
6738 -1,
6739 (gchar *) "certificate",
6740 (gchar *) "s",
6741 NULL
6742 },
6743 FALSE
6744 };
6745
6746 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_method_info_start_handover_OUT_ARG_key =
6747 {
6748 {
6749 -1,
6750 (gchar *) "key",
6751 (gchar *) "s",
6752 NULL
6753 },
6754 FALSE
6755 };
6756
6757 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_handover_method_info_start_handover_OUT_ARG_pointers[] =
6758 {
6759 &_gsd_remote_desktop_rdp_handover_method_info_start_handover_OUT_ARG_certificate.parent_struct,
6760 &_gsd_remote_desktop_rdp_handover_method_info_start_handover_OUT_ARG_key.parent_struct,
6761 NULL
6762 };
6763
6764 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_handover_method_info_start_handover =
6765 {
6766 {
6767 -1,
6768 (gchar *) "StartHandover",
6769 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_handover_method_info_start_handover_IN_ARG_pointers,
6770 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_handover_method_info_start_handover_OUT_ARG_pointers,
6771 NULL
6772 },
6773 "handle-start-handover",
6774 FALSE
6775 };
6776
6777 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_method_info_take_client_OUT_ARG_fd =
6778 {
6779 {
6780 -1,
6781 (gchar *) "fd",
6782 (gchar *) "h",
6783 NULL
6784 },
6785 FALSE
6786 };
6787
6788 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_handover_method_info_take_client_OUT_ARG_pointers[] =
6789 {
6790 &_gsd_remote_desktop_rdp_handover_method_info_take_client_OUT_ARG_fd.parent_struct,
6791 NULL
6792 };
6793
6794 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_handover_method_info_take_client =
6795 {
6796 {
6797 -1,
6798 (gchar *) "TakeClient",
6799 NULL,
6800 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_handover_method_info_take_client_OUT_ARG_pointers,
6801 NULL
6802 },
6803 "handle-take-client",
6804 TRUE
6805 };
6806
6807 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_method_info_get_system_credentials_OUT_ARG_username =
6808 {
6809 {
6810 -1,
6811 (gchar *) "username",
6812 (gchar *) "s",
6813 NULL
6814 },
6815 FALSE
6816 };
6817
6818 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_method_info_get_system_credentials_OUT_ARG_password =
6819 {
6820 {
6821 -1,
6822 (gchar *) "password",
6823 (gchar *) "s",
6824 NULL
6825 },
6826 FALSE
6827 };
6828
6829 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_handover_method_info_get_system_credentials_OUT_ARG_pointers[] =
6830 {
6831 &_gsd_remote_desktop_rdp_handover_method_info_get_system_credentials_OUT_ARG_username.parent_struct,
6832 &_gsd_remote_desktop_rdp_handover_method_info_get_system_credentials_OUT_ARG_password.parent_struct,
6833 NULL
6834 };
6835
6836 static const _ExtendedGDBusMethodInfo _gsd_remote_desktop_rdp_handover_method_info_get_system_credentials =
6837 {
6838 {
6839 -1,
6840 (gchar *) "GetSystemCredentials",
6841 NULL,
6842 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_handover_method_info_get_system_credentials_OUT_ARG_pointers,
6843 NULL
6844 },
6845 "handle-get-system-credentials",
6846 FALSE
6847 };
6848
6849 static const GDBusMethodInfo * const _gsd_remote_desktop_rdp_handover_method_info_pointers[] =
6850 {
6851 &_gsd_remote_desktop_rdp_handover_method_info_start_handover.parent_struct,
6852 &_gsd_remote_desktop_rdp_handover_method_info_take_client.parent_struct,
6853 &_gsd_remote_desktop_rdp_handover_method_info_get_system_credentials.parent_struct,
6854 NULL
6855 };
6856
6857 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_signal_info_redirect_client_ARG_routing_token =
6858 {
6859 {
6860 -1,
6861 (gchar *) "routing_token",
6862 (gchar *) "s",
6863 NULL
6864 },
6865 FALSE
6866 };
6867
6868 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_signal_info_redirect_client_ARG_username =
6869 {
6870 {
6871 -1,
6872 (gchar *) "username",
6873 (gchar *) "s",
6874 NULL
6875 },
6876 FALSE
6877 };
6878
6879 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_signal_info_redirect_client_ARG_password =
6880 {
6881 {
6882 -1,
6883 (gchar *) "password",
6884 (gchar *) "s",
6885 NULL
6886 },
6887 FALSE
6888 };
6889
6890 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_handover_signal_info_redirect_client_ARG_pointers[] =
6891 {
6892 &_gsd_remote_desktop_rdp_handover_signal_info_redirect_client_ARG_routing_token.parent_struct,
6893 &_gsd_remote_desktop_rdp_handover_signal_info_redirect_client_ARG_username.parent_struct,
6894 &_gsd_remote_desktop_rdp_handover_signal_info_redirect_client_ARG_password.parent_struct,
6895 NULL
6896 };
6897
6898 static const _ExtendedGDBusSignalInfo _gsd_remote_desktop_rdp_handover_signal_info_redirect_client =
6899 {
6900 {
6901 -1,
6902 (gchar *) "RedirectClient",
6903 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_handover_signal_info_redirect_client_ARG_pointers,
6904 NULL
6905 },
6906 "redirect-client"
6907 };
6908
6909 static const _ExtendedGDBusArgInfo _gsd_remote_desktop_rdp_handover_signal_info_take_client_ready_ARG_use_system_credentials =
6910 {
6911 {
6912 -1,
6913 (gchar *) "use_system_credentials",
6914 (gchar *) "b",
6915 NULL
6916 },
6917 FALSE
6918 };
6919
6920 static const GDBusArgInfo * const _gsd_remote_desktop_rdp_handover_signal_info_take_client_ready_ARG_pointers[] =
6921 {
6922 &_gsd_remote_desktop_rdp_handover_signal_info_take_client_ready_ARG_use_system_credentials.parent_struct,
6923 NULL
6924 };
6925
6926 static const _ExtendedGDBusSignalInfo _gsd_remote_desktop_rdp_handover_signal_info_take_client_ready =
6927 {
6928 {
6929 -1,
6930 (gchar *) "TakeClientReady",
6931 (GDBusArgInfo **) &_gsd_remote_desktop_rdp_handover_signal_info_take_client_ready_ARG_pointers,
6932 NULL
6933 },
6934 "take-client-ready"
6935 };
6936
6937 static const GDBusSignalInfo * const _gsd_remote_desktop_rdp_handover_signal_info_pointers[] =
6938 {
6939 &_gsd_remote_desktop_rdp_handover_signal_info_redirect_client.parent_struct,
6940 &_gsd_remote_desktop_rdp_handover_signal_info_take_client_ready.parent_struct,
6941 NULL
6942 };
6943
6944 static const _ExtendedGDBusInterfaceInfo _gsd_remote_desktop_rdp_handover_interface_info =
6945 {
6946 {
6947 -1,
6948 (gchar *) "org.gnome.RemoteDesktop.Rdp.Handover",
6949 (GDBusMethodInfo **) &_gsd_remote_desktop_rdp_handover_method_info_pointers,
6950 (GDBusSignalInfo **) &_gsd_remote_desktop_rdp_handover_signal_info_pointers,
6951 NULL,
6952 NULL
6953 },
6954 "remote-desktop-rdp-handover",
6955 };
6956
6957
6958 /**
6959 * gsd_remote_desktop_rdp_handover_interface_info:
6960 *
6961 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Handover.top_of_page">org.gnome.RemoteDesktop.Rdp.Handover</link> D-Bus interface.
6962 *
6963 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
6964 */
6965 GDBusInterfaceInfo *
6966 gsd_remote_desktop_rdp_handover_interface_info (void)
6967 {
6968 return (GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_handover_interface_info.parent_struct;
6969 }
6970
6971 /**
6972 * gsd_remote_desktop_rdp_handover_override_properties:
6973 * @klass: The class structure for a #GObject derived class.
6974 * @property_id_begin: The property id to assign to the first overridden property.
6975 *
6976 * Overrides all #GObject properties in the #GsdRemoteDesktopRdpHandover interface for a concrete class.
6977 * The properties are overridden in the order they are defined.
6978 *
6979 * Returns: The last property id.
6980 */
6981 guint
6982 gsd_remote_desktop_rdp_handover_override_properties (GObjectClass *klass G_GNUC_UNUSED, guint property_id_begin)
6983 {
6984 return property_id_begin - 1;
6985 }
6986
6987
6988 inline static void
6989 gsd_remote_desktop_rdp_handover_signal_marshal_redirect_client (
6990 GClosure *closure,
6991 GValue *return_value,
6992 unsigned int n_param_values,
6993 const GValue *param_values,
6994 void *invocation_hint,
6995 void *marshal_data)
6996 {
6997 _g_dbus_codegen_marshal_VOID__STRING_STRING_STRING (closure,
6998 return_value, n_param_values, param_values, invocation_hint, marshal_data);
6999 }
7000
7001 inline static void
7002 gsd_remote_desktop_rdp_handover_signal_marshal_take_client_ready (
7003 GClosure *closure,
7004 GValue *return_value,
7005 unsigned int n_param_values,
7006 const GValue *param_values,
7007 void *invocation_hint,
7008 void *marshal_data)
7009 {
7010 g_cclosure_marshal_VOID__BOOLEAN (closure,
7011 return_value, n_param_values, param_values, invocation_hint, marshal_data);
7012 }
7013
7014 inline static void
7015 gsd_remote_desktop_rdp_handover_method_marshal_start_handover (
7016 GClosure *closure,
7017 GValue *return_value,
7018 unsigned int n_param_values,
7019 const GValue *param_values,
7020 void *invocation_hint,
7021 void *marshal_data)
7022 {
7023 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_STRING_STRING (closure,
7024 return_value, n_param_values, param_values, invocation_hint, marshal_data);
7025 }
7026
7027 inline static void
7028 gsd_remote_desktop_rdp_handover_method_marshal_take_client (
7029 GClosure *closure,
7030 GValue *return_value,
7031 unsigned int n_param_values,
7032 const GValue *param_values,
7033 void *invocation_hint,
7034 void *marshal_data)
7035 {
7036 _g_dbus_codegen_marshal_BOOLEAN__OBJECT_OBJECT (closure,
7037 return_value, n_param_values, param_values, invocation_hint, marshal_data);
7038 }
7039
7040 inline static void
7041 gsd_remote_desktop_rdp_handover_method_marshal_get_system_credentials (
7042 GClosure *closure,
7043 GValue *return_value,
7044 unsigned int n_param_values,
7045 const GValue *param_values,
7046 void *invocation_hint,
7047 void *marshal_data)
7048 {
7049 _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
7050 return_value, n_param_values, param_values, invocation_hint, marshal_data);
7051 }
7052
7053
7054 /**
7055 * GsdRemoteDesktopRdpHandover:
7056 *
7057 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Handover.top_of_page">org.gnome.RemoteDesktop.Rdp.Handover</link>.
7058 */
7059
7060 /**
7061 * GsdRemoteDesktopRdpHandoverIface:
7062 * @parent_iface: The parent interface.
7063 * @handle_get_system_credentials: Handler for the #GsdRemoteDesktopRdpHandover::handle-get-system-credentials signal.
7064 * @handle_start_handover: Handler for the #GsdRemoteDesktopRdpHandover::handle-start-handover signal.
7065 * @handle_take_client: Handler for the #GsdRemoteDesktopRdpHandover::handle-take-client signal.
7066 * @redirect_client: Handler for the #GsdRemoteDesktopRdpHandover::redirect-client signal.
7067 * @take_client_ready: Handler for the #GsdRemoteDesktopRdpHandover::take-client-ready signal.
7068 *
7069 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Handover.top_of_page">org.gnome.RemoteDesktop.Rdp.Handover</link>.
7070 */
7071
7072 typedef GsdRemoteDesktopRdpHandoverIface GsdRemoteDesktopRdpHandoverInterface;
7073 G_DEFINE_INTERFACE (GsdRemoteDesktopRdpHandover, gsd_remote_desktop_rdp_handover, G_TYPE_OBJECT)
7074
7075 static void
7076 gsd_remote_desktop_rdp_handover_default_init (GsdRemoteDesktopRdpHandoverIface *iface)
7077 {
7078 /* GObject signals for incoming D-Bus method calls: */
7079 /**
7080 * GsdRemoteDesktopRdpHandover::handle-start-handover:
7081 * @object: A #GsdRemoteDesktopRdpHandover.
7082 * @invocation: A #GDBusMethodInvocation.
7083 * @arg_username: Argument passed by remote caller.
7084 * @arg_password: Argument passed by remote caller.
7085 *
7086 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.StartHandover">StartHandover()</link> D-Bus method.
7087 *
7088 * 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 gsd_remote_desktop_rdp_handover_complete_start_handover() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7089 *
7090 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
7091 */
7092 g_signal_new ("handle-start-handover",
7093 G_TYPE_FROM_INTERFACE (iface),
7094 G_SIGNAL_RUN_LAST,
7095 G_STRUCT_OFFSET (GsdRemoteDesktopRdpHandoverIface, handle_start_handover),
7096 g_signal_accumulator_true_handled,
7097 NULL,
7098 gsd_remote_desktop_rdp_handover_method_marshal_start_handover,
7099 G_TYPE_BOOLEAN,
7100 3,
7101 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING);
7102
7103 /**
7104 * GsdRemoteDesktopRdpHandover::handle-take-client:
7105 * @object: A #GsdRemoteDesktopRdpHandover.
7106 * @invocation: A #GDBusMethodInvocation.
7107 * @fd_list: (nullable): A #GUnixFDList or %NULL.
7108 *
7109 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.TakeClient">TakeClient()</link> D-Bus method.
7110 *
7111 * 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 gsd_remote_desktop_rdp_handover_complete_take_client() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7112 *
7113 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
7114 */
7115 g_signal_new ("handle-take-client",
7116 G_TYPE_FROM_INTERFACE (iface),
7117 G_SIGNAL_RUN_LAST,
7118 G_STRUCT_OFFSET (GsdRemoteDesktopRdpHandoverIface, handle_take_client),
7119 g_signal_accumulator_true_handled,
7120 NULL,
7121 gsd_remote_desktop_rdp_handover_method_marshal_take_client,
7122 G_TYPE_BOOLEAN,
7123 2,
7124 G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST);
7125
7126 /**
7127 * GsdRemoteDesktopRdpHandover::handle-get-system-credentials:
7128 * @object: A #GsdRemoteDesktopRdpHandover.
7129 * @invocation: A #GDBusMethodInvocation.
7130 *
7131 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.GetSystemCredentials">GetSystemCredentials()</link> D-Bus method.
7132 *
7133 * 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 gsd_remote_desktop_rdp_handover_complete_get_system_credentials() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
7134 *
7135 * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
7136 */
7137 g_signal_new ("handle-get-system-credentials",
7138 G_TYPE_FROM_INTERFACE (iface),
7139 G_SIGNAL_RUN_LAST,
7140 G_STRUCT_OFFSET (GsdRemoteDesktopRdpHandoverIface, handle_get_system_credentials),
7141 g_signal_accumulator_true_handled,
7142 NULL,
7143 gsd_remote_desktop_rdp_handover_method_marshal_get_system_credentials,
7144 G_TYPE_BOOLEAN,
7145 1,
7146 G_TYPE_DBUS_METHOD_INVOCATION);
7147
7148 /* GObject signals for received D-Bus signals: */
7149 /**
7150 * GsdRemoteDesktopRdpHandover::redirect-client:
7151 * @object: A #GsdRemoteDesktopRdpHandover.
7152 * @arg_routing_token: Argument.
7153 * @arg_username: Argument.
7154 * @arg_password: Argument.
7155 *
7156 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-gnome-RemoteDesktop-Rdp-Handover.RedirectClient">"RedirectClient"</link> is received.
7157 *
7158 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
7159 */
7160 GSD__REMOTE_DESKTOP_RDP_HANDOVER_SIGNALS[GSD__REMOTE_DESKTOP_RDP_HANDOVER_REDIRECT_CLIENT] =
7161 g_signal_new ("redirect-client",
7162 G_TYPE_FROM_INTERFACE (iface),
7163 G_SIGNAL_RUN_LAST,
7164 G_STRUCT_OFFSET (GsdRemoteDesktopRdpHandoverIface, redirect_client),
7165 NULL,
7166 NULL,
7167 gsd_remote_desktop_rdp_handover_signal_marshal_redirect_client,
7168 G_TYPE_NONE,
7169 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
7170
7171 /**
7172 * GsdRemoteDesktopRdpHandover::take-client-ready:
7173 * @object: A #GsdRemoteDesktopRdpHandover.
7174 * @arg_use_system_credentials: Argument.
7175 *
7176 * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-gnome-RemoteDesktop-Rdp-Handover.TakeClientReady">"TakeClientReady"</link> is received.
7177 *
7178 * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
7179 */
7180 GSD__REMOTE_DESKTOP_RDP_HANDOVER_SIGNALS[GSD__REMOTE_DESKTOP_RDP_HANDOVER_TAKE_CLIENT_READY] =
7181 g_signal_new ("take-client-ready",
7182 G_TYPE_FROM_INTERFACE (iface),
7183 G_SIGNAL_RUN_LAST,
7184 G_STRUCT_OFFSET (GsdRemoteDesktopRdpHandoverIface, take_client_ready),
7185 NULL,
7186 NULL,
7187 gsd_remote_desktop_rdp_handover_signal_marshal_take_client_ready,
7188 G_TYPE_NONE,
7189 1, G_TYPE_BOOLEAN);
7190
7191 }
7192
7193 /**
7194 * gsd_remote_desktop_rdp_handover_emit_redirect_client:
7195 * @object: A #GsdRemoteDesktopRdpHandover.
7196 * @arg_routing_token: Argument to pass with the signal.
7197 * @arg_username: Argument to pass with the signal.
7198 * @arg_password: Argument to pass with the signal.
7199 *
7200 * Emits the <link linkend="gdbus-signal-org-gnome-RemoteDesktop-Rdp-Handover.RedirectClient">"RedirectClient"</link> D-Bus signal.
7201 */
7202 void
7203 gsd_remote_desktop_rdp_handover_emit_redirect_client (
7204 GsdRemoteDesktopRdpHandover *object,
7205 const gchar *arg_routing_token,
7206 const gchar *arg_username,
7207 const gchar *arg_password)
7208 {
7209 g_signal_emit (object, GSD__REMOTE_DESKTOP_RDP_HANDOVER_SIGNALS[GSD__REMOTE_DESKTOP_RDP_HANDOVER_REDIRECT_CLIENT], 0, arg_routing_token, arg_username, arg_password);
7210 }
7211
7212 /**
7213 * gsd_remote_desktop_rdp_handover_emit_take_client_ready:
7214 * @object: A #GsdRemoteDesktopRdpHandover.
7215 * @arg_use_system_credentials: Argument to pass with the signal.
7216 *
7217 * Emits the <link linkend="gdbus-signal-org-gnome-RemoteDesktop-Rdp-Handover.TakeClientReady">"TakeClientReady"</link> D-Bus signal.
7218 */
7219 void
7220 gsd_remote_desktop_rdp_handover_emit_take_client_ready (
7221 GsdRemoteDesktopRdpHandover *object,
7222 gboolean arg_use_system_credentials)
7223 {
7224 g_signal_emit (object, GSD__REMOTE_DESKTOP_RDP_HANDOVER_SIGNALS[GSD__REMOTE_DESKTOP_RDP_HANDOVER_TAKE_CLIENT_READY], 0, arg_use_system_credentials);
7225 }
7226
7227 /**
7228 * gsd_remote_desktop_rdp_handover_call_start_handover:
7229 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7230 * @arg_username: Argument to pass with the method invocation.
7231 * @arg_password: Argument to pass with the method invocation.
7232 * @cancellable: (nullable): A #GCancellable or %NULL.
7233 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7234 * @user_data: User data to pass to @callback.
7235 *
7236 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.StartHandover">StartHandover()</link> D-Bus method on @proxy.
7237 * 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()).
7238 * You can then call gsd_remote_desktop_rdp_handover_call_start_handover_finish() to get the result of the operation.
7239 *
7240 * See gsd_remote_desktop_rdp_handover_call_start_handover_sync() for the synchronous, blocking version of this method.
7241 */
7242 void
7243 gsd_remote_desktop_rdp_handover_call_start_handover (
7244 GsdRemoteDesktopRdpHandover *proxy,
7245 const gchar *arg_username,
7246 const gchar *arg_password,
7247 GCancellable *cancellable,
7248 GAsyncReadyCallback callback,
7249 gpointer user_data)
7250 {
7251 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
7252 "StartHandover",
7253 g_variant_new ("(ss)",
7254 arg_username,
7255 arg_password),
7256 G_DBUS_CALL_FLAGS_NONE,
7257 -1,
7258 cancellable,
7259 callback,
7260 user_data);
7261 }
7262
7263 /**
7264 * gsd_remote_desktop_rdp_handover_call_start_handover_finish:
7265 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7266 * @out_certificate: (out) (optional): Return location for return parameter or %NULL to ignore.
7267 * @out_key: (out) (optional): Return location for return parameter or %NULL to ignore.
7268 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_handover_call_start_handover().
7269 * @error: Return location for error or %NULL.
7270 *
7271 * Finishes an operation started with gsd_remote_desktop_rdp_handover_call_start_handover().
7272 *
7273 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
7274 */
7275 gboolean
7276 gsd_remote_desktop_rdp_handover_call_start_handover_finish (
7277 GsdRemoteDesktopRdpHandover *proxy,
7278 gchar **out_certificate,
7279 gchar **out_key,
7280 GAsyncResult *res,
7281 GError **error)
7282 {
7283 GVariant *_ret;
7284 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
7285 if (_ret == NULL)
7286 goto _out;
7287 g_variant_get (_ret,
7288 "(ss)",
7289 out_certificate,
7290 out_key);
7291 g_variant_unref (_ret);
7292 _out:
7293 return _ret != NULL;
7294 }
7295
7296 /**
7297 * gsd_remote_desktop_rdp_handover_call_start_handover_sync:
7298 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7299 * @arg_username: Argument to pass with the method invocation.
7300 * @arg_password: Argument to pass with the method invocation.
7301 * @out_certificate: (out) (optional): Return location for return parameter or %NULL to ignore.
7302 * @out_key: (out) (optional): Return location for return parameter or %NULL to ignore.
7303 * @cancellable: (nullable): A #GCancellable or %NULL.
7304 * @error: Return location for error or %NULL.
7305 *
7306 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.StartHandover">StartHandover()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7307 *
7308 * See gsd_remote_desktop_rdp_handover_call_start_handover() for the asynchronous version of this method.
7309 *
7310 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
7311 */
7312 gboolean
7313 gsd_remote_desktop_rdp_handover_call_start_handover_sync (
7314 GsdRemoteDesktopRdpHandover *proxy,
7315 const gchar *arg_username,
7316 const gchar *arg_password,
7317 gchar **out_certificate,
7318 gchar **out_key,
7319 GCancellable *cancellable,
7320 GError **error)
7321 {
7322 GVariant *_ret;
7323 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
7324 "StartHandover",
7325 g_variant_new ("(ss)",
7326 arg_username,
7327 arg_password),
7328 G_DBUS_CALL_FLAGS_NONE,
7329 -1,
7330 cancellable,
7331 error);
7332 if (_ret == NULL)
7333 goto _out;
7334 g_variant_get (_ret,
7335 "(ss)",
7336 out_certificate,
7337 out_key);
7338 g_variant_unref (_ret);
7339 _out:
7340 return _ret != NULL;
7341 }
7342
7343 /**
7344 * gsd_remote_desktop_rdp_handover_call_take_client:
7345 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7346 * @fd_list: (nullable): A #GUnixFDList or %NULL.
7347 * @cancellable: (nullable): A #GCancellable or %NULL.
7348 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7349 * @user_data: User data to pass to @callback.
7350 *
7351 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.TakeClient">TakeClient()</link> D-Bus method on @proxy.
7352 * 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()).
7353 * You can then call gsd_remote_desktop_rdp_handover_call_take_client_finish() to get the result of the operation.
7354 *
7355 * See gsd_remote_desktop_rdp_handover_call_take_client_sync() for the synchronous, blocking version of this method.
7356 */
7357 void
7358 gsd_remote_desktop_rdp_handover_call_take_client (
7359 GsdRemoteDesktopRdpHandover *proxy,
7360 GUnixFDList *fd_list,
7361 GCancellable *cancellable,
7362 GAsyncReadyCallback callback,
7363 gpointer user_data)
7364 {
7365 g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
7366 "TakeClient",
7367 g_variant_new ("()"),
7368 G_DBUS_CALL_FLAGS_NONE,
7369 -1,
7370 fd_list,
7371 cancellable,
7372 callback,
7373 user_data);
7374 }
7375
7376 /**
7377 * gsd_remote_desktop_rdp_handover_call_take_client_finish:
7378 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7379 * @out_fd: (out) (optional): Return location for return parameter or %NULL to ignore.
7380 * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
7381 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_handover_call_take_client().
7382 * @error: Return location for error or %NULL.
7383 *
7384 * Finishes an operation started with gsd_remote_desktop_rdp_handover_call_take_client().
7385 *
7386 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
7387 */
7388 gboolean
7389 gsd_remote_desktop_rdp_handover_call_take_client_finish (
7390 GsdRemoteDesktopRdpHandover *proxy,
7391 GVariant **out_fd,
7392 GUnixFDList **out_fd_list,
7393 GAsyncResult *res,
7394 GError **error)
7395 {
7396 GVariant *_ret;
7397 _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
7398 if (_ret == NULL)
7399 goto _out;
7400 g_variant_get (_ret,
7401 "(@h)",
7402 out_fd);
7403 g_variant_unref (_ret);
7404 _out:
7405 return _ret != NULL;
7406 }
7407
7408 /**
7409 * gsd_remote_desktop_rdp_handover_call_take_client_sync:
7410 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7411 * @fd_list: (nullable): A #GUnixFDList or %NULL.
7412 * @out_fd: (out) (optional): Return location for return parameter or %NULL to ignore.
7413 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
7414 * @cancellable: (nullable): A #GCancellable or %NULL.
7415 * @error: Return location for error or %NULL.
7416 *
7417 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.TakeClient">TakeClient()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7418 *
7419 * See gsd_remote_desktop_rdp_handover_call_take_client() for the asynchronous version of this method.
7420 *
7421 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
7422 */
7423 gboolean
7424 gsd_remote_desktop_rdp_handover_call_take_client_sync (
7425 GsdRemoteDesktopRdpHandover *proxy,
7426 GUnixFDList *fd_list,
7427 GVariant **out_fd,
7428 GUnixFDList **out_fd_list,
7429 GCancellable *cancellable,
7430 GError **error)
7431 {
7432 GVariant *_ret;
7433 _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
7434 "TakeClient",
7435 g_variant_new ("()"),
7436 G_DBUS_CALL_FLAGS_NONE,
7437 -1,
7438 fd_list,
7439 out_fd_list,
7440 cancellable,
7441 error);
7442 if (_ret == NULL)
7443 goto _out;
7444 g_variant_get (_ret,
7445 "(@h)",
7446 out_fd);
7447 g_variant_unref (_ret);
7448 _out:
7449 return _ret != NULL;
7450 }
7451
7452 /**
7453 * gsd_remote_desktop_rdp_handover_call_get_system_credentials:
7454 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7455 * @cancellable: (nullable): A #GCancellable or %NULL.
7456 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7457 * @user_data: User data to pass to @callback.
7458 *
7459 * Asynchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.GetSystemCredentials">GetSystemCredentials()</link> D-Bus method on @proxy.
7460 * 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()).
7461 * You can then call gsd_remote_desktop_rdp_handover_call_get_system_credentials_finish() to get the result of the operation.
7462 *
7463 * See gsd_remote_desktop_rdp_handover_call_get_system_credentials_sync() for the synchronous, blocking version of this method.
7464 */
7465 void
7466 gsd_remote_desktop_rdp_handover_call_get_system_credentials (
7467 GsdRemoteDesktopRdpHandover *proxy,
7468 GCancellable *cancellable,
7469 GAsyncReadyCallback callback,
7470 gpointer user_data)
7471 {
7472 g_dbus_proxy_call (G_DBUS_PROXY (proxy),
7473 "GetSystemCredentials",
7474 g_variant_new ("()"),
7475 G_DBUS_CALL_FLAGS_NONE,
7476 -1,
7477 cancellable,
7478 callback,
7479 user_data);
7480 }
7481
7482 /**
7483 * gsd_remote_desktop_rdp_handover_call_get_system_credentials_finish:
7484 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7485 * @out_username: (out) (optional): Return location for return parameter or %NULL to ignore.
7486 * @out_password: (out) (optional): Return location for return parameter or %NULL to ignore.
7487 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_handover_call_get_system_credentials().
7488 * @error: Return location for error or %NULL.
7489 *
7490 * Finishes an operation started with gsd_remote_desktop_rdp_handover_call_get_system_credentials().
7491 *
7492 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
7493 */
7494 gboolean
7495 gsd_remote_desktop_rdp_handover_call_get_system_credentials_finish (
7496 GsdRemoteDesktopRdpHandover *proxy,
7497 gchar **out_username,
7498 gchar **out_password,
7499 GAsyncResult *res,
7500 GError **error)
7501 {
7502 GVariant *_ret;
7503 _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
7504 if (_ret == NULL)
7505 goto _out;
7506 g_variant_get (_ret,
7507 "(ss)",
7508 out_username,
7509 out_password);
7510 g_variant_unref (_ret);
7511 _out:
7512 return _ret != NULL;
7513 }
7514
7515 /**
7516 * gsd_remote_desktop_rdp_handover_call_get_system_credentials_sync:
7517 * @proxy: A #GsdRemoteDesktopRdpHandoverProxy.
7518 * @out_username: (out) (optional): Return location for return parameter or %NULL to ignore.
7519 * @out_password: (out) (optional): Return location for return parameter or %NULL to ignore.
7520 * @cancellable: (nullable): A #GCancellable or %NULL.
7521 * @error: Return location for error or %NULL.
7522 *
7523 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.GetSystemCredentials">GetSystemCredentials()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
7524 *
7525 * See gsd_remote_desktop_rdp_handover_call_get_system_credentials() for the asynchronous version of this method.
7526 *
7527 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
7528 */
7529 gboolean
7530 gsd_remote_desktop_rdp_handover_call_get_system_credentials_sync (
7531 GsdRemoteDesktopRdpHandover *proxy,
7532 gchar **out_username,
7533 gchar **out_password,
7534 GCancellable *cancellable,
7535 GError **error)
7536 {
7537 GVariant *_ret;
7538 _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
7539 "GetSystemCredentials",
7540 g_variant_new ("()"),
7541 G_DBUS_CALL_FLAGS_NONE,
7542 -1,
7543 cancellable,
7544 error);
7545 if (_ret == NULL)
7546 goto _out;
7547 g_variant_get (_ret,
7548 "(ss)",
7549 out_username,
7550 out_password);
7551 g_variant_unref (_ret);
7552 _out:
7553 return _ret != NULL;
7554 }
7555
7556 /**
7557 * gsd_remote_desktop_rdp_handover_complete_start_handover:
7558 * @object: A #GsdRemoteDesktopRdpHandover.
7559 * @invocation: (transfer full): A #GDBusMethodInvocation.
7560 * @certificate: Parameter to return.
7561 * @key: Parameter to return.
7562 *
7563 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.StartHandover">StartHandover()</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.
7564 *
7565 * This method will free @invocation, you cannot use it afterwards.
7566 */
7567 void
7568 gsd_remote_desktop_rdp_handover_complete_start_handover (
7569 GsdRemoteDesktopRdpHandover *object G_GNUC_UNUSED,
7570 GDBusMethodInvocation *invocation,
7571 const gchar *certificate,
7572 const gchar *key)
7573 {
7574 g_dbus_method_invocation_return_value (invocation,
7575 g_variant_new ("(ss)",
7576 certificate,
7577 key));
7578 }
7579
7580 /**
7581 * gsd_remote_desktop_rdp_handover_complete_take_client:
7582 * @object: A #GsdRemoteDesktopRdpHandover.
7583 * @invocation: (transfer full): A #GDBusMethodInvocation.
7584 * @fd_list: (nullable): A #GUnixFDList or %NULL.
7585 * @fd: Parameter to return.
7586 *
7587 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.TakeClient">TakeClient()</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.
7588 *
7589 * This method will free @invocation, you cannot use it afterwards.
7590 */
7591 void
7592 gsd_remote_desktop_rdp_handover_complete_take_client (
7593 GsdRemoteDesktopRdpHandover *object G_GNUC_UNUSED,
7594 GDBusMethodInvocation *invocation,
7595 GUnixFDList *fd_list,
7596 GVariant *fd)
7597 {
7598 g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
7599 g_variant_new ("(@h)",
7600 fd),
7601 fd_list);
7602 }
7603
7604 /**
7605 * gsd_remote_desktop_rdp_handover_complete_get_system_credentials:
7606 * @object: A #GsdRemoteDesktopRdpHandover.
7607 * @invocation: (transfer full): A #GDBusMethodInvocation.
7608 * @username: Parameter to return.
7609 * @password: Parameter to return.
7610 *
7611 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-RemoteDesktop-Rdp-Handover.GetSystemCredentials">GetSystemCredentials()</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.
7612 *
7613 * This method will free @invocation, you cannot use it afterwards.
7614 */
7615 void
7616 gsd_remote_desktop_rdp_handover_complete_get_system_credentials (
7617 GsdRemoteDesktopRdpHandover *object G_GNUC_UNUSED,
7618 GDBusMethodInvocation *invocation,
7619 const gchar *username,
7620 const gchar *password)
7621 {
7622 g_dbus_method_invocation_return_value (invocation,
7623 g_variant_new ("(ss)",
7624 username,
7625 password));
7626 }
7627
7628 /* ------------------------------------------------------------------------ */
7629
7630 /**
7631 * GsdRemoteDesktopRdpHandoverProxy:
7632 *
7633 * The #GsdRemoteDesktopRdpHandoverProxy structure contains only private data and should only be accessed using the provided API.
7634 */
7635
7636 /**
7637 * GsdRemoteDesktopRdpHandoverProxyClass:
7638 * @parent_class: The parent class.
7639 *
7640 * Class structure for #GsdRemoteDesktopRdpHandoverProxy.
7641 */
7642
7643 struct _GsdRemoteDesktopRdpHandoverProxyPrivate
7644 {
7645 GData *qdata;
7646 };
7647
7648 static void gsd_remote_desktop_rdp_handover_proxy_iface_init (GsdRemoteDesktopRdpHandoverIface *iface);
7649
7650 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7651 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpHandoverProxy, gsd_remote_desktop_rdp_handover_proxy, G_TYPE_DBUS_PROXY,
7652 G_ADD_PRIVATE (GsdRemoteDesktopRdpHandoverProxy)
7653 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER, gsd_remote_desktop_rdp_handover_proxy_iface_init))
7654
7655 #else
7656 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpHandoverProxy, gsd_remote_desktop_rdp_handover_proxy, G_TYPE_DBUS_PROXY,
7657 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER, gsd_remote_desktop_rdp_handover_proxy_iface_init))
7658
7659 #endif
7660 static void
7661 gsd_remote_desktop_rdp_handover_proxy_finalize (GObject *object)
7662 {
7663 GsdRemoteDesktopRdpHandoverProxy *proxy = GSD_REMOTE_DESKTOP_RDP_HANDOVER_PROXY (object);
7664 g_datalist_clear (&proxy->priv->qdata);
7665 G_OBJECT_CLASS (gsd_remote_desktop_rdp_handover_proxy_parent_class)->finalize (object);
7666 }
7667
7668 static void
7669 gsd_remote_desktop_rdp_handover_proxy_get_property (GObject *object G_GNUC_UNUSED,
7670 guint prop_id G_GNUC_UNUSED,
7671 GValue *value G_GNUC_UNUSED,
7672 GParamSpec *pspec G_GNUC_UNUSED)
7673 {
7674 }
7675
7676 static void
7677 gsd_remote_desktop_rdp_handover_proxy_set_property (GObject *object G_GNUC_UNUSED,
7678 guint prop_id G_GNUC_UNUSED,
7679 const GValue *value G_GNUC_UNUSED,
7680 GParamSpec *pspec G_GNUC_UNUSED)
7681 {
7682 }
7683
7684 static void
7685 gsd_remote_desktop_rdp_handover_proxy_g_signal (GDBusProxy *proxy,
7686 const gchar *sender_name G_GNUC_UNUSED,
7687 const gchar *signal_name,
7688 GVariant *parameters)
7689 {
7690 _ExtendedGDBusSignalInfo *info;
7691 GVariantIter iter;
7692 GVariant *child;
7693 GValue *paramv;
7694 gsize num_params;
7695 gsize n;
7696 guint signal_id;
7697 info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_handover_interface_info.parent_struct, signal_name);
7698 if (info == NULL)
7699 return;
7700 num_params = g_variant_n_children (parameters);
7701 paramv = g_new0 (GValue, num_params + 1);
7702 g_value_init (&paramv[0], GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER);
7703 g_value_set_object (&paramv[0], proxy);
7704 g_variant_iter_init (&iter, parameters);
7705 n = 1;
7706 while ((child = g_variant_iter_next_value (&iter)) != NULL)
7707 {
7708 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
7709 if (arg_info->use_gvariant)
7710 {
7711 g_value_init (&paramv[n], G_TYPE_VARIANT);
7712 g_value_set_variant (&paramv[n], child);
7713 n++;
7714 }
7715 else
7716 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
7717 g_variant_unref (child);
7718 }
7719 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER);
7720 g_signal_emitv (paramv, signal_id, 0, NULL);
7721 for (n = 0; n < num_params + 1; n++)
7722 g_value_unset (&paramv[n]);
7723 g_free (paramv);
7724 }
7725
7726 static void
7727 gsd_remote_desktop_rdp_handover_proxy_g_properties_changed (GDBusProxy *_proxy,
7728 GVariant *changed_properties,
7729 const gchar *const *invalidated_properties)
7730 {
7731 GsdRemoteDesktopRdpHandoverProxy *proxy = GSD_REMOTE_DESKTOP_RDP_HANDOVER_PROXY (_proxy);
7732 guint n;
7733 const gchar *key;
7734 GVariantIter *iter;
7735 _ExtendedGDBusPropertyInfo *info;
7736 g_variant_get (changed_properties, "a{sv}", &iter);
7737 while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
7738 {
7739 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_handover_interface_info.parent_struct, key);
7740 g_datalist_remove_data (&proxy->priv->qdata, key);
7741 if (info != NULL)
7742 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
7743 }
7744 g_variant_iter_free (iter);
7745 for (n = 0; invalidated_properties[n] != NULL; n++)
7746 {
7747 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_handover_interface_info.parent_struct, invalidated_properties[n]);
7748 g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
7749 if (info != NULL)
7750 g_object_notify (G_OBJECT (proxy), info->hyphen_name);
7751 }
7752 }
7753
7754 static void
7755 gsd_remote_desktop_rdp_handover_proxy_init (GsdRemoteDesktopRdpHandoverProxy *proxy)
7756 {
7757 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
7758 proxy->priv = gsd_remote_desktop_rdp_handover_proxy_get_instance_private (proxy);
7759 #else
7760 proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER_PROXY, GsdRemoteDesktopRdpHandoverProxyPrivate);
7761 #endif
7762
7763 g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), gsd_remote_desktop_rdp_handover_interface_info ());
7764 }
7765
7766 static void
7767 gsd_remote_desktop_rdp_handover_proxy_class_init (GsdRemoteDesktopRdpHandoverProxyClass *klass)
7768 {
7769 GObjectClass *gobject_class;
7770 GDBusProxyClass *proxy_class;
7771
7772 gobject_class = G_OBJECT_CLASS (klass);
7773 gobject_class->finalize = gsd_remote_desktop_rdp_handover_proxy_finalize;
7774 gobject_class->get_property = gsd_remote_desktop_rdp_handover_proxy_get_property;
7775 gobject_class->set_property = gsd_remote_desktop_rdp_handover_proxy_set_property;
7776
7777 proxy_class = G_DBUS_PROXY_CLASS (klass);
7778 proxy_class->g_signal = gsd_remote_desktop_rdp_handover_proxy_g_signal;
7779 proxy_class->g_properties_changed = gsd_remote_desktop_rdp_handover_proxy_g_properties_changed;
7780
7781 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
7782 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopRdpHandoverProxyPrivate));
7783 #endif
7784 }
7785
7786 static void
7787 gsd_remote_desktop_rdp_handover_proxy_iface_init (GsdRemoteDesktopRdpHandoverIface *iface G_GNUC_UNUSED)
7788 {
7789 }
7790
7791 /**
7792 * gsd_remote_desktop_rdp_handover_proxy_new:
7793 * @connection: A #GDBusConnection.
7794 * @flags: Flags from the #GDBusProxyFlags enumeration.
7795 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
7796 * @object_path: An object path.
7797 * @cancellable: (nullable): A #GCancellable or %NULL.
7798 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
7799 * @user_data: User data to pass to @callback.
7800 *
7801 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Handover.top_of_page">org.gnome.RemoteDesktop.Rdp.Handover</link>. See g_dbus_proxy_new() for more details.
7802 *
7803 * 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()).
7804 * You can then call gsd_remote_desktop_rdp_handover_proxy_new_finish() to get the result of the operation.
7805 *
7806 * See gsd_remote_desktop_rdp_handover_proxy_new_sync() for the synchronous, blocking version of this constructor.
7807 */
7808 void
7809 gsd_remote_desktop_rdp_handover_proxy_new (
7810 GDBusConnection *connection,
7811 GDBusProxyFlags flags,
7812 const gchar *name,
7813 const gchar *object_path,
7814 GCancellable *cancellable,
7815 GAsyncReadyCallback callback,
7816 gpointer user_data)
7817 {
7818 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER_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.RemoteDesktop.Rdp.Handover", NULL);
7819 }
7820
7821 /**
7822 * gsd_remote_desktop_rdp_handover_proxy_new_finish:
7823 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_handover_proxy_new().
7824 * @error: Return location for error or %NULL
7825 *
7826 * Finishes an operation started with gsd_remote_desktop_rdp_handover_proxy_new().
7827 *
7828 * Returns: (transfer full) (type GsdRemoteDesktopRdpHandoverProxy): The constructed proxy object or %NULL if @error is set.
7829 */
7830 GsdRemoteDesktopRdpHandover *
7831 gsd_remote_desktop_rdp_handover_proxy_new_finish (
7832 GAsyncResult *res,
7833 GError **error)
7834 {
7835 GObject *ret;
7836 GObject *source_object;
7837 source_object = g_async_result_get_source_object (res);
7838 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
7839 g_object_unref (source_object);
7840 if (ret != NULL)
7841 return GSD_REMOTE_DESKTOP_RDP_HANDOVER (ret);
7842 else
7843 return NULL;
7844 }
7845
7846 /**
7847 * gsd_remote_desktop_rdp_handover_proxy_new_sync:
7848 * @connection: A #GDBusConnection.
7849 * @flags: Flags from the #GDBusProxyFlags enumeration.
7850 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
7851 * @object_path: An object path.
7852 * @cancellable: (nullable): A #GCancellable or %NULL.
7853 * @error: Return location for error or %NULL
7854 *
7855 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Handover.top_of_page">org.gnome.RemoteDesktop.Rdp.Handover</link>. See g_dbus_proxy_new_sync() for more details.
7856 *
7857 * The calling thread is blocked until a reply is received.
7858 *
7859 * See gsd_remote_desktop_rdp_handover_proxy_new() for the asynchronous version of this constructor.
7860 *
7861 * Returns: (transfer full) (type GsdRemoteDesktopRdpHandoverProxy): The constructed proxy object or %NULL if @error is set.
7862 */
7863 GsdRemoteDesktopRdpHandover *
7864 gsd_remote_desktop_rdp_handover_proxy_new_sync (
7865 GDBusConnection *connection,
7866 GDBusProxyFlags flags,
7867 const gchar *name,
7868 const gchar *object_path,
7869 GCancellable *cancellable,
7870 GError **error)
7871 {
7872 GInitable *ret;
7873 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop.Rdp.Handover", NULL);
7874 if (ret != NULL)
7875 return GSD_REMOTE_DESKTOP_RDP_HANDOVER (ret);
7876 else
7877 return NULL;
7878 }
7879
7880
7881 /**
7882 * gsd_remote_desktop_rdp_handover_proxy_new_for_bus:
7883 * @bus_type: A #GBusType.
7884 * @flags: Flags from the #GDBusProxyFlags enumeration.
7885 * @name: A bus name (well-known or unique).
7886 * @object_path: An object path.
7887 * @cancellable: (nullable): A #GCancellable or %NULL.
7888 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
7889 * @user_data: User data to pass to @callback.
7890 *
7891 * Like gsd_remote_desktop_rdp_handover_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
7892 *
7893 * 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()).
7894 * You can then call gsd_remote_desktop_rdp_handover_proxy_new_for_bus_finish() to get the result of the operation.
7895 *
7896 * See gsd_remote_desktop_rdp_handover_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
7897 */
7898 void
7899 gsd_remote_desktop_rdp_handover_proxy_new_for_bus (
7900 GBusType bus_type,
7901 GDBusProxyFlags flags,
7902 const gchar *name,
7903 const gchar *object_path,
7904 GCancellable *cancellable,
7905 GAsyncReadyCallback callback,
7906 gpointer user_data)
7907 {
7908 g_async_initable_new_async (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER_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.RemoteDesktop.Rdp.Handover", NULL);
7909 }
7910
7911 /**
7912 * gsd_remote_desktop_rdp_handover_proxy_new_for_bus_finish:
7913 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_remote_desktop_rdp_handover_proxy_new_for_bus().
7914 * @error: Return location for error or %NULL
7915 *
7916 * Finishes an operation started with gsd_remote_desktop_rdp_handover_proxy_new_for_bus().
7917 *
7918 * Returns: (transfer full) (type GsdRemoteDesktopRdpHandoverProxy): The constructed proxy object or %NULL if @error is set.
7919 */
7920 GsdRemoteDesktopRdpHandover *
7921 gsd_remote_desktop_rdp_handover_proxy_new_for_bus_finish (
7922 GAsyncResult *res,
7923 GError **error)
7924 {
7925 GObject *ret;
7926 GObject *source_object;
7927 source_object = g_async_result_get_source_object (res);
7928 ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
7929 g_object_unref (source_object);
7930 if (ret != NULL)
7931 return GSD_REMOTE_DESKTOP_RDP_HANDOVER (ret);
7932 else
7933 return NULL;
7934 }
7935
7936 /**
7937 * gsd_remote_desktop_rdp_handover_proxy_new_for_bus_sync:
7938 * @bus_type: A #GBusType.
7939 * @flags: Flags from the #GDBusProxyFlags enumeration.
7940 * @name: A bus name (well-known or unique).
7941 * @object_path: An object path.
7942 * @cancellable: (nullable): A #GCancellable or %NULL.
7943 * @error: Return location for error or %NULL
7944 *
7945 * Like gsd_remote_desktop_rdp_handover_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
7946 *
7947 * The calling thread is blocked until a reply is received.
7948 *
7949 * See gsd_remote_desktop_rdp_handover_proxy_new_for_bus() for the asynchronous version of this constructor.
7950 *
7951 * Returns: (transfer full) (type GsdRemoteDesktopRdpHandoverProxy): The constructed proxy object or %NULL if @error is set.
7952 */
7953 GsdRemoteDesktopRdpHandover *
7954 gsd_remote_desktop_rdp_handover_proxy_new_for_bus_sync (
7955 GBusType bus_type,
7956 GDBusProxyFlags flags,
7957 const gchar *name,
7958 const gchar *object_path,
7959 GCancellable *cancellable,
7960 GError **error)
7961 {
7962 GInitable *ret;
7963 ret = g_initable_new (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.RemoteDesktop.Rdp.Handover", NULL);
7964 if (ret != NULL)
7965 return GSD_REMOTE_DESKTOP_RDP_HANDOVER (ret);
7966 else
7967 return NULL;
7968 }
7969
7970
7971 /* ------------------------------------------------------------------------ */
7972
7973 /**
7974 * GsdRemoteDesktopRdpHandoverSkeleton:
7975 *
7976 * The #GsdRemoteDesktopRdpHandoverSkeleton structure contains only private data and should only be accessed using the provided API.
7977 */
7978
7979 /**
7980 * GsdRemoteDesktopRdpHandoverSkeletonClass:
7981 * @parent_class: The parent class.
7982 *
7983 * Class structure for #GsdRemoteDesktopRdpHandoverSkeleton.
7984 */
7985
7986 struct _GsdRemoteDesktopRdpHandoverSkeletonPrivate
7987 {
7988 GValue *properties;
7989 GList *changed_properties;
7990 GSource *changed_properties_idle_source;
7991 GMainContext *context;
7992 GMutex lock;
7993 };
7994
7995 static void
7996 _gsd_remote_desktop_rdp_handover_skeleton_handle_method_call (
7997 GDBusConnection *connection G_GNUC_UNUSED,
7998 const gchar *sender G_GNUC_UNUSED,
7999 const gchar *object_path G_GNUC_UNUSED,
8000 const gchar *interface_name,
8001 const gchar *method_name,
8002 GVariant *parameters,
8003 GDBusMethodInvocation *invocation,
8004 gpointer user_data)
8005 {
8006 GsdRemoteDesktopRdpHandoverSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON (user_data);
8007 _ExtendedGDBusMethodInfo *info;
8008 GVariantIter iter;
8009 GVariant *child;
8010 GValue *paramv;
8011 gsize num_params;
8012 guint num_extra;
8013 gsize n;
8014 guint signal_id;
8015 GValue return_value = G_VALUE_INIT;
8016 info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
8017 g_assert (info != NULL);
8018 num_params = g_variant_n_children (parameters);
8019 num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
8020 n = 0;
8021 g_value_init (&paramv[n], GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER);
8022 g_value_set_object (&paramv[n++], skeleton);
8023 g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
8024 g_value_set_object (&paramv[n++], invocation);
8025 if (info->pass_fdlist)
8026 {
8027 #ifdef G_OS_UNIX
8028 g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
8029 g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
8030 #else
8031 g_assert_not_reached ();
8032 #endif
8033 }
8034 g_variant_iter_init (&iter, parameters);
8035 while ((child = g_variant_iter_next_value (&iter)) != NULL)
8036 {
8037 _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
8038 if (arg_info->use_gvariant)
8039 {
8040 g_value_init (&paramv[n], G_TYPE_VARIANT);
8041 g_value_set_variant (&paramv[n], child);
8042 n++;
8043 }
8044 else
8045 g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
8046 g_variant_unref (child);
8047 }
8048 signal_id = g_signal_lookup (info->signal_name, GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER);
8049 g_value_init (&return_value, G_TYPE_BOOLEAN);
8050 g_signal_emitv (paramv, signal_id, 0, &return_value);
8051 if (!g_value_get_boolean (&return_value))
8052 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);
8053 g_value_unset (&return_value);
8054 for (n = 0; n < num_params + num_extra; n++)
8055 g_value_unset (&paramv[n]);
8056 g_free (paramv);
8057 }
8058
8059 static GVariant *
8060 _gsd_remote_desktop_rdp_handover_skeleton_handle_get_property (
8061 GDBusConnection *connection G_GNUC_UNUSED,
8062 const gchar *sender G_GNUC_UNUSED,
8063 const gchar *object_path G_GNUC_UNUSED,
8064 const gchar *interface_name G_GNUC_UNUSED,
8065 const gchar *property_name,
8066 GError **error,
8067 gpointer user_data)
8068 {
8069 GsdRemoteDesktopRdpHandoverSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON (user_data);
8070 GValue value = G_VALUE_INIT;
8071 GParamSpec *pspec;
8072 _ExtendedGDBusPropertyInfo *info;
8073 GVariant *ret;
8074 ret = NULL;
8075 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_handover_interface_info.parent_struct, property_name);
8076 g_assert (info != NULL);
8077 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
8078 if (pspec == NULL)
8079 {
8080 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
8081 }
8082 else
8083 {
8084 g_value_init (&value, pspec->value_type);
8085 g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
8086 ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
8087 g_value_unset (&value);
8088 }
8089 return ret;
8090 }
8091
8092 static gboolean
8093 _gsd_remote_desktop_rdp_handover_skeleton_handle_set_property (
8094 GDBusConnection *connection G_GNUC_UNUSED,
8095 const gchar *sender G_GNUC_UNUSED,
8096 const gchar *object_path G_GNUC_UNUSED,
8097 const gchar *interface_name G_GNUC_UNUSED,
8098 const gchar *property_name,
8099 GVariant *variant,
8100 GError **error,
8101 gpointer user_data)
8102 {
8103 GsdRemoteDesktopRdpHandoverSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON (user_data);
8104 GValue value = G_VALUE_INIT;
8105 GParamSpec *pspec;
8106 _ExtendedGDBusPropertyInfo *info;
8107 gboolean ret;
8108 ret = FALSE;
8109 info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_gsd_remote_desktop_rdp_handover_interface_info.parent_struct, property_name);
8110 g_assert (info != NULL);
8111 pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
8112 if (pspec == NULL)
8113 {
8114 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
8115 }
8116 else
8117 {
8118 if (info->use_gvariant)
8119 g_value_set_variant (&value, variant);
8120 else
8121 g_dbus_gvariant_to_gvalue (variant, &value);
8122 g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
8123 g_value_unset (&value);
8124 ret = TRUE;
8125 }
8126 return ret;
8127 }
8128
8129 static const GDBusInterfaceVTable _gsd_remote_desktop_rdp_handover_skeleton_vtable =
8130 {
8131 _gsd_remote_desktop_rdp_handover_skeleton_handle_method_call,
8132 _gsd_remote_desktop_rdp_handover_skeleton_handle_get_property,
8133 _gsd_remote_desktop_rdp_handover_skeleton_handle_set_property,
8134 {NULL}
8135 };
8136
8137 static GDBusInterfaceInfo *
8138 gsd_remote_desktop_rdp_handover_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
8139 {
8140 return gsd_remote_desktop_rdp_handover_interface_info ();
8141 }
8142
8143 static GDBusInterfaceVTable *
8144 gsd_remote_desktop_rdp_handover_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
8145 {
8146 return (GDBusInterfaceVTable *) &_gsd_remote_desktop_rdp_handover_skeleton_vtable;
8147 }
8148
8149 static GVariant *
8150 gsd_remote_desktop_rdp_handover_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
8151 {
8152 GsdRemoteDesktopRdpHandoverSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON (_skeleton);
8153
8154 GVariantBuilder builder;
8155 guint n;
8156 g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
8157 if (_gsd_remote_desktop_rdp_handover_interface_info.parent_struct.properties == NULL)
8158 goto out;
8159 for (n = 0; _gsd_remote_desktop_rdp_handover_interface_info.parent_struct.properties[n] != NULL; n++)
8160 {
8161 GDBusPropertyInfo *info = _gsd_remote_desktop_rdp_handover_interface_info.parent_struct.properties[n];
8162 if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
8163 {
8164 GVariant *value;
8165 value = _gsd_remote_desktop_rdp_handover_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.RemoteDesktop.Rdp.Handover", info->name, NULL, skeleton);
8166 if (value != NULL)
8167 {
8168 g_variant_take_ref (value);
8169 g_variant_builder_add (&builder, "{sv}", info->name, value);
8170 g_variant_unref (value);
8171 }
8172 }
8173 }
8174 out:
8175 return g_variant_builder_end (&builder);
8176 }
8177
8178 static void
8179 gsd_remote_desktop_rdp_handover_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton G_GNUC_UNUSED)
8180 {
8181 }
8182
8183 static void
8184 _gsd_remote_desktop_rdp_handover_on_signal_redirect_client (
8185 GsdRemoteDesktopRdpHandover *object,
8186 const gchar *arg_routing_token,
8187 const gchar *arg_username,
8188 const gchar *arg_password)
8189 {
8190 GsdRemoteDesktopRdpHandoverSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON (object);
8191
8192 GList *connections, *l;
8193 GVariant *signal_variant;
8194 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
8195
8196 signal_variant = g_variant_ref_sink (g_variant_new ("(sss)",
8197 arg_routing_token,
8198 arg_username,
8199 arg_password));
8200 for (l = connections; l != NULL; l = l->next)
8201 {
8202 GDBusConnection *connection = l->data;
8203 g_dbus_connection_emit_signal (connection,
8204 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.gnome.RemoteDesktop.Rdp.Handover", "RedirectClient",
8205 signal_variant, NULL);
8206 }
8207 g_variant_unref (signal_variant);
8208 g_list_free_full (connections, g_object_unref);
8209 }
8210
8211 static void
8212 _gsd_remote_desktop_rdp_handover_on_signal_take_client_ready (
8213 GsdRemoteDesktopRdpHandover *object,
8214 gboolean arg_use_system_credentials)
8215 {
8216 GsdRemoteDesktopRdpHandoverSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON (object);
8217
8218 GList *connections, *l;
8219 GVariant *signal_variant;
8220 connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
8221
8222 signal_variant = g_variant_ref_sink (g_variant_new ("(b)",
8223 arg_use_system_credentials));
8224 for (l = connections; l != NULL; l = l->next)
8225 {
8226 GDBusConnection *connection = l->data;
8227 g_dbus_connection_emit_signal (connection,
8228 NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.gnome.RemoteDesktop.Rdp.Handover", "TakeClientReady",
8229 signal_variant, NULL);
8230 }
8231 g_variant_unref (signal_variant);
8232 g_list_free_full (connections, g_object_unref);
8233 }
8234
8235 static void gsd_remote_desktop_rdp_handover_skeleton_iface_init (GsdRemoteDesktopRdpHandoverIface *iface);
8236 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
8237 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpHandoverSkeleton, gsd_remote_desktop_rdp_handover_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
8238 G_ADD_PRIVATE (GsdRemoteDesktopRdpHandoverSkeleton)
8239 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER, gsd_remote_desktop_rdp_handover_skeleton_iface_init))
8240
8241 #else
8242 G_DEFINE_TYPE_WITH_CODE (GsdRemoteDesktopRdpHandoverSkeleton, gsd_remote_desktop_rdp_handover_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
8243 G_IMPLEMENT_INTERFACE (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER, gsd_remote_desktop_rdp_handover_skeleton_iface_init))
8244
8245 #endif
8246 static void
8247 gsd_remote_desktop_rdp_handover_skeleton_finalize (GObject *object)
8248 {
8249 GsdRemoteDesktopRdpHandoverSkeleton *skeleton = GSD_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON (object);
8250 g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
8251 if (skeleton->priv->changed_properties_idle_source != NULL)
8252 g_source_destroy (skeleton->priv->changed_properties_idle_source);
8253 g_main_context_unref (skeleton->priv->context);
8254 g_mutex_clear (&skeleton->priv->lock);
8255 G_OBJECT_CLASS (gsd_remote_desktop_rdp_handover_skeleton_parent_class)->finalize (object);
8256 }
8257
8258 static void
8259 gsd_remote_desktop_rdp_handover_skeleton_init (GsdRemoteDesktopRdpHandoverSkeleton *skeleton)
8260 {
8261 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
8262 skeleton->priv = gsd_remote_desktop_rdp_handover_skeleton_get_instance_private (skeleton);
8263 #else
8264 skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON, GsdRemoteDesktopRdpHandoverSkeletonPrivate);
8265 #endif
8266
8267 g_mutex_init (&skeleton->priv->lock);
8268 skeleton->priv->context = g_main_context_ref_thread_default ();
8269 }
8270
8271 static void
8272 gsd_remote_desktop_rdp_handover_skeleton_class_init (GsdRemoteDesktopRdpHandoverSkeletonClass *klass)
8273 {
8274 GObjectClass *gobject_class;
8275 GDBusInterfaceSkeletonClass *skeleton_class;
8276
8277 gobject_class = G_OBJECT_CLASS (klass);
8278 gobject_class->finalize = gsd_remote_desktop_rdp_handover_skeleton_finalize;
8279
8280 skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
8281 skeleton_class->get_info = gsd_remote_desktop_rdp_handover_skeleton_dbus_interface_get_info;
8282 skeleton_class->get_properties = gsd_remote_desktop_rdp_handover_skeleton_dbus_interface_get_properties;
8283 skeleton_class->flush = gsd_remote_desktop_rdp_handover_skeleton_dbus_interface_flush;
8284 skeleton_class->get_vtable = gsd_remote_desktop_rdp_handover_skeleton_dbus_interface_get_vtable;
8285
8286 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
8287 g_type_class_add_private (klass, sizeof (GsdRemoteDesktopRdpHandoverSkeletonPrivate));
8288 #endif
8289 }
8290
8291 static void
8292 gsd_remote_desktop_rdp_handover_skeleton_iface_init (GsdRemoteDesktopRdpHandoverIface *iface)
8293 {
8294 iface->redirect_client = _gsd_remote_desktop_rdp_handover_on_signal_redirect_client;
8295 iface->take_client_ready = _gsd_remote_desktop_rdp_handover_on_signal_take_client_ready;
8296 }
8297
8298 /**
8299 * gsd_remote_desktop_rdp_handover_skeleton_new:
8300 *
8301 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-RemoteDesktop-Rdp-Handover.top_of_page">org.gnome.RemoteDesktop.Rdp.Handover</link>.
8302 *
8303 * Returns: (transfer full) (type GsdRemoteDesktopRdpHandoverSkeleton): The skeleton object.
8304 */
8305 GsdRemoteDesktopRdpHandover *
8306 gsd_remote_desktop_rdp_handover_skeleton_new (void)
8307 {
8308 return GSD_REMOTE_DESKTOP_RDP_HANDOVER (g_object_new (GSD_TYPE_REMOTE_DESKTOP_RDP_HANDOVER_SKELETON, NULL));
8309 }
8310
8311