/* gitg-list-dnd.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-list-dnd.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2026 - Alberto Fanjul
 *
 * gitg 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 2 of the License, or
 * (at your option) any later version.
 *
 * gitg 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 gitg. If not, see <http://www.gnu.org/licenses/>.
 */

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

#define GITG_DRAG_LIST_BOX_SCROLL_STEP_SIZE 8
#define GITG_DRAG_LIST_BOX_SCROLL_DISTANCE 30
#define GITG_DRAG_LIST_BOX_SCROLL_DELAY 50
#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 GITG_TYPE_LIST_ROW (gitg_list_row_get_type ())
#define GITG_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_LIST_ROW, GitgListRow))
#define GITG_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_LIST_ROW, GitgListRowClass))
#define GITG_IS_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_LIST_ROW))
#define GITG_IS_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_LIST_ROW))
#define GITG_LIST_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_LIST_ROW, GitgListRowClass))

typedef struct _GitgListRow GitgListRow;
typedef struct _GitgListRowClass GitgListRowClass;
typedef struct _GitgListRowPrivate GitgListRowPrivate;
enum  {
	GITG_LIST_ROW_0_PROPERTY,
	GITG_LIST_ROW_NAME_PROPERTY,
	GITG_LIST_ROW_COL_PROPERTY,
	GITG_LIST_ROW_NUM_PROPERTIES
};
static GParamSpec* gitg_list_row_properties[GITG_LIST_ROW_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 GITG_TYPE_DRAG_LIST_BOX (gitg_drag_list_box_get_type ())
#define GITG_DRAG_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_DRAG_LIST_BOX, GitgDragListBox))
#define GITG_DRAG_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_DRAG_LIST_BOX, GitgDragListBoxClass))
#define GITG_IS_DRAG_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_DRAG_LIST_BOX))
#define GITG_IS_DRAG_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_DRAG_LIST_BOX))
#define GITG_DRAG_LIST_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_DRAG_LIST_BOX, GitgDragListBoxClass))

typedef struct _GitgDragListBox GitgDragListBox;
typedef struct _GitgDragListBoxClass GitgDragListBoxClass;
typedef struct _GitgDragListBoxPrivate GitgDragListBoxPrivate;
enum  {
	GITG_DRAG_LIST_BOX_0_PROPERTY,
	GITG_DRAG_LIST_BOX_VADJUSTMENT_PROPERTY,
	GITG_DRAG_LIST_BOX_NUM_PROPERTIES
};
static GParamSpec* gitg_drag_list_box_properties[GITG_DRAG_LIST_BOX_NUM_PROPERTIES];

#define GITG_TYPE_LIST_BOX_ROW_DN_D (gitg_list_box_row_dn_d_get_type ())
#define GITG_LIST_BOX_ROW_DN_D(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnD))
#define GITG_LIST_BOX_ROW_DN_D_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnDClass))
#define GITG_IS_LIST_BOX_ROW_DN_D(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_LIST_BOX_ROW_DN_D))
#define GITG_IS_LIST_BOX_ROW_DN_D_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_LIST_BOX_ROW_DN_D))
#define GITG_LIST_BOX_ROW_DN_D_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnDClass))

typedef struct _GitgListBoxRowDnD GitgListBoxRowDnD;
typedef struct _GitgListBoxRowDnDClass GitgListBoxRowDnDClass;
typedef struct _Block80Data Block80Data;
enum  {
	GITG_DRAG_LIST_BOX_ROW_REORDER_SIGNAL,
	GITG_DRAG_LIST_BOX_NUM_SIGNALS
};
static guint gitg_drag_list_box_signals[GITG_DRAG_LIST_BOX_NUM_SIGNALS] = {0};
typedef struct _GitgListBoxRowDnDPrivate GitgListBoxRowDnDPrivate;
enum  {
	GITG_LIST_BOX_ROW_DN_D_0_PROPERTY,
	GITG_LIST_BOX_ROW_DN_D_TITLE_PROPERTY,
	GITG_LIST_BOX_ROW_DN_D_NUM_PROPERTIES
};
static GParamSpec* gitg_list_box_row_dn_d_properties[GITG_LIST_BOX_ROW_DN_D_NUM_PROPERTIES];
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
enum  {
	GITG_LIST_BOX_ROW_DN_D_SWITCH_CHANGED_SIGNAL,
	GITG_LIST_BOX_ROW_DN_D_NUM_SIGNALS
};
static guint gitg_list_box_row_dn_d_signals[GITG_LIST_BOX_ROW_DN_D_NUM_SIGNALS] = {0};

struct _GitgListRow {
	GObject parent_instance;
	GitgListRowPrivate * priv;
};

struct _GitgListRowClass {
	GObjectClass parent_class;
};

struct _GitgListRowPrivate {
	gchar* _name;
	GtkTreeViewColumn* _col;
};

struct _GitgDragListBox {
	GtkListBox parent_instance;
	GitgDragListBoxPrivate * priv;
	GtkListBoxRow* drag_row;
};

struct _GitgDragListBoxClass {
	GtkListBoxClass parent_class;
};

struct _GitgDragListBoxPrivate {
	GListStore* model;
	GtkListBoxRow* hover_row;
	gboolean top;
	gint hover_top;
	gint hover_bottom;
	gboolean should_scroll;
	gboolean scrolling;
	gboolean scroll_up;
	GtkAdjustment* _vadjustment;
};

struct _Block80Data {
	int _ref_count_;
	GitgDragListBox* self;
	GtkTreeViewColumn* col;
	GitgListBoxRowDnD* w;
};

struct _GitgListBoxRowDnD {
	GtkListBoxRow parent_instance;
	GitgListBoxRowDnDPrivate * priv;
	GtkButton* btn_up;
	GtkButton* btn_down;
	GtkButton* menu_btn_up;
	GtkButton* menu_btn_down;
};

struct _GitgListBoxRowDnDClass {
	GtkListBoxRowClass parent_class;
};

struct _GitgListBoxRowDnDPrivate {
	gchar* _title;
	GtkSwitch* switch_visible;
	gboolean allow_signal;
};

static gint GitgListRow_private_offset;
static gpointer gitg_list_row_parent_class = NULL;
static gint GitgDragListBox_private_offset;
static gpointer gitg_drag_list_box_parent_class = NULL;
static gint GitgListBoxRowDnD_private_offset;
static gpointer gitg_list_box_row_dn_d_parent_class = NULL;

VALA_EXTERN GType gitg_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgListRow, g_object_unref)
VALA_EXTERN GitgListRow* gitg_list_row_new (const gchar* name,
                                GtkTreeViewColumn* col);
VALA_EXTERN GitgListRow* gitg_list_row_construct (GType object_type,
                                      const gchar* name,
                                      GtkTreeViewColumn* col);
VALA_EXTERN const gchar* gitg_list_row_get_name (GitgListRow* self);
VALA_EXTERN void gitg_list_row_set_name (GitgListRow* self,
                             const gchar* value);
VALA_EXTERN GtkTreeViewColumn* gitg_list_row_get_col (GitgListRow* self);
VALA_EXTERN void gitg_list_row_set_col (GitgListRow* self,
                            GtkTreeViewColumn* value);
static void gitg_list_row_finalize (GObject * obj);
static GType gitg_list_row_get_type_once (void);
static void _vala_gitg_list_row_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec);
static void _vala_gitg_list_row_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec);
VALA_EXTERN GType gitg_drag_list_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgDragListBox, g_object_unref)
VALA_EXTERN GitgDragListBox* gitg_drag_list_box_new (GListStore* model);
VALA_EXTERN GitgDragListBox* gitg_drag_list_box_construct (GType object_type,
                                               GListStore* model);
static GtkWidget* __lambda153_ (GitgDragListBox* self,
                         GObject* i);
VALA_EXTERN GType gitg_list_box_row_dn_d_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgListBoxRowDnD, g_object_unref)
static Block80Data* block80_data_ref (Block80Data* _data80_);
static void block80_data_unref (void * _userdata_);
VALA_EXTERN GitgListBoxRowDnD* gitg_list_box_row_dn_d_new (const gchar* title,
                                               gboolean switch_state);
VALA_EXTERN GitgListBoxRowDnD* gitg_list_box_row_dn_d_construct (GType object_type,
                                                     const gchar* title,
                                                     gboolean switch_state);
static void __lambda159_ (Block80Data* _data80_,
                   gboolean state);
static void ___lambda159__gitg_list_box_row_dn_d_switch_changed (GitgListBoxRowDnD* _sender,
                                                          gboolean state,
                                                          gpointer self);
static void __lambda160_ (Block80Data* _data80_);
VALA_EXTERN void gitg_list_box_row_dn_d_set_switch_active (GitgListBoxRowDnD* self,
                                               gboolean flag);
static void ___lambda160__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static GtkWidget* ___lambda153__gtk_list_box_create_widget_func (GObject* item,
                                                          gpointer self);
static gboolean gitg_drag_list_box_real_drag_motion (GtkWidget* base,
                                              GdkDragContext* context,
                                              gint x,
                                              gint y,
                                              guint time);
static void gitg_drag_list_box_check_scroll (GitgDragListBox* self,
                                      gint y);
static gboolean gitg_drag_list_box_scroll (GitgDragListBox* self);
static gboolean _gitg_drag_list_box_scroll_gsource_func (gpointer self);
static void gitg_drag_list_box_real_drag_leave (GtkWidget* base,
                                         GdkDragContext* context,
                                         guint time);
VALA_EXTERN GtkAdjustment* gitg_drag_list_box_get_vadjustment (GitgDragListBox* self);
static void gitg_drag_list_box_real_drag_data_received (GtkWidget* base,
                                                 GdkDragContext* context,
                                                 gint x,
                                                 gint y,
                                                 GtkSelectionData* selection_data,
                                                 guint info,
                                                 guint time);
VALA_EXTERN void gitg_drag_list_box_set_vadjustment (GitgDragListBox* self,
                                         GtkAdjustment* value);
static void g_cclosure_user_marshal_VOID__INT_INT (GClosure * closure,
                                            GValue * return_value,
                                            guint n_param_values,
                                            const GValue * param_values,
                                            gpointer invocation_hint,
                                            gpointer marshal_data);
static void gitg_drag_list_box_finalize (GObject * obj);
static GType gitg_drag_list_box_get_type_once (void);
static void _vala_gitg_drag_list_box_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_gitg_drag_list_box_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
VALA_EXTERN void gitg_list_box_row_dn_d_enable_up (GitgListBoxRowDnD* self,
                                       gboolean flag);
VALA_EXTERN void gitg_list_box_row_dn_d_enable_down (GitgListBoxRowDnD* self,
                                         gboolean flag);
VALA_EXTERN void gitg_list_box_row_dn_d_set_title (GitgListBoxRowDnD* self,
                                       const gchar* value);
static void __lambda154_ (GitgListBoxRowDnD* self);
static void gitg_list_box_row_dn_d_up (GitgListBoxRowDnD* self);
static void ___lambda154__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda155_ (GitgListBoxRowDnD* self);
static void gitg_list_box_row_dn_d_down (GitgListBoxRowDnD* self);
static void ___lambda155__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda156_ (GitgListBoxRowDnD* self);
static void ___lambda156__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda157_ (GitgListBoxRowDnD* self);
static void ___lambda157__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static gboolean __lambda158_ (GitgListBoxRowDnD* self,
                       gboolean state);
static gboolean ___lambda158__gtk_switch_state_set (GtkSwitch* _sender,
                                             gboolean state,
                                             gpointer self);
static void gitg_list_box_row_dn_d_row_drag_begin (GitgListBoxRowDnD* self,
                                            GtkWidget* widget,
                                            GdkDragContext* context);
static void _gitg_list_box_row_dn_d_row_drag_begin_gtk_widget_drag_begin (GtkWidget* _sender,
                                                                   GdkDragContext* context,
                                                                   gpointer self);
static void gitg_list_box_row_dn_d_row_drag_data_get (GitgListBoxRowDnD* self,
                                               GtkWidget* widget,
                                               GdkDragContext* context,
                                               GtkSelectionData* selection_data,
                                               guint info,
                                               guint time);
static void _gitg_list_box_row_dn_d_row_drag_data_get_gtk_widget_drag_data_get (GtkWidget* _sender,
                                                                         GdkDragContext* context,
                                                                         GtkSelectionData* selection_data,
                                                                         guint info,
                                                                         guint time_,
                                                                         gpointer self);
static void gitg_list_box_row_dn_d_move (GitgListBoxRowDnD* self,
                                  gint offset);
VALA_EXTERN const gchar* gitg_list_box_row_dn_d_get_title (GitgListBoxRowDnD* self);
static void gitg_list_box_row_dn_d_finalize (GObject * obj);
static GType gitg_list_box_row_dn_d_get_type_once (void);
static void _vala_gitg_list_box_row_dn_d_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_gitg_list_box_row_dn_d_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec);

const GtkTargetEntry GITG_entries[1] = {{"GTK_LIST_BOX_ROW", (guint) GTK_TARGET_SAME_APP, (guint) 0}};

static inline gpointer
gitg_list_row_get_instance_private (GitgListRow* self)
{
	return G_STRUCT_MEMBER_P (self, GitgListRow_private_offset);
}

GitgListRow*
gitg_list_row_construct (GType object_type,
                         const gchar* name,
                         GtkTreeViewColumn* col)
{
	GitgListRow * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (col != NULL, NULL);
	self = (GitgListRow*) g_object_new (object_type, "name", name, "col", col, NULL);
	return self;
}

GitgListRow*
gitg_list_row_new (const gchar* name,
                   GtkTreeViewColumn* col)
{
	return gitg_list_row_construct (GITG_TYPE_LIST_ROW, name, col);
}

const gchar*
gitg_list_row_get_name (GitgListRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
gitg_list_row_set_name (GitgListRow* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_list_row_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_list_row_properties[GITG_LIST_ROW_NAME_PROPERTY]);
	}
}

GtkTreeViewColumn*
gitg_list_row_get_col (GitgListRow* self)
{
	GtkTreeViewColumn* result;
	GtkTreeViewColumn* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_col;
	result = _tmp0_;
	return result;
}

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

void
gitg_list_row_set_col (GitgListRow* self,
                       GtkTreeViewColumn* value)
{
	GtkTreeViewColumn* old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_list_row_get_col (self);
	if (old_value != value) {
		GtkTreeViewColumn* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_col);
		self->priv->_col = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_list_row_properties[GITG_LIST_ROW_COL_PROPERTY]);
	}
}

static void
gitg_list_row_class_init (GitgListRowClass * klass,
                          gpointer klass_data)
{
	gitg_list_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgListRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_list_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_list_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = gitg_list_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_LIST_ROW_NAME_PROPERTY, gitg_list_row_properties[GITG_LIST_ROW_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_LIST_ROW_COL_PROPERTY, gitg_list_row_properties[GITG_LIST_ROW_COL_PROPERTY] = g_param_spec_object ("col", "col", "col", gtk_tree_view_column_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gitg_list_row_instance_init (GitgListRow * self,
                             gpointer klass)
{
	self->priv = gitg_list_row_get_instance_private (self);
}

static void
gitg_list_row_finalize (GObject * obj)
{
	GitgListRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_LIST_ROW, GitgListRow);
	_g_free0 (self->priv->_name);
	_g_object_unref0 (self->priv->_col);
	G_OBJECT_CLASS (gitg_list_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_list_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgListRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_list_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgListRow), 0, (GInstanceInitFunc) gitg_list_row_instance_init, NULL };
	GType gitg_list_row_type_id;
	gitg_list_row_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgListRow", &g_define_type_info, 0);
	GitgListRow_private_offset = g_type_add_instance_private (gitg_list_row_type_id, sizeof (GitgListRowPrivate));
	return gitg_list_row_type_id;
}

GType
gitg_list_row_get_type (void)
{
	static gsize gitg_list_row_type_id__once = 0;
	if (g_once_init_enter (&gitg_list_row_type_id__once)) {
		GType gitg_list_row_type_id;
		gitg_list_row_type_id = gitg_list_row_get_type_once ();
		g_once_init_leave (&gitg_list_row_type_id__once, gitg_list_row_type_id);
	}
	return gitg_list_row_type_id__once;
}

static void
_vala_gitg_list_row_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec)
{
	GitgListRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_LIST_ROW, GitgListRow);
	switch (property_id) {
		case GITG_LIST_ROW_NAME_PROPERTY:
		g_value_set_string (value, gitg_list_row_get_name (self));
		break;
		case GITG_LIST_ROW_COL_PROPERTY:
		g_value_set_object (value, gitg_list_row_get_col (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_list_row_set_property (GObject * object,
                                  guint property_id,
                                  const GValue * value,
                                  GParamSpec * pspec)
{
	GitgListRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_LIST_ROW, GitgListRow);
	switch (property_id) {
		case GITG_LIST_ROW_NAME_PROPERTY:
		gitg_list_row_set_name (self, g_value_get_string (value));
		break;
		case GITG_LIST_ROW_COL_PROPERTY:
		gitg_list_row_set_col (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
gitg_drag_list_box_get_instance_private (GitgDragListBox* self)
{
	return G_STRUCT_MEMBER_P (self, GitgDragListBox_private_offset);
}

static Block80Data*
block80_data_ref (Block80Data* _data80_)
{
	g_atomic_int_inc (&_data80_->_ref_count_);
	return _data80_;
}

static void
block80_data_unref (void * _userdata_)
{
	Block80Data* _data80_;
	_data80_ = (Block80Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data80_->_ref_count_)) {
		GitgDragListBox* self;
		self = _data80_->self;
		_g_object_unref0 (_data80_->w);
		_g_object_unref0 (_data80_->col);
		_g_object_unref0 (self);
		g_slice_free (Block80Data, _data80_);
	}
}

static void
__lambda159_ (Block80Data* _data80_,
              gboolean state)
{
	GitgDragListBox* self;
	self = _data80_->self;
	gtk_tree_view_column_set_visible (_data80_->col, state);
}

static void
___lambda159__gitg_list_box_row_dn_d_switch_changed (GitgListBoxRowDnD* _sender,
                                                     gboolean state,
                                                     gpointer self)
{
	__lambda159_ (self, state);
}

static void
__lambda160_ (Block80Data* _data80_)
{
	GitgDragListBox* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = _data80_->self;
	_tmp0_ = gtk_tree_view_column_get_visible (_data80_->col);
	_tmp1_ = _tmp0_;
	gitg_list_box_row_dn_d_set_switch_active (_data80_->w, _tmp1_);
}

static void
___lambda160__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda160_ (self);
}

static GtkWidget*
__lambda153_ (GitgDragListBox* self,
              GObject* i)
{
	Block80Data* _data80_;
	GitgListRow* row = NULL;
	GitgListRow* _tmp0_;
	GtkTreeViewColumn* _tmp1_;
	GtkTreeViewColumn* _tmp2_;
	GtkTreeViewColumn* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	GitgListBoxRowDnD* _tmp8_;
	GtkWidget* _tmp9_;
	GtkWidget* result;
	g_return_val_if_fail (i != NULL, NULL);
	_data80_ = g_slice_new0 (Block80Data);
	_data80_->_ref_count_ = 1;
	_data80_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (GITG_IS_LIST_ROW (i) ? ((GitgListRow*) i) : NULL);
	row = _tmp0_;
	_tmp1_ = gitg_list_row_get_col (row);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data80_->col = _tmp3_;
	_tmp4_ = gitg_list_row_get_name (row);
	_tmp5_ = _tmp4_;
	_tmp6_ = gtk_tree_view_column_get_visible (_data80_->col);
	_tmp7_ = _tmp6_;
	_tmp8_ = gitg_list_box_row_dn_d_new (_tmp5_, _tmp7_);
	g_object_ref_sink (_tmp8_);
	_data80_->w = _tmp8_;
	g_signal_connect_data (_data80_->w, "switch-changed", (GCallback) ___lambda159__gitg_list_box_row_dn_d_switch_changed, block80_data_ref (_data80_), (GClosureNotify) block80_data_unref, 0);
	g_signal_connect_data ((GObject*) _data80_->col, "notify::visible", (GCallback) ___lambda160__g_object_notify, block80_data_ref (_data80_), (GClosureNotify) block80_data_unref, 0);
	_tmp9_ = _g_object_ref0 ((GtkWidget*) _data80_->w);
	result = _tmp9_;
	_g_object_unref0 (row);
	block80_data_unref (_data80_);
	_data80_ = NULL;
	return result;
}

static GtkWidget*
___lambda153__gtk_list_box_create_widget_func (GObject* item,
                                               gpointer self)
{
	GtkWidget* result;
	result = __lambda153_ ((GitgDragListBox*) self, item);
	return result;
}

GitgDragListBox*
gitg_drag_list_box_construct (GType object_type,
                              GListStore* model)
{
	GitgDragListBox * self = NULL;
	GListStore* _tmp0_;
	g_return_val_if_fail (model != NULL, NULL);
	self = (GitgDragListBox*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (model);
	_g_object_unref0 (self->priv->model);
	self->priv->model = _tmp0_;
	gtk_list_box_bind_model ((GtkListBox*) self, (GListModel*) model, ___lambda153__gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	gtk_drag_dest_set ((GtkWidget*) self, GTK_DEST_DEFAULT_ALL, GITG_entries, (gint) G_N_ELEMENTS (GITG_entries), GDK_ACTION_MOVE);
	return self;
}

GitgDragListBox*
gitg_drag_list_box_new (GListStore* model)
{
	return gitg_drag_list_box_construct (GITG_TYPE_DRAG_LIST_BOX, model);
}

static gboolean
_gitg_drag_list_box_scroll_gsource_func (gpointer self)
{
	gboolean result;
	result = gitg_drag_list_box_scroll ((GitgDragListBox*) self);
	return result;
}

static gboolean
gitg_drag_list_box_real_drag_motion (GtkWidget* base,
                                     GdkDragContext* context,
                                     gint x,
                                     gint y,
                                     guint time)
{
	GitgDragListBox * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp27_ = FALSE;
	gboolean result;
	self = (GitgDragListBox*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	if (y > self->priv->hover_top) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = y < self->priv->hover_bottom;
	}
	if (_tmp0_) {
		GtkAllocation alloc = {0};
		GtkListBoxRow* row = NULL;
		GtkListBoxRow* _tmp1_;
		GtkListBoxRow* _tmp2_;
		gboolean old_top = FALSE;
		GtkListBoxRow* _tmp3_;
		GtkAllocation _tmp4_ = {0};
		gint hover_row_y = 0;
		GtkAllocation _tmp5_;
		gint hover_row_height = 0;
		GtkAllocation _tmp6_;
		GtkListBoxRow* _tmp7_;
		GtkListBoxRow* _tmp8_;
		gboolean _tmp17_ = FALSE;
		GtkListBoxRow* _tmp18_;
		GtkListBoxRow* _tmp25_;
		GtkListBoxRow* _tmp26_;
		_tmp1_ = gtk_list_box_get_row_at_y ((GtkListBox*) self, y);
		_tmp2_ = _g_object_ref0 (_tmp1_);
		row = _tmp2_;
		old_top = self->priv->top;
		_tmp3_ = row;
		gtk_widget_get_allocation ((GtkWidget*) _tmp3_, &_tmp4_);
		alloc = _tmp4_;
		_tmp5_ = alloc;
		hover_row_y = _tmp5_.y;
		_tmp6_ = alloc;
		hover_row_height = _tmp6_.height;
		_tmp7_ = row;
		_tmp8_ = self->drag_row;
		if (_tmp7_ != _tmp8_) {
			if (y < (hover_row_y + (hover_row_height / 2))) {
				GtkListBoxRow* _tmp9_;
				GtkStyleContext* _tmp10_;
				GtkListBoxRow* _tmp11_;
				GtkStyleContext* _tmp12_;
				self->priv->hover_top = hover_row_y;
				self->priv->hover_bottom = self->priv->hover_top + (hover_row_height / 2);
				_tmp9_ = row;
				_tmp10_ = gtk_widget_get_style_context ((GtkWidget*) _tmp9_);
				gtk_style_context_add_class (_tmp10_, "drag-hover-top");
				_tmp11_ = row;
				_tmp12_ = gtk_widget_get_style_context ((GtkWidget*) _tmp11_);
				gtk_style_context_remove_class (_tmp12_, "drag-hover-bottom");
				self->priv->top = TRUE;
			} else {
				GtkListBoxRow* _tmp13_;
				GtkStyleContext* _tmp14_;
				GtkListBoxRow* _tmp15_;
				GtkStyleContext* _tmp16_;
				self->priv->hover_top = hover_row_y + (hover_row_height / 2);
				self->priv->hover_bottom = hover_row_y + hover_row_height;
				_tmp13_ = row;
				_tmp14_ = gtk_widget_get_style_context ((GtkWidget*) _tmp13_);
				gtk_style_context_add_class (_tmp14_, "drag-hover-bottom");
				_tmp15_ = row;
				_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) _tmp15_);
				gtk_style_context_remove_class (_tmp16_, "drag-hover-top");
				self->priv->top = FALSE;
			}
		}
		_tmp18_ = self->priv->hover_row;
		if (_tmp18_ != NULL) {
			GtkListBoxRow* _tmp19_;
			GtkListBoxRow* _tmp20_;
			_tmp19_ = self->priv->hover_row;
			_tmp20_ = row;
			_tmp17_ = _tmp19_ != _tmp20_;
		} else {
			_tmp17_ = FALSE;
		}
		if (_tmp17_) {
			if (old_top) {
				GtkListBoxRow* _tmp21_;
				GtkStyleContext* _tmp22_;
				_tmp21_ = self->priv->hover_row;
				_tmp22_ = gtk_widget_get_style_context ((GtkWidget*) _tmp21_);
				gtk_style_context_remove_class (_tmp22_, "drag-hover-top");
			} else {
				GtkListBoxRow* _tmp23_;
				GtkStyleContext* _tmp24_;
				_tmp23_ = self->priv->hover_row;
				_tmp24_ = gtk_widget_get_style_context ((GtkWidget*) _tmp23_);
				gtk_style_context_remove_class (_tmp24_, "drag-hover-bottom");
			}
		}
		_tmp25_ = row;
		_tmp26_ = _g_object_ref0 (_tmp25_);
		_g_object_unref0 (self->priv->hover_row);
		self->priv->hover_row = _tmp26_;
		_g_object_unref0 (row);
	}
	gitg_drag_list_box_check_scroll (self, y);
	if (self->priv->should_scroll) {
		_tmp27_ = !self->priv->scrolling;
	} else {
		_tmp27_ = FALSE;
	}
	if (_tmp27_) {
		self->priv->scrolling = TRUE;
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) GITG_DRAG_LIST_BOX_SCROLL_DELAY, _gitg_drag_list_box_scroll_gsource_func, g_object_ref (self), g_object_unref);
	}
	result = TRUE;
	return result;
}

static void
gitg_drag_list_box_real_drag_leave (GtkWidget* base,
                                    GdkDragContext* context,
                                    guint time)
{
	GitgDragListBox * self;
	self = (GitgDragListBox*) base;
	g_return_if_fail (context != NULL);
	self->priv->should_scroll = FALSE;
}

static void
gitg_drag_list_box_check_scroll (GitgDragListBox* self,
                                 gint y)
{
	GtkAdjustment* _tmp0_;
	GtkAdjustment* _tmp1_;
	gdouble vadjustment_min = 0.0;
	GtkAdjustment* _tmp2_;
	GtkAdjustment* _tmp3_;
	gdouble _tmp4_;
	gdouble _tmp5_;
	gdouble vadjustment_max = 0.0;
	GtkAdjustment* _tmp6_;
	GtkAdjustment* _tmp7_;
	gdouble _tmp8_;
	gdouble _tmp9_;
	gdouble show_min = 0.0;
	gdouble show_max = 0.0;
	GtkAdjustment* _tmp10_;
	GtkAdjustment* _tmp11_;
	gdouble _tmp12_;
	gdouble _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gitg_drag_list_box_get_vadjustment (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = gitg_drag_list_box_get_vadjustment (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gtk_adjustment_get_value (_tmp3_);
	_tmp5_ = _tmp4_;
	vadjustment_min = _tmp5_;
	_tmp6_ = gitg_drag_list_box_get_vadjustment (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = gtk_adjustment_get_page_size (_tmp7_);
	_tmp9_ = _tmp8_;
	vadjustment_max = _tmp9_ + vadjustment_min;
	show_min = MAX ((gdouble) 0, (gdouble) (y - GITG_DRAG_LIST_BOX_SCROLL_DISTANCE));
	_tmp10_ = gitg_drag_list_box_get_vadjustment (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = gtk_adjustment_get_upper (_tmp11_);
	_tmp13_ = _tmp12_;
	show_max = MIN (_tmp13_, (gdouble) (y + GITG_DRAG_LIST_BOX_SCROLL_DISTANCE));
	if (vadjustment_min > show_min) {
		self->priv->should_scroll = TRUE;
		self->priv->scroll_up = TRUE;
	} else {
		if (vadjustment_max < show_max) {
			self->priv->should_scroll = TRUE;
			self->priv->scroll_up = FALSE;
		} else {
			self->priv->should_scroll = FALSE;
		}
	}
}

static gboolean
gitg_drag_list_box_scroll (GitgDragListBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->should_scroll) {
		if (self->priv->scroll_up) {
			GtkAdjustment* _tmp0_;
			GtkAdjustment* _tmp1_;
			GtkAdjustment* _tmp2_;
			GtkAdjustment* _tmp3_;
			gdouble _tmp4_;
			gdouble _tmp5_;
			_tmp0_ = gitg_drag_list_box_get_vadjustment (self);
			_tmp1_ = _tmp0_;
			_tmp2_ = gitg_drag_list_box_get_vadjustment (self);
			_tmp3_ = _tmp2_;
			_tmp4_ = gtk_adjustment_get_value (_tmp3_);
			_tmp5_ = _tmp4_;
			gtk_adjustment_set_value (_tmp3_, _tmp5_ - GITG_DRAG_LIST_BOX_SCROLL_STEP_SIZE);
		} else {
			GtkAdjustment* _tmp6_;
			GtkAdjustment* _tmp7_;
			GtkAdjustment* _tmp8_;
			GtkAdjustment* _tmp9_;
			gdouble _tmp10_;
			gdouble _tmp11_;
			_tmp6_ = gitg_drag_list_box_get_vadjustment (self);
			_tmp7_ = _tmp6_;
			_tmp8_ = gitg_drag_list_box_get_vadjustment (self);
			_tmp9_ = _tmp8_;
			_tmp10_ = gtk_adjustment_get_value (_tmp9_);
			_tmp11_ = _tmp10_;
			gtk_adjustment_set_value (_tmp9_, _tmp11_ + GITG_DRAG_LIST_BOX_SCROLL_STEP_SIZE);
		}
	} else {
		self->priv->scrolling = FALSE;
	}
	result = self->priv->should_scroll;
	return result;
}

static void
gitg_drag_list_box_real_drag_data_received (GtkWidget* base,
                                            GdkDragContext* context,
                                            gint x,
                                            gint y,
                                            GtkSelectionData* selection_data,
                                            guint info,
                                            guint time)
{
	GitgDragListBox * self;
	GtkWidget* handle = NULL;
	GtkListBoxRow* row = NULL;
	gint to = 0;
	GtkListBoxRow* _tmp0_;
	self = (GitgDragListBox*) base;
	g_return_if_fail (context != NULL);
	g_return_if_fail (selection_data != NULL);
	to = 0;
	_tmp0_ = self->priv->hover_row;
	if (_tmp0_ != NULL) {
		gint h_index = 0;
		GtkListBoxRow* _tmp1_;
		guint8* _tmp2_;
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		GtkWidget* _tmp5_;
		GtkWidget* _tmp6_;
		GtkListBoxRow* _tmp7_;
		gint from = 0;
		GtkListBoxRow* _tmp8_;
		gboolean up_down = FALSE;
		_tmp1_ = self->priv->hover_row;
		h_index = gtk_list_box_row_get_index (_tmp1_);
		_tmp2_ = gtk_selection_data_get_data (selection_data);
		_tmp3_ = ((GtkWidget**) _tmp2_)[0];
		_tmp4_ = _g_object_ref0 (_tmp3_);
		_g_object_unref0 (handle);
		handle = _tmp4_;
		_tmp5_ = handle;
		_tmp6_ = gtk_widget_get_ancestor (_tmp5_, gtk_list_box_row_get_type ());
		_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_list_box_row_get_type (), GtkListBoxRow));
		_g_object_unref0 (row);
		row = _tmp7_;
		_tmp8_ = row;
		from = gtk_list_box_row_get_index (_tmp8_);
		up_down = from < h_index;
		if (self->priv->top) {
			GtkListBoxRow* _tmp9_;
			GtkStyleContext* _tmp10_;
			if (up_down) {
				to = h_index - 1;
			} else {
				to = h_index;
			}
			_tmp9_ = self->priv->hover_row;
			_tmp10_ = gtk_widget_get_style_context ((GtkWidget*) _tmp9_);
			gtk_style_context_remove_class (_tmp10_, "drag-hover-top");
		} else {
			GtkListBoxRow* _tmp11_;
			GtkStyleContext* _tmp12_;
			if (up_down) {
				to = h_index;
			} else {
				to = h_index + 1;
			}
			_tmp11_ = self->priv->hover_row;
			_tmp12_ = gtk_widget_get_style_context ((GtkWidget*) _tmp11_);
			gtk_style_context_remove_class (_tmp12_, "drag-hover-bottom");
		}
		if (from != to) {
			GitgListRow* list_row = NULL;
			GListStore* _tmp13_;
			GObject* _tmp14_;
			GListStore* _tmp15_;
			GListStore* _tmp16_;
			GitgListRow* _tmp17_;
			_tmp13_ = self->priv->model;
			_tmp14_ = g_list_model_get_item ((GListModel*) _tmp13_, (guint) from);
			list_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GITG_TYPE_LIST_ROW, GitgListRow);
			_tmp15_ = self->priv->model;
			g_list_store_remove (_tmp15_, (guint) from);
			_tmp16_ = self->priv->model;
			_tmp17_ = list_row;
			g_list_store_insert (_tmp16_, (guint) to, (GObject*) _tmp17_);
			g_signal_emit (self, gitg_drag_list_box_signals[GITG_DRAG_LIST_BOX_ROW_REORDER_SIGNAL], 0, from, to);
			_g_object_unref0 (list_row);
		}
	}
	_g_object_unref0 (self->drag_row);
	self->drag_row = NULL;
	_g_object_unref0 (row);
	_g_object_unref0 (handle);
}

GtkAdjustment*
gitg_drag_list_box_get_vadjustment (GitgDragListBox* self)
{
	GtkAdjustment* result;
	GtkAdjustment* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_vadjustment;
	result = _tmp0_;
	return result;
}

void
gitg_drag_list_box_set_vadjustment (GitgDragListBox* self,
                                    GtkAdjustment* value)
{
	GtkAdjustment* _tmp0_;
	GtkAdjustment* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_vadjustment);
	self->priv->_vadjustment = _tmp0_;
	_tmp1_ = self->priv->_vadjustment;
	if (_tmp1_ == NULL) {
		self->priv->should_scroll = FALSE;
	}
	g_object_notify_by_pspec ((GObject *) self, gitg_drag_list_box_properties[GITG_DRAG_LIST_BOX_VADJUSTMENT_PROPERTY]);
}

static void
g_cclosure_user_marshal_VOID__INT_INT (GClosure * closure,
                                       GValue * return_value,
                                       guint n_param_values,
                                       const GValue * param_values,
                                       gpointer invocation_hint,
                                       gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, gint arg_1, gint arg_2, gpointer data2);
	register GMarshalFunc_VOID__INT_INT 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__INT_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_int (param_values + 1), g_value_get_int (param_values + 2), data2);
}

static void
gitg_drag_list_box_class_init (GitgDragListBoxClass * klass,
                               gpointer klass_data)
{
	gitg_drag_list_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgDragListBox_private_offset);
	((GtkWidgetClass *) klass)->drag_motion = (gboolean (*) (GtkWidget*, GdkDragContext*, gint, gint, guint)) gitg_drag_list_box_real_drag_motion;
	((GtkWidgetClass *) klass)->drag_leave = (void (*) (GtkWidget*, GdkDragContext*, guint)) gitg_drag_list_box_real_drag_leave;
	((GtkWidgetClass *) klass)->drag_data_received = (void (*) (GtkWidget*, GdkDragContext*, gint, gint, GtkSelectionData*, guint, guint)) gitg_drag_list_box_real_drag_data_received;
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_drag_list_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_drag_list_box_set_property;
	G_OBJECT_CLASS (klass)->finalize = gitg_drag_list_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_DRAG_LIST_BOX_VADJUSTMENT_PROPERTY, gitg_drag_list_box_properties[GITG_DRAG_LIST_BOX_VADJUSTMENT_PROPERTY] = g_param_spec_object ("vadjustment", "vadjustment", "vadjustment", gtk_adjustment_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gitg_drag_list_box_signals[GITG_DRAG_LIST_BOX_ROW_REORDER_SIGNAL] = g_signal_new ("row-reorder", GITG_TYPE_DRAG_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
}

static void
gitg_drag_list_box_instance_init (GitgDragListBox * self,
                                  gpointer klass)
{
	self->priv = gitg_drag_list_box_get_instance_private (self);
	self->priv->top = FALSE;
	self->priv->should_scroll = FALSE;
	self->priv->scrolling = FALSE;
}

static void
gitg_drag_list_box_finalize (GObject * obj)
{
	GitgDragListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_DRAG_LIST_BOX, GitgDragListBox);
	_g_object_unref0 (self->priv->model);
	_g_object_unref0 (self->priv->hover_row);
	_g_object_unref0 (self->drag_row);
	_g_object_unref0 (self->priv->_vadjustment);
	G_OBJECT_CLASS (gitg_drag_list_box_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_drag_list_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgDragListBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_drag_list_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgDragListBox), 0, (GInstanceInitFunc) gitg_drag_list_box_instance_init, NULL };
	GType gitg_drag_list_box_type_id;
	gitg_drag_list_box_type_id = g_type_register_static (gtk_list_box_get_type (), "GitgDragListBox", &g_define_type_info, 0);
	GitgDragListBox_private_offset = g_type_add_instance_private (gitg_drag_list_box_type_id, sizeof (GitgDragListBoxPrivate));
	return gitg_drag_list_box_type_id;
}

GType
gitg_drag_list_box_get_type (void)
{
	static gsize gitg_drag_list_box_type_id__once = 0;
	if (g_once_init_enter (&gitg_drag_list_box_type_id__once)) {
		GType gitg_drag_list_box_type_id;
		gitg_drag_list_box_type_id = gitg_drag_list_box_get_type_once ();
		g_once_init_leave (&gitg_drag_list_box_type_id__once, gitg_drag_list_box_type_id);
	}
	return gitg_drag_list_box_type_id__once;
}

static void
_vala_gitg_drag_list_box_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	GitgDragListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_DRAG_LIST_BOX, GitgDragListBox);
	switch (property_id) {
		case GITG_DRAG_LIST_BOX_VADJUSTMENT_PROPERTY:
		g_value_set_object (value, gitg_drag_list_box_get_vadjustment (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_drag_list_box_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	GitgDragListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_DRAG_LIST_BOX, GitgDragListBox);
	switch (property_id) {
		case GITG_DRAG_LIST_BOX_VADJUSTMENT_PROPERTY:
		gitg_drag_list_box_set_vadjustment (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
gitg_list_box_row_dn_d_get_instance_private (GitgListBoxRowDnD* self)
{
	return G_STRUCT_MEMBER_P (self, GitgListBoxRowDnD_private_offset);
}

void
gitg_list_box_row_dn_d_enable_up (GitgListBoxRowDnD* self,
                                  gboolean flag)
{
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->menu_btn_up;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, flag);
	_tmp1_ = self->btn_up;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, flag);
}

void
gitg_list_box_row_dn_d_enable_down (GitgListBoxRowDnD* self,
                                    gboolean flag)
{
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->menu_btn_down;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, flag);
	_tmp1_ = self->btn_down;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, flag);
}

void
gitg_list_box_row_dn_d_set_switch_active (GitgListBoxRowDnD* self,
                                          gboolean flag)
{
	GtkSwitch* _tmp0_;
	g_return_if_fail (self != NULL);
	self->priv->allow_signal = FALSE;
	_tmp0_ = self->priv->switch_visible;
	gtk_switch_set_active (_tmp0_, flag);
	self->priv->allow_signal = TRUE;
}

static void
__lambda154_ (GitgListBoxRowDnD* self)
{
	gitg_list_box_row_dn_d_up (self);
}

static void
___lambda154__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda154_ ((GitgListBoxRowDnD*) self);
}

static void
__lambda155_ (GitgListBoxRowDnD* self)
{
	gitg_list_box_row_dn_d_down (self);
}

static void
___lambda155__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda155_ ((GitgListBoxRowDnD*) self);
}

static void
__lambda156_ (GitgListBoxRowDnD* self)
{
	gitg_list_box_row_dn_d_up (self);
}

static void
___lambda156__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda156_ ((GitgListBoxRowDnD*) self);
}

static void
__lambda157_ (GitgListBoxRowDnD* self)
{
	gitg_list_box_row_dn_d_down (self);
}

static void
___lambda157__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda157_ ((GitgListBoxRowDnD*) self);
}

static gboolean
__lambda158_ (GitgListBoxRowDnD* self,
              gboolean state)
{
	gboolean result;
	if (self->priv->allow_signal) {
		GtkSwitch* _tmp0_;
		gboolean _tmp1_;
		gboolean _tmp2_;
		_tmp0_ = self->priv->switch_visible;
		_tmp1_ = gtk_switch_get_active (_tmp0_);
		_tmp2_ = _tmp1_;
		g_signal_emit (self, gitg_list_box_row_dn_d_signals[GITG_LIST_BOX_ROW_DN_D_SWITCH_CHANGED_SIGNAL], 0, _tmp2_);
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda158__gtk_switch_state_set (GtkSwitch* _sender,
                                    gboolean state,
                                    gpointer self)
{
	gboolean result;
	result = __lambda158_ ((GitgListBoxRowDnD*) self, state);
	return result;
}

static void
_gitg_list_box_row_dn_d_row_drag_begin_gtk_widget_drag_begin (GtkWidget* _sender,
                                                              GdkDragContext* context,
                                                              gpointer self)
{
	gitg_list_box_row_dn_d_row_drag_begin ((GitgListBoxRowDnD*) self, _sender, context);
}

static void
_gitg_list_box_row_dn_d_row_drag_data_get_gtk_widget_drag_data_get (GtkWidget* _sender,
                                                                    GdkDragContext* context,
                                                                    GtkSelectionData* selection_data,
                                                                    guint info,
                                                                    guint time_,
                                                                    gpointer self)
{
	gitg_list_box_row_dn_d_row_drag_data_get ((GitgListBoxRowDnD*) self, _sender, context, selection_data, info, time_);
}

GitgListBoxRowDnD*
gitg_list_box_row_dn_d_construct (GType object_type,
                                  const gchar* title,
                                  gboolean switch_state)
{
	GitgListBoxRowDnD * self = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp0_;
	GtkEventBox* handle = NULL;
	GtkEventBox* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GtkImage* image = NULL;
	GtkImage* _tmp4_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp5_;
	GtkBox* hbox = NULL;
	GtkBox* _tmp6_;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	GtkStyleContext* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	GtkStyleContext* _tmp14_;
	GtkImage* arrow_up = NULL;
	GtkImage* _tmp15_;
	GtkImage* arrow_down = NULL;
	GtkImage* _tmp16_;
	GtkButton* _tmp17_;
	GtkButton* _tmp18_;
	GtkButton* _tmp19_;
	GtkButton* _tmp20_;
	GtkButton* _tmp21_;
	GtkButton* _tmp22_;
	GtkMenuButton* menu_btn = NULL;
	GtkMenuButton* _tmp23_;
	GtkImage* _tmp24_;
	GtkImage* _tmp25_;
	GtkPopover* pop = NULL;
	GtkPopover* _tmp26_;
	GtkBox* v = NULL;
	GtkBox* _tmp27_;
	GtkButton* _tmp28_;
	GtkButton* _tmp29_;
	GtkButton* _tmp30_;
	GtkButton* _tmp31_;
	GtkButton* _tmp32_;
	GtkButton* _tmp33_;
	GtkButton* _tmp34_;
	GtkButton* _tmp35_;
	GtkSwitch* _tmp36_;
	GtkSwitch* _tmp37_;
	GtkSwitch* _tmp38_;
	GtkSwitch* _tmp39_;
	GtkSwitch* _tmp40_;
	GtkSwitch* _tmp41_;
	GtkSpinButton* spin = NULL;
	GtkSpinButton* _tmp42_;
	g_return_val_if_fail (title != NULL, NULL);
	self = (GitgListBoxRowDnD*) g_object_new (object_type, NULL);
	self->priv->allow_signal = TRUE;
	gitg_list_box_row_dn_d_set_title (self, title);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
	g_object_ref_sink (_tmp0_);
	box = _tmp0_;
	gtk_widget_set_margin_start ((GtkWidget*) box, 10);
	gtk_widget_set_margin_end ((GtkWidget*) box, 10);
	_tmp1_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp1_);
	handle = _tmp1_;
	_tmp2_ = g_strconcat ("eventBox", title, NULL);
	_tmp3_ = _tmp2_;
	gtk_buildable_set_name ((GtkBuildable*) handle, _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = (GtkImage*) gtk_image_new_from_icon_name ("list-drag-handle-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp4_);
	image = _tmp4_;
	gtk_container_add ((GtkContainer*) handle, (GtkWidget*) image);
	gtk_box_pack_start (box, (GtkWidget*) handle, FALSE, TRUE, (guint) 0);
	_tmp5_ = (GtkLabel*) gtk_label_new (title);
	g_object_ref_sink (_tmp5_);
	label = _tmp5_;
	gtk_box_pack_start (box, (GtkWidget*) label, TRUE, TRUE, (guint) 0);
	_tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp6_);
	hbox = _tmp6_;
	_tmp7_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->btn_up);
	self->btn_up = _tmp7_;
	_tmp8_ = self->btn_up;
	gtk_button_set_relief (_tmp8_, GTK_RELIEF_NONE);
	_tmp9_ = self->btn_up;
	_tmp10_ = gtk_widget_get_style_context ((GtkWidget*) _tmp9_);
	gtk_style_context_add_class (_tmp10_, "flat");
	_tmp11_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->btn_down);
	self->btn_down = _tmp11_;
	_tmp12_ = self->btn_down;
	gtk_button_set_relief (_tmp12_, GTK_RELIEF_NONE);
	_tmp13_ = self->btn_down;
	_tmp14_ = gtk_widget_get_style_context ((GtkWidget*) _tmp13_);
	gtk_style_context_add_class (_tmp14_, "flat");
	_tmp15_ = (GtkImage*) gtk_image_new_from_icon_name ("pan-up-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp15_);
	arrow_up = _tmp15_;
	_tmp16_ = (GtkImage*) gtk_image_new_from_icon_name ("pan-down-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp16_);
	arrow_down = _tmp16_;
	_tmp17_ = self->btn_up;
	gtk_container_add ((GtkContainer*) _tmp17_, (GtkWidget*) arrow_up);
	_tmp18_ = self->btn_down;
	gtk_container_add ((GtkContainer*) _tmp18_, (GtkWidget*) arrow_down);
	_tmp19_ = self->btn_up;
	g_signal_connect_object (_tmp19_, "clicked", (GCallback) ___lambda154__gtk_button_clicked, self, 0);
	_tmp20_ = self->btn_down;
	g_signal_connect_object (_tmp20_, "clicked", (GCallback) ___lambda155__gtk_button_clicked, self, 0);
	_tmp21_ = self->btn_up;
	gtk_box_pack_start (hbox, (GtkWidget*) _tmp21_, TRUE, TRUE, (guint) 0);
	_tmp22_ = self->btn_down;
	gtk_box_pack_start (hbox, (GtkWidget*) _tmp22_, TRUE, TRUE, (guint) 0);
	gtk_box_pack_end (box, (GtkWidget*) hbox, FALSE, FALSE, (guint) 0);
	_tmp23_ = (GtkMenuButton*) gtk_menu_button_new ();
	g_object_ref_sink (_tmp23_);
	menu_btn = _tmp23_;
	gtk_button_set_relief ((GtkButton*) menu_btn, GTK_RELIEF_NONE);
	_tmp24_ = (GtkImage*) gtk_image_new_from_icon_name ("view-more-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp24_);
	_tmp25_ = _tmp24_;
	gtk_container_add ((GtkContainer*) menu_btn, (GtkWidget*) _tmp25_);
	_g_object_unref0 (_tmp25_);
	gtk_menu_button_set_use_popover (menu_btn, TRUE);
	gtk_button_set_relief ((GtkButton*) menu_btn, GTK_RELIEF_NONE);
	gtk_widget_set_tooltip_text ((GtkWidget*) menu_btn, "More options");
	gtk_box_pack_end (box, (GtkWidget*) menu_btn, FALSE, FALSE, (guint) 0);
	_tmp26_ = (GtkPopover*) gtk_popover_new ((GtkWidget*) menu_btn);
	g_object_ref_sink (_tmp26_);
	pop = _tmp26_;
	gtk_container_set_border_width ((GtkContainer*) pop, (guint) 6);
	gtk_popover_set_relative_to (pop, (GtkWidget*) menu_btn);
	_tmp27_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	g_object_ref_sink (_tmp27_);
	v = _tmp27_;
	g_object_set ((GtkWidget*) v, "margin", 6, NULL);
	_tmp28_ = (GtkButton*) gtk_button_new_with_label ("Up");
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (self->menu_btn_up);
	self->menu_btn_up = _tmp28_;
	_tmp29_ = self->menu_btn_up;
	gtk_button_set_relief (_tmp29_, GTK_RELIEF_NONE);
	_tmp30_ = self->menu_btn_up;
	gtk_box_pack_start (v, (GtkWidget*) _tmp30_, FALSE, FALSE, (guint) 0);
	_tmp31_ = (GtkButton*) gtk_button_new_with_label ("Down");
	g_object_ref_sink (_tmp31_);
	_g_object_unref0 (self->menu_btn_down);
	self->menu_btn_down = _tmp31_;
	_tmp32_ = self->menu_btn_down;
	gtk_button_set_relief (_tmp32_, GTK_RELIEF_NONE);
	_tmp33_ = self->menu_btn_down;
	gtk_box_pack_start (v, (GtkWidget*) _tmp33_, FALSE, FALSE, (guint) 0);
	gtk_widget_show_all ((GtkWidget*) v);
	gtk_container_add ((GtkContainer*) pop, (GtkWidget*) v);
	_tmp34_ = self->menu_btn_up;
	g_signal_connect_object (_tmp34_, "clicked", (GCallback) ___lambda156__gtk_button_clicked, self, 0);
	_tmp35_ = self->menu_btn_down;
	g_signal_connect_object (_tmp35_, "clicked", (GCallback) ___lambda157__gtk_button_clicked, self, 0);
	gtk_menu_button_set_popover (menu_btn, (GtkWidget*) pop);
	_tmp36_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp36_);
	_g_object_unref0 (self->priv->switch_visible);
	self->priv->switch_visible = _tmp36_;
	_tmp37_ = self->priv->switch_visible;
	gtk_switch_set_active (_tmp37_, switch_state);
	_tmp38_ = self->priv->switch_visible;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp38_, FALSE);
	_tmp39_ = self->priv->switch_visible;
	gtk_widget_set_valign ((GtkWidget*) _tmp39_, GTK_ALIGN_CENTER);
	_tmp40_ = self->priv->switch_visible;
	g_signal_connect_object (_tmp40_, "state-set", (GCallback) ___lambda158__gtk_switch_state_set, self, 0);
	_tmp41_ = self->priv->switch_visible;
	gtk_box_pack_end (box, (GtkWidget*) _tmp41_, FALSE, FALSE, (guint) 0);
	_tmp42_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 1, (gdouble) 1);
	g_object_ref_sink (_tmp42_);
	spin = _tmp42_;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) box);
	gtk_drag_source_set ((GtkWidget*) handle, GDK_BUTTON1_MASK, GITG_entries, (gint) G_N_ELEMENTS (GITG_entries), GDK_ACTION_MOVE);
	g_signal_connect_object ((GtkWidget*) handle, "drag-begin", (GCallback) _gitg_list_box_row_dn_d_row_drag_begin_gtk_widget_drag_begin, self, 0);
	g_signal_connect_object ((GtkWidget*) handle, "drag-data-get", (GCallback) _gitg_list_box_row_dn_d_row_drag_data_get_gtk_widget_drag_data_get, self, 0);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (spin);
	_g_object_unref0 (v);
	_g_object_unref0 (pop);
	_g_object_unref0 (menu_btn);
	_g_object_unref0 (arrow_down);
	_g_object_unref0 (arrow_up);
	_g_object_unref0 (hbox);
	_g_object_unref0 (label);
	_g_object_unref0 (image);
	_g_object_unref0 (handle);
	_g_object_unref0 (box);
	return self;
}

GitgListBoxRowDnD*
gitg_list_box_row_dn_d_new (const gchar* title,
                            gboolean switch_state)
{
	return gitg_list_box_row_dn_d_construct (GITG_TYPE_LIST_BOX_ROW_DN_D, title, switch_state);
}

static void
gitg_list_box_row_dn_d_up (GitgListBoxRowDnD* self)
{
	g_return_if_fail (self != NULL);
	gitg_list_box_row_dn_d_move (self, -1);
}

static void
gitg_list_box_row_dn_d_down (GitgListBoxRowDnD* self)
{
	g_return_if_fail (self != NULL);
	gitg_list_box_row_dn_d_move (self, 1);
}

static void
gitg_list_box_row_dn_d_move (GitgListBoxRowDnD* self,
                             gint offset)
{
	gint from = 0;
	GitgDragListBox* listbox = NULL;
	GtkContainer* _tmp0_;
	GitgDragListBox* _tmp1_;
	g_return_if_fail (self != NULL);
	from = gtk_list_box_row_get_index ((GtkListBoxRow*) self);
	_tmp0_ = gtk_widget_get_parent ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (GITG_IS_DRAG_LIST_BOX (_tmp0_) ? ((GitgDragListBox*) _tmp0_) : NULL);
	listbox = _tmp1_;
	gtk_container_remove ((GtkContainer*) listbox, (GtkWidget*) self);
	gtk_list_box_insert ((GtkListBox*) listbox, (GtkWidget*) self, from + offset);
	g_signal_emit (listbox, gitg_drag_list_box_signals[GITG_DRAG_LIST_BOX_ROW_REORDER_SIGNAL], 0, from, from + offset);
	_g_object_unref0 (listbox);
}

static void
gitg_list_box_row_dn_d_row_drag_begin (GitgListBoxRowDnD* self,
                                       GtkWidget* widget,
                                       GdkDragContext* context)
{
	GtkAllocation alloc = {0};
	GtkAllocation _tmp0_ = {0};
	cairo_surface_t* surface = NULL;
	GtkAllocation _tmp1_;
	GtkAllocation _tmp2_;
	cairo_surface_t* _tmp3_;
	cairo_t* cr = NULL;
	cairo_surface_t* _tmp4_;
	cairo_t* _tmp5_;
	GitgDragListBox* parent = NULL;
	GtkContainer* _tmp6_;
	GitgDragListBox* _tmp7_;
	GitgDragListBox* _tmp8_;
	GtkStyleContext* _tmp11_;
	cairo_t* _tmp12_;
	gboolean _tmp13_ = FALSE;
	GtkStyleContext* _tmp14_;
	gint x = 0;
	gint y = 0;
	gint _tmp15_ = 0;
	gint _tmp16_ = 0;
	cairo_surface_t* _tmp17_;
	cairo_surface_t* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (context != NULL);
	gtk_widget_get_allocation ((GtkWidget*) self, &_tmp0_);
	alloc = _tmp0_;
	_tmp1_ = alloc;
	_tmp2_ = alloc;
	_tmp3_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp1_.width, _tmp2_.height);
	surface = _tmp3_;
	_tmp4_ = surface;
	_tmp5_ = cairo_create (_tmp4_);
	cr = _tmp5_;
	_tmp6_ = gtk_widget_get_parent ((GtkWidget*) self);
	_tmp7_ = _g_object_ref0 (GITG_IS_DRAG_LIST_BOX (_tmp6_) ? ((GitgDragListBox*) _tmp6_) : NULL);
	parent = _tmp7_;
	_tmp8_ = parent;
	if (_tmp8_ != NULL) {
		GitgDragListBox* _tmp9_;
		GtkListBoxRow* _tmp10_;
		_tmp9_ = parent;
		_tmp10_ = _g_object_ref0 ((GtkListBoxRow*) self);
		_g_object_unref0 (_tmp9_->drag_row);
		_tmp9_->drag_row = _tmp10_;
	}
	_tmp11_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp11_, "drag-icon");
	_tmp12_ = cr;
	g_signal_emit_by_name ((GtkWidget*) self, "draw", _tmp12_, &_tmp13_);
	_tmp14_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_remove_class (_tmp14_, "drag-icon");
	gtk_widget_translate_coordinates (widget, (GtkWidget*) self, 0, 0, &_tmp15_, &_tmp16_);
	x = _tmp15_;
	y = _tmp16_;
	_tmp17_ = surface;
	cairo_surface_set_device_offset (_tmp17_, (gdouble) ((-x) - 7), (gdouble) ((-y) - 10));
	_tmp18_ = surface;
	gtk_drag_set_icon_surface (context, _tmp18_);
	_g_object_unref0 (parent);
	_cairo_destroy0 (cr);
	_cairo_surface_destroy0 (surface);
}

static void
gitg_list_box_row_dn_d_row_drag_data_get (GitgListBoxRowDnD* self,
                                          GtkWidget* widget,
                                          GdkDragContext* context,
                                          GtkSelectionData* selection_data,
                                          guint info,
                                          guint time)
{
	guchar* data = NULL;
	guchar* _tmp0_;
	gint data_length1;
	gint _data_size_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (context != NULL);
	g_return_if_fail (selection_data != NULL);
	_tmp0_ = g_new0 (guchar, sizeof (GtkWidget*));
	data = _tmp0_;
	data_length1 = sizeof (GtkWidget*);
	_data_size_ = data_length1;
	_tmp1_ = _g_object_ref0 (widget);
	_g_object_unref0 (((GtkWidget**) data)[0]);
	((GtkWidget**) data)[0] = _tmp1_;
	gtk_selection_data_set (selection_data, gdk_atom_intern_static_string ("GTK_LIST_BOX_ROW"), 32, data, (gint) data_length1);
	data = (g_free (data), NULL);
}

const gchar*
gitg_list_box_row_dn_d_get_title (GitgListBoxRowDnD* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

void
gitg_list_box_row_dn_d_set_title (GitgListBoxRowDnD* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gitg_list_box_row_dn_d_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_list_box_row_dn_d_properties[GITG_LIST_BOX_ROW_DN_D_TITLE_PROPERTY]);
	}
}

static void
gitg_list_box_row_dn_d_class_init (GitgListBoxRowDnDClass * klass,
                                   gpointer klass_data)
{
	gitg_list_box_row_dn_d_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgListBoxRowDnD_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_list_box_row_dn_d_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_list_box_row_dn_d_set_property;
	G_OBJECT_CLASS (klass)->finalize = gitg_list_box_row_dn_d_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_LIST_BOX_ROW_DN_D_TITLE_PROPERTY, gitg_list_box_row_dn_d_properties[GITG_LIST_BOX_ROW_DN_D_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gitg_list_box_row_dn_d_signals[GITG_LIST_BOX_ROW_DN_D_SWITCH_CHANGED_SIGNAL] = g_signal_new ("switch-changed", GITG_TYPE_LIST_BOX_ROW_DN_D, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}

static void
gitg_list_box_row_dn_d_instance_init (GitgListBoxRowDnD * self,
                                      gpointer klass)
{
	self->priv = gitg_list_box_row_dn_d_get_instance_private (self);
}

static void
gitg_list_box_row_dn_d_finalize (GObject * obj)
{
	GitgListBoxRowDnD * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnD);
	_g_free0 (self->priv->_title);
	_g_object_unref0 (self->btn_up);
	_g_object_unref0 (self->btn_down);
	_g_object_unref0 (self->menu_btn_up);
	_g_object_unref0 (self->menu_btn_down);
	_g_object_unref0 (self->priv->switch_visible);
	G_OBJECT_CLASS (gitg_list_box_row_dn_d_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_list_box_row_dn_d_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgListBoxRowDnDClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_list_box_row_dn_d_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgListBoxRowDnD), 0, (GInstanceInitFunc) gitg_list_box_row_dn_d_instance_init, NULL };
	GType gitg_list_box_row_dn_d_type_id;
	gitg_list_box_row_dn_d_type_id = g_type_register_static (gtk_list_box_row_get_type (), "GitgListBoxRowDnD", &g_define_type_info, 0);
	GitgListBoxRowDnD_private_offset = g_type_add_instance_private (gitg_list_box_row_dn_d_type_id, sizeof (GitgListBoxRowDnDPrivate));
	return gitg_list_box_row_dn_d_type_id;
}

GType
gitg_list_box_row_dn_d_get_type (void)
{
	static gsize gitg_list_box_row_dn_d_type_id__once = 0;
	if (g_once_init_enter (&gitg_list_box_row_dn_d_type_id__once)) {
		GType gitg_list_box_row_dn_d_type_id;
		gitg_list_box_row_dn_d_type_id = gitg_list_box_row_dn_d_get_type_once ();
		g_once_init_leave (&gitg_list_box_row_dn_d_type_id__once, gitg_list_box_row_dn_d_type_id);
	}
	return gitg_list_box_row_dn_d_type_id__once;
}

static void
_vala_gitg_list_box_row_dn_d_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	GitgListBoxRowDnD * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnD);
	switch (property_id) {
		case GITG_LIST_BOX_ROW_DN_D_TITLE_PROPERTY:
		g_value_set_string (value, gitg_list_box_row_dn_d_get_title (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_list_box_row_dn_d_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	GitgListBoxRowDnD * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnD);
	switch (property_id) {
		case GITG_LIST_BOX_ROW_DN_D_TITLE_PROPERTY:
		gitg_list_box_row_dn_d_set_title (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

