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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * 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, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

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

#define WIDGETS_REORDER_CHILD_TRANSITION_DURATION 200
#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 WIDGETS_TYPE_REORDER_CHILD (widgets_reorder_child_get_type ())
#define WIDGETS_REORDER_CHILD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_REORDER_CHILD, WidgetsReorderChild))
#define WIDGETS_REORDER_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_REORDER_CHILD, WidgetsReorderChildClass))
#define WIDGETS_IS_REORDER_CHILD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_REORDER_CHILD))
#define WIDGETS_IS_REORDER_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_REORDER_CHILD))
#define WIDGETS_REORDER_CHILD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_REORDER_CHILD, WidgetsReorderChildClass))

typedef struct _WidgetsReorderChild WidgetsReorderChild;
typedef struct _WidgetsReorderChildClass WidgetsReorderChildClass;
typedef struct _WidgetsReorderChildPrivate WidgetsReorderChildPrivate;
enum  {
	WIDGETS_REORDER_CHILD_0_PROPERTY,
	WIDGETS_REORDER_CHILD_WIDGET_PROPERTY,
	WIDGETS_REORDER_CHILD_ROW_PROPERTY,
	WIDGETS_REORDER_CHILD_REVEAL_CHILD_PROPERTY,
	WIDGETS_REORDER_CHILD_ON_DRAG_PROPERTY,
	WIDGETS_REORDER_CHILD_NUM_PROPERTIES
};
static GParamSpec* widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	WIDGETS_REORDER_CHILD_ON_DROP_END_SIGNAL,
	WIDGETS_REORDER_CHILD_ON_DRAG_EVENT_SIGNAL,
	WIDGETS_REORDER_CHILD_NUM_SIGNALS
};
static guint widgets_reorder_child_signals[WIDGETS_REORDER_CHILD_NUM_SIGNALS] = {0};

struct _WidgetsReorderChild {
	AdwBin parent_instance;
	WidgetsReorderChildPrivate * priv;
};

struct _WidgetsReorderChildClass {
	AdwBinClass parent_class;
};

struct _WidgetsReorderChildPrivate {
	GtkWidget* _widget;
	GtkListBoxRow* _row;
	AdwBin* motion_top_grid;
	GtkRevealer* motion_top_revealer;
	AdwBin* motion_bottom_grid;
	GtkRevealer* motion_bottom_revealer;
	GtkRevealer* main_revealer;
	GtkDragSource* drag_source;
	GtkDropTarget* drop_order_top_target;
	GtkDropTarget* drop_order_bottom_target;
	GtkDropControllerMotion* drop_motion_ctrl;
	gboolean _on_drag;
	GeeHashMap* signal_map;
};

static gint WidgetsReorderChild_private_offset;
static gpointer widgets_reorder_child_parent_class = NULL;

VALA_EXTERN GType widgets_reorder_child_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsReorderChild, g_object_unref)
VALA_EXTERN WidgetsReorderChild* widgets_reorder_child_new (GtkWidget* widget,
                                                GtkListBoxRow* row);
VALA_EXTERN WidgetsReorderChild* widgets_reorder_child_construct (GType object_type,
                                                      GtkWidget* widget,
                                                      GtkListBoxRow* row);
VALA_EXTERN void widgets_reorder_child_build_drag_and_drop (WidgetsReorderChild* self);
VALA_EXTERN GtkListBoxRow* widgets_reorder_child_get_row (WidgetsReorderChild* self);
static GdkContentProvider* __lambda270_ (WidgetsReorderChild* self,
                                  GtkDragSource* source,
                                  gdouble x,
                                  gdouble y);
static GdkContentProvider* ___lambda270__gtk_drag_source_prepare (GtkDragSource* _sender,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self);
static void __lambda271_ (WidgetsReorderChild* self,
                   GtkDragSource* source,
                   GdkDrag* drag);
VALA_EXTERN GtkWidget* widgets_reorder_child_get_widget (WidgetsReorderChild* self);
VALA_EXTERN void widgets_reorder_child_drag_begin (WidgetsReorderChild* self);
static void ___lambda271__gtk_drag_source_drag_begin (GtkDragSource* _sender,
                                               GdkDrag* drag,
                                               gpointer self);
static void __lambda272_ (WidgetsReorderChild* self,
                   GtkDragSource* source,
                   GdkDrag* drag,
                   gboolean delete_data);
VALA_EXTERN void widgets_reorder_child_drag_end (WidgetsReorderChild* self);
static void ___lambda272__gtk_drag_source_drag_end (GtkDragSource* _sender,
                                             GdkDrag* drag,
                                             gboolean delete_data,
                                             gpointer self);
static gboolean __lambda273_ (WidgetsReorderChild* self,
                       GtkDragSource* source,
                       GdkDrag* drag,
                       GdkDragCancelReason reason);
static gboolean ___lambda273__gtk_drag_source_drag_cancel (GtkDragSource* _sender,
                                                    GdkDrag* drag,
                                                    GdkDragCancelReason reason,
                                                    gpointer self);
static gboolean __lambda274_ (WidgetsReorderChild* self,
                       GValue* value,
                       gdouble x,
                       gdouble y);
static gboolean widgets_reorder_child_on_drop (WidgetsReorderChild* self,
                                        GValue* value,
                                        gdouble x,
                                        gdouble y,
                                        gboolean bottom);
static gboolean ___lambda274__gtk_drop_target_drop (GtkDropTarget* _sender,
                                             GValue* value,
                                             gdouble x,
                                             gdouble y,
                                             gpointer self);
static void __lambda275_ (WidgetsReorderChild* self,
                   gdouble x,
                   gdouble y);
static void ___lambda275__gtk_drop_controller_motion_motion (GtkDropControllerMotion* _sender,
                                                      gdouble x,
                                                      gdouble y,
                                                      gpointer self);
static void __lambda276_ (WidgetsReorderChild* self);
static void ___lambda276__gtk_drop_controller_motion_leave (GtkDropControllerMotion* _sender,
                                                     gpointer self);
VALA_EXTERN void widgets_reorder_child_set_on_drag (WidgetsReorderChild* self,
                                        gboolean value);
VALA_EXTERN void widgets_reorder_child_draw_motion_widgets (WidgetsReorderChild* self);
VALA_EXTERN void widgets_reorder_child_clean_up (WidgetsReorderChild* self);
static void widgets_reorder_child_set_widget (WidgetsReorderChild* self,
                                       GtkWidget* value);
static void widgets_reorder_child_set_row (WidgetsReorderChild* self,
                                    GtkListBoxRow* value);
VALA_EXTERN gboolean widgets_reorder_child_get_reveal_child (WidgetsReorderChild* self);
VALA_EXTERN void widgets_reorder_child_set_reveal_child (WidgetsReorderChild* self,
                                             gboolean value);
VALA_EXTERN gboolean widgets_reorder_child_get_on_drag (WidgetsReorderChild* self);
static GObject * widgets_reorder_child_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void _widgets_reorder_child___lambda277_ (WidgetsReorderChild* self);
static void __widgets_reorder_child___lambda277__gtk_widget_destroy (GtkWidget* _sender,
                                                              gpointer self);
static void widgets_reorder_child_finalize (GObject * obj);
static GType widgets_reorder_child_get_type_once (void);
static void _vala_widgets_reorder_child_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_widgets_reorder_child_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
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
widgets_reorder_child_get_instance_private (WidgetsReorderChild* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsReorderChild_private_offset);
}

WidgetsReorderChild*
widgets_reorder_child_construct (GType object_type,
                                 GtkWidget* widget,
                                 GtkListBoxRow* row)
{
	WidgetsReorderChild * self = NULL;
	g_return_val_if_fail (widget != NULL, NULL);
	g_return_val_if_fail (row != NULL, NULL);
	self = (WidgetsReorderChild*) g_object_new (object_type, "widget", widget, "row", row, NULL);
	return self;
}

WidgetsReorderChild*
widgets_reorder_child_new (GtkWidget* widget,
                           GtkListBoxRow* row)
{
	return widgets_reorder_child_construct (WIDGETS_TYPE_REORDER_CHILD, widget, row);
}

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

static GdkContentProvider*
__lambda270_ (WidgetsReorderChild* self,
              GtkDragSource* source,
              gdouble x,
              gdouble y)
{
	GValue _tmp0_ = {0};
	GdkContentProvider* _tmp1_;
	GdkContentProvider* _tmp2_;
	GdkContentProvider* result;
	g_return_val_if_fail (source != NULL, NULL);
	g_value_init (&_tmp0_, WIDGETS_TYPE_REORDER_CHILD);
	g_value_set_object (&_tmp0_, self);
	_tmp1_ = gdk_content_provider_new_for_value (&_tmp0_);
	_tmp2_ = _tmp1_;
	G_IS_VALUE (&_tmp0_) ? (g_value_unset (&_tmp0_), NULL) : NULL;
	result = _tmp2_;
	return result;
}

static GdkContentProvider*
___lambda270__gtk_drag_source_prepare (GtkDragSource* _sender,
                                       gdouble x,
                                       gdouble y,
                                       gpointer self)
{
	GdkContentProvider* result;
	result = __lambda270_ ((WidgetsReorderChild*) self, _sender, x, y);
	return result;
}

static void
__lambda271_ (WidgetsReorderChild* self,
              GtkDragSource* source,
              GdkDrag* drag)
{
	GtkWidgetPaintable* paintable = NULL;
	GtkWidget* _tmp0_;
	GtkWidgetPaintable* _tmp1_;
	g_return_if_fail (source != NULL);
	g_return_if_fail (drag != NULL);
	_tmp0_ = self->priv->_widget;
	_tmp1_ = (GtkWidgetPaintable*) gtk_widget_paintable_new (_tmp0_);
	paintable = _tmp1_;
	gtk_drag_source_set_icon (source, (GdkPaintable*) paintable, 0, 0);
	widgets_reorder_child_drag_begin (self);
	_g_object_unref0 (paintable);
}

static void
___lambda271__gtk_drag_source_drag_begin (GtkDragSource* _sender,
                                          GdkDrag* drag,
                                          gpointer self)
{
	__lambda271_ ((WidgetsReorderChild*) self, _sender, drag);
}

static void
__lambda272_ (WidgetsReorderChild* self,
              GtkDragSource* source,
              GdkDrag* drag,
              gboolean delete_data)
{
	g_return_if_fail (source != NULL);
	g_return_if_fail (drag != NULL);
	widgets_reorder_child_drag_end (self);
}

static void
___lambda272__gtk_drag_source_drag_end (GtkDragSource* _sender,
                                        GdkDrag* drag,
                                        gboolean delete_data,
                                        gpointer self)
{
	__lambda272_ ((WidgetsReorderChild*) self, _sender, drag, delete_data);
}

static gboolean
__lambda273_ (WidgetsReorderChild* self,
              GtkDragSource* source,
              GdkDrag* drag,
              GdkDragCancelReason reason)
{
	gboolean result;
	g_return_val_if_fail (source != NULL, FALSE);
	g_return_val_if_fail (drag != NULL, FALSE);
	widgets_reorder_child_drag_end (self);
	result = FALSE;
	return result;
}

static gboolean
___lambda273__gtk_drag_source_drag_cancel (GtkDragSource* _sender,
                                           GdkDrag* drag,
                                           GdkDragCancelReason reason,
                                           gpointer self)
{
	gboolean result;
	result = __lambda273_ ((WidgetsReorderChild*) self, _sender, drag, reason);
	return result;
}

static gboolean
__lambda274_ (WidgetsReorderChild* self,
              GValue* value,
              gdouble x,
              gdouble y)
{
	gboolean bottom = FALSE;
	GtkListBoxRow* _tmp0_;
	GValue _tmp1_;
	gboolean result;
	g_return_val_if_fail (value != NULL, FALSE);
	_tmp0_ = self->priv->_row;
	bottom = y >= (gtk_widget_get_height ((GtkWidget*) _tmp0_) / 2.0);
	_tmp1_ = *value;
	result = widgets_reorder_child_on_drop (self, &_tmp1_, x, y, bottom);
	return result;
}

static gboolean
___lambda274__gtk_drop_target_drop (GtkDropTarget* _sender,
                                    GValue* value,
                                    gdouble x,
                                    gdouble y,
                                    gpointer self)
{
	gboolean result;
	result = __lambda274_ ((WidgetsReorderChild*) self, value, x, y);
	return result;
}

static void
__lambda275_ (WidgetsReorderChild* self,
              gdouble x,
              gdouble y)
{
	gint row_height = 0;
	GtkListBoxRow* _tmp0_;
	gboolean is_top_half = FALSE;
	GtkRevealer* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkRevealer* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	_tmp0_ = self->priv->_row;
	row_height = gtk_widget_get_height ((GtkWidget*) _tmp0_);
	is_top_half = y < ((gdouble) (row_height / 2));
	_tmp1_ = self->priv->motion_top_revealer;
	_tmp2_ = gtk_revealer_get_reveal_child (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != is_top_half) {
		GtkRevealer* _tmp4_;
		_tmp4_ = self->priv->motion_top_revealer;
		gtk_revealer_set_reveal_child (_tmp4_, is_top_half);
		if (is_top_half) {
			AdwBin* _tmp5_;
			_tmp5_ = self->priv->motion_top_grid;
			gtk_widget_add_css_class ((GtkWidget*) _tmp5_, "drop-area");
		} else {
			AdwBin* _tmp6_;
			_tmp6_ = self->priv->motion_top_grid;
			gtk_widget_remove_css_class ((GtkWidget*) _tmp6_, "drop-area");
		}
	}
	_tmp7_ = self->priv->motion_bottom_revealer;
	_tmp8_ = gtk_revealer_get_reveal_child (_tmp7_);
	_tmp9_ = _tmp8_;
	if (_tmp9_ != (!is_top_half)) {
		GtkRevealer* _tmp10_;
		_tmp10_ = self->priv->motion_bottom_revealer;
		gtk_revealer_set_reveal_child (_tmp10_, !is_top_half);
		if (!is_top_half) {
			AdwBin* _tmp11_;
			_tmp11_ = self->priv->motion_bottom_grid;
			gtk_widget_add_css_class ((GtkWidget*) _tmp11_, "drop-area");
		} else {
			AdwBin* _tmp12_;
			_tmp12_ = self->priv->motion_bottom_grid;
			gtk_widget_remove_css_class ((GtkWidget*) _tmp12_, "drop-area");
		}
	}
}

static void
___lambda275__gtk_drop_controller_motion_motion (GtkDropControllerMotion* _sender,
                                                 gdouble x,
                                                 gdouble y,
                                                 gpointer self)
{
	__lambda275_ ((WidgetsReorderChild*) self, x, y);
}

static void
__lambda276_ (WidgetsReorderChild* self)
{
	GtkRevealer* _tmp0_;
	GtkRevealer* _tmp1_;
	AdwBin* _tmp2_;
	AdwBin* _tmp3_;
	_tmp0_ = self->priv->motion_top_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, FALSE);
	_tmp1_ = self->priv->motion_bottom_revealer;
	gtk_revealer_set_reveal_child (_tmp1_, FALSE);
	_tmp2_ = self->priv->motion_top_grid;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp2_, "drop-area");
	_tmp3_ = self->priv->motion_bottom_grid;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp3_, "drop-area");
}

static void
___lambda276__gtk_drop_controller_motion_leave (GtkDropControllerMotion* _sender,
                                                gpointer self)
{
	__lambda276_ ((WidgetsReorderChild*) self);
}

void
widgets_reorder_child_build_drag_and_drop (WidgetsReorderChild* self)
{
	GtkDragSource* _tmp0_;
	GtkDragSource* _tmp1_;
	GtkListBoxRow* _tmp2_;
	GtkDragSource* _tmp3_;
	GtkEventController* _tmp4_;
	GeeHashMap* _tmp5_;
	GtkDragSource* _tmp6_;
	gulong _tmp7_;
	GtkDragSource* _tmp8_;
	GeeHashMap* _tmp9_;
	GtkDragSource* _tmp10_;
	gulong _tmp11_;
	GtkDragSource* _tmp12_;
	GeeHashMap* _tmp13_;
	GtkDragSource* _tmp14_;
	gulong _tmp15_;
	GtkDragSource* _tmp16_;
	GeeHashMap* _tmp17_;
	GtkDragSource* _tmp18_;
	gulong _tmp19_;
	GtkDragSource* _tmp20_;
	GtkDropTarget* _tmp21_;
	GtkListBoxRow* _tmp22_;
	GtkDropTarget* _tmp23_;
	GtkEventController* _tmp24_;
	GeeHashMap* _tmp25_;
	GtkDropTarget* _tmp26_;
	gulong _tmp27_;
	GtkDropTarget* _tmp28_;
	GtkDropControllerMotion* _tmp29_;
	GtkListBoxRow* _tmp30_;
	GtkDropControllerMotion* _tmp31_;
	GtkEventController* _tmp32_;
	GeeHashMap* _tmp33_;
	GtkDropControllerMotion* _tmp34_;
	gulong _tmp35_;
	GtkDropControllerMotion* _tmp36_;
	GeeHashMap* _tmp37_;
	GtkDropControllerMotion* _tmp38_;
	gulong _tmp39_;
	GtkDropControllerMotion* _tmp40_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_drag_source_new ();
	_g_object_unref0 (self->priv->drag_source);
	self->priv->drag_source = _tmp0_;
	_tmp1_ = self->priv->drag_source;
	gtk_drag_source_set_actions (_tmp1_, GDK_ACTION_MOVE);
	_tmp2_ = self->priv->_row;
	_tmp3_ = self->priv->drag_source;
	_tmp4_ = _g_object_ref0 ((GtkEventController*) _tmp3_);
	gtk_widget_add_controller ((GtkWidget*) _tmp2_, _tmp4_);
	_tmp5_ = self->priv->signal_map;
	_tmp6_ = self->priv->drag_source;
	_tmp7_ = g_signal_connect_object (_tmp6_, "prepare", (GCallback) ___lambda270__gtk_drag_source_prepare, self, 0);
	_tmp8_ = self->priv->drag_source;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, (gpointer) ((guintptr) _tmp7_), (GObject*) _tmp8_);
	_tmp9_ = self->priv->signal_map;
	_tmp10_ = self->priv->drag_source;
	_tmp11_ = g_signal_connect_object (_tmp10_, "drag-begin", (GCallback) ___lambda271__gtk_drag_source_drag_begin, self, 0);
	_tmp12_ = self->priv->drag_source;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, (gpointer) ((guintptr) _tmp11_), (GObject*) _tmp12_);
	_tmp13_ = self->priv->signal_map;
	_tmp14_ = self->priv->drag_source;
	_tmp15_ = g_signal_connect_object (_tmp14_, "drag-end", (GCallback) ___lambda272__gtk_drag_source_drag_end, self, 0);
	_tmp16_ = self->priv->drag_source;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, (gpointer) ((guintptr) _tmp15_), (GObject*) _tmp16_);
	_tmp17_ = self->priv->signal_map;
	_tmp18_ = self->priv->drag_source;
	_tmp19_ = g_signal_connect_object (_tmp18_, "drag-cancel", (GCallback) ___lambda273__gtk_drag_source_drag_cancel, self, 0);
	_tmp20_ = self->priv->drag_source;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp17_, (gpointer) ((guintptr) _tmp19_), (GObject*) _tmp20_);
	_tmp21_ = gtk_drop_target_new (WIDGETS_TYPE_REORDER_CHILD, GDK_ACTION_MOVE);
	_g_object_unref0 (self->priv->drop_order_top_target);
	self->priv->drop_order_top_target = _tmp21_;
	_tmp22_ = self->priv->_row;
	_tmp23_ = self->priv->drop_order_top_target;
	_tmp24_ = _g_object_ref0 ((GtkEventController*) _tmp23_);
	gtk_widget_add_controller ((GtkWidget*) _tmp22_, _tmp24_);
	_tmp25_ = self->priv->signal_map;
	_tmp26_ = self->priv->drop_order_top_target;
	_tmp27_ = g_signal_connect_object (_tmp26_, "drop", (GCallback) ___lambda274__gtk_drop_target_drop, self, 0);
	_tmp28_ = self->priv->drop_order_top_target;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp25_, (gpointer) ((guintptr) _tmp27_), (GObject*) _tmp28_);
	_tmp29_ = (GtkDropControllerMotion*) gtk_drop_controller_motion_new ();
	_g_object_unref0 (self->priv->drop_motion_ctrl);
	self->priv->drop_motion_ctrl = _tmp29_;
	_tmp30_ = self->priv->_row;
	_tmp31_ = self->priv->drop_motion_ctrl;
	_tmp32_ = _g_object_ref0 ((GtkEventController*) _tmp31_);
	gtk_widget_add_controller ((GtkWidget*) _tmp30_, _tmp32_);
	_tmp33_ = self->priv->signal_map;
	_tmp34_ = self->priv->drop_motion_ctrl;
	_tmp35_ = g_signal_connect_object (_tmp34_, "motion", (GCallback) ___lambda275__gtk_drop_controller_motion_motion, self, 0);
	_tmp36_ = self->priv->drop_motion_ctrl;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp33_, (gpointer) ((guintptr) _tmp35_), (GObject*) _tmp36_);
	_tmp37_ = self->priv->signal_map;
	_tmp38_ = self->priv->drop_motion_ctrl;
	_tmp39_ = g_signal_connect_object (_tmp38_, "leave", (GCallback) ___lambda276__gtk_drop_controller_motion_leave, self, 0);
	_tmp40_ = self->priv->drop_motion_ctrl;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp37_, (gpointer) ((guintptr) _tmp39_), (GObject*) _tmp40_);
}

static gboolean
widgets_reorder_child_on_drop (WidgetsReorderChild* self,
                               GValue* value,
                               gdouble x,
                               gdouble y,
                               gboolean bottom)
{
	WidgetsReorderChild* picked_widget = NULL;
	GValue _tmp0_;
	WidgetsReorderChild* _tmp1_;
	WidgetsReorderChild* target_widget = NULL;
	WidgetsReorderChild* _tmp2_;
	WidgetsReorderChild* _tmp3_;
	WidgetsReorderChild* _tmp4_;
	WidgetsReorderChild* _tmp5_;
	GtkRevealer* _tmp6_;
	WidgetsReorderChild* _tmp7_;
	GtkRevealer* _tmp8_;
	gboolean _tmp9_ = FALSE;
	WidgetsReorderChild* _tmp10_;
	WidgetsReorderChild* _tmp11_;
	GtkListBox* source_list = NULL;
	WidgetsReorderChild* _tmp13_;
	GtkListBoxRow* _tmp14_;
	GtkWidget* _tmp15_;
	GtkWidget* _tmp16_;
	GtkListBox* _tmp17_;
	GtkListBox* target_list = NULL;
	WidgetsReorderChild* _tmp18_;
	GtkListBoxRow* _tmp19_;
	GtkWidget* _tmp20_;
	GtkWidget* _tmp21_;
	GtkListBox* _tmp22_;
	GtkListBoxRow* picked_row = NULL;
	WidgetsReorderChild* _tmp23_;
	GtkListBoxRow* _tmp24_;
	GtkListBoxRow* _tmp25_;
	GtkListBox* _tmp26_;
	GtkListBoxRow* _tmp27_;
	gint _tmp28_ = 0;
	GtkListBox* _tmp29_;
	GtkListBoxRow* _tmp30_;
	WidgetsReorderChild* _tmp31_;
	GtkListBoxRow* _tmp32_;
	GtkListBox* _tmp33_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (value != NULL, FALSE);
	_tmp0_ = *value;
	_tmp1_ = _g_object_ref0 (g_value_get_object (&_tmp0_));
	picked_widget = _tmp1_;
	_tmp2_ = _g_object_ref0 (self);
	target_widget = _tmp2_;
	_tmp3_ = picked_widget;
	widgets_reorder_child_drag_end (_tmp3_);
	_tmp4_ = target_widget;
	widgets_reorder_child_drag_end (_tmp4_);
	_tmp5_ = target_widget;
	_tmp6_ = _tmp5_->priv->motion_top_revealer;
	gtk_revealer_set_reveal_child (_tmp6_, FALSE);
	_tmp7_ = target_widget;
	_tmp8_ = _tmp7_->priv->motion_bottom_revealer;
	gtk_revealer_set_reveal_child (_tmp8_, FALSE);
	_tmp10_ = picked_widget;
	_tmp11_ = target_widget;
	if (_tmp10_ == _tmp11_) {
		_tmp9_ = TRUE;
	} else {
		WidgetsReorderChild* _tmp12_;
		_tmp12_ = target_widget;
		_tmp9_ = _tmp12_ == NULL;
	}
	if (_tmp9_) {
		result = FALSE;
		_g_object_unref0 (target_widget);
		_g_object_unref0 (picked_widget);
		return result;
	}
	_tmp13_ = picked_widget;
	_tmp14_ = _tmp13_->priv->_row;
	_tmp15_ = gtk_widget_get_parent ((GtkWidget*) _tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_list_box_get_type (), GtkListBox));
	source_list = _tmp17_;
	_tmp18_ = target_widget;
	_tmp19_ = _tmp18_->priv->_row;
	_tmp20_ = gtk_widget_get_parent ((GtkWidget*) _tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_list_box_get_type (), GtkListBox));
	target_list = _tmp22_;
	_tmp23_ = picked_widget;
	_tmp24_ = _tmp23_->priv->_row;
	_tmp25_ = _g_object_ref0 (_tmp24_);
	picked_row = _tmp25_;
	_tmp26_ = source_list;
	_tmp27_ = picked_row;
	gtk_list_box_remove (_tmp26_, (GtkWidget*) _tmp27_);
	if (bottom) {
		_tmp28_ = 1;
	} else {
		_tmp28_ = 0;
	}
	_tmp29_ = target_list;
	_tmp30_ = picked_row;
	_tmp31_ = target_widget;
	_tmp32_ = _tmp31_->priv->_row;
	gtk_list_box_insert (_tmp29_, (GtkWidget*) _tmp30_, gtk_list_box_row_get_index (_tmp32_) + _tmp28_);
	_tmp33_ = target_list;
	g_signal_emit (self, widgets_reorder_child_signals[WIDGETS_REORDER_CHILD_ON_DROP_END_SIGNAL], 0, _tmp33_);
	result = TRUE;
	_g_object_unref0 (picked_row);
	_g_object_unref0 (target_list);
	_g_object_unref0 (source_list);
	_g_object_unref0 (target_widget);
	_g_object_unref0 (picked_widget);
	return result;
}

void
widgets_reorder_child_drag_begin (WidgetsReorderChild* self)
{
	GtkWidget* _tmp0_;
	GtkRevealer* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_widget;
	gtk_widget_add_css_class (_tmp0_, "drop-begin");
	widgets_reorder_child_set_on_drag (self, TRUE);
	g_signal_emit (self, widgets_reorder_child_signals[WIDGETS_REORDER_CHILD_ON_DRAG_EVENT_SIGNAL], 0, TRUE);
	_tmp1_ = self->priv->main_revealer;
	gtk_revealer_set_reveal_child (_tmp1_, FALSE);
}

void
widgets_reorder_child_drag_end (WidgetsReorderChild* self)
{
	GtkWidget* _tmp0_;
	GtkRevealer* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_widget;
	gtk_widget_remove_css_class (_tmp0_, "drop-begin");
	widgets_reorder_child_set_on_drag (self, FALSE);
	g_signal_emit (self, widgets_reorder_child_signals[WIDGETS_REORDER_CHILD_ON_DRAG_EVENT_SIGNAL], 0, FALSE);
	_tmp1_ = self->priv->main_revealer;
	gtk_revealer_set_reveal_child (_tmp1_, TRUE);
}

void
widgets_reorder_child_draw_motion_widgets (WidgetsReorderChild* self)
{
	gint height = 0;
	GtkListBoxRow* _tmp0_;
	AdwBin* _tmp1_;
	AdwBin* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_row;
	height = gtk_widget_get_height ((GtkWidget*) _tmp0_);
	if (height == 0) {
		height = 32;
	}
	_tmp1_ = self->priv->motion_top_grid;
	g_object_set ((GtkWidget*) _tmp1_, "height-request", height, NULL);
	_tmp2_ = self->priv->motion_bottom_grid;
	g_object_set ((GtkWidget*) _tmp2_, "height-request", height, NULL);
}

void
widgets_reorder_child_clean_up (WidgetsReorderChild* self)
{
	GeeHashMap* _tmp15_;
	gboolean _tmp16_ = FALSE;
	GtkDragSource* _tmp17_;
	gboolean _tmp21_ = FALSE;
	GtkDropTarget* _tmp22_;
	GtkDropTarget* _tmp26_;
	gboolean _tmp27_ = FALSE;
	GtkDropControllerMotion* _tmp28_;
	GtkRevealer* _tmp32_;
	GtkRevealer* _tmp34_;
	GtkRevealer* _tmp36_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->signal_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_value (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			g_signal_handler_disconnect ((GObject*) _tmp11_, (gulong) ((guintptr) _tmp14_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = self->priv->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
	_tmp17_ = self->priv->drag_source;
	if (_tmp17_ != NULL) {
		GtkListBoxRow* _tmp18_;
		_tmp18_ = self->priv->_row;
		_tmp16_ = _tmp18_ != NULL;
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		GtkListBoxRow* _tmp19_;
		GtkDragSource* _tmp20_;
		_tmp19_ = self->priv->_row;
		_tmp20_ = self->priv->drag_source;
		gtk_widget_remove_controller ((GtkWidget*) _tmp19_, (GtkEventController*) _tmp20_);
		_g_object_unref0 (self->priv->drag_source);
		self->priv->drag_source = NULL;
	}
	_tmp22_ = self->priv->drop_order_top_target;
	if (_tmp22_ != NULL) {
		GtkListBoxRow* _tmp23_;
		_tmp23_ = self->priv->_row;
		_tmp21_ = _tmp23_ != NULL;
	} else {
		_tmp21_ = FALSE;
	}
	if (_tmp21_) {
		GtkListBoxRow* _tmp24_;
		GtkDropTarget* _tmp25_;
		_tmp24_ = self->priv->_row;
		_tmp25_ = self->priv->drop_order_top_target;
		gtk_widget_remove_controller ((GtkWidget*) _tmp24_, (GtkEventController*) _tmp25_);
		_g_object_unref0 (self->priv->drop_order_top_target);
		self->priv->drop_order_top_target = NULL;
	}
	_tmp26_ = self->priv->drop_order_bottom_target;
	if (_tmp26_ != NULL) {
		_g_object_unref0 (self->priv->drop_order_bottom_target);
		self->priv->drop_order_bottom_target = NULL;
	}
	_tmp28_ = self->priv->drop_motion_ctrl;
	if (_tmp28_ != NULL) {
		GtkListBoxRow* _tmp29_;
		_tmp29_ = self->priv->_row;
		_tmp27_ = _tmp29_ != NULL;
	} else {
		_tmp27_ = FALSE;
	}
	if (_tmp27_) {
		GtkListBoxRow* _tmp30_;
		GtkDropControllerMotion* _tmp31_;
		_tmp30_ = self->priv->_row;
		_tmp31_ = self->priv->drop_motion_ctrl;
		gtk_widget_remove_controller ((GtkWidget*) _tmp30_, (GtkEventController*) _tmp31_);
		_g_object_unref0 (self->priv->drop_motion_ctrl);
		self->priv->drop_motion_ctrl = NULL;
	}
	_tmp32_ = self->priv->main_revealer;
	if (_tmp32_ != NULL) {
		GtkRevealer* _tmp33_;
		_tmp33_ = self->priv->main_revealer;
		gtk_revealer_set_child (_tmp33_, NULL);
	}
	_tmp34_ = self->priv->motion_top_revealer;
	if (_tmp34_ != NULL) {
		GtkRevealer* _tmp35_;
		_tmp35_ = self->priv->motion_top_revealer;
		gtk_revealer_set_child (_tmp35_, NULL);
	}
	_tmp36_ = self->priv->motion_bottom_revealer;
	if (_tmp36_ != NULL) {
		GtkRevealer* _tmp37_;
		_tmp37_ = self->priv->motion_bottom_revealer;
		gtk_revealer_set_child (_tmp37_, NULL);
	}
	adw_bin_set_child ((AdwBin*) self, NULL);
	_g_object_unref0 (self->priv->motion_top_grid);
	self->priv->motion_top_grid = NULL;
	_g_object_unref0 (self->priv->motion_top_revealer);
	self->priv->motion_top_revealer = NULL;
	_g_object_unref0 (self->priv->motion_bottom_grid);
	self->priv->motion_bottom_grid = NULL;
	_g_object_unref0 (self->priv->motion_bottom_revealer);
	self->priv->motion_bottom_revealer = NULL;
	_g_object_unref0 (self->priv->main_revealer);
	self->priv->main_revealer = NULL;
}

GtkWidget*
widgets_reorder_child_get_widget (WidgetsReorderChild* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_widget;
	result = _tmp0_;
	return result;
}

static void
widgets_reorder_child_set_widget (WidgetsReorderChild* self,
                                  GtkWidget* value)
{
	GtkWidget* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_reorder_child_get_widget (self);
	if (old_value != value) {
		GtkWidget* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_widget);
		self->priv->_widget = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_WIDGET_PROPERTY]);
	}
}

GtkListBoxRow*
widgets_reorder_child_get_row (WidgetsReorderChild* self)
{
	GtkListBoxRow* result;
	GtkListBoxRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_row;
	result = _tmp0_;
	return result;
}

static void
widgets_reorder_child_set_row (WidgetsReorderChild* self,
                               GtkListBoxRow* value)
{
	GtkListBoxRow* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_reorder_child_get_row (self);
	if (old_value != value) {
		self->priv->_row = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_ROW_PROPERTY]);
	}
}

gboolean
widgets_reorder_child_get_reveal_child (WidgetsReorderChild* self)
{
	gboolean result;
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->main_revealer;
	_tmp1_ = gtk_revealer_get_reveal_child (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
widgets_reorder_child_set_reveal_child (WidgetsReorderChild* self,
                                        gboolean value)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_REVEAL_CHILD_PROPERTY]);
}

gboolean
widgets_reorder_child_get_on_drag (WidgetsReorderChild* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_on_drag;
	return result;
}

void
widgets_reorder_child_set_on_drag (WidgetsReorderChild* self,
                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_reorder_child_get_on_drag (self);
	if (old_value != value) {
		self->priv->_on_drag = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_ON_DRAG_PROPERTY]);
	}
}

static void
_widgets_reorder_child___lambda277_ (WidgetsReorderChild* self)
{
	widgets_reorder_child_clean_up (self);
}

static void
__widgets_reorder_child___lambda277__gtk_widget_destroy (GtkWidget* _sender,
                                                         gpointer self)
{
	_widgets_reorder_child___lambda277_ ((WidgetsReorderChild*) self);
}

static GObject *
widgets_reorder_child_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsReorderChild * self;
	gchar* _tmp0_;
	gchar** _tmp1_;
	AdwBin* _tmp2_ = NULL;
	AdwBin* _tmp3_;
	GtkWidget* _tmp4_;
	GtkRevealer* _tmp5_ = NULL;
	gchar* _tmp6_;
	gchar** _tmp7_;
	AdwBin* _tmp8_ = NULL;
	AdwBin* _tmp9_;
	GtkWidget* _tmp10_;
	GtkRevealer* _tmp11_ = NULL;
	GtkBox* main_box = NULL;
	GtkBox* _tmp12_;
	GtkBox* _tmp13_;
	GtkRevealer* _tmp14_;
	GtkBox* _tmp15_;
	GtkWidget* _tmp16_;
	GtkBox* _tmp17_;
	GtkRevealer* _tmp18_;
	GtkBox* _tmp19_;
	GtkWidget* _tmp20_;
	GtkRevealer* _tmp21_ = NULL;
	GtkRevealer* _tmp22_;
	parent_class = G_OBJECT_CLASS (widgets_reorder_child_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_REORDER_CHILD, WidgetsReorderChild);
	_tmp0_ = g_strdup ("drop-target");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = (AdwBin*) adw_bin_new ();
	gtk_widget_set_css_classes ((GtkWidget*) _tmp2_, _tmp1_);
	_tmp1_ = (_vala_array_free (_tmp1_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->motion_top_grid);
	self->priv->motion_top_grid = _tmp2_;
	_tmp3_ = self->priv->motion_top_grid;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) _tmp3_);
	_tmp5_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp5_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_transition_duration (_tmp5_, (guint) WIDGETS_REORDER_CHILD_TRANSITION_DURATION);
	gtk_revealer_set_child (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->motion_top_revealer);
	self->priv->motion_top_revealer = _tmp5_;
	_tmp6_ = g_strdup ("drop-target");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = (AdwBin*) adw_bin_new ();
	gtk_widget_set_css_classes ((GtkWidget*) _tmp8_, _tmp7_);
	_tmp7_ = (_vala_array_free (_tmp7_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->motion_bottom_grid);
	self->priv->motion_bottom_grid = _tmp8_;
	_tmp9_ = self->priv->motion_bottom_grid;
	_tmp10_ = _g_object_ref0 ((GtkWidget*) _tmp9_);
	_tmp11_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp11_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_transition_duration (_tmp11_, (guint) WIDGETS_REORDER_CHILD_TRANSITION_DURATION);
	gtk_revealer_set_child (_tmp11_, _tmp10_);
	_g_object_unref0 (_tmp10_);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->motion_bottom_revealer);
	self->priv->motion_bottom_revealer = _tmp11_;
	_tmp12_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp12_);
	main_box = _tmp12_;
	_tmp13_ = main_box;
	_tmp14_ = self->priv->motion_top_revealer;
	gtk_box_append (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = main_box;
	_tmp16_ = self->priv->_widget;
	gtk_box_append (_tmp15_, _tmp16_);
	_tmp17_ = main_box;
	_tmp18_ = self->priv->motion_bottom_revealer;
	gtk_box_append (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = main_box;
	_tmp20_ = _g_object_ref0 ((GtkWidget*) _tmp19_);
	_tmp21_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp21_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp21_, _tmp20_);
	_g_object_unref0 (_tmp20_);
	gtk_revealer_set_reveal_child (_tmp21_, TRUE);
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->main_revealer);
	self->priv->main_revealer = _tmp21_;
	_tmp22_ = self->priv->main_revealer;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp22_);
	g_signal_connect_object ((GtkWidget*) self, "destroy", (GCallback) __widgets_reorder_child___lambda277__gtk_widget_destroy, self, 0);
	_g_object_unref0 (main_box);
	return obj;
}

static void
widgets_reorder_child_class_init (WidgetsReorderChildClass * klass,
                                  gpointer klass_data)
{
	widgets_reorder_child_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsReorderChild_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_reorder_child_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_reorder_child_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_reorder_child_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_reorder_child_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_REORDER_CHILD_WIDGET_PROPERTY, widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_WIDGET_PROPERTY] = g_param_spec_object ("widget", "widget", "widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_REORDER_CHILD_ROW_PROPERTY, widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_ROW_PROPERTY] = g_param_spec_object ("row", "row", "row", gtk_list_box_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_REORDER_CHILD_REVEAL_CHILD_PROPERTY, widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_REVEAL_CHILD_PROPERTY] = g_param_spec_boolean ("reveal-child", "reveal-child", "reveal-child", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_REORDER_CHILD_ON_DRAG_PROPERTY, widgets_reorder_child_properties[WIDGETS_REORDER_CHILD_ON_DRAG_PROPERTY] = g_param_spec_boolean ("on-drag", "on-drag", "on-drag", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	widgets_reorder_child_signals[WIDGETS_REORDER_CHILD_ON_DROP_END_SIGNAL] = g_signal_new ("on-drop-end", WIDGETS_TYPE_REORDER_CHILD, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, gtk_list_box_get_type ());
	widgets_reorder_child_signals[WIDGETS_REORDER_CHILD_ON_DRAG_EVENT_SIGNAL] = g_signal_new ("on-drag-event", WIDGETS_TYPE_REORDER_CHILD, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}

static void
widgets_reorder_child_instance_init (WidgetsReorderChild * self,
                                     gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = widgets_reorder_child_get_instance_private (self);
	self->priv->_on_drag = FALSE;
	_tmp0_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signal_map = _tmp0_;
}

static void
widgets_reorder_child_finalize (GObject * obj)
{
	WidgetsReorderChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_REORDER_CHILD, WidgetsReorderChild);
	g_debug ("ReorderChild.vala:62: Destroying - Widgets.ReorderChild\n");
	_g_object_unref0 (self->priv->_widget);
	_g_object_unref0 (self->priv->motion_top_grid);
	_g_object_unref0 (self->priv->motion_top_revealer);
	_g_object_unref0 (self->priv->motion_bottom_grid);
	_g_object_unref0 (self->priv->motion_bottom_revealer);
	_g_object_unref0 (self->priv->main_revealer);
	_g_object_unref0 (self->priv->drag_source);
	_g_object_unref0 (self->priv->drop_order_top_target);
	_g_object_unref0 (self->priv->drop_order_bottom_target);
	_g_object_unref0 (self->priv->drop_motion_ctrl);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (widgets_reorder_child_parent_class)->finalize (obj);
}

static GType
widgets_reorder_child_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsReorderChildClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_reorder_child_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsReorderChild), 0, (GInstanceInitFunc) widgets_reorder_child_instance_init, NULL };
	GType widgets_reorder_child_type_id;
	widgets_reorder_child_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsReorderChild", &g_define_type_info, 0);
	WidgetsReorderChild_private_offset = g_type_add_instance_private (widgets_reorder_child_type_id, sizeof (WidgetsReorderChildPrivate));
	return widgets_reorder_child_type_id;
}

GType
widgets_reorder_child_get_type (void)
{
	static volatile gsize widgets_reorder_child_type_id__once = 0;
	if (g_once_init_enter (&widgets_reorder_child_type_id__once)) {
		GType widgets_reorder_child_type_id;
		widgets_reorder_child_type_id = widgets_reorder_child_get_type_once ();
		g_once_init_leave (&widgets_reorder_child_type_id__once, widgets_reorder_child_type_id);
	}
	return widgets_reorder_child_type_id__once;
}

static void
_vala_widgets_reorder_child_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	WidgetsReorderChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_REORDER_CHILD, WidgetsReorderChild);
	switch (property_id) {
		case WIDGETS_REORDER_CHILD_WIDGET_PROPERTY:
		g_value_set_object (value, widgets_reorder_child_get_widget (self));
		break;
		case WIDGETS_REORDER_CHILD_ROW_PROPERTY:
		g_value_set_object (value, widgets_reorder_child_get_row (self));
		break;
		case WIDGETS_REORDER_CHILD_REVEAL_CHILD_PROPERTY:
		g_value_set_boolean (value, widgets_reorder_child_get_reveal_child (self));
		break;
		case WIDGETS_REORDER_CHILD_ON_DRAG_PROPERTY:
		g_value_set_boolean (value, widgets_reorder_child_get_on_drag (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_reorder_child_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	WidgetsReorderChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_REORDER_CHILD, WidgetsReorderChild);
	switch (property_id) {
		case WIDGETS_REORDER_CHILD_WIDGET_PROPERTY:
		widgets_reorder_child_set_widget (self, g_value_get_object (value));
		break;
		case WIDGETS_REORDER_CHILD_ROW_PROPERTY:
		widgets_reorder_child_set_row (self, g_value_get_object (value));
		break;
		case WIDGETS_REORDER_CHILD_REVEAL_CHILD_PROPERTY:
		widgets_reorder_child_set_reveal_child (self, g_value_get_boolean (value));
		break;
		case WIDGETS_REORDER_CHILD_ON_DRAG_PROPERTY:
		widgets_reorder_child_set_on_drag (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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);
}

