/*
 * Generated by gdbus-codegen 2.49.4. DO NOT EDIT.
 *
 * The license of this code is the same as for the source it was derived from.
 */

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

#include "src/xdg-desktop-portal-dbus.h"

#include <string.h>
#ifdef G_OS_UNIX
#  include <gio/gunixfdlist.h>
#endif

typedef struct
{
  GDBusArgInfo parent_struct;
  gboolean use_gvariant;
} _ExtendedGDBusArgInfo;

typedef struct
{
  GDBusMethodInfo parent_struct;
  const gchar *signal_name;
  gboolean pass_fdlist;
} _ExtendedGDBusMethodInfo;

typedef struct
{
  GDBusSignalInfo parent_struct;
  const gchar *signal_name;
} _ExtendedGDBusSignalInfo;

typedef struct
{
  GDBusPropertyInfo parent_struct;
  const gchar *hyphen_name;
  gboolean use_gvariant;
} _ExtendedGDBusPropertyInfo;

typedef struct
{
  GDBusInterfaceInfo parent_struct;
  const gchar *hyphen_name;
} _ExtendedGDBusInterfaceInfo;

typedef struct
{
  const _ExtendedGDBusPropertyInfo *info;
  guint prop_id;
  GValue orig_value; /* the value before the change */
} ChangedProperty;

static void
_changed_property_free (ChangedProperty *data)
{
  g_value_unset (&data->orig_value);
  g_free (data);
}

static gboolean
_g_strv_equal0 (gchar **a, gchar **b)
{
  gboolean ret = FALSE;
  guint n;
  if (a == NULL && b == NULL)
    {
      ret = TRUE;
      goto out;
    }
  if (a == NULL || b == NULL)
    goto out;
  if (g_strv_length (a) != g_strv_length (b))
    goto out;
  for (n = 0; a[n] != NULL; n++)
    if (g_strcmp0 (a[n], b[n]) != 0)
      goto out;
  ret = TRUE;
out:
  return ret;
}

static gboolean
_g_variant_equal0 (GVariant *a, GVariant *b)
{
  gboolean ret = FALSE;
  if (a == NULL && b == NULL)
    {
      ret = TRUE;
      goto out;
    }
  if (a == NULL || b == NULL)
    goto out;
  ret = g_variant_equal (a, b);
out:
  return ret;
}

G_GNUC_UNUSED static gboolean
_g_value_equal (const GValue *a, const GValue *b)
{
  gboolean ret = FALSE;
  g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
  switch (G_VALUE_TYPE (a))
    {
      case G_TYPE_BOOLEAN:
        ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
        break;
      case G_TYPE_UCHAR:
        ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
        break;
      case G_TYPE_INT:
        ret = (g_value_get_int (a) == g_value_get_int (b));
        break;
      case G_TYPE_UINT:
        ret = (g_value_get_uint (a) == g_value_get_uint (b));
        break;
      case G_TYPE_INT64:
        ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
        break;
      case G_TYPE_UINT64:
        ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
        break;
      case G_TYPE_DOUBLE:
        {
          /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
          gdouble da = g_value_get_double (a);
          gdouble db = g_value_get_double (b);
          ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
        }
        break;
      case G_TYPE_STRING:
        ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
        break;
      case G_TYPE_VARIANT:
        ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
        break;
      default:
        if (G_VALUE_TYPE (a) == G_TYPE_STRV)
          ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
        else
          g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
        break;
    }
  return ret;
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.impl.portal.Request
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:XdpImplRequest
 * @title: XdpImplRequest
 * @short_description: Generated C code for the org.freedesktop.impl.portal.Request D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Request.top_of_page">org.freedesktop.impl.portal.Request</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.impl.portal.Request ---- */

static const _ExtendedGDBusMethodInfo _xdp_impl_request_method_info_close =
{
  {
    -1,
    (gchar *) "Close",
    NULL,
    NULL,
    NULL
  },
  "handle-close",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _xdp_impl_request_method_info_pointers[] =
{
  &_xdp_impl_request_method_info_close,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _xdp_impl_request_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.impl.portal.Request",
    (GDBusMethodInfo **) &_xdp_impl_request_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "request",
};


/**
 * xdp_impl_request_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Request.top_of_page">org.freedesktop.impl.portal.Request</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
xdp_impl_request_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_xdp_impl_request_interface_info.parent_struct;
}

/**
 * xdp_impl_request_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #XdpImplRequest interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
xdp_impl_request_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * XdpImplRequest:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Request.top_of_page">org.freedesktop.impl.portal.Request</link>.
 */

/**
 * XdpImplRequestIface:
 * @parent_iface: The parent interface.
 * @handle_close: Handler for the #XdpImplRequest::handle-close signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Request.top_of_page">org.freedesktop.impl.portal.Request</link>.
 */

typedef XdpImplRequestIface XdpImplRequestInterface;
G_DEFINE_INTERFACE (XdpImplRequest, xdp_impl_request, G_TYPE_OBJECT);

static void
xdp_impl_request_default_init (XdpImplRequestIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * XdpImplRequest::handle-close:
   * @object: A #XdpImplRequest.
   * @invocation: A #GDBusMethodInvocation.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-Request.Close">Close()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_request_complete_close() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-close",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplRequestIface, handle_close),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    1,
    G_TYPE_DBUS_METHOD_INVOCATION);

}

/**
 * xdp_impl_request_call_close:
 * @proxy: A #XdpImplRequestProxy.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Request.Close">Close()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_request_call_close_finish() to get the result of the operation.
 *
 * See xdp_impl_request_call_close_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_request_call_close (
    XdpImplRequest *proxy,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Close",
    g_variant_new ("()"),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_request_call_close_finish:
 * @proxy: A #XdpImplRequestProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_request_call_close().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_request_call_close().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_request_call_close_finish (
    XdpImplRequest *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_request_call_close_sync:
 * @proxy: A #XdpImplRequestProxy.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Request.Close">Close()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_request_call_close() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_request_call_close_sync (
    XdpImplRequest *proxy,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Close",
    g_variant_new ("()"),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_request_complete_close:
 * @object: A #XdpImplRequest.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-Request.Close">Close()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_request_complete_close (
    XdpImplRequest *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/* ------------------------------------------------------------------------ */

/**
 * XdpImplRequestProxy:
 *
 * The #XdpImplRequestProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplRequestProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplRequestProxy.
 */

struct _XdpImplRequestProxyPrivate
{
  GData *qdata;
};

static void xdp_impl_request_proxy_iface_init (XdpImplRequestIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplRequestProxy, xdp_impl_request_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (XdpImplRequestProxy)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_REQUEST, xdp_impl_request_proxy_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplRequestProxy, xdp_impl_request_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_REQUEST, xdp_impl_request_proxy_iface_init));

#endif
static void
xdp_impl_request_proxy_finalize (GObject *object)
{
  XdpImplRequestProxy *proxy = XDP_IMPL_REQUEST_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (xdp_impl_request_proxy_parent_class)->finalize (object);
}

static void
xdp_impl_request_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_request_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_request_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xdp_impl_request_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], XDP_IMPL_TYPE_REQUEST);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_REQUEST);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
xdp_impl_request_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  XdpImplRequestProxy *proxy = XDP_IMPL_REQUEST_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_request_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_request_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
xdp_impl_request_proxy_init (XdpImplRequestProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = xdp_impl_request_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XDP_IMPL_TYPE_REQUEST_PROXY, XdpImplRequestProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xdp_impl_request_interface_info ());
}

static void
xdp_impl_request_proxy_class_init (XdpImplRequestProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = xdp_impl_request_proxy_finalize;
  gobject_class->get_property = xdp_impl_request_proxy_get_property;
  gobject_class->set_property = xdp_impl_request_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = xdp_impl_request_proxy_g_signal;
  proxy_class->g_properties_changed = xdp_impl_request_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplRequestProxyPrivate));
#endif
}

static void
xdp_impl_request_proxy_iface_init (XdpImplRequestIface *iface)
{
}

/**
 * xdp_impl_request_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Request.top_of_page">org.freedesktop.impl.portal.Request</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_request_proxy_new_finish() to get the result of the operation.
 *
 * See xdp_impl_request_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_request_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_REQUEST_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Request", NULL);
}

/**
 * xdp_impl_request_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_request_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_request_proxy_new().
 *
 * Returns: (transfer full) (type XdpImplRequestProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplRequest *
xdp_impl_request_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_REQUEST (ret);
  else
    return NULL;
}

/**
 * xdp_impl_request_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Request.top_of_page">org.freedesktop.impl.portal.Request</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_request_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplRequestProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplRequest *
xdp_impl_request_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_REQUEST_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Request", NULL);
  if (ret != NULL)
    return XDP_IMPL_REQUEST (ret);
  else
    return NULL;
}


/**
 * xdp_impl_request_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like xdp_impl_request_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_request_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See xdp_impl_request_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_request_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_REQUEST_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Request", NULL);
}

/**
 * xdp_impl_request_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_request_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_request_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type XdpImplRequestProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplRequest *
xdp_impl_request_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_REQUEST (ret);
  else
    return NULL;
}

/**
 * xdp_impl_request_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like xdp_impl_request_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_request_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplRequestProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplRequest *
xdp_impl_request_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_REQUEST_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Request", NULL);
  if (ret != NULL)
    return XDP_IMPL_REQUEST (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * XdpImplRequestSkeleton:
 *
 * The #XdpImplRequestSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplRequestSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplRequestSkeleton.
 */

struct _XdpImplRequestSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_xdp_impl_request_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  XdpImplRequestSkeleton *skeleton = XDP_IMPL_REQUEST_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint num_extra;
  guint n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], XDP_IMPL_TYPE_REQUEST);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_REQUEST);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    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);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_xdp_impl_request_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  XdpImplRequestSkeleton *skeleton = XDP_IMPL_REQUEST_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_request_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_xdp_impl_request_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  XdpImplRequestSkeleton *skeleton = XDP_IMPL_REQUEST_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_request_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _xdp_impl_request_skeleton_vtable =
{
  _xdp_impl_request_skeleton_handle_method_call,
  _xdp_impl_request_skeleton_handle_get_property,
  _xdp_impl_request_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
xdp_impl_request_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return xdp_impl_request_interface_info ();
}

static GDBusInterfaceVTable *
xdp_impl_request_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_xdp_impl_request_skeleton_vtable;
}

static GVariant *
xdp_impl_request_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  XdpImplRequestSkeleton *skeleton = XDP_IMPL_REQUEST_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_xdp_impl_request_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _xdp_impl_request_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _xdp_impl_request_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _xdp_impl_request_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.impl.portal.Request", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
xdp_impl_request_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void xdp_impl_request_skeleton_iface_init (XdpImplRequestIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplRequestSkeleton, xdp_impl_request_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (XdpImplRequestSkeleton)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_REQUEST, xdp_impl_request_skeleton_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplRequestSkeleton, xdp_impl_request_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_REQUEST, xdp_impl_request_skeleton_iface_init));

#endif
static void
xdp_impl_request_skeleton_finalize (GObject *object)
{
  XdpImplRequestSkeleton *skeleton = XDP_IMPL_REQUEST_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (xdp_impl_request_skeleton_parent_class)->finalize (object);
}

static void
xdp_impl_request_skeleton_init (XdpImplRequestSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = xdp_impl_request_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XDP_IMPL_TYPE_REQUEST_SKELETON, XdpImplRequestSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
xdp_impl_request_skeleton_class_init (XdpImplRequestSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = xdp_impl_request_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = xdp_impl_request_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = xdp_impl_request_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = xdp_impl_request_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = xdp_impl_request_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplRequestSkeletonPrivate));
#endif
}

static void
xdp_impl_request_skeleton_iface_init (XdpImplRequestIface *iface)
{
}

/**
 * xdp_impl_request_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Request.top_of_page">org.freedesktop.impl.portal.Request</link>.
 *
 * Returns: (transfer full) (type XdpImplRequestSkeleton): The skeleton object.
 */
XdpImplRequest *
xdp_impl_request_skeleton_new (void)
{
  return XDP_IMPL_REQUEST (g_object_new (XDP_IMPL_TYPE_REQUEST_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.impl.portal.FileChooser
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:XdpImplFileChooser
 * @title: XdpImplFileChooser
 * @short_description: Generated C code for the org.freedesktop.impl.portal.FileChooser D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-impl-portal-FileChooser.top_of_page">org.freedesktop.impl.portal.FileChooser</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.impl.portal.FileChooser ---- */

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_open_file_IN_ARG_handle =
{
  {
    -1,
    (gchar *) "handle",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_open_file_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_open_file_IN_ARG_parent_window =
{
  {
    -1,
    (gchar *) "parent_window",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_open_file_IN_ARG_title =
{
  {
    -1,
    (gchar *) "title",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_open_file_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_file_chooser_method_info_open_file_IN_ARG_pointers[] =
{
  &_xdp_impl_file_chooser_method_info_open_file_IN_ARG_handle,
  &_xdp_impl_file_chooser_method_info_open_file_IN_ARG_app_id,
  &_xdp_impl_file_chooser_method_info_open_file_IN_ARG_parent_window,
  &_xdp_impl_file_chooser_method_info_open_file_IN_ARG_title,
  &_xdp_impl_file_chooser_method_info_open_file_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_open_file_OUT_ARG_response =
{
  {
    -1,
    (gchar *) "response",
    (gchar *) "u",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_open_file_OUT_ARG_results =
{
  {
    -1,
    (gchar *) "results",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_file_chooser_method_info_open_file_OUT_ARG_pointers[] =
{
  &_xdp_impl_file_chooser_method_info_open_file_OUT_ARG_response,
  &_xdp_impl_file_chooser_method_info_open_file_OUT_ARG_results,
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_file_chooser_method_open_file_annotation_info_0 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In4",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_file_chooser_method_open_file_annotation_info_1 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out1",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo * const _xdp_impl_file_chooser_method_open_file_annotation_info_pointers[] =
{
  &_xdp_impl_file_chooser_method_open_file_annotation_info_0,
  &_xdp_impl_file_chooser_method_open_file_annotation_info_1,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_file_chooser_method_info_open_file =
{
  {
    -1,
    (gchar *) "OpenFile",
    (GDBusArgInfo **) &_xdp_impl_file_chooser_method_info_open_file_IN_ARG_pointers,
    (GDBusArgInfo **) &_xdp_impl_file_chooser_method_info_open_file_OUT_ARG_pointers,
    (GDBusAnnotationInfo **) &_xdp_impl_file_chooser_method_open_file_annotation_info_pointers
  },
  "handle-open-file",
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_save_file_IN_ARG_handle =
{
  {
    -1,
    (gchar *) "handle",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_save_file_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_save_file_IN_ARG_parent_window =
{
  {
    -1,
    (gchar *) "parent_window",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_save_file_IN_ARG_title =
{
  {
    -1,
    (gchar *) "title",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_save_file_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_file_chooser_method_info_save_file_IN_ARG_pointers[] =
{
  &_xdp_impl_file_chooser_method_info_save_file_IN_ARG_handle,
  &_xdp_impl_file_chooser_method_info_save_file_IN_ARG_app_id,
  &_xdp_impl_file_chooser_method_info_save_file_IN_ARG_parent_window,
  &_xdp_impl_file_chooser_method_info_save_file_IN_ARG_title,
  &_xdp_impl_file_chooser_method_info_save_file_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_save_file_OUT_ARG_response =
{
  {
    -1,
    (gchar *) "response",
    (gchar *) "u",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_file_chooser_method_info_save_file_OUT_ARG_results =
{
  {
    -1,
    (gchar *) "results",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_file_chooser_method_info_save_file_OUT_ARG_pointers[] =
{
  &_xdp_impl_file_chooser_method_info_save_file_OUT_ARG_response,
  &_xdp_impl_file_chooser_method_info_save_file_OUT_ARG_results,
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_file_chooser_method_save_file_annotation_info_0 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In4",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_file_chooser_method_save_file_annotation_info_1 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out1",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo * const _xdp_impl_file_chooser_method_save_file_annotation_info_pointers[] =
{
  &_xdp_impl_file_chooser_method_save_file_annotation_info_0,
  &_xdp_impl_file_chooser_method_save_file_annotation_info_1,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_file_chooser_method_info_save_file =
{
  {
    -1,
    (gchar *) "SaveFile",
    (GDBusArgInfo **) &_xdp_impl_file_chooser_method_info_save_file_IN_ARG_pointers,
    (GDBusArgInfo **) &_xdp_impl_file_chooser_method_info_save_file_OUT_ARG_pointers,
    (GDBusAnnotationInfo **) &_xdp_impl_file_chooser_method_save_file_annotation_info_pointers
  },
  "handle-save-file",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _xdp_impl_file_chooser_method_info_pointers[] =
{
  &_xdp_impl_file_chooser_method_info_open_file,
  &_xdp_impl_file_chooser_method_info_save_file,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _xdp_impl_file_chooser_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.impl.portal.FileChooser",
    (GDBusMethodInfo **) &_xdp_impl_file_chooser_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "file-chooser",
};


/**
 * xdp_impl_file_chooser_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-impl-portal-FileChooser.top_of_page">org.freedesktop.impl.portal.FileChooser</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
xdp_impl_file_chooser_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_xdp_impl_file_chooser_interface_info.parent_struct;
}

/**
 * xdp_impl_file_chooser_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #XdpImplFileChooser interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
xdp_impl_file_chooser_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * XdpImplFileChooser:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-FileChooser.top_of_page">org.freedesktop.impl.portal.FileChooser</link>.
 */

/**
 * XdpImplFileChooserIface:
 * @parent_iface: The parent interface.
 * @handle_open_file: Handler for the #XdpImplFileChooser::handle-open-file signal.
 * @handle_save_file: Handler for the #XdpImplFileChooser::handle-save-file signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-FileChooser.top_of_page">org.freedesktop.impl.portal.FileChooser</link>.
 */

typedef XdpImplFileChooserIface XdpImplFileChooserInterface;
G_DEFINE_INTERFACE (XdpImplFileChooser, xdp_impl_file_chooser, G_TYPE_OBJECT);

static void
xdp_impl_file_chooser_default_init (XdpImplFileChooserIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * XdpImplFileChooser::handle-open-file:
   * @object: A #XdpImplFileChooser.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_handle: Argument passed by remote caller.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_parent_window: Argument passed by remote caller.
   * @arg_title: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-FileChooser.OpenFile">OpenFile()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_file_chooser_complete_open_file() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-open-file",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplFileChooserIface, handle_open_file),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    6,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);

  /**
   * XdpImplFileChooser::handle-save-file:
   * @object: A #XdpImplFileChooser.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_handle: Argument passed by remote caller.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_parent_window: Argument passed by remote caller.
   * @arg_title: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-FileChooser.SaveFile">SaveFile()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_file_chooser_complete_save_file() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-save-file",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplFileChooserIface, handle_save_file),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    6,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);

}

/**
 * xdp_impl_file_chooser_call_open_file:
 * @proxy: A #XdpImplFileChooserProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-FileChooser.OpenFile">OpenFile()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_file_chooser_call_open_file_finish() to get the result of the operation.
 *
 * See xdp_impl_file_chooser_call_open_file_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_file_chooser_call_open_file (
    XdpImplFileChooser *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "OpenFile",
    g_variant_new ("(osss@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_file_chooser_call_open_file_finish:
 * @proxy: A #XdpImplFileChooserProxy.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_file_chooser_call_open_file().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_file_chooser_call_open_file().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_file_chooser_call_open_file_finish (
    XdpImplFileChooser *proxy,
    guint *out_response,
    GVariant **out_results,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_file_chooser_call_open_file_sync:
 * @proxy: A #XdpImplFileChooserProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-FileChooser.OpenFile">OpenFile()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_file_chooser_call_open_file() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_file_chooser_call_open_file_sync (
    XdpImplFileChooser *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    GVariant *arg_options,
    guint *out_response,
    GVariant **out_results,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "OpenFile",
    g_variant_new ("(osss@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_file_chooser_call_save_file:
 * @proxy: A #XdpImplFileChooserProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-FileChooser.SaveFile">SaveFile()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_file_chooser_call_save_file_finish() to get the result of the operation.
 *
 * See xdp_impl_file_chooser_call_save_file_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_file_chooser_call_save_file (
    XdpImplFileChooser *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "SaveFile",
    g_variant_new ("(osss@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_file_chooser_call_save_file_finish:
 * @proxy: A #XdpImplFileChooserProxy.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_file_chooser_call_save_file().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_file_chooser_call_save_file().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_file_chooser_call_save_file_finish (
    XdpImplFileChooser *proxy,
    guint *out_response,
    GVariant **out_results,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_file_chooser_call_save_file_sync:
 * @proxy: A #XdpImplFileChooserProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-FileChooser.SaveFile">SaveFile()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_file_chooser_call_save_file() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_file_chooser_call_save_file_sync (
    XdpImplFileChooser *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    GVariant *arg_options,
    guint *out_response,
    GVariant **out_results,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "SaveFile",
    g_variant_new ("(osss@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_file_chooser_complete_open_file:
 * @object: A #XdpImplFileChooser.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @response: Parameter to return.
 * @results: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-FileChooser.OpenFile">OpenFile()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_file_chooser_complete_open_file (
    XdpImplFileChooser *object,
    GDBusMethodInvocation *invocation,
    guint response,
    GVariant *results)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(u@a{sv})",
                   response,
                   results));
}

/**
 * xdp_impl_file_chooser_complete_save_file:
 * @object: A #XdpImplFileChooser.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @response: Parameter to return.
 * @results: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-FileChooser.SaveFile">SaveFile()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_file_chooser_complete_save_file (
    XdpImplFileChooser *object,
    GDBusMethodInvocation *invocation,
    guint response,
    GVariant *results)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(u@a{sv})",
                   response,
                   results));
}

/* ------------------------------------------------------------------------ */

/**
 * XdpImplFileChooserProxy:
 *
 * The #XdpImplFileChooserProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplFileChooserProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplFileChooserProxy.
 */

struct _XdpImplFileChooserProxyPrivate
{
  GData *qdata;
};

static void xdp_impl_file_chooser_proxy_iface_init (XdpImplFileChooserIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplFileChooserProxy, xdp_impl_file_chooser_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (XdpImplFileChooserProxy)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_FILE_CHOOSER, xdp_impl_file_chooser_proxy_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplFileChooserProxy, xdp_impl_file_chooser_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_FILE_CHOOSER, xdp_impl_file_chooser_proxy_iface_init));

#endif
static void
xdp_impl_file_chooser_proxy_finalize (GObject *object)
{
  XdpImplFileChooserProxy *proxy = XDP_IMPL_FILE_CHOOSER_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (xdp_impl_file_chooser_proxy_parent_class)->finalize (object);
}

static void
xdp_impl_file_chooser_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_file_chooser_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_file_chooser_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xdp_impl_file_chooser_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], XDP_IMPL_TYPE_FILE_CHOOSER);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_FILE_CHOOSER);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
xdp_impl_file_chooser_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  XdpImplFileChooserProxy *proxy = XDP_IMPL_FILE_CHOOSER_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_file_chooser_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_file_chooser_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
xdp_impl_file_chooser_proxy_init (XdpImplFileChooserProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = xdp_impl_file_chooser_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XDP_IMPL_TYPE_FILE_CHOOSER_PROXY, XdpImplFileChooserProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xdp_impl_file_chooser_interface_info ());
}

static void
xdp_impl_file_chooser_proxy_class_init (XdpImplFileChooserProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = xdp_impl_file_chooser_proxy_finalize;
  gobject_class->get_property = xdp_impl_file_chooser_proxy_get_property;
  gobject_class->set_property = xdp_impl_file_chooser_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = xdp_impl_file_chooser_proxy_g_signal;
  proxy_class->g_properties_changed = xdp_impl_file_chooser_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplFileChooserProxyPrivate));
#endif
}

static void
xdp_impl_file_chooser_proxy_iface_init (XdpImplFileChooserIface *iface)
{
}

/**
 * xdp_impl_file_chooser_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-FileChooser.top_of_page">org.freedesktop.impl.portal.FileChooser</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_file_chooser_proxy_new_finish() to get the result of the operation.
 *
 * See xdp_impl_file_chooser_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_file_chooser_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_FILE_CHOOSER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.FileChooser", NULL);
}

/**
 * xdp_impl_file_chooser_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_file_chooser_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_file_chooser_proxy_new().
 *
 * Returns: (transfer full) (type XdpImplFileChooserProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplFileChooser *
xdp_impl_file_chooser_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_FILE_CHOOSER (ret);
  else
    return NULL;
}

/**
 * xdp_impl_file_chooser_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-FileChooser.top_of_page">org.freedesktop.impl.portal.FileChooser</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_file_chooser_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplFileChooserProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplFileChooser *
xdp_impl_file_chooser_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_FILE_CHOOSER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.FileChooser", NULL);
  if (ret != NULL)
    return XDP_IMPL_FILE_CHOOSER (ret);
  else
    return NULL;
}


/**
 * xdp_impl_file_chooser_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like xdp_impl_file_chooser_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_file_chooser_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See xdp_impl_file_chooser_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_file_chooser_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_FILE_CHOOSER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.FileChooser", NULL);
}

/**
 * xdp_impl_file_chooser_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_file_chooser_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_file_chooser_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type XdpImplFileChooserProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplFileChooser *
xdp_impl_file_chooser_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_FILE_CHOOSER (ret);
  else
    return NULL;
}

/**
 * xdp_impl_file_chooser_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like xdp_impl_file_chooser_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_file_chooser_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplFileChooserProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplFileChooser *
xdp_impl_file_chooser_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_FILE_CHOOSER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.FileChooser", NULL);
  if (ret != NULL)
    return XDP_IMPL_FILE_CHOOSER (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * XdpImplFileChooserSkeleton:
 *
 * The #XdpImplFileChooserSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplFileChooserSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplFileChooserSkeleton.
 */

struct _XdpImplFileChooserSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_xdp_impl_file_chooser_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  XdpImplFileChooserSkeleton *skeleton = XDP_IMPL_FILE_CHOOSER_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint num_extra;
  guint n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], XDP_IMPL_TYPE_FILE_CHOOSER);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_FILE_CHOOSER);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    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);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_xdp_impl_file_chooser_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  XdpImplFileChooserSkeleton *skeleton = XDP_IMPL_FILE_CHOOSER_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_file_chooser_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_xdp_impl_file_chooser_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  XdpImplFileChooserSkeleton *skeleton = XDP_IMPL_FILE_CHOOSER_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_file_chooser_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _xdp_impl_file_chooser_skeleton_vtable =
{
  _xdp_impl_file_chooser_skeleton_handle_method_call,
  _xdp_impl_file_chooser_skeleton_handle_get_property,
  _xdp_impl_file_chooser_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
xdp_impl_file_chooser_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return xdp_impl_file_chooser_interface_info ();
}

static GDBusInterfaceVTable *
xdp_impl_file_chooser_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_xdp_impl_file_chooser_skeleton_vtable;
}

static GVariant *
xdp_impl_file_chooser_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  XdpImplFileChooserSkeleton *skeleton = XDP_IMPL_FILE_CHOOSER_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_xdp_impl_file_chooser_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _xdp_impl_file_chooser_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _xdp_impl_file_chooser_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _xdp_impl_file_chooser_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.impl.portal.FileChooser", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
xdp_impl_file_chooser_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void xdp_impl_file_chooser_skeleton_iface_init (XdpImplFileChooserIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplFileChooserSkeleton, xdp_impl_file_chooser_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (XdpImplFileChooserSkeleton)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_FILE_CHOOSER, xdp_impl_file_chooser_skeleton_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplFileChooserSkeleton, xdp_impl_file_chooser_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_FILE_CHOOSER, xdp_impl_file_chooser_skeleton_iface_init));

#endif
static void
xdp_impl_file_chooser_skeleton_finalize (GObject *object)
{
  XdpImplFileChooserSkeleton *skeleton = XDP_IMPL_FILE_CHOOSER_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (xdp_impl_file_chooser_skeleton_parent_class)->finalize (object);
}

static void
xdp_impl_file_chooser_skeleton_init (XdpImplFileChooserSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = xdp_impl_file_chooser_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XDP_IMPL_TYPE_FILE_CHOOSER_SKELETON, XdpImplFileChooserSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
xdp_impl_file_chooser_skeleton_class_init (XdpImplFileChooserSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = xdp_impl_file_chooser_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = xdp_impl_file_chooser_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = xdp_impl_file_chooser_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = xdp_impl_file_chooser_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = xdp_impl_file_chooser_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplFileChooserSkeletonPrivate));
#endif
}

static void
xdp_impl_file_chooser_skeleton_iface_init (XdpImplFileChooserIface *iface)
{
}

/**
 * xdp_impl_file_chooser_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-FileChooser.top_of_page">org.freedesktop.impl.portal.FileChooser</link>.
 *
 * Returns: (transfer full) (type XdpImplFileChooserSkeleton): The skeleton object.
 */
XdpImplFileChooser *
xdp_impl_file_chooser_skeleton_new (void)
{
  return XDP_IMPL_FILE_CHOOSER (g_object_new (XDP_IMPL_TYPE_FILE_CHOOSER_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.impl.portal.AppChooser
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:XdpImplAppChooser
 * @title: XdpImplAppChooser
 * @short_description: Generated C code for the org.freedesktop.impl.portal.AppChooser D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-impl-portal-AppChooser.top_of_page">org.freedesktop.impl.portal.AppChooser</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.impl.portal.AppChooser ---- */

static const _ExtendedGDBusArgInfo _xdp_impl_app_chooser_method_info_choose_application_IN_ARG_handle =
{
  {
    -1,
    (gchar *) "handle",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_app_chooser_method_info_choose_application_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_app_chooser_method_info_choose_application_IN_ARG_parent_window =
{
  {
    -1,
    (gchar *) "parent_window",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_app_chooser_method_info_choose_application_IN_ARG_choices =
{
  {
    -1,
    (gchar *) "choices",
    (gchar *) "as",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_app_chooser_method_info_choose_application_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_app_chooser_method_info_choose_application_IN_ARG_pointers[] =
{
  &_xdp_impl_app_chooser_method_info_choose_application_IN_ARG_handle,
  &_xdp_impl_app_chooser_method_info_choose_application_IN_ARG_app_id,
  &_xdp_impl_app_chooser_method_info_choose_application_IN_ARG_parent_window,
  &_xdp_impl_app_chooser_method_info_choose_application_IN_ARG_choices,
  &_xdp_impl_app_chooser_method_info_choose_application_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusArgInfo _xdp_impl_app_chooser_method_info_choose_application_OUT_ARG_response =
{
  {
    -1,
    (gchar *) "response",
    (gchar *) "u",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_app_chooser_method_info_choose_application_OUT_ARG_results =
{
  {
    -1,
    (gchar *) "results",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_app_chooser_method_info_choose_application_OUT_ARG_pointers[] =
{
  &_xdp_impl_app_chooser_method_info_choose_application_OUT_ARG_response,
  &_xdp_impl_app_chooser_method_info_choose_application_OUT_ARG_results,
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_app_chooser_method_choose_application_annotation_info_0 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In4",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_app_chooser_method_choose_application_annotation_info_1 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out1",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo * const _xdp_impl_app_chooser_method_choose_application_annotation_info_pointers[] =
{
  &_xdp_impl_app_chooser_method_choose_application_annotation_info_0,
  &_xdp_impl_app_chooser_method_choose_application_annotation_info_1,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_app_chooser_method_info_choose_application =
{
  {
    -1,
    (gchar *) "ChooseApplication",
    (GDBusArgInfo **) &_xdp_impl_app_chooser_method_info_choose_application_IN_ARG_pointers,
    (GDBusArgInfo **) &_xdp_impl_app_chooser_method_info_choose_application_OUT_ARG_pointers,
    (GDBusAnnotationInfo **) &_xdp_impl_app_chooser_method_choose_application_annotation_info_pointers
  },
  "handle-choose-application",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _xdp_impl_app_chooser_method_info_pointers[] =
{
  &_xdp_impl_app_chooser_method_info_choose_application,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _xdp_impl_app_chooser_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.impl.portal.AppChooser",
    (GDBusMethodInfo **) &_xdp_impl_app_chooser_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "app-chooser",
};


/**
 * xdp_impl_app_chooser_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-impl-portal-AppChooser.top_of_page">org.freedesktop.impl.portal.AppChooser</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
xdp_impl_app_chooser_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_xdp_impl_app_chooser_interface_info.parent_struct;
}

/**
 * xdp_impl_app_chooser_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #XdpImplAppChooser interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
xdp_impl_app_chooser_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * XdpImplAppChooser:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-AppChooser.top_of_page">org.freedesktop.impl.portal.AppChooser</link>.
 */

/**
 * XdpImplAppChooserIface:
 * @parent_iface: The parent interface.
 * @handle_choose_application: Handler for the #XdpImplAppChooser::handle-choose-application signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-AppChooser.top_of_page">org.freedesktop.impl.portal.AppChooser</link>.
 */

typedef XdpImplAppChooserIface XdpImplAppChooserInterface;
G_DEFINE_INTERFACE (XdpImplAppChooser, xdp_impl_app_chooser, G_TYPE_OBJECT);

static void
xdp_impl_app_chooser_default_init (XdpImplAppChooserIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * XdpImplAppChooser::handle-choose-application:
   * @object: A #XdpImplAppChooser.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_handle: Argument passed by remote caller.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_parent_window: Argument passed by remote caller.
   * @arg_choices: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-AppChooser.ChooseApplication">ChooseApplication()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_app_chooser_complete_choose_application() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-choose-application",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplAppChooserIface, handle_choose_application),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    6,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV, G_TYPE_VARIANT);

}

/**
 * xdp_impl_app_chooser_call_choose_application:
 * @proxy: A #XdpImplAppChooserProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_choices: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-AppChooser.ChooseApplication">ChooseApplication()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_app_chooser_call_choose_application_finish() to get the result of the operation.
 *
 * See xdp_impl_app_chooser_call_choose_application_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_app_chooser_call_choose_application (
    XdpImplAppChooser *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *const *arg_choices,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "ChooseApplication",
    g_variant_new ("(oss^as@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_choices,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_app_chooser_call_choose_application_finish:
 * @proxy: A #XdpImplAppChooserProxy.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_app_chooser_call_choose_application().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_app_chooser_call_choose_application().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_app_chooser_call_choose_application_finish (
    XdpImplAppChooser *proxy,
    guint *out_response,
    GVariant **out_results,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_app_chooser_call_choose_application_sync:
 * @proxy: A #XdpImplAppChooserProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_choices: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-AppChooser.ChooseApplication">ChooseApplication()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_app_chooser_call_choose_application() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_app_chooser_call_choose_application_sync (
    XdpImplAppChooser *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *const *arg_choices,
    GVariant *arg_options,
    guint *out_response,
    GVariant **out_results,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "ChooseApplication",
    g_variant_new ("(oss^as@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_choices,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_app_chooser_complete_choose_application:
 * @object: A #XdpImplAppChooser.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @response: Parameter to return.
 * @results: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-AppChooser.ChooseApplication">ChooseApplication()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_app_chooser_complete_choose_application (
    XdpImplAppChooser *object,
    GDBusMethodInvocation *invocation,
    guint response,
    GVariant *results)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(u@a{sv})",
                   response,
                   results));
}

/* ------------------------------------------------------------------------ */

/**
 * XdpImplAppChooserProxy:
 *
 * The #XdpImplAppChooserProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplAppChooserProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplAppChooserProxy.
 */

struct _XdpImplAppChooserProxyPrivate
{
  GData *qdata;
};

static void xdp_impl_app_chooser_proxy_iface_init (XdpImplAppChooserIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplAppChooserProxy, xdp_impl_app_chooser_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (XdpImplAppChooserProxy)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_APP_CHOOSER, xdp_impl_app_chooser_proxy_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplAppChooserProxy, xdp_impl_app_chooser_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_APP_CHOOSER, xdp_impl_app_chooser_proxy_iface_init));

#endif
static void
xdp_impl_app_chooser_proxy_finalize (GObject *object)
{
  XdpImplAppChooserProxy *proxy = XDP_IMPL_APP_CHOOSER_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (xdp_impl_app_chooser_proxy_parent_class)->finalize (object);
}

static void
xdp_impl_app_chooser_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_app_chooser_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_app_chooser_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xdp_impl_app_chooser_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], XDP_IMPL_TYPE_APP_CHOOSER);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_APP_CHOOSER);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
xdp_impl_app_chooser_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  XdpImplAppChooserProxy *proxy = XDP_IMPL_APP_CHOOSER_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_app_chooser_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_app_chooser_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
xdp_impl_app_chooser_proxy_init (XdpImplAppChooserProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = xdp_impl_app_chooser_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XDP_IMPL_TYPE_APP_CHOOSER_PROXY, XdpImplAppChooserProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xdp_impl_app_chooser_interface_info ());
}

static void
xdp_impl_app_chooser_proxy_class_init (XdpImplAppChooserProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = xdp_impl_app_chooser_proxy_finalize;
  gobject_class->get_property = xdp_impl_app_chooser_proxy_get_property;
  gobject_class->set_property = xdp_impl_app_chooser_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = xdp_impl_app_chooser_proxy_g_signal;
  proxy_class->g_properties_changed = xdp_impl_app_chooser_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplAppChooserProxyPrivate));
#endif
}

static void
xdp_impl_app_chooser_proxy_iface_init (XdpImplAppChooserIface *iface)
{
}

/**
 * xdp_impl_app_chooser_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-AppChooser.top_of_page">org.freedesktop.impl.portal.AppChooser</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_app_chooser_proxy_new_finish() to get the result of the operation.
 *
 * See xdp_impl_app_chooser_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_app_chooser_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_APP_CHOOSER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.AppChooser", NULL);
}

/**
 * xdp_impl_app_chooser_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_app_chooser_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_app_chooser_proxy_new().
 *
 * Returns: (transfer full) (type XdpImplAppChooserProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplAppChooser *
xdp_impl_app_chooser_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_APP_CHOOSER (ret);
  else
    return NULL;
}

/**
 * xdp_impl_app_chooser_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-AppChooser.top_of_page">org.freedesktop.impl.portal.AppChooser</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_app_chooser_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplAppChooserProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplAppChooser *
xdp_impl_app_chooser_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_APP_CHOOSER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.AppChooser", NULL);
  if (ret != NULL)
    return XDP_IMPL_APP_CHOOSER (ret);
  else
    return NULL;
}


/**
 * xdp_impl_app_chooser_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like xdp_impl_app_chooser_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_app_chooser_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See xdp_impl_app_chooser_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_app_chooser_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_APP_CHOOSER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.AppChooser", NULL);
}

/**
 * xdp_impl_app_chooser_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_app_chooser_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_app_chooser_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type XdpImplAppChooserProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplAppChooser *
xdp_impl_app_chooser_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_APP_CHOOSER (ret);
  else
    return NULL;
}

/**
 * xdp_impl_app_chooser_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like xdp_impl_app_chooser_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_app_chooser_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplAppChooserProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplAppChooser *
xdp_impl_app_chooser_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_APP_CHOOSER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.AppChooser", NULL);
  if (ret != NULL)
    return XDP_IMPL_APP_CHOOSER (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * XdpImplAppChooserSkeleton:
 *
 * The #XdpImplAppChooserSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplAppChooserSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplAppChooserSkeleton.
 */

struct _XdpImplAppChooserSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_xdp_impl_app_chooser_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  XdpImplAppChooserSkeleton *skeleton = XDP_IMPL_APP_CHOOSER_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint num_extra;
  guint n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], XDP_IMPL_TYPE_APP_CHOOSER);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_APP_CHOOSER);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    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);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_xdp_impl_app_chooser_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  XdpImplAppChooserSkeleton *skeleton = XDP_IMPL_APP_CHOOSER_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_app_chooser_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_xdp_impl_app_chooser_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  XdpImplAppChooserSkeleton *skeleton = XDP_IMPL_APP_CHOOSER_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_app_chooser_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _xdp_impl_app_chooser_skeleton_vtable =
{
  _xdp_impl_app_chooser_skeleton_handle_method_call,
  _xdp_impl_app_chooser_skeleton_handle_get_property,
  _xdp_impl_app_chooser_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
xdp_impl_app_chooser_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return xdp_impl_app_chooser_interface_info ();
}

static GDBusInterfaceVTable *
xdp_impl_app_chooser_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_xdp_impl_app_chooser_skeleton_vtable;
}

static GVariant *
xdp_impl_app_chooser_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  XdpImplAppChooserSkeleton *skeleton = XDP_IMPL_APP_CHOOSER_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_xdp_impl_app_chooser_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _xdp_impl_app_chooser_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _xdp_impl_app_chooser_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _xdp_impl_app_chooser_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.impl.portal.AppChooser", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
xdp_impl_app_chooser_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void xdp_impl_app_chooser_skeleton_iface_init (XdpImplAppChooserIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplAppChooserSkeleton, xdp_impl_app_chooser_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (XdpImplAppChooserSkeleton)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_APP_CHOOSER, xdp_impl_app_chooser_skeleton_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplAppChooserSkeleton, xdp_impl_app_chooser_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_APP_CHOOSER, xdp_impl_app_chooser_skeleton_iface_init));

#endif
static void
xdp_impl_app_chooser_skeleton_finalize (GObject *object)
{
  XdpImplAppChooserSkeleton *skeleton = XDP_IMPL_APP_CHOOSER_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (xdp_impl_app_chooser_skeleton_parent_class)->finalize (object);
}

static void
xdp_impl_app_chooser_skeleton_init (XdpImplAppChooserSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = xdp_impl_app_chooser_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XDP_IMPL_TYPE_APP_CHOOSER_SKELETON, XdpImplAppChooserSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
xdp_impl_app_chooser_skeleton_class_init (XdpImplAppChooserSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = xdp_impl_app_chooser_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = xdp_impl_app_chooser_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = xdp_impl_app_chooser_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = xdp_impl_app_chooser_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = xdp_impl_app_chooser_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplAppChooserSkeletonPrivate));
#endif
}

static void
xdp_impl_app_chooser_skeleton_iface_init (XdpImplAppChooserIface *iface)
{
}

/**
 * xdp_impl_app_chooser_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-AppChooser.top_of_page">org.freedesktop.impl.portal.AppChooser</link>.
 *
 * Returns: (transfer full) (type XdpImplAppChooserSkeleton): The skeleton object.
 */
XdpImplAppChooser *
xdp_impl_app_chooser_skeleton_new (void)
{
  return XDP_IMPL_APP_CHOOSER (g_object_new (XDP_IMPL_TYPE_APP_CHOOSER_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.impl.portal.Print
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:XdpImplPrint
 * @title: XdpImplPrint
 * @short_description: Generated C code for the org.freedesktop.impl.portal.Print D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Print.top_of_page">org.freedesktop.impl.portal.Print</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.impl.portal.Print ---- */

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_print_IN_ARG_handle =
{
  {
    -1,
    (gchar *) "handle",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_print_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_print_IN_ARG_parent_window =
{
  {
    -1,
    (gchar *) "parent_window",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_print_IN_ARG_title =
{
  {
    -1,
    (gchar *) "title",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_print_IN_ARG_fd =
{
  {
    -1,
    (gchar *) "fd",
    (gchar *) "h",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_print_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_print_method_info_print_IN_ARG_pointers[] =
{
  &_xdp_impl_print_method_info_print_IN_ARG_handle,
  &_xdp_impl_print_method_info_print_IN_ARG_app_id,
  &_xdp_impl_print_method_info_print_IN_ARG_parent_window,
  &_xdp_impl_print_method_info_print_IN_ARG_title,
  &_xdp_impl_print_method_info_print_IN_ARG_fd,
  &_xdp_impl_print_method_info_print_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_print_OUT_ARG_response =
{
  {
    -1,
    (gchar *) "response",
    (gchar *) "u",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_print_OUT_ARG_results =
{
  {
    -1,
    (gchar *) "results",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_print_method_info_print_OUT_ARG_pointers[] =
{
  &_xdp_impl_print_method_info_print_OUT_ARG_response,
  &_xdp_impl_print_method_info_print_OUT_ARG_results,
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_print_method_print_annotation_info_0 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In5",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_print_method_print_annotation_info_1 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out1",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo * const _xdp_impl_print_method_print_annotation_info_pointers[] =
{
  &_xdp_impl_print_method_print_annotation_info_0,
  &_xdp_impl_print_method_print_annotation_info_1,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_print_method_info_print =
{
  {
    -1,
    (gchar *) "Print",
    (GDBusArgInfo **) &_xdp_impl_print_method_info_print_IN_ARG_pointers,
    (GDBusArgInfo **) &_xdp_impl_print_method_info_print_OUT_ARG_pointers,
    (GDBusAnnotationInfo **) &_xdp_impl_print_method_print_annotation_info_pointers
  },
  "handle-print",
  TRUE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_IN_ARG_handle =
{
  {
    -1,
    (gchar *) "handle",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_IN_ARG_parent_window =
{
  {
    -1,
    (gchar *) "parent_window",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_IN_ARG_title =
{
  {
    -1,
    (gchar *) "title",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_IN_ARG_settings =
{
  {
    -1,
    (gchar *) "settings",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_IN_ARG_page_setup =
{
  {
    -1,
    (gchar *) "page_setup",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_print_method_info_prepare_print_IN_ARG_pointers[] =
{
  &_xdp_impl_print_method_info_prepare_print_IN_ARG_handle,
  &_xdp_impl_print_method_info_prepare_print_IN_ARG_app_id,
  &_xdp_impl_print_method_info_prepare_print_IN_ARG_parent_window,
  &_xdp_impl_print_method_info_prepare_print_IN_ARG_title,
  &_xdp_impl_print_method_info_prepare_print_IN_ARG_settings,
  &_xdp_impl_print_method_info_prepare_print_IN_ARG_page_setup,
  &_xdp_impl_print_method_info_prepare_print_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_OUT_ARG_response =
{
  {
    -1,
    (gchar *) "response",
    (gchar *) "u",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_print_method_info_prepare_print_OUT_ARG_results =
{
  {
    -1,
    (gchar *) "results",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_print_method_info_prepare_print_OUT_ARG_pointers[] =
{
  &_xdp_impl_print_method_info_prepare_print_OUT_ARG_response,
  &_xdp_impl_print_method_info_prepare_print_OUT_ARG_results,
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_print_method_prepare_print_annotation_info_0 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In4",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_print_method_prepare_print_annotation_info_1 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In5",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_print_method_prepare_print_annotation_info_2 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In6",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_print_method_prepare_print_annotation_info_3 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out1",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo * const _xdp_impl_print_method_prepare_print_annotation_info_pointers[] =
{
  &_xdp_impl_print_method_prepare_print_annotation_info_0,
  &_xdp_impl_print_method_prepare_print_annotation_info_1,
  &_xdp_impl_print_method_prepare_print_annotation_info_2,
  &_xdp_impl_print_method_prepare_print_annotation_info_3,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_print_method_info_prepare_print =
{
  {
    -1,
    (gchar *) "PreparePrint",
    (GDBusArgInfo **) &_xdp_impl_print_method_info_prepare_print_IN_ARG_pointers,
    (GDBusArgInfo **) &_xdp_impl_print_method_info_prepare_print_OUT_ARG_pointers,
    (GDBusAnnotationInfo **) &_xdp_impl_print_method_prepare_print_annotation_info_pointers
  },
  "handle-prepare-print",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _xdp_impl_print_method_info_pointers[] =
{
  &_xdp_impl_print_method_info_print,
  &_xdp_impl_print_method_info_prepare_print,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _xdp_impl_print_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.impl.portal.Print",
    (GDBusMethodInfo **) &_xdp_impl_print_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "print",
};


/**
 * xdp_impl_print_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Print.top_of_page">org.freedesktop.impl.portal.Print</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
xdp_impl_print_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_xdp_impl_print_interface_info.parent_struct;
}

/**
 * xdp_impl_print_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #XdpImplPrint interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
xdp_impl_print_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * XdpImplPrint:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Print.top_of_page">org.freedesktop.impl.portal.Print</link>.
 */

/**
 * XdpImplPrintIface:
 * @parent_iface: The parent interface.
 * @handle_prepare_print: Handler for the #XdpImplPrint::handle-prepare-print signal.
 * @handle_print: Handler for the #XdpImplPrint::handle-print signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Print.top_of_page">org.freedesktop.impl.portal.Print</link>.
 */

typedef XdpImplPrintIface XdpImplPrintInterface;
G_DEFINE_INTERFACE (XdpImplPrint, xdp_impl_print, G_TYPE_OBJECT);

static void
xdp_impl_print_default_init (XdpImplPrintIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * XdpImplPrint::handle-print:
   * @object: A #XdpImplPrint.
   * @invocation: A #GDBusMethodInvocation.
   * @fd_list: (allow-none): A #GUnixFDList or %NULL.
   * @arg_handle: Argument passed by remote caller.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_parent_window: Argument passed by remote caller.
   * @arg_title: Argument passed by remote caller.
   * @arg_fd: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-Print.Print">Print()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_print_complete_print() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-print",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplPrintIface, handle_print),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    8,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UNIX_FD_LIST, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT);

  /**
   * XdpImplPrint::handle-prepare-print:
   * @object: A #XdpImplPrint.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_handle: Argument passed by remote caller.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_parent_window: Argument passed by remote caller.
   * @arg_title: Argument passed by remote caller.
   * @arg_settings: Argument passed by remote caller.
   * @arg_page_setup: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-Print.PreparePrint">PreparePrint()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_print_complete_prepare_print() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-prepare-print",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplPrintIface, handle_prepare_print),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    8,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_VARIANT);

}

/**
 * xdp_impl_print_call_print:
 * @proxy: A #XdpImplPrintProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_fd: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Print.Print">Print()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_print_call_print_finish() to get the result of the operation.
 *
 * See xdp_impl_print_call_print_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_print_call_print (
    XdpImplPrint *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    GVariant *arg_fd,
    GVariant *arg_options,
    GUnixFDList *fd_list,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
    "Print",
    g_variant_new ("(osss@h@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_fd,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    fd_list,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_print_call_print_finish:
 * @proxy: A #XdpImplPrintProxy.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_print_call_print().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_print_call_print().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_print_call_print_finish (
    XdpImplPrint *proxy,
    guint *out_response,
    GVariant **out_results,
    GUnixFDList **out_fd_list,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_print_call_print_sync:
 * @proxy: A #XdpImplPrintProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_fd: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Print.Print">Print()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_print_call_print() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_print_call_print_sync (
    XdpImplPrint *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    GVariant *arg_fd,
    GVariant *arg_options,
    GUnixFDList  *fd_list,
    guint *out_response,
    GVariant **out_results,
    GUnixFDList **out_fd_list,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
    "Print",
    g_variant_new ("(osss@h@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_fd,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    fd_list,
    out_fd_list,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_print_call_prepare_print:
 * @proxy: A #XdpImplPrintProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_settings: Argument to pass with the method invocation.
 * @arg_page_setup: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Print.PreparePrint">PreparePrint()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_print_call_prepare_print_finish() to get the result of the operation.
 *
 * See xdp_impl_print_call_prepare_print_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_print_call_prepare_print (
    XdpImplPrint *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    GVariant *arg_settings,
    GVariant *arg_page_setup,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "PreparePrint",
    g_variant_new ("(osss@a{sv}@a{sv}@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_settings,
                   arg_page_setup,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_print_call_prepare_print_finish:
 * @proxy: A #XdpImplPrintProxy.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_print_call_prepare_print().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_print_call_prepare_print().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_print_call_prepare_print_finish (
    XdpImplPrint *proxy,
    guint *out_response,
    GVariant **out_results,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_print_call_prepare_print_sync:
 * @proxy: A #XdpImplPrintProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_settings: Argument to pass with the method invocation.
 * @arg_page_setup: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Print.PreparePrint">PreparePrint()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_print_call_prepare_print() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_print_call_prepare_print_sync (
    XdpImplPrint *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    GVariant *arg_settings,
    GVariant *arg_page_setup,
    GVariant *arg_options,
    guint *out_response,
    GVariant **out_results,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "PreparePrint",
    g_variant_new ("(osss@a{sv}@a{sv}@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_settings,
                   arg_page_setup,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_print_complete_print:
 * @object: A #XdpImplPrint.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
 * @response: Parameter to return.
 * @results: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-Print.Print">Print()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_print_complete_print (
    XdpImplPrint *object,
    GDBusMethodInvocation *invocation,
    GUnixFDList *fd_list,
    guint response,
    GVariant *results)
{
  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
    g_variant_new ("(u@a{sv})",
                   response,
                   results),
    fd_list);
}

/**
 * xdp_impl_print_complete_prepare_print:
 * @object: A #XdpImplPrint.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @response: Parameter to return.
 * @results: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-Print.PreparePrint">PreparePrint()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_print_complete_prepare_print (
    XdpImplPrint *object,
    GDBusMethodInvocation *invocation,
    guint response,
    GVariant *results)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(u@a{sv})",
                   response,
                   results));
}

/* ------------------------------------------------------------------------ */

/**
 * XdpImplPrintProxy:
 *
 * The #XdpImplPrintProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplPrintProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplPrintProxy.
 */

struct _XdpImplPrintProxyPrivate
{
  GData *qdata;
};

static void xdp_impl_print_proxy_iface_init (XdpImplPrintIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplPrintProxy, xdp_impl_print_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (XdpImplPrintProxy)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_PRINT, xdp_impl_print_proxy_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplPrintProxy, xdp_impl_print_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_PRINT, xdp_impl_print_proxy_iface_init));

#endif
static void
xdp_impl_print_proxy_finalize (GObject *object)
{
  XdpImplPrintProxy *proxy = XDP_IMPL_PRINT_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (xdp_impl_print_proxy_parent_class)->finalize (object);
}

static void
xdp_impl_print_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_print_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_print_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xdp_impl_print_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], XDP_IMPL_TYPE_PRINT);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_PRINT);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
xdp_impl_print_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  XdpImplPrintProxy *proxy = XDP_IMPL_PRINT_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_print_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_print_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
xdp_impl_print_proxy_init (XdpImplPrintProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = xdp_impl_print_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XDP_IMPL_TYPE_PRINT_PROXY, XdpImplPrintProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xdp_impl_print_interface_info ());
}

static void
xdp_impl_print_proxy_class_init (XdpImplPrintProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = xdp_impl_print_proxy_finalize;
  gobject_class->get_property = xdp_impl_print_proxy_get_property;
  gobject_class->set_property = xdp_impl_print_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = xdp_impl_print_proxy_g_signal;
  proxy_class->g_properties_changed = xdp_impl_print_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplPrintProxyPrivate));
#endif
}

static void
xdp_impl_print_proxy_iface_init (XdpImplPrintIface *iface)
{
}

/**
 * xdp_impl_print_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Print.top_of_page">org.freedesktop.impl.portal.Print</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_print_proxy_new_finish() to get the result of the operation.
 *
 * See xdp_impl_print_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_print_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_PRINT_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Print", NULL);
}

/**
 * xdp_impl_print_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_print_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_print_proxy_new().
 *
 * Returns: (transfer full) (type XdpImplPrintProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplPrint *
xdp_impl_print_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_PRINT (ret);
  else
    return NULL;
}

/**
 * xdp_impl_print_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Print.top_of_page">org.freedesktop.impl.portal.Print</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_print_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplPrintProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplPrint *
xdp_impl_print_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_PRINT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Print", NULL);
  if (ret != NULL)
    return XDP_IMPL_PRINT (ret);
  else
    return NULL;
}


/**
 * xdp_impl_print_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like xdp_impl_print_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_print_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See xdp_impl_print_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_print_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_PRINT_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Print", NULL);
}

/**
 * xdp_impl_print_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_print_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_print_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type XdpImplPrintProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplPrint *
xdp_impl_print_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_PRINT (ret);
  else
    return NULL;
}

/**
 * xdp_impl_print_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like xdp_impl_print_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_print_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplPrintProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplPrint *
xdp_impl_print_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_PRINT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Print", NULL);
  if (ret != NULL)
    return XDP_IMPL_PRINT (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * XdpImplPrintSkeleton:
 *
 * The #XdpImplPrintSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplPrintSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplPrintSkeleton.
 */

struct _XdpImplPrintSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_xdp_impl_print_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  XdpImplPrintSkeleton *skeleton = XDP_IMPL_PRINT_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint num_extra;
  guint n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], XDP_IMPL_TYPE_PRINT);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_PRINT);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    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);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_xdp_impl_print_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  XdpImplPrintSkeleton *skeleton = XDP_IMPL_PRINT_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_print_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_xdp_impl_print_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  XdpImplPrintSkeleton *skeleton = XDP_IMPL_PRINT_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_print_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _xdp_impl_print_skeleton_vtable =
{
  _xdp_impl_print_skeleton_handle_method_call,
  _xdp_impl_print_skeleton_handle_get_property,
  _xdp_impl_print_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
xdp_impl_print_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return xdp_impl_print_interface_info ();
}

static GDBusInterfaceVTable *
xdp_impl_print_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_xdp_impl_print_skeleton_vtable;
}

static GVariant *
xdp_impl_print_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  XdpImplPrintSkeleton *skeleton = XDP_IMPL_PRINT_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_xdp_impl_print_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _xdp_impl_print_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _xdp_impl_print_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _xdp_impl_print_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.impl.portal.Print", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
xdp_impl_print_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void xdp_impl_print_skeleton_iface_init (XdpImplPrintIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplPrintSkeleton, xdp_impl_print_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (XdpImplPrintSkeleton)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_PRINT, xdp_impl_print_skeleton_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplPrintSkeleton, xdp_impl_print_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_PRINT, xdp_impl_print_skeleton_iface_init));

#endif
static void
xdp_impl_print_skeleton_finalize (GObject *object)
{
  XdpImplPrintSkeleton *skeleton = XDP_IMPL_PRINT_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (xdp_impl_print_skeleton_parent_class)->finalize (object);
}

static void
xdp_impl_print_skeleton_init (XdpImplPrintSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = xdp_impl_print_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XDP_IMPL_TYPE_PRINT_SKELETON, XdpImplPrintSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
xdp_impl_print_skeleton_class_init (XdpImplPrintSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = xdp_impl_print_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = xdp_impl_print_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = xdp_impl_print_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = xdp_impl_print_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = xdp_impl_print_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplPrintSkeletonPrivate));
#endif
}

static void
xdp_impl_print_skeleton_iface_init (XdpImplPrintIface *iface)
{
}

/**
 * xdp_impl_print_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Print.top_of_page">org.freedesktop.impl.portal.Print</link>.
 *
 * Returns: (transfer full) (type XdpImplPrintSkeleton): The skeleton object.
 */
XdpImplPrint *
xdp_impl_print_skeleton_new (void)
{
  return XDP_IMPL_PRINT (g_object_new (XDP_IMPL_TYPE_PRINT_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.impl.portal.Screenshot
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:XdpImplScreenshot
 * @title: XdpImplScreenshot
 * @short_description: Generated C code for the org.freedesktop.impl.portal.Screenshot D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Screenshot.top_of_page">org.freedesktop.impl.portal.Screenshot</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.impl.portal.Screenshot ---- */

static const _ExtendedGDBusArgInfo _xdp_impl_screenshot_method_info_screenshot_IN_ARG_handle =
{
  {
    -1,
    (gchar *) "handle",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_screenshot_method_info_screenshot_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_screenshot_method_info_screenshot_IN_ARG_parent_window =
{
  {
    -1,
    (gchar *) "parent_window",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_screenshot_method_info_screenshot_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_screenshot_method_info_screenshot_IN_ARG_pointers[] =
{
  &_xdp_impl_screenshot_method_info_screenshot_IN_ARG_handle,
  &_xdp_impl_screenshot_method_info_screenshot_IN_ARG_app_id,
  &_xdp_impl_screenshot_method_info_screenshot_IN_ARG_parent_window,
  &_xdp_impl_screenshot_method_info_screenshot_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusArgInfo _xdp_impl_screenshot_method_info_screenshot_OUT_ARG_response =
{
  {
    -1,
    (gchar *) "response",
    (gchar *) "u",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_screenshot_method_info_screenshot_OUT_ARG_results =
{
  {
    -1,
    (gchar *) "results",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_screenshot_method_info_screenshot_OUT_ARG_pointers[] =
{
  &_xdp_impl_screenshot_method_info_screenshot_OUT_ARG_response,
  &_xdp_impl_screenshot_method_info_screenshot_OUT_ARG_results,
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_screenshot_method_screenshot_annotation_info_0 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In3",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_screenshot_method_screenshot_annotation_info_1 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.Out1",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo * const _xdp_impl_screenshot_method_screenshot_annotation_info_pointers[] =
{
  &_xdp_impl_screenshot_method_screenshot_annotation_info_0,
  &_xdp_impl_screenshot_method_screenshot_annotation_info_1,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_screenshot_method_info_screenshot =
{
  {
    -1,
    (gchar *) "Screenshot",
    (GDBusArgInfo **) &_xdp_impl_screenshot_method_info_screenshot_IN_ARG_pointers,
    (GDBusArgInfo **) &_xdp_impl_screenshot_method_info_screenshot_OUT_ARG_pointers,
    (GDBusAnnotationInfo **) &_xdp_impl_screenshot_method_screenshot_annotation_info_pointers
  },
  "handle-screenshot",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _xdp_impl_screenshot_method_info_pointers[] =
{
  &_xdp_impl_screenshot_method_info_screenshot,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _xdp_impl_screenshot_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.impl.portal.Screenshot",
    (GDBusMethodInfo **) &_xdp_impl_screenshot_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "screenshot",
};


/**
 * xdp_impl_screenshot_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Screenshot.top_of_page">org.freedesktop.impl.portal.Screenshot</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
xdp_impl_screenshot_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_xdp_impl_screenshot_interface_info.parent_struct;
}

/**
 * xdp_impl_screenshot_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #XdpImplScreenshot interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
xdp_impl_screenshot_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * XdpImplScreenshot:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Screenshot.top_of_page">org.freedesktop.impl.portal.Screenshot</link>.
 */

/**
 * XdpImplScreenshotIface:
 * @parent_iface: The parent interface.
 * @handle_screenshot: Handler for the #XdpImplScreenshot::handle-screenshot signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Screenshot.top_of_page">org.freedesktop.impl.portal.Screenshot</link>.
 */

typedef XdpImplScreenshotIface XdpImplScreenshotInterface;
G_DEFINE_INTERFACE (XdpImplScreenshot, xdp_impl_screenshot, G_TYPE_OBJECT);

static void
xdp_impl_screenshot_default_init (XdpImplScreenshotIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * XdpImplScreenshot::handle-screenshot:
   * @object: A #XdpImplScreenshot.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_handle: Argument passed by remote caller.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_parent_window: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-Screenshot.Screenshot">Screenshot()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_screenshot_complete_screenshot() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-screenshot",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplScreenshotIface, handle_screenshot),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    5,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);

}

/**
 * xdp_impl_screenshot_call_screenshot:
 * @proxy: A #XdpImplScreenshotProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Screenshot.Screenshot">Screenshot()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_screenshot_call_screenshot_finish() to get the result of the operation.
 *
 * See xdp_impl_screenshot_call_screenshot_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_screenshot_call_screenshot (
    XdpImplScreenshot *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Screenshot",
    g_variant_new ("(oss@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_screenshot_call_screenshot_finish:
 * @proxy: A #XdpImplScreenshotProxy.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_screenshot_call_screenshot().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_screenshot_call_screenshot().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_screenshot_call_screenshot_finish (
    XdpImplScreenshot *proxy,
    guint *out_response,
    GVariant **out_results,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_screenshot_call_screenshot_sync:
 * @proxy: A #XdpImplScreenshotProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Screenshot.Screenshot">Screenshot()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_screenshot_call_screenshot() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_screenshot_call_screenshot_sync (
    XdpImplScreenshot *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    GVariant *arg_options,
    guint *out_response,
    GVariant **out_results,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Screenshot",
    g_variant_new ("(oss@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_screenshot_complete_screenshot:
 * @object: A #XdpImplScreenshot.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @response: Parameter to return.
 * @results: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-Screenshot.Screenshot">Screenshot()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_screenshot_complete_screenshot (
    XdpImplScreenshot *object,
    GDBusMethodInvocation *invocation,
    guint response,
    GVariant *results)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(u@a{sv})",
                   response,
                   results));
}

/* ------------------------------------------------------------------------ */

/**
 * XdpImplScreenshotProxy:
 *
 * The #XdpImplScreenshotProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplScreenshotProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplScreenshotProxy.
 */

struct _XdpImplScreenshotProxyPrivate
{
  GData *qdata;
};

static void xdp_impl_screenshot_proxy_iface_init (XdpImplScreenshotIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplScreenshotProxy, xdp_impl_screenshot_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (XdpImplScreenshotProxy)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_SCREENSHOT, xdp_impl_screenshot_proxy_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplScreenshotProxy, xdp_impl_screenshot_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_SCREENSHOT, xdp_impl_screenshot_proxy_iface_init));

#endif
static void
xdp_impl_screenshot_proxy_finalize (GObject *object)
{
  XdpImplScreenshotProxy *proxy = XDP_IMPL_SCREENSHOT_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (xdp_impl_screenshot_proxy_parent_class)->finalize (object);
}

static void
xdp_impl_screenshot_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_screenshot_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_screenshot_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xdp_impl_screenshot_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], XDP_IMPL_TYPE_SCREENSHOT);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_SCREENSHOT);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
xdp_impl_screenshot_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  XdpImplScreenshotProxy *proxy = XDP_IMPL_SCREENSHOT_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_screenshot_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_screenshot_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
xdp_impl_screenshot_proxy_init (XdpImplScreenshotProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = xdp_impl_screenshot_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XDP_IMPL_TYPE_SCREENSHOT_PROXY, XdpImplScreenshotProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xdp_impl_screenshot_interface_info ());
}

static void
xdp_impl_screenshot_proxy_class_init (XdpImplScreenshotProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = xdp_impl_screenshot_proxy_finalize;
  gobject_class->get_property = xdp_impl_screenshot_proxy_get_property;
  gobject_class->set_property = xdp_impl_screenshot_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = xdp_impl_screenshot_proxy_g_signal;
  proxy_class->g_properties_changed = xdp_impl_screenshot_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplScreenshotProxyPrivate));
#endif
}

static void
xdp_impl_screenshot_proxy_iface_init (XdpImplScreenshotIface *iface)
{
}

/**
 * xdp_impl_screenshot_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Screenshot.top_of_page">org.freedesktop.impl.portal.Screenshot</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_screenshot_proxy_new_finish() to get the result of the operation.
 *
 * See xdp_impl_screenshot_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_screenshot_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_SCREENSHOT_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Screenshot", NULL);
}

/**
 * xdp_impl_screenshot_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_screenshot_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_screenshot_proxy_new().
 *
 * Returns: (transfer full) (type XdpImplScreenshotProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplScreenshot *
xdp_impl_screenshot_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_SCREENSHOT (ret);
  else
    return NULL;
}

/**
 * xdp_impl_screenshot_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Screenshot.top_of_page">org.freedesktop.impl.portal.Screenshot</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_screenshot_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplScreenshotProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplScreenshot *
xdp_impl_screenshot_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_SCREENSHOT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Screenshot", NULL);
  if (ret != NULL)
    return XDP_IMPL_SCREENSHOT (ret);
  else
    return NULL;
}


/**
 * xdp_impl_screenshot_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like xdp_impl_screenshot_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_screenshot_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See xdp_impl_screenshot_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_screenshot_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_SCREENSHOT_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Screenshot", NULL);
}

/**
 * xdp_impl_screenshot_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_screenshot_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_screenshot_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type XdpImplScreenshotProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplScreenshot *
xdp_impl_screenshot_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_SCREENSHOT (ret);
  else
    return NULL;
}

/**
 * xdp_impl_screenshot_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like xdp_impl_screenshot_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_screenshot_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplScreenshotProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplScreenshot *
xdp_impl_screenshot_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_SCREENSHOT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Screenshot", NULL);
  if (ret != NULL)
    return XDP_IMPL_SCREENSHOT (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * XdpImplScreenshotSkeleton:
 *
 * The #XdpImplScreenshotSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplScreenshotSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplScreenshotSkeleton.
 */

struct _XdpImplScreenshotSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_xdp_impl_screenshot_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  XdpImplScreenshotSkeleton *skeleton = XDP_IMPL_SCREENSHOT_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint num_extra;
  guint n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], XDP_IMPL_TYPE_SCREENSHOT);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_SCREENSHOT);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    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);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_xdp_impl_screenshot_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  XdpImplScreenshotSkeleton *skeleton = XDP_IMPL_SCREENSHOT_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_screenshot_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_xdp_impl_screenshot_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  XdpImplScreenshotSkeleton *skeleton = XDP_IMPL_SCREENSHOT_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_screenshot_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _xdp_impl_screenshot_skeleton_vtable =
{
  _xdp_impl_screenshot_skeleton_handle_method_call,
  _xdp_impl_screenshot_skeleton_handle_get_property,
  _xdp_impl_screenshot_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
xdp_impl_screenshot_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return xdp_impl_screenshot_interface_info ();
}

static GDBusInterfaceVTable *
xdp_impl_screenshot_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_xdp_impl_screenshot_skeleton_vtable;
}

static GVariant *
xdp_impl_screenshot_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  XdpImplScreenshotSkeleton *skeleton = XDP_IMPL_SCREENSHOT_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_xdp_impl_screenshot_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _xdp_impl_screenshot_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _xdp_impl_screenshot_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _xdp_impl_screenshot_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.impl.portal.Screenshot", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
xdp_impl_screenshot_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void xdp_impl_screenshot_skeleton_iface_init (XdpImplScreenshotIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplScreenshotSkeleton, xdp_impl_screenshot_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (XdpImplScreenshotSkeleton)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_SCREENSHOT, xdp_impl_screenshot_skeleton_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplScreenshotSkeleton, xdp_impl_screenshot_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_SCREENSHOT, xdp_impl_screenshot_skeleton_iface_init));

#endif
static void
xdp_impl_screenshot_skeleton_finalize (GObject *object)
{
  XdpImplScreenshotSkeleton *skeleton = XDP_IMPL_SCREENSHOT_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (xdp_impl_screenshot_skeleton_parent_class)->finalize (object);
}

static void
xdp_impl_screenshot_skeleton_init (XdpImplScreenshotSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = xdp_impl_screenshot_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XDP_IMPL_TYPE_SCREENSHOT_SKELETON, XdpImplScreenshotSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
xdp_impl_screenshot_skeleton_class_init (XdpImplScreenshotSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = xdp_impl_screenshot_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = xdp_impl_screenshot_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = xdp_impl_screenshot_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = xdp_impl_screenshot_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = xdp_impl_screenshot_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplScreenshotSkeletonPrivate));
#endif
}

static void
xdp_impl_screenshot_skeleton_iface_init (XdpImplScreenshotIface *iface)
{
}

/**
 * xdp_impl_screenshot_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Screenshot.top_of_page">org.freedesktop.impl.portal.Screenshot</link>.
 *
 * Returns: (transfer full) (type XdpImplScreenshotSkeleton): The skeleton object.
 */
XdpImplScreenshot *
xdp_impl_screenshot_skeleton_new (void)
{
  return XDP_IMPL_SCREENSHOT (g_object_new (XDP_IMPL_TYPE_SCREENSHOT_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.impl.portal.Notification
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:XdpImplNotification
 * @title: XdpImplNotification
 * @short_description: Generated C code for the org.freedesktop.impl.portal.Notification D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Notification.top_of_page">org.freedesktop.impl.portal.Notification</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.impl.portal.Notification ---- */

static const _ExtendedGDBusArgInfo _xdp_impl_notification_method_info_add_notification_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_notification_method_info_add_notification_IN_ARG_id =
{
  {
    -1,
    (gchar *) "id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_notification_method_info_add_notification_IN_ARG_notification =
{
  {
    -1,
    (gchar *) "notification",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_notification_method_info_add_notification_IN_ARG_pointers[] =
{
  &_xdp_impl_notification_method_info_add_notification_IN_ARG_app_id,
  &_xdp_impl_notification_method_info_add_notification_IN_ARG_id,
  &_xdp_impl_notification_method_info_add_notification_IN_ARG_notification,
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_notification_method_add_notification_annotation_info_0 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In2",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo * const _xdp_impl_notification_method_add_notification_annotation_info_pointers[] =
{
  &_xdp_impl_notification_method_add_notification_annotation_info_0,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_notification_method_info_add_notification =
{
  {
    -1,
    (gchar *) "AddNotification",
    (GDBusArgInfo **) &_xdp_impl_notification_method_info_add_notification_IN_ARG_pointers,
    NULL,
    (GDBusAnnotationInfo **) &_xdp_impl_notification_method_add_notification_annotation_info_pointers
  },
  "handle-add-notification",
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_notification_method_info_remove_notification_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_notification_method_info_remove_notification_IN_ARG_id =
{
  {
    -1,
    (gchar *) "id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_notification_method_info_remove_notification_IN_ARG_pointers[] =
{
  &_xdp_impl_notification_method_info_remove_notification_IN_ARG_app_id,
  &_xdp_impl_notification_method_info_remove_notification_IN_ARG_id,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_notification_method_info_remove_notification =
{
  {
    -1,
    (gchar *) "RemoveNotification",
    (GDBusArgInfo **) &_xdp_impl_notification_method_info_remove_notification_IN_ARG_pointers,
    NULL,
    NULL
  },
  "handle-remove-notification",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _xdp_impl_notification_method_info_pointers[] =
{
  &_xdp_impl_notification_method_info_add_notification,
  &_xdp_impl_notification_method_info_remove_notification,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _xdp_impl_notification_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.impl.portal.Notification",
    (GDBusMethodInfo **) &_xdp_impl_notification_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "notification",
};


/**
 * xdp_impl_notification_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Notification.top_of_page">org.freedesktop.impl.portal.Notification</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
xdp_impl_notification_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_xdp_impl_notification_interface_info.parent_struct;
}

/**
 * xdp_impl_notification_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #XdpImplNotification interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
xdp_impl_notification_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * XdpImplNotification:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Notification.top_of_page">org.freedesktop.impl.portal.Notification</link>.
 */

/**
 * XdpImplNotificationIface:
 * @parent_iface: The parent interface.
 * @handle_add_notification: Handler for the #XdpImplNotification::handle-add-notification signal.
 * @handle_remove_notification: Handler for the #XdpImplNotification::handle-remove-notification signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Notification.top_of_page">org.freedesktop.impl.portal.Notification</link>.
 */

typedef XdpImplNotificationIface XdpImplNotificationInterface;
G_DEFINE_INTERFACE (XdpImplNotification, xdp_impl_notification, G_TYPE_OBJECT);

static void
xdp_impl_notification_default_init (XdpImplNotificationIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * XdpImplNotification::handle-add-notification:
   * @object: A #XdpImplNotification.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_id: Argument passed by remote caller.
   * @arg_notification: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-Notification.AddNotification">AddNotification()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_notification_complete_add_notification() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-add-notification",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplNotificationIface, handle_add_notification),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    4,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);

  /**
   * XdpImplNotification::handle-remove-notification:
   * @object: A #XdpImplNotification.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_id: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-Notification.RemoveNotification">RemoveNotification()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_notification_complete_remove_notification() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-remove-notification",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplNotificationIface, handle_remove_notification),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    3,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING);

}

/**
 * xdp_impl_notification_call_add_notification:
 * @proxy: A #XdpImplNotificationProxy.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_id: Argument to pass with the method invocation.
 * @arg_notification: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Notification.AddNotification">AddNotification()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_notification_call_add_notification_finish() to get the result of the operation.
 *
 * See xdp_impl_notification_call_add_notification_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_notification_call_add_notification (
    XdpImplNotification *proxy,
    const gchar *arg_app_id,
    const gchar *arg_id,
    GVariant *arg_notification,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "AddNotification",
    g_variant_new ("(ss@a{sv})",
                   arg_app_id,
                   arg_id,
                   arg_notification),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_notification_call_add_notification_finish:
 * @proxy: A #XdpImplNotificationProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_notification_call_add_notification().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_notification_call_add_notification().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_notification_call_add_notification_finish (
    XdpImplNotification *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_notification_call_add_notification_sync:
 * @proxy: A #XdpImplNotificationProxy.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_id: Argument to pass with the method invocation.
 * @arg_notification: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Notification.AddNotification">AddNotification()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_notification_call_add_notification() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_notification_call_add_notification_sync (
    XdpImplNotification *proxy,
    const gchar *arg_app_id,
    const gchar *arg_id,
    GVariant *arg_notification,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "AddNotification",
    g_variant_new ("(ss@a{sv})",
                   arg_app_id,
                   arg_id,
                   arg_notification),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_notification_call_remove_notification:
 * @proxy: A #XdpImplNotificationProxy.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_id: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Notification.RemoveNotification">RemoveNotification()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_notification_call_remove_notification_finish() to get the result of the operation.
 *
 * See xdp_impl_notification_call_remove_notification_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_notification_call_remove_notification (
    XdpImplNotification *proxy,
    const gchar *arg_app_id,
    const gchar *arg_id,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "RemoveNotification",
    g_variant_new ("(ss)",
                   arg_app_id,
                   arg_id),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_notification_call_remove_notification_finish:
 * @proxy: A #XdpImplNotificationProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_notification_call_remove_notification().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_notification_call_remove_notification().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_notification_call_remove_notification_finish (
    XdpImplNotification *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_notification_call_remove_notification_sync:
 * @proxy: A #XdpImplNotificationProxy.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_id: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Notification.RemoveNotification">RemoveNotification()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_notification_call_remove_notification() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_notification_call_remove_notification_sync (
    XdpImplNotification *proxy,
    const gchar *arg_app_id,
    const gchar *arg_id,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "RemoveNotification",
    g_variant_new ("(ss)",
                   arg_app_id,
                   arg_id),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_notification_complete_add_notification:
 * @object: A #XdpImplNotification.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-Notification.AddNotification">AddNotification()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_notification_complete_add_notification (
    XdpImplNotification *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/**
 * xdp_impl_notification_complete_remove_notification:
 * @object: A #XdpImplNotification.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-Notification.RemoveNotification">RemoveNotification()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_notification_complete_remove_notification (
    XdpImplNotification *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/* ------------------------------------------------------------------------ */

/**
 * XdpImplNotificationProxy:
 *
 * The #XdpImplNotificationProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplNotificationProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplNotificationProxy.
 */

struct _XdpImplNotificationProxyPrivate
{
  GData *qdata;
};

static void xdp_impl_notification_proxy_iface_init (XdpImplNotificationIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplNotificationProxy, xdp_impl_notification_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (XdpImplNotificationProxy)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_NOTIFICATION, xdp_impl_notification_proxy_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplNotificationProxy, xdp_impl_notification_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_NOTIFICATION, xdp_impl_notification_proxy_iface_init));

#endif
static void
xdp_impl_notification_proxy_finalize (GObject *object)
{
  XdpImplNotificationProxy *proxy = XDP_IMPL_NOTIFICATION_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (xdp_impl_notification_proxy_parent_class)->finalize (object);
}

static void
xdp_impl_notification_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_notification_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_notification_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xdp_impl_notification_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], XDP_IMPL_TYPE_NOTIFICATION);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_NOTIFICATION);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
xdp_impl_notification_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  XdpImplNotificationProxy *proxy = XDP_IMPL_NOTIFICATION_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_notification_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_notification_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
xdp_impl_notification_proxy_init (XdpImplNotificationProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = xdp_impl_notification_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XDP_IMPL_TYPE_NOTIFICATION_PROXY, XdpImplNotificationProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xdp_impl_notification_interface_info ());
}

static void
xdp_impl_notification_proxy_class_init (XdpImplNotificationProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = xdp_impl_notification_proxy_finalize;
  gobject_class->get_property = xdp_impl_notification_proxy_get_property;
  gobject_class->set_property = xdp_impl_notification_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = xdp_impl_notification_proxy_g_signal;
  proxy_class->g_properties_changed = xdp_impl_notification_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplNotificationProxyPrivate));
#endif
}

static void
xdp_impl_notification_proxy_iface_init (XdpImplNotificationIface *iface)
{
}

/**
 * xdp_impl_notification_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Notification.top_of_page">org.freedesktop.impl.portal.Notification</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_notification_proxy_new_finish() to get the result of the operation.
 *
 * See xdp_impl_notification_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_notification_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_NOTIFICATION_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Notification", NULL);
}

/**
 * xdp_impl_notification_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_notification_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_notification_proxy_new().
 *
 * Returns: (transfer full) (type XdpImplNotificationProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplNotification *
xdp_impl_notification_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_NOTIFICATION (ret);
  else
    return NULL;
}

/**
 * xdp_impl_notification_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Notification.top_of_page">org.freedesktop.impl.portal.Notification</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_notification_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplNotificationProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplNotification *
xdp_impl_notification_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_NOTIFICATION_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Notification", NULL);
  if (ret != NULL)
    return XDP_IMPL_NOTIFICATION (ret);
  else
    return NULL;
}


/**
 * xdp_impl_notification_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like xdp_impl_notification_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_notification_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See xdp_impl_notification_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_notification_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_NOTIFICATION_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Notification", NULL);
}

/**
 * xdp_impl_notification_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_notification_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_notification_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type XdpImplNotificationProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplNotification *
xdp_impl_notification_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_NOTIFICATION (ret);
  else
    return NULL;
}

/**
 * xdp_impl_notification_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like xdp_impl_notification_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_notification_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplNotificationProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplNotification *
xdp_impl_notification_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_NOTIFICATION_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Notification", NULL);
  if (ret != NULL)
    return XDP_IMPL_NOTIFICATION (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * XdpImplNotificationSkeleton:
 *
 * The #XdpImplNotificationSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplNotificationSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplNotificationSkeleton.
 */

struct _XdpImplNotificationSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_xdp_impl_notification_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  XdpImplNotificationSkeleton *skeleton = XDP_IMPL_NOTIFICATION_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint num_extra;
  guint n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], XDP_IMPL_TYPE_NOTIFICATION);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_NOTIFICATION);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    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);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_xdp_impl_notification_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  XdpImplNotificationSkeleton *skeleton = XDP_IMPL_NOTIFICATION_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_notification_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_xdp_impl_notification_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  XdpImplNotificationSkeleton *skeleton = XDP_IMPL_NOTIFICATION_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_notification_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _xdp_impl_notification_skeleton_vtable =
{
  _xdp_impl_notification_skeleton_handle_method_call,
  _xdp_impl_notification_skeleton_handle_get_property,
  _xdp_impl_notification_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
xdp_impl_notification_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return xdp_impl_notification_interface_info ();
}

static GDBusInterfaceVTable *
xdp_impl_notification_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_xdp_impl_notification_skeleton_vtable;
}

static GVariant *
xdp_impl_notification_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  XdpImplNotificationSkeleton *skeleton = XDP_IMPL_NOTIFICATION_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_xdp_impl_notification_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _xdp_impl_notification_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _xdp_impl_notification_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _xdp_impl_notification_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.impl.portal.Notification", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
xdp_impl_notification_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void xdp_impl_notification_skeleton_iface_init (XdpImplNotificationIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplNotificationSkeleton, xdp_impl_notification_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (XdpImplNotificationSkeleton)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_NOTIFICATION, xdp_impl_notification_skeleton_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplNotificationSkeleton, xdp_impl_notification_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_NOTIFICATION, xdp_impl_notification_skeleton_iface_init));

#endif
static void
xdp_impl_notification_skeleton_finalize (GObject *object)
{
  XdpImplNotificationSkeleton *skeleton = XDP_IMPL_NOTIFICATION_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (xdp_impl_notification_skeleton_parent_class)->finalize (object);
}

static void
xdp_impl_notification_skeleton_init (XdpImplNotificationSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = xdp_impl_notification_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XDP_IMPL_TYPE_NOTIFICATION_SKELETON, XdpImplNotificationSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
xdp_impl_notification_skeleton_class_init (XdpImplNotificationSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = xdp_impl_notification_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = xdp_impl_notification_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = xdp_impl_notification_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = xdp_impl_notification_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = xdp_impl_notification_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplNotificationSkeletonPrivate));
#endif
}

static void
xdp_impl_notification_skeleton_iface_init (XdpImplNotificationIface *iface)
{
}

/**
 * xdp_impl_notification_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Notification.top_of_page">org.freedesktop.impl.portal.Notification</link>.
 *
 * Returns: (transfer full) (type XdpImplNotificationSkeleton): The skeleton object.
 */
XdpImplNotification *
xdp_impl_notification_skeleton_new (void)
{
  return XDP_IMPL_NOTIFICATION (g_object_new (XDP_IMPL_TYPE_NOTIFICATION_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.impl.portal.Inhibit
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:XdpImplInhibit
 * @title: XdpImplInhibit
 * @short_description: Generated C code for the org.freedesktop.impl.portal.Inhibit D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Inhibit.top_of_page">org.freedesktop.impl.portal.Inhibit</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.impl.portal.Inhibit ---- */

static const _ExtendedGDBusArgInfo _xdp_impl_inhibit_method_info_inhibit_IN_ARG_handle =
{
  {
    -1,
    (gchar *) "handle",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_inhibit_method_info_inhibit_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_inhibit_method_info_inhibit_IN_ARG_window =
{
  {
    -1,
    (gchar *) "window",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_inhibit_method_info_inhibit_IN_ARG_flags =
{
  {
    -1,
    (gchar *) "flags",
    (gchar *) "u",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_inhibit_method_info_inhibit_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_inhibit_method_info_inhibit_IN_ARG_pointers[] =
{
  &_xdp_impl_inhibit_method_info_inhibit_IN_ARG_handle,
  &_xdp_impl_inhibit_method_info_inhibit_IN_ARG_app_id,
  &_xdp_impl_inhibit_method_info_inhibit_IN_ARG_window,
  &_xdp_impl_inhibit_method_info_inhibit_IN_ARG_flags,
  &_xdp_impl_inhibit_method_info_inhibit_IN_ARG_options,
  NULL
};

static const GDBusAnnotationInfo _xdp_impl_inhibit_method_inhibit_annotation_info_0 =
{
  -1,
  (gchar *) "org.qtproject.QtDBus.QtTypeName.In4",
  (gchar *) "QVariantMap",
  NULL
};

static const GDBusAnnotationInfo * const _xdp_impl_inhibit_method_inhibit_annotation_info_pointers[] =
{
  &_xdp_impl_inhibit_method_inhibit_annotation_info_0,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_inhibit_method_info_inhibit =
{
  {
    -1,
    (gchar *) "Inhibit",
    (GDBusArgInfo **) &_xdp_impl_inhibit_method_info_inhibit_IN_ARG_pointers,
    NULL,
    (GDBusAnnotationInfo **) &_xdp_impl_inhibit_method_inhibit_annotation_info_pointers
  },
  "handle-inhibit",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _xdp_impl_inhibit_method_info_pointers[] =
{
  &_xdp_impl_inhibit_method_info_inhibit,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _xdp_impl_inhibit_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.impl.portal.Inhibit",
    (GDBusMethodInfo **) &_xdp_impl_inhibit_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "inhibit",
};


/**
 * xdp_impl_inhibit_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Inhibit.top_of_page">org.freedesktop.impl.portal.Inhibit</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
xdp_impl_inhibit_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_xdp_impl_inhibit_interface_info.parent_struct;
}

/**
 * xdp_impl_inhibit_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #XdpImplInhibit interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
xdp_impl_inhibit_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * XdpImplInhibit:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Inhibit.top_of_page">org.freedesktop.impl.portal.Inhibit</link>.
 */

/**
 * XdpImplInhibitIface:
 * @parent_iface: The parent interface.
 * @handle_inhibit: Handler for the #XdpImplInhibit::handle-inhibit signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Inhibit.top_of_page">org.freedesktop.impl.portal.Inhibit</link>.
 */

typedef XdpImplInhibitIface XdpImplInhibitInterface;
G_DEFINE_INTERFACE (XdpImplInhibit, xdp_impl_inhibit, G_TYPE_OBJECT);

static void
xdp_impl_inhibit_default_init (XdpImplInhibitIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * XdpImplInhibit::handle-inhibit:
   * @object: A #XdpImplInhibit.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_handle: Argument passed by remote caller.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_window: Argument passed by remote caller.
   * @arg_flags: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-Inhibit.Inhibit">Inhibit()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_inhibit_complete_inhibit() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-inhibit",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplInhibitIface, handle_inhibit),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    6,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_VARIANT);

}

/**
 * xdp_impl_inhibit_call_inhibit:
 * @proxy: A #XdpImplInhibitProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_window: Argument to pass with the method invocation.
 * @arg_flags: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Inhibit.Inhibit">Inhibit()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_inhibit_call_inhibit_finish() to get the result of the operation.
 *
 * See xdp_impl_inhibit_call_inhibit_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_inhibit_call_inhibit (
    XdpImplInhibit *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_window,
    guint arg_flags,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Inhibit",
    g_variant_new ("(ossu@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_window,
                   arg_flags,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_inhibit_call_inhibit_finish:
 * @proxy: A #XdpImplInhibitProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_inhibit_call_inhibit().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_inhibit_call_inhibit().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_inhibit_call_inhibit_finish (
    XdpImplInhibit *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_inhibit_call_inhibit_sync:
 * @proxy: A #XdpImplInhibitProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_window: Argument to pass with the method invocation.
 * @arg_flags: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Inhibit.Inhibit">Inhibit()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_inhibit_call_inhibit() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_inhibit_call_inhibit_sync (
    XdpImplInhibit *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_window,
    guint arg_flags,
    GVariant *arg_options,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Inhibit",
    g_variant_new ("(ossu@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_window,
                   arg_flags,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_inhibit_complete_inhibit:
 * @object: A #XdpImplInhibit.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-Inhibit.Inhibit">Inhibit()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_inhibit_complete_inhibit (
    XdpImplInhibit *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/* ------------------------------------------------------------------------ */

/**
 * XdpImplInhibitProxy:
 *
 * The #XdpImplInhibitProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplInhibitProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplInhibitProxy.
 */

struct _XdpImplInhibitProxyPrivate
{
  GData *qdata;
};

static void xdp_impl_inhibit_proxy_iface_init (XdpImplInhibitIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplInhibitProxy, xdp_impl_inhibit_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (XdpImplInhibitProxy)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_INHIBIT, xdp_impl_inhibit_proxy_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplInhibitProxy, xdp_impl_inhibit_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_INHIBIT, xdp_impl_inhibit_proxy_iface_init));

#endif
static void
xdp_impl_inhibit_proxy_finalize (GObject *object)
{
  XdpImplInhibitProxy *proxy = XDP_IMPL_INHIBIT_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (xdp_impl_inhibit_proxy_parent_class)->finalize (object);
}

static void
xdp_impl_inhibit_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_inhibit_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_inhibit_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xdp_impl_inhibit_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], XDP_IMPL_TYPE_INHIBIT);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_INHIBIT);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
xdp_impl_inhibit_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  XdpImplInhibitProxy *proxy = XDP_IMPL_INHIBIT_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_inhibit_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_inhibit_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
xdp_impl_inhibit_proxy_init (XdpImplInhibitProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = xdp_impl_inhibit_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XDP_IMPL_TYPE_INHIBIT_PROXY, XdpImplInhibitProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xdp_impl_inhibit_interface_info ());
}

static void
xdp_impl_inhibit_proxy_class_init (XdpImplInhibitProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = xdp_impl_inhibit_proxy_finalize;
  gobject_class->get_property = xdp_impl_inhibit_proxy_get_property;
  gobject_class->set_property = xdp_impl_inhibit_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = xdp_impl_inhibit_proxy_g_signal;
  proxy_class->g_properties_changed = xdp_impl_inhibit_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplInhibitProxyPrivate));
#endif
}

static void
xdp_impl_inhibit_proxy_iface_init (XdpImplInhibitIface *iface)
{
}

/**
 * xdp_impl_inhibit_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Inhibit.top_of_page">org.freedesktop.impl.portal.Inhibit</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_inhibit_proxy_new_finish() to get the result of the operation.
 *
 * See xdp_impl_inhibit_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_inhibit_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_INHIBIT_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Inhibit", NULL);
}

/**
 * xdp_impl_inhibit_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_inhibit_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_inhibit_proxy_new().
 *
 * Returns: (transfer full) (type XdpImplInhibitProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplInhibit *
xdp_impl_inhibit_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_INHIBIT (ret);
  else
    return NULL;
}

/**
 * xdp_impl_inhibit_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Inhibit.top_of_page">org.freedesktop.impl.portal.Inhibit</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_inhibit_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplInhibitProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplInhibit *
xdp_impl_inhibit_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_INHIBIT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Inhibit", NULL);
  if (ret != NULL)
    return XDP_IMPL_INHIBIT (ret);
  else
    return NULL;
}


/**
 * xdp_impl_inhibit_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like xdp_impl_inhibit_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_inhibit_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See xdp_impl_inhibit_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_inhibit_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_INHIBIT_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Inhibit", NULL);
}

/**
 * xdp_impl_inhibit_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_inhibit_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_inhibit_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type XdpImplInhibitProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplInhibit *
xdp_impl_inhibit_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_INHIBIT (ret);
  else
    return NULL;
}

/**
 * xdp_impl_inhibit_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like xdp_impl_inhibit_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_inhibit_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplInhibitProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplInhibit *
xdp_impl_inhibit_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_INHIBIT_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Inhibit", NULL);
  if (ret != NULL)
    return XDP_IMPL_INHIBIT (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * XdpImplInhibitSkeleton:
 *
 * The #XdpImplInhibitSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplInhibitSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplInhibitSkeleton.
 */

struct _XdpImplInhibitSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_xdp_impl_inhibit_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  XdpImplInhibitSkeleton *skeleton = XDP_IMPL_INHIBIT_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint num_extra;
  guint n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], XDP_IMPL_TYPE_INHIBIT);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_INHIBIT);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    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);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_xdp_impl_inhibit_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  XdpImplInhibitSkeleton *skeleton = XDP_IMPL_INHIBIT_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_inhibit_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_xdp_impl_inhibit_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  XdpImplInhibitSkeleton *skeleton = XDP_IMPL_INHIBIT_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_inhibit_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _xdp_impl_inhibit_skeleton_vtable =
{
  _xdp_impl_inhibit_skeleton_handle_method_call,
  _xdp_impl_inhibit_skeleton_handle_get_property,
  _xdp_impl_inhibit_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
xdp_impl_inhibit_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return xdp_impl_inhibit_interface_info ();
}

static GDBusInterfaceVTable *
xdp_impl_inhibit_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_xdp_impl_inhibit_skeleton_vtable;
}

static GVariant *
xdp_impl_inhibit_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  XdpImplInhibitSkeleton *skeleton = XDP_IMPL_INHIBIT_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_xdp_impl_inhibit_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _xdp_impl_inhibit_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _xdp_impl_inhibit_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _xdp_impl_inhibit_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.impl.portal.Inhibit", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
xdp_impl_inhibit_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void xdp_impl_inhibit_skeleton_iface_init (XdpImplInhibitIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplInhibitSkeleton, xdp_impl_inhibit_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (XdpImplInhibitSkeleton)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_INHIBIT, xdp_impl_inhibit_skeleton_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplInhibitSkeleton, xdp_impl_inhibit_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_INHIBIT, xdp_impl_inhibit_skeleton_iface_init));

#endif
static void
xdp_impl_inhibit_skeleton_finalize (GObject *object)
{
  XdpImplInhibitSkeleton *skeleton = XDP_IMPL_INHIBIT_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (xdp_impl_inhibit_skeleton_parent_class)->finalize (object);
}

static void
xdp_impl_inhibit_skeleton_init (XdpImplInhibitSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = xdp_impl_inhibit_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XDP_IMPL_TYPE_INHIBIT_SKELETON, XdpImplInhibitSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
xdp_impl_inhibit_skeleton_class_init (XdpImplInhibitSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = xdp_impl_inhibit_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = xdp_impl_inhibit_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = xdp_impl_inhibit_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = xdp_impl_inhibit_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = xdp_impl_inhibit_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplInhibitSkeletonPrivate));
#endif
}

static void
xdp_impl_inhibit_skeleton_iface_init (XdpImplInhibitIface *iface)
{
}

/**
 * xdp_impl_inhibit_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Inhibit.top_of_page">org.freedesktop.impl.portal.Inhibit</link>.
 *
 * Returns: (transfer full) (type XdpImplInhibitSkeleton): The skeleton object.
 */
XdpImplInhibit *
xdp_impl_inhibit_skeleton_new (void)
{
  return XDP_IMPL_INHIBIT (g_object_new (XDP_IMPL_TYPE_INHIBIT_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.impl.portal.Access
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:XdpImplAccess
 * @title: XdpImplAccess
 * @short_description: Generated C code for the org.freedesktop.impl.portal.Access D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Access.top_of_page">org.freedesktop.impl.portal.Access</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.impl.portal.Access ---- */

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_IN_ARG_handle =
{
  {
    -1,
    (gchar *) "handle",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_IN_ARG_app_id =
{
  {
    -1,
    (gchar *) "app_id",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_IN_ARG_parent_window =
{
  {
    -1,
    (gchar *) "parent_window",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_IN_ARG_title =
{
  {
    -1,
    (gchar *) "title",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_IN_ARG_subtitle =
{
  {
    -1,
    (gchar *) "subtitle",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_IN_ARG_body =
{
  {
    -1,
    (gchar *) "body",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_access_method_info_access_dialog_IN_ARG_pointers[] =
{
  &_xdp_impl_access_method_info_access_dialog_IN_ARG_handle,
  &_xdp_impl_access_method_info_access_dialog_IN_ARG_app_id,
  &_xdp_impl_access_method_info_access_dialog_IN_ARG_parent_window,
  &_xdp_impl_access_method_info_access_dialog_IN_ARG_title,
  &_xdp_impl_access_method_info_access_dialog_IN_ARG_subtitle,
  &_xdp_impl_access_method_info_access_dialog_IN_ARG_body,
  &_xdp_impl_access_method_info_access_dialog_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_OUT_ARG_response =
{
  {
    -1,
    (gchar *) "response",
    (gchar *) "u",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _xdp_impl_access_method_info_access_dialog_OUT_ARG_results =
{
  {
    -1,
    (gchar *) "results",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _xdp_impl_access_method_info_access_dialog_OUT_ARG_pointers[] =
{
  &_xdp_impl_access_method_info_access_dialog_OUT_ARG_response,
  &_xdp_impl_access_method_info_access_dialog_OUT_ARG_results,
  NULL
};

static const _ExtendedGDBusMethodInfo _xdp_impl_access_method_info_access_dialog =
{
  {
    -1,
    (gchar *) "AccessDialog",
    (GDBusArgInfo **) &_xdp_impl_access_method_info_access_dialog_IN_ARG_pointers,
    (GDBusArgInfo **) &_xdp_impl_access_method_info_access_dialog_OUT_ARG_pointers,
    NULL
  },
  "handle-access-dialog",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _xdp_impl_access_method_info_pointers[] =
{
  &_xdp_impl_access_method_info_access_dialog,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _xdp_impl_access_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.impl.portal.Access",
    (GDBusMethodInfo **) &_xdp_impl_access_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "access",
};


/**
 * xdp_impl_access_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-impl-portal-Access.top_of_page">org.freedesktop.impl.portal.Access</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
xdp_impl_access_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_xdp_impl_access_interface_info.parent_struct;
}

/**
 * xdp_impl_access_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #XdpImplAccess interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
xdp_impl_access_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * XdpImplAccess:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Access.top_of_page">org.freedesktop.impl.portal.Access</link>.
 */

/**
 * XdpImplAccessIface:
 * @parent_iface: The parent interface.
 * @handle_access_dialog: Handler for the #XdpImplAccess::handle-access-dialog signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Access.top_of_page">org.freedesktop.impl.portal.Access</link>.
 */

typedef XdpImplAccessIface XdpImplAccessInterface;
G_DEFINE_INTERFACE (XdpImplAccess, xdp_impl_access, G_TYPE_OBJECT);

static void
xdp_impl_access_default_init (XdpImplAccessIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * XdpImplAccess::handle-access-dialog:
   * @object: A #XdpImplAccess.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_handle: Argument passed by remote caller.
   * @arg_app_id: Argument passed by remote caller.
   * @arg_parent_window: Argument passed by remote caller.
   * @arg_title: Argument passed by remote caller.
   * @arg_subtitle: Argument passed by remote caller.
   * @arg_body: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-impl-portal-Access.AccessDialog">AccessDialog()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call xdp_impl_access_complete_access_dialog() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-access-dialog",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (XdpImplAccessIface, handle_access_dialog),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    8,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VARIANT);

}

/**
 * xdp_impl_access_call_access_dialog:
 * @proxy: A #XdpImplAccessProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_subtitle: Argument to pass with the method invocation.
 * @arg_body: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Access.AccessDialog">AccessDialog()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_access_call_access_dialog_finish() to get the result of the operation.
 *
 * See xdp_impl_access_call_access_dialog_sync() for the synchronous, blocking version of this method.
 */
void
xdp_impl_access_call_access_dialog (
    XdpImplAccess *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    const gchar *arg_subtitle,
    const gchar *arg_body,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "AccessDialog",
    g_variant_new ("(osssss@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_subtitle,
                   arg_body,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * xdp_impl_access_call_access_dialog_finish:
 * @proxy: A #XdpImplAccessProxy.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_access_call_access_dialog().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with xdp_impl_access_call_access_dialog().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_access_call_access_dialog_finish (
    XdpImplAccess *proxy,
    guint *out_response,
    GVariant **out_results,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_access_call_access_dialog_sync:
 * @proxy: A #XdpImplAccessProxy.
 * @arg_handle: Argument to pass with the method invocation.
 * @arg_app_id: Argument to pass with the method invocation.
 * @arg_parent_window: Argument to pass with the method invocation.
 * @arg_title: Argument to pass with the method invocation.
 * @arg_subtitle: Argument to pass with the method invocation.
 * @arg_body: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @out_response: (out): Return location for return parameter or %NULL to ignore.
 * @out_results: (out): Return location for return parameter or %NULL to ignore.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-impl-portal-Access.AccessDialog">AccessDialog()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_access_call_access_dialog() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
xdp_impl_access_call_access_dialog_sync (
    XdpImplAccess *proxy,
    const gchar *arg_handle,
    const gchar *arg_app_id,
    const gchar *arg_parent_window,
    const gchar *arg_title,
    const gchar *arg_subtitle,
    const gchar *arg_body,
    GVariant *arg_options,
    guint *out_response,
    GVariant **out_results,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "AccessDialog",
    g_variant_new ("(osssss@a{sv})",
                   arg_handle,
                   arg_app_id,
                   arg_parent_window,
                   arg_title,
                   arg_subtitle,
                   arg_body,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(u@a{sv})",
                 out_response,
                 out_results);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * xdp_impl_access_complete_access_dialog:
 * @object: A #XdpImplAccess.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @response: Parameter to return.
 * @results: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-impl-portal-Access.AccessDialog">AccessDialog()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
xdp_impl_access_complete_access_dialog (
    XdpImplAccess *object,
    GDBusMethodInvocation *invocation,
    guint response,
    GVariant *results)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(u@a{sv})",
                   response,
                   results));
}

/* ------------------------------------------------------------------------ */

/**
 * XdpImplAccessProxy:
 *
 * The #XdpImplAccessProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplAccessProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplAccessProxy.
 */

struct _XdpImplAccessProxyPrivate
{
  GData *qdata;
};

static void xdp_impl_access_proxy_iface_init (XdpImplAccessIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplAccessProxy, xdp_impl_access_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (XdpImplAccessProxy)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_ACCESS, xdp_impl_access_proxy_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplAccessProxy, xdp_impl_access_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_ACCESS, xdp_impl_access_proxy_iface_init));

#endif
static void
xdp_impl_access_proxy_finalize (GObject *object)
{
  XdpImplAccessProxy *proxy = XDP_IMPL_ACCESS_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (xdp_impl_access_proxy_parent_class)->finalize (object);
}

static void
xdp_impl_access_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_access_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
xdp_impl_access_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_xdp_impl_access_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], XDP_IMPL_TYPE_ACCESS);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_ACCESS);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
xdp_impl_access_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  XdpImplAccessProxy *proxy = XDP_IMPL_ACCESS_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_access_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_access_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
xdp_impl_access_proxy_init (XdpImplAccessProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = xdp_impl_access_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, XDP_IMPL_TYPE_ACCESS_PROXY, XdpImplAccessProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), xdp_impl_access_interface_info ());
}

static void
xdp_impl_access_proxy_class_init (XdpImplAccessProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = xdp_impl_access_proxy_finalize;
  gobject_class->get_property = xdp_impl_access_proxy_get_property;
  gobject_class->set_property = xdp_impl_access_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = xdp_impl_access_proxy_g_signal;
  proxy_class->g_properties_changed = xdp_impl_access_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplAccessProxyPrivate));
#endif
}

static void
xdp_impl_access_proxy_iface_init (XdpImplAccessIface *iface)
{
}

/**
 * xdp_impl_access_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Access.top_of_page">org.freedesktop.impl.portal.Access</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_access_proxy_new_finish() to get the result of the operation.
 *
 * See xdp_impl_access_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_access_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_ACCESS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Access", NULL);
}

/**
 * xdp_impl_access_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_access_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_access_proxy_new().
 *
 * Returns: (transfer full) (type XdpImplAccessProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplAccess *
xdp_impl_access_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_ACCESS (ret);
  else
    return NULL;
}

/**
 * xdp_impl_access_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Access.top_of_page">org.freedesktop.impl.portal.Access</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_access_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplAccessProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplAccess *
xdp_impl_access_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_ACCESS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Access", NULL);
  if (ret != NULL)
    return XDP_IMPL_ACCESS (ret);
  else
    return NULL;
}


/**
 * xdp_impl_access_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like xdp_impl_access_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call xdp_impl_access_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See xdp_impl_access_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
xdp_impl_access_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (XDP_IMPL_TYPE_ACCESS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Access", NULL);
}

/**
 * xdp_impl_access_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to xdp_impl_access_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with xdp_impl_access_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type XdpImplAccessProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplAccess *
xdp_impl_access_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return XDP_IMPL_ACCESS (ret);
  else
    return NULL;
}

/**
 * xdp_impl_access_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like xdp_impl_access_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See xdp_impl_access_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type XdpImplAccessProxy): The constructed proxy object or %NULL if @error is set.
 */
XdpImplAccess *
xdp_impl_access_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (XDP_IMPL_TYPE_ACCESS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.impl.portal.Access", NULL);
  if (ret != NULL)
    return XDP_IMPL_ACCESS (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * XdpImplAccessSkeleton:
 *
 * The #XdpImplAccessSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * XdpImplAccessSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #XdpImplAccessSkeleton.
 */

struct _XdpImplAccessSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_xdp_impl_access_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  XdpImplAccessSkeleton *skeleton = XDP_IMPL_ACCESS_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  guint num_params;
  guint num_extra;
  guint n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], XDP_IMPL_TYPE_ACCESS);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, XDP_IMPL_TYPE_ACCESS);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    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);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_xdp_impl_access_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  XdpImplAccessSkeleton *skeleton = XDP_IMPL_ACCESS_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_access_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_xdp_impl_access_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  XdpImplAccessSkeleton *skeleton = XDP_IMPL_ACCESS_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_xdp_impl_access_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _xdp_impl_access_skeleton_vtable =
{
  _xdp_impl_access_skeleton_handle_method_call,
  _xdp_impl_access_skeleton_handle_get_property,
  _xdp_impl_access_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
xdp_impl_access_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return xdp_impl_access_interface_info ();
}

static GDBusInterfaceVTable *
xdp_impl_access_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_xdp_impl_access_skeleton_vtable;
}

static GVariant *
xdp_impl_access_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  XdpImplAccessSkeleton *skeleton = XDP_IMPL_ACCESS_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_xdp_impl_access_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _xdp_impl_access_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _xdp_impl_access_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _xdp_impl_access_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.impl.portal.Access", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
xdp_impl_access_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void xdp_impl_access_skeleton_iface_init (XdpImplAccessIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (XdpImplAccessSkeleton, xdp_impl_access_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (XdpImplAccessSkeleton)
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_ACCESS, xdp_impl_access_skeleton_iface_init));

#else
G_DEFINE_TYPE_WITH_CODE (XdpImplAccessSkeleton, xdp_impl_access_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (XDP_IMPL_TYPE_ACCESS, xdp_impl_access_skeleton_iface_init));

#endif
static void
xdp_impl_access_skeleton_finalize (GObject *object)
{
  XdpImplAccessSkeleton *skeleton = XDP_IMPL_ACCESS_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (xdp_impl_access_skeleton_parent_class)->finalize (object);
}

static void
xdp_impl_access_skeleton_init (XdpImplAccessSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = xdp_impl_access_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, XDP_IMPL_TYPE_ACCESS_SKELETON, XdpImplAccessSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
xdp_impl_access_skeleton_class_init (XdpImplAccessSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = xdp_impl_access_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = xdp_impl_access_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = xdp_impl_access_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = xdp_impl_access_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = xdp_impl_access_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (XdpImplAccessSkeletonPrivate));
#endif
}

static void
xdp_impl_access_skeleton_iface_init (XdpImplAccessIface *iface)
{
}

/**
 * xdp_impl_access_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-impl-portal-Access.top_of_page">org.freedesktop.impl.portal.Access</link>.
 *
 * Returns: (transfer full) (type XdpImplAccessSkeleton): The skeleton object.
 */
XdpImplAccess *
xdp_impl_access_skeleton_new (void)
{
  return XDP_IMPL_ACCESS (g_object_new (XDP_IMPL_TYPE_ACCESS_SKELETON, NULL));
}

