Back to index

indicator-session  12.10.0
dbus-consolekit-seat.c
Go to the documentation of this file.
00001 /*
00002  * Generated by gdbus-codegen 2.33.3. DO NOT EDIT.
00003  *
00004  * The license of this code is the same as for the source it was derived from.
00005  */
00006 
00007 #ifdef HAVE_CONFIG_H
00008 #  include "config.h"
00009 #endif
00010 
00011 #include "dbus-consolekit-seat.h"
00012 
00013 #include <string.h>
00014 #ifdef G_OS_UNIX
00015 #  include <gio/gunixfdlist.h>
00016 #endif
00017 
00018 typedef struct
00019 {
00020   GDBusArgInfo parent_struct;
00021   gboolean use_gvariant;
00022 } _ExtendedGDBusArgInfo;
00023 
00024 typedef struct
00025 {
00026   GDBusMethodInfo parent_struct;
00027   const gchar *signal_name;
00028   gboolean pass_fdlist;
00029 } _ExtendedGDBusMethodInfo;
00030 
00031 typedef struct
00032 {
00033   GDBusSignalInfo parent_struct;
00034   const gchar *signal_name;
00035 } _ExtendedGDBusSignalInfo;
00036 
00037 typedef struct
00038 {
00039   GDBusPropertyInfo parent_struct;
00040   const gchar *hyphen_name;
00041   gboolean use_gvariant;
00042 } _ExtendedGDBusPropertyInfo;
00043 
00044 typedef struct
00045 {
00046   GDBusInterfaceInfo parent_struct;
00047   const gchar *hyphen_name;
00048 } _ExtendedGDBusInterfaceInfo;
00049 
00050 typedef struct
00051 {
00052   const _ExtendedGDBusPropertyInfo *info;
00053   guint prop_id;
00054   GValue orig_value; /* the value before the change */
00055 } ChangedProperty;
00056 
00057 static void
00058 _changed_property_free (ChangedProperty *data)
00059 {
00060   g_value_unset (&data->orig_value);
00061   g_free (data);
00062 }
00063 
00064 static gboolean
00065 _g_strv_equal0 (gchar **a, gchar **b)
00066 {
00067   gboolean ret = FALSE;
00068   guint n;
00069   if (a == NULL && b == NULL)
00070     {
00071       ret = TRUE;
00072       goto out;
00073     }
00074   if (a == NULL || b == NULL)
00075     goto out;
00076   if (g_strv_length (a) != g_strv_length (b))
00077     goto out;
00078   for (n = 0; a[n] != NULL; n++)
00079     if (g_strcmp0 (a[n], b[n]) != 0)
00080       goto out;
00081   ret = TRUE;
00082 out:
00083   return ret;
00084 }
00085 
00086 static gboolean
00087 _g_variant_equal0 (GVariant *a, GVariant *b)
00088 {
00089   gboolean ret = FALSE;
00090   if (a == NULL && b == NULL)
00091     {
00092       ret = TRUE;
00093       goto out;
00094     }
00095   if (a == NULL || b == NULL)
00096     goto out;
00097   ret = g_variant_equal (a, b);
00098 out:
00099   return ret;
00100 }
00101 
00102 G_GNUC_UNUSED static gboolean
00103 _g_value_equal (const GValue *a, const GValue *b)
00104 {
00105   gboolean ret = FALSE;
00106   g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
00107   switch (G_VALUE_TYPE (a))
00108     {
00109       case G_TYPE_BOOLEAN:
00110         ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
00111         break;
00112       case G_TYPE_UCHAR:
00113         ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
00114         break;
00115       case G_TYPE_INT:
00116         ret = (g_value_get_int (a) == g_value_get_int (b));
00117         break;
00118       case G_TYPE_UINT:
00119         ret = (g_value_get_uint (a) == g_value_get_uint (b));
00120         break;
00121       case G_TYPE_INT64:
00122         ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
00123         break;
00124       case G_TYPE_UINT64:
00125         ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
00126         break;
00127       case G_TYPE_DOUBLE:
00128         {
00129           /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
00130           gdouble da = g_value_get_double (a);
00131           gdouble db = g_value_get_double (b);
00132           ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
00133         }
00134         break;
00135       case G_TYPE_STRING:
00136         ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
00137         break;
00138       case G_TYPE_VARIANT:
00139         ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
00140         break;
00141       default:
00142         if (G_VALUE_TYPE (a) == G_TYPE_STRV)
00143           ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
00144         else
00145           g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
00146         break;
00147     }
00148   return ret;
00149 }
00150 
00151 /* ------------------------------------------------------------------------
00152  * Code for interface org.freedesktop.ConsoleKit.Seat
00153  * ------------------------------------------------------------------------
00154  */
00155 
00164 /* ---- Introspection data for org.freedesktop.ConsoleKit.Seat ---- */
00165 
00166 static const _ExtendedGDBusArgInfo _console_kit_seat_method_info_get_id_OUT_ARG_sid =
00167 {
00168   {
00169     -1,
00170     (gchar *) "sid",
00171     (gchar *) "o",
00172     NULL
00173   },
00174   FALSE
00175 };
00176 
00177 static const _ExtendedGDBusArgInfo * const _console_kit_seat_method_info_get_id_OUT_ARG_pointers[] =
00178 {
00179   &_console_kit_seat_method_info_get_id_OUT_ARG_sid,
00180   NULL
00181 };
00182 
00183 static const _ExtendedGDBusMethodInfo _console_kit_seat_method_info_get_id =
00184 {
00185   {
00186     -1,
00187     (gchar *) "GetId",
00188     NULL,
00189     (GDBusArgInfo **) &_console_kit_seat_method_info_get_id_OUT_ARG_pointers,
00190     NULL
00191   },
00192   "handle-get-id",
00193   FALSE
00194 };
00195 
00196 static const _ExtendedGDBusArgInfo _console_kit_seat_method_info_get_sessions_OUT_ARG_sessions =
00197 {
00198   {
00199     -1,
00200     (gchar *) "sessions",
00201     (gchar *) "ao",
00202     NULL
00203   },
00204   FALSE
00205 };
00206 
00207 static const _ExtendedGDBusArgInfo * const _console_kit_seat_method_info_get_sessions_OUT_ARG_pointers[] =
00208 {
00209   &_console_kit_seat_method_info_get_sessions_OUT_ARG_sessions,
00210   NULL
00211 };
00212 
00213 static const _ExtendedGDBusMethodInfo _console_kit_seat_method_info_get_sessions =
00214 {
00215   {
00216     -1,
00217     (gchar *) "GetSessions",
00218     NULL,
00219     (GDBusArgInfo **) &_console_kit_seat_method_info_get_sessions_OUT_ARG_pointers,
00220     NULL
00221   },
00222   "handle-get-sessions",
00223   FALSE
00224 };
00225 
00226 static const _ExtendedGDBusArgInfo _console_kit_seat_method_info_get_devices_OUT_ARG_devices =
00227 {
00228   {
00229     -1,
00230     (gchar *) "devices",
00231     (gchar *) "a(ss)",
00232     NULL
00233   },
00234   FALSE
00235 };
00236 
00237 static const _ExtendedGDBusArgInfo * const _console_kit_seat_method_info_get_devices_OUT_ARG_pointers[] =
00238 {
00239   &_console_kit_seat_method_info_get_devices_OUT_ARG_devices,
00240   NULL
00241 };
00242 
00243 static const _ExtendedGDBusMethodInfo _console_kit_seat_method_info_get_devices =
00244 {
00245   {
00246     -1,
00247     (gchar *) "GetDevices",
00248     NULL,
00249     (GDBusArgInfo **) &_console_kit_seat_method_info_get_devices_OUT_ARG_pointers,
00250     NULL
00251   },
00252   "handle-get-devices",
00253   FALSE
00254 };
00255 
00256 static const _ExtendedGDBusArgInfo _console_kit_seat_method_info_get_active_session_OUT_ARG_ssid =
00257 {
00258   {
00259     -1,
00260     (gchar *) "ssid",
00261     (gchar *) "o",
00262     NULL
00263   },
00264   FALSE
00265 };
00266 
00267 static const _ExtendedGDBusArgInfo * const _console_kit_seat_method_info_get_active_session_OUT_ARG_pointers[] =
00268 {
00269   &_console_kit_seat_method_info_get_active_session_OUT_ARG_ssid,
00270   NULL
00271 };
00272 
00273 static const _ExtendedGDBusMethodInfo _console_kit_seat_method_info_get_active_session =
00274 {
00275   {
00276     -1,
00277     (gchar *) "GetActiveSession",
00278     NULL,
00279     (GDBusArgInfo **) &_console_kit_seat_method_info_get_active_session_OUT_ARG_pointers,
00280     NULL
00281   },
00282   "handle-get-active-session",
00283   FALSE
00284 };
00285 
00286 static const _ExtendedGDBusArgInfo _console_kit_seat_method_info_can_activate_sessions_OUT_ARG_can_activate =
00287 {
00288   {
00289     -1,
00290     (gchar *) "can_activate",
00291     (gchar *) "b",
00292     NULL
00293   },
00294   FALSE
00295 };
00296 
00297 static const _ExtendedGDBusArgInfo * const _console_kit_seat_method_info_can_activate_sessions_OUT_ARG_pointers[] =
00298 {
00299   &_console_kit_seat_method_info_can_activate_sessions_OUT_ARG_can_activate,
00300   NULL
00301 };
00302 
00303 static const _ExtendedGDBusMethodInfo _console_kit_seat_method_info_can_activate_sessions =
00304 {
00305   {
00306     -1,
00307     (gchar *) "CanActivateSessions",
00308     NULL,
00309     (GDBusArgInfo **) &_console_kit_seat_method_info_can_activate_sessions_OUT_ARG_pointers,
00310     NULL
00311   },
00312   "handle-can-activate-sessions",
00313   FALSE
00314 };
00315 
00316 static const _ExtendedGDBusArgInfo _console_kit_seat_method_info_activate_session_IN_ARG_ssid =
00317 {
00318   {
00319     -1,
00320     (gchar *) "ssid",
00321     (gchar *) "o",
00322     NULL
00323   },
00324   FALSE
00325 };
00326 
00327 static const _ExtendedGDBusArgInfo * const _console_kit_seat_method_info_activate_session_IN_ARG_pointers[] =
00328 {
00329   &_console_kit_seat_method_info_activate_session_IN_ARG_ssid,
00330   NULL
00331 };
00332 
00333 static const GDBusAnnotationInfo _console_kit_seat_method_activate_session_annotation_info_0 =
00334 {
00335   -1,
00336   (gchar *) "org.freedesktop.DBus.GLib.Async",
00337   (gchar *) "",
00338   NULL
00339 };
00340 
00341 static const GDBusAnnotationInfo * const _console_kit_seat_method_activate_session_annotation_info_pointers[] =
00342 {
00343   &_console_kit_seat_method_activate_session_annotation_info_0,
00344   NULL
00345 };
00346 
00347 static const _ExtendedGDBusMethodInfo _console_kit_seat_method_info_activate_session =
00348 {
00349   {
00350     -1,
00351     (gchar *) "ActivateSession",
00352     (GDBusArgInfo **) &_console_kit_seat_method_info_activate_session_IN_ARG_pointers,
00353     NULL,
00354     (GDBusAnnotationInfo **) &_console_kit_seat_method_activate_session_annotation_info_pointers
00355   },
00356   "handle-activate-session",
00357   FALSE
00358 };
00359 
00360 static const _ExtendedGDBusMethodInfo * const _console_kit_seat_method_info_pointers[] =
00361 {
00362   &_console_kit_seat_method_info_get_id,
00363   &_console_kit_seat_method_info_get_sessions,
00364   &_console_kit_seat_method_info_get_devices,
00365   &_console_kit_seat_method_info_get_active_session,
00366   &_console_kit_seat_method_info_can_activate_sessions,
00367   &_console_kit_seat_method_info_activate_session,
00368   NULL
00369 };
00370 
00371 static const _ExtendedGDBusArgInfo _console_kit_seat_signal_info_active_session_changed_ARG_ssid =
00372 {
00373   {
00374     -1,
00375     (gchar *) "ssid",
00376     (gchar *) "s",
00377     NULL
00378   },
00379   FALSE
00380 };
00381 
00382 static const _ExtendedGDBusArgInfo * const _console_kit_seat_signal_info_active_session_changed_ARG_pointers[] =
00383 {
00384   &_console_kit_seat_signal_info_active_session_changed_ARG_ssid,
00385   NULL
00386 };
00387 
00388 static const _ExtendedGDBusSignalInfo _console_kit_seat_signal_info_active_session_changed =
00389 {
00390   {
00391     -1,
00392     (gchar *) "ActiveSessionChanged",
00393     (GDBusArgInfo **) &_console_kit_seat_signal_info_active_session_changed_ARG_pointers,
00394     NULL
00395   },
00396   "active-session-changed"
00397 };
00398 
00399 static const _ExtendedGDBusArgInfo _console_kit_seat_signal_info_session_added_ARG_ssid =
00400 {
00401   {
00402     -1,
00403     (gchar *) "ssid",
00404     (gchar *) "o",
00405     NULL
00406   },
00407   FALSE
00408 };
00409 
00410 static const _ExtendedGDBusArgInfo * const _console_kit_seat_signal_info_session_added_ARG_pointers[] =
00411 {
00412   &_console_kit_seat_signal_info_session_added_ARG_ssid,
00413   NULL
00414 };
00415 
00416 static const _ExtendedGDBusSignalInfo _console_kit_seat_signal_info_session_added =
00417 {
00418   {
00419     -1,
00420     (gchar *) "SessionAdded",
00421     (GDBusArgInfo **) &_console_kit_seat_signal_info_session_added_ARG_pointers,
00422     NULL
00423   },
00424   "session-added"
00425 };
00426 
00427 static const _ExtendedGDBusArgInfo _console_kit_seat_signal_info_session_removed_ARG_ssid =
00428 {
00429   {
00430     -1,
00431     (gchar *) "ssid",
00432     (gchar *) "o",
00433     NULL
00434   },
00435   FALSE
00436 };
00437 
00438 static const _ExtendedGDBusArgInfo * const _console_kit_seat_signal_info_session_removed_ARG_pointers[] =
00439 {
00440   &_console_kit_seat_signal_info_session_removed_ARG_ssid,
00441   NULL
00442 };
00443 
00444 static const _ExtendedGDBusSignalInfo _console_kit_seat_signal_info_session_removed =
00445 {
00446   {
00447     -1,
00448     (gchar *) "SessionRemoved",
00449     (GDBusArgInfo **) &_console_kit_seat_signal_info_session_removed_ARG_pointers,
00450     NULL
00451   },
00452   "session-removed"
00453 };
00454 
00455 static const _ExtendedGDBusArgInfo _console_kit_seat_signal_info_device_added_ARG_device =
00456 {
00457   {
00458     -1,
00459     (gchar *) "device",
00460     (gchar *) "(ss)",
00461     NULL
00462   },
00463   FALSE
00464 };
00465 
00466 static const _ExtendedGDBusArgInfo * const _console_kit_seat_signal_info_device_added_ARG_pointers[] =
00467 {
00468   &_console_kit_seat_signal_info_device_added_ARG_device,
00469   NULL
00470 };
00471 
00472 static const _ExtendedGDBusSignalInfo _console_kit_seat_signal_info_device_added =
00473 {
00474   {
00475     -1,
00476     (gchar *) "DeviceAdded",
00477     (GDBusArgInfo **) &_console_kit_seat_signal_info_device_added_ARG_pointers,
00478     NULL
00479   },
00480   "device-added"
00481 };
00482 
00483 static const _ExtendedGDBusArgInfo _console_kit_seat_signal_info_device_removed_ARG_device =
00484 {
00485   {
00486     -1,
00487     (gchar *) "device",
00488     (gchar *) "(ss)",
00489     NULL
00490   },
00491   FALSE
00492 };
00493 
00494 static const _ExtendedGDBusArgInfo * const _console_kit_seat_signal_info_device_removed_ARG_pointers[] =
00495 {
00496   &_console_kit_seat_signal_info_device_removed_ARG_device,
00497   NULL
00498 };
00499 
00500 static const _ExtendedGDBusSignalInfo _console_kit_seat_signal_info_device_removed =
00501 {
00502   {
00503     -1,
00504     (gchar *) "DeviceRemoved",
00505     (GDBusArgInfo **) &_console_kit_seat_signal_info_device_removed_ARG_pointers,
00506     NULL
00507   },
00508   "device-removed"
00509 };
00510 
00511 static const _ExtendedGDBusSignalInfo * const _console_kit_seat_signal_info_pointers[] =
00512 {
00513   &_console_kit_seat_signal_info_active_session_changed,
00514   &_console_kit_seat_signal_info_session_added,
00515   &_console_kit_seat_signal_info_session_removed,
00516   &_console_kit_seat_signal_info_device_added,
00517   &_console_kit_seat_signal_info_device_removed,
00518   NULL
00519 };
00520 
00521 static const _ExtendedGDBusInterfaceInfo _console_kit_seat_interface_info =
00522 {
00523   {
00524     -1,
00525     (gchar *) "org.freedesktop.ConsoleKit.Seat",
00526     (GDBusMethodInfo **) &_console_kit_seat_method_info_pointers,
00527     (GDBusSignalInfo **) &_console_kit_seat_signal_info_pointers,
00528     NULL,
00529     NULL
00530   },
00531   "console-kit-seat",
00532 };
00533 
00534 
00542 GDBusInterfaceInfo *
00543 console_kit_seat_interface_info (void)
00544 {
00545   return (GDBusInterfaceInfo *) &_console_kit_seat_interface_info;
00546 }
00547 
00558 guint
00559 console_kit_seat_override_properties (GObjectClass *klass, guint property_id_begin)
00560 {
00561   return property_id_begin - 1;
00562 }
00563 
00564 
00565 
00590 static void
00591 console_kit_seat_default_init (ConsoleKitSeatIface *iface)
00592 {
00593   /* GObject signals for incoming D-Bus method calls: */
00605   g_signal_new ("handle-get-id",
00606     G_TYPE_FROM_INTERFACE (iface),
00607     G_SIGNAL_RUN_LAST,
00608     G_STRUCT_OFFSET (ConsoleKitSeatIface, handle_get_id),
00609     g_signal_accumulator_true_handled,
00610     NULL,
00611     g_cclosure_marshal_generic,
00612     G_TYPE_BOOLEAN,
00613     1,
00614     G_TYPE_DBUS_METHOD_INVOCATION);
00615 
00627   g_signal_new ("handle-get-sessions",
00628     G_TYPE_FROM_INTERFACE (iface),
00629     G_SIGNAL_RUN_LAST,
00630     G_STRUCT_OFFSET (ConsoleKitSeatIface, handle_get_sessions),
00631     g_signal_accumulator_true_handled,
00632     NULL,
00633     g_cclosure_marshal_generic,
00634     G_TYPE_BOOLEAN,
00635     1,
00636     G_TYPE_DBUS_METHOD_INVOCATION);
00637 
00649   g_signal_new ("handle-get-devices",
00650     G_TYPE_FROM_INTERFACE (iface),
00651     G_SIGNAL_RUN_LAST,
00652     G_STRUCT_OFFSET (ConsoleKitSeatIface, handle_get_devices),
00653     g_signal_accumulator_true_handled,
00654     NULL,
00655     g_cclosure_marshal_generic,
00656     G_TYPE_BOOLEAN,
00657     1,
00658     G_TYPE_DBUS_METHOD_INVOCATION);
00659 
00671   g_signal_new ("handle-get-active-session",
00672     G_TYPE_FROM_INTERFACE (iface),
00673     G_SIGNAL_RUN_LAST,
00674     G_STRUCT_OFFSET (ConsoleKitSeatIface, handle_get_active_session),
00675     g_signal_accumulator_true_handled,
00676     NULL,
00677     g_cclosure_marshal_generic,
00678     G_TYPE_BOOLEAN,
00679     1,
00680     G_TYPE_DBUS_METHOD_INVOCATION);
00681 
00693   g_signal_new ("handle-can-activate-sessions",
00694     G_TYPE_FROM_INTERFACE (iface),
00695     G_SIGNAL_RUN_LAST,
00696     G_STRUCT_OFFSET (ConsoleKitSeatIface, handle_can_activate_sessions),
00697     g_signal_accumulator_true_handled,
00698     NULL,
00699     g_cclosure_marshal_generic,
00700     G_TYPE_BOOLEAN,
00701     1,
00702     G_TYPE_DBUS_METHOD_INVOCATION);
00703 
00716   g_signal_new ("handle-activate-session",
00717     G_TYPE_FROM_INTERFACE (iface),
00718     G_SIGNAL_RUN_LAST,
00719     G_STRUCT_OFFSET (ConsoleKitSeatIface, handle_activate_session),
00720     g_signal_accumulator_true_handled,
00721     NULL,
00722     g_cclosure_marshal_generic,
00723     G_TYPE_BOOLEAN,
00724     2,
00725     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
00726 
00727   /* GObject signals for received D-Bus signals: */
00737   g_signal_new ("active-session-changed",
00738     G_TYPE_FROM_INTERFACE (iface),
00739     G_SIGNAL_RUN_LAST,
00740     G_STRUCT_OFFSET (ConsoleKitSeatIface, active_session_changed),
00741     NULL,
00742     NULL,
00743     g_cclosure_marshal_generic,
00744     G_TYPE_NONE,
00745     1, G_TYPE_STRING);
00746 
00756   g_signal_new ("session-added",
00757     G_TYPE_FROM_INTERFACE (iface),
00758     G_SIGNAL_RUN_LAST,
00759     G_STRUCT_OFFSET (ConsoleKitSeatIface, session_added),
00760     NULL,
00761     NULL,
00762     g_cclosure_marshal_generic,
00763     G_TYPE_NONE,
00764     1, G_TYPE_STRING);
00765 
00775   g_signal_new ("session-removed",
00776     G_TYPE_FROM_INTERFACE (iface),
00777     G_SIGNAL_RUN_LAST,
00778     G_STRUCT_OFFSET (ConsoleKitSeatIface, session_removed),
00779     NULL,
00780     NULL,
00781     g_cclosure_marshal_generic,
00782     G_TYPE_NONE,
00783     1, G_TYPE_STRING);
00784 
00794   g_signal_new ("device-added",
00795     G_TYPE_FROM_INTERFACE (iface),
00796     G_SIGNAL_RUN_LAST,
00797     G_STRUCT_OFFSET (ConsoleKitSeatIface, device_added),
00798     NULL,
00799     NULL,
00800     g_cclosure_marshal_generic,
00801     G_TYPE_NONE,
00802     1, G_TYPE_VARIANT);
00803 
00813   g_signal_new ("device-removed",
00814     G_TYPE_FROM_INTERFACE (iface),
00815     G_SIGNAL_RUN_LAST,
00816     G_STRUCT_OFFSET (ConsoleKitSeatIface, device_removed),
00817     NULL,
00818     NULL,
00819     g_cclosure_marshal_generic,
00820     G_TYPE_NONE,
00821     1, G_TYPE_VARIANT);
00822 
00823 }
00824 
00825 typedef ConsoleKitSeatIface ConsoleKitSeatInterface;
00826 G_DEFINE_INTERFACE (ConsoleKitSeat, console_kit_seat, G_TYPE_OBJECT);
00827 
00835 void
00836 console_kit_seat_emit_active_session_changed (
00837     ConsoleKitSeat *object,
00838     const gchar *arg_ssid)
00839 {
00840   g_signal_emit_by_name (object, "active-session-changed", arg_ssid);
00841 }
00842 
00850 void
00851 console_kit_seat_emit_session_added (
00852     ConsoleKitSeat *object,
00853     const gchar *arg_ssid)
00854 {
00855   g_signal_emit_by_name (object, "session-added", arg_ssid);
00856 }
00857 
00865 void
00866 console_kit_seat_emit_session_removed (
00867     ConsoleKitSeat *object,
00868     const gchar *arg_ssid)
00869 {
00870   g_signal_emit_by_name (object, "session-removed", arg_ssid);
00871 }
00872 
00880 void
00881 console_kit_seat_emit_device_added (
00882     ConsoleKitSeat *object,
00883     GVariant *arg_device)
00884 {
00885   g_signal_emit_by_name (object, "device-added", arg_device);
00886 }
00887 
00895 void
00896 console_kit_seat_emit_device_removed (
00897     ConsoleKitSeat *object,
00898     GVariant *arg_device)
00899 {
00900   g_signal_emit_by_name (object, "device-removed", arg_device);
00901 }
00902 
00916 void
00917 console_kit_seat_call_get_id (
00918     ConsoleKitSeat *proxy,
00919     GCancellable *cancellable,
00920     GAsyncReadyCallback callback,
00921     gpointer user_data)
00922 {
00923   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
00924     "GetId",
00925     g_variant_new ("()"),
00926     G_DBUS_CALL_FLAGS_NONE,
00927     -1,
00928     cancellable,
00929     callback,
00930     user_data);
00931 }
00932 
00944 gboolean
00945 console_kit_seat_call_get_id_finish (
00946     ConsoleKitSeat *proxy,
00947     gchar **out_sid,
00948     GAsyncResult *res,
00949     GError **error)
00950 {
00951   GVariant *_ret;
00952   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
00953   if (_ret == NULL)
00954     goto _out;
00955   g_variant_get (_ret,
00956                  "(o)",
00957                  out_sid);
00958   g_variant_unref (_ret);
00959 _out:
00960   return _ret != NULL;
00961 }
00962 
00976 gboolean
00977 console_kit_seat_call_get_id_sync (
00978     ConsoleKitSeat *proxy,
00979     gchar **out_sid,
00980     GCancellable *cancellable,
00981     GError **error)
00982 {
00983   GVariant *_ret;
00984   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
00985     "GetId",
00986     g_variant_new ("()"),
00987     G_DBUS_CALL_FLAGS_NONE,
00988     -1,
00989     cancellable,
00990     error);
00991   if (_ret == NULL)
00992     goto _out;
00993   g_variant_get (_ret,
00994                  "(o)",
00995                  out_sid);
00996   g_variant_unref (_ret);
00997 _out:
00998   return _ret != NULL;
00999 }
01000 
01014 void
01015 console_kit_seat_call_get_sessions (
01016     ConsoleKitSeat *proxy,
01017     GCancellable *cancellable,
01018     GAsyncReadyCallback callback,
01019     gpointer user_data)
01020 {
01021   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01022     "GetSessions",
01023     g_variant_new ("()"),
01024     G_DBUS_CALL_FLAGS_NONE,
01025     -1,
01026     cancellable,
01027     callback,
01028     user_data);
01029 }
01030 
01042 gboolean
01043 console_kit_seat_call_get_sessions_finish (
01044     ConsoleKitSeat *proxy,
01045     gchar ***out_sessions,
01046     GAsyncResult *res,
01047     GError **error)
01048 {
01049   GVariant *_ret;
01050   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01051   if (_ret == NULL)
01052     goto _out;
01053   g_variant_get (_ret,
01054                  "(^ao)",
01055                  out_sessions);
01056   g_variant_unref (_ret);
01057 _out:
01058   return _ret != NULL;
01059 }
01060 
01074 gboolean
01075 console_kit_seat_call_get_sessions_sync (
01076     ConsoleKitSeat *proxy,
01077     gchar ***out_sessions,
01078     GCancellable *cancellable,
01079     GError **error)
01080 {
01081   GVariant *_ret;
01082   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01083     "GetSessions",
01084     g_variant_new ("()"),
01085     G_DBUS_CALL_FLAGS_NONE,
01086     -1,
01087     cancellable,
01088     error);
01089   if (_ret == NULL)
01090     goto _out;
01091   g_variant_get (_ret,
01092                  "(^ao)",
01093                  out_sessions);
01094   g_variant_unref (_ret);
01095 _out:
01096   return _ret != NULL;
01097 }
01098 
01112 void
01113 console_kit_seat_call_get_devices (
01114     ConsoleKitSeat *proxy,
01115     GCancellable *cancellable,
01116     GAsyncReadyCallback callback,
01117     gpointer user_data)
01118 {
01119   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01120     "GetDevices",
01121     g_variant_new ("()"),
01122     G_DBUS_CALL_FLAGS_NONE,
01123     -1,
01124     cancellable,
01125     callback,
01126     user_data);
01127 }
01128 
01140 gboolean
01141 console_kit_seat_call_get_devices_finish (
01142     ConsoleKitSeat *proxy,
01143     GVariant **out_devices,
01144     GAsyncResult *res,
01145     GError **error)
01146 {
01147   GVariant *_ret;
01148   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01149   if (_ret == NULL)
01150     goto _out;
01151   g_variant_get (_ret,
01152                  "(@a(ss))",
01153                  out_devices);
01154   g_variant_unref (_ret);
01155 _out:
01156   return _ret != NULL;
01157 }
01158 
01172 gboolean
01173 console_kit_seat_call_get_devices_sync (
01174     ConsoleKitSeat *proxy,
01175     GVariant **out_devices,
01176     GCancellable *cancellable,
01177     GError **error)
01178 {
01179   GVariant *_ret;
01180   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01181     "GetDevices",
01182     g_variant_new ("()"),
01183     G_DBUS_CALL_FLAGS_NONE,
01184     -1,
01185     cancellable,
01186     error);
01187   if (_ret == NULL)
01188     goto _out;
01189   g_variant_get (_ret,
01190                  "(@a(ss))",
01191                  out_devices);
01192   g_variant_unref (_ret);
01193 _out:
01194   return _ret != NULL;
01195 }
01196 
01210 void
01211 console_kit_seat_call_get_active_session (
01212     ConsoleKitSeat *proxy,
01213     GCancellable *cancellable,
01214     GAsyncReadyCallback callback,
01215     gpointer user_data)
01216 {
01217   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01218     "GetActiveSession",
01219     g_variant_new ("()"),
01220     G_DBUS_CALL_FLAGS_NONE,
01221     -1,
01222     cancellable,
01223     callback,
01224     user_data);
01225 }
01226 
01238 gboolean
01239 console_kit_seat_call_get_active_session_finish (
01240     ConsoleKitSeat *proxy,
01241     gchar **out_ssid,
01242     GAsyncResult *res,
01243     GError **error)
01244 {
01245   GVariant *_ret;
01246   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01247   if (_ret == NULL)
01248     goto _out;
01249   g_variant_get (_ret,
01250                  "(o)",
01251                  out_ssid);
01252   g_variant_unref (_ret);
01253 _out:
01254   return _ret != NULL;
01255 }
01256 
01270 gboolean
01271 console_kit_seat_call_get_active_session_sync (
01272     ConsoleKitSeat *proxy,
01273     gchar **out_ssid,
01274     GCancellable *cancellable,
01275     GError **error)
01276 {
01277   GVariant *_ret;
01278   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01279     "GetActiveSession",
01280     g_variant_new ("()"),
01281     G_DBUS_CALL_FLAGS_NONE,
01282     -1,
01283     cancellable,
01284     error);
01285   if (_ret == NULL)
01286     goto _out;
01287   g_variant_get (_ret,
01288                  "(o)",
01289                  out_ssid);
01290   g_variant_unref (_ret);
01291 _out:
01292   return _ret != NULL;
01293 }
01294 
01308 void
01309 console_kit_seat_call_can_activate_sessions (
01310     ConsoleKitSeat *proxy,
01311     GCancellable *cancellable,
01312     GAsyncReadyCallback callback,
01313     gpointer user_data)
01314 {
01315   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01316     "CanActivateSessions",
01317     g_variant_new ("()"),
01318     G_DBUS_CALL_FLAGS_NONE,
01319     -1,
01320     cancellable,
01321     callback,
01322     user_data);
01323 }
01324 
01336 gboolean
01337 console_kit_seat_call_can_activate_sessions_finish (
01338     ConsoleKitSeat *proxy,
01339     gboolean *out_can_activate,
01340     GAsyncResult *res,
01341     GError **error)
01342 {
01343   GVariant *_ret;
01344   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01345   if (_ret == NULL)
01346     goto _out;
01347   g_variant_get (_ret,
01348                  "(b)",
01349                  out_can_activate);
01350   g_variant_unref (_ret);
01351 _out:
01352   return _ret != NULL;
01353 }
01354 
01368 gboolean
01369 console_kit_seat_call_can_activate_sessions_sync (
01370     ConsoleKitSeat *proxy,
01371     gboolean *out_can_activate,
01372     GCancellable *cancellable,
01373     GError **error)
01374 {
01375   GVariant *_ret;
01376   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01377     "CanActivateSessions",
01378     g_variant_new ("()"),
01379     G_DBUS_CALL_FLAGS_NONE,
01380     -1,
01381     cancellable,
01382     error);
01383   if (_ret == NULL)
01384     goto _out;
01385   g_variant_get (_ret,
01386                  "(b)",
01387                  out_can_activate);
01388   g_variant_unref (_ret);
01389 _out:
01390   return _ret != NULL;
01391 }
01392 
01407 void
01408 console_kit_seat_call_activate_session (
01409     ConsoleKitSeat *proxy,
01410     const gchar *arg_ssid,
01411     GCancellable *cancellable,
01412     GAsyncReadyCallback callback,
01413     gpointer user_data)
01414 {
01415   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01416     "ActivateSession",
01417     g_variant_new ("(o)",
01418                    arg_ssid),
01419     G_DBUS_CALL_FLAGS_NONE,
01420     -1,
01421     cancellable,
01422     callback,
01423     user_data);
01424 }
01425 
01436 gboolean
01437 console_kit_seat_call_activate_session_finish (
01438     ConsoleKitSeat *proxy,
01439     GAsyncResult *res,
01440     GError **error)
01441 {
01442   GVariant *_ret;
01443   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01444   if (_ret == NULL)
01445     goto _out;
01446   g_variant_get (_ret,
01447                  "()");
01448   g_variant_unref (_ret);
01449 _out:
01450   return _ret != NULL;
01451 }
01452 
01466 gboolean
01467 console_kit_seat_call_activate_session_sync (
01468     ConsoleKitSeat *proxy,
01469     const gchar *arg_ssid,
01470     GCancellable *cancellable,
01471     GError **error)
01472 {
01473   GVariant *_ret;
01474   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01475     "ActivateSession",
01476     g_variant_new ("(o)",
01477                    arg_ssid),
01478     G_DBUS_CALL_FLAGS_NONE,
01479     -1,
01480     cancellable,
01481     error);
01482   if (_ret == NULL)
01483     goto _out;
01484   g_variant_get (_ret,
01485                  "()");
01486   g_variant_unref (_ret);
01487 _out:
01488   return _ret != NULL;
01489 }
01490 
01501 void
01502 console_kit_seat_complete_get_id (
01503     ConsoleKitSeat *object,
01504     GDBusMethodInvocation *invocation,
01505     const gchar *sid)
01506 {
01507   g_dbus_method_invocation_return_value (invocation,
01508     g_variant_new ("(o)",
01509                    sid));
01510 }
01511 
01522 void
01523 console_kit_seat_complete_get_sessions (
01524     ConsoleKitSeat *object,
01525     GDBusMethodInvocation *invocation,
01526     const gchar *const *sessions)
01527 {
01528   g_dbus_method_invocation_return_value (invocation,
01529     g_variant_new ("(^ao)",
01530                    sessions));
01531 }
01532 
01543 void
01544 console_kit_seat_complete_get_devices (
01545     ConsoleKitSeat *object,
01546     GDBusMethodInvocation *invocation,
01547     GVariant *devices)
01548 {
01549   g_dbus_method_invocation_return_value (invocation,
01550     g_variant_new ("(@a(ss))",
01551                    devices));
01552 }
01553 
01564 void
01565 console_kit_seat_complete_get_active_session (
01566     ConsoleKitSeat *object,
01567     GDBusMethodInvocation *invocation,
01568     const gchar *ssid)
01569 {
01570   g_dbus_method_invocation_return_value (invocation,
01571     g_variant_new ("(o)",
01572                    ssid));
01573 }
01574 
01585 void
01586 console_kit_seat_complete_can_activate_sessions (
01587     ConsoleKitSeat *object,
01588     GDBusMethodInvocation *invocation,
01589     gboolean can_activate)
01590 {
01591   g_dbus_method_invocation_return_value (invocation,
01592     g_variant_new ("(b)",
01593                    can_activate));
01594 }
01595 
01605 void
01606 console_kit_seat_complete_activate_session (
01607     ConsoleKitSeat *object,
01608     GDBusMethodInvocation *invocation)
01609 {
01610   g_dbus_method_invocation_return_value (invocation,
01611     g_variant_new ("()"));
01612 }
01613 
01614 /* ------------------------------------------------------------------------ */
01615 
01629 struct _ConsoleKitSeatProxyPrivate
01630 {
01631   GData *qdata;
01632 };
01633 
01634 static void console_kit_seat_proxy_iface_init (ConsoleKitSeatIface *iface);
01635 
01636 G_DEFINE_TYPE_WITH_CODE (ConsoleKitSeatProxy, console_kit_seat_proxy, G_TYPE_DBUS_PROXY,
01637                          G_IMPLEMENT_INTERFACE (TYPE_CONSOLE_KIT_SEAT, console_kit_seat_proxy_iface_init));
01638 
01639 static void
01640 console_kit_seat_proxy_finalize (GObject *object)
01641 {
01642   ConsoleKitSeatProxy *proxy = CONSOLE_KIT_SEAT_PROXY (object);
01643   g_datalist_clear (&proxy->priv->qdata);
01644   G_OBJECT_CLASS (console_kit_seat_proxy_parent_class)->finalize (object);
01645 }
01646 
01647 static void
01648 console_kit_seat_proxy_get_property (GObject      *object,
01649   guint         prop_id,
01650   GValue       *value,
01651   GParamSpec   *pspec)
01652 {
01653 }
01654 
01655 static void
01656 console_kit_seat_proxy_set_property (GObject      *object,
01657   guint         prop_id,
01658   const GValue *value,
01659   GParamSpec   *pspec)
01660 {
01661 }
01662 
01663 static void
01664 console_kit_seat_proxy_g_signal (GDBusProxy *proxy,
01665   const gchar *sender_name,
01666   const gchar *signal_name,
01667   GVariant *parameters)
01668 {
01669   _ExtendedGDBusSignalInfo *info;
01670   GVariantIter iter;
01671   GVariant *child;
01672   GValue *paramv;
01673   guint num_params;
01674   guint n;
01675   guint signal_id;
01676   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_console_kit_seat_interface_info, signal_name);
01677   if (info == NULL)
01678     return;
01679   num_params = g_variant_n_children (parameters);
01680   paramv = g_new0 (GValue, num_params + 1);
01681   g_value_init (&paramv[0], TYPE_CONSOLE_KIT_SEAT);
01682   g_value_set_object (&paramv[0], proxy);
01683   g_variant_iter_init (&iter, parameters);
01684   n = 1;
01685   while ((child = g_variant_iter_next_value (&iter)) != NULL)
01686     {
01687       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
01688       if (arg_info->use_gvariant)
01689         {
01690           g_value_init (&paramv[n], G_TYPE_VARIANT);
01691           g_value_set_variant (&paramv[n], child);
01692           n++;
01693         }
01694       else
01695         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
01696       g_variant_unref (child);
01697     }
01698   signal_id = g_signal_lookup (info->signal_name, TYPE_CONSOLE_KIT_SEAT);
01699   g_signal_emitv (paramv, signal_id, 0, NULL);
01700   for (n = 0; n < num_params + 1; n++)
01701     g_value_unset (&paramv[n]);
01702   g_free (paramv);
01703 }
01704 
01705 static void
01706 console_kit_seat_proxy_g_properties_changed (GDBusProxy *_proxy,
01707   GVariant *changed_properties,
01708   const gchar *const *invalidated_properties)
01709 {
01710   ConsoleKitSeatProxy *proxy = CONSOLE_KIT_SEAT_PROXY (_proxy);
01711   guint n;
01712   const gchar *key;
01713   GVariantIter *iter;
01714   _ExtendedGDBusPropertyInfo *info;
01715   g_variant_get (changed_properties, "a{sv}", &iter);
01716   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
01717     {
01718       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_console_kit_seat_interface_info, key);
01719       g_datalist_remove_data (&proxy->priv->qdata, key);
01720       if (info != NULL)
01721         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
01722     }
01723   g_variant_iter_free (iter);
01724   for (n = 0; invalidated_properties[n] != NULL; n++)
01725     {
01726       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_console_kit_seat_interface_info, invalidated_properties[n]);
01727       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
01728       if (info != NULL)
01729         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
01730     }
01731 }
01732 
01733 static void
01734 console_kit_seat_proxy_init (ConsoleKitSeatProxy *proxy)
01735 {
01736   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_CONSOLE_KIT_SEAT_PROXY, ConsoleKitSeatProxyPrivate);
01737   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), console_kit_seat_interface_info ());
01738 }
01739 
01740 static void
01741 console_kit_seat_proxy_class_init (ConsoleKitSeatProxyClass *klass)
01742 {
01743   GObjectClass *gobject_class;
01744   GDBusProxyClass *proxy_class;
01745 
01746   g_type_class_add_private (klass, sizeof (ConsoleKitSeatProxyPrivate));
01747 
01748   gobject_class = G_OBJECT_CLASS (klass);
01749   gobject_class->finalize     = console_kit_seat_proxy_finalize;
01750   gobject_class->get_property = console_kit_seat_proxy_get_property;
01751   gobject_class->set_property = console_kit_seat_proxy_set_property;
01752 
01753   proxy_class = G_DBUS_PROXY_CLASS (klass);
01754   proxy_class->g_signal = console_kit_seat_proxy_g_signal;
01755   proxy_class->g_properties_changed = console_kit_seat_proxy_g_properties_changed;
01756 
01757 }
01758 
01759 static void
01760 console_kit_seat_proxy_iface_init (ConsoleKitSeatIface *iface)
01761 {
01762 }
01763 
01781 void
01782 console_kit_seat_proxy_new (
01783     GDBusConnection     *connection,
01784     GDBusProxyFlags      flags,
01785     const gchar         *name,
01786     const gchar         *object_path,
01787     GCancellable        *cancellable,
01788     GAsyncReadyCallback  callback,
01789     gpointer             user_data)
01790 {
01791   g_async_initable_new_async (TYPE_CONSOLE_KIT_SEAT_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.freedesktop.ConsoleKit.Seat", NULL);
01792 }
01793 
01803 ConsoleKitSeat *
01804 console_kit_seat_proxy_new_finish (
01805     GAsyncResult        *res,
01806     GError             **error)
01807 {
01808   GObject *ret;
01809   GObject *source_object;
01810   source_object = g_async_result_get_source_object (res);
01811   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
01812   g_object_unref (source_object);
01813   if (ret != NULL)
01814     return CONSOLE_KIT_SEAT (ret);
01815   else
01816     return NULL;
01817 }
01818 
01836 ConsoleKitSeat *
01837 console_kit_seat_proxy_new_sync (
01838     GDBusConnection     *connection,
01839     GDBusProxyFlags      flags,
01840     const gchar         *name,
01841     const gchar         *object_path,
01842     GCancellable        *cancellable,
01843     GError             **error)
01844 {
01845   GInitable *ret;
01846   ret = g_initable_new (TYPE_CONSOLE_KIT_SEAT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.ConsoleKit.Seat", NULL);
01847   if (ret != NULL)
01848     return CONSOLE_KIT_SEAT (ret);
01849   else
01850     return NULL;
01851 }
01852 
01853 
01871 void
01872 console_kit_seat_proxy_new_for_bus (
01873     GBusType             bus_type,
01874     GDBusProxyFlags      flags,
01875     const gchar         *name,
01876     const gchar         *object_path,
01877     GCancellable        *cancellable,
01878     GAsyncReadyCallback  callback,
01879     gpointer             user_data)
01880 {
01881   g_async_initable_new_async (TYPE_CONSOLE_KIT_SEAT_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.freedesktop.ConsoleKit.Seat", NULL);
01882 }
01883 
01893 ConsoleKitSeat *
01894 console_kit_seat_proxy_new_for_bus_finish (
01895     GAsyncResult        *res,
01896     GError             **error)
01897 {
01898   GObject *ret;
01899   GObject *source_object;
01900   source_object = g_async_result_get_source_object (res);
01901   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
01902   g_object_unref (source_object);
01903   if (ret != NULL)
01904     return CONSOLE_KIT_SEAT (ret);
01905   else
01906     return NULL;
01907 }
01908 
01926 ConsoleKitSeat *
01927 console_kit_seat_proxy_new_for_bus_sync (
01928     GBusType             bus_type,
01929     GDBusProxyFlags      flags,
01930     const gchar         *name,
01931     const gchar         *object_path,
01932     GCancellable        *cancellable,
01933     GError             **error)
01934 {
01935   GInitable *ret;
01936   ret = g_initable_new (TYPE_CONSOLE_KIT_SEAT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.ConsoleKit.Seat", NULL);
01937   if (ret != NULL)
01938     return CONSOLE_KIT_SEAT (ret);
01939   else
01940     return NULL;
01941 }
01942 
01943 
01944 /* ------------------------------------------------------------------------ */
01945 
01959 struct _ConsoleKitSeatSkeletonPrivate
01960 {
01961   GValue *properties;
01962   GList *changed_properties;
01963   GSource *changed_properties_idle_source;
01964   GMainContext *context;
01965   GMutex lock;
01966 };
01967 
01968 static void
01969 _console_kit_seat_skeleton_handle_method_call (
01970   GDBusConnection *connection,
01971   const gchar *sender,
01972   const gchar *object_path,
01973   const gchar *interface_name,
01974   const gchar *method_name,
01975   GVariant *parameters,
01976   GDBusMethodInvocation *invocation,
01977   gpointer user_data)
01978 {
01979   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (user_data);
01980   _ExtendedGDBusMethodInfo *info;
01981   GVariantIter iter;
01982   GVariant *child;
01983   GValue *paramv;
01984   guint num_params;
01985   guint num_extra;
01986   guint n;
01987   guint signal_id;
01988   GValue return_value = G_VALUE_INIT;
01989   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
01990   g_assert (info != NULL);
01991   num_params = g_variant_n_children (parameters);
01992   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
01993   n = 0;
01994   g_value_init (&paramv[n], TYPE_CONSOLE_KIT_SEAT);
01995   g_value_set_object (&paramv[n++], skeleton);
01996   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
01997   g_value_set_object (&paramv[n++], invocation);
01998   if (info->pass_fdlist)
01999     {
02000 #ifdef G_OS_UNIX
02001       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
02002       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
02003 #else
02004       g_assert_not_reached ();
02005 #endif
02006     }
02007   g_variant_iter_init (&iter, parameters);
02008   while ((child = g_variant_iter_next_value (&iter)) != NULL)
02009     {
02010       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
02011       if (arg_info->use_gvariant)
02012         {
02013           g_value_init (&paramv[n], G_TYPE_VARIANT);
02014           g_value_set_variant (&paramv[n], child);
02015           n++;
02016         }
02017       else
02018         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
02019       g_variant_unref (child);
02020     }
02021   signal_id = g_signal_lookup (info->signal_name, TYPE_CONSOLE_KIT_SEAT);
02022   g_value_init (&return_value, G_TYPE_BOOLEAN);
02023   g_signal_emitv (paramv, signal_id, 0, &return_value);
02024   if (!g_value_get_boolean (&return_value))
02025     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);
02026   g_value_unset (&return_value);
02027   for (n = 0; n < num_params + num_extra; n++)
02028     g_value_unset (&paramv[n]);
02029   g_free (paramv);
02030 }
02031 
02032 static GVariant *
02033 _console_kit_seat_skeleton_handle_get_property (
02034   GDBusConnection *connection,
02035   const gchar *sender,
02036   const gchar *object_path,
02037   const gchar *interface_name,
02038   const gchar *property_name,
02039   GError **error,
02040   gpointer user_data)
02041 {
02042   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (user_data);
02043   GValue value = G_VALUE_INIT;
02044   GParamSpec *pspec;
02045   _ExtendedGDBusPropertyInfo *info;
02046   GVariant *ret;
02047   ret = NULL;
02048   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_console_kit_seat_interface_info, property_name);
02049   g_assert (info != NULL);
02050   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
02051   if (pspec == NULL)
02052     {
02053       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
02054     }
02055   else
02056     {
02057       g_value_init (&value, pspec->value_type);
02058       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
02059       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
02060       g_value_unset (&value);
02061     }
02062   return ret;
02063 }
02064 
02065 static gboolean
02066 _console_kit_seat_skeleton_handle_set_property (
02067   GDBusConnection *connection,
02068   const gchar *sender,
02069   const gchar *object_path,
02070   const gchar *interface_name,
02071   const gchar *property_name,
02072   GVariant *variant,
02073   GError **error,
02074   gpointer user_data)
02075 {
02076   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (user_data);
02077   GValue value = G_VALUE_INIT;
02078   GParamSpec *pspec;
02079   _ExtendedGDBusPropertyInfo *info;
02080   gboolean ret;
02081   ret = FALSE;
02082   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_console_kit_seat_interface_info, property_name);
02083   g_assert (info != NULL);
02084   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
02085   if (pspec == NULL)
02086     {
02087       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
02088     }
02089   else
02090     {
02091       if (info->use_gvariant)
02092         g_value_set_variant (&value, variant);
02093       else
02094         g_dbus_gvariant_to_gvalue (variant, &value);
02095       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
02096       g_value_unset (&value);
02097       ret = TRUE;
02098     }
02099   return ret;
02100 }
02101 
02102 static const GDBusInterfaceVTable _console_kit_seat_skeleton_vtable =
02103 {
02104   _console_kit_seat_skeleton_handle_method_call,
02105   _console_kit_seat_skeleton_handle_get_property,
02106   _console_kit_seat_skeleton_handle_set_property
02107 };
02108 
02109 static GDBusInterfaceInfo *
02110 console_kit_seat_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
02111 {
02112   return console_kit_seat_interface_info ();
02113 }
02114 
02115 static GDBusInterfaceVTable *
02116 console_kit_seat_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
02117 {
02118   return (GDBusInterfaceVTable *) &_console_kit_seat_skeleton_vtable;
02119 }
02120 
02121 static GVariant *
02122 console_kit_seat_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
02123 {
02124   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (_skeleton);
02125 
02126   GVariantBuilder builder;
02127   guint n;
02128   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
02129   if (_console_kit_seat_interface_info.parent_struct.properties == NULL)
02130     goto out;
02131   for (n = 0; _console_kit_seat_interface_info.parent_struct.properties[n] != NULL; n++)
02132     {
02133       GDBusPropertyInfo *info = _console_kit_seat_interface_info.parent_struct.properties[n];
02134       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
02135         {
02136           GVariant *value;
02137           value = _console_kit_seat_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.freedesktop.ConsoleKit.Seat", info->name, NULL, skeleton);
02138           if (value != NULL)
02139             {
02140               g_variant_take_ref (value);
02141               g_variant_builder_add (&builder, "{sv}", info->name, value);
02142               g_variant_unref (value);
02143             }
02144         }
02145     }
02146 out:
02147   return g_variant_builder_end (&builder);
02148 }
02149 
02150 static void
02151 console_kit_seat_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
02152 {
02153 }
02154 
02155 static void
02156 _console_kit_seat_on_signal_active_session_changed (
02157     ConsoleKitSeat *object,
02158     const gchar *arg_ssid)
02159 {
02160   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (object);
02161 
02162   GList      *connections, *l;
02163   GVariant   *signal_variant;
02164   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
02165 
02166   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
02167                    arg_ssid));
02168   for (l = connections; l != NULL; l = l->next)
02169     {
02170       GDBusConnection *connection = l->data;
02171       g_dbus_connection_emit_signal (connection,
02172         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.ConsoleKit.Seat", "ActiveSessionChanged",
02173         signal_variant, NULL);
02174     }
02175   g_variant_unref (signal_variant);
02176   g_list_free_full (connections, g_object_unref);
02177 }
02178 
02179 static void
02180 _console_kit_seat_on_signal_session_added (
02181     ConsoleKitSeat *object,
02182     const gchar *arg_ssid)
02183 {
02184   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (object);
02185 
02186   GList      *connections, *l;
02187   GVariant   *signal_variant;
02188   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
02189 
02190   signal_variant = g_variant_ref_sink (g_variant_new ("(o)",
02191                    arg_ssid));
02192   for (l = connections; l != NULL; l = l->next)
02193     {
02194       GDBusConnection *connection = l->data;
02195       g_dbus_connection_emit_signal (connection,
02196         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.ConsoleKit.Seat", "SessionAdded",
02197         signal_variant, NULL);
02198     }
02199   g_variant_unref (signal_variant);
02200   g_list_free_full (connections, g_object_unref);
02201 }
02202 
02203 static void
02204 _console_kit_seat_on_signal_session_removed (
02205     ConsoleKitSeat *object,
02206     const gchar *arg_ssid)
02207 {
02208   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (object);
02209 
02210   GList      *connections, *l;
02211   GVariant   *signal_variant;
02212   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
02213 
02214   signal_variant = g_variant_ref_sink (g_variant_new ("(o)",
02215                    arg_ssid));
02216   for (l = connections; l != NULL; l = l->next)
02217     {
02218       GDBusConnection *connection = l->data;
02219       g_dbus_connection_emit_signal (connection,
02220         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.ConsoleKit.Seat", "SessionRemoved",
02221         signal_variant, NULL);
02222     }
02223   g_variant_unref (signal_variant);
02224   g_list_free_full (connections, g_object_unref);
02225 }
02226 
02227 static void
02228 _console_kit_seat_on_signal_device_added (
02229     ConsoleKitSeat *object,
02230     GVariant *arg_device)
02231 {
02232   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (object);
02233 
02234   GList      *connections, *l;
02235   GVariant   *signal_variant;
02236   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
02237 
02238   signal_variant = g_variant_ref_sink (g_variant_new ("(@(ss))",
02239                    arg_device));
02240   for (l = connections; l != NULL; l = l->next)
02241     {
02242       GDBusConnection *connection = l->data;
02243       g_dbus_connection_emit_signal (connection,
02244         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.ConsoleKit.Seat", "DeviceAdded",
02245         signal_variant, NULL);
02246     }
02247   g_variant_unref (signal_variant);
02248   g_list_free_full (connections, g_object_unref);
02249 }
02250 
02251 static void
02252 _console_kit_seat_on_signal_device_removed (
02253     ConsoleKitSeat *object,
02254     GVariant *arg_device)
02255 {
02256   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (object);
02257 
02258   GList      *connections, *l;
02259   GVariant   *signal_variant;
02260   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
02261 
02262   signal_variant = g_variant_ref_sink (g_variant_new ("(@(ss))",
02263                    arg_device));
02264   for (l = connections; l != NULL; l = l->next)
02265     {
02266       GDBusConnection *connection = l->data;
02267       g_dbus_connection_emit_signal (connection,
02268         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.ConsoleKit.Seat", "DeviceRemoved",
02269         signal_variant, NULL);
02270     }
02271   g_variant_unref (signal_variant);
02272   g_list_free_full (connections, g_object_unref);
02273 }
02274 
02275 static void console_kit_seat_skeleton_iface_init (ConsoleKitSeatIface *iface);
02276 G_DEFINE_TYPE_WITH_CODE (ConsoleKitSeatSkeleton, console_kit_seat_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
02277                          G_IMPLEMENT_INTERFACE (TYPE_CONSOLE_KIT_SEAT, console_kit_seat_skeleton_iface_init));
02278 
02279 static void
02280 console_kit_seat_skeleton_finalize (GObject *object)
02281 {
02282   ConsoleKitSeatSkeleton *skeleton = CONSOLE_KIT_SEAT_SKELETON (object);
02283   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
02284   if (skeleton->priv->changed_properties_idle_source != NULL)
02285     g_source_destroy (skeleton->priv->changed_properties_idle_source);
02286   g_main_context_unref (skeleton->priv->context);
02287   g_mutex_clear (&skeleton->priv->lock);
02288   G_OBJECT_CLASS (console_kit_seat_skeleton_parent_class)->finalize (object);
02289 }
02290 
02291 static void
02292 console_kit_seat_skeleton_init (ConsoleKitSeatSkeleton *skeleton)
02293 {
02294   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_CONSOLE_KIT_SEAT_SKELETON, ConsoleKitSeatSkeletonPrivate);
02295   g_mutex_init (&skeleton->priv->lock);
02296   skeleton->priv->context = g_main_context_ref_thread_default ();
02297 }
02298 
02299 static void
02300 console_kit_seat_skeleton_class_init (ConsoleKitSeatSkeletonClass *klass)
02301 {
02302   GObjectClass *gobject_class;
02303   GDBusInterfaceSkeletonClass *skeleton_class;
02304 
02305   g_type_class_add_private (klass, sizeof (ConsoleKitSeatSkeletonPrivate));
02306 
02307   gobject_class = G_OBJECT_CLASS (klass);
02308   gobject_class->finalize = console_kit_seat_skeleton_finalize;
02309 
02310   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
02311   skeleton_class->get_info = console_kit_seat_skeleton_dbus_interface_get_info;
02312   skeleton_class->get_properties = console_kit_seat_skeleton_dbus_interface_get_properties;
02313   skeleton_class->flush = console_kit_seat_skeleton_dbus_interface_flush;
02314   skeleton_class->get_vtable = console_kit_seat_skeleton_dbus_interface_get_vtable;
02315 }
02316 
02317 static void
02318 console_kit_seat_skeleton_iface_init (ConsoleKitSeatIface *iface)
02319 {
02320   iface->active_session_changed = _console_kit_seat_on_signal_active_session_changed;
02321   iface->session_added = _console_kit_seat_on_signal_session_added;
02322   iface->session_removed = _console_kit_seat_on_signal_session_removed;
02323   iface->device_added = _console_kit_seat_on_signal_device_added;
02324   iface->device_removed = _console_kit_seat_on_signal_device_removed;
02325 }
02326 
02334 ConsoleKitSeat *
02335 console_kit_seat_skeleton_new (void)
02336 {
02337   return CONSOLE_KIT_SEAT (g_object_new (TYPE_CONSOLE_KIT_SEAT_SKELETON, NULL));
02338 }
02339