diff options
Diffstat (limited to 'src/main.c')
-rwxr-xr-x | src/main.c | 89 |
1 files changed, 42 insertions, 47 deletions
@@ -56,7 +56,6 @@ void _screen_reader_sec_description_change(void* data); static Eina_Bool _screen_reader_reset_button_cb(void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info); void _screen_reader_objects_create(void* data); void _screen_reader_setting_screen_update(void* data); -void _screen_reader_preset_screen_update(void* data); void _screen_reader_preset_screen_launch(void* data); void _screen_reader_transition_from_runing_to_setting_screen(void* data); void _screen_reader_transition_from_setting_to_runing_screen(void* data); @@ -672,9 +671,6 @@ static void _tmr_button_state_update(void *data) TMR_INFO("btn disable"); elm_object_signal_emit(ad->ly_main, "rbutton,hide", "*"); //call preset screen -#ifdef __SCREEN_READER_ENABLE - _screen_reader_preset_screen_update(ad); -#endif } else { elm_object_disabled_set(ad->eo_btn_lft, EINA_FALSE); TMR_INFO("btn enable"); @@ -1090,7 +1086,6 @@ static void _tmr_reset_cb(void *data) } elm_object_signal_emit(ad->progress, "default", ""); #ifdef __SCREEN_READER_ENABLE - _screen_reader_preset_screen_update(ad); _screen_reader_preset_screen_launch(ad); #endif } @@ -1168,6 +1163,7 @@ static void _tmr_rbtn_cb_ex(void *data, Evas_Object *obj, const char *emission, ad->min = 0; ad->sec = 0; _tmr_timepicker_time_update(ad); + _screen_reader_preset_screen_launch(ad); } else { if ((ad->due_time.tv_sec <= 0) || (ad->due_time.tv_sec == 1 && ad->due_time.tv_usec <= 0)) { @@ -2012,24 +2008,14 @@ void _screen_reader_objects_create(void* data) elm_atspi_accessible_reading_info_type_set(sr_data->time_text, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION)); //for reset button and cancle_button - sr_data->reset_button = elm_access_object_register(edje_object_part_object_get(_EDJ(ad->ly_main), "resetbutton_rect"), ad->ly_main); + sr_data->reset_cancel_button = elm_access_object_register(edje_object_part_object_get(_EDJ(ad->ly_main), "rbutton,touch"), ad->ly_main); snprintf(buf, sizeof(buf), "%s", S_(STRING_TMR_RESET)); - elm_atspi_accessible_name_set(sr_data->reset_button, buf); - snprintf(buf, sizeof(buf), "%s", S_(STRING_TTS_TMR_BUTTON)); - elm_atspi_accessible_description_set(sr_data->reset_button, buf); - elm_atspi_accessible_translation_domain_set(sr_data->reset_button, PACKAGE); - elm_atspi_accessible_reading_info_type_set(sr_data->reset_button, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION)); - elm_access_action_cb_set(sr_data->reset_button, ELM_ACCESS_ACTION_ACTIVATE, _screen_reader_reset_button_cb, ad); - - //for reset button and cancle_button - sr_data->cancel_button = elm_access_object_register(edje_object_part_object_get(_EDJ(ad->ly_main), "cancelbutton_rect"), ad->ly_main); - snprintf(buf, sizeof(buf), "%s", S_(STRING_TMR_CANCEL)); - elm_atspi_accessible_name_set(sr_data->cancel_button, buf); + elm_atspi_accessible_name_set(sr_data->reset_cancel_button, buf); snprintf(buf, sizeof(buf), "%s", S_(STRING_TTS_TMR_BUTTON)); - elm_atspi_accessible_description_set(sr_data->cancel_button, buf); - elm_atspi_accessible_translation_domain_set(sr_data->cancel_button, PACKAGE); - elm_atspi_accessible_reading_info_type_set(sr_data->cancel_button, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION)); - elm_access_action_cb_set(sr_data->cancel_button, ELM_ACCESS_ACTION_ACTIVATE, _screen_reader_reset_button_cb, ad); + elm_atspi_accessible_description_set(sr_data->reset_cancel_button, buf); + elm_atspi_accessible_translation_domain_set(sr_data->reset_cancel_button, PACKAGE); + elm_atspi_accessible_reading_info_type_set(sr_data->reset_cancel_button, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION)); + elm_access_action_cb_set(sr_data->reset_cancel_button, ELM_ACCESS_ACTION_ACTIVATE, _screen_reader_reset_button_cb, ad); //for pause and resume buttons sr_data->pause_resume_button = elm_access_object_register(edje_object_part_object_get(_EDJ(ad->ly_main), "lbutton,touch"), ad->ly_main); @@ -2086,24 +2072,26 @@ void _screen_reader_objects_create(void* data) elm_access_action_cb_set(sr_data->start_button, ELM_ACCESS_ACTION_ACTIVATE, _screen_reader_start_button_cb, ad); - elm_atspi_accessible_relationship_append(sr_data->reset_button, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->timer_title); - elm_atspi_accessible_relationship_append(sr_data->hour_spinner, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->reset_button); + elm_atspi_accessible_relationship_append(sr_data->reset_cancel_button, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->timer_title); + elm_atspi_accessible_relationship_append(sr_data->hour_spinner, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->reset_cancel_button); elm_atspi_accessible_relationship_append(sr_data->min_spinner, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->hour_spinner); elm_atspi_accessible_relationship_append(sr_data->sec_spinner, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->min_spinner); elm_atspi_accessible_relationship_append(sr_data->start_button, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->sec_spinner); - + elm_atspi_accessible_relationship_append(sr_data->time_text, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->start_button); elm_atspi_accessible_relationship_append(sr_data->pause_resume_button, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->time_text); - elm_atspi_accessible_relationship_append(sr_data->time_text, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->cancel_button); + //elm_atspi_accessible_relationship_append(sr_data->time_text, ELM_ATSPI_RELATION_FLOWS_FROM, sr_data->cancel_button); - elm_atspi_accessible_relationship_append(sr_data->timer_title, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->reset_button); - elm_atspi_accessible_relationship_append(sr_data->reset_button, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->hour_spinner); + elm_atspi_accessible_relationship_append(sr_data->timer_title, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->reset_cancel_button); + elm_atspi_accessible_relationship_append(sr_data->reset_cancel_button, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->hour_spinner); elm_atspi_accessible_relationship_append(sr_data->hour_spinner, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->min_spinner); elm_atspi_accessible_relationship_append(sr_data->min_spinner, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->sec_spinner); elm_atspi_accessible_relationship_append(sr_data->sec_spinner, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->start_button); + elm_atspi_accessible_relationship_append(sr_data->start_button, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->time_text); - elm_atspi_accessible_relationship_append(sr_data->cancel_button, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->time_text); + //elm_atspi_accessible_relationship_append(sr_data->cancel_button, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->time_text); elm_atspi_accessible_relationship_append(sr_data->time_text, ELM_ATSPI_RELATION_FLOWS_TO, sr_data->pause_resume_button); + elm_atspi_accessible_relationship_append(sr_data->time_text, ELM_ATSPI_RELATION_FLOWS_TO, NULL); } @@ -2116,17 +2104,7 @@ void _screen_reader_setting_screen_update(void* data) screenreader_data* sr_data = ad->sr_data; //title is hidden here elm_atspi_accessible_can_highlight_set(sr_data->timer_title, EINA_FALSE); - elm_atspi_accessible_can_highlight_set(sr_data->reset_button, EINA_TRUE); -} -void _screen_reader_preset_screen_update(void* data) -{ - _D(""); - struct appdata *ad = (struct appdata *)data; - ret_if(!ad); - screenreader_data* sr_data = ad->sr_data; - //reset is hidden here - elm_atspi_accessible_can_highlight_set(sr_data->timer_title, EINA_TRUE); - elm_atspi_accessible_can_highlight_set(sr_data->reset_button, EINA_FALSE); + elm_atspi_accessible_can_highlight_set(sr_data->reset_cancel_button, EINA_TRUE); } void _screen_reader_preset_screen_launch(void* data) @@ -2138,8 +2116,8 @@ void _screen_reader_preset_screen_launch(void* data) //when this screen is luanched grab elm_atspi_accessible_can_highlight_set(sr_data->timer_title, EINA_TRUE); - elm_atspi_accessible_can_highlight_set(sr_data->reset_button, EINA_FALSE); - elm_atspi_accessible_can_highlight_set(sr_data->cancel_button, EINA_FALSE); + elm_atspi_accessible_can_highlight_set(sr_data->reset_cancel_button, EINA_FALSE); + //elm_atspi_accessible_can_highlight_set(sr_data->cancel_button, EINA_FALSE); elm_atspi_component_highlight_grab(sr_data->timer_title); } @@ -2239,12 +2217,20 @@ void _screen_reader_transition_from_setting_to_runing_screen(void* data) elm_atspi_accessible_can_highlight_set(sr_data->min_spinner, EINA_FALSE); elm_atspi_accessible_can_highlight_set(sr_data->sec_spinner, EINA_FALSE); elm_atspi_accessible_can_highlight_set(sr_data->start_button, EINA_FALSE); - elm_atspi_accessible_can_highlight_set(sr_data->reset_button, EINA_FALSE); - elm_atspi_accessible_can_highlight_set(sr_data->cancel_button, EINA_TRUE); elm_atspi_accessible_can_highlight_set(sr_data->time_text, EINA_TRUE); elm_atspi_accessible_can_highlight_set(sr_data->pause_resume_button, EINA_TRUE); - elm_atspi_component_highlight_grab(sr_data->cancel_button); + //elm_atspi_component_highlight_grab(sr_data->cancel_button); + elm_atspi_accessible_can_highlight_set(sr_data->reset_cancel_button, EINA_TRUE); + elm_atspi_component_highlight_grab(sr_data->reset_cancel_button); + + //change lable for reset button to cancel + snprintf(buf, sizeof(buf), "%s", S_(STRING_TMR_CANCEL)); + elm_atspi_accessible_name_set(sr_data->reset_cancel_button, buf); + snprintf(buf, sizeof(buf), "%s", S_(STRING_TTS_TMR_BUTTON)); + elm_atspi_accessible_description_set(sr_data->reset_cancel_button, buf); + elm_atspi_accessible_translation_domain_set(sr_data->reset_cancel_button, PACKAGE); + elm_atspi_accessible_reading_info_type_set(sr_data->reset_cancel_button, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION)); //change lable for pause_resume_button to pause snprintf(buf, sizeof(buf), "%s", S_(STRING_TMR_PAUSE)); @@ -2259,10 +2245,11 @@ void _screen_reader_transition_from_runing_to_setting_screen(void* data) { _D(""); struct appdata *ad = (struct appdata *)data; + char buf[256] = {0,}; ret_if(!ad); screenreader_data* sr_data = ad->sr_data; elm_atspi_accessible_can_highlight_set(sr_data->timer_title, EINA_FALSE); - elm_atspi_accessible_can_highlight_set(sr_data->cancel_button, EINA_FALSE); + //elm_atspi_accessible_can_highlight_set(sr_data->cancel_button, EINA_FALSE); elm_atspi_accessible_can_highlight_set(sr_data->time_text, EINA_FALSE); elm_atspi_accessible_can_highlight_set(sr_data->pause_resume_button, EINA_FALSE); @@ -2270,7 +2257,15 @@ void _screen_reader_transition_from_runing_to_setting_screen(void* data) elm_atspi_accessible_can_highlight_set(sr_data->min_spinner, EINA_TRUE); elm_atspi_accessible_can_highlight_set(sr_data->sec_spinner, EINA_TRUE); elm_atspi_accessible_can_highlight_set(sr_data->start_button, EINA_TRUE); - elm_atspi_accessible_can_highlight_set(sr_data->reset_button, EINA_TRUE); - elm_atspi_component_highlight_grab(sr_data->reset_button); + elm_atspi_accessible_can_highlight_set(sr_data->reset_cancel_button, EINA_TRUE); + elm_atspi_component_highlight_grab(sr_data->reset_cancel_button); + + snprintf(buf, sizeof(buf), "%s", S_(STRING_TMR_RESET)); + elm_atspi_accessible_name_set(sr_data->reset_cancel_button, buf); + snprintf(buf, sizeof(buf), "%s", S_(STRING_TTS_TMR_BUTTON)); + elm_atspi_accessible_description_set(sr_data->reset_cancel_button, buf); + elm_atspi_accessible_translation_domain_set(sr_data->reset_cancel_button, PACKAGE); + elm_atspi_accessible_reading_info_type_set(sr_data->reset_cancel_button, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION)); + } #endif |