本文整理汇总了C++中ConfigPointer::null方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigPointer::null方法的具体用法?C++ ConfigPointer::null怎么用?C++ ConfigPointer::null使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigPointer
的用法示例。
在下文中一共展示了ConfigPointer::null方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例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: 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);
}
示例4: 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 ();
}
}
示例5:
static void
save_config (const ConfigPointer &config)
{
if (!config.null ()) {
// config->write (String (SCIM_CONFIG_IMENGINE_ANTHY_USE_KANA),
// __config_use_kana);
config->write (String (SCIM_CONFIG_WNN_SERVER),
__config_server);
config->write (String (SCIM_CONFIG_WNN_RC),
__config_wnn_rc);
config->write (String (SCIM_CONFIG_WNN_SERVERTYPE),
__config_servertype);
config->write (String (SCIM_CONFIG_WNN_DEFAULT_PREEDITOR),
__config_preeditor);
config->write (String (SCIM_CONFIG_WNN_ALP),
__config_alp);
config->write (String (SCIM_CONFIG_WNN_NUMKEY_SELECT),
__config_numkeyselect);
config->write (String (SCIM_CONFIG_WNN_AUTO_CONVERSION),
__config_autoconversion);
config->write (String (SCIM_CONFIG_WNN_YOSOKU),
__config_yosoku);
config->write (String (SCIM_CONFIG_WNN_ROMKAN_TABLE_FILE),
__config_romkan_table);
for (unsigned j = 0; j < __key_conf_pages_num; j++) {
for (unsigned int i = 0; __key_conf_pages[j].data[i].key; ++ i) {
config->write (String (__key_conf_pages[j].data[i].key),
__key_conf_pages[j].data[i].data);
}
}
__have_changed = false;
}
}
示例6: load_config
void load_config( const ConfigPointer &config )
{
if (!config.null ()) {
__config_add_phrase_forward =
config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_ADD_PHRASE_FORWARD ),
__config_add_phrase_forward );
__config_phrase_choice_rearward =
config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_PHRASE_CHOICE_REARWARD ),
__config_phrase_choice_rearward );
__config_auto_shift_cursor =
config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_AUTO_SHIFT_CURSOR ),
__config_auto_shift_cursor );
__config_esc_clean_all_buffer =
config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_ESC_CLEAN_ALL_BUFFER ),
__config_esc_clean_all_buffer );
__config_space_as_selection =
config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_SPACE_AS_SELECTION ),
__config_space_as_selection );
__config_kb_type_data =
config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_USER_KB_TYPE ),
__config_kb_type_data);
__config_selKey_type_data =
config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_USER_SELECTION_KEYS ),
__config_selKey_type_data);
__config_selKey_num_data =
config->read( String( SCIM_CHEWING_SELECTION_KEYS_NUM ),
__config_selKey_num_data);
__config_chieng_mode_data =
config->read( String( SCIM_CONFIG_IMENGINE_CHEWING_CHI_ENG_MODE ),
__config_chieng_mode_data);
for (int i = 0; __config_keyboards[ i ].key; ++ i) {
__config_keyboards[ i ].data =
config->read( String( __config_keyboards [ i ].key ),
__config_keyboards[ i ].data);
}
for (unsigned int i = 0;
i < (sizeof(config_color_common) / sizeof((config_color_common)[0])); i++) {
ColorConfigData &entry = config_color_common[i];
entry.bg_value = config->read (String (entry.bg_key), entry.bg_value);
}
setup_widget_value ();
__have_changed = false;
}
}
示例7:
void
load_config (const ConfigPointer &config)
{
if (!config.null ()) {
__config_toolbar_always_hidden =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_ALWAYS_HIDDEN),
__config_toolbar_always_hidden);
__config_toolbar_always_show =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_ALWAYS_SHOW),
__config_toolbar_always_show);
__config_toolbar_auto_snap =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_AUTO_SNAP),
__config_toolbar_auto_snap);
__config_toolbar_hide_timeout =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_HIDE_TIMEOUT),
__config_toolbar_hide_timeout);
__config_toolbar_show_factory_icon =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_SHOW_FACTORY_ICON),
__config_toolbar_show_factory_icon);
__config_toolbar_show_factory_name =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_SHOW_FACTORY_NAME),
__config_toolbar_show_factory_name);
__config_toolbar_show_stick_icon =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_SHOW_STICK_ICON),
__config_toolbar_show_stick_icon);
__config_toolbar_show_menu_icon =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_SHOW_MENU_ICON),
__config_toolbar_show_menu_icon);
__config_toolbar_show_help_icon =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_SHOW_HELP_ICON),
__config_toolbar_show_help_icon);
__config_toolbar_show_property_label =
config->read (String (SCIM_CONFIG_PANEL_GTK_TOOLBAR_SHOW_PROPERTY_LABEL),
__config_toolbar_show_property_label);
__config_lookup_table_embedded =
config->read (String (SCIM_CONFIG_PANEL_GTK_LOOKUP_TABLE_EMBEDDED),
__config_lookup_table_embedded);
__config_lookup_table_vertical =
config->read (String (SCIM_CONFIG_PANEL_GTK_LOOKUP_TABLE_VERTICAL),
__config_lookup_table_vertical);
__config_default_sticked =
config->read (String (SCIM_CONFIG_PANEL_GTK_DEFAULT_STICKED),
__config_default_sticked);
__config_show_tray_icon =
config->read (String (SCIM_CONFIG_PANEL_GTK_SHOW_TRAY_ICON),
__config_show_tray_icon);
__config_font =
config->read (String (SCIM_CONFIG_PANEL_GTK_FONT),
__config_font);
setup_widget_value ();
__have_changed = false;
}
}
示例8:
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);
}
}
示例9: 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);
}
}
示例10:
void
save_config (const ConfigPointer &config)
{
if (!config.null ()) {
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_TOOLBAR_AUTO_SNAP),
__config_toolbar_auto_snap);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_TOOLBAR_HIDE_TIMEOUT),
__config_toolbar_hide_timeout);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_TOOLBAR_SHOW_FACTORY_ICON),
__config_toolbar_show_factory_icon);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_TOOLBAR_SHOW_FACTORY_NAME),
__config_toolbar_show_factory_name);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_TOOLBAR_SHOW_MENU_ICON),
__config_toolbar_show_menu_icon);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_TOOLBAR_SHOW_HELP_ICON),
__config_toolbar_show_help_icon);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_TOOLBAR_SHOW_PROPERTY_LABEL),
__config_toolbar_show_property_label);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_FONT),
__config_font);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_VKB_PROGRAM),
__config_vkb_program);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_VKB_PARAMETERS),
__config_vkb_parameters);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_VKB_WIDTH),
__config_vkb_window_width);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_VKB_HEIGHT),
__config_vkb_window_height);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_DOCK_PANEL),
__config_vkb_dockpanel);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_PANEL_EXTEND),
__config_vkb_panel_extend);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_ENABLE_VKB),
__config_vkb_enable);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_PANEL_NORMAL_TEXT_COLOR),
__config_vkb_panel_normal_text_color);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_PANEL_NORMAL_BG_COLOR),
__config_vkb_panel_normal_bg_color);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_PANEL_ACTIVE_TEXT_COLOR),
__config_vkb_panel_active_text_color);
config->write (String (SCIM_CONFIG_PANEL_VKB_GTK_PANEL_ACTIVE_BG_COLOR),
__config_vkb_panel_active_bg_color);
__have_changed = false;
}
}
示例11: 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);
}
示例12: main
int main(int argc, char* argv[])
{
String config_name("simple");
String display_name;
bool daemon = false;
bool should_resident = true;
//parse command options
int i = 1;
while (i < argc) {
if (String("-l") == argv[i] || String("--list") == argv[i]) {
std::cout << "\n";
std::cout << "Available Config module:\n";
// get config module list
std::vector<String> config_list;
scim_get_config_module_list(config_list);
config_list.push_back("dummy");
std::vector<String>::iterator it = config_list.begin();
for (; it != config_list.end(); ++it) {
std::cout << " " << *it << "\n";
}
return 0;
}
else if (String("-c") == argv[i] || String("--config") == argv[i]) {
if (++i >= argc) {
std::cerr << "no argument for option " << argv[i-1] << "\n";
return -1;
}
config_name = argv[i];
}
else if (String("-h") == argv[i] || String("--help") == argv[i]) {
std::cout << "Usage: " << argv [0] << " [option]...\n\n"
<< "The options are: \n"
<< " --display DISPLAY Run on display DISPLAY.\n"
<< " -l, --list List all of available config modules.\n"
<< " -c, --config NAME Uses specified Config module.\n"
<< " -d, --daemon Run " << argv [0] << " as a daemon.\n"
<< " -ns, --no-stay Quit if no connected client.\n"
<< " -h, --help Show this help message.\n";
return 0;
}
else if (String("-d") == argv[i] || String("--daemon") == argv[i]) {
daemon = true;
}
else if (String("-ns") == argv[i] || String("--no-stay") == argv[i]) {
should_resident = false;
}
else if (String("--display") == argv[i]) {
if (++i >= argc) {
std::cerr << "No argument for option " << argv[i-1] << "\n";
return -1;
}
display_name = argv[i];
}
else {
std::cerr << "Invalid command line option: " << argv[i] << "\n";
return -1;
}
++i;
}
// Make up DISPLAY env.
if (display_name.length()) {
setenv("DISPLAY", display_name.c_str(), 1);
}
if (config_name == "dummy") {
_config = new DummyConfig();
}
else {
_config_module = new ConfigModule(config_name);
if (!_config_module || !_config_module->valid()) {
std::cerr << "Can not load " << config_name << " Config module.\n";
return -1;
}
_config = _config_module->create_config();
}
if (_config.null()) {
std::cerr << "Failed to create instance from " << config_name << " Config module.\n";
return -1;
}
signal(SIGTERM, niam);
signal(SIGINT, niam);
if (!initialize_panel_agent(config_name, display_name, should_resident)) {
std::cerr << "Failed to initialize PanelAgent.\n";
return -1;
}
if (daemon)
scim_daemon();
if (!run_panel_agent()) {
std::cerr << "Failed to run Socket Server!\n";
return -1;
}
//.........这里部分代码省略.........
示例13: ReloadConfig
virtual void ReloadConfig() {
panel_agent->reload_config();
if (!_config.null())
_config->reload();
}
示例14: main
//.........这里部分代码省略.........
}
if (String (argv [i]) != "none") {
std::vector<String> debug_mask_list;
scim_split_string_list (debug_mask_list, argv [i], ',');
DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
for (size_t j=0; j<debug_mask_list.size (); j++)
DebugOutput::enable_debug_by_name (debug_mask_list [j]);
}
continue;
}
if (String ("-o") == argv [i] ||
String ("--output") == argv [i]) {
if (++i >= argc) {
std::cerr << "No argument for option " << argv [i-1] << "\n";
return -1;
}
DebugOutput::set_output (String (argv [i]));
continue;
}
if (String ("--") == argv [i])
break;
new_argv [new_argc ++] = argv [i];
} //End of command line parsing.
// Construct new argv array for FrontEnd.
new_argv [new_argc ++] = const_cast <char *> ("-c");
new_argv [new_argc ++] = const_cast <char *> (config_name.c_str ());
// Store the rest argvs into new_argv.
for (++i; i < argc && new_argc < 40; ++i) {
new_argv [new_argc ++] = argv [i];
}
new_argv [new_argc] = 0;
try {
// Try to load config module
std::cerr << "Loading " << config_name << " Config module ...\n";
if (config_name != "dummy") {
//load config module
config_module = new ConfigModule (config_name);
if (!config_module->valid ()) {
std::cerr << "Can not load " << config_name << " Config module. Using dummy module instead.\n";
delete config_module;
config_module = 0;
}
}
if (config_module) {
config = config_module->create_config ();
} else {
config = new DummyConfig ();
}
if (config.null ()) {
std::cerr << "Can not create Config Object!\n";
return 1;
}
// create backend
std::cerr << "Creating backend ...\n";
backend = new CommonBackEnd (config, engine_list);
//load FrontEnd module
std::cerr << "Loading " << frontend_name << " FrontEnd module ...\n";
frontend_module = new FrontEndModule (frontend_name, backend, config, new_argc, new_argv);
if (!frontend_module || !frontend_module->valid ()) {
std::cerr << "Failed to load " << frontend_name << " FrontEnd module.\n";
return 1;
}
//reset backend pointer, in order to destroy backend automatically.
backend.reset ();
signal(SIGQUIT, signalhandler);
signal(SIGTERM, signalhandler);
signal(SIGINT, signalhandler);
signal(SIGHUP, signalhandler);
if (daemon) {
std::cerr << "Starting SCIM as daemon ...\n";
scim_daemon ();
} else {
std::cerr << "Starting SCIM ...\n";
}
frontend_module->run ();
} catch (const std::exception & err) {
std::cerr << err.what () << "\n";
return 1;
}
return 0;
}
示例15: main
//.........这里部分代码省略.........
if (++i >= argc) {
cerr << "No argument for option " << argv [i-1] << endl;
return -1;
}
display = String (argv [i]);
continue;
}
if (String ("--reload") == argv [i]) {
reload = true;
continue;
}
cerr << "Unknown option " << argv [i] << endl;
return -1;
}
if ((cmd == DO_NOTHING || !key.length ()) && reload == false) {
cerr << "What do you want to do?\n";
return -1;
}
if (cmd != DO_NOTHING) {
if (def_config == "global") {
global = true;
} else {
if (!config_module.load (def_config)) {
cerr << "Failed to load config module " << def_config << endl;
return -1;
}
config = config_module.create_config ();
if (config.null ()) {
cerr << "Failed to create config object.\n";
return -1;
}
}
}
// Get data
if (cmd == GET_DATA) {
bool ok = false;
if (type == DATA_TYPE_STRING) {
if (global) {
value = scim_global_config_read (key, String (""));
ok = (scim_global_config_read (key, String ("Invalid")) == value);
} else {
ok = config->read (key, &value);
}
if (ok) cout << value << endl;
} else if (type == DATA_TYPE_INT) {
int intval;
if (global) {
intval = scim_global_config_read (key, (int) 0);
ok = (scim_global_config_read (key, (int) 0) == intval);
} else {
ok = config->read (key, &intval);
}
if (ok) cout << intval << endl;
} else if (type == DATA_TYPE_DOUBLE) {
double doubleval;
if (global) {
doubleval = scim_global_config_read (key, (double) 0);
ok = (scim_global_config_read (key, (double) 1) == doubleval);
} else {