/* InstallList.c generated by valac 0.56.19, the Vala compiler
 * generated from InstallList.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/gi18n-lib.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

gchar*
keyboard_input_method_page_install_list_get_name (KeyboardInputMethodPageInstallList self)
{
	gchar* result;
	switch (self) {
		case KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_JA:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup (_ ("Japanese"));
			result = _tmp0_;
			return result;
		}
		case KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_KO:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup (_ ("Korean"));
			result = _tmp1_;
			return result;
		}
		case KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup (_ ("Chinese"));
			result = _tmp2_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

gchar**
keyboard_input_method_page_install_list_get_components (KeyboardInputMethodPageInstallList self,
                                                        gint* result_length1)
{
	gchar** result;
	switch (self) {
		case KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_JA:
		{
			gchar* _tmp0_;
			gchar* _tmp1_;
			gchar* _tmp2_;
			gchar** _tmp3_;
			gchar** _tmp4_;
			gint _tmp4__length1;
			_tmp0_ = g_strdup ("ibus-anthy");
			_tmp1_ = g_strdup ("ibus-mozc");
			_tmp2_ = g_strdup ("ibus-skk");
			_tmp3_ = g_new0 (gchar*, 3 + 1);
			_tmp3_[0] = _tmp0_;
			_tmp3_[1] = _tmp1_;
			_tmp3_[2] = _tmp2_;
			_tmp4_ = _tmp3_;
			_tmp4__length1 = 3;
			if (result_length1) {
				*result_length1 = _tmp4__length1;
			}
			result = _tmp4_;
			return result;
		}
		case KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_KO:
		{
			gchar* _tmp5_;
			gchar** _tmp6_;
			gchar** _tmp7_;
			gint _tmp7__length1;
			_tmp5_ = g_strdup ("ibus-hangul");
			_tmp6_ = g_new0 (gchar*, 1 + 1);
			_tmp6_[0] = _tmp5_;
			_tmp7_ = _tmp6_;
			_tmp7__length1 = 1;
			if (result_length1) {
				*result_length1 = _tmp7__length1;
			}
			result = _tmp7_;
			return result;
		}
		case KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH:
		{
			gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			gchar** _tmp12_;
			gchar** _tmp13_;
			gint _tmp13__length1;
			_tmp8_ = g_strdup ("ibus-cangjie");
			_tmp9_ = g_strdup ("ibus-chewing");
			_tmp10_ = g_strdup ("ibus-pinyin");
			_tmp11_ = g_strdup ("ibus-rime");
			_tmp12_ = g_new0 (gchar*, 4 + 1);
			_tmp12_[0] = _tmp8_;
			_tmp12_[1] = _tmp9_;
			_tmp12_[2] = _tmp10_;
			_tmp12_[3] = _tmp11_;
			_tmp13_ = _tmp12_;
			_tmp13__length1 = 4;
			if (result_length1) {
				*result_length1 = _tmp13__length1;
			}
			result = _tmp13_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

KeyboardInputMethodPageInstallList
keyboard_input_method_page_install_list_get_language_from_engine_name (const gchar* engine_name)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	static GQuark _tmp1_label3 = 0;
	static GQuark _tmp1_label4 = 0;
	static GQuark _tmp1_label5 = 0;
	static GQuark _tmp1_label6 = 0;
	static GQuark _tmp1_label7 = 0;
	KeyboardInputMethodPageInstallList result;
	g_return_val_if_fail (engine_name != NULL, 0);
	_tmp0_ = engine_name;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("ibus-anthy")))) {
		switch (0) {
			default:
			{
				result = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_JA;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("ibus-mozc")))) {
		switch (0) {
			default:
			{
				result = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_JA;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("ibus-skk")))) {
		switch (0) {
			default:
			{
				result = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_JA;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("ibus-hangul")))) {
		switch (0) {
			default:
			{
				result = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_KO;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label4) ? _tmp1_label4 : (_tmp1_label4 = g_quark_from_static_string ("ibus-cangjie")))) {
		switch (0) {
			default:
			{
				result = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label5) ? _tmp1_label5 : (_tmp1_label5 = g_quark_from_static_string ("ibus-chewing")))) {
		switch (0) {
			default:
			{
				result = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label6) ? _tmp1_label6 : (_tmp1_label6 = g_quark_from_static_string ("ibus-pinyin")))) {
		switch (0) {
			default:
			{
				result = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label7) ? _tmp1_label7 : (_tmp1_label7 = g_quark_from_static_string ("ibus-rime")))) {
		switch (0) {
			default:
			{
				result = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				g_assert_not_reached ();
			}
		}
	}
}

KeyboardInputMethodPageInstallList*
keyboard_input_method_page_install_list_get_all (gint* result_length1)
{
	KeyboardInputMethodPageInstallList* _tmp0_;
	KeyboardInputMethodPageInstallList* _tmp1_;
	gint _tmp1__length1;
	KeyboardInputMethodPageInstallList* result;
	_tmp0_ = g_new0 (KeyboardInputMethodPageInstallList, 3);
	_tmp0_[0] = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_JA;
	_tmp0_[1] = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_KO;
	_tmp0_[2] = KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 3;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static GType
keyboard_input_method_page_install_list_get_type_once (void)
{
	static const GEnumValue values[] = {{KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_JA, "KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_JA", "ja"}, {KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_KO, "KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_KO", "ko"}, {KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH, "KEYBOARD_INPUT_METHOD_PAGE_INSTALL_LIST_ZH", "zh"}, {0, NULL, NULL}};
	GType keyboard_input_method_page_install_list_type_id;
	keyboard_input_method_page_install_list_type_id = g_enum_register_static ("KeyboardInputMethodPageInstallList", values);
	return keyboard_input_method_page_install_list_type_id;
}

GType
keyboard_input_method_page_install_list_get_type (void)
{
	static volatile gsize keyboard_input_method_page_install_list_type_id__once = 0;
	if (g_once_init_enter (&keyboard_input_method_page_install_list_type_id__once)) {
		GType keyboard_input_method_page_install_list_type_id;
		keyboard_input_method_page_install_list_type_id = keyboard_input_method_page_install_list_get_type_once ();
		g_once_init_leave (&keyboard_input_method_page_install_list_type_id__once, keyboard_input_method_page_install_list_type_id);
	}
	return keyboard_input_method_page_install_list_type_id__once;
}

