/*! * \brief 短按删除键处理函数 * \param void * \return * \note * \example * \author weizhiping * \date 2010-10-9 9:49:29 */ void GBInputBox_DeletkeyHandler(void) { #if __MTK__ > 0 PCLayoutAbstract pltAbstractObj = Global_GetCurrentLayoutObject(); PCLayoutControl pLtCtl = Global_GetLayoutCtl(); gui_reset_clip(); gdi_layer_lock_frame_buffer(); gui_push_clip(); gui_push_text_clip(); if (pLtCtl->engineOutputInfo.bCandWindOpen) { // pltAbstractObj->bSendEngineKeyEvent = GBTrue; // pltAbstractObj->engineKeyEvent = GBKEY_BACK; // Global_FillEventGroup(GBIME_CT_NORMAL_KEY_UP, GBKEY_BACK, 0); GBEngine_SendKeyEvent(Global_GetEnineInstance(), GBKEY_BACK, 0);//引擎pOutputString没有更新[BUG 611] //GBIME_Paint(); } else { GBInputBox_DeleteChar(); } gui_pop_clip(); gui_pop_text_clip(); gdi_layer_unlock_frame_buffer(); gdi_lcd_repaint_all(); GBInputBox_UpdateSoftKeyLabel(); #endif }
/*! * \brief 高亮插入单个字符 * \param pMultiTapString * \return * \note * \example * \author weizhiping * \date 2010-9-3 9:29:56 */ void GBInputBox_MultiTapInsertChar(GBPWCHAR pMultiTapString) { #if __MTK__ > 0 gdi_layer_lock_frame_buffer(); GBInputBox_IMC_SendMessage(MMI_IMC_MESSAGE_INSERT_MULTITAP_CHAR, (GBU32)pMultiTapString[0], 0); gdi_layer_unlock_frame_buffer(); #endif // __MTK__ }
/***************************************************************************** * FUNCTION * csb_frm_testtool_callback * DESCRIPTION * Callback to take snap shots one by one (non-blocking) * PARAMETERS * void * RETURNS * U16 *****************************************************************************/ void csb_frm_testtool_callback(void) { /*----------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------*/ BOOL error_code = TRUE; /*----------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------*/ StopTimer(CSB_AUTO_MODE_TIMER_ID); /* Lock the buffer as we dont want to display the category screens */ gdi_layer_lock_frame_buffer(); /* ASSERT if the entryFuncPtr is NULL */ ASSERT(g_CSB_struct.pscreen_info[g_csb_index].entryFuncPtr != NULL); /* Call the category as the buffer must built before calling csb_frm_save_screen_shot */ g_CSB_struct.pscreen_info[g_csb_index].entryFuncPtr(); /* Unlock the buffer as it is already built */ gdi_layer_unlock_frame_buffer(); /* API to create the file path and save the LAYER contents in JPEG format */ error_code = (BOOL)csb_frm_save_screen_shot((U32)g_csb_index); if (error_code == FALSE) { /* Clear the key events */ ClearKeyEvents(); DisplayPopup((PU8) GetString(STR_ID_CSB_JPEG_FAIL_TEXT), IMG_GLOBAL_ERROR, 1, CSB_NOTIFY_DURATION, 0); DeleteUptoScrID(SCR_ID_CSB_TESTTOOL_SCR_ID); return; } /* Show processing screen till all the screenshots are taken */ TestToolProcessingScr(STR_ID_CSB_PROCESSING_TEXT); g_csb_index++; /* Delete the screens from History, as all the screens are getting added in History */ DeleteUptoScrID(SCR_ID_CSB_TESTTOOL_SCR_ID); DeleteScreenIfPresent(SCR_ID_CSB_DUMMY_SCR_ID); if(g_csb_index < TOTAL_CATEGORY_SCREENS) { EntryCSBTestToolRun(); } else { g_csb_index = 0; /* Once all the category screenshots are taken, show the DONE pop-up */ DisplayPopup((PU8) GetString(STR_ID_CSB_TESTTOOL_PASS), IMG_GLOBAL_ACTIVATED, 1, CSB_NOTIFY_DURATION, 0); DeleteUptoScrID(SCR_ID_CSB_TESTTOOL_SCR_ID); } }
/***************************************************************************** * FUNCTION * mmi_pen_editor_get_candidates_from_hand_writing * DESCRIPTION * Get the candidates from the handwriting module * PARAMETERS * void * RETURNS * The number of the candidates *****************************************************************************/ int mmi_pen_editor_get_candidates_from_hand_writing(void) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE]; int num = 0; mmi_pen_editor_input_type_enum hand_writing_type; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ hand_writing_type = mmi_pen_editor_get_hand_writing_type_by_input_mode(MMI_current_input_mode); if (hand_writing_type != 0) { num = mmi_pen_editor_hand_writing_get_candidates( (U16*) gPenEditorStrokeBuffer, candidate_buffer, hand_writing_type, PEN_EDITOR_CANDIDATE_SIZE); switch (hand_writing_type) { case PEN_EDITOR_UPPER_CASE_ENGLISH: mmi_pen_editor_resort_candidates(candidate_buffer, num, PEN_EDITOR_SORT_CAPITAL_FIRST); break; case PEN_EDITOR_LOWER_CASE_ENGLISH: mmi_pen_editor_resort_candidates(candidate_buffer, num, PEN_EDITOR_SORT_NON_CAPITAL_FIRST); break; default: break; } } /* W05.33 Fix numeric_leading_zero issue make sure that the first candidate can be '0' */ { U8 temp = numeric_leading_zero; set_leading_zero(TRUE); /* W05.36 Check the Candidates List, if empty return 0 */ if (mmi_pen_editor_reset_candidate_and_composition_box(mmi_pen_editor_get_candidate_box(), candidate_buffer, num, MMI_TRUE)) { set_leading_zero(temp); } else { set_leading_zero(temp); return 0; } } gdi_layer_lock_frame_buffer(); mmi_pen_editor_hide_virtual_keyboard_area(); mmi_pen_editor_show_candidate_area(MMI_FALSE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS); gdi_layer_unlock_frame_buffer(); gdi_lcd_repaint_all(); return num; }
/*! * \brief 高亮替换字符串 * \param nCandLength * \param pCandString * \return * \note * \example * \author weizhiping * \date 2010-9-3 9:28:56 */ GBUINT GBInputBox_ReplaceHighlightString(GBUINT nCandLength, GBPCWCHAR pCandString) { #if __MTK__ > 0 GBUINT repaceLen = 0; gdi_layer_lock_frame_buffer(); repaceLen = GBInputBox_IMC_SendMessage(MMI_IMC_MESSAGE_REPLACE_HIGHLIGHT_STRING, (GBU32)nCandLength, (GBU32)pCandString); gdi_layer_unlock_frame_buffer(); return repaceLen; #endif // __MTK__ return 0; }
void SFApp_FreeGDI(void) { gdi_layer_unlock_frame_buffer(); lcd_power_down(); TurnOffBacklight(); mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_ENABLED); /* lcd_power_down(); TurnOffBacklight(); mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_ENABLED); */ }
/*! * \brief 长按删除处理函数 * \param void * \return * \note * \example * \author weizhiping * \date 2010-10-9 9:49:00 */ void GBInputBox_DeleteAllHandler(void) { #if __MTK__ > 0 PCLayoutControl pLtCtl = Global_GetLayoutCtl(); gui_reset_clip(); gdi_layer_lock_frame_buffer(); gui_push_clip(); gui_push_text_clip(); // 循环清空引擎输入串内容 if (pLtCtl->engineOutputInfo.bCandWindOpen) { GBEngine_Reset(Global_GetEnineInstance()); //while (pEngineOutputInfo->.inputStringLen > 0) { //GBEventHandler(GBKEY_BACK, 0);//引擎pOutputString没有更新[BUG 611] } //GBIME_Paint(); } else // 清空编辑器输入框内容 { // if(!GBInputBoxIsEmpty() && gbCurInputBox.pfDeleteAll) // { // (*gbCurInputBox.pfDeleteAll)(); // } // mmi_imc_message_struct msg_ptr; // msg_ptr.message_id = MMI_IMC_MESSAGE_CLEAR_ALL; // msg_ptr.param_0 = 1; // msg_ptr.param_1 = 0; // mmi_imc_send_message( &msg_ptr ); GBInputBox_DeleteAll(); } gui_pop_clip(); gui_pop_text_clip(); gdi_layer_unlock_frame_buffer(); gdi_lcd_repaint_all(); // 重置功能按键及引擎状态并关闭候选框 //GBResetFuncKey(); //GBInputMethodReset(); //GBDrawCandWnd(1); #endif }
/***************************************************************************** * FUNCTION * ShowCategory626Screen * DESCRIPTION * Displays the category626 screen (Tab List menu with description ) * PARAMETERS * title [IN] Title for the screen * title_icon [IN] Icon displayed with the title * left_softkey [IN] Left softkey label * left_softkey_icon [IN] Left softkey icon * right_softkey [IN] Right softkey label * right_softkey_icon [IN] Right softkey icon * number_of_items [IN] Number of items in the menu * list_of_items [IN] Array of items * list_of_icons [IN] Array of icons * list_of_descriptions [IN] Array of Pop up description strings * flags [IN] Flags (see explanation below) * highlighted_item [IN] Default item to be highlighted (if there is no history) * n_tabs [IN] * highlighted_tab [IN] * tab_items [IN] * history_buffer [IN] History buffer * RETURNS * void *****************************************************************************/ void ShowCategory626Screen( U8 *title, U16 title_icon, U16 left_softkey, U16 left_softkey_icon, U16 right_softkey, U16 right_softkey_icon, S32 number_of_items, U8 **list_of_items, U16 *list_of_icons, U8 **list_of_descriptions, S32 flags, S32 highlighted_item, S8 highlighted_tab, U8 *history_buffer) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ dm_data_struct dm_data; S32 i; U8 h_flag; S32 shortcut_width; S8 n_tabs; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ gdi_layer_lock_frame_buffer(); /* Show Tab bars */ mmi_frm_get_tab_bar_items(MMI_tab_bar_items, &n_tabs); cat626_tab_num = n_tabs; if (n_tabs) { wgui_create_horizontal_tab_bar(TRUE, (UI_string_type)title, n_tabs, highlighted_tab, MMI_FALSE); } /* Softkeys */ set_left_softkey_label((UI_string_type)GetString(left_softkey)); set_left_softkey_icon((PU8)GetImage(left_softkey_icon)); set_right_softkey_label((UI_string_type)GetString(right_softkey)); set_right_softkey_icon((PU8)GetImage(right_softkey_icon)); SetupCategoryKeyHandlers(); /* Show List */ create_fixed_icontext_menuitems(); associate_fixed_icontext_list(); MMI_current_menu_type = LIST_MENU; register_fixed_list_keys(); if (n_tabs) { resize_fixed_list(MMI_CONTENT_WIDTH_WITH_H_TAB, MMI_CONTENT_HEIGHT_WITH_H_TAB); move_fixed_list(MMI_CONTENT_X_WITH_H_TAB, MMI_CONTENT_Y_WITH_H_TAB); } else { MMI_title_string = (UI_string_type)title; MMI_title_icon = (PU8)GetImage(title_icon); resize_fixed_list(MMI_content_width, MMI_content_height); move_fixed_list(MMI_content_x, MMI_content_y); } register_fixed_list_highlight_handler(standard_list_highlight_handler); if (list_of_descriptions == NULL) { for (i = 0; i < number_of_items; i++) { add_fixed_icontext_item((UI_string_type) list_of_items[i], wgui_get_list_menu_icon(i, list_of_icons[i])); wgui_pop_up_description_strings[i].text_strings[0] = NULL; } } else { for (i = 0; i < number_of_items; i++) { add_fixed_icontext_item((UI_string_type) list_of_items[i], wgui_get_list_menu_icon(i, list_of_icons[i])); wgui_pop_up_description_strings[i].text_strings[0] = (UI_string_type) list_of_descriptions[i]; } } h_flag = set_list_menu_category_history(MMI_CATEGORY626_ID, history_buffer); #ifdef __MMI_UI_HINTS_IN_MENUITEM__ if (list_of_descriptions != NULL) { S32 hints = 0; for (i = 0; i < number_of_items; i++) { if (wgui_pop_up_description_strings[i].text_strings[0]) { hints = 1; break; } } if (hints) { if (is_set_force_icon_on_highlight_only_in_menuitem()) { wgui_show_icon_only_highlight_in_icontext_menuitem(); } if (is_set_force_all_hints_in_menuitem()) { wgui_enable_hints_in_icontext_menuitem(); } else if (is_set_force_hints_on_highlight_in_menuitem()) { wgui_enable_hint_highlight_in_icontext_menuitem(); } else { wgui_enable_hint_highlight_in_icontext_menuitem(); } set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item); #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ gui_block_list_effect(); #endif } } #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ if (h_flag) { fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item); } else { fixed_list_goto_item_no_redraw(highlighted_item); } MMI_title_string = (UI_string_type) title; MMI_title_icon = (PU8) get_image(title_icon); set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item); /* Setup (hidden) menu shortcut. */ MMI_menu_shortcut_number = highlighted_item + 1; register_fixed_list_shortcut_handler(); shortcut_width = set_menu_item_count(number_of_items) + 7; if (n_tabs) { resize_menu_shortcut_handler(shortcut_width, MMI_HORIZONTAL_TAB_BAR_HINT_AREA_HEIGHT); move_menu_shortcut_handler( MMI_HORIZONTAL_TAB_BAR_X + MMI_HORIZONTAL_TAB_BAR_WIDTH - MMI_menu_shortcut_box.width, MMI_HORIZONTAL_TAB_BAR_Y + MMI_HORIZONTAL_TAB_BAR_TAB_AREA_HEIGHT); register_hide_menu_shortcut(wgui_show_horizontal_tab_bar_hint_area); } else { resize_menu_shortcut_handler(shortcut_width, MMI_title_height); move_menu_shortcut_handler(MMI_title_x + MMI_title_width - MMI_menu_shortcut_box.width, MMI_title_y); register_hide_menu_shortcut(gui_redraw_menu_shortcut); } gdi_layer_unlock_frame_buffer(); ExitCategoryFunction = ExitCategory626Screen; dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size); dm_data.s32ScrId = (S32) GetActiveScreenId(); dm_data.s32CatId = MMI_CATEGORY626_ID; dm_data.s32flags = 0; dm_setup_data(&dm_data); dm_redraw_category_screen(); }