예제 #1
0
WideString
HangulFactory::get_help () const
{
    const char *header =
	_("Key bindings:\n");

    String hangul_keys;
    String hanja_keys;
    scim_key_list_to_string(hangul_keys, m_hangul_keys);
    scim_key_list_to_string(hanja_keys, m_hanja_keys);

    char paragraph1[512];
    char paragraph2[512];

    snprintf(paragraph1, sizeof(paragraph1),
	_("  Hangul key: %s\n"
	  "    This key binding is to switch the input mode between the ASCII input \n"
	  "    mode and the hangul input mode.\n"), hangul_keys.c_str());
    snprintf(paragraph2, sizeof(paragraph2),
	_("  Hanja key: %s\n"
	  "    This key binding is to convert a hangul character to a hanja character.\n"), hanja_keys.c_str());

    return utf8_mbstowcs (header)
	+ utf8_mbstowcs (paragraph1)
	+ utf8_mbstowcs (paragraph2);
}
예제 #2
0
void
FrontEndHotkeyMatcher::save_hotkeys (const ConfigPointer &config) const
{
    if (config.null () || !config->valid ()) return;

    KeyEventList keys;
    String keystr;

    for (int i = SCIM_FRONTEND_HOTKEY_TRIGGER; i <= SCIM_FRONTEND_HOTKEY_SHOW_FACTORY_MENU; ++i) {
        if (m_impl->m_matcher.find_hotkeys (i, keys) > 0 && scim_key_list_to_string (keystr, keys))
            config->write (String (__scim_frontend_hotkey_config_paths [i]), keystr);
    }
}
예제 #3
0
void
IMEngineHotkeyMatcher::save_hotkeys (const ConfigPointer &config) const
{
    if (config.null () || !config->valid () || !m_impl->m_uuids.size ()) return;

    KeyEventList keys;
    String keystr;
    std::vector <String> uuids;

    for (size_t i = 0; i < m_impl->m_uuids.size (); ++i) {
        if (m_impl->m_matcher.find_hotkeys ((int) i, keys) > 0 && scim_key_list_to_string (keystr, keys)) {
            config->write (String (SCIM_CONFIG_HOTKEYS_IMENGINE "/") + m_impl->m_uuids [i], keystr);
            uuids.push_back (m_impl->m_uuids [i]);
        }
    }

    config->write (String (SCIM_CONFIG_HOTKEYS_IMENGINE_LIST), scim_combine_string_list (uuids));
}