int fms_do_button_loop(bool update_screen) { int button = skin_wait_for_action(fms_skin, CONTEXT_FM, update_screen ? TIMEOUT_NOBLOCK : HZ); #ifdef HAVE_TOUCHSCREEN int offset; if (button == ACTION_TOUCHSCREEN) button = skin_get_touchaction(&fms_skin_data[SCREEN_MAIN], &offset); switch (button) { case ACTION_WPS_STOP: return ACTION_FM_STOP; case ACTION_STD_CANCEL: return ACTION_FM_EXIT; case ACTION_WPS_VOLUP: return ACTION_SETTINGS_INC; case ACTION_WPS_VOLDOWN: return ACTION_SETTINGS_DEC; case ACTION_WPS_PLAY: return ACTION_FM_PLAY; case ACTION_STD_MENU: return ACTION_FM_MENU; case WPS_TOUCHREGION_SCROLLBAR: /* TODO */ break; } #endif return button; }
int sb_touch_to_button(int context) { struct touchregion *region; static int last_context = -1; int button, offset; if (bypass_sb_touchregions) return ACTION_TOUCHSCREEN; if (last_context != context) skin_disarm_touchregions(skin_get_gwps(CUSTOM_STATUSBAR, SCREEN_MAIN)->data); last_context = context; button = skin_get_touchaction(skin_get_gwps(CUSTOM_STATUSBAR, SCREEN_MAIN)->data, &offset, ®ion); switch (button) { #ifdef HAVE_VOLUME_IN_LIST case ACTION_WPS_VOLUP: return ACTION_LIST_VOLUP; case ACTION_WPS_VOLDOWN: return ACTION_LIST_VOLDOWN; #endif /* TODO */ } return button; }