📄 wgui_categories.c
字号:
/**********************************************************************************
Filename: wgui_categories.c
Author: manju, Vandana Mehtani, Vandana Dhawan
Date Created: August-07-2002
Contains: PixTel UI wrapper routines
High Level Category screen wrappers.
**********************************************************************************/
#include "MMI_features.h"
#include "stdC.h"
#include "L4Dr1.h"
#include "PixtelDataTypes.h"
#include "GlobalDefs.h"
#include "EventsGprot.h"
#include "CustDataProts.h"
#include "CustMenuRes.h"
#include "HistoryGprot.h"
#include "FrameworkStruct.h"
#include "TimerEvents.h"
#include "EventsDef.h"
#include "Unicodexdcl.h"
#include "gui_setting.h"
#include "gui_themes.h"
#include "wgui.h"
#include "wgui_softkeys.h"
#include "wgui_menu_shortcuts.h"
#include "wgui_fixed_menus.h"
#include "wgui_fixed_menuitems.h"
#include "wgui_inputs.h"
#include "wgui_status_icons.h"
#include "wgui_datetime.h"
#include "wgui_categories_defs.h"
#include "wgui_categories_idlescreen.h"
#include "wgui_categories_inputs.h"
#include "wgui_categories_MM.h"
#include "wgui_categories_sublcd.h"
#include "wgui_categories_util.h"
#include "wgui_dynamic_menus.h"
#include "wgui_dynamic_menuitems.h"
#include "wgui_asyncdynamic_menus.h"
#include "wgui_asyncdynamic_menuitems.h"
#include "wgui_draw_manager.h"
#include "IdleAppDef.h"
#include "IdleAppProt.h"
#include "WallpaperDefs.h"
#include "ScreenSaverDefs.h"
#include "DebugInitDef.h"
#include "MainMenuDef.h"
#include "gdi_include.h" /* include for graphic lib */
#include "SettingGProts.h"
#include "ShortcutsDefs.h"
#include "SimDetectionGexdcl.h"
#include "PhoneBookTypes.h"
#include "CallSetUpEnum.h" //tangjie add 20070506
// zx add beign 20070404
#ifdef __MMI_SUBMENU_DASHED_NO_STATE_BAR__
#include "PhoneBookDef.h"
#include "SettingDefs.h"
//#include "CallSetUpEnum.h" //tangjie del 20070506
#include "MessagesresourceData.h"
#ifdef __MMI_EMAIL__
#include "EmailAppGProt.h"
#endif
#endif
// zx add end
#include "wgui_draw_manager.h" /* Add for Draw Manager */
#include "wgui_touch_screen.h" /* for touch screen apis */
#include "wgui_categories_util.h" /* 032305 Calvin added */
#ifdef __MMI_UI_TAB_PANE__
#include "wgui_tab.h"
#endif
#ifdef __MMI_AUDIO_PLAYER__
/* dependent headers for AudioPlayerXXX.h" */
#include "gui_data_types.h"
#include "FrameworkStruct.h"
#include "GlobalConstants.h"
#include "mdi_datatype.h"
#include "kal_release.h"
#include "Conversions.h"
#include "FileMgr.h"
#include "AudioPlayerDef.h"
#include "AudioPlayerType.h"
#include "AudioPlayerProt.h"
#include "AudioPlayerMainScreen.h"
#endif /* __MMI_AUDIO_PLAYER__ */
/* MTK Elvis for R2L characters */
#include "BIDIDEF.h"
#include "BIDIProt.h"
#include "UCS2Prot.h"
/* MTK end */
#if defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)
#include "SmsGuiInterfaceType.h"
#include "wgui_categories_util.h"
#endif /* defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__) */
#if defined(__MMI_TOUCH_SCREEN__)
#include "EditorPen.h"
#include "wgui_virtual_keyboard.h"
#endif /* defined(__MMI_TOUCH_SCREEN__) */
#ifdef __MMI_EDITABLE_AUDIO_EQUALIZER__
#ifdef __MMI_TOUCH_SCREEN__
#include "TouchScreenGprot.h"
#endif
#include "SoundEffect.h"
#endif /* __MMI_EDITABLE_AUDIO_EQUALIZER__ */
/* PMT HIMANSHU START 20050729 */
#if defined(__MMI_TOUCH_SCREEN__) && defined(__MMI_WALLPAPER_ON_BOTTOM__)
#include "VolumeHandler.h"
#endif
/* PMT HIMANSHU END 20050729 */
#if (defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__) && !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI))
#include "bmt.h"
#include "pwic.h"
extern kal_bool custom_cfg_gpio_set_level(kal_uint8 gpio_dev_type, kal_uint8 gpio_dev_level);
extern void setup_UI_wrappers(void);
#endif /* (defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__) && !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)) */
#define MMI_CAT401_X_OFFSET 17
// zx add begin 20070404
#ifdef __MMI_SUBMENU_DASHED_NO_STATE_BAR__
BOOL statusFlag=FALSE;
#endif
// zx add end
#ifdef __MMI_UI_TAB_PANE__
extern struct_tab_control MMI_tab_control;
#endif
/* for NFB progress bar images */
extern U8 *nfb_progress_images[];
#ifdef __MMI_BIDI_ALG__
extern U8 visual_str[];
#endif
extern BOOL r2lMMIFlag;
/* image store the image data of left arrow key */
extern U8 inline_select_left_arrow_image[];
/* image store the image data of right arrow key */
extern U8 inline_select_right_arrow_image[];
extern U8 matrix_main_menu_highlight_bitmap_data[];
extern S32 GUI_current_fixed_icontext_list_menuitem_column;
extern U16 StopMyTimer(U16 nTimerId);
extern U16 StartMyTimerInt(U16 nTimerId, U32 nTimeDuration, oslTimerFuncPtr TimerExpiry, U8 alignment);
/* Externals for graphics context switching */
extern bitmap main_LCD_device_bitmap;
extern bitmap sub_LCD_device_bitmap;
extern bitmap *current_LCD_device_bitmap;
/* store Main lcd width */
extern S32 MAIN_LCD_device_width;
/* store Main LCD height */
extern S32 MAIN_LCD_device_height;
extern BOOL dynamic_item_text_align_left;
extern FuncPtr gExitFullScreenCallBack;
void UI_set_main_LCD_graphics_context(void);
void UI_set_sub_LCD_graphics_context(void);
extern pBOOL GetShowAOC(void);
extern S32 UI_get_font_height(UI_font_type f);
extern void mtk_show_animation(S32 x, S32 y, U8 *image);
extern void mtk_show_animation_frames(S32 x, S32 y, U8 *image, S32 start_frame);
extern void UI_draw_horizontal_line(S32 x1, S32 x2, S32 y, color c);
extern void UI_putpixel(S32 x, S32 y, color c);
extern void UI_draw_vertical_line(S32 y1, S32 y2, S32 x, color c);
extern void wgui_setup_singleline_inputbox(
S32 x,
S32 y,
S32 width,
S32 height,
U8 *buffer,
S32 buffer_size,
U16 category_screen_ID,
UI_string_type RSK_label,
PU8 RSK_icon,
U16 input_type,
U8 *history_buffer,
U8 information_bar_flag);
extern void wgui_close_singleline_inputbox(void);
extern void get_singleline_inputbox_category_history(U16 history_ID, U8 *history_buffer, S16 input_type);
extern void move_slide_control_value(slide_control *s, S32 x, S32 y);
extern void (*ExitCategoryFunction) (void);
#ifdef __MMI_UI_LIST_TRANSITION__
extern void set_list_transition(wgui_transition_styles style);
extern wgui_transition_styles get_list_transition(void);
extern void reset_list_transition(void);
#endif /* __MMI_UI_LIST_TRANSITION__ */
extern void dm_set_scr_bg_image_no_draw(U16 image_id, S8 *file_name, S32 x, S32 y, U8 opacity);
#ifdef __MMI_T9__
#include "T9Main.h" /* T9SynT9WithInputBox() */
extern void InuptMethodEnterCategory5(void);
#elif defined __MMI_ZI__
extern void ZiInuptMethodEnterCategory5(void);
#elif defined( __MMI_MY__)
extern void MyInuptMethodEnterCategory5(void); //add by luo ren 2007/03/26
#elif defined __MMI_KA__
extern void KonkaInuptMethodEnterCategory5(void);
#elif defined __MMI_ITAP__
/* under construction !*/
#endif
U8 category89_string_list[MAX_CATEGORY89_STRINGS][MAX_CATEGORY89_STRING_LENGTH];
#ifdef __MMI_CALORIE__
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* __MMI_CALORIE__ */
/* Store current menu type..matrix,list,circular */
S32 MMI_current_menu_type = MATRIX_MENU;
S32 volume_level_UI;
#ifdef __MMI_IDLE_FULL_SCREEN__
U16 on_idle_screen = 0;
#endif
U8 Category154Align = 0;
U8 cat9_show_message = 0;
/* a flagused to check if text dispaly in category125 is scrolling or not */
U8 flag_scroll = FALSE;
/* used by category125 to display valeu in dispaly valeu bar beliow title bar */
U8 *disp_valuestr = NULL;
/* used by categopry 125 */
U8 *disp_barstr = NULL, *left_value = NULL, *right_value = NULL;
S16 status_icon = 0;
/* global variable store the image height,width ,and no_of_pixtel */
S32 no_of_pixel = 0;
/* store category142 image list */
U16 *category_142_image_list = NULL;
/* store the category142 image list inex */
U8 **category_142_image_file_name_list = NULL;
/* store the category142 image filename list inex */
S32 *category_142_image_list_index = NULL;
/* store number of items of category 142 */
S32 category_142_image_list_n_items = 0;
/* vertical scroll bar of category 142 */
vertical_scrollbar category142_vbar;
/* list of titles of category 142 */
U8 **category_142_list_of_titles = NULL;
#ifdef __MMI_EDITABLE_AUDIO_EQUALIZER__
equalizer_setting_info g_audio_equalizer_current_setting_info; /* to store the values of currently accessed equal8izer setting */
float one_pixel_represents; /* one pixel in each equalizer bar represents what value.... */
float temp_float_var;
extern void mmi_settings_audio_equalizer_change_sound_level(S16 change);
extern U16 g_audio_equalizer_bar_start_x, g_audio_equalizer_bar_start_y;
extern U16 g_audio_equalizer_bar_width, g_audio_equalizer_bar_height, g_audio_equalizer_dist_btw_bars;
extern U16 g_audio_equalizer_scrollable_ht, g_audio_equalizer_unit_scroll;
#endif /* __MMI_EDITABLE_AUDIO_EQUALIZER__ */
/* category 154 message 1 y postition */
S32 category_154_message1_y = 0;
/* category 154 message 2 y position */
S32 category_154_message2_y = 0;
scrolling_text scroll_text_cat125;
UI_string_type category155_slide_string = NULL;
#if defined (__MMI_WALLPAPER_ON_BOTTOM__)
static MMI_ID_TYPE idle_scr_bg_ID;
static S8 *idle_scr_bg_filename;
static S32 idle_scr_bg_x, idle_scr_bg_y;
static U8 idle_scr_bg_opacity;
static S32 idle_scr_bg_flags;//082906 scr_bg
#endif /* defined (__MMI_WALLPAPER_ON_BOTTOM__) */
extern U16 title_bg_id;
U16 Cat402PercentageBarId = 0;
/* Start of Common List Category Screen */
extern PU8 subMenuDataPtrs[MAX_SUB_MENUS];
#ifdef __J2ME__
extern gdi_handle jui_layer_handle;
extern void ExitCategory176Screen(void);
#endif
/* 061306 dummy category Start */
U32 status_bar_flag[MAX_STATUS_ICON_BARS];
/* for category 75 and 77 */
static U8 old_font_size = 0;
static S8 old_font_style = 0;
//begin add by luo ren 2007/08/18
#ifdef __MT190_MMI__
#ifdef __MMI_TOUCH_SCREEN__
#include "PhoneBookDef.h"
enum MULTI_STATUS g_switch_virtualkeybord_status[4] = {ONE_STATUS,ONE_STATUS,ONE_STATUS,ONE_STATUS};
BOOL curr_virtual_keyboard_status_flag = FALSE;
extern BOOL curr_symbol_keyboard_status_flag;
#endif
#endif
//end add by luo ren 2007/08/18
/*****************************************************************************
* FUNCTION
* ExitCategoryDummyScreen
* DESCRIPTION
* Exits the dummy category screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void ExitCategoryDummyScreen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
set_status_icon_bar_type(0, status_bar_flag[0]);
set_status_icon_bar_type(1, status_bar_flag[1]);
} /* end of ExitCategoryDummyScreen */
/*****************************************************************************
* FUNCTION
* ShowCategoryDummyScreen
* DESCRIPTION
* Set some global settings for category without drawing anything on the screen
* PARAMETERS
*
* RETURNS
*
*****************************************************************************/
void ShowCategoryDummyScreen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
status_bar_flag[0] = get_status_icon_bar_type(0);
hide_status_icon_bar(0);
status_bar_flag[1] = get_status_icon_bar_type(1);
hide_status_icon_bar(1);
ExitCategoryFunction = ExitCategoryDummyScreen;
RedrawCategoryFunction = dm_redraw_category_screen;
GetCategoryHistory = dummy_get_history;
GetCategoryHistorySize = dummy_get_history_size;
} /* end of ShowCategoryDummyScreen */
/* 061306 dummy category End */
/*****************************************************************************
* FUNCTION
* RedrawListCategoryScreen
* DESCRIPTION
* Redraw category function of current main lcd category scrren using list menu
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void RedrawListCategoryScreen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_UI_TITLE_TRANSITION__
S32 no_transition_in_title = 0;
{
#ifdef __MMI_UI_TAB_PANE__
if (is_enabled_tab_pane())
{
tab_pane_modify_data();
}
#endif /* __MMI_UI_TAB_PANE__ */
if ((gOnFullScreen & MMI_IN_FULL_SCREEN || gOnFullScreen & MMI_LEAVE_FULL_SCREEN) &&
!(gOnFullScreen & MMI_LEAVE_FULL_IDLE_SCREEN))
{
no_transition_in_title = 1;
}
if (get_title_transition() != WGUI_TRANSITION_NONE && !no_transition_in_title)
{
draw_title();
}
}
#else /* __MMI_UI_TITLE_TRANSITION__ */
#ifdef __MMI_UI_TAB_PANE__
if (is_enabled_tab_pane())
{
tab_pane_modify_data();
}
#endif /* __MMI_UI_TAB_PANE__ */
#endif /* __MMI_UI_TITLE_TRANSITION__ */
#ifdef __MMI_UI_LIST_TRANSITION__
if (get_list_transition() == WGUI_TRANSITION_T2D)
{
draw_title();
show_fixed_list();
}
#endif /* __MMI_UI_LIST_TRANSITION__ */
gdi_layer_lock_frame_buffer();
#if(UI_ENABLE_POP_UP_DESCRIPTIONS)
gui_pop_up_description_stop_scroll();
#endif
#ifdef __MMI_WGUI_MINI_TAB_BAR__
if (wgui_if_mini_tab_bar_enable() == MMI_TRUE)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -