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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * This program 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 3 of the License, or (at your option) any later version.
 *
 * This program 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 this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <glib-object.h>
#include "planify.h"
#include <stdlib.h>
#include <string.h>
#include <glib.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM (dialogs_quick_find_quick_find_item_get_type ())
#define DIALOGS_QUICK_FIND_QUICK_FIND_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem))
#define DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItemClass))
#define DIALOGS_QUICK_FIND_IS_QUICK_FIND_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM))
#define DIALOGS_QUICK_FIND_IS_QUICK_FIND_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM))
#define DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItemClass))

typedef struct _DialogsQuickFindQuickFindItem DialogsQuickFindQuickFindItem;
typedef struct _DialogsQuickFindQuickFindItemClass DialogsQuickFindQuickFindItemClass;
typedef struct _DialogsQuickFindQuickFindItemPrivate DialogsQuickFindQuickFindItemPrivate;
enum  {
	DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_0_PROPERTY,
	DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_BASE_OBJECT_PROPERTY,
	DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_PATTERN_PROPERTY,
	DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_NUM_PROPERTIES
};
static GParamSpec* dialogs_quick_find_quick_find_item_properties[DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DialogsQuickFindQuickFindItem {
	GObject parent_instance;
	DialogsQuickFindQuickFindItemPrivate * priv;
};

struct _DialogsQuickFindQuickFindItemClass {
	GObjectClass parent_class;
};

struct _DialogsQuickFindQuickFindItemPrivate {
	ObjectsBaseObject* _base_object;
	gchar* _pattern;
};

static gint DialogsQuickFindQuickFindItem_private_offset;
static gpointer dialogs_quick_find_quick_find_item_parent_class = NULL;

VALA_EXTERN GType dialogs_quick_find_quick_find_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsQuickFindQuickFindItem, g_object_unref)
VALA_EXTERN DialogsQuickFindQuickFindItem* dialogs_quick_find_quick_find_item_new (ObjectsBaseObject* base_object,
                                                                       const gchar* pattern);
VALA_EXTERN DialogsQuickFindQuickFindItem* dialogs_quick_find_quick_find_item_construct (GType object_type,
                                                                             ObjectsBaseObject* base_object,
                                                                             const gchar* pattern);
VALA_EXTERN ObjectsBaseObject* dialogs_quick_find_quick_find_item_get_base_object (DialogsQuickFindQuickFindItem* self);
static void dialogs_quick_find_quick_find_item_set_base_object (DialogsQuickFindQuickFindItem* self,
                                                         ObjectsBaseObject* value);
VALA_EXTERN const gchar* dialogs_quick_find_quick_find_item_get_pattern (DialogsQuickFindQuickFindItem* self);
VALA_EXTERN void dialogs_quick_find_quick_find_item_set_pattern (DialogsQuickFindQuickFindItem* self,
                                                     const gchar* value);
static void dialogs_quick_find_quick_find_item_finalize (GObject * obj);
static GType dialogs_quick_find_quick_find_item_get_type_once (void);
static void _vala_dialogs_quick_find_quick_find_item_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_dialogs_quick_find_quick_find_item_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);

static inline gpointer
dialogs_quick_find_quick_find_item_get_instance_private (DialogsQuickFindQuickFindItem* self)
{
	return G_STRUCT_MEMBER_P (self, DialogsQuickFindQuickFindItem_private_offset);
}

DialogsQuickFindQuickFindItem*
dialogs_quick_find_quick_find_item_construct (GType object_type,
                                              ObjectsBaseObject* base_object,
                                              const gchar* pattern)
{
	DialogsQuickFindQuickFindItem * self = NULL;
	g_return_val_if_fail (base_object != NULL, NULL);
	g_return_val_if_fail (pattern != NULL, NULL);
	self = (DialogsQuickFindQuickFindItem*) g_object_new (object_type, "base-object", base_object, "pattern", pattern, NULL);
	return self;
}

DialogsQuickFindQuickFindItem*
dialogs_quick_find_quick_find_item_new (ObjectsBaseObject* base_object,
                                        const gchar* pattern)
{
	return dialogs_quick_find_quick_find_item_construct (DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, base_object, pattern);
}

ObjectsBaseObject*
dialogs_quick_find_quick_find_item_get_base_object (DialogsQuickFindQuickFindItem* self)
{
	ObjectsBaseObject* result;
	ObjectsBaseObject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_base_object;
	result = _tmp0_;
	return result;
}

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

static void
dialogs_quick_find_quick_find_item_set_base_object (DialogsQuickFindQuickFindItem* self,
                                                    ObjectsBaseObject* value)
{
	ObjectsBaseObject* old_value;
	g_return_if_fail (self != NULL);
	old_value = dialogs_quick_find_quick_find_item_get_base_object (self);
	if (old_value != value) {
		ObjectsBaseObject* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_base_object);
		self->priv->_base_object = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dialogs_quick_find_quick_find_item_properties[DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_BASE_OBJECT_PROPERTY]);
	}
}

const gchar*
dialogs_quick_find_quick_find_item_get_pattern (DialogsQuickFindQuickFindItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_pattern;
	result = _tmp0_;
	return result;
}

void
dialogs_quick_find_quick_find_item_set_pattern (DialogsQuickFindQuickFindItem* self,
                                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dialogs_quick_find_quick_find_item_get_pattern (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_pattern);
		self->priv->_pattern = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dialogs_quick_find_quick_find_item_properties[DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_PATTERN_PROPERTY]);
	}
}

static void
dialogs_quick_find_quick_find_item_class_init (DialogsQuickFindQuickFindItemClass * klass,
                                               gpointer klass_data)
{
	dialogs_quick_find_quick_find_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DialogsQuickFindQuickFindItem_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dialogs_quick_find_quick_find_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dialogs_quick_find_quick_find_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = dialogs_quick_find_quick_find_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_BASE_OBJECT_PROPERTY, dialogs_quick_find_quick_find_item_properties[DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_BASE_OBJECT_PROPERTY] = g_param_spec_object ("base-object", "base-object", "base-object", OBJECTS_TYPE_BASE_OBJECT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_PATTERN_PROPERTY, dialogs_quick_find_quick_find_item_properties[DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_PATTERN_PROPERTY] = g_param_spec_string ("pattern", "pattern", "pattern", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dialogs_quick_find_quick_find_item_instance_init (DialogsQuickFindQuickFindItem * self,
                                                  gpointer klass)
{
	self->priv = dialogs_quick_find_quick_find_item_get_instance_private (self);
}

static void
dialogs_quick_find_quick_find_item_finalize (GObject * obj)
{
	DialogsQuickFindQuickFindItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem);
	g_debug ("QuickFindItem.vala:31: Destroying Dialogs.QuickFind.QuickFindItem\n");
	_g_object_unref0 (self->priv->_base_object);
	_g_free0 (self->priv->_pattern);
	G_OBJECT_CLASS (dialogs_quick_find_quick_find_item_parent_class)->finalize (obj);
}

static GType
dialogs_quick_find_quick_find_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DialogsQuickFindQuickFindItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dialogs_quick_find_quick_find_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DialogsQuickFindQuickFindItem), 0, (GInstanceInitFunc) dialogs_quick_find_quick_find_item_instance_init, NULL };
	GType dialogs_quick_find_quick_find_item_type_id;
	dialogs_quick_find_quick_find_item_type_id = g_type_register_static (G_TYPE_OBJECT, "DialogsQuickFindQuickFindItem", &g_define_type_info, 0);
	DialogsQuickFindQuickFindItem_private_offset = g_type_add_instance_private (dialogs_quick_find_quick_find_item_type_id, sizeof (DialogsQuickFindQuickFindItemPrivate));
	return dialogs_quick_find_quick_find_item_type_id;
}

GType
dialogs_quick_find_quick_find_item_get_type (void)
{
	static volatile gsize dialogs_quick_find_quick_find_item_type_id__once = 0;
	if (g_once_init_enter (&dialogs_quick_find_quick_find_item_type_id__once)) {
		GType dialogs_quick_find_quick_find_item_type_id;
		dialogs_quick_find_quick_find_item_type_id = dialogs_quick_find_quick_find_item_get_type_once ();
		g_once_init_leave (&dialogs_quick_find_quick_find_item_type_id__once, dialogs_quick_find_quick_find_item_type_id);
	}
	return dialogs_quick_find_quick_find_item_type_id__once;
}

static void
_vala_dialogs_quick_find_quick_find_item_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	DialogsQuickFindQuickFindItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem);
	switch (property_id) {
		case DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_BASE_OBJECT_PROPERTY:
		g_value_set_object (value, dialogs_quick_find_quick_find_item_get_base_object (self));
		break;
		case DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_PATTERN_PROPERTY:
		g_value_set_string (value, dialogs_quick_find_quick_find_item_get_pattern (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dialogs_quick_find_quick_find_item_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	DialogsQuickFindQuickFindItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DIALOGS_QUICK_FIND_TYPE_QUICK_FIND_ITEM, DialogsQuickFindQuickFindItem);
	switch (property_id) {
		case DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_BASE_OBJECT_PROPERTY:
		dialogs_quick_find_quick_find_item_set_base_object (self, g_value_get_object (value));
		break;
		case DIALOGS_QUICK_FIND_QUICK_FIND_ITEM_PATTERN_PROPERTY:
		dialogs_quick_find_quick_find_item_set_pattern (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

