require "smartinput"

local lng = smartinput.new_language("笔", "Stroke")

local pkgname = ""

lng.support_mode = smartinput.context.MATH + smartinput.context.PHONE + smartinput.context.NUMBER

lng.surfaces = {
    {
        surface_id = pkgname .. "chsstroke_soft.sur",
        surface_type = smartinput.surface_type.SOFT_KEYBOARD,
        surface_subtype = smartinput.surface_subtype.KEYBOARD_OHTER,
        surface_display_name = "chsstroke_soft",
    },

    {
        surface_id = "chs_sym_number.sur",
        surface_type = smartinput.surface_type.SOFT_SYMBOL,
        support_mode = smartinput.context.NUMBER + smartinput.context.MATH,
        surface_display_name = "symbol",
    },
    
    {
        surface_id = "more.sur",
        surface_type = smartinput.surface_type.SOFT_FULLCANDIDATE,
        surface_display_name = "more",
    },

    {
        surface_id = "chs_abc.sur",
        surface_type = smartinput.surface_type.SOFT_SPECIAL,
        surface_layout = smartinput.surface_layout.QW,
        surface_display_name = "abc",
    },

    {
        surface_id = "number.sur",
        surface_type = smartinput.surface_type.SOFT_SYMBOL,
        support_mode = smartinput.context.NUMBER + smartinput.context.MATH,
        surface_display_name = "number",
    },

    {
        surface_id = "number_only.sur",
        surface_type = smartinput.surface_type.SOFT_SYMBOL,
        surface_display_name = "number_only",
    },

}

lng.support_keyboard = {
	smartinput.keyboard_type.SOFT_KEYBOARD
}

lng.categories[smartinput.language.category.FASTSWITCH] = "chinese"
lng.categories[smartinput.language.category.LAYOUT] = "chinese_stroke"
lng.categories[smartinput.language.category.USERWORD] = "chinese_simplified"

lng.traits = pkgname .. "chsstroke_traits.trt"

lng.dictionary = smartinput.new_engine(smartinput.dictionary.engine_type.OCEAN, smartinput.dictionary.dict_type.CHS_STROKE)

lng.dictionary.files = {
	{
		file_name = "pinyin.rom",
		file_type = smartinput.dictionary.image_type.ROM,
		open_mode = smartinput.file.READ,
		load_mode = smartinput.dictionary.load_mode.PURE_ARRAY,
	},
	{
		file_name = pkgname .. "bihua.rom",
		file_type = smartinput.dictionary.image_type.ROM,
		open_mode = smartinput.file.READ,
		load_mode = smartinput.dictionary.load_mode.PURE_ARRAY,
	},
	{	
		file_name = pkgname .. "bihua.ram",
		file_type = smartinput.dictionary.image_type.RAM,
		open_mode = smartinput.file.READWRITE,
		load_mode = smartinput.dictionary.load_mode.PURE_ARRAY,
	},
	{	
		file_name = "chinese_simplified.usr",
		file_type = smartinput.dictionary.image_type.USR,
		open_mode = smartinput.file.READWRITE,
		load_mode = smartinput.dictionary.load_mode.PURE_ARRAY,
	},
}

return lng

