本文整理汇总了C++中ConfigPointer类的典型用法代码示例。如果您正苦于以下问题:C++ ConfigPointer类的具体用法?C++ ConfigPointer怎么用?C++ ConfigPointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfigPointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: String
void
HangulFactory::reload_config(const ConfigPointer &config)
{
if (config.null())
return;
m_show_candidate_comment = config->read(String(SCIM_CONFIG_SHOW_CANDIDATE_COMMENT),
m_show_candidate_comment);
m_keyboard_layout = config->read(String(SCIM_CONFIG_LAYOUT), String("2"));
m_use_ascii_mode = config->read(String(SCIM_CONFIG_USE_ASCII_MODE),
false);
m_commit_by_word = config->read(String(SCIM_CONFIG_COMMIT_BY_WORD),
false);
m_hanja_mode = config->read(String(SCIM_CONFIG_HANJA_MODE),
false);
String str;
str = config->read(String(SCIM_CONFIG_HANGUL_KEY),
String("Hangul,Shift+space"));
scim_string_to_key_list(m_hangul_keys, str);
str = config->read(String (SCIM_CONFIG_HANJA_KEY),
String ("Hangul_Hanja,F9"));
scim_string_to_key_list(m_hanja_keys, str);
str = config->read(String (SCIM_CONFIG_HANJA_MODE_KEY),
String (""));
scim_string_to_key_list(m_hanja_mode_keys, str);
m_lookup_table_vertical = config->read(String(SCIM_CONFIG_PANEL_LOOKUP_TABLE_VERTICAL),
false);
}
示例2: save_config
void save_config(const ConfigPointer& config)
{
//Don't save to a null config file.
if (config.null())
return;
//Flash our file: burmese_numerals
int id = 0;
for (int i=0; i<__burmese_numerals_config_opts; i++) {
if (__config_burmese_numerals == __burmese_numerals_config_vals[i])
id = i;
}
config->write(String(SCIM_CONFIG_IMENGINE_WAITZAR_BURMESE_NUMERALS), String(__burmese_numerals_config_string[id]));
//Flash our file: default_encoding
id = 0;
for (int i=0; i<__default_encoding_config_opts; i++) {
if (__config_default_encoding == __default_encoding_config_vals[i])
id = i;
}
config->write(String(SCIM_CONFIG_IMENGINE_WAITZAR_DEFAULT_ENCODING), String(__default_encoding_config_string[id]));
//The update is complete
__has_changed = false;
}
示例3: load_config
void load_config (const ConfigPointer& config)
{
//Don't parse null configurations
if (!config)
return;
//Read option 1: burmese_numerals
String str = config->read(String(SCIM_CONFIG_IMENGINE_WAITZAR_BURMESE_NUMERALS), String(__burmese_numerals_config_string[0]));
__config_burmese_numerals = __burmese_numerals_config_vals[0];
for (int i=0; i<__burmese_numerals_config_opts; i++) {
if (str == __burmese_numerals_config_string[i])
__config_burmese_numerals = __burmese_numerals_config_vals[i];
}
//Read option 2: default_encoding
str = config->read(String(SCIM_CONFIG_IMENGINE_WAITZAR_DEFAULT_ENCODING), String(__default_encoding_config_string[0]));
__config_default_encoding = __default_encoding_config_vals[0];
for (int i=0; i<__default_encoding_config_opts; i++) {
if (str == __default_encoding_config_string[i])
__config_default_encoding = __default_encoding_config_vals[i];
}
//Reset the radio buttons
setup_widget_value ();
}
示例4:
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);
}
}
示例5: slot_reload_config
void ScimBridgeAgentImpl::slot_reload_config (const ConfigPointer &config)
{
scim_bridge_pdebugln (8, "slot_reload_config ()");
scim_frontend_hotkey_matcher.load_hotkeys (scim_config);
scim_imengine_hotkey_matcher.load_hotkeys (scim_config);
KeyEvent key;
scim_string_to_key (key,
config->read (String (SCIM_CONFIG_HOTKEYS_FRONTEND_VALID_KEY_MASK),
String ("Shift+Control+Alt+Lock")));
int key_mask = (key.mask > 0) ? key.mask : 0xFFFF;
key_mask |= SCIM_KEY_ReleaseMask;
// Special treatment for two backslash keys on jp106 keyboard.
key_mask |= SCIM_KEY_QuirkKanaRoMask;
valid_key_mask = key_mask;
ScimBridgeAgentIMContext::set_enabled_by_default (scim_config->read (String (SCIM_CONFIG_FRONTEND_IM_OPENED_BY_DEFAULT), ScimBridgeAgentIMContext::is_enabled_by_default ()));
ScimBridgeAgentIMContext::set_imengine_shared (scim_config->read (String (SCIM_CONFIG_FRONTEND_SHARED_INPUT_METHOD), ScimBridgeAgentIMContext::is_imengine_shared ()));
ScimBridgeAgentIMContext::set_on_the_spot_enabled (scim_config->read (String (SCIM_CONFIG_FRONTEND_ON_THE_SPOT), ScimBridgeAgentIMContext::is_on_the_spot_enabled ()));
// Get keyboard layout setting
// Flush the global config first, in order to load the new configs from disk.
scim_global_config_flush ();
scim_keyboard_layout = scim_get_default_keyboard_layout ();
// Hot key name, hot key config key.
// ! Update hotkey_list_length according to updated list length.
int hotkey_list_length = 6;
String hotkey_list[][2] = {
{ "Toggle on/off - ", "/Hotkeys/FrontEnd/Trigger" },
{ "Turn on - ", "/Hotkeys/FrontEnd/On" },
{ "Turn off - ", "/Hotkeys/FrontEnd/Off" },
{ "Next input method - ", "/Hotkeys/FrontEnd/NextFactory" },
{ "Previous input method - ", "/Hotkeys/FrontEnd/PreviousFactory" },
{ "Show input method menu - ", "/Hotkeys/FrontEnd/ShowFactoryMenu" }
};
// Undefined hot keys are hidden from help window.
String help_hotkeys = "\nGlobal Hotkeys:";
for ( int i = 0; i < hotkey_list_length; i++ ) {
String tmp_hotkeys = scim_config->read (String (hotkey_list[i][1]), String (""));
if ( tmp_hotkeys != "" )
help_hotkeys += "\n" + hotkey_list[i][0] + "<" + tmp_hotkeys + ">";
}
ScimBridgeAgentIMContext::set_help_hotkeys (help_hotkeys);
}
示例6: clear
void
FrontEndHotkeyMatcher::load_hotkeys (const ConfigPointer &config)
{
clear ();
if (config.null () || !config->valid ()) return;
KeyEventList keys;
// Load the least important hotkeys first.
for (int i = SCIM_FRONTEND_HOTKEY_SHOW_FACTORY_MENU; i >= SCIM_FRONTEND_HOTKEY_TRIGGER; --i) {
if (scim_string_to_key_list (keys, config->read (String (__scim_frontend_hotkey_config_paths [i]), String (__scim_frontend_hotkey_defaults [i]))))
m_impl->m_matcher.add_hotkeys (keys, i);
}
}
示例7: romaji_page_save_config
void
romaji_page_save_config (const ConfigPointer &config)
{
__config_romaji_theme_file
= config->write (String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE),
String (__config_romaji_theme_file));
}
示例8: romaji_page_load_config
void
romaji_page_load_config (const ConfigPointer &config)
{
__config_romaji_theme_file
= config->read (String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE),
String (SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_DEFAULT));
setup_romaji_page ();
}
示例9: String
void
ArrayFactory::reload_config(const ConfigPointer &config)
{
if (config.null())
return;
String str;
str = config->read(String(SCIM_CONFIG_IMENGINE_ARRAY_ENCHKEY),
String(""));
scim_string_to_key_list(m_ench_key, str);
str = config->read(String(SCIM_CONFIG_IMENGINE_ARRAY_HFKEY),
String("Shift+space"));
scim_string_to_key_list(m_full_half_key, str);
m_show_special = config->read(String(SCIM_CONFIG_IMENGINE_ARRAY_SHOW_SPECIAL),
false);
m_special_code_only = config->read(String(SCIM_CONFIG_IMENGINE_ARRAY_SPECIAL_CODE_ONLY),
false);
}
示例10: isf_get_keyboard_ise
/**
* @brief Get keyboard ISE
*
* @param ise_uuid The keyboard ISE uuid.
* @param ise_name The keyboard ISE name.
*/
void isf_get_keyboard_ise (String &ise_uuid, String &ise_name, const ConfigPointer &config)
{
String language = String ("~other");
String uuid = config->read (String (SCIM_CONFIG_DEFAULT_IMENGINE_FACTORY) + String ("/") + language, String ("d75857a5-4148-4745-89e2-1da7ddaf7999"));
if (ise_uuid.length () > 0)
uuid = ise_uuid;
for (unsigned int i = 0; i < _uuids.size (); i++) {
if (uuid == _uuids[i]) {
ise_name = _names[i];
ise_uuid = uuid;
return;
}
}
ise_name = String ("");
ise_uuid = String ("");
}
示例11: on_destroy
static void on_destroy (ui_gadget_h ug, service_h s, void *priv)
{
if ( ug == NULL|| priv == NULL)
return;
if (imf_context != NULL) {
ecore_imf_context_del(imf_context);
imf_context = NULL;
}
struct ug_data *ugd = (struct ug_data *) priv;
if (ugd->naviframe != NULL) {
evas_object_del (ugd->naviframe);
ugd->naviframe = NULL;
}
if (ugd->layout_main != NULL) {
evas_object_del (ugd->layout_main);
ugd->layout_main = NULL;
}
if (!_config.null ()) {
_config->flush ();
_config.reset ();
}
}
示例12: bindtextdomain
static void *on_create (ui_gadget_h ug, enum ug_mode mode, service_h s, void *priv)
{
Evas_Object *parent = NULL;
Evas_Object *content = NULL;
if ( ug == NULL || priv == NULL)
return NULL;
bindtextdomain (WIZARD_PACKAGE, WIZARD_LOCALEDIR);
struct ug_data *ugd = (struct ug_data *)priv;
ugd->ug = ug;
ugd->data = s;
parent = (Evas_Object *) ug_get_parent_layout (ug);
if (parent == NULL)
return NULL;
//-------------------------- ise infomation ----------------------------
const char *ctx_id = ecore_imf_context_default_id_get ();
if (ctx_id != NULL) {
imf_context = ecore_imf_context_add (ctx_id);
}
_config = isf_imf_context_get_config ();
if (_config.null ()) {
std::cerr << "Create dummy config!!!\n";
_config = new DummyConfig ();
}
if (_config.null ()) {
std::cerr << "Can not create Config Object!\n";
}
//only helper ISEs will be needed in isfsetting according to phone requirement.
isf_load_ise_information (HELPER_ONLY, _config);
// Request ISF to update ISE list, below codes are very important, dont remove
char **iselist = NULL;
int count = isf_control_get_ise_list (&iselist);
for (unsigned int i = 0; i < (unsigned int)count; i++) {
SCIM_DEBUG_MAIN (3) << " [" << i << " : " << iselist[i] << "] \n";
if (iselist[i] != NULL)
delete [] (iselist[i]);
}
if (iselist!=NULL)
free(iselist);
//-------------------------- ise infomation ----------------------------
//construct the UI part of the isfsetting module
if (mode == UG_MODE_FULLVIEW)
ugd->layout_main = create_fullview (parent, ugd);
else
ugd->layout_main = create_frameview (parent, ugd);
if (ugd->layout_main != NULL) {
content = isf_setting_main_view_tizen(ugd);
elm_object_part_content_set (ugd->layout_main, "elm.swallow.content", content);
}
return (void *)ugd->layout_main;
}
示例13: scim_module_exit
void scim_module_exit (void)
{
if (_scim_config)
_scim_config.reset ();
if (scim_skkdict) {
scim_skkdict->dump_userdict();
delete scim_skkdict;
}
}
示例14: signalhandler
void signalhandler(int sig)
{
if (config != NULL) {
config->flush ();
}
std::cerr << "SCIM successfully exited.\n";
exit (0);
}
示例15: initialize
retval_t ScimBridgeAgentImpl::initialize ()
{
accept_listener = ScimBridgeAgentAcceptListener::alloc (this);
if (accept_listener == NULL) return RETVAL_FAILED;
clients.push_back (accept_listener);
display = scim_bridge_alloc_display ();
if (scim_bridge_display_fetch_current (display)) {
scim_bridge_perrorln ("Failed to allocate the current display");
return RETVAL_FAILED;
}
if (initialize_scim ()) {
scim_bridge_perrorln ("Failed to initialize scim");
return RETVAL_FAILED;
}
scim_bridge_pdebugln (4, "Loading configurations...");
slot_reload_config (scim_config);
scim_config->signal_connect_reload (slot (this, &ScimBridgeAgentImpl::slot_reload_config));
interruption_listener = ScimBridgeAgentInterruptionListener::alloc ();
if (interruption_listener == NULL) return RETVAL_FAILED;
clients.push_back (interruption_listener);
panel_listener = ScimBridgeAgentPanelListener::alloc (scim_config->get_name (), display, this);
if (panel_listener == NULL) return RETVAL_FAILED;
clients.push_back (panel_listener);
signal_listener = ScimBridgeAgentSignalListener::alloc (this);
if (signal_listener == NULL) return RETVAL_FAILED;
clients.push_back (signal_listener);
ScimBridgeAgentIMContext::static_initialize (panel_listener, scim_language, scim_backend);
scim_bridge_pdebugln (4, "ScimBridgeAgent is now ready");
return RETVAL_SUCCEEDED;
}