/* gitg-lane.c generated by valac 0.34.7, the Vala compiler
 * generated from gitg-lane.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 <libgit2-glib/ggit.h>


#define GITG_TYPE_LANE_TAG (gitg_lane_tag_get_type ())

#define GITG_TYPE_LANE (gitg_lane_get_type ())
#define GITG_LANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_LANE, GitgLane))
#define GITG_LANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_LANE, GitgLaneClass))
#define GITG_IS_LANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_LANE))
#define GITG_IS_LANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_LANE))
#define GITG_LANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_LANE, GitgLaneClass))

typedef struct _GitgLane GitgLane;
typedef struct _GitgLaneClass GitgLaneClass;
typedef struct _GitgLanePrivate GitgLanePrivate;

#define GITG_TYPE_COLOR (gitg_color_get_type ())
#define GITG_COLOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COLOR, GitgColor))
#define GITG_COLOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_COLOR, GitgColorClass))
#define GITG_IS_COLOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_COLOR))
#define GITG_IS_COLOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_COLOR))
#define GITG_COLOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_COLOR, GitgColorClass))

typedef struct _GitgColor GitgColor;
typedef struct _GitgColorClass GitgColorClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_slist_free0(var) ((var == NULL) ? NULL : (var = (g_slist_free (var), NULL)))
#define __vala_GgitOId_free0(var) ((var == NULL) ? NULL : (var = (_vala_GgitOId_free (var), NULL)))

typedef enum  {
	GITG_LANE_TAG_NONE = 0,
	GITG_LANE_TAG_START = 1 << 0,
	GITG_LANE_TAG_END = 1 << 1,
	GITG_LANE_TAG_SIGN_STASH = 1 << 2,
	GITG_LANE_TAG_SIGN_STAGED = 1 << 3,
	GITG_LANE_TAG_SIGN_UNSTAGED = 1 << 4,
	GITG_LANE_TAG_HIDDEN = 1 << 5
} GitgLaneTag;

struct _GitgLane {
	GObject parent_instance;
	GitgLanePrivate * priv;
	GitgColor* color;
	GSList* from;
	GitgLaneTag tag;
	GgitOId* boundary_id;
};

struct _GitgLaneClass {
	GObjectClass parent_class;
};


static gpointer gitg_lane_parent_class = NULL;

GType gitg_lane_tag_get_type (void) G_GNUC_CONST;
GType gitg_lane_get_type (void) G_GNUC_CONST;
GType gitg_color_get_type (void) G_GNUC_CONST;
enum  {
	GITG_LANE_DUMMY_PROPERTY
};
static void _vala_GgitOId_free (GgitOId* self);
GitgLane* gitg_lane_new (void);
GitgLane* gitg_lane_construct (GType object_type);
GitgLane* gitg_lane_new_with_color (GitgColor* color);
GitgLane* gitg_lane_construct_with_color (GType object_type, GitgColor* color);
GitgColor* gitg_color_next (void);
GitgLane* gitg_lane_copy (GitgLane* self);
static GgitOId* _vala_GgitOId_copy (GgitOId* self);
GitgLane* gitg_lane_dup (GitgLane* self);
GitgColor* gitg_color_copy (GitgColor* self);
static void gitg_lane_finalize (GObject* obj);


GType gitg_lane_tag_get_type (void) {
	static volatile gsize gitg_lane_tag_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_lane_tag_type_id__volatile)) {
		static const GFlagsValue values[] = {{GITG_LANE_TAG_NONE, "GITG_LANE_TAG_NONE", "none"}, {GITG_LANE_TAG_START, "GITG_LANE_TAG_START", "start"}, {GITG_LANE_TAG_END, "GITG_LANE_TAG_END", "end"}, {GITG_LANE_TAG_SIGN_STASH, "GITG_LANE_TAG_SIGN_STASH", "sign-stash"}, {GITG_LANE_TAG_SIGN_STAGED, "GITG_LANE_TAG_SIGN_STAGED", "sign-staged"}, {GITG_LANE_TAG_SIGN_UNSTAGED, "GITG_LANE_TAG_SIGN_UNSTAGED", "sign-unstaged"}, {GITG_LANE_TAG_HIDDEN, "GITG_LANE_TAG_HIDDEN", "hidden"}, {0, NULL, NULL}};
		GType gitg_lane_tag_type_id;
		gitg_lane_tag_type_id = g_flags_register_static ("GitgLaneTag", values);
		g_once_init_leave (&gitg_lane_tag_type_id__volatile, gitg_lane_tag_type_id);
	}
	return gitg_lane_tag_type_id__volatile;
}


static void _vala_GgitOId_free (GgitOId* self) {
#line 40 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	g_boxed_free (ggit_oid_get_type (), self);
#line 115 "gitg-lane.c"
}


GitgLane* gitg_lane_construct (GType object_type) {
	GitgLane * self = NULL;
#line 44 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	self = (GitgLane*) gitg_lane_construct_with_color (object_type, NULL);
#line 42 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return self;
#line 125 "gitg-lane.c"
}


GitgLane* gitg_lane_new (void) {
#line 42 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return gitg_lane_construct (GITG_TYPE_LANE);
#line 132 "gitg-lane.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 51 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return self ? g_object_ref (self) : NULL;
#line 139 "gitg-lane.c"
}


GitgLane* gitg_lane_construct_with_color (GType object_type, GitgColor* color) {
	GitgLane * self = NULL;
	GitgColor* _tmp0_ = NULL;
#line 47 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	self = (GitgLane*) g_object_new (object_type, NULL);
#line 49 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp0_ = color;
#line 49 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	if (_tmp0_ != NULL) {
#line 152 "gitg-lane.c"
		GitgColor* _tmp1_ = NULL;
		GitgColor* _tmp2_ = NULL;
#line 51 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
		_tmp1_ = color;
#line 51 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
		_tmp2_ = _g_object_ref0 (_tmp1_);
#line 51 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
		_g_object_unref0 (self->color);
#line 51 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
		self->color = _tmp2_;
#line 163 "gitg-lane.c"
	} else {
		GitgColor* _tmp3_ = NULL;
#line 55 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
		_tmp3_ = gitg_color_next ();
#line 55 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
		_g_object_unref0 (self->color);
#line 55 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
		self->color = _tmp3_;
#line 172 "gitg-lane.c"
	}
#line 47 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return self;
#line 176 "gitg-lane.c"
}


GitgLane* gitg_lane_new_with_color (GitgColor* color) {
#line 47 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return gitg_lane_construct_with_color (GITG_TYPE_LANE, color);
#line 183 "gitg-lane.c"
}


static GgitOId* _vala_GgitOId_copy (GgitOId* self) {
#line 64 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return g_boxed_copy (ggit_oid_get_type (), self);
#line 190 "gitg-lane.c"
}


static gpointer __vala_GgitOId_copy0 (gpointer self) {
#line 64 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return self ? _vala_GgitOId_copy (self) : NULL;
#line 197 "gitg-lane.c"
}


GitgLane* gitg_lane_copy (GitgLane* self) {
	GitgLane* result = NULL;
	GitgLane* ret = NULL;
	GitgColor* _tmp0_ = NULL;
	GitgLane* _tmp1_ = NULL;
	GSList* _tmp2_ = NULL;
	GSList* _tmp3_ = NULL;
	GitgLaneTag _tmp4_ = 0;
	GgitOId* _tmp5_ = NULL;
	GgitOId* _tmp6_ = NULL;
#line 59 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 61 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp0_ = self->color;
#line 61 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp1_ = gitg_lane_new_with_color (_tmp0_);
#line 61 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	ret = _tmp1_;
#line 62 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp2_ = self->from;
#line 62 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp3_ = g_slist_copy (_tmp2_);
#line 62 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_g_slist_free0 (ret->from);
#line 62 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	ret->from = _tmp3_;
#line 63 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp4_ = self->tag;
#line 63 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	ret->tag = _tmp4_;
#line 64 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp5_ = self->boundary_id;
#line 64 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp6_ = __vala_GgitOId_copy0 (_tmp5_);
#line 64 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	__vala_GgitOId_free0 (ret->boundary_id);
#line 64 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	ret->boundary_id = _tmp6_;
#line 66 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	result = ret;
#line 66 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return result;
#line 243 "gitg-lane.c"
}


GitgLane* gitg_lane_dup (GitgLane* self) {
	GitgLane* result = NULL;
	GitgLane* ret = NULL;
	GitgColor* _tmp0_ = NULL;
	GitgColor* _tmp1_ = NULL;
	GitgColor* _tmp2_ = NULL;
	GitgLane* _tmp3_ = NULL;
	GitgLane* _tmp4_ = NULL;
	GSList* _tmp5_ = NULL;
	GSList* _tmp6_ = NULL;
	GitgLaneTag _tmp7_ = 0;
	GgitOId* _tmp8_ = NULL;
	GgitOId* _tmp9_ = NULL;
#line 69 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp0_ = self->color;
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp1_ = gitg_color_copy (_tmp0_);
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp2_ = _tmp1_;
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp3_ = gitg_lane_new_with_color (_tmp2_);
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp4_ = _tmp3_;
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_g_object_unref0 (_tmp2_);
#line 71 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	ret = _tmp4_;
#line 72 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp5_ = self->from;
#line 72 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp6_ = g_slist_copy (_tmp5_);
#line 72 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_g_slist_free0 (ret->from);
#line 72 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	ret->from = _tmp6_;
#line 73 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp7_ = self->tag;
#line 73 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	ret->tag = _tmp7_;
#line 74 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp8_ = self->boundary_id;
#line 74 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_tmp9_ = __vala_GgitOId_copy0 (_tmp8_);
#line 74 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	__vala_GgitOId_free0 (ret->boundary_id);
#line 74 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	ret->boundary_id = _tmp9_;
#line 76 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	result = ret;
#line 76 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	return result;
#line 300 "gitg-lane.c"
}


static void gitg_lane_class_init (GitgLaneClass * klass) {
#line 35 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	gitg_lane_parent_class = g_type_class_peek_parent (klass);
#line 35 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	G_OBJECT_CLASS (klass)->finalize = gitg_lane_finalize;
#line 309 "gitg-lane.c"
}


static void gitg_lane_instance_init (GitgLane * self) {
}


static void gitg_lane_finalize (GObject* obj) {
	GitgLane * self;
#line 35 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_LANE, GitgLane);
#line 37 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_g_object_unref0 (self->color);
#line 38 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	_g_slist_free0 (self->from);
#line 40 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	__vala_GgitOId_free0 (self->boundary_id);
#line 35 "/home/jesse/dev/gitg/libgitg/gitg-lane.vala"
	G_OBJECT_CLASS (gitg_lane_parent_class)->finalize (obj);
#line 329 "gitg-lane.c"
}


GType gitg_lane_get_type (void) {
	static volatile gsize gitg_lane_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_lane_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GitgLaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_lane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgLane), 0, (GInstanceInitFunc) gitg_lane_instance_init, NULL };
		GType gitg_lane_type_id;
		gitg_lane_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgLane", &g_define_type_info, 0);
		g_once_init_leave (&gitg_lane_type_id__volatile, gitg_lane_type_id);
	}
	return gitg_lane_type_id__volatile;
}



