/* gitg-ext-message.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-ext-message.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-ext.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.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_EXT_MESSAGE_0_PROPERTY,
	GITG_EXT_MESSAGE_ID_PROPERTY,
	GITG_EXT_MESSAGE_NUM_PROPERTIES
};
static GParamSpec* gitg_ext_message_properties[GITG_EXT_MESSAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL)))
#define _g_param_spec_unref0(var) ((var == NULL) ? NULL : (var = (g_param_spec_unref (var), NULL)))

struct _GitgExtMessagePrivate {
	GitgExtMessageId* d_id;
};

static gint GitgExtMessage_private_offset;
static gpointer gitg_ext_message_parent_class = NULL;

static void gitg_ext_message_finalize (GObject * obj);
static GType gitg_ext_message_get_type_once (void);
static void _vala_gitg_ext_message_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_gitg_ext_message_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);

static inline gpointer
gitg_ext_message_get_instance_private (GitgExtMessage* self)
{
	return G_STRUCT_MEMBER_P (self, GitgExtMessage_private_offset);
}

gboolean
gitg_ext_message_has (GitgExtMessage* self,
                      const gchar* propname)
{
	GObjectClass* _tmp0_;
	GParamSpec* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (propname != NULL, FALSE);
	_tmp0_ = G_OBJECT_GET_CLASS ((GObject*) self);
	_tmp1_ = g_object_class_find_property (_tmp0_, propname);
	result = _tmp1_ != NULL;
	return result;
}

gboolean
gitg_ext_message_type_has (GType type,
                           const gchar* propname)
{
	GTypeClass* _tmp0_;
	GObjectClass* _tmp1_;
	GParamSpec* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (propname != NULL, FALSE);
	_tmp0_ = g_type_class_ref (type);
	_tmp1_ = (GObjectClass*) _tmp0_;
	_tmp2_ = g_object_class_find_property (_tmp1_, propname);
	_tmp3_ = _tmp2_ != NULL;
	_g_type_class_unref0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static gpointer
_g_param_spec_ref0 (gpointer self)
{
	return self ? g_param_spec_ref (self) : NULL;
}

gboolean
gitg_ext_message_type_check (GType type,
                             const gchar* propname,
                             GType value_type)
{
	GParamSpec* spec = NULL;
	GTypeClass* _tmp0_;
	GObjectClass* _tmp1_;
	GParamSpec* _tmp2_;
	GParamSpec* _tmp3_;
	GParamSpec* _tmp4_;
	gboolean _tmp5_ = FALSE;
	GParamSpec* _tmp6_;
	gboolean result;
	g_return_val_if_fail (propname != NULL, FALSE);
	_tmp0_ = g_type_class_ref (type);
	_tmp1_ = (GObjectClass*) _tmp0_;
	_tmp2_ = g_object_class_find_property (_tmp1_, propname);
	_tmp3_ = _g_param_spec_ref0 (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_type_class_unref0 (_tmp1_);
	spec = _tmp4_;
	_tmp6_ = spec;
	if (_tmp6_ != NULL) {
		GParamSpec* _tmp7_;
		_tmp7_ = spec;
		_tmp5_ = _tmp7_->value_type == value_type;
	} else {
		_tmp5_ = FALSE;
	}
	result = _tmp5_;
	_g_param_spec_unref0 (spec);
	return result;
}

GitgExtMessage*
gitg_ext_message_construct (GType object_type)
{
	GitgExtMessage * self = NULL;
	self = (GitgExtMessage*) g_object_new (object_type, NULL);
	return self;
}

GitgExtMessageId*
gitg_ext_message_get_id (GitgExtMessage* self)
{
	GitgExtMessageId* result;
	GitgExtMessageId* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_id;
	result = _tmp0_;
	return result;
}

void
gitg_ext_message_set_id (GitgExtMessage* self,
                         GitgExtMessageId* value)
{
	GitgExtMessageId* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gitg_ext_message_id_copy (value);
	_g_object_unref0 (self->priv->d_id);
	self->priv->d_id = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, gitg_ext_message_properties[GITG_EXT_MESSAGE_ID_PROPERTY]);
}

static void
gitg_ext_message_class_init (GitgExtMessageClass * klass,
                             gpointer klass_data)
{
	gitg_ext_message_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgExtMessage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_ext_message_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_ext_message_set_property;
	G_OBJECT_CLASS (klass)->finalize = gitg_ext_message_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_EXT_MESSAGE_ID_PROPERTY, gitg_ext_message_properties[GITG_EXT_MESSAGE_ID_PROPERTY] = g_param_spec_object ("id", "id", "id", GITG_EXT_TYPE_MESSAGE_ID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}

static void
gitg_ext_message_instance_init (GitgExtMessage * self,
                                gpointer klass)
{
	self->priv = gitg_ext_message_get_instance_private (self);
}

static void
gitg_ext_message_finalize (GObject * obj)
{
	GitgExtMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_EXT_TYPE_MESSAGE, GitgExtMessage);
	_g_object_unref0 (self->priv->d_id);
	G_OBJECT_CLASS (gitg_ext_message_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_ext_message_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgExtMessageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_ext_message_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgExtMessage), 0, (GInstanceInitFunc) gitg_ext_message_instance_init, NULL };
	GType gitg_ext_message_type_id;
	gitg_ext_message_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgExtMessage", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	GitgExtMessage_private_offset = g_type_add_instance_private (gitg_ext_message_type_id, sizeof (GitgExtMessagePrivate));
	return gitg_ext_message_type_id;
}

GType
gitg_ext_message_get_type (void)
{
	static gsize gitg_ext_message_type_id__once = 0;
	if (g_once_init_enter (&gitg_ext_message_type_id__once)) {
		GType gitg_ext_message_type_id;
		gitg_ext_message_type_id = gitg_ext_message_get_type_once ();
		g_once_init_leave (&gitg_ext_message_type_id__once, gitg_ext_message_type_id);
	}
	return gitg_ext_message_type_id__once;
}

static void
_vala_gitg_ext_message_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	GitgExtMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_EXT_TYPE_MESSAGE, GitgExtMessage);
	switch (property_id) {
		case GITG_EXT_MESSAGE_ID_PROPERTY:
		g_value_set_object (value, gitg_ext_message_get_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_ext_message_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	GitgExtMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_EXT_TYPE_MESSAGE, GitgExtMessage);
	switch (property_id) {
		case GITG_EXT_MESSAGE_ID_PROPERTY:
		gitg_ext_message_set_id (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

