/* Thumbnailer.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from Thumbnailer.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-*/
/*-
 * Copyright (c) 2016-2016 elementary LLC.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authored by: Artem Anufrij <artem.anufrij@live.de>
 *
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>

#define AUDIENCE_SERVICES_DBUS_THUMBNAILER_THUMBNAILER_IFACE "org.freedesktop.thumbnails.Thumbnailer1"
#define AUDIENCE_SERVICES_DBUS_THUMBNAILER_THUMBNAILER_SERVICE "/org/freedesktop/thumbnails/Thumbnailer1"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define AUDIENCE_SERVICES_TYPE_TUMBLER (audience_services_tumbler_get_type ())
#define AUDIENCE_SERVICES_TUMBLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AUDIENCE_SERVICES_TYPE_TUMBLER, AudienceServicesTumbler))
#define AUDIENCE_SERVICES_IS_TUMBLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AUDIENCE_SERVICES_TYPE_TUMBLER))
#define AUDIENCE_SERVICES_TUMBLER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), AUDIENCE_SERVICES_TYPE_TUMBLER, AudienceServicesTumblerIface))

typedef struct _AudienceServicesTumbler AudienceServicesTumbler;
typedef struct _AudienceServicesTumblerIface AudienceServicesTumblerIface;

#define AUDIENCE_SERVICES_TYPE_TUMBLER_PROXY (audience_services_tumbler_proxy_get_type ())
enum  {
	AUDIENCE_SERVICES_TUMBLER_FINISHED_SIGNAL,
	AUDIENCE_SERVICES_TUMBLER_NUM_SIGNALS
};
static guint audience_services_tumbler_signals[AUDIENCE_SERVICES_TUMBLER_NUM_SIGNALS] = {0};
typedef GDBusProxy AudienceServicesTumblerProxy;
typedef GDBusProxyClass AudienceServicesTumblerProxyClass;
typedef struct _AudienceServicesTumblerQueueReadyData AudienceServicesTumblerQueueReadyData;
#define _g_free0(var) (var = (g_free (var), NULL))

#define AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER (audience_services_dbus_thumbnailer_get_type ())
#define AUDIENCE_SERVICES_DBUS_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER, AudienceServicesDbusThumbnailer))
#define AUDIENCE_SERVICES_DBUS_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER, AudienceServicesDbusThumbnailerClass))
#define AUDIENCE_SERVICES_IS_DBUS_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER))
#define AUDIENCE_SERVICES_IS_DBUS_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER))
#define AUDIENCE_SERVICES_DBUS_THUMBNAILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER, AudienceServicesDbusThumbnailerClass))

typedef struct _AudienceServicesDbusThumbnailer AudienceServicesDbusThumbnailer;
typedef struct _AudienceServicesDbusThumbnailerClass AudienceServicesDbusThumbnailerClass;
typedef struct _AudienceServicesDbusThumbnailerPrivate AudienceServicesDbusThumbnailerPrivate;
enum  {
	AUDIENCE_SERVICES_DBUS_THUMBNAILER_0_PROPERTY,
	AUDIENCE_SERVICES_DBUS_THUMBNAILER_NUM_PROPERTIES
};
static GParamSpec* audience_services_dbus_thumbnailer_properties[AUDIENCE_SERVICES_DBUS_THUMBNAILER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	AUDIENCE_SERVICES_DBUS_THUMBNAILER_FINISHED_SIGNAL,
	AUDIENCE_SERVICES_DBUS_THUMBNAILER_NUM_SIGNALS
};
static guint audience_services_dbus_thumbnailer_signals[AUDIENCE_SERVICES_DBUS_THUMBNAILER_NUM_SIGNALS] = {0};

struct _AudienceServicesTumblerIface {
	GTypeInterface parent_iface;
	void (*queue) (AudienceServicesTumbler* self, gchar** uris, gint uris_length1, gchar** mime_types, gint mime_types_length1, const gchar* flavor, const gchar* sheduler, guint handle_to_dequeue, GAsyncReadyCallback _callback_, gpointer _user_data_);
	guint (*queue_finish) (AudienceServicesTumbler* self, GAsyncResult* _res_, GError** error);
};

struct _AudienceServicesTumblerQueueReadyData {
	GDBusMethodInvocation* _invocation_;
	gchar** uris;
	gint uris_length1;
	gchar** mime_types;
	gint mime_types_length1;
	gchar* flavor;
	gchar* sheduler;
	guint handle_to_dequeue;
};

struct _AudienceServicesDbusThumbnailer {
	GObject parent_instance;
	AudienceServicesDbusThumbnailerPrivate * priv;
};

struct _AudienceServicesDbusThumbnailerClass {
	GObjectClass parent_class;
};

struct _AudienceServicesDbusThumbnailerPrivate {
	AudienceServicesTumbler* tumbler;
};

static gint AudienceServicesDbusThumbnailer_private_offset;
static gpointer audience_services_dbus_thumbnailer_parent_class = NULL;

VALA_EXTERN GType audience_services_tumbler_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint audience_services_tumbler_register_object (void* object,
                                                 GDBusConnection* connection,
                                                 const gchar* path,
                                                 GError** error);
VALA_EXTERN GType audience_services_tumbler_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AudienceServicesTumbler, g_object_unref)
VALA_EXTERN void audience_services_tumbler_queue (AudienceServicesTumbler* self,
                                      gchar** uris,
                                      gint uris_length1,
                                      gchar** mime_types,
                                      gint mime_types_length1,
                                      const gchar* flavor,
                                      const gchar* sheduler,
                                      guint handle_to_dequeue,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN guint audience_services_tumbler_queue_finish (AudienceServicesTumbler* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static GType audience_services_tumbler_get_type_once (void);
static void audience_services_tumbler_proxy_g_signal (GDBusProxy* proxy,
                                               const gchar* sender_name,
                                               const gchar* signal_name,
                                               GVariant* parameters);
static void _dbus_handle_audience_services_tumbler_finished (AudienceServicesTumbler* self,
                                                      GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void audience_services_tumbler_proxy_queue_async (AudienceServicesTumbler* self,
                                                  gchar** uris,
                                                  gint uris_length1,
                                                  gchar** mime_types,
                                                  gint mime_types_length1,
                                                  const gchar* flavor,
                                                  const gchar* sheduler,
                                                  guint handle_to_dequeue,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static guint audience_services_tumbler_proxy_queue_finish (AudienceServicesTumbler* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static void audience_services_tumbler_proxy_audience_services_tumbler_interface_init (AudienceServicesTumblerIface* iface);
static void _dbus_audience_services_tumbler_queue (AudienceServicesTumbler* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void _dbus_audience_services_tumbler_queue_ready (GObject * source_object,
                                                  GAsyncResult * _res_,
                                                  gpointer _user_data_);
static void audience_services_tumbler_dbus_interface_method_call (GDBusConnection* connection,
                                                           const gchar* sender,
                                                           const gchar* object_path,
                                                           const gchar* interface_name,
                                                           const gchar* method_name,
                                                           GVariant* parameters,
                                                           GDBusMethodInvocation* invocation,
                                                           gpointer user_data);
static GVariant* audience_services_tumbler_dbus_interface_get_property (GDBusConnection* connection,
                                                                 const gchar* sender,
                                                                 const gchar* object_path,
                                                                 const gchar* interface_name,
                                                                 const gchar* property_name,
                                                                 GError** error,
                                                                 gpointer user_data);
static gboolean audience_services_tumbler_dbus_interface_set_property (GDBusConnection* connection,
                                                                const gchar* sender,
                                                                const gchar* object_path,
                                                                const gchar* interface_name,
                                                                const gchar* property_name,
                                                                GVariant* value,
                                                                GError** error,
                                                                gpointer user_data);
static void _dbus_audience_services_tumbler_finished (GObject* _sender,
                                               guint handle,
                                               gpointer* _data);
static void _audience_services_tumbler_unregister_object (gpointer user_data);
VALA_EXTERN GType audience_services_dbus_thumbnailer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AudienceServicesDbusThumbnailer, g_object_unref)
VALA_EXTERN AudienceServicesDbusThumbnailer* audience_services_dbus_thumbnailer_new (void);
VALA_EXTERN AudienceServicesDbusThumbnailer* audience_services_dbus_thumbnailer_construct (GType object_type);
VALA_EXTERN void audience_services_dbus_thumbnailer_instand (AudienceServicesDbusThumbnailer* self,
                                                 GeeArrayList* uris,
                                                 GeeArrayList* mimes,
                                                 const gchar* size);
static GObject * audience_services_dbus_thumbnailer_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties);
static void _audience_services_dbus_thumbnailer____lambda4_ (AudienceServicesDbusThumbnailer* self,
                                                      guint handle);
static void __audience_services_dbus_thumbnailer____lambda4__audience_services_tumbler_finished (AudienceServicesTumbler* _sender,
                                                                                          guint handle,
                                                                                          gpointer self);
static void audience_services_dbus_thumbnailer_finalize (GObject * obj);
static GType audience_services_dbus_thumbnailer_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static const GDBusArgInfo _audience_services_tumbler_dbus_arg_info_queue_uris = {-1, "uris", "as", NULL};
static const GDBusArgInfo _audience_services_tumbler_dbus_arg_info_queue_mime_types = {-1, "mime_types", "as", NULL};
static const GDBusArgInfo _audience_services_tumbler_dbus_arg_info_queue_flavor = {-1, "flavor", "s", NULL};
static const GDBusArgInfo _audience_services_tumbler_dbus_arg_info_queue_sheduler = {-1, "sheduler", "s", NULL};
static const GDBusArgInfo _audience_services_tumbler_dbus_arg_info_queue_handle_to_dequeue = {-1, "handle_to_dequeue", "u", NULL};
static const GDBusArgInfo _audience_services_tumbler_dbus_arg_info_queue_result = {-1, "result", "u", NULL};
static const GDBusArgInfo * const _audience_services_tumbler_dbus_arg_info_queue_in[] = {&_audience_services_tumbler_dbus_arg_info_queue_uris, &_audience_services_tumbler_dbus_arg_info_queue_mime_types, &_audience_services_tumbler_dbus_arg_info_queue_flavor, &_audience_services_tumbler_dbus_arg_info_queue_sheduler, &_audience_services_tumbler_dbus_arg_info_queue_handle_to_dequeue, NULL};
static const GDBusArgInfo * const _audience_services_tumbler_dbus_arg_info_queue_out[] = {&_audience_services_tumbler_dbus_arg_info_queue_result, NULL};
static const GDBusMethodInfo _audience_services_tumbler_dbus_method_info_queue = {-1, "Queue", (GDBusArgInfo **) (&_audience_services_tumbler_dbus_arg_info_queue_in), (GDBusArgInfo **) (&_audience_services_tumbler_dbus_arg_info_queue_out), NULL};
static const GDBusMethodInfo * const _audience_services_tumbler_dbus_method_info[] = {&_audience_services_tumbler_dbus_method_info_queue, NULL};
static const GDBusArgInfo _audience_services_tumbler_dbus_arg_info_finished_handle = {-1, "handle", "u", NULL};
static const GDBusArgInfo * const _audience_services_tumbler_dbus_arg_info_finished[] = {&_audience_services_tumbler_dbus_arg_info_finished_handle, NULL};
static const GDBusSignalInfo _audience_services_tumbler_dbus_signal_info_finished = {-1, "Finished", (GDBusArgInfo **) (&_audience_services_tumbler_dbus_arg_info_finished), NULL};
static const GDBusSignalInfo * const _audience_services_tumbler_dbus_signal_info[] = {&_audience_services_tumbler_dbus_signal_info_finished, NULL};
static const GDBusPropertyInfo * const _audience_services_tumbler_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _audience_services_tumbler_dbus_interface_info = {-1, "org.freedesktop.thumbnails.Thumbnailer1", (GDBusMethodInfo **) (&_audience_services_tumbler_dbus_method_info), (GDBusSignalInfo **) (&_audience_services_tumbler_dbus_signal_info), (GDBusPropertyInfo **) (&_audience_services_tumbler_dbus_property_info), NULL};
static const GDBusInterfaceVTable _audience_services_tumbler_dbus_interface_vtable = {audience_services_tumbler_dbus_interface_method_call, audience_services_tumbler_dbus_interface_get_property, audience_services_tumbler_dbus_interface_set_property};

void
audience_services_tumbler_queue (AudienceServicesTumbler* self,
                                 gchar** uris,
                                 gint uris_length1,
                                 gchar** mime_types,
                                 gint mime_types_length1,
                                 const gchar* flavor,
                                 const gchar* sheduler,
                                 guint handle_to_dequeue,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	AudienceServicesTumblerIface* _iface_;
	_iface_ = AUDIENCE_SERVICES_TUMBLER_GET_INTERFACE (self);
	if (_iface_->queue) {
		_iface_->queue (self, uris, uris_length1, mime_types, mime_types_length1, flavor, sheduler, handle_to_dequeue, _callback_, _user_data_);
	}
}

guint
audience_services_tumbler_queue_finish (AudienceServicesTumbler* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	AudienceServicesTumblerIface* _iface_;
	_iface_ = AUDIENCE_SERVICES_TUMBLER_GET_INTERFACE (self);
	if (_iface_->queue_finish) {
		return _iface_->queue_finish (self, _res_, error);
	}
	return 0U;
}

static void
audience_services_tumbler_default_init (AudienceServicesTumblerIface * iface,
                                        gpointer iface_data)
{
	audience_services_tumbler_signals[AUDIENCE_SERVICES_TUMBLER_FINISHED_SIGNAL] = g_signal_new ("finished", AUDIENCE_SERVICES_TYPE_TUMBLER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
}

static GType
audience_services_tumbler_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AudienceServicesTumblerIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) audience_services_tumbler_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType audience_services_tumbler_type_id;
	audience_services_tumbler_type_id = g_type_register_static (G_TYPE_INTERFACE, "AudienceServicesTumbler", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (audience_services_tumbler_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (audience_services_tumbler_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) audience_services_tumbler_proxy_get_type);
	g_type_set_qdata (audience_services_tumbler_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.thumbnails.Thumbnailer1");
	g_type_set_qdata (audience_services_tumbler_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_audience_services_tumbler_dbus_interface_info));
	g_type_set_qdata (audience_services_tumbler_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) audience_services_tumbler_register_object);
	return audience_services_tumbler_type_id;
}

GType
audience_services_tumbler_get_type (void)
{
	static volatile gsize audience_services_tumbler_type_id__once = 0;
	if (g_once_init_enter (&audience_services_tumbler_type_id__once)) {
		GType audience_services_tumbler_type_id;
		audience_services_tumbler_type_id = audience_services_tumbler_get_type_once ();
		g_once_init_leave (&audience_services_tumbler_type_id__once, audience_services_tumbler_type_id);
	}
	return audience_services_tumbler_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (AudienceServicesTumblerProxy, audience_services_tumbler_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (AUDIENCE_SERVICES_TYPE_TUMBLER, audience_services_tumbler_proxy_audience_services_tumbler_interface_init) )
static void
audience_services_tumbler_proxy_class_init (AudienceServicesTumblerProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = audience_services_tumbler_proxy_g_signal;
}

static void
_dbus_handle_audience_services_tumbler_finished (AudienceServicesTumbler* self,
                                                 GVariant* parameters)
{
	GVariantIter _arguments_iter;
	guint handle = 0U;
	GVariant* _tmp10_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp10_ = g_variant_iter_next_value (&_arguments_iter);
	handle = g_variant_get_uint32 (_tmp10_);
	g_variant_unref (_tmp10_);
	g_signal_emit_by_name (self, "finished", handle);
}

static void
audience_services_tumbler_proxy_g_signal (GDBusProxy* proxy,
                                          const gchar* sender_name,
                                          const gchar* signal_name,
                                          GVariant* parameters)
{
	if (strcmp (signal_name, "Finished") == 0) {
		_dbus_handle_audience_services_tumbler_finished ((AudienceServicesTumbler*) proxy, parameters);
	}
}

static void
audience_services_tumbler_proxy_init (AudienceServicesTumblerProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_audience_services_tumbler_dbus_interface_info));
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
audience_services_tumbler_proxy_queue_async (AudienceServicesTumbler* self,
                                             gchar** uris,
                                             gint uris_length1,
                                             gchar** mime_types,
                                             gint mime_types_length1,
                                             const gchar* flavor,
                                             const gchar* sheduler,
                                             guint handle_to_dequeue,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	gchar** _tmp11_;
	GVariantBuilder _tmp12_;
	gint _tmp13_;
	gchar** _tmp14_;
	GVariantBuilder _tmp15_;
	gint _tmp16_;
	G_IO_ERROR;
	G_DBUS_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.thumbnails.Thumbnailer1", "Queue");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_tmp11_ = uris;
	g_variant_builder_init (&_tmp12_, G_VARIANT_TYPE ("as"));
	for (_tmp13_ = 0; _tmp13_ < uris_length1; _tmp13_++) {
		g_variant_builder_add_value (&_tmp12_, g_variant_new_string (*_tmp11_));
		_tmp11_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp12_));
	_tmp14_ = mime_types;
	g_variant_builder_init (&_tmp15_, G_VARIANT_TYPE ("as"));
	for (_tmp16_ = 0; _tmp16_ < mime_types_length1; _tmp16_++) {
		g_variant_builder_add_value (&_tmp15_, g_variant_new_string (*_tmp14_));
		_tmp14_++;
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp15_));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (flavor));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (sheduler));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (handle_to_dequeue));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static guint
audience_services_tumbler_proxy_queue_finish (AudienceServicesTumbler* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	guint _result = 0U;
	GVariant* _tmp19_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		guint _tmp17_ = 0U;
		return _tmp17_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		guint _tmp18_ = 0U;
		g_object_unref (_reply_message);
		return _tmp18_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp19_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_uint32 (_tmp19_);
	g_variant_unref (_tmp19_);
	g_object_unref (_reply_message);
	return _result;
}

static void
audience_services_tumbler_proxy_audience_services_tumbler_interface_init (AudienceServicesTumblerIface* iface)
{
	iface->queue = audience_services_tumbler_proxy_queue_async;
	iface->queue_finish = audience_services_tumbler_proxy_queue_finish;
}

static void
_dbus_audience_services_tumbler_queue (AudienceServicesTumbler* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	AudienceServicesTumblerQueueReadyData* _ready_data;
	GVariant* _tmp20_;
	gchar** _tmp21_;
	gint _tmp21__length;
	gint _tmp21__size;
	gint _tmp21__length1;
	GVariantIter _tmp22_;
	GVariant* _tmp23_;
	GVariant* _tmp24_;
	gchar** _tmp25_;
	gint _tmp25__length;
	gint _tmp25__size;
	gint _tmp25__length1;
	GVariantIter _tmp26_;
	GVariant* _tmp27_;
	GVariant* _tmp28_;
	GVariant* _tmp29_;
	GVariant* _tmp30_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (AudienceServicesTumblerQueueReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp20_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp21_ = g_new (gchar*, 5);
	_tmp21__length = 0;
	_tmp21__size = 4;
	_tmp21__length1 = 0;
	g_variant_iter_init (&_tmp22_, _tmp20_);
	for (; (_tmp23_ = g_variant_iter_next_value (&_tmp22_)) != NULL; _tmp21__length1++) {
		if (_tmp21__size == _tmp21__length) {
			_tmp21__size = 2 * _tmp21__size;
			_tmp21_ = g_renew (gchar*, _tmp21_, _tmp21__size + 1);
		}
		_tmp21_[_tmp21__length++] = g_variant_dup_string (_tmp23_, NULL);
		g_variant_unref (_tmp23_);
	}
	_ready_data->uris_length1 = _tmp21__length1;
	_tmp21_[_tmp21__length] = NULL;
	_ready_data->uris = _tmp21_;
	g_variant_unref (_tmp20_);
	_tmp24_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp25_ = g_new (gchar*, 5);
	_tmp25__length = 0;
	_tmp25__size = 4;
	_tmp25__length1 = 0;
	g_variant_iter_init (&_tmp26_, _tmp24_);
	for (; (_tmp27_ = g_variant_iter_next_value (&_tmp26_)) != NULL; _tmp25__length1++) {
		if (_tmp25__size == _tmp25__length) {
			_tmp25__size = 2 * _tmp25__size;
			_tmp25_ = g_renew (gchar*, _tmp25_, _tmp25__size + 1);
		}
		_tmp25_[_tmp25__length++] = g_variant_dup_string (_tmp27_, NULL);
		g_variant_unref (_tmp27_);
	}
	_ready_data->mime_types_length1 = _tmp25__length1;
	_tmp25_[_tmp25__length] = NULL;
	_ready_data->mime_types = _tmp25_;
	g_variant_unref (_tmp24_);
	_tmp28_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->flavor = g_variant_dup_string (_tmp28_, NULL);
	g_variant_unref (_tmp28_);
	_tmp29_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->sheduler = g_variant_dup_string (_tmp29_, NULL);
	g_variant_unref (_tmp29_);
	_tmp30_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->handle_to_dequeue = g_variant_get_uint32 (_tmp30_);
	g_variant_unref (_tmp30_);
	audience_services_tumbler_queue (self, _ready_data->uris, _ready_data->uris_length1, _ready_data->mime_types, _ready_data->mime_types_length1, _ready_data->flavor, _ready_data->sheduler, _ready_data->handle_to_dequeue, (GAsyncReadyCallback) _dbus_audience_services_tumbler_queue_ready, _ready_data);
	_error:
	;
}

static void
_dbus_audience_services_tumbler_queue_ready (GObject * source_object,
                                             GAsyncResult * _res_,
                                             gpointer _user_data_)
{
	AudienceServicesTumblerQueueReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	guint result;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	result = audience_services_tumbler_queue_finish ((AudienceServicesTumbler*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_uint32 (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_ready_data->uris = (_vala_array_free (_ready_data->uris, _ready_data->uris_length1, (GDestroyNotify) g_free), NULL);
	_ready_data->mime_types = (_vala_array_free (_ready_data->mime_types, _ready_data->mime_types_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (_ready_data->flavor);
	_g_free0 (_ready_data->sheduler);
	g_slice_free (AudienceServicesTumblerQueueReadyData, _ready_data);
}

static void
audience_services_tumbler_dbus_interface_method_call (GDBusConnection* connection,
                                                      const gchar* sender,
                                                      const gchar* object_path,
                                                      const gchar* interface_name,
                                                      const gchar* method_name,
                                                      GVariant* parameters,
                                                      GDBusMethodInvocation* invocation,
                                                      gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "Queue") == 0) {
		_dbus_audience_services_tumbler_queue (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
audience_services_tumbler_dbus_interface_get_property (GDBusConnection* connection,
                                                       const gchar* sender,
                                                       const gchar* object_path,
                                                       const gchar* interface_name,
                                                       const gchar* property_name,
                                                       GError** error,
                                                       gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}

static gboolean
audience_services_tumbler_dbus_interface_set_property (GDBusConnection* connection,
                                                       const gchar* sender,
                                                       const gchar* object_path,
                                                       const gchar* interface_name,
                                                       const gchar* property_name,
                                                       GVariant* value,
                                                       GError** error,
                                                       gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

static void
_dbus_audience_services_tumbler_finished (GObject* _sender,
                                          guint handle,
                                          gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (handle));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.thumbnails.Thumbnailer1", "Finished", _arguments, NULL);
}

guint
audience_services_tumbler_register_object (gpointer object,
                                           GDBusConnection* connection,
                                           const gchar* path,
                                           GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_audience_services_tumbler_dbus_interface_info), &_audience_services_tumbler_dbus_interface_vtable, data, _audience_services_tumbler_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "finished", (GCallback) _dbus_audience_services_tumbler_finished, data);
	return result;
}

static void
_audience_services_tumbler_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_audience_services_tumbler_finished, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
audience_services_dbus_thumbnailer_get_instance_private (AudienceServicesDbusThumbnailer* self)
{
	return G_STRUCT_MEMBER_P (self, AudienceServicesDbusThumbnailer_private_offset);
}

AudienceServicesDbusThumbnailer*
audience_services_dbus_thumbnailer_construct (GType object_type)
{
	AudienceServicesDbusThumbnailer * self = NULL;
	self = (AudienceServicesDbusThumbnailer*) g_object_new (object_type, NULL);
	return self;
}

AudienceServicesDbusThumbnailer*
audience_services_dbus_thumbnailer_new (void)
{
	return audience_services_dbus_thumbnailer_construct (AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER);
}

void
audience_services_dbus_thumbnailer_instand (AudienceServicesDbusThumbnailer* self,
                                            GeeArrayList* uris,
                                            GeeArrayList* mimes,
                                            const gchar* size)
{
	AudienceServicesTumbler* _tmp0_;
	gint _tmp1_ = 0;
	gpointer* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gint _tmp4_ = 0;
	gpointer* _tmp5_;
	gchar** _tmp6_;
	gint _tmp6__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (uris != NULL);
	g_return_if_fail (mimes != NULL);
	g_return_if_fail (size != NULL);
	_tmp0_ = self->priv->tumbler;
	_tmp2_ = gee_collection_to_array ((GeeCollection*) uris, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	_tmp5_ = gee_collection_to_array ((GeeCollection*) mimes, &_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp6__length1 = _tmp4_;
	audience_services_tumbler_queue (_tmp0_, _tmp3_, (gint) _tmp1_, _tmp6_, (gint) _tmp4_, size, "default", (guint) 0, NULL, NULL);
	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_free), NULL);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
}

static void
_audience_services_dbus_thumbnailer____lambda4_ (AudienceServicesDbusThumbnailer* self,
                                                 guint handle)
{
	g_signal_emit (self, audience_services_dbus_thumbnailer_signals[AUDIENCE_SERVICES_DBUS_THUMBNAILER_FINISHED_SIGNAL], 0, handle);
}

static void
__audience_services_dbus_thumbnailer____lambda4__audience_services_tumbler_finished (AudienceServicesTumbler* _sender,
                                                                                     guint handle,
                                                                                     gpointer self)
{
	_audience_services_dbus_thumbnailer____lambda4_ ((AudienceServicesDbusThumbnailer*) self, handle);
}

static GObject *
audience_services_dbus_thumbnailer_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	AudienceServicesDbusThumbnailer * self;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (audience_services_dbus_thumbnailer_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER, AudienceServicesDbusThumbnailer);
	{
		AudienceServicesTumbler* _tmp0_ = NULL;
		AudienceServicesTumbler* _tmp1_;
		AudienceServicesTumbler* _tmp2_;
		AudienceServicesTumbler* _tmp3_;
		_tmp1_ = (AudienceServicesTumbler*) g_initable_new (AUDIENCE_SERVICES_TYPE_TUMBLER_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", AUDIENCE_SERVICES_DBUS_THUMBNAILER_THUMBNAILER_IFACE, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", AUDIENCE_SERVICES_DBUS_THUMBNAILER_THUMBNAILER_SERVICE, "g-interface-name", "org.freedesktop.thumbnails.Thumbnailer1", NULL);
		_tmp0_ = (AudienceServicesTumbler*) _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->tumbler);
		self->priv->tumbler = _tmp2_;
		_tmp3_ = self->priv->tumbler;
		g_signal_connect_object (_tmp3_, "finished", (GCallback) __audience_services_dbus_thumbnailer____lambda4__audience_services_tumbler_finished, self, 0);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("Thumbnailer.vala:44: %s", _tmp5_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
	}
	return obj;
}

static void
audience_services_dbus_thumbnailer_class_init (AudienceServicesDbusThumbnailerClass * klass,
                                               gpointer klass_data)
{
	audience_services_dbus_thumbnailer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &AudienceServicesDbusThumbnailer_private_offset);
	G_OBJECT_CLASS (klass)->constructor = audience_services_dbus_thumbnailer_constructor;
	G_OBJECT_CLASS (klass)->finalize = audience_services_dbus_thumbnailer_finalize;
	audience_services_dbus_thumbnailer_signals[AUDIENCE_SERVICES_DBUS_THUMBNAILER_FINISHED_SIGNAL] = g_signal_new ("finished", AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
}

static void
audience_services_dbus_thumbnailer_instance_init (AudienceServicesDbusThumbnailer * self,
                                                  gpointer klass)
{
	self->priv = audience_services_dbus_thumbnailer_get_instance_private (self);
}

static void
audience_services_dbus_thumbnailer_finalize (GObject * obj)
{
	AudienceServicesDbusThumbnailer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, AUDIENCE_SERVICES_TYPE_DBUS_THUMBNAILER, AudienceServicesDbusThumbnailer);
	_g_object_unref0 (self->priv->tumbler);
	G_OBJECT_CLASS (audience_services_dbus_thumbnailer_parent_class)->finalize (obj);
}

static GType
audience_services_dbus_thumbnailer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AudienceServicesDbusThumbnailerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) audience_services_dbus_thumbnailer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AudienceServicesDbusThumbnailer), 0, (GInstanceInitFunc) audience_services_dbus_thumbnailer_instance_init, NULL };
	GType audience_services_dbus_thumbnailer_type_id;
	audience_services_dbus_thumbnailer_type_id = g_type_register_static (G_TYPE_OBJECT, "AudienceServicesDbusThumbnailer", &g_define_type_info, 0);
	AudienceServicesDbusThumbnailer_private_offset = g_type_add_instance_private (audience_services_dbus_thumbnailer_type_id, sizeof (AudienceServicesDbusThumbnailerPrivate));
	return audience_services_dbus_thumbnailer_type_id;
}

GType
audience_services_dbus_thumbnailer_get_type (void)
{
	static volatile gsize audience_services_dbus_thumbnailer_type_id__once = 0;
	if (g_once_init_enter (&audience_services_dbus_thumbnailer_type_id__once)) {
		GType audience_services_dbus_thumbnailer_type_id;
		audience_services_dbus_thumbnailer_type_id = audience_services_dbus_thumbnailer_get_type_once ();
		g_once_init_leave (&audience_services_dbus_thumbnailer_type_id__once, audience_services_dbus_thumbnailer_type_id);
	}
	return audience_services_dbus_thumbnailer_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

