summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <kimcinoo.efl@gmail.com>2013-01-12 06:41:21 +0000
committerShinwoo Kim <kimcinoo.efl@gmail.com>2013-01-12 06:41:21 +0000
commitc3fdd57d5edbd8fe301440fe0bee207ecac751a2 (patch)
tree4435ad1501157803f684d4a6fc65dbfc21e6c867
parentdf4c7c551b113189adf3096be445f5f5bdc11e2f (diff)
[naviframe] rebuild broken accessibility feature on title area.
SVN revision: 82685
-rw-r--r--src/lib/elc_naviframe.c90
1 files changed, 40 insertions, 50 deletions
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index cbe0ab086..2accf3c20 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -15,6 +15,7 @@ static const char NEXT_BTN_PART[] = "elm.swallow.next_btn";
15static const char ICON_PART[] = "elm.swallow.icon"; 15static const char ICON_PART[] = "elm.swallow.icon";
16static const char TITLE_PART[] = "elm.text.title"; 16static const char TITLE_PART[] = "elm.text.title";
17static const char SUBTITLE_PART[] = "elm.text.subtitle"; 17static const char SUBTITLE_PART[] = "elm.text.subtitle";
18static const char TITLE_ACCESS_PART[] = "title_base";
18 19
19static const char SIG_TRANSITION_FINISHED[] = "transition,finished"; 20static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
20static const char SIG_TITLE_CLICKED[] = "title,clicked"; 21static const char SIG_TITLE_CLICKED[] = "title,clicked";
@@ -202,9 +203,8 @@ _access_object_get(Elm_Naviframe_Item *it, const char* part)
202{ 203{
203 Evas_Object *po, *ao; 204 Evas_Object *po, *ao;
204 205
205 if (!elm_object_part_text_get(VIEW(it), part)) return NULL; 206 po = (Evas_Object *)edje_object_part_object_get
206 207 (elm_layout_edje_get(VIEW(it)), part);
207 po = (Evas_Object *)elm_object_part_content_get(VIEW(it), part);
208 ao = evas_object_data_get(po, "_part_access_obj"); 208 ao = evas_object_data_get(po, "_part_access_obj");
209 209
210 return ao; 210 return ao;
@@ -221,7 +221,7 @@ _access_focus_set(Elm_Naviframe_Item *it)
221 return; 221 return;
222 } 222 }
223 223
224 ao =_access_object_get(it, TITLE_PART); 224 ao =_access_object_get(it, TITLE_ACCESS_PART);
225 if (ao) elm_object_focus_set(ao, EINA_TRUE); 225 if (ao) elm_object_focus_set(ao, EINA_TRUE);
226 else if ((it->title_icon) && 226 else if ((it->title_icon) &&
227 (elm_widget_can_focus_get(it->title_icon) || 227 (elm_widget_can_focus_get(it->title_icon) ||
@@ -300,54 +300,55 @@ _elm_naviframe_smart_theme(Eo *obj, void *_pd, va_list *list)
300 if (ret) *ret = EINA_TRUE; 300 if (ret) *ret = EINA_TRUE;
301} 301}
302 302
303static char *
304_access_info_cb(void *data, Evas_Object *obj __UNUSED__)
305{
306 Evas_Object *layout;
307 Eina_Strbuf *buf;
308 const char *info;
309 char *ret;
310
311 layout = (Evas_Object *)data;
312 info = elm_object_part_text_get(layout, TITLE_PART);
313 if (!info) return NULL;
314
315 buf = eina_strbuf_new();
316 eina_strbuf_append(buf, info);
317
318 info = elm_object_part_text_get(layout, SUBTITLE_PART);
319 if (!info) goto end;
320
321 eina_strbuf_append_printf(buf, ", %s", info);
322
323end:
324 ret = eina_strbuf_string_steal(buf);
325 eina_strbuf_free(buf);
326 return ret;
327}
328
303static void 329static void
304_access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access) 330_access_obj_process(Elm_Naviframe_Item *it, Eina_Bool is_access)
305{ 331{
306 Evas_Object *ao; 332 Evas_Object *ao, *eo;
307 Elm_Naviframe_Text_Item_Pair *pair;
308 333
309 if (is_access) 334 if (is_access)
310 { 335 {
311 if (!_access_object_get(it, TITLE_PART)) 336 if (!_access_object_get(it, TITLE_ACCESS_PART))
312 { 337 {
313 ao =_elm_access_edje_object_part_object_register 338 eo = elm_layout_edje_get(VIEW(it));
314 (WIDGET(it), VIEW(it), TITLE_PART); 339 ao =_elm_access_edje_object_part_object_register(WIDGET(it), eo,
340 TITLE_ACCESS_PART);
315 _elm_access_text_set(_elm_access_object_get(ao), 341 _elm_access_text_set(_elm_access_object_get(ao),
316 ELM_ACCESS_TYPE, E_("title")); 342 ELM_ACCESS_TYPE, E_("Title"));
343 _elm_access_callback_set(_elm_access_object_get(ao),
344 ELM_ACCESS_INFO, _access_info_cb, VIEW(it));
317 } 345 }
318
319 if (!_access_object_get(it, SUBTITLE_PART))
320 {
321 ao =_elm_access_edje_object_part_object_register
322 (WIDGET(it), VIEW(it), SUBTITLE_PART);
323 _elm_access_text_set(_elm_access_object_get(ao),
324 ELM_ACCESS_TYPE, E_("sub title"));
325 }
326
327 EINA_INLIST_FOREACH(it->text_list, pair)
328 {
329 if (!_access_object_get(it, pair->part))
330 {
331 ao = _elm_access_edje_object_part_object_register
332 (WIDGET(it), VIEW(it), pair->part);
333 _elm_access_text_set(_elm_access_object_get(ao),
334 ELM_ACCESS_TYPE, E_(pair->part));
335 }
336 }
337 } 346 }
338 else 347 else
339 { 348 {
340 if (it->title_label) 349 if (it->title_label)
341 _elm_access_edje_object_part_object_unregister 350 _elm_access_edje_object_part_object_unregister
342 (WIDGET(it), VIEW(it), TITLE_PART); 351 (WIDGET(it), elm_layout_edje_get(VIEW(it)), TITLE_ACCESS_PART);
343
344 if (it->subtitle_label)
345 _elm_access_edje_object_part_object_unregister
346 (WIDGET(it), VIEW(it), SUBTITLE_PART);
347
348 EINA_INLIST_FOREACH(it->text_list, pair)
349 _elm_access_edje_object_part_object_unregister
350 (WIDGET(it), VIEW(it), pair->part);
351 } 352 }
352} 353}
353 354
@@ -1167,7 +1168,6 @@ _elm_naviframe_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1167 Eina_List *l = NULL; 1168 Eina_List *l = NULL;
1168 Elm_Naviframe_Item *top_it; 1169 Elm_Naviframe_Item *top_it;
1169 Elm_Naviframe_Content_Item_Pair *content_pair = NULL; 1170 Elm_Naviframe_Content_Item_Pair *content_pair = NULL;
1170 Elm_Naviframe_Text_Item_Pair *text_pair = NULL;
1171 void *(*list_data_get)(const Eina_List *list); 1171 void *(*list_data_get)(const Eina_List *list);
1172 1172
1173 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction); 1173 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
@@ -1192,18 +1192,8 @@ _elm_naviframe_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1192 /* access */ 1192 /* access */
1193 if (_elm_config->access_mode) 1193 if (_elm_config->access_mode)
1194 { 1194 {
1195 ao = _access_object_get(top_it, TITLE_PART); 1195 ao = _access_object_get(top_it, TITLE_ACCESS_PART);
1196 if (ao) l = eina_list_append(l, ao);
1197
1198 ao = _access_object_get(top_it, SUBTITLE_PART);
1199 if (ao) l = eina_list_append(l, ao); 1196 if (ao) l = eina_list_append(l, ao);
1200
1201
1202 EINA_INLIST_FOREACH(top_it->text_list, text_pair)
1203 {
1204 ao = _access_object_get(top_it, text_pair->part);
1205 if (ao) l = eina_list_append(l, ao);
1206 }
1207 } 1197 }
1208 1198
1209 /* icon would be able to have an widget. ex: segment control */ 1199 /* icon would be able to have an widget. ex: segment control */