📄 wgui_categories_util.c
字号:
void wgui_set_animation_image_y(S32 x, S32 y, PU8 img)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 width, height;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (UI_test_sub_LCD_graphics_context())
{
SUBLCD_MMI_animated_icon = img;
if (SUBLCD_MMI_animated_icon == NULL)
{
return;
}
gui_measure_image(SUBLCD_MMI_animated_icon, &width, &height);
SUBLCD_MMI_animated_icon_x = x - (width >> 1);
SUBLCD_MMI_animated_icon_y = y;
}
else
{
_MMI_animated_icon = img;
if (_MMI_animated_icon == NULL)
{
return;
}
gui_measure_image(_MMI_animated_icon, &width, &height);
_MMI_animated_icon_x = x - (width >> 1);
_MMI_animated_icon_y = y;
}
} /* end of wgui_set_animation_image_y */
/*****************************************************************************
* FUNCTION
* wgui_measure_set_animation
* DESCRIPTION
* Sets up the animated icon to be displayed in the category screens
* PARAMETERS
* x [IN] Coordinates around which the icon is centered horizontally
* y [IN] Position from which the icon is drawn centered vertically.
* width [?]
* height [?]
* img [IN]
* imag(?) [IN] The id of icon to be displayed
* RETURNS
* void
*****************************************************************************/
void wgui_measure_set_animation(S32 x, S32 y, S32 *width, S32 *height, MMI_ID_TYPE img)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
wgui_measure_set_animation_image(x, y, width, height, get_image(img));
}
/*****************************************************************************
* FUNCTION
* wgui_measure_set_animation_y
* DESCRIPTION
* Sets up the animated icon to be displayed in the category screens
* PARAMETERS
* x [IN] Coordinates around which the icon is centered horizontally
* y [IN] Position from which the top of the icon is drawn
* width [?]
* height [?]
* img [IN]
* imag(?) [IN] The id of icon to be displayed
* RETURNS
* void
*****************************************************************************/
void wgui_measure_set_animation_y(S32 x, S32 y, S32 *width, S32 *height, MMI_ID_TYPE img)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
wgui_measure_set_animation_image_y(x, y, width, height, get_image(img));
}
/*****************************************************************************
* FUNCTION
* wgui_measure_set_animation_image
* DESCRIPTION
* Sets up the animated icon to be displayed in the category screens
* PARAMETERS
* x [IN] Coordinates around which the icon is centered horizontally
* y [IN] Position from which the icon is drawn centered vertically.
* width [?]
* height [?]
* img [IN]
* imag(?) [IN] The icon to be displayed
* RETURNS
* void
*****************************************************************************/
void wgui_measure_set_animation_image(S32 x, S32 y, S32 *width, S32 *height, PU8 img)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
*width = 0;
*height = 0;
if (UI_test_sub_LCD_graphics_context())
{
SUBLCD_MMI_animated_icon = img;
if (SUBLCD_MMI_animated_icon == NULL)
{
return;
}
gui_measure_image(SUBLCD_MMI_animated_icon, width, height);
SUBLCD_MMI_animated_icon_x = x - ((*width) >> 1);
SUBLCD_MMI_animated_icon_y = y - ((*height) >> 1);
}
else
{
_MMI_animated_icon = img;
if (_MMI_animated_icon == NULL)
{
return;
}
gui_measure_image(_MMI_animated_icon, width, height);
_MMI_animated_icon_x = x - ((*width) >> 1);
_MMI_animated_icon_y = y - ((*height) >> 1);
}
} /* end of wgui_measure_set_animation_image */
/*****************************************************************************
* FUNCTION
* wgui_measure_set_animation_image_y
* DESCRIPTION
* Sets up the animated icon to be displayed in the category screens
* PARAMETERS
* x [IN] Coordinates around which the icon is centered horizontally
* y [IN] Position from which the top of the icon is drawn
* width [?]
* height [?]
* img [IN]
* imag(?) [IN] The icon to be displayed
* RETURNS
* void
*****************************************************************************/
void wgui_measure_set_animation_image_y(S32 x, S32 y, S32 *width, S32 *height, PU8 img)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
*width = 0;
*height = 0;
/* check whether the current graphic context is sub lcd */
if (UI_test_sub_LCD_graphics_context())
{
SUBLCD_MMI_animated_icon = img;
if (SUBLCD_MMI_animated_icon == NULL)
{
return;
}
gui_measure_image(SUBLCD_MMI_animated_icon, width, height);
SUBLCD_MMI_animated_icon_x = x - ((*width) >> 1);
SUBLCD_MMI_animated_icon_y = y;
}
else
{
_MMI_animated_icon = img;
if (_MMI_animated_icon == NULL)
{
return;
}
gui_measure_image(_MMI_animated_icon, width, height);
_MMI_animated_icon_x = x - ((*width) >> 1);
_MMI_animated_icon_y = y;
}
}
/*****************************************************************************
* FUNCTION
* wgui_hide_animation
* DESCRIPTION
* Hides the Category screen animation. Stop the animation
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void wgui_hide_animation(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (UI_test_sub_LCD_graphics_context())
{
gui_hide_animated_image(0, 0, SUBLCD_MMI_animated_icon_handle);
}
else
{
gui_hide_animated_image(0, 0, _MMI_animated_icon_handle);
}
}
/*****************************************************************************
* Common Utility
*****************************************************************************/
#if (0)
/* 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 /* (0) */
/*****************************************************************************
* FUNCTION
* wgui_fill_rectangle_clip
* DESCRIPTION
* set clip and draw rectangle
* PARAMETERS
* x1 [IN]
* y1 [IN]
* x2 [IN]
* y2 [IN]
* c [IN]
* RETURNS
* void
*****************************************************************************/
void wgui_fill_rectangle_clip(S32 x1, S32 y1, S32 x2, S32 y2, color c)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gdi_layer_push_clip();
gdi_layer_set_clip(x1, y1, x2, y2);
gui_fill_rectangle(x1, y1, x2, y2, c);
gdi_layer_pop_clip();
}
/*****************************************************************************
* FUNCTION
* clear_screen_with_color
* DESCRIPTION
* Clears the screen with specific color
* PARAMETERS
* c [IN]
* RETURNS
* void
*****************************************************************************/
void clear_screen_with_color(color c)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_push_clip();
#if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) /* 041205 Calvin modieid */
if ((gOnFullScreen & MMI_IN_NORMAL_SCREEN)) /* current screen is not full screen */
{
gui_set_clip(0, MMI_title_y, UI_device_width - 1, UI_device_height - 1);
gui_fill_rectangle(0, MMI_title_y, UI_device_width - 1, UI_device_height - 1, c);
}
else
#endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */
{
gui_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
gui_fill_rectangle(0, 0, UI_device_width - 1, UI_device_height - 1, c);
}
gui_pop_clip();
}
/*****************************************************************************
* FUNCTION
* clear_screen
* DESCRIPTION
* Clears the screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void clear_screen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
color c;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
//zx add begin 20070405
#ifdef __MMI_BLACK_UI_STYLE__
c.r=0;
c.g=0;
c.b=0;
c.alpha=100;
#else
//ljz add begin 20070618
#ifdef __MT170_UI_STYLE__
{
c.r = 171;
c.g = 171;
c.b = 171;
c.alpha = 100;
}
#else
c.r = 255;
c.g = 255;
c.b = 255;
c.alpha = 100;
#endif
#endif
//ljz add end 20070618
//zx add end
clear_screen_with_color(c);
}
/*****************************************************************************
* FUNCTION
* clear_buttonbar
* DESCRIPTION
* Clears the button bar portion of the screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void clear_buttonbar(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
color c = gui_color(255, 255, 255);
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_reset_clip();
if (UI_device_height == 128)
{
gui_fill_rectangle(0, UI_device_height - MMI_softkey_height - 10, UI_device_width - 1, UI_device_height - 1, c);
}
else
/* START VIJAY PMT 20050930 */
#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
/* START VIJAY PMT 20051202 */
if (whether_no_small_screen())
/* END VIJAY PMT 20051202 */
{
gui_fill_rectangle(0, UI_device_height - MMI_softkey_height, UI_device_width - 1, UI_device_height - 1, c); /* PMT MANISH 20050707 */
}
else
#endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */
/* END VIJAY PMT 20050930 */
gui_fill_rectangle(0, UI_device_height - MMI_softkey_height - 4, UI_device_width - 1, UI_device_height - 1, c);
}
/**********************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -