Back to index

bamf  0.2.120
bamf-gdbus-browser-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-browser-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 org.ayatana.bamf.browser
00147  * ------------------------------------------------------------------------
00148  */
00149 
00158 /* ---- Introspection data for org.ayatana.bamf.browser ---- */
00159 
00160 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__method_info_tab_ids_OUT_ARG_ids =
00161 {
00162   {
00163     -1,
00164     "ids",
00165     "as",
00166     NULL
00167   },
00168   FALSE
00169 };
00170 
00171 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__method_info_tab_ids_OUT_ARG_pointers[] =
00172 {
00173   &_bamf_dbus_browser__method_info_tab_ids_OUT_ARG_ids,
00174   NULL
00175 };
00176 
00177 static const _ExtendedGDBusMethodInfo _bamf_dbus_browser__method_info_tab_ids =
00178 {
00179   {
00180     -1,
00181     "TabIds",
00182     NULL,
00183     (GDBusArgInfo **) &_bamf_dbus_browser__method_info_tab_ids_OUT_ARG_pointers,
00184     NULL
00185   },
00186   "handle-tab-ids",
00187   FALSE
00188 };
00189 
00190 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__method_info_show_tab_IN_ARG_id =
00191 {
00192   {
00193     -1,
00194     "id",
00195     "s",
00196     NULL
00197   },
00198   FALSE
00199 };
00200 
00201 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__method_info_show_tab_IN_ARG_pointers[] =
00202 {
00203   &_bamf_dbus_browser__method_info_show_tab_IN_ARG_id,
00204   NULL
00205 };
00206 
00207 static const _ExtendedGDBusMethodInfo _bamf_dbus_browser__method_info_show_tab =
00208 {
00209   {
00210     -1,
00211     "ShowTab",
00212     (GDBusArgInfo **) &_bamf_dbus_browser__method_info_show_tab_IN_ARG_pointers,
00213     NULL,
00214     NULL
00215   },
00216   "handle-show-tab",
00217   FALSE
00218 };
00219 
00220 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__method_info_tab_uri_IN_ARG_id =
00221 {
00222   {
00223     -1,
00224     "id",
00225     "s",
00226     NULL
00227   },
00228   FALSE
00229 };
00230 
00231 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__method_info_tab_uri_IN_ARG_pointers[] =
00232 {
00233   &_bamf_dbus_browser__method_info_tab_uri_IN_ARG_id,
00234   NULL
00235 };
00236 
00237 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__method_info_tab_uri_OUT_ARG_uri =
00238 {
00239   {
00240     -1,
00241     "uri",
00242     "s",
00243     NULL
00244   },
00245   FALSE
00246 };
00247 
00248 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__method_info_tab_uri_OUT_ARG_pointers[] =
00249 {
00250   &_bamf_dbus_browser__method_info_tab_uri_OUT_ARG_uri,
00251   NULL
00252 };
00253 
00254 static const _ExtendedGDBusMethodInfo _bamf_dbus_browser__method_info_tab_uri =
00255 {
00256   {
00257     -1,
00258     "TabUri",
00259     (GDBusArgInfo **) &_bamf_dbus_browser__method_info_tab_uri_IN_ARG_pointers,
00260     (GDBusArgInfo **) &_bamf_dbus_browser__method_info_tab_uri_OUT_ARG_pointers,
00261     NULL
00262   },
00263   "handle-tab-uri",
00264   FALSE
00265 };
00266 
00267 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__method_info_tab_preview_IN_ARG_id =
00268 {
00269   {
00270     -1,
00271     "id",
00272     "s",
00273     NULL
00274   },
00275   FALSE
00276 };
00277 
00278 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__method_info_tab_preview_IN_ARG_pointers[] =
00279 {
00280   &_bamf_dbus_browser__method_info_tab_preview_IN_ARG_id,
00281   NULL
00282 };
00283 
00284 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__method_info_tab_preview_OUT_ARG_preview =
00285 {
00286   {
00287     -1,
00288     "preview",
00289     "ay",
00290     NULL
00291   },
00292   FALSE
00293 };
00294 
00295 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__method_info_tab_preview_OUT_ARG_pointers[] =
00296 {
00297   &_bamf_dbus_browser__method_info_tab_preview_OUT_ARG_preview,
00298   NULL
00299 };
00300 
00301 static const _ExtendedGDBusMethodInfo _bamf_dbus_browser__method_info_tab_preview =
00302 {
00303   {
00304     -1,
00305     "TabPreview",
00306     (GDBusArgInfo **) &_bamf_dbus_browser__method_info_tab_preview_IN_ARG_pointers,
00307     (GDBusArgInfo **) &_bamf_dbus_browser__method_info_tab_preview_OUT_ARG_pointers,
00308     NULL
00309   },
00310   "handle-tab-preview",
00311   FALSE
00312 };
00313 
00314 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__method_info_tab_xid_IN_ARG_id =
00315 {
00316   {
00317     -1,
00318     "id",
00319     "s",
00320     NULL
00321   },
00322   FALSE
00323 };
00324 
00325 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__method_info_tab_xid_IN_ARG_pointers[] =
00326 {
00327   &_bamf_dbus_browser__method_info_tab_xid_IN_ARG_id,
00328   NULL
00329 };
00330 
00331 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__method_info_tab_xid_OUT_ARG_xid =
00332 {
00333   {
00334     -1,
00335     "xid",
00336     "u",
00337     NULL
00338   },
00339   FALSE
00340 };
00341 
00342 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__method_info_tab_xid_OUT_ARG_pointers[] =
00343 {
00344   &_bamf_dbus_browser__method_info_tab_xid_OUT_ARG_xid,
00345   NULL
00346 };
00347 
00348 static const _ExtendedGDBusMethodInfo _bamf_dbus_browser__method_info_tab_xid =
00349 {
00350   {
00351     -1,
00352     "TabXid",
00353     (GDBusArgInfo **) &_bamf_dbus_browser__method_info_tab_xid_IN_ARG_pointers,
00354     (GDBusArgInfo **) &_bamf_dbus_browser__method_info_tab_xid_OUT_ARG_pointers,
00355     NULL
00356   },
00357   "handle-tab-xid",
00358   FALSE
00359 };
00360 
00361 static const _ExtendedGDBusMethodInfo * const _bamf_dbus_browser__method_info_pointers[] =
00362 {
00363   &_bamf_dbus_browser__method_info_tab_ids,
00364   &_bamf_dbus_browser__method_info_show_tab,
00365   &_bamf_dbus_browser__method_info_tab_uri,
00366   &_bamf_dbus_browser__method_info_tab_preview,
00367   &_bamf_dbus_browser__method_info_tab_xid,
00368   NULL
00369 };
00370 
00371 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__signal_info_tab_opened_ARG_id =
00372 {
00373   {
00374     -1,
00375     "id",
00376     "s",
00377     NULL
00378   },
00379   FALSE
00380 };
00381 
00382 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__signal_info_tab_opened_ARG_pointers[] =
00383 {
00384   &_bamf_dbus_browser__signal_info_tab_opened_ARG_id,
00385   NULL
00386 };
00387 
00388 static const _ExtendedGDBusSignalInfo _bamf_dbus_browser__signal_info_tab_opened =
00389 {
00390   {
00391     -1,
00392     "TabOpened",
00393     (GDBusArgInfo **) &_bamf_dbus_browser__signal_info_tab_opened_ARG_pointers,
00394     NULL
00395   },
00396   "tab-opened"
00397 };
00398 
00399 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__signal_info_tab_closed_ARG_id =
00400 {
00401   {
00402     -1,
00403     "id",
00404     "s",
00405     NULL
00406   },
00407   FALSE
00408 };
00409 
00410 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__signal_info_tab_closed_ARG_pointers[] =
00411 {
00412   &_bamf_dbus_browser__signal_info_tab_closed_ARG_id,
00413   NULL
00414 };
00415 
00416 static const _ExtendedGDBusSignalInfo _bamf_dbus_browser__signal_info_tab_closed =
00417 {
00418   {
00419     -1,
00420     "TabClosed",
00421     (GDBusArgInfo **) &_bamf_dbus_browser__signal_info_tab_closed_ARG_pointers,
00422     NULL
00423   },
00424   "tab-closed"
00425 };
00426 
00427 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__signal_info_tab_uri_changed_ARG_id =
00428 {
00429   {
00430     -1,
00431     "id",
00432     "s",
00433     NULL
00434   },
00435   FALSE
00436 };
00437 
00438 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__signal_info_tab_uri_changed_ARG_old_uri =
00439 {
00440   {
00441     -1,
00442     "old_uri",
00443     "s",
00444     NULL
00445   },
00446   FALSE
00447 };
00448 
00449 static const _ExtendedGDBusArgInfo _bamf_dbus_browser__signal_info_tab_uri_changed_ARG_new_uri =
00450 {
00451   {
00452     -1,
00453     "new_uri",
00454     "s",
00455     NULL
00456   },
00457   FALSE
00458 };
00459 
00460 static const _ExtendedGDBusArgInfo * const _bamf_dbus_browser__signal_info_tab_uri_changed_ARG_pointers[] =
00461 {
00462   &_bamf_dbus_browser__signal_info_tab_uri_changed_ARG_id,
00463   &_bamf_dbus_browser__signal_info_tab_uri_changed_ARG_old_uri,
00464   &_bamf_dbus_browser__signal_info_tab_uri_changed_ARG_new_uri,
00465   NULL
00466 };
00467 
00468 static const _ExtendedGDBusSignalInfo _bamf_dbus_browser__signal_info_tab_uri_changed =
00469 {
00470   {
00471     -1,
00472     "TabUriChanged",
00473     (GDBusArgInfo **) &_bamf_dbus_browser__signal_info_tab_uri_changed_ARG_pointers,
00474     NULL
00475   },
00476   "tab-uri-changed"
00477 };
00478 
00479 static const _ExtendedGDBusSignalInfo * const _bamf_dbus_browser__signal_info_pointers[] =
00480 {
00481   &_bamf_dbus_browser__signal_info_tab_opened,
00482   &_bamf_dbus_browser__signal_info_tab_closed,
00483   &_bamf_dbus_browser__signal_info_tab_uri_changed,
00484   NULL
00485 };
00486 
00487 static const _ExtendedGDBusInterfaceInfo _bamf_dbus_browser__interface_info =
00488 {
00489   {
00490     -1,
00491     "org.ayatana.bamf.browser",
00492     (GDBusMethodInfo **) &_bamf_dbus_browser__method_info_pointers,
00493     (GDBusSignalInfo **) &_bamf_dbus_browser__signal_info_pointers,
00494     NULL,
00495     NULL
00496   },
00497   "",
00498 };
00499 
00500 
00508 GDBusInterfaceInfo *
00509 bamf_dbus_browser__interface_info (void)
00510 {
00511   return (GDBusInterfaceInfo *) &_bamf_dbus_browser__interface_info;
00512 }
00513 
00524 guint
00525 bamf_dbus_browser__override_properties (GObjectClass *klass, guint property_id_begin)
00526 {
00527   return property_id_begin - 1;
00528 }
00529 
00530 
00531 
00553 static void
00554 bamf_dbus_browser__default_init (BamfDBusBrowserIface *iface)
00555 {
00556   /* GObject signals for incoming D-Bus method calls: */
00568   g_signal_new ("handle-tab-ids",
00569     G_TYPE_FROM_INTERFACE (iface),
00570     G_SIGNAL_RUN_LAST,
00571     G_STRUCT_OFFSET (BamfDBusBrowserIface, handle_tab_ids),
00572     g_signal_accumulator_true_handled,
00573     NULL,
00574     g_cclosure_marshal_generic,
00575     G_TYPE_BOOLEAN,
00576     1,
00577     G_TYPE_DBUS_METHOD_INVOCATION);
00578 
00591   g_signal_new ("handle-show-tab",
00592     G_TYPE_FROM_INTERFACE (iface),
00593     G_SIGNAL_RUN_LAST,
00594     G_STRUCT_OFFSET (BamfDBusBrowserIface, handle_show_tab),
00595     g_signal_accumulator_true_handled,
00596     NULL,
00597     g_cclosure_marshal_generic,
00598     G_TYPE_BOOLEAN,
00599     2,
00600     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
00601 
00614   g_signal_new ("handle-tab-uri",
00615     G_TYPE_FROM_INTERFACE (iface),
00616     G_SIGNAL_RUN_LAST,
00617     G_STRUCT_OFFSET (BamfDBusBrowserIface, handle_tab_uri),
00618     g_signal_accumulator_true_handled,
00619     NULL,
00620     g_cclosure_marshal_generic,
00621     G_TYPE_BOOLEAN,
00622     2,
00623     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
00624 
00637   g_signal_new ("handle-tab-preview",
00638     G_TYPE_FROM_INTERFACE (iface),
00639     G_SIGNAL_RUN_LAST,
00640     G_STRUCT_OFFSET (BamfDBusBrowserIface, handle_tab_preview),
00641     g_signal_accumulator_true_handled,
00642     NULL,
00643     g_cclosure_marshal_generic,
00644     G_TYPE_BOOLEAN,
00645     2,
00646     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
00647 
00660   g_signal_new ("handle-tab-xid",
00661     G_TYPE_FROM_INTERFACE (iface),
00662     G_SIGNAL_RUN_LAST,
00663     G_STRUCT_OFFSET (BamfDBusBrowserIface, handle_tab_xid),
00664     g_signal_accumulator_true_handled,
00665     NULL,
00666     g_cclosure_marshal_generic,
00667     G_TYPE_BOOLEAN,
00668     2,
00669     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
00670 
00671   /* GObject signals for received D-Bus signals: */
00681   g_signal_new ("tab-opened",
00682     G_TYPE_FROM_INTERFACE (iface),
00683     G_SIGNAL_RUN_LAST,
00684     G_STRUCT_OFFSET (BamfDBusBrowserIface, tab_opened),
00685     NULL,
00686     NULL,
00687     g_cclosure_marshal_generic,
00688     G_TYPE_NONE,
00689     1, G_TYPE_STRING);
00690 
00700   g_signal_new ("tab-closed",
00701     G_TYPE_FROM_INTERFACE (iface),
00702     G_SIGNAL_RUN_LAST,
00703     G_STRUCT_OFFSET (BamfDBusBrowserIface, tab_closed),
00704     NULL,
00705     NULL,
00706     g_cclosure_marshal_generic,
00707     G_TYPE_NONE,
00708     1, G_TYPE_STRING);
00709 
00721   g_signal_new ("tab-uri-changed",
00722     G_TYPE_FROM_INTERFACE (iface),
00723     G_SIGNAL_RUN_LAST,
00724     G_STRUCT_OFFSET (BamfDBusBrowserIface, tab_uri_changed),
00725     NULL,
00726     NULL,
00727     g_cclosure_marshal_generic,
00728     G_TYPE_NONE,
00729     3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
00730 
00731 }
00732 
00733 typedef BamfDBusBrowserIface BamfDBusBrowserInterface;
00734 G_DEFINE_INTERFACE (BamfDBusBrowser, bamf_dbus_browser_, G_TYPE_OBJECT);
00735 
00743 void
00744 bamf_dbus_browser__emit_tab_opened (
00745     BamfDBusBrowser *object,
00746     const gchar *arg_id)
00747 {
00748   g_signal_emit_by_name (object, "tab-opened", arg_id);
00749 }
00750 
00758 void
00759 bamf_dbus_browser__emit_tab_closed (
00760     BamfDBusBrowser *object,
00761     const gchar *arg_id)
00762 {
00763   g_signal_emit_by_name (object, "tab-closed", arg_id);
00764 }
00765 
00775 void
00776 bamf_dbus_browser__emit_tab_uri_changed (
00777     BamfDBusBrowser *object,
00778     const gchar *arg_id,
00779     const gchar *arg_old_uri,
00780     const gchar *arg_new_uri)
00781 {
00782   g_signal_emit_by_name (object, "tab-uri-changed", arg_id, arg_old_uri, arg_new_uri);
00783 }
00784 
00798 void
00799 bamf_dbus_browser__call_tab_ids (
00800     BamfDBusBrowser *proxy,
00801     GCancellable *cancellable,
00802     GAsyncReadyCallback callback,
00803     gpointer user_data)
00804 {
00805   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
00806     "TabIds",
00807     g_variant_new ("()"),
00808     G_DBUS_CALL_FLAGS_NONE,
00809     -1,
00810     cancellable,
00811     callback,
00812     user_data);
00813 }
00814 
00826 gboolean
00827 bamf_dbus_browser__call_tab_ids_finish (
00828     BamfDBusBrowser *proxy,
00829     gchar ***out_ids,
00830     GAsyncResult *res,
00831     GError **error)
00832 {
00833   GVariant *_ret;
00834   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
00835   if (_ret == NULL)
00836     goto _out;
00837   g_variant_get (_ret,
00838                  "(^as)",
00839                  out_ids);
00840   g_variant_unref (_ret);
00841 _out:
00842   return _ret != NULL;
00843 }
00844 
00858 gboolean
00859 bamf_dbus_browser__call_tab_ids_sync (
00860     BamfDBusBrowser *proxy,
00861     gchar ***out_ids,
00862     GCancellable *cancellable,
00863     GError **error)
00864 {
00865   GVariant *_ret;
00866   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
00867     "TabIds",
00868     g_variant_new ("()"),
00869     G_DBUS_CALL_FLAGS_NONE,
00870     -1,
00871     cancellable,
00872     error);
00873   if (_ret == NULL)
00874     goto _out;
00875   g_variant_get (_ret,
00876                  "(^as)",
00877                  out_ids);
00878   g_variant_unref (_ret);
00879 _out:
00880   return _ret != NULL;
00881 }
00882 
00897 void
00898 bamf_dbus_browser__call_show_tab (
00899     BamfDBusBrowser *proxy,
00900     const gchar *arg_id,
00901     GCancellable *cancellable,
00902     GAsyncReadyCallback callback,
00903     gpointer user_data)
00904 {
00905   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
00906     "ShowTab",
00907     g_variant_new ("(s)",
00908                    arg_id),
00909     G_DBUS_CALL_FLAGS_NONE,
00910     -1,
00911     cancellable,
00912     callback,
00913     user_data);
00914 }
00915 
00926 gboolean
00927 bamf_dbus_browser__call_show_tab_finish (
00928     BamfDBusBrowser *proxy,
00929     GAsyncResult *res,
00930     GError **error)
00931 {
00932   GVariant *_ret;
00933   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
00934   if (_ret == NULL)
00935     goto _out;
00936   g_variant_get (_ret,
00937                  "()");
00938   g_variant_unref (_ret);
00939 _out:
00940   return _ret != NULL;
00941 }
00942 
00956 gboolean
00957 bamf_dbus_browser__call_show_tab_sync (
00958     BamfDBusBrowser *proxy,
00959     const gchar *arg_id,
00960     GCancellable *cancellable,
00961     GError **error)
00962 {
00963   GVariant *_ret;
00964   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
00965     "ShowTab",
00966     g_variant_new ("(s)",
00967                    arg_id),
00968     G_DBUS_CALL_FLAGS_NONE,
00969     -1,
00970     cancellable,
00971     error);
00972   if (_ret == NULL)
00973     goto _out;
00974   g_variant_get (_ret,
00975                  "()");
00976   g_variant_unref (_ret);
00977 _out:
00978   return _ret != NULL;
00979 }
00980 
00995 void
00996 bamf_dbus_browser__call_tab_uri (
00997     BamfDBusBrowser *proxy,
00998     const gchar *arg_id,
00999     GCancellable *cancellable,
01000     GAsyncReadyCallback callback,
01001     gpointer user_data)
01002 {
01003   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01004     "TabUri",
01005     g_variant_new ("(s)",
01006                    arg_id),
01007     G_DBUS_CALL_FLAGS_NONE,
01008     -1,
01009     cancellable,
01010     callback,
01011     user_data);
01012 }
01013 
01025 gboolean
01026 bamf_dbus_browser__call_tab_uri_finish (
01027     BamfDBusBrowser *proxy,
01028     gchar **out_uri,
01029     GAsyncResult *res,
01030     GError **error)
01031 {
01032   GVariant *_ret;
01033   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01034   if (_ret == NULL)
01035     goto _out;
01036   g_variant_get (_ret,
01037                  "(s)",
01038                  out_uri);
01039   g_variant_unref (_ret);
01040 _out:
01041   return _ret != NULL;
01042 }
01043 
01058 gboolean
01059 bamf_dbus_browser__call_tab_uri_sync (
01060     BamfDBusBrowser *proxy,
01061     const gchar *arg_id,
01062     gchar **out_uri,
01063     GCancellable *cancellable,
01064     GError **error)
01065 {
01066   GVariant *_ret;
01067   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01068     "TabUri",
01069     g_variant_new ("(s)",
01070                    arg_id),
01071     G_DBUS_CALL_FLAGS_NONE,
01072     -1,
01073     cancellable,
01074     error);
01075   if (_ret == NULL)
01076     goto _out;
01077   g_variant_get (_ret,
01078                  "(s)",
01079                  out_uri);
01080   g_variant_unref (_ret);
01081 _out:
01082   return _ret != NULL;
01083 }
01084 
01099 void
01100 bamf_dbus_browser__call_tab_preview (
01101     BamfDBusBrowser *proxy,
01102     const gchar *arg_id,
01103     GCancellable *cancellable,
01104     GAsyncReadyCallback callback,
01105     gpointer user_data)
01106 {
01107   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01108     "TabPreview",
01109     g_variant_new ("(s)",
01110                    arg_id),
01111     G_DBUS_CALL_FLAGS_NONE,
01112     -1,
01113     cancellable,
01114     callback,
01115     user_data);
01116 }
01117 
01129 gboolean
01130 bamf_dbus_browser__call_tab_preview_finish (
01131     BamfDBusBrowser *proxy,
01132     gchar **out_preview,
01133     GAsyncResult *res,
01134     GError **error)
01135 {
01136   GVariant *_ret;
01137   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01138   if (_ret == NULL)
01139     goto _out;
01140   g_variant_get (_ret,
01141                  "(^ay)",
01142                  out_preview);
01143   g_variant_unref (_ret);
01144 _out:
01145   return _ret != NULL;
01146 }
01147 
01162 gboolean
01163 bamf_dbus_browser__call_tab_preview_sync (
01164     BamfDBusBrowser *proxy,
01165     const gchar *arg_id,
01166     gchar **out_preview,
01167     GCancellable *cancellable,
01168     GError **error)
01169 {
01170   GVariant *_ret;
01171   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01172     "TabPreview",
01173     g_variant_new ("(s)",
01174                    arg_id),
01175     G_DBUS_CALL_FLAGS_NONE,
01176     -1,
01177     cancellable,
01178     error);
01179   if (_ret == NULL)
01180     goto _out;
01181   g_variant_get (_ret,
01182                  "(^ay)",
01183                  out_preview);
01184   g_variant_unref (_ret);
01185 _out:
01186   return _ret != NULL;
01187 }
01188 
01203 void
01204 bamf_dbus_browser__call_tab_xid (
01205     BamfDBusBrowser *proxy,
01206     const gchar *arg_id,
01207     GCancellable *cancellable,
01208     GAsyncReadyCallback callback,
01209     gpointer user_data)
01210 {
01211   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01212     "TabXid",
01213     g_variant_new ("(s)",
01214                    arg_id),
01215     G_DBUS_CALL_FLAGS_NONE,
01216     -1,
01217     cancellable,
01218     callback,
01219     user_data);
01220 }
01221 
01233 gboolean
01234 bamf_dbus_browser__call_tab_xid_finish (
01235     BamfDBusBrowser *proxy,
01236     guint *out_xid,
01237     GAsyncResult *res,
01238     GError **error)
01239 {
01240   GVariant *_ret;
01241   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01242   if (_ret == NULL)
01243     goto _out;
01244   g_variant_get (_ret,
01245                  "(u)",
01246                  out_xid);
01247   g_variant_unref (_ret);
01248 _out:
01249   return _ret != NULL;
01250 }
01251 
01266 gboolean
01267 bamf_dbus_browser__call_tab_xid_sync (
01268     BamfDBusBrowser *proxy,
01269     const gchar *arg_id,
01270     guint *out_xid,
01271     GCancellable *cancellable,
01272     GError **error)
01273 {
01274   GVariant *_ret;
01275   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01276     "TabXid",
01277     g_variant_new ("(s)",
01278                    arg_id),
01279     G_DBUS_CALL_FLAGS_NONE,
01280     -1,
01281     cancellable,
01282     error);
01283   if (_ret == NULL)
01284     goto _out;
01285   g_variant_get (_ret,
01286                  "(u)",
01287                  out_xid);
01288   g_variant_unref (_ret);
01289 _out:
01290   return _ret != NULL;
01291 }
01292 
01303 void
01304 bamf_dbus_browser__complete_tab_ids (
01305     BamfDBusBrowser *object,
01306     GDBusMethodInvocation *invocation,
01307     const gchar *const *ids)
01308 {
01309   g_dbus_method_invocation_return_value (invocation,
01310     g_variant_new ("(^as)",
01311                    ids));
01312 }
01313 
01323 void
01324 bamf_dbus_browser__complete_show_tab (
01325     BamfDBusBrowser *object,
01326     GDBusMethodInvocation *invocation)
01327 {
01328   g_dbus_method_invocation_return_value (invocation,
01329     g_variant_new ("()"));
01330 }
01331 
01342 void
01343 bamf_dbus_browser__complete_tab_uri (
01344     BamfDBusBrowser *object,
01345     GDBusMethodInvocation *invocation,
01346     const gchar *uri)
01347 {
01348   g_dbus_method_invocation_return_value (invocation,
01349     g_variant_new ("(s)",
01350                    uri));
01351 }
01352 
01363 void
01364 bamf_dbus_browser__complete_tab_preview (
01365     BamfDBusBrowser *object,
01366     GDBusMethodInvocation *invocation,
01367     const gchar *preview)
01368 {
01369   g_dbus_method_invocation_return_value (invocation,
01370     g_variant_new ("(^ay)",
01371                    preview));
01372 }
01373 
01384 void
01385 bamf_dbus_browser__complete_tab_xid (
01386     BamfDBusBrowser *object,
01387     GDBusMethodInvocation *invocation,
01388     guint xid)
01389 {
01390   g_dbus_method_invocation_return_value (invocation,
01391     g_variant_new ("(u)",
01392                    xid));
01393 }
01394 
01395 /* ------------------------------------------------------------------------ */
01396 
01410 struct _BamfDBusBrowserProxyPrivate
01411 {
01412   GData *qdata;
01413 };
01414 
01415 static void bamf_dbus_browser__proxy_iface_init (BamfDBusBrowserIface *iface);
01416 
01417 G_DEFINE_TYPE_WITH_CODE (BamfDBusBrowserProxy, bamf_dbus_browser__proxy, G_TYPE_DBUS_PROXY,
01418                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_BROWSER_TYPE_, bamf_dbus_browser__proxy_iface_init));
01419 
01420 static void
01421 bamf_dbus_browser__proxy_finalize (GObject *object)
01422 {
01423   BamfDBusBrowserProxy *proxy = BAMF_DBUS_BROWSER__PROXY (object);
01424   g_datalist_clear (&proxy->priv->qdata);
01425   G_OBJECT_CLASS (bamf_dbus_browser__proxy_parent_class)->finalize (object);
01426 }
01427 
01428 static void
01429 bamf_dbus_browser__proxy_get_property (GObject      *object,
01430   guint         prop_id,
01431   GValue       *value,
01432   GParamSpec   *pspec)
01433 {
01434 }
01435 
01436 static void
01437 bamf_dbus_browser__proxy_set_property (GObject      *object,
01438   guint         prop_id,
01439   const GValue *value,
01440   GParamSpec   *pspec)
01441 {
01442 }
01443 
01444 static void
01445 bamf_dbus_browser__proxy_g_signal (GDBusProxy *proxy,
01446   const gchar *sender_name,
01447   const gchar *signal_name,
01448   GVariant *parameters)
01449 {
01450   _ExtendedGDBusSignalInfo *info;
01451   GVariantIter iter;
01452   GVariant *child;
01453   GValue *paramv;
01454   guint num_params;
01455   guint n;
01456   guint signal_id;
01457   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_bamf_dbus_browser__interface_info, signal_name);
01458   if (info == NULL)
01459     return;
01460   num_params = g_variant_n_children (parameters);
01461   paramv = g_new0 (GValue, num_params + 1);
01462   g_value_init (&paramv[0], BAMF_DBUS_BROWSER_TYPE_);
01463   g_value_set_object (&paramv[0], proxy);
01464   g_variant_iter_init (&iter, parameters);
01465   n = 1;
01466   while ((child = g_variant_iter_next_value (&iter)) != NULL)
01467     {
01468       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
01469       if (arg_info->use_gvariant)
01470         {
01471           g_value_init (&paramv[n], G_TYPE_VARIANT);
01472           g_value_set_variant (&paramv[n], child);
01473           n++;
01474         }
01475       else
01476         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
01477       g_variant_unref (child);
01478     }
01479   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_BROWSER_TYPE_);
01480   g_signal_emitv (paramv, signal_id, 0, NULL);
01481   for (n = 0; n < num_params + 1; n++)
01482     g_value_unset (&paramv[n]);
01483   g_free (paramv);
01484 }
01485 
01486 static void
01487 bamf_dbus_browser__proxy_g_properties_changed (GDBusProxy *_proxy,
01488   GVariant *changed_properties,
01489   const gchar *const *invalidated_properties)
01490 {
01491   BamfDBusBrowserProxy *proxy = BAMF_DBUS_BROWSER__PROXY (_proxy);
01492   guint n;
01493   const gchar *key;
01494   GVariantIter *iter;
01495   _ExtendedGDBusPropertyInfo *info;
01496   g_variant_get (changed_properties, "a{sv}", &iter);
01497   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
01498     {
01499       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_browser__interface_info, key);
01500       g_datalist_remove_data (&proxy->priv->qdata, key);
01501       if (info != NULL)
01502         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
01503     }
01504   g_variant_iter_free (iter);
01505   for (n = 0; invalidated_properties[n] != NULL; n++)
01506     {
01507       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_browser__interface_info, invalidated_properties[n]);
01508       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
01509       if (info != NULL)
01510         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
01511     }
01512 }
01513 
01514 static void
01515 bamf_dbus_browser__proxy_init (BamfDBusBrowserProxy *proxy)
01516 {
01517   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, BAMF_DBUS_BROWSER_TYPE__PROXY, BamfDBusBrowserProxyPrivate);
01518   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), bamf_dbus_browser__interface_info ());
01519 }
01520 
01521 static void
01522 bamf_dbus_browser__proxy_class_init (BamfDBusBrowserProxyClass *klass)
01523 {
01524   GObjectClass *gobject_class;
01525   GDBusProxyClass *proxy_class;
01526 
01527   g_type_class_add_private (klass, sizeof (BamfDBusBrowserProxyPrivate));
01528 
01529   gobject_class = G_OBJECT_CLASS (klass);
01530   gobject_class->finalize     = bamf_dbus_browser__proxy_finalize;
01531   gobject_class->get_property = bamf_dbus_browser__proxy_get_property;
01532   gobject_class->set_property = bamf_dbus_browser__proxy_set_property;
01533 
01534   proxy_class = G_DBUS_PROXY_CLASS (klass);
01535   proxy_class->g_signal = bamf_dbus_browser__proxy_g_signal;
01536   proxy_class->g_properties_changed = bamf_dbus_browser__proxy_g_properties_changed;
01537 
01538 }
01539 
01540 static void
01541 bamf_dbus_browser__proxy_iface_init (BamfDBusBrowserIface *iface)
01542 {
01543 }
01544 
01562 void
01563 bamf_dbus_browser__proxy_new (
01564     GDBusConnection     *connection,
01565     GDBusProxyFlags      flags,
01566     const gchar         *name,
01567     const gchar         *object_path,
01568     GCancellable        *cancellable,
01569     GAsyncReadyCallback  callback,
01570     gpointer             user_data)
01571 {
01572   g_async_initable_new_async (BAMF_DBUS_BROWSER_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", "org.ayatana.bamf.browser", NULL);
01573 }
01574 
01584 BamfDBusBrowser *
01585 bamf_dbus_browser__proxy_new_finish (
01586     GAsyncResult        *res,
01587     GError             **error)
01588 {
01589   GObject *ret;
01590   GObject *source_object;
01591   source_object = g_async_result_get_source_object (res);
01592   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
01593   g_object_unref (source_object);
01594   if (ret != NULL)
01595     return BAMF_DBUS_BROWSER_ (ret);
01596   else
01597     return NULL;
01598 }
01599 
01617 BamfDBusBrowser *
01618 bamf_dbus_browser__proxy_new_sync (
01619     GDBusConnection     *connection,
01620     GDBusProxyFlags      flags,
01621     const gchar         *name,
01622     const gchar         *object_path,
01623     GCancellable        *cancellable,
01624     GError             **error)
01625 {
01626   GInitable *ret;
01627   ret = g_initable_new (BAMF_DBUS_BROWSER_TYPE__PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.ayatana.bamf.browser", NULL);
01628   if (ret != NULL)
01629     return BAMF_DBUS_BROWSER_ (ret);
01630   else
01631     return NULL;
01632 }
01633 
01634 
01652 void
01653 bamf_dbus_browser__proxy_new_for_bus (
01654     GBusType             bus_type,
01655     GDBusProxyFlags      flags,
01656     const gchar         *name,
01657     const gchar         *object_path,
01658     GCancellable        *cancellable,
01659     GAsyncReadyCallback  callback,
01660     gpointer             user_data)
01661 {
01662   g_async_initable_new_async (BAMF_DBUS_BROWSER_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", "org.ayatana.bamf.browser", NULL);
01663 }
01664 
01674 BamfDBusBrowser *
01675 bamf_dbus_browser__proxy_new_for_bus_finish (
01676     GAsyncResult        *res,
01677     GError             **error)
01678 {
01679   GObject *ret;
01680   GObject *source_object;
01681   source_object = g_async_result_get_source_object (res);
01682   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
01683   g_object_unref (source_object);
01684   if (ret != NULL)
01685     return BAMF_DBUS_BROWSER_ (ret);
01686   else
01687     return NULL;
01688 }
01689 
01707 BamfDBusBrowser *
01708 bamf_dbus_browser__proxy_new_for_bus_sync (
01709     GBusType             bus_type,
01710     GDBusProxyFlags      flags,
01711     const gchar         *name,
01712     const gchar         *object_path,
01713     GCancellable        *cancellable,
01714     GError             **error)
01715 {
01716   GInitable *ret;
01717   ret = g_initable_new (BAMF_DBUS_BROWSER_TYPE__PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.ayatana.bamf.browser", NULL);
01718   if (ret != NULL)
01719     return BAMF_DBUS_BROWSER_ (ret);
01720   else
01721     return NULL;
01722 }
01723 
01724 
01725 /* ------------------------------------------------------------------------ */
01726 
01740 struct _BamfDBusBrowserSkeletonPrivate
01741 {
01742   GValue *properties;
01743   GList *changed_properties;
01744   GSource *changed_properties_idle_source;
01745   GMainContext *context;
01746   GMutex lock;
01747 };
01748 
01749 static void
01750 _bamf_dbus_browser__skeleton_handle_method_call (
01751   GDBusConnection *connection,
01752   const gchar *sender,
01753   const gchar *object_path,
01754   const gchar *interface_name,
01755   const gchar *method_name,
01756   GVariant *parameters,
01757   GDBusMethodInvocation *invocation,
01758   gpointer user_data)
01759 {
01760   BamfDBusBrowserSkeleton *skeleton = BAMF_DBUS_BROWSER__SKELETON (user_data);
01761   _ExtendedGDBusMethodInfo *info;
01762   GVariantIter iter;
01763   GVariant *child;
01764   GValue *paramv;
01765   guint num_params;
01766   guint num_extra;
01767   guint n;
01768   guint signal_id;
01769   GValue return_value = G_VALUE_INIT;
01770   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
01771   g_assert (info != NULL);
01772   num_params = g_variant_n_children (parameters);
01773   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
01774   n = 0;
01775   g_value_init (&paramv[n], BAMF_DBUS_BROWSER_TYPE_);
01776   g_value_set_object (&paramv[n++], skeleton);
01777   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
01778   g_value_set_object (&paramv[n++], invocation);
01779   if (info->pass_fdlist)
01780     {
01781 #ifdef G_OS_UNIX
01782       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
01783       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
01784 #else
01785       g_assert_not_reached ();
01786 #endif
01787     }
01788   g_variant_iter_init (&iter, parameters);
01789   while ((child = g_variant_iter_next_value (&iter)) != NULL)
01790     {
01791       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
01792       if (arg_info->use_gvariant)
01793         {
01794           g_value_init (&paramv[n], G_TYPE_VARIANT);
01795           g_value_set_variant (&paramv[n], child);
01796           n++;
01797         }
01798       else
01799         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
01800       g_variant_unref (child);
01801     }
01802   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_BROWSER_TYPE_);
01803   g_value_init (&return_value, G_TYPE_BOOLEAN);
01804   g_signal_emitv (paramv, signal_id, 0, &return_value);
01805   if (!g_value_get_boolean (&return_value))
01806     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);
01807   g_value_unset (&return_value);
01808   for (n = 0; n < num_params + num_extra; n++)
01809     g_value_unset (&paramv[n]);
01810   g_free (paramv);
01811 }
01812 
01813 static GVariant *
01814 _bamf_dbus_browser__skeleton_handle_get_property (
01815   GDBusConnection *connection,
01816   const gchar *sender,
01817   const gchar *object_path,
01818   const gchar *interface_name,
01819   const gchar *property_name,
01820   GError **error,
01821   gpointer user_data)
01822 {
01823   BamfDBusBrowserSkeleton *skeleton = BAMF_DBUS_BROWSER__SKELETON (user_data);
01824   GValue value = G_VALUE_INIT;
01825   GParamSpec *pspec;
01826   _ExtendedGDBusPropertyInfo *info;
01827   GVariant *ret;
01828   ret = NULL;
01829   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_browser__interface_info, property_name);
01830   g_assert (info != NULL);
01831   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
01832   if (pspec == NULL)
01833     {
01834       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
01835     }
01836   else
01837     {
01838       g_value_init (&value, pspec->value_type);
01839       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
01840       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
01841       g_value_unset (&value);
01842     }
01843   return ret;
01844 }
01845 
01846 static gboolean
01847 _bamf_dbus_browser__skeleton_handle_set_property (
01848   GDBusConnection *connection,
01849   const gchar *sender,
01850   const gchar *object_path,
01851   const gchar *interface_name,
01852   const gchar *property_name,
01853   GVariant *variant,
01854   GError **error,
01855   gpointer user_data)
01856 {
01857   BamfDBusBrowserSkeleton *skeleton = BAMF_DBUS_BROWSER__SKELETON (user_data);
01858   GValue value = G_VALUE_INIT;
01859   GParamSpec *pspec;
01860   _ExtendedGDBusPropertyInfo *info;
01861   gboolean ret;
01862   ret = FALSE;
01863   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_browser__interface_info, property_name);
01864   g_assert (info != NULL);
01865   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
01866   if (pspec == NULL)
01867     {
01868       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
01869     }
01870   else
01871     {
01872       if (info->use_gvariant)
01873         g_value_set_variant (&value, variant);
01874       else
01875         g_dbus_gvariant_to_gvalue (variant, &value);
01876       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
01877       g_value_unset (&value);
01878       ret = TRUE;
01879     }
01880   return ret;
01881 }
01882 
01883 static const GDBusInterfaceVTable _bamf_dbus_browser__skeleton_vtable =
01884 {
01885   _bamf_dbus_browser__skeleton_handle_method_call,
01886   _bamf_dbus_browser__skeleton_handle_get_property,
01887   _bamf_dbus_browser__skeleton_handle_set_property
01888 };
01889 
01890 static GDBusInterfaceInfo *
01891 bamf_dbus_browser__skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
01892 {
01893   return bamf_dbus_browser__interface_info ();
01894 }
01895 
01896 static GDBusInterfaceVTable *
01897 bamf_dbus_browser__skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
01898 {
01899   return (GDBusInterfaceVTable *) &_bamf_dbus_browser__skeleton_vtable;
01900 }
01901 
01902 static GVariant *
01903 bamf_dbus_browser__skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
01904 {
01905   BamfDBusBrowserSkeleton *skeleton = BAMF_DBUS_BROWSER__SKELETON (_skeleton);
01906 
01907   GVariantBuilder builder;
01908   guint n;
01909   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
01910   if (_bamf_dbus_browser__interface_info.parent_struct.properties == NULL)
01911     goto out;
01912   for (n = 0; _bamf_dbus_browser__interface_info.parent_struct.properties[n] != NULL; n++)
01913     {
01914       GDBusPropertyInfo *info = _bamf_dbus_browser__interface_info.parent_struct.properties[n];
01915       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
01916         {
01917           GVariant *value;
01918           value = _bamf_dbus_browser__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.ayatana.bamf.browser", info->name, NULL, skeleton);
01919           if (value != NULL)
01920             {
01921               g_variant_take_ref (value);
01922               g_variant_builder_add (&builder, "{sv}", info->name, value);
01923               g_variant_unref (value);
01924             }
01925         }
01926     }
01927 out:
01928   return g_variant_builder_end (&builder);
01929 }
01930 
01931 static void
01932 bamf_dbus_browser__skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
01933 {
01934 }
01935 
01936 static void
01937 _bamf_dbus_browser__on_signal_tab_opened (
01938     BamfDBusBrowser *object,
01939     const gchar *arg_id)
01940 {
01941   BamfDBusBrowserSkeleton *skeleton = BAMF_DBUS_BROWSER__SKELETON (object);
01942 
01943   GList      *connections, *l;
01944   GVariant   *signal_variant;
01945   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
01946 
01947   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
01948                    arg_id));
01949   for (l = connections; l != NULL; l = l->next)
01950     {
01951       GDBusConnection *connection = l->data;
01952       g_dbus_connection_emit_signal (connection,
01953         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.browser", "TabOpened",
01954         signal_variant, NULL);
01955     }
01956   g_variant_unref (signal_variant);
01957   g_list_free_full (connections, g_object_unref);
01958 }
01959 
01960 static void
01961 _bamf_dbus_browser__on_signal_tab_closed (
01962     BamfDBusBrowser *object,
01963     const gchar *arg_id)
01964 {
01965   BamfDBusBrowserSkeleton *skeleton = BAMF_DBUS_BROWSER__SKELETON (object);
01966 
01967   GList      *connections, *l;
01968   GVariant   *signal_variant;
01969   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
01970 
01971   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
01972                    arg_id));
01973   for (l = connections; l != NULL; l = l->next)
01974     {
01975       GDBusConnection *connection = l->data;
01976       g_dbus_connection_emit_signal (connection,
01977         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.browser", "TabClosed",
01978         signal_variant, NULL);
01979     }
01980   g_variant_unref (signal_variant);
01981   g_list_free_full (connections, g_object_unref);
01982 }
01983 
01984 static void
01985 _bamf_dbus_browser__on_signal_tab_uri_changed (
01986     BamfDBusBrowser *object,
01987     const gchar *arg_id,
01988     const gchar *arg_old_uri,
01989     const gchar *arg_new_uri)
01990 {
01991   BamfDBusBrowserSkeleton *skeleton = BAMF_DBUS_BROWSER__SKELETON (object);
01992 
01993   GList      *connections, *l;
01994   GVariant   *signal_variant;
01995   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
01996 
01997   signal_variant = g_variant_ref_sink (g_variant_new ("(sss)",
01998                    arg_id,
01999                    arg_old_uri,
02000                    arg_new_uri));
02001   for (l = connections; l != NULL; l = l->next)
02002     {
02003       GDBusConnection *connection = l->data;
02004       g_dbus_connection_emit_signal (connection,
02005         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.browser", "TabUriChanged",
02006         signal_variant, NULL);
02007     }
02008   g_variant_unref (signal_variant);
02009   g_list_free_full (connections, g_object_unref);
02010 }
02011 
02012 static void bamf_dbus_browser__skeleton_iface_init (BamfDBusBrowserIface *iface);
02013 G_DEFINE_TYPE_WITH_CODE (BamfDBusBrowserSkeleton, bamf_dbus_browser__skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
02014                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_BROWSER_TYPE_, bamf_dbus_browser__skeleton_iface_init));
02015 
02016 static void
02017 bamf_dbus_browser__skeleton_finalize (GObject *object)
02018 {
02019   BamfDBusBrowserSkeleton *skeleton = BAMF_DBUS_BROWSER__SKELETON (object);
02020   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
02021   if (skeleton->priv->changed_properties_idle_source != NULL)
02022     g_source_destroy (skeleton->priv->changed_properties_idle_source);
02023   g_main_context_unref (skeleton->priv->context);
02024   g_mutex_clear (&skeleton->priv->lock);
02025   G_OBJECT_CLASS (bamf_dbus_browser__skeleton_parent_class)->finalize (object);
02026 }
02027 
02028 static void
02029 bamf_dbus_browser__skeleton_init (BamfDBusBrowserSkeleton *skeleton)
02030 {
02031   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, BAMF_DBUS_BROWSER_TYPE__SKELETON, BamfDBusBrowserSkeletonPrivate);
02032   g_mutex_init (&skeleton->priv->lock);
02033   skeleton->priv->context = g_main_context_ref_thread_default ();
02034 }
02035 
02036 static void
02037 bamf_dbus_browser__skeleton_class_init (BamfDBusBrowserSkeletonClass *klass)
02038 {
02039   GObjectClass *gobject_class;
02040   GDBusInterfaceSkeletonClass *skeleton_class;
02041 
02042   g_type_class_add_private (klass, sizeof (BamfDBusBrowserSkeletonPrivate));
02043 
02044   gobject_class = G_OBJECT_CLASS (klass);
02045   gobject_class->finalize = bamf_dbus_browser__skeleton_finalize;
02046 
02047   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
02048   skeleton_class->get_info = bamf_dbus_browser__skeleton_dbus_interface_get_info;
02049   skeleton_class->get_properties = bamf_dbus_browser__skeleton_dbus_interface_get_properties;
02050   skeleton_class->flush = bamf_dbus_browser__skeleton_dbus_interface_flush;
02051   skeleton_class->get_vtable = bamf_dbus_browser__skeleton_dbus_interface_get_vtable;
02052 }
02053 
02054 static void
02055 bamf_dbus_browser__skeleton_iface_init (BamfDBusBrowserIface *iface)
02056 {
02057   iface->tab_opened = _bamf_dbus_browser__on_signal_tab_opened;
02058   iface->tab_closed = _bamf_dbus_browser__on_signal_tab_closed;
02059   iface->tab_uri_changed = _bamf_dbus_browser__on_signal_tab_uri_changed;
02060 }
02061 
02069 BamfDBusBrowser *
02070 bamf_dbus_browser__skeleton_new (void)
02071 {
02072   return BAMF_DBUS_BROWSER_ (g_object_new (BAMF_DBUS_BROWSER_TYPE__SKELETON, NULL));
02073 }
02074