Back to index

bamf  0.2.120
bamf-gdbus-view-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-view-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.view
00147  * ------------------------------------------------------------------------
00148  */
00149 
00158 /* ---- Introspection data for org.ayatana.bamf.view ---- */
00159 
00160 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_view_type_OUT_ARG_view_type =
00161 {
00162   {
00163     -1,
00164     "view_type",
00165     "s",
00166     NULL
00167   },
00168   FALSE
00169 };
00170 
00171 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_view_type_OUT_ARG_pointers[] =
00172 {
00173   &_bamf_dbus_item_view_method_info_view_type_OUT_ARG_view_type,
00174   NULL
00175 };
00176 
00177 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_view_type =
00178 {
00179   {
00180     -1,
00181     "ViewType",
00182     NULL,
00183     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_view_type_OUT_ARG_pointers,
00184     NULL
00185   },
00186   "handle-view-type",
00187   FALSE
00188 };
00189 
00190 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_user_visible_OUT_ARG_visible =
00191 {
00192   {
00193     -1,
00194     "visible",
00195     "b",
00196     NULL
00197   },
00198   FALSE
00199 };
00200 
00201 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_user_visible_OUT_ARG_pointers[] =
00202 {
00203   &_bamf_dbus_item_view_method_info_user_visible_OUT_ARG_visible,
00204   NULL
00205 };
00206 
00207 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_user_visible =
00208 {
00209   {
00210     -1,
00211     "UserVisible",
00212     NULL,
00213     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_user_visible_OUT_ARG_pointers,
00214     NULL
00215   },
00216   "handle-user-visible",
00217   FALSE
00218 };
00219 
00220 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_icon_OUT_ARG_name =
00221 {
00222   {
00223     -1,
00224     "name",
00225     "s",
00226     NULL
00227   },
00228   FALSE
00229 };
00230 
00231 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_icon_OUT_ARG_pointers[] =
00232 {
00233   &_bamf_dbus_item_view_method_info_icon_OUT_ARG_name,
00234   NULL
00235 };
00236 
00237 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_icon =
00238 {
00239   {
00240     -1,
00241     "Icon",
00242     NULL,
00243     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_icon_OUT_ARG_pointers,
00244     NULL
00245   },
00246   "handle-icon",
00247   FALSE
00248 };
00249 
00250 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_name_OUT_ARG_name =
00251 {
00252   {
00253     -1,
00254     "name",
00255     "s",
00256     NULL
00257   },
00258   FALSE
00259 };
00260 
00261 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_name_OUT_ARG_pointers[] =
00262 {
00263   &_bamf_dbus_item_view_method_info_name_OUT_ARG_name,
00264   NULL
00265 };
00266 
00267 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_name =
00268 {
00269   {
00270     -1,
00271     "Name",
00272     NULL,
00273     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_name_OUT_ARG_pointers,
00274     NULL
00275   },
00276   "handle-name",
00277   FALSE
00278 };
00279 
00280 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_is_urgent_OUT_ARG_urgent =
00281 {
00282   {
00283     -1,
00284     "urgent",
00285     "b",
00286     NULL
00287   },
00288   FALSE
00289 };
00290 
00291 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_is_urgent_OUT_ARG_pointers[] =
00292 {
00293   &_bamf_dbus_item_view_method_info_is_urgent_OUT_ARG_urgent,
00294   NULL
00295 };
00296 
00297 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_is_urgent =
00298 {
00299   {
00300     -1,
00301     "IsUrgent",
00302     NULL,
00303     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_is_urgent_OUT_ARG_pointers,
00304     NULL
00305   },
00306   "handle-is-urgent",
00307   FALSE
00308 };
00309 
00310 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_is_running_OUT_ARG_running =
00311 {
00312   {
00313     -1,
00314     "running",
00315     "b",
00316     NULL
00317   },
00318   FALSE
00319 };
00320 
00321 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_is_running_OUT_ARG_pointers[] =
00322 {
00323   &_bamf_dbus_item_view_method_info_is_running_OUT_ARG_running,
00324   NULL
00325 };
00326 
00327 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_is_running =
00328 {
00329   {
00330     -1,
00331     "IsRunning",
00332     NULL,
00333     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_is_running_OUT_ARG_pointers,
00334     NULL
00335   },
00336   "handle-is-running",
00337   FALSE
00338 };
00339 
00340 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_is_active_OUT_ARG_active =
00341 {
00342   {
00343     -1,
00344     "active",
00345     "b",
00346     NULL
00347   },
00348   FALSE
00349 };
00350 
00351 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_is_active_OUT_ARG_pointers[] =
00352 {
00353   &_bamf_dbus_item_view_method_info_is_active_OUT_ARG_active,
00354   NULL
00355 };
00356 
00357 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_is_active =
00358 {
00359   {
00360     -1,
00361     "IsActive",
00362     NULL,
00363     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_is_active_OUT_ARG_pointers,
00364     NULL
00365   },
00366   "handle-is-active",
00367   FALSE
00368 };
00369 
00370 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_parents_OUT_ARG_parents_paths =
00371 {
00372   {
00373     -1,
00374     "parents_paths",
00375     "as",
00376     NULL
00377   },
00378   FALSE
00379 };
00380 
00381 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_parents_OUT_ARG_pointers[] =
00382 {
00383   &_bamf_dbus_item_view_method_info_parents_OUT_ARG_parents_paths,
00384   NULL
00385 };
00386 
00387 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_parents =
00388 {
00389   {
00390     -1,
00391     "Parents",
00392     NULL,
00393     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_parents_OUT_ARG_pointers,
00394     NULL
00395   },
00396   "handle-parents",
00397   FALSE
00398 };
00399 
00400 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_method_info_children_OUT_ARG_children_paths =
00401 {
00402   {
00403     -1,
00404     "children_paths",
00405     "as",
00406     NULL
00407   },
00408   FALSE
00409 };
00410 
00411 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_method_info_children_OUT_ARG_pointers[] =
00412 {
00413   &_bamf_dbus_item_view_method_info_children_OUT_ARG_children_paths,
00414   NULL
00415 };
00416 
00417 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_view_method_info_children =
00418 {
00419   {
00420     -1,
00421     "Children",
00422     NULL,
00423     (GDBusArgInfo **) &_bamf_dbus_item_view_method_info_children_OUT_ARG_pointers,
00424     NULL
00425   },
00426   "handle-children",
00427   FALSE
00428 };
00429 
00430 static const _ExtendedGDBusMethodInfo * const _bamf_dbus_item_view_method_info_pointers[] =
00431 {
00432   &_bamf_dbus_item_view_method_info_view_type,
00433   &_bamf_dbus_item_view_method_info_user_visible,
00434   &_bamf_dbus_item_view_method_info_icon,
00435   &_bamf_dbus_item_view_method_info_name,
00436   &_bamf_dbus_item_view_method_info_is_urgent,
00437   &_bamf_dbus_item_view_method_info_is_running,
00438   &_bamf_dbus_item_view_method_info_is_active,
00439   &_bamf_dbus_item_view_method_info_parents,
00440   &_bamf_dbus_item_view_method_info_children,
00441   NULL
00442 };
00443 
00444 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_signal_info_name_changed_ARG_old_name =
00445 {
00446   {
00447     -1,
00448     "old_name",
00449     "s",
00450     NULL
00451   },
00452   FALSE
00453 };
00454 
00455 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_signal_info_name_changed_ARG_new_name =
00456 {
00457   {
00458     -1,
00459     "new_name",
00460     "s",
00461     NULL
00462   },
00463   FALSE
00464 };
00465 
00466 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_signal_info_name_changed_ARG_pointers[] =
00467 {
00468   &_bamf_dbus_item_view_signal_info_name_changed_ARG_old_name,
00469   &_bamf_dbus_item_view_signal_info_name_changed_ARG_new_name,
00470   NULL
00471 };
00472 
00473 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_view_signal_info_name_changed =
00474 {
00475   {
00476     -1,
00477     "NameChanged",
00478     (GDBusArgInfo **) &_bamf_dbus_item_view_signal_info_name_changed_ARG_pointers,
00479     NULL
00480   },
00481   "name-changed"
00482 };
00483 
00484 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_signal_info_user_visible_changed_ARG_user_visible =
00485 {
00486   {
00487     -1,
00488     "user_visible",
00489     "b",
00490     NULL
00491   },
00492   FALSE
00493 };
00494 
00495 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_signal_info_user_visible_changed_ARG_pointers[] =
00496 {
00497   &_bamf_dbus_item_view_signal_info_user_visible_changed_ARG_user_visible,
00498   NULL
00499 };
00500 
00501 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_view_signal_info_user_visible_changed =
00502 {
00503   {
00504     -1,
00505     "UserVisibleChanged",
00506     (GDBusArgInfo **) &_bamf_dbus_item_view_signal_info_user_visible_changed_ARG_pointers,
00507     NULL
00508   },
00509   "user-visible-changed"
00510 };
00511 
00512 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_signal_info_urgent_changed_ARG_is_urgent =
00513 {
00514   {
00515     -1,
00516     "is_urgent",
00517     "b",
00518     NULL
00519   },
00520   FALSE
00521 };
00522 
00523 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_signal_info_urgent_changed_ARG_pointers[] =
00524 {
00525   &_bamf_dbus_item_view_signal_info_urgent_changed_ARG_is_urgent,
00526   NULL
00527 };
00528 
00529 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_view_signal_info_urgent_changed =
00530 {
00531   {
00532     -1,
00533     "UrgentChanged",
00534     (GDBusArgInfo **) &_bamf_dbus_item_view_signal_info_urgent_changed_ARG_pointers,
00535     NULL
00536   },
00537   "urgent-changed"
00538 };
00539 
00540 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_signal_info_running_changed_ARG_is_running =
00541 {
00542   {
00543     -1,
00544     "is_running",
00545     "b",
00546     NULL
00547   },
00548   FALSE
00549 };
00550 
00551 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_signal_info_running_changed_ARG_pointers[] =
00552 {
00553   &_bamf_dbus_item_view_signal_info_running_changed_ARG_is_running,
00554   NULL
00555 };
00556 
00557 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_view_signal_info_running_changed =
00558 {
00559   {
00560     -1,
00561     "RunningChanged",
00562     (GDBusArgInfo **) &_bamf_dbus_item_view_signal_info_running_changed_ARG_pointers,
00563     NULL
00564   },
00565   "running-changed"
00566 };
00567 
00568 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_signal_info_child_removed_ARG_path =
00569 {
00570   {
00571     -1,
00572     "path",
00573     "s",
00574     NULL
00575   },
00576   FALSE
00577 };
00578 
00579 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_signal_info_child_removed_ARG_pointers[] =
00580 {
00581   &_bamf_dbus_item_view_signal_info_child_removed_ARG_path,
00582   NULL
00583 };
00584 
00585 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_view_signal_info_child_removed =
00586 {
00587   {
00588     -1,
00589     "ChildRemoved",
00590     (GDBusArgInfo **) &_bamf_dbus_item_view_signal_info_child_removed_ARG_pointers,
00591     NULL
00592   },
00593   "child-removed"
00594 };
00595 
00596 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_signal_info_child_added_ARG_path =
00597 {
00598   {
00599     -1,
00600     "path",
00601     "s",
00602     NULL
00603   },
00604   FALSE
00605 };
00606 
00607 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_signal_info_child_added_ARG_pointers[] =
00608 {
00609   &_bamf_dbus_item_view_signal_info_child_added_ARG_path,
00610   NULL
00611 };
00612 
00613 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_view_signal_info_child_added =
00614 {
00615   {
00616     -1,
00617     "ChildAdded",
00618     (GDBusArgInfo **) &_bamf_dbus_item_view_signal_info_child_added_ARG_pointers,
00619     NULL
00620   },
00621   "child-added"
00622 };
00623 
00624 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_view_signal_info_closed =
00625 {
00626   {
00627     -1,
00628     "Closed",
00629     NULL,
00630     NULL
00631   },
00632   "closed"
00633 };
00634 
00635 static const _ExtendedGDBusArgInfo _bamf_dbus_item_view_signal_info_active_changed_ARG_is_active =
00636 {
00637   {
00638     -1,
00639     "is_active",
00640     "b",
00641     NULL
00642   },
00643   FALSE
00644 };
00645 
00646 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_view_signal_info_active_changed_ARG_pointers[] =
00647 {
00648   &_bamf_dbus_item_view_signal_info_active_changed_ARG_is_active,
00649   NULL
00650 };
00651 
00652 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_view_signal_info_active_changed =
00653 {
00654   {
00655     -1,
00656     "ActiveChanged",
00657     (GDBusArgInfo **) &_bamf_dbus_item_view_signal_info_active_changed_ARG_pointers,
00658     NULL
00659   },
00660   "active-changed"
00661 };
00662 
00663 static const _ExtendedGDBusSignalInfo * const _bamf_dbus_item_view_signal_info_pointers[] =
00664 {
00665   &_bamf_dbus_item_view_signal_info_name_changed,
00666   &_bamf_dbus_item_view_signal_info_user_visible_changed,
00667   &_bamf_dbus_item_view_signal_info_urgent_changed,
00668   &_bamf_dbus_item_view_signal_info_running_changed,
00669   &_bamf_dbus_item_view_signal_info_child_removed,
00670   &_bamf_dbus_item_view_signal_info_child_added,
00671   &_bamf_dbus_item_view_signal_info_closed,
00672   &_bamf_dbus_item_view_signal_info_active_changed,
00673   NULL
00674 };
00675 
00676 static const _ExtendedGDBusPropertyInfo _bamf_dbus_item_view_property_info_user_visible =
00677 {
00678   {
00679     -1,
00680     "UserVisible",
00681     "b",
00682     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
00683     NULL
00684   },
00685   "user-visible",
00686   FALSE
00687 };
00688 
00689 static const _ExtendedGDBusPropertyInfo _bamf_dbus_item_view_property_info_running =
00690 {
00691   {
00692     -1,
00693     "Running",
00694     "b",
00695     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
00696     NULL
00697   },
00698   "running",
00699   FALSE
00700 };
00701 
00702 static const _ExtendedGDBusPropertyInfo _bamf_dbus_item_view_property_info_urgent =
00703 {
00704   {
00705     -1,
00706     "Urgent",
00707     "b",
00708     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
00709     NULL
00710   },
00711   "urgent",
00712   FALSE
00713 };
00714 
00715 static const _ExtendedGDBusPropertyInfo _bamf_dbus_item_view_property_info_active =
00716 {
00717   {
00718     -1,
00719     "Active",
00720     "b",
00721     G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
00722     NULL
00723   },
00724   "active",
00725   FALSE
00726 };
00727 
00728 static const _ExtendedGDBusPropertyInfo * const _bamf_dbus_item_view_property_info_pointers[] =
00729 {
00730   &_bamf_dbus_item_view_property_info_user_visible,
00731   &_bamf_dbus_item_view_property_info_running,
00732   &_bamf_dbus_item_view_property_info_urgent,
00733   &_bamf_dbus_item_view_property_info_active,
00734   NULL
00735 };
00736 
00737 static const _ExtendedGDBusInterfaceInfo _bamf_dbus_item_view_interface_info =
00738 {
00739   {
00740     -1,
00741     "org.ayatana.bamf.view",
00742     (GDBusMethodInfo **) &_bamf_dbus_item_view_method_info_pointers,
00743     (GDBusSignalInfo **) &_bamf_dbus_item_view_signal_info_pointers,
00744     (GDBusPropertyInfo **) &_bamf_dbus_item_view_property_info_pointers,
00745     NULL
00746   },
00747   "view",
00748 };
00749 
00750 
00758 GDBusInterfaceInfo *
00759 bamf_dbus_item_view_interface_info (void)
00760 {
00761   return (GDBusInterfaceInfo *) &_bamf_dbus_item_view_interface_info;
00762 }
00763 
00774 guint
00775 bamf_dbus_item_view_override_properties (GObjectClass *klass, guint property_id_begin)
00776 {
00777   g_object_class_override_property (klass, property_id_begin++, "user-visible");
00778   g_object_class_override_property (klass, property_id_begin++, "running");
00779   g_object_class_override_property (klass, property_id_begin++, "urgent");
00780   g_object_class_override_property (klass, property_id_begin++, "active");
00781   return property_id_begin - 1;
00782 }
00783 
00784 
00785 
00820 static void
00821 bamf_dbus_item_view_default_init (BamfDBusItemViewIface *iface)
00822 {
00823   /* GObject signals for incoming D-Bus method calls: */
00835   g_signal_new ("handle-view-type",
00836     G_TYPE_FROM_INTERFACE (iface),
00837     G_SIGNAL_RUN_LAST,
00838     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_view_type),
00839     g_signal_accumulator_true_handled,
00840     NULL,
00841     g_cclosure_marshal_generic,
00842     G_TYPE_BOOLEAN,
00843     1,
00844     G_TYPE_DBUS_METHOD_INVOCATION);
00845 
00857   g_signal_new ("handle-user-visible",
00858     G_TYPE_FROM_INTERFACE (iface),
00859     G_SIGNAL_RUN_LAST,
00860     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_user_visible),
00861     g_signal_accumulator_true_handled,
00862     NULL,
00863     g_cclosure_marshal_generic,
00864     G_TYPE_BOOLEAN,
00865     1,
00866     G_TYPE_DBUS_METHOD_INVOCATION);
00867 
00879   g_signal_new ("handle-icon",
00880     G_TYPE_FROM_INTERFACE (iface),
00881     G_SIGNAL_RUN_LAST,
00882     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_icon),
00883     g_signal_accumulator_true_handled,
00884     NULL,
00885     g_cclosure_marshal_generic,
00886     G_TYPE_BOOLEAN,
00887     1,
00888     G_TYPE_DBUS_METHOD_INVOCATION);
00889 
00901   g_signal_new ("handle-name",
00902     G_TYPE_FROM_INTERFACE (iface),
00903     G_SIGNAL_RUN_LAST,
00904     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_name),
00905     g_signal_accumulator_true_handled,
00906     NULL,
00907     g_cclosure_marshal_generic,
00908     G_TYPE_BOOLEAN,
00909     1,
00910     G_TYPE_DBUS_METHOD_INVOCATION);
00911 
00923   g_signal_new ("handle-is-urgent",
00924     G_TYPE_FROM_INTERFACE (iface),
00925     G_SIGNAL_RUN_LAST,
00926     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_is_urgent),
00927     g_signal_accumulator_true_handled,
00928     NULL,
00929     g_cclosure_marshal_generic,
00930     G_TYPE_BOOLEAN,
00931     1,
00932     G_TYPE_DBUS_METHOD_INVOCATION);
00933 
00945   g_signal_new ("handle-is-running",
00946     G_TYPE_FROM_INTERFACE (iface),
00947     G_SIGNAL_RUN_LAST,
00948     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_is_running),
00949     g_signal_accumulator_true_handled,
00950     NULL,
00951     g_cclosure_marshal_generic,
00952     G_TYPE_BOOLEAN,
00953     1,
00954     G_TYPE_DBUS_METHOD_INVOCATION);
00955 
00967   g_signal_new ("handle-is-active",
00968     G_TYPE_FROM_INTERFACE (iface),
00969     G_SIGNAL_RUN_LAST,
00970     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_is_active),
00971     g_signal_accumulator_true_handled,
00972     NULL,
00973     g_cclosure_marshal_generic,
00974     G_TYPE_BOOLEAN,
00975     1,
00976     G_TYPE_DBUS_METHOD_INVOCATION);
00977 
00989   g_signal_new ("handle-parents",
00990     G_TYPE_FROM_INTERFACE (iface),
00991     G_SIGNAL_RUN_LAST,
00992     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_parents),
00993     g_signal_accumulator_true_handled,
00994     NULL,
00995     g_cclosure_marshal_generic,
00996     G_TYPE_BOOLEAN,
00997     1,
00998     G_TYPE_DBUS_METHOD_INVOCATION);
00999 
01011   g_signal_new ("handle-children",
01012     G_TYPE_FROM_INTERFACE (iface),
01013     G_SIGNAL_RUN_LAST,
01014     G_STRUCT_OFFSET (BamfDBusItemViewIface, handle_children),
01015     g_signal_accumulator_true_handled,
01016     NULL,
01017     g_cclosure_marshal_generic,
01018     G_TYPE_BOOLEAN,
01019     1,
01020     G_TYPE_DBUS_METHOD_INVOCATION);
01021 
01022   /* GObject signals for received D-Bus signals: */
01033   g_signal_new ("name-changed",
01034     G_TYPE_FROM_INTERFACE (iface),
01035     G_SIGNAL_RUN_LAST,
01036     G_STRUCT_OFFSET (BamfDBusItemViewIface, name_changed),
01037     NULL,
01038     NULL,
01039     g_cclosure_marshal_generic,
01040     G_TYPE_NONE,
01041     2, G_TYPE_STRING, G_TYPE_STRING);
01042 
01052   g_signal_new ("user-visible-changed",
01053     G_TYPE_FROM_INTERFACE (iface),
01054     G_SIGNAL_RUN_LAST,
01055     G_STRUCT_OFFSET (BamfDBusItemViewIface, user_visible_changed),
01056     NULL,
01057     NULL,
01058     g_cclosure_marshal_generic,
01059     G_TYPE_NONE,
01060     1, G_TYPE_BOOLEAN);
01061 
01071   g_signal_new ("urgent-changed",
01072     G_TYPE_FROM_INTERFACE (iface),
01073     G_SIGNAL_RUN_LAST,
01074     G_STRUCT_OFFSET (BamfDBusItemViewIface, urgent_changed),
01075     NULL,
01076     NULL,
01077     g_cclosure_marshal_generic,
01078     G_TYPE_NONE,
01079     1, G_TYPE_BOOLEAN);
01080 
01090   g_signal_new ("running-changed",
01091     G_TYPE_FROM_INTERFACE (iface),
01092     G_SIGNAL_RUN_LAST,
01093     G_STRUCT_OFFSET (BamfDBusItemViewIface, running_changed),
01094     NULL,
01095     NULL,
01096     g_cclosure_marshal_generic,
01097     G_TYPE_NONE,
01098     1, G_TYPE_BOOLEAN);
01099 
01109   g_signal_new ("child-removed",
01110     G_TYPE_FROM_INTERFACE (iface),
01111     G_SIGNAL_RUN_LAST,
01112     G_STRUCT_OFFSET (BamfDBusItemViewIface, child_removed),
01113     NULL,
01114     NULL,
01115     g_cclosure_marshal_generic,
01116     G_TYPE_NONE,
01117     1, G_TYPE_STRING);
01118 
01128   g_signal_new ("child-added",
01129     G_TYPE_FROM_INTERFACE (iface),
01130     G_SIGNAL_RUN_LAST,
01131     G_STRUCT_OFFSET (BamfDBusItemViewIface, child_added),
01132     NULL,
01133     NULL,
01134     g_cclosure_marshal_generic,
01135     G_TYPE_NONE,
01136     1, G_TYPE_STRING);
01137 
01146   g_signal_new ("closed",
01147     G_TYPE_FROM_INTERFACE (iface),
01148     G_SIGNAL_RUN_LAST,
01149     G_STRUCT_OFFSET (BamfDBusItemViewIface, closed),
01150     NULL,
01151     NULL,
01152     g_cclosure_marshal_generic,
01153     G_TYPE_NONE,
01154     0);
01155 
01165   g_signal_new ("active-changed",
01166     G_TYPE_FROM_INTERFACE (iface),
01167     G_SIGNAL_RUN_LAST,
01168     G_STRUCT_OFFSET (BamfDBusItemViewIface, active_changed),
01169     NULL,
01170     NULL,
01171     g_cclosure_marshal_generic,
01172     G_TYPE_NONE,
01173     1, G_TYPE_BOOLEAN);
01174 
01175   /* GObject properties for D-Bus properties: */
01183   g_object_interface_install_property (iface,
01184     g_param_spec_boolean ("user-visible", "UserVisible", "UserVisible", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
01192   g_object_interface_install_property (iface,
01193     g_param_spec_boolean ("running", "Running", "Running", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
01201   g_object_interface_install_property (iface,
01202     g_param_spec_boolean ("urgent", "Urgent", "Urgent", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
01210   g_object_interface_install_property (iface,
01211     g_param_spec_boolean ("active", "Active", "Active", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
01212 }
01213 
01214 typedef BamfDBusItemViewIface BamfDBusItemViewInterface;
01215 G_DEFINE_INTERFACE (BamfDBusItemView, bamf_dbus_item_view, G_TYPE_OBJECT);
01216 
01227 gboolean 
01228 bamf_dbus_item_view_get_user_visible (BamfDBusItemView *object)
01229 {
01230   return BAMF_DBUS_ITEM_VIEW_GET_IFACE (object)->get_user_visible (object);
01231 }
01232 
01242 void
01243 bamf_dbus_item_view_set_user_visible (BamfDBusItemView *object, gboolean value)
01244 {
01245   g_object_set (G_OBJECT (object), "user-visible", value, NULL);
01246 }
01247 
01258 gboolean 
01259 bamf_dbus_item_view_get_running (BamfDBusItemView *object)
01260 {
01261   return BAMF_DBUS_ITEM_VIEW_GET_IFACE (object)->get_running (object);
01262 }
01263 
01273 void
01274 bamf_dbus_item_view_set_running (BamfDBusItemView *object, gboolean value)
01275 {
01276   g_object_set (G_OBJECT (object), "running", value, NULL);
01277 }
01278 
01289 gboolean 
01290 bamf_dbus_item_view_get_urgent (BamfDBusItemView *object)
01291 {
01292   return BAMF_DBUS_ITEM_VIEW_GET_IFACE (object)->get_urgent (object);
01293 }
01294 
01304 void
01305 bamf_dbus_item_view_set_urgent (BamfDBusItemView *object, gboolean value)
01306 {
01307   g_object_set (G_OBJECT (object), "urgent", value, NULL);
01308 }
01309 
01320 gboolean 
01321 bamf_dbus_item_view_get_active (BamfDBusItemView *object)
01322 {
01323   return BAMF_DBUS_ITEM_VIEW_GET_IFACE (object)->get_active (object);
01324 }
01325 
01335 void
01336 bamf_dbus_item_view_set_active (BamfDBusItemView *object, gboolean value)
01337 {
01338   g_object_set (G_OBJECT (object), "active", value, NULL);
01339 }
01340 
01349 void
01350 bamf_dbus_item_view_emit_name_changed (
01351     BamfDBusItemView *object,
01352     const gchar *arg_old_name,
01353     const gchar *arg_new_name)
01354 {
01355   g_signal_emit_by_name (object, "name-changed", arg_old_name, arg_new_name);
01356 }
01357 
01365 void
01366 bamf_dbus_item_view_emit_user_visible_changed (
01367     BamfDBusItemView *object,
01368     gboolean arg_user_visible)
01369 {
01370   g_signal_emit_by_name (object, "user-visible-changed", arg_user_visible);
01371 }
01372 
01380 void
01381 bamf_dbus_item_view_emit_urgent_changed (
01382     BamfDBusItemView *object,
01383     gboolean arg_is_urgent)
01384 {
01385   g_signal_emit_by_name (object, "urgent-changed", arg_is_urgent);
01386 }
01387 
01395 void
01396 bamf_dbus_item_view_emit_running_changed (
01397     BamfDBusItemView *object,
01398     gboolean arg_is_running)
01399 {
01400   g_signal_emit_by_name (object, "running-changed", arg_is_running);
01401 }
01402 
01410 void
01411 bamf_dbus_item_view_emit_child_removed (
01412     BamfDBusItemView *object,
01413     const gchar *arg_path)
01414 {
01415   g_signal_emit_by_name (object, "child-removed", arg_path);
01416 }
01417 
01425 void
01426 bamf_dbus_item_view_emit_child_added (
01427     BamfDBusItemView *object,
01428     const gchar *arg_path)
01429 {
01430   g_signal_emit_by_name (object, "child-added", arg_path);
01431 }
01432 
01439 void
01440 bamf_dbus_item_view_emit_closed (
01441     BamfDBusItemView *object)
01442 {
01443   g_signal_emit_by_name (object, "closed");
01444 }
01445 
01453 void
01454 bamf_dbus_item_view_emit_active_changed (
01455     BamfDBusItemView *object,
01456     gboolean arg_is_active)
01457 {
01458   g_signal_emit_by_name (object, "active-changed", arg_is_active);
01459 }
01460 
01474 void
01475 bamf_dbus_item_view_call_view_type (
01476     BamfDBusItemView *proxy,
01477     GCancellable *cancellable,
01478     GAsyncReadyCallback callback,
01479     gpointer user_data)
01480 {
01481   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01482     "ViewType",
01483     g_variant_new ("()"),
01484     G_DBUS_CALL_FLAGS_NONE,
01485     -1,
01486     cancellable,
01487     callback,
01488     user_data);
01489 }
01490 
01502 gboolean
01503 bamf_dbus_item_view_call_view_type_finish (
01504     BamfDBusItemView *proxy,
01505     gchar **out_view_type,
01506     GAsyncResult *res,
01507     GError **error)
01508 {
01509   GVariant *_ret;
01510   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01511   if (_ret == NULL)
01512     goto _out;
01513   g_variant_get (_ret,
01514                  "(s)",
01515                  out_view_type);
01516   g_variant_unref (_ret);
01517 _out:
01518   return _ret != NULL;
01519 }
01520 
01534 gboolean
01535 bamf_dbus_item_view_call_view_type_sync (
01536     BamfDBusItemView *proxy,
01537     gchar **out_view_type,
01538     GCancellable *cancellable,
01539     GError **error)
01540 {
01541   GVariant *_ret;
01542   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01543     "ViewType",
01544     g_variant_new ("()"),
01545     G_DBUS_CALL_FLAGS_NONE,
01546     -1,
01547     cancellable,
01548     error);
01549   if (_ret == NULL)
01550     goto _out;
01551   g_variant_get (_ret,
01552                  "(s)",
01553                  out_view_type);
01554   g_variant_unref (_ret);
01555 _out:
01556   return _ret != NULL;
01557 }
01558 
01572 void
01573 bamf_dbus_item_view_call_user_visible (
01574     BamfDBusItemView *proxy,
01575     GCancellable *cancellable,
01576     GAsyncReadyCallback callback,
01577     gpointer user_data)
01578 {
01579   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01580     "UserVisible",
01581     g_variant_new ("()"),
01582     G_DBUS_CALL_FLAGS_NONE,
01583     -1,
01584     cancellable,
01585     callback,
01586     user_data);
01587 }
01588 
01600 gboolean
01601 bamf_dbus_item_view_call_user_visible_finish (
01602     BamfDBusItemView *proxy,
01603     gboolean *out_visible,
01604     GAsyncResult *res,
01605     GError **error)
01606 {
01607   GVariant *_ret;
01608   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01609   if (_ret == NULL)
01610     goto _out;
01611   g_variant_get (_ret,
01612                  "(b)",
01613                  out_visible);
01614   g_variant_unref (_ret);
01615 _out:
01616   return _ret != NULL;
01617 }
01618 
01632 gboolean
01633 bamf_dbus_item_view_call_user_visible_sync (
01634     BamfDBusItemView *proxy,
01635     gboolean *out_visible,
01636     GCancellable *cancellable,
01637     GError **error)
01638 {
01639   GVariant *_ret;
01640   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01641     "UserVisible",
01642     g_variant_new ("()"),
01643     G_DBUS_CALL_FLAGS_NONE,
01644     -1,
01645     cancellable,
01646     error);
01647   if (_ret == NULL)
01648     goto _out;
01649   g_variant_get (_ret,
01650                  "(b)",
01651                  out_visible);
01652   g_variant_unref (_ret);
01653 _out:
01654   return _ret != NULL;
01655 }
01656 
01670 void
01671 bamf_dbus_item_view_call_icon (
01672     BamfDBusItemView *proxy,
01673     GCancellable *cancellable,
01674     GAsyncReadyCallback callback,
01675     gpointer user_data)
01676 {
01677   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01678     "Icon",
01679     g_variant_new ("()"),
01680     G_DBUS_CALL_FLAGS_NONE,
01681     -1,
01682     cancellable,
01683     callback,
01684     user_data);
01685 }
01686 
01698 gboolean
01699 bamf_dbus_item_view_call_icon_finish (
01700     BamfDBusItemView *proxy,
01701     gchar **out_name,
01702     GAsyncResult *res,
01703     GError **error)
01704 {
01705   GVariant *_ret;
01706   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01707   if (_ret == NULL)
01708     goto _out;
01709   g_variant_get (_ret,
01710                  "(s)",
01711                  out_name);
01712   g_variant_unref (_ret);
01713 _out:
01714   return _ret != NULL;
01715 }
01716 
01730 gboolean
01731 bamf_dbus_item_view_call_icon_sync (
01732     BamfDBusItemView *proxy,
01733     gchar **out_name,
01734     GCancellable *cancellable,
01735     GError **error)
01736 {
01737   GVariant *_ret;
01738   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01739     "Icon",
01740     g_variant_new ("()"),
01741     G_DBUS_CALL_FLAGS_NONE,
01742     -1,
01743     cancellable,
01744     error);
01745   if (_ret == NULL)
01746     goto _out;
01747   g_variant_get (_ret,
01748                  "(s)",
01749                  out_name);
01750   g_variant_unref (_ret);
01751 _out:
01752   return _ret != NULL;
01753 }
01754 
01768 void
01769 bamf_dbus_item_view_call_name (
01770     BamfDBusItemView *proxy,
01771     GCancellable *cancellable,
01772     GAsyncReadyCallback callback,
01773     gpointer user_data)
01774 {
01775   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01776     "Name",
01777     g_variant_new ("()"),
01778     G_DBUS_CALL_FLAGS_NONE,
01779     -1,
01780     cancellable,
01781     callback,
01782     user_data);
01783 }
01784 
01796 gboolean
01797 bamf_dbus_item_view_call_name_finish (
01798     BamfDBusItemView *proxy,
01799     gchar **out_name,
01800     GAsyncResult *res,
01801     GError **error)
01802 {
01803   GVariant *_ret;
01804   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01805   if (_ret == NULL)
01806     goto _out;
01807   g_variant_get (_ret,
01808                  "(s)",
01809                  out_name);
01810   g_variant_unref (_ret);
01811 _out:
01812   return _ret != NULL;
01813 }
01814 
01828 gboolean
01829 bamf_dbus_item_view_call_name_sync (
01830     BamfDBusItemView *proxy,
01831     gchar **out_name,
01832     GCancellable *cancellable,
01833     GError **error)
01834 {
01835   GVariant *_ret;
01836   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01837     "Name",
01838     g_variant_new ("()"),
01839     G_DBUS_CALL_FLAGS_NONE,
01840     -1,
01841     cancellable,
01842     error);
01843   if (_ret == NULL)
01844     goto _out;
01845   g_variant_get (_ret,
01846                  "(s)",
01847                  out_name);
01848   g_variant_unref (_ret);
01849 _out:
01850   return _ret != NULL;
01851 }
01852 
01866 void
01867 bamf_dbus_item_view_call_is_urgent (
01868     BamfDBusItemView *proxy,
01869     GCancellable *cancellable,
01870     GAsyncReadyCallback callback,
01871     gpointer user_data)
01872 {
01873   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01874     "IsUrgent",
01875     g_variant_new ("()"),
01876     G_DBUS_CALL_FLAGS_NONE,
01877     -1,
01878     cancellable,
01879     callback,
01880     user_data);
01881 }
01882 
01894 gboolean
01895 bamf_dbus_item_view_call_is_urgent_finish (
01896     BamfDBusItemView *proxy,
01897     gboolean *out_urgent,
01898     GAsyncResult *res,
01899     GError **error)
01900 {
01901   GVariant *_ret;
01902   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
01903   if (_ret == NULL)
01904     goto _out;
01905   g_variant_get (_ret,
01906                  "(b)",
01907                  out_urgent);
01908   g_variant_unref (_ret);
01909 _out:
01910   return _ret != NULL;
01911 }
01912 
01926 gboolean
01927 bamf_dbus_item_view_call_is_urgent_sync (
01928     BamfDBusItemView *proxy,
01929     gboolean *out_urgent,
01930     GCancellable *cancellable,
01931     GError **error)
01932 {
01933   GVariant *_ret;
01934   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
01935     "IsUrgent",
01936     g_variant_new ("()"),
01937     G_DBUS_CALL_FLAGS_NONE,
01938     -1,
01939     cancellable,
01940     error);
01941   if (_ret == NULL)
01942     goto _out;
01943   g_variant_get (_ret,
01944                  "(b)",
01945                  out_urgent);
01946   g_variant_unref (_ret);
01947 _out:
01948   return _ret != NULL;
01949 }
01950 
01964 void
01965 bamf_dbus_item_view_call_is_running (
01966     BamfDBusItemView *proxy,
01967     GCancellable *cancellable,
01968     GAsyncReadyCallback callback,
01969     gpointer user_data)
01970 {
01971   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
01972     "IsRunning",
01973     g_variant_new ("()"),
01974     G_DBUS_CALL_FLAGS_NONE,
01975     -1,
01976     cancellable,
01977     callback,
01978     user_data);
01979 }
01980 
01992 gboolean
01993 bamf_dbus_item_view_call_is_running_finish (
01994     BamfDBusItemView *proxy,
01995     gboolean *out_running,
01996     GAsyncResult *res,
01997     GError **error)
01998 {
01999   GVariant *_ret;
02000   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
02001   if (_ret == NULL)
02002     goto _out;
02003   g_variant_get (_ret,
02004                  "(b)",
02005                  out_running);
02006   g_variant_unref (_ret);
02007 _out:
02008   return _ret != NULL;
02009 }
02010 
02024 gboolean
02025 bamf_dbus_item_view_call_is_running_sync (
02026     BamfDBusItemView *proxy,
02027     gboolean *out_running,
02028     GCancellable *cancellable,
02029     GError **error)
02030 {
02031   GVariant *_ret;
02032   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
02033     "IsRunning",
02034     g_variant_new ("()"),
02035     G_DBUS_CALL_FLAGS_NONE,
02036     -1,
02037     cancellable,
02038     error);
02039   if (_ret == NULL)
02040     goto _out;
02041   g_variant_get (_ret,
02042                  "(b)",
02043                  out_running);
02044   g_variant_unref (_ret);
02045 _out:
02046   return _ret != NULL;
02047 }
02048 
02062 void
02063 bamf_dbus_item_view_call_is_active (
02064     BamfDBusItemView *proxy,
02065     GCancellable *cancellable,
02066     GAsyncReadyCallback callback,
02067     gpointer user_data)
02068 {
02069   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
02070     "IsActive",
02071     g_variant_new ("()"),
02072     G_DBUS_CALL_FLAGS_NONE,
02073     -1,
02074     cancellable,
02075     callback,
02076     user_data);
02077 }
02078 
02090 gboolean
02091 bamf_dbus_item_view_call_is_active_finish (
02092     BamfDBusItemView *proxy,
02093     gboolean *out_active,
02094     GAsyncResult *res,
02095     GError **error)
02096 {
02097   GVariant *_ret;
02098   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
02099   if (_ret == NULL)
02100     goto _out;
02101   g_variant_get (_ret,
02102                  "(b)",
02103                  out_active);
02104   g_variant_unref (_ret);
02105 _out:
02106   return _ret != NULL;
02107 }
02108 
02122 gboolean
02123 bamf_dbus_item_view_call_is_active_sync (
02124     BamfDBusItemView *proxy,
02125     gboolean *out_active,
02126     GCancellable *cancellable,
02127     GError **error)
02128 {
02129   GVariant *_ret;
02130   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
02131     "IsActive",
02132     g_variant_new ("()"),
02133     G_DBUS_CALL_FLAGS_NONE,
02134     -1,
02135     cancellable,
02136     error);
02137   if (_ret == NULL)
02138     goto _out;
02139   g_variant_get (_ret,
02140                  "(b)",
02141                  out_active);
02142   g_variant_unref (_ret);
02143 _out:
02144   return _ret != NULL;
02145 }
02146 
02160 void
02161 bamf_dbus_item_view_call_parents (
02162     BamfDBusItemView *proxy,
02163     GCancellable *cancellable,
02164     GAsyncReadyCallback callback,
02165     gpointer user_data)
02166 {
02167   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
02168     "Parents",
02169     g_variant_new ("()"),
02170     G_DBUS_CALL_FLAGS_NONE,
02171     -1,
02172     cancellable,
02173     callback,
02174     user_data);
02175 }
02176 
02188 gboolean
02189 bamf_dbus_item_view_call_parents_finish (
02190     BamfDBusItemView *proxy,
02191     gchar ***out_parents_paths,
02192     GAsyncResult *res,
02193     GError **error)
02194 {
02195   GVariant *_ret;
02196   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
02197   if (_ret == NULL)
02198     goto _out;
02199   g_variant_get (_ret,
02200                  "(^as)",
02201                  out_parents_paths);
02202   g_variant_unref (_ret);
02203 _out:
02204   return _ret != NULL;
02205 }
02206 
02220 gboolean
02221 bamf_dbus_item_view_call_parents_sync (
02222     BamfDBusItemView *proxy,
02223     gchar ***out_parents_paths,
02224     GCancellable *cancellable,
02225     GError **error)
02226 {
02227   GVariant *_ret;
02228   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
02229     "Parents",
02230     g_variant_new ("()"),
02231     G_DBUS_CALL_FLAGS_NONE,
02232     -1,
02233     cancellable,
02234     error);
02235   if (_ret == NULL)
02236     goto _out;
02237   g_variant_get (_ret,
02238                  "(^as)",
02239                  out_parents_paths);
02240   g_variant_unref (_ret);
02241 _out:
02242   return _ret != NULL;
02243 }
02244 
02258 void
02259 bamf_dbus_item_view_call_children (
02260     BamfDBusItemView *proxy,
02261     GCancellable *cancellable,
02262     GAsyncReadyCallback callback,
02263     gpointer user_data)
02264 {
02265   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
02266     "Children",
02267     g_variant_new ("()"),
02268     G_DBUS_CALL_FLAGS_NONE,
02269     -1,
02270     cancellable,
02271     callback,
02272     user_data);
02273 }
02274 
02286 gboolean
02287 bamf_dbus_item_view_call_children_finish (
02288     BamfDBusItemView *proxy,
02289     gchar ***out_children_paths,
02290     GAsyncResult *res,
02291     GError **error)
02292 {
02293   GVariant *_ret;
02294   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
02295   if (_ret == NULL)
02296     goto _out;
02297   g_variant_get (_ret,
02298                  "(^as)",
02299                  out_children_paths);
02300   g_variant_unref (_ret);
02301 _out:
02302   return _ret != NULL;
02303 }
02304 
02318 gboolean
02319 bamf_dbus_item_view_call_children_sync (
02320     BamfDBusItemView *proxy,
02321     gchar ***out_children_paths,
02322     GCancellable *cancellable,
02323     GError **error)
02324 {
02325   GVariant *_ret;
02326   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
02327     "Children",
02328     g_variant_new ("()"),
02329     G_DBUS_CALL_FLAGS_NONE,
02330     -1,
02331     cancellable,
02332     error);
02333   if (_ret == NULL)
02334     goto _out;
02335   g_variant_get (_ret,
02336                  "(^as)",
02337                  out_children_paths);
02338   g_variant_unref (_ret);
02339 _out:
02340   return _ret != NULL;
02341 }
02342 
02353 void
02354 bamf_dbus_item_view_complete_view_type (
02355     BamfDBusItemView *object,
02356     GDBusMethodInvocation *invocation,
02357     const gchar *view_type)
02358 {
02359   g_dbus_method_invocation_return_value (invocation,
02360     g_variant_new ("(s)",
02361                    view_type));
02362 }
02363 
02374 void
02375 bamf_dbus_item_view_complete_user_visible (
02376     BamfDBusItemView *object,
02377     GDBusMethodInvocation *invocation,
02378     gboolean visible)
02379 {
02380   g_dbus_method_invocation_return_value (invocation,
02381     g_variant_new ("(b)",
02382                    visible));
02383 }
02384 
02395 void
02396 bamf_dbus_item_view_complete_icon (
02397     BamfDBusItemView *object,
02398     GDBusMethodInvocation *invocation,
02399     const gchar *name)
02400 {
02401   g_dbus_method_invocation_return_value (invocation,
02402     g_variant_new ("(s)",
02403                    name));
02404 }
02405 
02416 void
02417 bamf_dbus_item_view_complete_name (
02418     BamfDBusItemView *object,
02419     GDBusMethodInvocation *invocation,
02420     const gchar *name)
02421 {
02422   g_dbus_method_invocation_return_value (invocation,
02423     g_variant_new ("(s)",
02424                    name));
02425 }
02426 
02437 void
02438 bamf_dbus_item_view_complete_is_urgent (
02439     BamfDBusItemView *object,
02440     GDBusMethodInvocation *invocation,
02441     gboolean urgent)
02442 {
02443   g_dbus_method_invocation_return_value (invocation,
02444     g_variant_new ("(b)",
02445                    urgent));
02446 }
02447 
02458 void
02459 bamf_dbus_item_view_complete_is_running (
02460     BamfDBusItemView *object,
02461     GDBusMethodInvocation *invocation,
02462     gboolean running)
02463 {
02464   g_dbus_method_invocation_return_value (invocation,
02465     g_variant_new ("(b)",
02466                    running));
02467 }
02468 
02479 void
02480 bamf_dbus_item_view_complete_is_active (
02481     BamfDBusItemView *object,
02482     GDBusMethodInvocation *invocation,
02483     gboolean active)
02484 {
02485   g_dbus_method_invocation_return_value (invocation,
02486     g_variant_new ("(b)",
02487                    active));
02488 }
02489 
02500 void
02501 bamf_dbus_item_view_complete_parents (
02502     BamfDBusItemView *object,
02503     GDBusMethodInvocation *invocation,
02504     const gchar *const *parents_paths)
02505 {
02506   g_dbus_method_invocation_return_value (invocation,
02507     g_variant_new ("(^as)",
02508                    parents_paths));
02509 }
02510 
02521 void
02522 bamf_dbus_item_view_complete_children (
02523     BamfDBusItemView *object,
02524     GDBusMethodInvocation *invocation,
02525     const gchar *const *children_paths)
02526 {
02527   g_dbus_method_invocation_return_value (invocation,
02528     g_variant_new ("(^as)",
02529                    children_paths));
02530 }
02531 
02532 /* ------------------------------------------------------------------------ */
02533 
02547 struct _BamfDBusItemViewProxyPrivate
02548 {
02549   GData *qdata;
02550 };
02551 
02552 static void bamf_dbus_item_view_proxy_iface_init (BamfDBusItemViewIface *iface);
02553 
02554 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemViewProxy, bamf_dbus_item_view_proxy, G_TYPE_DBUS_PROXY,
02555                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_VIEW, bamf_dbus_item_view_proxy_iface_init));
02556 
02557 static void
02558 bamf_dbus_item_view_proxy_finalize (GObject *object)
02559 {
02560   BamfDBusItemViewProxy *proxy = BAMF_DBUS_ITEM_VIEW_PROXY (object);
02561   g_datalist_clear (&proxy->priv->qdata);
02562   G_OBJECT_CLASS (bamf_dbus_item_view_proxy_parent_class)->finalize (object);
02563 }
02564 
02565 static void
02566 bamf_dbus_item_view_proxy_get_property (GObject      *object,
02567   guint         prop_id,
02568   GValue       *value,
02569   GParamSpec   *pspec)
02570 {
02571   const _ExtendedGDBusPropertyInfo *info;
02572   GVariant *variant;
02573   g_assert (prop_id != 0 && prop_id - 1 < 4);
02574   info = _bamf_dbus_item_view_property_info_pointers[prop_id - 1];
02575   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
02576   if (info->use_gvariant)
02577     {
02578       g_value_set_variant (value, variant);
02579     }
02580   else
02581     {
02582       if (variant != NULL)
02583         g_dbus_gvariant_to_gvalue (variant, value);
02584     }
02585   if (variant != NULL)
02586     g_variant_unref (variant);
02587 }
02588 
02589 static void
02590 bamf_dbus_item_view_proxy_set_property_cb (GDBusProxy *proxy,
02591   GAsyncResult *res,
02592   gpointer      user_data)
02593 {
02594   const _ExtendedGDBusPropertyInfo *info = user_data;
02595   GError *error;
02596   error = NULL;
02597   if (!g_dbus_proxy_call_finish (proxy, res, &error))
02598     {
02599       g_warning ("Error setting property `%s' on interface org.ayatana.bamf.view: %s (%s, %d)",
02600                  info->parent_struct.name, 
02601                  error->message, g_quark_to_string (error->domain), error->code);
02602       g_error_free (error);
02603     }
02604 }
02605 
02606 static void
02607 bamf_dbus_item_view_proxy_set_property (GObject      *object,
02608   guint         prop_id,
02609   const GValue *value,
02610   GParamSpec   *pspec)
02611 {
02612   const _ExtendedGDBusPropertyInfo *info;
02613   GVariant *variant;
02614   g_assert (prop_id != 0 && prop_id - 1 < 4);
02615   info = _bamf_dbus_item_view_property_info_pointers[prop_id - 1];
02616   variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
02617   g_dbus_proxy_call (G_DBUS_PROXY (object),
02618     "org.freedesktop.DBus.Properties.Set",
02619     g_variant_new ("(ssv)", "org.ayatana.bamf.view", info->parent_struct.name, variant),
02620     G_DBUS_CALL_FLAGS_NONE,
02621     -1,
02622     NULL, (GAsyncReadyCallback) bamf_dbus_item_view_proxy_set_property_cb, (gpointer) info);
02623   g_variant_unref (variant);
02624 }
02625 
02626 static void
02627 bamf_dbus_item_view_proxy_g_signal (GDBusProxy *proxy,
02628   const gchar *sender_name,
02629   const gchar *signal_name,
02630   GVariant *parameters)
02631 {
02632   _ExtendedGDBusSignalInfo *info;
02633   GVariantIter iter;
02634   GVariant *child;
02635   GValue *paramv;
02636   guint num_params;
02637   guint n;
02638   guint signal_id;
02639   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_bamf_dbus_item_view_interface_info, signal_name);
02640   if (info == NULL)
02641     return;
02642   num_params = g_variant_n_children (parameters);
02643   paramv = g_new0 (GValue, num_params + 1);
02644   g_value_init (&paramv[0], BAMF_DBUS_ITEM_TYPE_VIEW);
02645   g_value_set_object (&paramv[0], proxy);
02646   g_variant_iter_init (&iter, parameters);
02647   n = 1;
02648   while ((child = g_variant_iter_next_value (&iter)) != NULL)
02649     {
02650       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
02651       if (arg_info->use_gvariant)
02652         {
02653           g_value_init (&paramv[n], G_TYPE_VARIANT);
02654           g_value_set_variant (&paramv[n], child);
02655           n++;
02656         }
02657       else
02658         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
02659       g_variant_unref (child);
02660     }
02661   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_VIEW);
02662   g_signal_emitv (paramv, signal_id, 0, NULL);
02663   for (n = 0; n < num_params + 1; n++)
02664     g_value_unset (&paramv[n]);
02665   g_free (paramv);
02666 }
02667 
02668 static void
02669 bamf_dbus_item_view_proxy_g_properties_changed (GDBusProxy *_proxy,
02670   GVariant *changed_properties,
02671   const gchar *const *invalidated_properties)
02672 {
02673   BamfDBusItemViewProxy *proxy = BAMF_DBUS_ITEM_VIEW_PROXY (_proxy);
02674   guint n;
02675   const gchar *key;
02676   GVariantIter *iter;
02677   _ExtendedGDBusPropertyInfo *info;
02678   g_variant_get (changed_properties, "a{sv}", &iter);
02679   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
02680     {
02681       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_view_interface_info, key);
02682       g_datalist_remove_data (&proxy->priv->qdata, key);
02683       if (info != NULL)
02684         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
02685     }
02686   g_variant_iter_free (iter);
02687   for (n = 0; invalidated_properties[n] != NULL; n++)
02688     {
02689       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_view_interface_info, invalidated_properties[n]);
02690       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
02691       if (info != NULL)
02692         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
02693     }
02694 }
02695 
02696 static gboolean 
02697 bamf_dbus_item_view_proxy_get_user_visible (BamfDBusItemView *object)
02698 {
02699   BamfDBusItemViewProxy *proxy = BAMF_DBUS_ITEM_VIEW_PROXY (object);
02700   GVariant *variant;
02701   gboolean value = 0;
02702   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "UserVisible");
02703   if (variant != NULL)
02704     {
02705       value = g_variant_get_boolean (variant);
02706       g_variant_unref (variant);
02707     }
02708   return value;
02709 }
02710 
02711 static gboolean 
02712 bamf_dbus_item_view_proxy_get_running (BamfDBusItemView *object)
02713 {
02714   BamfDBusItemViewProxy *proxy = BAMF_DBUS_ITEM_VIEW_PROXY (object);
02715   GVariant *variant;
02716   gboolean value = 0;
02717   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Running");
02718   if (variant != NULL)
02719     {
02720       value = g_variant_get_boolean (variant);
02721       g_variant_unref (variant);
02722     }
02723   return value;
02724 }
02725 
02726 static gboolean 
02727 bamf_dbus_item_view_proxy_get_urgent (BamfDBusItemView *object)
02728 {
02729   BamfDBusItemViewProxy *proxy = BAMF_DBUS_ITEM_VIEW_PROXY (object);
02730   GVariant *variant;
02731   gboolean value = 0;
02732   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Urgent");
02733   if (variant != NULL)
02734     {
02735       value = g_variant_get_boolean (variant);
02736       g_variant_unref (variant);
02737     }
02738   return value;
02739 }
02740 
02741 static gboolean 
02742 bamf_dbus_item_view_proxy_get_active (BamfDBusItemView *object)
02743 {
02744   BamfDBusItemViewProxy *proxy = BAMF_DBUS_ITEM_VIEW_PROXY (object);
02745   GVariant *variant;
02746   gboolean value = 0;
02747   variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Active");
02748   if (variant != NULL)
02749     {
02750       value = g_variant_get_boolean (variant);
02751       g_variant_unref (variant);
02752     }
02753   return value;
02754 }
02755 
02756 static void
02757 bamf_dbus_item_view_proxy_init (BamfDBusItemViewProxy *proxy)
02758 {
02759   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, BAMF_DBUS_ITEM_TYPE_VIEW_PROXY, BamfDBusItemViewProxyPrivate);
02760   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), bamf_dbus_item_view_interface_info ());
02761 }
02762 
02763 static void
02764 bamf_dbus_item_view_proxy_class_init (BamfDBusItemViewProxyClass *klass)
02765 {
02766   GObjectClass *gobject_class;
02767   GDBusProxyClass *proxy_class;
02768 
02769   g_type_class_add_private (klass, sizeof (BamfDBusItemViewProxyPrivate));
02770 
02771   gobject_class = G_OBJECT_CLASS (klass);
02772   gobject_class->finalize     = bamf_dbus_item_view_proxy_finalize;
02773   gobject_class->get_property = bamf_dbus_item_view_proxy_get_property;
02774   gobject_class->set_property = bamf_dbus_item_view_proxy_set_property;
02775 
02776   proxy_class = G_DBUS_PROXY_CLASS (klass);
02777   proxy_class->g_signal = bamf_dbus_item_view_proxy_g_signal;
02778   proxy_class->g_properties_changed = bamf_dbus_item_view_proxy_g_properties_changed;
02779 
02780 
02781   bamf_dbus_item_view_override_properties (gobject_class, 1);
02782 }
02783 
02784 static void
02785 bamf_dbus_item_view_proxy_iface_init (BamfDBusItemViewIface *iface)
02786 {
02787   iface->get_user_visible = bamf_dbus_item_view_proxy_get_user_visible;
02788   iface->get_running = bamf_dbus_item_view_proxy_get_running;
02789   iface->get_urgent = bamf_dbus_item_view_proxy_get_urgent;
02790   iface->get_active = bamf_dbus_item_view_proxy_get_active;
02791 }
02792 
02810 void
02811 bamf_dbus_item_view_proxy_new (
02812     GDBusConnection     *connection,
02813     GDBusProxyFlags      flags,
02814     const gchar         *name,
02815     const gchar         *object_path,
02816     GCancellable        *cancellable,
02817     GAsyncReadyCallback  callback,
02818     gpointer             user_data)
02819 {
02820   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_VIEW_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.view", NULL);
02821 }
02822 
02832 BamfDBusItemView *
02833 bamf_dbus_item_view_proxy_new_finish (
02834     GAsyncResult        *res,
02835     GError             **error)
02836 {
02837   GObject *ret;
02838   GObject *source_object;
02839   source_object = g_async_result_get_source_object (res);
02840   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
02841   g_object_unref (source_object);
02842   if (ret != NULL)
02843     return BAMF_DBUS_ITEM_VIEW (ret);
02844   else
02845     return NULL;
02846 }
02847 
02865 BamfDBusItemView *
02866 bamf_dbus_item_view_proxy_new_sync (
02867     GDBusConnection     *connection,
02868     GDBusProxyFlags      flags,
02869     const gchar         *name,
02870     const gchar         *object_path,
02871     GCancellable        *cancellable,
02872     GError             **error)
02873 {
02874   GInitable *ret;
02875   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_VIEW_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.ayatana.bamf.view", NULL);
02876   if (ret != NULL)
02877     return BAMF_DBUS_ITEM_VIEW (ret);
02878   else
02879     return NULL;
02880 }
02881 
02882 
02900 void
02901 bamf_dbus_item_view_proxy_new_for_bus (
02902     GBusType             bus_type,
02903     GDBusProxyFlags      flags,
02904     const gchar         *name,
02905     const gchar         *object_path,
02906     GCancellable        *cancellable,
02907     GAsyncReadyCallback  callback,
02908     gpointer             user_data)
02909 {
02910   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_VIEW_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.view", NULL);
02911 }
02912 
02922 BamfDBusItemView *
02923 bamf_dbus_item_view_proxy_new_for_bus_finish (
02924     GAsyncResult        *res,
02925     GError             **error)
02926 {
02927   GObject *ret;
02928   GObject *source_object;
02929   source_object = g_async_result_get_source_object (res);
02930   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
02931   g_object_unref (source_object);
02932   if (ret != NULL)
02933     return BAMF_DBUS_ITEM_VIEW (ret);
02934   else
02935     return NULL;
02936 }
02937 
02955 BamfDBusItemView *
02956 bamf_dbus_item_view_proxy_new_for_bus_sync (
02957     GBusType             bus_type,
02958     GDBusProxyFlags      flags,
02959     const gchar         *name,
02960     const gchar         *object_path,
02961     GCancellable        *cancellable,
02962     GError             **error)
02963 {
02964   GInitable *ret;
02965   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_VIEW_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.view", NULL);
02966   if (ret != NULL)
02967     return BAMF_DBUS_ITEM_VIEW (ret);
02968   else
02969     return NULL;
02970 }
02971 
02972 
02973 /* ------------------------------------------------------------------------ */
02974 
02988 struct _BamfDBusItemViewSkeletonPrivate
02989 {
02990   GValue *properties;
02991   GList *changed_properties;
02992   GSource *changed_properties_idle_source;
02993   GMainContext *context;
02994   GMutex lock;
02995 };
02996 
02997 static void
02998 _bamf_dbus_item_view_skeleton_handle_method_call (
02999   GDBusConnection *connection,
03000   const gchar *sender,
03001   const gchar *object_path,
03002   const gchar *interface_name,
03003   const gchar *method_name,
03004   GVariant *parameters,
03005   GDBusMethodInvocation *invocation,
03006   gpointer user_data)
03007 {
03008   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (user_data);
03009   _ExtendedGDBusMethodInfo *info;
03010   GVariantIter iter;
03011   GVariant *child;
03012   GValue *paramv;
03013   guint num_params;
03014   guint num_extra;
03015   guint n;
03016   guint signal_id;
03017   GValue return_value = G_VALUE_INIT;
03018   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
03019   g_assert (info != NULL);
03020   num_params = g_variant_n_children (parameters);
03021   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
03022   n = 0;
03023   g_value_init (&paramv[n], BAMF_DBUS_ITEM_TYPE_VIEW);
03024   g_value_set_object (&paramv[n++], skeleton);
03025   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
03026   g_value_set_object (&paramv[n++], invocation);
03027   if (info->pass_fdlist)
03028     {
03029 #ifdef G_OS_UNIX
03030       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
03031       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
03032 #else
03033       g_assert_not_reached ();
03034 #endif
03035     }
03036   g_variant_iter_init (&iter, parameters);
03037   while ((child = g_variant_iter_next_value (&iter)) != NULL)
03038     {
03039       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
03040       if (arg_info->use_gvariant)
03041         {
03042           g_value_init (&paramv[n], G_TYPE_VARIANT);
03043           g_value_set_variant (&paramv[n], child);
03044           n++;
03045         }
03046       else
03047         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
03048       g_variant_unref (child);
03049     }
03050   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_VIEW);
03051   g_value_init (&return_value, G_TYPE_BOOLEAN);
03052   g_signal_emitv (paramv, signal_id, 0, &return_value);
03053   if (!g_value_get_boolean (&return_value))
03054     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);
03055   g_value_unset (&return_value);
03056   for (n = 0; n < num_params + num_extra; n++)
03057     g_value_unset (&paramv[n]);
03058   g_free (paramv);
03059 }
03060 
03061 static GVariant *
03062 _bamf_dbus_item_view_skeleton_handle_get_property (
03063   GDBusConnection *connection,
03064   const gchar *sender,
03065   const gchar *object_path,
03066   const gchar *interface_name,
03067   const gchar *property_name,
03068   GError **error,
03069   gpointer user_data)
03070 {
03071   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (user_data);
03072   GValue value = G_VALUE_INIT;
03073   GParamSpec *pspec;
03074   _ExtendedGDBusPropertyInfo *info;
03075   GVariant *ret;
03076   ret = NULL;
03077   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_view_interface_info, property_name);
03078   g_assert (info != NULL);
03079   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
03080   if (pspec == NULL)
03081     {
03082       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
03083     }
03084   else
03085     {
03086       g_value_init (&value, pspec->value_type);
03087       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
03088       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
03089       g_value_unset (&value);
03090     }
03091   return ret;
03092 }
03093 
03094 static gboolean
03095 _bamf_dbus_item_view_skeleton_handle_set_property (
03096   GDBusConnection *connection,
03097   const gchar *sender,
03098   const gchar *object_path,
03099   const gchar *interface_name,
03100   const gchar *property_name,
03101   GVariant *variant,
03102   GError **error,
03103   gpointer user_data)
03104 {
03105   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (user_data);
03106   GValue value = G_VALUE_INIT;
03107   GParamSpec *pspec;
03108   _ExtendedGDBusPropertyInfo *info;
03109   gboolean ret;
03110   ret = FALSE;
03111   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_view_interface_info, property_name);
03112   g_assert (info != NULL);
03113   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
03114   if (pspec == NULL)
03115     {
03116       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
03117     }
03118   else
03119     {
03120       if (info->use_gvariant)
03121         g_value_set_variant (&value, variant);
03122       else
03123         g_dbus_gvariant_to_gvalue (variant, &value);
03124       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
03125       g_value_unset (&value);
03126       ret = TRUE;
03127     }
03128   return ret;
03129 }
03130 
03131 static const GDBusInterfaceVTable _bamf_dbus_item_view_skeleton_vtable =
03132 {
03133   _bamf_dbus_item_view_skeleton_handle_method_call,
03134   _bamf_dbus_item_view_skeleton_handle_get_property,
03135   _bamf_dbus_item_view_skeleton_handle_set_property
03136 };
03137 
03138 static GDBusInterfaceInfo *
03139 bamf_dbus_item_view_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
03140 {
03141   return bamf_dbus_item_view_interface_info ();
03142 }
03143 
03144 static GDBusInterfaceVTable *
03145 bamf_dbus_item_view_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
03146 {
03147   return (GDBusInterfaceVTable *) &_bamf_dbus_item_view_skeleton_vtable;
03148 }
03149 
03150 static GVariant *
03151 bamf_dbus_item_view_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
03152 {
03153   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (_skeleton);
03154 
03155   GVariantBuilder builder;
03156   guint n;
03157   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
03158   if (_bamf_dbus_item_view_interface_info.parent_struct.properties == NULL)
03159     goto out;
03160   for (n = 0; _bamf_dbus_item_view_interface_info.parent_struct.properties[n] != NULL; n++)
03161     {
03162       GDBusPropertyInfo *info = _bamf_dbus_item_view_interface_info.parent_struct.properties[n];
03163       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
03164         {
03165           GVariant *value;
03166           value = _bamf_dbus_item_view_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.view", info->name, NULL, skeleton);
03167           if (value != NULL)
03168             {
03169               g_variant_take_ref (value);
03170               g_variant_builder_add (&builder, "{sv}", info->name, value);
03171               g_variant_unref (value);
03172             }
03173         }
03174     }
03175 out:
03176   return g_variant_builder_end (&builder);
03177 }
03178 
03179 static gboolean _bamf_dbus_item_view_emit_changed (gpointer user_data);
03180 
03181 static void
03182 bamf_dbus_item_view_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
03183 {
03184   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (_skeleton);
03185   gboolean emit_changed = FALSE;
03186 
03187   g_mutex_lock (&skeleton->priv->lock);
03188   if (skeleton->priv->changed_properties_idle_source != NULL)
03189     {
03190       g_source_destroy (skeleton->priv->changed_properties_idle_source);
03191       skeleton->priv->changed_properties_idle_source = NULL;
03192       emit_changed = TRUE;
03193     }
03194   g_mutex_unlock (&skeleton->priv->lock);
03195 
03196   if (emit_changed)
03197     _bamf_dbus_item_view_emit_changed (skeleton);
03198 }
03199 
03200 static void
03201 _bamf_dbus_item_view_on_signal_name_changed (
03202     BamfDBusItemView *object,
03203     const gchar *arg_old_name,
03204     const gchar *arg_new_name)
03205 {
03206   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03207 
03208   GList      *connections, *l;
03209   GVariant   *signal_variant;
03210   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03211 
03212   signal_variant = g_variant_ref_sink (g_variant_new ("(ss)",
03213                    arg_old_name,
03214                    arg_new_name));
03215   for (l = connections; l != NULL; l = l->next)
03216     {
03217       GDBusConnection *connection = l->data;
03218       g_dbus_connection_emit_signal (connection,
03219         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.view", "NameChanged",
03220         signal_variant, NULL);
03221     }
03222   g_variant_unref (signal_variant);
03223   g_list_free_full (connections, g_object_unref);
03224 }
03225 
03226 static void
03227 _bamf_dbus_item_view_on_signal_user_visible_changed (
03228     BamfDBusItemView *object,
03229     gboolean arg_user_visible)
03230 {
03231   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03232 
03233   GList      *connections, *l;
03234   GVariant   *signal_variant;
03235   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03236 
03237   signal_variant = g_variant_ref_sink (g_variant_new ("(b)",
03238                    arg_user_visible));
03239   for (l = connections; l != NULL; l = l->next)
03240     {
03241       GDBusConnection *connection = l->data;
03242       g_dbus_connection_emit_signal (connection,
03243         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.view", "UserVisibleChanged",
03244         signal_variant, NULL);
03245     }
03246   g_variant_unref (signal_variant);
03247   g_list_free_full (connections, g_object_unref);
03248 }
03249 
03250 static void
03251 _bamf_dbus_item_view_on_signal_urgent_changed (
03252     BamfDBusItemView *object,
03253     gboolean arg_is_urgent)
03254 {
03255   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03256 
03257   GList      *connections, *l;
03258   GVariant   *signal_variant;
03259   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03260 
03261   signal_variant = g_variant_ref_sink (g_variant_new ("(b)",
03262                    arg_is_urgent));
03263   for (l = connections; l != NULL; l = l->next)
03264     {
03265       GDBusConnection *connection = l->data;
03266       g_dbus_connection_emit_signal (connection,
03267         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.view", "UrgentChanged",
03268         signal_variant, NULL);
03269     }
03270   g_variant_unref (signal_variant);
03271   g_list_free_full (connections, g_object_unref);
03272 }
03273 
03274 static void
03275 _bamf_dbus_item_view_on_signal_running_changed (
03276     BamfDBusItemView *object,
03277     gboolean arg_is_running)
03278 {
03279   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03280 
03281   GList      *connections, *l;
03282   GVariant   *signal_variant;
03283   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03284 
03285   signal_variant = g_variant_ref_sink (g_variant_new ("(b)",
03286                    arg_is_running));
03287   for (l = connections; l != NULL; l = l->next)
03288     {
03289       GDBusConnection *connection = l->data;
03290       g_dbus_connection_emit_signal (connection,
03291         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.view", "RunningChanged",
03292         signal_variant, NULL);
03293     }
03294   g_variant_unref (signal_variant);
03295   g_list_free_full (connections, g_object_unref);
03296 }
03297 
03298 static void
03299 _bamf_dbus_item_view_on_signal_child_removed (
03300     BamfDBusItemView *object,
03301     const gchar *arg_path)
03302 {
03303   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03304 
03305   GList      *connections, *l;
03306   GVariant   *signal_variant;
03307   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03308 
03309   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
03310                    arg_path));
03311   for (l = connections; l != NULL; l = l->next)
03312     {
03313       GDBusConnection *connection = l->data;
03314       g_dbus_connection_emit_signal (connection,
03315         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.view", "ChildRemoved",
03316         signal_variant, NULL);
03317     }
03318   g_variant_unref (signal_variant);
03319   g_list_free_full (connections, g_object_unref);
03320 }
03321 
03322 static void
03323 _bamf_dbus_item_view_on_signal_child_added (
03324     BamfDBusItemView *object,
03325     const gchar *arg_path)
03326 {
03327   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03328 
03329   GList      *connections, *l;
03330   GVariant   *signal_variant;
03331   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03332 
03333   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
03334                    arg_path));
03335   for (l = connections; l != NULL; l = l->next)
03336     {
03337       GDBusConnection *connection = l->data;
03338       g_dbus_connection_emit_signal (connection,
03339         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.view", "ChildAdded",
03340         signal_variant, NULL);
03341     }
03342   g_variant_unref (signal_variant);
03343   g_list_free_full (connections, g_object_unref);
03344 }
03345 
03346 static void
03347 _bamf_dbus_item_view_on_signal_closed (
03348     BamfDBusItemView *object)
03349 {
03350   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03351 
03352   GList      *connections, *l;
03353   GVariant   *signal_variant;
03354   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03355 
03356   signal_variant = g_variant_ref_sink (g_variant_new ("()"));
03357   for (l = connections; l != NULL; l = l->next)
03358     {
03359       GDBusConnection *connection = l->data;
03360       g_dbus_connection_emit_signal (connection,
03361         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.view", "Closed",
03362         signal_variant, NULL);
03363     }
03364   g_variant_unref (signal_variant);
03365   g_list_free_full (connections, g_object_unref);
03366 }
03367 
03368 static void
03369 _bamf_dbus_item_view_on_signal_active_changed (
03370     BamfDBusItemView *object,
03371     gboolean arg_is_active)
03372 {
03373   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03374 
03375   GList      *connections, *l;
03376   GVariant   *signal_variant;
03377   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03378 
03379   signal_variant = g_variant_ref_sink (g_variant_new ("(b)",
03380                    arg_is_active));
03381   for (l = connections; l != NULL; l = l->next)
03382     {
03383       GDBusConnection *connection = l->data;
03384       g_dbus_connection_emit_signal (connection,
03385         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.view", "ActiveChanged",
03386         signal_variant, NULL);
03387     }
03388   g_variant_unref (signal_variant);
03389   g_list_free_full (connections, g_object_unref);
03390 }
03391 
03392 static void bamf_dbus_item_view_skeleton_iface_init (BamfDBusItemViewIface *iface);
03393 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemViewSkeleton, bamf_dbus_item_view_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
03394                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_VIEW, bamf_dbus_item_view_skeleton_iface_init));
03395 
03396 static void
03397 bamf_dbus_item_view_skeleton_finalize (GObject *object)
03398 {
03399   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03400   guint n;
03401   for (n = 0; n < 4; n++)
03402     g_value_unset (&skeleton->priv->properties[n]);
03403   g_free (skeleton->priv->properties);
03404   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
03405   if (skeleton->priv->changed_properties_idle_source != NULL)
03406     g_source_destroy (skeleton->priv->changed_properties_idle_source);
03407   g_main_context_unref (skeleton->priv->context);
03408   g_mutex_clear (&skeleton->priv->lock);
03409   G_OBJECT_CLASS (bamf_dbus_item_view_skeleton_parent_class)->finalize (object);
03410 }
03411 
03412 static void
03413 bamf_dbus_item_view_skeleton_get_property (GObject      *object,
03414   guint         prop_id,
03415   GValue       *value,
03416   GParamSpec   *pspec)
03417 {
03418   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03419   g_assert (prop_id != 0 && prop_id - 1 < 4);
03420   g_mutex_lock (&skeleton->priv->lock);
03421   g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
03422   g_mutex_unlock (&skeleton->priv->lock);
03423 }
03424 
03425 static gboolean
03426 _bamf_dbus_item_view_emit_changed (gpointer user_data)
03427 {
03428   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (user_data);
03429   GList *l;
03430   GVariantBuilder builder;
03431   GVariantBuilder invalidated_builder;
03432   guint num_changes;
03433 
03434   g_mutex_lock (&skeleton->priv->lock);
03435   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
03436   g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
03437   for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
03438     {
03439       ChangedProperty *cp = l->data;
03440       GVariant *variant;
03441       const GValue *cur_value;
03442 
03443       cur_value = &skeleton->priv->properties[cp->prop_id - 1];
03444       if (!_g_value_equal (cur_value, &cp->orig_value))
03445         {
03446           variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
03447           g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
03448           g_variant_unref (variant);
03449           num_changes++;
03450         }
03451     }
03452   if (num_changes > 0)
03453     {
03454       GList *connections, *l;
03455       GVariant *signal_variant;
03456       signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.ayatana.bamf.view",
03457                                            &builder, &invalidated_builder));
03458       connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
03459       for (l = connections; l != NULL; l = l->next)
03460         {
03461           GDBusConnection *connection = l->data;
03462 
03463           g_dbus_connection_emit_signal (connection,
03464                                          NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
03465                                          "org.freedesktop.DBus.Properties",
03466                                          "PropertiesChanged",
03467                                          signal_variant,
03468                                          NULL);
03469         }
03470       g_variant_unref (signal_variant);
03471       g_list_free_full (connections, g_object_unref);
03472     }
03473   else
03474     {
03475       g_variant_builder_clear (&builder);
03476       g_variant_builder_clear (&invalidated_builder);
03477     }
03478   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
03479   skeleton->priv->changed_properties = NULL;
03480   skeleton->priv->changed_properties_idle_source = NULL;
03481   g_mutex_unlock (&skeleton->priv->lock);
03482   return FALSE;
03483 }
03484 
03485 static void
03486 _bamf_dbus_item_view_schedule_emit_changed (BamfDBusItemViewSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
03487 {
03488   ChangedProperty *cp;
03489   GList *l;
03490   cp = NULL;
03491   for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
03492     {
03493       ChangedProperty *i_cp = l->data;
03494       if (i_cp->info == info)
03495         {
03496           cp = i_cp;
03497           break;
03498         }
03499     }
03500   if (cp == NULL)
03501     {
03502       cp = g_new0 (ChangedProperty, 1);
03503       cp->prop_id = prop_id;
03504       cp->info = info;
03505       skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
03506       g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
03507       g_value_copy (orig_value, &cp->orig_value);
03508     }
03509 }
03510 
03511 static void
03512 bamf_dbus_item_view_skeleton_notify (GObject      *object,
03513   GParamSpec *pspec)
03514 {
03515   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03516   g_mutex_lock (&skeleton->priv->lock);
03517   if (skeleton->priv->changed_properties != NULL &&
03518       skeleton->priv->changed_properties_idle_source == NULL)
03519     {
03520       skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
03521       g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
03522       g_source_set_callback (skeleton->priv->changed_properties_idle_source, _bamf_dbus_item_view_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
03523       g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
03524       g_source_unref (skeleton->priv->changed_properties_idle_source);
03525     }
03526   g_mutex_unlock (&skeleton->priv->lock);
03527 }
03528 
03529 static void
03530 bamf_dbus_item_view_skeleton_set_property (GObject      *object,
03531   guint         prop_id,
03532   const GValue *value,
03533   GParamSpec   *pspec)
03534 {
03535   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03536   g_assert (prop_id != 0 && prop_id - 1 < 4);
03537   g_mutex_lock (&skeleton->priv->lock);
03538   g_object_freeze_notify (object);
03539   if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
03540     {
03541       if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
03542         _bamf_dbus_item_view_schedule_emit_changed (skeleton, _bamf_dbus_item_view_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
03543       g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
03544       g_object_notify_by_pspec (object, pspec);
03545     }
03546   g_mutex_unlock (&skeleton->priv->lock);
03547   g_object_thaw_notify (object);
03548 }
03549 
03550 static void
03551 bamf_dbus_item_view_skeleton_init (BamfDBusItemViewSkeleton *skeleton)
03552 {
03553   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, BAMF_DBUS_ITEM_TYPE_VIEW_SKELETON, BamfDBusItemViewSkeletonPrivate);
03554   g_mutex_init (&skeleton->priv->lock);
03555   skeleton->priv->context = g_main_context_ref_thread_default ();
03556   skeleton->priv->properties = g_new0 (GValue, 4);
03557   g_value_init (&skeleton->priv->properties[0], G_TYPE_BOOLEAN);
03558   g_value_init (&skeleton->priv->properties[1], G_TYPE_BOOLEAN);
03559   g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN);
03560   g_value_init (&skeleton->priv->properties[3], G_TYPE_BOOLEAN);
03561 }
03562 
03563 static gboolean 
03564 bamf_dbus_item_view_skeleton_get_user_visible (BamfDBusItemView *object)
03565 {
03566   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03567   gboolean value;
03568   g_mutex_lock (&skeleton->priv->lock);
03569   value = g_value_get_boolean (&(skeleton->priv->properties[0]));
03570   g_mutex_unlock (&skeleton->priv->lock);
03571   return value;
03572 }
03573 
03574 static gboolean 
03575 bamf_dbus_item_view_skeleton_get_running (BamfDBusItemView *object)
03576 {
03577   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03578   gboolean value;
03579   g_mutex_lock (&skeleton->priv->lock);
03580   value = g_value_get_boolean (&(skeleton->priv->properties[1]));
03581   g_mutex_unlock (&skeleton->priv->lock);
03582   return value;
03583 }
03584 
03585 static gboolean 
03586 bamf_dbus_item_view_skeleton_get_urgent (BamfDBusItemView *object)
03587 {
03588   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03589   gboolean value;
03590   g_mutex_lock (&skeleton->priv->lock);
03591   value = g_value_get_boolean (&(skeleton->priv->properties[2]));
03592   g_mutex_unlock (&skeleton->priv->lock);
03593   return value;
03594 }
03595 
03596 static gboolean 
03597 bamf_dbus_item_view_skeleton_get_active (BamfDBusItemView *object)
03598 {
03599   BamfDBusItemViewSkeleton *skeleton = BAMF_DBUS_ITEM_VIEW_SKELETON (object);
03600   gboolean value;
03601   g_mutex_lock (&skeleton->priv->lock);
03602   value = g_value_get_boolean (&(skeleton->priv->properties[3]));
03603   g_mutex_unlock (&skeleton->priv->lock);
03604   return value;
03605 }
03606 
03607 static void
03608 bamf_dbus_item_view_skeleton_class_init (BamfDBusItemViewSkeletonClass *klass)
03609 {
03610   GObjectClass *gobject_class;
03611   GDBusInterfaceSkeletonClass *skeleton_class;
03612 
03613   g_type_class_add_private (klass, sizeof (BamfDBusItemViewSkeletonPrivate));
03614 
03615   gobject_class = G_OBJECT_CLASS (klass);
03616   gobject_class->finalize = bamf_dbus_item_view_skeleton_finalize;
03617   gobject_class->get_property = bamf_dbus_item_view_skeleton_get_property;
03618   gobject_class->set_property = bamf_dbus_item_view_skeleton_set_property;
03619   gobject_class->notify       = bamf_dbus_item_view_skeleton_notify;
03620 
03621 
03622   bamf_dbus_item_view_override_properties (gobject_class, 1);
03623 
03624   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
03625   skeleton_class->get_info = bamf_dbus_item_view_skeleton_dbus_interface_get_info;
03626   skeleton_class->get_properties = bamf_dbus_item_view_skeleton_dbus_interface_get_properties;
03627   skeleton_class->flush = bamf_dbus_item_view_skeleton_dbus_interface_flush;
03628   skeleton_class->get_vtable = bamf_dbus_item_view_skeleton_dbus_interface_get_vtable;
03629 }
03630 
03631 static void
03632 bamf_dbus_item_view_skeleton_iface_init (BamfDBusItemViewIface *iface)
03633 {
03634   iface->name_changed = _bamf_dbus_item_view_on_signal_name_changed;
03635   iface->user_visible_changed = _bamf_dbus_item_view_on_signal_user_visible_changed;
03636   iface->urgent_changed = _bamf_dbus_item_view_on_signal_urgent_changed;
03637   iface->running_changed = _bamf_dbus_item_view_on_signal_running_changed;
03638   iface->child_removed = _bamf_dbus_item_view_on_signal_child_removed;
03639   iface->child_added = _bamf_dbus_item_view_on_signal_child_added;
03640   iface->closed = _bamf_dbus_item_view_on_signal_closed;
03641   iface->active_changed = _bamf_dbus_item_view_on_signal_active_changed;
03642   iface->get_user_visible = bamf_dbus_item_view_skeleton_get_user_visible;
03643   iface->get_running = bamf_dbus_item_view_skeleton_get_running;
03644   iface->get_urgent = bamf_dbus_item_view_skeleton_get_urgent;
03645   iface->get_active = bamf_dbus_item_view_skeleton_get_active;
03646 }
03647 
03655 BamfDBusItemView *
03656 bamf_dbus_item_view_skeleton_new (void)
03657 {
03658   return BAMF_DBUS_ITEM_VIEW (g_object_new (BAMF_DBUS_ITEM_TYPE_VIEW_SKELETON, NULL));
03659 }
03660 
03661 /* ------------------------------------------------------------------------
03662  * Code for interface org.ayatana.bamf.application
03663  * ------------------------------------------------------------------------
03664  */
03665 
03674 /* ---- Introspection data for org.ayatana.bamf.application ---- */
03675 
03676 static const _ExtendedGDBusArgInfo _bamf_dbus_item_application_method_info_show_stubs_OUT_ARG_show_stubs =
03677 {
03678   {
03679     -1,
03680     "show_stubs",
03681     "b",
03682     NULL
03683   },
03684   FALSE
03685 };
03686 
03687 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_application_method_info_show_stubs_OUT_ARG_pointers[] =
03688 {
03689   &_bamf_dbus_item_application_method_info_show_stubs_OUT_ARG_show_stubs,
03690   NULL
03691 };
03692 
03693 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_application_method_info_show_stubs =
03694 {
03695   {
03696     -1,
03697     "ShowStubs",
03698     NULL,
03699     (GDBusArgInfo **) &_bamf_dbus_item_application_method_info_show_stubs_OUT_ARG_pointers,
03700     NULL
03701   },
03702   "handle-show-stubs",
03703   FALSE
03704 };
03705 
03706 static const _ExtendedGDBusArgInfo _bamf_dbus_item_application_method_info_xids_OUT_ARG_xids =
03707 {
03708   {
03709     -1,
03710     "xids",
03711     "au",
03712     NULL
03713   },
03714   FALSE
03715 };
03716 
03717 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_application_method_info_xids_OUT_ARG_pointers[] =
03718 {
03719   &_bamf_dbus_item_application_method_info_xids_OUT_ARG_xids,
03720   NULL
03721 };
03722 
03723 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_application_method_info_xids =
03724 {
03725   {
03726     -1,
03727     "Xids",
03728     NULL,
03729     (GDBusArgInfo **) &_bamf_dbus_item_application_method_info_xids_OUT_ARG_pointers,
03730     NULL
03731   },
03732   "handle-xids",
03733   FALSE
03734 };
03735 
03736 static const _ExtendedGDBusArgInfo _bamf_dbus_item_application_method_info_desktop_file_OUT_ARG_desktop_file =
03737 {
03738   {
03739     -1,
03740     "desktop_file",
03741     "s",
03742     NULL
03743   },
03744   FALSE
03745 };
03746 
03747 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_application_method_info_desktop_file_OUT_ARG_pointers[] =
03748 {
03749   &_bamf_dbus_item_application_method_info_desktop_file_OUT_ARG_desktop_file,
03750   NULL
03751 };
03752 
03753 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_application_method_info_desktop_file =
03754 {
03755   {
03756     -1,
03757     "DesktopFile",
03758     NULL,
03759     (GDBusArgInfo **) &_bamf_dbus_item_application_method_info_desktop_file_OUT_ARG_pointers,
03760     NULL
03761   },
03762   "handle-desktop-file",
03763   FALSE
03764 };
03765 
03766 static const _ExtendedGDBusArgInfo _bamf_dbus_item_application_method_info_application_type_OUT_ARG_type =
03767 {
03768   {
03769     -1,
03770     "type",
03771     "s",
03772     NULL
03773   },
03774   FALSE
03775 };
03776 
03777 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_application_method_info_application_type_OUT_ARG_pointers[] =
03778 {
03779   &_bamf_dbus_item_application_method_info_application_type_OUT_ARG_type,
03780   NULL
03781 };
03782 
03783 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_application_method_info_application_type =
03784 {
03785   {
03786     -1,
03787     "ApplicationType",
03788     NULL,
03789     (GDBusArgInfo **) &_bamf_dbus_item_application_method_info_application_type_OUT_ARG_pointers,
03790     NULL
03791   },
03792   "handle-application-type",
03793   FALSE
03794 };
03795 
03796 static const _ExtendedGDBusMethodInfo * const _bamf_dbus_item_application_method_info_pointers[] =
03797 {
03798   &_bamf_dbus_item_application_method_info_show_stubs,
03799   &_bamf_dbus_item_application_method_info_xids,
03800   &_bamf_dbus_item_application_method_info_desktop_file,
03801   &_bamf_dbus_item_application_method_info_application_type,
03802   NULL
03803 };
03804 
03805 static const _ExtendedGDBusArgInfo _bamf_dbus_item_application_signal_info_window_removed_ARG_path =
03806 {
03807   {
03808     -1,
03809     "path",
03810     "s",
03811     NULL
03812   },
03813   FALSE
03814 };
03815 
03816 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_application_signal_info_window_removed_ARG_pointers[] =
03817 {
03818   &_bamf_dbus_item_application_signal_info_window_removed_ARG_path,
03819   NULL
03820 };
03821 
03822 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_application_signal_info_window_removed =
03823 {
03824   {
03825     -1,
03826     "WindowRemoved",
03827     (GDBusArgInfo **) &_bamf_dbus_item_application_signal_info_window_removed_ARG_pointers,
03828     NULL
03829   },
03830   "window-removed"
03831 };
03832 
03833 static const _ExtendedGDBusArgInfo _bamf_dbus_item_application_signal_info_window_added_ARG_path =
03834 {
03835   {
03836     -1,
03837     "path",
03838     "s",
03839     NULL
03840   },
03841   FALSE
03842 };
03843 
03844 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_application_signal_info_window_added_ARG_pointers[] =
03845 {
03846   &_bamf_dbus_item_application_signal_info_window_added_ARG_path,
03847   NULL
03848 };
03849 
03850 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_application_signal_info_window_added =
03851 {
03852   {
03853     -1,
03854     "WindowAdded",
03855     (GDBusArgInfo **) &_bamf_dbus_item_application_signal_info_window_added_ARG_pointers,
03856     NULL
03857   },
03858   "window-added"
03859 };
03860 
03861 static const _ExtendedGDBusSignalInfo * const _bamf_dbus_item_application_signal_info_pointers[] =
03862 {
03863   &_bamf_dbus_item_application_signal_info_window_removed,
03864   &_bamf_dbus_item_application_signal_info_window_added,
03865   NULL
03866 };
03867 
03868 static const _ExtendedGDBusInterfaceInfo _bamf_dbus_item_application_interface_info =
03869 {
03870   {
03871     -1,
03872     "org.ayatana.bamf.application",
03873     (GDBusMethodInfo **) &_bamf_dbus_item_application_method_info_pointers,
03874     (GDBusSignalInfo **) &_bamf_dbus_item_application_signal_info_pointers,
03875     NULL,
03876     NULL
03877   },
03878   "application",
03879 };
03880 
03881 
03889 GDBusInterfaceInfo *
03890 bamf_dbus_item_application_interface_info (void)
03891 {
03892   return (GDBusInterfaceInfo *) &_bamf_dbus_item_application_interface_info;
03893 }
03894 
03905 guint
03906 bamf_dbus_item_application_override_properties (GObjectClass *klass, guint property_id_begin)
03907 {
03908   return property_id_begin - 1;
03909 }
03910 
03911 
03912 
03932 static void
03933 bamf_dbus_item_application_default_init (BamfDBusItemApplicationIface *iface)
03934 {
03935   /* GObject signals for incoming D-Bus method calls: */
03947   g_signal_new ("handle-show-stubs",
03948     G_TYPE_FROM_INTERFACE (iface),
03949     G_SIGNAL_RUN_LAST,
03950     G_STRUCT_OFFSET (BamfDBusItemApplicationIface, handle_show_stubs),
03951     g_signal_accumulator_true_handled,
03952     NULL,
03953     g_cclosure_marshal_generic,
03954     G_TYPE_BOOLEAN,
03955     1,
03956     G_TYPE_DBUS_METHOD_INVOCATION);
03957 
03969   g_signal_new ("handle-xids",
03970     G_TYPE_FROM_INTERFACE (iface),
03971     G_SIGNAL_RUN_LAST,
03972     G_STRUCT_OFFSET (BamfDBusItemApplicationIface, handle_xids),
03973     g_signal_accumulator_true_handled,
03974     NULL,
03975     g_cclosure_marshal_generic,
03976     G_TYPE_BOOLEAN,
03977     1,
03978     G_TYPE_DBUS_METHOD_INVOCATION);
03979 
03991   g_signal_new ("handle-desktop-file",
03992     G_TYPE_FROM_INTERFACE (iface),
03993     G_SIGNAL_RUN_LAST,
03994     G_STRUCT_OFFSET (BamfDBusItemApplicationIface, handle_desktop_file),
03995     g_signal_accumulator_true_handled,
03996     NULL,
03997     g_cclosure_marshal_generic,
03998     G_TYPE_BOOLEAN,
03999     1,
04000     G_TYPE_DBUS_METHOD_INVOCATION);
04001 
04013   g_signal_new ("handle-application-type",
04014     G_TYPE_FROM_INTERFACE (iface),
04015     G_SIGNAL_RUN_LAST,
04016     G_STRUCT_OFFSET (BamfDBusItemApplicationIface, handle_application_type),
04017     g_signal_accumulator_true_handled,
04018     NULL,
04019     g_cclosure_marshal_generic,
04020     G_TYPE_BOOLEAN,
04021     1,
04022     G_TYPE_DBUS_METHOD_INVOCATION);
04023 
04024   /* GObject signals for received D-Bus signals: */
04034   g_signal_new ("window-removed",
04035     G_TYPE_FROM_INTERFACE (iface),
04036     G_SIGNAL_RUN_LAST,
04037     G_STRUCT_OFFSET (BamfDBusItemApplicationIface, window_removed),
04038     NULL,
04039     NULL,
04040     g_cclosure_marshal_generic,
04041     G_TYPE_NONE,
04042     1, G_TYPE_STRING);
04043 
04053   g_signal_new ("window-added",
04054     G_TYPE_FROM_INTERFACE (iface),
04055     G_SIGNAL_RUN_LAST,
04056     G_STRUCT_OFFSET (BamfDBusItemApplicationIface, window_added),
04057     NULL,
04058     NULL,
04059     g_cclosure_marshal_generic,
04060     G_TYPE_NONE,
04061     1, G_TYPE_STRING);
04062 
04063 }
04064 
04065 typedef BamfDBusItemApplicationIface BamfDBusItemApplicationInterface;
04066 G_DEFINE_INTERFACE (BamfDBusItemApplication, bamf_dbus_item_application, G_TYPE_OBJECT);
04067 
04075 void
04076 bamf_dbus_item_application_emit_window_removed (
04077     BamfDBusItemApplication *object,
04078     const gchar *arg_path)
04079 {
04080   g_signal_emit_by_name (object, "window-removed", arg_path);
04081 }
04082 
04090 void
04091 bamf_dbus_item_application_emit_window_added (
04092     BamfDBusItemApplication *object,
04093     const gchar *arg_path)
04094 {
04095   g_signal_emit_by_name (object, "window-added", arg_path);
04096 }
04097 
04111 void
04112 bamf_dbus_item_application_call_show_stubs (
04113     BamfDBusItemApplication *proxy,
04114     GCancellable *cancellable,
04115     GAsyncReadyCallback callback,
04116     gpointer user_data)
04117 {
04118   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
04119     "ShowStubs",
04120     g_variant_new ("()"),
04121     G_DBUS_CALL_FLAGS_NONE,
04122     -1,
04123     cancellable,
04124     callback,
04125     user_data);
04126 }
04127 
04139 gboolean
04140 bamf_dbus_item_application_call_show_stubs_finish (
04141     BamfDBusItemApplication *proxy,
04142     gboolean *out_show_stubs,
04143     GAsyncResult *res,
04144     GError **error)
04145 {
04146   GVariant *_ret;
04147   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
04148   if (_ret == NULL)
04149     goto _out;
04150   g_variant_get (_ret,
04151                  "(b)",
04152                  out_show_stubs);
04153   g_variant_unref (_ret);
04154 _out:
04155   return _ret != NULL;
04156 }
04157 
04171 gboolean
04172 bamf_dbus_item_application_call_show_stubs_sync (
04173     BamfDBusItemApplication *proxy,
04174     gboolean *out_show_stubs,
04175     GCancellable *cancellable,
04176     GError **error)
04177 {
04178   GVariant *_ret;
04179   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
04180     "ShowStubs",
04181     g_variant_new ("()"),
04182     G_DBUS_CALL_FLAGS_NONE,
04183     -1,
04184     cancellable,
04185     error);
04186   if (_ret == NULL)
04187     goto _out;
04188   g_variant_get (_ret,
04189                  "(b)",
04190                  out_show_stubs);
04191   g_variant_unref (_ret);
04192 _out:
04193   return _ret != NULL;
04194 }
04195 
04209 void
04210 bamf_dbus_item_application_call_xids (
04211     BamfDBusItemApplication *proxy,
04212     GCancellable *cancellable,
04213     GAsyncReadyCallback callback,
04214     gpointer user_data)
04215 {
04216   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
04217     "Xids",
04218     g_variant_new ("()"),
04219     G_DBUS_CALL_FLAGS_NONE,
04220     -1,
04221     cancellable,
04222     callback,
04223     user_data);
04224 }
04225 
04237 gboolean
04238 bamf_dbus_item_application_call_xids_finish (
04239     BamfDBusItemApplication *proxy,
04240     GVariant **out_xids,
04241     GAsyncResult *res,
04242     GError **error)
04243 {
04244   GVariant *_ret;
04245   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
04246   if (_ret == NULL)
04247     goto _out;
04248   g_variant_get (_ret,
04249                  "(@au)",
04250                  out_xids);
04251   g_variant_unref (_ret);
04252 _out:
04253   return _ret != NULL;
04254 }
04255 
04269 gboolean
04270 bamf_dbus_item_application_call_xids_sync (
04271     BamfDBusItemApplication *proxy,
04272     GVariant **out_xids,
04273     GCancellable *cancellable,
04274     GError **error)
04275 {
04276   GVariant *_ret;
04277   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
04278     "Xids",
04279     g_variant_new ("()"),
04280     G_DBUS_CALL_FLAGS_NONE,
04281     -1,
04282     cancellable,
04283     error);
04284   if (_ret == NULL)
04285     goto _out;
04286   g_variant_get (_ret,
04287                  "(@au)",
04288                  out_xids);
04289   g_variant_unref (_ret);
04290 _out:
04291   return _ret != NULL;
04292 }
04293 
04307 void
04308 bamf_dbus_item_application_call_desktop_file (
04309     BamfDBusItemApplication *proxy,
04310     GCancellable *cancellable,
04311     GAsyncReadyCallback callback,
04312     gpointer user_data)
04313 {
04314   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
04315     "DesktopFile",
04316     g_variant_new ("()"),
04317     G_DBUS_CALL_FLAGS_NONE,
04318     -1,
04319     cancellable,
04320     callback,
04321     user_data);
04322 }
04323 
04335 gboolean
04336 bamf_dbus_item_application_call_desktop_file_finish (
04337     BamfDBusItemApplication *proxy,
04338     gchar **out_desktop_file,
04339     GAsyncResult *res,
04340     GError **error)
04341 {
04342   GVariant *_ret;
04343   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
04344   if (_ret == NULL)
04345     goto _out;
04346   g_variant_get (_ret,
04347                  "(s)",
04348                  out_desktop_file);
04349   g_variant_unref (_ret);
04350 _out:
04351   return _ret != NULL;
04352 }
04353 
04367 gboolean
04368 bamf_dbus_item_application_call_desktop_file_sync (
04369     BamfDBusItemApplication *proxy,
04370     gchar **out_desktop_file,
04371     GCancellable *cancellable,
04372     GError **error)
04373 {
04374   GVariant *_ret;
04375   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
04376     "DesktopFile",
04377     g_variant_new ("()"),
04378     G_DBUS_CALL_FLAGS_NONE,
04379     -1,
04380     cancellable,
04381     error);
04382   if (_ret == NULL)
04383     goto _out;
04384   g_variant_get (_ret,
04385                  "(s)",
04386                  out_desktop_file);
04387   g_variant_unref (_ret);
04388 _out:
04389   return _ret != NULL;
04390 }
04391 
04405 void
04406 bamf_dbus_item_application_call_application_type (
04407     BamfDBusItemApplication *proxy,
04408     GCancellable *cancellable,
04409     GAsyncReadyCallback callback,
04410     gpointer user_data)
04411 {
04412   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
04413     "ApplicationType",
04414     g_variant_new ("()"),
04415     G_DBUS_CALL_FLAGS_NONE,
04416     -1,
04417     cancellable,
04418     callback,
04419     user_data);
04420 }
04421 
04433 gboolean
04434 bamf_dbus_item_application_call_application_type_finish (
04435     BamfDBusItemApplication *proxy,
04436     gchar **out_type,
04437     GAsyncResult *res,
04438     GError **error)
04439 {
04440   GVariant *_ret;
04441   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
04442   if (_ret == NULL)
04443     goto _out;
04444   g_variant_get (_ret,
04445                  "(s)",
04446                  out_type);
04447   g_variant_unref (_ret);
04448 _out:
04449   return _ret != NULL;
04450 }
04451 
04465 gboolean
04466 bamf_dbus_item_application_call_application_type_sync (
04467     BamfDBusItemApplication *proxy,
04468     gchar **out_type,
04469     GCancellable *cancellable,
04470     GError **error)
04471 {
04472   GVariant *_ret;
04473   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
04474     "ApplicationType",
04475     g_variant_new ("()"),
04476     G_DBUS_CALL_FLAGS_NONE,
04477     -1,
04478     cancellable,
04479     error);
04480   if (_ret == NULL)
04481     goto _out;
04482   g_variant_get (_ret,
04483                  "(s)",
04484                  out_type);
04485   g_variant_unref (_ret);
04486 _out:
04487   return _ret != NULL;
04488 }
04489 
04500 void
04501 bamf_dbus_item_application_complete_show_stubs (
04502     BamfDBusItemApplication *object,
04503     GDBusMethodInvocation *invocation,
04504     gboolean show_stubs)
04505 {
04506   g_dbus_method_invocation_return_value (invocation,
04507     g_variant_new ("(b)",
04508                    show_stubs));
04509 }
04510 
04521 void
04522 bamf_dbus_item_application_complete_xids (
04523     BamfDBusItemApplication *object,
04524     GDBusMethodInvocation *invocation,
04525     GVariant *xids)
04526 {
04527   g_dbus_method_invocation_return_value (invocation,
04528     g_variant_new ("(@au)",
04529                    xids));
04530 }
04531 
04542 void
04543 bamf_dbus_item_application_complete_desktop_file (
04544     BamfDBusItemApplication *object,
04545     GDBusMethodInvocation *invocation,
04546     const gchar *desktop_file)
04547 {
04548   g_dbus_method_invocation_return_value (invocation,
04549     g_variant_new ("(s)",
04550                    desktop_file));
04551 }
04552 
04563 void
04564 bamf_dbus_item_application_complete_application_type (
04565     BamfDBusItemApplication *object,
04566     GDBusMethodInvocation *invocation,
04567     const gchar *type)
04568 {
04569   g_dbus_method_invocation_return_value (invocation,
04570     g_variant_new ("(s)",
04571                    type));
04572 }
04573 
04574 /* ------------------------------------------------------------------------ */
04575 
04589 struct _BamfDBusItemApplicationProxyPrivate
04590 {
04591   GData *qdata;
04592 };
04593 
04594 static void bamf_dbus_item_application_proxy_iface_init (BamfDBusItemApplicationIface *iface);
04595 
04596 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemApplicationProxy, bamf_dbus_item_application_proxy, G_TYPE_DBUS_PROXY,
04597                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_APPLICATION, bamf_dbus_item_application_proxy_iface_init));
04598 
04599 static void
04600 bamf_dbus_item_application_proxy_finalize (GObject *object)
04601 {
04602   BamfDBusItemApplicationProxy *proxy = BAMF_DBUS_ITEM_APPLICATION_PROXY (object);
04603   g_datalist_clear (&proxy->priv->qdata);
04604   G_OBJECT_CLASS (bamf_dbus_item_application_proxy_parent_class)->finalize (object);
04605 }
04606 
04607 static void
04608 bamf_dbus_item_application_proxy_get_property (GObject      *object,
04609   guint         prop_id,
04610   GValue       *value,
04611   GParamSpec   *pspec)
04612 {
04613 }
04614 
04615 static void
04616 bamf_dbus_item_application_proxy_set_property (GObject      *object,
04617   guint         prop_id,
04618   const GValue *value,
04619   GParamSpec   *pspec)
04620 {
04621 }
04622 
04623 static void
04624 bamf_dbus_item_application_proxy_g_signal (GDBusProxy *proxy,
04625   const gchar *sender_name,
04626   const gchar *signal_name,
04627   GVariant *parameters)
04628 {
04629   _ExtendedGDBusSignalInfo *info;
04630   GVariantIter iter;
04631   GVariant *child;
04632   GValue *paramv;
04633   guint num_params;
04634   guint n;
04635   guint signal_id;
04636   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_bamf_dbus_item_application_interface_info, signal_name);
04637   if (info == NULL)
04638     return;
04639   num_params = g_variant_n_children (parameters);
04640   paramv = g_new0 (GValue, num_params + 1);
04641   g_value_init (&paramv[0], BAMF_DBUS_ITEM_TYPE_APPLICATION);
04642   g_value_set_object (&paramv[0], proxy);
04643   g_variant_iter_init (&iter, parameters);
04644   n = 1;
04645   while ((child = g_variant_iter_next_value (&iter)) != NULL)
04646     {
04647       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
04648       if (arg_info->use_gvariant)
04649         {
04650           g_value_init (&paramv[n], G_TYPE_VARIANT);
04651           g_value_set_variant (&paramv[n], child);
04652           n++;
04653         }
04654       else
04655         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
04656       g_variant_unref (child);
04657     }
04658   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_APPLICATION);
04659   g_signal_emitv (paramv, signal_id, 0, NULL);
04660   for (n = 0; n < num_params + 1; n++)
04661     g_value_unset (&paramv[n]);
04662   g_free (paramv);
04663 }
04664 
04665 static void
04666 bamf_dbus_item_application_proxy_g_properties_changed (GDBusProxy *_proxy,
04667   GVariant *changed_properties,
04668   const gchar *const *invalidated_properties)
04669 {
04670   BamfDBusItemApplicationProxy *proxy = BAMF_DBUS_ITEM_APPLICATION_PROXY (_proxy);
04671   guint n;
04672   const gchar *key;
04673   GVariantIter *iter;
04674   _ExtendedGDBusPropertyInfo *info;
04675   g_variant_get (changed_properties, "a{sv}", &iter);
04676   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
04677     {
04678       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_application_interface_info, key);
04679       g_datalist_remove_data (&proxy->priv->qdata, key);
04680       if (info != NULL)
04681         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
04682     }
04683   g_variant_iter_free (iter);
04684   for (n = 0; invalidated_properties[n] != NULL; n++)
04685     {
04686       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_application_interface_info, invalidated_properties[n]);
04687       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
04688       if (info != NULL)
04689         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
04690     }
04691 }
04692 
04693 static void
04694 bamf_dbus_item_application_proxy_init (BamfDBusItemApplicationProxy *proxy)
04695 {
04696   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, BAMF_DBUS_ITEM_TYPE_APPLICATION_PROXY, BamfDBusItemApplicationProxyPrivate);
04697   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), bamf_dbus_item_application_interface_info ());
04698 }
04699 
04700 static void
04701 bamf_dbus_item_application_proxy_class_init (BamfDBusItemApplicationProxyClass *klass)
04702 {
04703   GObjectClass *gobject_class;
04704   GDBusProxyClass *proxy_class;
04705 
04706   g_type_class_add_private (klass, sizeof (BamfDBusItemApplicationProxyPrivate));
04707 
04708   gobject_class = G_OBJECT_CLASS (klass);
04709   gobject_class->finalize     = bamf_dbus_item_application_proxy_finalize;
04710   gobject_class->get_property = bamf_dbus_item_application_proxy_get_property;
04711   gobject_class->set_property = bamf_dbus_item_application_proxy_set_property;
04712 
04713   proxy_class = G_DBUS_PROXY_CLASS (klass);
04714   proxy_class->g_signal = bamf_dbus_item_application_proxy_g_signal;
04715   proxy_class->g_properties_changed = bamf_dbus_item_application_proxy_g_properties_changed;
04716 
04717 }
04718 
04719 static void
04720 bamf_dbus_item_application_proxy_iface_init (BamfDBusItemApplicationIface *iface)
04721 {
04722 }
04723 
04741 void
04742 bamf_dbus_item_application_proxy_new (
04743     GDBusConnection     *connection,
04744     GDBusProxyFlags      flags,
04745     const gchar         *name,
04746     const gchar         *object_path,
04747     GCancellable        *cancellable,
04748     GAsyncReadyCallback  callback,
04749     gpointer             user_data)
04750 {
04751   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_APPLICATION_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.application", NULL);
04752 }
04753 
04763 BamfDBusItemApplication *
04764 bamf_dbus_item_application_proxy_new_finish (
04765     GAsyncResult        *res,
04766     GError             **error)
04767 {
04768   GObject *ret;
04769   GObject *source_object;
04770   source_object = g_async_result_get_source_object (res);
04771   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
04772   g_object_unref (source_object);
04773   if (ret != NULL)
04774     return BAMF_DBUS_ITEM_APPLICATION (ret);
04775   else
04776     return NULL;
04777 }
04778 
04796 BamfDBusItemApplication *
04797 bamf_dbus_item_application_proxy_new_sync (
04798     GDBusConnection     *connection,
04799     GDBusProxyFlags      flags,
04800     const gchar         *name,
04801     const gchar         *object_path,
04802     GCancellable        *cancellable,
04803     GError             **error)
04804 {
04805   GInitable *ret;
04806   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_APPLICATION_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.ayatana.bamf.application", NULL);
04807   if (ret != NULL)
04808     return BAMF_DBUS_ITEM_APPLICATION (ret);
04809   else
04810     return NULL;
04811 }
04812 
04813 
04831 void
04832 bamf_dbus_item_application_proxy_new_for_bus (
04833     GBusType             bus_type,
04834     GDBusProxyFlags      flags,
04835     const gchar         *name,
04836     const gchar         *object_path,
04837     GCancellable        *cancellable,
04838     GAsyncReadyCallback  callback,
04839     gpointer             user_data)
04840 {
04841   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_APPLICATION_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.application", NULL);
04842 }
04843 
04853 BamfDBusItemApplication *
04854 bamf_dbus_item_application_proxy_new_for_bus_finish (
04855     GAsyncResult        *res,
04856     GError             **error)
04857 {
04858   GObject *ret;
04859   GObject *source_object;
04860   source_object = g_async_result_get_source_object (res);
04861   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
04862   g_object_unref (source_object);
04863   if (ret != NULL)
04864     return BAMF_DBUS_ITEM_APPLICATION (ret);
04865   else
04866     return NULL;
04867 }
04868 
04886 BamfDBusItemApplication *
04887 bamf_dbus_item_application_proxy_new_for_bus_sync (
04888     GBusType             bus_type,
04889     GDBusProxyFlags      flags,
04890     const gchar         *name,
04891     const gchar         *object_path,
04892     GCancellable        *cancellable,
04893     GError             **error)
04894 {
04895   GInitable *ret;
04896   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_APPLICATION_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.application", NULL);
04897   if (ret != NULL)
04898     return BAMF_DBUS_ITEM_APPLICATION (ret);
04899   else
04900     return NULL;
04901 }
04902 
04903 
04904 /* ------------------------------------------------------------------------ */
04905 
04919 struct _BamfDBusItemApplicationSkeletonPrivate
04920 {
04921   GValue *properties;
04922   GList *changed_properties;
04923   GSource *changed_properties_idle_source;
04924   GMainContext *context;
04925   GMutex lock;
04926 };
04927 
04928 static void
04929 _bamf_dbus_item_application_skeleton_handle_method_call (
04930   GDBusConnection *connection,
04931   const gchar *sender,
04932   const gchar *object_path,
04933   const gchar *interface_name,
04934   const gchar *method_name,
04935   GVariant *parameters,
04936   GDBusMethodInvocation *invocation,
04937   gpointer user_data)
04938 {
04939   BamfDBusItemApplicationSkeleton *skeleton = BAMF_DBUS_ITEM_APPLICATION_SKELETON (user_data);
04940   _ExtendedGDBusMethodInfo *info;
04941   GVariantIter iter;
04942   GVariant *child;
04943   GValue *paramv;
04944   guint num_params;
04945   guint num_extra;
04946   guint n;
04947   guint signal_id;
04948   GValue return_value = G_VALUE_INIT;
04949   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
04950   g_assert (info != NULL);
04951   num_params = g_variant_n_children (parameters);
04952   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
04953   n = 0;
04954   g_value_init (&paramv[n], BAMF_DBUS_ITEM_TYPE_APPLICATION);
04955   g_value_set_object (&paramv[n++], skeleton);
04956   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
04957   g_value_set_object (&paramv[n++], invocation);
04958   if (info->pass_fdlist)
04959     {
04960 #ifdef G_OS_UNIX
04961       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
04962       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
04963 #else
04964       g_assert_not_reached ();
04965 #endif
04966     }
04967   g_variant_iter_init (&iter, parameters);
04968   while ((child = g_variant_iter_next_value (&iter)) != NULL)
04969     {
04970       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
04971       if (arg_info->use_gvariant)
04972         {
04973           g_value_init (&paramv[n], G_TYPE_VARIANT);
04974           g_value_set_variant (&paramv[n], child);
04975           n++;
04976         }
04977       else
04978         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
04979       g_variant_unref (child);
04980     }
04981   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_APPLICATION);
04982   g_value_init (&return_value, G_TYPE_BOOLEAN);
04983   g_signal_emitv (paramv, signal_id, 0, &return_value);
04984   if (!g_value_get_boolean (&return_value))
04985     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);
04986   g_value_unset (&return_value);
04987   for (n = 0; n < num_params + num_extra; n++)
04988     g_value_unset (&paramv[n]);
04989   g_free (paramv);
04990 }
04991 
04992 static GVariant *
04993 _bamf_dbus_item_application_skeleton_handle_get_property (
04994   GDBusConnection *connection,
04995   const gchar *sender,
04996   const gchar *object_path,
04997   const gchar *interface_name,
04998   const gchar *property_name,
04999   GError **error,
05000   gpointer user_data)
05001 {
05002   BamfDBusItemApplicationSkeleton *skeleton = BAMF_DBUS_ITEM_APPLICATION_SKELETON (user_data);
05003   GValue value = G_VALUE_INIT;
05004   GParamSpec *pspec;
05005   _ExtendedGDBusPropertyInfo *info;
05006   GVariant *ret;
05007   ret = NULL;
05008   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_application_interface_info, property_name);
05009   g_assert (info != NULL);
05010   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
05011   if (pspec == NULL)
05012     {
05013       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
05014     }
05015   else
05016     {
05017       g_value_init (&value, pspec->value_type);
05018       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
05019       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
05020       g_value_unset (&value);
05021     }
05022   return ret;
05023 }
05024 
05025 static gboolean
05026 _bamf_dbus_item_application_skeleton_handle_set_property (
05027   GDBusConnection *connection,
05028   const gchar *sender,
05029   const gchar *object_path,
05030   const gchar *interface_name,
05031   const gchar *property_name,
05032   GVariant *variant,
05033   GError **error,
05034   gpointer user_data)
05035 {
05036   BamfDBusItemApplicationSkeleton *skeleton = BAMF_DBUS_ITEM_APPLICATION_SKELETON (user_data);
05037   GValue value = G_VALUE_INIT;
05038   GParamSpec *pspec;
05039   _ExtendedGDBusPropertyInfo *info;
05040   gboolean ret;
05041   ret = FALSE;
05042   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_application_interface_info, property_name);
05043   g_assert (info != NULL);
05044   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
05045   if (pspec == NULL)
05046     {
05047       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
05048     }
05049   else
05050     {
05051       if (info->use_gvariant)
05052         g_value_set_variant (&value, variant);
05053       else
05054         g_dbus_gvariant_to_gvalue (variant, &value);
05055       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
05056       g_value_unset (&value);
05057       ret = TRUE;
05058     }
05059   return ret;
05060 }
05061 
05062 static const GDBusInterfaceVTable _bamf_dbus_item_application_skeleton_vtable =
05063 {
05064   _bamf_dbus_item_application_skeleton_handle_method_call,
05065   _bamf_dbus_item_application_skeleton_handle_get_property,
05066   _bamf_dbus_item_application_skeleton_handle_set_property
05067 };
05068 
05069 static GDBusInterfaceInfo *
05070 bamf_dbus_item_application_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
05071 {
05072   return bamf_dbus_item_application_interface_info ();
05073 }
05074 
05075 static GDBusInterfaceVTable *
05076 bamf_dbus_item_application_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
05077 {
05078   return (GDBusInterfaceVTable *) &_bamf_dbus_item_application_skeleton_vtable;
05079 }
05080 
05081 static GVariant *
05082 bamf_dbus_item_application_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
05083 {
05084   BamfDBusItemApplicationSkeleton *skeleton = BAMF_DBUS_ITEM_APPLICATION_SKELETON (_skeleton);
05085 
05086   GVariantBuilder builder;
05087   guint n;
05088   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
05089   if (_bamf_dbus_item_application_interface_info.parent_struct.properties == NULL)
05090     goto out;
05091   for (n = 0; _bamf_dbus_item_application_interface_info.parent_struct.properties[n] != NULL; n++)
05092     {
05093       GDBusPropertyInfo *info = _bamf_dbus_item_application_interface_info.parent_struct.properties[n];
05094       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
05095         {
05096           GVariant *value;
05097           value = _bamf_dbus_item_application_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.application", info->name, NULL, skeleton);
05098           if (value != NULL)
05099             {
05100               g_variant_take_ref (value);
05101               g_variant_builder_add (&builder, "{sv}", info->name, value);
05102               g_variant_unref (value);
05103             }
05104         }
05105     }
05106 out:
05107   return g_variant_builder_end (&builder);
05108 }
05109 
05110 static void
05111 bamf_dbus_item_application_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
05112 {
05113 }
05114 
05115 static void
05116 _bamf_dbus_item_application_on_signal_window_removed (
05117     BamfDBusItemApplication *object,
05118     const gchar *arg_path)
05119 {
05120   BamfDBusItemApplicationSkeleton *skeleton = BAMF_DBUS_ITEM_APPLICATION_SKELETON (object);
05121 
05122   GList      *connections, *l;
05123   GVariant   *signal_variant;
05124   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
05125 
05126   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
05127                    arg_path));
05128   for (l = connections; l != NULL; l = l->next)
05129     {
05130       GDBusConnection *connection = l->data;
05131       g_dbus_connection_emit_signal (connection,
05132         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.application", "WindowRemoved",
05133         signal_variant, NULL);
05134     }
05135   g_variant_unref (signal_variant);
05136   g_list_free_full (connections, g_object_unref);
05137 }
05138 
05139 static void
05140 _bamf_dbus_item_application_on_signal_window_added (
05141     BamfDBusItemApplication *object,
05142     const gchar *arg_path)
05143 {
05144   BamfDBusItemApplicationSkeleton *skeleton = BAMF_DBUS_ITEM_APPLICATION_SKELETON (object);
05145 
05146   GList      *connections, *l;
05147   GVariant   *signal_variant;
05148   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
05149 
05150   signal_variant = g_variant_ref_sink (g_variant_new ("(s)",
05151                    arg_path));
05152   for (l = connections; l != NULL; l = l->next)
05153     {
05154       GDBusConnection *connection = l->data;
05155       g_dbus_connection_emit_signal (connection,
05156         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.application", "WindowAdded",
05157         signal_variant, NULL);
05158     }
05159   g_variant_unref (signal_variant);
05160   g_list_free_full (connections, g_object_unref);
05161 }
05162 
05163 static void bamf_dbus_item_application_skeleton_iface_init (BamfDBusItemApplicationIface *iface);
05164 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemApplicationSkeleton, bamf_dbus_item_application_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
05165                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_APPLICATION, bamf_dbus_item_application_skeleton_iface_init));
05166 
05167 static void
05168 bamf_dbus_item_application_skeleton_finalize (GObject *object)
05169 {
05170   BamfDBusItemApplicationSkeleton *skeleton = BAMF_DBUS_ITEM_APPLICATION_SKELETON (object);
05171   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
05172   if (skeleton->priv->changed_properties_idle_source != NULL)
05173     g_source_destroy (skeleton->priv->changed_properties_idle_source);
05174   g_main_context_unref (skeleton->priv->context);
05175   g_mutex_clear (&skeleton->priv->lock);
05176   G_OBJECT_CLASS (bamf_dbus_item_application_skeleton_parent_class)->finalize (object);
05177 }
05178 
05179 static void
05180 bamf_dbus_item_application_skeleton_init (BamfDBusItemApplicationSkeleton *skeleton)
05181 {
05182   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, BAMF_DBUS_ITEM_TYPE_APPLICATION_SKELETON, BamfDBusItemApplicationSkeletonPrivate);
05183   g_mutex_init (&skeleton->priv->lock);
05184   skeleton->priv->context = g_main_context_ref_thread_default ();
05185 }
05186 
05187 static void
05188 bamf_dbus_item_application_skeleton_class_init (BamfDBusItemApplicationSkeletonClass *klass)
05189 {
05190   GObjectClass *gobject_class;
05191   GDBusInterfaceSkeletonClass *skeleton_class;
05192 
05193   g_type_class_add_private (klass, sizeof (BamfDBusItemApplicationSkeletonPrivate));
05194 
05195   gobject_class = G_OBJECT_CLASS (klass);
05196   gobject_class->finalize = bamf_dbus_item_application_skeleton_finalize;
05197 
05198   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
05199   skeleton_class->get_info = bamf_dbus_item_application_skeleton_dbus_interface_get_info;
05200   skeleton_class->get_properties = bamf_dbus_item_application_skeleton_dbus_interface_get_properties;
05201   skeleton_class->flush = bamf_dbus_item_application_skeleton_dbus_interface_flush;
05202   skeleton_class->get_vtable = bamf_dbus_item_application_skeleton_dbus_interface_get_vtable;
05203 }
05204 
05205 static void
05206 bamf_dbus_item_application_skeleton_iface_init (BamfDBusItemApplicationIface *iface)
05207 {
05208   iface->window_removed = _bamf_dbus_item_application_on_signal_window_removed;
05209   iface->window_added = _bamf_dbus_item_application_on_signal_window_added;
05210 }
05211 
05219 BamfDBusItemApplication *
05220 bamf_dbus_item_application_skeleton_new (void)
05221 {
05222   return BAMF_DBUS_ITEM_APPLICATION (g_object_new (BAMF_DBUS_ITEM_TYPE_APPLICATION_SKELETON, NULL));
05223 }
05224 
05225 /* ------------------------------------------------------------------------
05226  * Code for interface org.ayatana.bamf.window
05227  * ------------------------------------------------------------------------
05228  */
05229 
05238 /* ---- Introspection data for org.ayatana.bamf.window ---- */
05239 
05240 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_method_info_get_xid_OUT_ARG_xid =
05241 {
05242   {
05243     -1,
05244     "xid",
05245     "u",
05246     NULL
05247   },
05248   FALSE
05249 };
05250 
05251 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_method_info_get_xid_OUT_ARG_pointers[] =
05252 {
05253   &_bamf_dbus_item_window_method_info_get_xid_OUT_ARG_xid,
05254   NULL
05255 };
05256 
05257 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_window_method_info_get_xid =
05258 {
05259   {
05260     -1,
05261     "GetXid",
05262     NULL,
05263     (GDBusArgInfo **) &_bamf_dbus_item_window_method_info_get_xid_OUT_ARG_pointers,
05264     NULL
05265   },
05266   "handle-get-xid",
05267   FALSE
05268 };
05269 
05270 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_method_info_get_pid_OUT_ARG_pid =
05271 {
05272   {
05273     -1,
05274     "pid",
05275     "u",
05276     NULL
05277   },
05278   FALSE
05279 };
05280 
05281 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_method_info_get_pid_OUT_ARG_pointers[] =
05282 {
05283   &_bamf_dbus_item_window_method_info_get_pid_OUT_ARG_pid,
05284   NULL
05285 };
05286 
05287 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_window_method_info_get_pid =
05288 {
05289   {
05290     -1,
05291     "GetPid",
05292     NULL,
05293     (GDBusArgInfo **) &_bamf_dbus_item_window_method_info_get_pid_OUT_ARG_pointers,
05294     NULL
05295   },
05296   "handle-get-pid",
05297   FALSE
05298 };
05299 
05300 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_method_info_transient_OUT_ARG_path =
05301 {
05302   {
05303     -1,
05304     "path",
05305     "s",
05306     NULL
05307   },
05308   FALSE
05309 };
05310 
05311 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_method_info_transient_OUT_ARG_pointers[] =
05312 {
05313   &_bamf_dbus_item_window_method_info_transient_OUT_ARG_path,
05314   NULL
05315 };
05316 
05317 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_window_method_info_transient =
05318 {
05319   {
05320     -1,
05321     "Transient",
05322     NULL,
05323     (GDBusArgInfo **) &_bamf_dbus_item_window_method_info_transient_OUT_ARG_pointers,
05324     NULL
05325   },
05326   "handle-transient",
05327   FALSE
05328 };
05329 
05330 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_method_info_window_type_OUT_ARG_type =
05331 {
05332   {
05333     -1,
05334     "type",
05335     "u",
05336     NULL
05337   },
05338   FALSE
05339 };
05340 
05341 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_method_info_window_type_OUT_ARG_pointers[] =
05342 {
05343   &_bamf_dbus_item_window_method_info_window_type_OUT_ARG_type,
05344   NULL
05345 };
05346 
05347 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_window_method_info_window_type =
05348 {
05349   {
05350     -1,
05351     "WindowType",
05352     NULL,
05353     (GDBusArgInfo **) &_bamf_dbus_item_window_method_info_window_type_OUT_ARG_pointers,
05354     NULL
05355   },
05356   "handle-window-type",
05357   FALSE
05358 };
05359 
05360 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_method_info_xprop_IN_ARG_xprop =
05361 {
05362   {
05363     -1,
05364     "xprop",
05365     "s",
05366     NULL
05367   },
05368   FALSE
05369 };
05370 
05371 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_method_info_xprop_IN_ARG_pointers[] =
05372 {
05373   &_bamf_dbus_item_window_method_info_xprop_IN_ARG_xprop,
05374   NULL
05375 };
05376 
05377 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_method_info_xprop_OUT_ARG_name =
05378 {
05379   {
05380     -1,
05381     "name",
05382     "s",
05383     NULL
05384   },
05385   FALSE
05386 };
05387 
05388 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_method_info_xprop_OUT_ARG_pointers[] =
05389 {
05390   &_bamf_dbus_item_window_method_info_xprop_OUT_ARG_name,
05391   NULL
05392 };
05393 
05394 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_window_method_info_xprop =
05395 {
05396   {
05397     -1,
05398     "Xprop",
05399     (GDBusArgInfo **) &_bamf_dbus_item_window_method_info_xprop_IN_ARG_pointers,
05400     (GDBusArgInfo **) &_bamf_dbus_item_window_method_info_xprop_OUT_ARG_pointers,
05401     NULL
05402   },
05403   "handle-xprop",
05404   FALSE
05405 };
05406 
05407 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_method_info_monitor_OUT_ARG_monitor_number =
05408 {
05409   {
05410     -1,
05411     "monitor_number",
05412     "i",
05413     NULL
05414   },
05415   FALSE
05416 };
05417 
05418 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_method_info_monitor_OUT_ARG_pointers[] =
05419 {
05420   &_bamf_dbus_item_window_method_info_monitor_OUT_ARG_monitor_number,
05421   NULL
05422 };
05423 
05424 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_window_method_info_monitor =
05425 {
05426   {
05427     -1,
05428     "Monitor",
05429     NULL,
05430     (GDBusArgInfo **) &_bamf_dbus_item_window_method_info_monitor_OUT_ARG_pointers,
05431     NULL
05432   },
05433   "handle-monitor",
05434   FALSE
05435 };
05436 
05437 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_method_info_maximized_OUT_ARG_maximized =
05438 {
05439   {
05440     -1,
05441     "maximized",
05442     "i",
05443     NULL
05444   },
05445   FALSE
05446 };
05447 
05448 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_method_info_maximized_OUT_ARG_pointers[] =
05449 {
05450   &_bamf_dbus_item_window_method_info_maximized_OUT_ARG_maximized,
05451   NULL
05452 };
05453 
05454 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_window_method_info_maximized =
05455 {
05456   {
05457     -1,
05458     "Maximized",
05459     NULL,
05460     (GDBusArgInfo **) &_bamf_dbus_item_window_method_info_maximized_OUT_ARG_pointers,
05461     NULL
05462   },
05463   "handle-maximized",
05464   FALSE
05465 };
05466 
05467 static const _ExtendedGDBusMethodInfo * const _bamf_dbus_item_window_method_info_pointers[] =
05468 {
05469   &_bamf_dbus_item_window_method_info_get_xid,
05470   &_bamf_dbus_item_window_method_info_get_pid,
05471   &_bamf_dbus_item_window_method_info_transient,
05472   &_bamf_dbus_item_window_method_info_window_type,
05473   &_bamf_dbus_item_window_method_info_xprop,
05474   &_bamf_dbus_item_window_method_info_monitor,
05475   &_bamf_dbus_item_window_method_info_maximized,
05476   NULL
05477 };
05478 
05479 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_signal_info_monitor_changed_ARG_old =
05480 {
05481   {
05482     -1,
05483     "old",
05484     "i",
05485     NULL
05486   },
05487   FALSE
05488 };
05489 
05490 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_signal_info_monitor_changed_ARG_new =
05491 {
05492   {
05493     -1,
05494     "new",
05495     "i",
05496     NULL
05497   },
05498   FALSE
05499 };
05500 
05501 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_signal_info_monitor_changed_ARG_pointers[] =
05502 {
05503   &_bamf_dbus_item_window_signal_info_monitor_changed_ARG_old,
05504   &_bamf_dbus_item_window_signal_info_monitor_changed_ARG_new,
05505   NULL
05506 };
05507 
05508 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_window_signal_info_monitor_changed =
05509 {
05510   {
05511     -1,
05512     "MonitorChanged",
05513     (GDBusArgInfo **) &_bamf_dbus_item_window_signal_info_monitor_changed_ARG_pointers,
05514     NULL
05515   },
05516   "monitor-changed"
05517 };
05518 
05519 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_signal_info_maximized_changed_ARG_old =
05520 {
05521   {
05522     -1,
05523     "old",
05524     "i",
05525     NULL
05526   },
05527   FALSE
05528 };
05529 
05530 static const _ExtendedGDBusArgInfo _bamf_dbus_item_window_signal_info_maximized_changed_ARG_new =
05531 {
05532   {
05533     -1,
05534     "new",
05535     "i",
05536     NULL
05537   },
05538   FALSE
05539 };
05540 
05541 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_window_signal_info_maximized_changed_ARG_pointers[] =
05542 {
05543   &_bamf_dbus_item_window_signal_info_maximized_changed_ARG_old,
05544   &_bamf_dbus_item_window_signal_info_maximized_changed_ARG_new,
05545   NULL
05546 };
05547 
05548 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_window_signal_info_maximized_changed =
05549 {
05550   {
05551     -1,
05552     "MaximizedChanged",
05553     (GDBusArgInfo **) &_bamf_dbus_item_window_signal_info_maximized_changed_ARG_pointers,
05554     NULL
05555   },
05556   "maximized-changed"
05557 };
05558 
05559 static const _ExtendedGDBusSignalInfo * const _bamf_dbus_item_window_signal_info_pointers[] =
05560 {
05561   &_bamf_dbus_item_window_signal_info_monitor_changed,
05562   &_bamf_dbus_item_window_signal_info_maximized_changed,
05563   NULL
05564 };
05565 
05566 static const _ExtendedGDBusInterfaceInfo _bamf_dbus_item_window_interface_info =
05567 {
05568   {
05569     -1,
05570     "org.ayatana.bamf.window",
05571     (GDBusMethodInfo **) &_bamf_dbus_item_window_method_info_pointers,
05572     (GDBusSignalInfo **) &_bamf_dbus_item_window_signal_info_pointers,
05573     NULL,
05574     NULL
05575   },
05576   "window",
05577 };
05578 
05579 
05587 GDBusInterfaceInfo *
05588 bamf_dbus_item_window_interface_info (void)
05589 {
05590   return (GDBusInterfaceInfo *) &_bamf_dbus_item_window_interface_info;
05591 }
05592 
05603 guint
05604 bamf_dbus_item_window_override_properties (GObjectClass *klass, guint property_id_begin)
05605 {
05606   return property_id_begin - 1;
05607 }
05608 
05609 
05610 
05633 static void
05634 bamf_dbus_item_window_default_init (BamfDBusItemWindowIface *iface)
05635 {
05636   /* GObject signals for incoming D-Bus method calls: */
05648   g_signal_new ("handle-get-xid",
05649     G_TYPE_FROM_INTERFACE (iface),
05650     G_SIGNAL_RUN_LAST,
05651     G_STRUCT_OFFSET (BamfDBusItemWindowIface, handle_get_xid),
05652     g_signal_accumulator_true_handled,
05653     NULL,
05654     g_cclosure_marshal_generic,
05655     G_TYPE_BOOLEAN,
05656     1,
05657     G_TYPE_DBUS_METHOD_INVOCATION);
05658 
05670   g_signal_new ("handle-get-pid",
05671     G_TYPE_FROM_INTERFACE (iface),
05672     G_SIGNAL_RUN_LAST,
05673     G_STRUCT_OFFSET (BamfDBusItemWindowIface, handle_get_pid),
05674     g_signal_accumulator_true_handled,
05675     NULL,
05676     g_cclosure_marshal_generic,
05677     G_TYPE_BOOLEAN,
05678     1,
05679     G_TYPE_DBUS_METHOD_INVOCATION);
05680 
05692   g_signal_new ("handle-transient",
05693     G_TYPE_FROM_INTERFACE (iface),
05694     G_SIGNAL_RUN_LAST,
05695     G_STRUCT_OFFSET (BamfDBusItemWindowIface, handle_transient),
05696     g_signal_accumulator_true_handled,
05697     NULL,
05698     g_cclosure_marshal_generic,
05699     G_TYPE_BOOLEAN,
05700     1,
05701     G_TYPE_DBUS_METHOD_INVOCATION);
05702 
05714   g_signal_new ("handle-window-type",
05715     G_TYPE_FROM_INTERFACE (iface),
05716     G_SIGNAL_RUN_LAST,
05717     G_STRUCT_OFFSET (BamfDBusItemWindowIface, handle_window_type),
05718     g_signal_accumulator_true_handled,
05719     NULL,
05720     g_cclosure_marshal_generic,
05721     G_TYPE_BOOLEAN,
05722     1,
05723     G_TYPE_DBUS_METHOD_INVOCATION);
05724 
05737   g_signal_new ("handle-xprop",
05738     G_TYPE_FROM_INTERFACE (iface),
05739     G_SIGNAL_RUN_LAST,
05740     G_STRUCT_OFFSET (BamfDBusItemWindowIface, handle_xprop),
05741     g_signal_accumulator_true_handled,
05742     NULL,
05743     g_cclosure_marshal_generic,
05744     G_TYPE_BOOLEAN,
05745     2,
05746     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
05747 
05759   g_signal_new ("handle-monitor",
05760     G_TYPE_FROM_INTERFACE (iface),
05761     G_SIGNAL_RUN_LAST,
05762     G_STRUCT_OFFSET (BamfDBusItemWindowIface, handle_monitor),
05763     g_signal_accumulator_true_handled,
05764     NULL,
05765     g_cclosure_marshal_generic,
05766     G_TYPE_BOOLEAN,
05767     1,
05768     G_TYPE_DBUS_METHOD_INVOCATION);
05769 
05781   g_signal_new ("handle-maximized",
05782     G_TYPE_FROM_INTERFACE (iface),
05783     G_SIGNAL_RUN_LAST,
05784     G_STRUCT_OFFSET (BamfDBusItemWindowIface, handle_maximized),
05785     g_signal_accumulator_true_handled,
05786     NULL,
05787     g_cclosure_marshal_generic,
05788     G_TYPE_BOOLEAN,
05789     1,
05790     G_TYPE_DBUS_METHOD_INVOCATION);
05791 
05792   /* GObject signals for received D-Bus signals: */
05803   g_signal_new ("monitor-changed",
05804     G_TYPE_FROM_INTERFACE (iface),
05805     G_SIGNAL_RUN_LAST,
05806     G_STRUCT_OFFSET (BamfDBusItemWindowIface, monitor_changed),
05807     NULL,
05808     NULL,
05809     g_cclosure_marshal_generic,
05810     G_TYPE_NONE,
05811     2, G_TYPE_INT, G_TYPE_INT);
05812 
05823   g_signal_new ("maximized-changed",
05824     G_TYPE_FROM_INTERFACE (iface),
05825     G_SIGNAL_RUN_LAST,
05826     G_STRUCT_OFFSET (BamfDBusItemWindowIface, maximized_changed),
05827     NULL,
05828     NULL,
05829     g_cclosure_marshal_generic,
05830     G_TYPE_NONE,
05831     2, G_TYPE_INT, G_TYPE_INT);
05832 
05833 }
05834 
05835 typedef BamfDBusItemWindowIface BamfDBusItemWindowInterface;
05836 G_DEFINE_INTERFACE (BamfDBusItemWindow, bamf_dbus_item_window, G_TYPE_OBJECT);
05837 
05846 void
05847 bamf_dbus_item_window_emit_monitor_changed (
05848     BamfDBusItemWindow *object,
05849     gint arg_old,
05850     gint arg_new)
05851 {
05852   g_signal_emit_by_name (object, "monitor-changed", arg_old, arg_new);
05853 }
05854 
05863 void
05864 bamf_dbus_item_window_emit_maximized_changed (
05865     BamfDBusItemWindow *object,
05866     gint arg_old,
05867     gint arg_new)
05868 {
05869   g_signal_emit_by_name (object, "maximized-changed", arg_old, arg_new);
05870 }
05871 
05885 void
05886 bamf_dbus_item_window_call_get_xid (
05887     BamfDBusItemWindow *proxy,
05888     GCancellable *cancellable,
05889     GAsyncReadyCallback callback,
05890     gpointer user_data)
05891 {
05892   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
05893     "GetXid",
05894     g_variant_new ("()"),
05895     G_DBUS_CALL_FLAGS_NONE,
05896     -1,
05897     cancellable,
05898     callback,
05899     user_data);
05900 }
05901 
05913 gboolean
05914 bamf_dbus_item_window_call_get_xid_finish (
05915     BamfDBusItemWindow *proxy,
05916     guint *out_xid,
05917     GAsyncResult *res,
05918     GError **error)
05919 {
05920   GVariant *_ret;
05921   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
05922   if (_ret == NULL)
05923     goto _out;
05924   g_variant_get (_ret,
05925                  "(u)",
05926                  out_xid);
05927   g_variant_unref (_ret);
05928 _out:
05929   return _ret != NULL;
05930 }
05931 
05945 gboolean
05946 bamf_dbus_item_window_call_get_xid_sync (
05947     BamfDBusItemWindow *proxy,
05948     guint *out_xid,
05949     GCancellable *cancellable,
05950     GError **error)
05951 {
05952   GVariant *_ret;
05953   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
05954     "GetXid",
05955     g_variant_new ("()"),
05956     G_DBUS_CALL_FLAGS_NONE,
05957     -1,
05958     cancellable,
05959     error);
05960   if (_ret == NULL)
05961     goto _out;
05962   g_variant_get (_ret,
05963                  "(u)",
05964                  out_xid);
05965   g_variant_unref (_ret);
05966 _out:
05967   return _ret != NULL;
05968 }
05969 
05983 void
05984 bamf_dbus_item_window_call_get_pid (
05985     BamfDBusItemWindow *proxy,
05986     GCancellable *cancellable,
05987     GAsyncReadyCallback callback,
05988     gpointer user_data)
05989 {
05990   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
05991     "GetPid",
05992     g_variant_new ("()"),
05993     G_DBUS_CALL_FLAGS_NONE,
05994     -1,
05995     cancellable,
05996     callback,
05997     user_data);
05998 }
05999 
06011 gboolean
06012 bamf_dbus_item_window_call_get_pid_finish (
06013     BamfDBusItemWindow *proxy,
06014     guint *out_pid,
06015     GAsyncResult *res,
06016     GError **error)
06017 {
06018   GVariant *_ret;
06019   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
06020   if (_ret == NULL)
06021     goto _out;
06022   g_variant_get (_ret,
06023                  "(u)",
06024                  out_pid);
06025   g_variant_unref (_ret);
06026 _out:
06027   return _ret != NULL;
06028 }
06029 
06043 gboolean
06044 bamf_dbus_item_window_call_get_pid_sync (
06045     BamfDBusItemWindow *proxy,
06046     guint *out_pid,
06047     GCancellable *cancellable,
06048     GError **error)
06049 {
06050   GVariant *_ret;
06051   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
06052     "GetPid",
06053     g_variant_new ("()"),
06054     G_DBUS_CALL_FLAGS_NONE,
06055     -1,
06056     cancellable,
06057     error);
06058   if (_ret == NULL)
06059     goto _out;
06060   g_variant_get (_ret,
06061                  "(u)",
06062                  out_pid);
06063   g_variant_unref (_ret);
06064 _out:
06065   return _ret != NULL;
06066 }
06067 
06081 void
06082 bamf_dbus_item_window_call_transient (
06083     BamfDBusItemWindow *proxy,
06084     GCancellable *cancellable,
06085     GAsyncReadyCallback callback,
06086     gpointer user_data)
06087 {
06088   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
06089     "Transient",
06090     g_variant_new ("()"),
06091     G_DBUS_CALL_FLAGS_NONE,
06092     -1,
06093     cancellable,
06094     callback,
06095     user_data);
06096 }
06097 
06109 gboolean
06110 bamf_dbus_item_window_call_transient_finish (
06111     BamfDBusItemWindow *proxy,
06112     gchar **out_path,
06113     GAsyncResult *res,
06114     GError **error)
06115 {
06116   GVariant *_ret;
06117   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
06118   if (_ret == NULL)
06119     goto _out;
06120   g_variant_get (_ret,
06121                  "(s)",
06122                  out_path);
06123   g_variant_unref (_ret);
06124 _out:
06125   return _ret != NULL;
06126 }
06127 
06141 gboolean
06142 bamf_dbus_item_window_call_transient_sync (
06143     BamfDBusItemWindow *proxy,
06144     gchar **out_path,
06145     GCancellable *cancellable,
06146     GError **error)
06147 {
06148   GVariant *_ret;
06149   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
06150     "Transient",
06151     g_variant_new ("()"),
06152     G_DBUS_CALL_FLAGS_NONE,
06153     -1,
06154     cancellable,
06155     error);
06156   if (_ret == NULL)
06157     goto _out;
06158   g_variant_get (_ret,
06159                  "(s)",
06160                  out_path);
06161   g_variant_unref (_ret);
06162 _out:
06163   return _ret != NULL;
06164 }
06165 
06179 void
06180 bamf_dbus_item_window_call_window_type (
06181     BamfDBusItemWindow *proxy,
06182     GCancellable *cancellable,
06183     GAsyncReadyCallback callback,
06184     gpointer user_data)
06185 {
06186   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
06187     "WindowType",
06188     g_variant_new ("()"),
06189     G_DBUS_CALL_FLAGS_NONE,
06190     -1,
06191     cancellable,
06192     callback,
06193     user_data);
06194 }
06195 
06207 gboolean
06208 bamf_dbus_item_window_call_window_type_finish (
06209     BamfDBusItemWindow *proxy,
06210     guint *out_type,
06211     GAsyncResult *res,
06212     GError **error)
06213 {
06214   GVariant *_ret;
06215   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
06216   if (_ret == NULL)
06217     goto _out;
06218   g_variant_get (_ret,
06219                  "(u)",
06220                  out_type);
06221   g_variant_unref (_ret);
06222 _out:
06223   return _ret != NULL;
06224 }
06225 
06239 gboolean
06240 bamf_dbus_item_window_call_window_type_sync (
06241     BamfDBusItemWindow *proxy,
06242     guint *out_type,
06243     GCancellable *cancellable,
06244     GError **error)
06245 {
06246   GVariant *_ret;
06247   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
06248     "WindowType",
06249     g_variant_new ("()"),
06250     G_DBUS_CALL_FLAGS_NONE,
06251     -1,
06252     cancellable,
06253     error);
06254   if (_ret == NULL)
06255     goto _out;
06256   g_variant_get (_ret,
06257                  "(u)",
06258                  out_type);
06259   g_variant_unref (_ret);
06260 _out:
06261   return _ret != NULL;
06262 }
06263 
06278 void
06279 bamf_dbus_item_window_call_xprop (
06280     BamfDBusItemWindow *proxy,
06281     const gchar *arg_xprop,
06282     GCancellable *cancellable,
06283     GAsyncReadyCallback callback,
06284     gpointer user_data)
06285 {
06286   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
06287     "Xprop",
06288     g_variant_new ("(s)",
06289                    arg_xprop),
06290     G_DBUS_CALL_FLAGS_NONE,
06291     -1,
06292     cancellable,
06293     callback,
06294     user_data);
06295 }
06296 
06308 gboolean
06309 bamf_dbus_item_window_call_xprop_finish (
06310     BamfDBusItemWindow *proxy,
06311     gchar **out_name,
06312     GAsyncResult *res,
06313     GError **error)
06314 {
06315   GVariant *_ret;
06316   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
06317   if (_ret == NULL)
06318     goto _out;
06319   g_variant_get (_ret,
06320                  "(s)",
06321                  out_name);
06322   g_variant_unref (_ret);
06323 _out:
06324   return _ret != NULL;
06325 }
06326 
06341 gboolean
06342 bamf_dbus_item_window_call_xprop_sync (
06343     BamfDBusItemWindow *proxy,
06344     const gchar *arg_xprop,
06345     gchar **out_name,
06346     GCancellable *cancellable,
06347     GError **error)
06348 {
06349   GVariant *_ret;
06350   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
06351     "Xprop",
06352     g_variant_new ("(s)",
06353                    arg_xprop),
06354     G_DBUS_CALL_FLAGS_NONE,
06355     -1,
06356     cancellable,
06357     error);
06358   if (_ret == NULL)
06359     goto _out;
06360   g_variant_get (_ret,
06361                  "(s)",
06362                  out_name);
06363   g_variant_unref (_ret);
06364 _out:
06365   return _ret != NULL;
06366 }
06367 
06381 void
06382 bamf_dbus_item_window_call_monitor (
06383     BamfDBusItemWindow *proxy,
06384     GCancellable *cancellable,
06385     GAsyncReadyCallback callback,
06386     gpointer user_data)
06387 {
06388   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
06389     "Monitor",
06390     g_variant_new ("()"),
06391     G_DBUS_CALL_FLAGS_NONE,
06392     -1,
06393     cancellable,
06394     callback,
06395     user_data);
06396 }
06397 
06409 gboolean
06410 bamf_dbus_item_window_call_monitor_finish (
06411     BamfDBusItemWindow *proxy,
06412     gint *out_monitor_number,
06413     GAsyncResult *res,
06414     GError **error)
06415 {
06416   GVariant *_ret;
06417   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
06418   if (_ret == NULL)
06419     goto _out;
06420   g_variant_get (_ret,
06421                  "(i)",
06422                  out_monitor_number);
06423   g_variant_unref (_ret);
06424 _out:
06425   return _ret != NULL;
06426 }
06427 
06441 gboolean
06442 bamf_dbus_item_window_call_monitor_sync (
06443     BamfDBusItemWindow *proxy,
06444     gint *out_monitor_number,
06445     GCancellable *cancellable,
06446     GError **error)
06447 {
06448   GVariant *_ret;
06449   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
06450     "Monitor",
06451     g_variant_new ("()"),
06452     G_DBUS_CALL_FLAGS_NONE,
06453     -1,
06454     cancellable,
06455     error);
06456   if (_ret == NULL)
06457     goto _out;
06458   g_variant_get (_ret,
06459                  "(i)",
06460                  out_monitor_number);
06461   g_variant_unref (_ret);
06462 _out:
06463   return _ret != NULL;
06464 }
06465 
06479 void
06480 bamf_dbus_item_window_call_maximized (
06481     BamfDBusItemWindow *proxy,
06482     GCancellable *cancellable,
06483     GAsyncReadyCallback callback,
06484     gpointer user_data)
06485 {
06486   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
06487     "Maximized",
06488     g_variant_new ("()"),
06489     G_DBUS_CALL_FLAGS_NONE,
06490     -1,
06491     cancellable,
06492     callback,
06493     user_data);
06494 }
06495 
06507 gboolean
06508 bamf_dbus_item_window_call_maximized_finish (
06509     BamfDBusItemWindow *proxy,
06510     gint *out_maximized,
06511     GAsyncResult *res,
06512     GError **error)
06513 {
06514   GVariant *_ret;
06515   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
06516   if (_ret == NULL)
06517     goto _out;
06518   g_variant_get (_ret,
06519                  "(i)",
06520                  out_maximized);
06521   g_variant_unref (_ret);
06522 _out:
06523   return _ret != NULL;
06524 }
06525 
06539 gboolean
06540 bamf_dbus_item_window_call_maximized_sync (
06541     BamfDBusItemWindow *proxy,
06542     gint *out_maximized,
06543     GCancellable *cancellable,
06544     GError **error)
06545 {
06546   GVariant *_ret;
06547   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
06548     "Maximized",
06549     g_variant_new ("()"),
06550     G_DBUS_CALL_FLAGS_NONE,
06551     -1,
06552     cancellable,
06553     error);
06554   if (_ret == NULL)
06555     goto _out;
06556   g_variant_get (_ret,
06557                  "(i)",
06558                  out_maximized);
06559   g_variant_unref (_ret);
06560 _out:
06561   return _ret != NULL;
06562 }
06563 
06574 void
06575 bamf_dbus_item_window_complete_get_xid (
06576     BamfDBusItemWindow *object,
06577     GDBusMethodInvocation *invocation,
06578     guint xid)
06579 {
06580   g_dbus_method_invocation_return_value (invocation,
06581     g_variant_new ("(u)",
06582                    xid));
06583 }
06584 
06595 void
06596 bamf_dbus_item_window_complete_get_pid (
06597     BamfDBusItemWindow *object,
06598     GDBusMethodInvocation *invocation,
06599     guint pid)
06600 {
06601   g_dbus_method_invocation_return_value (invocation,
06602     g_variant_new ("(u)",
06603                    pid));
06604 }
06605 
06616 void
06617 bamf_dbus_item_window_complete_transient (
06618     BamfDBusItemWindow *object,
06619     GDBusMethodInvocation *invocation,
06620     const gchar *path)
06621 {
06622   g_dbus_method_invocation_return_value (invocation,
06623     g_variant_new ("(s)",
06624                    path));
06625 }
06626 
06637 void
06638 bamf_dbus_item_window_complete_window_type (
06639     BamfDBusItemWindow *object,
06640     GDBusMethodInvocation *invocation,
06641     guint type)
06642 {
06643   g_dbus_method_invocation_return_value (invocation,
06644     g_variant_new ("(u)",
06645                    type));
06646 }
06647 
06658 void
06659 bamf_dbus_item_window_complete_xprop (
06660     BamfDBusItemWindow *object,
06661     GDBusMethodInvocation *invocation,
06662     const gchar *name)
06663 {
06664   g_dbus_method_invocation_return_value (invocation,
06665     g_variant_new ("(s)",
06666                    name));
06667 }
06668 
06679 void
06680 bamf_dbus_item_window_complete_monitor (
06681     BamfDBusItemWindow *object,
06682     GDBusMethodInvocation *invocation,
06683     gint monitor_number)
06684 {
06685   g_dbus_method_invocation_return_value (invocation,
06686     g_variant_new ("(i)",
06687                    monitor_number));
06688 }
06689 
06700 void
06701 bamf_dbus_item_window_complete_maximized (
06702     BamfDBusItemWindow *object,
06703     GDBusMethodInvocation *invocation,
06704     gint maximized)
06705 {
06706   g_dbus_method_invocation_return_value (invocation,
06707     g_variant_new ("(i)",
06708                    maximized));
06709 }
06710 
06711 /* ------------------------------------------------------------------------ */
06712 
06726 struct _BamfDBusItemWindowProxyPrivate
06727 {
06728   GData *qdata;
06729 };
06730 
06731 static void bamf_dbus_item_window_proxy_iface_init (BamfDBusItemWindowIface *iface);
06732 
06733 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemWindowProxy, bamf_dbus_item_window_proxy, G_TYPE_DBUS_PROXY,
06734                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_WINDOW, bamf_dbus_item_window_proxy_iface_init));
06735 
06736 static void
06737 bamf_dbus_item_window_proxy_finalize (GObject *object)
06738 {
06739   BamfDBusItemWindowProxy *proxy = BAMF_DBUS_ITEM_WINDOW_PROXY (object);
06740   g_datalist_clear (&proxy->priv->qdata);
06741   G_OBJECT_CLASS (bamf_dbus_item_window_proxy_parent_class)->finalize (object);
06742 }
06743 
06744 static void
06745 bamf_dbus_item_window_proxy_get_property (GObject      *object,
06746   guint         prop_id,
06747   GValue       *value,
06748   GParamSpec   *pspec)
06749 {
06750 }
06751 
06752 static void
06753 bamf_dbus_item_window_proxy_set_property (GObject      *object,
06754   guint         prop_id,
06755   const GValue *value,
06756   GParamSpec   *pspec)
06757 {
06758 }
06759 
06760 static void
06761 bamf_dbus_item_window_proxy_g_signal (GDBusProxy *proxy,
06762   const gchar *sender_name,
06763   const gchar *signal_name,
06764   GVariant *parameters)
06765 {
06766   _ExtendedGDBusSignalInfo *info;
06767   GVariantIter iter;
06768   GVariant *child;
06769   GValue *paramv;
06770   guint num_params;
06771   guint n;
06772   guint signal_id;
06773   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_bamf_dbus_item_window_interface_info, signal_name);
06774   if (info == NULL)
06775     return;
06776   num_params = g_variant_n_children (parameters);
06777   paramv = g_new0 (GValue, num_params + 1);
06778   g_value_init (&paramv[0], BAMF_DBUS_ITEM_TYPE_WINDOW);
06779   g_value_set_object (&paramv[0], proxy);
06780   g_variant_iter_init (&iter, parameters);
06781   n = 1;
06782   while ((child = g_variant_iter_next_value (&iter)) != NULL)
06783     {
06784       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
06785       if (arg_info->use_gvariant)
06786         {
06787           g_value_init (&paramv[n], G_TYPE_VARIANT);
06788           g_value_set_variant (&paramv[n], child);
06789           n++;
06790         }
06791       else
06792         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
06793       g_variant_unref (child);
06794     }
06795   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_WINDOW);
06796   g_signal_emitv (paramv, signal_id, 0, NULL);
06797   for (n = 0; n < num_params + 1; n++)
06798     g_value_unset (&paramv[n]);
06799   g_free (paramv);
06800 }
06801 
06802 static void
06803 bamf_dbus_item_window_proxy_g_properties_changed (GDBusProxy *_proxy,
06804   GVariant *changed_properties,
06805   const gchar *const *invalidated_properties)
06806 {
06807   BamfDBusItemWindowProxy *proxy = BAMF_DBUS_ITEM_WINDOW_PROXY (_proxy);
06808   guint n;
06809   const gchar *key;
06810   GVariantIter *iter;
06811   _ExtendedGDBusPropertyInfo *info;
06812   g_variant_get (changed_properties, "a{sv}", &iter);
06813   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
06814     {
06815       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_window_interface_info, key);
06816       g_datalist_remove_data (&proxy->priv->qdata, key);
06817       if (info != NULL)
06818         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
06819     }
06820   g_variant_iter_free (iter);
06821   for (n = 0; invalidated_properties[n] != NULL; n++)
06822     {
06823       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_window_interface_info, invalidated_properties[n]);
06824       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
06825       if (info != NULL)
06826         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
06827     }
06828 }
06829 
06830 static void
06831 bamf_dbus_item_window_proxy_init (BamfDBusItemWindowProxy *proxy)
06832 {
06833   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, BAMF_DBUS_ITEM_TYPE_WINDOW_PROXY, BamfDBusItemWindowProxyPrivate);
06834   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), bamf_dbus_item_window_interface_info ());
06835 }
06836 
06837 static void
06838 bamf_dbus_item_window_proxy_class_init (BamfDBusItemWindowProxyClass *klass)
06839 {
06840   GObjectClass *gobject_class;
06841   GDBusProxyClass *proxy_class;
06842 
06843   g_type_class_add_private (klass, sizeof (BamfDBusItemWindowProxyPrivate));
06844 
06845   gobject_class = G_OBJECT_CLASS (klass);
06846   gobject_class->finalize     = bamf_dbus_item_window_proxy_finalize;
06847   gobject_class->get_property = bamf_dbus_item_window_proxy_get_property;
06848   gobject_class->set_property = bamf_dbus_item_window_proxy_set_property;
06849 
06850   proxy_class = G_DBUS_PROXY_CLASS (klass);
06851   proxy_class->g_signal = bamf_dbus_item_window_proxy_g_signal;
06852   proxy_class->g_properties_changed = bamf_dbus_item_window_proxy_g_properties_changed;
06853 
06854 }
06855 
06856 static void
06857 bamf_dbus_item_window_proxy_iface_init (BamfDBusItemWindowIface *iface)
06858 {
06859 }
06860 
06878 void
06879 bamf_dbus_item_window_proxy_new (
06880     GDBusConnection     *connection,
06881     GDBusProxyFlags      flags,
06882     const gchar         *name,
06883     const gchar         *object_path,
06884     GCancellable        *cancellable,
06885     GAsyncReadyCallback  callback,
06886     gpointer             user_data)
06887 {
06888   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_WINDOW_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.window", NULL);
06889 }
06890 
06900 BamfDBusItemWindow *
06901 bamf_dbus_item_window_proxy_new_finish (
06902     GAsyncResult        *res,
06903     GError             **error)
06904 {
06905   GObject *ret;
06906   GObject *source_object;
06907   source_object = g_async_result_get_source_object (res);
06908   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
06909   g_object_unref (source_object);
06910   if (ret != NULL)
06911     return BAMF_DBUS_ITEM_WINDOW (ret);
06912   else
06913     return NULL;
06914 }
06915 
06933 BamfDBusItemWindow *
06934 bamf_dbus_item_window_proxy_new_sync (
06935     GDBusConnection     *connection,
06936     GDBusProxyFlags      flags,
06937     const gchar         *name,
06938     const gchar         *object_path,
06939     GCancellable        *cancellable,
06940     GError             **error)
06941 {
06942   GInitable *ret;
06943   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_WINDOW_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.ayatana.bamf.window", NULL);
06944   if (ret != NULL)
06945     return BAMF_DBUS_ITEM_WINDOW (ret);
06946   else
06947     return NULL;
06948 }
06949 
06950 
06968 void
06969 bamf_dbus_item_window_proxy_new_for_bus (
06970     GBusType             bus_type,
06971     GDBusProxyFlags      flags,
06972     const gchar         *name,
06973     const gchar         *object_path,
06974     GCancellable        *cancellable,
06975     GAsyncReadyCallback  callback,
06976     gpointer             user_data)
06977 {
06978   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_WINDOW_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.window", NULL);
06979 }
06980 
06990 BamfDBusItemWindow *
06991 bamf_dbus_item_window_proxy_new_for_bus_finish (
06992     GAsyncResult        *res,
06993     GError             **error)
06994 {
06995   GObject *ret;
06996   GObject *source_object;
06997   source_object = g_async_result_get_source_object (res);
06998   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
06999   g_object_unref (source_object);
07000   if (ret != NULL)
07001     return BAMF_DBUS_ITEM_WINDOW (ret);
07002   else
07003     return NULL;
07004 }
07005 
07023 BamfDBusItemWindow *
07024 bamf_dbus_item_window_proxy_new_for_bus_sync (
07025     GBusType             bus_type,
07026     GDBusProxyFlags      flags,
07027     const gchar         *name,
07028     const gchar         *object_path,
07029     GCancellable        *cancellable,
07030     GError             **error)
07031 {
07032   GInitable *ret;
07033   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_WINDOW_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.window", NULL);
07034   if (ret != NULL)
07035     return BAMF_DBUS_ITEM_WINDOW (ret);
07036   else
07037     return NULL;
07038 }
07039 
07040 
07041 /* ------------------------------------------------------------------------ */
07042 
07056 struct _BamfDBusItemWindowSkeletonPrivate
07057 {
07058   GValue *properties;
07059   GList *changed_properties;
07060   GSource *changed_properties_idle_source;
07061   GMainContext *context;
07062   GMutex lock;
07063 };
07064 
07065 static void
07066 _bamf_dbus_item_window_skeleton_handle_method_call (
07067   GDBusConnection *connection,
07068   const gchar *sender,
07069   const gchar *object_path,
07070   const gchar *interface_name,
07071   const gchar *method_name,
07072   GVariant *parameters,
07073   GDBusMethodInvocation *invocation,
07074   gpointer user_data)
07075 {
07076   BamfDBusItemWindowSkeleton *skeleton = BAMF_DBUS_ITEM_WINDOW_SKELETON (user_data);
07077   _ExtendedGDBusMethodInfo *info;
07078   GVariantIter iter;
07079   GVariant *child;
07080   GValue *paramv;
07081   guint num_params;
07082   guint num_extra;
07083   guint n;
07084   guint signal_id;
07085   GValue return_value = G_VALUE_INIT;
07086   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
07087   g_assert (info != NULL);
07088   num_params = g_variant_n_children (parameters);
07089   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
07090   n = 0;
07091   g_value_init (&paramv[n], BAMF_DBUS_ITEM_TYPE_WINDOW);
07092   g_value_set_object (&paramv[n++], skeleton);
07093   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
07094   g_value_set_object (&paramv[n++], invocation);
07095   if (info->pass_fdlist)
07096     {
07097 #ifdef G_OS_UNIX
07098       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
07099       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
07100 #else
07101       g_assert_not_reached ();
07102 #endif
07103     }
07104   g_variant_iter_init (&iter, parameters);
07105   while ((child = g_variant_iter_next_value (&iter)) != NULL)
07106     {
07107       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
07108       if (arg_info->use_gvariant)
07109         {
07110           g_value_init (&paramv[n], G_TYPE_VARIANT);
07111           g_value_set_variant (&paramv[n], child);
07112           n++;
07113         }
07114       else
07115         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
07116       g_variant_unref (child);
07117     }
07118   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_WINDOW);
07119   g_value_init (&return_value, G_TYPE_BOOLEAN);
07120   g_signal_emitv (paramv, signal_id, 0, &return_value);
07121   if (!g_value_get_boolean (&return_value))
07122     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);
07123   g_value_unset (&return_value);
07124   for (n = 0; n < num_params + num_extra; n++)
07125     g_value_unset (&paramv[n]);
07126   g_free (paramv);
07127 }
07128 
07129 static GVariant *
07130 _bamf_dbus_item_window_skeleton_handle_get_property (
07131   GDBusConnection *connection,
07132   const gchar *sender,
07133   const gchar *object_path,
07134   const gchar *interface_name,
07135   const gchar *property_name,
07136   GError **error,
07137   gpointer user_data)
07138 {
07139   BamfDBusItemWindowSkeleton *skeleton = BAMF_DBUS_ITEM_WINDOW_SKELETON (user_data);
07140   GValue value = G_VALUE_INIT;
07141   GParamSpec *pspec;
07142   _ExtendedGDBusPropertyInfo *info;
07143   GVariant *ret;
07144   ret = NULL;
07145   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_window_interface_info, property_name);
07146   g_assert (info != NULL);
07147   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
07148   if (pspec == NULL)
07149     {
07150       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
07151     }
07152   else
07153     {
07154       g_value_init (&value, pspec->value_type);
07155       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
07156       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
07157       g_value_unset (&value);
07158     }
07159   return ret;
07160 }
07161 
07162 static gboolean
07163 _bamf_dbus_item_window_skeleton_handle_set_property (
07164   GDBusConnection *connection,
07165   const gchar *sender,
07166   const gchar *object_path,
07167   const gchar *interface_name,
07168   const gchar *property_name,
07169   GVariant *variant,
07170   GError **error,
07171   gpointer user_data)
07172 {
07173   BamfDBusItemWindowSkeleton *skeleton = BAMF_DBUS_ITEM_WINDOW_SKELETON (user_data);
07174   GValue value = G_VALUE_INIT;
07175   GParamSpec *pspec;
07176   _ExtendedGDBusPropertyInfo *info;
07177   gboolean ret;
07178   ret = FALSE;
07179   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_window_interface_info, property_name);
07180   g_assert (info != NULL);
07181   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
07182   if (pspec == NULL)
07183     {
07184       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
07185     }
07186   else
07187     {
07188       if (info->use_gvariant)
07189         g_value_set_variant (&value, variant);
07190       else
07191         g_dbus_gvariant_to_gvalue (variant, &value);
07192       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
07193       g_value_unset (&value);
07194       ret = TRUE;
07195     }
07196   return ret;
07197 }
07198 
07199 static const GDBusInterfaceVTable _bamf_dbus_item_window_skeleton_vtable =
07200 {
07201   _bamf_dbus_item_window_skeleton_handle_method_call,
07202   _bamf_dbus_item_window_skeleton_handle_get_property,
07203   _bamf_dbus_item_window_skeleton_handle_set_property
07204 };
07205 
07206 static GDBusInterfaceInfo *
07207 bamf_dbus_item_window_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
07208 {
07209   return bamf_dbus_item_window_interface_info ();
07210 }
07211 
07212 static GDBusInterfaceVTable *
07213 bamf_dbus_item_window_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
07214 {
07215   return (GDBusInterfaceVTable *) &_bamf_dbus_item_window_skeleton_vtable;
07216 }
07217 
07218 static GVariant *
07219 bamf_dbus_item_window_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
07220 {
07221   BamfDBusItemWindowSkeleton *skeleton = BAMF_DBUS_ITEM_WINDOW_SKELETON (_skeleton);
07222 
07223   GVariantBuilder builder;
07224   guint n;
07225   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
07226   if (_bamf_dbus_item_window_interface_info.parent_struct.properties == NULL)
07227     goto out;
07228   for (n = 0; _bamf_dbus_item_window_interface_info.parent_struct.properties[n] != NULL; n++)
07229     {
07230       GDBusPropertyInfo *info = _bamf_dbus_item_window_interface_info.parent_struct.properties[n];
07231       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
07232         {
07233           GVariant *value;
07234           value = _bamf_dbus_item_window_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.window", info->name, NULL, skeleton);
07235           if (value != NULL)
07236             {
07237               g_variant_take_ref (value);
07238               g_variant_builder_add (&builder, "{sv}", info->name, value);
07239               g_variant_unref (value);
07240             }
07241         }
07242     }
07243 out:
07244   return g_variant_builder_end (&builder);
07245 }
07246 
07247 static void
07248 bamf_dbus_item_window_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
07249 {
07250 }
07251 
07252 static void
07253 _bamf_dbus_item_window_on_signal_monitor_changed (
07254     BamfDBusItemWindow *object,
07255     gint arg_old,
07256     gint arg_new)
07257 {
07258   BamfDBusItemWindowSkeleton *skeleton = BAMF_DBUS_ITEM_WINDOW_SKELETON (object);
07259 
07260   GList      *connections, *l;
07261   GVariant   *signal_variant;
07262   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
07263 
07264   signal_variant = g_variant_ref_sink (g_variant_new ("(ii)",
07265                    arg_old,
07266                    arg_new));
07267   for (l = connections; l != NULL; l = l->next)
07268     {
07269       GDBusConnection *connection = l->data;
07270       g_dbus_connection_emit_signal (connection,
07271         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.window", "MonitorChanged",
07272         signal_variant, NULL);
07273     }
07274   g_variant_unref (signal_variant);
07275   g_list_free_full (connections, g_object_unref);
07276 }
07277 
07278 static void
07279 _bamf_dbus_item_window_on_signal_maximized_changed (
07280     BamfDBusItemWindow *object,
07281     gint arg_old,
07282     gint arg_new)
07283 {
07284   BamfDBusItemWindowSkeleton *skeleton = BAMF_DBUS_ITEM_WINDOW_SKELETON (object);
07285 
07286   GList      *connections, *l;
07287   GVariant   *signal_variant;
07288   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
07289 
07290   signal_variant = g_variant_ref_sink (g_variant_new ("(ii)",
07291                    arg_old,
07292                    arg_new));
07293   for (l = connections; l != NULL; l = l->next)
07294     {
07295       GDBusConnection *connection = l->data;
07296       g_dbus_connection_emit_signal (connection,
07297         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.window", "MaximizedChanged",
07298         signal_variant, NULL);
07299     }
07300   g_variant_unref (signal_variant);
07301   g_list_free_full (connections, g_object_unref);
07302 }
07303 
07304 static void bamf_dbus_item_window_skeleton_iface_init (BamfDBusItemWindowIface *iface);
07305 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemWindowSkeleton, bamf_dbus_item_window_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
07306                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_WINDOW, bamf_dbus_item_window_skeleton_iface_init));
07307 
07308 static void
07309 bamf_dbus_item_window_skeleton_finalize (GObject *object)
07310 {
07311   BamfDBusItemWindowSkeleton *skeleton = BAMF_DBUS_ITEM_WINDOW_SKELETON (object);
07312   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
07313   if (skeleton->priv->changed_properties_idle_source != NULL)
07314     g_source_destroy (skeleton->priv->changed_properties_idle_source);
07315   g_main_context_unref (skeleton->priv->context);
07316   g_mutex_clear (&skeleton->priv->lock);
07317   G_OBJECT_CLASS (bamf_dbus_item_window_skeleton_parent_class)->finalize (object);
07318 }
07319 
07320 static void
07321 bamf_dbus_item_window_skeleton_init (BamfDBusItemWindowSkeleton *skeleton)
07322 {
07323   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, BAMF_DBUS_ITEM_TYPE_WINDOW_SKELETON, BamfDBusItemWindowSkeletonPrivate);
07324   g_mutex_init (&skeleton->priv->lock);
07325   skeleton->priv->context = g_main_context_ref_thread_default ();
07326 }
07327 
07328 static void
07329 bamf_dbus_item_window_skeleton_class_init (BamfDBusItemWindowSkeletonClass *klass)
07330 {
07331   GObjectClass *gobject_class;
07332   GDBusInterfaceSkeletonClass *skeleton_class;
07333 
07334   g_type_class_add_private (klass, sizeof (BamfDBusItemWindowSkeletonPrivate));
07335 
07336   gobject_class = G_OBJECT_CLASS (klass);
07337   gobject_class->finalize = bamf_dbus_item_window_skeleton_finalize;
07338 
07339   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
07340   skeleton_class->get_info = bamf_dbus_item_window_skeleton_dbus_interface_get_info;
07341   skeleton_class->get_properties = bamf_dbus_item_window_skeleton_dbus_interface_get_properties;
07342   skeleton_class->flush = bamf_dbus_item_window_skeleton_dbus_interface_flush;
07343   skeleton_class->get_vtable = bamf_dbus_item_window_skeleton_dbus_interface_get_vtable;
07344 }
07345 
07346 static void
07347 bamf_dbus_item_window_skeleton_iface_init (BamfDBusItemWindowIface *iface)
07348 {
07349   iface->monitor_changed = _bamf_dbus_item_window_on_signal_monitor_changed;
07350   iface->maximized_changed = _bamf_dbus_item_window_on_signal_maximized_changed;
07351 }
07352 
07360 BamfDBusItemWindow *
07361 bamf_dbus_item_window_skeleton_new (void)
07362 {
07363   return BAMF_DBUS_ITEM_WINDOW (g_object_new (BAMF_DBUS_ITEM_TYPE_WINDOW_SKELETON, NULL));
07364 }
07365 
07366 /* ------------------------------------------------------------------------
07367  * Code for interface org.ayatana.bamf.indicator
07368  * ------------------------------------------------------------------------
07369  */
07370 
07379 /* ---- Introspection data for org.ayatana.bamf.indicator ---- */
07380 
07381 static const _ExtendedGDBusArgInfo _bamf_dbus_item_indicator_method_info_path_OUT_ARG_path =
07382 {
07383   {
07384     -1,
07385     "path",
07386     "s",
07387     NULL
07388   },
07389   FALSE
07390 };
07391 
07392 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_indicator_method_info_path_OUT_ARG_pointers[] =
07393 {
07394   &_bamf_dbus_item_indicator_method_info_path_OUT_ARG_path,
07395   NULL
07396 };
07397 
07398 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_indicator_method_info_path =
07399 {
07400   {
07401     -1,
07402     "Path",
07403     NULL,
07404     (GDBusArgInfo **) &_bamf_dbus_item_indicator_method_info_path_OUT_ARG_pointers,
07405     NULL
07406   },
07407   "handle-path",
07408   FALSE
07409 };
07410 
07411 static const _ExtendedGDBusArgInfo _bamf_dbus_item_indicator_method_info_address_OUT_ARG_address =
07412 {
07413   {
07414     -1,
07415     "address",
07416     "s",
07417     NULL
07418   },
07419   FALSE
07420 };
07421 
07422 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_indicator_method_info_address_OUT_ARG_pointers[] =
07423 {
07424   &_bamf_dbus_item_indicator_method_info_address_OUT_ARG_address,
07425   NULL
07426 };
07427 
07428 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_indicator_method_info_address =
07429 {
07430   {
07431     -1,
07432     "Address",
07433     NULL,
07434     (GDBusArgInfo **) &_bamf_dbus_item_indicator_method_info_address_OUT_ARG_pointers,
07435     NULL
07436   },
07437   "handle-address",
07438   FALSE
07439 };
07440 
07441 static const _ExtendedGDBusMethodInfo * const _bamf_dbus_item_indicator_method_info_pointers[] =
07442 {
07443   &_bamf_dbus_item_indicator_method_info_path,
07444   &_bamf_dbus_item_indicator_method_info_address,
07445   NULL
07446 };
07447 
07448 static const _ExtendedGDBusInterfaceInfo _bamf_dbus_item_indicator_interface_info =
07449 {
07450   {
07451     -1,
07452     "org.ayatana.bamf.indicator",
07453     (GDBusMethodInfo **) &_bamf_dbus_item_indicator_method_info_pointers,
07454     NULL,
07455     NULL,
07456     NULL
07457   },
07458   "indicator",
07459 };
07460 
07461 
07469 GDBusInterfaceInfo *
07470 bamf_dbus_item_indicator_interface_info (void)
07471 {
07472   return (GDBusInterfaceInfo *) &_bamf_dbus_item_indicator_interface_info;
07473 }
07474 
07485 guint
07486 bamf_dbus_item_indicator_override_properties (GObjectClass *klass, guint property_id_begin)
07487 {
07488   return property_id_begin - 1;
07489 }
07490 
07491 
07492 
07508 static void
07509 bamf_dbus_item_indicator_default_init (BamfDBusItemIndicatorIface *iface)
07510 {
07511   /* GObject signals for incoming D-Bus method calls: */
07523   g_signal_new ("handle-path",
07524     G_TYPE_FROM_INTERFACE (iface),
07525     G_SIGNAL_RUN_LAST,
07526     G_STRUCT_OFFSET (BamfDBusItemIndicatorIface, handle_path),
07527     g_signal_accumulator_true_handled,
07528     NULL,
07529     g_cclosure_marshal_generic,
07530     G_TYPE_BOOLEAN,
07531     1,
07532     G_TYPE_DBUS_METHOD_INVOCATION);
07533 
07545   g_signal_new ("handle-address",
07546     G_TYPE_FROM_INTERFACE (iface),
07547     G_SIGNAL_RUN_LAST,
07548     G_STRUCT_OFFSET (BamfDBusItemIndicatorIface, handle_address),
07549     g_signal_accumulator_true_handled,
07550     NULL,
07551     g_cclosure_marshal_generic,
07552     G_TYPE_BOOLEAN,
07553     1,
07554     G_TYPE_DBUS_METHOD_INVOCATION);
07555 
07556 }
07557 
07558 typedef BamfDBusItemIndicatorIface BamfDBusItemIndicatorInterface;
07559 G_DEFINE_INTERFACE (BamfDBusItemIndicator, bamf_dbus_item_indicator, G_TYPE_OBJECT);
07560 
07574 void
07575 bamf_dbus_item_indicator_call_path (
07576     BamfDBusItemIndicator *proxy,
07577     GCancellable *cancellable,
07578     GAsyncReadyCallback callback,
07579     gpointer user_data)
07580 {
07581   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
07582     "Path",
07583     g_variant_new ("()"),
07584     G_DBUS_CALL_FLAGS_NONE,
07585     -1,
07586     cancellable,
07587     callback,
07588     user_data);
07589 }
07590 
07602 gboolean
07603 bamf_dbus_item_indicator_call_path_finish (
07604     BamfDBusItemIndicator *proxy,
07605     gchar **out_path,
07606     GAsyncResult *res,
07607     GError **error)
07608 {
07609   GVariant *_ret;
07610   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
07611   if (_ret == NULL)
07612     goto _out;
07613   g_variant_get (_ret,
07614                  "(s)",
07615                  out_path);
07616   g_variant_unref (_ret);
07617 _out:
07618   return _ret != NULL;
07619 }
07620 
07634 gboolean
07635 bamf_dbus_item_indicator_call_path_sync (
07636     BamfDBusItemIndicator *proxy,
07637     gchar **out_path,
07638     GCancellable *cancellable,
07639     GError **error)
07640 {
07641   GVariant *_ret;
07642   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
07643     "Path",
07644     g_variant_new ("()"),
07645     G_DBUS_CALL_FLAGS_NONE,
07646     -1,
07647     cancellable,
07648     error);
07649   if (_ret == NULL)
07650     goto _out;
07651   g_variant_get (_ret,
07652                  "(s)",
07653                  out_path);
07654   g_variant_unref (_ret);
07655 _out:
07656   return _ret != NULL;
07657 }
07658 
07672 void
07673 bamf_dbus_item_indicator_call_address (
07674     BamfDBusItemIndicator *proxy,
07675     GCancellable *cancellable,
07676     GAsyncReadyCallback callback,
07677     gpointer user_data)
07678 {
07679   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
07680     "Address",
07681     g_variant_new ("()"),
07682     G_DBUS_CALL_FLAGS_NONE,
07683     -1,
07684     cancellable,
07685     callback,
07686     user_data);
07687 }
07688 
07700 gboolean
07701 bamf_dbus_item_indicator_call_address_finish (
07702     BamfDBusItemIndicator *proxy,
07703     gchar **out_address,
07704     GAsyncResult *res,
07705     GError **error)
07706 {
07707   GVariant *_ret;
07708   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
07709   if (_ret == NULL)
07710     goto _out;
07711   g_variant_get (_ret,
07712                  "(s)",
07713                  out_address);
07714   g_variant_unref (_ret);
07715 _out:
07716   return _ret != NULL;
07717 }
07718 
07732 gboolean
07733 bamf_dbus_item_indicator_call_address_sync (
07734     BamfDBusItemIndicator *proxy,
07735     gchar **out_address,
07736     GCancellable *cancellable,
07737     GError **error)
07738 {
07739   GVariant *_ret;
07740   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
07741     "Address",
07742     g_variant_new ("()"),
07743     G_DBUS_CALL_FLAGS_NONE,
07744     -1,
07745     cancellable,
07746     error);
07747   if (_ret == NULL)
07748     goto _out;
07749   g_variant_get (_ret,
07750                  "(s)",
07751                  out_address);
07752   g_variant_unref (_ret);
07753 _out:
07754   return _ret != NULL;
07755 }
07756 
07767 void
07768 bamf_dbus_item_indicator_complete_path (
07769     BamfDBusItemIndicator *object,
07770     GDBusMethodInvocation *invocation,
07771     const gchar *path)
07772 {
07773   g_dbus_method_invocation_return_value (invocation,
07774     g_variant_new ("(s)",
07775                    path));
07776 }
07777 
07788 void
07789 bamf_dbus_item_indicator_complete_address (
07790     BamfDBusItemIndicator *object,
07791     GDBusMethodInvocation *invocation,
07792     const gchar *address)
07793 {
07794   g_dbus_method_invocation_return_value (invocation,
07795     g_variant_new ("(s)",
07796                    address));
07797 }
07798 
07799 /* ------------------------------------------------------------------------ */
07800 
07814 struct _BamfDBusItemIndicatorProxyPrivate
07815 {
07816   GData *qdata;
07817 };
07818 
07819 static void bamf_dbus_item_indicator_proxy_iface_init (BamfDBusItemIndicatorIface *iface);
07820 
07821 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemIndicatorProxy, bamf_dbus_item_indicator_proxy, G_TYPE_DBUS_PROXY,
07822                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_INDICATOR, bamf_dbus_item_indicator_proxy_iface_init));
07823 
07824 static void
07825 bamf_dbus_item_indicator_proxy_finalize (GObject *object)
07826 {
07827   BamfDBusItemIndicatorProxy *proxy = BAMF_DBUS_ITEM_INDICATOR_PROXY (object);
07828   g_datalist_clear (&proxy->priv->qdata);
07829   G_OBJECT_CLASS (bamf_dbus_item_indicator_proxy_parent_class)->finalize (object);
07830 }
07831 
07832 static void
07833 bamf_dbus_item_indicator_proxy_get_property (GObject      *object,
07834   guint         prop_id,
07835   GValue       *value,
07836   GParamSpec   *pspec)
07837 {
07838 }
07839 
07840 static void
07841 bamf_dbus_item_indicator_proxy_set_property (GObject      *object,
07842   guint         prop_id,
07843   const GValue *value,
07844   GParamSpec   *pspec)
07845 {
07846 }
07847 
07848 static void
07849 bamf_dbus_item_indicator_proxy_g_signal (GDBusProxy *proxy,
07850   const gchar *sender_name,
07851   const gchar *signal_name,
07852   GVariant *parameters)
07853 {
07854   _ExtendedGDBusSignalInfo *info;
07855   GVariantIter iter;
07856   GVariant *child;
07857   GValue *paramv;
07858   guint num_params;
07859   guint n;
07860   guint signal_id;
07861   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_bamf_dbus_item_indicator_interface_info, signal_name);
07862   if (info == NULL)
07863     return;
07864   num_params = g_variant_n_children (parameters);
07865   paramv = g_new0 (GValue, num_params + 1);
07866   g_value_init (&paramv[0], BAMF_DBUS_ITEM_TYPE_INDICATOR);
07867   g_value_set_object (&paramv[0], proxy);
07868   g_variant_iter_init (&iter, parameters);
07869   n = 1;
07870   while ((child = g_variant_iter_next_value (&iter)) != NULL)
07871     {
07872       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
07873       if (arg_info->use_gvariant)
07874         {
07875           g_value_init (&paramv[n], G_TYPE_VARIANT);
07876           g_value_set_variant (&paramv[n], child);
07877           n++;
07878         }
07879       else
07880         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
07881       g_variant_unref (child);
07882     }
07883   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_INDICATOR);
07884   g_signal_emitv (paramv, signal_id, 0, NULL);
07885   for (n = 0; n < num_params + 1; n++)
07886     g_value_unset (&paramv[n]);
07887   g_free (paramv);
07888 }
07889 
07890 static void
07891 bamf_dbus_item_indicator_proxy_g_properties_changed (GDBusProxy *_proxy,
07892   GVariant *changed_properties,
07893   const gchar *const *invalidated_properties)
07894 {
07895   BamfDBusItemIndicatorProxy *proxy = BAMF_DBUS_ITEM_INDICATOR_PROXY (_proxy);
07896   guint n;
07897   const gchar *key;
07898   GVariantIter *iter;
07899   _ExtendedGDBusPropertyInfo *info;
07900   g_variant_get (changed_properties, "a{sv}", &iter);
07901   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
07902     {
07903       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_indicator_interface_info, key);
07904       g_datalist_remove_data (&proxy->priv->qdata, key);
07905       if (info != NULL)
07906         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
07907     }
07908   g_variant_iter_free (iter);
07909   for (n = 0; invalidated_properties[n] != NULL; n++)
07910     {
07911       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_indicator_interface_info, invalidated_properties[n]);
07912       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
07913       if (info != NULL)
07914         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
07915     }
07916 }
07917 
07918 static void
07919 bamf_dbus_item_indicator_proxy_init (BamfDBusItemIndicatorProxy *proxy)
07920 {
07921   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, BAMF_DBUS_ITEM_TYPE_INDICATOR_PROXY, BamfDBusItemIndicatorProxyPrivate);
07922   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), bamf_dbus_item_indicator_interface_info ());
07923 }
07924 
07925 static void
07926 bamf_dbus_item_indicator_proxy_class_init (BamfDBusItemIndicatorProxyClass *klass)
07927 {
07928   GObjectClass *gobject_class;
07929   GDBusProxyClass *proxy_class;
07930 
07931   g_type_class_add_private (klass, sizeof (BamfDBusItemIndicatorProxyPrivate));
07932 
07933   gobject_class = G_OBJECT_CLASS (klass);
07934   gobject_class->finalize     = bamf_dbus_item_indicator_proxy_finalize;
07935   gobject_class->get_property = bamf_dbus_item_indicator_proxy_get_property;
07936   gobject_class->set_property = bamf_dbus_item_indicator_proxy_set_property;
07937 
07938   proxy_class = G_DBUS_PROXY_CLASS (klass);
07939   proxy_class->g_signal = bamf_dbus_item_indicator_proxy_g_signal;
07940   proxy_class->g_properties_changed = bamf_dbus_item_indicator_proxy_g_properties_changed;
07941 
07942 }
07943 
07944 static void
07945 bamf_dbus_item_indicator_proxy_iface_init (BamfDBusItemIndicatorIface *iface)
07946 {
07947 }
07948 
07966 void
07967 bamf_dbus_item_indicator_proxy_new (
07968     GDBusConnection     *connection,
07969     GDBusProxyFlags      flags,
07970     const gchar         *name,
07971     const gchar         *object_path,
07972     GCancellable        *cancellable,
07973     GAsyncReadyCallback  callback,
07974     gpointer             user_data)
07975 {
07976   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_INDICATOR_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.indicator", NULL);
07977 }
07978 
07988 BamfDBusItemIndicator *
07989 bamf_dbus_item_indicator_proxy_new_finish (
07990     GAsyncResult        *res,
07991     GError             **error)
07992 {
07993   GObject *ret;
07994   GObject *source_object;
07995   source_object = g_async_result_get_source_object (res);
07996   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
07997   g_object_unref (source_object);
07998   if (ret != NULL)
07999     return BAMF_DBUS_ITEM_INDICATOR (ret);
08000   else
08001     return NULL;
08002 }
08003 
08021 BamfDBusItemIndicator *
08022 bamf_dbus_item_indicator_proxy_new_sync (
08023     GDBusConnection     *connection,
08024     GDBusProxyFlags      flags,
08025     const gchar         *name,
08026     const gchar         *object_path,
08027     GCancellable        *cancellable,
08028     GError             **error)
08029 {
08030   GInitable *ret;
08031   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_INDICATOR_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.ayatana.bamf.indicator", NULL);
08032   if (ret != NULL)
08033     return BAMF_DBUS_ITEM_INDICATOR (ret);
08034   else
08035     return NULL;
08036 }
08037 
08038 
08056 void
08057 bamf_dbus_item_indicator_proxy_new_for_bus (
08058     GBusType             bus_type,
08059     GDBusProxyFlags      flags,
08060     const gchar         *name,
08061     const gchar         *object_path,
08062     GCancellable        *cancellable,
08063     GAsyncReadyCallback  callback,
08064     gpointer             user_data)
08065 {
08066   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_INDICATOR_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.indicator", NULL);
08067 }
08068 
08078 BamfDBusItemIndicator *
08079 bamf_dbus_item_indicator_proxy_new_for_bus_finish (
08080     GAsyncResult        *res,
08081     GError             **error)
08082 {
08083   GObject *ret;
08084   GObject *source_object;
08085   source_object = g_async_result_get_source_object (res);
08086   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
08087   g_object_unref (source_object);
08088   if (ret != NULL)
08089     return BAMF_DBUS_ITEM_INDICATOR (ret);
08090   else
08091     return NULL;
08092 }
08093 
08111 BamfDBusItemIndicator *
08112 bamf_dbus_item_indicator_proxy_new_for_bus_sync (
08113     GBusType             bus_type,
08114     GDBusProxyFlags      flags,
08115     const gchar         *name,
08116     const gchar         *object_path,
08117     GCancellable        *cancellable,
08118     GError             **error)
08119 {
08120   GInitable *ret;
08121   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_INDICATOR_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.indicator", NULL);
08122   if (ret != NULL)
08123     return BAMF_DBUS_ITEM_INDICATOR (ret);
08124   else
08125     return NULL;
08126 }
08127 
08128 
08129 /* ------------------------------------------------------------------------ */
08130 
08144 struct _BamfDBusItemIndicatorSkeletonPrivate
08145 {
08146   GValue *properties;
08147   GList *changed_properties;
08148   GSource *changed_properties_idle_source;
08149   GMainContext *context;
08150   GMutex lock;
08151 };
08152 
08153 static void
08154 _bamf_dbus_item_indicator_skeleton_handle_method_call (
08155   GDBusConnection *connection,
08156   const gchar *sender,
08157   const gchar *object_path,
08158   const gchar *interface_name,
08159   const gchar *method_name,
08160   GVariant *parameters,
08161   GDBusMethodInvocation *invocation,
08162   gpointer user_data)
08163 {
08164   BamfDBusItemIndicatorSkeleton *skeleton = BAMF_DBUS_ITEM_INDICATOR_SKELETON (user_data);
08165   _ExtendedGDBusMethodInfo *info;
08166   GVariantIter iter;
08167   GVariant *child;
08168   GValue *paramv;
08169   guint num_params;
08170   guint num_extra;
08171   guint n;
08172   guint signal_id;
08173   GValue return_value = G_VALUE_INIT;
08174   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
08175   g_assert (info != NULL);
08176   num_params = g_variant_n_children (parameters);
08177   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
08178   n = 0;
08179   g_value_init (&paramv[n], BAMF_DBUS_ITEM_TYPE_INDICATOR);
08180   g_value_set_object (&paramv[n++], skeleton);
08181   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
08182   g_value_set_object (&paramv[n++], invocation);
08183   if (info->pass_fdlist)
08184     {
08185 #ifdef G_OS_UNIX
08186       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
08187       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
08188 #else
08189       g_assert_not_reached ();
08190 #endif
08191     }
08192   g_variant_iter_init (&iter, parameters);
08193   while ((child = g_variant_iter_next_value (&iter)) != NULL)
08194     {
08195       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
08196       if (arg_info->use_gvariant)
08197         {
08198           g_value_init (&paramv[n], G_TYPE_VARIANT);
08199           g_value_set_variant (&paramv[n], child);
08200           n++;
08201         }
08202       else
08203         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
08204       g_variant_unref (child);
08205     }
08206   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_INDICATOR);
08207   g_value_init (&return_value, G_TYPE_BOOLEAN);
08208   g_signal_emitv (paramv, signal_id, 0, &return_value);
08209   if (!g_value_get_boolean (&return_value))
08210     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);
08211   g_value_unset (&return_value);
08212   for (n = 0; n < num_params + num_extra; n++)
08213     g_value_unset (&paramv[n]);
08214   g_free (paramv);
08215 }
08216 
08217 static GVariant *
08218 _bamf_dbus_item_indicator_skeleton_handle_get_property (
08219   GDBusConnection *connection,
08220   const gchar *sender,
08221   const gchar *object_path,
08222   const gchar *interface_name,
08223   const gchar *property_name,
08224   GError **error,
08225   gpointer user_data)
08226 {
08227   BamfDBusItemIndicatorSkeleton *skeleton = BAMF_DBUS_ITEM_INDICATOR_SKELETON (user_data);
08228   GValue value = G_VALUE_INIT;
08229   GParamSpec *pspec;
08230   _ExtendedGDBusPropertyInfo *info;
08231   GVariant *ret;
08232   ret = NULL;
08233   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_indicator_interface_info, property_name);
08234   g_assert (info != NULL);
08235   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
08236   if (pspec == NULL)
08237     {
08238       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
08239     }
08240   else
08241     {
08242       g_value_init (&value, pspec->value_type);
08243       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
08244       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
08245       g_value_unset (&value);
08246     }
08247   return ret;
08248 }
08249 
08250 static gboolean
08251 _bamf_dbus_item_indicator_skeleton_handle_set_property (
08252   GDBusConnection *connection,
08253   const gchar *sender,
08254   const gchar *object_path,
08255   const gchar *interface_name,
08256   const gchar *property_name,
08257   GVariant *variant,
08258   GError **error,
08259   gpointer user_data)
08260 {
08261   BamfDBusItemIndicatorSkeleton *skeleton = BAMF_DBUS_ITEM_INDICATOR_SKELETON (user_data);
08262   GValue value = G_VALUE_INIT;
08263   GParamSpec *pspec;
08264   _ExtendedGDBusPropertyInfo *info;
08265   gboolean ret;
08266   ret = FALSE;
08267   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_indicator_interface_info, property_name);
08268   g_assert (info != NULL);
08269   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
08270   if (pspec == NULL)
08271     {
08272       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
08273     }
08274   else
08275     {
08276       if (info->use_gvariant)
08277         g_value_set_variant (&value, variant);
08278       else
08279         g_dbus_gvariant_to_gvalue (variant, &value);
08280       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
08281       g_value_unset (&value);
08282       ret = TRUE;
08283     }
08284   return ret;
08285 }
08286 
08287 static const GDBusInterfaceVTable _bamf_dbus_item_indicator_skeleton_vtable =
08288 {
08289   _bamf_dbus_item_indicator_skeleton_handle_method_call,
08290   _bamf_dbus_item_indicator_skeleton_handle_get_property,
08291   _bamf_dbus_item_indicator_skeleton_handle_set_property
08292 };
08293 
08294 static GDBusInterfaceInfo *
08295 bamf_dbus_item_indicator_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
08296 {
08297   return bamf_dbus_item_indicator_interface_info ();
08298 }
08299 
08300 static GDBusInterfaceVTable *
08301 bamf_dbus_item_indicator_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
08302 {
08303   return (GDBusInterfaceVTable *) &_bamf_dbus_item_indicator_skeleton_vtable;
08304 }
08305 
08306 static GVariant *
08307 bamf_dbus_item_indicator_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
08308 {
08309   BamfDBusItemIndicatorSkeleton *skeleton = BAMF_DBUS_ITEM_INDICATOR_SKELETON (_skeleton);
08310 
08311   GVariantBuilder builder;
08312   guint n;
08313   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
08314   if (_bamf_dbus_item_indicator_interface_info.parent_struct.properties == NULL)
08315     goto out;
08316   for (n = 0; _bamf_dbus_item_indicator_interface_info.parent_struct.properties[n] != NULL; n++)
08317     {
08318       GDBusPropertyInfo *info = _bamf_dbus_item_indicator_interface_info.parent_struct.properties[n];
08319       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
08320         {
08321           GVariant *value;
08322           value = _bamf_dbus_item_indicator_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.indicator", info->name, NULL, skeleton);
08323           if (value != NULL)
08324             {
08325               g_variant_take_ref (value);
08326               g_variant_builder_add (&builder, "{sv}", info->name, value);
08327               g_variant_unref (value);
08328             }
08329         }
08330     }
08331 out:
08332   return g_variant_builder_end (&builder);
08333 }
08334 
08335 static void
08336 bamf_dbus_item_indicator_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
08337 {
08338 }
08339 
08340 static void bamf_dbus_item_indicator_skeleton_iface_init (BamfDBusItemIndicatorIface *iface);
08341 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemIndicatorSkeleton, bamf_dbus_item_indicator_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
08342                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_INDICATOR, bamf_dbus_item_indicator_skeleton_iface_init));
08343 
08344 static void
08345 bamf_dbus_item_indicator_skeleton_finalize (GObject *object)
08346 {
08347   BamfDBusItemIndicatorSkeleton *skeleton = BAMF_DBUS_ITEM_INDICATOR_SKELETON (object);
08348   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
08349   if (skeleton->priv->changed_properties_idle_source != NULL)
08350     g_source_destroy (skeleton->priv->changed_properties_idle_source);
08351   g_main_context_unref (skeleton->priv->context);
08352   g_mutex_clear (&skeleton->priv->lock);
08353   G_OBJECT_CLASS (bamf_dbus_item_indicator_skeleton_parent_class)->finalize (object);
08354 }
08355 
08356 static void
08357 bamf_dbus_item_indicator_skeleton_init (BamfDBusItemIndicatorSkeleton *skeleton)
08358 {
08359   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, BAMF_DBUS_ITEM_TYPE_INDICATOR_SKELETON, BamfDBusItemIndicatorSkeletonPrivate);
08360   g_mutex_init (&skeleton->priv->lock);
08361   skeleton->priv->context = g_main_context_ref_thread_default ();
08362 }
08363 
08364 static void
08365 bamf_dbus_item_indicator_skeleton_class_init (BamfDBusItemIndicatorSkeletonClass *klass)
08366 {
08367   GObjectClass *gobject_class;
08368   GDBusInterfaceSkeletonClass *skeleton_class;
08369 
08370   g_type_class_add_private (klass, sizeof (BamfDBusItemIndicatorSkeletonPrivate));
08371 
08372   gobject_class = G_OBJECT_CLASS (klass);
08373   gobject_class->finalize = bamf_dbus_item_indicator_skeleton_finalize;
08374 
08375   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
08376   skeleton_class->get_info = bamf_dbus_item_indicator_skeleton_dbus_interface_get_info;
08377   skeleton_class->get_properties = bamf_dbus_item_indicator_skeleton_dbus_interface_get_properties;
08378   skeleton_class->flush = bamf_dbus_item_indicator_skeleton_dbus_interface_flush;
08379   skeleton_class->get_vtable = bamf_dbus_item_indicator_skeleton_dbus_interface_get_vtable;
08380 }
08381 
08382 static void
08383 bamf_dbus_item_indicator_skeleton_iface_init (BamfDBusItemIndicatorIface *iface)
08384 {
08385 }
08386 
08394 BamfDBusItemIndicator *
08395 bamf_dbus_item_indicator_skeleton_new (void)
08396 {
08397   return BAMF_DBUS_ITEM_INDICATOR (g_object_new (BAMF_DBUS_ITEM_TYPE_INDICATOR_SKELETON, NULL));
08398 }
08399 
08400 /* ------------------------------------------------------------------------
08401  * Code for interface org.ayatana.bamf.tab
08402  * ------------------------------------------------------------------------
08403  */
08404 
08413 /* ---- Introspection data for org.ayatana.bamf.tab ---- */
08414 
08415 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_tab_method_info_show_tab =
08416 {
08417   {
08418     -1,
08419     "ShowTab",
08420     NULL,
08421     NULL,
08422     NULL
08423   },
08424   "handle-show-tab",
08425   FALSE
08426 };
08427 
08428 static const _ExtendedGDBusArgInfo _bamf_dbus_item_tab_method_info_parent_xid_OUT_ARG_xid =
08429 {
08430   {
08431     -1,
08432     "xid",
08433     "u",
08434     NULL
08435   },
08436   FALSE
08437 };
08438 
08439 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_tab_method_info_parent_xid_OUT_ARG_pointers[] =
08440 {
08441   &_bamf_dbus_item_tab_method_info_parent_xid_OUT_ARG_xid,
08442   NULL
08443 };
08444 
08445 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_tab_method_info_parent_xid =
08446 {
08447   {
08448     -1,
08449     "ParentXid",
08450     NULL,
08451     (GDBusArgInfo **) &_bamf_dbus_item_tab_method_info_parent_xid_OUT_ARG_pointers,
08452     NULL
08453   },
08454   "handle-parent-xid",
08455   FALSE
08456 };
08457 
08458 static const _ExtendedGDBusArgInfo _bamf_dbus_item_tab_method_info_current_uri_OUT_ARG_uri =
08459 {
08460   {
08461     -1,
08462     "uri",
08463     "s",
08464     NULL
08465   },
08466   FALSE
08467 };
08468 
08469 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_tab_method_info_current_uri_OUT_ARG_pointers[] =
08470 {
08471   &_bamf_dbus_item_tab_method_info_current_uri_OUT_ARG_uri,
08472   NULL
08473 };
08474 
08475 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_tab_method_info_current_uri =
08476 {
08477   {
08478     -1,
08479     "CurrentUri",
08480     NULL,
08481     (GDBusArgInfo **) &_bamf_dbus_item_tab_method_info_current_uri_OUT_ARG_pointers,
08482     NULL
08483   },
08484   "handle-current-uri",
08485   FALSE
08486 };
08487 
08488 static const _ExtendedGDBusArgInfo _bamf_dbus_item_tab_method_info_preview_OUT_ARG_data =
08489 {
08490   {
08491     -1,
08492     "data",
08493     "ay",
08494     NULL
08495   },
08496   FALSE
08497 };
08498 
08499 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_tab_method_info_preview_OUT_ARG_pointers[] =
08500 {
08501   &_bamf_dbus_item_tab_method_info_preview_OUT_ARG_data,
08502   NULL
08503 };
08504 
08505 static const _ExtendedGDBusMethodInfo _bamf_dbus_item_tab_method_info_preview =
08506 {
08507   {
08508     -1,
08509     "Preview",
08510     NULL,
08511     (GDBusArgInfo **) &_bamf_dbus_item_tab_method_info_preview_OUT_ARG_pointers,
08512     NULL
08513   },
08514   "handle-preview",
08515   FALSE
08516 };
08517 
08518 static const _ExtendedGDBusMethodInfo * const _bamf_dbus_item_tab_method_info_pointers[] =
08519 {
08520   &_bamf_dbus_item_tab_method_info_show_tab,
08521   &_bamf_dbus_item_tab_method_info_parent_xid,
08522   &_bamf_dbus_item_tab_method_info_current_uri,
08523   &_bamf_dbus_item_tab_method_info_preview,
08524   NULL
08525 };
08526 
08527 static const _ExtendedGDBusArgInfo _bamf_dbus_item_tab_signal_info_uri_changed_ARG_old =
08528 {
08529   {
08530     -1,
08531     "old",
08532     "s",
08533     NULL
08534   },
08535   FALSE
08536 };
08537 
08538 static const _ExtendedGDBusArgInfo _bamf_dbus_item_tab_signal_info_uri_changed_ARG_new =
08539 {
08540   {
08541     -1,
08542     "new",
08543     "s",
08544     NULL
08545   },
08546   FALSE
08547 };
08548 
08549 static const _ExtendedGDBusArgInfo * const _bamf_dbus_item_tab_signal_info_uri_changed_ARG_pointers[] =
08550 {
08551   &_bamf_dbus_item_tab_signal_info_uri_changed_ARG_old,
08552   &_bamf_dbus_item_tab_signal_info_uri_changed_ARG_new,
08553   NULL
08554 };
08555 
08556 static const _ExtendedGDBusSignalInfo _bamf_dbus_item_tab_signal_info_uri_changed =
08557 {
08558   {
08559     -1,
08560     "UriChanged",
08561     (GDBusArgInfo **) &_bamf_dbus_item_tab_signal_info_uri_changed_ARG_pointers,
08562     NULL
08563   },
08564   "uri-changed"
08565 };
08566 
08567 static const _ExtendedGDBusSignalInfo * const _bamf_dbus_item_tab_signal_info_pointers[] =
08568 {
08569   &_bamf_dbus_item_tab_signal_info_uri_changed,
08570   NULL
08571 };
08572 
08573 static const _ExtendedGDBusInterfaceInfo _bamf_dbus_item_tab_interface_info =
08574 {
08575   {
08576     -1,
08577     "org.ayatana.bamf.tab",
08578     (GDBusMethodInfo **) &_bamf_dbus_item_tab_method_info_pointers,
08579     (GDBusSignalInfo **) &_bamf_dbus_item_tab_signal_info_pointers,
08580     NULL,
08581     NULL
08582   },
08583   "tab",
08584 };
08585 
08586 
08594 GDBusInterfaceInfo *
08595 bamf_dbus_item_tab_interface_info (void)
08596 {
08597   return (GDBusInterfaceInfo *) &_bamf_dbus_item_tab_interface_info;
08598 }
08599 
08610 guint
08611 bamf_dbus_item_tab_override_properties (GObjectClass *klass, guint property_id_begin)
08612 {
08613   return property_id_begin - 1;
08614 }
08615 
08616 
08617 
08636 static void
08637 bamf_dbus_item_tab_default_init (BamfDBusItemTabIface *iface)
08638 {
08639   /* GObject signals for incoming D-Bus method calls: */
08651   g_signal_new ("handle-show-tab",
08652     G_TYPE_FROM_INTERFACE (iface),
08653     G_SIGNAL_RUN_LAST,
08654     G_STRUCT_OFFSET (BamfDBusItemTabIface, handle_show_tab),
08655     g_signal_accumulator_true_handled,
08656     NULL,
08657     g_cclosure_marshal_generic,
08658     G_TYPE_BOOLEAN,
08659     1,
08660     G_TYPE_DBUS_METHOD_INVOCATION);
08661 
08673   g_signal_new ("handle-parent-xid",
08674     G_TYPE_FROM_INTERFACE (iface),
08675     G_SIGNAL_RUN_LAST,
08676     G_STRUCT_OFFSET (BamfDBusItemTabIface, handle_parent_xid),
08677     g_signal_accumulator_true_handled,
08678     NULL,
08679     g_cclosure_marshal_generic,
08680     G_TYPE_BOOLEAN,
08681     1,
08682     G_TYPE_DBUS_METHOD_INVOCATION);
08683 
08695   g_signal_new ("handle-current-uri",
08696     G_TYPE_FROM_INTERFACE (iface),
08697     G_SIGNAL_RUN_LAST,
08698     G_STRUCT_OFFSET (BamfDBusItemTabIface, handle_current_uri),
08699     g_signal_accumulator_true_handled,
08700     NULL,
08701     g_cclosure_marshal_generic,
08702     G_TYPE_BOOLEAN,
08703     1,
08704     G_TYPE_DBUS_METHOD_INVOCATION);
08705 
08717   g_signal_new ("handle-preview",
08718     G_TYPE_FROM_INTERFACE (iface),
08719     G_SIGNAL_RUN_LAST,
08720     G_STRUCT_OFFSET (BamfDBusItemTabIface, handle_preview),
08721     g_signal_accumulator_true_handled,
08722     NULL,
08723     g_cclosure_marshal_generic,
08724     G_TYPE_BOOLEAN,
08725     1,
08726     G_TYPE_DBUS_METHOD_INVOCATION);
08727 
08728   /* GObject signals for received D-Bus signals: */
08739   g_signal_new ("uri-changed",
08740     G_TYPE_FROM_INTERFACE (iface),
08741     G_SIGNAL_RUN_LAST,
08742     G_STRUCT_OFFSET (BamfDBusItemTabIface, uri_changed),
08743     NULL,
08744     NULL,
08745     g_cclosure_marshal_generic,
08746     G_TYPE_NONE,
08747     2, G_TYPE_STRING, G_TYPE_STRING);
08748 
08749 }
08750 
08751 typedef BamfDBusItemTabIface BamfDBusItemTabInterface;
08752 G_DEFINE_INTERFACE (BamfDBusItemTab, bamf_dbus_item_tab, G_TYPE_OBJECT);
08753 
08762 void
08763 bamf_dbus_item_tab_emit_uri_changed (
08764     BamfDBusItemTab *object,
08765     const gchar *arg_old,
08766     const gchar *arg_new)
08767 {
08768   g_signal_emit_by_name (object, "uri-changed", arg_old, arg_new);
08769 }
08770 
08784 void
08785 bamf_dbus_item_tab_call_show_tab (
08786     BamfDBusItemTab *proxy,
08787     GCancellable *cancellable,
08788     GAsyncReadyCallback callback,
08789     gpointer user_data)
08790 {
08791   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
08792     "ShowTab",
08793     g_variant_new ("()"),
08794     G_DBUS_CALL_FLAGS_NONE,
08795     -1,
08796     cancellable,
08797     callback,
08798     user_data);
08799 }
08800 
08811 gboolean
08812 bamf_dbus_item_tab_call_show_tab_finish (
08813     BamfDBusItemTab *proxy,
08814     GAsyncResult *res,
08815     GError **error)
08816 {
08817   GVariant *_ret;
08818   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
08819   if (_ret == NULL)
08820     goto _out;
08821   g_variant_get (_ret,
08822                  "()");
08823   g_variant_unref (_ret);
08824 _out:
08825   return _ret != NULL;
08826 }
08827 
08840 gboolean
08841 bamf_dbus_item_tab_call_show_tab_sync (
08842     BamfDBusItemTab *proxy,
08843     GCancellable *cancellable,
08844     GError **error)
08845 {
08846   GVariant *_ret;
08847   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
08848     "ShowTab",
08849     g_variant_new ("()"),
08850     G_DBUS_CALL_FLAGS_NONE,
08851     -1,
08852     cancellable,
08853     error);
08854   if (_ret == NULL)
08855     goto _out;
08856   g_variant_get (_ret,
08857                  "()");
08858   g_variant_unref (_ret);
08859 _out:
08860   return _ret != NULL;
08861 }
08862 
08876 void
08877 bamf_dbus_item_tab_call_parent_xid (
08878     BamfDBusItemTab *proxy,
08879     GCancellable *cancellable,
08880     GAsyncReadyCallback callback,
08881     gpointer user_data)
08882 {
08883   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
08884     "ParentXid",
08885     g_variant_new ("()"),
08886     G_DBUS_CALL_FLAGS_NONE,
08887     -1,
08888     cancellable,
08889     callback,
08890     user_data);
08891 }
08892 
08904 gboolean
08905 bamf_dbus_item_tab_call_parent_xid_finish (
08906     BamfDBusItemTab *proxy,
08907     guint *out_xid,
08908     GAsyncResult *res,
08909     GError **error)
08910 {
08911   GVariant *_ret;
08912   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
08913   if (_ret == NULL)
08914     goto _out;
08915   g_variant_get (_ret,
08916                  "(u)",
08917                  out_xid);
08918   g_variant_unref (_ret);
08919 _out:
08920   return _ret != NULL;
08921 }
08922 
08936 gboolean
08937 bamf_dbus_item_tab_call_parent_xid_sync (
08938     BamfDBusItemTab *proxy,
08939     guint *out_xid,
08940     GCancellable *cancellable,
08941     GError **error)
08942 {
08943   GVariant *_ret;
08944   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
08945     "ParentXid",
08946     g_variant_new ("()"),
08947     G_DBUS_CALL_FLAGS_NONE,
08948     -1,
08949     cancellable,
08950     error);
08951   if (_ret == NULL)
08952     goto _out;
08953   g_variant_get (_ret,
08954                  "(u)",
08955                  out_xid);
08956   g_variant_unref (_ret);
08957 _out:
08958   return _ret != NULL;
08959 }
08960 
08974 void
08975 bamf_dbus_item_tab_call_current_uri (
08976     BamfDBusItemTab *proxy,
08977     GCancellable *cancellable,
08978     GAsyncReadyCallback callback,
08979     gpointer user_data)
08980 {
08981   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
08982     "CurrentUri",
08983     g_variant_new ("()"),
08984     G_DBUS_CALL_FLAGS_NONE,
08985     -1,
08986     cancellable,
08987     callback,
08988     user_data);
08989 }
08990 
09002 gboolean
09003 bamf_dbus_item_tab_call_current_uri_finish (
09004     BamfDBusItemTab *proxy,
09005     gchar **out_uri,
09006     GAsyncResult *res,
09007     GError **error)
09008 {
09009   GVariant *_ret;
09010   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
09011   if (_ret == NULL)
09012     goto _out;
09013   g_variant_get (_ret,
09014                  "(s)",
09015                  out_uri);
09016   g_variant_unref (_ret);
09017 _out:
09018   return _ret != NULL;
09019 }
09020 
09034 gboolean
09035 bamf_dbus_item_tab_call_current_uri_sync (
09036     BamfDBusItemTab *proxy,
09037     gchar **out_uri,
09038     GCancellable *cancellable,
09039     GError **error)
09040 {
09041   GVariant *_ret;
09042   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
09043     "CurrentUri",
09044     g_variant_new ("()"),
09045     G_DBUS_CALL_FLAGS_NONE,
09046     -1,
09047     cancellable,
09048     error);
09049   if (_ret == NULL)
09050     goto _out;
09051   g_variant_get (_ret,
09052                  "(s)",
09053                  out_uri);
09054   g_variant_unref (_ret);
09055 _out:
09056   return _ret != NULL;
09057 }
09058 
09072 void
09073 bamf_dbus_item_tab_call_preview (
09074     BamfDBusItemTab *proxy,
09075     GCancellable *cancellable,
09076     GAsyncReadyCallback callback,
09077     gpointer user_data)
09078 {
09079   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
09080     "Preview",
09081     g_variant_new ("()"),
09082     G_DBUS_CALL_FLAGS_NONE,
09083     -1,
09084     cancellable,
09085     callback,
09086     user_data);
09087 }
09088 
09100 gboolean
09101 bamf_dbus_item_tab_call_preview_finish (
09102     BamfDBusItemTab *proxy,
09103     gchar **out_data,
09104     GAsyncResult *res,
09105     GError **error)
09106 {
09107   GVariant *_ret;
09108   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
09109   if (_ret == NULL)
09110     goto _out;
09111   g_variant_get (_ret,
09112                  "(^ay)",
09113                  out_data);
09114   g_variant_unref (_ret);
09115 _out:
09116   return _ret != NULL;
09117 }
09118 
09132 gboolean
09133 bamf_dbus_item_tab_call_preview_sync (
09134     BamfDBusItemTab *proxy,
09135     gchar **out_data,
09136     GCancellable *cancellable,
09137     GError **error)
09138 {
09139   GVariant *_ret;
09140   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
09141     "Preview",
09142     g_variant_new ("()"),
09143     G_DBUS_CALL_FLAGS_NONE,
09144     -1,
09145     cancellable,
09146     error);
09147   if (_ret == NULL)
09148     goto _out;
09149   g_variant_get (_ret,
09150                  "(^ay)",
09151                  out_data);
09152   g_variant_unref (_ret);
09153 _out:
09154   return _ret != NULL;
09155 }
09156 
09166 void
09167 bamf_dbus_item_tab_complete_show_tab (
09168     BamfDBusItemTab *object,
09169     GDBusMethodInvocation *invocation)
09170 {
09171   g_dbus_method_invocation_return_value (invocation,
09172     g_variant_new ("()"));
09173 }
09174 
09185 void
09186 bamf_dbus_item_tab_complete_parent_xid (
09187     BamfDBusItemTab *object,
09188     GDBusMethodInvocation *invocation,
09189     guint xid)
09190 {
09191   g_dbus_method_invocation_return_value (invocation,
09192     g_variant_new ("(u)",
09193                    xid));
09194 }
09195 
09206 void
09207 bamf_dbus_item_tab_complete_current_uri (
09208     BamfDBusItemTab *object,
09209     GDBusMethodInvocation *invocation,
09210     const gchar *uri)
09211 {
09212   g_dbus_method_invocation_return_value (invocation,
09213     g_variant_new ("(s)",
09214                    uri));
09215 }
09216 
09227 void
09228 bamf_dbus_item_tab_complete_preview (
09229     BamfDBusItemTab *object,
09230     GDBusMethodInvocation *invocation,
09231     const gchar *data)
09232 {
09233   g_dbus_method_invocation_return_value (invocation,
09234     g_variant_new ("(^ay)",
09235                    data));
09236 }
09237 
09238 /* ------------------------------------------------------------------------ */
09239 
09253 struct _BamfDBusItemTabProxyPrivate
09254 {
09255   GData *qdata;
09256 };
09257 
09258 static void bamf_dbus_item_tab_proxy_iface_init (BamfDBusItemTabIface *iface);
09259 
09260 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemTabProxy, bamf_dbus_item_tab_proxy, G_TYPE_DBUS_PROXY,
09261                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_TAB, bamf_dbus_item_tab_proxy_iface_init));
09262 
09263 static void
09264 bamf_dbus_item_tab_proxy_finalize (GObject *object)
09265 {
09266   BamfDBusItemTabProxy *proxy = BAMF_DBUS_ITEM_TAB_PROXY (object);
09267   g_datalist_clear (&proxy->priv->qdata);
09268   G_OBJECT_CLASS (bamf_dbus_item_tab_proxy_parent_class)->finalize (object);
09269 }
09270 
09271 static void
09272 bamf_dbus_item_tab_proxy_get_property (GObject      *object,
09273   guint         prop_id,
09274   GValue       *value,
09275   GParamSpec   *pspec)
09276 {
09277 }
09278 
09279 static void
09280 bamf_dbus_item_tab_proxy_set_property (GObject      *object,
09281   guint         prop_id,
09282   const GValue *value,
09283   GParamSpec   *pspec)
09284 {
09285 }
09286 
09287 static void
09288 bamf_dbus_item_tab_proxy_g_signal (GDBusProxy *proxy,
09289   const gchar *sender_name,
09290   const gchar *signal_name,
09291   GVariant *parameters)
09292 {
09293   _ExtendedGDBusSignalInfo *info;
09294   GVariantIter iter;
09295   GVariant *child;
09296   GValue *paramv;
09297   guint num_params;
09298   guint n;
09299   guint signal_id;
09300   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_bamf_dbus_item_tab_interface_info, signal_name);
09301   if (info == NULL)
09302     return;
09303   num_params = g_variant_n_children (parameters);
09304   paramv = g_new0 (GValue, num_params + 1);
09305   g_value_init (&paramv[0], BAMF_DBUS_ITEM_TYPE_TAB);
09306   g_value_set_object (&paramv[0], proxy);
09307   g_variant_iter_init (&iter, parameters);
09308   n = 1;
09309   while ((child = g_variant_iter_next_value (&iter)) != NULL)
09310     {
09311       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
09312       if (arg_info->use_gvariant)
09313         {
09314           g_value_init (&paramv[n], G_TYPE_VARIANT);
09315           g_value_set_variant (&paramv[n], child);
09316           n++;
09317         }
09318       else
09319         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
09320       g_variant_unref (child);
09321     }
09322   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_TAB);
09323   g_signal_emitv (paramv, signal_id, 0, NULL);
09324   for (n = 0; n < num_params + 1; n++)
09325     g_value_unset (&paramv[n]);
09326   g_free (paramv);
09327 }
09328 
09329 static void
09330 bamf_dbus_item_tab_proxy_g_properties_changed (GDBusProxy *_proxy,
09331   GVariant *changed_properties,
09332   const gchar *const *invalidated_properties)
09333 {
09334   BamfDBusItemTabProxy *proxy = BAMF_DBUS_ITEM_TAB_PROXY (_proxy);
09335   guint n;
09336   const gchar *key;
09337   GVariantIter *iter;
09338   _ExtendedGDBusPropertyInfo *info;
09339   g_variant_get (changed_properties, "a{sv}", &iter);
09340   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
09341     {
09342       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_tab_interface_info, key);
09343       g_datalist_remove_data (&proxy->priv->qdata, key);
09344       if (info != NULL)
09345         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
09346     }
09347   g_variant_iter_free (iter);
09348   for (n = 0; invalidated_properties[n] != NULL; n++)
09349     {
09350       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_tab_interface_info, invalidated_properties[n]);
09351       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
09352       if (info != NULL)
09353         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
09354     }
09355 }
09356 
09357 static void
09358 bamf_dbus_item_tab_proxy_init (BamfDBusItemTabProxy *proxy)
09359 {
09360   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, BAMF_DBUS_ITEM_TYPE_TAB_PROXY, BamfDBusItemTabProxyPrivate);
09361   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), bamf_dbus_item_tab_interface_info ());
09362 }
09363 
09364 static void
09365 bamf_dbus_item_tab_proxy_class_init (BamfDBusItemTabProxyClass *klass)
09366 {
09367   GObjectClass *gobject_class;
09368   GDBusProxyClass *proxy_class;
09369 
09370   g_type_class_add_private (klass, sizeof (BamfDBusItemTabProxyPrivate));
09371 
09372   gobject_class = G_OBJECT_CLASS (klass);
09373   gobject_class->finalize     = bamf_dbus_item_tab_proxy_finalize;
09374   gobject_class->get_property = bamf_dbus_item_tab_proxy_get_property;
09375   gobject_class->set_property = bamf_dbus_item_tab_proxy_set_property;
09376 
09377   proxy_class = G_DBUS_PROXY_CLASS (klass);
09378   proxy_class->g_signal = bamf_dbus_item_tab_proxy_g_signal;
09379   proxy_class->g_properties_changed = bamf_dbus_item_tab_proxy_g_properties_changed;
09380 
09381 }
09382 
09383 static void
09384 bamf_dbus_item_tab_proxy_iface_init (BamfDBusItemTabIface *iface)
09385 {
09386 }
09387 
09405 void
09406 bamf_dbus_item_tab_proxy_new (
09407     GDBusConnection     *connection,
09408     GDBusProxyFlags      flags,
09409     const gchar         *name,
09410     const gchar         *object_path,
09411     GCancellable        *cancellable,
09412     GAsyncReadyCallback  callback,
09413     gpointer             user_data)
09414 {
09415   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_TAB_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.tab", NULL);
09416 }
09417 
09427 BamfDBusItemTab *
09428 bamf_dbus_item_tab_proxy_new_finish (
09429     GAsyncResult        *res,
09430     GError             **error)
09431 {
09432   GObject *ret;
09433   GObject *source_object;
09434   source_object = g_async_result_get_source_object (res);
09435   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
09436   g_object_unref (source_object);
09437   if (ret != NULL)
09438     return BAMF_DBUS_ITEM_TAB (ret);
09439   else
09440     return NULL;
09441 }
09442 
09460 BamfDBusItemTab *
09461 bamf_dbus_item_tab_proxy_new_sync (
09462     GDBusConnection     *connection,
09463     GDBusProxyFlags      flags,
09464     const gchar         *name,
09465     const gchar         *object_path,
09466     GCancellable        *cancellable,
09467     GError             **error)
09468 {
09469   GInitable *ret;
09470   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_TAB_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.ayatana.bamf.tab", NULL);
09471   if (ret != NULL)
09472     return BAMF_DBUS_ITEM_TAB (ret);
09473   else
09474     return NULL;
09475 }
09476 
09477 
09495 void
09496 bamf_dbus_item_tab_proxy_new_for_bus (
09497     GBusType             bus_type,
09498     GDBusProxyFlags      flags,
09499     const gchar         *name,
09500     const gchar         *object_path,
09501     GCancellable        *cancellable,
09502     GAsyncReadyCallback  callback,
09503     gpointer             user_data)
09504 {
09505   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_TAB_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.tab", NULL);
09506 }
09507 
09517 BamfDBusItemTab *
09518 bamf_dbus_item_tab_proxy_new_for_bus_finish (
09519     GAsyncResult        *res,
09520     GError             **error)
09521 {
09522   GObject *ret;
09523   GObject *source_object;
09524   source_object = g_async_result_get_source_object (res);
09525   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
09526   g_object_unref (source_object);
09527   if (ret != NULL)
09528     return BAMF_DBUS_ITEM_TAB (ret);
09529   else
09530     return NULL;
09531 }
09532 
09550 BamfDBusItemTab *
09551 bamf_dbus_item_tab_proxy_new_for_bus_sync (
09552     GBusType             bus_type,
09553     GDBusProxyFlags      flags,
09554     const gchar         *name,
09555     const gchar         *object_path,
09556     GCancellable        *cancellable,
09557     GError             **error)
09558 {
09559   GInitable *ret;
09560   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_TAB_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.tab", NULL);
09561   if (ret != NULL)
09562     return BAMF_DBUS_ITEM_TAB (ret);
09563   else
09564     return NULL;
09565 }
09566 
09567 
09568 /* ------------------------------------------------------------------------ */
09569 
09583 struct _BamfDBusItemTabSkeletonPrivate
09584 {
09585   GValue *properties;
09586   GList *changed_properties;
09587   GSource *changed_properties_idle_source;
09588   GMainContext *context;
09589   GMutex lock;
09590 };
09591 
09592 static void
09593 _bamf_dbus_item_tab_skeleton_handle_method_call (
09594   GDBusConnection *connection,
09595   const gchar *sender,
09596   const gchar *object_path,
09597   const gchar *interface_name,
09598   const gchar *method_name,
09599   GVariant *parameters,
09600   GDBusMethodInvocation *invocation,
09601   gpointer user_data)
09602 {
09603   BamfDBusItemTabSkeleton *skeleton = BAMF_DBUS_ITEM_TAB_SKELETON (user_data);
09604   _ExtendedGDBusMethodInfo *info;
09605   GVariantIter iter;
09606   GVariant *child;
09607   GValue *paramv;
09608   guint num_params;
09609   guint num_extra;
09610   guint n;
09611   guint signal_id;
09612   GValue return_value = G_VALUE_INIT;
09613   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
09614   g_assert (info != NULL);
09615   num_params = g_variant_n_children (parameters);
09616   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
09617   n = 0;
09618   g_value_init (&paramv[n], BAMF_DBUS_ITEM_TYPE_TAB);
09619   g_value_set_object (&paramv[n++], skeleton);
09620   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
09621   g_value_set_object (&paramv[n++], invocation);
09622   if (info->pass_fdlist)
09623     {
09624 #ifdef G_OS_UNIX
09625       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
09626       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
09627 #else
09628       g_assert_not_reached ();
09629 #endif
09630     }
09631   g_variant_iter_init (&iter, parameters);
09632   while ((child = g_variant_iter_next_value (&iter)) != NULL)
09633     {
09634       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
09635       if (arg_info->use_gvariant)
09636         {
09637           g_value_init (&paramv[n], G_TYPE_VARIANT);
09638           g_value_set_variant (&paramv[n], child);
09639           n++;
09640         }
09641       else
09642         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
09643       g_variant_unref (child);
09644     }
09645   signal_id = g_signal_lookup (info->signal_name, BAMF_DBUS_ITEM_TYPE_TAB);
09646   g_value_init (&return_value, G_TYPE_BOOLEAN);
09647   g_signal_emitv (paramv, signal_id, 0, &return_value);
09648   if (!g_value_get_boolean (&return_value))
09649     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);
09650   g_value_unset (&return_value);
09651   for (n = 0; n < num_params + num_extra; n++)
09652     g_value_unset (&paramv[n]);
09653   g_free (paramv);
09654 }
09655 
09656 static GVariant *
09657 _bamf_dbus_item_tab_skeleton_handle_get_property (
09658   GDBusConnection *connection,
09659   const gchar *sender,
09660   const gchar *object_path,
09661   const gchar *interface_name,
09662   const gchar *property_name,
09663   GError **error,
09664   gpointer user_data)
09665 {
09666   BamfDBusItemTabSkeleton *skeleton = BAMF_DBUS_ITEM_TAB_SKELETON (user_data);
09667   GValue value = G_VALUE_INIT;
09668   GParamSpec *pspec;
09669   _ExtendedGDBusPropertyInfo *info;
09670   GVariant *ret;
09671   ret = NULL;
09672   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_tab_interface_info, property_name);
09673   g_assert (info != NULL);
09674   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
09675   if (pspec == NULL)
09676     {
09677       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
09678     }
09679   else
09680     {
09681       g_value_init (&value, pspec->value_type);
09682       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
09683       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
09684       g_value_unset (&value);
09685     }
09686   return ret;
09687 }
09688 
09689 static gboolean
09690 _bamf_dbus_item_tab_skeleton_handle_set_property (
09691   GDBusConnection *connection,
09692   const gchar *sender,
09693   const gchar *object_path,
09694   const gchar *interface_name,
09695   const gchar *property_name,
09696   GVariant *variant,
09697   GError **error,
09698   gpointer user_data)
09699 {
09700   BamfDBusItemTabSkeleton *skeleton = BAMF_DBUS_ITEM_TAB_SKELETON (user_data);
09701   GValue value = G_VALUE_INIT;
09702   GParamSpec *pspec;
09703   _ExtendedGDBusPropertyInfo *info;
09704   gboolean ret;
09705   ret = FALSE;
09706   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_bamf_dbus_item_tab_interface_info, property_name);
09707   g_assert (info != NULL);
09708   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
09709   if (pspec == NULL)
09710     {
09711       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
09712     }
09713   else
09714     {
09715       if (info->use_gvariant)
09716         g_value_set_variant (&value, variant);
09717       else
09718         g_dbus_gvariant_to_gvalue (variant, &value);
09719       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
09720       g_value_unset (&value);
09721       ret = TRUE;
09722     }
09723   return ret;
09724 }
09725 
09726 static const GDBusInterfaceVTable _bamf_dbus_item_tab_skeleton_vtable =
09727 {
09728   _bamf_dbus_item_tab_skeleton_handle_method_call,
09729   _bamf_dbus_item_tab_skeleton_handle_get_property,
09730   _bamf_dbus_item_tab_skeleton_handle_set_property
09731 };
09732 
09733 static GDBusInterfaceInfo *
09734 bamf_dbus_item_tab_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
09735 {
09736   return bamf_dbus_item_tab_interface_info ();
09737 }
09738 
09739 static GDBusInterfaceVTable *
09740 bamf_dbus_item_tab_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
09741 {
09742   return (GDBusInterfaceVTable *) &_bamf_dbus_item_tab_skeleton_vtable;
09743 }
09744 
09745 static GVariant *
09746 bamf_dbus_item_tab_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
09747 {
09748   BamfDBusItemTabSkeleton *skeleton = BAMF_DBUS_ITEM_TAB_SKELETON (_skeleton);
09749 
09750   GVariantBuilder builder;
09751   guint n;
09752   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
09753   if (_bamf_dbus_item_tab_interface_info.parent_struct.properties == NULL)
09754     goto out;
09755   for (n = 0; _bamf_dbus_item_tab_interface_info.parent_struct.properties[n] != NULL; n++)
09756     {
09757       GDBusPropertyInfo *info = _bamf_dbus_item_tab_interface_info.parent_struct.properties[n];
09758       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
09759         {
09760           GVariant *value;
09761           value = _bamf_dbus_item_tab_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.tab", info->name, NULL, skeleton);
09762           if (value != NULL)
09763             {
09764               g_variant_take_ref (value);
09765               g_variant_builder_add (&builder, "{sv}", info->name, value);
09766               g_variant_unref (value);
09767             }
09768         }
09769     }
09770 out:
09771   return g_variant_builder_end (&builder);
09772 }
09773 
09774 static void
09775 bamf_dbus_item_tab_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
09776 {
09777 }
09778 
09779 static void
09780 _bamf_dbus_item_tab_on_signal_uri_changed (
09781     BamfDBusItemTab *object,
09782     const gchar *arg_old,
09783     const gchar *arg_new)
09784 {
09785   BamfDBusItemTabSkeleton *skeleton = BAMF_DBUS_ITEM_TAB_SKELETON (object);
09786 
09787   GList      *connections, *l;
09788   GVariant   *signal_variant;
09789   connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
09790 
09791   signal_variant = g_variant_ref_sink (g_variant_new ("(ss)",
09792                    arg_old,
09793                    arg_new));
09794   for (l = connections; l != NULL; l = l->next)
09795     {
09796       GDBusConnection *connection = l->data;
09797       g_dbus_connection_emit_signal (connection,
09798         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.ayatana.bamf.tab", "UriChanged",
09799         signal_variant, NULL);
09800     }
09801   g_variant_unref (signal_variant);
09802   g_list_free_full (connections, g_object_unref);
09803 }
09804 
09805 static void bamf_dbus_item_tab_skeleton_iface_init (BamfDBusItemTabIface *iface);
09806 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemTabSkeleton, bamf_dbus_item_tab_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
09807                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_TAB, bamf_dbus_item_tab_skeleton_iface_init));
09808 
09809 static void
09810 bamf_dbus_item_tab_skeleton_finalize (GObject *object)
09811 {
09812   BamfDBusItemTabSkeleton *skeleton = BAMF_DBUS_ITEM_TAB_SKELETON (object);
09813   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
09814   if (skeleton->priv->changed_properties_idle_source != NULL)
09815     g_source_destroy (skeleton->priv->changed_properties_idle_source);
09816   g_main_context_unref (skeleton->priv->context);
09817   g_mutex_clear (&skeleton->priv->lock);
09818   G_OBJECT_CLASS (bamf_dbus_item_tab_skeleton_parent_class)->finalize (object);
09819 }
09820 
09821 static void
09822 bamf_dbus_item_tab_skeleton_init (BamfDBusItemTabSkeleton *skeleton)
09823 {
09824   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, BAMF_DBUS_ITEM_TYPE_TAB_SKELETON, BamfDBusItemTabSkeletonPrivate);
09825   g_mutex_init (&skeleton->priv->lock);
09826   skeleton->priv->context = g_main_context_ref_thread_default ();
09827 }
09828 
09829 static void
09830 bamf_dbus_item_tab_skeleton_class_init (BamfDBusItemTabSkeletonClass *klass)
09831 {
09832   GObjectClass *gobject_class;
09833   GDBusInterfaceSkeletonClass *skeleton_class;
09834 
09835   g_type_class_add_private (klass, sizeof (BamfDBusItemTabSkeletonPrivate));
09836 
09837   gobject_class = G_OBJECT_CLASS (klass);
09838   gobject_class->finalize = bamf_dbus_item_tab_skeleton_finalize;
09839 
09840   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
09841   skeleton_class->get_info = bamf_dbus_item_tab_skeleton_dbus_interface_get_info;
09842   skeleton_class->get_properties = bamf_dbus_item_tab_skeleton_dbus_interface_get_properties;
09843   skeleton_class->flush = bamf_dbus_item_tab_skeleton_dbus_interface_flush;
09844   skeleton_class->get_vtable = bamf_dbus_item_tab_skeleton_dbus_interface_get_vtable;
09845 }
09846 
09847 static void
09848 bamf_dbus_item_tab_skeleton_iface_init (BamfDBusItemTabIface *iface)
09849 {
09850   iface->uri_changed = _bamf_dbus_item_tab_on_signal_uri_changed;
09851 }
09852 
09860 BamfDBusItemTab *
09861 bamf_dbus_item_tab_skeleton_new (void)
09862 {
09863   return BAMF_DBUS_ITEM_TAB (g_object_new (BAMF_DBUS_ITEM_TYPE_TAB_SKELETON, NULL));
09864 }
09865 
09866 /* ------------------------------------------------------------------------
09867  * Code for Object, ObjectProxy and ObjectSkeleton
09868  * ------------------------------------------------------------------------
09869  */
09870 
09892 static void
09893 bamf_dbus_item_object_default_init (BamfDBusItemObjectIface *iface)
09894 {
09902   g_object_interface_install_property (iface, g_param_spec_object ("view", "view", "view", BAMF_DBUS_ITEM_TYPE_VIEW, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
09903 
09911   g_object_interface_install_property (iface, g_param_spec_object ("application", "application", "application", BAMF_DBUS_ITEM_TYPE_APPLICATION, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
09912 
09920   g_object_interface_install_property (iface, g_param_spec_object ("window", "window", "window", BAMF_DBUS_ITEM_TYPE_WINDOW, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
09921 
09929   g_object_interface_install_property (iface, g_param_spec_object ("indicator", "indicator", "indicator", BAMF_DBUS_ITEM_TYPE_INDICATOR, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
09930 
09938   g_object_interface_install_property (iface, g_param_spec_object ("tab", "tab", "tab", BAMF_DBUS_ITEM_TYPE_TAB, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
09939 
09940 }
09941 
09942 typedef BamfDBusItemObjectIface BamfDBusItemObjectInterface;
09943 G_DEFINE_INTERFACE_WITH_CODE (BamfDBusItemObject, bamf_dbus_item_object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));
09944 
09953 BamfDBusItemView *bamf_dbus_item_object_get_view (BamfDBusItemObject *object)
09954 {
09955   GDBusInterface *ret;
09956   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.view");
09957   if (ret == NULL)
09958     return NULL;
09959   return BAMF_DBUS_ITEM_VIEW (ret);
09960 }
09961 
09970 BamfDBusItemApplication *bamf_dbus_item_object_get_application (BamfDBusItemObject *object)
09971 {
09972   GDBusInterface *ret;
09973   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.application");
09974   if (ret == NULL)
09975     return NULL;
09976   return BAMF_DBUS_ITEM_APPLICATION (ret);
09977 }
09978 
09987 BamfDBusItemWindow *bamf_dbus_item_object_get_window (BamfDBusItemObject *object)
09988 {
09989   GDBusInterface *ret;
09990   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.window");
09991   if (ret == NULL)
09992     return NULL;
09993   return BAMF_DBUS_ITEM_WINDOW (ret);
09994 }
09995 
10004 BamfDBusItemIndicator *bamf_dbus_item_object_get_indicator (BamfDBusItemObject *object)
10005 {
10006   GDBusInterface *ret;
10007   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.indicator");
10008   if (ret == NULL)
10009     return NULL;
10010   return BAMF_DBUS_ITEM_INDICATOR (ret);
10011 }
10012 
10021 BamfDBusItemTab *bamf_dbus_item_object_get_tab (BamfDBusItemObject *object)
10022 {
10023   GDBusInterface *ret;
10024   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.tab");
10025   if (ret == NULL)
10026     return NULL;
10027   return BAMF_DBUS_ITEM_TAB (ret);
10028 }
10029 
10030 
10041 BamfDBusItemView *bamf_dbus_item_object_peek_view (BamfDBusItemObject *object)
10042 {
10043   GDBusInterface *ret;
10044   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.view");
10045   if (ret == NULL)
10046     return NULL;
10047   g_object_unref (ret);
10048   return BAMF_DBUS_ITEM_VIEW (ret);
10049 }
10050 
10061 BamfDBusItemApplication *bamf_dbus_item_object_peek_application (BamfDBusItemObject *object)
10062 {
10063   GDBusInterface *ret;
10064   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.application");
10065   if (ret == NULL)
10066     return NULL;
10067   g_object_unref (ret);
10068   return BAMF_DBUS_ITEM_APPLICATION (ret);
10069 }
10070 
10081 BamfDBusItemWindow *bamf_dbus_item_object_peek_window (BamfDBusItemObject *object)
10082 {
10083   GDBusInterface *ret;
10084   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.window");
10085   if (ret == NULL)
10086     return NULL;
10087   g_object_unref (ret);
10088   return BAMF_DBUS_ITEM_WINDOW (ret);
10089 }
10090 
10101 BamfDBusItemIndicator *bamf_dbus_item_object_peek_indicator (BamfDBusItemObject *object)
10102 {
10103   GDBusInterface *ret;
10104   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.indicator");
10105   if (ret == NULL)
10106     return NULL;
10107   g_object_unref (ret);
10108   return BAMF_DBUS_ITEM_INDICATOR (ret);
10109 }
10110 
10121 BamfDBusItemTab *bamf_dbus_item_object_peek_tab (BamfDBusItemObject *object)
10122 {
10123   GDBusInterface *ret;
10124   ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.tab");
10125   if (ret == NULL)
10126     return NULL;
10127   g_object_unref (ret);
10128   return BAMF_DBUS_ITEM_TAB (ret);
10129 }
10130 
10131 
10132 static void
10133 bamf_dbus_item_object_notify (GDBusObject *object, GDBusInterface *interface)
10134 {
10135   g_object_notify (G_OBJECT (object), ((_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface))->hyphen_name);
10136 }
10137 
10151 static void
10152 bamf_dbus_item_object_proxy__bamf_dbus_item_object_iface_init (BamfDBusItemObjectIface *iface)
10153 {
10154 }
10155 
10156 static void
10157 bamf_dbus_item_object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
10158 {
10159   iface->interface_added = bamf_dbus_item_object_notify;
10160   iface->interface_removed = bamf_dbus_item_object_notify;
10161 }
10162 
10163 
10164 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemObjectProxy, bamf_dbus_item_object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
10165                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_OBJECT, bamf_dbus_item_object_proxy__bamf_dbus_item_object_iface_init)
10166                          G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, bamf_dbus_item_object_proxy__g_dbus_object_iface_init));
10167 
10168 static void
10169 bamf_dbus_item_object_proxy_init (BamfDBusItemObjectProxy *object)
10170 {
10171 }
10172 
10173 static void
10174 bamf_dbus_item_object_proxy_set_property (GObject      *gobject,
10175   guint         prop_id,
10176   const GValue *value,
10177   GParamSpec   *pspec)
10178 {
10179   G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
10180 }
10181 
10182 static void
10183 bamf_dbus_item_object_proxy_get_property (GObject      *gobject,
10184   guint         prop_id,
10185   GValue       *value,
10186   GParamSpec   *pspec)
10187 {
10188   BamfDBusItemObjectProxy *object = BAMF_DBUS_ITEM_OBJECT_PROXY (gobject);
10189   GDBusInterface *interface;
10190 
10191   switch (prop_id)
10192     {
10193     case 1:
10194       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.view");
10195       g_value_take_object (value, interface);
10196       break;
10197 
10198     case 2:
10199       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.application");
10200       g_value_take_object (value, interface);
10201       break;
10202 
10203     case 3:
10204       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.window");
10205       g_value_take_object (value, interface);
10206       break;
10207 
10208     case 4:
10209       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.indicator");
10210       g_value_take_object (value, interface);
10211       break;
10212 
10213     case 5:
10214       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.tab");
10215       g_value_take_object (value, interface);
10216       break;
10217 
10218     default:
10219       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
10220       break;
10221   }
10222 }
10223 
10224 static void
10225 bamf_dbus_item_object_proxy_class_init (BamfDBusItemObjectProxyClass *klass)
10226 {
10227   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
10228 
10229   gobject_class->set_property = bamf_dbus_item_object_proxy_set_property;
10230   gobject_class->get_property = bamf_dbus_item_object_proxy_get_property;
10231 
10232   g_object_class_override_property (gobject_class, 1, "view");
10233   g_object_class_override_property (gobject_class, 2, "application");
10234   g_object_class_override_property (gobject_class, 3, "window");
10235   g_object_class_override_property (gobject_class, 4, "indicator");
10236   g_object_class_override_property (gobject_class, 5, "tab");
10237 }
10238 
10248 BamfDBusItemObjectProxy *
10249 bamf_dbus_item_object_proxy_new (GDBusConnection *connection,
10250   const gchar *object_path)
10251 {
10252   g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
10253   g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
10254   return BAMF_DBUS_ITEM_OBJECT_PROXY (g_object_new (BAMF_DBUS_ITEM_TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
10255 }
10256 
10270 static void
10271 bamf_dbus_item_object_skeleton__bamf_dbus_item_object_iface_init (BamfDBusItemObjectIface *iface)
10272 {
10273 }
10274 
10275 
10276 static void
10277 bamf_dbus_item_object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
10278 {
10279   iface->interface_added = bamf_dbus_item_object_notify;
10280   iface->interface_removed = bamf_dbus_item_object_notify;
10281 }
10282 
10283 G_DEFINE_TYPE_WITH_CODE (BamfDBusItemObjectSkeleton, bamf_dbus_item_object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
10284                          G_IMPLEMENT_INTERFACE (BAMF_DBUS_ITEM_TYPE_OBJECT, bamf_dbus_item_object_skeleton__bamf_dbus_item_object_iface_init)
10285                          G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, bamf_dbus_item_object_skeleton__g_dbus_object_iface_init));
10286 
10287 static void
10288 bamf_dbus_item_object_skeleton_init (BamfDBusItemObjectSkeleton *object)
10289 {
10290 }
10291 
10292 static void
10293 bamf_dbus_item_object_skeleton_set_property (GObject      *gobject,
10294   guint         prop_id,
10295   const GValue *value,
10296   GParamSpec   *pspec)
10297 {
10298   BamfDBusItemObjectSkeleton *object = BAMF_DBUS_ITEM_OBJECT_SKELETON (gobject);
10299   GDBusInterfaceSkeleton *interface;
10300 
10301   switch (prop_id)
10302     {
10303     case 1:
10304       interface = g_value_get_object (value);
10305       if (interface != NULL)
10306         {
10307           g_warn_if_fail (BAMF_DBUS_ITEM_IS_VIEW (interface));
10308           g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
10309         }
10310       else
10311         {
10312           g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.ayatana.bamf.view");
10313         }
10314       break;
10315 
10316     case 2:
10317       interface = g_value_get_object (value);
10318       if (interface != NULL)
10319         {
10320           g_warn_if_fail (BAMF_DBUS_ITEM_IS_APPLICATION (interface));
10321           g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
10322         }
10323       else
10324         {
10325           g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.ayatana.bamf.application");
10326         }
10327       break;
10328 
10329     case 3:
10330       interface = g_value_get_object (value);
10331       if (interface != NULL)
10332         {
10333           g_warn_if_fail (BAMF_DBUS_ITEM_IS_WINDOW (interface));
10334           g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
10335         }
10336       else
10337         {
10338           g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.ayatana.bamf.window");
10339         }
10340       break;
10341 
10342     case 4:
10343       interface = g_value_get_object (value);
10344       if (interface != NULL)
10345         {
10346           g_warn_if_fail (BAMF_DBUS_ITEM_IS_INDICATOR (interface));
10347           g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
10348         }
10349       else
10350         {
10351           g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.ayatana.bamf.indicator");
10352         }
10353       break;
10354 
10355     case 5:
10356       interface = g_value_get_object (value);
10357       if (interface != NULL)
10358         {
10359           g_warn_if_fail (BAMF_DBUS_ITEM_IS_TAB (interface));
10360           g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
10361         }
10362       else
10363         {
10364           g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.ayatana.bamf.tab");
10365         }
10366       break;
10367 
10368     default:
10369       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
10370       break;
10371   }
10372 }
10373 
10374 static void
10375 bamf_dbus_item_object_skeleton_get_property (GObject      *gobject,
10376   guint         prop_id,
10377   GValue       *value,
10378   GParamSpec   *pspec)
10379 {
10380   BamfDBusItemObjectSkeleton *object = BAMF_DBUS_ITEM_OBJECT_SKELETON (gobject);
10381   GDBusInterface *interface;
10382 
10383   switch (prop_id)
10384     {
10385     case 1:
10386       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.view");
10387       g_value_take_object (value, interface);
10388       break;
10389 
10390     case 2:
10391       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.application");
10392       g_value_take_object (value, interface);
10393       break;
10394 
10395     case 3:
10396       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.window");
10397       g_value_take_object (value, interface);
10398       break;
10399 
10400     case 4:
10401       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.indicator");
10402       g_value_take_object (value, interface);
10403       break;
10404 
10405     case 5:
10406       interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.ayatana.bamf.tab");
10407       g_value_take_object (value, interface);
10408       break;
10409 
10410     default:
10411       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
10412       break;
10413   }
10414 }
10415 
10416 static void
10417 bamf_dbus_item_object_skeleton_class_init (BamfDBusItemObjectSkeletonClass *klass)
10418 {
10419   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
10420 
10421   gobject_class->set_property = bamf_dbus_item_object_skeleton_set_property;
10422   gobject_class->get_property = bamf_dbus_item_object_skeleton_get_property;
10423 
10424   g_object_class_override_property (gobject_class, 1, "view");
10425   g_object_class_override_property (gobject_class, 2, "application");
10426   g_object_class_override_property (gobject_class, 3, "window");
10427   g_object_class_override_property (gobject_class, 4, "indicator");
10428   g_object_class_override_property (gobject_class, 5, "tab");
10429 }
10430 
10439 BamfDBusItemObjectSkeleton *
10440 bamf_dbus_item_object_skeleton_new (const gchar *object_path)
10441 {
10442   g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
10443   return BAMF_DBUS_ITEM_OBJECT_SKELETON (g_object_new (BAMF_DBUS_ITEM_TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
10444 }
10445 
10453 void bamf_dbus_item_object_skeleton_set_view (BamfDBusItemObjectSkeleton *object, BamfDBusItemView *interface_)
10454 {
10455   g_object_set (G_OBJECT (object), "view", interface_, NULL);
10456 }
10457 
10465 void bamf_dbus_item_object_skeleton_set_application (BamfDBusItemObjectSkeleton *object, BamfDBusItemApplication *interface_)
10466 {
10467   g_object_set (G_OBJECT (object), "application", interface_, NULL);
10468 }
10469 
10477 void bamf_dbus_item_object_skeleton_set_window (BamfDBusItemObjectSkeleton *object, BamfDBusItemWindow *interface_)
10478 {
10479   g_object_set (G_OBJECT (object), "window", interface_, NULL);
10480 }
10481 
10489 void bamf_dbus_item_object_skeleton_set_indicator (BamfDBusItemObjectSkeleton *object, BamfDBusItemIndicator *interface_)
10490 {
10491   g_object_set (G_OBJECT (object), "indicator", interface_, NULL);
10492 }
10493 
10501 void bamf_dbus_item_object_skeleton_set_tab (BamfDBusItemObjectSkeleton *object, BamfDBusItemTab *interface_)
10502 {
10503   g_object_set (G_OBJECT (object), "tab", interface_, NULL);
10504 }
10505 
10506 
10507 /* ------------------------------------------------------------------------
10508  * Code for ObjectManager client
10509  * ------------------------------------------------------------------------
10510  */
10511 
10533 G_DEFINE_TYPE (BamfDBusItemObjectManagerClient, bamf_dbus_item_object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);
10534 
10535 static void
10536 bamf_dbus_item_object_manager_client_init (BamfDBusItemObjectManagerClient *manager)
10537 {
10538 }
10539 
10540 static void
10541 bamf_dbus_item_object_manager_client_class_init (BamfDBusItemObjectManagerClientClass *klass)
10542 {
10543 }
10544 
10556 GType
10557 bamf_dbus_item_object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data)
10558 {
10559   static gsize once_init_value = 0;
10560   static GHashTable *lookup_hash;
10561   GType ret;
10562 
10563   if (interface_name == NULL)
10564     return BAMF_DBUS_ITEM_TYPE_OBJECT_PROXY;
10565   if (g_once_init_enter (&once_init_value))
10566     {
10567       lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
10568       g_hash_table_insert (lookup_hash, "org.ayatana.bamf.view", GSIZE_TO_POINTER (BAMF_DBUS_ITEM_TYPE_VIEW_PROXY));
10569       g_hash_table_insert (lookup_hash, "org.ayatana.bamf.application", GSIZE_TO_POINTER (BAMF_DBUS_ITEM_TYPE_APPLICATION_PROXY));
10570       g_hash_table_insert (lookup_hash, "org.ayatana.bamf.window", GSIZE_TO_POINTER (BAMF_DBUS_ITEM_TYPE_WINDOW_PROXY));
10571       g_hash_table_insert (lookup_hash, "org.ayatana.bamf.indicator", GSIZE_TO_POINTER (BAMF_DBUS_ITEM_TYPE_INDICATOR_PROXY));
10572       g_hash_table_insert (lookup_hash, "org.ayatana.bamf.tab", GSIZE_TO_POINTER (BAMF_DBUS_ITEM_TYPE_TAB_PROXY));
10573       g_once_init_leave (&once_init_value, 1);
10574     }
10575   ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
10576   if (ret == (GType) 0)
10577     ret = G_TYPE_DBUS_PROXY;
10578   return ret;
10579 }
10580 
10598 void
10599 bamf_dbus_item_object_manager_client_new (
10600     GDBusConnection        *connection,
10601     GDBusObjectManagerClientFlags  flags,
10602     const gchar            *name,
10603     const gchar            *object_path,
10604     GCancellable           *cancellable,
10605     GAsyncReadyCallback     callback,
10606     gpointer                user_data)
10607 {
10608   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", bamf_dbus_item_object_manager_client_get_proxy_type, NULL);
10609 }
10610 
10620 GDBusObjectManager *
10621 bamf_dbus_item_object_manager_client_new_finish (
10622     GAsyncResult        *res,
10623     GError             **error)
10624 {
10625   GObject *ret;
10626   GObject *source_object;
10627   source_object = g_async_result_get_source_object (res);
10628   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
10629   g_object_unref (source_object);
10630   if (ret != NULL)
10631     return G_DBUS_OBJECT_MANAGER (ret);
10632   else
10633     return NULL;
10634 }
10635 
10653 GDBusObjectManager *
10654 bamf_dbus_item_object_manager_client_new_sync (
10655     GDBusConnection        *connection,
10656     GDBusObjectManagerClientFlags  flags,
10657     const gchar            *name,
10658     const gchar            *object_path,
10659     GCancellable           *cancellable,
10660     GError                **error)
10661 {
10662   GInitable *ret;
10663   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", bamf_dbus_item_object_manager_client_get_proxy_type, NULL);
10664   if (ret != NULL)
10665     return G_DBUS_OBJECT_MANAGER (ret);
10666   else
10667     return NULL;
10668 }
10669 
10670 
10688 void
10689 bamf_dbus_item_object_manager_client_new_for_bus (
10690     GBusType                bus_type,
10691     GDBusObjectManagerClientFlags  flags,
10692     const gchar            *name,
10693     const gchar            *object_path,
10694     GCancellable           *cancellable,
10695     GAsyncReadyCallback     callback,
10696     gpointer                user_data)
10697 {
10698   g_async_initable_new_async (BAMF_DBUS_ITEM_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", bamf_dbus_item_object_manager_client_get_proxy_type, NULL);
10699 }
10700 
10710 GDBusObjectManager *
10711 bamf_dbus_item_object_manager_client_new_for_bus_finish (
10712     GAsyncResult        *res,
10713     GError             **error)
10714 {
10715   GObject *ret;
10716   GObject *source_object;
10717   source_object = g_async_result_get_source_object (res);
10718   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
10719   g_object_unref (source_object);
10720   if (ret != NULL)
10721     return G_DBUS_OBJECT_MANAGER (ret);
10722   else
10723     return NULL;
10724 }
10725 
10743 GDBusObjectManager *
10744 bamf_dbus_item_object_manager_client_new_for_bus_sync (
10745     GBusType                bus_type,
10746     GDBusObjectManagerClientFlags  flags,
10747     const gchar            *name,
10748     const gchar            *object_path,
10749     GCancellable           *cancellable,
10750     GError                **error)
10751 {
10752   GInitable *ret;
10753   ret = g_initable_new (BAMF_DBUS_ITEM_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", bamf_dbus_item_object_manager_client_get_proxy_type, NULL);
10754   if (ret != NULL)
10755     return G_DBUS_OBJECT_MANAGER (ret);
10756   else
10757     return NULL;
10758 }
10759 
10760