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 "sn-watcher-v0-gen.h"
14 
15 #include <string.h>
16 #ifdef G_OS_UNIX
17 #  include <gio/gunixfdlist.h>
18 #endif
19 
20 typedef struct
21 {
22   GDBusArgInfo parent_struct;
23   gboolean use_gvariant;
24 } _ExtendedGDBusArgInfo;
25 
26 typedef struct
27 {
28   GDBusMethodInfo parent_struct;
29   const gchar *signal_name;
30   gboolean pass_fdlist;
31 } _ExtendedGDBusMethodInfo;
32 
33 typedef struct
34 {
35   GDBusSignalInfo parent_struct;
36   const gchar *signal_name;
37 } _ExtendedGDBusSignalInfo;
38 
39 typedef struct
40 {
41   GDBusPropertyInfo parent_struct;
42   const gchar *hyphen_name;
43   guint use_gvariant : 1;
44   guint emits_changed_signal : 1;
45 } _ExtendedGDBusPropertyInfo;
46 
47 typedef struct
48 {
49   GDBusInterfaceInfo parent_struct;
50   const gchar *hyphen_name;
51 } _ExtendedGDBusInterfaceInfo;
52 
53 typedef struct
54 {
55   const _ExtendedGDBusPropertyInfo *info;
56   guint prop_id;
57   GValue orig_value; /* the value before the change */
58 } ChangedProperty;
59 
60 static void
_changed_property_free(ChangedProperty * data)61 _changed_property_free (ChangedProperty *data)
62 {
63   g_value_unset (&data->orig_value);
64   g_free (data);
65 }
66 
67 static gboolean
_g_strv_equal0(gchar ** a,gchar ** b)68 _g_strv_equal0 (gchar **a, gchar **b)
69 {
70   gboolean ret = FALSE;
71   guint n;
72   if (a == NULL && b == NULL)
73     {
74       ret = TRUE;
75       goto out;
76     }
77   if (a == NULL || b == NULL)
78     goto out;
79   if (g_strv_length (a) != g_strv_length (b))
80     goto out;
81   for (n = 0; a[n] != NULL; n++)
82     if (g_strcmp0 (a[n], b[n]) != 0)
83       goto out;
84   ret = TRUE;
85 out:
86   return ret;
87 }
88 
89 static gboolean
_g_variant_equal0(GVariant * a,GVariant * b)90 _g_variant_equal0 (GVariant *a, GVariant *b)
91 {
92   gboolean ret = FALSE;
93   if (a == NULL && b == NULL)
94     {
95       ret = TRUE;
96       goto out;
97     }
98   if (a == NULL || b == NULL)
99     goto out;
100   ret = g_variant_equal (a, b);
101 out:
102   return ret;
103 }
104 
105 G_GNUC_UNUSED static gboolean
_g_value_equal(const GValue * a,const GValue * b)106 _g_value_equal (const GValue *a, const GValue *b)
107 {
108   gboolean ret = FALSE;
109   g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
110   switch (G_VALUE_TYPE (a))
111     {
112       case G_TYPE_BOOLEAN:
113         ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
114         break;
115       case G_TYPE_UCHAR:
116         ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
117         break;
118       case G_TYPE_INT:
119         ret = (g_value_get_int (a) == g_value_get_int (b));
120         break;
121       case G_TYPE_UINT:
122         ret = (g_value_get_uint (a) == g_value_get_uint (b));
123         break;
124       case G_TYPE_INT64:
125         ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
126         break;
127       case G_TYPE_UINT64:
128         ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
129         break;
130       case G_TYPE_DOUBLE:
131         {
132           /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
133           gdouble da = g_value_get_double (a);
134           gdouble db = g_value_get_double (b);
135           ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
136         }
137         break;
138       case G_TYPE_STRING:
139         ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
140         break;
141       case G_TYPE_VARIANT:
142         ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
143         break;
144       default:
145         if (G_VALUE_TYPE (a) == G_TYPE_STRV)
146           ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
147         else
148           g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
149         break;
150     }
151   return ret;
152 }
153 
154 /* ------------------------------------------------------------------------
155  * Code for interface org.kde.StatusNotifierWatcher
156  * ------------------------------------------------------------------------
157  */
158 
159 /**
160  * SECTION:SnWatcherV0Gen
161  * @title: SnWatcherV0Gen
162  * @short_description: Generated C code for the org.kde.StatusNotifierWatcher D-Bus interface
163  *
164  * This section contains code for working with the <link linkend="gdbus-interface-org-kde-StatusNotifierWatcher.top_of_page">org.kde.StatusNotifierWatcher</link> D-Bus interface in C.
165  */
166 
167 /* ---- Introspection data for org.kde.StatusNotifierWatcher ---- */
168 
169 static const _ExtendedGDBusArgInfo _sn_watcher_v0_gen_method_info_register_item_IN_ARG_service =
170 {
171   {
172     -1,
173     (gchar *) "service",
174     (gchar *) "s",
175     NULL
176   },
177   FALSE
178 };
179 
180 static const GDBusArgInfo * const _sn_watcher_v0_gen_method_info_register_item_IN_ARG_pointers[] =
181 {
182   &_sn_watcher_v0_gen_method_info_register_item_IN_ARG_service.parent_struct,
183   NULL
184 };
185 
186 static const _ExtendedGDBusMethodInfo _sn_watcher_v0_gen_method_info_register_item =
187 {
188   {
189     -1,
190     (gchar *) "RegisterStatusNotifierItem",
191     (GDBusArgInfo **) &_sn_watcher_v0_gen_method_info_register_item_IN_ARG_pointers,
192     NULL,
193     NULL
194   },
195   "handle-register-item",
196   FALSE
197 };
198 
199 static const _ExtendedGDBusArgInfo _sn_watcher_v0_gen_method_info_register_host_IN_ARG_service =
200 {
201   {
202     -1,
203     (gchar *) "service",
204     (gchar *) "s",
205     NULL
206   },
207   FALSE
208 };
209 
210 static const GDBusArgInfo * const _sn_watcher_v0_gen_method_info_register_host_IN_ARG_pointers[] =
211 {
212   &_sn_watcher_v0_gen_method_info_register_host_IN_ARG_service.parent_struct,
213   NULL
214 };
215 
216 static const _ExtendedGDBusMethodInfo _sn_watcher_v0_gen_method_info_register_host =
217 {
218   {
219     -1,
220     (gchar *) "RegisterStatusNotifierHost",
221     (GDBusArgInfo **) &_sn_watcher_v0_gen_method_info_register_host_IN_ARG_pointers,
222     NULL,
223     NULL
224   },
225   "handle-register-host",
226   FALSE
227 };
228 
229 static const GDBusMethodInfo * const _sn_watcher_v0_gen_method_info_pointers[] =
230 {
231   &_sn_watcher_v0_gen_method_info_register_item.parent_struct,
232   &_sn_watcher_v0_gen_method_info_register_host.parent_struct,
233   NULL
234 };
235 
236 static const _ExtendedGDBusArgInfo _sn_watcher_v0_gen_signal_info_item_registered_ARG_service =
237 {
238   {
239     -1,
240     (gchar *) "service",
241     (gchar *) "s",
242     NULL
243   },
244   FALSE
245 };
246 
247 static const GDBusArgInfo * const _sn_watcher_v0_gen_signal_info_item_registered_ARG_pointers[] =
248 {
249   &_sn_watcher_v0_gen_signal_info_item_registered_ARG_service.parent_struct,
250   NULL
251 };
252 
253 static const _ExtendedGDBusSignalInfo _sn_watcher_v0_gen_signal_info_item_registered =
254 {
255   {
256     -1,
257     (gchar *) "StatusNotifierItemRegistered",
258     (GDBusArgInfo **) &_sn_watcher_v0_gen_signal_info_item_registered_ARG_pointers,
259     NULL
260   },
261   "item-registered"
262 };
263 
264 static const _ExtendedGDBusArgInfo _sn_watcher_v0_gen_signal_info_item_unregistered_ARG_service =
265 {
266   {
267     -1,
268     (gchar *) "service",
269     (gchar *) "s",
270     NULL
271   },
272   FALSE
273 };
274 
275 static const GDBusArgInfo * const _sn_watcher_v0_gen_signal_info_item_unregistered_ARG_pointers[] =
276 {
277   &_sn_watcher_v0_gen_signal_info_item_unregistered_ARG_service.parent_struct,
278   NULL
279 };
280 
281 static const _ExtendedGDBusSignalInfo _sn_watcher_v0_gen_signal_info_item_unregistered =
282 {
283   {
284     -1,
285     (gchar *) "StatusNotifierItemUnregistered",
286     (GDBusArgInfo **) &_sn_watcher_v0_gen_signal_info_item_unregistered_ARG_pointers,
287     NULL
288   },
289   "item-unregistered"
290 };
291 
292 static const _ExtendedGDBusSignalInfo _sn_watcher_v0_gen_signal_info_host_registered =
293 {
294   {
295     -1,
296     (gchar *) "StatusNotifierHostRegistered",
297     NULL,
298     NULL
299   },
300   "host-registered"
301 };
302 
303 static const GDBusSignalInfo * const _sn_watcher_v0_gen_signal_info_pointers[] =
304 {
305   &_sn_watcher_v0_gen_signal_info_item_registered.parent_struct,
306   &_sn_watcher_v0_gen_signal_info_item_unregistered.parent_struct,
307   &_sn_watcher_v0_gen_signal_info_host_registered.parent_struct,
308   NULL
309 };
310 
311 static const _ExtendedGDBusPropertyInfo _sn_watcher_v0_gen_property_info_registered_items =
312 {
313   {
314     -1,
315     (gchar *) "RegisteredStatusNotifierItems",
316     (gchar *) "as",
317     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
318     NULL
319   },
320   "registered-items",
321   FALSE,
322   TRUE
323 };
324 
325 static const _ExtendedGDBusPropertyInfo _sn_watcher_v0_gen_property_info_is_host_registered =
326 {
327   {
328     -1,
329     (gchar *) "IsStatusNotifierHostRegistered",
330     (gchar *) "b",
331     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
332     NULL
333   },
334   "is-host-registered",
335   FALSE,
336   TRUE
337 };
338 
339 static const _ExtendedGDBusPropertyInfo _sn_watcher_v0_gen_property_info_protocol_version =
340 {
341   {
342     -1,
343     (gchar *) "ProtocolVersion",
344     (gchar *) "i",
345     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
346     NULL
347   },
348   "protocol-version",
349   FALSE,
350   TRUE
351 };
352 
353 static const GDBusPropertyInfo * const _sn_watcher_v0_gen_property_info_pointers[] =
354 {
355   &_sn_watcher_v0_gen_property_info_registered_items.parent_struct,
356   &_sn_watcher_v0_gen_property_info_is_host_registered.parent_struct,
357   &_sn_watcher_v0_gen_property_info_protocol_version.parent_struct,
358   NULL
359 };
360 
361 static const _ExtendedGDBusInterfaceInfo _sn_watcher_v0_gen_interface_info =
362 {
363   {
364     -1,
365     (gchar *) "org.kde.StatusNotifierWatcher",
366     (GDBusMethodInfo **) &_sn_watcher_v0_gen_method_info_pointers,
367     (GDBusSignalInfo **) &_sn_watcher_v0_gen_signal_info_pointers,
368     (GDBusPropertyInfo **) &_sn_watcher_v0_gen_property_info_pointers,
369     NULL
370   },
371   "watcher-v0-gen",
372 };
373 
374 
375 /**
376  * sn_watcher_v0_gen_interface_info:
377  *
378  * Gets a machine-readable description of the <link linkend="gdbus-interface-org-kde-StatusNotifierWatcher.top_of_page">org.kde.StatusNotifierWatcher</link> D-Bus interface.
379  *
380  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
381  */
382 GDBusInterfaceInfo *
sn_watcher_v0_gen_interface_info(void)383 sn_watcher_v0_gen_interface_info (void)
384 {
385   return (GDBusInterfaceInfo *) &_sn_watcher_v0_gen_interface_info.parent_struct;
386 }
387 
388 /**
389  * sn_watcher_v0_gen_override_properties:
390  * @klass: The class structure for a #GObject derived class.
391  * @property_id_begin: The property id to assign to the first overridden property.
392  *
393  * Overrides all #GObject properties in the #SnWatcherV0Gen interface for a concrete class.
394  * The properties are overridden in the order they are defined.
395  *
396  * Returns: The last property id.
397  */
398 guint
sn_watcher_v0_gen_override_properties(GObjectClass * klass,guint property_id_begin)399 sn_watcher_v0_gen_override_properties (GObjectClass *klass, guint property_id_begin)
400 {
401   g_object_class_override_property (klass, property_id_begin++, "registered-items");
402   g_object_class_override_property (klass, property_id_begin++, "is-host-registered");
403   g_object_class_override_property (klass, property_id_begin++, "protocol-version");
404   return property_id_begin - 1;
405 }
406 
407 
408 
409 /**
410  * SnWatcherV0Gen:
411  *
412  * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-kde-StatusNotifierWatcher.top_of_page">org.kde.StatusNotifierWatcher</link>.
413  */
414 
415 /**
416  * SnWatcherV0GenIface:
417  * @parent_iface: The parent interface.
418  * @handle_register_host: Handler for the #SnWatcherV0Gen::handle-register-host signal.
419  * @handle_register_item: Handler for the #SnWatcherV0Gen::handle-register-item signal.
420  * @get_is_host_registered: Getter for the #SnWatcherV0Gen:is-host-registered property.
421  * @get_protocol_version: Getter for the #SnWatcherV0Gen:protocol-version property.
422  * @get_registered_items: Getter for the #SnWatcherV0Gen:registered-items property.
423  * @host_registered: Handler for the #SnWatcherV0Gen::host-registered signal.
424  * @item_registered: Handler for the #SnWatcherV0Gen::item-registered signal.
425  * @item_unregistered: Handler for the #SnWatcherV0Gen::item-unregistered signal.
426  *
427  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-kde-StatusNotifierWatcher.top_of_page">org.kde.StatusNotifierWatcher</link>.
428  */
429 
430 typedef SnWatcherV0GenIface SnWatcherV0GenInterface;
G_DEFINE_INTERFACE(SnWatcherV0Gen,sn_watcher_v0_gen,G_TYPE_OBJECT)431 G_DEFINE_INTERFACE (SnWatcherV0Gen, sn_watcher_v0_gen, G_TYPE_OBJECT)
432 
433 static void
434 sn_watcher_v0_gen_default_init (SnWatcherV0GenIface *iface)
435 {
436   /* GObject signals for incoming D-Bus method calls: */
437   /**
438    * SnWatcherV0Gen::handle-register-item:
439    * @object: A #SnWatcherV0Gen.
440    * @invocation: A #GDBusMethodInvocation.
441    * @arg_service: Argument passed by remote caller.
442    *
443    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-kde-StatusNotifierWatcher.RegisterStatusNotifierItem">RegisterStatusNotifierItem()</link> D-Bus method.
444    *
445    * 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 sn_watcher_v0_gen_complete_register_item() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
446    *
447    * 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.
448    */
449   g_signal_new ("handle-register-item",
450     G_TYPE_FROM_INTERFACE (iface),
451     G_SIGNAL_RUN_LAST,
452     G_STRUCT_OFFSET (SnWatcherV0GenIface, handle_register_item),
453     g_signal_accumulator_true_handled,
454     NULL,
455     g_cclosure_marshal_generic,
456     G_TYPE_BOOLEAN,
457     2,
458     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
459 
460   /**
461    * SnWatcherV0Gen::handle-register-host:
462    * @object: A #SnWatcherV0Gen.
463    * @invocation: A #GDBusMethodInvocation.
464    * @arg_service: Argument passed by remote caller.
465    *
466    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-kde-StatusNotifierWatcher.RegisterStatusNotifierHost">RegisterStatusNotifierHost()</link> D-Bus method.
467    *
468    * 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 sn_watcher_v0_gen_complete_register_host() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
469    *
470    * 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.
471    */
472   g_signal_new ("handle-register-host",
473     G_TYPE_FROM_INTERFACE (iface),
474     G_SIGNAL_RUN_LAST,
475     G_STRUCT_OFFSET (SnWatcherV0GenIface, handle_register_host),
476     g_signal_accumulator_true_handled,
477     NULL,
478     g_cclosure_marshal_generic,
479     G_TYPE_BOOLEAN,
480     2,
481     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
482 
483   /* GObject signals for received D-Bus signals: */
484   /**
485    * SnWatcherV0Gen::item-registered:
486    * @object: A #SnWatcherV0Gen.
487    * @arg_service: Argument.
488    *
489    * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-kde-StatusNotifierWatcher.StatusNotifierItemRegistered">"StatusNotifierItemRegistered"</link> is received.
490    *
491    * 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.
492    */
493   g_signal_new ("item-registered",
494     G_TYPE_FROM_INTERFACE (iface),
495     G_SIGNAL_RUN_LAST,
496     G_STRUCT_OFFSET (SnWatcherV0GenIface, item_registered),
497     NULL,
498     NULL,
499     g_cclosure_marshal_generic,
500     G_TYPE_NONE,
501     1, G_TYPE_STRING);
502 
503   /**
504    * SnWatcherV0Gen::item-unregistered:
505    * @object: A #SnWatcherV0Gen.
506    * @arg_service: Argument.
507    *
508    * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-kde-StatusNotifierWatcher.StatusNotifierItemUnregistered">"StatusNotifierItemUnregistered"</link> is received.
509    *
510    * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
511    */
512   g_signal_new ("item-unregistered",
513     G_TYPE_FROM_INTERFACE (iface),
514     G_SIGNAL_RUN_LAST,
515     G_STRUCT_OFFSET (SnWatcherV0GenIface, item_unregistered),
516     NULL,
517     NULL,
518     g_cclosure_marshal_generic,
519     G_TYPE_NONE,
520     1, G_TYPE_STRING);
521 
522   /**
523    * SnWatcherV0Gen::host-registered:
524    * @object: A #SnWatcherV0Gen.
525    *
526    * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-kde-StatusNotifierWatcher.StatusNotifierHostRegistered">"StatusNotifierHostRegistered"</link> is received.
527    *
528    * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
529    */
530   g_signal_new ("host-registered",
531     G_TYPE_FROM_INTERFACE (iface),
532     G_SIGNAL_RUN_LAST,
533     G_STRUCT_OFFSET (SnWatcherV0GenIface, host_registered),
534     NULL,
535     NULL,
536     g_cclosure_marshal_generic,
537     G_TYPE_NONE,
538     0);
539 
540   /* GObject properties for D-Bus properties: */
541   /**
542    * SnWatcherV0Gen:registered-items:
543    *
544    * Represents the D-Bus property <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.RegisteredStatusNotifierItems">"RegisteredStatusNotifierItems"</link>.
545    *
546    * 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.
547    */
548   g_object_interface_install_property (iface,
549     g_param_spec_boxed ("registered-items", "RegisteredStatusNotifierItems", "RegisteredStatusNotifierItems", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
550   /**
551    * SnWatcherV0Gen:is-host-registered:
552    *
553    * Represents the D-Bus property <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.IsStatusNotifierHostRegistered">"IsStatusNotifierHostRegistered"</link>.
554    *
555    * 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.
556    */
557   g_object_interface_install_property (iface,
558     g_param_spec_boolean ("is-host-registered", "IsStatusNotifierHostRegistered", "IsStatusNotifierHostRegistered", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
559   /**
560    * SnWatcherV0Gen:protocol-version:
561    *
562    * Represents the D-Bus property <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.ProtocolVersion">"ProtocolVersion"</link>.
563    *
564    * 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.
565    */
566   g_object_interface_install_property (iface,
567     g_param_spec_int ("protocol-version", "ProtocolVersion", "ProtocolVersion", G_MININT32, G_MAXINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
568 }
569 
570 /**
571  * sn_watcher_v0_gen_get_registered_items: (skip)
572  * @object: A #SnWatcherV0Gen.
573  *
574  * Gets the value of the <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.RegisteredStatusNotifierItems">"RegisteredStatusNotifierItems"</link> D-Bus property.
575  *
576  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
577  *
578  * 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 sn_watcher_v0_gen_dup_registered_items() if on another thread.
579  *
580  * 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.
581  */
582 const gchar *const *
sn_watcher_v0_gen_get_registered_items(SnWatcherV0Gen * object)583 sn_watcher_v0_gen_get_registered_items (SnWatcherV0Gen *object)
584 {
585   return SN_WATCHER_V0_GEN_GET_IFACE (object)->get_registered_items (object);
586 }
587 
588 /**
589  * sn_watcher_v0_gen_dup_registered_items: (skip)
590  * @object: A #SnWatcherV0Gen.
591  *
592  * Gets a copy of the <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.RegisteredStatusNotifierItems">"RegisteredStatusNotifierItems"</link> D-Bus property.
593  *
594  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
595  *
596  * Returns: (transfer full) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
597  */
598 gchar **
sn_watcher_v0_gen_dup_registered_items(SnWatcherV0Gen * object)599 sn_watcher_v0_gen_dup_registered_items (SnWatcherV0Gen *object)
600 {
601   gchar **value;
602   g_object_get (G_OBJECT (object), "registered-items", &value, NULL);
603   return value;
604 }
605 
606 /**
607  * sn_watcher_v0_gen_set_registered_items: (skip)
608  * @object: A #SnWatcherV0Gen.
609  * @value: The value to set.
610  *
611  * Sets the <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.RegisteredStatusNotifierItems">"RegisteredStatusNotifierItems"</link> D-Bus property to @value.
612  *
613  * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
614  */
615 void
sn_watcher_v0_gen_set_registered_items(SnWatcherV0Gen * object,const gchar * const * value)616 sn_watcher_v0_gen_set_registered_items (SnWatcherV0Gen *object, const gchar *const *value)
617 {
618   g_object_set (G_OBJECT (object), "registered-items", value, NULL);
619 }
620 
621 /**
622  * sn_watcher_v0_gen_get_is_host_registered: (skip)
623  * @object: A #SnWatcherV0Gen.
624  *
625  * Gets the value of the <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.IsStatusNotifierHostRegistered">"IsStatusNotifierHostRegistered"</link> D-Bus property.
626  *
627  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
628  *
629  * Returns: The property value.
630  */
631 gboolean
sn_watcher_v0_gen_get_is_host_registered(SnWatcherV0Gen * object)632 sn_watcher_v0_gen_get_is_host_registered (SnWatcherV0Gen *object)
633 {
634   return SN_WATCHER_V0_GEN_GET_IFACE (object)->get_is_host_registered (object);
635 }
636 
637 /**
638  * sn_watcher_v0_gen_set_is_host_registered: (skip)
639  * @object: A #SnWatcherV0Gen.
640  * @value: The value to set.
641  *
642  * Sets the <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.IsStatusNotifierHostRegistered">"IsStatusNotifierHostRegistered"</link> D-Bus property to @value.
643  *
644  * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
645  */
646 void
sn_watcher_v0_gen_set_is_host_registered(SnWatcherV0Gen * object,gboolean value)647 sn_watcher_v0_gen_set_is_host_registered (SnWatcherV0Gen *object, gboolean value)
648 {
649   g_object_set (G_OBJECT (object), "is-host-registered", value, NULL);
650 }
651 
652 /**
653  * sn_watcher_v0_gen_get_protocol_version: (skip)
654  * @object: A #SnWatcherV0Gen.
655  *
656  * Gets the value of the <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.ProtocolVersion">"ProtocolVersion"</link> D-Bus property.
657  *
658  * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
659  *
660  * Returns: The property value.
661  */
662 gint
sn_watcher_v0_gen_get_protocol_version(SnWatcherV0Gen * object)663 sn_watcher_v0_gen_get_protocol_version (SnWatcherV0Gen *object)
664 {
665   return SN_WATCHER_V0_GEN_GET_IFACE (object)->get_protocol_version (object);
666 }
667 
668 /**
669  * sn_watcher_v0_gen_set_protocol_version: (skip)
670  * @object: A #SnWatcherV0Gen.
671  * @value: The value to set.
672  *
673  * Sets the <link linkend="gdbus-property-org-kde-StatusNotifierWatcher.ProtocolVersion">"ProtocolVersion"</link> D-Bus property to @value.
674  *
675  * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
676  */
677 void
sn_watcher_v0_gen_set_protocol_version(SnWatcherV0Gen * object,gint value)678 sn_watcher_v0_gen_set_protocol_version (SnWatcherV0Gen *object, gint value)
679 {
680   g_object_set (G_OBJECT (object), "protocol-version", value, NULL);
681 }
682 
683 /**
684  * sn_watcher_v0_gen_emit_item_registered:
685  * @object: A #SnWatcherV0Gen.
686  * @arg_service: Argument to pass with the signal.
687  *
688  * Emits the <link linkend="gdbus-signal-org-kde-StatusNotifierWatcher.StatusNotifierItemRegistered">"StatusNotifierItemRegistered"</link> D-Bus signal.
689  */
690 void
sn_watcher_v0_gen_emit_item_registered(SnWatcherV0Gen * object,const gchar * arg_service)691 sn_watcher_v0_gen_emit_item_registered (
692     SnWatcherV0Gen *object,
693     const gchar *arg_service)
694 {
695   g_signal_emit_by_name (object, "item-registered", arg_service);
696 }
697 
698 /**
699  * sn_watcher_v0_gen_emit_item_unregistered:
700  * @object: A #SnWatcherV0Gen.
701  * @arg_service: Argument to pass with the signal.
702  *
703  * Emits the <link linkend="gdbus-signal-org-kde-StatusNotifierWatcher.StatusNotifierItemUnregistered">"StatusNotifierItemUnregistered"</link> D-Bus signal.
704  */
705 void
sn_watcher_v0_gen_emit_item_unregistered(SnWatcherV0Gen * object,const gchar * arg_service)706 sn_watcher_v0_gen_emit_item_unregistered (
707     SnWatcherV0Gen *object,
708     const gchar *arg_service)
709 {
710   g_signal_emit_by_name (object, "item-unregistered", arg_service);
711 }
712 
713 /**
714  * sn_watcher_v0_gen_emit_host_registered:
715  * @object: A #SnWatcherV0Gen.
716  *
717  * Emits the <link linkend="gdbus-signal-org-kde-StatusNotifierWatcher.StatusNotifierHostRegistered">"StatusNotifierHostRegistered"</link> D-Bus signal.
718  */
719 void
sn_watcher_v0_gen_emit_host_registered(SnWatcherV0Gen * object)720 sn_watcher_v0_gen_emit_host_registered (
721     SnWatcherV0Gen *object)
722 {
723   g_signal_emit_by_name (object, "host-registered");
724 }
725 
726 /**
727  * sn_watcher_v0_gen_call_register_item:
728  * @proxy: A #SnWatcherV0GenProxy.
729  * @arg_service: Argument to pass with the method invocation.
730  * @cancellable: (nullable): A #GCancellable or %NULL.
731  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
732  * @user_data: User data to pass to @callback.
733  *
734  * Asynchronously invokes the <link linkend="gdbus-method-org-kde-StatusNotifierWatcher.RegisterStatusNotifierItem">RegisterStatusNotifierItem()</link> D-Bus method on @proxy.
735  * 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()).
736  * You can then call sn_watcher_v0_gen_call_register_item_finish() to get the result of the operation.
737  *
738  * See sn_watcher_v0_gen_call_register_item_sync() for the synchronous, blocking version of this method.
739  */
740 void
sn_watcher_v0_gen_call_register_item(SnWatcherV0Gen * proxy,const gchar * arg_service,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)741 sn_watcher_v0_gen_call_register_item (
742     SnWatcherV0Gen *proxy,
743     const gchar *arg_service,
744     GCancellable *cancellable,
745     GAsyncReadyCallback callback,
746     gpointer user_data)
747 {
748   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
749     "RegisterStatusNotifierItem",
750     g_variant_new ("(s)",
751                    arg_service),
752     G_DBUS_CALL_FLAGS_NONE,
753     -1,
754     cancellable,
755     callback,
756     user_data);
757 }
758 
759 /**
760  * sn_watcher_v0_gen_call_register_item_finish:
761  * @proxy: A #SnWatcherV0GenProxy.
762  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sn_watcher_v0_gen_call_register_item().
763  * @error: Return location for error or %NULL.
764  *
765  * Finishes an operation started with sn_watcher_v0_gen_call_register_item().
766  *
767  * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
768  */
769 gboolean
sn_watcher_v0_gen_call_register_item_finish(SnWatcherV0Gen * proxy,GAsyncResult * res,GError ** error)770 sn_watcher_v0_gen_call_register_item_finish (
771     SnWatcherV0Gen *proxy,
772     GAsyncResult *res,
773     GError **error)
774 {
775   GVariant *_ret;
776   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
777   if (_ret == NULL)
778     goto _out;
779   g_variant_get (_ret,
780                  "()");
781   g_variant_unref (_ret);
782 _out:
783   return _ret != NULL;
784 }
785 
786 /**
787  * sn_watcher_v0_gen_call_register_item_sync:
788  * @proxy: A #SnWatcherV0GenProxy.
789  * @arg_service: Argument to pass with the method invocation.
790  * @cancellable: (nullable): A #GCancellable or %NULL.
791  * @error: Return location for error or %NULL.
792  *
793  * Synchronously invokes the <link linkend="gdbus-method-org-kde-StatusNotifierWatcher.RegisterStatusNotifierItem">RegisterStatusNotifierItem()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
794  *
795  * See sn_watcher_v0_gen_call_register_item() for the asynchronous version of this method.
796  *
797  * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
798  */
799 gboolean
sn_watcher_v0_gen_call_register_item_sync(SnWatcherV0Gen * proxy,const gchar * arg_service,GCancellable * cancellable,GError ** error)800 sn_watcher_v0_gen_call_register_item_sync (
801     SnWatcherV0Gen *proxy,
802     const gchar *arg_service,
803     GCancellable *cancellable,
804     GError **error)
805 {
806   GVariant *_ret;
807   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
808     "RegisterStatusNotifierItem",
809     g_variant_new ("(s)",
810                    arg_service),
811     G_DBUS_CALL_FLAGS_NONE,
812     -1,
813     cancellable,
814     error);
815   if (_ret == NULL)
816     goto _out;
817   g_variant_get (_ret,
818                  "()");
819   g_variant_unref (_ret);
820 _out:
821   return _ret != NULL;
822 }
823 
824 /**
825  * sn_watcher_v0_gen_call_register_host:
826  * @proxy: A #SnWatcherV0GenProxy.
827  * @arg_service: Argument to pass with the method invocation.
828  * @cancellable: (nullable): A #GCancellable or %NULL.
829  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
830  * @user_data: User data to pass to @callback.
831  *
832  * Asynchronously invokes the <link linkend="gdbus-method-org-kde-StatusNotifierWatcher.RegisterStatusNotifierHost">RegisterStatusNotifierHost()</link> D-Bus method on @proxy.
833  * 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()).
834  * You can then call sn_watcher_v0_gen_call_register_host_finish() to get the result of the operation.
835  *
836  * See sn_watcher_v0_gen_call_register_host_sync() for the synchronous, blocking version of this method.
837  */
838 void
sn_watcher_v0_gen_call_register_host(SnWatcherV0Gen * proxy,const gchar * arg_service,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)839 sn_watcher_v0_gen_call_register_host (
840     SnWatcherV0Gen *proxy,
841     const gchar *arg_service,
842     GCancellable *cancellable,
843     GAsyncReadyCallback callback,
844     gpointer user_data)
845 {
846   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
847     "RegisterStatusNotifierHost",
848     g_variant_new ("(s)",
849                    arg_service),
850     G_DBUS_CALL_FLAGS_NONE,
851     -1,
852     cancellable,
853     callback,
854     user_data);
855 }
856 
857 /**
858  * sn_watcher_v0_gen_call_register_host_finish:
859  * @proxy: A #SnWatcherV0GenProxy.
860  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sn_watcher_v0_gen_call_register_host().
861  * @error: Return location for error or %NULL.
862  *
863  * Finishes an operation started with sn_watcher_v0_gen_call_register_host().
864  *
865  * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
866  */
867 gboolean
sn_watcher_v0_gen_call_register_host_finish(SnWatcherV0Gen * proxy,GAsyncResult * res,GError ** error)868 sn_watcher_v0_gen_call_register_host_finish (
869     SnWatcherV0Gen *proxy,
870     GAsyncResult *res,
871     GError **error)
872 {
873   GVariant *_ret;
874   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
875   if (_ret == NULL)
876     goto _out;
877   g_variant_get (_ret,
878                  "()");
879   g_variant_unref (_ret);
880 _out:
881   return _ret != NULL;
882 }
883 
884 /**
885  * sn_watcher_v0_gen_call_register_host_sync:
886  * @proxy: A #SnWatcherV0GenProxy.
887  * @arg_service: Argument to pass with the method invocation.
888  * @cancellable: (nullable): A #GCancellable or %NULL.
889  * @error: Return location for error or %NULL.
890  *
891  * Synchronously invokes the <link linkend="gdbus-method-org-kde-StatusNotifierWatcher.RegisterStatusNotifierHost">RegisterStatusNotifierHost()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
892  *
893  * See sn_watcher_v0_gen_call_register_host() for the asynchronous version of this method.
894  *
895  * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
896  */
897 gboolean
sn_watcher_v0_gen_call_register_host_sync(SnWatcherV0Gen * proxy,const gchar * arg_service,GCancellable * cancellable,GError ** error)898 sn_watcher_v0_gen_call_register_host_sync (
899     SnWatcherV0Gen *proxy,
900     const gchar *arg_service,
901     GCancellable *cancellable,
902     GError **error)
903 {
904   GVariant *_ret;
905   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
906     "RegisterStatusNotifierHost",
907     g_variant_new ("(s)",
908                    arg_service),
909     G_DBUS_CALL_FLAGS_NONE,
910     -1,
911     cancellable,
912     error);
913   if (_ret == NULL)
914     goto _out;
915   g_variant_get (_ret,
916                  "()");
917   g_variant_unref (_ret);
918 _out:
919   return _ret != NULL;
920 }
921 
922 /**
923  * sn_watcher_v0_gen_complete_register_item:
924  * @object: A #SnWatcherV0Gen.
925  * @invocation: (transfer full): A #GDBusMethodInvocation.
926  *
927  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-kde-StatusNotifierWatcher.RegisterStatusNotifierItem">RegisterStatusNotifierItem()</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.
928  *
929  * This method will free @invocation, you cannot use it afterwards.
930  */
931 void
sn_watcher_v0_gen_complete_register_item(SnWatcherV0Gen * object G_GNUC_UNUSED,GDBusMethodInvocation * invocation)932 sn_watcher_v0_gen_complete_register_item (
933     SnWatcherV0Gen *object G_GNUC_UNUSED,
934     GDBusMethodInvocation *invocation)
935 {
936   g_dbus_method_invocation_return_value (invocation,
937     g_variant_new ("()"));
938 }
939 
940 /**
941  * sn_watcher_v0_gen_complete_register_host:
942  * @object: A #SnWatcherV0Gen.
943  * @invocation: (transfer full): A #GDBusMethodInvocation.
944  *
945  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-kde-StatusNotifierWatcher.RegisterStatusNotifierHost">RegisterStatusNotifierHost()</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.
946  *
947  * This method will free @invocation, you cannot use it afterwards.
948  */
949 void
sn_watcher_v0_gen_complete_register_host(SnWatcherV0Gen * object G_GNUC_UNUSED,GDBusMethodInvocation * invocation)950 sn_watcher_v0_gen_complete_register_host (
951     SnWatcherV0Gen *object G_GNUC_UNUSED,
952     GDBusMethodInvocation *invocation)
953 {
954   g_dbus_method_invocation_return_value (invocation,
955     g_variant_new ("()"));
956 }
957 
958 /* ------------------------------------------------------------------------ */
959 
960 /**
961  * SnWatcherV0GenProxy:
962  *
963  * The #SnWatcherV0GenProxy structure contains only private data and should only be accessed using the provided API.
964  */
965 
966 /**
967  * SnWatcherV0GenProxyClass:
968  * @parent_class: The parent class.
969  *
970  * Class structure for #SnWatcherV0GenProxy.
971  */
972 
973 struct _SnWatcherV0GenProxyPrivate
974 {
975   GData *qdata;
976 };
977 
978 static void sn_watcher_v0_gen_proxy_iface_init (SnWatcherV0GenIface *iface);
979 
980 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(SnWatcherV0GenProxy,sn_watcher_v0_gen_proxy,G_TYPE_DBUS_PROXY,G_ADD_PRIVATE (SnWatcherV0GenProxy)G_IMPLEMENT_INTERFACE (SN_TYPE_WATCHER_V0_GEN,sn_watcher_v0_gen_proxy_iface_init))981 G_DEFINE_TYPE_WITH_CODE (SnWatcherV0GenProxy, sn_watcher_v0_gen_proxy, G_TYPE_DBUS_PROXY,
982                          G_ADD_PRIVATE (SnWatcherV0GenProxy)
983                          G_IMPLEMENT_INTERFACE (SN_TYPE_WATCHER_V0_GEN, sn_watcher_v0_gen_proxy_iface_init))
984 
985 #else
986 G_DEFINE_TYPE_WITH_CODE (SnWatcherV0GenProxy, sn_watcher_v0_gen_proxy, G_TYPE_DBUS_PROXY,
987                          G_IMPLEMENT_INTERFACE (SN_TYPE_WATCHER_V0_GEN, sn_watcher_v0_gen_proxy_iface_init))
988 
989 #endif
990 static void
991 sn_watcher_v0_gen_proxy_finalize (GObject *object)
992 {
993   SnWatcherV0GenProxy *proxy = SN_WATCHER_V0_GEN_PROXY (object);
994   g_datalist_clear (&proxy->priv->qdata);
995   G_OBJECT_CLASS (sn_watcher_v0_gen_proxy_parent_class)->finalize (object);
996 }
997 
998 static void
sn_watcher_v0_gen_proxy_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)999 sn_watcher_v0_gen_proxy_get_property (GObject      *object,
1000   guint         prop_id,
1001   GValue       *value,
1002   GParamSpec   *pspec G_GNUC_UNUSED)
1003 {
1004   const _ExtendedGDBusPropertyInfo *info;
1005   GVariant *variant;
1006   g_assert (prop_id != 0 && prop_id - 1 < 3);
1007   info = (const _ExtendedGDBusPropertyInfo *) _sn_watcher_v0_gen_property_info_pointers[prop_id - 1];
1008   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
1009   if (info->use_gvariant)
1010     {
1011       g_value_set_variant (value, variant);
1012     }
1013   else
1014     {
1015       if (variant != NULL)
1016         g_dbus_gvariant_to_gvalue (variant, value);
1017     }
1018   if (variant != NULL)
1019     g_variant_unref (variant);
1020 }
1021 
1022 static void
sn_watcher_v0_gen_proxy_set_property_cb(GDBusProxy * proxy,GAsyncResult * res,gpointer user_data)1023 sn_watcher_v0_gen_proxy_set_property_cb (GDBusProxy *proxy,
1024   GAsyncResult *res,
1025   gpointer      user_data)
1026 {
1027   const _ExtendedGDBusPropertyInfo *info = user_data;
1028   GError *error;
1029   GVariant *_ret;
1030   error = NULL;
1031   _ret = g_dbus_proxy_call_finish (proxy, res, &error);
1032   if (!_ret)
1033     {
1034       g_warning ("Error setting property '%s' on interface org.kde.StatusNotifierWatcher: %s (%s, %d)",
1035                  info->parent_struct.name,
1036                  error->message, g_quark_to_string (error->domain), error->code);
1037       g_error_free (error);
1038     }
1039   else
1040     {
1041       g_variant_unref (_ret);
1042     }
1043 }
1044 
1045 static void
sn_watcher_v0_gen_proxy_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec G_GNUC_UNUSED)1046 sn_watcher_v0_gen_proxy_set_property (GObject      *object,
1047   guint         prop_id,
1048   const GValue *value,
1049   GParamSpec   *pspec G_GNUC_UNUSED)
1050 {
1051   const _ExtendedGDBusPropertyInfo *info;
1052   GVariant *variant;
1053   g_assert (prop_id != 0 && prop_id - 1 < 3);
1054   info = (const _ExtendedGDBusPropertyInfo *) _sn_watcher_v0_gen_property_info_pointers[prop_id - 1];
1055   variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
1056   g_dbus_proxy_call (G_DBUS_PROXY (object),
1057     "org.freedesktop.DBus.Properties.Set",
1058     g_variant_new ("(ssv)", "org.kde.StatusNotifierWatcher", info->parent_struct.name, variant),
1059     G_DBUS_CALL_FLAGS_NONE,
1060     -1,
1061     NULL, (GAsyncReadyCallback) sn_watcher_v0_gen_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
1062   g_variant_unref (variant);
1063 }
1064 
1065 static void
sn_watcher_v0_gen_proxy_g_signal(GDBusProxy * proxy,const gchar * sender_name G_GNUC_UNUSED,const gchar * signal_name,GVariant * parameters)1066 sn_watcher_v0_gen_proxy_g_signal (GDBusProxy *proxy,
1067   const gchar *sender_name G_GNUC_UNUSED,
1068   const gchar *signal_name,
1069   GVariant *parameters)
1070 {
1071   _ExtendedGDBusSignalInfo *info;
1072   GVariantIter iter;
1073   GVariant *child;
1074   GValue *paramv;
1075   gsize num_params;
1076   gsize n;
1077   guint signal_id;
1078   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_sn_watcher_v0_gen_interface_info.parent_struct, signal_name);
1079   if (info == NULL)
1080     return;
1081   num_params = g_variant_n_children (parameters);
1082   paramv = g_new0 (GValue, num_params + 1);
1083   g_value_init (&paramv[0], SN_TYPE_WATCHER_V0_GEN);
1084   g_value_set_object (&paramv[0], proxy);
1085   g_variant_iter_init (&iter, parameters);
1086   n = 1;
1087   while ((child = g_variant_iter_next_value (&iter)) != NULL)
1088     {
1089       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1090       if (arg_info->use_gvariant)
1091         {
1092           g_value_init (&paramv[n], G_TYPE_VARIANT);
1093           g_value_set_variant (&paramv[n], child);
1094           n++;
1095         }
1096       else
1097         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1098       g_variant_unref (child);
1099     }
1100   signal_id = g_signal_lookup (info->signal_name, SN_TYPE_WATCHER_V0_GEN);
1101   g_signal_emitv (paramv, signal_id, 0, NULL);
1102   for (n = 0; n < num_params + 1; n++)
1103     g_value_unset (&paramv[n]);
1104   g_free (paramv);
1105 }
1106 
1107 static void
sn_watcher_v0_gen_proxy_g_properties_changed(GDBusProxy * _proxy,GVariant * changed_properties,const gchar * const * invalidated_properties)1108 sn_watcher_v0_gen_proxy_g_properties_changed (GDBusProxy *_proxy,
1109   GVariant *changed_properties,
1110   const gchar *const *invalidated_properties)
1111 {
1112   SnWatcherV0GenProxy *proxy = SN_WATCHER_V0_GEN_PROXY (_proxy);
1113   guint n;
1114   const gchar *key;
1115   GVariantIter *iter;
1116   _ExtendedGDBusPropertyInfo *info;
1117   g_variant_get (changed_properties, "a{sv}", &iter);
1118   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1119     {
1120       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sn_watcher_v0_gen_interface_info.parent_struct, key);
1121       g_datalist_remove_data (&proxy->priv->qdata, key);
1122       if (info != NULL)
1123         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1124     }
1125   g_variant_iter_free (iter);
1126   for (n = 0; invalidated_properties[n] != NULL; n++)
1127     {
1128       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sn_watcher_v0_gen_interface_info.parent_struct, invalidated_properties[n]);
1129       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
1130       if (info != NULL)
1131         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1132     }
1133 }
1134 
1135 static const gchar *const *
sn_watcher_v0_gen_proxy_get_registered_items(SnWatcherV0Gen * object)1136 sn_watcher_v0_gen_proxy_get_registered_items (SnWatcherV0Gen *object)
1137 {
1138   SnWatcherV0GenProxy *proxy = SN_WATCHER_V0_GEN_PROXY (object);
1139   GVariant *variant;
1140   const gchar *const *value = NULL;
1141   value = g_datalist_get_data (&proxy->priv->qdata, "RegisteredStatusNotifierItems");
1142   if (value != NULL)
1143     return value;
1144   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "RegisteredStatusNotifierItems");
1145   if (variant != NULL)
1146     {
1147       value = g_variant_get_strv (variant, NULL);
1148       g_datalist_set_data_full (&proxy->priv->qdata, "RegisteredStatusNotifierItems", (gpointer) value, g_free);
1149       g_variant_unref (variant);
1150     }
1151   return value;
1152 }
1153 
1154 static gboolean
sn_watcher_v0_gen_proxy_get_is_host_registered(SnWatcherV0Gen * object)1155 sn_watcher_v0_gen_proxy_get_is_host_registered (SnWatcherV0Gen *object)
1156 {
1157   SnWatcherV0GenProxy *proxy = SN_WATCHER_V0_GEN_PROXY (object);
1158   GVariant *variant;
1159   gboolean value = 0;
1160   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "IsStatusNotifierHostRegistered");
1161   if (variant != NULL)
1162     {
1163       value = g_variant_get_boolean (variant);
1164       g_variant_unref (variant);
1165     }
1166   return value;
1167 }
1168 
1169 static gint
sn_watcher_v0_gen_proxy_get_protocol_version(SnWatcherV0Gen * object)1170 sn_watcher_v0_gen_proxy_get_protocol_version (SnWatcherV0Gen *object)
1171 {
1172   SnWatcherV0GenProxy *proxy = SN_WATCHER_V0_GEN_PROXY (object);
1173   GVariant *variant;
1174   gint value = 0;
1175   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "ProtocolVersion");
1176   if (variant != NULL)
1177     {
1178       value = g_variant_get_int32 (variant);
1179       g_variant_unref (variant);
1180     }
1181   return value;
1182 }
1183 
1184 static void
sn_watcher_v0_gen_proxy_init(SnWatcherV0GenProxy * proxy)1185 sn_watcher_v0_gen_proxy_init (SnWatcherV0GenProxy *proxy)
1186 {
1187 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1188   proxy->priv = sn_watcher_v0_gen_proxy_get_instance_private (proxy);
1189 #else
1190   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, SN_TYPE_WATCHER_V0_GEN_PROXY, SnWatcherV0GenProxyPrivate);
1191 #endif
1192 
1193   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), sn_watcher_v0_gen_interface_info ());
1194 }
1195 
1196 static void
sn_watcher_v0_gen_proxy_class_init(SnWatcherV0GenProxyClass * klass)1197 sn_watcher_v0_gen_proxy_class_init (SnWatcherV0GenProxyClass *klass)
1198 {
1199   GObjectClass *gobject_class;
1200   GDBusProxyClass *proxy_class;
1201 
1202   gobject_class = G_OBJECT_CLASS (klass);
1203   gobject_class->finalize     = sn_watcher_v0_gen_proxy_finalize;
1204   gobject_class->get_property = sn_watcher_v0_gen_proxy_get_property;
1205   gobject_class->set_property = sn_watcher_v0_gen_proxy_set_property;
1206 
1207   proxy_class = G_DBUS_PROXY_CLASS (klass);
1208   proxy_class->g_signal = sn_watcher_v0_gen_proxy_g_signal;
1209   proxy_class->g_properties_changed = sn_watcher_v0_gen_proxy_g_properties_changed;
1210 
1211   sn_watcher_v0_gen_override_properties (gobject_class, 1);
1212 
1213 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1214   g_type_class_add_private (klass, sizeof (SnWatcherV0GenProxyPrivate));
1215 #endif
1216 }
1217 
1218 static void
sn_watcher_v0_gen_proxy_iface_init(SnWatcherV0GenIface * iface)1219 sn_watcher_v0_gen_proxy_iface_init (SnWatcherV0GenIface *iface)
1220 {
1221   iface->get_registered_items = sn_watcher_v0_gen_proxy_get_registered_items;
1222   iface->get_is_host_registered = sn_watcher_v0_gen_proxy_get_is_host_registered;
1223   iface->get_protocol_version = sn_watcher_v0_gen_proxy_get_protocol_version;
1224 }
1225 
1226 /**
1227  * sn_watcher_v0_gen_proxy_new:
1228  * @connection: A #GDBusConnection.
1229  * @flags: Flags from the #GDBusProxyFlags enumeration.
1230  * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1231  * @object_path: An object path.
1232  * @cancellable: (nullable): A #GCancellable or %NULL.
1233  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1234  * @user_data: User data to pass to @callback.
1235  *
1236  * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-kde-StatusNotifierWatcher.top_of_page">org.kde.StatusNotifierWatcher</link>. See g_dbus_proxy_new() for more details.
1237  *
1238  * 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()).
1239  * You can then call sn_watcher_v0_gen_proxy_new_finish() to get the result of the operation.
1240  *
1241  * See sn_watcher_v0_gen_proxy_new_sync() for the synchronous, blocking version of this constructor.
1242  */
1243 void
sn_watcher_v0_gen_proxy_new(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1244 sn_watcher_v0_gen_proxy_new (
1245     GDBusConnection     *connection,
1246     GDBusProxyFlags      flags,
1247     const gchar         *name,
1248     const gchar         *object_path,
1249     GCancellable        *cancellable,
1250     GAsyncReadyCallback  callback,
1251     gpointer             user_data)
1252 {
1253   g_async_initable_new_async (SN_TYPE_WATCHER_V0_GEN_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.kde.StatusNotifierWatcher", NULL);
1254 }
1255 
1256 /**
1257  * sn_watcher_v0_gen_proxy_new_finish:
1258  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sn_watcher_v0_gen_proxy_new().
1259  * @error: Return location for error or %NULL
1260  *
1261  * Finishes an operation started with sn_watcher_v0_gen_proxy_new().
1262  *
1263  * Returns: (transfer full) (type SnWatcherV0GenProxy): The constructed proxy object or %NULL if @error is set.
1264  */
1265 SnWatcherV0Gen *
sn_watcher_v0_gen_proxy_new_finish(GAsyncResult * res,GError ** error)1266 sn_watcher_v0_gen_proxy_new_finish (
1267     GAsyncResult        *res,
1268     GError             **error)
1269 {
1270   GObject *ret;
1271   GObject *source_object;
1272   source_object = g_async_result_get_source_object (res);
1273   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1274   g_object_unref (source_object);
1275   if (ret != NULL)
1276     return SN_WATCHER_V0_GEN (ret);
1277   else
1278     return NULL;
1279 }
1280 
1281 /**
1282  * sn_watcher_v0_gen_proxy_new_sync:
1283  * @connection: A #GDBusConnection.
1284  * @flags: Flags from the #GDBusProxyFlags enumeration.
1285  * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1286  * @object_path: An object path.
1287  * @cancellable: (nullable): A #GCancellable or %NULL.
1288  * @error: Return location for error or %NULL
1289  *
1290  * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-kde-StatusNotifierWatcher.top_of_page">org.kde.StatusNotifierWatcher</link>. See g_dbus_proxy_new_sync() for more details.
1291  *
1292  * The calling thread is blocked until a reply is received.
1293  *
1294  * See sn_watcher_v0_gen_proxy_new() for the asynchronous version of this constructor.
1295  *
1296  * Returns: (transfer full) (type SnWatcherV0GenProxy): The constructed proxy object or %NULL if @error is set.
1297  */
1298 SnWatcherV0Gen *
sn_watcher_v0_gen_proxy_new_sync(GDBusConnection * connection,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1299 sn_watcher_v0_gen_proxy_new_sync (
1300     GDBusConnection     *connection,
1301     GDBusProxyFlags      flags,
1302     const gchar         *name,
1303     const gchar         *object_path,
1304     GCancellable        *cancellable,
1305     GError             **error)
1306 {
1307   GInitable *ret;
1308   ret = g_initable_new (SN_TYPE_WATCHER_V0_GEN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.kde.StatusNotifierWatcher", NULL);
1309   if (ret != NULL)
1310     return SN_WATCHER_V0_GEN (ret);
1311   else
1312     return NULL;
1313 }
1314 
1315 
1316 /**
1317  * sn_watcher_v0_gen_proxy_new_for_bus:
1318  * @bus_type: A #GBusType.
1319  * @flags: Flags from the #GDBusProxyFlags enumeration.
1320  * @name: A bus name (well-known or unique).
1321  * @object_path: An object path.
1322  * @cancellable: (nullable): A #GCancellable or %NULL.
1323  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1324  * @user_data: User data to pass to @callback.
1325  *
1326  * Like sn_watcher_v0_gen_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1327  *
1328  * 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()).
1329  * You can then call sn_watcher_v0_gen_proxy_new_for_bus_finish() to get the result of the operation.
1330  *
1331  * See sn_watcher_v0_gen_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1332  */
1333 void
sn_watcher_v0_gen_proxy_new_for_bus(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GAsyncReadyCallback callback,gpointer user_data)1334 sn_watcher_v0_gen_proxy_new_for_bus (
1335     GBusType             bus_type,
1336     GDBusProxyFlags      flags,
1337     const gchar         *name,
1338     const gchar         *object_path,
1339     GCancellable        *cancellable,
1340     GAsyncReadyCallback  callback,
1341     gpointer             user_data)
1342 {
1343   g_async_initable_new_async (SN_TYPE_WATCHER_V0_GEN_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.kde.StatusNotifierWatcher", NULL);
1344 }
1345 
1346 /**
1347  * sn_watcher_v0_gen_proxy_new_for_bus_finish:
1348  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sn_watcher_v0_gen_proxy_new_for_bus().
1349  * @error: Return location for error or %NULL
1350  *
1351  * Finishes an operation started with sn_watcher_v0_gen_proxy_new_for_bus().
1352  *
1353  * Returns: (transfer full) (type SnWatcherV0GenProxy): The constructed proxy object or %NULL if @error is set.
1354  */
1355 SnWatcherV0Gen *
sn_watcher_v0_gen_proxy_new_for_bus_finish(GAsyncResult * res,GError ** error)1356 sn_watcher_v0_gen_proxy_new_for_bus_finish (
1357     GAsyncResult        *res,
1358     GError             **error)
1359 {
1360   GObject *ret;
1361   GObject *source_object;
1362   source_object = g_async_result_get_source_object (res);
1363   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1364   g_object_unref (source_object);
1365   if (ret != NULL)
1366     return SN_WATCHER_V0_GEN (ret);
1367   else
1368     return NULL;
1369 }
1370 
1371 /**
1372  * sn_watcher_v0_gen_proxy_new_for_bus_sync:
1373  * @bus_type: A #GBusType.
1374  * @flags: Flags from the #GDBusProxyFlags enumeration.
1375  * @name: A bus name (well-known or unique).
1376  * @object_path: An object path.
1377  * @cancellable: (nullable): A #GCancellable or %NULL.
1378  * @error: Return location for error or %NULL
1379  *
1380  * Like sn_watcher_v0_gen_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1381  *
1382  * The calling thread is blocked until a reply is received.
1383  *
1384  * See sn_watcher_v0_gen_proxy_new_for_bus() for the asynchronous version of this constructor.
1385  *
1386  * Returns: (transfer full) (type SnWatcherV0GenProxy): The constructed proxy object or %NULL if @error is set.
1387  */
1388 SnWatcherV0Gen *
sn_watcher_v0_gen_proxy_new_for_bus_sync(GBusType bus_type,GDBusProxyFlags flags,const gchar * name,const gchar * object_path,GCancellable * cancellable,GError ** error)1389 sn_watcher_v0_gen_proxy_new_for_bus_sync (
1390     GBusType             bus_type,
1391     GDBusProxyFlags      flags,
1392     const gchar         *name,
1393     const gchar         *object_path,
1394     GCancellable        *cancellable,
1395     GError             **error)
1396 {
1397   GInitable *ret;
1398   ret = g_initable_new (SN_TYPE_WATCHER_V0_GEN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.kde.StatusNotifierWatcher", NULL);
1399   if (ret != NULL)
1400     return SN_WATCHER_V0_GEN (ret);
1401   else
1402     return NULL;
1403 }
1404 
1405 
1406 /* ------------------------------------------------------------------------ */
1407 
1408 /**
1409  * SnWatcherV0GenSkeleton:
1410  *
1411  * The #SnWatcherV0GenSkeleton structure contains only private data and should only be accessed using the provided API.
1412  */
1413 
1414 /**
1415  * SnWatcherV0GenSkeletonClass:
1416  * @parent_class: The parent class.
1417  *
1418  * Class structure for #SnWatcherV0GenSkeleton.
1419  */
1420 
1421 struct _SnWatcherV0GenSkeletonPrivate
1422 {
1423   GValue *properties;
1424   GList *changed_properties;
1425   GSource *changed_properties_idle_source;
1426   GMainContext *context;
1427   GMutex lock;
1428 };
1429 
1430 static void
_sn_watcher_v0_gen_skeleton_handle_method_call(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name,const gchar * method_name,GVariant * parameters,GDBusMethodInvocation * invocation,gpointer user_data)1431 _sn_watcher_v0_gen_skeleton_handle_method_call (
1432   GDBusConnection *connection G_GNUC_UNUSED,
1433   const gchar *sender G_GNUC_UNUSED,
1434   const gchar *object_path G_GNUC_UNUSED,
1435   const gchar *interface_name,
1436   const gchar *method_name,
1437   GVariant *parameters,
1438   GDBusMethodInvocation *invocation,
1439   gpointer user_data)
1440 {
1441   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (user_data);
1442   _ExtendedGDBusMethodInfo *info;
1443   GVariantIter iter;
1444   GVariant *child;
1445   GValue *paramv;
1446   gsize num_params;
1447   guint num_extra;
1448   gsize n;
1449   guint signal_id;
1450   GValue return_value = G_VALUE_INIT;
1451   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1452   g_assert (info != NULL);
1453   num_params = g_variant_n_children (parameters);
1454   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
1455   n = 0;
1456   g_value_init (&paramv[n], SN_TYPE_WATCHER_V0_GEN);
1457   g_value_set_object (&paramv[n++], skeleton);
1458   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1459   g_value_set_object (&paramv[n++], invocation);
1460   if (info->pass_fdlist)
1461     {
1462 #ifdef G_OS_UNIX
1463       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
1464       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1465 #else
1466       g_assert_not_reached ();
1467 #endif
1468     }
1469   g_variant_iter_init (&iter, parameters);
1470   while ((child = g_variant_iter_next_value (&iter)) != NULL)
1471     {
1472       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1473       if (arg_info->use_gvariant)
1474         {
1475           g_value_init (&paramv[n], G_TYPE_VARIANT);
1476           g_value_set_variant (&paramv[n], child);
1477           n++;
1478         }
1479       else
1480         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1481       g_variant_unref (child);
1482     }
1483   signal_id = g_signal_lookup (info->signal_name, SN_TYPE_WATCHER_V0_GEN);
1484   g_value_init (&return_value, G_TYPE_BOOLEAN);
1485   g_signal_emitv (paramv, signal_id, 0, &return_value);
1486   if (!g_value_get_boolean (&return_value))
1487     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);
1488   g_value_unset (&return_value);
1489   for (n = 0; n < num_params + num_extra; n++)
1490     g_value_unset (&paramv[n]);
1491   g_free (paramv);
1492 }
1493 
1494 static GVariant *
_sn_watcher_v0_gen_skeleton_handle_get_property(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name G_GNUC_UNUSED,const gchar * property_name,GError ** error,gpointer user_data)1495 _sn_watcher_v0_gen_skeleton_handle_get_property (
1496   GDBusConnection *connection G_GNUC_UNUSED,
1497   const gchar *sender G_GNUC_UNUSED,
1498   const gchar *object_path G_GNUC_UNUSED,
1499   const gchar *interface_name G_GNUC_UNUSED,
1500   const gchar *property_name,
1501   GError **error,
1502   gpointer user_data)
1503 {
1504   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (user_data);
1505   GValue value = G_VALUE_INIT;
1506   GParamSpec *pspec;
1507   _ExtendedGDBusPropertyInfo *info;
1508   GVariant *ret;
1509   ret = NULL;
1510   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sn_watcher_v0_gen_interface_info.parent_struct, property_name);
1511   g_assert (info != NULL);
1512   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1513   if (pspec == NULL)
1514     {
1515       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1516     }
1517   else
1518     {
1519       g_value_init (&value, pspec->value_type);
1520       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1521       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
1522       g_value_unset (&value);
1523     }
1524   return ret;
1525 }
1526 
1527 static gboolean
_sn_watcher_v0_gen_skeleton_handle_set_property(GDBusConnection * connection G_GNUC_UNUSED,const gchar * sender G_GNUC_UNUSED,const gchar * object_path G_GNUC_UNUSED,const gchar * interface_name G_GNUC_UNUSED,const gchar * property_name,GVariant * variant,GError ** error,gpointer user_data)1528 _sn_watcher_v0_gen_skeleton_handle_set_property (
1529   GDBusConnection *connection G_GNUC_UNUSED,
1530   const gchar *sender G_GNUC_UNUSED,
1531   const gchar *object_path G_GNUC_UNUSED,
1532   const gchar *interface_name G_GNUC_UNUSED,
1533   const gchar *property_name,
1534   GVariant *variant,
1535   GError **error,
1536   gpointer user_data)
1537 {
1538   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (user_data);
1539   GValue value = G_VALUE_INIT;
1540   GParamSpec *pspec;
1541   _ExtendedGDBusPropertyInfo *info;
1542   gboolean ret;
1543   ret = FALSE;
1544   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sn_watcher_v0_gen_interface_info.parent_struct, property_name);
1545   g_assert (info != NULL);
1546   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1547   if (pspec == NULL)
1548     {
1549       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1550     }
1551   else
1552     {
1553       if (info->use_gvariant)
1554         g_value_set_variant (&value, variant);
1555       else
1556         g_dbus_gvariant_to_gvalue (variant, &value);
1557       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1558       g_value_unset (&value);
1559       ret = TRUE;
1560     }
1561   return ret;
1562 }
1563 
1564 static const GDBusInterfaceVTable _sn_watcher_v0_gen_skeleton_vtable =
1565 {
1566   _sn_watcher_v0_gen_skeleton_handle_method_call,
1567   _sn_watcher_v0_gen_skeleton_handle_get_property,
1568   _sn_watcher_v0_gen_skeleton_handle_set_property,
1569   {NULL}
1570 };
1571 
1572 static GDBusInterfaceInfo *
sn_watcher_v0_gen_skeleton_dbus_interface_get_info(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)1573 sn_watcher_v0_gen_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1574 {
1575   return sn_watcher_v0_gen_interface_info ();
1576 }
1577 
1578 static GDBusInterfaceVTable *
sn_watcher_v0_gen_skeleton_dbus_interface_get_vtable(GDBusInterfaceSkeleton * skeleton G_GNUC_UNUSED)1579 sn_watcher_v0_gen_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1580 {
1581   return (GDBusInterfaceVTable *) &_sn_watcher_v0_gen_skeleton_vtable;
1582 }
1583 
1584 static GVariant *
sn_watcher_v0_gen_skeleton_dbus_interface_get_properties(GDBusInterfaceSkeleton * _skeleton)1585 sn_watcher_v0_gen_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1586 {
1587   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (_skeleton);
1588 
1589   GVariantBuilder builder;
1590   guint n;
1591   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1592   if (_sn_watcher_v0_gen_interface_info.parent_struct.properties == NULL)
1593     goto out;
1594   for (n = 0; _sn_watcher_v0_gen_interface_info.parent_struct.properties[n] != NULL; n++)
1595     {
1596       GDBusPropertyInfo *info = _sn_watcher_v0_gen_interface_info.parent_struct.properties[n];
1597       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1598         {
1599           GVariant *value;
1600           value = _sn_watcher_v0_gen_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.kde.StatusNotifierWatcher", info->name, NULL, skeleton);
1601           if (value != NULL)
1602             {
1603               g_variant_take_ref (value);
1604               g_variant_builder_add (&builder, "{sv}", info->name, value);
1605               g_variant_unref (value);
1606             }
1607         }
1608     }
1609 out:
1610   return g_variant_builder_end (&builder);
1611 }
1612 
1613 static gboolean _sn_watcher_v0_gen_emit_changed (gpointer user_data);
1614 
1615 static void
sn_watcher_v0_gen_skeleton_dbus_interface_flush(GDBusInterfaceSkeleton * _skeleton)1616 sn_watcher_v0_gen_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1617 {
1618   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (_skeleton);
1619   gboolean emit_changed = FALSE;
1620 
1621   g_mutex_lock (&skeleton->priv->lock);
1622   if (skeleton->priv->changed_properties_idle_source != NULL)
1623     {
1624       g_source_destroy (skeleton->priv->changed_properties_idle_source);
1625       skeleton->priv->changed_properties_idle_source = NULL;
1626       emit_changed = TRUE;
1627     }
1628   g_mutex_unlock (&skeleton->priv->lock);
1629 
1630   if (emit_changed)
1631     _sn_watcher_v0_gen_emit_changed (skeleton);
1632 }
1633 
1634 static void
_sn_watcher_v0_gen_on_signal_item_registered(SnWatcherV0Gen * object,const gchar * arg_service)1635 _sn_watcher_v0_gen_on_signal_item_registered (
1636     SnWatcherV0Gen *object,
1637     const gchar *arg_service)
1638 {
1639   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1640 
1641   GList      *connections, *l;
1642   GVariant   *signal_variant;
1643   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
1644 
1645   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
1646                    arg_service));
1647   for (l = connections; l != NULL; l = l->next)
1648     {
1649       GDBusConnection *connection = l->data;
1650       g_dbus_connection_emit_signal (connection,
1651         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.kde.StatusNotifierWatcher", "StatusNotifierItemRegistered",
1652         signal_variant, NULL);
1653     }
1654   g_variant_unref (signal_variant);
1655   g_list_free_full (connections, g_object_unref);
1656 }
1657 
1658 static void
_sn_watcher_v0_gen_on_signal_item_unregistered(SnWatcherV0Gen * object,const gchar * arg_service)1659 _sn_watcher_v0_gen_on_signal_item_unregistered (
1660     SnWatcherV0Gen *object,
1661     const gchar *arg_service)
1662 {
1663   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1664 
1665   GList      *connections, *l;
1666   GVariant   *signal_variant;
1667   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
1668 
1669   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
1670                    arg_service));
1671   for (l = connections; l != NULL; l = l->next)
1672     {
1673       GDBusConnection *connection = l->data;
1674       g_dbus_connection_emit_signal (connection,
1675         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.kde.StatusNotifierWatcher", "StatusNotifierItemUnregistered",
1676         signal_variant, NULL);
1677     }
1678   g_variant_unref (signal_variant);
1679   g_list_free_full (connections, g_object_unref);
1680 }
1681 
1682 static void
_sn_watcher_v0_gen_on_signal_host_registered(SnWatcherV0Gen * object)1683 _sn_watcher_v0_gen_on_signal_host_registered (
1684     SnWatcherV0Gen *object)
1685 {
1686   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1687 
1688   GList      *connections, *l;
1689   GVariant   *signal_variant;
1690   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
1691 
1692   signal_variant = g_variant_ref_sink (g_variant_new ("()"));
1693   for (l = connections; l != NULL; l = l->next)
1694     {
1695       GDBusConnection *connection = l->data;
1696       g_dbus_connection_emit_signal (connection,
1697         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.kde.StatusNotifierWatcher", "StatusNotifierHostRegistered",
1698         signal_variant, NULL);
1699     }
1700   g_variant_unref (signal_variant);
1701   g_list_free_full (connections, g_object_unref);
1702 }
1703 
1704 static void sn_watcher_v0_gen_skeleton_iface_init (SnWatcherV0GenIface *iface);
1705 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE(SnWatcherV0GenSkeleton,sn_watcher_v0_gen_skeleton,G_TYPE_DBUS_INTERFACE_SKELETON,G_ADD_PRIVATE (SnWatcherV0GenSkeleton)G_IMPLEMENT_INTERFACE (SN_TYPE_WATCHER_V0_GEN,sn_watcher_v0_gen_skeleton_iface_init))1706 G_DEFINE_TYPE_WITH_CODE (SnWatcherV0GenSkeleton, sn_watcher_v0_gen_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1707                          G_ADD_PRIVATE (SnWatcherV0GenSkeleton)
1708                          G_IMPLEMENT_INTERFACE (SN_TYPE_WATCHER_V0_GEN, sn_watcher_v0_gen_skeleton_iface_init))
1709 
1710 #else
1711 G_DEFINE_TYPE_WITH_CODE (SnWatcherV0GenSkeleton, sn_watcher_v0_gen_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1712                          G_IMPLEMENT_INTERFACE (SN_TYPE_WATCHER_V0_GEN, sn_watcher_v0_gen_skeleton_iface_init))
1713 
1714 #endif
1715 static void
1716 sn_watcher_v0_gen_skeleton_finalize (GObject *object)
1717 {
1718   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1719   guint n;
1720   for (n = 0; n < 3; n++)
1721     g_value_unset (&skeleton->priv->properties[n]);
1722   g_free (skeleton->priv->properties);
1723   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1724   if (skeleton->priv->changed_properties_idle_source != NULL)
1725     g_source_destroy (skeleton->priv->changed_properties_idle_source);
1726   g_main_context_unref (skeleton->priv->context);
1727   g_mutex_clear (&skeleton->priv->lock);
1728   G_OBJECT_CLASS (sn_watcher_v0_gen_skeleton_parent_class)->finalize (object);
1729 }
1730 
1731 static void
sn_watcher_v0_gen_skeleton_get_property(GObject * object,guint prop_id,GValue * value,GParamSpec * pspec G_GNUC_UNUSED)1732 sn_watcher_v0_gen_skeleton_get_property (GObject      *object,
1733   guint         prop_id,
1734   GValue       *value,
1735   GParamSpec   *pspec G_GNUC_UNUSED)
1736 {
1737   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1738   g_assert (prop_id != 0 && prop_id - 1 < 3);
1739   g_mutex_lock (&skeleton->priv->lock);
1740   g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
1741   g_mutex_unlock (&skeleton->priv->lock);
1742 }
1743 
1744 static gboolean
_sn_watcher_v0_gen_emit_changed(gpointer user_data)1745 _sn_watcher_v0_gen_emit_changed (gpointer user_data)
1746 {
1747   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (user_data);
1748   GList *l;
1749   GVariantBuilder builder;
1750   GVariantBuilder invalidated_builder;
1751   guint num_changes;
1752 
1753   g_mutex_lock (&skeleton->priv->lock);
1754   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1755   g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
1756   for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
1757     {
1758       ChangedProperty *cp = l->data;
1759       GVariant *variant;
1760       const GValue *cur_value;
1761 
1762       cur_value = &skeleton->priv->properties[cp->prop_id - 1];
1763       if (!_g_value_equal (cur_value, &cp->orig_value))
1764         {
1765           variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
1766           g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
1767           g_variant_unref (variant);
1768           num_changes++;
1769         }
1770     }
1771   if (num_changes > 0)
1772     {
1773       GList *connections, *ll;
1774       GVariant *signal_variant;
1775       signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.kde.StatusNotifierWatcher",
1776                                            &builder, &invalidated_builder));
1777       connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
1778       for (ll = connections; ll != NULL; ll = ll->next)
1779         {
1780           GDBusConnection *connection = ll->data;
1781 
1782           g_dbus_connection_emit_signal (connection,
1783                                          NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
1784                                          "org.freedesktop.DBus.Properties",
1785                                          "PropertiesChanged",
1786                                          signal_variant,
1787                                          NULL);
1788         }
1789       g_variant_unref (signal_variant);
1790       g_list_free_full (connections, g_object_unref);
1791     }
1792   else
1793     {
1794       g_variant_builder_clear (&builder);
1795       g_variant_builder_clear (&invalidated_builder);
1796     }
1797   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1798   skeleton->priv->changed_properties = NULL;
1799   skeleton->priv->changed_properties_idle_source = NULL;
1800   g_mutex_unlock (&skeleton->priv->lock);
1801   return FALSE;
1802 }
1803 
1804 static void
_sn_watcher_v0_gen_schedule_emit_changed(SnWatcherV0GenSkeleton * skeleton,const _ExtendedGDBusPropertyInfo * info,guint prop_id,const GValue * orig_value)1805 _sn_watcher_v0_gen_schedule_emit_changed (SnWatcherV0GenSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
1806 {
1807   ChangedProperty *cp;
1808   GList *l;
1809   cp = NULL;
1810   for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
1811     {
1812       ChangedProperty *i_cp = l->data;
1813       if (i_cp->info == info)
1814         {
1815           cp = i_cp;
1816           break;
1817         }
1818     }
1819   if (cp == NULL)
1820     {
1821       cp = g_new0 (ChangedProperty, 1);
1822       cp->prop_id = prop_id;
1823       cp->info = info;
1824       skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
1825       g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
1826       g_value_copy (orig_value, &cp->orig_value);
1827     }
1828 }
1829 
1830 static void
sn_watcher_v0_gen_skeleton_notify(GObject * object,GParamSpec * pspec G_GNUC_UNUSED)1831 sn_watcher_v0_gen_skeleton_notify (GObject      *object,
1832   GParamSpec *pspec G_GNUC_UNUSED)
1833 {
1834   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1835   g_mutex_lock (&skeleton->priv->lock);
1836   if (skeleton->priv->changed_properties != NULL &&
1837       skeleton->priv->changed_properties_idle_source == NULL)
1838     {
1839       skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
1840       g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
1841       g_source_set_callback (skeleton->priv->changed_properties_idle_source, _sn_watcher_v0_gen_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
1842       g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _sn_watcher_v0_gen_emit_changed");
1843       g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
1844       g_source_unref (skeleton->priv->changed_properties_idle_source);
1845     }
1846   g_mutex_unlock (&skeleton->priv->lock);
1847 }
1848 
1849 static void
sn_watcher_v0_gen_skeleton_set_property(GObject * object,guint prop_id,const GValue * value,GParamSpec * pspec)1850 sn_watcher_v0_gen_skeleton_set_property (GObject      *object,
1851   guint         prop_id,
1852   const GValue *value,
1853   GParamSpec   *pspec)
1854 {
1855   const _ExtendedGDBusPropertyInfo *info;
1856   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1857   g_assert (prop_id != 0 && prop_id - 1 < 3);
1858   info = (const _ExtendedGDBusPropertyInfo *) _sn_watcher_v0_gen_property_info_pointers[prop_id - 1];
1859   g_mutex_lock (&skeleton->priv->lock);
1860   g_object_freeze_notify (object);
1861   if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
1862     {
1863       if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
1864           info->emits_changed_signal)
1865         _sn_watcher_v0_gen_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
1866       g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
1867       g_object_notify_by_pspec (object, pspec);
1868     }
1869   g_mutex_unlock (&skeleton->priv->lock);
1870   g_object_thaw_notify (object);
1871 }
1872 
1873 static void
sn_watcher_v0_gen_skeleton_init(SnWatcherV0GenSkeleton * skeleton)1874 sn_watcher_v0_gen_skeleton_init (SnWatcherV0GenSkeleton *skeleton)
1875 {
1876 #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1877   skeleton->priv = sn_watcher_v0_gen_skeleton_get_instance_private (skeleton);
1878 #else
1879   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, SN_TYPE_WATCHER_V0_GEN_SKELETON, SnWatcherV0GenSkeletonPrivate);
1880 #endif
1881 
1882   g_mutex_init (&skeleton->priv->lock);
1883   skeleton->priv->context = g_main_context_ref_thread_default ();
1884   skeleton->priv->properties = g_new0 (GValue, 3);
1885   g_value_init (&skeleton->priv->properties[0], G_TYPE_STRV);
1886   g_value_init (&skeleton->priv->properties[1], G_TYPE_BOOLEAN);
1887   g_value_init (&skeleton->priv->properties[2], G_TYPE_INT);
1888 }
1889 
1890 static const gchar *const *
sn_watcher_v0_gen_skeleton_get_registered_items(SnWatcherV0Gen * object)1891 sn_watcher_v0_gen_skeleton_get_registered_items (SnWatcherV0Gen *object)
1892 {
1893   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1894   const gchar *const *value;
1895   g_mutex_lock (&skeleton->priv->lock);
1896   value = g_value_get_boxed (&(skeleton->priv->properties[0]));
1897   g_mutex_unlock (&skeleton->priv->lock);
1898   return value;
1899 }
1900 
1901 static gboolean
sn_watcher_v0_gen_skeleton_get_is_host_registered(SnWatcherV0Gen * object)1902 sn_watcher_v0_gen_skeleton_get_is_host_registered (SnWatcherV0Gen *object)
1903 {
1904   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1905   gboolean value;
1906   g_mutex_lock (&skeleton->priv->lock);
1907   value = g_value_get_boolean (&(skeleton->priv->properties[1]));
1908   g_mutex_unlock (&skeleton->priv->lock);
1909   return value;
1910 }
1911 
1912 static gint
sn_watcher_v0_gen_skeleton_get_protocol_version(SnWatcherV0Gen * object)1913 sn_watcher_v0_gen_skeleton_get_protocol_version (SnWatcherV0Gen *object)
1914 {
1915   SnWatcherV0GenSkeleton *skeleton = SN_WATCHER_V0_GEN_SKELETON (object);
1916   gint value;
1917   g_mutex_lock (&skeleton->priv->lock);
1918   value = g_value_get_int (&(skeleton->priv->properties[2]));
1919   g_mutex_unlock (&skeleton->priv->lock);
1920   return value;
1921 }
1922 
1923 static void
sn_watcher_v0_gen_skeleton_class_init(SnWatcherV0GenSkeletonClass * klass)1924 sn_watcher_v0_gen_skeleton_class_init (SnWatcherV0GenSkeletonClass *klass)
1925 {
1926   GObjectClass *gobject_class;
1927   GDBusInterfaceSkeletonClass *skeleton_class;
1928 
1929   gobject_class = G_OBJECT_CLASS (klass);
1930   gobject_class->finalize = sn_watcher_v0_gen_skeleton_finalize;
1931   gobject_class->get_property = sn_watcher_v0_gen_skeleton_get_property;
1932   gobject_class->set_property = sn_watcher_v0_gen_skeleton_set_property;
1933   gobject_class->notify       = sn_watcher_v0_gen_skeleton_notify;
1934 
1935 
1936   sn_watcher_v0_gen_override_properties (gobject_class, 1);
1937 
1938   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1939   skeleton_class->get_info = sn_watcher_v0_gen_skeleton_dbus_interface_get_info;
1940   skeleton_class->get_properties = sn_watcher_v0_gen_skeleton_dbus_interface_get_properties;
1941   skeleton_class->flush = sn_watcher_v0_gen_skeleton_dbus_interface_flush;
1942   skeleton_class->get_vtable = sn_watcher_v0_gen_skeleton_dbus_interface_get_vtable;
1943 
1944 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1945   g_type_class_add_private (klass, sizeof (SnWatcherV0GenSkeletonPrivate));
1946 #endif
1947 }
1948 
1949 static void
sn_watcher_v0_gen_skeleton_iface_init(SnWatcherV0GenIface * iface)1950 sn_watcher_v0_gen_skeleton_iface_init (SnWatcherV0GenIface *iface)
1951 {
1952   iface->item_registered = _sn_watcher_v0_gen_on_signal_item_registered;
1953   iface->item_unregistered = _sn_watcher_v0_gen_on_signal_item_unregistered;
1954   iface->host_registered = _sn_watcher_v0_gen_on_signal_host_registered;
1955   iface->get_registered_items = sn_watcher_v0_gen_skeleton_get_registered_items;
1956   iface->get_is_host_registered = sn_watcher_v0_gen_skeleton_get_is_host_registered;
1957   iface->get_protocol_version = sn_watcher_v0_gen_skeleton_get_protocol_version;
1958 }
1959 
1960 /**
1961  * sn_watcher_v0_gen_skeleton_new:
1962  *
1963  * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-kde-StatusNotifierWatcher.top_of_page">org.kde.StatusNotifierWatcher</link>.
1964  *
1965  * Returns: (transfer full) (type SnWatcherV0GenSkeleton): The skeleton object.
1966  */
1967 SnWatcherV0Gen *
sn_watcher_v0_gen_skeleton_new(void)1968 sn_watcher_v0_gen_skeleton_new (void)
1969 {
1970   return SN_WATCHER_V0_GEN (g_object_new (SN_TYPE_WATCHER_V0_GEN_SKELETON, NULL));
1971 }
1972 
1973