/* release-page.c generated by valac 0.56.19, the Vala compiler
 * generated from release-page.vala, do not modify */

#include "protonplus_core.h"
#include <gee.h>
#include <glib-object.h>
#include <glib.h>
#include <string.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  {
	PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_0_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_RELEASES_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_NEXT_PAGE_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_HAS_MORE_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_tools_release_page_properties[PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusModelsToolsReleasePagePrivate {
	GeeLinkedList* _releases;
	gint _next_page;
	gboolean _has_more;
};

static gint ProtonPlusModelsToolsReleasePage_private_offset;
static gpointer proton_plus_models_tools_release_page_parent_class = NULL;

static void proton_plus_models_tools_release_page_finalize (GObject * obj);
static GType proton_plus_models_tools_release_page_get_type_once (void);
static void _vala_proton_plus_models_tools_release_page_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec);
static void _vala_proton_plus_models_tools_release_page_set_property (GObject * object,
                                                               guint property_id,
                                                               const GValue * value,
                                                               GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_models_tools_release_page_get_instance_private (ProtonPlusModelsToolsReleasePage* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusModelsToolsReleasePage_private_offset);
}

ProtonPlusModelsToolsReleasePage*
proton_plus_models_tools_release_page_construct (GType object_type,
                                                 GeeLinkedList* releases,
                                                 gint next_page,
                                                 gboolean has_more)
{
	ProtonPlusModelsToolsReleasePage * self = NULL;
	g_return_val_if_fail (releases != NULL, NULL);
	self = (ProtonPlusModelsToolsReleasePage*) g_object_new (object_type, "releases", releases, "next-page", next_page, "has-more", has_more, NULL);
	return self;
}

ProtonPlusModelsToolsReleasePage*
proton_plus_models_tools_release_page_new (GeeLinkedList* releases,
                                           gint next_page,
                                           gboolean has_more)
{
	return proton_plus_models_tools_release_page_construct (PROTON_PLUS_MODELS_TOOLS_TYPE_RELEASE_PAGE, releases, next_page, has_more);
}

GeeLinkedList*
proton_plus_models_tools_release_page_get_releases (ProtonPlusModelsToolsReleasePage* self)
{
	GeeLinkedList* result;
	GeeLinkedList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_releases;
	result = _tmp0_;
	return result;
}

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

static void
proton_plus_models_tools_release_page_set_releases (ProtonPlusModelsToolsReleasePage* self,
                                                    GeeLinkedList* value)
{
	GeeLinkedList* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tools_release_page_get_releases (self);
	if (old_value != value) {
		GeeLinkedList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_releases);
		self->priv->_releases = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tools_release_page_properties[PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_RELEASES_PROPERTY]);
	}
}

gint
proton_plus_models_tools_release_page_get_next_page (ProtonPlusModelsToolsReleasePage* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_next_page;
	return result;
}

static void
proton_plus_models_tools_release_page_set_next_page (ProtonPlusModelsToolsReleasePage* self,
                                                     gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tools_release_page_get_next_page (self);
	if (old_value != value) {
		self->priv->_next_page = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tools_release_page_properties[PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_NEXT_PAGE_PROPERTY]);
	}
}

gboolean
proton_plus_models_tools_release_page_get_has_more (ProtonPlusModelsToolsReleasePage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_has_more;
	return result;
}

static void
proton_plus_models_tools_release_page_set_has_more (ProtonPlusModelsToolsReleasePage* self,
                                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tools_release_page_get_has_more (self);
	if (old_value != value) {
		self->priv->_has_more = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tools_release_page_properties[PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_HAS_MORE_PROPERTY]);
	}
}

static void
proton_plus_models_tools_release_page_class_init (ProtonPlusModelsToolsReleasePageClass * klass,
                                                  gpointer klass_data)
{
	proton_plus_models_tools_release_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusModelsToolsReleasePage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_models_tools_release_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_models_tools_release_page_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_models_tools_release_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_RELEASES_PROPERTY, proton_plus_models_tools_release_page_properties[PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_RELEASES_PROPERTY] = g_param_spec_object ("releases", "releases", "releases", GEE_TYPE_LINKED_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_NEXT_PAGE_PROPERTY, proton_plus_models_tools_release_page_properties[PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_NEXT_PAGE_PROPERTY] = g_param_spec_int ("next-page", "next-page", "next-page", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_HAS_MORE_PROPERTY, proton_plus_models_tools_release_page_properties[PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_HAS_MORE_PROPERTY] = g_param_spec_boolean ("has-more", "has-more", "has-more", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
proton_plus_models_tools_release_page_instance_init (ProtonPlusModelsToolsReleasePage * self,
                                                     gpointer klass)
{
	self->priv = proton_plus_models_tools_release_page_get_instance_private (self);
}

static void
proton_plus_models_tools_release_page_finalize (GObject * obj)
{
	ProtonPlusModelsToolsReleasePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_MODELS_TOOLS_TYPE_RELEASE_PAGE, ProtonPlusModelsToolsReleasePage);
	_g_object_unref0 (self->priv->_releases);
	G_OBJECT_CLASS (proton_plus_models_tools_release_page_parent_class)->finalize (obj);
}

static GType
proton_plus_models_tools_release_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsToolsReleasePageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_tools_release_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsToolsReleasePage), 0, (GInstanceInitFunc) proton_plus_models_tools_release_page_instance_init, NULL };
	GType proton_plus_models_tools_release_page_type_id;
	proton_plus_models_tools_release_page_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusModelsToolsReleasePage", &g_define_type_info, 0);
	ProtonPlusModelsToolsReleasePage_private_offset = g_type_add_instance_private (proton_plus_models_tools_release_page_type_id, sizeof (ProtonPlusModelsToolsReleasePagePrivate));
	return proton_plus_models_tools_release_page_type_id;
}

GType
proton_plus_models_tools_release_page_get_type (void)
{
	static volatile gsize proton_plus_models_tools_release_page_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_tools_release_page_type_id__once)) {
		GType proton_plus_models_tools_release_page_type_id;
		proton_plus_models_tools_release_page_type_id = proton_plus_models_tools_release_page_get_type_once ();
		g_once_init_leave (&proton_plus_models_tools_release_page_type_id__once, proton_plus_models_tools_release_page_type_id);
	}
	return proton_plus_models_tools_release_page_type_id__once;
}

static void
_vala_proton_plus_models_tools_release_page_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec)
{
	ProtonPlusModelsToolsReleasePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TOOLS_TYPE_RELEASE_PAGE, ProtonPlusModelsToolsReleasePage);
	switch (property_id) {
		case PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_RELEASES_PROPERTY:
		g_value_set_object (value, proton_plus_models_tools_release_page_get_releases (self));
		break;
		case PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_NEXT_PAGE_PROPERTY:
		g_value_set_int (value, proton_plus_models_tools_release_page_get_next_page (self));
		break;
		case PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_HAS_MORE_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_tools_release_page_get_has_more (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_models_tools_release_page_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec)
{
	ProtonPlusModelsToolsReleasePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TOOLS_TYPE_RELEASE_PAGE, ProtonPlusModelsToolsReleasePage);
	switch (property_id) {
		case PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_RELEASES_PROPERTY:
		proton_plus_models_tools_release_page_set_releases (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_NEXT_PAGE_PROPERTY:
		proton_plus_models_tools_release_page_set_next_page (self, g_value_get_int (value));
		break;
		case PROTON_PLUS_MODELS_TOOLS_RELEASE_PAGE_HAS_MORE_PROPERTY:
		proton_plus_models_tools_release_page_set_has_more (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

