From: Jihoon Kim Date: Mon, 12 Dec 2016 02:53:58 +0000 (+0900) Subject: Support accessibility on on/off option X-Git-Tag: accepted/tizen/3.0/common/20161213.163720~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F67%2F103967%2F1;p=platform%2Fcore%2Fuifw%2Finputmethod-setting.git Support accessibility on on/off option Change-Id: I6163c273f1a88ecd8020edabca20c873624a95be Signed-off-by: Jihoon Kim --- diff --git a/im_setting_list/input_method_setting_list_ui.cpp b/im_setting_list/input_method_setting_list_ui.cpp index f42530e..20e54ee 100644 --- a/im_setting_list/input_method_setting_list_ui.cpp +++ b/im_setting_list/input_method_setting_list_ui.cpp @@ -59,6 +59,12 @@ typedef struct gen_item_data_s int chk_status; } gen_item_data; +typedef struct _Item_Data +{ + int index; + Elm_Object_Item *item; +} Item_Data; + class ime_info_compare { public: @@ -452,9 +458,17 @@ static char *im_setting_list_genlist_group_label_get(void *data, Evas_Object *ob return NULL; } +static void +im_setting_list_genlist_keyboard_list_item_del(void *data, Evas_Object *obj) +{ + Item_Data *id = (Item_Data *)data; + if (id) free(id); +} + static char *im_setting_list_genlist_keyboard_list_item_label_get(void *data, Evas_Object *obj, const char *part) { - int index = (int)reinterpret_cast(data); + Item_Data *id = (Item_Data *)data; + int index = id->index; if (index < 0 || index >= (int)g_ime_info_list.size()) { LOGW("Wrong value. index : %d, g_ime_info_list.size() : %d\n", index, g_ime_info_list.size()); return NULL; @@ -482,7 +496,9 @@ static char *im_setting_list_genlist_title_label_get(void *data, Evas_Object *ob static Evas_Object *im_setting_list_genlist_keyboard_list_item_icon_get(void *data, Evas_Object *obj, const char *part) { - int index = (int)reinterpret_cast(data); + Item_Data *id = (Item_Data *)data; + int index = id->index; + if (index < 0 || index >= (int)g_ime_info_list.size()) { LOGW("Wrong value. index : %d, g_ime_info_list.size() : %d\n", index, g_ime_info_list.size()); return NULL; @@ -500,6 +516,11 @@ static Evas_Object *im_setting_list_genlist_keyboard_list_item_icon_get(void *da evas_object_pass_events_set(ck, EINA_TRUE); evas_object_smart_callback_add(ck, "changed", im_setting_list_check_button_change_cb, (void *)(index)); evas_object_show(ck); + + elm_atspi_accessible_relationship_append(ck, ELM_ATSPI_RELATION_CONTROLLED_BY, id->item); + elm_atspi_accessible_relationship_append(id->item, ELM_ATSPI_RELATION_CONTROLLER_FOR, ck); + elm_atspi_accessible_relationship_append(id->item, ELM_ATSPI_RELATION_DESCRIBED_BY, ck); + return ck; } return NULL; @@ -574,7 +595,7 @@ static void im_setting_list_genlist_item_class_create(int app_type) itc_im_list_keyboard_list->func.text_get = im_setting_list_genlist_keyboard_list_item_label_get; itc_im_list_keyboard_list->func.content_get = im_setting_list_genlist_keyboard_list_item_icon_get; itc_im_list_keyboard_list->func.state_get = NULL; - itc_im_list_keyboard_list->func.del = NULL; + itc_im_list_keyboard_list->func.del = im_setting_list_genlist_keyboard_list_item_del; } } @@ -687,11 +708,12 @@ static void im_setting_list_add_ime(void *data) { #ifdef _MOBILE /* Keyboards group */ Elm_Object_Item *group_header_item = NULL; + Item_Data *id = NULL; group_header_item = elm_genlist_item_append(ad->genlist, itc_im_list_group, IM_SETTING_LIST_KEYBOARD_HEADER, NULL, - ELM_GENLIST_ITEM_NONE, + ELM_GENLIST_ITEM_GROUP, NULL, NULL); elm_genlist_item_select_mode_set(group_header_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); @@ -708,19 +730,22 @@ static void im_setting_list_add_ime(void *data) { } g_gen_item_data.push_back(item_data); - Elm_Object_Item *item = elm_genlist_item_append(ad->genlist, + id = (Item_Data *)calloc(sizeof(Item_Data), 1); + id->index = i; + + id->item = elm_genlist_item_append(ad->genlist, itc_im_list_keyboard_list, - (void *)(i), + id, NULL, ELM_GENLIST_ITEM_NONE, im_setting_list_item_sel_cb, (void *)(i)); if (g_ime_info_list[i].is_preinstalled || (i == g_active_ime_index)) { - elm_object_item_disabled_set(item, EINA_TRUE); + elm_object_item_disabled_set(id->item, EINA_TRUE); } - g_gen_item_data[i].gen_item = item; + g_gen_item_data[i].gen_item = id->item; } #endif