📄 gui_fixed_menus.c
字号:
{
MMI_DBG_ASSERT(0); /* invaild cache */
gui_draw_filled_area(x1, y1, x2, y2, f);
}
else
{
PU8 dest;
S32 dest_layer_width, dest_layer_height;
gdi_rect_struct dest_clip;
gdi_layer_get_buffer_ptr(&dest);
gdi_layer_get_dimension(&dest_layer_width, &dest_layer_height);
dest_clip.x1 = x1;
dest_clip.y1 = y1;
dest_clip.x2 = x2;
dest_clip.y2 = y2;
gdi_2d_memory_blt(
(U8*) g_gui_list_menu_filler_cache,
GUI_LIST_MENU_FILLER_CACHE_MAX_WIDTH,
0,
0,
GUI_LIST_MENU_FILLER_CACHE_MAX_WIDTH,
GUI_LIST_MENU_FILLER_CACHE_MAX_HEIGHT,
dest,
dest_layer_width,
x1,
y1,
dest_clip,
GDI_MAINLCD_BIT_PER_PIXEL);
}
}
#endif /* __MMI_UI_LIST_RESIDENT_FILLER_CACHE__ */
/*****************************************************************************
* FUNCTION
* gui_show_menu_background_in_layer
* DESCRIPTION
*
* PARAMETERS
* x1 [IN]
* y1 [IN]
* x2 [IN]
* y2 [IN]
* f [?]
* RETURNS
* void
*****************************************************************************/
void gui_show_menu_background_in_layer(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 width = x2 - x1 + 1;
S32 height = y2 - y1 + 1;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/*
* We do not use gui_set_transparent_source_layer() in this function because
* not all list menu use gui_show_menu_background_in_layer(), then some menus
* have transparency effect but others do not on platforms that
* !defined(__MMI_WALLPAPER_ON_BOTTOM__) && defined (__MMI_UI_TRANSPARENT_EFFECT__)
*/
if (!gui_is_entry_new_screen())
{
S32 layer_width, layer_height, layer_x, layer_y;
gdi_layer_push_and_set_active(wgui_layer_1);
gdi_layer_get_position(&layer_x, &layer_y);
gdi_layer_get_dimension(&layer_width, &layer_height);
if (layer_width != (x2 - x1 + 1) || layer_height != (y2 - y1 + 1))
{
MMI_DBG_ASSERT(0);
}
if (layer_x != x1 || layer_y != y1)
{
gdi_layer_set_position(x1, y1);
}
gdi_layer_pop_and_restore_active();
if (dm_is_activated())
{
/*
* If draw manager is reset by RedrawCategoryScreen(), original information of draw manager layers are discarded
* We need to configure the layer information again.
*/
dm_add_blt_layer(wgui_layer_1, DM_LAYER_BOTTOM);
}
gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
}
else
{
gui_set_entry_new_screen(MMI_FALSE);
gdi_layer_multi_layer_enable();
gdi_layer_get_base_handle(&wgui_base_layer);
/* Setup the base layer */
gdi_layer_push_and_set_active(wgui_base_layer);
gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
gdi_layer_set_opacity(TRUE, UI_SUBMENU_OPACITY_BASED_LAYER);
gdi_layer_push_clip();
gdi_layer_set_clip(x1, y1, x2, y2);
gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
gdi_layer_pop_clip();
gdi_layer_pop_and_restore_active();
/* Create multilayer buffer */
if (wgui_layer_1 == GDI_LAYER_EMPTY_HANDLE)
{
if (dm_is_activated())
{
/* BLT layers are controlled by draw manager */
dm_create_layer(x1, y1, width, height, &wgui_layer_1, DM_LAYER_BOTTOM);
}
else
{
gdi_layer_create(x1, y1, width, height, &wgui_layer_1);
gdi_layer_set_blt_layer(wgui_layer_1, wgui_base_layer, 0, 0);
}
}
gdi_layer_push_and_set_active(wgui_layer_1);
#ifdef __MMI_UI_LIST_RESIDENT_FILLER_CACHE__
gui_show_menu_background_filler_from_cache(0, 0, width - 1, height - 1, f);
#else
gui_draw_filled_area(0, 0, width - 1, height - 1, f);
#endif
gdi_layer_pop_and_restore_active();
}
}
#endif /* __MMI_UI_LIST_CACHE_BACKGROUND__ */
//wangbei add begin 20070407
#ifdef __MMI_SUBMENU_DASHED_NO_STATE_BAR__
void gui_show_menu_background_in_layer1(S32 x1, S32 y1, S32 x2, S32 y2, U16 image_ID)
{
S32 width = x2 - x1 + 1;
S32 height = y2 - y1 + 1;
if (!gui_is_entry_new_screen())
{
S32 layer_width, layer_height, layer_x, layer_y;
#if defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__)
gui_set_transparent_source_layer(wgui_layer_1);
#endif
gdi_layer_push_and_set_active(wgui_layer_1);
gdi_layer_get_position(&layer_x, &layer_y);
gdi_layer_get_dimension(&layer_width, &layer_height);
if (layer_width != (x2 - x1 + 1) || layer_height != (y2 - y1 + 1))
{
MMI_DBG_ASSERT(0);
}
if (layer_x != x1 || layer_y != y1)
{
gdi_layer_set_position(x1, y1);
}
gdi_layer_pop_and_restore_active();
if (dm_is_activated())
{
/*
* If draw manager is reset by RedrawCategoryScreen(), original information of draw manager layers are discarded
* We need to configure the layer information again.
*/
dm_add_blt_layer(wgui_layer_1, DM_LAYER_BOTTOM);
}
gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
}
else
{
gui_set_entry_new_screen(MMI_FALSE);
gdi_layer_multi_layer_enable();
gdi_layer_get_base_handle(&wgui_base_layer);
/* Setup the base layer */
gdi_layer_push_and_set_active(wgui_base_layer);
gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
gdi_layer_set_opacity(TRUE, UI_SUBMENU_OPACITY_BASED_LAYER);
gdi_layer_push_clip();
gdi_layer_set_clip(x1, y1, x2, y2);
gdi_draw_solid_rect(x1,y1,x2,y2, GDI_COLOR_TRANSPARENT);
gdi_layer_pop_clip();
gdi_layer_pop_and_restore_active();
//Create multilayer buffer
if (wgui_layer_1 == GDI_LAYER_EMPTY_HANDLE)
{
if (dm_is_activated())
{
/* BLT layers are controlled by draw manager */
dm_create_layer(x1, y1, width, height, &wgui_layer_1, DM_LAYER_BOTTOM);
}
else
{
gdi_layer_create(x1, y1, width, height, &wgui_layer_1);
gdi_layer_set_blt_layer(wgui_layer_1, wgui_base_layer, 0, 0);
}
#if defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__)
gui_set_transparent_source_layer(wgui_layer_1); //should remove// wangbei modify 20070612
#endif
}
gdi_layer_push_and_set_active(wgui_layer_1);
#ifdef __MMI_UI_LIST_RESIDENT_FILLER_CACHE__
gdi_image_draw_id(0,0,image_ID);
#else
gdi_image_draw_id(0,0,image_ID);
#endif
gdi_layer_pop_and_restore_active();
}
}
#endif
//wangbei add end
/*****************************************************************************
* FUNCTION
* gui_show_list_menu_background_outside_area
* DESCRIPTION
* Show the extended menu background outside the menu display area.
*
* For example, in handwriting mode of inline editor, we may want to draw
* menu background in the bottom virtual keyboard area when the keyboard is hidden.
*
* Note: This API does not use any menu cache
* PARAMETERS
* m [IN] Is the list menu object
* x1 [IN] left-top x
* y1 [IN] left-top y
* x2 [IN] right-bottom x
* y2 [IN] right-bottom y
* RETURNS
* void
*****************************************************************************/
void gui_show_list_menu_background_outside_area(fixed_list_menu *m, S32 x1, S32 y1, S32 x2, S32 y2)
{
UI_filled_area *f;
if (m->flags & UI_LIST_MENU_STATE_FOCUSSED)
{
f = m->focussed_filler;
}
else
{
f = m->normal_filler;
}
gui_push_clip();
gui_set_clip(x1, y1, x2, y2);
gui_draw_filled_area(m->x, m->y, x2, y2, f);
gui_pop_clip();
}
/*****************************************************************************
* FUNCTION
* gui_show_fixed_list_menu
* DESCRIPTION
* Displays the fixed list menu
* PARAMETERS
* m [IN] Is the fixed list menu object
* RETURNS
* void
*****************************************************************************/
extern S32 MMI_current_menu_type;
#ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
extern MMI_theme *current_MMI_theme;
extern BOOL line_draw;
extern fixed_list_menu MMI_fixed_list_menu;
#endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
//gqy add begin 20070725
#ifdef __MALATA_STANDARD_441_MEMU__
extern BOOL g_BControlFlag;
extern U16 mm_highlighticon;
#endif
#ifdef __MT190_SUBMENU_STYLE__
S32 g_NumIndex;
BOOL g_bNumFlag;
#endif
//gqy add end 20070725
void gui_show_fixed_list_menu(fixed_list_menu *m)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 x1, y1, x2, y2, y_offset;
#ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
S32 ic, menu_grid_gap;
#endif
UI_filled_area *f;
S32 i;
S32 cx1, cy1, cx2, cy2;
S32 tx1, ty1, tx2, ty2;
S32 iwidth, iheight;
U8 done = 0;
S32 total_height, counter, list_height;
U8 disable_draw = 0;
MMI_BOOL show_scrollbar;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (m->flags & UI_LIST_MENU_DISABLE_DRAW)
{
disable_draw = 1;
}
gui_get_clip(&cx1, &cy1, &cx2, &cy2);
gui_get_text_clip(&tx1, &ty1, &tx2, &ty2);
//zx add begin 20070802
#ifdef __MT190_SUBMENU_STYLE__
gDynamicMenus=FALSE;
#endif
//zx add end 20070802
x1 = m->x;
y1 = m->y;
x2 = x1 + m->width - 1;
y2 = y1 + m->height - 1;
/* Use the original x1, y1, x2, y2 for background filler */
if (m->flags & UI_LIST_MENU_STATE_FOCUSSED)
{
f = m->focussed_filler;
}
else
{
f = m->normal_filler;
}
if (!disable_draw && (!(m->flags & UI_LIST_MENU_DISABLE_BACKGROUND)) && MMI_current_menu_type != PAGE_MENU)
{
gui_set_clip(x1, y1, x2, y2);
if (!(m->flags & UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER) && (wgui_is_wallpaper_on_bottom() == MMI_TRUE))
{
gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
/* PMT VIKAS START 20051217 */
#if (defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__))
/* PMT VIKAS END 20051217 */
if (gui_get_transparent_source_layer() == GDI_LAYER_EMPTY_HANDLE) /* 110705 WAP menu Clavin add */
{
gui_set_transparent_source_layer(dm_get_scr_bg_layer()); /* should remove */
}
#endif /* (defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__)) */
}
#ifdef __MMI_UI_LIST_CACHE_BACKGROUND__
else if (!(m->flags & UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER) &&
(dm_get_scr_bg_layer() == GDI_ERROR_HANDLE) && (gui_get_multilayer_mask() & UI_MUL_BKG_SUBMENU))
{
gui_show_menu_background_in_layer(x1, y1, x2, y2, f);
}
#endif /* __MMI_UI_LIST_CACHE_BACKGROUND__ */
else
{
#if !defined(MT6205B) && !defined(MT6208)
gui_draw_filled_area(x1, y1, x2, y2, f);
#else /* !defined(MT6205B) && !defined(MT6208) */
/* For low-end phone, disable list menu background ca
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -