--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef ISE_EMOTICON_GROUP_H_
+#define ISE_EMOTICON_GROUP_H_
+
+#ifdef SUPPORTS_EMOTICONS
+
+#ifdef _WEARABLE
+#define EMOTICON_GROUP_RECENTLY_USED_NUM 9
+#define EMOTICON_GROUP_1_NUM 9
+#define EMOTICON_GROUP_2_NUM 9
+#define EMOTICON_GROUP_3_NUM 9
+#define EMOTICON_GROUP_4_NUM 0
+#define EMOTICON_GROUP_5_NUM 0
+
+enum emoticon_group_t
+{
+ EMOTICON_GROUP_DESTROY = -1,
+ EMOTICON_GROUP_RECENTLY_USED,
+ EMOTICON_GROUP_1,
+ EMOTICON_GROUP_2,
+ EMOTICON_GROUP_3,
+ MAX_EMOTICON_GROUP,
+};
+
+#else
+#define EMOTICON_GROUP_RECENTLY_USED_NUM 28
+#define EMOTICON_GROUP_1_NUM 77
+#define EMOTICON_GROUP_2_NUM 157
+#define EMOTICON_GROUP_3_NUM 178
+#define EMOTICON_GROUP_4_NUM 114
+#define EMOTICON_GROUP_5_NUM 207
+
+enum emoticon_group_t
+{
+ EMOTICON_GROUP_DESTROY = -1,
+ EMOTICON_GROUP_RECENTLY_USED,
+ EMOTICON_GROUP_1,
+ EMOTICON_GROUP_2,
+ EMOTICON_GROUP_3,
+ EMOTICON_GROUP_4,
+ EMOTICON_GROUP_5,
+ MAX_EMOTICON_GROUP,
+};
+#endif
+
+#endif /* SUPPORTS_EMOTICONS */
+#endif /* ISE_EMOTICON_GROUP_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef ISE_EMOTICON_LIST_H_
+#define ISE_EMOTICON_LIST_H_
+
+#ifdef SUPPORTS_EMOTICONS
+
+#include "ise-emoticon-group.h"
+
+void ise_emoticon_init_list(void);
+
+emoticon_group_t ise_emoticon_get_group_id(const char *group_name);
+const char *ise_emoticon_get_group_name(int id);
+int ise_emoticon_get_code(unsigned int group, unsigned int index);
+
+#endif /* SUPPORTS_EMOTICONS */
+#endif /* ISE_EMOTICON_LIST_H_ */
#ifndef ISE_EMOTICON_MODE_H_
#define ISE_EMOTICON_MODE_H_
-#include "ise-floating-mode.h"
-#include <stdlib.h>
-
#ifdef SUPPORTS_EMOTICONS
-#ifdef _WEARABLE
-#define EMOTICON_GROUP_RECENTLY_USED_NUM 9
-#define EMOTICON_GROUP_1_NUM 9
-#define EMOTICON_GROUP_2_NUM 9
-#define EMOTICON_GROUP_3_NUM 9
-#define EMOTICON_GROUP_4_NUM 0
-#define EMOTICON_GROUP_5_NUM 0
-
-enum emoticon_group_t
-{
- EMOTICON_GROUP_DESTROY = -1,
- EMOTICON_GROUP_RECENTLY_USED,
- EMOTICON_GROUP_1,
- EMOTICON_GROUP_2,
- EMOTICON_GROUP_3,
- MAX_EMOTICON_GROUP,
-};
-
-#else
-#define EMOTICON_GROUP_RECENTLY_USED_NUM 28
-#define EMOTICON_GROUP_1_NUM 77
-#define EMOTICON_GROUP_2_NUM 157
-#define EMOTICON_GROUP_3_NUM 178
-#define EMOTICON_GROUP_4_NUM 114
-#define EMOTICON_GROUP_5_NUM 207
-
-enum emoticon_group_t
-{
- EMOTICON_GROUP_DESTROY = -1,
- EMOTICON_GROUP_RECENTLY_USED,
- EMOTICON_GROUP_1,
- EMOTICON_GROUP_2,
- EMOTICON_GROUP_3,
- EMOTICON_GROUP_4,
- EMOTICON_GROUP_5,
- MAX_EMOTICON_GROUP,
-};
-#endif
+#include <stdlib.h>
+#include "ise-emoticon-group.h"
-void ise_show_emoticon_layout(emoticon_group_t emoticon_group, const int screen_degree, const bool is_candidate_on, void *main_window);
-void ise_change_emoticon_mode(emoticon_group_t emoticon_group);
-void ise_destroy_emoticon_layout(void);
-void ise_init_emoticon_list(void);
-bool is_emoticon_show(void);
-emoticon_group_t ise_get_emoticon_group_id(const char *group_name);
-const char *ise_get_emoticon_group_name(int id);
-void ise_set_private_key_for_emoticon_mode(const emoticon_group_t emoticon_group);
-size_t get_emoticon_list_recent_size();
+void ise_emoticon_show_layout(emoticon_group_t emoticon_group, const int screen_degree, const bool is_candidate_on, void *main_window);
+void ise_emoticon_change_mode(emoticon_group_t emoticon_group);
+void ise_emoticon_destroy_layout(void);
+bool ise_emoticon_is_show(void);
+void ise_emoticon_set_private_key_for_emoticon_mode(const emoticon_group_t emoticon_group);
+size_t ise_emoticon_get_recent_list_size();
-emoticon_group_t get_current_emoticon_group();
-void set_current_emoticon_group(emoticon_group_t emoticon_group);
-int get_emoticon_code(unsigned int group, unsigned int index);
+void ise_emoticon_set_current_group(emoticon_group_t emoticon_group);
+emoticon_group_t ise_emoticon_get_current_group();
#endif /* SUPPORTS_EMOTICONS */
#endif /* ISE_EMOTICON_MODE_H_ */
extern void ise_read_recent_emoticon_list_from_scim(void);
-void ise_init_emoticon_list(void)
+void ise_emoticon_init_list(void)
{
static bool is_emoticon_list_initialised = false;
if (!is_emoticon_list_initialised) {
}
}
-emoticon_group_t ise_get_emoticon_group_id(const char *group_name)
+emoticon_group_t ise_emoticon_get_group_id(const char *group_name)
{
int i = 0;
for (; i < MAX_EMOTICON_GROUP; ++i) {
return (emoticon_group_t)0;
}
-const char *ise_get_emoticon_group_name(int id)
+const char *ise_emoticon_get_group_name(int id)
{
if (id >= 0 && id < MAX_EMOTICON_GROUP)
return emoticon_group_name[id];
return NULL;
}
-int get_emoticon_code(unsigned int group, unsigned int index)
+int ise_emoticon_get_code(unsigned int group, unsigned int index)
{
return emoticon_list[group][index];
}
#include <sclfeedback.h>
#include "ise-emoticon-mode.h"
+#include "ise-emoticon-list.h"
#include "ise.h"
#include "config.h"
#include "candidate-factory.h"
static emoticon_group_t current_emoticon_group = EMOTICON_GROUP_RECENTLY_USED;
static std::vector <int> emoticon_list_recent;
-size_t get_emoticon_list_recent_size()
+size_t ise_emoticon_get_recent_list_size()
{
return emoticon_list_recent.size();
}
-emoticon_group_t get_current_emoticon_group()
+emoticon_group_t ise_emoticon_get_current_group()
{
return current_emoticon_group;
}
-void set_current_emoticon_group(emoticon_group_t emoticon_group)
+void ise_emoticon_set_current_group(emoticon_group_t emoticon_group)
{
current_emoticon_group = emoticon_group;
}
}
}
-void ise_show_emoticon_layout(emoticon_group_t emoticon_group, const int screen_degree, const bool is_candidate_on, void *main_window)
+void ise_emoticon_show_layout(emoticon_group_t emoticon_group, const int screen_degree, const bool is_candidate_on, void *main_window)
{
CSCLUI *ui = get_ui();
if (!ui) return;
return;
#endif
//xt9_send_flush(0);
- ise_init_emoticon_list();
- ise_set_private_key_for_emoticon_mode(emoticon_group);
+ ise_emoticon_init_list();
+ ise_emoticon_set_private_key_for_emoticon_mode(emoticon_group);
if (emoticon_group == EMOTICON_GROUP_RECENTLY_USED) {
//ise_read_recent_emoticon_list_from_scim();
}
}
- ise_destroy_emoticon_layout();
+ ise_emoticon_destroy_layout();
layout = elm_layout_add((Evas_Object *)main_window);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
current_emoticon_group = emoticon_group;
}
-void ise_destroy_emoticon_layout(void)
+void ise_emoticon_destroy_layout(void)
{
/* According to UI FW team, when the a parent is deleted, all its child content will
* also be deleted. So no need to delete gengrid explicitly. Just setting the gendrid
}
}
-void ise_change_emoticon_mode(emoticon_group_t emoticon_group)
+void ise_emoticon_change_mode(emoticon_group_t emoticon_group)
{
if (emoticon_group == EMOTICON_GROUP_RECENTLY_USED) {
//ise_read_recent_emoticon_list_from_scim();
items = emoticon_group_items[emoticon_group];
}
for (int i = 0; i < items; i++) {
- snprintf(img_name, 10, "%x", get_emoticon_code(emoticon_group-1, i));
+ snprintf(img_name, 10, "%x", ise_emoticon_get_code(emoticon_group-1, i));
file_path = (std::string)EMOTICON_DIR + (std::string)"u" + (std::string)img_name + (std::string)".png";
if (ise_util_does_file_exists(file_path)) {
- emoticon_items[i].code = get_emoticon_code(emoticon_group-1, i);
- emoticon_items[i].keyevent = get_emoticon_code(emoticon_group-1, i);
+ emoticon_items[i].code = ise_emoticon_get_code(emoticon_group-1, i);
+ emoticon_items[i].keyevent = ise_emoticon_get_code(emoticon_group-1, i);
emoticon_items[i].path = file_path;
emoticon_items[i].item = elm_gengrid_item_append(gengrid, gic, &(emoticon_items[i]), _item_selected, &(emoticon_items[i]));
// PRINTFUNC(SECURE_DEBUG,"file_path = %s\n",file_path.c_str());
items = emoticon_group_items[emoticon_group];
}
for (int i = 0; i < items; i++) {
- snprintf(img_name, 10, "%x", get_emoticon_code(emoticon_group-1, i));
+ snprintf(img_name, 10, "%x", ise_emoticon_get_code(emoticon_group-1, i));
file_path = (std::string)img_name;
- emoticon_items[i].keyevent = get_emoticon_code(emoticon_group-1, i);
+ emoticon_items[i].keyevent = ise_emoticon_get_code(emoticon_group-1, i);
emoticon_items[i].path = file_path;
emoticon_items[i].item = elm_gengrid_item_append(gengrid, gic, &(emoticon_items[i]), _item_selected, &(emoticon_items[i]));
}
//PRINTFUNC(DLOG_DEBUG,"_item_selected() ends");
}
-bool is_emoticon_show(void)
+bool ise_emoticon_is_show(void)
{
return is_emoticon_mode;
}
-void ise_set_private_key_for_emoticon_mode(const emoticon_group_t emoticon_group)
+void ise_emoticon_set_private_key_for_emoticon_mode(const emoticon_group_t emoticon_group)
{
CSCLUI *ui = get_ui();
if (ui) {
const char *group_name = NULL;
for (int id = EMOTICON_GROUP_RECENTLY_USED; id < MAX_EMOTICON_GROUP; id++) {
- group_name = ise_get_emoticon_group_name(id);
+ group_name = ise_emoticon_get_group_name(id);
if (group_name)
ui->unset_private_key(group_name);
}
- group_name = ise_get_emoticon_group_name(emoticon_group);
+ group_name = ise_emoticon_get_group_name(emoticon_group);
if (group_name) {
#ifndef _WEARABLE
sclchar* imagelabel[SCL_BUTTON_STATE_MAX] = {
#include "languages.h"
#include "candidate-factory.h"
#include "ise-emoticon-mode.h"
+#include "ise-emoticon-list.h"
#include "ise-stt-mode.h"
#include "ise-stt-option.h"
#include "ise-language-change.h"
}
}
}
- if (is_emoticon_show()) {
- ise_destroy_emoticon_layout();
+ if (ise_emoticon_is_show()) {
+ ise_emoticon_destroy_layout();
}
if (key_value) {
if (!strcmp(key_value, USER_KEYSTRING_EMOTICON)) {
- ise_init_emoticon_list();
+ ise_emoticon_init_list();
#ifdef _WEARABLE
- set_current_emoticon_group(EMOTICON_GROUP_1);
+ ise_emoticon_set_current_group(EMOTICON_GROUP_1);
#else
- if (get_emoticon_list_recent_size() == 0)
- set_current_emoticon_group(EMOTICON_GROUP_1);
+ if (ise_emoticon_get_recent_list_size() == 0)
+ ise_emoticon_set_current_group(EMOTICON_GROUP_1);
else
- set_current_emoticon_group(EMOTICON_GROUP_RECENTLY_USED);
+ ise_emoticon_set_current_group(EMOTICON_GROUP_RECENTLY_USED);
#endif
SCLRotation rotation = ui->get_rotation();
- ise_show_emoticon_layout(get_current_emoticon_group(), ROTATION_TO_DEGREE(rotation), false, ime_get_main_window());
+ ise_emoticon_show_layout(ise_emoticon_get_current_group(), ROTATION_TO_DEGREE(rotation), false, ime_get_main_window());
}
}
}
} else {
const sclchar *input_mode = ui->get_input_mode();
if ((NULL != input_mode) && (!strcmp(input_mode, "EMOTICON_LAYOUT"))) {
- if (is_emoticon_show()) {
- ise_destroy_emoticon_layout();
+ if (ise_emoticon_is_show()) {
+ ise_emoticon_destroy_layout();
}
#ifdef _WEARABLE
emoticon_group_t group_id = EMOTICON_GROUP_1;
- if (get_current_emoticon_group() < EMOTICON_GROUP_3)
- group_id = (emoticon_group_t)(get_current_emoticon_group() + 1);
+ if (ise_emoticon_get_current_group() < EMOTICON_GROUP_3)
+ group_id = (emoticon_group_t)(ise_emoticon_get_current_group() + 1);
ise_set_emoticon_label(group_id);
#else
- emoticon_group_t group_id = ise_get_emoticon_group_id(event_desc.key_value);
+ emoticon_group_t group_id = ise_emoticon_get_group_id(event_desc.key_value);
#endif
if ((group_id >= 0) && (group_id < MAX_EMOTICON_GROUP)) {
SCLRotation rotation = ui->get_rotation();
- ise_show_emoticon_layout(group_id, ROTATION_TO_DEGREE(rotation), false, ime_get_main_window());
+ ise_emoticon_show_layout(group_id, ROTATION_TO_DEGREE(rotation), false, ime_get_main_window());
}
}
}
}
}
ui->set_cur_sublayout(g_ise_default_values[layout_index].sublayout_name);
- if (is_emoticon_show()) {
- ise_destroy_emoticon_layout();
+ if (ise_emoticon_is_show()) {
+ ise_emoticon_destroy_layout();
}
if (keyboard_state->layout == ISE_LAYOUT_STYLE_EMOTICON) {
- ise_init_emoticon_list();
+ ise_emoticon_init_list();
#ifdef _WEARABLE
- set_current_emoticon_group(EMOTICON_GROUP_1);
+ ise_emoticon_set_current_group(EMOTICON_GROUP_1);
ise_set_emoticon_label(1);
#else
- if (get_emoticon_list_recent_size() == 0)
- set_current_emoticon_group(EMOTICON_GROUP_1);
+ if (ise_emoticon_get_recent_list_size() == 0)
+ ise_emoticon_set_current_group(EMOTICON_GROUP_1);
else
- set_current_emoticon_group(EMOTICON_GROUP_RECENTLY_USED);
+ ise_emoticon_set_current_group(EMOTICON_GROUP_RECENTLY_USED);
#endif
SCLRotation rotation = ui->get_rotation();
- ise_show_emoticon_layout(get_current_emoticon_group(), ROTATION_TO_DEGREE(rotation), false, ime_get_main_window());
+ ise_emoticon_show_layout(ise_emoticon_get_current_group(), ROTATION_TO_DEGREE(rotation), false, ime_get_main_window());
}
}
}
ise_reset_context(); // reset ISE
- /*if (context.language == ECORE_IMF_INPUT_PANEL_LANG_ALPHABET) {
- ise_explictly_set_language(PRIMARY_LATIN_LANGUAGE_INDEX);
- }*/
+ // if (iseContext.language == ECORE_IMF_INPUT_PANEL_LANG_ALPHABET) {
+ // LOGD("alphabet");
+ // ise_explictly_set_language(PRIMARY_LATIN_LANGUAGE_INDEX);
+ // }
+ // else {
+ // LOGD("non-alphabet");
+ // }
_context_layout = iseContext.layout;
_context_layout_variation = iseContext.layout_variation;
static void ime_app_language_set_cb(Ecore_IMF_Input_Panel_Lang language, void *user_data)
{
LOGD("language : %d\n", language);
+
+ // if (language == ECORE_IMF_INPUT_PANEL_LANG_ALPHABET) {
+ // ise_explictly_set_language(PRIMARY_LATIN_LANGUAGE_INDEX);
+ // }
}
static void ime_app_input_context_reset_cb(void *user_data)
ise_show_move_handler(handler_width, FLOATING_TITLE_BAR_HEIGHT);
}
#endif
- if (is_emoticon_show()) {
- ise_destroy_emoticon_layout();
+ if (ise_emoticon_is_show()) {
+ ise_emoticon_destroy_layout();
}
if (keyboard_state->layout == ISE_LAYOUT_STYLE_VOICE) {
ise_hide_stt_mode();
}
if (keyboard_state->layout == ISE_LAYOUT_STYLE_EMOTICON) {
- ise_show_emoticon_layout(get_current_emoticon_group(), degree, false, ime_get_main_window());
+ ise_emoticon_show_layout(ise_emoticon_get_current_group(), degree, false, ime_get_main_window());
} else if (ui) {
const sclchar *input_mode = ui->get_input_mode();
if (input_mode) {
if (!(strcmp(input_mode, "EMOTICON_LAYOUT")))
- ise_show_emoticon_layout(get_current_emoticon_group(), degree, false, ime_get_main_window());
+ ise_emoticon_show_layout(ise_emoticon_get_current_group(), degree, false, ime_get_main_window());
else if (!(strcmp(input_mode, "STT_3X4")))
ise_show_stt_mode(NATIVE_WINDOW_CAST(ime_get_main_window()));
}