From 89b34e88d530be0bc88b1cc4a4ceb727dfd4cebf Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 18 Oct 2017 15:03:35 +0900 Subject: [PATCH] Add app-specific input method to quick response list Change-Id: I00a6a94dba8b64b79371e1a9b88f14a2811f0f6e Signed-off-by: sungwook79.park --- src/w-input-selector.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 77e12c1..23db269 100755 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -462,6 +462,39 @@ static void __ise_gl_lang_changed(void *data, Evas_Object *obj, void *event_info elm_genlist_realized_items_update(obj); } +static char * __ise_drawing_text_get(void *data, Evas_Object *obj, const char *part) +{ + if(!strcmp(part, "elm.text")) { + return(strdup(gettext("WDS_IME_MBODY_DRAWING_M_EMOTICON_ABB"))); + } + return NULL; +} + +static Evas_Object * __ise_drawing_content_get(void *data, Evas_Object *obj, const char *part) +{ + if (!strcmp(part, "elm.icon")) { + Evas_Object* btn = elm_button_add(obj); + evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + Evas_Object* ic = elm_image_add(btn); + elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE); + string path = get_resource_path(); + if (_WEARABLE) + path = path + "wearable/"; + else if (_TV) + path = path + "tv/"; + else + path = path + "mobile/"; + elm_object_style_set(btn, "ime_button_drawing"); + string path_ic = path + "images/wi_drawing_icon.png"; + elm_image_file_set(ic, path_ic.c_str(), NULL); + elm_object_content_set(btn, ic); + evas_object_layer_set(btn, 32000); + return btn; + } + return NULL; +} + void set_source_caller_app_id(app_control_h app_control) { if (!app_control){ @@ -921,6 +954,15 @@ unsigned int _update_smartreply_items(void *user_data) return item_size; } +static void _drawing_item_clicked_cb(void *data, Evas_Object * obj, void *event_info) +{ + PRINTFUNC(DLOG_DEBUG, "%s", __func__); + App_Data* ad = (App_Data*) data; + if (!ad) + return; + + launch_drawing_app(ad); +} unsigned int _update_template_items(void *user_data) { @@ -990,6 +1032,28 @@ unsigned int _update_template_items(void *user_data) } elm_genlist_item_class_free(itc); + // drawing button (+) + if (app_data->mime_type == MIME_TYPE_ALL) { + Elm_Genlist_Item_Class *itc; + itc = elm_genlist_item_class_new(); + + itc->item_style = "1text.1icon"; + itc->func.text_get = __ise_drawing_text_get;; + itc->func.content_get = __ise_drawing_content_get; + itc->func.state_get = NULL; + itc->func.del = NULL; + + elm_genlist_item_append(app_data->genlist, + itc, + NULL, + NULL, + ELM_GENLIST_ITEM_NONE, + _drawing_item_clicked_cb, + app_data); + + elm_genlist_item_class_free(itc); + } + // dummy item for empty space Elm_Genlist_Item_Class * itc0 = elm_genlist_item_class_new(); itc0->item_style = "title"; -- 2.7.4