2
* Generated by gdbus-codegen 2.41.4. DO NOT EDIT.
4
* The license of this code is the same as for the source it was derived from.
11
#include "meta-dbus-idle-monitor.h"
15
# include <gio/gunixfdlist.h>
20
GDBusArgInfo parent_struct;
21
gboolean use_gvariant;
22
} _ExtendedGDBusArgInfo;
26
GDBusMethodInfo parent_struct;
27
const gchar *signal_name;
29
} _ExtendedGDBusMethodInfo;
33
GDBusSignalInfo parent_struct;
34
const gchar *signal_name;
35
} _ExtendedGDBusSignalInfo;
39
GDBusPropertyInfo parent_struct;
40
const gchar *hyphen_name;
41
gboolean use_gvariant;
42
} _ExtendedGDBusPropertyInfo;
46
GDBusInterfaceInfo parent_struct;
47
const gchar *hyphen_name;
48
} _ExtendedGDBusInterfaceInfo;
52
const _ExtendedGDBusPropertyInfo *info;
54
GValue orig_value; /* the value before the change */
58
_changed_property_free (ChangedProperty *data)
60
g_value_unset (&data->orig_value);
65
_g_strv_equal0 (gchar **a, gchar **b)
69
if (a == NULL && b == NULL)
74
if (a == NULL || b == NULL)
76
if (g_strv_length (a) != g_strv_length (b))
78
for (n = 0; a[n] != NULL; n++)
79
if (g_strcmp0 (a[n], b[n]) != 0)
87
_g_variant_equal0 (GVariant *a, GVariant *b)
90
if (a == NULL && b == NULL)
95
if (a == NULL || b == NULL)
97
ret = g_variant_equal (a, b);
102
G_GNUC_UNUSED static gboolean
103
_g_value_equal (const GValue *a, const GValue *b)
105
gboolean ret = FALSE;
106
g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
107
switch (G_VALUE_TYPE (a))
110
ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
113
ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
116
ret = (g_value_get_int (a) == g_value_get_int (b));
119
ret = (g_value_get_uint (a) == g_value_get_uint (b));
122
ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
125
ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
129
/* Avoid -Wfloat-equal warnings by doing a direct bit compare */
130
gdouble da = g_value_get_double (a);
131
gdouble db = g_value_get_double (b);
132
ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
136
ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
139
ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
142
if (G_VALUE_TYPE (a) == G_TYPE_STRV)
143
ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
145
g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
151
/* ------------------------------------------------------------------------
152
* Code for interface org.gnome.Mutter.IdleMonitor
153
* ------------------------------------------------------------------------
157
* SECTION:MetaDBusIdleMonitor
158
* @title: MetaDBusIdleMonitor
159
* @short_description: Generated C code for the org.gnome.Mutter.IdleMonitor D-Bus interface
161
* This section contains code for working with the <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link> D-Bus interface in C.
164
/* ---- Introspection data for org.gnome.Mutter.IdleMonitor ---- */
166
static const _ExtendedGDBusArgInfo _meta_dbus_idle_monitor_method_info_get_idletime_OUT_ARG_idletime =
170
(gchar *) "idletime",
177
static const _ExtendedGDBusArgInfo * const _meta_dbus_idle_monitor_method_info_get_idletime_OUT_ARG_pointers[] =
179
&_meta_dbus_idle_monitor_method_info_get_idletime_OUT_ARG_idletime,
183
static const _ExtendedGDBusMethodInfo _meta_dbus_idle_monitor_method_info_get_idletime =
187
(gchar *) "GetIdletime",
189
(GDBusArgInfo **) &_meta_dbus_idle_monitor_method_info_get_idletime_OUT_ARG_pointers,
192
"handle-get-idletime",
196
static const _ExtendedGDBusArgInfo _meta_dbus_idle_monitor_method_info_add_idle_watch_IN_ARG_interval =
200
(gchar *) "interval",
207
static const _ExtendedGDBusArgInfo * const _meta_dbus_idle_monitor_method_info_add_idle_watch_IN_ARG_pointers[] =
209
&_meta_dbus_idle_monitor_method_info_add_idle_watch_IN_ARG_interval,
213
static const _ExtendedGDBusArgInfo _meta_dbus_idle_monitor_method_info_add_idle_watch_OUT_ARG_id =
224
static const _ExtendedGDBusArgInfo * const _meta_dbus_idle_monitor_method_info_add_idle_watch_OUT_ARG_pointers[] =
226
&_meta_dbus_idle_monitor_method_info_add_idle_watch_OUT_ARG_id,
230
static const _ExtendedGDBusMethodInfo _meta_dbus_idle_monitor_method_info_add_idle_watch =
234
(gchar *) "AddIdleWatch",
235
(GDBusArgInfo **) &_meta_dbus_idle_monitor_method_info_add_idle_watch_IN_ARG_pointers,
236
(GDBusArgInfo **) &_meta_dbus_idle_monitor_method_info_add_idle_watch_OUT_ARG_pointers,
239
"handle-add-idle-watch",
243
static const _ExtendedGDBusArgInfo _meta_dbus_idle_monitor_method_info_add_user_active_watch_OUT_ARG_id =
254
static const _ExtendedGDBusArgInfo * const _meta_dbus_idle_monitor_method_info_add_user_active_watch_OUT_ARG_pointers[] =
256
&_meta_dbus_idle_monitor_method_info_add_user_active_watch_OUT_ARG_id,
260
static const _ExtendedGDBusMethodInfo _meta_dbus_idle_monitor_method_info_add_user_active_watch =
264
(gchar *) "AddUserActiveWatch",
266
(GDBusArgInfo **) &_meta_dbus_idle_monitor_method_info_add_user_active_watch_OUT_ARG_pointers,
269
"handle-add-user-active-watch",
273
static const _ExtendedGDBusArgInfo _meta_dbus_idle_monitor_method_info_remove_watch_IN_ARG_id =
284
static const _ExtendedGDBusArgInfo * const _meta_dbus_idle_monitor_method_info_remove_watch_IN_ARG_pointers[] =
286
&_meta_dbus_idle_monitor_method_info_remove_watch_IN_ARG_id,
290
static const _ExtendedGDBusMethodInfo _meta_dbus_idle_monitor_method_info_remove_watch =
294
(gchar *) "RemoveWatch",
295
(GDBusArgInfo **) &_meta_dbus_idle_monitor_method_info_remove_watch_IN_ARG_pointers,
299
"handle-remove-watch",
303
static const _ExtendedGDBusMethodInfo * const _meta_dbus_idle_monitor_method_info_pointers[] =
305
&_meta_dbus_idle_monitor_method_info_get_idletime,
306
&_meta_dbus_idle_monitor_method_info_add_idle_watch,
307
&_meta_dbus_idle_monitor_method_info_add_user_active_watch,
308
&_meta_dbus_idle_monitor_method_info_remove_watch,
312
static const _ExtendedGDBusArgInfo _meta_dbus_idle_monitor_signal_info_watch_fired_ARG_id =
323
static const _ExtendedGDBusArgInfo * const _meta_dbus_idle_monitor_signal_info_watch_fired_ARG_pointers[] =
325
&_meta_dbus_idle_monitor_signal_info_watch_fired_ARG_id,
329
static const _ExtendedGDBusSignalInfo _meta_dbus_idle_monitor_signal_info_watch_fired =
333
(gchar *) "WatchFired",
334
(GDBusArgInfo **) &_meta_dbus_idle_monitor_signal_info_watch_fired_ARG_pointers,
340
static const _ExtendedGDBusSignalInfo * const _meta_dbus_idle_monitor_signal_info_pointers[] =
342
&_meta_dbus_idle_monitor_signal_info_watch_fired,
346
static const _ExtendedGDBusInterfaceInfo _meta_dbus_idle_monitor_interface_info =
350
(gchar *) "org.gnome.Mutter.IdleMonitor",
351
(GDBusMethodInfo **) &_meta_dbus_idle_monitor_method_info_pointers,
352
(GDBusSignalInfo **) &_meta_dbus_idle_monitor_signal_info_pointers,
361
* meta_dbus_idle_monitor_interface_info:
363
* Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link> D-Bus interface.
365
* Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
368
meta_dbus_idle_monitor_interface_info (void)
370
return (GDBusInterfaceInfo *) &_meta_dbus_idle_monitor_interface_info.parent_struct;
374
* meta_dbus_idle_monitor_override_properties:
375
* @klass: The class structure for a #GObject<!-- -->-derived class.
376
* @property_id_begin: The property id to assign to the first overridden property.
378
* Overrides all #GObject properties in the #MetaDBusIdleMonitor interface for a concrete class.
379
* The properties are overridden in the order they are defined.
381
* Returns: The last property id.
384
meta_dbus_idle_monitor_override_properties (GObjectClass *klass, guint property_id_begin)
386
return property_id_begin - 1;
392
* MetaDBusIdleMonitor:
394
* Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link>.
398
* MetaDBusIdleMonitorIface:
399
* @parent_iface: The parent interface.
400
* @handle_add_idle_watch: Handler for the #MetaDBusIdleMonitor::handle-add-idle-watch signal.
401
* @handle_add_user_active_watch: Handler for the #MetaDBusIdleMonitor::handle-add-user-active-watch signal.
402
* @handle_get_idletime: Handler for the #MetaDBusIdleMonitor::handle-get-idletime signal.
403
* @handle_remove_watch: Handler for the #MetaDBusIdleMonitor::handle-remove-watch signal.
404
* @watch_fired: Handler for the #MetaDBusIdleMonitor::watch-fired signal.
406
* Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link>.
409
typedef MetaDBusIdleMonitorIface MetaDBusIdleMonitorInterface;
410
G_DEFINE_INTERFACE (MetaDBusIdleMonitor, meta_dbus_idle_monitor, G_TYPE_OBJECT);
413
meta_dbus_idle_monitor_default_init (MetaDBusIdleMonitorIface *iface)
415
/* GObject signals for incoming D-Bus method calls: */
417
* MetaDBusIdleMonitor::handle-get-idletime:
418
* @object: A #MetaDBusIdleMonitor.
419
* @invocation: A #GDBusMethodInvocation.
421
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.GetIdletime">GetIdletime()</link> D-Bus method.
423
* 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 meta_dbus_idle_monitor_complete_get_idletime() 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.
425
* Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
427
g_signal_new ("handle-get-idletime",
428
G_TYPE_FROM_INTERFACE (iface),
430
G_STRUCT_OFFSET (MetaDBusIdleMonitorIface, handle_get_idletime),
431
g_signal_accumulator_true_handled,
433
g_cclosure_marshal_generic,
436
G_TYPE_DBUS_METHOD_INVOCATION);
439
* MetaDBusIdleMonitor::handle-add-idle-watch:
440
* @object: A #MetaDBusIdleMonitor.
441
* @invocation: A #GDBusMethodInvocation.
442
* @arg_interval: Argument passed by remote caller.
444
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.AddIdleWatch">AddIdleWatch()</link> D-Bus method.
446
* 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 meta_dbus_idle_monitor_complete_add_idle_watch() 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.
448
* Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
450
g_signal_new ("handle-add-idle-watch",
451
G_TYPE_FROM_INTERFACE (iface),
453
G_STRUCT_OFFSET (MetaDBusIdleMonitorIface, handle_add_idle_watch),
454
g_signal_accumulator_true_handled,
456
g_cclosure_marshal_generic,
459
G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT64);
462
* MetaDBusIdleMonitor::handle-add-user-active-watch:
463
* @object: A #MetaDBusIdleMonitor.
464
* @invocation: A #GDBusMethodInvocation.
466
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.AddUserActiveWatch">AddUserActiveWatch()</link> D-Bus method.
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 meta_dbus_idle_monitor_complete_add_user_active_watch() 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.
470
* Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
472
g_signal_new ("handle-add-user-active-watch",
473
G_TYPE_FROM_INTERFACE (iface),
475
G_STRUCT_OFFSET (MetaDBusIdleMonitorIface, handle_add_user_active_watch),
476
g_signal_accumulator_true_handled,
478
g_cclosure_marshal_generic,
481
G_TYPE_DBUS_METHOD_INVOCATION);
484
* MetaDBusIdleMonitor::handle-remove-watch:
485
* @object: A #MetaDBusIdleMonitor.
486
* @invocation: A #GDBusMethodInvocation.
487
* @arg_id: Argument passed by remote caller.
489
* Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.RemoveWatch">RemoveWatch()</link> D-Bus method.
491
* 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 meta_dbus_idle_monitor_complete_remove_watch() 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.
493
* Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
495
g_signal_new ("handle-remove-watch",
496
G_TYPE_FROM_INTERFACE (iface),
498
G_STRUCT_OFFSET (MetaDBusIdleMonitorIface, handle_remove_watch),
499
g_signal_accumulator_true_handled,
501
g_cclosure_marshal_generic,
504
G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT);
506
/* GObject signals for received D-Bus signals: */
508
* MetaDBusIdleMonitor::watch-fired:
509
* @object: A #MetaDBusIdleMonitor.
512
* On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-gnome-Mutter-IdleMonitor.WatchFired">"WatchFired"</link> is received.
514
* 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.
516
g_signal_new ("watch-fired",
517
G_TYPE_FROM_INTERFACE (iface),
519
G_STRUCT_OFFSET (MetaDBusIdleMonitorIface, watch_fired),
522
g_cclosure_marshal_generic,
529
* meta_dbus_idle_monitor_emit_watch_fired:
530
* @object: A #MetaDBusIdleMonitor.
531
* @arg_id: Argument to pass with the signal.
533
* Emits the <link linkend="gdbus-signal-org-gnome-Mutter-IdleMonitor.WatchFired">"WatchFired"</link> D-Bus signal.
536
meta_dbus_idle_monitor_emit_watch_fired (
537
MetaDBusIdleMonitor *object,
540
g_signal_emit_by_name (object, "watch-fired", arg_id);
544
* meta_dbus_idle_monitor_call_get_idletime:
545
* @proxy: A #MetaDBusIdleMonitorProxy.
546
* @cancellable: (allow-none): A #GCancellable or %NULL.
547
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
548
* @user_data: User data to pass to @callback.
550
* Asynchronously invokes the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.GetIdletime">GetIdletime()</link> D-Bus method on @proxy.
551
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
552
* You can then call meta_dbus_idle_monitor_call_get_idletime_finish() to get the result of the operation.
554
* See meta_dbus_idle_monitor_call_get_idletime_sync() for the synchronous, blocking version of this method.
557
meta_dbus_idle_monitor_call_get_idletime (
558
MetaDBusIdleMonitor *proxy,
559
GCancellable *cancellable,
560
GAsyncReadyCallback callback,
563
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
565
g_variant_new ("()"),
566
G_DBUS_CALL_FLAGS_NONE,
574
* meta_dbus_idle_monitor_call_get_idletime_finish:
575
* @proxy: A #MetaDBusIdleMonitorProxy.
576
* @out_idletime: (out): Return location for return parameter or %NULL to ignore.
577
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to meta_dbus_idle_monitor_call_get_idletime().
578
* @error: Return location for error or %NULL.
580
* Finishes an operation started with meta_dbus_idle_monitor_call_get_idletime().
582
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
585
meta_dbus_idle_monitor_call_get_idletime_finish (
586
MetaDBusIdleMonitor *proxy,
587
guint64 *out_idletime,
592
_ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
598
g_variant_unref (_ret);
604
* meta_dbus_idle_monitor_call_get_idletime_sync:
605
* @proxy: A #MetaDBusIdleMonitorProxy.
606
* @out_idletime: (out): Return location for return parameter or %NULL to ignore.
607
* @cancellable: (allow-none): A #GCancellable or %NULL.
608
* @error: Return location for error or %NULL.
610
* Synchronously invokes the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.GetIdletime">GetIdletime()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
612
* See meta_dbus_idle_monitor_call_get_idletime() for the asynchronous version of this method.
614
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
617
meta_dbus_idle_monitor_call_get_idletime_sync (
618
MetaDBusIdleMonitor *proxy,
619
guint64 *out_idletime,
620
GCancellable *cancellable,
624
_ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
626
g_variant_new ("()"),
627
G_DBUS_CALL_FLAGS_NONE,
636
g_variant_unref (_ret);
642
* meta_dbus_idle_monitor_call_add_idle_watch:
643
* @proxy: A #MetaDBusIdleMonitorProxy.
644
* @arg_interval: Argument to pass with the method invocation.
645
* @cancellable: (allow-none): A #GCancellable or %NULL.
646
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
647
* @user_data: User data to pass to @callback.
649
* Asynchronously invokes the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.AddIdleWatch">AddIdleWatch()</link> D-Bus method on @proxy.
650
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
651
* You can then call meta_dbus_idle_monitor_call_add_idle_watch_finish() to get the result of the operation.
653
* See meta_dbus_idle_monitor_call_add_idle_watch_sync() for the synchronous, blocking version of this method.
656
meta_dbus_idle_monitor_call_add_idle_watch (
657
MetaDBusIdleMonitor *proxy,
658
guint64 arg_interval,
659
GCancellable *cancellable,
660
GAsyncReadyCallback callback,
663
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
665
g_variant_new ("(t)",
667
G_DBUS_CALL_FLAGS_NONE,
675
* meta_dbus_idle_monitor_call_add_idle_watch_finish:
676
* @proxy: A #MetaDBusIdleMonitorProxy.
677
* @out_id: (out): Return location for return parameter or %NULL to ignore.
678
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to meta_dbus_idle_monitor_call_add_idle_watch().
679
* @error: Return location for error or %NULL.
681
* Finishes an operation started with meta_dbus_idle_monitor_call_add_idle_watch().
683
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
686
meta_dbus_idle_monitor_call_add_idle_watch_finish (
687
MetaDBusIdleMonitor *proxy,
693
_ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
699
g_variant_unref (_ret);
705
* meta_dbus_idle_monitor_call_add_idle_watch_sync:
706
* @proxy: A #MetaDBusIdleMonitorProxy.
707
* @arg_interval: Argument to pass with the method invocation.
708
* @out_id: (out): Return location for return parameter or %NULL to ignore.
709
* @cancellable: (allow-none): A #GCancellable or %NULL.
710
* @error: Return location for error or %NULL.
712
* Synchronously invokes the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.AddIdleWatch">AddIdleWatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
714
* See meta_dbus_idle_monitor_call_add_idle_watch() for the asynchronous version of this method.
716
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
719
meta_dbus_idle_monitor_call_add_idle_watch_sync (
720
MetaDBusIdleMonitor *proxy,
721
guint64 arg_interval,
723
GCancellable *cancellable,
727
_ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
729
g_variant_new ("(t)",
731
G_DBUS_CALL_FLAGS_NONE,
740
g_variant_unref (_ret);
746
* meta_dbus_idle_monitor_call_add_user_active_watch:
747
* @proxy: A #MetaDBusIdleMonitorProxy.
748
* @cancellable: (allow-none): A #GCancellable or %NULL.
749
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
750
* @user_data: User data to pass to @callback.
752
* Asynchronously invokes the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.AddUserActiveWatch">AddUserActiveWatch()</link> D-Bus method on @proxy.
753
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
754
* You can then call meta_dbus_idle_monitor_call_add_user_active_watch_finish() to get the result of the operation.
756
* See meta_dbus_idle_monitor_call_add_user_active_watch_sync() for the synchronous, blocking version of this method.
759
meta_dbus_idle_monitor_call_add_user_active_watch (
760
MetaDBusIdleMonitor *proxy,
761
GCancellable *cancellable,
762
GAsyncReadyCallback callback,
765
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
766
"AddUserActiveWatch",
767
g_variant_new ("()"),
768
G_DBUS_CALL_FLAGS_NONE,
776
* meta_dbus_idle_monitor_call_add_user_active_watch_finish:
777
* @proxy: A #MetaDBusIdleMonitorProxy.
778
* @out_id: (out): Return location for return parameter or %NULL to ignore.
779
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to meta_dbus_idle_monitor_call_add_user_active_watch().
780
* @error: Return location for error or %NULL.
782
* Finishes an operation started with meta_dbus_idle_monitor_call_add_user_active_watch().
784
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
787
meta_dbus_idle_monitor_call_add_user_active_watch_finish (
788
MetaDBusIdleMonitor *proxy,
794
_ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
800
g_variant_unref (_ret);
806
* meta_dbus_idle_monitor_call_add_user_active_watch_sync:
807
* @proxy: A #MetaDBusIdleMonitorProxy.
808
* @out_id: (out): Return location for return parameter or %NULL to ignore.
809
* @cancellable: (allow-none): A #GCancellable or %NULL.
810
* @error: Return location for error or %NULL.
812
* Synchronously invokes the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.AddUserActiveWatch">AddUserActiveWatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
814
* See meta_dbus_idle_monitor_call_add_user_active_watch() for the asynchronous version of this method.
816
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
819
meta_dbus_idle_monitor_call_add_user_active_watch_sync (
820
MetaDBusIdleMonitor *proxy,
822
GCancellable *cancellable,
826
_ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
827
"AddUserActiveWatch",
828
g_variant_new ("()"),
829
G_DBUS_CALL_FLAGS_NONE,
838
g_variant_unref (_ret);
844
* meta_dbus_idle_monitor_call_remove_watch:
845
* @proxy: A #MetaDBusIdleMonitorProxy.
846
* @arg_id: Argument to pass with the method invocation.
847
* @cancellable: (allow-none): A #GCancellable or %NULL.
848
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
849
* @user_data: User data to pass to @callback.
851
* Asynchronously invokes the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.RemoveWatch">RemoveWatch()</link> D-Bus method on @proxy.
852
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
853
* You can then call meta_dbus_idle_monitor_call_remove_watch_finish() to get the result of the operation.
855
* See meta_dbus_idle_monitor_call_remove_watch_sync() for the synchronous, blocking version of this method.
858
meta_dbus_idle_monitor_call_remove_watch (
859
MetaDBusIdleMonitor *proxy,
861
GCancellable *cancellable,
862
GAsyncReadyCallback callback,
865
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
867
g_variant_new ("(u)",
869
G_DBUS_CALL_FLAGS_NONE,
877
* meta_dbus_idle_monitor_call_remove_watch_finish:
878
* @proxy: A #MetaDBusIdleMonitorProxy.
879
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to meta_dbus_idle_monitor_call_remove_watch().
880
* @error: Return location for error or %NULL.
882
* Finishes an operation started with meta_dbus_idle_monitor_call_remove_watch().
884
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
887
meta_dbus_idle_monitor_call_remove_watch_finish (
888
MetaDBusIdleMonitor *proxy,
893
_ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
898
g_variant_unref (_ret);
904
* meta_dbus_idle_monitor_call_remove_watch_sync:
905
* @proxy: A #MetaDBusIdleMonitorProxy.
906
* @arg_id: Argument to pass with the method invocation.
907
* @cancellable: (allow-none): A #GCancellable or %NULL.
908
* @error: Return location for error or %NULL.
910
* Synchronously invokes the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.RemoveWatch">RemoveWatch()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
912
* See meta_dbus_idle_monitor_call_remove_watch() for the asynchronous version of this method.
914
* Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
917
meta_dbus_idle_monitor_call_remove_watch_sync (
918
MetaDBusIdleMonitor *proxy,
920
GCancellable *cancellable,
924
_ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
926
g_variant_new ("(u)",
928
G_DBUS_CALL_FLAGS_NONE,
936
g_variant_unref (_ret);
942
* meta_dbus_idle_monitor_complete_get_idletime:
943
* @object: A #MetaDBusIdleMonitor.
944
* @invocation: (transfer full): A #GDBusMethodInvocation.
945
* @idletime: Parameter to return.
947
* Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.GetIdletime">GetIdletime()</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.
949
* This method will free @invocation, you cannot use it afterwards.
952
meta_dbus_idle_monitor_complete_get_idletime (
953
MetaDBusIdleMonitor *object,
954
GDBusMethodInvocation *invocation,
957
g_dbus_method_invocation_return_value (invocation,
958
g_variant_new ("(t)",
963
* meta_dbus_idle_monitor_complete_add_idle_watch:
964
* @object: A #MetaDBusIdleMonitor.
965
* @invocation: (transfer full): A #GDBusMethodInvocation.
966
* @id: Parameter to return.
968
* Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.AddIdleWatch">AddIdleWatch()</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.
970
* This method will free @invocation, you cannot use it afterwards.
973
meta_dbus_idle_monitor_complete_add_idle_watch (
974
MetaDBusIdleMonitor *object,
975
GDBusMethodInvocation *invocation,
978
g_dbus_method_invocation_return_value (invocation,
979
g_variant_new ("(u)",
984
* meta_dbus_idle_monitor_complete_add_user_active_watch:
985
* @object: A #MetaDBusIdleMonitor.
986
* @invocation: (transfer full): A #GDBusMethodInvocation.
987
* @id: Parameter to return.
989
* Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.AddUserActiveWatch">AddUserActiveWatch()</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.
991
* This method will free @invocation, you cannot use it afterwards.
994
meta_dbus_idle_monitor_complete_add_user_active_watch (
995
MetaDBusIdleMonitor *object,
996
GDBusMethodInvocation *invocation,
999
g_dbus_method_invocation_return_value (invocation,
1000
g_variant_new ("(u)",
1005
* meta_dbus_idle_monitor_complete_remove_watch:
1006
* @object: A #MetaDBusIdleMonitor.
1007
* @invocation: (transfer full): A #GDBusMethodInvocation.
1009
* Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-Mutter-IdleMonitor.RemoveWatch">RemoveWatch()</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.
1011
* This method will free @invocation, you cannot use it afterwards.
1014
meta_dbus_idle_monitor_complete_remove_watch (
1015
MetaDBusIdleMonitor *object,
1016
GDBusMethodInvocation *invocation)
1018
g_dbus_method_invocation_return_value (invocation,
1019
g_variant_new ("()"));
1022
/* ------------------------------------------------------------------------ */
1025
* MetaDBusIdleMonitorProxy:
1027
* The #MetaDBusIdleMonitorProxy structure contains only private data and should only be accessed using the provided API.
1031
* MetaDBusIdleMonitorProxyClass:
1032
* @parent_class: The parent class.
1034
* Class structure for #MetaDBusIdleMonitorProxy.
1037
struct _MetaDBusIdleMonitorProxyPrivate
1042
static void meta_dbus_idle_monitor_proxy_iface_init (MetaDBusIdleMonitorIface *iface);
1044
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1045
G_DEFINE_TYPE_WITH_CODE (MetaDBusIdleMonitorProxy, meta_dbus_idle_monitor_proxy, G_TYPE_DBUS_PROXY,
1046
G_ADD_PRIVATE (MetaDBusIdleMonitorProxy)
1047
G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_IDLE_MONITOR, meta_dbus_idle_monitor_proxy_iface_init));
1050
G_DEFINE_TYPE_WITH_CODE (MetaDBusIdleMonitorProxy, meta_dbus_idle_monitor_proxy, G_TYPE_DBUS_PROXY,
1051
G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_IDLE_MONITOR, meta_dbus_idle_monitor_proxy_iface_init));
1055
meta_dbus_idle_monitor_proxy_finalize (GObject *object)
1057
MetaDBusIdleMonitorProxy *proxy = META_DBUS_IDLE_MONITOR_PROXY (object);
1058
g_datalist_clear (&proxy->priv->qdata);
1059
G_OBJECT_CLASS (meta_dbus_idle_monitor_proxy_parent_class)->finalize (object);
1063
meta_dbus_idle_monitor_proxy_get_property (GObject *object,
1066
GParamSpec *pspec G_GNUC_UNUSED)
1071
meta_dbus_idle_monitor_proxy_set_property (GObject *object,
1073
const GValue *value,
1074
GParamSpec *pspec G_GNUC_UNUSED)
1079
meta_dbus_idle_monitor_proxy_g_signal (GDBusProxy *proxy,
1080
const gchar *sender_name G_GNUC_UNUSED,
1081
const gchar *signal_name,
1082
GVariant *parameters)
1084
_ExtendedGDBusSignalInfo *info;
1091
info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_meta_dbus_idle_monitor_interface_info.parent_struct, signal_name);
1094
num_params = g_variant_n_children (parameters);
1095
paramv = g_new0 (GValue, num_params + 1);
1096
g_value_init (¶mv[0], META_DBUS_TYPE_IDLE_MONITOR);
1097
g_value_set_object (¶mv[0], proxy);
1098
g_variant_iter_init (&iter, parameters);
1100
while ((child = g_variant_iter_next_value (&iter)) != NULL)
1102
_ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
1103
if (arg_info->use_gvariant)
1105
g_value_init (¶mv[n], G_TYPE_VARIANT);
1106
g_value_set_variant (¶mv[n], child);
1110
g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1111
g_variant_unref (child);
1113
signal_id = g_signal_lookup (info->signal_name, META_DBUS_TYPE_IDLE_MONITOR);
1114
g_signal_emitv (paramv, signal_id, 0, NULL);
1115
for (n = 0; n < num_params + 1; n++)
1116
g_value_unset (¶mv[n]);
1121
meta_dbus_idle_monitor_proxy_g_properties_changed (GDBusProxy *_proxy,
1122
GVariant *changed_properties,
1123
const gchar *const *invalidated_properties)
1125
MetaDBusIdleMonitorProxy *proxy = META_DBUS_IDLE_MONITOR_PROXY (_proxy);
1129
_ExtendedGDBusPropertyInfo *info;
1130
g_variant_get (changed_properties, "a{sv}", &iter);
1131
while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
1133
info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_meta_dbus_idle_monitor_interface_info.parent_struct, key);
1134
g_datalist_remove_data (&proxy->priv->qdata, key);
1136
g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1138
g_variant_iter_free (iter);
1139
for (n = 0; invalidated_properties[n] != NULL; n++)
1141
info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_meta_dbus_idle_monitor_interface_info.parent_struct, invalidated_properties[n]);
1142
g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
1144
g_object_notify (G_OBJECT (proxy), info->hyphen_name);
1149
meta_dbus_idle_monitor_proxy_init (MetaDBusIdleMonitorProxy *proxy)
1151
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1152
proxy->priv = meta_dbus_idle_monitor_proxy_get_instance_private (proxy);
1154
proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, META_DBUS_TYPE_IDLE_MONITOR_PROXY, MetaDBusIdleMonitorProxyPrivate);
1157
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), meta_dbus_idle_monitor_interface_info ());
1161
meta_dbus_idle_monitor_proxy_class_init (MetaDBusIdleMonitorProxyClass *klass)
1163
GObjectClass *gobject_class;
1164
GDBusProxyClass *proxy_class;
1166
gobject_class = G_OBJECT_CLASS (klass);
1167
gobject_class->finalize = meta_dbus_idle_monitor_proxy_finalize;
1168
gobject_class->get_property = meta_dbus_idle_monitor_proxy_get_property;
1169
gobject_class->set_property = meta_dbus_idle_monitor_proxy_set_property;
1171
proxy_class = G_DBUS_PROXY_CLASS (klass);
1172
proxy_class->g_signal = meta_dbus_idle_monitor_proxy_g_signal;
1173
proxy_class->g_properties_changed = meta_dbus_idle_monitor_proxy_g_properties_changed;
1175
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1176
g_type_class_add_private (klass, sizeof (MetaDBusIdleMonitorProxyPrivate));
1181
meta_dbus_idle_monitor_proxy_iface_init (MetaDBusIdleMonitorIface *iface)
1186
* meta_dbus_idle_monitor_proxy_new:
1187
* @connection: A #GDBusConnection.
1188
* @flags: Flags from the #GDBusProxyFlags enumeration.
1189
* @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1190
* @object_path: An object path.
1191
* @cancellable: (allow-none): A #GCancellable or %NULL.
1192
* @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1193
* @user_data: User data to pass to @callback.
1195
* Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link>. See g_dbus_proxy_new() for more details.
1197
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1198
* You can then call meta_dbus_idle_monitor_proxy_new_finish() to get the result of the operation.
1200
* See meta_dbus_idle_monitor_proxy_new_sync() for the synchronous, blocking version of this constructor.
1203
meta_dbus_idle_monitor_proxy_new (
1204
GDBusConnection *connection,
1205
GDBusProxyFlags flags,
1207
const gchar *object_path,
1208
GCancellable *cancellable,
1209
GAsyncReadyCallback callback,
1212
g_async_initable_new_async (META_DBUS_TYPE_IDLE_MONITOR_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.Mutter.IdleMonitor", NULL);
1216
* meta_dbus_idle_monitor_proxy_new_finish:
1217
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to meta_dbus_idle_monitor_proxy_new().
1218
* @error: Return location for error or %NULL
1220
* Finishes an operation started with meta_dbus_idle_monitor_proxy_new().
1222
* Returns: (transfer full) (type MetaDBusIdleMonitorProxy): The constructed proxy object or %NULL if @error is set.
1224
MetaDBusIdleMonitor *
1225
meta_dbus_idle_monitor_proxy_new_finish (
1230
GObject *source_object;
1231
source_object = g_async_result_get_source_object (res);
1232
ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1233
g_object_unref (source_object);
1235
return META_DBUS_IDLE_MONITOR (ret);
1241
* meta_dbus_idle_monitor_proxy_new_sync:
1242
* @connection: A #GDBusConnection.
1243
* @flags: Flags from the #GDBusProxyFlags enumeration.
1244
* @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1245
* @object_path: An object path.
1246
* @cancellable: (allow-none): A #GCancellable or %NULL.
1247
* @error: Return location for error or %NULL
1249
* Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link>. See g_dbus_proxy_new_sync() for more details.
1251
* The calling thread is blocked until a reply is received.
1253
* See meta_dbus_idle_monitor_proxy_new() for the asynchronous version of this constructor.
1255
* Returns: (transfer full) (type MetaDBusIdleMonitorProxy): The constructed proxy object or %NULL if @error is set.
1257
MetaDBusIdleMonitor *
1258
meta_dbus_idle_monitor_proxy_new_sync (
1259
GDBusConnection *connection,
1260
GDBusProxyFlags flags,
1262
const gchar *object_path,
1263
GCancellable *cancellable,
1267
ret = g_initable_new (META_DBUS_TYPE_IDLE_MONITOR_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.Mutter.IdleMonitor", NULL);
1269
return META_DBUS_IDLE_MONITOR (ret);
1276
* meta_dbus_idle_monitor_proxy_new_for_bus:
1277
* @bus_type: A #GBusType.
1278
* @flags: Flags from the #GDBusProxyFlags enumeration.
1279
* @name: A bus name (well-known or unique).
1280
* @object_path: An object path.
1281
* @cancellable: (allow-none): A #GCancellable or %NULL.
1282
* @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1283
* @user_data: User data to pass to @callback.
1285
* Like meta_dbus_idle_monitor_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1287
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1288
* You can then call meta_dbus_idle_monitor_proxy_new_for_bus_finish() to get the result of the operation.
1290
* See meta_dbus_idle_monitor_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1293
meta_dbus_idle_monitor_proxy_new_for_bus (
1295
GDBusProxyFlags flags,
1297
const gchar *object_path,
1298
GCancellable *cancellable,
1299
GAsyncReadyCallback callback,
1302
g_async_initable_new_async (META_DBUS_TYPE_IDLE_MONITOR_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.Mutter.IdleMonitor", NULL);
1306
* meta_dbus_idle_monitor_proxy_new_for_bus_finish:
1307
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to meta_dbus_idle_monitor_proxy_new_for_bus().
1308
* @error: Return location for error or %NULL
1310
* Finishes an operation started with meta_dbus_idle_monitor_proxy_new_for_bus().
1312
* Returns: (transfer full) (type MetaDBusIdleMonitorProxy): The constructed proxy object or %NULL if @error is set.
1314
MetaDBusIdleMonitor *
1315
meta_dbus_idle_monitor_proxy_new_for_bus_finish (
1320
GObject *source_object;
1321
source_object = g_async_result_get_source_object (res);
1322
ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1323
g_object_unref (source_object);
1325
return META_DBUS_IDLE_MONITOR (ret);
1331
* meta_dbus_idle_monitor_proxy_new_for_bus_sync:
1332
* @bus_type: A #GBusType.
1333
* @flags: Flags from the #GDBusProxyFlags enumeration.
1334
* @name: A bus name (well-known or unique).
1335
* @object_path: An object path.
1336
* @cancellable: (allow-none): A #GCancellable or %NULL.
1337
* @error: Return location for error or %NULL
1339
* Like meta_dbus_idle_monitor_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1341
* The calling thread is blocked until a reply is received.
1343
* See meta_dbus_idle_monitor_proxy_new_for_bus() for the asynchronous version of this constructor.
1345
* Returns: (transfer full) (type MetaDBusIdleMonitorProxy): The constructed proxy object or %NULL if @error is set.
1347
MetaDBusIdleMonitor *
1348
meta_dbus_idle_monitor_proxy_new_for_bus_sync (
1350
GDBusProxyFlags flags,
1352
const gchar *object_path,
1353
GCancellable *cancellable,
1357
ret = g_initable_new (META_DBUS_TYPE_IDLE_MONITOR_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.Mutter.IdleMonitor", NULL);
1359
return META_DBUS_IDLE_MONITOR (ret);
1365
/* ------------------------------------------------------------------------ */
1368
* MetaDBusIdleMonitorSkeleton:
1370
* The #MetaDBusIdleMonitorSkeleton structure contains only private data and should only be accessed using the provided API.
1374
* MetaDBusIdleMonitorSkeletonClass:
1375
* @parent_class: The parent class.
1377
* Class structure for #MetaDBusIdleMonitorSkeleton.
1380
struct _MetaDBusIdleMonitorSkeletonPrivate
1383
GList *changed_properties;
1384
GSource *changed_properties_idle_source;
1385
GMainContext *context;
1390
_meta_dbus_idle_monitor_skeleton_handle_method_call (
1391
GDBusConnection *connection G_GNUC_UNUSED,
1392
const gchar *sender G_GNUC_UNUSED,
1393
const gchar *object_path G_GNUC_UNUSED,
1394
const gchar *interface_name,
1395
const gchar *method_name,
1396
GVariant *parameters,
1397
GDBusMethodInvocation *invocation,
1400
MetaDBusIdleMonitorSkeleton *skeleton = META_DBUS_IDLE_MONITOR_SKELETON (user_data);
1401
_ExtendedGDBusMethodInfo *info;
1409
GValue return_value = G_VALUE_INIT;
1410
info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1411
g_assert (info != NULL);
1412
num_params = g_variant_n_children (parameters);
1413
num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
1415
g_value_init (¶mv[n], META_DBUS_TYPE_IDLE_MONITOR);
1416
g_value_set_object (¶mv[n++], skeleton);
1417
g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1418
g_value_set_object (¶mv[n++], invocation);
1419
if (info->pass_fdlist)
1422
g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
1423
g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1425
g_assert_not_reached ();
1428
g_variant_iter_init (&iter, parameters);
1429
while ((child = g_variant_iter_next_value (&iter)) != NULL)
1431
_ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1432
if (arg_info->use_gvariant)
1434
g_value_init (¶mv[n], G_TYPE_VARIANT);
1435
g_value_set_variant (¶mv[n], child);
1439
g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
1440
g_variant_unref (child);
1442
signal_id = g_signal_lookup (info->signal_name, META_DBUS_TYPE_IDLE_MONITOR);
1443
g_value_init (&return_value, G_TYPE_BOOLEAN);
1444
g_signal_emitv (paramv, signal_id, 0, &return_value);
1445
if (!g_value_get_boolean (&return_value))
1446
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);
1447
g_value_unset (&return_value);
1448
for (n = 0; n < num_params + num_extra; n++)
1449
g_value_unset (¶mv[n]);
1454
_meta_dbus_idle_monitor_skeleton_handle_get_property (
1455
GDBusConnection *connection G_GNUC_UNUSED,
1456
const gchar *sender G_GNUC_UNUSED,
1457
const gchar *object_path G_GNUC_UNUSED,
1458
const gchar *interface_name G_GNUC_UNUSED,
1459
const gchar *property_name,
1463
MetaDBusIdleMonitorSkeleton *skeleton = META_DBUS_IDLE_MONITOR_SKELETON (user_data);
1464
GValue value = G_VALUE_INIT;
1466
_ExtendedGDBusPropertyInfo *info;
1469
info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_meta_dbus_idle_monitor_interface_info.parent_struct, property_name);
1470
g_assert (info != NULL);
1471
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1474
g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1478
g_value_init (&value, pspec->value_type);
1479
g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1480
ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
1481
g_value_unset (&value);
1487
_meta_dbus_idle_monitor_skeleton_handle_set_property (
1488
GDBusConnection *connection G_GNUC_UNUSED,
1489
const gchar *sender G_GNUC_UNUSED,
1490
const gchar *object_path G_GNUC_UNUSED,
1491
const gchar *interface_name G_GNUC_UNUSED,
1492
const gchar *property_name,
1497
MetaDBusIdleMonitorSkeleton *skeleton = META_DBUS_IDLE_MONITOR_SKELETON (user_data);
1498
GValue value = G_VALUE_INIT;
1500
_ExtendedGDBusPropertyInfo *info;
1503
info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_meta_dbus_idle_monitor_interface_info.parent_struct, property_name);
1504
g_assert (info != NULL);
1505
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1508
g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1512
if (info->use_gvariant)
1513
g_value_set_variant (&value, variant);
1515
g_dbus_gvariant_to_gvalue (variant, &value);
1516
g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1517
g_value_unset (&value);
1523
static const GDBusInterfaceVTable _meta_dbus_idle_monitor_skeleton_vtable =
1525
_meta_dbus_idle_monitor_skeleton_handle_method_call,
1526
_meta_dbus_idle_monitor_skeleton_handle_get_property,
1527
_meta_dbus_idle_monitor_skeleton_handle_set_property,
1531
static GDBusInterfaceInfo *
1532
meta_dbus_idle_monitor_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1534
return meta_dbus_idle_monitor_interface_info ();
1537
static GDBusInterfaceVTable *
1538
meta_dbus_idle_monitor_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
1540
return (GDBusInterfaceVTable *) &_meta_dbus_idle_monitor_skeleton_vtable;
1544
meta_dbus_idle_monitor_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1546
MetaDBusIdleMonitorSkeleton *skeleton = META_DBUS_IDLE_MONITOR_SKELETON (_skeleton);
1548
GVariantBuilder builder;
1550
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1551
if (_meta_dbus_idle_monitor_interface_info.parent_struct.properties == NULL)
1553
for (n = 0; _meta_dbus_idle_monitor_interface_info.parent_struct.properties[n] != NULL; n++)
1555
GDBusPropertyInfo *info = _meta_dbus_idle_monitor_interface_info.parent_struct.properties[n];
1556
if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1559
value = _meta_dbus_idle_monitor_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.Mutter.IdleMonitor", info->name, NULL, skeleton);
1562
g_variant_take_ref (value);
1563
g_variant_builder_add (&builder, "{sv}", info->name, value);
1564
g_variant_unref (value);
1569
return g_variant_builder_end (&builder);
1573
meta_dbus_idle_monitor_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1578
_meta_dbus_idle_monitor_on_signal_watch_fired (
1579
MetaDBusIdleMonitor *object,
1582
MetaDBusIdleMonitorSkeleton *skeleton = META_DBUS_IDLE_MONITOR_SKELETON (object);
1584
GList *connections, *l;
1585
GVariant *signal_variant;
1586
connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
1588
signal_variant = g_variant_ref_sink (g_variant_new ("(u)",
1590
for (l = connections; l != NULL; l = l->next)
1592
GDBusConnection *connection = l->data;
1593
g_dbus_connection_emit_signal (connection,
1594
NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.gnome.Mutter.IdleMonitor", "WatchFired",
1595
signal_variant, NULL);
1597
g_variant_unref (signal_variant);
1598
g_list_free_full (connections, g_object_unref);
1601
static void meta_dbus_idle_monitor_skeleton_iface_init (MetaDBusIdleMonitorIface *iface);
1602
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1603
G_DEFINE_TYPE_WITH_CODE (MetaDBusIdleMonitorSkeleton, meta_dbus_idle_monitor_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1604
G_ADD_PRIVATE (MetaDBusIdleMonitorSkeleton)
1605
G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_IDLE_MONITOR, meta_dbus_idle_monitor_skeleton_iface_init));
1608
G_DEFINE_TYPE_WITH_CODE (MetaDBusIdleMonitorSkeleton, meta_dbus_idle_monitor_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1609
G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_IDLE_MONITOR, meta_dbus_idle_monitor_skeleton_iface_init));
1613
meta_dbus_idle_monitor_skeleton_finalize (GObject *object)
1615
MetaDBusIdleMonitorSkeleton *skeleton = META_DBUS_IDLE_MONITOR_SKELETON (object);
1616
g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1617
if (skeleton->priv->changed_properties_idle_source != NULL)
1618
g_source_destroy (skeleton->priv->changed_properties_idle_source);
1619
g_main_context_unref (skeleton->priv->context);
1620
g_mutex_clear (&skeleton->priv->lock);
1621
G_OBJECT_CLASS (meta_dbus_idle_monitor_skeleton_parent_class)->finalize (object);
1625
meta_dbus_idle_monitor_skeleton_init (MetaDBusIdleMonitorSkeleton *skeleton)
1627
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
1628
skeleton->priv = meta_dbus_idle_monitor_skeleton_get_instance_private (skeleton);
1630
skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, META_DBUS_TYPE_IDLE_MONITOR_SKELETON, MetaDBusIdleMonitorSkeletonPrivate);
1633
g_mutex_init (&skeleton->priv->lock);
1634
skeleton->priv->context = g_main_context_ref_thread_default ();
1638
meta_dbus_idle_monitor_skeleton_class_init (MetaDBusIdleMonitorSkeletonClass *klass)
1640
GObjectClass *gobject_class;
1641
GDBusInterfaceSkeletonClass *skeleton_class;
1643
gobject_class = G_OBJECT_CLASS (klass);
1644
gobject_class->finalize = meta_dbus_idle_monitor_skeleton_finalize;
1646
skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1647
skeleton_class->get_info = meta_dbus_idle_monitor_skeleton_dbus_interface_get_info;
1648
skeleton_class->get_properties = meta_dbus_idle_monitor_skeleton_dbus_interface_get_properties;
1649
skeleton_class->flush = meta_dbus_idle_monitor_skeleton_dbus_interface_flush;
1650
skeleton_class->get_vtable = meta_dbus_idle_monitor_skeleton_dbus_interface_get_vtable;
1652
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
1653
g_type_class_add_private (klass, sizeof (MetaDBusIdleMonitorSkeletonPrivate));
1658
meta_dbus_idle_monitor_skeleton_iface_init (MetaDBusIdleMonitorIface *iface)
1660
iface->watch_fired = _meta_dbus_idle_monitor_on_signal_watch_fired;
1664
* meta_dbus_idle_monitor_skeleton_new:
1666
* Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link>.
1668
* Returns: (transfer full) (type MetaDBusIdleMonitorSkeleton): The skeleton object.
1670
MetaDBusIdleMonitor *
1671
meta_dbus_idle_monitor_skeleton_new (void)
1673
return META_DBUS_IDLE_MONITOR (g_object_new (META_DBUS_TYPE_IDLE_MONITOR_SKELETON, NULL));
1676
/* ------------------------------------------------------------------------
1677
* Code for Object, ObjectProxy and ObjectSkeleton
1678
* ------------------------------------------------------------------------
1682
* SECTION:MetaDBusObject
1683
* @title: MetaDBusObject
1684
* @short_description: Specialized GDBusObject types
1686
* This section contains the #MetaDBusObject, #MetaDBusObjectProxy, and #MetaDBusObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
1692
* The #MetaDBusObject type is a specialized container of interfaces.
1696
* MetaDBusObjectIface:
1697
* @parent_iface: The parent interface.
1699
* Virtual table for the #MetaDBusObject interface.
1702
typedef MetaDBusObjectIface MetaDBusObjectInterface;
1703
G_DEFINE_INTERFACE_WITH_CODE (MetaDBusObject, meta_dbus_object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
1706
meta_dbus_object_default_init (MetaDBusObjectIface *iface)
1709
* MetaDBusObject:idle-monitor:
1711
* The #MetaDBusIdleMonitor instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link>, if any.
1713
* Connect to the #GObject::notify signal to get informed of property changes.
1715
g_object_interface_install_property (iface, g_param_spec_object ("idle-monitor", "idle-monitor", "idle-monitor", META_DBUS_TYPE_IDLE_MONITOR, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
1720
* meta_dbus_object_get_idle_monitor:
1721
* @object: A #MetaDBusObject.
1723
* Gets the #MetaDBusIdleMonitor instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link> on @object, if any.
1725
* Returns: (transfer full): A #MetaDBusIdleMonitor that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
1727
MetaDBusIdleMonitor *meta_dbus_object_get_idle_monitor (MetaDBusObject *object)
1729
GDBusInterface *ret;
1730
ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Mutter.IdleMonitor");
1733
return META_DBUS_IDLE_MONITOR (ret);
1738
* meta_dbus_object_peek_idle_monitor: (skip)
1739
* @object: A #MetaDBusObject.
1741
* Like meta_dbus_object_get_idle_monitor() but doesn't increase the reference count on the returned object.
1743
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
1745
* Returns: (transfer none): A #MetaDBusIdleMonitor or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
1747
MetaDBusIdleMonitor *meta_dbus_object_peek_idle_monitor (MetaDBusObject *object)
1749
GDBusInterface *ret;
1750
ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Mutter.IdleMonitor");
1753
g_object_unref (ret);
1754
return META_DBUS_IDLE_MONITOR (ret);
1759
meta_dbus_object_notify (GDBusObject *object, GDBusInterface *interface)
1761
_ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
1762
/* info can be NULL if the other end is using a D-Bus interface we don't know
1763
* anything about, for example old generated code in this process talking to
1764
* newer generated code in the other process. */
1766
g_object_notify (G_OBJECT (object), info->hyphen_name);
1770
* MetaDBusObjectProxy:
1772
* The #MetaDBusObjectProxy structure contains only private data and should only be accessed using the provided API.
1776
* MetaDBusObjectProxyClass:
1777
* @parent_class: The parent class.
1779
* Class structure for #MetaDBusObjectProxy.
1783
meta_dbus_object_proxy__meta_dbus_object_iface_init (MetaDBusObjectIface *iface G_GNUC_UNUSED)
1788
meta_dbus_object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
1790
iface->interface_added = meta_dbus_object_notify;
1791
iface->interface_removed = meta_dbus_object_notify;
1795
G_DEFINE_TYPE_WITH_CODE (MetaDBusObjectProxy, meta_dbus_object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
1796
G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_OBJECT, meta_dbus_object_proxy__meta_dbus_object_iface_init)
1797
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, meta_dbus_object_proxy__g_dbus_object_iface_init));
1800
meta_dbus_object_proxy_init (MetaDBusObjectProxy *object G_GNUC_UNUSED)
1805
meta_dbus_object_proxy_set_property (GObject *gobject,
1807
const GValue *value G_GNUC_UNUSED,
1810
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
1814
meta_dbus_object_proxy_get_property (GObject *gobject,
1819
MetaDBusObjectProxy *object = META_DBUS_OBJECT_PROXY (gobject);
1820
GDBusInterface *interface;
1825
interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Mutter.IdleMonitor");
1826
g_value_take_object (value, interface);
1830
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
1836
meta_dbus_object_proxy_class_init (MetaDBusObjectProxyClass *klass)
1838
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
1840
gobject_class->set_property = meta_dbus_object_proxy_set_property;
1841
gobject_class->get_property = meta_dbus_object_proxy_get_property;
1843
g_object_class_override_property (gobject_class, 1, "idle-monitor");
1847
* meta_dbus_object_proxy_new:
1848
* @connection: A #GDBusConnection.
1849
* @object_path: An object path.
1851
* Creates a new proxy object.
1853
* Returns: (transfer full): The proxy object.
1855
MetaDBusObjectProxy *
1856
meta_dbus_object_proxy_new (GDBusConnection *connection,
1857
const gchar *object_path)
1859
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
1860
g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
1861
return META_DBUS_OBJECT_PROXY (g_object_new (META_DBUS_TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
1865
* MetaDBusObjectSkeleton:
1867
* The #MetaDBusObjectSkeleton structure contains only private data and should only be accessed using the provided API.
1871
* MetaDBusObjectSkeletonClass:
1872
* @parent_class: The parent class.
1874
* Class structure for #MetaDBusObjectSkeleton.
1878
meta_dbus_object_skeleton__meta_dbus_object_iface_init (MetaDBusObjectIface *iface G_GNUC_UNUSED)
1884
meta_dbus_object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
1886
iface->interface_added = meta_dbus_object_notify;
1887
iface->interface_removed = meta_dbus_object_notify;
1890
G_DEFINE_TYPE_WITH_CODE (MetaDBusObjectSkeleton, meta_dbus_object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
1891
G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_OBJECT, meta_dbus_object_skeleton__meta_dbus_object_iface_init)
1892
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, meta_dbus_object_skeleton__g_dbus_object_iface_init));
1895
meta_dbus_object_skeleton_init (MetaDBusObjectSkeleton *object G_GNUC_UNUSED)
1900
meta_dbus_object_skeleton_set_property (GObject *gobject,
1902
const GValue *value,
1905
MetaDBusObjectSkeleton *object = META_DBUS_OBJECT_SKELETON (gobject);
1906
GDBusInterfaceSkeleton *interface;
1911
interface = g_value_get_object (value);
1912
if (interface != NULL)
1914
g_warn_if_fail (META_DBUS_IS_IDLE_MONITOR (interface));
1915
g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
1919
g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.gnome.Mutter.IdleMonitor");
1924
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
1930
meta_dbus_object_skeleton_get_property (GObject *gobject,
1935
MetaDBusObjectSkeleton *object = META_DBUS_OBJECT_SKELETON (gobject);
1936
GDBusInterface *interface;
1941
interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.Mutter.IdleMonitor");
1942
g_value_take_object (value, interface);
1946
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
1952
meta_dbus_object_skeleton_class_init (MetaDBusObjectSkeletonClass *klass)
1954
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
1956
gobject_class->set_property = meta_dbus_object_skeleton_set_property;
1957
gobject_class->get_property = meta_dbus_object_skeleton_get_property;
1959
g_object_class_override_property (gobject_class, 1, "idle-monitor");
1963
* meta_dbus_object_skeleton_new:
1964
* @object_path: An object path.
1966
* Creates a new skeleton object.
1968
* Returns: (transfer full): The skeleton object.
1970
MetaDBusObjectSkeleton *
1971
meta_dbus_object_skeleton_new (const gchar *object_path)
1973
g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
1974
return META_DBUS_OBJECT_SKELETON (g_object_new (META_DBUS_TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
1978
* meta_dbus_object_skeleton_set_idle_monitor:
1979
* @object: A #MetaDBusObjectSkeleton.
1980
* @interface_: (allow-none): A #MetaDBusIdleMonitor or %NULL to clear the interface.
1982
* Sets the #MetaDBusIdleMonitor instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-Mutter-IdleMonitor.top_of_page">org.gnome.Mutter.IdleMonitor</link> on @object.
1984
void meta_dbus_object_skeleton_set_idle_monitor (MetaDBusObjectSkeleton *object, MetaDBusIdleMonitor *interface_)
1986
g_object_set (G_OBJECT (object), "idle-monitor", interface_, NULL);
1990
/* ------------------------------------------------------------------------
1991
* Code for ObjectManager client
1992
* ------------------------------------------------------------------------
1996
* SECTION:MetaDBusObjectManagerClient
1997
* @title: MetaDBusObjectManagerClient
1998
* @short_description: Generated GDBusObjectManagerClient type
2000
* This section contains a #GDBusObjectManagerClient that uses meta_dbus_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
2004
* MetaDBusObjectManagerClient:
2006
* The #MetaDBusObjectManagerClient structure contains only private data and should only be accessed using the provided API.
2010
* MetaDBusObjectManagerClientClass:
2011
* @parent_class: The parent class.
2013
* Class structure for #MetaDBusObjectManagerClient.
2016
G_DEFINE_TYPE (MetaDBusObjectManagerClient, meta_dbus_object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
2019
meta_dbus_object_manager_client_init (MetaDBusObjectManagerClient *manager G_GNUC_UNUSED)
2024
meta_dbus_object_manager_client_class_init (MetaDBusObjectManagerClientClass *klass G_GNUC_UNUSED)
2029
* meta_dbus_object_manager_client_get_proxy_type:
2030
* @manager: A #GDBusObjectManagerClient.
2031
* @object_path: The object path of the remote object (unused).
2032
* @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
2033
* @user_data: User data (unused).
2035
* A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
2037
* Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #MetaDBusObjectProxy.
2040
meta_dbus_object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
2042
static gsize once_init_value = 0;
2043
static GHashTable *lookup_hash;
2046
if (interface_name == NULL)
2047
return META_DBUS_TYPE_OBJECT_PROXY;
2048
if (g_once_init_enter (&once_init_value))
2050
lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
2051
g_hash_table_insert (lookup_hash, (gpointer) "org.gnome.Mutter.IdleMonitor", GSIZE_TO_POINTER (META_DBUS_TYPE_IDLE_MONITOR_PROXY));
2052
g_once_init_leave (&once_init_value, 1);
2054
ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
2055
if (ret == (GType) 0)
2056
ret = G_TYPE_DBUS_PROXY;
2061
* meta_dbus_object_manager_client_new:
2062
* @connection: A #GDBusConnection.
2063
* @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
2064
* @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2065
* @object_path: An object path.
2066
* @cancellable: (allow-none): A #GCancellable or %NULL.
2067
* @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2068
* @user_data: User data to pass to @callback.
2070
* Asynchronously creates #GDBusObjectManagerClient using meta_dbus_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
2072
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
2073
* You can then call meta_dbus_object_manager_client_new_finish() to get the result of the operation.
2075
* See meta_dbus_object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
2078
meta_dbus_object_manager_client_new (
2079
GDBusConnection *connection,
2080
GDBusObjectManagerClientFlags flags,
2082
const gchar *object_path,
2083
GCancellable *cancellable,
2084
GAsyncReadyCallback callback,
2087
g_async_initable_new_async (META_DBUS_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", meta_dbus_object_manager_client_get_proxy_type, NULL);
2091
* meta_dbus_object_manager_client_new_finish:
2092
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to meta_dbus_object_manager_client_new().
2093
* @error: Return location for error or %NULL
2095
* Finishes an operation started with meta_dbus_object_manager_client_new().
2097
* Returns: (transfer full) (type MetaDBusObjectManagerClient): The constructed object manager client or %NULL if @error is set.
2099
GDBusObjectManager *
2100
meta_dbus_object_manager_client_new_finish (
2105
GObject *source_object;
2106
source_object = g_async_result_get_source_object (res);
2107
ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2108
g_object_unref (source_object);
2110
return G_DBUS_OBJECT_MANAGER (ret);
2116
* meta_dbus_object_manager_client_new_sync:
2117
* @connection: A #GDBusConnection.
2118
* @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
2119
* @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
2120
* @object_path: An object path.
2121
* @cancellable: (allow-none): A #GCancellable or %NULL.
2122
* @error: Return location for error or %NULL
2124
* Synchronously creates #GDBusObjectManagerClient using meta_dbus_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
2126
* The calling thread is blocked until a reply is received.
2128
* See meta_dbus_object_manager_client_new() for the asynchronous version of this constructor.
2130
* Returns: (transfer full) (type MetaDBusObjectManagerClient): The constructed object manager client or %NULL if @error is set.
2132
GDBusObjectManager *
2133
meta_dbus_object_manager_client_new_sync (
2134
GDBusConnection *connection,
2135
GDBusObjectManagerClientFlags flags,
2137
const gchar *object_path,
2138
GCancellable *cancellable,
2142
ret = g_initable_new (META_DBUS_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", meta_dbus_object_manager_client_get_proxy_type, NULL);
2144
return G_DBUS_OBJECT_MANAGER (ret);
2151
* meta_dbus_object_manager_client_new_for_bus:
2152
* @bus_type: A #GBusType.
2153
* @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
2154
* @name: A bus name (well-known or unique).
2155
* @object_path: An object path.
2156
* @cancellable: (allow-none): A #GCancellable or %NULL.
2157
* @callback: A #GAsyncReadyCallback to call when the request is satisfied.
2158
* @user_data: User data to pass to @callback.
2160
* Like meta_dbus_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
2162
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
2163
* You can then call meta_dbus_object_manager_client_new_for_bus_finish() to get the result of the operation.
2165
* See meta_dbus_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
2168
meta_dbus_object_manager_client_new_for_bus (
2170
GDBusObjectManagerClientFlags flags,
2172
const gchar *object_path,
2173
GCancellable *cancellable,
2174
GAsyncReadyCallback callback,
2177
g_async_initable_new_async (META_DBUS_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", meta_dbus_object_manager_client_get_proxy_type, NULL);
2181
* meta_dbus_object_manager_client_new_for_bus_finish:
2182
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to meta_dbus_object_manager_client_new_for_bus().
2183
* @error: Return location for error or %NULL
2185
* Finishes an operation started with meta_dbus_object_manager_client_new_for_bus().
2187
* Returns: (transfer full) (type MetaDBusObjectManagerClient): The constructed object manager client or %NULL if @error is set.
2189
GDBusObjectManager *
2190
meta_dbus_object_manager_client_new_for_bus_finish (
2195
GObject *source_object;
2196
source_object = g_async_result_get_source_object (res);
2197
ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
2198
g_object_unref (source_object);
2200
return G_DBUS_OBJECT_MANAGER (ret);
2206
* meta_dbus_object_manager_client_new_for_bus_sync:
2207
* @bus_type: A #GBusType.
2208
* @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
2209
* @name: A bus name (well-known or unique).
2210
* @object_path: An object path.
2211
* @cancellable: (allow-none): A #GCancellable or %NULL.
2212
* @error: Return location for error or %NULL
2214
* Like meta_dbus_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
2216
* The calling thread is blocked until a reply is received.
2218
* See meta_dbus_object_manager_client_new_for_bus() for the asynchronous version of this constructor.
2220
* Returns: (transfer full) (type MetaDBusObjectManagerClient): The constructed object manager client or %NULL if @error is set.
2222
GDBusObjectManager *
2223
meta_dbus_object_manager_client_new_for_bus_sync (
2225
GDBusObjectManagerClientFlags flags,
2227
const gchar *object_path,
2228
GCancellable *cancellable,
2232
ret = g_initable_new (META_DBUS_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", meta_dbus_object_manager_client_get_proxy_type, NULL);
2234
return G_DBUS_OBJECT_MANAGER (ret);