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

/*
 * This file is part of gitg
 *
 * Copyright (C) 2012 - 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.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>


#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 _GitgCreateBranchDialogPrivate GitgCreateBranchDialogPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GitgCreateBranchDialog {
	GtkDialog parent_instance;
	GitgCreateBranchDialogPrivate * priv;
};

struct _GitgCreateBranchDialogClass {
	GtkDialogClass parent_class;
};

struct _GitgCreateBranchDialogPrivate {
	GtkButton* d_button_create;
	GtkEntry* d_entry_branch_name;
};


static gpointer gitg_create_branch_dialog_parent_class = NULL;

GType gitg_create_branch_dialog_get_type (void) G_GNUC_CONST;
#define GITG_CREATE_BRANCH_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GITG_TYPE_CREATE_BRANCH_DIALOG, GitgCreateBranchDialogPrivate))
enum  {
	GITG_CREATE_BRANCH_DIALOG_DUMMY_PROPERTY,
	GITG_CREATE_BRANCH_DIALOG_NEW_BRANCH_NAME
};
GitgCreateBranchDialog* gitg_create_branch_dialog_new (GtkWindow* parent);
GitgCreateBranchDialog* gitg_create_branch_dialog_construct (GType object_type, GtkWindow* parent);
gchar* gitg_create_branch_dialog_get_new_branch_name (GitgCreateBranchDialog* self);
static GObject * gitg_create_branch_dialog_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void _gitg_create_branch_dialog___lambda146_ (GitgCreateBranchDialog* self);
static void __gitg_create_branch_dialog___lambda146__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void gitg_create_branch_dialog_finalize (GObject* obj);
static void _vala_gitg_create_branch_dialog_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


GitgCreateBranchDialog* gitg_create_branch_dialog_construct (GType object_type, GtkWindow* parent) {
	GitgCreateBranchDialog * self = NULL;
	GtkWindow* _tmp0_ = NULL;
#line 44 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	self = (GitgCreateBranchDialog*) g_object_new (object_type, "use-header-bar", 1, NULL);
#line 46 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp0_ = parent;
#line 46 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	if (_tmp0_ != NULL) {
#line 86 "gitg-create-branch-dialog.c"
		GtkWindow* _tmp1_ = NULL;
#line 48 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
		_tmp1_ = parent;
#line 48 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
		gtk_window_set_transient_for ((GtkWindow*) self, _tmp1_);
#line 92 "gitg-create-branch-dialog.c"
	}
#line 42 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	return self;
#line 96 "gitg-create-branch-dialog.c"
}


GitgCreateBranchDialog* gitg_create_branch_dialog_new (GtkWindow* parent) {
#line 42 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	return gitg_create_branch_dialog_construct (GITG_TYPE_CREATE_BRANCH_DIALOG, parent);
#line 103 "gitg-create-branch-dialog.c"
}


static gchar* string_strip (const gchar* self) {
	gchar* result = NULL;
	gchar* _result_ = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
#line 1207 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1208 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1208 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1209 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = _result_;
#line 1209 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_strstrip (_tmp1_);
#line 1210 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	result = _result_;
#line 1210 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	return result;
#line 126 "gitg-create-branch-dialog.c"
}


gchar* gitg_create_branch_dialog_get_new_branch_name (GitgCreateBranchDialog* self) {
	gchar* result;
	GtkEntry* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 54 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 56 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp0_ = self->priv->d_entry_branch_name;
#line 56 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp1_ = gtk_entry_get_text (_tmp0_);
#line 56 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp2_ = _tmp1_;
#line 56 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp3_ = string_strip (_tmp2_);
#line 56 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	result = _tmp3_;
#line 56 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	return result;
#line 150 "gitg-create-branch-dialog.c"
}


static void _gitg_create_branch_dialog___lambda146_ (GitgCreateBranchDialog* self) {
	GtkButton* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp0_ = self->priv->d_button_create;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp1_ = gitg_create_branch_dialog_get_new_branch_name (self);
#line 35 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp2_ = _tmp1_;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp3_ = _tmp2_;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp4_ = strlen (_tmp3_);
#line 35 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp5_ = _tmp4_;
#line 35 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp5_ != 0);
#line 35 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_g_free0 (_tmp3_);
#line 177 "gitg-create-branch-dialog.c"
}


static void __gitg_create_branch_dialog___lambda146__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
#line 34 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_gitg_create_branch_dialog___lambda146_ ((GitgCreateBranchDialog*) self);
#line 184 "gitg-create-branch-dialog.c"
}


static GObject * gitg_create_branch_dialog_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	GitgCreateBranchDialog * self;
	GtkEntry* _tmp0_ = NULL;
	GtkButton* _tmp1_ = NULL;
#line 32 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	parent_class = G_OBJECT_CLASS (gitg_create_branch_dialog_parent_class);
#line 32 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 32 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_CREATE_BRANCH_DIALOG, GitgCreateBranchDialog);
#line 34 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp0_ = self->priv->d_entry_branch_name;
#line 34 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	g_signal_connect_object ((GtkEditable*) _tmp0_, "changed", (GCallback) __gitg_create_branch_dialog___lambda146__gtk_editable_changed, self, 0);
#line 38 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_tmp1_ = self->priv->d_button_create;
#line 38 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	gtk_window_set_default ((GtkWindow*) self, (GtkWidget*) _tmp1_);
#line 39 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	gtk_dialog_set_default_response ((GtkDialog*) self, (gint) GTK_RESPONSE_OK);
#line 32 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	return obj;
#line 212 "gitg-create-branch-dialog.c"
}


static void gitg_create_branch_dialog_class_init (GitgCreateBranchDialogClass * klass) {
	gint GitgCreateBranchDialog_private_offset;
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	gitg_create_branch_dialog_parent_class = g_type_class_peek_parent (klass);
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	g_type_class_add_private (klass, sizeof (GitgCreateBranchDialogPrivate));
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_create_branch_dialog_get_property;
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	G_OBJECT_CLASS (klass)->constructor = gitg_create_branch_dialog_constructor;
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	G_OBJECT_CLASS (klass)->finalize = gitg_create_branch_dialog_finalize;
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_CREATE_BRANCH_DIALOG_NEW_BRANCH_NAME, g_param_spec_string ("new-branch-name", "new-branch-name", "new-branch-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	GitgCreateBranchDialog_private_offset = g_type_class_get_instance_private_offset (klass);
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/gitg/ui/gitg-create-branch-dialog.ui");
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_button_create", FALSE, GitgCreateBranchDialog_private_offset + G_STRUCT_OFFSET (GitgCreateBranchDialogPrivate, d_button_create));
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_entry_branch_name", FALSE, GitgCreateBranchDialog_private_offset + G_STRUCT_OFFSET (GitgCreateBranchDialogPrivate, d_entry_branch_name));
#line 238 "gitg-create-branch-dialog.c"
}


static void gitg_create_branch_dialog_instance_init (GitgCreateBranchDialog * self) {
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	self->priv = GITG_CREATE_BRANCH_DIALOG_GET_PRIVATE (self);
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	gtk_widget_init_template (GTK_WIDGET (self));
#line 247 "gitg-create-branch-dialog.c"
}


static void gitg_create_branch_dialog_finalize (GObject* obj) {
	GitgCreateBranchDialog * self;
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_CREATE_BRANCH_DIALOG, GitgCreateBranchDialog);
#line 27 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_g_object_unref0 (self->priv->d_button_create);
#line 30 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	_g_object_unref0 (self->priv->d_entry_branch_name);
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	G_OBJECT_CLASS (gitg_create_branch_dialog_parent_class)->finalize (obj);
#line 261 "gitg-create-branch-dialog.c"
}


GType gitg_create_branch_dialog_get_type (void) {
	static volatile gsize gitg_create_branch_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_create_branch_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GitgCreateBranchDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_create_branch_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgCreateBranchDialog), 0, (GInstanceInitFunc) gitg_create_branch_dialog_instance_init, NULL };
		GType gitg_create_branch_dialog_type_id;
		gitg_create_branch_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "GitgCreateBranchDialog", &g_define_type_info, 0);
		g_once_init_leave (&gitg_create_branch_dialog_type_id__volatile, gitg_create_branch_dialog_type_id);
	}
	return gitg_create_branch_dialog_type_id__volatile;
}


static void _vala_gitg_create_branch_dialog_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GitgCreateBranchDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_CREATE_BRANCH_DIALOG, GitgCreateBranchDialog);
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
	switch (property_id) {
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
		case GITG_CREATE_BRANCH_DIALOG_NEW_BRANCH_NAME:
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
		g_value_take_string (value, gitg_create_branch_dialog_get_new_branch_name (self));
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
		break;
#line 288 "gitg-create-branch-dialog.c"
		default:
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 24 "/home/jesse/dev/gitg/gitg/gitg-create-branch-dialog.vala"
		break;
#line 294 "gitg-create-branch-dialog.c"
	}
}



