/* BranchCheckoutPage.c generated by valac 0.56.19, the Vala compiler
 * generated from BranchCheckoutPage.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 <libgit2-glib/ggit.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <granite.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
#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 SCRATCH_TYPE_BRANCH_ACTION_PAGE (scratch_branch_action_page_get_type ())
#define SCRATCH_BRANCH_ACTION_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_TYPE_BRANCH_ACTION_PAGE, ScratchBranchActionPage))
#define SCRATCH_IS_BRANCH_ACTION_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_TYPE_BRANCH_ACTION_PAGE))
#define SCRATCH_BRANCH_ACTION_PAGE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SCRATCH_TYPE_BRANCH_ACTION_PAGE, ScratchBranchActionPageIface))

typedef struct _ScratchBranchActionPage ScratchBranchActionPage;
typedef struct _ScratchBranchActionPageIface ScratchBranchActionPageIface;
typedef enum  {
	SCRATCH_BRANCH_ACTION_CHECKOUT,
	SCRATCH_BRANCH_ACTION_COMMIT,
	SCRATCH_BRANCH_ACTION_PUSH,
	SCRATCH_BRANCH_ACTION_PULL,
	SCRATCH_BRANCH_ACTION_MERGE,
	SCRATCH_BRANCH_ACTION_DELETE,
	SCRATCH_BRANCH_ACTION_CREATE
} ScratchBranchAction;

#define SCRATCH_TYPE_BRANCH_ACTION (scratch_branch_action_get_type ())

#define SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE (scratch_dialogs_branch_checkout_page_get_type ())
#define SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE, ScratchDialogsBranchCheckoutPage))
#define SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE, ScratchDialogsBranchCheckoutPageClass))
#define SCRATCH_DIALOGS_IS_BRANCH_CHECKOUT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE))
#define SCRATCH_DIALOGS_IS_BRANCH_CHECKOUT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE))
#define SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE, ScratchDialogsBranchCheckoutPageClass))

typedef struct _ScratchDialogsBranchCheckoutPage ScratchDialogsBranchCheckoutPage;
typedef struct _ScratchDialogsBranchCheckoutPageClass ScratchDialogsBranchCheckoutPageClass;
typedef struct _ScratchDialogsBranchCheckoutPagePrivate ScratchDialogsBranchCheckoutPagePrivate;

#define SCRATCH_DIALOGS_TYPE_BRANCH_ACTION_DIALOG (scratch_dialogs_branch_action_dialog_get_type ())
#define SCRATCH_DIALOGS_BRANCH_ACTION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_ACTION_DIALOG, ScratchDialogsBranchActionDialog))
#define SCRATCH_DIALOGS_BRANCH_ACTION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_DIALOGS_TYPE_BRANCH_ACTION_DIALOG, ScratchDialogsBranchActionDialogClass))
#define SCRATCH_DIALOGS_IS_BRANCH_ACTION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_ACTION_DIALOG))
#define SCRATCH_DIALOGS_IS_BRANCH_ACTION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_DIALOGS_TYPE_BRANCH_ACTION_DIALOG))
#define SCRATCH_DIALOGS_BRANCH_ACTION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_DIALOGS_TYPE_BRANCH_ACTION_DIALOG, ScratchDialogsBranchActionDialogClass))

typedef struct _ScratchDialogsBranchActionDialog ScratchDialogsBranchActionDialog;
typedef struct _ScratchDialogsBranchActionDialogClass ScratchDialogsBranchActionDialogClass;

#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;
enum  {
	SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_0_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_ACTION_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_BRANCH_REF_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_NEW_BRANCH_NAME_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_DIALOG_PROPERTY,
	SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_NUM_PROPERTIES
};
static GParamSpec* scratch_dialogs_branch_checkout_page_properties[SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_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 CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM (code_widgets_source_list_item_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItem))
#define CODE_WIDGETS_SOURCE_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItemClass))
#define CODE_WIDGETS_SOURCE_LIST_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM))
#define CODE_WIDGETS_SOURCE_LIST_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM))
#define CODE_WIDGETS_SOURCE_LIST_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItemClass))

typedef struct _CodeWidgetsSourceListItem CodeWidgetsSourceListItem;
typedef struct _CodeWidgetsSourceListItemClass CodeWidgetsSourceListItemClass;

#define CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM (code_widgets_source_list_expandable_item_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem))
#define CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItemClass))
#define CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM))
#define CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM))
#define CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItemClass))

typedef struct _CodeWidgetsSourceListExpandableItem CodeWidgetsSourceListExpandableItem;
typedef struct _CodeWidgetsSourceListExpandableItemClass CodeWidgetsSourceListExpandableItemClass;

#define SCRATCH_FOLDER_MANAGER_TYPE_ITEM (scratch_folder_manager_item_get_type ())
#define SCRATCH_FOLDER_MANAGER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_FOLDER_MANAGER_TYPE_ITEM, ScratchFolderManagerItem))
#define SCRATCH_FOLDER_MANAGER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_FOLDER_MANAGER_TYPE_ITEM, ScratchFolderManagerItemClass))
#define SCRATCH_FOLDER_MANAGER_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_FOLDER_MANAGER_TYPE_ITEM))
#define SCRATCH_FOLDER_MANAGER_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_FOLDER_MANAGER_TYPE_ITEM))
#define SCRATCH_FOLDER_MANAGER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_FOLDER_MANAGER_TYPE_ITEM, ScratchFolderManagerItemClass))

typedef struct _ScratchFolderManagerItem ScratchFolderManagerItem;
typedef struct _ScratchFolderManagerItemClass ScratchFolderManagerItemClass;

#define SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM (scratch_folder_manager_folder_item_get_type ())
#define SCRATCH_FOLDER_MANAGER_FOLDER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM, ScratchFolderManagerFolderItem))
#define SCRATCH_FOLDER_MANAGER_FOLDER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM, ScratchFolderManagerFolderItemClass))
#define SCRATCH_FOLDER_MANAGER_IS_FOLDER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM))
#define SCRATCH_FOLDER_MANAGER_IS_FOLDER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM))
#define SCRATCH_FOLDER_MANAGER_FOLDER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM, ScratchFolderManagerFolderItemClass))

typedef struct _ScratchFolderManagerFolderItem ScratchFolderManagerFolderItem;
typedef struct _ScratchFolderManagerFolderItemClass ScratchFolderManagerFolderItemClass;

#define SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM (scratch_folder_manager_project_folder_item_get_type ())
#define SCRATCH_FOLDER_MANAGER_PROJECT_FOLDER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM, ScratchFolderManagerProjectFolderItem))
#define SCRATCH_FOLDER_MANAGER_PROJECT_FOLDER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM, ScratchFolderManagerProjectFolderItemClass))
#define SCRATCH_FOLDER_MANAGER_IS_PROJECT_FOLDER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM))
#define SCRATCH_FOLDER_MANAGER_IS_PROJECT_FOLDER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM))
#define SCRATCH_FOLDER_MANAGER_PROJECT_FOLDER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM, ScratchFolderManagerProjectFolderItemClass))

typedef struct _ScratchFolderManagerProjectFolderItem ScratchFolderManagerProjectFolderItem;
typedef struct _ScratchFolderManagerProjectFolderItemClass ScratchFolderManagerProjectFolderItemClass;

struct _ScratchBranchActionPageIface {
	GTypeInterface parent_iface;
	void (*focus_start_widget) (ScratchBranchActionPage* self);
	ScratchBranchAction (*get_action) (ScratchBranchActionPage* self);
	GgitRef* (*get_branch_ref) (ScratchBranchActionPage* self);
	const gchar* (*get_new_branch_name) (ScratchBranchActionPage* self);
};

struct _ScratchDialogsBranchCheckoutPage {
	GtkBox parent_instance;
	ScratchDialogsBranchCheckoutPagePrivate * priv;
};

struct _ScratchDialogsBranchCheckoutPageClass {
	GtkBoxClass parent_class;
};

struct _ScratchDialogsBranchCheckoutPagePrivate {
	ScratchDialogsBranchActionDialog* _dialog;
	ScratchDialogsBranchListBox* list_box;
};

static gint ScratchDialogsBranchCheckoutPage_private_offset;
static gpointer scratch_dialogs_branch_checkout_page_parent_class = NULL;
static ScratchBranchActionPageIface * scratch_dialogs_branch_checkout_page_scratch_branch_action_page_parent_iface = NULL;

VALA_EXTERN GType scratch_branch_action_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType scratch_branch_action_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchBranchActionPage, g_object_unref)
VALA_EXTERN GType scratch_dialogs_branch_checkout_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchDialogsBranchCheckoutPage, g_object_unref)
VALA_EXTERN GType scratch_dialogs_branch_action_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchDialogsBranchActionDialog, g_object_unref)
VALA_EXTERN GType scratch_dialogs_branch_list_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchDialogsBranchListBox, g_object_unref)
VALA_EXTERN ScratchDialogsBranchCheckoutPage* scratch_dialogs_branch_checkout_page_new (ScratchDialogsBranchActionDialog* dialog);
VALA_EXTERN ScratchDialogsBranchCheckoutPage* scratch_dialogs_branch_checkout_page_construct (GType object_type,
                                                                                  ScratchDialogsBranchActionDialog* dialog);
static void scratch_dialogs_branch_checkout_page_real_focus_start_widget (ScratchBranchActionPage* base);
VALA_EXTERN void scratch_dialogs_branch_list_box_grab_focus (ScratchDialogsBranchListBox* self);
VALA_EXTERN GType scratch_dialogs_branch_name_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchDialogsBranchNameRow, g_object_unref)
VALA_EXTERN ScratchDialogsBranchNameRow* scratch_dialogs_branch_list_box_get_selected_row (ScratchDialogsBranchListBox* self);
VALA_EXTERN GgitRef* scratch_dialogs_branch_name_row_get_bref (ScratchDialogsBranchNameRow* self);
VALA_EXTERN ScratchDialogsBranchActionDialog* scratch_dialogs_branch_checkout_page_get_dialog (ScratchDialogsBranchCheckoutPage* self);
static void scratch_dialogs_branch_checkout_page_set_dialog (ScratchDialogsBranchCheckoutPage* self,
                                                      ScratchDialogsBranchActionDialog* value);
static GObject * scratch_dialogs_branch_checkout_page_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties);
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);
static void _scratch_dialogs_branch_checkout_page___lambda107_ (ScratchDialogsBranchCheckoutPage* self,
                                                         const gchar* text);
VALA_EXTERN GType code_widgets_source_list_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CodeWidgetsSourceListItem, g_object_unref)
VALA_EXTERN GType code_widgets_source_list_expandable_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CodeWidgetsSourceListExpandableItem, g_object_unref)
VALA_EXTERN GType scratch_folder_manager_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchFolderManagerItem, g_object_unref)
VALA_EXTERN GType scratch_folder_manager_folder_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchFolderManagerFolderItem, g_object_unref)
VALA_EXTERN GType scratch_folder_manager_project_folder_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchFolderManagerProjectFolderItem, g_object_unref)
VALA_EXTERN ScratchFolderManagerProjectFolderItem* scratch_dialogs_branch_action_dialog_get_project (ScratchDialogsBranchActionDialog* self);
VALA_EXTERN gboolean scratch_folder_manager_project_folder_item_has_branch_name (ScratchFolderManagerProjectFolderItem* self,
                                                                     const gchar* name,
                                                                     gboolean* found_is_remote);
VALA_EXTERN void scratch_dialogs_branch_action_dialog_set_can_apply (ScratchDialogsBranchActionDialog* self,
                                                         gboolean value);
static void __scratch_dialogs_branch_checkout_page___lambda107__scratch_dialogs_branch_list_box_branch_changed (ScratchDialogsBranchListBox* _sender,
                                                                                                         const gchar* branch_name,
                                                                                                         gpointer self);
VALA_EXTERN void scratch_branch_action_page_focus_start_widget (ScratchBranchActionPage* self);
VALA_EXTERN ScratchBranchAction scratch_branch_action_page_get_action (ScratchBranchActionPage* self);
VALA_EXTERN GgitRef* scratch_branch_action_page_get_branch_ref (ScratchBranchActionPage* self);
VALA_EXTERN const gchar* scratch_branch_action_page_get_new_branch_name (ScratchBranchActionPage* self);
static void scratch_dialogs_branch_checkout_page_finalize (GObject * obj);
static GType scratch_dialogs_branch_checkout_page_get_type_once (void);
static void _vala_scratch_dialogs_branch_checkout_page_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_scratch_dialogs_branch_checkout_page_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);

static inline gpointer
scratch_dialogs_branch_checkout_page_get_instance_private (ScratchDialogsBranchCheckoutPage* self)
{
	return G_STRUCT_MEMBER_P (self, ScratchDialogsBranchCheckoutPage_private_offset);
}

ScratchDialogsBranchCheckoutPage*
scratch_dialogs_branch_checkout_page_construct (GType object_type,
                                                ScratchDialogsBranchActionDialog* dialog)
{
	ScratchDialogsBranchCheckoutPage * self = NULL;
	g_return_val_if_fail (dialog != NULL, NULL);
	self = (ScratchDialogsBranchCheckoutPage*) g_object_new (object_type, "dialog", dialog, NULL);
	return self;
}

ScratchDialogsBranchCheckoutPage*
scratch_dialogs_branch_checkout_page_new (ScratchDialogsBranchActionDialog* dialog)
{
	return scratch_dialogs_branch_checkout_page_construct (SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE, dialog);
}

static void
scratch_dialogs_branch_checkout_page_real_focus_start_widget (ScratchBranchActionPage* base)
{
	ScratchDialogsBranchCheckoutPage * self;
	ScratchDialogsBranchListBox* _tmp0_;
	self = (ScratchDialogsBranchCheckoutPage*) base;
	_tmp0_ = self->priv->list_box;
	scratch_dialogs_branch_list_box_grab_focus (_tmp0_);
}

static ScratchBranchAction
scratch_dialogs_branch_checkout_page_real_get_action (ScratchBranchActionPage* base)
{
	ScratchBranchAction result;
	ScratchDialogsBranchCheckoutPage* self;
	self = (ScratchDialogsBranchCheckoutPage*) base;
	result = SCRATCH_BRANCH_ACTION_CHECKOUT;
	return result;
}

static GgitRef*
scratch_dialogs_branch_checkout_page_real_get_branch_ref (ScratchBranchActionPage* base)
{
	GgitRef* result;
	ScratchDialogsBranchCheckoutPage* self;
	ScratchDialogsBranchListBox* _tmp0_;
	ScratchDialogsBranchNameRow* _tmp1_;
	ScratchDialogsBranchNameRow* _tmp2_;
	GgitRef* _tmp3_;
	GgitRef* _tmp4_;
	GgitRef* _tmp5_;
	self = (ScratchDialogsBranchCheckoutPage*) base;
	_tmp0_ = self->priv->list_box;
	_tmp1_ = scratch_dialogs_branch_list_box_get_selected_row (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = scratch_dialogs_branch_name_row_get_bref (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	result = _tmp5_;
	return result;
}

static const gchar*
scratch_dialogs_branch_checkout_page_real_get_new_branch_name (ScratchBranchActionPage* base)
{
	const gchar* result;
	ScratchDialogsBranchCheckoutPage* self;
	self = (ScratchDialogsBranchCheckoutPage*) base;
	result = "";
	return result;
}

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

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

static void
scratch_dialogs_branch_checkout_page_set_dialog (ScratchDialogsBranchCheckoutPage* self,
                                                 ScratchDialogsBranchActionDialog* value)
{
	ScratchDialogsBranchActionDialog* old_value;
	g_return_if_fail (self != NULL);
	old_value = scratch_dialogs_branch_checkout_page_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_checkout_page_properties[SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_DIALOG_PROPERTY]);
	}
}

static void
_scratch_dialogs_branch_checkout_page___lambda107_ (ScratchDialogsBranchCheckoutPage* self,
                                                    const gchar* text)
{
	ScratchDialogsBranchActionDialog* _tmp0_;
	ScratchDialogsBranchActionDialog* _tmp1_;
	ScratchFolderManagerProjectFolderItem* _tmp2_;
	ScratchFolderManagerProjectFolderItem* _tmp3_;
	g_return_if_fail (text != NULL);
	_tmp0_ = self->priv->_dialog;
	_tmp1_ = self->priv->_dialog;
	_tmp2_ = scratch_dialogs_branch_action_dialog_get_project (_tmp1_);
	_tmp3_ = _tmp2_;
	scratch_dialogs_branch_action_dialog_set_can_apply (_tmp0_, scratch_folder_manager_project_folder_item_has_branch_name (_tmp3_, text, NULL));
}

static void
__scratch_dialogs_branch_checkout_page___lambda107__scratch_dialogs_branch_list_box_branch_changed (ScratchDialogsBranchListBox* _sender,
                                                                                                    const gchar* branch_name,
                                                                                                    gpointer self)
{
	_scratch_dialogs_branch_checkout_page___lambda107_ ((ScratchDialogsBranchCheckoutPage*) self, branch_name);
}

static GObject *
scratch_dialogs_branch_checkout_page_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ScratchDialogsBranchCheckoutPage * self;
	ScratchDialogsBranchActionDialog* _tmp0_;
	ScratchDialogsBranchListBox* _tmp1_;
	ScratchDialogsBranchListBox* _tmp2_;
	ScratchDialogsBranchListBox* _tmp3_;
	parent_class = G_OBJECT_CLASS (scratch_dialogs_branch_checkout_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE, ScratchDialogsBranchCheckoutPage);
	_tmp0_ = self->priv->_dialog;
	_tmp1_ = scratch_dialogs_branch_list_box_new (_tmp0_, TRUE);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->list_box);
	self->priv->list_box = _tmp1_;
	_tmp2_ = self->priv->list_box;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp2_);
	_tmp3_ = self->priv->list_box;
	g_signal_connect_object (_tmp3_, "branch-changed", (GCallback) __scratch_dialogs_branch_checkout_page___lambda107__scratch_dialogs_branch_list_box_branch_changed, self, 0);
	return obj;
}

static void
scratch_dialogs_branch_checkout_page_class_init (ScratchDialogsBranchCheckoutPageClass * klass,
                                                 gpointer klass_data)
{
	scratch_dialogs_branch_checkout_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ScratchDialogsBranchCheckoutPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_scratch_dialogs_branch_checkout_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_scratch_dialogs_branch_checkout_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = scratch_dialogs_branch_checkout_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = scratch_dialogs_branch_checkout_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_ACTION_PROPERTY, scratch_dialogs_branch_checkout_page_properties[SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_ACTION_PROPERTY] = g_param_spec_enum ("action", "action", "action", SCRATCH_TYPE_BRANCH_ACTION, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_BRANCH_REF_PROPERTY, scratch_dialogs_branch_checkout_page_properties[SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_BRANCH_REF_PROPERTY] = g_param_spec_object ("branch-ref", "branch-ref", "branch-ref", ggit_ref_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_NEW_BRANCH_NAME_PROPERTY, scratch_dialogs_branch_checkout_page_properties[SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_NEW_BRANCH_NAME_PROPERTY] = g_param_spec_string ("new-branch-name", "new-branch-name", "new-branch-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_DIALOG_PROPERTY, scratch_dialogs_branch_checkout_page_properties[SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_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));
}

static void
scratch_dialogs_branch_checkout_page_scratch_branch_action_page_interface_init (ScratchBranchActionPageIface * iface,
                                                                                gpointer iface_data)
{
	scratch_dialogs_branch_checkout_page_scratch_branch_action_page_parent_iface = g_type_interface_peek_parent (iface);
	iface->focus_start_widget = (void (*) (ScratchBranchActionPage*)) scratch_dialogs_branch_checkout_page_real_focus_start_widget;
	iface->get_action = scratch_dialogs_branch_checkout_page_real_get_action;
	iface->get_branch_ref = scratch_dialogs_branch_checkout_page_real_get_branch_ref;
	iface->get_new_branch_name = scratch_dialogs_branch_checkout_page_real_get_new_branch_name;
}

static void
scratch_dialogs_branch_checkout_page_instance_init (ScratchDialogsBranchCheckoutPage * self,
                                                    gpointer klass)
{
	self->priv = scratch_dialogs_branch_checkout_page_get_instance_private (self);
}

static void
scratch_dialogs_branch_checkout_page_finalize (GObject * obj)
{
	ScratchDialogsBranchCheckoutPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE, ScratchDialogsBranchCheckoutPage);
	_g_object_unref0 (self->priv->_dialog);
	_g_object_unref0 (self->priv->list_box);
	G_OBJECT_CLASS (scratch_dialogs_branch_checkout_page_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
scratch_dialogs_branch_checkout_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScratchDialogsBranchCheckoutPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) scratch_dialogs_branch_checkout_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScratchDialogsBranchCheckoutPage), 0, (GInstanceInitFunc) scratch_dialogs_branch_checkout_page_instance_init, NULL };
	static const GInterfaceInfo scratch_branch_action_page_info = { (GInterfaceInitFunc) scratch_dialogs_branch_checkout_page_scratch_branch_action_page_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType scratch_dialogs_branch_checkout_page_type_id;
	scratch_dialogs_branch_checkout_page_type_id = g_type_register_static (gtk_box_get_type (), "ScratchDialogsBranchCheckoutPage", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (scratch_dialogs_branch_checkout_page_type_id, SCRATCH_TYPE_BRANCH_ACTION_PAGE, &scratch_branch_action_page_info);
	ScratchDialogsBranchCheckoutPage_private_offset = g_type_add_instance_private (scratch_dialogs_branch_checkout_page_type_id, sizeof (ScratchDialogsBranchCheckoutPagePrivate));
	return scratch_dialogs_branch_checkout_page_type_id;
}

GType
scratch_dialogs_branch_checkout_page_get_type (void)
{
	static gsize scratch_dialogs_branch_checkout_page_type_id__once = 0;
	if (g_once_init_enter (&scratch_dialogs_branch_checkout_page_type_id__once)) {
		GType scratch_dialogs_branch_checkout_page_type_id;
		scratch_dialogs_branch_checkout_page_type_id = scratch_dialogs_branch_checkout_page_get_type_once ();
		g_once_init_leave (&scratch_dialogs_branch_checkout_page_type_id__once, scratch_dialogs_branch_checkout_page_type_id);
	}
	return scratch_dialogs_branch_checkout_page_type_id__once;
}

static void
_vala_scratch_dialogs_branch_checkout_page_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	ScratchDialogsBranchCheckoutPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE, ScratchDialogsBranchCheckoutPage);
	switch (property_id) {
		case SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_ACTION_PROPERTY:
		g_value_set_enum (value, scratch_branch_action_page_get_action ((ScratchBranchActionPage*) self));
		break;
		case SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_BRANCH_REF_PROPERTY:
		g_value_set_object (value, scratch_branch_action_page_get_branch_ref ((ScratchBranchActionPage*) self));
		break;
		case SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_NEW_BRANCH_NAME_PROPERTY:
		g_value_set_string (value, scratch_branch_action_page_get_new_branch_name ((ScratchBranchActionPage*) self));
		break;
		case SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_DIALOG_PROPERTY:
		g_value_set_object (value, scratch_dialogs_branch_checkout_page_get_dialog (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_scratch_dialogs_branch_checkout_page_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	ScratchDialogsBranchCheckoutPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCRATCH_DIALOGS_TYPE_BRANCH_CHECKOUT_PAGE, ScratchDialogsBranchCheckoutPage);
	switch (property_id) {
		case SCRATCH_DIALOGS_BRANCH_CHECKOUT_PAGE_DIALOG_PROPERTY:
		scratch_dialogs_branch_checkout_page_set_dialog (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

