From 05621f6da6a1d47e0174afcff6d89f630795a3c1 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 17 Dec 2020 17:57:00 +0900 Subject: [PATCH] Remove global variables Change-Id: Idc3a741869da8c00b89d98aec3b10934211c487b Signed-off-by: Jihoon Kim --- src/config.cpp | 2 +- src/ise-emoticon-mode.cpp | 9 ++++----- src/ise-language-change.cpp | 2 +- src/ise-stt-mode.cpp | 2 +- src/ise-tutorial-mode.cpp | 2 +- src/ise.cpp | 11 ++++++----- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 6ac90f0..8fe7f94 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -64,7 +64,7 @@ CONFIG_VALUES::CONFIG_VALUES() dataclear = FALSE; }; -CONFIG_VALUES g_config_values; +static CONFIG_VALUES g_config_values; CONFIG_VALUES* get_config_values() { diff --git a/src/ise-emoticon-mode.cpp b/src/ise-emoticon-mode.cpp index 24992f9..5171513 100644 --- a/src/ise-emoticon-mode.cpp +++ b/src/ise-emoticon-mode.cpp @@ -108,15 +108,14 @@ #define MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS (EMOTICON_GROUP_1_NUM > EMOTICON_GROUP_2_NUM ? (EMOTICON_GROUP_1_NUM > EMOTICON_GROUP_3_NUM ? EMOTICON_GROUP_1_NUM : EMOTICON_GROUP_3_NUM) : (EMOTICON_GROUP_2_NUM > EMOTICON_GROUP_3_NUM ? EMOTICON_GROUP_2_NUM : EMOTICON_GROUP_3_NUM)) #define MAX_SIZE_AMONG_EMOTICON_GROUPS (EMOTICON_GROUP_4_NUM > EMOTICON_GROUP_5_NUM ? (EMOTICON_GROUP_4_NUM > MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS ? EMOTICON_GROUP_4_NUM : MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS) : (EMOTICON_GROUP_5_NUM > MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS ? EMOTICON_GROUP_5_NUM : MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS)) -bool is_emoticon_mode = false; +static bool is_emoticon_mode = false; emoticon_group_t current_emoticon_group = EMOTICON_GROUP_RECENTLY_USED; std::vector emoticon_list_recent; -bool is_recently_used_emoticon_mode_disabled = true; extern int * emoticon_list[]; #ifdef _WEARABLE -unsigned short int emoticon_group_items[MAX_EMOTICON_GROUP] = +static unsigned short int emoticon_group_items[MAX_EMOTICON_GROUP] = { EMOTICON_GROUP_RECENTLY_USED_NUM, EMOTICON_GROUP_1_NUM, @@ -124,7 +123,7 @@ unsigned short int emoticon_group_items[MAX_EMOTICON_GROUP] = EMOTICON_GROUP_3_NUM }; #else -unsigned short int emoticon_group_items[MAX_EMOTICON_GROUP] = +static unsigned short int emoticon_group_items[MAX_EMOTICON_GROUP] = { EMOTICON_GROUP_RECENTLY_USED_NUM, EMOTICON_GROUP_1_NUM, @@ -153,7 +152,7 @@ struct emoticon_item_t Eina_Unicode keyevent; }; -emoticon_item_t emoticon_items[MAX_SIZE_AMONG_EMOTICON_GROUPS] = {{0, }, }; +static emoticon_item_t emoticon_items[MAX_SIZE_AMONG_EMOTICON_GROUPS] = {{0, }, }; // Static variable declarations static Evas_Object *layout = NULL; diff --git a/src/ise-language-change.cpp b/src/ise-language-change.cpp index 583d7e9..bd60e6c 100644 --- a/src/ise-language-change.cpp +++ b/src/ise-language-change.cpp @@ -70,7 +70,7 @@ static short int old_ev_y = NOT_USED; static int scroller_region_x = NOT_USED; static int cw = NOT_USED; -bool lang_popup_on = false; +static bool lang_popup_on = false; static Ecore_Event_Handler *_lang_popup_mouse_move_handler = NULL; static Evas_Object *win = NULL; diff --git a/src/ise-stt-mode.cpp b/src/ise-stt-mode.cpp index 5f64310..50eabd3 100644 --- a/src/ise-stt-mode.cpp +++ b/src/ise-stt-mode.cpp @@ -35,7 +35,7 @@ #define STT_EDJ_FILE "edje/" PROFILE_NAME"/w-input-stt.edj" -VoiceData *my_voicedata = NULL; +static VoiceData *my_voicedata = NULL; #ifndef _TV static void set_guide_text(VoiceData *vd, const char* text, bool translatable = false); diff --git a/src/ise-tutorial-mode.cpp b/src/ise-tutorial-mode.cpp index b5ef51b..f6c81e4 100644 --- a/src/ise-tutorial-mode.cpp +++ b/src/ise-tutorial-mode.cpp @@ -59,7 +59,7 @@ static Ecore_Timer *tutorial_window_create_timer = NULL; static Ecore_Timer *tutorial_window_destory_timer = NULL; static int SCREEN_WIDTH, SCREEN_HEIGHT; -bool is_tutorial_show = false; +static bool is_tutorial_show = false; static sclu32 _context_layout = 0; diff --git a/src/ise.cpp b/src/ise.cpp index f2bd7da..3ef2834 100644 --- a/src/ise.cpp +++ b/src/ise.cpp @@ -60,7 +60,7 @@ using namespace scl; #include using namespace std; -CSCLUI *g_ui = NULL; +static CSCLUI *g_ui = NULL; CSCLUI* get_ui() { return g_ui; } #ifdef HAVE_CBHM @@ -116,7 +116,7 @@ extern sclboolean g_setting_window_open_status; static int g_ic = 0; static int g_ic_smartreply = -1; -KEYBOARD_STATE g_keyboard_state = { +static KEYBOARD_STATE g_keyboard_state = { 0, 0, ISE_LAYOUT_STYLE_NORMAL, @@ -128,6 +128,7 @@ KEYBOARD_STATE g_keyboard_state = { KEY_MODIFIER_NONE, FALSE }; + KEYBOARD_STATE* get_keyboard_state() { return &g_keyboard_state; } @@ -146,7 +147,7 @@ static Ecore_Timer *_commit_timer = NULL; static sclu32 _context_layout = ISE_LAYOUT_STYLE_NORMAL; static sclu32 _context_layout_variation = 0; -Candidate *g_candidate = NULL; +static Candidate *g_candidate = NULL; Candidate* get_candidate() { return g_candidate; } @@ -235,8 +236,8 @@ static CandidateEventListener g_candidate_event_listener; static sclboolean _cm_popup_opened = FALSE; static const char *_cm_key_list[CM_KEY_LIST_SIZE] = {USER_KEYSTRING_OPTION, USER_KEYSTRING_EMOTICON, USER_KEYSTRING_CLIPBOARD, USER_KEYSTRING_VOICE, USER_KEYSTRING_FLOATING}; static scluint _current_cm_key_id = 0; -Evas_Object* _guide_popup_setting = NULL; -Evas_Object* _guide_popup_space = NULL; +static Evas_Object* _guide_popup_setting = NULL; +static Evas_Object* _guide_popup_space = NULL; /* * This callback class will receive all response events from SCL -- 2.7.4