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

/*
 * Copyright (C) 2012-2014 Daiki Ueno <ueno@gnu.org>
 * Copyright (C) 2012-2014 Red Hat, Inc.
 *
 * 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 <http://www.gnu.org/licenses/>.
 */

#include "libkkc/libkkc.h"
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <config.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

#define KKC_TYPE_DICTIONARY_UTILS (kkc_dictionary_utils_get_type ())
#define KKC_DICTIONARY_UTILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), KKC_TYPE_DICTIONARY_UTILS, KkcDictionaryUtils))
#define KKC_DICTIONARY_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), KKC_TYPE_DICTIONARY_UTILS, KkcDictionaryUtilsClass))
#define KKC_IS_DICTIONARY_UTILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KKC_TYPE_DICTIONARY_UTILS))
#define KKC_IS_DICTIONARY_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), KKC_TYPE_DICTIONARY_UTILS))
#define KKC_DICTIONARY_UTILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), KKC_TYPE_DICTIONARY_UTILS, KkcDictionaryUtilsClass))

typedef struct _KkcDictionaryUtils KkcDictionaryUtils;
typedef struct _KkcDictionaryUtilsClass KkcDictionaryUtilsClass;
#define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL)))

#define KKC_TYPE_KEY_EVENT_UTILS (kkc_key_event_utils_get_type ())
#define KKC_KEY_EVENT_UTILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), KKC_TYPE_KEY_EVENT_UTILS, KkcKeyEventUtils))
#define KKC_KEY_EVENT_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), KKC_TYPE_KEY_EVENT_UTILS, KkcKeyEventUtilsClass))
#define KKC_IS_KEY_EVENT_UTILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KKC_TYPE_KEY_EVENT_UTILS))
#define KKC_IS_KEY_EVENT_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), KKC_TYPE_KEY_EVENT_UTILS))
#define KKC_KEY_EVENT_UTILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), KKC_TYPE_KEY_EVENT_UTILS, KkcKeyEventUtilsClass))

typedef struct _KkcKeyEventUtils KkcKeyEventUtils;
typedef struct _KkcKeyEventUtilsClass KkcKeyEventUtilsClass;

#define KKC_TYPE_ROM_KANA_UTILS (kkc_rom_kana_utils_get_type ())
#define KKC_ROM_KANA_UTILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), KKC_TYPE_ROM_KANA_UTILS, KkcRomKanaUtils))
#define KKC_ROM_KANA_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), KKC_TYPE_ROM_KANA_UTILS, KkcRomKanaUtilsClass))
#define KKC_IS_ROM_KANA_UTILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KKC_TYPE_ROM_KANA_UTILS))
#define KKC_IS_ROM_KANA_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), KKC_TYPE_ROM_KANA_UTILS))
#define KKC_ROM_KANA_UTILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), KKC_TYPE_ROM_KANA_UTILS, KkcRomKanaUtilsClass))

typedef struct _KkcRomKanaUtils KkcRomKanaUtils;
typedef struct _KkcRomKanaUtilsClass KkcRomKanaUtilsClass;

gboolean kkc_use_mapped_index_file = FALSE;

VALA_EXTERN GType kkc_dictionary_utils_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType kkc_key_event_utils_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType kkc_rom_kana_utils_get_type (void) G_GNUC_CONST ;
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

/**
     * Initialize libkkc.
     *
     * Must be called before using any functions in libkkc.
     */
void
kkc_init (void)
{
	GTypeClass* _tmp0_;
	GTypeClass* _tmp1_;
	GTypeClass* _tmp2_;
	GTypeClass* _tmp3_;
	GTypeClass* _tmp4_;
	GTypeClass* _tmp5_;
	GTypeClass* _tmp6_;
	GTypeClass* _tmp7_;
	GTypeClass* _tmp8_;
	GTypeClass* _tmp9_;
	GTypeClass* _tmp10_;
	GTypeClass* _tmp11_;
	_tmp0_ = g_type_class_ref (KKC_TYPE_DICTIONARY_UTILS);
	_tmp1_ = _tmp0_;
	_g_type_class_unref0 (_tmp1_);
	_tmp2_ = g_type_class_ref (KKC_TYPE_KEYMAP);
	_tmp3_ = _tmp2_;
	_g_type_class_unref0 (_tmp3_);
	_tmp4_ = g_type_class_ref (KKC_TYPE_KEY_EVENT_UTILS);
	_tmp5_ = _tmp4_;
	_g_type_class_unref0 (_tmp5_);
	_tmp6_ = g_type_class_ref (KKC_TYPE_LANGUAGE_MODEL_METADATA);
	_tmp7_ = _tmp6_;
	_g_type_class_unref0 (_tmp7_);
	_tmp8_ = g_type_class_ref (KKC_TYPE_RULE_METADATA);
	_tmp9_ = _tmp8_;
	_g_type_class_unref0 (_tmp9_);
	_tmp10_ = g_type_class_ref (KKC_TYPE_ROM_KANA_UTILS);
	_tmp11_ = _tmp10_;
	_g_type_class_unref0 (_tmp11_);
	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
}

/**
     * Type to specify input modes.
     */
static GType
kkc_input_mode_get_type_once (void)
{
	static const GEnumValue values[] = {{KKC_INPUT_MODE_HIRAGANA, "KKC_INPUT_MODE_HIRAGANA", "hiragana"}, {KKC_INPUT_MODE_KATAKANA, "KKC_INPUT_MODE_KATAKANA", "katakana"}, {KKC_INPUT_MODE_HANKAKU_KATAKANA, "KKC_INPUT_MODE_HANKAKU_KATAKANA", "hankaku-katakana"}, {KKC_INPUT_MODE_LATIN, "KKC_INPUT_MODE_LATIN", "latin"}, {KKC_INPUT_MODE_WIDE_LATIN, "KKC_INPUT_MODE_WIDE_LATIN", "wide-latin"}, {KKC_INPUT_MODE_DIRECT, "KKC_INPUT_MODE_DIRECT", "direct"}, {0, NULL, NULL}};
	GType kkc_input_mode_type_id;
	kkc_input_mode_type_id = g_enum_register_static ("KkcInputMode", values);
	return kkc_input_mode_type_id;
}

GType
kkc_input_mode_get_type (void)
{
	static volatile gsize kkc_input_mode_type_id__once = 0;
	if (g_once_init_enter (&kkc_input_mode_type_id__once)) {
		GType kkc_input_mode_type_id;
		kkc_input_mode_type_id = kkc_input_mode_get_type_once ();
		g_once_init_leave (&kkc_input_mode_type_id__once, kkc_input_mode_type_id);
	}
	return kkc_input_mode_type_id__once;
}

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;
}

