From 014fc36a5d8dfdb88e819978274cb238fb2ffd5e Mon Sep 17 00:00:00 2001 From: "hhh.kwon" Date: Thu, 20 Jun 2013 22:44:08 +0900 Subject: [PATCH] Implement lockscreen tts. Change-Id: If40074e2d5a853130486ad932d569b608bf3f1c4 --- data/groups/lock-main.edc | 36 +++++++++++++++++++++++++ src/util.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 104 insertions(+), 1 deletion(-) diff --git a/data/groups/lock-main.edc b/data/groups/lock-main.edc index 9344c07..82db78a 100755 --- a/data/groups/lock-main.edc +++ b/data/groups/lock-main.edc @@ -121,6 +121,18 @@ } } part{ + name: "tts.title"; + type: RECT; + repeat_events: 1; + description{ + state: "default" 0.0; + fixed: 1 1; + rel1.to: "text.area"; + rel2.to: "text.area"; + color : 0 0 0 0; + } + } + part{ name: "sw.noti"; type: SWALLOW; scale: 1; @@ -172,6 +184,18 @@ } } part{ + name: "tts.sim.state"; + type: RECT; + repeat_events: 1; + description{ + state: "default" 0.0; + fixed: 1 1; + rel1.to: "sim.state"; + rel2.to: "sim.state"; + color : 0 0 0 0; + } + } + part{ name: "rect.info"; type: SWALLOW; scale: 1; @@ -210,6 +234,18 @@ } } part{ + name: "tts.info"; + type: RECT; + repeat_events: 1; + description{ + state: "default" 0.0; + fixed: 1 1; + rel1.to: "rect.info"; + rel2.to: "rect.info"; + color : 0 0 0 0; + } + } + part{ name: "dim.bg"; type: SWALLOW; scale: 1; diff --git a/src/util.c b/src/util.c index 670ca14..c3fbf29 100755 --- a/src/util.c +++ b/src/util.c @@ -391,6 +391,44 @@ static Evas_Object *_access_object_get(Evas_Object *obj, const char *part) return ao; } +const char *_lock_info_access_activate_cb(void *data, Evas_Object *obj) +{ + struct appdata *ad = data; + if(ad == NULL || obj == NULL) { + return NULL; + } + if(ad->ly_main == NULL || ad->info == NULL) { + return NULL; + } + + const char *text = NULL; + Eina_Strbuf *str_buf = NULL; + str_buf = eina_strbuf_new(); + if(str_buf == NULL) { + LOCK_SCREEN_TRACE_ERR("eina_strbuf_new() failed"); + return NULL; + } + + text = elm_object_part_text_get(ad->info, "txt.clock"); + if(text) { + text = evas_textblock_text_markup_to_utf8(NULL, text); + if(text) + eina_strbuf_append(str_buf, text); + } + + text = elm_object_part_text_get(ad->info, "txt.date"); + if(text) { + text = evas_textblock_text_markup_to_utf8(NULL, text); + if(text) + eina_strbuf_append(str_buf, text); + } + + text = strdup(eina_strbuf_string_get(str_buf)); + eina_strbuf_free(str_buf); + + return text?strdup(text):NULL; +} + static Eina_Bool _init_widget_cb(void *data) { struct appdata *ad = data; @@ -443,10 +481,39 @@ static Eina_Bool _init_widget_cb(void *data) edje_object_signal_callback_add(_EDJ(ad->ly_main), "exit,app", "event", _app_exit, ad); + Eina_List *chain_list = NULL; + ad->ao_bg = _access_object_get(ad->ly_main, "tts.bg"); if(ad->ao_bg) { elm_access_action_cb_set(ad->ao_bg, ELM_ACCESS_ACTION_MOUSE, _mouse_cb, ad); - } + elm_object_focus_allow_set(ad->ao_bg, EINA_TRUE); + chain_list = eina_list_append(chain_list, ad->ao_bg); + } + Evas_Object *ao_title = _access_object_get(ad->ly_main, "tts.title"); + if(ao_title) { + elm_access_info_set(ao_title, ELM_ACCESS_INFO, "Life Magazine"); + elm_access_info_set(ao_title, ELM_ACCESS_TYPE, ""); + elm_object_focus_allow_set(ao_title, EINA_TRUE); + chain_list = eina_list_append(chain_list, ao_title); + } + Evas_Object *ao_sim = _access_object_get(ad->ly_main, "tts.sim.state"); + if(ao_sim) { + const char *text_sim = elm_object_part_text_get(ad->ly_main, "sim.state"); + if(text_sim) { + elm_access_info_set(ao_sim, ELM_ACCESS_INFO, text_sim); + } + elm_access_info_set(ao_sim, ELM_ACCESS_TYPE, ""); + elm_object_focus_allow_set(ao_sim, EINA_TRUE); + chain_list = eina_list_append(chain_list, ao_sim); + } + Evas_Object *ao_info = _access_object_get(ad->ly_main, "tts.info"); + if(ao_info) { + elm_access_info_cb_set(ao_info, ELM_ACCESS_INFO, _lock_info_access_activate_cb, ad); + elm_access_info_set(ao_info, ELM_ACCESS_TYPE, ""); + elm_object_focus_allow_set(ao_info, EINA_TRUE); + chain_list = eina_list_append(chain_list, ao_info); + } + elm_object_focus_custom_chain_set(ad->ly_main, chain_list); vconf_set_int(VCONFKEY_IDLE_LOCK_STATE, VCONFKEY_IDLE_LOCK); -- 2.7.4