static void i51EntryI51Check(void) { // author : Miki // since : 2011.12.2 // (C) PKIG Tech. Co., Ltd. #if( I51_MTK_VS == VS_11B_1224 ) if( GetActiveScreenId() != SCR_ID_ALERT_0 ) #else if( GetActiveScreenId() != SCR_CONFIRM_SCREEN ) #endif { gui_cancel_timer( i51EntryI51Check ); } else if( i51KernelGetInitStatus() == i51_KERNEL_INIT_SUCCEED ) { gui_cancel_timer(i51EntryI51Check); if(l_EntyMenuFnPtr) l_EntyMenuFnPtr(); } else { if(i51KernelGetInitStatus() == i51_KERNEL_INIT_FAILED && l_BootWaited ) i51KernelInit(0); gui_start_timer( 1000, i51EntryI51Check ); } }
/** * @brief 停止指定的定时器 * @param idTimer - IN 定时器ID */ void SFTimer_Stop(SFTIMER_ID idTimer) { if(g_kernal.iTimerInfo.iTimerId==idTimer) { gui_cancel_timer(SFTimer_Callback); } }
/***************************************************************************** * FUNCTION * mdi_motion_stop_listen * DESCRIPTION * stop listen to event * PARAMETERS * void * RETURNS * MDI_RESULT *****************************************************************************/ MDI_RESULT mdi_motion_stop_listen(void) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ g_mdi_motion_cntx.shake_callback = NULL; g_mdi_motion_cntx.tile_callback = NULL; g_mdi_motion_cntx.state = MOTION_STATE_IDLE; #ifdef MDI_MOTION_DRIVER_AVAIALBE gui_cancel_timer(mdi_motion_disable_mute_timeout); SetProtocolEventHandler(NULL, MSG_ID_MDI_MOTION_DATA_STATE_RSP); #endif /* MDI_MOTION_DRIVER_AVAIALBE */ return MDI_RES_MOTION_SUCCEED; }
/***************************************************************************** * FUNCTION * wgui_horizontal_tab_bar_translate_pen_event * DESCRIPTION * * PARAMETERS * pen_event [IN] * x [IN] * y [IN] * RETURNS * *****************************************************************************/ BOOL wgui_horizontal_tab_bar_translate_pen_event(mmi_pen_event_type_enum pen_event, S16 x, S16 y) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ BOOL ret; gui_tab_bar_pen_enum tab_event; gui_pen_event_param_struct tab_param; horizontal_tab_bar *tb = &MMI_horizontal_tab_bar; S32 prev_fdisp; /* first displayed item before pen down */ S32 prev_focus; /* focused item before pen down */ /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ prev_fdisp = tb->first_displayed_item; prev_focus = tb->focused_item; ret = gui_horizontal_tab_bar_translate_pen_event(tb, pen_event, x, y, &tab_event, &tab_param); if (ret) { if (pen_event == MMI_PEN_EVENT_DOWN) { gui_cancel_timer(wgui_horizontal_tab_bar_restore_offset_timer_hdlr); if (MMI_horizontal_tab_bar_first_displayed_before_pen_down < 0) { MMI_horizontal_tab_bar_first_displayed_before_pen_down = prev_fdisp; } } if (tab_event == GUI_TAB_BAR_PEN_NEED_REDRAW) { wgui_show_horizontal_tab_bar_tab_area(); } else if (tab_event == GUI_TAB_BAR_PEN_JUMP_TO_I) { if (MMI_horizontal_tab_bar_select_callback) { MMI_horizontal_tab_bar_first_displayed_on_screen_switched = tb->first_displayed_item; MMI_horizontal_tab_bar_select_callback(tab_param._u.i); MMI_horizontal_tab_bar_first_displayed_on_screen_switched = -1; } } if ((pen_event == MMI_PEN_EVENT_ABORT || pen_event == MMI_PEN_EVENT_UP) && MMI_horizontal_tab_bar.focused_item == prev_focus && MMI_horizontal_tab_bar.first_displayed_item != MMI_horizontal_tab_bar_first_displayed_before_pen_down) { if (gui_horizontal_tab_bar_is_item_displayed(tb, tb->focused_item)) { MMI_horizontal_tab_bar_first_displayed_before_pen_down = -1; } else { wgui_horizontal_tab_bar_start_restore_offset_timer(); } } return MMI_TRUE; } else { return MMI_FALSE; } }
/***************************************************************************** * FUNCTION * gui_panel_translate_pen_event * DESCRIPTION * Pen event handler in GUI panel component * PARAMETERS * panel [IN/OUT] * pen_event [IN] * x [IN] * y [IN] * RETURNS * MMI_TRUE if the pen event is handled by panel. * If pen_event != MMI_PEN_EVENT_DOWN, always return MMI_TRUE. *****************************************************************************/ MMI_BOOL gui_panel_translate_pen_event( gui_panel_struct *panel, mmi_pen_event_type_enum pen_event, S16 x, S16 y) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ MMI_BOOL ret; S32 i; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ if (!panel || panel->element_count <= 0) { return MMI_FALSE; } /* Return true by default except for Pen Down */ ret = MMI_TRUE; switch (pen_event) { case MMI_PEN_EVENT_DOWN: ret = MMI_FALSE; panel->element_pen_down_index = -1; for (i = 0; i < panel->element_count; i++) { gui_panel_element_struct *e = &panel->elements[i]; if (e->disabled_state) { continue; } if (PEN_CHECK_BOUND(x, y, e->x1, e->y1, e->x2 - e->x1 + 1, e->y2 - e->y1 + 1)) { ret = MMI_TRUE; if (panel->element_focus_index != i && panel->display_focus) { gui_panel_show_element( panel, &panel->elements[panel->element_focus_index], GUI_PANEL_ELEM_STATE_NORMAL, MMI_FALSE); } panel->element_pen_down_index = i; panel->element_focus_index = i; gui_panel_show_element(panel, e, GUI_PANEL_ELEM_STATE_DOWN, MMI_FALSE); e->down_state = 1; /* Upper applications may use GetKeyInfo() to detect the event, though it's not a good design */ SetkeyInfo(e->keycode, KEY_EVENT_DOWN); /* Invoke callback */ e->down_event_callback(); /* repeat timer */ g_curr_active_panel = panel; gui_start_timer(panel->repeat_period, gui_panel_repeat_timer); break; } } break; case MMI_PEN_EVENT_UP: if (g_curr_active_panel == panel && panel->element_pen_down_index >= 0) { gui_panel_element_struct *e = &panel->elements[panel->element_pen_down_index]; if (e->down_state) /* If pen was inside the region */ { gui_panel_show_element( panel, e, panel->display_focus ? GUI_PANEL_ELEM_STATE_FOCUSSED : GUI_PANEL_ELEM_STATE_NORMAL, MMI_FALSE); e->down_state = 0; } /* Upper applications may use GetKeyInfo() to detect the event, though it's not a good design */ SetkeyInfo(e->keycode, KEY_EVENT_UP); /* Invoke callback no matter pen was inside the element or not */ e->up_event_callback(); /* repeat timer */ g_curr_active_panel = NULL; gui_cancel_timer(gui_panel_repeat_timer); } break; case MMI_PEN_EVENT_MOVE: if (g_curr_active_panel == panel && panel->element_pen_down_index >= 0) { gui_panel_element_struct *e = &panel->elements[panel->element_pen_down_index]; MMI_BOOL point_inside = PEN_CHECK_BOUND(x, y, e->x1, e->y1, e->x2 - e->x1 + 1, e->y2 - e->y1 + 1); if (e->down_state && !point_inside) /* If pen was inside the region */ { gui_panel_show_element( panel, e, panel->display_focus ? GUI_PANEL_ELEM_STATE_FOCUSSED : GUI_PANEL_ELEM_STATE_NORMAL, MMI_FALSE); e->down_state = 0; gui_cancel_timer(gui_panel_repeat_timer); } else if (!e->down_state && point_inside) { gui_panel_show_element( panel, e, panel->display_focus ? GUI_PANEL_ELEM_STATE_FOCUSSED : GUI_PANEL_ELEM_STATE_NORMAL, MMI_FALSE); e->down_state = 1; gui_start_timer(panel->repeat_period, gui_panel_repeat_timer); } } break; case MMI_PEN_EVENT_LONG_TAP: case MMI_PEN_EVENT_REPEAT: break; case MMI_PEN_EVENT_ABORT: g_curr_active_panel = NULL; break; default: MMI_ASSERT(0); } return ret; }
/***************************************************************************** * FUNCTION * gui_panel_general_key_handler * DESCRIPTION * General key handler for panel elements * PARAMETERS * panel [IN/OUT] panel * keycode [IN] key code * state [IN] key type * RETURNS * void *****************************************************************************/ void gui_panel_general_key_handler(gui_panel_struct *panel, U16 keycode, U16 keytype) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ S32 i; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ for (i = 0; i < panel->element_count; i++) { gui_panel_element_struct *e = &panel->elements[i]; if (e->keycode == keycode) { if (e->disabled_state) { continue; } switch (keytype) { case KEY_EVENT_DOWN: if (panel->element_focus_index != i && panel->display_focus) { gui_panel_show_element( panel, &panel->elements[panel->element_focus_index], GUI_PANEL_ELEM_STATE_NORMAL, MMI_FALSE); } panel->element_focus_index = i; gui_panel_show_element( panel, e, GUI_PANEL_ELEM_STATE_DOWN, MMI_FALSE); e->down_state = 1; /* Invoke callback */ e->down_event_callback(); /* repeat timer */ g_curr_active_panel = panel; gui_start_timer(panel->repeat_period, gui_panel_repeat_timer); break; case KEY_EVENT_UP: gui_panel_show_element( panel, e, panel->display_focus ? GUI_PANEL_ELEM_STATE_FOCUSSED : GUI_PANEL_ELEM_STATE_NORMAL, MMI_FALSE); /* Invoke callback */ if (e->down_state == 1) { e->up_event_callback(); } e->down_state = 0; /* repeat timer */ g_curr_active_panel = NULL; gui_cancel_timer(gui_panel_repeat_timer); break; default: break; } break; } } }