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

/*
* 2019-2020 elementary, Inc. (https://elementary.io)
*
* 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, see <https://www.gnu.org/licenses/>.
*/

#include "keyboard.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  {
	KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_0_PROPERTY,
	KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_ID_PROPERTY,
	KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_FULL_NAME_PROPERTY,
	KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_NUM_PROPERTIES
};
static GParamSpec* keyboard_input_method_page_add_engines_list_properties[KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _KeyboardInputMethodPageAddEnginesListPrivate {
	gchar* _engine_id;
	gchar* _engine_full_name;
};

static gint KeyboardInputMethodPageAddEnginesList_private_offset;
static gpointer keyboard_input_method_page_add_engines_list_parent_class = NULL;

static void keyboard_input_method_page_add_engines_list_finalize (GObject * obj);
static GType keyboard_input_method_page_add_engines_list_get_type_once (void);
static void _vala_keyboard_input_method_page_add_engines_list_get_property (GObject * object,
                                                                     guint property_id,
                                                                     GValue * value,
                                                                     GParamSpec * pspec);
static void _vala_keyboard_input_method_page_add_engines_list_set_property (GObject * object,
                                                                     guint property_id,
                                                                     const GValue * value,
                                                                     GParamSpec * pspec);

static inline gpointer
keyboard_input_method_page_add_engines_list_get_instance_private (KeyboardInputMethodPageAddEnginesList* self)
{
	return G_STRUCT_MEMBER_P (self, KeyboardInputMethodPageAddEnginesList_private_offset);
}

KeyboardInputMethodPageAddEnginesList*
keyboard_input_method_page_add_engines_list_construct (GType object_type,
                                                       const gchar* id,
                                                       const gchar* full_name)
{
	KeyboardInputMethodPageAddEnginesList * self = NULL;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (full_name != NULL, NULL);
	self = (KeyboardInputMethodPageAddEnginesList*) g_object_new (object_type, "engine-id", id, "engine-full-name", full_name, NULL);
	return self;
}

KeyboardInputMethodPageAddEnginesList*
keyboard_input_method_page_add_engines_list_new (const gchar* id,
                                                 const gchar* full_name)
{
	return keyboard_input_method_page_add_engines_list_construct (KEYBOARD_INPUT_METHOD_PAGE_TYPE_ADD_ENGINES_LIST, id, full_name);
}

const gchar*
keyboard_input_method_page_add_engines_list_get_engine_id (KeyboardInputMethodPageAddEnginesList* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_engine_id;
	result = _tmp0_;
	return result;
}

static void
keyboard_input_method_page_add_engines_list_set_engine_id (KeyboardInputMethodPageAddEnginesList* self,
                                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = keyboard_input_method_page_add_engines_list_get_engine_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_engine_id);
		self->priv->_engine_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, keyboard_input_method_page_add_engines_list_properties[KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_ID_PROPERTY]);
	}
}

const gchar*
keyboard_input_method_page_add_engines_list_get_engine_full_name (KeyboardInputMethodPageAddEnginesList* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_engine_full_name;
	result = _tmp0_;
	return result;
}

static void
keyboard_input_method_page_add_engines_list_set_engine_full_name (KeyboardInputMethodPageAddEnginesList* self,
                                                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = keyboard_input_method_page_add_engines_list_get_engine_full_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_engine_full_name);
		self->priv->_engine_full_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, keyboard_input_method_page_add_engines_list_properties[KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_FULL_NAME_PROPERTY]);
	}
}

static void
keyboard_input_method_page_add_engines_list_class_init (KeyboardInputMethodPageAddEnginesListClass * klass,
                                                        gpointer klass_data)
{
	keyboard_input_method_page_add_engines_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &KeyboardInputMethodPageAddEnginesList_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_keyboard_input_method_page_add_engines_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_keyboard_input_method_page_add_engines_list_set_property;
	G_OBJECT_CLASS (klass)->finalize = keyboard_input_method_page_add_engines_list_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_ID_PROPERTY, keyboard_input_method_page_add_engines_list_properties[KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_ID_PROPERTY] = g_param_spec_string ("engine-id", "engine-id", "engine-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_FULL_NAME_PROPERTY, keyboard_input_method_page_add_engines_list_properties[KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_FULL_NAME_PROPERTY] = g_param_spec_string ("engine-full-name", "engine-full-name", "engine-full-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
keyboard_input_method_page_add_engines_list_instance_init (KeyboardInputMethodPageAddEnginesList * self,
                                                           gpointer klass)
{
	self->priv = keyboard_input_method_page_add_engines_list_get_instance_private (self);
}

static void
keyboard_input_method_page_add_engines_list_finalize (GObject * obj)
{
	KeyboardInputMethodPageAddEnginesList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, KEYBOARD_INPUT_METHOD_PAGE_TYPE_ADD_ENGINES_LIST, KeyboardInputMethodPageAddEnginesList);
	_g_free0 (self->priv->_engine_id);
	_g_free0 (self->priv->_engine_full_name);
	G_OBJECT_CLASS (keyboard_input_method_page_add_engines_list_parent_class)->finalize (obj);
}

static GType
keyboard_input_method_page_add_engines_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (KeyboardInputMethodPageAddEnginesListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) keyboard_input_method_page_add_engines_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (KeyboardInputMethodPageAddEnginesList), 0, (GInstanceInitFunc) keyboard_input_method_page_add_engines_list_instance_init, NULL };
	GType keyboard_input_method_page_add_engines_list_type_id;
	keyboard_input_method_page_add_engines_list_type_id = g_type_register_static (G_TYPE_OBJECT, "KeyboardInputMethodPageAddEnginesList", &g_define_type_info, 0);
	KeyboardInputMethodPageAddEnginesList_private_offset = g_type_add_instance_private (keyboard_input_method_page_add_engines_list_type_id, sizeof (KeyboardInputMethodPageAddEnginesListPrivate));
	return keyboard_input_method_page_add_engines_list_type_id;
}

GType
keyboard_input_method_page_add_engines_list_get_type (void)
{
	static volatile gsize keyboard_input_method_page_add_engines_list_type_id__once = 0;
	if (g_once_init_enter (&keyboard_input_method_page_add_engines_list_type_id__once)) {
		GType keyboard_input_method_page_add_engines_list_type_id;
		keyboard_input_method_page_add_engines_list_type_id = keyboard_input_method_page_add_engines_list_get_type_once ();
		g_once_init_leave (&keyboard_input_method_page_add_engines_list_type_id__once, keyboard_input_method_page_add_engines_list_type_id);
	}
	return keyboard_input_method_page_add_engines_list_type_id__once;
}

static void
_vala_keyboard_input_method_page_add_engines_list_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec)
{
	KeyboardInputMethodPageAddEnginesList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, KEYBOARD_INPUT_METHOD_PAGE_TYPE_ADD_ENGINES_LIST, KeyboardInputMethodPageAddEnginesList);
	switch (property_id) {
		case KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_ID_PROPERTY:
		g_value_set_string (value, keyboard_input_method_page_add_engines_list_get_engine_id (self));
		break;
		case KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_FULL_NAME_PROPERTY:
		g_value_set_string (value, keyboard_input_method_page_add_engines_list_get_engine_full_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_keyboard_input_method_page_add_engines_list_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec)
{
	KeyboardInputMethodPageAddEnginesList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, KEYBOARD_INPUT_METHOD_PAGE_TYPE_ADD_ENGINES_LIST, KeyboardInputMethodPageAddEnginesList);
	switch (property_id) {
		case KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_ID_PROPERTY:
		keyboard_input_method_page_add_engines_list_set_engine_id (self, g_value_get_string (value));
		break;
		case KEYBOARD_INPUT_METHOD_PAGE_ADD_ENGINES_LIST_ENGINE_FULL_NAME_PROPERTY:
		keyboard_input_method_page_add_engines_list_set_engine_full_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

