/* gitg-commit-action-create-branch.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-commit-action-create-branch.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2014 - Jesse van den Kieboom
 *
 * 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 <glib-object.h>
#include "libgitg-ext.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "libgitg.h"
#include "config.h"
#include <gtk/gtk.h>
#include <libgit2-glib/ggit.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>

#define GITG_COMMIT_ACTION_CREATE_BRANCH_version VERSION
#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_COMMIT_ACTION_CREATE_BRANCH (gitg_commit_action_create_branch_get_type ())
#define GITG_COMMIT_ACTION_CREATE_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranch))
#define GITG_COMMIT_ACTION_CREATE_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranchClass))
#define GITG_IS_COMMIT_ACTION_CREATE_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH))
#define GITG_IS_COMMIT_ACTION_CREATE_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH))
#define GITG_COMMIT_ACTION_CREATE_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranchClass))

typedef struct _GitgCommitActionCreateBranch GitgCommitActionCreateBranch;
typedef struct _GitgCommitActionCreateBranchClass GitgCommitActionCreateBranchClass;
typedef struct _GitgCommitActionCreateBranchPrivate GitgCommitActionCreateBranchPrivate;
enum  {
	GITG_COMMIT_ACTION_CREATE_BRANCH_0_PROPERTY,
	GITG_COMMIT_ACTION_CREATE_BRANCH_APPLICATION_PROPERTY,
	GITG_COMMIT_ACTION_CREATE_BRANCH_ACTION_INTERFACE_PROPERTY,
	GITG_COMMIT_ACTION_CREATE_BRANCH_COMMIT_PROPERTY,
	GITG_COMMIT_ACTION_CREATE_BRANCH_ID_PROPERTY,
	GITG_COMMIT_ACTION_CREATE_BRANCH_DISPLAY_NAME_PROPERTY,
	GITG_COMMIT_ACTION_CREATE_BRANCH_DESCRIPTION_PROPERTY,
	GITG_COMMIT_ACTION_CREATE_BRANCH_NUM_PROPERTIES
};
static GParamSpec* gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GITG_TYPE_CREATE_BRANCH_DIALOG (gitg_create_branch_dialog_get_type ())
#define GITG_CREATE_BRANCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_CREATE_BRANCH_DIALOG, GitgCreateBranchDialog))
#define GITG_CREATE_BRANCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_CREATE_BRANCH_DIALOG, GitgCreateBranchDialogClass))
#define GITG_IS_CREATE_BRANCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_CREATE_BRANCH_DIALOG))
#define GITG_IS_CREATE_BRANCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_CREATE_BRANCH_DIALOG))
#define GITG_CREATE_BRANCH_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_CREATE_BRANCH_DIALOG, GitgCreateBranchDialogClass))

typedef struct _GitgCreateBranchDialog GitgCreateBranchDialog;
typedef struct _GitgCreateBranchDialogClass GitgCreateBranchDialogClass;
typedef struct _Block56Data Block56Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define GITG_TYPE_REF_ACTION_CHECKOUT (gitg_ref_action_checkout_get_type ())
#define GITG_REF_ACTION_CHECKOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_CHECKOUT, GitgRefActionCheckout))
#define GITG_REF_ACTION_CHECKOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_CHECKOUT, GitgRefActionCheckoutClass))
#define GITG_IS_REF_ACTION_CHECKOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_CHECKOUT))
#define GITG_IS_REF_ACTION_CHECKOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_CHECKOUT))
#define GITG_REF_ACTION_CHECKOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_CHECKOUT, GitgRefActionCheckoutClass))

typedef struct _GitgRefActionCheckout GitgRefActionCheckout;
typedef struct _GitgRefActionCheckoutClass GitgRefActionCheckoutClass;

struct _GitgCommitActionCreateBranch {
	GObject parent_instance;
	GitgCommitActionCreateBranchPrivate * priv;
};

struct _GitgCommitActionCreateBranchClass {
	GObjectClass parent_class;
	void (*activate) (GitgCommitActionCreateBranch* self);
	gchar* (*get_id) (GitgCommitActionCreateBranch* self);
	gchar* (*get_description) (GitgCommitActionCreateBranch* self);
};

struct _GitgCommitActionCreateBranchPrivate {
	GitgExtApplication* _application;
	GitgExtRefActionInterface* _action_interface;
	GitgCommit* _commit;
};

struct _Block56Data {
	int _ref_count_;
	GitgCommitActionCreateBranch* self;
	GitgCreateBranchDialog* dlg;
};

static gint GitgCommitActionCreateBranch_private_offset;
static gpointer gitg_commit_action_create_branch_parent_class = NULL;
static GitgExtUIElementIface * gitg_commit_action_create_branch_gitg_ext_ui_element_parent_iface = NULL;
static GitgExtActionIface * gitg_commit_action_create_branch_gitg_ext_action_parent_iface = NULL;
static GitgExtCommitActionIface * gitg_commit_action_create_branch_gitg_ext_commit_action_parent_iface = NULL;

VALA_EXTERN GType gitg_commit_action_create_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitActionCreateBranch, g_object_unref)
VALA_EXTERN void gitg_commit_action_create_branch_activate (GitgCommitActionCreateBranch* self);
VALA_EXTERN gchar* gitg_commit_action_create_branch_get_id (GitgCommitActionCreateBranch* self);
VALA_EXTERN gchar* gitg_commit_action_create_branch_get_description (GitgCommitActionCreateBranch* self);
VALA_EXTERN GitgCommitActionCreateBranch* gitg_commit_action_create_branch_new (GitgExtApplication* application,
                                                                    GitgExtRefActionInterface* action_interface,
                                                                    GitgCommit* commit);
VALA_EXTERN GitgCommitActionCreateBranch* gitg_commit_action_create_branch_construct (GType object_type,
                                                                          GitgExtApplication* application,
                                                                          GitgExtRefActionInterface* action_interface,
                                                                          GitgCommit* commit);
static void gitg_commit_action_create_branch_real_activate (GitgCommitActionCreateBranch* self);
VALA_EXTERN GType gitg_create_branch_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCreateBranchDialog, g_object_unref)
static Block56Data* block56_data_ref (Block56Data* _data56_);
static void block56_data_unref (void * _userdata_);
VALA_EXTERN GitgCreateBranchDialog* gitg_create_branch_dialog_new (GtkWindow* parent);
VALA_EXTERN GitgCreateBranchDialog* gitg_create_branch_dialog_construct (GType object_type,
                                                             GtkWindow* parent);
static void __lambda117_ (Block56Data* _data56_,
                   GtkDialog* d,
                   gint resp);
VALA_EXTERN gchar* gitg_create_branch_dialog_get_new_branch_name (GitgCreateBranchDialog* self);
VALA_EXTERN gboolean gitg_create_branch_dialog_get_checkout_created (GitgCreateBranchDialog* self);
VALA_EXTERN GType gitg_ref_action_checkout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionCheckout, g_object_unref)
VALA_EXTERN GitgRefActionCheckout* gitg_ref_action_checkout_new (GitgExtApplication* application,
                                                     GitgExtRefActionInterface* action_interface,
                                                     GitgRef* reference);
VALA_EXTERN GitgRefActionCheckout* gitg_ref_action_checkout_construct (GType object_type,
                                                           GitgExtApplication* application,
                                                           GitgExtRefActionInterface* action_interface,
                                                           GitgRef* reference);
VALA_EXTERN void gitg_ref_action_checkout_checkout (GitgRefActionCheckout* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN gboolean gitg_ref_action_checkout_checkout_finish (GitgRefActionCheckout* self,
                                                   GAsyncResult* _res_);
static void ___lambda117__gtk_dialog_response (GtkDialog* _sender,
                                        gint response_id,
                                        gpointer self);
static void gitg_commit_action_create_branch_finalize (GObject * obj);
static GType gitg_commit_action_create_branch_get_type_once (void);
static void _vala_gitg_commit_action_create_branch_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec);
static void _vala_gitg_commit_action_create_branch_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec);

static inline gpointer
gitg_commit_action_create_branch_get_instance_private (GitgCommitActionCreateBranch* self)
{
	return G_STRUCT_MEMBER_P (self, GitgCommitActionCreateBranch_private_offset);
}

GitgCommitActionCreateBranch*
gitg_commit_action_create_branch_construct (GType object_type,
                                            GitgExtApplication* application,
                                            GitgExtRefActionInterface* action_interface,
                                            GitgCommit* commit)
{
	GitgCommitActionCreateBranch * self = NULL;
	g_return_val_if_fail (application != NULL, NULL);
	g_return_val_if_fail (action_interface != NULL, NULL);
	g_return_val_if_fail (commit != NULL, NULL);
	self = (GitgCommitActionCreateBranch*) g_object_new (object_type, "application", application, "action-interface", action_interface, "commit", commit, NULL);
	return self;
}

GitgCommitActionCreateBranch*
gitg_commit_action_create_branch_new (GitgExtApplication* application,
                                      GitgExtRefActionInterface* action_interface,
                                      GitgCommit* commit)
{
	return gitg_commit_action_create_branch_construct (GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, application, action_interface, commit);
}

static Block56Data*
block56_data_ref (Block56Data* _data56_)
{
	g_atomic_int_inc (&_data56_->_ref_count_);
	return _data56_;
}

static void
block56_data_unref (void * _userdata_)
{
	Block56Data* _data56_;
	_data56_ = (Block56Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data56_->_ref_count_)) {
		GitgCommitActionCreateBranch* self;
		self = _data56_->self;
		_g_object_unref0 (_data56_->dlg);
		_g_object_unref0 (self);
		g_slice_free (Block56Data, _data56_);
	}
}

static void
__lambda117_ (Block56Data* _data56_,
              GtkDialog* d,
              gint resp)
{
	GitgCommitActionCreateBranch* self;
	GError* _inner_error0_ = NULL;
	self = _data56_->self;
	g_return_if_fail (d != NULL);
	if (resp == ((gint) GTK_RESPONSE_OK)) {
		GgitBranch* branch = NULL;
		GitgRepository* repo = NULL;
		GitgExtApplication* _tmp0_;
		GitgExtApplication* _tmp1_;
		GitgExtApplication* _tmp2_;
		GitgRepository* _tmp3_;
		GitgRepository* _tmp4_;
		GitgRepository* _tmp5_;
		GgitBranch* _tmp21_;
		gboolean _tmp25_;
		gboolean _tmp26_;
		branch = NULL;
		_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gitg_ext_application_get_repository (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp2_);
		repo = _tmp5_;
		{
			GitgBranch* _tmp6_ = NULL;
			GitgRepository* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			GitgCommit* _tmp11_;
			GitgCommit* _tmp12_;
			GitgBranch* _tmp13_;
			GitgBranch* _tmp14_;
			GitgBranch* _tmp15_;
			_tmp7_ = repo;
			_tmp8_ = gitg_create_branch_dialog_get_new_branch_name (_data56_->dlg);
			_tmp9_ = _tmp8_;
			_tmp10_ = _tmp9_;
			_tmp11_ = gitg_ext_commit_action_get_commit ((GitgExtCommitAction*) self);
			_tmp12_ = _tmp11_;
			_tmp13_ = gitg_repository_create_branch (_tmp7_, _tmp10_, (GgitObject*) _tmp12_, GGIT_CREATE_NONE, &_inner_error0_);
			_tmp14_ = _tmp13_;
			_g_free0 (_tmp10_);
			_tmp6_ = _tmp14_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp15_ = _tmp6_;
			_tmp6_ = NULL;
			_g_object_unref0 (branch);
			branch = (GgitBranch*) _tmp15_;
			_g_object_unref0 (_tmp6_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GitgExtApplication* _tmp16_;
			GitgExtApplication* _tmp17_;
			GitgExtApplication* _tmp18_;
			GError* _tmp19_;
			const gchar* _tmp20_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp16_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
			_tmp17_ = _tmp16_;
			_tmp18_ = _tmp17_;
			_tmp19_ = e;
			_tmp20_ = _tmp19_->message;
			gitg_ext_application_show_infobar (_tmp18_, _ ("Failed to create branch"), _tmp20_, GTK_MESSAGE_ERROR);
			_g_object_unref0 (_tmp18_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (repo);
			_g_object_unref0 (branch);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp21_ = branch;
		if (_tmp21_ != NULL) {
			GitgExtRefActionInterface* _tmp22_;
			GitgExtRefActionInterface* _tmp23_;
			GgitBranch* _tmp24_;
			_tmp22_ = gitg_ext_commit_action_get_action_interface ((GitgExtCommitAction*) self);
			_tmp23_ = _tmp22_;
			_tmp24_ = branch;
			gitg_ext_ref_action_interface_add_ref (_tmp23_, G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, GITG_TYPE_REF, GitgRef));
		}
		_tmp25_ = gitg_create_branch_dialog_get_checkout_created (_data56_->dlg);
		_tmp26_ = _tmp25_;
		if (_tmp26_) {
			GitgRefActionCheckout* checkout = NULL;
			GitgExtApplication* _tmp27_;
			GitgExtApplication* _tmp28_;
			GitgExtApplication* _tmp29_;
			GitgExtRefActionInterface* _tmp30_;
			GitgExtRefActionInterface* _tmp31_;
			GgitBranch* _tmp32_;
			GitgRefActionCheckout* _tmp33_;
			GitgRefActionCheckout* _tmp34_;
			GitgRefActionCheckout* _tmp35_;
			_tmp27_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
			_tmp28_ = _tmp27_;
			_tmp29_ = _tmp28_;
			_tmp30_ = gitg_ext_commit_action_get_action_interface ((GitgExtCommitAction*) self);
			_tmp31_ = _tmp30_;
			_tmp32_ = branch;
			_tmp33_ = gitg_ref_action_checkout_new (_tmp29_, _tmp31_, G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GITG_TYPE_REF, GitgRef));
			_tmp34_ = _tmp33_;
			_g_object_unref0 (_tmp29_);
			checkout = _tmp34_;
			_tmp35_ = checkout;
			gitg_ref_action_checkout_checkout (_tmp35_, NULL, NULL);
			_g_object_unref0 (checkout);
		}
		_g_object_unref0 (repo);
		_g_object_unref0 (branch);
	}
	gtk_widget_destroy ((GtkWidget*) _data56_->dlg);
	g_signal_emit_by_name ((GitgExtCommitAction*) self, "finished");
}

static void
___lambda117__gtk_dialog_response (GtkDialog* _sender,
                                   gint response_id,
                                   gpointer self)
{
	__lambda117_ (self, _sender, response_id);
}

static void
gitg_commit_action_create_branch_real_activate (GitgCommitActionCreateBranch* self)
{
	Block56Data* _data56_;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GtkWindow* _tmp2_;
	GitgCreateBranchDialog* _tmp3_;
	GitgCreateBranchDialog* _tmp4_;
	_data56_ = g_slice_new0 (Block56Data);
	_data56_->_ref_count_ = 1;
	_data56_->self = g_object_ref (self);
	_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_window_get_type (), GtkWindow);
	_tmp3_ = gitg_create_branch_dialog_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp2_);
	_data56_->dlg = _tmp4_;
	g_signal_connect_data ((GtkDialog*) _data56_->dlg, "response", (GCallback) ___lambda117__gtk_dialog_response, block56_data_ref (_data56_), (GClosureNotify) block56_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data56_->dlg);
	block56_data_unref (_data56_);
	_data56_ = NULL;
}

void
gitg_commit_action_create_branch_activate (GitgCommitActionCreateBranch* self)
{
	GitgCommitActionCreateBranchClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = GITG_COMMIT_ACTION_CREATE_BRANCH_GET_CLASS (self);
	if (_klass_->activate) {
		_klass_->activate (self);
	}
}

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

static GitgExtApplication*
gitg_commit_action_create_branch_real_get_application (GitgExtUIElement* base)
{
	GitgExtApplication* result;
	GitgCommitActionCreateBranch* self;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	self = (GitgCommitActionCreateBranch*) base;
	_tmp0_ = self->priv->_application;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
gitg_commit_action_create_branch_real_set_application (GitgExtUIElement* base,
                                                       GitgExtApplication* value)
{
	GitgCommitActionCreateBranch* self;
	GitgExtApplication* old_value;
	self = (GitgCommitActionCreateBranch*) base;
	old_value = gitg_commit_action_create_branch_real_get_application (base);
	if (old_value != value) {
		GitgExtApplication* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_application);
		self->priv->_application = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_APPLICATION_PROPERTY]);
	}
	_g_object_unref0 (old_value);
}

static GitgExtRefActionInterface*
gitg_commit_action_create_branch_real_get_action_interface (GitgExtCommitAction* base)
{
	GitgExtRefActionInterface* result;
	GitgCommitActionCreateBranch* self;
	GitgExtRefActionInterface* _tmp0_;
	self = (GitgCommitActionCreateBranch*) base;
	_tmp0_ = self->priv->_action_interface;
	result = _tmp0_;
	return result;
}

static void
gitg_commit_action_create_branch_real_set_action_interface (GitgExtCommitAction* base,
                                                            GitgExtRefActionInterface* value)
{
	GitgCommitActionCreateBranch* self;
	GitgExtRefActionInterface* old_value;
	self = (GitgCommitActionCreateBranch*) base;
	old_value = gitg_commit_action_create_branch_real_get_action_interface (base);
	if (old_value != value) {
		GitgExtRefActionInterface* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_action_interface);
		self->priv->_action_interface = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_ACTION_INTERFACE_PROPERTY]);
	}
}

static GitgCommit*
gitg_commit_action_create_branch_real_get_commit (GitgExtCommitAction* base)
{
	GitgCommit* result;
	GitgCommitActionCreateBranch* self;
	GitgCommit* _tmp0_;
	self = (GitgCommitActionCreateBranch*) base;
	_tmp0_ = self->priv->_commit;
	result = _tmp0_;
	return result;
}

static void
gitg_commit_action_create_branch_real_set_commit (GitgExtCommitAction* base,
                                                  GitgCommit* value)
{
	GitgCommitActionCreateBranch* self;
	GitgCommit* old_value;
	self = (GitgCommitActionCreateBranch*) base;
	old_value = gitg_commit_action_create_branch_real_get_commit (base);
	if (old_value != value) {
		GitgCommit* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_commit);
		self->priv->_commit = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_COMMIT_PROPERTY]);
	}
}

gchar*
gitg_commit_action_create_branch_get_id (GitgCommitActionCreateBranch* self)
{
	GitgCommitActionCreateBranchClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = GITG_COMMIT_ACTION_CREATE_BRANCH_GET_CLASS (self);
	if (_klass_->get_id) {
		return _klass_->get_id (self);
	}
	return NULL;
}

static gchar*
gitg_commit_action_create_branch_real_get_id (GitgCommitActionCreateBranch* base)
{
	gchar* result;
	GitgCommitActionCreateBranch* self;
	gchar* _tmp0_;
	self = base;
	_tmp0_ = g_strdup ("/org/gnome/gitg/commit-actions/create-branch");
	result = _tmp0_;
	return result;
}

static gchar*
gitg_commit_action_create_branch_real_get_display_name (GitgExtUIElement* base)
{
	gchar* result;
	GitgCommitActionCreateBranch* self;
	gchar* _tmp0_;
	self = (GitgCommitActionCreateBranch*) base;
	_tmp0_ = g_strdup (_ ("Create branch"));
	result = _tmp0_;
	return result;
}

gchar*
gitg_commit_action_create_branch_get_description (GitgCommitActionCreateBranch* self)
{
	GitgCommitActionCreateBranchClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = GITG_COMMIT_ACTION_CREATE_BRANCH_GET_CLASS (self);
	if (_klass_->get_description) {
		return _klass_->get_description (self);
	}
	return NULL;
}

static gchar*
gitg_commit_action_create_branch_real_get_description (GitgCommitActionCreateBranch* base)
{
	gchar* result;
	GitgCommitActionCreateBranch* self;
	gchar* _tmp0_;
	self = base;
	_tmp0_ = g_strdup (_ ("Create a new branch at the selected commit"));
	result = _tmp0_;
	return result;
}

static void
gitg_commit_action_create_branch_class_init (GitgCommitActionCreateBranchClass * klass,
                                             gpointer klass_data)
{
	gitg_commit_action_create_branch_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgCommitActionCreateBranch_private_offset);
	((GitgCommitActionCreateBranchClass *) klass)->activate = (void (*) (GitgCommitActionCreateBranch*)) gitg_commit_action_create_branch_real_activate;
	GITG_COMMIT_ACTION_CREATE_BRANCH_CLASS (klass)->get_id = (gchar* (*) (GitgCommitActionCreateBranch*)) gitg_commit_action_create_branch_real_get_id;
	GITG_COMMIT_ACTION_CREATE_BRANCH_CLASS (klass)->get_description = (gchar* (*) (GitgCommitActionCreateBranch*)) gitg_commit_action_create_branch_real_get_description;
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_commit_action_create_branch_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_commit_action_create_branch_set_property;
	G_OBJECT_CLASS (klass)->finalize = gitg_commit_action_create_branch_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_BRANCH_APPLICATION_PROPERTY, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_APPLICATION_PROPERTY] = g_param_spec_object ("application", "application", "application", GITG_EXT_TYPE_APPLICATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_BRANCH_ACTION_INTERFACE_PROPERTY, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_ACTION_INTERFACE_PROPERTY] = g_param_spec_object ("action-interface", "action-interface", "action-interface", GITG_EXT_TYPE_REF_ACTION_INTERFACE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_BRANCH_COMMIT_PROPERTY, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_COMMIT_PROPERTY] = g_param_spec_object ("commit", "commit", "commit", GITG_TYPE_COMMIT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_BRANCH_ID_PROPERTY, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_BRANCH_DISPLAY_NAME_PROPERTY, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_ACTION_CREATE_BRANCH_DESCRIPTION_PROPERTY, gitg_commit_action_create_branch_properties[GITG_COMMIT_ACTION_CREATE_BRANCH_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gitg_commit_action_create_branch_gitg_ext_ui_element_interface_init (GitgExtUIElementIface * iface,
                                                                     gpointer iface_data)
{
	gitg_commit_action_create_branch_gitg_ext_ui_element_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate = (void (*) (GitgExtUIElement*)) gitg_commit_action_create_branch_activate;
	iface->get_application = gitg_commit_action_create_branch_real_get_application;
	iface->set_application = gitg_commit_action_create_branch_real_set_application;
	iface->get_id = (gchar* (*) (GitgExtUIElement*)) gitg_commit_action_create_branch_get_id;
	iface->get_display_name = gitg_commit_action_create_branch_real_get_display_name;
	iface->get_description = (gchar* (*) (GitgExtUIElement*)) gitg_commit_action_create_branch_get_description;
}

static void
gitg_commit_action_create_branch_gitg_ext_action_interface_init (GitgExtActionIface * iface,
                                                                 gpointer iface_data)
{
	gitg_commit_action_create_branch_gitg_ext_action_parent_iface = g_type_interface_peek_parent (iface);
}

static void
gitg_commit_action_create_branch_gitg_ext_commit_action_interface_init (GitgExtCommitActionIface * iface,
                                                                        gpointer iface_data)
{
	gitg_commit_action_create_branch_gitg_ext_commit_action_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_action_interface = gitg_commit_action_create_branch_real_get_action_interface;
	iface->set_action_interface = gitg_commit_action_create_branch_real_set_action_interface;
	iface->get_commit = gitg_commit_action_create_branch_real_get_commit;
	iface->set_commit = gitg_commit_action_create_branch_real_set_commit;
}

static void
gitg_commit_action_create_branch_instance_init (GitgCommitActionCreateBranch * self,
                                                gpointer klass)
{
	self->priv = gitg_commit_action_create_branch_get_instance_private (self);
}

static void
gitg_commit_action_create_branch_finalize (GObject * obj)
{
	GitgCommitActionCreateBranch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranch);
	_g_object_unref0 (self->priv->_application);
	_g_object_unref0 (self->priv->_action_interface);
	_g_object_unref0 (self->priv->_commit);
	G_OBJECT_CLASS (gitg_commit_action_create_branch_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_commit_action_create_branch_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgCommitActionCreateBranchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_commit_action_create_branch_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgCommitActionCreateBranch), 0, (GInstanceInitFunc) gitg_commit_action_create_branch_instance_init, NULL };
	static const GInterfaceInfo gitg_ext_ui_element_info = { (GInterfaceInitFunc) gitg_commit_action_create_branch_gitg_ext_ui_element_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gitg_ext_action_info = { (GInterfaceInitFunc) gitg_commit_action_create_branch_gitg_ext_action_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gitg_ext_commit_action_info = { (GInterfaceInitFunc) gitg_commit_action_create_branch_gitg_ext_commit_action_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gitg_commit_action_create_branch_type_id;
	gitg_commit_action_create_branch_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgCommitActionCreateBranch", &g_define_type_info, 0);
	g_type_add_interface_static (gitg_commit_action_create_branch_type_id, GITG_EXT_TYPE_UI_ELEMENT, &gitg_ext_ui_element_info);
	g_type_add_interface_static (gitg_commit_action_create_branch_type_id, GITG_EXT_TYPE_ACTION, &gitg_ext_action_info);
	g_type_add_interface_static (gitg_commit_action_create_branch_type_id, GITG_EXT_TYPE_COMMIT_ACTION, &gitg_ext_commit_action_info);
	GitgCommitActionCreateBranch_private_offset = g_type_add_instance_private (gitg_commit_action_create_branch_type_id, sizeof (GitgCommitActionCreateBranchPrivate));
	return gitg_commit_action_create_branch_type_id;
}

GType
gitg_commit_action_create_branch_get_type (void)
{
	static gsize gitg_commit_action_create_branch_type_id__once = 0;
	if (g_once_init_enter (&gitg_commit_action_create_branch_type_id__once)) {
		GType gitg_commit_action_create_branch_type_id;
		gitg_commit_action_create_branch_type_id = gitg_commit_action_create_branch_get_type_once ();
		g_once_init_leave (&gitg_commit_action_create_branch_type_id__once, gitg_commit_action_create_branch_type_id);
	}
	return gitg_commit_action_create_branch_type_id__once;
}

static void
_vala_gitg_commit_action_create_branch_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec)
{
	GitgCommitActionCreateBranch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranch);
	switch (property_id) {
		case GITG_COMMIT_ACTION_CREATE_BRANCH_APPLICATION_PROPERTY:
		g_value_take_object (value, gitg_ext_ui_element_get_application ((GitgExtUIElement*) self));
		break;
		case GITG_COMMIT_ACTION_CREATE_BRANCH_ACTION_INTERFACE_PROPERTY:
		g_value_set_object (value, gitg_ext_commit_action_get_action_interface ((GitgExtCommitAction*) self));
		break;
		case GITG_COMMIT_ACTION_CREATE_BRANCH_COMMIT_PROPERTY:
		g_value_set_object (value, gitg_ext_commit_action_get_commit ((GitgExtCommitAction*) self));
		break;
		case GITG_COMMIT_ACTION_CREATE_BRANCH_ID_PROPERTY:
		g_value_take_string (value, gitg_commit_action_create_branch_get_id (self));
		break;
		case GITG_COMMIT_ACTION_CREATE_BRANCH_DISPLAY_NAME_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_display_name ((GitgExtUIElement*) self));
		break;
		case GITG_COMMIT_ACTION_CREATE_BRANCH_DESCRIPTION_PROPERTY:
		g_value_take_string (value, gitg_commit_action_create_branch_get_description (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_commit_action_create_branch_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec)
{
	GitgCommitActionCreateBranch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranch);
	switch (property_id) {
		case GITG_COMMIT_ACTION_CREATE_BRANCH_APPLICATION_PROPERTY:
		gitg_ext_ui_element_set_application ((GitgExtUIElement*) self, g_value_get_object (value));
		break;
		case GITG_COMMIT_ACTION_CREATE_BRANCH_ACTION_INTERFACE_PROPERTY:
		gitg_ext_commit_action_set_action_interface ((GitgExtCommitAction*) self, g_value_get_object (value));
		break;
		case GITG_COMMIT_ACTION_CREATE_BRANCH_COMMIT_PROPERTY:
		gitg_ext_commit_action_set_commit ((GitgExtCommitAction*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

