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

/*
 * Copyright 2025 elementary, Inc. <https://elementary.io>
 * SPDX-License-Identifier: GPL-3.0-or-later
*
* Authored by: Jeremy Wootten <jeremywootten@gmail.com>
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include "codecore.h"
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <granite.h>
#include <gee.h>
#include <libgit2-glib/ggit.h>

#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

#define SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX (scratch_dialogs_branch_list_box_get_type ())
#define SCRATCH_DIALOGS_BRANCH_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, ScratchDialogsBranchListBox))
#define SCRATCH_DIALOGS_BRANCH_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, ScratchDialogsBranchListBoxClass))
#define SCRATCH_DIALOGS_IS_BRANCH_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX))
#define SCRATCH_DIALOGS_IS_BRANCH_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX))
#define SCRATCH_DIALOGS_BRANCH_LIST_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, ScratchDialogsBranchListBoxClass))

typedef struct _ScratchDialogsBranchListBox ScratchDialogsBranchListBox;
typedef struct _ScratchDialogsBranchListBoxClass ScratchDialogsBranchListBoxClass;
typedef struct _ScratchDialogsBranchListBoxPrivate ScratchDialogsBranchListBoxPrivate;
enum  {
	SCRATCH_DIALOGS_BRANCH_LIST_BOX_0_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_LIST_BOX_TEXT_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_LIST_BOX_SHOW_REMOTES_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_LIST_BOX_DIALOG_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_LIST_BOX_NUM_PROPERTIES
};
static GParamSpec* scratch_dialogs_branch_list_box_properties[SCRATCH_DIALOGS_BRANCH_LIST_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW (scratch_dialogs_branch_name_row_get_type ())
#define SCRATCH_DIALOGS_BRANCH_NAME_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow))
#define SCRATCH_DIALOGS_BRANCH_NAME_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRowClass))
#define SCRATCH_DIALOGS_IS_BRANCH_NAME_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW))
#define SCRATCH_DIALOGS_IS_BRANCH_NAME_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW))
#define SCRATCH_DIALOGS_BRANCH_NAME_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRowClass))

typedef struct _ScratchDialogsBranchNameRow ScratchDialogsBranchNameRow;
typedef struct _ScratchDialogsBranchNameRowClass ScratchDialogsBranchNameRowClass;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	SCRATCH_DIALOGS_BRANCH_LIST_BOX_BRANCH_CHANGED_SIGNAL,
	SCRATCH_DIALOGS_BRANCH_LIST_BOX_NUM_SIGNALS
};
static guint scratch_dialogs_branch_list_box_signals[SCRATCH_DIALOGS_BRANCH_LIST_BOX_NUM_SIGNALS] = {0};

struct _ScratchDialogsBranchListBox {
	GtkBin parent_instance;
	ScratchDialogsBranchListBoxPrivate * priv;
};

struct _ScratchDialogsBranchListBoxClass {
	GtkBinClass parent_class;
};

struct _ScratchDialogsBranchListBoxPrivate {
	gboolean _show_remotes;
	ScratchDialogsBranchActionDialog* _dialog;
	GtkListBox* list_box;
	GtkSearchEntry* search_entry;
	GtkLabel* local_header;
	GtkLabel* remote_header;
	GtkLabel* recent_header;
};

static gint ScratchDialogsBranchListBox_private_offset;
static gpointer scratch_dialogs_branch_list_box_parent_class = NULL;

VALA_EXTERN GType scratch_dialogs_branch_list_box_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ScratchDialogsBranchListBox* scratch_dialogs_branch_list_box_new (ScratchDialogsBranchActionDialog* dialog,
                                                                  gboolean show_remotes);
VALA_EXTERN ScratchDialogsBranchListBox* scratch_dialogs_branch_list_box_construct (GType object_type,
                                                                        ScratchDialogsBranchActionDialog* dialog,
                                                                        gboolean show_remotes);
VALA_EXTERN GType scratch_dialogs_branch_name_row_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ScratchDialogsBranchNameRow* scratch_dialogs_branch_list_box_get_selected_row (ScratchDialogsBranchListBox* self);
VALA_EXTERN const gchar* scratch_dialogs_branch_name_row_get_branch_name (ScratchDialogsBranchNameRow* self);
static gint scratch_dialogs_branch_list_box_listbox_sort_func (ScratchDialogsBranchListBox* self,
                                                        GtkListBoxRow* rowa,
                                                        GtkListBoxRow* rowb);
VALA_EXTERN gboolean scratch_dialogs_branch_name_row_get_is_recent (ScratchDialogsBranchNameRow* self);
VALA_EXTERN gboolean scratch_dialogs_branch_name_row_get_is_remote (ScratchDialogsBranchNameRow* self);
static void scratch_dialogs_branch_list_box_listbox_header_func (ScratchDialogsBranchListBox* self,
                                                          GtkListBoxRow* row,
                                                          GtkListBoxRow* row_before);
VALA_EXTERN void scratch_dialogs_branch_list_box_grab_focus (ScratchDialogsBranchListBox* self);
VALA_EXTERN const gchar* scratch_dialogs_branch_list_box_get_text (ScratchDialogsBranchListBox* self);
VALA_EXTERN gboolean scratch_dialogs_branch_list_box_get_show_remotes (ScratchDialogsBranchListBox* self);
static void scratch_dialogs_branch_list_box_set_show_remotes (ScratchDialogsBranchListBox* self,
                                                       gboolean value);
VALA_EXTERN ScratchDialogsBranchActionDialog* scratch_dialogs_branch_list_box_get_dialog (ScratchDialogsBranchListBox* self);
static void scratch_dialogs_branch_list_box_set_dialog (ScratchDialogsBranchListBox* self,
                                                 ScratchDialogsBranchActionDialog* value);
static GObject * scratch_dialogs_branch_list_box_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
VALA_EXTERN ScratchDialogsBranchNameRow* scratch_dialogs_branch_name_row_new (GgitRef* bref);
VALA_EXTERN ScratchDialogsBranchNameRow* scratch_dialogs_branch_name_row_construct (GType object_type,
                                                                        GgitRef* bref);
VALA_EXTERN void scratch_dialogs_branch_name_row_set_is_recent (ScratchDialogsBranchNameRow* self,
                                                    gboolean value);
static gint _scratch_dialogs_branch_list_box_listbox_sort_func_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                                GtkListBoxRow* row2,
                                                                                gpointer self);
static void _scratch_dialogs_branch_list_box_listbox_header_func_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                                           GtkListBoxRow* before,
                                                                                           gpointer self);
static void _scratch_dialogs_branch_list_box___lambda102_ (ScratchDialogsBranchListBox* self,
                                                    GtkListBoxRow* listboxrow);
static void __scratch_dialogs_branch_list_box___lambda102__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                               GtkListBoxRow* row,
                                                                               gpointer self);
static void _scratch_dialogs_branch_list_box___lambda103_ (ScratchDialogsBranchListBox* self,
                                                    GtkListBoxRow* listboxrow);
static void __scratch_dialogs_branch_list_box___lambda103__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                GtkListBoxRow* row,
                                                                                gpointer self);
static gboolean _scratch_dialogs_branch_list_box___lambda104_ (ScratchDialogsBranchListBox* self,
                                                        GtkListBoxRow* listboxrow);
static gboolean __scratch_dialogs_branch_list_box___lambda104__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                                  gpointer self);
static void _scratch_dialogs_branch_list_box___lambda105_ (ScratchDialogsBranchListBox* self);
static void __scratch_dialogs_branch_list_box___lambda105__gtk_editable_changed (GtkEditable* _sender,
                                                                          gpointer self);
static void _scratch_dialogs_branch_list_box___lambda106_ (ScratchDialogsBranchListBox* self);
static void __scratch_dialogs_branch_list_box___lambda106__gtk_entry_activate (GtkEntry* _sender,
                                                                        gpointer self);
static void scratch_dialogs_branch_list_box_finalize (GObject * obj);
static GType scratch_dialogs_branch_list_box_get_type_once (void);
static void _vala_scratch_dialogs_branch_list_box_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_scratch_dialogs_branch_list_box_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);

static inline gpointer
scratch_dialogs_branch_list_box_get_instance_private (ScratchDialogsBranchListBox* self)
{
	return G_STRUCT_MEMBER_P (self, ScratchDialogsBranchListBox_private_offset);
}

ScratchDialogsBranchListBox*
scratch_dialogs_branch_list_box_construct (GType object_type,
                                           ScratchDialogsBranchActionDialog* dialog,
                                           gboolean show_remotes)
{
	ScratchDialogsBranchListBox * self = NULL;
	g_return_val_if_fail (dialog != NULL, NULL);
	self = (ScratchDialogsBranchListBox*) g_object_new (object_type, "dialog", dialog, "show-remotes", show_remotes, NULL);
	return self;
}

ScratchDialogsBranchListBox*
scratch_dialogs_branch_list_box_new (ScratchDialogsBranchActionDialog* dialog,
                                     gboolean show_remotes)
{
	return scratch_dialogs_branch_list_box_construct (SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, dialog, show_remotes);
}

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

ScratchDialogsBranchNameRow*
scratch_dialogs_branch_list_box_get_selected_row (ScratchDialogsBranchListBox* self)
{
	gint index = 0;
	GtkListBoxRow* row = NULL;
	GtkListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	GtkListBoxRow* _tmp2_;
	GtkListBoxRow* _tmp15_;
	ScratchDialogsBranchNameRow* _tmp16_;
	ScratchDialogsBranchNameRow* result;
	g_return_val_if_fail (self != NULL, NULL);
	index = 0;
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_list_box_get_row_at_index (_tmp0_, index);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	row = _tmp2_;
	while (TRUE) {
		gboolean _tmp3_ = FALSE;
		GtkListBoxRow* _tmp4_;
		GtkListBox* _tmp11_;
		gint _tmp12_;
		GtkListBoxRow* _tmp13_;
		GtkListBoxRow* _tmp14_;
		_tmp4_ = row;
		if (_tmp4_ != NULL) {
			GtkListBoxRow* _tmp5_;
			const gchar* _tmp6_;
			const gchar* _tmp7_;
			GtkSearchEntry* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			_tmp5_ = row;
			_tmp6_ = scratch_dialogs_branch_name_row_get_branch_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow));
			_tmp7_ = _tmp6_;
			_tmp8_ = self->priv->search_entry;
			_tmp9_ = gtk_entry_get_text ((GtkEntry*) _tmp8_);
			_tmp10_ = _tmp9_;
			_tmp3_ = g_strcmp0 (_tmp7_, _tmp10_) != 0;
		} else {
			_tmp3_ = FALSE;
		}
		if (!_tmp3_) {
			break;
		}
		_tmp11_ = self->priv->list_box;
		index = index + 1;
		_tmp12_ = index;
		_tmp13_ = gtk_list_box_get_row_at_index (_tmp11_, _tmp12_);
		_tmp14_ = _g_object_ref0 (_tmp13_);
		_g_object_unref0 (row);
		row = _tmp14_;
	}
	_tmp15_ = row;
	_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow));
	result = _tmp16_;
	_g_object_unref0 (row);
	return result;
}

static gint
scratch_dialogs_branch_list_box_listbox_sort_func (ScratchDialogsBranchListBox* self,
                                                   GtkListBoxRow* rowa,
                                                   GtkListBoxRow* rowb)
{
	ScratchDialogsBranchNameRow* a = NULL;
	ScratchDialogsBranchNameRow* _tmp0_;
	ScratchDialogsBranchNameRow* b = NULL;
	ScratchDialogsBranchNameRow* _tmp1_;
	gboolean _tmp2_ = FALSE;
	ScratchDialogsBranchNameRow* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp16_ = FALSE;
	ScratchDialogsBranchNameRow* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	ScratchDialogsBranchNameRow* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	ScratchDialogsBranchNameRow* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (rowa != NULL, -1);
	g_return_val_if_fail (rowb != NULL, -1);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (rowa, SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow));
	a = _tmp0_;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (rowb, SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow));
	b = _tmp1_;
	_tmp3_ = a;
	_tmp4_ = scratch_dialogs_branch_name_row_get_is_recent (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		ScratchDialogsBranchNameRow* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = b;
		_tmp7_ = scratch_dialogs_branch_name_row_get_is_recent (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp2_ = !_tmp8_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		result = -1;
		_g_object_unref0 (b);
		_g_object_unref0 (a);
		return result;
	} else {
		gboolean _tmp9_ = FALSE;
		ScratchDialogsBranchNameRow* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp10_ = b;
		_tmp11_ = scratch_dialogs_branch_name_row_get_is_recent (_tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_) {
			ScratchDialogsBranchNameRow* _tmp13_;
			gboolean _tmp14_;
			gboolean _tmp15_;
			_tmp13_ = a;
			_tmp14_ = scratch_dialogs_branch_name_row_get_is_recent (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp9_ = !_tmp15_;
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			result = 1;
			_g_object_unref0 (b);
			_g_object_unref0 (a);
			return result;
		}
	}
	_tmp17_ = a;
	_tmp18_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		ScratchDialogsBranchNameRow* _tmp20_;
		gboolean _tmp21_;
		gboolean _tmp22_;
		_tmp20_ = b;
		_tmp21_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp16_ = !_tmp22_;
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		result = 1;
		_g_object_unref0 (b);
		_g_object_unref0 (a);
		return result;
	} else {
		gboolean _tmp23_ = FALSE;
		ScratchDialogsBranchNameRow* _tmp24_;
		gboolean _tmp25_;
		gboolean _tmp26_;
		_tmp24_ = b;
		_tmp25_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp24_);
		_tmp26_ = _tmp25_;
		if (_tmp26_) {
			ScratchDialogsBranchNameRow* _tmp27_;
			gboolean _tmp28_;
			gboolean _tmp29_;
			_tmp27_ = a;
			_tmp28_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp23_ = !_tmp29_;
		} else {
			_tmp23_ = FALSE;
		}
		if (_tmp23_) {
			result = -1;
			_g_object_unref0 (b);
			_g_object_unref0 (a);
			return result;
		}
	}
	_tmp30_ = a;
	_tmp31_ = scratch_dialogs_branch_name_row_get_branch_name (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = b;
	_tmp34_ = scratch_dialogs_branch_name_row_get_branch_name (_tmp33_);
	_tmp35_ = _tmp34_;
	result = g_utf8_collate (_tmp32_, _tmp35_);
	_g_object_unref0 (b);
	_g_object_unref0 (a);
	return result;
}

static void
scratch_dialogs_branch_list_box_listbox_header_func (ScratchDialogsBranchListBox* self,
                                                     GtkListBoxRow* row,
                                                     GtkListBoxRow* row_before)
{
	ScratchDialogsBranchNameRow* a = NULL;
	ScratchDialogsBranchNameRow* _tmp0_;
	ScratchDialogsBranchNameRow* b = NULL;
	ScratchDialogsBranchNameRow* _tmp1_;
	ScratchDialogsBranchNameRow* _tmp2_;
	ScratchDialogsBranchNameRow* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row, SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow));
	a = _tmp0_;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row_before, SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow));
	b = _tmp1_;
	_tmp2_ = a;
	gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp2_, NULL);
	_tmp3_ = b;
	if (_tmp3_ == NULL) {
		ScratchDialogsBranchNameRow* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = a;
		_tmp5_ = scratch_dialogs_branch_name_row_get_is_recent (_tmp4_);
		_tmp6_ = _tmp5_;
		if (_tmp6_) {
			ScratchDialogsBranchNameRow* _tmp7_;
			GtkLabel* _tmp8_;
			_tmp7_ = a;
			_tmp8_ = self->priv->recent_header;
			gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp7_, (GtkWidget*) _tmp8_);
		} else {
			ScratchDialogsBranchNameRow* _tmp9_;
			gboolean _tmp10_;
			gboolean _tmp11_;
			_tmp9_ = a;
			_tmp10_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp9_);
			_tmp11_ = _tmp10_;
			if (!_tmp11_) {
				ScratchDialogsBranchNameRow* _tmp12_;
				GtkLabel* _tmp13_;
				_tmp12_ = a;
				_tmp13_ = self->priv->local_header;
				gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp12_, (GtkWidget*) _tmp13_);
			} else {
				ScratchDialogsBranchNameRow* _tmp14_;
				GtkLabel* _tmp15_;
				_tmp14_ = a;
				_tmp15_ = self->priv->remote_header;
				gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp14_, (GtkWidget*) _tmp15_);
			}
		}
	} else {
		ScratchDialogsBranchNameRow* _tmp16_;
		gboolean _tmp17_;
		gboolean _tmp18_;
		_tmp16_ = b;
		_tmp17_ = scratch_dialogs_branch_name_row_get_is_recent (_tmp16_);
		_tmp18_ = _tmp17_;
		if (_tmp18_) {
			ScratchDialogsBranchNameRow* _tmp19_;
			gboolean _tmp20_;
			gboolean _tmp21_;
			_tmp19_ = a;
			_tmp20_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp19_);
			_tmp21_ = _tmp20_;
			if (!_tmp21_) {
				ScratchDialogsBranchNameRow* _tmp22_;
				GtkLabel* _tmp23_;
				_tmp22_ = a;
				_tmp23_ = self->priv->local_header;
				gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp22_, (GtkWidget*) _tmp23_);
			} else {
				ScratchDialogsBranchNameRow* _tmp24_;
				gboolean _tmp25_;
				gboolean _tmp26_;
				_tmp24_ = a;
				_tmp25_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp24_);
				_tmp26_ = _tmp25_;
				if (_tmp26_) {
					ScratchDialogsBranchNameRow* _tmp27_;
					GtkLabel* _tmp28_;
					_tmp27_ = a;
					_tmp28_ = self->priv->remote_header;
					gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp27_, (GtkWidget*) _tmp28_);
				}
			}
		} else {
			ScratchDialogsBranchNameRow* _tmp29_;
			gboolean _tmp30_;
			gboolean _tmp31_;
			_tmp29_ = b;
			_tmp30_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp29_);
			_tmp31_ = _tmp30_;
			if (!_tmp31_) {
				ScratchDialogsBranchNameRow* _tmp32_;
				gboolean _tmp33_;
				gboolean _tmp34_;
				_tmp32_ = a;
				_tmp33_ = scratch_dialogs_branch_name_row_get_is_remote (_tmp32_);
				_tmp34_ = _tmp33_;
				if (_tmp34_) {
					ScratchDialogsBranchNameRow* _tmp35_;
					GtkLabel* _tmp36_;
					_tmp35_ = a;
					_tmp36_ = self->priv->remote_header;
					gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp35_, (GtkWidget*) _tmp36_);
				}
			}
		}
	}
	_g_object_unref0 (b);
	_g_object_unref0 (a);
}

void
scratch_dialogs_branch_list_box_grab_focus (ScratchDialogsBranchListBox* self)
{
	GtkSearchEntry* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->search_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

const gchar*
scratch_dialogs_branch_list_box_get_text (ScratchDialogsBranchListBox* self)
{
	const gchar* result;
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->search_entry;
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

gboolean
scratch_dialogs_branch_list_box_get_show_remotes (ScratchDialogsBranchListBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_remotes;
	return result;
}

static void
scratch_dialogs_branch_list_box_set_show_remotes (ScratchDialogsBranchListBox* self,
                                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = scratch_dialogs_branch_list_box_get_show_remotes (self);
	if (old_value != value) {
		self->priv->_show_remotes = value;
		g_object_notify_by_pspec ((GObject *) self, scratch_dialogs_branch_list_box_properties[SCRATCH_DIALOGS_BRANCH_LIST_BOX_SHOW_REMOTES_PROPERTY]);
	}
}

ScratchDialogsBranchActionDialog*
scratch_dialogs_branch_list_box_get_dialog (ScratchDialogsBranchListBox* self)
{
	ScratchDialogsBranchActionDialog* result;
	ScratchDialogsBranchActionDialog* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_dialog;
	result = _tmp0_;
	return result;
}

static void
scratch_dialogs_branch_list_box_set_dialog (ScratchDialogsBranchListBox* self,
                                            ScratchDialogsBranchActionDialog* value)
{
	ScratchDialogsBranchActionDialog* old_value;
	g_return_if_fail (self != NULL);
	old_value = scratch_dialogs_branch_list_box_get_dialog (self);
	if (old_value != value) {
		ScratchDialogsBranchActionDialog* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_dialog);
		self->priv->_dialog = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, scratch_dialogs_branch_list_box_properties[SCRATCH_DIALOGS_BRANCH_LIST_BOX_DIALOG_PROPERTY]);
	}
}

static gint
_scratch_dialogs_branch_list_box_listbox_sort_func_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                           GtkListBoxRow* row2,
                                                                           gpointer self)
{
	gint result;
	result = scratch_dialogs_branch_list_box_listbox_sort_func ((ScratchDialogsBranchListBox*) self, row1, row2);
	return result;
}

static void
_scratch_dialogs_branch_list_box_listbox_header_func_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                                      GtkListBoxRow* before,
                                                                                      gpointer self)
{
	scratch_dialogs_branch_list_box_listbox_header_func ((ScratchDialogsBranchListBox*) self, row, before);
}

static void
_scratch_dialogs_branch_list_box___lambda102_ (ScratchDialogsBranchListBox* self,
                                               GtkListBoxRow* listboxrow)
{
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkSearchEntry* _tmp3_;
	GtkSearchEntry* _tmp4_;
	_tmp0_ = self->priv->search_entry;
	_tmp1_ = scratch_dialogs_branch_name_row_get_branch_name (G_TYPE_CHECK_INSTANCE_CAST (listboxrow, SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow));
	_tmp2_ = _tmp1_;
	gtk_entry_set_text ((GtkEntry*) _tmp0_, _tmp2_);
	_tmp3_ = self->priv->search_entry;
	gtk_entry_grab_focus_without_selecting ((GtkEntry*) _tmp3_);
	_tmp4_ = self->priv->search_entry;
	g_signal_emit_by_name ((GtkEntry*) _tmp4_, "move-cursor", GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1, FALSE);
}

static void
__scratch_dialogs_branch_list_box___lambda102__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                          GtkListBoxRow* row,
                                                                          gpointer self)
{
	_scratch_dialogs_branch_list_box___lambda102_ ((ScratchDialogsBranchListBox*) self, row);
}

static void
_scratch_dialogs_branch_list_box___lambda103_ (ScratchDialogsBranchListBox* self,
                                               GtkListBoxRow* listboxrow)
{
	ScratchDialogsBranchActionDialog* _tmp0_;
	g_return_if_fail (listboxrow != NULL);
	_tmp0_ = self->priv->_dialog;
	g_signal_emit_by_name (_tmp0_, "page-activated");
}

static void
__scratch_dialogs_branch_list_box___lambda103__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                           GtkListBoxRow* row,
                                                                           gpointer self)
{
	_scratch_dialogs_branch_list_box___lambda103_ ((ScratchDialogsBranchListBox*) self, row);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
_scratch_dialogs_branch_list_box___lambda104_ (ScratchDialogsBranchListBox* self,
                                               GtkListBoxRow* listboxrow)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GtkSearchEntry* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gboolean result;
	g_return_val_if_fail (listboxrow != NULL, FALSE);
	_tmp0_ = scratch_dialogs_branch_name_row_get_branch_name (G_TYPE_CHECK_INSTANCE_CAST (listboxrow, SCRATCH_DIALOGS_TYPE_BRANCH_NAME_ROW, ScratchDialogsBranchNameRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->search_entry;
	_tmp3_ = gtk_entry_get_text ((GtkEntry*) _tmp2_);
	_tmp4_ = _tmp3_;
	result = string_contains (_tmp1_, _tmp4_);
	return result;
}

static gboolean
__scratch_dialogs_branch_list_box___lambda104__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                         gpointer self)
{
	gboolean result;
	result = _scratch_dialogs_branch_list_box___lambda104_ ((ScratchDialogsBranchListBox*) self, row);
	return result;
}

static void
_scratch_dialogs_branch_list_box___lambda105_ (ScratchDialogsBranchListBox* self)
{
	GtkListBox* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_tmp0_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp0_);
	_tmp1_ = scratch_dialogs_branch_list_box_get_text (self);
	_tmp2_ = _tmp1_;
	g_signal_emit (self, scratch_dialogs_branch_list_box_signals[SCRATCH_DIALOGS_BRANCH_LIST_BOX_BRANCH_CHANGED_SIGNAL], 0, _tmp2_);
}

static void
__scratch_dialogs_branch_list_box___lambda105__gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self)
{
	_scratch_dialogs_branch_list_box___lambda105_ ((ScratchDialogsBranchListBox*) self);
}

static void
_scratch_dialogs_branch_list_box___lambda106_ (ScratchDialogsBranchListBox* self)
{
	ScratchDialogsBranchActionDialog* _tmp0_;
	_tmp0_ = self->priv->_dialog;
	g_signal_emit_by_name (_tmp0_, "page-activated");
}

static void
__scratch_dialogs_branch_list_box___lambda106__gtk_entry_activate (GtkEntry* _sender,
                                                                   gpointer self)
{
	_scratch_dialogs_branch_list_box___lambda106_ ((ScratchDialogsBranchListBox*) self);
}

static GObject *
scratch_dialogs_branch_list_box_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ScratchDialogsBranchListBox * self;
	GtkListBox* _tmp0_ = NULL;
	GtkScrolledWindow* scrolled_window = NULL;
	GtkScrolledWindow* _tmp1_ = NULL;
	GtkScrolledWindow* _tmp2_;
	GtkListBox* _tmp3_;
	gchar* _tmp4_;
	GtkSearchEntry* _tmp5_ = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp6_;
	GtkBox* _tmp7_;
	GtkSearchEntry* _tmp8_;
	GtkBox* _tmp9_;
	GtkScrolledWindow* _tmp10_;
	GtkBox* _tmp11_;
	GraniteHeaderLabel* _tmp12_;
	GraniteHeaderLabel* _tmp13_;
	GraniteHeaderLabel* _tmp14_;
	GeeArrayList* branch_refs = NULL;
	ScratchDialogsBranchActionDialog* _tmp15_;
	ScratchFolderManagerProjectFolderItem* _tmp16_;
	ScratchFolderManagerProjectFolderItem* _tmp17_;
	GeeArrayList* _tmp18_;
	GtkListBox* _tmp39_;
	GtkListBox* _tmp40_;
	GtkListBox* _tmp41_;
	GtkListBox* _tmp42_;
	GtkListBox* _tmp43_;
	GtkSearchEntry* _tmp44_;
	GtkSearchEntry* _tmp45_;
	parent_class = G_OBJECT_CLASS (scratch_dialogs_branch_list_box_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, ScratchDialogsBranchListBox);
	_tmp0_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_activate_on_single_click (_tmp0_, FALSE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->list_box);
	self->priv->list_box = _tmp0_;
	_tmp1_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_set (_tmp1_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (_tmp1_, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	gtk_scrolled_window_set_min_content_height (_tmp1_, 200);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp1_, TRUE);
	g_object_ref_sink (_tmp1_);
	scrolled_window = _tmp1_;
	_tmp2_ = scrolled_window;
	_tmp3_ = self->priv->list_box;
	g_object_set ((GtkContainer*) _tmp2_, "child", (GtkWidget*) _tmp3_, NULL);
	_tmp4_ = g_strdup (_ ("Enter search term"));
	_tmp5_ = (GtkSearchEntry*) gtk_search_entry_new ();
	gtk_entry_set_placeholder_text ((GtkEntry*) _tmp5_, _tmp4_);
	_g_free0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->search_entry);
	self->priv->search_entry = _tmp5_;
	_tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	g_object_ref_sink (_tmp6_);
	box = _tmp6_;
	_tmp7_ = box;
	_tmp8_ = self->priv->search_entry;
	gtk_container_add ((GtkContainer*) _tmp7_, (GtkWidget*) _tmp8_);
	_tmp9_ = box;
	_tmp10_ = scrolled_window;
	gtk_container_add ((GtkContainer*) _tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = box;
	g_object_set ((GtkContainer*) self, "child", (GtkWidget*) _tmp11_, NULL);
	_tmp12_ = granite_header_label_new (_ ("Recent Branches"));
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->recent_header);
	self->priv->recent_header = (GtkLabel*) _tmp12_;
	_tmp13_ = granite_header_label_new (_ ("Local Branches"));
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->local_header);
	self->priv->local_header = (GtkLabel*) _tmp13_;
	_tmp14_ = granite_header_label_new (_ ("Remote Branches"));
	g_object_ref_sink (_tmp14_);
	_g_object_unref0 (self->priv->remote_header);
	self->priv->remote_header = (GtkLabel*) _tmp14_;
	_tmp15_ = self->priv->_dialog;
	_tmp16_ = scratch_dialogs_branch_action_dialog_get_project (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = scratch_folder_manager_project_folder_item_get_all_branch_refs (_tmp17_);
	branch_refs = _tmp18_;
	{
		GeeArrayList* _branch_ref_list = NULL;
		GeeArrayList* _tmp19_;
		gint _branch_ref_size = 0;
		GeeArrayList* _tmp20_;
		gint _tmp21_;
		gint _tmp22_;
		gint _branch_ref_index = 0;
		_tmp19_ = branch_refs;
		_branch_ref_list = _tmp19_;
		_tmp20_ = _branch_ref_list;
		_tmp21_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp20_);
		_tmp22_ = _tmp21_;
		_branch_ref_size = _tmp22_;
		_branch_ref_index = -1;
		while (TRUE) {
			gint _tmp23_;
			gint _tmp24_;
			GgitRef* branch_ref = NULL;
			GeeArrayList* _tmp25_;
			gpointer _tmp26_;
			gboolean _tmp27_ = FALSE;
			GgitRef* _tmp28_;
			_branch_ref_index = _branch_ref_index + 1;
			_tmp23_ = _branch_ref_index;
			_tmp24_ = _branch_ref_size;
			if (!(_tmp23_ < _tmp24_)) {
				break;
			}
			_tmp25_ = _branch_ref_list;
			_tmp26_ = gee_abstract_list_get ((GeeAbstractList*) _tmp25_, _branch_ref_index);
			branch_ref = (GgitRef*) _tmp26_;
			_tmp28_ = branch_ref;
			if (ggit_ref_is_branch (_tmp28_)) {
				_tmp27_ = TRUE;
			} else {
				gboolean _tmp29_;
				_tmp29_ = self->priv->_show_remotes;
				_tmp27_ = _tmp29_;
			}
			if (_tmp27_) {
				ScratchDialogsBranchNameRow* row = NULL;
				GgitRef* _tmp30_;
				ScratchDialogsBranchNameRow* _tmp31_;
				ScratchDialogsBranchActionDialog* _tmp32_;
				ScratchFolderManagerProjectFolderItem* _tmp33_;
				ScratchFolderManagerProjectFolderItem* _tmp34_;
				GgitRef* _tmp35_;
				GtkListBox* _tmp37_;
				ScratchDialogsBranchNameRow* _tmp38_;
				_tmp30_ = branch_ref;
				_tmp31_ = scratch_dialogs_branch_name_row_new (_tmp30_);
				g_object_ref_sink (_tmp31_);
				row = _tmp31_;
				_tmp32_ = self->priv->_dialog;
				_tmp33_ = scratch_dialogs_branch_action_dialog_get_project (_tmp32_);
				_tmp34_ = _tmp33_;
				_tmp35_ = branch_ref;
				if (scratch_folder_manager_project_folder_item_is_recent_ref (_tmp34_, _tmp35_)) {
					ScratchDialogsBranchNameRow* _tmp36_;
					_tmp36_ = row;
					scratch_dialogs_branch_name_row_set_is_recent (_tmp36_, TRUE);
				}
				_tmp37_ = self->priv->list_box;
				_tmp38_ = row;
				gtk_container_add ((GtkContainer*) _tmp37_, (GtkWidget*) _tmp38_);
				_g_object_unref0 (row);
			}
			_g_object_unref0 (branch_ref);
		}
	}
	_tmp39_ = self->priv->list_box;
	gtk_list_box_set_sort_func (_tmp39_, _scratch_dialogs_branch_list_box_listbox_sort_func_gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	_tmp40_ = self->priv->list_box;
	gtk_list_box_set_header_func (_tmp40_, _scratch_dialogs_branch_list_box_listbox_header_func_gtk_list_box_update_header_func, g_object_ref (self), g_object_unref);
	_tmp41_ = self->priv->list_box;
	g_signal_connect_object (_tmp41_, "row-selected", (GCallback) __scratch_dialogs_branch_list_box___lambda102__gtk_list_box_row_selected, self, 0);
	_tmp42_ = self->priv->list_box;
	g_signal_connect_object (_tmp42_, "row-activated", (GCallback) __scratch_dialogs_branch_list_box___lambda103__gtk_list_box_row_activated, self, 0);
	_tmp43_ = self->priv->list_box;
	gtk_list_box_set_filter_func (_tmp43_, __scratch_dialogs_branch_list_box___lambda104__gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
	_tmp44_ = self->priv->search_entry;
	g_signal_connect_object ((GtkEditable*) _tmp44_, "changed", (GCallback) __scratch_dialogs_branch_list_box___lambda105__gtk_editable_changed, self, 0);
	_tmp45_ = self->priv->search_entry;
	g_signal_connect_object ((GtkEntry*) _tmp45_, "activate", (GCallback) __scratch_dialogs_branch_list_box___lambda106__gtk_entry_activate, self, 0);
	_g_object_unref0 (branch_refs);
	_g_object_unref0 (box);
	_g_object_unref0 (scrolled_window);
	return obj;
}

static void
scratch_dialogs_branch_list_box_class_init (ScratchDialogsBranchListBoxClass * klass,
                                            gpointer klass_data)
{
	scratch_dialogs_branch_list_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ScratchDialogsBranchListBox_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_scratch_dialogs_branch_list_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_scratch_dialogs_branch_list_box_set_property;
	G_OBJECT_CLASS (klass)->constructor = scratch_dialogs_branch_list_box_constructor;
	G_OBJECT_CLASS (klass)->finalize = scratch_dialogs_branch_list_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCRATCH_DIALOGS_BRANCH_LIST_BOX_TEXT_PROPERTY, scratch_dialogs_branch_list_box_properties[SCRATCH_DIALOGS_BRANCH_LIST_BOX_TEXT_PROPERTY] = g_param_spec_string ("text", "text", "text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCRATCH_DIALOGS_BRANCH_LIST_BOX_SHOW_REMOTES_PROPERTY, scratch_dialogs_branch_list_box_properties[SCRATCH_DIALOGS_BRANCH_LIST_BOX_SHOW_REMOTES_PROPERTY] = g_param_spec_boolean ("show-remotes", "show-remotes", "show-remotes", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCRATCH_DIALOGS_BRANCH_LIST_BOX_DIALOG_PROPERTY, scratch_dialogs_branch_list_box_properties[SCRATCH_DIALOGS_BRANCH_LIST_BOX_DIALOG_PROPERTY] = g_param_spec_object ("dialog", "dialog", "dialog", SCRATCH_DIALOGS_TYPE_BRANCH_ACTION_DIALOG, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	scratch_dialogs_branch_list_box_signals[SCRATCH_DIALOGS_BRANCH_LIST_BOX_BRANCH_CHANGED_SIGNAL] = g_signal_new ("branch-changed", SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
scratch_dialogs_branch_list_box_instance_init (ScratchDialogsBranchListBox * self,
                                               gpointer klass)
{
	self->priv = scratch_dialogs_branch_list_box_get_instance_private (self);
}

static void
scratch_dialogs_branch_list_box_finalize (GObject * obj)
{
	ScratchDialogsBranchListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, ScratchDialogsBranchListBox);
	_g_object_unref0 (self->priv->_dialog);
	_g_object_unref0 (self->priv->list_box);
	_g_object_unref0 (self->priv->search_entry);
	_g_object_unref0 (self->priv->local_header);
	_g_object_unref0 (self->priv->remote_header);
	_g_object_unref0 (self->priv->recent_header);
	G_OBJECT_CLASS (scratch_dialogs_branch_list_box_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
scratch_dialogs_branch_list_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScratchDialogsBranchListBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) scratch_dialogs_branch_list_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScratchDialogsBranchListBox), 0, (GInstanceInitFunc) scratch_dialogs_branch_list_box_instance_init, NULL };
	GType scratch_dialogs_branch_list_box_type_id;
	scratch_dialogs_branch_list_box_type_id = g_type_register_static (gtk_bin_get_type (), "ScratchDialogsBranchListBox", &g_define_type_info, G_TYPE_FLAG_NONE);
	ScratchDialogsBranchListBox_private_offset = g_type_add_instance_private (scratch_dialogs_branch_list_box_type_id, sizeof (ScratchDialogsBranchListBoxPrivate));
	return scratch_dialogs_branch_list_box_type_id;
}

GType
scratch_dialogs_branch_list_box_get_type (void)
{
	static gsize scratch_dialogs_branch_list_box_type_id__once = 0;
	if (g_once_init_enter (&scratch_dialogs_branch_list_box_type_id__once)) {
		GType scratch_dialogs_branch_list_box_type_id;
		scratch_dialogs_branch_list_box_type_id = scratch_dialogs_branch_list_box_get_type_once ();
		g_once_init_leave (&scratch_dialogs_branch_list_box_type_id__once, scratch_dialogs_branch_list_box_type_id);
	}
	return scratch_dialogs_branch_list_box_type_id__once;
}

static void
_vala_scratch_dialogs_branch_list_box_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	ScratchDialogsBranchListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, ScratchDialogsBranchListBox);
	switch (property_id) {
		case SCRATCH_DIALOGS_BRANCH_LIST_BOX_TEXT_PROPERTY:
		g_value_set_string (value, scratch_dialogs_branch_list_box_get_text (self));
		break;
		case SCRATCH_DIALOGS_BRANCH_LIST_BOX_SHOW_REMOTES_PROPERTY:
		g_value_set_boolean (value, scratch_dialogs_branch_list_box_get_show_remotes (self));
		break;
		case SCRATCH_DIALOGS_BRANCH_LIST_BOX_DIALOG_PROPERTY:
		g_value_set_object (value, scratch_dialogs_branch_list_box_get_dialog (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_scratch_dialogs_branch_list_box_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	ScratchDialogsBranchListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCRATCH_DIALOGS_TYPE_BRANCH_LIST_BOX, ScratchDialogsBranchListBox);
	switch (property_id) {
		case SCRATCH_DIALOGS_BRANCH_LIST_BOX_SHOW_REMOTES_PROPERTY:
		scratch_dialogs_branch_list_box_set_show_remotes (self, g_value_get_boolean (value));
		break;
		case SCRATCH_DIALOGS_BRANCH_LIST_BOX_DIALOG_PROPERTY:
		scratch_dialogs_branch_list_box_set_dialog (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

