/* gitg-lane.c generated by valac 0.56.19, 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 "libgitg.h"
#include <glib-object.h>
#include <glib.h>
#include <libgit2-glib/ggit.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	GITG_LANE_0_PROPERTY,
	GITG_LANE_NUM_PROPERTIES
};
static GParamSpec* gitg_lane_properties[GITG_LANE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __vala_GgitOId_free0(var) ((var == NULL) ? NULL : (var = (_vala_GgitOId_free (var), NULL)))

static gpointer gitg_lane_parent_class = NULL;

static void _vala_GgitOId_free (GgitOId* self);
static GgitOId* _vala_GgitOId_copy (GgitOId* self);
static void gitg_lane_finalize (GObject * obj);
static GType gitg_lane_get_type_once (void);

 G_GNUC_NO_INLINE static GType
gitg_lane_tag_get_type_once (void)
{
	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);
	return gitg_lane_tag_type_id;
}

GType
gitg_lane_tag_get_type (void)
{
	static gsize gitg_lane_tag_type_id__once = 0;
	if (g_once_init_enter (&gitg_lane_tag_type_id__once)) {
		GType gitg_lane_tag_type_id;
		gitg_lane_tag_type_id = gitg_lane_tag_get_type_once ();
		g_once_init_leave (&gitg_lane_tag_type_id__once, gitg_lane_tag_type_id);
	}
	return gitg_lane_tag_type_id__once;
}

static void
_vala_GgitOId_free (GgitOId* self)
{
	g_boxed_free (ggit_oid_get_type (), self);
}

GitgLane*
gitg_lane_construct (GType object_type)
{
	GitgLane * self = NULL;
	self = (GitgLane*) gitg_lane_construct_with_color (object_type, NULL);
	return self;
}

GitgLane*
gitg_lane_new (void)
{
	return gitg_lane_construct (GITG_TYPE_LANE);
}

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

GitgLane*
gitg_lane_construct_with_color (GType object_type,
                                GitgColor* color)
{
	GitgLane * self = NULL;
	self = (GitgLane*) g_object_new (object_type, NULL);
	if (color != NULL) {
		GitgColor* _tmp0_;
		_tmp0_ = _g_object_ref0 (color);
		_g_object_unref0 (self->color);
		self->color = _tmp0_;
	} else {
		GitgColor* _tmp1_;
		_tmp1_ = gitg_color_next ();
		_g_object_unref0 (self->color);
		self->color = _tmp1_;
	}
	return self;
}

GitgLane*
gitg_lane_new_with_color (GitgColor* color)
{
	return gitg_lane_construct_with_color (GITG_TYPE_LANE, color);
}

static GgitOId*
_vala_GgitOId_copy (GgitOId* self)
{
	return g_boxed_copy (ggit_oid_get_type (), self);
}

static gpointer
__vala_GgitOId_copy0 (gpointer self)
{
	return self ? _vala_GgitOId_copy (self) : NULL;
}

GitgLane*
gitg_lane_copy (GitgLane* self)
{
	GitgLane* ret = NULL;
	GitgColor* _tmp0_;
	GitgLane* _tmp1_;
	GSList* _tmp2_;
	GSList* _tmp3_;
	GgitOId* _tmp4_;
	GgitOId* _tmp5_;
	GitgLane* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->color;
	_tmp1_ = gitg_lane_new_with_color (_tmp0_);
	ret = _tmp1_;
	_tmp2_ = self->from;
	_tmp3_ = g_slist_copy (_tmp2_);
	(ret->from == NULL) ? NULL : (ret->from = (g_slist_free (ret->from), NULL));
	ret->from = _tmp3_;
	ret->tag = self->tag;
	_tmp4_ = self->boundary_id;
	_tmp5_ = __vala_GgitOId_copy0 (_tmp4_);
	__vala_GgitOId_free0 (ret->boundary_id);
	ret->boundary_id = _tmp5_;
	result = ret;
	return result;
}

GitgLane*
gitg_lane_dup (GitgLane* self)
{
	GitgLane* ret = NULL;
	GitgColor* _tmp0_;
	GitgColor* _tmp1_;
	GitgColor* _tmp2_;
	GitgLane* _tmp3_;
	GitgLane* _tmp4_;
	GSList* _tmp5_;
	GSList* _tmp6_;
	GgitOId* _tmp7_;
	GgitOId* _tmp8_;
	GitgLane* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->color;
	_tmp1_ = gitg_color_copy (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gitg_lane_new_with_color (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp2_);
	ret = _tmp4_;
	_tmp5_ = self->from;
	_tmp6_ = g_slist_copy (_tmp5_);
	(ret->from == NULL) ? NULL : (ret->from = (g_slist_free (ret->from), NULL));
	ret->from = _tmp6_;
	ret->tag = self->tag;
	_tmp7_ = self->boundary_id;
	_tmp8_ = __vala_GgitOId_copy0 (_tmp7_);
	__vala_GgitOId_free0 (ret->boundary_id);
	ret->boundary_id = _tmp8_;
	result = ret;
	return result;
}

static void
gitg_lane_class_init (GitgLaneClass * klass,
                      gpointer klass_data)
{
	gitg_lane_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = gitg_lane_finalize;
}

static void
gitg_lane_instance_init (GitgLane * self,
                         gpointer klass)
{
}

static void
gitg_lane_finalize (GObject * obj)
{
	GitgLane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_LANE, GitgLane);
	_g_object_unref0 (self->color);
	(self->from == NULL) ? NULL : (self->from = (g_slist_free (self->from), NULL));
	__vala_GgitOId_free0 (self->boundary_id);
	G_OBJECT_CLASS (gitg_lane_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_lane_get_type_once (void)
{
	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);
	return gitg_lane_type_id;
}

GType
gitg_lane_get_type (void)
{
	static gsize gitg_lane_type_id__once = 0;
	if (g_once_init_enter (&gitg_lane_type_id__once)) {
		GType gitg_lane_type_id;
		gitg_lane_type_id = gitg_lane_get_type_once ();
		g_once_init_leave (&gitg_lane_type_id__once, gitg_lane_type_id);
	}
	return gitg_lane_type_id__once;
}

