📄 wgui_categories_util.c
字号:
#include "CustDataProts.h"
#include "CustMenuRes.h"
#include "HistoryGprot.h"
#include "FrameworkStruct.h"
#include "TimerEvents.h"
#include "EventsDef.h"
#include "Unicodexdcl.h"
#include "WrapperGprot.h"
#include "gui_themes.h"
#include "gui_setting.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_dynamic_menus.h"
#include "wgui_dynamic_menuitems.h"
#include "wgui_asyncdynamic_menus.h"
#include "wgui_asyncdynamic_menuitems.h"
#include "wgui_virtual_keyboard.h"
#include "gdi_include.h"
//zx add begin 20070529
#ifdef __MMI_DZD__
#include "DzdDefs.h"
#endif
//zx add end
// #include "CallStructureManagementProt.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 "lcd_sw_rnd.h"
#include "SettingGProts.h"
#include "ShortcutsDefs.h"
#include "SimDetectionGexdcl.h"
#include "PhoneBookTypes.h"
#include "wgui_draw_manager.h" /* Add for Draw Manager */
#include "wgui_touch_screen.h" /* for touch screen apis */
/* PMT NEERAJ START 20050804 */
#include "MMIThemes.h"
//PMT NEERAJ END 20050804
//PMT VIKAS START 20050720
#ifdef __MMI_UI_ANIMATED_TITLE_EFFECT__
#include "MMI_features.h" /* Add for Effect type entry for Title & highlighter */
#endif
/* PMT VIKAS END 20050720 */
#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"
#include "wgui_categories_util.h"
/* MTK end */
#include "wgui_draw_manager.h"
#ifdef __MMI_UI_TAB_PANE__
#include "wgui_tab.h"
#endif
#include "ScreenRotationGprot.h"
#include "ScrMemMgrGprot.h"
#if defined(__MMI_TOUCH_SCREEN__)
#include "EditorPen.h"
#endif
// begin add by luo ren 2007/04/28
#ifdef __MMI_CLOSE_STATUS_ICONS_IN_SUBMENUS__
#include "MessagesResourceData.h"
#include "CallhistoryEnum.h"
#include "IdleAppDef.h"
#include "SimDetectionDef.h" //add by luo ren 2007/05/07
#include "CallmanagementIdDef.h" //add by luo ren 2007/05/14
#include "PhoneBookDef.h" //zx add 20070521
#include "vObjectsEnum.h" //zx add 20070523
#endif
// end add by luo ren 2007/04/28
// wangbei add start 20071010
#ifdef __NEW_STATUS_ICONS_STYLE__
#include "StatusIconRes.h"
#include "Worldclock.h"
#include "SettingDefs.h"
#include "CalendarDef.h"
#include "GameFramework.h"
#include "VdoRecScrEnum.h"
#include "VdoPlyScrEnum.h"
#include "poweronoffdisplaydefs.h"
#include "ImageViewerResDefs.h"
#endif
// wangbei add end
/* Slim Version Menu Style */
static wgui_list_menu_slim_style_enum wgui_current_list_menu_slim_style = WGUI_LIST_MENU_SLIM_STYLE_DEFAULT;
/* Globals */
gdi_handle animation_handle = GDI_ERROR_HANDLE;
// wangbei add start 20071010
#ifdef __NEW_STATUS_ICONS_STYLE__
BOOL g_is_need_draw_statusicons = TRUE;
#endif
// wangbei add end
/*** Store the value of height, width , x, y position of title bar ,status icons
popup dialog in global variables these valeu r also #define in wgui.h */
/* Bear - 040228 move init value to wgui.c */
S32 MMI_matrix_bar_height;
S32 MMI_matrix_bar_x;
S32 MMI_matrix_bar_y;
S32 MMI_matrix_bar_width;
S32 MMI_title_height;
S32 MMI_title_width;
S32 MMI_title_x;
S32 MMI_title_y;
S32 MMI_button_bar_height;
S32 MMI_menuitem_height;
/* 111406 animated title icon */
S32 MMI_title_icon_x;
S32 MMI_title_icon_y;
S32 MMI_title_icon_width;
S32 MMI_title_icon_height;
S32 MMI_pop_up_dialog_x;
S32 MMI_pop_up_dialog_y;
S32 MMI_pop_up_dialog_width;
S32 MMI_pop_up_dialog_height;
S32 MMI_pop_up_dialog_full_height;
U8 wgui_switch_title_with_status_bar = 0; /* 0: Title, 1: Status icons */
U8 wgui_category_screen_no_buttons = 0;
/* Store the clipping value of current image */
S32 wgui_image_clip_x1 = 0;
S32 wgui_image_clip_y1 = 0;
S32 wgui_image_clip_x2 = 0;
S32 wgui_image_clip_y2 = 0;
/* Support for displaying animations in Category screens:
These functions allow the display of a single animated
icon in any category screen. The position of the icon
is decided by the category screen */
PU8 _MMI_animated_icon = NULL;
U8 *_MMI_animated_icon_name;
S32 _MMI_animated_icon_x;
S32 _MMI_animated_icon_y;
UI_animated_image_handle _MMI_animated_icon_handle = NULL;
UI_pop_up_description wgui_pop_up_description;
/* store number of strigs of pop up */
S32 wgui_pop_up_descriptions_n_strings = 0;
/* store current index of popup */
S32 wgui_current_pop_up_description_index = -1;
/* store number of popup */
S32 wgui_pop_up_descriptions_n_items = 0;
/* store flag of popup */
U8 wgui_pop_up_description_flag = 0;
wgui_pop_up_description_string_type wgui_pop_up_description_strings[WGUI_MAX_POP_UP_DESCRIPTION_STRINGS];
U8 *checklist_category_menu_item_states = NULL;
S32 item_checked = 0;
void (*checkbox_toggle_DONE_RSK_function) (void) = NULL;
void (*checkbox_toggle_BACK_RSK_function) (void) = NULL;
/** Store the title string of current main lcd scrren */
UI_string_type MMI_title_string = NULL;
/** Store the address of title icon display on current main lcd scrren title bar */
PU8 MMI_title_icon = NULL;
/** Animation handle of title icon */
GDI_HANDLE MMI_title_icon_ani_handle = GDI_ERROR_HANDLE;
/** Store the address of title icon display on current main lcd scrren title bar */
PU8 MMI_title_icon2 = NULL;
/* Store the scrolling text of title bar */
scrolling_text scrolling_title_text;
/* Scrolling title support */
/** global variables store value of x,y,width of title bar text , icon to scroll the text on title bar */
S32 scrolling_title_icon_x = 0;
S32 scrolling_title_icon_y = 0;
/* Store the message of current multibox dispaly on main lcd */
UI_string_type MMI_message_string = NULL;
UI_string_type MMI_message_string2 = NULL;
/** Store the address of icon display on content area of current main lcd scrren */
PU8 MMI_message_icon = NULL;
PU8 MMI_message_icon2 = NULL;
/* store teh current shorcut number display on right side of title bar in case of menu screen */
S32 MMI_menu_shortcut_number = -1;
/* Store the text of current highlighted item in menu */
UI_string_type MMI_highlighted_item_text = NULL;
/* high level wrappers */
PU8 MMI_mm_animation = NULL;
U8 gMMI_UI_U8_flag_1 = 0, gMMI_UI_U8_flag_2 = 0;
U16 gMMI_UI_U16_var_1 = 0, gMMI_UI_U16_var_2 = 0;
S32 gMMI_UI_S32_var_1 = 0, gMMI_UI_S32_var_2 = 0, gMMI_UI_S32_var_3 = 0, gMMI_UI_S32_var_4 = 0;
void *gMMI_UI_ptr_1 = NULL, *gMMI_UI_ptr_2 = NULL, *gMMI_UI_ptr_3 = NULL, *gMMI_UI_ptr_4 = NULL;
/* varbale of type slide_control used in slide control screen */
slide_control *MMI_current_slide_control = NULL;
/* slide_control MMI_slide_control1,MMI_slide_control2; */
slide_control MMI_slide_control[MMI_MAX_SLIDE_CONTROL];
/* store current slide control value */
S32 *MMI_current_slide_control_value = NULL;
S32 *MMI_slide_control_value[MMI_MAX_SLIDE_CONTROL];
MMI_BOOL gMMI_title_bknd_display = MMI_TRUE;
MMI_BOOL gMMI_wallpaper_on_bottom = MMI_FALSE; /* 041205 Calvin added to support wallpaper on bottom */
MMI_BOOL gMMI_disable_shortcut_display = MMI_FALSE; /* 071205 Calvin added to support wallpaper on bottom */
FuncPtr gExitFullScreenCallBack = NULL;
S32 gOnFullScreen = 0x00000000;
#define MMI_BEFORE_SCREEN 0x00000000
#define MMI_LEAVE_FULL_SCREEN 0x00000001
#define MMI_LEAVE_FULL_IDLE_SCREEN 0x00000002
#define MMI_IN_FULL_SCREEN 0x00000004
#define MMI_IN_NORMAL_SCREEN 0x00000008
#define MMI_IN_NORMAL_SCREEN_WITHOUT_STATUSBAR 0x00000010
#define MMI_IN_IDLE_SCREEN 0x00000020
#define MMI_LEAVE_BG_ON_BOTTOM_SCREEN 0x00000040 /* 092005 redraw status Calvin */
#define MMI_IN_JAVA_SCREEN 0x00000080 //021007 Java title
/* Add for Draw Manager */
S32 g_gui_current_catid = 0;
U16 title_bg_id = 0; /* 070505 Calvin added for customized title background image */
/* MTK Elvis for R2L characters */
#ifdef __MMI_BIDI_ALG__
extern U8 visual_str[];
#endif
extern BOOL r2lMMIFlag;
/* MTK end */
extern U16 gMainMenuAnimation[];
extern U16 gMainMenuTitleIcon[];
extern S32 volume_level_UI;
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;
/* store the function pointers of keys */
extern FuncPtr currKeyFuncPtrs[MAX_KEYS][MAX_KEY_TYPE];
/* store the ui key function pointers just a copy of currKeyFuncPtrs */
FuncPtr wgui_key_handlers[MAX_KEYS][MAX_KEY_TYPE];
extern void (*hide_softkey[]) (void);
extern icontext_button MMI_softkeys[];
#ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
extern BOOL inMatrixNoTitleFlag; /* 060505 Calvin added */
#endif
/* PMT VIKAS START 20050707 */
#ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
extern void gui_register_button_shuffle(void (*f) (void));
extern void shuffle_draw_white(void);
extern void (*pixtel_shuffle_draw_background) (void);
#endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */
/* PMT VIKAS END 20050707 */
/* PMT VIKAS START 20050720 */
#ifdef __MMI_UI_ANIMATED_TITLE_EFFECT__
#define TITLE_EFFECT_TYPE__(A) MMI_UI_TITLE_IMAGE_ANIMATE_##A
#define TITLE_EFFECT_TYPE_(A) TITLE_EFFECT_TYPE__(A)
#define TITLE_EFFECT_TYPE(A) TITLE_EFFECT_TYPE_(A)
wgui_title_effect_styles title_effect_style = TITLE_EFFECT_TYPE(__MMI_TITLE_EFFECT_TYPE__);
S32 animate_title_move = 0;
S32 is_animated_title_effect = 1;
S32 title_animation_current_frame_count = 0;
S32 MMI_draw_title_next_frame = 0;
S32 backup_title_animation_current_frame_count = 0;
#endif /* __MMI_UI_ANIMATED_TITLE_EFFECT__ */
/* PMT VIKAS END 20050720 */
/*****************************************************************************
* Dummy functions
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* dummy_get_history
* DESCRIPTION
* Dummy function to get history
* PARAMETERS
* buffer [IN] History buffer
* RETURNS
* byte*
*****************************************************************************/
U8 *dummy_get_history(U8 *buffer)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return (buffer);
} /* end of dummy_get_hisgory */
/*****************************************************************************
* FUNCTION
* dummy_get_history_size
* DESCRIPTION
* Dummy function to get history size
* PARAMETERS
* void
* RETURNS
* size of history
*****************************************************************************/
S32 dummy_get_history_size(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return (0);
} /* end of dummy_get_history_size */
/*****************************************************************************
* Get Resource
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* get_string_lang
* DESCRIPTION
* Wrapper for GetStringLang() function, to get string for specific language
* PARAMETERS
* i [IN] String id
* ssc_str [IN] Ssc string to identify language
* RETURNS
* pointer to the string corresponding to the given string ID and give sscstring of language
*****************************************************************************/
UI_string_type get_string_lang(MMI_ID_TYPE i, S8 *ssc_str)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 lang_index;
UI_string_type s;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
lang_index = GetLanguageIndex(ssc_str);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -