/* file_drop.c generated by valac 0.56.19, the Vala compiler
 * generated from file_drop.vala, do not modify */

#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <gio/gio.h>

#define DC_FILE_DROP_TARGET_URI_LIST_MIME_TYPE "text/uri-list"
#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 DC_TYPE_FILE_DROP_TARGET (dc_file_drop_target_get_type ())
#define DC_FILE_DROP_TARGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_FILE_DROP_TARGET, DcFileDropTarget))
#define DC_FILE_DROP_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_FILE_DROP_TARGET, DcFileDropTargetClass))
#define DC_IS_FILE_DROP_TARGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_FILE_DROP_TARGET))
#define DC_IS_FILE_DROP_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_FILE_DROP_TARGET))
#define DC_FILE_DROP_TARGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_FILE_DROP_TARGET, DcFileDropTargetClass))

typedef struct _DcFileDropTarget DcFileDropTarget;
typedef struct _DcFileDropTargetClass DcFileDropTargetClass;
typedef struct _DcFileDropTargetPrivate DcFileDropTargetPrivate;
enum  {
	DC_FILE_DROP_TARGET_0_PROPERTY,
	DC_FILE_DROP_TARGET_NUM_PROPERTIES
};
static GParamSpec* dc_file_drop_target_properties[DC_FILE_DROP_TARGET_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _gdk_content_formats_builder_unref0(var) ((var == NULL) ? NULL : (var = (gdk_content_formats_builder_unref (var), NULL)))
#define _gdk_content_formats_unref0(var) ((var == NULL) ? NULL : (var = (gdk_content_formats_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _DcFileDropTargetHandleDropData DcFileDropTargetHandleDropData;
typedef struct _DcFileDropTargetEmitLocalFileData DcFileDropTargetEmitLocalFileData;
typedef struct _DcFileDropTargetReadFileData DcFileDropTargetReadFileData;
#define __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
typedef struct _DcFileDropTargetReadFileValueData DcFileDropTargetReadFileValueData;
#define __vala_GdkFileList_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkFileList_free (var), NULL)))
typedef struct _DcFileDropTargetReadFileListData DcFileDropTargetReadFileListData;
typedef struct _DcFileDropTargetReadUriListFileData DcFileDropTargetReadUriListFileData;
enum  {
	DC_FILE_DROP_TARGET_ACCEPT_SIGNAL,
	DC_FILE_DROP_TARGET_DROPPED_SIGNAL,
	DC_FILE_DROP_TARGET_FAILED_SIGNAL,
	DC_FILE_DROP_TARGET_NUM_SIGNALS
};
static guint dc_file_drop_target_signals[DC_FILE_DROP_TARGET_NUM_SIGNALS] = {0};

#define DC_TYPE_NATIVE_FILE_DROP_TARGET (dc_native_file_drop_target_get_type ())
#define DC_NATIVE_FILE_DROP_TARGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_NATIVE_FILE_DROP_TARGET, DcNativeFileDropTarget))
#define DC_NATIVE_FILE_DROP_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_NATIVE_FILE_DROP_TARGET, DcNativeFileDropTargetClass))
#define DC_IS_NATIVE_FILE_DROP_TARGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_NATIVE_FILE_DROP_TARGET))
#define DC_IS_NATIVE_FILE_DROP_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_NATIVE_FILE_DROP_TARGET))
#define DC_NATIVE_FILE_DROP_TARGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_NATIVE_FILE_DROP_TARGET, DcNativeFileDropTargetClass))

typedef struct _DcNativeFileDropTarget DcNativeFileDropTarget;
typedef struct _DcNativeFileDropTargetClass DcNativeFileDropTargetClass;
typedef struct _DcNativeFileDropTargetPrivate DcNativeFileDropTargetPrivate;
enum  {
	DC_NATIVE_FILE_DROP_TARGET_0_PROPERTY,
	DC_NATIVE_FILE_DROP_TARGET_NUM_PROPERTIES
};
static GParamSpec* dc_native_file_drop_target_properties[DC_NATIVE_FILE_DROP_TARGET_NUM_PROPERTIES];
typedef void (*DcPlatformRawMacosFileDropCallback) (const gchar* path, gdouble x, gdouble y, void* user_data);
enum  {
	DC_NATIVE_FILE_DROP_TARGET_PATH_DROPPED_SIGNAL,
	DC_NATIVE_FILE_DROP_TARGET_NUM_SIGNALS
};
static guint dc_native_file_drop_target_signals[DC_NATIVE_FILE_DROP_TARGET_NUM_SIGNALS] = {0};

struct _DcFileDropTarget {
	GObject parent_instance;
	DcFileDropTargetPrivate * priv;
};

struct _DcFileDropTargetClass {
	GObjectClass parent_class;
};

struct _DcFileDropTargetPrivate {
	GtkWidget* widget;
	gchar* active_css_class;
};

struct _DcFileDropTargetHandleDropData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcFileDropTarget* self;
	GdkDrop* drop;
	gboolean ok;
	GFile* file;
	GFile* _tmp0_;
	GFile* _tmp1_;
	gboolean _tmp2_;
	GFile* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GError* _inner_error1_;
	GdkDragAction _tmp6_;
	GError* _inner_error0_;
};

struct _DcFileDropTargetEmitLocalFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcFileDropTarget* self;
	GFile* file;
	gboolean result;
	gchar* path;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* name;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	GFileIOStream* stream;
	GFile* tmp;
	GFileIOStream* _tmp6_;
	GFile* _tmp7_;
	GFileIOStream* _tmp8_;
	GFile* _tmp9_;
	GFile* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	GError* _inner_error0_;
};

struct _DcFileDropTargetReadFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcFileDropTarget* self;
	GdkDrop* drop;
	GFile* result;
	GFile* file;
	GFile* _tmp0_;
	GFile* _tmp1_;
	GdkContentFormats* formats;
	GdkContentFormats* _tmp2_;
	GdkContentFormats* _tmp3_;
	GdkContentFormats* _tmp4_;
	GFile* _vala1_file;
	GFile* _tmp5_;
	GFile* _tmp6_;
	GError* e;
	gboolean _tmp7_;
	GdkContentFormats* _tmp8_;
	GdkContentFormats* _tmp9_;
	GError* _tmp10_;
	GError* _tmp11_;
	GdkContentFormats* _tmp12_;
	GFile* _vala2_file;
	GFile* _tmp13_;
	GFile* _tmp14_;
	GError* _vala1_e;
	GdkContentFormats* _tmp15_;
	GError* _tmp16_;
	GError* _tmp17_;
	GFile* _tmp18_;
	GFile* _tmp19_;
	GFile* _tmp20_;
	GError* _inner_error0_;
};

struct _DcFileDropTargetReadFileValueData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcFileDropTarget* self;
	GdkDrop* drop;
	GFile* result;
	GValue* value;
	GValue* _tmp0_;
	GObject* _tmp1_;
	GObject* _tmp2_;
	GObject* obj;
	GObject* _tmp3_;
	GObject* _tmp4_;
	GFile* _tmp5_;
	GError* _inner_error0_;
};

struct _DcFileDropTargetReadFileListData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcFileDropTarget* self;
	GdkDrop* drop;
	GFile* result;
	GValue* value;
	GValue* _tmp0_;
	GdkFileList* _tmp1_;
	void* _tmp2_;
	GdkFileList* fl;
	GdkFileList* _tmp3_;
	GSList* files;
	GdkFileList* _tmp4_;
	GdkFileList* _tmp5_;
	GSList* _tmp6_;
	gboolean _tmp7_;
	GSList* _tmp8_;
	GSList* _tmp9_;
	gconstpointer _tmp10_;
	GFile* borrowed;
	GSList* _tmp11_;
	gconstpointer _tmp12_;
	GFile* _tmp13_;
	GObject* _tmp14_;
	GFile* _tmp15_;
	GError* _inner_error0_;
};

struct _DcFileDropTargetReadUriListFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcFileDropTarget* self;
	GdkDrop* drop;
	GFile* result;
	GdkContentFormats* formats;
	GdkContentFormats* _tmp0_;
	GdkContentFormats* _tmp1_;
	GdkContentFormats* _tmp2_;
	gchar** mime_types;
	gchar* _tmp3_;
	gchar** _tmp4_;
	gint mime_types_length1;
	gint _mime_types_size_;
	const gchar* out_mime_type;
	GInputStream* stream;
	gchar** _tmp5_;
	gint _tmp5__length1;
	const gchar* _tmp6_;
	GInputStream* _tmp7_;
	GInputStream* _tmp8_;
	GDataInputStream* data;
	GInputStream* _tmp9_;
	GDataInputStream* _tmp10_;
	gchar* line;
	gchar* _tmp11_;
	GDataInputStream* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* uri;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gboolean _tmp18_;
	const gchar* _tmp19_;
	gint _tmp20_;
	gint _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	GFile* _tmp24_;
	GError* _inner_error0_;
};

struct _DcNativeFileDropTarget {
	GObject parent_instance;
	DcNativeFileDropTargetPrivate * priv;
};

struct _DcNativeFileDropTargetClass {
	GObjectClass parent_class;
};

struct _DcNativeFileDropTargetPrivate {
	GtkWidget* widget;
};

static gint DcFileDropTarget_private_offset;
static gpointer dc_file_drop_target_parent_class = NULL;
static gint DcNativeFileDropTarget_private_offset;
static gpointer dc_native_file_drop_target_parent_class = NULL;

VALA_EXTERN GType dc_file_drop_target_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcFileDropTarget, g_object_unref)
VALA_EXTERN DcFileDropTarget* dc_file_drop_target_new (GtkWidget* widget,
                                           const gchar* active_css_class);
VALA_EXTERN DcFileDropTarget* dc_file_drop_target_construct (GType object_type,
                                                 GtkWidget* widget,
                                                 const gchar* active_css_class);
static void dc_file_drop_target_install (DcFileDropTarget* self);
static GdkContentFormats* dc_file_drop_target_content_formats (DcFileDropTarget* self);
static gboolean __lambda38_ (DcFileDropTarget* self,
                      GdkDrop* gdk_drop);
static gboolean dc_file_drop_target_can_accept (DcFileDropTarget* self,
                                         GdkDrop* drop);
static gboolean ___lambda38__gtk_drop_target_async_accept (GtkDropTargetAsync* _sender,
                                                    GdkDrop* drop,
                                                    gpointer self);
static GdkDragAction __lambda39_ (DcFileDropTarget* self,
                           GdkDrop* gdk_drop,
                           gdouble x,
                           gdouble y);
static GdkDragAction dc_file_drop_target_action_for (DcFileDropTarget* self,
                                              GdkDrop* drop);
static GdkDragAction ___lambda39__gtk_drop_target_async_drag_enter (GtkDropTargetAsync* _sender,
                                                             GdkDrop* drop,
                                                             gdouble x,
                                                             gdouble y,
                                                             gpointer self);
static GdkDragAction __lambda40_ (DcFileDropTarget* self,
                           GdkDrop* gdk_drop,
                           gdouble x,
                           gdouble y);
static GdkDragAction ___lambda40__gtk_drop_target_async_drag_motion (GtkDropTargetAsync* _sender,
                                                              GdkDrop* drop,
                                                              gdouble x,
                                                              gdouble y,
                                                              gpointer self);
static void __lambda41_ (DcFileDropTarget* self,
                  GdkDrop* gdk_drop);
static void ___lambda41__gtk_drop_target_async_drag_leave (GtkDropTargetAsync* _sender,
                                                    GdkDrop* drop,
                                                    gpointer self);
static gboolean __lambda42_ (DcFileDropTarget* self,
                      GdkDrop* gdk_drop,
                      gdouble x,
                      gdouble y);
static void dc_file_drop_target_handle_drop (DcFileDropTarget* self,
                                      GdkDrop* drop,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
static void dc_file_drop_target_handle_drop_finish (DcFileDropTarget* self,
                                             GAsyncResult* _res_);
static gboolean ___lambda42__gtk_drop_target_async_drop (GtkDropTargetAsync* _sender,
                                                  GdkDrop* drop,
                                                  gdouble x,
                                                  gdouble y,
                                                  gpointer self);
VALA_EXTERN gboolean dc_platform_is_macos (void);
static GdkDragAction dc_file_drop_target_preferred_action (DcFileDropTarget* self,
                                                    GdkDrop* drop);
static void dc_file_drop_target_handle_drop_data_free (gpointer _data);
static gboolean dc_file_drop_target_handle_drop_co (DcFileDropTargetHandleDropData* _data_);
static void dc_file_drop_target_read_file (DcFileDropTarget* self,
                                    GdkDrop* drop,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
static GFile* dc_file_drop_target_read_file_finish (DcFileDropTarget* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static void dc_file_drop_target_handle_drop_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void dc_file_drop_target_emit_local_file (DcFileDropTarget* self,
                                          GFile* file,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static gboolean dc_file_drop_target_emit_local_file_finish (DcFileDropTarget* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static void dc_file_drop_target_emit_local_file_data_free (gpointer _data);
static gboolean dc_file_drop_target_emit_local_file_co (DcFileDropTargetEmitLocalFileData* _data_);
static void dc_file_drop_target_emit_local_file_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_file_drop_target_read_file_data_free (gpointer _data);
static gboolean dc_file_drop_target_read_file_co (DcFileDropTargetReadFileData* _data_);
static void dc_file_drop_target_read_uri_list_file (DcFileDropTarget* self,
                                             GdkDrop* drop,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static GFile* dc_file_drop_target_read_uri_list_file_finish (DcFileDropTarget* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static void dc_file_drop_target_read_file_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_file_drop_target_read_file_value (DcFileDropTarget* self,
                                          GdkDrop* drop,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static GFile* dc_file_drop_target_read_file_value_finish (DcFileDropTarget* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static void dc_file_drop_target_read_file_list (DcFileDropTarget* self,
                                         GdkDrop* drop,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static GFile* dc_file_drop_target_read_file_list_finish (DcFileDropTarget* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static void dc_file_drop_target_read_file_value_data_free (gpointer _data);
static gboolean dc_file_drop_target_read_file_value_co (DcFileDropTargetReadFileValueData* _data_);
static void dc_file_drop_target_read_file_value_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static GValue* _g_value_dup (GValue* self);
static void _vala_GValue_free (GValue* self);
static void dc_file_drop_target_read_file_list_data_free (gpointer _data);
static gboolean dc_file_drop_target_read_file_list_co (DcFileDropTargetReadFileListData* _data_);
static void dc_file_drop_target_read_file_list_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static GdkFileList* _vala_GdkFileList_copy (GdkFileList* self);
static void _vala_GdkFileList_free (GdkFileList* self);
static void dc_file_drop_target_read_uri_list_file_data_free (gpointer _data);
static gboolean dc_file_drop_target_read_uri_list_file_co (DcFileDropTargetReadUriListFileData* _data_);
static void dc_file_drop_target_read_uri_list_file_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void g_cclosure_user_marshal_BOOLEAN__VOID (GClosure * closure,
                                            GValue * return_value,
                                            guint n_param_values,
                                            const GValue * param_values,
                                            gpointer invocation_hint,
                                            gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__STRING_STRING (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void dc_file_drop_target_finalize (GObject * obj);
static GType dc_file_drop_target_get_type_once (void);
VALA_EXTERN GType dc_native_file_drop_target_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcNativeFileDropTarget, g_object_unref)
VALA_EXTERN DcNativeFileDropTarget* dc_native_file_drop_target_new (GtkWidget* widget);
VALA_EXTERN DcNativeFileDropTarget* dc_native_file_drop_target_construct (GType object_type,
                                                              GtkWidget* widget);
static void dc_native_file_drop_target_install (DcNativeFileDropTarget* self);
static void _dc_native_file_drop_target_install_gtk_widget_map (GtkWidget* _sender,
                                                         gpointer self);
VALA_EXTERN void dc_platform_install_macos_file_drop_handler (GtkWidget* widget,
                                                  DcPlatformRawMacosFileDropCallback callback,
                                                  void* user_data);
static void dc_native_file_drop_target_on_path_dropped (const gchar* path,
                                                 gdouble x,
                                                 gdouble y,
                                                 void* user_data);
static void _dc_native_file_drop_target_on_path_dropped_dc_platform_raw_macos_file_drop_callback (const gchar* path,
                                                                                           gdouble x,
                                                                                           gdouble y,
                                                                                           void* user_data);
static void g_cclosure_user_marshal_VOID__STRING_DOUBLE_DOUBLE (GClosure * closure,
                                                         GValue * return_value,
                                                         guint n_param_values,
                                                         const GValue * param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
static void dc_native_file_drop_target_finalize (GObject * obj);
static GType dc_native_file_drop_target_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 inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dc_file_drop_target_get_instance_private (DcFileDropTarget* self)
{
	return G_STRUCT_MEMBER_P (self, DcFileDropTarget_private_offset);
}

DcFileDropTarget*
dc_file_drop_target_construct (GType object_type,
                               GtkWidget* widget,
                               const gchar* active_css_class)
{
	DcFileDropTarget * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (widget != NULL, NULL);
	g_return_val_if_fail (active_css_class != NULL, NULL);
	self = (DcFileDropTarget*) g_object_new (object_type, NULL);
	self->priv->widget = widget;
	_tmp0_ = g_strdup (active_css_class);
	_g_free0 (self->priv->active_css_class);
	self->priv->active_css_class = _tmp0_;
	dc_file_drop_target_install (self);
	return self;
}

DcFileDropTarget*
dc_file_drop_target_new (GtkWidget* widget,
                         const gchar* active_css_class)
{
	return dc_file_drop_target_construct (DC_TYPE_FILE_DROP_TARGET, widget, active_css_class);
}

static gboolean
__lambda38_ (DcFileDropTarget* self,
             GdkDrop* gdk_drop)
{
	gboolean result;
	g_return_val_if_fail (gdk_drop != NULL, FALSE);
	result = dc_file_drop_target_can_accept (self, gdk_drop);
	return result;
}

static gboolean
___lambda38__gtk_drop_target_async_accept (GtkDropTargetAsync* _sender,
                                           GdkDrop* drop,
                                           gpointer self)
{
	gboolean result;
	result = __lambda38_ ((DcFileDropTarget*) self, drop);
	return result;
}

static GdkDragAction
__lambda39_ (DcFileDropTarget* self,
             GdkDrop* gdk_drop,
             gdouble x,
             gdouble y)
{
	GdkDragAction action = 0U;
	GdkDragAction result;
	g_return_val_if_fail (gdk_drop != NULL, 0U);
	action = dc_file_drop_target_action_for (self, gdk_drop);
	if (action != ((GdkDragAction) 0)) {
		GtkWidget* _tmp0_;
		const gchar* _tmp1_;
		_tmp0_ = self->priv->widget;
		_tmp1_ = self->priv->active_css_class;
		gtk_widget_add_css_class (_tmp0_, _tmp1_);
	}
	result = action;
	return result;
}

static GdkDragAction
___lambda39__gtk_drop_target_async_drag_enter (GtkDropTargetAsync* _sender,
                                               GdkDrop* drop,
                                               gdouble x,
                                               gdouble y,
                                               gpointer self)
{
	GdkDragAction result;
	result = __lambda39_ ((DcFileDropTarget*) self, drop, x, y);
	return result;
}

static GdkDragAction
__lambda40_ (DcFileDropTarget* self,
             GdkDrop* gdk_drop,
             gdouble x,
             gdouble y)
{
	GdkDragAction result;
	g_return_val_if_fail (gdk_drop != NULL, 0U);
	result = dc_file_drop_target_action_for (self, gdk_drop);
	return result;
}

static GdkDragAction
___lambda40__gtk_drop_target_async_drag_motion (GtkDropTargetAsync* _sender,
                                                GdkDrop* drop,
                                                gdouble x,
                                                gdouble y,
                                                gpointer self)
{
	GdkDragAction result;
	result = __lambda40_ ((DcFileDropTarget*) self, drop, x, y);
	return result;
}

static void
__lambda41_ (DcFileDropTarget* self,
             GdkDrop* gdk_drop)
{
	GtkWidget* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (gdk_drop != NULL);
	_tmp0_ = self->priv->widget;
	_tmp1_ = self->priv->active_css_class;
	gtk_widget_remove_css_class (_tmp0_, _tmp1_);
}

static void
___lambda41__gtk_drop_target_async_drag_leave (GtkDropTargetAsync* _sender,
                                               GdkDrop* drop,
                                               gpointer self)
{
	__lambda41_ ((DcFileDropTarget*) self, drop);
}

static gboolean
__lambda42_ (DcFileDropTarget* self,
             GdkDrop* gdk_drop,
             gdouble x,
             gdouble y)
{
	GtkWidget* _tmp0_;
	const gchar* _tmp1_;
	gboolean result;
	g_return_val_if_fail (gdk_drop != NULL, FALSE);
	_tmp0_ = self->priv->widget;
	_tmp1_ = self->priv->active_css_class;
	gtk_widget_remove_css_class (_tmp0_, _tmp1_);
	if (!dc_file_drop_target_can_accept (self, gdk_drop)) {
		result = FALSE;
		return result;
	}
	dc_file_drop_target_handle_drop (self, gdk_drop, NULL, NULL);
	result = TRUE;
	return result;
}

static gboolean
___lambda42__gtk_drop_target_async_drop (GtkDropTargetAsync* _sender,
                                         GdkDrop* drop,
                                         gdouble x,
                                         gdouble y,
                                         gpointer self)
{
	gboolean result;
	result = __lambda42_ ((DcFileDropTarget*) self, drop, x, y);
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
dc_file_drop_target_install (DcFileDropTarget* self)
{
	GtkDropTargetAsync* drop = NULL;
	GdkContentFormats* _tmp0_;
	GtkDropTargetAsync* _tmp1_;
	GtkWidget* _tmp2_;
	GtkEventController* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dc_file_drop_target_content_formats (self);
	_tmp1_ = gtk_drop_target_async_new (_tmp0_, GDK_ACTION_COPY);
	drop = _tmp1_;
	g_signal_connect_object (drop, "accept", (GCallback) ___lambda38__gtk_drop_target_async_accept, self, 0);
	g_signal_connect_object (drop, "drag-enter", (GCallback) ___lambda39__gtk_drop_target_async_drag_enter, self, 0);
	g_signal_connect_object (drop, "drag-motion", (GCallback) ___lambda40__gtk_drop_target_async_drag_motion, self, 0);
	g_signal_connect_object (drop, "drag-leave", (GCallback) ___lambda41__gtk_drop_target_async_drag_leave, self, 0);
	g_signal_connect_object (drop, "drop", (GCallback) ___lambda42__gtk_drop_target_async_drop, self, 0);
	_tmp2_ = self->priv->widget;
	_tmp3_ = _g_object_ref0 ((GtkEventController*) drop);
	gtk_widget_add_controller (_tmp2_, _tmp3_);
	_g_object_unref0 (drop);
}

static GdkContentFormats*
dc_file_drop_target_content_formats (DcFileDropTarget* self)
{
	GdkContentFormatsBuilder* formats = NULL;
	GdkContentFormatsBuilder* _tmp0_;
	GdkContentFormatsBuilder* _tmp1_;
	GdkContentFormatsBuilder* _tmp2_;
	GdkContentFormatsBuilder* _tmp3_;
	GdkContentFormatsBuilder* _tmp4_;
	GdkContentFormats* _tmp5_;
	GdkContentFormats* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (dc_platform_is_macos ()) {
		result = NULL;
		return result;
	}
	_tmp0_ = gdk_content_formats_builder_new ();
	formats = _tmp0_;
	_tmp1_ = formats;
	gdk_content_formats_builder_add_gtype (_tmp1_, g_file_get_type ());
	_tmp2_ = formats;
	gdk_content_formats_builder_add_gtype (_tmp2_, gdk_file_list_get_type ());
	_tmp3_ = formats;
	gdk_content_formats_builder_add_mime_type (_tmp3_, DC_FILE_DROP_TARGET_URI_LIST_MIME_TYPE);
	_tmp4_ = formats;
	_tmp5_ = gdk_content_formats_builder_to_formats (_tmp4_);
	result = _tmp5_;
	_gdk_content_formats_builder_unref0 (formats);
	return result;
}

static gpointer
_gdk_content_formats_ref0 (gpointer self)
{
	return self ? gdk_content_formats_ref (self) : NULL;
}

static gboolean
dc_file_drop_target_can_accept (DcFileDropTarget* self,
                                GdkDrop* drop)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GdkContentFormats* formats = NULL;
	GdkContentFormats* _tmp2_;
	GdkContentFormats* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GdkContentFormats* _tmp6_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (drop != NULL, FALSE);
	g_signal_emit (self, dc_file_drop_target_signals[DC_FILE_DROP_TARGET_ACCEPT_SIGNAL], 0, &_tmp1_);
	if (!_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = dc_file_drop_target_preferred_action (self, drop) == ((GdkDragAction) 0);
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	if (dc_platform_is_macos ()) {
		result = TRUE;
		return result;
	}
	_tmp2_ = gdk_drop_get_formats (drop);
	_tmp3_ = _gdk_content_formats_ref0 (_tmp2_);
	formats = _tmp3_;
	_tmp6_ = formats;
	if (gdk_content_formats_contain_gtype (_tmp6_, g_file_get_type ())) {
		_tmp5_ = TRUE;
	} else {
		GdkContentFormats* _tmp7_;
		_tmp7_ = formats;
		_tmp5_ = gdk_content_formats_contain_gtype (_tmp7_, gdk_file_list_get_type ());
	}
	if (_tmp5_) {
		_tmp4_ = TRUE;
	} else {
		GdkContentFormats* _tmp8_;
		_tmp8_ = formats;
		_tmp4_ = gdk_content_formats_contain_mime_type (_tmp8_, DC_FILE_DROP_TARGET_URI_LIST_MIME_TYPE);
	}
	result = _tmp4_;
	_gdk_content_formats_unref0 (formats);
	return result;
}

static GdkDragAction
dc_file_drop_target_action_for (DcFileDropTarget* self,
                                GdkDrop* drop)
{
	GdkDragAction _tmp0_ = 0U;
	GdkDragAction result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (drop != NULL, 0U);
	if (dc_file_drop_target_can_accept (self, drop)) {
		_tmp0_ = dc_file_drop_target_preferred_action (self, drop);
	} else {
		_tmp0_ = (GdkDragAction) 0;
	}
	result = _tmp0_;
	return result;
}

static GdkDragAction
dc_file_drop_target_preferred_action (DcFileDropTarget* self,
                                      GdkDrop* drop)
{
	GdkDragAction _tmp0_ = 0U;
	GdkDragAction result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (drop != NULL, 0U);
	if ((gdk_drop_get_actions (drop) & GDK_ACTION_COPY) != 0) {
		_tmp0_ = GDK_ACTION_COPY;
	} else {
		_tmp0_ = (GdkDragAction) 0;
	}
	result = _tmp0_;
	return result;
}

static void
dc_file_drop_target_handle_drop_data_free (gpointer _data)
{
	DcFileDropTargetHandleDropData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->drop);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcFileDropTargetHandleDropData, _data_);
}

static void
dc_file_drop_target_handle_drop (DcFileDropTarget* self,
                                 GdkDrop* drop,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DcFileDropTargetHandleDropData* _data_;
	DcFileDropTarget* _tmp0_;
	GdkDrop* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (drop != NULL);
	_data_ = g_slice_new0 (DcFileDropTargetHandleDropData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_file_drop_target_handle_drop_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (drop);
	_g_object_unref0 (_data_->drop);
	_data_->drop = _tmp1_;
	dc_file_drop_target_handle_drop_co (_data_);
}

static void
dc_file_drop_target_handle_drop_finish (DcFileDropTarget* self,
                                        GAsyncResult* _res_)
{
	DcFileDropTargetHandleDropData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_file_drop_target_handle_drop_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DcFileDropTargetHandleDropData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_file_drop_target_handle_drop_co (_data_);
}

static gboolean
dc_file_drop_target_handle_drop_co (DcFileDropTargetHandleDropData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->ok = FALSE;
	{
		_data_->_state_ = 1;
		dc_file_drop_target_read_file (_data_->self, _data_->drop, dc_file_drop_target_handle_drop_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = dc_file_drop_target_read_file_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->file = _data_->_tmp0_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp1_ = _data_->file;
		if (_data_->_tmp1_ == NULL) {
			g_signal_emit (_data_->self, dc_file_drop_target_signals[DC_FILE_DROP_TARGET_FAILED_SIGNAL], 0, "unsupported drop data");
		} else {
			_data_->_tmp3_ = _data_->file;
			_data_->_state_ = 2;
			dc_file_drop_target_emit_local_file (_data_->self, _data_->_tmp3_, dc_file_drop_target_handle_drop_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp2_ = dc_file_drop_target_emit_local_file_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->file);
				goto __catch0_g_error;
			}
			_data_->ok = _data_->_tmp2_;
		}
		_g_object_unref0 (_data_->file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_signal_emit (_data_->self, dc_file_drop_target_signals[DC_FILE_DROP_TARGET_FAILED_SIGNAL], 0, _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	{
		if (_data_->ok) {
			_data_->_tmp6_ = GDK_ACTION_COPY;
		} else {
			_data_->_tmp6_ = (GdkDragAction) 0;
		}
		gdk_drop_finish (_data_->drop, _data_->_tmp6_);
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_file_drop_target_emit_local_file_data_free (gpointer _data)
{
	DcFileDropTargetEmitLocalFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcFileDropTargetEmitLocalFileData, _data_);
}

static void
dc_file_drop_target_emit_local_file (DcFileDropTarget* self,
                                     GFile* file,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcFileDropTargetEmitLocalFileData* _data_;
	DcFileDropTarget* _tmp0_;
	GFile* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	_data_ = g_slice_new0 (DcFileDropTargetEmitLocalFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_file_drop_target_emit_local_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file);
	_g_object_unref0 (_data_->file);
	_data_->file = _tmp1_;
	dc_file_drop_target_emit_local_file_co (_data_);
}

static gboolean
dc_file_drop_target_emit_local_file_finish (DcFileDropTarget* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	gboolean result;
	DcFileDropTargetEmitLocalFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_file_drop_target_emit_local_file_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcFileDropTargetEmitLocalFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_file_drop_target_emit_local_file_co (_data_);
}

static gboolean
dc_file_drop_target_emit_local_file_co (DcFileDropTargetEmitLocalFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_file_get_path (_data_->file);
	_data_->path = _data_->_tmp0_;
	_data_->_tmp2_ = g_file_get_basename (_data_->file);
	_data_->_tmp1_ = _data_->_tmp2_;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp3_ = g_strdup ("attachment");
		_g_free0 (_data_->_tmp1_);
		_data_->_tmp1_ = _data_->_tmp3_;
	}
	_data_->_tmp4_ = _data_->_tmp1_;
	_data_->_tmp1_ = NULL;
	_data_->name = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->path;
	if (_data_->_tmp5_ == NULL) {
		_data_->_tmp6_ = NULL;
		_data_->_tmp7_ = g_file_new_tmp ("parla-XXXXXX", &_data_->_tmp6_, &_data_->_inner_error0_);
		_g_object_unref0 (_data_->stream);
		_data_->stream = _data_->_tmp6_;
		_data_->tmp = _data_->_tmp7_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->stream);
			_g_free0 (_data_->name);
			_g_free0 (_data_->_tmp1_);
			_g_free0 (_data_->path);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp8_ = _data_->stream;
		g_io_stream_close ((GIOStream*) _data_->_tmp8_, NULL, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->tmp);
			_g_object_unref0 (_data_->stream);
			_g_free0 (_data_->name);
			_g_free0 (_data_->_tmp1_);
			_g_free0 (_data_->path);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp9_ = _data_->tmp;
		_data_->_state_ = 1;
		g_file_copy_async (_data_->file, _data_->_tmp9_, G_FILE_COPY_OVERWRITE, G_PRIORITY_DEFAULT, NULL, NULL, NULL, dc_file_drop_target_emit_local_file_ready, _data_);
		return FALSE;
		_state_1:
		g_file_copy_finish (_data_->file, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->tmp);
			_g_object_unref0 (_data_->stream);
			_g_free0 (_data_->name);
			_g_free0 (_data_->_tmp1_);
			_g_free0 (_data_->path);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp10_ = _data_->tmp;
		_data_->_tmp11_ = g_file_get_path (_data_->_tmp10_);
		_g_free0 (_data_->path);
		_data_->path = _data_->_tmp11_;
		_g_object_unref0 (_data_->tmp);
		_g_object_unref0 (_data_->stream);
	}
	_data_->_tmp12_ = _data_->path;
	if (_data_->_tmp12_ == NULL) {
		g_signal_emit (_data_->self, dc_file_drop_target_signals[DC_FILE_DROP_TARGET_FAILED_SIGNAL], 0, "file has no local path");
		_data_->result = FALSE;
		_g_free0 (_data_->name);
		_g_free0 (_data_->_tmp1_);
		_g_free0 (_data_->path);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp13_ = _data_->path;
	_data_->_tmp14_ = _data_->name;
	g_signal_emit (_data_->self, dc_file_drop_target_signals[DC_FILE_DROP_TARGET_DROPPED_SIGNAL], 0, _data_->_tmp13_, _data_->_tmp14_);
	_data_->result = TRUE;
	_g_free0 (_data_->name);
	_g_free0 (_data_->_tmp1_);
	_g_free0 (_data_->path);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_file_drop_target_read_file_data_free (gpointer _data)
{
	DcFileDropTargetReadFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->drop);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcFileDropTargetReadFileData, _data_);
}

static void
dc_file_drop_target_read_file (DcFileDropTarget* self,
                               GdkDrop* drop,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcFileDropTargetReadFileData* _data_;
	DcFileDropTarget* _tmp0_;
	GdkDrop* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (drop != NULL);
	_data_ = g_slice_new0 (DcFileDropTargetReadFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_file_drop_target_read_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (drop);
	_g_object_unref0 (_data_->drop);
	_data_->drop = _tmp1_;
	dc_file_drop_target_read_file_co (_data_);
}

static GFile*
dc_file_drop_target_read_file_finish (DcFileDropTarget* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	GFile* result;
	DcFileDropTargetReadFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_file_drop_target_read_file_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcFileDropTargetReadFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_file_drop_target_read_file_co (_data_);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
dc_file_drop_target_read_file_co (DcFileDropTargetReadFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (dc_platform_is_macos ()) {
		{
			_data_->_state_ = 1;
			dc_file_drop_target_read_uri_list_file (_data_->self, _data_->drop, dc_file_drop_target_read_file_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp0_ = dc_file_drop_target_read_uri_list_file_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			_data_->file = _data_->_tmp0_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_tmp1_ = _data_->file;
			if (_data_->_tmp1_ != NULL) {
				_data_->result = _data_->file;
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->file);
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_data_->_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp2_ = gdk_drop_get_formats (_data_->drop);
	_data_->_tmp3_ = _gdk_content_formats_ref0 (_data_->_tmp2_);
	_data_->formats = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->formats;
	if (gdk_content_formats_contain_gtype (_data_->_tmp4_, g_file_get_type ())) {
		{
			_data_->_state_ = 2;
			dc_file_drop_target_read_file_value (_data_->self, _data_->drop, dc_file_drop_target_read_file_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp5_ = dc_file_drop_target_read_file_value_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			_data_->_vala1_file = _data_->_tmp5_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
			_data_->_tmp6_ = _data_->_vala1_file;
			if (_data_->_tmp6_ != NULL) {
				_data_->result = _data_->_vala1_file;
				_gdk_content_formats_unref0 (_data_->formats);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->_vala1_file);
		}
		goto __finally1;
		__catch1_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp8_ = _data_->formats;
			if (!gdk_content_formats_contain_gtype (_data_->_tmp8_, gdk_file_list_get_type ())) {
				_data_->_tmp9_ = _data_->formats;
				_data_->_tmp7_ = !gdk_content_formats_contain_mime_type (_data_->_tmp9_, DC_FILE_DROP_TARGET_URI_LIST_MIME_TYPE);
			} else {
				_data_->_tmp7_ = FALSE;
			}
			if (_data_->_tmp7_) {
				_data_->_tmp10_ = _data_->e;
				_data_->_tmp11_ = _g_error_copy0 (_data_->_tmp10_);
				_data_->_inner_error0_ = _data_->_tmp11_;
				_g_error_free0 (_data_->e);
				goto __finally1;
			}
			_g_error_free0 (_data_->e);
		}
		__finally1:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_gdk_content_formats_unref0 (_data_->formats);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp12_ = _data_->formats;
	if (gdk_content_formats_contain_gtype (_data_->_tmp12_, gdk_file_list_get_type ())) {
		{
			_data_->_state_ = 3;
			dc_file_drop_target_read_file_list (_data_->self, _data_->drop, dc_file_drop_target_read_file_ready, _data_);
			return FALSE;
			_state_3:
			_data_->_tmp13_ = dc_file_drop_target_read_file_list_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			_data_->_vala2_file = _data_->_tmp13_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch2_g_error;
			}
			_data_->_tmp14_ = _data_->_vala2_file;
			if (_data_->_tmp14_ != NULL) {
				_data_->result = _data_->_vala2_file;
				_gdk_content_formats_unref0 (_data_->formats);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->_vala2_file);
		}
		goto __finally2;
		__catch2_g_error:
		{
			_data_->_vala1_e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp15_ = _data_->formats;
			if (!gdk_content_formats_contain_mime_type (_data_->_tmp15_, DC_FILE_DROP_TARGET_URI_LIST_MIME_TYPE)) {
				_data_->_tmp16_ = _data_->_vala1_e;
				_data_->_tmp17_ = _g_error_copy0 (_data_->_tmp16_);
				_data_->_inner_error0_ = _data_->_tmp17_;
				_g_error_free0 (_data_->_vala1_e);
				goto __finally2;
			}
			_g_error_free0 (_data_->_vala1_e);
		}
		__finally2:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_gdk_content_formats_unref0 (_data_->formats);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_state_ = 4;
	dc_file_drop_target_read_uri_list_file (_data_->self, _data_->drop, dc_file_drop_target_read_file_ready, _data_);
	return FALSE;
	_state_4:
	_data_->_tmp19_ = dc_file_drop_target_read_uri_list_file_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp18_ = _data_->_tmp19_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_gdk_content_formats_unref0 (_data_->formats);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp20_ = _data_->_tmp18_;
	_data_->_tmp18_ = NULL;
	_data_->result = _data_->_tmp20_;
	_g_object_unref0 (_data_->_tmp18_);
	_gdk_content_formats_unref0 (_data_->formats);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_file_drop_target_read_file_value_data_free (gpointer _data)
{
	DcFileDropTargetReadFileValueData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->drop);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcFileDropTargetReadFileValueData, _data_);
}

static void
dc_file_drop_target_read_file_value (DcFileDropTarget* self,
                                     GdkDrop* drop,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcFileDropTargetReadFileValueData* _data_;
	DcFileDropTarget* _tmp0_;
	GdkDrop* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (drop != NULL);
	_data_ = g_slice_new0 (DcFileDropTargetReadFileValueData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_file_drop_target_read_file_value_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (drop);
	_g_object_unref0 (_data_->drop);
	_data_->drop = _tmp1_;
	dc_file_drop_target_read_file_value_co (_data_);
}

static GFile*
dc_file_drop_target_read_file_value_finish (DcFileDropTarget* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	GFile* result;
	DcFileDropTargetReadFileValueData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_file_drop_target_read_file_value_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcFileDropTargetReadFileValueData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_file_drop_target_read_file_value_co (_data_);
}

static GValue*
_g_value_dup (GValue* self)
{
	return g_boxed_copy (G_TYPE_VALUE, self);
}

static gpointer
__g_value_dup0 (gpointer self)
{
	return self ? _g_value_dup (self) : NULL;
}

static void
_vala_GValue_free (GValue* self)
{
	g_boxed_free (G_TYPE_VALUE, self);
}

static gboolean
dc_file_drop_target_read_file_value_co (DcFileDropTargetReadFileValueData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	gdk_drop_read_value_async (_data_->drop, g_file_get_type (), G_PRIORITY_DEFAULT, NULL, dc_file_drop_target_read_file_value_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = __g_value_dup0 (gdk_drop_read_value_finish (_data_->drop, _data_->_res_, &_data_->_inner_error0_));
	_data_->value = _data_->_tmp0_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (((gpointer) _data_->value) == NULL) {
		_g_object_unref0 (_data_->_tmp1_);
		_data_->_tmp1_ = NULL;
	} else {
		_data_->_tmp2_ = g_value_dup_object (_data_->value);
		_g_object_unref0 (_data_->_tmp1_);
		_data_->_tmp1_ = _data_->_tmp2_;
	}
	_data_->_tmp3_ = _data_->_tmp1_;
	_data_->_tmp1_ = NULL;
	_data_->obj = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->obj;
	_data_->_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp4_, g_file_get_type ()) ? ((GFile*) _data_->_tmp4_) : NULL);
	_data_->result = _data_->_tmp5_;
	_g_object_unref0 (_data_->obj);
	_g_object_unref0 (_data_->_tmp1_);
	__vala_GValue_free0 (_data_->value);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_file_drop_target_read_file_list_data_free (gpointer _data)
{
	DcFileDropTargetReadFileListData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->drop);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcFileDropTargetReadFileListData, _data_);
}

static void
dc_file_drop_target_read_file_list (DcFileDropTarget* self,
                                    GdkDrop* drop,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	DcFileDropTargetReadFileListData* _data_;
	DcFileDropTarget* _tmp0_;
	GdkDrop* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (drop != NULL);
	_data_ = g_slice_new0 (DcFileDropTargetReadFileListData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_file_drop_target_read_file_list_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (drop);
	_g_object_unref0 (_data_->drop);
	_data_->drop = _tmp1_;
	dc_file_drop_target_read_file_list_co (_data_);
}

static GFile*
dc_file_drop_target_read_file_list_finish (DcFileDropTarget* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	GFile* result;
	DcFileDropTargetReadFileListData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_file_drop_target_read_file_list_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	DcFileDropTargetReadFileListData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_file_drop_target_read_file_list_co (_data_);
}

static GdkFileList*
_vala_GdkFileList_copy (GdkFileList* self)
{
	return g_boxed_copy (gdk_file_list_get_type (), self);
}

static gpointer
__vala_GdkFileList_copy0 (gpointer self)
{
	return self ? _vala_GdkFileList_copy (self) : NULL;
}

static void
_vala_GdkFileList_free (GdkFileList* self)
{
	g_boxed_free (gdk_file_list_get_type (), self);
}

static gboolean
dc_file_drop_target_read_file_list_co (DcFileDropTargetReadFileListData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	gdk_drop_read_value_async (_data_->drop, gdk_file_list_get_type (), G_PRIORITY_DEFAULT, NULL, dc_file_drop_target_read_file_list_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = __g_value_dup0 (gdk_drop_read_value_finish (_data_->drop, _data_->_res_, &_data_->_inner_error0_));
	_data_->value = _data_->_tmp0_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (((gpointer) _data_->value) == NULL) {
		_data_->_tmp1_ = NULL;
	} else {
		_data_->_tmp2_ = g_value_get_boxed (_data_->value);
		_data_->_tmp1_ = (GdkFileList*) _data_->_tmp2_;
	}
	_data_->_tmp3_ = __vala_GdkFileList_copy0 (_data_->_tmp1_);
	_data_->fl = _data_->_tmp3_;
	_data_->files = NULL;
	_data_->_tmp4_ = _data_->fl;
	if (_data_->_tmp4_ != NULL) {
		_data_->_tmp5_ = _data_->fl;
		_data_->_tmp6_ = gdk_file_list_get_files (_data_->_tmp5_);
		(_data_->files == NULL) ? NULL : (_data_->files = (g_slist_free (_data_->files), NULL));
		_data_->files = _data_->_tmp6_;
	}
	_data_->_tmp8_ = _data_->files;
	if (_data_->_tmp8_ == NULL) {
		_data_->_tmp7_ = TRUE;
	} else {
		_data_->_tmp9_ = _data_->files;
		_data_->_tmp10_ = _data_->_tmp9_->data;
		_data_->_tmp7_ = ((GFile*) _data_->_tmp10_) == NULL;
	}
	if (_data_->_tmp7_) {
		_data_->result = NULL;
		(_data_->files == NULL) ? NULL : (_data_->files = (g_slist_free (_data_->files), NULL));
		__vala_GdkFileList_free0 (_data_->fl);
		__vala_GValue_free0 (_data_->value);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->files;
	_data_->_tmp12_ = _data_->_tmp11_->data;
	_data_->borrowed = (GFile*) _data_->_tmp12_;
	_data_->_tmp13_ = _data_->borrowed;
	_data_->_tmp14_ = g_object_ref ((GObject*) _data_->_tmp13_);
	_data_->_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp14_, g_file_get_type (), GFile));
	_data_->result = _data_->_tmp15_;
	(_data_->files == NULL) ? NULL : (_data_->files = (g_slist_free (_data_->files), NULL));
	__vala_GdkFileList_free0 (_data_->fl);
	__vala_GValue_free0 (_data_->value);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_file_drop_target_read_uri_list_file_data_free (gpointer _data)
{
	DcFileDropTargetReadUriListFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->drop);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcFileDropTargetReadUriListFileData, _data_);
}

static void
dc_file_drop_target_read_uri_list_file (DcFileDropTarget* self,
                                        GdkDrop* drop,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcFileDropTargetReadUriListFileData* _data_;
	DcFileDropTarget* _tmp0_;
	GdkDrop* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (drop != NULL);
	_data_ = g_slice_new0 (DcFileDropTargetReadUriListFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_file_drop_target_read_uri_list_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (drop);
	_g_object_unref0 (_data_->drop);
	_data_->drop = _tmp1_;
	dc_file_drop_target_read_uri_list_file_co (_data_);
}

static GFile*
dc_file_drop_target_read_uri_list_file_finish (DcFileDropTarget* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	GFile* result;
	DcFileDropTargetReadUriListFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_file_drop_target_read_uri_list_file_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcFileDropTargetReadUriListFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_file_drop_target_read_uri_list_file_co (_data_);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gboolean
dc_file_drop_target_read_uri_list_file_co (DcFileDropTargetReadUriListFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gdk_drop_get_formats (_data_->drop);
	_data_->_tmp1_ = _gdk_content_formats_ref0 (_data_->_tmp0_);
	_data_->formats = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->formats;
	if (!gdk_content_formats_contain_mime_type (_data_->_tmp2_, DC_FILE_DROP_TARGET_URI_LIST_MIME_TYPE)) {
		_data_->result = NULL;
		_gdk_content_formats_unref0 (_data_->formats);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = g_strdup (DC_FILE_DROP_TARGET_URI_LIST_MIME_TYPE);
	_data_->_tmp4_ = g_new0 (gchar*, 1 + 1);
	_data_->_tmp4_[0] = _data_->_tmp3_;
	_data_->mime_types = _data_->_tmp4_;
	_data_->mime_types_length1 = 1;
	_data_->_mime_types_size_ = _data_->mime_types_length1;
	_data_->_tmp5_ = _data_->mime_types;
	_data_->_tmp5__length1 = _data_->mime_types_length1;
	_data_->_tmp6_ = NULL;
	_data_->_state_ = 1;
	gdk_drop_read_async (_data_->drop, _data_->_tmp5_, G_PRIORITY_DEFAULT, NULL, dc_file_drop_target_read_uri_list_file_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp7_ = gdk_drop_read_finish (_data_->drop, _data_->_res_, &_data_->_tmp6_, &_data_->_inner_error0_);
	_data_->out_mime_type = _data_->_tmp6_;
	_data_->stream = _data_->_tmp7_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_data_->mime_types = (_vala_array_free (_data_->mime_types, _data_->mime_types_length1, (GDestroyNotify) g_free), NULL);
		_gdk_content_formats_unref0 (_data_->formats);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = _data_->stream;
	if (_data_->_tmp8_ == NULL) {
		_data_->result = NULL;
		_g_object_unref0 (_data_->stream);
		_data_->mime_types = (_vala_array_free (_data_->mime_types, _data_->mime_types_length1, (GDestroyNotify) g_free), NULL);
		_gdk_content_formats_unref0 (_data_->formats);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->stream;
	_data_->_tmp10_ = g_data_input_stream_new (_data_->_tmp9_);
	_data_->data = _data_->_tmp10_;
	while (TRUE) {
		_data_->_tmp12_ = _data_->data;
		_data_->_state_ = 2;
		g_data_input_stream_read_line_async (_data_->_tmp12_, G_PRIORITY_DEFAULT, NULL, dc_file_drop_target_read_uri_list_file_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp13_ = g_data_input_stream_read_line_finish_utf8 (_data_->_tmp12_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp11_ = _data_->_tmp13_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->line);
			_g_object_unref0 (_data_->data);
			_g_object_unref0 (_data_->stream);
			_data_->mime_types = (_vala_array_free (_data_->mime_types, _data_->mime_types_length1, (GDestroyNotify) g_free), NULL);
			_gdk_content_formats_unref0 (_data_->formats);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp14_ = _data_->_tmp11_;
		_data_->_tmp11_ = NULL;
		_g_free0 (_data_->line);
		_data_->line = _data_->_tmp14_;
		_data_->_tmp15_ = _data_->line;
		if (!(_data_->_tmp15_ != NULL)) {
			_g_free0 (_data_->_tmp11_);
			break;
		}
		_data_->_tmp16_ = _data_->line;
		_data_->_tmp17_ = string_strip (_data_->_tmp16_);
		_data_->uri = _data_->_tmp17_;
		_data_->_tmp19_ = _data_->uri;
		_data_->_tmp20_ = strlen (_data_->_tmp19_);
		_data_->_tmp21_ = _data_->_tmp20_;
		if (_data_->_tmp21_ == 0) {
			_data_->_tmp18_ = TRUE;
		} else {
			_data_->_tmp22_ = _data_->uri;
			_data_->_tmp18_ = g_str_has_prefix (_data_->_tmp22_, "#");
		}
		if (_data_->_tmp18_) {
			_g_free0 (_data_->uri);
			_g_free0 (_data_->_tmp11_);
			continue;
		}
		_data_->_tmp23_ = _data_->uri;
		_data_->_tmp24_ = g_file_new_for_uri (_data_->_tmp23_);
		_data_->result = _data_->_tmp24_;
		_g_free0 (_data_->uri);
		_g_free0 (_data_->_tmp11_);
		_g_free0 (_data_->line);
		_g_object_unref0 (_data_->data);
		_g_object_unref0 (_data_->stream);
		_data_->mime_types = (_vala_array_free (_data_->mime_types, _data_->mime_types_length1, (GDestroyNotify) g_free), NULL);
		_gdk_content_formats_unref0 (_data_->formats);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = NULL;
	_g_free0 (_data_->line);
	_g_object_unref0 (_data_->data);
	_g_object_unref0 (_data_->stream);
	_data_->mime_types = (_vala_array_free (_data_->mime_types, _data_->mime_types_length1, (GDestroyNotify) g_free), NULL);
	_gdk_content_formats_unref0 (_data_->formats);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g_cclosure_user_marshal_BOOLEAN__VOID (GClosure * closure,
                                       GValue * return_value,
                                       guint n_param_values,
                                       const GValue * param_values,
                                       gpointer invocation_hint,
                                       gpointer marshal_data)
{
	typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1, gpointer data2);
	register GMarshalFunc_BOOLEAN__VOID callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	gboolean v_return;
	cc = (GCClosure *) closure;
	g_return_if_fail (return_value != NULL);
	g_return_if_fail (n_param_values == 1);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback);
	v_return = callback (data1, data2);
	g_value_set_boolean (return_value, v_return);
}

static void
g_cclosure_user_marshal_VOID__STRING_STRING (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer data1, const char* arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), data2);
}

static void
dc_file_drop_target_class_init (DcFileDropTargetClass * klass,
                                gpointer klass_data)
{
	dc_file_drop_target_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcFileDropTarget_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dc_file_drop_target_finalize;
	dc_file_drop_target_signals[DC_FILE_DROP_TARGET_ACCEPT_SIGNAL] = g_signal_new ("accept", DC_TYPE_FILE_DROP_TARGET, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0);
	dc_file_drop_target_signals[DC_FILE_DROP_TARGET_DROPPED_SIGNAL] = g_signal_new ("dropped", DC_TYPE_FILE_DROP_TARGET, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
	dc_file_drop_target_signals[DC_FILE_DROP_TARGET_FAILED_SIGNAL] = g_signal_new ("failed", DC_TYPE_FILE_DROP_TARGET, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
dc_file_drop_target_instance_init (DcFileDropTarget * self,
                                   gpointer klass)
{
	self->priv = dc_file_drop_target_get_instance_private (self);
}

static void
dc_file_drop_target_finalize (GObject * obj)
{
	DcFileDropTarget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_FILE_DROP_TARGET, DcFileDropTarget);
	_g_free0 (self->priv->active_css_class);
	G_OBJECT_CLASS (dc_file_drop_target_parent_class)->finalize (obj);
}

static GType
dc_file_drop_target_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcFileDropTargetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_file_drop_target_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcFileDropTarget), 0, (GInstanceInitFunc) dc_file_drop_target_instance_init, NULL };
	GType dc_file_drop_target_type_id;
	dc_file_drop_target_type_id = g_type_register_static (G_TYPE_OBJECT, "DcFileDropTarget", &g_define_type_info, 0);
	DcFileDropTarget_private_offset = g_type_add_instance_private (dc_file_drop_target_type_id, sizeof (DcFileDropTargetPrivate));
	return dc_file_drop_target_type_id;
}

GType
dc_file_drop_target_get_type (void)
{
	static volatile gsize dc_file_drop_target_type_id__once = 0;
	if (g_once_init_enter (&dc_file_drop_target_type_id__once)) {
		GType dc_file_drop_target_type_id;
		dc_file_drop_target_type_id = dc_file_drop_target_get_type_once ();
		g_once_init_leave (&dc_file_drop_target_type_id__once, dc_file_drop_target_type_id);
	}
	return dc_file_drop_target_type_id__once;
}

static inline gpointer
dc_native_file_drop_target_get_instance_private (DcNativeFileDropTarget* self)
{
	return G_STRUCT_MEMBER_P (self, DcNativeFileDropTarget_private_offset);
}

static void
_dc_native_file_drop_target_install_gtk_widget_map (GtkWidget* _sender,
                                                    gpointer self)
{
	dc_native_file_drop_target_install ((DcNativeFileDropTarget*) self);
}

DcNativeFileDropTarget*
dc_native_file_drop_target_construct (GType object_type,
                                      GtkWidget* widget)
{
	DcNativeFileDropTarget * self = NULL;
	g_return_val_if_fail (widget != NULL, NULL);
	self = (DcNativeFileDropTarget*) g_object_new (object_type, NULL);
	self->priv->widget = widget;
	g_signal_connect_object (widget, "map", (GCallback) _dc_native_file_drop_target_install_gtk_widget_map, self, 0);
	return self;
}

DcNativeFileDropTarget*
dc_native_file_drop_target_new (GtkWidget* widget)
{
	return dc_native_file_drop_target_construct (DC_TYPE_NATIVE_FILE_DROP_TARGET, widget);
}

static void
_dc_native_file_drop_target_on_path_dropped_dc_platform_raw_macos_file_drop_callback (const gchar* path,
                                                                                      gdouble x,
                                                                                      gdouble y,
                                                                                      void* user_data)
{
	dc_native_file_drop_target_on_path_dropped (path, x, y, user_data);
}

static void
dc_native_file_drop_target_install (DcNativeFileDropTarget* self)
{
	GtkWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->widget;
	dc_platform_install_macos_file_drop_handler (_tmp0_, _dc_native_file_drop_target_on_path_dropped_dc_platform_raw_macos_file_drop_callback, self);
}

static void
dc_native_file_drop_target_on_path_dropped (const gchar* path,
                                            gdouble x,
                                            gdouble y,
                                            void* user_data)
{
	DcNativeFileDropTarget* _self_ = NULL;
	g_return_if_fail (path != NULL);
	_self_ = G_TYPE_CHECK_INSTANCE_CAST (user_data, DC_TYPE_NATIVE_FILE_DROP_TARGET, DcNativeFileDropTarget);
	g_signal_emit (_self_, dc_native_file_drop_target_signals[DC_NATIVE_FILE_DROP_TARGET_PATH_DROPPED_SIGNAL], 0, path, x, y);
}

static void
g_cclosure_user_marshal_VOID__STRING_DOUBLE_DOUBLE (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_DOUBLE_DOUBLE) (gpointer data1, const char* arg_1, gdouble arg_2, gdouble arg_3, gpointer data2);
	register GMarshalFunc_VOID__STRING_DOUBLE_DOUBLE callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_DOUBLE_DOUBLE) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_double (param_values + 2), g_value_get_double (param_values + 3), data2);
}

static void
dc_native_file_drop_target_class_init (DcNativeFileDropTargetClass * klass,
                                       gpointer klass_data)
{
	dc_native_file_drop_target_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcNativeFileDropTarget_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dc_native_file_drop_target_finalize;
	dc_native_file_drop_target_signals[DC_NATIVE_FILE_DROP_TARGET_PATH_DROPPED_SIGNAL] = g_signal_new ("path-dropped", DC_TYPE_NATIVE_FILE_DROP_TARGET, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_DOUBLE_DOUBLE, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
}

static void
dc_native_file_drop_target_instance_init (DcNativeFileDropTarget * self,
                                          gpointer klass)
{
	self->priv = dc_native_file_drop_target_get_instance_private (self);
}

static void
dc_native_file_drop_target_finalize (GObject * obj)
{
	DcNativeFileDropTarget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_NATIVE_FILE_DROP_TARGET, DcNativeFileDropTarget);
	G_OBJECT_CLASS (dc_native_file_drop_target_parent_class)->finalize (obj);
}

static GType
dc_native_file_drop_target_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcNativeFileDropTargetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_native_file_drop_target_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcNativeFileDropTarget), 0, (GInstanceInitFunc) dc_native_file_drop_target_instance_init, NULL };
	GType dc_native_file_drop_target_type_id;
	dc_native_file_drop_target_type_id = g_type_register_static (G_TYPE_OBJECT, "DcNativeFileDropTarget", &g_define_type_info, 0);
	DcNativeFileDropTarget_private_offset = g_type_add_instance_private (dc_native_file_drop_target_type_id, sizeof (DcNativeFileDropTargetPrivate));
	return dc_native_file_drop_target_type_id;
}

GType
dc_native_file_drop_target_get_type (void)
{
	static volatile gsize dc_native_file_drop_target_type_id__once = 0;
	if (g_once_init_enter (&dc_native_file_drop_target_type_id__once)) {
		GType dc_native_file_drop_target_type_id;
		dc_native_file_drop_target_type_id = dc_native_file_drop_target_get_type_once ();
		g_once_init_leave (&dc_native_file_drop_target_type_id__once, dc_native_file_drop_target_type_id);
	}
	return dc_native_file_drop_target_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);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

