#define CHANGE_FONT_SIZE "change font size"
#define GB_OUTPUT_TOGGLE "gb output toggle"
#define KBM_TOGGLE "kbm toggle"
#define RELOAD_TSIN_DB "reload tsin db"
#define GCIN_EXIT_MESSAGE "gcin exit"


#define GCIN_FONT_SIZE "gcin-font-size"
#define GCIN_FONT_NAME "gcin-font-name"
#define GCIN_FONT_SIZE_TSIN_PRESEL "gcin-font-size-tsin-presel"
#define GCIN_FONT_SIZE_SYMBOL "gcin-font-size-symbol"
#define GCIN_FONT_SIZE_TSIN_PHO_IN "gcin-font-size-tsin-pho-in"
#define GCIN_FONT_SIZE_GTAB_IN "gcin-font-size-gtab-in"
#define GCIN_FONT_SIZE_PHO_NEAR "gcin-font-size-pho-near"
#define GCIN_FONT_SIZE_WIN_KBM "gcin-font-size-win-kbm"
#define GCIN_FONT_SIZE_WIN_KBM_EN "gcin-font-size-win-kbm-en"
#define GCIN_INPUT_STYLE "gcin-input-style"
#define GCIN_ROOT_X      "gcin-root-x"
#define GCIN_ROOT_Y      "gcin-root-y"
#define GCIN_POP_UP_WIN "gcin-pop-up-win"
#define GCIN_INNER_FRAME "gcin-inner-frame"
#define GCIN_INIT_IM_ENABLED "gcin-init-im-enabled"
#define GCIN_BELL_VOLUME "gcin-bell-volume"
#define GCIN_SOUND_PLAY_OVERLAP "gcin-sound-play-overlap"
#define GCIN_ENABLE_CTRL_ALT_SWITCH "gcin-enable-ctrl-alt-switch"
#define GCIN_EDIT_DISPLAY "gcin-edit-display"
#define GCIN_BELL_OFF "gcin-bell-off"
#define GCIN_ON_THE_SPOT_KEY "gcin-on-the-spot-key"
#define GCIN_TRAY_HF_WIN_KBM "gcin-tray-hf-win-kbm"
#define GCIN_SINGLE_STATE "gcin-single-state"
#define GCIN_PUNC_AUTO_SEND "gcin-punc-auto-send"
#define GCIN_STATUS_WIN "gcin-status-win"
#define GCIN_BUFFER_SELECT_CHAR_AUTO_LEFT "gcin-buffer-select-char-auto-left"
#define GCIN_CTRL_PUNC "gcin-ctrl-punc"

#define GCIN_IM_TOGGLE_KEYS "gcin-im-toggle-keys"
#define DEFAULT_INPUT_METHOD "default-input-method"
#define LEFT_RIGHT_BUTTON_TIPS "left-right-button-tips"
#define GCIN_STR_IM_CYCLE "gcin-str-im-cycle"
#define GCIN_REMOTE_CLIENT "gcin-remote-client"
#define GCIN_SHIFT_SPACE_ENG_FULL "gcin-shift-space-eng-full"
#define GCIN_STATUS_TRAY "gcin-status-tray"
#define GCIN_WIN_COLOR_FG "gcin-win-color-fg"
#define GCIN_WIN_COLOR_BG "gcin-win-color-bg"
#define GCIN_WIN_COLOR_USE "gcin-win-color-use"
#define GCIN_CAPSLOCK_LOWER "gcin-capslock-lower"
#define GCIN_ENG_PHRASE_ENABLED "gcin-eng-phrase-enabled"
#define GCIN_WIN_SYM_CLICK_CLOSE "gcin-win-sym-click-close"
#define GCIN_SEL_KEY_COLOR "gcin-sel-key-color"
#define GCIN_WIN32_ICON "gcin-win32-icon"
#define GCIN_ESCAPE_CLEAR_EDIT_BUFFER "gcin-escape_clear-edit-buffer"

#define GTAB_DUP_SELECT_BELL "gtab-dup-select-bell"
#define GTAB_SPACE_AUTO_FIRST "gtab-space-auto-first"
#define GTAB_AUTO_SELECT_BY_PHRASE "gtab-auto-select-by_phrase"
#define GTAB_PRE_SELECT "gtab-pre-select"
#define GTAB_PHRASE_PRE_SELECT "gtab-phrase-pre-select"
#define GTAB_PRESS_FULL_AUTO_SEND "gtab-press-full-auto-send"
#define GTAB_DISP_PARTIAL_MATCH "gtab-disp-partial-match"
#define GTAB_DISP_KEY_CODES "gtab-disp-key-codes"
#define GTAB_DISP_IM_NAME "gtab-disp-im-name"
#define GTAB_INVALID_KEY_IN "gtab-invalid-key-in"
#define GTAB_SHIFT_PHRASE_KEY "gtab-shift-phrase-key"
#define GTAB_HIDE_ROW2 "gtab-hide-row2"
#define GTAB_IN_ROW1 "gtab-in-row1"
#define GTAB_CAPSLOCK_IN_ENG "gtab-capslock-in-eng"
#define GTAB_VERTICAL_SELECT "gtab-vertical-select"
#define GTAB_UNIQUE_AUTO_SEND "gtab-unique-auto-send"
#define GTAB_QUE_WILD_CARD "gtab-que-wild-card"
#define GTAB_PHRASE_PRE_SELECT "gtab-phrase-pre-select"
#define GTAB_IN_AREA_BUTTON "gtab-in-area-button"
#define GTAB_AUTO_SPACE "gtab-auto-space"


#define TSIN_PHRASE_PRE_SELECT "tsin-phrase-pre-select"
#define TSIN_CHINESE_ENGLISH_TOGGLE_KEY "tsin-chinese-english-toggle_key"
#define TSIN_SPACE_OPT "tsin-space-opt"
#define TSIN_BUFFER_SIZE "tsin-buffer-size"
#define TSIN_PHRASE_LINE_COLOR "tsin-phrase-line-color"
#define TSIN_CURSOR_COLOR "tsin-cursor-color"
#define TSIN_TONE_CHAR_INPUT "tsin-tone-char-input"
#define TSIN_TAB_PHRASE_END "tsin-tab-phrase-end"
#define TSIN_TAIL_SELECT_KEY "tsin-tail-select-key"
#define TSIN_BUFFER_EDITING_MODE "tsin-buffer-editing-mode"
#define TSIN_USE_PHO_NEAR "tsin-use-pho-near"
#define TSIN_PHO_MODE "tsin-pho-mode"
#define TSIN_SHIFT_PUNC "tsin-shift-punc"

#define PHO_HIDE_ROW2 "pho-hide-row2"
#define PHO_IN_ROW1 "pho-in-row1"


#define PHONETIC_KEYBOARD "phonetic-keyboard2"
#define PHONETIC_KEYBOARD_BAK "phonetic-keyboard-bak"

#define PHONETIC_CHAR_DYNAMIC_SEQUENCE "phonetic-char-dynamic-sequence"
#define PHONETIC_HUGE_TAB "phonetic-huge-tab"
#define PHONETIC_SPEAK "phonetic-speak"
#define PHONETIC_SPEAK_SEL "phonetic-speak-sel"
#define GCB_POSITION "gcb-position"
#define GCB_POSITION_X "gcb-position-x"
#define GCB_POSITION_Y "gcb-position-y"
#define GCB_ENABLED "gcb-enabled"
#define GCB_BUTTON_N "gcb-button-n"
#define GCB_HISTORY_N "gcb-history-n"

extern int gcin_font_size, gcin_font_size_tsin_presel, gcin_font_size_symbol,
           gcin_font_size_tsin_pho_in, gcin_font_size_pho_near,
           gcin_font_size_gtab_in, gcin_font_size_win_kbm, gcin_font_size_win_kbm_en,
           gcin_inner_frame, gcin_single_state,
           gcin_remote_client, ini_tsin_pho_mode,
           gtab_disp_key_codes, gtab_disp_im_name, gcin_shift_space_eng_full,
           gtab_invalid_key_in, gtab_hide_row2, gtab_in_row1, gtab_capslock_in_eng, gtab_auto_space,
           gcin_capslock_lower, pho_hide_row2, pho_in_row1,
           gcin_eng_phrase_enabled, gtab_que_wild_card, gcin_win_sym_click_close,
           gcin_bell_volume, gcin_sound_play_overlap, gcin_enable_ctrl_alt_switch, gcin_on_the_spot_key,
           gcin_status_win, gcin_escape_clear_edit_buffer, gcin_buffer_select_char_auto_left,
           tsin_shift_punc,gcin_ctrl_punc;

extern int default_input_method;
extern int left_right_button_tips;
extern int gtab_dup_select_bell;
extern int gtab_space_auto_first;
extern int gtab_auto_select_by_phrase;
extern int gcin_im_toggle_keys;
extern int gtab_pre_select, gtab_phrase_pre_select;
extern int gtab_press_full_auto_send;
extern int gtab_disp_partial_match;
extern int gtab_shift_phrase_key, gtab_in_area_button;
extern int gtab_vertical_select, gtab_unique_auto_send;
extern int tsin_buffer_size;
extern int gcin_input_style, gcin_root_x, gcin_root_y, gcin_pop_up_win;
extern int gcin_status_tray, gcin_tray_hf_win_kbm;
extern int gcin_punc_auto_send;

extern int tsin_phrase_pre_select;
extern int tsin_chinese_english_toggle_key;
extern int tsin_tab_phrase_end, tsin_tail_select_key;
extern int tsin_buffer_editing_mode;
extern int tsin_use_pho_near;

extern int phonetic_char_dynamic_sequence;
extern int phonetic_huge_tab, phonetic_speak;
extern char *phonetic_speak_sel;
extern int tsin_space_opt, tsin_tone_char_input;

extern char *tsin_phrase_line_color, *tsin_cursor_color, *gcin_font_name, *gcin_sel_key_color;
extern unich_t eng_full_str[], cht_full_str[];
extern char *eng_color_full_str, *cht_color_full_str;
extern char *gcin_win_color_fg, *gcin_win_color_bg;
extern int gcin_win_color_use, gcin_bell_off;
extern int gcin_init_im_enabled, gcin_win32_icon;
extern int gcb_enabled, gcb_position, gcb_position_x, gcb_position_y, gcb_button_n, gcb_history_n;
extern int gcin_edit_display;
extern char *pho_kbm_name, *pho_selkey, *gcin_str_im_cycle;
extern int pho_candicate_col_N, pho_candicate_R2L;

gboolean get_gcin_user_fname(char *name, char fname[]);
void get_gcin_conf_str(char *name, char **rstr, char *default_str);
void get_gcin_conf_fstr(char *name, char rstr[], char *default_str);
void save_gcin_conf_str(char *name, char *str);
void save_gcin_conf_int(char *name, int val);
int get_gcin_conf_int(char *name, int default_value);
void load_setttings();

