Back to index

bamf  0.2.120
bamf-gdbus-indicator-source-generated.c
Go to the documentation of this file.
00001 /*
00002  * Generated by gdbus-codegen 2.32.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 "bamf-gdbus-indicator-source-generated.h"
00012 
00013 #ifdef G_OS_UNIX
00014 #  include <gio/gunixfdlist.h>
00015 #endif
00016 
00017 typedef struct
00018 {
00019   GDBusArgInfo parent_struct;
00020   gboolean use_gvariant;
00021 } _ExtendedGDBusArgInfo;
00022 
00023 typedef struct
00024 {
00025   GDBusMethodInfo parent_struct;
00026   const gchar *signal_name;
00027   gboolean pass_fdlist;
00028 } _ExtendedGDBusMethodInfo;
00029 
00030 typedef struct
00031 {
00032   GDBusSignalInfo parent_struct;
00033   const gchar *signal_name;
00034 } _ExtendedGDBusSignalInfo;
00035 
00036 typedef struct
00037 {
00038   GDBusPropertyInfo parent_struct;
00039   const gchar *hyphen_name;
00040   gboolean use_gvariant;
00041 } _ExtendedGDBusPropertyInfo;
00042 
00043 typedef struct
00044 {
00045   GDBusInterfaceInfo parent_struct;
00046   const gchar *hyphen_name;
00047 } _ExtendedGDBusInterfaceInfo;
00048 
00049 typedef struct
00050 {
00051   const _ExtendedGDBusPropertyInfo *info;
00052   guint prop_id;
00053   GValue orig_value; /* the value before the change */
00054 } ChangedProperty;
00055 
00056 static void
00057 _changed_property_free (ChangedProperty *data)
00058 {
00059   g_value_unset (&data->orig_value);
00060   g_free (data);
00061 }
00062 
00063 static gboolean
00064 _g_strv_equal0 (gchar **a, gchar **b)
00065 {
00066   gboolean ret = FALSE;
00067   guint n;
00068   if (a == NULL && b == NULL)
00069     {
00070       ret = TRUE;
00071       goto out;
00072     }
00073   if (a == NULL || b == NULL)
00074     goto out;
00075   if (g_strv_length (a) != g_strv_length (b))
00076     goto out;
00077   for (n = 0; a[n] != NULL; n++)
00078     if (g_strcmp0 (a[n], b[n]) != 0)
00079       goto out;
00080   ret = TRUE;
00081 out:
00082   return ret;
00083 }
00084 
00085 static gboolean
00086 _g_variant_equal0 (GVariant *a, GVariant *b)
00087 {
00088   gboolean ret = FALSE;
00089   if (a == NULL && b == NULL)
00090     {
00091       ret = TRUE;
00092       goto out;
00093     }
00094   if (a == NULL || b == NULL)
00095     goto out;
00096   ret = g_variant_equal (a, b);
00097 out:
00098   return ret;
00099 }
00100 
00101 G_GNUC_UNUSED static gboolean
00102 _g_value_equal (const GValue *a, const GValue *b)
00103 {
00104   gboolean ret = FALSE;
00105   g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
00106   switch (G_VALUE_TYPE (a))
00107     {
00108       case G_TYPE_BOOLEAN:
00109         ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
00110         break;
00111       case G_TYPE_UCHAR:
00112         ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
00113         break;
00114       case G_TYPE_INT:
00115         ret = (g_value_get_int (a) == g_value_get_int (b));
00116         break;
00117       case G_TYPE_UINT:
00118         ret = (g_value_get_uint (a) == g_value_get_uint (b));
00119         break;
00120       case G_TYPE_INT64:
00121         ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
00122         break;
00123       case G_TYPE_UINT64:
00124         ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
00125         break;
00126       case G_TYPE_DOUBLE:
00127         ret = (g_value_get_double (a) == g_value_get_double (b));
00128         break;
00129       case G_TYPE_STRING:
00130         ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
00131         break;
00132       case G_TYPE_VARIANT:
00133         ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
00134         break;
00135       default:
00136         if (G_VALUE_TYPE (a) == G_TYPE_STRV)
00137           ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
00138         else
00139           g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
00140         break;
00141     }
00142   return ret;
00143 }
00144 
00145 /* ------------------------------------------------------------------------
00146  * Code for interface com.canonical.StatusNotifierApprover
00147  * ------------------------------------------------------------------------
00148  */
00149 
00158 /* ---- Introspection data for com.canonical.StatusNotifierApprover ---- */
00159 
00160 static const _ExtendedGDBusArgInfo _status_notifier_approver__method_info_approve_item_IN_ARG_id =
00161 {
00162   {
00163     -1,
00164     "id",
00165     "s",
00166     NULL
00167   },
00168   FALSE
00169 };
00170 
00171 static const _ExtendedGDBusArgInfo _status_notifier_approver__method_info_approve_item_IN_ARG_category =
00172 {
00173   {
00174     -1,
00175     "category",
00176     "s",
00177     NULL
00178   },
00179   FALSE
00180 };
00181 
00182 static const _ExtendedGDBusArgInfo _status_notifier_approver__method_info_approve_item_IN_ARG_pid =
00183 {
00184   {
00185     -1,
00186     "pid",
00187     "u",
00188     NULL
00189   },
00190   FALSE
00191 };
00192 
00193 static const _ExtendedGDBusArgInfo _status_notifier_approver__method_info_approve_item_IN_ARG_address =
00194 {
00195   {
00196     -1,
00197     "address",
00198     "s",
00199     NULL
00200   },
00201   FALSE
00202 };
00203 
00204 static const _ExtendedGDBusArgInfo _status_notifier_approver__method_info_approve_item_IN_ARG_path =
00205 {
00206   {
00207     -1,
00208     "path",
00209     "o",
00210     NULL
00211   },
00212   FALSE
00213 };
00214 
00215 static const _ExtendedGDBusArgInfo * const _status_notifier_approver__method_info_approve_item_IN_ARG_pointers[] =
00216 {
00217   &_status_notifier_approver__method_info_approve_item_IN_ARG_id,
00218   &_status_notifier_approver__method_info_approve_item_IN_ARG_category,
00219   &_status_notifier_approver__method_info_approve_item_IN_ARG_pid,
00220   &_status_notifier_approver__method_info_approve_item_IN_ARG_address,
00221   &_status_notifier_approver__method_info_approve_item_IN_ARG_path,
00222   NULL
00223 };
00224 
00225 static const _ExtendedGDBusArgInfo _status_notifier_approver__method_info_approve_item_OUT_ARG_approved =
00226 {
00227   {
00228     -1,
00229     "approved",
00230     "b",
00231     NULL
00232   },
00233   FALSE
00234 };
00235 
00236 static const _ExtendedGDBusArgInfo * const _status_notifier_approver__method_info_approve_item_OUT_ARG_pointers[] =
00237 {
00238   &_status_notifier_approver__method_info_approve_item_OUT_ARG_approved,
00239   NULL
00240 };
00241 
00242 static const _ExtendedGDBusMethodInfo _status_notifier_approver__method_info_approve_item =
00243 {
00244   {
00245     -1,
00246     "ApproveItem",
00247     (GDBusArgInfo **) &_status_notifier_approver__method_info_approve_item_IN_ARG_pointers,
00248     (GDBusArgInfo **) &_status_notifier_approver__method_info_approve_item_OUT_ARG_pointers,
00249     NULL
00250   },
00251   "handle-approve-item",
00252   FALSE
00253 };
00254 
00255 static const _ExtendedGDBusMethodInfo * const _status_notifier_approver__method_info_pointers[] =
00256 {
00257   &_status_notifier_approver__method_info_approve_item,
00258   NULL
00259 };
00260 
00261 static const _ExtendedGDBusArgInfo _status_notifier_approver__signal_info_revise_judgement_ARG_approved =
00262 {
00263   {
00264     -1,
00265     "approved",
00266     "b",
00267     NULL
00268   },
00269   FALSE
00270 };
00271 
00272 static const _ExtendedGDBusArgInfo _status_notifier_approver__signal_info_revise_judgement_ARG_address =
00273 {
00274   {
00275     -1,
00276     "address",
00277     "s",
00278     NULL
00279   },
00280   FALSE
00281 };
00282 
00283 static const _ExtendedGDBusArgInfo _status_notifier_approver__signal_info_revise_judgement_ARG_path =
00284 {
00285   {
00286     -1,
00287     "path",
00288     "o",
00289     NULL
00290   },
00291   FALSE
00292 };
00293 
00294 static const _ExtendedGDBusArgInfo * const _status_notifier_approver__signal_info_revise_judgement_ARG_pointers[] =
00295 {
00296   &_status_notifier_approver__signal_info_revise_judgement_ARG_approved,
00297   &_status_notifier_approver__signal_info_revise_judgement_ARG_address,
00298   &_status_notifier_approver__signal_info_revise_judgement_ARG_path,
00299   NULL
00300 };
00301 
00302 static const _ExtendedGDBusSignalInfo _status_notifier_approver__signal_info_revise_judgement =
00303 {
00304   {
00305     -1,
00306     "ReviseJudgement",
00307     (GDBusArgInfo **) &_status_notifier_approver__signal_info_revise_judgement_ARG_pointers,
00308     NULL
00309   },
00310   "revise-judgement"
00311 };
00312 
00313 static const _ExtendedGDBusSignalInfo * const _status_notifier_approver__signal_info_pointers[] =
00314 {
00315   &_status_notifier_approver__signal_info_revise_judgement,
00316   NULL
00317 };
00318 
00319 static const _ExtendedGDBusInterfaceInfo _status_notifier_approver__interface_info =
00320 {
00321   {
00322     -1,
00323     "com.canonical.StatusNotifierApprover",
00324     (GDBusMethodInfo **) &_status_notifier_approver__method_info_pointers,
00325     (GDBusSignalInfo **) &_status_notifier_approver__signal_info_pointers,
00326     NULL,
00327     NULL
00328   },
00329   "",
00330 };
00331 
00332 
00340 GDBusInterfaceInfo *
00341 status_notifier_approver__interface_info (void)
00342 {
00343   return (GDBusInterfaceInfo *) &_status_notifier_approver__interface_info;
00344 }
00345 
00356 guint
00357 status_notifier_approver__override_properties (GObjectClass *klass, guint property_id_begin)
00358 {
00359   return property_id_begin - 1;
00360 }
00361 
00362 
00363 
00379 static void
00380 status_notifier_approver__default_init (StatusNotifierApproverIface *iface)
00381 {
00382   /* GObject signals for incoming D-Bus method calls: */
00399   g_signal_new ("handle-approve-item",
00400     G_TYPE_FROM_INTERFACE (iface),
00401     G_SIGNAL_RUN_LAST,
00402     G_STRUCT_OFFSET (StatusNotifierApproverIface, handle_approve_item),
00403     g_signal_accumulator_true_handled,
00404     NULL,
00405     g_cclosure_marshal_generic,
00406     G_TYPE_BOOLEAN,
00407     6,
00408     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING);
00409 
00410   /* GObject signals for received D-Bus signals: */
00422   g_signal_new ("revise-judgement",
00423     G_TYPE_FROM_INTERFACE (iface),
00424     G_SIGNAL_RUN_LAST,
00425     G_STRUCT_OFFSET (StatusNotifierApproverIface, revise_judgement),
00426     NULL,
00427     NULL,
00428     g_cclosure_marshal_generic,
00429     G_TYPE_NONE,
00430     3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING);
00431 
00432 }
00433 
00434 typedef StatusNotifierApproverIface StatusNotifierApproverInterface;
00435 G_DEFINE_INTERFACE (StatusNotifierApprover, status_notifier_approver_, G_TYPE_OBJECT);
00436 
00446 void
00447 status_notifier_approver__emit_revise_judgement (
00448     StatusNotifierApprover *object,
00449     gboolean arg_approved,
00450     const gchar *arg_address,
00451     const gchar *arg_path)
00452 {
00453   g_signal_emit_by_name (object, "revise-judgement", arg_approved, arg_address, arg_path);
00454 }
00455 
00474 void
00475 status_notifier_approver__call_approve_item (
00476     StatusNotifierApprover *proxy,
00477     const gchar *arg_id,
00478     const gchar *arg_category,
00479     guint arg_pid,
00480     const gchar *arg_address,
00481     const gchar *arg_path,
00482     GCancellable *cancellable,
00483     GAsyncReadyCallback callback,
00484     gpointer user_data)
00485 {
00486   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
00487     "ApproveItem",
00488     g_variant_new ("(ssuso)",
00489                    arg_id,
00490                    arg_category,
00491                    arg_pid,
00492                    arg_address,
00493                    arg_path),
00494     G_DBUS_CALL_FLAGS_NONE,
00495     -1,
00496     cancellable,
00497     callback,
00498     user_data);
00499 }
00500 
00512 gboolean
00513 status_notifier_approver__call_approve_item_finish (
00514     StatusNotifierApprover *proxy,
00515     gboolean *out_approved,
00516     GAsyncResult *res,
00517     GError **error)
00518 {
00519   GVariant *_ret;
00520   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
00521   if (_ret == NULL)
00522     goto _out;
00523   g_variant_get (_ret,
00524                  "(b)",
00525                  out_approved);
00526   g_variant_unref (_ret);
00527 _out:
00528   return _ret != NULL;
00529 }
00530 
00549 gboolean
00550 status_notifier_approver__call_approve_item_sync (
00551     StatusNotifierApprover *proxy,
00552     const gchar *arg_id,
00553     const gchar *arg_category,
00554     guint arg_pid,
00555     const gchar *arg_address,
00556     const gchar *arg_path,
00557     gboolean *out_approved,
00558     GCancellable *cancellable,
00559     GError **error)
00560 {
00561   GVariant *_ret;
00562   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
00563     "ApproveItem",
00564     g_variant_new ("(ssuso)",
00565                    arg_id,
00566                    arg_category,
00567                    arg_pid,
00568                    arg_address,
00569                    arg_path),
00570     G_DBUS_CALL_FLAGS_NONE,
00571     -1,
00572     cancellable,
00573     error);
00574   if (_ret == NULL)
00575     goto _out;
00576   g_variant_get (_ret,
00577                  "(b)",
00578                  out_approved);
00579   g_variant_unref (_ret);
00580 _out:
00581   return _ret != NULL;
00582 }
00583 
00594 void
00595 status_notifier_approver__complete_approve_item (
00596     StatusNotifierApprover *object,
00597     GDBusMethodInvocation *invocation,
00598     gboolean approved)
00599 {
00600   g_dbus_method_invocation_return_value (invocation,
00601     g_variant_new ("(b)",
00602                    approved));
00603 }
00604 
00605 /* ------------------------------------------------------------------------ */
00606 
00620 struct _StatusNotifierApproverProxyPrivate
00621 {
00622   GData *qdata;
00623 };
00624 
00625 static void status_notifier_approver__proxy_iface_init (StatusNotifierApproverIface *iface);
00626 
00627 G_DEFINE_TYPE_WITH_CODE (StatusNotifierApproverProxy, status_notifier_approver__proxy, G_TYPE_DBUS_PROXY,
00628                          G_IMPLEMENT_INTERFACE (STATUS_NOTIFIER_APPROVER_TYPE_, status_notifier_approver__proxy_iface_init));
00629 
00630 static void
00631 status_notifier_approver__proxy_finalize (GObject *object)
00632 {
00633   StatusNotifierApproverProxy *proxy = STATUS_NOTIFIER_APPROVER__PROXY (object);
00634   g_datalist_clear (&proxy->priv->qdata);
00635   G_OBJECT_CLASS (status_notifier_approver__proxy_parent_class)->finalize (object);
00636 }
00637 
00638 static void
00639 status_notifier_approver__proxy_get_property (GObject      *object,
00640   guint         prop_id,
00641   GValue       *value,
00642   GParamSpec   *pspec)
00643 {
00644 }
00645 
00646 static void
00647 status_notifier_approver__proxy_set_property (GObject      *object,
00648   guint         prop_id,
00649   const GValue *value,
00650   GParamSpec   *pspec)
00651 {
00652 }
00653 
00654 static void
00655 status_notifier_approver__proxy_g_signal (GDBusProxy *proxy,
00656   const gchar *sender_name,
00657   const gchar *signal_name,
00658   GVariant *parameters)
00659 {
00660   _ExtendedGDBusSignalInfo *info;
00661   GVariantIter iter;
00662   GVariant *child;
00663   GValue *paramv;
00664   guint num_params;
00665   guint n;
00666   guint signal_id;
00667   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_status_notifier_approver__interface_info, signal_name);
00668   if (info == NULL)
00669     return;
00670   num_params = g_variant_n_children (parameters);
00671   paramv = g_new0 (GValue, num_params + 1);
00672   g_value_init (&paramv[0], STATUS_NOTIFIER_APPROVER_TYPE_);
00673   g_value_set_object (&paramv[0], proxy);
00674   g_variant_iter_init (&iter, parameters);
00675   n = 1;
00676   while ((child = g_variant_iter_next_value (&iter)) != NULL)
00677     {
00678       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
00679       if (arg_info->use_gvariant)
00680         {
00681           g_value_init (&paramv[n], G_TYPE_VARIANT);
00682           g_value_set_variant (&paramv[n], child);
00683           n++;
00684         }
00685       else
00686         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
00687       g_variant_unref (child);
00688     }
00689   signal_id = g_signal_lookup (info->signal_name, STATUS_NOTIFIER_APPROVER_TYPE_);
00690   g_signal_emitv (paramv, signal_id, 0, NULL);
00691   for (n = 0; n < num_params + 1; n++)
00692     g_value_unset (&paramv[n]);
00693   g_free (paramv);
00694 }
00695 
00696 static void
00697 status_notifier_approver__proxy_g_properties_changed (GDBusProxy *_proxy,
00698   GVariant *changed_properties,
00699   const gchar *const *invalidated_properties)
00700 {
00701   StatusNotifierApproverProxy *proxy = STATUS_NOTIFIER_APPROVER__PROXY (_proxy);
00702   guint n;
00703   const gchar *key;
00704   GVariantIter *iter;
00705   _ExtendedGDBusPropertyInfo *info;
00706   g_variant_get (changed_properties, "a{sv}", &iter);
00707   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
00708     {
00709       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_status_notifier_approver__interface_info, key);
00710       g_datalist_remove_data (&proxy->priv->qdata, key);
00711       if (info != NULL)
00712         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
00713     }
00714   g_variant_iter_free (iter);
00715   for (n = 0; invalidated_properties[n] != NULL; n++)
00716     {
00717       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_status_notifier_approver__interface_info, invalidated_properties[n]);
00718       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
00719       if (info != NULL)
00720         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
00721     }
00722 }
00723 
00724 static void
00725 status_notifier_approver__proxy_init (StatusNotifierApproverProxy *proxy)
00726 {
00727   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, STATUS_NOTIFIER_APPROVER_TYPE__PROXY, StatusNotifierApproverProxyPrivate);
00728   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), status_notifier_approver__interface_info ());
00729 }
00730 
00731 static void
00732 status_notifier_approver__proxy_class_init (StatusNotifierApproverProxyClass *klass)
00733 {
00734   GObjectClass *gobject_class;
00735   GDBusProxyClass *proxy_class;
00736 
00737   g_type_class_add_private (klass, sizeof (StatusNotifierApproverProxyPrivate));
00738 
00739   gobject_class = G_OBJECT_CLASS (klass);
00740   gobject_class->finalize     = status_notifier_approver__proxy_finalize;
00741   gobject_class->get_property = status_notifier_approver__proxy_get_property;
00742   gobject_class->set_property = status_notifier_approver__proxy_set_property;
00743 
00744   proxy_class = G_DBUS_PROXY_CLASS (klass);
00745   proxy_class->g_signal = status_notifier_approver__proxy_g_signal;
00746   proxy_class->g_properties_changed = status_notifier_approver__proxy_g_properties_changed;
00747 
00748 }
00749 
00750 static void
00751 status_notifier_approver__proxy_iface_init (StatusNotifierApproverIface *iface)
00752 {
00753 }
00754 
00772 void
00773 status_notifier_approver__proxy_new (
00774     GDBusConnection     *connection,
00775     GDBusProxyFlags      flags,
00776     const gchar         *name,
00777     const gchar         *object_path,
00778     GCancellable        *cancellable,
00779     GAsyncReadyCallback  callback,
00780     gpointer             user_data)
00781 {
00782   g_async_initable_new_async (STATUS_NOTIFIER_APPROVER_TYPE__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", "com.canonical.StatusNotifierApprover", NULL);
00783 }
00784 
00794 StatusNotifierApprover *
00795 status_notifier_approver__proxy_new_finish (
00796     GAsyncResult        *res,
00797     GError             **error)
00798 {
00799   GObject *ret;
00800   GObject *source_object;
00801   source_object = g_async_result_get_source_object (res);
00802   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
00803   g_object_unref (source_object);
00804   if (ret != NULL)
00805     return STATUS_NOTIFIER_APPROVER_ (ret);
00806   else
00807     return NULL;
00808 }
00809 
00827 StatusNotifierApprover *
00828 status_notifier_approver__proxy_new_sync (
00829     GDBusConnection     *connection,
00830     GDBusProxyFlags      flags,
00831     const gchar         *name,
00832     const gchar         *object_path,
00833     GCancellable        *cancellable,
00834     GError             **error)
00835 {
00836   GInitable *ret;
00837   ret = g_initable_new (STATUS_NOTIFIER_APPROVER_TYPE__PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.canonical.StatusNotifierApprover", NULL);
00838   if (ret != NULL)
00839     return STATUS_NOTIFIER_APPROVER_ (ret);
00840   else
00841     return NULL;
00842 }
00843 
00844 
00862 void
00863 status_notifier_approver__proxy_new_for_bus (
00864     GBusType             bus_type,
00865     GDBusProxyFlags      flags,
00866     const gchar         *name,
00867     const gchar         *object_path,
00868     GCancellable        *cancellable,
00869     GAsyncReadyCallback  callback,
00870     gpointer             user_data)
00871 {
00872   g_async_initable_new_async (STATUS_NOTIFIER_APPROVER_TYPE__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", "com.canonical.StatusNotifierApprover", NULL);
00873 }
00874 
00884 StatusNotifierApprover *
00885 status_notifier_approver__proxy_new_for_bus_finish (
00886     GAsyncResult        *res,
00887     GError             **error)
00888 {
00889   GObject *ret;
00890   GObject *source_object;
00891   source_object = g_async_result_get_source_object (res);
00892   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
00893   g_object_unref (source_object);
00894   if (ret != NULL)
00895     return STATUS_NOTIFIER_APPROVER_ (ret);
00896   else
00897     return NULL;
00898 }
00899 
00917 StatusNotifierApprover *
00918 status_notifier_approver__proxy_new_for_bus_sync (
00919     GBusType             bus_type,
00920     GDBusProxyFlags      flags,
00921     const gchar         *name,
00922     const gchar         *object_path,
00923     GCancellable        *cancellable,
00924     GError             **error)
00925 {
00926   GInitable *ret;
00927   ret = g_initable_new (STATUS_NOTIFIER_APPROVER_TYPE__PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.canonical.StatusNotifierApprover", NULL);
00928   if (ret != NULL)
00929     return STATUS_NOTIFIER_APPROVER_ (ret);
00930   else
00931     return NULL;
00932 }
00933 
00934 
00935 /* ------------------------------------------------------------------------ */
00936 
00950 struct _StatusNotifierApproverSkeletonPrivate
00951 {
00952   GValue *properties;
00953   GList *changed_properties;
00954   GSource *changed_properties_idle_source;
00955   GMainContext *context;
00956   GMutex lock;
00957 };
00958 
00959 static void
00960 _status_notifier_approver__skeleton_handle_method_call (
00961   GDBusConnection *connection,
00962   const gchar *sender,
00963   const gchar *object_path,
00964   const gchar *interface_name,
00965   const gchar *method_name,
00966   GVariant *parameters,
00967   GDBusMethodInvocation *invocation,
00968   gpointer user_data)
00969 {
00970   StatusNotifierApproverSkeleton *skeleton = STATUS_NOTIFIER_APPROVER__SKELETON (user_data);
00971   _ExtendedGDBusMethodInfo *info;
00972   GVariantIter iter;
00973   GVariant *child;
00974   GValue *paramv;
00975   guint num_params;
00976   guint num_extra;
00977   guint n;
00978   guint signal_id;
00979   GValue return_value = G_VALUE_INIT;
00980   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
00981   g_assert (info != NULL);
00982   num_params = g_variant_n_children (parameters);
00983   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
00984   n = 0;
00985   g_value_init (&paramv[n], STATUS_NOTIFIER_APPROVER_TYPE_);
00986   g_value_set_object (&paramv[n++], skeleton);
00987   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
00988   g_value_set_object (&paramv[n++], invocation);
00989   if (info->pass_fdlist)
00990     {
00991 #ifdef G_OS_UNIX
00992       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
00993       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
00994 #else
00995       g_assert_not_reached ();
00996 #endif
00997     }
00998   g_variant_iter_init (&iter, parameters);
00999   while ((child = g_variant_iter_next_value (&iter)) != NULL)
01000     {
01001       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
01002       if (arg_info->use_gvariant)
01003         {
01004           g_value_init (&paramv[n], G_TYPE_VARIANT);
01005           g_value_set_variant (&paramv[n], child);
01006           n++;
01007         }
01008       else
01009         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
01010       g_variant_unref (child);
01011     }
01012   signal_id = g_signal_lookup (info->signal_name, STATUS_NOTIFIER_APPROVER_TYPE_);
01013   g_value_init (&return_value, G_TYPE_BOOLEAN);
01014   g_signal_emitv (paramv, signal_id, 0, &return_value);
01015   if (!g_value_get_boolean (&return_value))
01016     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);
01017   g_value_unset (&return_value);
01018   for (n = 0; n < num_params + num_extra; n++)
01019     g_value_unset (&paramv[n]);
01020   g_free (paramv);
01021 }
01022 
01023 static GVariant *
01024 _status_notifier_approver__skeleton_handle_get_property (
01025   GDBusConnection *connection,
01026   const gchar *sender,
01027   const gchar *object_path,
01028   const gchar *interface_name,
01029   const gchar *property_name,
01030   GError **error,
01031   gpointer user_data)
01032 {
01033   StatusNotifierApproverSkeleton *skeleton = STATUS_NOTIFIER_APPROVER__SKELETON (user_data);
01034   GValue value = G_VALUE_INIT;
01035   GParamSpec *pspec;
01036   _ExtendedGDBusPropertyInfo *info;
01037   GVariant *ret;
01038   ret = NULL;
01039   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_status_notifier_approver__interface_info, property_name);
01040   g_assert (info != NULL);
01041   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
01042   if (pspec == NULL)
01043     {
01044       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
01045     }
01046   else
01047     {
01048       g_value_init (&value, pspec->value_type);
01049       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
01050       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
01051       g_value_unset (&value);
01052     }
01053   return ret;
01054 }
01055 
01056 static gboolean
01057 _status_notifier_approver__skeleton_handle_set_property (
01058   GDBusConnection *connection,
01059   const gchar *sender,
01060   const gchar *object_path,
01061   const gchar *interface_name,
01062   const gchar *property_name,
01063   GVariant *variant,
01064   GError **error,
01065   gpointer user_data)
01066 {
01067   StatusNotifierApproverSkeleton *skeleton = STATUS_NOTIFIER_APPROVER__SKELETON (user_data);
01068   GValue value = G_VALUE_INIT;
01069   GParamSpec *pspec;
01070   _ExtendedGDBusPropertyInfo *info;
01071   gboolean ret;
01072   ret = FALSE;
01073   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_status_notifier_approver__interface_info, property_name);
01074   g_assert (info != NULL);
01075   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
01076   if (pspec == NULL)
01077     {
01078       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
01079     }
01080   else
01081     {
01082       if (info->use_gvariant)
01083         g_value_set_variant (&value, variant);
01084       else
01085         g_dbus_gvariant_to_gvalue (variant, &value);
01086       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
01087       g_value_unset (&value);
01088       ret = TRUE;
01089     }
01090   return ret;
01091 }
01092 
01093 static const GDBusInterfaceVTable _status_notifier_approver__skeleton_vtable =
01094 {
01095   _status_notifier_approver__skeleton_handle_method_call,
01096   _status_notifier_approver__skeleton_handle_get_property,
01097   _status_notifier_approver__skeleton_handle_set_property
01098 };
01099 
01100 static GDBusInterfaceInfo *
01101 status_notifier_approver__skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
01102 {
01103   return status_notifier_approver__interface_info ();
01104 }
01105 
01106 static GDBusInterfaceVTable *
01107 status_notifier_approver__skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
01108 {
01109   return (GDBusInterfaceVTable *) &_status_notifier_approver__skeleton_vtable;
01110 }
01111 
01112 static GVariant *
01113 status_notifier_approver__skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
01114 {
01115   StatusNotifierApproverSkeleton *skeleton = STATUS_NOTIFIER_APPROVER__SKELETON (_skeleton);
01116 
01117   GVariantBuilder builder;
01118   guint n;
01119   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
01120   if (_status_notifier_approver__interface_info.parent_struct.properties == NULL)
01121     goto out;
01122   for (n = 0; _status_notifier_approver__interface_info.parent_struct.properties[n] != NULL; n++)
01123     {
01124       GDBusPropertyInfo *info = _status_notifier_approver__interface_info.parent_struct.properties[n];
01125       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
01126         {
01127           GVariant *value;
01128           value = _status_notifier_approver__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)), "com.canonical.StatusNotifierApprover", info->name, NULL, skeleton);
01129           if (value != NULL)
01130             {
01131               g_variant_take_ref (value);
01132               g_variant_builder_add (&builder, "{sv}", info->name, value);
01133               g_variant_unref (value);
01134             }
01135         }
01136     }
01137 out:
01138   return g_variant_builder_end (&builder);
01139 }
01140 
01141 static void
01142 status_notifier_approver__skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
01143 {
01144 }
01145 
01146 static void
01147 _status_notifier_approver__on_signal_revise_judgement (
01148     StatusNotifierApprover *object,
01149     gboolean arg_approved,
01150     const gchar *arg_address,
01151     const gchar *arg_path)
01152 {
01153   StatusNotifierApproverSkeleton *skeleton = STATUS_NOTIFIER_APPROVER__SKELETON (object);
01154 
01155   GList      *connections, *l;
01156   GVariant   *signal_variant;
01157   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
01158 
01159   signal_variant = g_variant_ref_sink (g_variant_new ("(bso)",
01160                    arg_approved,
01161                    arg_address,
01162                    arg_path));
01163   for (l = connections; l != NULL; l = l->next)
01164     {
01165       GDBusConnection *connection = l->data;
01166       g_dbus_connection_emit_signal (connection,
01167         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.canonical.StatusNotifierApprover", "ReviseJudgement",
01168         signal_variant, NULL);
01169     }
01170   g_variant_unref (signal_variant);
01171   g_list_free_full (connections, g_object_unref);
01172 }
01173 
01174 static void status_notifier_approver__skeleton_iface_init (StatusNotifierApproverIface *iface);
01175 G_DEFINE_TYPE_WITH_CODE (StatusNotifierApproverSkeleton, status_notifier_approver__skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
01176                          G_IMPLEMENT_INTERFACE (STATUS_NOTIFIER_APPROVER_TYPE_, status_notifier_approver__skeleton_iface_init));
01177 
01178 static void
01179 status_notifier_approver__skeleton_finalize (GObject *object)
01180 {
01181   StatusNotifierApproverSkeleton *skeleton = STATUS_NOTIFIER_APPROVER__SKELETON (object);
01182   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
01183   if (skeleton->priv->changed_properties_idle_source != NULL)
01184     g_source_destroy (skeleton->priv->changed_properties_idle_source);
01185   g_main_context_unref (skeleton->priv->context);
01186   g_mutex_clear (&skeleton->priv->lock);
01187   G_OBJECT_CLASS (status_notifier_approver__skeleton_parent_class)->finalize (object);
01188 }
01189 
01190 static void
01191 status_notifier_approver__skeleton_init (StatusNotifierApproverSkeleton *skeleton)
01192 {
01193   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, STATUS_NOTIFIER_APPROVER_TYPE__SKELETON, StatusNotifierApproverSkeletonPrivate);
01194   g_mutex_init (&skeleton->priv->lock);
01195   skeleton->priv->context = g_main_context_ref_thread_default ();
01196 }
01197 
01198 static void
01199 status_notifier_approver__skeleton_class_init (StatusNotifierApproverSkeletonClass *klass)
01200 {
01201   GObjectClass *gobject_class;
01202   GDBusInterfaceSkeletonClass *skeleton_class;
01203 
01204   g_type_class_add_private (klass, sizeof (StatusNotifierApproverSkeletonPrivate));
01205 
01206   gobject_class = G_OBJECT_CLASS (klass);
01207   gobject_class->finalize = status_notifier_approver__skeleton_finalize;
01208 
01209   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
01210   skeleton_class->get_info = status_notifier_approver__skeleton_dbus_interface_get_info;
01211   skeleton_class->get_properties = status_notifier_approver__skeleton_dbus_interface_get_properties;
01212   skeleton_class->flush = status_notifier_approver__skeleton_dbus_interface_flush;
01213   skeleton_class->get_vtable = status_notifier_approver__skeleton_dbus_interface_get_vtable;
01214 }
01215 
01216 static void
01217 status_notifier_approver__skeleton_iface_init (StatusNotifierApproverIface *iface)
01218 {
01219   iface->revise_judgement = _status_notifier_approver__on_signal_revise_judgement;
01220 }
01221 
01229 StatusNotifierApprover *
01230 status_notifier_approver__skeleton_new (void)
01231 {
01232   return STATUS_NOTIFIER_APPROVER_ (g_object_new (STATUS_NOTIFIER_APPROVER_TYPE__SKELETON, NULL));
01233 }
01234