📄 wgui_draw_manager.c
字号:
g_dm_scr_bg_cntx.image_name = NULL;
//g_dm_scr_bg_cntx.flags = 0;//082906 scr_bg
}
#endif /* __MMI_SCREEN_ROTATE__ */
g_dm_data.s32CatId = 0;
g_dm_data.s32flags = 0;
g_dm_data.s32ScrId = 0;
/* Leo start 20050830 */
ExitCategoryFunction = MMI_dummy_function;
RedrawCategoryFunction = MMI_dummy_function;
GetCategoryHistory = dummy_get_history;
GetCategoryHistorySize = dummy_get_history_size;
/* Leo end 20050830 */
g_dm_cntx.is_context_reset = MMI_TRUE;
}
}
/*****************************************************************************
* FUNCTION
* dm_reset_context_ext
* DESCRIPTION
* reset variables used in draw manager.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void dm_reset_context_ext(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
}
#ifdef __MMI_SUBLCD__
/*****************************************************************************
* FUNCTION
* dm_reset_sublcd_context
* DESCRIPTION
* reset variables used in draw manager for sublcd.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void dm_reset_sublcd_context(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 idx = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
for (idx = 0; idx < dm_layers_count_sub; idx++)
{
if (dm_layers_sub[idx] != GDI_LAYER_SUB_BASE_LAYER_HANDLE)
{
gdi_layer_free(dm_layers_sub[idx]);
}
dm_layers_sub[idx] = GDI_ERROR_HANDLE;
}
dm_layers_count_sub = 0;
/* Reset all images */
for (idx = 0; idx < dm_image_count_sub; idx++)
{
dm_image_array_sub[idx].back_fill = NULL;
dm_image_array_sub[idx].image = NULL;
dm_image_array_sub[idx].name = NULL;
if (dm_image_array_sub[idx].image_handle != GDI_ERROR_HANDLE)
{
gdi_image_stop_animation(dm_image_array_sub[idx].image_handle);
dm_image_array_sub[idx].image_handle = GDI_ERROR_HANDLE;
}
}
dm_image_count_sub = 0;
dm_string_count_sub = 0;
dm_reset_sub_category_controlled_callback();
}
#endif /* __MMI_SUBLCD__ */
/*****************************************************************************
* FUNCTION
* dm_get_image_count
* DESCRIPTION
* Used to get currently used image controls
* PARAMETERS
* void
* RETURNS
* U16 number of image countrol used currently
*****************************************************************************/
U16 dm_get_image_count(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return dm_image_count;
}
/*****************************************************************************
* FUNCTION
* dm_get_button_count
* DESCRIPTION
* Used to get currently used button controls
* PARAMETERS
* void
* RETURNS
* U16 number of button countrol used currently
*****************************************************************************/
U16 dm_get_button_count(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return dm_button_count;
}
/*****************************************************************************
* FUNCTION
* dm_get_button
* DESCRIPTION
*
* PARAMETERS
* index [IN]
* RETURNS
*
*****************************************************************************/
icontext_button *dm_get_button(U16 index)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_ASSERT(index < DM_MAX_BUTTONS);
return &dm_button_array[index];
}
/* Leo end 20050722 */
/*****************************************************************************
* FUNCTION
* dm_get_font
* DESCRIPTION
* Used to return the font poointer depending on the font enum value read from
* coordinate set
* PARAMETERS
* font [IN] Font enum value
* RETURNS
* returns font pointer
*****************************************************************************/
UI_font_type dm_get_font(S16 font)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (font)
{
case SMALL_FONT:
return (&MMI_small_font);
break;
case MEDIUM_FONT:
return (&MMI_medium_font);
break;
case LARGE_FONT:
return (&MMI_large_font);
case SUBLCD_FONT:
return (&MMI_sublcd_font);
case DIALER_FONT:
return (&wgui_dialer_box_f1);
default:
return (&MMI_default_font);
break;
}
}
/*****************************************************************************
* FUNCTION
* setup_previous_control
* DESCRIPTION
* Set ups the coordinates for previous control.
* PARAMETERS
* dm_coordinate_info [?]
* RETURNS
* void
*****************************************************************************/
void setup_previous_control(dm_coordinates *dm_coordinate_info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
prev_control_coordinates.coordinate.s16X = dm_coordinate_info->s16X;
prev_control_coordinates.coordinate.s16Y = dm_coordinate_info->s16Y;
prev_control_coordinates.coordinate.s16Height = dm_coordinate_info->s16Height;
prev_control_coordinates.coordinate.s16Width = dm_coordinate_info->s16Width;
prev_control_coordinates.s16X2 =
prev_control_coordinates.coordinate.s16X + prev_control_coordinates.coordinate.s16Width - 1;
prev_control_coordinates.s16Y2 =
prev_control_coordinates.coordinate.s16Y + prev_control_coordinates.coordinate.s16Height - 1;
}
/*****************************************************************************
* FUNCTION
* dm_exit_category_function
* DESCRIPTION
* Common exit function for draw manager.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void dm_exit_category_function(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (g_dm_cntx.redraw_screen_main)
{
/* normal case */
case NORMAL_REDRAW:
case REDRAW_2_REDRAW:
if (dm_backup_exit_category_function)
{
dm_backup_exit_category_function();
}
g_dm_cntx.redraw_screen_main = NORMAL_EXIT;
break;
case REDRAW_2_SHOW:
break;
default:
MMI_ASSERT(0);
}
#ifdef GDI_USING_LAYER_ROTATE
//W06.04 Replace functions for GDI LCD Rotate
//if ( gdi_layer_get_base_layer_rotation() == GDI_LCD_LAYER_ROTATE_0)
if (gdi_lcd_get_rotate() == GDI_LCD_LAYER_ROTATE_0)
#endif /* GDI_USING_LAYER_ROTATE */
{
if (dm_layers[0] != GDI_ERROR_HANDLE || dm_layers[1] != GDI_ERROR_HANDLE || dm_layers[2] != GDI_ERROR_HANDLE ||
dm_layers[3] != GDI_ERROR_HANDLE)
{
gdi_layer_flatten_to_base(dm_layers[0], dm_layers[1], dm_layers[2], dm_layers[3]);
}
}
dm_reset_context();
if (g_dm_cntx.exit_full_screen_on_exit)
{
g_dm_cntx.exit_full_screen_on_exit = MMI_FALSE;
leave_full_screen();
}
/* 092005 redraw status Calvin Start */
if (wgui_is_wallpaper_on_bottom())
{
gOnFullScreen = MMI_LEAVE_BG_ON_BOTTOM_SCREEN;
wgui_reset_wallpaper_on_bottom(); /* 041205 Calvin added to support wallpaper on bottom */
}
/* 092005 redraw status Calvin End */
} /* end of dm_exit_category_function */
#ifdef __MMI_SUBLCD__
/*****************************************************************************
* FUNCTION
* dm_sub_exit_category_function
* DESCRIPTION
* Common exit function for draw manager.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void dm_sub_exit_category_function(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (g_dm_sublcd_data.s32flags & DM_SUB_LCD_CONTEXT)
{
switch (g_dm_cntx.redraw_screen_sub)
{
/* normal case */
case NORMAL_REDRAW:
case REDRAW_2_REDRAW:
if (dm_sub_backup_exit_category_function)
{
dm_sub_backup_exit_category_function();
}
g_dm_cntx.redraw_screen_sub = NORMAL_EXIT;
break;
case REDRAW_2_SHOW:
break;
default:
MMI_ASSERT(0);
}
}
dm_reset_sublcd_context();
SUBLCD_ExitCategoryFunction = MMI_dummy_function;
SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
SUBLCD_GetCategoryHistory = dummy_get_history;
SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
}
#endif /* __MMI_SUBLCD__ */
/*****************************************************************************
* FUNCTION
* dm_backup_current_category_exit_function
* DESCRIPTION
* Save current exit function and set ExitCategoryFunction to dm_exit_category_function
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void dm_backup_current_category_exit_function(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
dm_backup_exit_category_function = ExitCategoryFunction;
ExitCategoryFunction = dm_exit_category_function;
} /* end of dm_backup_current_category_exit_function */
#ifdef __MMI_SUBLCD__
/*****************************************************************************
* FUNCTION
* dm_sub_backup_current_category_exit_function
* DESCRIPTION
* Save current exit function and set ExitCategoryFunction to dm_exit_category_function
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void dm_sub_backup_current_category_exit_function(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
dm_sub_backup_exit_category_function = SUBLCD_ExitCategoryFunction;
SUBLCD_ExitCategoryFunction = dm_sub_exit_category_function;
} /* end of dm_backup_current_category_exit_function */
#endif /* __MMI_SUBLCD__ */
/*****************************************************************************
* FUNCTION
* dm_setup_category_functions
* DESCRIPTION
* This function sets up the common-used functions for the Draw Manager
* PARAMETERS
* redraw_function [IN]
* get_history_function [IN]
* get_history_size_function [IN]
* dm_data(?) [IN] Which contains the Draw Manager Information
* RETURNS
* void
*****************************************************************************/
void dm_setup_category_functions(
FuncPtr redraw_function,
U8 *(*get_history_function) (U8 *buffer),
S32(*get_history_size_function) (void))
{
/*----------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -