gui.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:192k
- * gui_shadow_filled_area
- * DESCRIPTION
- * Draws a shadow for a filled area
- *
- * See fillers (UI_filled_area structure)
- * PARAMETERS
- * x1 [IN] Left-top corner of the rectangle
- * y1 [IN] Left-top corner of the rectangle
- * x2 [IN] Right-bottom corner of the rectangle
- * y2 [IN] Right-bottom corner of the rectangle
- * f [IN] Is the filler to use
- * RETURNS
- * void
- *****************************************************************************/
- void gui_shadow_filled_area(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 flags = f->flags;
- color shadow_color = f->shadow_color;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (flags & UI_FILLED_AREA_SHADOW_DOUBLE_LINE)
- {
- if ((flags & UI_FILLED_AREA_DOUBLE_BORDER) == UI_FILLED_AREA_DOUBLE_BORDER)
- {
- if (flags & UI_FILLED_AREA_ROUNDED_BORDER)
- {
- gui_draw_horizontal_line(x1 + 3, x2 + 1, y2 + 1, shadow_color);
- gui_draw_horizontal_line(x1 + 4, x2, y2 + 2, shadow_color);
- gui_draw_vertical_line(y1 + 3, y2, x2 + 1, shadow_color);
- gui_draw_vertical_line(y1 + 4, y2, x2 + 2, shadow_color);
- gui_putpixel(x2 - 1, y2, shadow_color);
- gui_putpixel(x2, y2, shadow_color);
- gui_putpixel(x2, y2 - 1, shadow_color);
- }
- else
- {
- gui_draw_horizontal_line(x1 + 2, x2 + 2, y2 + 1, shadow_color);
- gui_draw_horizontal_line(x1 + 2, x2 + 2, y2 + 2, shadow_color);
- gui_draw_vertical_line(y1 + 2, y2, x2 + 1, shadow_color);
- gui_draw_vertical_line(y1 + 2, y2, x2 + 2, shadow_color);
- }
- }
- else
- {
- if (flags & UI_FILLED_AREA_ROUNDED_BORDER)
- {
- gui_draw_horizontal_line(x1 + 3, x2 + 1, y2 + 1, shadow_color);
- gui_draw_horizontal_line(x1 + 4, x2, y2 + 2, shadow_color);
- gui_draw_vertical_line(y1 + 3, y2, x2 + 1, shadow_color);
- gui_draw_vertical_line(y1 + 4, y2, x2 + 2, shadow_color);
- gui_putpixel(x2 - 1, y2, shadow_color);
- gui_putpixel(x2, y2, shadow_color);
- gui_putpixel(x2, y2 - 1, shadow_color);
- }
- else
- {
- gui_draw_horizontal_line(x1 + 2, x2 + 2, y2 + 1, shadow_color);
- gui_draw_horizontal_line(x1 + 2, x2 + 2, y2 + 2, shadow_color);
- gui_draw_vertical_line(y1 + 2, y2, x2 + 1, shadow_color);
- gui_draw_vertical_line(y1 + 2, y2, x2 + 2, shadow_color);
- }
- }
- }
- else
- {
- if ((flags & UI_FILLED_AREA_DOUBLE_BORDER) == UI_FILLED_AREA_DOUBLE_BORDER)
- {
- if (flags & UI_FILLED_AREA_ROUNDED_BORDER)
- {
- gui_draw_horizontal_line(x1 + 3, x2 - 2, y2 + 1, shadow_color);
- gui_draw_vertical_line(y1 + 3, y2 - 2, x2 + 1, shadow_color);
- gui_putpixel(x2, y2 - 1, shadow_color);
- gui_putpixel(x2 - 1, y2, shadow_color);
- }
- else
- {
- gui_draw_horizontal_line(x1 + 1, x2 + 1, y2 + 1, shadow_color);
- gui_draw_vertical_line(y1 + 1, y2, x2 + 1, shadow_color);
- }
- }
- else
- {
- if (flags & UI_FILLED_AREA_ROUNDED_BORDER)
- {
- gui_draw_horizontal_line(x1 + 2, x2 - 1, y2 + 1, shadow_color);
- gui_draw_vertical_line(y1 + 2, y2 - 1, x2 + 1, shadow_color);
- gui_putpixel(x2, y2, shadow_color);
- }
- else
- {
- gui_draw_horizontal_line(x1 + 1, x2 + 1, y2 + 1, shadow_color);
- gui_draw_vertical_line(y1 + 1, y2, x2 + 1, shadow_color);
- }
- }
- }
- }
- /* c=c+x such that c does not go above 255 */
- #define INCREMENT_COLOR_COMPONENT(c,x)
- { S32 cc=c;
- cc=cc+x;
- if(cc>255) cc=255;
- c=(U8)cc;
- }
- /* c=c-x such that c does not go below 0 */
- #define DECREMENT_COLOR_COMPONENT(c,x)
- { S32 cc=c;
- cc=cc-x;
- if(cc<0) cc=0;
- c=(U8)cc;
- }
- #define UI_FILLED_AREA_INFO_BORDER_OFFSET 5
- /*****************************************************************************
- * FUNCTION
- * gui_custom_fill_area_type2
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_custom_fill_area_type2(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 rx1 = x1, rx2 = x2, ry1 = y1, ry2 = y2, i = 0;
- color c = f->c;
- gdi_color gdi_c = gdi_act_color_from_rgb(255, c.r, c.g, c.b);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ry2 -= UI_FILLED_AREA_INFO_BORDER_OFFSET;
- gdi_draw_solid_rect(rx1 + 1, ry1 + 1, rx2 - 1, ry2 - 1, gdi_c);
- for (i = 0; i < 5; i++)
- {
- gdi_draw_line(rx1 + 9 + i, ry2 + i, rx1 + 17 - i, ry2 + i, gdi_c);
- }
- c = f->border_color;
- gdi_c = gdi_act_color_from_rgb(255, c.r, c.g, c.b);
- gdi_draw_line(rx1, ry1 + 2, rx1, ry2 - 2, gdi_c);
- gdi_draw_line(rx1 + 1, ry1 + 2, rx1 + 1, ry2 - 3, GDI_COLOR_WHITE);
- gdi_draw_line(rx1 + 2, ry1, rx2 - 2, ry1, gdi_c);
- gdi_draw_line(rx1 + 2, ry1 + 1, rx2 - 3, ry1 + 1, GDI_COLOR_WHITE);
- gdi_draw_point(rx1 + 1, ry1 + 1, gdi_c); /* Line Next To Upper Line */
- gdi_draw_point(rx1 + 2, ry1 + 2, GDI_COLOR_WHITE); /* Line Next To Upper Line */
- gdi_draw_point(rx2 - 1, ry1 + 1, gdi_c); /* Line Next To Upper Line */
- gdi_draw_point(rx2 - 2, ry1 + 1, gdi_c); /* Line Next To Upper Line */
- gdi_draw_point(rx1 + 1, ry2 - 1, gdi_c); /* Lower Edge */
- gdi_draw_point(rx1 + 1, ry2 - 2, gdi_c); /* Lower Edge */
- gdi_draw_point(rx2 - 1, ry2 - 1, gdi_c); /* Ipx above lower edge */
- gdi_draw_point(rx2 - 2, ry2 - 2, gdi_c); /* Ipx above lower edge */
- gdi_draw_line(rx2 - 1, ry1 + 2, rx2 - 1, ry2 - 2, gdi_c);
- gdi_draw_line(rx2, ry1 + 2, rx2, ry2 - 2, gdi_c);
- gdi_draw_line(rx1 + 2, ry2, rx1 + 8, ry2, gdi_c);
- gdi_draw_line(rx1 + 2, ry2 - 1, rx1 + 8, ry2 - 1, gdi_c);
- gdi_draw_line(rx1 + 18, ry2, rx2 - 2, ry2, gdi_c);
- gdi_draw_line(rx1 + 18, ry2 - 1, rx2 - 2, ry2 - 1, gdi_c);
- gdi_draw_line(rx1 + 8, ry2, rx1 + 13, ry2 + UI_FILLED_AREA_INFO_BORDER_OFFSET, gdi_c);
- gdi_draw_line(rx1 + 9, ry2, rx1 + 13, ry2 + UI_FILLED_AREA_INFO_BORDER_OFFSET - 1, gdi_c);
- gdi_draw_line(
- rx1 + 8 + UI_FILLED_AREA_INFO_BORDER_OFFSET,
- ry2 + UI_FILLED_AREA_INFO_BORDER_OFFSET,
- rx1 + 8 + (UI_FILLED_AREA_INFO_BORDER_OFFSET << 1),
- ry2,
- gdi_c);
- gdi_draw_line(
- rx1 + 8 + UI_FILLED_AREA_INFO_BORDER_OFFSET,
- ry2 + UI_FILLED_AREA_INFO_BORDER_OFFSET - 1,
- rx1 + 8 + (UI_FILLED_AREA_INFO_BORDER_OFFSET << 1),
- ry2,
- gdi_c);
- }
- /* For new hint style 2 & 3 */
- /*****************************************************************************
- * FUNCTION
- * gui_custom_fill_area_type1and2
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_custom_fill_area_type1and2(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
- {
- #if defined(UI_POPUP_DESCRIPTION_STYLE_1)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_fill_rectangle(x1, y1, x2, y2, f->c);
- #elif defined(UI_POPUP_DESCRIPTION_STYLE_2)
- UI_HLS_color hls;
- color sc;
- U8 l;
- gui_fill_rectangle(x1 + 1, y1 + 1, x2 - 2, y2 - 2, f->c);
- gui_putpixel(x1 + 1, y1 + 1, f->border_color);
- gui_putpixel(x1 + 1, y2 - 2, f->border_color);
- gui_putpixel(x2 - 2, y1 + 1, f->border_color);
- gui_putpixel(x2 - 2, y2 - 2, f->border_color);
- gui_draw_horizontal_line(x1 + 2, x2 - 3, y1, f->border_color);
- gui_draw_horizontal_line(x1 + 2, x2 - 3, y2 - 1, f->border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 3, x1, f->border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 3, x2 - 1, f->border_color);
- gui_RGB_to_HLS(f->c, &hls);
- l = hls.l;
- l -= (l >> 2);
- sc = gui_color(l, l, l);
- gui_draw_horizontal_line(x1 + 2 + 1, x2 - 3, y2, sc);
- gui_draw_vertical_line(y1 + 2 + 1, y2 - 3, x2, sc);
- l -= (l >> 3);
- sc = gui_color(l, l, l);
- gui_putpixel(x2 - 1, y2 - 2, sc);
- gui_putpixel(x2 - 2, y2 - 1, sc);
- l = hls.l;
- l -= (l >> 3);
- sc = gui_color(l, l, l);
- gui_putpixel(x1 + 2, y2, sc);
- gui_putpixel(x1 + 1, y2 - 1, sc);
- gui_putpixel(x2, y1 + 2, sc);
- gui_putpixel(x2 - 1, y2 - 1, sc);
- gui_putpixel(x2 - 2, y2, sc);
- gui_putpixel(x2, y2 - 2, sc);
- #elif defined(UI_POPUP_DESCRIPTION_STYLE_3)
- color c, sc, bc, lc; /* fill color, shadow color, border color, light color */
- S32 i;
- BOOL upward;
- #if 1
- static color cache_c, cache_bc, cache_sc;
- c = f->c;
- bc = f->border_color;
- lc = gui_color(255, 255, 255);
- if (memcpy(&cache_c, &c, sizeof(color)) || memcpy(&cache_bc, &bc, sizeof(color)))
- {
- UI_HLS_color hls1, hls2;
- cache_c = c;
- cache_bc = bc;
- gui_RGB_to_HLS(c, &hls1);
- gui_RGB_to_HLS(bc, &hls2);
- hls2.l = ((hls1.l << 1) + hls2.l) / 3;
- hls2.s -= (hls2.s >> 4) + (hls2.s >> 3); /* about 0.8 */
- gui_HLS_to_RGB(hls2, &cache_sc);
- }
- sc = cache_sc;
- #else /* 1 */ /* alternative algorithm. simple but does not work for all color combination */
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 1 */
- if ((f->flags & 0x0ff) == UI_FILLED_AREA_TYPE_CUSTOM_FILL_TYPE1)
- {
- upward = MMI_TRUE;
- }
- else
- {
- upward = MMI_FALSE;
- }
- if (upward)
- {
- y1 += 3;
- }
- else
- {
- y2 -= 3;
- }
- /* internal */
- gui_fill_rectangle(x1 + 2, y1 + 2, x2 - 2, y2 - 2, c);
- /* shadown */
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1 + 1, lc);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2 - 1, sc);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1 + 1, sc);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, sc);
- /* border */
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, bc);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, bc);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, bc);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, bc);
- gui_putpixel(x1 + 1, y1 + 1, bc);
- gui_putpixel(x1 + 1, y2 - 1, bc);
- gui_putpixel(x2 - 1, y1 + 1, bc);
- gui_putpixel(x2 - 1, y2 - 1, bc);
- if (x2 - x1 > 10 + 7)
- {
- if (!r2lMMIFlag)
- {
- x1 += 10;
- }
- else
- {
- x1 = x2 - 10 - 7;
- }
- x2 = x1 + 6;
- if (upward)
- {
- y1 -= 3;
- for (i = 0; i < 3; i++)
- {
- gui_draw_horizontal_line(x1 + 2 - i, x2 - 2 + i, y1 + i, bc);
- }
- for (i = 0; i < 4; i++)
- {
- gui_draw_horizontal_line(x1 + 3 - i, x2 - 3 + i, y1 + i, lc);
- }
- y1++;
- for (i = 0; i < 4; i++)
- {
- gui_draw_horizontal_line(x1 + 3 - i, x2 - 3 + i, y1 + i, c);
- }
- }
- else
- {
- y2 += 3;
- for (i = 0; i < 3; i++)
- {
- gui_draw_horizontal_line(x1 + 2 - i, x2 - 2 + i, y2 - i, bc);
- }
- for (i = 0; i < 4; i++)
- {
- gui_draw_horizontal_line(x1 + 3 - i, x2 - 3 + i, y2 - i, sc);
- }
- y2--;
- for (i = 0; i < 4; i++)
- {
- gui_draw_horizontal_line(x1 + 3 - i, x2 - 3 + i, y2 - i, c);
- }
- }
- }
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fill_left_rounded_border
- * DESCRIPTION
- * Draws a filled area with left rounded border shape
- *
- * See fillers (UI_filled_area structure)
- * PARAMETERS
- * rx1 [IN] Left-top corner of the rectangle
- * ry1 [IN] Left-top corner of the rectangle
- * rx2 [IN] Right-bottom corner of the rectangle
- * ry2 [IN] Right-bottom corner of the rectangle
- * f [IN] Is the filler to use
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fill_left_rounded_border(S32 rx1, S32 ry1, S32 rx2, S32 ry2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color filler_color = f->c;
- color border_color = f->border_color;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_draw_vertical_line(ry1, ry2, rx1 - 1, border_color);
- gui_draw_vertical_line(ry1 - 1, ry2 + 1, rx1, border_color);
- gui_draw_horizontal_line(rx1 + 5, rx2, ry1 - 6, border_color);
- gui_draw_horizontal_line(rx1 + 3, rx2, ry1 - 5, border_color);
- gui_draw_horizontal_line(rx1 + 5, rx2, ry2 + 6, border_color);
- gui_draw_horizontal_line(rx1 + 3, rx2, ry2 + 5, border_color);
- gui_draw_horizontal_line(rx1 + 1, rx2, ry1 - 1, filler_color);
- gui_draw_horizontal_line(rx1 + 2, rx2, ry1 - 2, filler_color);
- gui_draw_horizontal_line(rx1 + 3, rx2, ry1 - 3, filler_color);
- gui_draw_horizontal_line(rx1 + 4, rx2, ry1 - 4, filler_color);
- gui_draw_horizontal_line(rx1 + 1, rx2, ry2 + 1, filler_color);
- gui_draw_horizontal_line(rx1 + 2, rx2, ry2 + 2, filler_color);
- gui_draw_horizontal_line(rx1 + 3, rx2, ry2 + 3, filler_color);
- gui_draw_horizontal_line(rx1 + 4, rx2, ry2 + 4, filler_color);
- gui_putpixel(rx1, ry1 - 1, border_color);
- gui_putpixel(rx1, ry1 - 2, border_color);
- gui_putpixel(rx1 + 1, ry1 - 2, border_color);
- gui_putpixel(rx1 + 1, ry1 - 3, border_color);
- gui_putpixel(rx1 + 2, ry1 - 3, border_color);
- gui_putpixel(rx1 + 2, ry1 - 4, border_color);
- gui_putpixel(rx1 + 3, ry1 - 4, border_color);
- gui_putpixel(rx1 + 4, ry1 - 4, border_color);
- gui_putpixel(rx1 + 3, ry1 - 5, border_color);
- gui_putpixel(rx1 + 4, ry1 - 5, border_color);
- gui_putpixel(rx1, ry2 + 1, border_color);
- gui_putpixel(rx1, ry2 + 2, border_color);
- gui_putpixel(rx1 + 1, ry2 + 2, border_color);
- gui_putpixel(rx1 + 1, ry2 + 3, border_color);
- gui_putpixel(rx1 + 2, ry2 + 3, border_color);
- gui_putpixel(rx1 + 2, ry2 + 4, border_color);
- gui_putpixel(rx1 + 3, ry2 + 4, border_color);
- gui_putpixel(rx1 + 4, ry2 + 4, border_color);
- gui_putpixel(rx1 + 3, ry2 + 5, border_color);
- gui_putpixel(rx1 + 4, ry2 + 5, border_color);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fill_right_rounded_border
- * DESCRIPTION
- * Draws a filled area with right rounded border shape
- *
- * See fillers (UI_filled_area structure)
- * PARAMETERS
- * rx1 [IN] Left-top corner of the rectangle
- * ry1 [IN] Left-top corner of the rectangle
- * rx2 [IN] Right-bottom corner of the rectangle
- * ry2 [IN] Right-bottom corner of the rectangle
- * f [IN] Is the filler to use
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fill_right_rounded_border(S32 rx1, S32 ry1, S32 rx2, S32 ry2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color filler_color = f->c;
- color border_color = f->border_color;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_draw_vertical_line(ry1, ry2, rx2 + 1, border_color);
- gui_draw_vertical_line(ry1 - 1, ry2 + 1, rx2, border_color);
- gui_draw_horizontal_line(rx1, rx2 - 5, ry1 - 6, border_color);
- gui_draw_horizontal_line(rx1, rx2 - 3, ry1 - 5, border_color);
- gui_draw_horizontal_line(rx1, rx2 - 5, ry2 + 6, border_color);
- gui_draw_horizontal_line(rx1, rx2 - 3, ry2 + 5, border_color);
- gui_draw_horizontal_line(rx1, rx2 - 1, ry1 - 1, filler_color);
- gui_draw_horizontal_line(rx1, rx2 - 2, ry1 - 2, filler_color);
- gui_draw_horizontal_line(rx1, rx2 - 3, ry1 - 3, filler_color);
- gui_draw_horizontal_line(rx1, rx2 - 4, ry1 - 4, filler_color);
- gui_draw_horizontal_line(rx1, rx2 - 1, ry2 + 1, filler_color);
- gui_draw_horizontal_line(rx1, rx2 - 2, ry2 + 2, filler_color);
- gui_draw_horizontal_line(rx1, rx2 - 3, ry2 + 3, filler_color);
- gui_draw_horizontal_line(rx1, rx2 - 4, ry2 + 4, filler_color);
- gui_putpixel(rx2, ry1 - 1, border_color);
- gui_putpixel(rx2, ry1 - 2, border_color);
- gui_putpixel(rx2 - 1, ry1 - 2, border_color);
- gui_putpixel(rx2 - 1, ry1 - 3, border_color);
- gui_putpixel(rx2 - 2, ry1 - 3, border_color);
- gui_putpixel(rx2 - 2, ry1 - 4, border_color);
- gui_putpixel(rx2 - 3, ry1 - 4, border_color);
- gui_putpixel(rx2 - 4, ry1 - 4, border_color);
- gui_putpixel(rx2 - 3, ry1 - 5, border_color);
- gui_putpixel(rx2 - 4, ry1 - 5, border_color);
- gui_putpixel(rx2, ry2 + 1, border_color);
- gui_putpixel(rx2, ry2 + 2, border_color);
- gui_putpixel(rx2 - 1, ry2 + 2, border_color);
- gui_putpixel(rx2 - 1, ry2 + 3, border_color);
- gui_putpixel(rx2 - 2, ry2 + 3, border_color);
- gui_putpixel(rx2 - 2, ry2 + 4, border_color);
- gui_putpixel(rx2 - 3, ry2 + 4, border_color);
- gui_putpixel(rx2 - 4, ry2 + 4, border_color);
- gui_putpixel(rx2 - 3, ry2 + 5, border_color);
- gui_putpixel(rx2 - 4, ry2 + 5, border_color);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_draw_filled_area
- * DESCRIPTION
- * Draws a filled area
- *
- * See fillers (UI_filled_area structure)
- * PARAMETERS
- * x1 [IN] Left-top corner of the rectangle
- * y1 [IN] Left-top corner of the rectangle
- * x2 [IN] Right-bottom corner of the rectangle
- * y2 [IN] Right-bottom corner of the rectangle
- * f [IN] Is the filler to use
- * RETURNS
- * void
- *****************************************************************************/
- void gui_draw_filled_area(S32 x1, S32 y1, S32 x2, S32 y2, UI_filled_area *f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 rx1 = x1, ry1 = y1, rx2 = x2, ry2 = y2;
- U32 flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (f == NULL)
- {
- return;
- }
- flags = f->flags;
- if ((flags & UI_FILLED_AREA_DOUBLE_BORDER) == UI_FILLED_AREA_DOUBLE_BORDER)
- {
- rx1 += 2;
- rx2 -= 2;
- ry1 += 2;
- ry2 -= 2;
- if (flags & UI_FILLED_AREA_NO_VERTICAL_LINE)
- {
- rx1 -= 2;
- rx2 += 2;
- }
- }
- else if (flags & UI_FILLED_AREA_SINGLE_BORDER)
- {
- rx1 += 1;
- rx2 -= 1;
- ry1 += 1;
- ry2 -= 1;
- if (flags & UI_FILLED_AREA_NO_VERTICAL_LINE)
- {
- rx1 -= 1;
- rx2 += 1;
- }
- }
- if (flags & UI_FILLED_AREA_LEFT_ROUNDED_BORDER)
- {
- rx1 += 2;
- ry1 += 6;
- ry2 -= 6;
- }
- else if (flags & UI_FILLED_AREA_RIGHT_ROUNDED_BORDER)
- {
- rx2 -= 2;
- ry1 += 6;
- ry2 -= 6;
- }
- switch (flags & 0x0ff)
- {
- case UI_FILLED_AREA_TYPE_COLOR:
- #if defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__) /* 072505 Calvin modified */
- if (flags & UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR)
- {
- gui_transparent_color_filler(rx1, ry1, rx2, ry2, f->c); /* For transparent color filler */
- }
- else
- #endif /* defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__) */
- {
- gui_fill_rectangle(rx1, ry1, rx2, ry2, f->c);
- }
- break;
-
- case UI_FILLED_AREA_TYPE_GRADIENT_COLOR:
- gui_gradient_fill_rectangle(rx1, ry1, rx2, ry2, f->gc, flags);
- break;
-
- case UI_FILLED_AREA_TYPE_TEXTURE:
- if (f->transparent_color != UI_NULL_TRANSPARENT_COLOR)
- {
- gui_transparent_texture_fill_rectangle(rx1, ry1, rx2, ry2, f->b, f->transparent_color);
- }
- else
- {
- gui_texture_fill_rectangle(rx1, ry1, rx2, ry2, f->b);
- }
- break;
-
- case UI_FILLED_AREA_TYPE_BITMAP:
- gui_push_clip();
- gui_set_clip_preset(x1, y1, x2, y2);
- if (f->transparent_color != UI_NULL_TRANSPARENT_COLOR)
- {
- gui_show_transparent_image(x1, y1, f->b, f->transparent_color);
- }
- else
- {
- gui_show_image(x1, y1, f->b);
- }
- gui_pop_clip();
- break;
-
- case UI_FILLED_AREA_TYPE_HATCH_COLOR:
- gui_hatch_fill_rectangle(rx1, ry1, rx2, ry2, f->c);
- break;
-
- case UI_FILLED_AREA_TYPE_ALTERNATE_HATCH_COLOR:
- gui_alternate_hatch_fill_rectangle(rx1, ry1, rx2, ry2, f->c, f->ac);
- break;
-
- case UI_FILLED_AREA_TYPE_CROSS_HATCH_COLOR:
- gui_cross_hatch_fill_rectangle(rx1, ry1, rx2, ry2, f->c);
- break;
-
- case UI_FILLED_AREA_TYPE_ALTERNATE_CROSS_HATCH_COLOR:
- gui_alternate_cross_hatch_fill_rectangle(rx1, ry1, rx2, ry2, f->c, f->ac);
- break;
-
- case UI_FILLED_AREA_TYPE_CUSTOM_FILL_TYPE1:
- gui_custom_fill_area_type1and2(rx1, ry1, rx2, ry2, f);
- break;
-
- case UI_FILLED_AREA_TYPE_CUSTOM_FILL_TYPE2:
- gui_custom_fill_area_type1and2(rx1, ry1, rx2, ry2, f);
- break;
-
- case UI_FILLED_AREA_TYPE_3D_BORDER:
- gui_custom_fill_area_type2(rx1, ry1, rx2, ry2, f);
- break;
- }
- if (flags & UI_FILLED_AREA_LEFT_ROUNDED_BORDER)
- {
- gui_fill_left_rounded_border(rx1, ry1, rx2, ry2, f);
- }
- else if (flags & UI_FILLED_AREA_RIGHT_ROUNDED_BORDER)
- {
- gui_fill_right_rounded_border(rx1, ry1, rx2, ry2, f);
- }
- if (flags & UI_FILLED_AREA_BORDER) /* if border flag is set */
- {
- color border_color = f->border_color; /* border color */
- if ((flags & UI_FILLED_AREA_DOUBLE_BORDER) == UI_FILLED_AREA_DOUBLE_BORDER)
- {
- if (flags & UI_FILLED_AREA_3D_BORDER)
- {
- /* outer border light color */
- color filled_area_outer_light_border = current_filled_area_border_theme->filled_area_outer_light_border;
- /* inner border light color */
- color filled_area_inner_light_border = current_filled_area_border_theme->filled_area_inner_light_border;
- /* outer border dark color */
- color filled_area_outer_dark_border = current_filled_area_border_theme->filled_area_outer_dark_border;
- /* inner border dark color */
- color filled_area_inner_dark_border = current_filled_area_border_theme->filled_area_inner_dark_border;
- if (flags & UI_FILLED_AREA_ROUNDED_BORDER) /* if round border is set */
- {
- #if !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__)
- if (flags & UI_FILLED_AREA_ELEVATED_BORDER)
- {
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, filled_area_outer_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1 + 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1 + 1, filled_area_inner_light_border);
- gui_putpixel(x1 + 1, y1 + 1, filled_area_outer_light_border);
- gui_putpixel(x1 + 1, y2 - 1, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2 - 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, filled_area_outer_dark_border);
- gui_putpixel(x2 - 1, y1 + 1, filled_area_outer_light_border);
- gui_putpixel(x2 - 1, y2 - 1, filled_area_outer_dark_border);
- }
- else
- {
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, filled_area_outer_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1 + 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1 + 1, filled_area_inner_dark_border);
- gui_putpixel(x1 + 1, y1 + 1, filled_area_outer_dark_border);
- gui_putpixel(x1 + 1, y2 - 1, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2 - 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, filled_area_outer_light_border);
- gui_putpixel(x2 - 1, y1 + 1, filled_area_outer_dark_border);
- gui_putpixel(x2 - 1, y2 - 1, filled_area_outer_light_border);
- }
- #else /* !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__) */
- if (flags & UI_FILLED_AREA_ELEVATED_BORDER)
- {
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, filled_area_outer_light_border);
- /* draw vertical line */
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1 + 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1 + 1, filled_area_inner_light_border);
- gui_putpixel(x1 + 1, y1 + 1, filled_area_outer_light_border);
- gui_putpixel(x1 + 1, y2 - 1, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2 - 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, filled_area_outer_dark_border);
- gui_putpixel(x2 - 1, y1 + 1, filled_area_outer_light_border);
- gui_putpixel(x2 - 1, y2 - 1, filled_area_outer_dark_border);
- gui_putpixel(x1 + 2, y1 + 2, filled_area_inner_light_border); /* Single Pixel Line To Fill Left Upper Corner */
- gui_putpixel(x2 - 2, y1 + 2, filled_area_inner_light_border); /* Single Pixel Line To Fill Left Bottom Corner */
- gui_putpixel(x1 + 2, y2 - 2, filled_area_inner_dark_border); /* Single Pixel Line To Fill Right Upper Corner */
- gui_putpixel(x2 - 2, y2 - 2, filled_area_inner_dark_border); /* Single Pixel Line To Fill Right Bottom Corner */
- }
- else
- {
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, filled_area_outer_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1 + 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1 + 1, filled_area_inner_dark_border);
- gui_putpixel(x1 + 1, y1 + 1, filled_area_outer_dark_border);
- gui_putpixel(x1 + 1, y2 - 1, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2 - 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, filled_area_outer_light_border);
- gui_putpixel(x2 - 1, y1 + 1, filled_area_outer_dark_border);
- gui_putpixel(x2 - 1, y2 - 1, filled_area_outer_light_border);
- gui_putpixel(x1 + 2, y1 + 2, filled_area_inner_dark_border); /* Single Pixel Line To Fill Left Upper Corner */
- gui_putpixel(x2 - 2, y1 + 2, filled_area_inner_dark_border); /* Single Pixel Line To Fill Left Bottom Corner */
- gui_putpixel(x1 + 2, y2 - 2, filled_area_inner_light_border); /* Single Pixel Line To Fill Right Upper Corner */
- gui_putpixel(x2 - 2, y2 - 2, filled_area_inner_light_border); /* Single Pixel Line To Fill Right Bottom Corner */
- }
- #endif /* !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__) */
- }
- else
- {
- if (flags & UI_FILLED_AREA_ELEVATED_BORDER) /* if elevated border is set */
- {
- gui_draw_horizontal_line(x1, x2, y1, filled_area_outer_light_border);
- gui_draw_vertical_line(y1 + 1, y2, x1, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y1 + 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 1, x1 + 1, filled_area_inner_light_border);
- gui_draw_horizontal_line(x1 + 1, x2, y2, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 1, y2 - 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, filled_area_outer_dark_border);
- }
- else
- {
- gui_draw_horizontal_line(x1, x2, y1, filled_area_outer_dark_border);
- gui_draw_vertical_line(y1 + 1, y2, x1, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y1 + 1, filled_area_inner_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 1, x1 + 1, filled_area_inner_dark_border);
- gui_draw_horizontal_line(x1 + 1, x2, y2, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 1, y2 - 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, filled_area_inner_light_border);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, filled_area_outer_light_border);
- }
- }
- }
- else
- {
- if (flags & UI_FILLED_AREA_ROUNDED_BORDER) /* if round border is set */
- { /* Pixtel - Gurinder 1/21/04 - Added code to support double pixel rounded corner. */
- #if !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__)
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, border_color);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y1 + 1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1 + 1, border_color);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, border_color);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y2 - 1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, border_color);
- #else /* !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__) */
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, border_color);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y1 + 1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1 + 1, border_color);
- gui_putpixel(x1 + 2, y1 + 2, border_color); /* Single Pixel Line To Fill Left Upper Corner */
- gui_putpixel(x2 - 2, y1 + 2, border_color); /* Single Pixel Line To Fill Left Bottom Corner */
- gui_putpixel(x1 + 2, y2 - 2, border_color); /* Single Pixel Line To Fill Right Upper Corner */
- gui_putpixel(x2 - 2, y2 - 2, border_color); /* Single Pixel Line To Fill Right Bottom Corner */
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, border_color);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y2 - 1, border_color);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, border_color);
- #endif /* !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__) */
- }
- else
- {
- if (flags & UI_FILLED_AREA_NO_VERTICAL_LINE)
- {
- gui_draw_horizontal_line(x1, x2, y1, border_color);
- gui_draw_horizontal_line(x1, x2, y1 + 1, border_color);
- gui_draw_horizontal_line(x1, x2, y2, border_color);
- gui_draw_horizontal_line(x1, x2, y2 - 1, border_color);
- }
- else
- {
- gui_draw_horizontal_line(x1, x2, y1, border_color);
- gui_draw_vertical_line(y1 + 1, y2, x1, border_color);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y1 + 1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 1, x1 + 1, border_color);
- gui_draw_horizontal_line(x1 + 1, x2, y2, border_color);
- gui_draw_horizontal_line(x1 + 2, x2 - 1, y2 - 1, border_color);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2 - 1, border_color);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, border_color);
- }
- }
- }
- }
- else
- {
- if (flags & UI_FILLED_AREA_3D_BORDER) /* if 3d border is set */
- {
- color filled_area_outer_light_border = current_filled_area_border_theme->filled_area_outer_light_border;
- color filled_area_outer_dark_border = current_filled_area_border_theme->filled_area_outer_dark_border;
- if (flags & UI_FILLED_AREA_ROUNDED_BORDER)
- {
- #if !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__)
- if (flags & UI_FILLED_AREA_ELEVATED_BORDER)
- {
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y1, filled_area_outer_light_border);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x1, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y2, filled_area_outer_dark_border);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, filled_area_outer_dark_border);
- }
- else
- {
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y1, filled_area_outer_dark_border);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x1, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y2, filled_area_outer_light_border);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, filled_area_outer_light_border);
- }
- #else /* !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__) */
- if (flags & UI_FILLED_AREA_ELEVATED_BORDER)
- {
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, filled_area_outer_light_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, filled_area_outer_light_border);
- gui_putpixel(x1 + 1, y1 + 1, filled_area_outer_light_border); /* Single Pixel Line To Fill Left Upper Corner */
- gui_putpixel(x2 - 1, y1 + 1, filled_area_outer_light_border); /* Single Pixel Line To Fill Left Bottom Corner */
- gui_putpixel(x1 + 1, y2 - 1, filled_area_outer_dark_border); /* Single Pixel Line To Fill Right Upper Corner */
- gui_putpixel(x2 - 1, y2 - 1, filled_area_outer_dark_border); /* Single Pixel Line To Fill Right Bottom Corner */
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, filled_area_outer_dark_border);
- }
- else
- {
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, filled_area_outer_dark_border);
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, filled_area_outer_dark_border);
- gui_putpixel(x1 + 1, y1 + 1, filled_area_outer_dark_border); /* Single Pixel Line To Fill Left Upper Corner */
- gui_putpixel(x2 - 1, y1 + 1, filled_area_outer_dark_border); /* Single Pixel Line To Fill Left Bottom Corner */
- gui_putpixel(x1 + 1, y2 - 1, filled_area_outer_light_border); /* Single Pixel Line To Fill Right Upper Corner */
- gui_putpixel(x2 - 1, y2 - 1, filled_area_outer_light_border); /* Single Pixel Line To Fill Right Bottom Corner */
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, filled_area_outer_light_border);
- }
- #endif /* !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__) */
- }
- else
- {
- if (flags & UI_FILLED_AREA_ELEVATED_BORDER)
- {
- gui_draw_horizontal_line(x1, x2, y1, filled_area_outer_light_border);
- gui_draw_vertical_line(y1, y2, x1, filled_area_outer_light_border);
- gui_draw_horizontal_line(x1 + 1, x2, y2, filled_area_outer_dark_border);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, filled_area_outer_dark_border);
- }
- else
- {
- if (flags & UI_FILLED_AREA_NO_VERTICAL_LINE)
- {
- gui_draw_horizontal_line(x1, x2, y1, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1, x2, y2, filled_area_outer_light_border);
- }
- else
- {
- gui_draw_horizontal_line(x1, x2, y1, filled_area_outer_dark_border);
- gui_draw_vertical_line(y1, y2, x1, filled_area_outer_dark_border);
- gui_draw_horizontal_line(x1 + 1, x2, y2, filled_area_outer_light_border);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, filled_area_outer_light_border);
- }
- }
- }
- }
- else
- {
- if (flags & UI_FILLED_AREA_ROUNDED_BORDER)
- {
- #if !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__)
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y1, border_color);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x1, border_color);
- gui_draw_horizontal_line(x1 + 1, x2 - 1, y2, border_color);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, border_color);
- #else /* !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__) */
- gui_draw_vertical_line(y1 + 2, y2 - 2, x1, border_color);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y1, border_color); /* Line Next To Upper Line */
- gui_putpixel(x1 + 1, y1 + 1, border_color); /* Line Next To Upper Line */
- gui_putpixel(x2 - 1, y1 + 1, border_color); /* Line Next To Upper Line */
- gui_putpixel(x1 + 1, y2 - 1, border_color); /* Lower Edge */
- gui_putpixel(x2 - 1, y2 - 1, border_color); /* Ipx above lower edge */
- gui_draw_vertical_line(y1 + 2, y2 - 2, x2, border_color);
- gui_draw_horizontal_line(x1 + 2, x2 - 2, y2, border_color); /* Line Next To Upper Line */
- #endif /* !defined(__MMI_PLUTO_DOUBLEPX_ROUND_CORNER__) */
- }
- else
- {
- gui_draw_horizontal_line(x1, x2, y1, border_color);
- gui_draw_vertical_line(y1, y2, x1, border_color);
- gui_draw_horizontal_line(x1 + 1, x2, y2, border_color);
- gui_draw_vertical_line(y1 + 1, y2 - 1, x2, border_color);
- }
- }
- }
- }
- if (flags & UI_FILLED_AREA_SHADOW)
- {
- gui_shadow_filled_area(x1, y1, x2, y2, f);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_print_truncated_text
- * DESCRIPTION
- * Print truncated text with no border .
- *
- * If length of text is greater than
- * screen width then the text is truncated . Three dots are shown at end of text
- * PARAMETERS
- * x [IN] Start x positoin
- * y [IN] Start Y position
- * xwidth [IN] Width of text in pixels to display
- * st [IN] Text to display
- * RETURNS
- * void
- *****************************************************************************/
- void gui_print_truncated_text(S32 x, S32 y, S32 xwidth, UI_string_type st)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 sw, sh;
- #if defined(__MMI_LANG_VIETNAMESE__)
- viet_tone_mark tone_mark = VIET_TONE_NONE;
- viet_vowel_letter viet_vowel = VIET_VOWEL_NONE;
- UI_character_type dummy_c = 0;
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- UI_string_type s;
- #ifdef __MMI_BIDI_ALG__
- S32 nLen;
- #endif
- #ifdef __MMI_HINDI_ALG__
- U16 glyph_output[G_MAX];
- S32 cluster_length = 0;
- U16 cluster_fill[G_MAX];
- S8 hf_flag = TRUE;
- PU16 hf_text_p;
- S32 hf_len = 0;
- U16 *hf_string;
- U16 *hf_string_p;
- S32 hf_total_len = 0;
- #endif /* __MMI_HINDI_ALG__ */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_HINDI_ALG__
- hf_len = UCS2Strlen((const char*)st);
- hf_string_p = st;
- hf_string = (U16*) OslMalloc((hf_len + 1) * 2);
- while (hf_len--)
- {
- if (HF_HINDI_RANGE(*hf_string_p))
- {
- hf_string_p++;
- hf_flag = FALSE;
- break;
- }
- }
- if (!hf_flag)
- {
- hf_text_p = st;
- hf_string_p = hf_string;
- init_cluster_start_p((PU8) hf_text_p);
- init_cluster_end_p((PU8) hf_text_p);
- do
- {
- cluster_length = hf_get_cluster(cluster_fill);
- if (cluster_length)
- {
- hf_hindi_rules(glyph_output, cluster_fill, cluster_length);
- hf_len = UCS2Strlen((const S8*)glyph_output);
- hf_text_p += cluster_length;
- memcpy(hf_string_p, glyph_output, hf_len * 2);
- hf_string_p += hf_len;
- hf_total_len += hf_len;
- }
- } while (cluster_length);
- *hf_string_p = (U16) NULL;
- s = hf_string;
- }
- else
- #endif /* __MMI_HINDI_ALG__ */
- {
- s = st;
- }
- #ifdef __MMI_BIDI_ALG__
- nLen = UCS2Strlen((const char*)s);
- MMI_ASSERT(!(nLen > MAX_TEXT_LENGTH - ENCODING_LENGTH));
- UCS2Strcpy((S8*) pwcWord, (S8*) s);
- nLen = UCS2Strlen((const char*)pwcWord);
- #if defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__)
- #if defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__)
- if (nLen)
- {
- #ifdef __MMI_ZI_V7__
- /* PMT START PERSIAN */
- #if defined(__MMI_ZI_PERSIAN__) && defined(__MMI_ZI_ARABIC__)
- ZiStringShape(ZI8_LANG_FA, (U16*) & nLen, pwcWord);
- #elif defined (__MMI_ZI_PERSIAN__)
- ZiStringShape(ZI8_LANG_FA, (U16*) & nLen, pwcWord);
- #elif defined (__MMI_ZI_ARABIC__)
- ZiStringShape(ZI8_LANG_AR, (U16*) & nLen, pwcWord);
- #endif
- /* PMT END PERSIAN */
- #else /* __MMI_ZI_V7__ */
- ArabicStringShape((U16*) & nLen, pwcWord); /* output will replace the input string after returning */
- #endif /* __MMI_ZI_V7__ */
- }
- #else /* defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__) */
- if (nLen)
- {
- ArabicShapeEngine((U16*) & nLen, pwcWord); /* output will replace the input string after returning */
- }
- #endif /* defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__) */
- #endif /* defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__) */
- s = pwcWord;
- #endif /* __MMI_BIDI_ALG__ */
- gui_measure_string(s, &sw, &sh);
-
- if (sw > xwidth)
- {
- UI_character_type es[] = { '.', '.', ' ' };
- UI_character_type c;
- U8 done = 0;
- UI_buffer_type text_p, last_p, previous_p;
- S32 ew, lh, cw, ch, total_width, w;
- U8* text=(U8*)s;
- //U8 text[512]; /* =(U8*)UI_temp_buffer; */
- /* get string width */
- ew = gui_get_string_width((UI_string_type) es);
- //gui_strcpy((UI_string_type) text, s);
- text_p = (U8*) text;
- last_p = (U8*) text;
- total_width = lh = 0;
- //w = xwidth - ew + 4;//082406 truncate
- w = xwidth - ew;
- #ifdef __MMI_LANG_THAI__
- if (HaveThaiCharacter(s))
- {
- //If the length of string is too long to show and it has Thai characters,we need to process this string in different way
- //The defect of this way is that it need to process the string two times(maybe more) and if the string is too long,it may waaste a lot of time.
- int i = 1;
- gui_measure_string_n(s, i, &sw, &sh);
- while (sw < w)
- {
- i++;
- gui_measure_string_n(s, i, &sw, &sh);
- }
- gui_move_text_cursor(x, y);
- gui_print_text_n((UI_string_type) s, i - 1);
- gui_measure_string_n(s, i - 1, &sw, &sh);
- gui_move_text_cursor(x + sw, y);
- gui_print_bordered_text((UI_string_type) es);
- return;
- }
- #endif /* __MMI_LANG_THAI__ */
- /* First pass: find the last displayable character and the string dimensions */
- while (!done)
- {
- previous_p = text_p;
- UI_STRING_GET_NEXT_CHARACTER(text_p, c); /* get next character in c , and point the pointer text_p to next character */
- /* This function is not designed for multi-line */
- if (c == (UI_character_type) 'n')
- {
- c = (UI_character_type) ' ';
- }
- #if defined(__MMI_LANG_VIETNAMESE__)
- if ((c > 0x0040) && (c < 0x01B1))
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, dummy_c); /* get next character */
- tone_mark = mmi_viet_tone_mark(dummy_c);
- if (VIET_TONE_NONE != tone_mark)
- {
- viet_vowel = mmi_viet_vowel_letter(c);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- c = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- gui_measure_character(c, &cw, &ch); /* measure width of character in pixels */
- if (UI_STRING_LINE_BREAK_CHARACTER(c) || UI_STRING_END_OF_STRING_CHARACTER(c)) /* check for end or space */
- {
- last_p = previous_p;
- break;
- }
- if ((total_width + cw) > w)
- {
- last_p = previous_p;
- break;
- }
- if (ch > lh)
- {
- lh = ch;
- }
- total_width += cw;
- }
- /* Second pass: display the text */
- text_p = (U8*) text;
- while (text_p != last_p)
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, c);
- #if defined(__MMI_LANG_VIETNAMESE__)
- if ((c > 0x0040) && (c < 0x01B1))
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, dummy_c); /* get next character */
- tone_mark = mmi_viet_tone_mark(dummy_c);
- if (VIET_TONE_NONE != tone_mark)
- {
- viet_vowel = mmi_viet_vowel_letter(c);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- c = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- gui_measure_character(c, &cw, &ch);
- gui_move_text_cursor(x, y + lh - ch);
- gui_print_character(c);
- if (r2lMMIFlag)
- {
- x -= cw;
- }
- else
- {
- x += cw;
- }
- }
- gui_measure_character((UI_character_type) es[0], &cw, &ch);
- gui_move_text_cursor(x, y + lh - ch); /* move cursor to particular position x,y */
- gui_print_text((UI_string_type) es); /* print text */
- }
- else
- {
- gui_move_text_cursor(x, y); /* move cursor to x,y position */
- #ifdef __MMI_HINDI_ALG__
- hf_disable_hindi_rules_parsing(); /* vj */
- gui_print_text(s); /* print text //vj */
- hf_enable_hindi_rules_parsing(); /* vj */
- #else /* __MMI_HINDI_ALG__ */
- gui_print_text(s); /* print text */
- #endif /* __MMI_HINDI_ALG__ */
- }
- #ifdef __MMI_HINDI_ALG__
- OslMfree(hf_string);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * gui_print_truncated_borderd_text
- * DESCRIPTION
- * Print truncated text border .
- *
- * If length of text is greater than
- * screen width then the text is truncated . Three dots are shown at end of text
- * PARAMETERS
- * x [IN] Start x positoin
- * y [IN] Start Y position
- * xwidth [IN] Width of text in pixels to display
- * st [IN] Text to display
- * RETURNS
- * void
- *****************************************************************************/
- void gui_print_truncated_borderd_text(S32 x, S32 y, S32 xwidth, UI_string_type st)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 sw, sh;
- #if defined(__MMI_LANG_VIETNAMESE__)
- viet_tone_mark tone_mark = VIET_TONE_NONE;
- viet_vowel_letter viet_vowel = VIET_VOWEL_NONE;
- UI_character_type dummy_c;
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- UI_string_type s = st;
- #ifdef __MMI_HINDI_ALG__
- S32 border_hindi = 1;
- U16 glyph_output[G_MAX];
- S32 cluster_length = 0;
- U16 cluster_fill[G_MAX];
- S8 hf_flag = TRUE;
- PU16 hf_text_p;
- S32 hf_len = 0;
- U16 *hf_string;
- U16 *hf_string_p;
- S32 hf_total_len = 0;
- #endif /* __MMI_HINDI_ALG__ */
- #ifdef __MMI_BIDI_ALG__
- S32 nLen;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_HINDI_ALG__
- hf_len = UCS2Strlen((const char*)st);
- hf_string_p = st;
- hf_string = (U16*) OslMalloc((hf_len + 1) * 2);
- while (hf_len--)
- {
- if (HF_HINDI_RANGE(*hf_string_p))
- {
- hf_string_p++;
- hf_flag = FALSE;
- break;
- }
- }
- if (!hf_flag)
- {
- hf_text_p = st;
- hf_string_p = hf_string;
- init_cluster_start_p((PU8) hf_text_p);
- init_cluster_end_p((PU8) hf_text_p);
- do
- {
- cluster_length = hf_get_cluster(cluster_fill);
- if (cluster_length)
- {
- hf_hindi_rules(glyph_output, cluster_fill, cluster_length);
- hf_len = UCS2Strlen((const S8*)glyph_output);
- hf_text_p += cluster_length;
- memcpy(hf_string_p, glyph_output, hf_len * 2);
- hf_string_p += hf_len;
- hf_total_len += hf_len;
- }
- } while (cluster_length);
- *hf_string_p = (U16) NULL;
- s = hf_string;
- }
- else
- #endif /* __MMI_HINDI_ALG__ */
- {
- s = st;
- }
- #ifdef __MMI_BIDI_ALG__
- nLen = UCS2Strlen((const char*)s);
- MMI_ASSERT(!(nLen > MAX_TEXT_LENGTH - ENCODING_LENGTH));
- UCS2Strcpy((S8*) pwcWord, (S8*) s);
- nLen = UCS2Strlen((const char*)pwcWord);
- #if defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__)
- #if defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__)
- if (nLen)
- {
- #ifdef __MMI_ZI_V7__
- /* PMT START PERSIAN */
- #if defined(__MMI_ZI_PERSIAN__) && defined(__MMI_ZI_ARABIC__)
- ZiStringShape(ZI8_LANG_FA, (U16*) & nLen, pwcWord);
- #elif defined (__MMI_ZI_PERSIAN__)
- ZiStringShape(ZI8_LANG_FA, (U16*) & nLen, pwcWord);
- #elif defined (__MMI_ZI_ARABIC__)
- ZiStringShape(ZI8_LANG_AR, (U16*) & nLen, pwcWord);
- #endif
- /* PMT END PERSIAN */
- #else /* __MMI_ZI_V7__ */
- ArabicStringShape((U16*) & nLen, pwcWord); /* output will replace the input string after returning */
- #endif /* __MMI_ZI_V7__ */
- }
- #else /* defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__) */
- if (nLen)
- {
- ArabicShapeEngine((U16*) & nLen, pwcWord); /* output will replace the input string after returning */
- }
- #endif /* defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__) */
- #endif /* defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__) */
- s = pwcWord;
- #endif /* __MMI_BIDI_ALG__ */
- gui_measure_string(s, &sw, &sh);
- if (sw > xwidth)
- {
- UI_character_type es[] = { '.', '.', ' ' };
- UI_character_type c;
- U8 done = 0;
- UI_buffer_type text_p, last_p, previous_p;
- S32 ew, lh, cw, ch, total_width, w;
- U8* text=(U8*)s;
- //U8 text[512]; /* =(U8*)UI_temp_buffer; */
- ew = gui_get_string_width((UI_string_type) es); /* get string width in pixels */
- //gui_strcpy((UI_string_type) text, s);
- text_p = (U8*) text;
- last_p = (U8*) text;
- total_width = lh = 0;
- //Adding the width of 4 will cause error as we don't have space for two dots.
- //w=xwidth-ew+4;
- w = xwidth - ew - 2;
- #ifdef __MMI_LANG_THAI__
- if (HaveThaiCharacter(s))
- {
- //If the length of string is too long to show and it has Thai characters,we need to process this string in different way
- //The defect of this way is that it need to process the string two times(maybe more) and if the string is too long,it may waaste a lot of time.
- int i = 1;
- gui_measure_string_n(s, i, &sw, &sh);
- while (sw < w)
- {
- i++;
- gui_measure_string_n(s, i, &sw, &sh);
- }
- gui_move_text_cursor(x, y);
- gui_print_bordered_text_n((UI_string_type) s, i - 1);
- gui_measure_string_n(s, i - 1, &sw, &sh);
- gui_move_text_cursor(x + sw, y);
- gui_print_bordered_text((UI_string_type) es);
- return;
- }
- #endif /* __MMI_LANG_THAI__ */
- /* First pass: find the last displayable character and the string dimensions */
- while (!done)
- {
- previous_p = text_p;
- UI_STRING_GET_NEXT_CHARACTER(text_p, c);
- /* This function is not designed for multi-line */
- if (c == (UI_character_type) 'n')
- {
- c = (UI_character_type) ' ';
- }
- #if defined(__MMI_LANG_VIETNAMESE__)
- if ((c > 0x0040) && (c < 0x01B1))
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, dummy_c); /* get next character */
- tone_mark = mmi_viet_tone_mark(dummy_c);
- if (VIET_TONE_NONE != tone_mark)
- {
- viet_vowel = mmi_viet_vowel_letter(c);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- c = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- gui_measure_character(c, &cw, &ch); /* measure width of character in pixels */
- if (UI_STRING_LINE_BREAK_CHARACTER(c) || UI_STRING_END_OF_STRING_CHARACTER(c))
- {
- last_p = previous_p;
- break;
- }
- if ((total_width + cw) > w)
- {
- last_p = previous_p;
- break;
- }
- if (ch > lh)
- {
- lh = ch;
- }
- total_width += cw;
- }
- /* Second pass: display the text */
- text_p = (U8*) text;
- {
- U8 no_of_chars = (last_p - text_p) / ENCODING_LENGTH;
- U8 *string_to_be_reversed;
- U8 *orginal_string_to_be_reversed;
- orginal_string_to_be_reversed = OslMalloc((no_of_chars + 4) * ENCODING_LENGTH);
- string_to_be_reversed = orginal_string_to_be_reversed;
- UCS2Strncpy((char*)orginal_string_to_be_reversed, (const char*)text_p, no_of_chars);
- string_to_be_reversed += (no_of_chars * ENCODING_LENGTH);
- /* Add .. in the end */
- *string_to_be_reversed++ = '.';
- *(string_to_be_reversed++) = ' ';
- *string_to_be_reversed++ = '.';
- *(string_to_be_reversed++) = ' ';
- /* Add NULL in the end */
- *string_to_be_reversed++ = ' ';
- *string_to_be_reversed++ = ' ';
- gui_measure_character((UI_character_type) es[0], &cw, &ch);
- gui_move_text_cursor(x, y);
- gui_print_bordered_text((UI_string_type) orginal_string_to_be_reversed);
- OslMfree(orginal_string_to_be_reversed);
- }
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #if defined(__MMI_LANG_VIETNAMESE__)
- /* 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 !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif
- /* under construction !*/
- /* under construction !*/
- #if defined(__MMI_HINDI_ALG__)
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif
- /* 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 */
- }
- else
- {
- gui_move_text_cursor(x, y);
- #ifdef __MMI_HINDI_ALG__
- hf_disable_hindi_rules_parsing(); /* vj */
- gui_print_bordered_text(s); /* vj */
- hf_enable_hindi_rules_parsing(); /* vj */
- #else /* __MMI_HINDI_ALG__ */
- gui_print_bordered_text(s); /* vj */
- #endif /* __MMI_HINDI_ALG__ */
- }
- #ifdef __MMI_HINDI_ALG__
- OslMfree(hf_string);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * gui_print_truncated_text2
- * DESCRIPTION
- * Displays truncated text (Does not display ...)
- * PARAMETERS
- * x [IN] Top left corner of text display
- * y [IN] Top left corner of text display
- * xwidth [IN] Width (in pixels) available for text display
- * ss [IN] Text to be displayed
- * RETURNS
- * Non-zero if the complete string was displayed
- * zero if the complete string could not be displayed
- *****************************************************************************/
- U8 gui_print_truncated_text2(S32 x, S32 y, S32 xwidth, UI_string_type *ss)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 sw, sh;
- #if defined(__MMI_LANG_VIETNAMESE__)
- viet_tone_mark tone_mark = VIET_TONE_NONE;
- viet_vowel_letter viet_vowel = VIET_VOWEL_NONE;
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- #ifdef __MMI_BIDI_ALG__
- S32 nLen;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_BIDI_ALG__
- nLen = UCS2Strlen((const char*)ss);
- MMI_ASSERT(!(nLen > MAX_TEXT_LENGTH - ENCODING_LENGTH));
- UCS2Strcpy((S8*) pwcWord, (S8*) ss);
- nLen = UCS2Strlen((const char*)pwcWord);
- #if defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__)
- #if defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__)
- if (nLen)
- {
- #ifdef __MMI_ZI_V7__
- /* PMT START PERSIAN */
- #if defined(__MMI_ZI_PERSIAN__) && defined(__MMI_ZI_ARABIC__)
- ZiStringShape(ZI8_LANG_FA, (U16*) & nLen, pwcWord);
- #elif defined (__MMI_ZI_PERSIAN__)
- ZiStringShape(ZI8_LANG_FA, (U16*) & nLen, pwcWord);
- #elif defined (__MMI_ZI_ARABIC__)
- ZiStringShape(ZI8_LANG_AR, (U16*) & nLen, pwcWord);
- #endif
- /* PMT END PERSIAN */
- #else /* __MMI_ZI_V7__ */
- ArabicStringShape((U16*) & nLen, pwcWord); /* output will replace the input string after returning */
- #endif /* __MMI_ZI_V7__ */
- }
- #else /* defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__) */
- if (nLen)
- {
- ArabicShapeEngine((U16*) & nLen, pwcWord); /* output will replace the input string after returning */
- }
- #endif /* defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__) */
- #endif /* defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__) */
- ss = (UI_string_type*) pwcWord;
- #endif /* __MMI_BIDI_ALG__ */
- gui_measure_string(*ss, &sw, &sh);
- if (sw > xwidth)
- {
- UI_character_type c, dummy_c;
- U8 done = 0;
- UI_buffer_type text_p, last_p, previous_p;
- S32 lh, cw, ch, total_width, w;
- U8* text=(U8*)*ss;
- //U8 text[512]; /* =(U8*)UI_temp_buffer; */
- U8 *s = (U8*) * ss;
- //gui_strcpy((UI_string_type) text, *ss);
- text_p = (U8*) text;
- last_p = (U8*) text;
- total_width = lh = 0;
- w = xwidth;
- #ifdef __MMI_LANG_THAI__
- if (HaveThaiCharacter(*ss))
- {
- //If the length of string is too long to show and it has Thai characters,we need to process this string in different way
- //The defect of this way is that it need to process the string two times(maybe more) and if the string is too long,it may waaste a lot of time.
- int i = 1;
- gui_measure_string_n(*ss, i, &sw, &sh);
- while (sw < w)
- {
- i++;
- gui_measure_string_n(*ss, i, &sw, &sh);
- }
- gui_move_text_cursor(x, y);
- gui_print_text_n((UI_string_type) * ss, i - 1);
- ss += (i - 1) * 2;
- return 0;
- }
- #endif /* __MMI_LANG_THAI__ */
- /* First pass: find the last displayable character and the string dimensions */
- while (!done)
- {
- previous_p = text_p;
- UI_STRING_GET_NEXT_CHARACTER(text_p, c); /* get next character in c , and point the pointer text_p to next character */
- /* This function is not designed for multi-line */
- if (c == (UI_character_type) 'n')
- {
- c = (UI_character_type) ' ';
- }
- #if defined(__MMI_LANG_VIETNAMESE__)
- if ((c > 0x0040) && (c < 0x01B1))
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, dummy_c); /* get next character */
- tone_mark = mmi_viet_tone_mark(dummy_c);
- if (VIET_TONE_NONE != tone_mark)
- {
- viet_vowel = mmi_viet_vowel_letter(c);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- c = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- gui_measure_character(c, &cw, &ch); /* measure width of character in pixels */
- if (UI_STRING_LINE_BREAK_CHARACTER(c) || UI_STRING_END_OF_STRING_CHARACTER(c)) /* check for end or space */
- {
- last_p = previous_p;
- break;
- }
- if ((total_width + cw) > w)
- {
- last_p = previous_p;
- break;
- }
- if (ch > lh)
- {
- lh = ch;
- }
- total_width += cw;
- }
- /* Second pass: display the text */
- text_p = (U8*) text;
- while (text_p != last_p)
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, c);
- UI_STRING_GET_NEXT_CHARACTER(s, dummy_c);
- #if defined(__MMI_LANG_VIETNAMESE__)
- if ((c > 0x0040) && (c < 0x01B1))
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, dummy_c); /* get next character */
- tone_mark = mmi_viet_tone_mark(dummy_c);
- if (VIET_TONE_NONE != tone_mark)
- {
- viet_vowel = mmi_viet_vowel_letter(c);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- c = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- UI_STRING_GET_NEXT_CHARACTER(s, dummy_c);
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- gui_measure_character(c, &cw, &ch);
- gui_move_text_cursor(x, y + lh - ch);
- gui_print_character(c);
- if (r2lMMIFlag)
- {
- x -= cw;
- }
- else
- {
- x += cw;
- }
- }
- *ss = (UI_string_type) s;
- return (0);
- }
- else
- {
- gui_move_text_cursor(x, y); /* move cursor to x,y position */
- gui_print_text(*ss); /* print text */
- return (1);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_print_truncated_bordered_text2
- * DESCRIPTION
- * Displays truncated bordered text (Does not display ...)
- * PARAMETERS
- * x [IN] Top left corner of text display
- * y [IN] Top left corner of text display
- * xwidth [IN] Width (in pixels) available for text display
- * ss [IN] Text to be displayed
- * RETURNS
- * Non-zero if the complete string was displayed
- * zero if the complete string could not be displayed
- *****************************************************************************/
- U8 gui_print_truncated_bordered_text2(S32 x, S32 y, S32 xwidth, UI_string_type *ss)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 sw, sh;
- #if defined(__MMI_LANG_VIETNAMESE__)
- viet_tone_mark tone_mark = VIET_TONE_NONE;
- viet_vowel_letter viet_vowel = VIET_VOWEL_NONE;
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- #ifdef __MMI_BIDI_ALG__
- S32 nLen;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_BIDI_ALG__
- nLen = UCS2Strlen((const char*)ss);
- MMI_ASSERT(!(nLen > MAX_TEXT_LENGTH - ENCODING_LENGTH));
- UCS2Strcpy((S8*) pwcWord, (S8*) ss);
- nLen = UCS2Strlen((const char*)pwcWord);
- #if defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__)
- #if defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__)
- if (nLen)
- {
- #ifdef __MMI_ZI_V7__
- /* PMT START PERSIAN */
- #if defined(__MMI_ZI_PERSIAN__) && defined(__MMI_ZI_ARABIC__)
- ZiStringShape(ZI8_LANG_FA, (U16*) & nLen, pwcWord);
- #elif defined (__MMI_ZI_PERSIAN__)
- ZiStringShape(ZI8_LANG_FA, (U16*) & nLen, pwcWord);
- #elif defined (__MMI_ZI_ARABIC__)
- ZiStringShape(ZI8_LANG_AR, (U16*) & nLen, pwcWord);
- #endif
- /* PMT END PERSIAN */
- #else /* __MMI_ZI_V7__ */
- ArabicStringShape((U16*) & nLen, pwcWord); /* output will replace the input string after returning */
- #endif /* __MMI_ZI_V7__ */
- }
- #else /* defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__) */
- if (nLen)
- {
- ArabicShapeEngine((U16*) & nLen, pwcWord); /* output will replace the input string after returning */
- }
- #endif /* defined(__MMI_ZI_ARABIC__) || defined(__MMI_ZI_PERSIAN__) */
- #endif /* defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__) */
- ss = (UI_string_type*) pwcWord;
- #endif /* __MMI_BIDI_ALG__ */
- gui_measure_string(*ss, &sw, &sh);
- if (sw > xwidth)
- {
- UI_character_type c, dummy_c;
- U8 done = 0;
- UI_buffer_type text_p, last_p, previous_p;
- S32 lh, cw, ch, total_width, w;
- U8* text=(U8*)*ss;
- //U8 text[512]; /* =(U8*)UI_temp_buffer; */
- U8 *s = (U8*) * ss;
- //gui_strcpy((UI_string_type) text, *ss);
- text_p = (U8*) text;
- last_p = (U8*) text;
- total_width = lh = 0;
- w = xwidth;
- #ifdef __MMI_LANG_THAI__
- if (HaveThaiCharacter(*ss))
- {
- //If the length of string is too long to show and it has Thai characters,we need to process this string in different way
- //The defect of this way is that it need to process the string two times(maybe more) and if the string is too long,it may waaste a lot of time.
- int i = 1;
- gui_measure_string_n(*ss, i, &sw, &sh);
- while (sw < w)
- {
- i++;
- gui_measure_string_n(*ss, i, &sw, &sh);
- }
- gui_move_text_cursor(x, y);
- gui_print_bordered_text_n((UI_string_type) * ss, i - 1);
- ss += (i - 1) * 2;
- return 0;
- }
- #endif /* __MMI_LANG_THAI__ */
- /* First pass: find the last displayable character and the string dimensions */
- while (!done)
- {
- previous_p = text_p;
- UI_STRING_GET_NEXT_CHARACTER(text_p, c); /* get next character in c , and point the pointer text_p to next character */
- /* This function is not designed for multi-line */
- if (c == (UI_character_type) 'n')
- {
- c = (UI_character_type) ' ';
- }
- #if defined(__MMI_LANG_VIETNAMESE__)
- if ((c > 0x0040) && (c < 0x01B1))
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, dummy_c); /* get next character */
- tone_mark = mmi_viet_tone_mark(dummy_c);
- if (VIET_TONE_NONE != tone_mark)
- {
- viet_vowel = mmi_viet_vowel_letter(c);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- c = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- gui_measure_character(c, &cw, &ch); /* measure width of character in pixels */
- if (UI_STRING_LINE_BREAK_CHARACTER(c) || UI_STRING_END_OF_STRING_CHARACTER(c)) /* check for end or space */
- {
- last_p = previous_p;
- break;
- }
- if ((total_width + cw) > w)
- {
- last_p = previous_p;
- break;
- }
- if (ch > lh)
- {
- lh = ch;
- }
- total_width += cw;
- }
- /* Second pass: display the text */
- text_p = (U8*) text;
- while (text_p != last_p)
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, c);
- UI_STRING_GET_NEXT_CHARACTER(s, dummy_c);
- #if defined(__MMI_LANG_VIETNAMESE__)
- if ((c > 0x0040) && (c < 0x01B1))
- {
- UI_STRING_GET_NEXT_CHARACTER(text_p, dummy_c); /* get next character */
- tone_mark = mmi_viet_tone_mark(dummy_c);
- if (VIET_TONE_NONE != tone_mark)
- {
- viet_vowel = mmi_viet_vowel_letter(c);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- c = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- UI_STRING_GET_NEXT_CHARACTER(s, dummy_c);
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(text_p, dummy_c);
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- gui_measure_character(c, &cw, &ch);
- gui_move_text_cursor(x, y + lh - ch);
- gui_print_bordered_character(c);
- if (r2lMMIFlag)
- {
- x -= cw;
- }
- else
- {
- x += cw;
- }
- }
- *ss = (UI_string_type) s;
- return (0);
- }
- else
- {
- gui_move_text_cursor(x, y); /* move cursor to x,y position */
- gui_print_bordered_text(*ss); /* print text */
- return (1);
- }
- }
- /*
- * Painter Component: encapsulates various painting operations with common interface
- */
- /*****************************************************************************
- * FUNCTION
- * gui_util_painter_create_empty
- * DESCRIPTION
- * Create an empty painter that draws nothing
- * PARAMETERS
- * p [OUT] created painter object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_util_painter_create_empty(gui_util_painter_struct *p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- p->type = GUI_UTIL_PAINTER_TYPE_EMPTY;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_util_painter_create_transparent
- * DESCRIPTION
- * Create a painter that fills transparent background
- * PARAMETERS
- * p [OUT] created painter object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_util_painter_create_transparent(gui_util_painter_struct *p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- p->type = GUI_UTIL_PAINTER_TYPE_TRANSPARENT;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_util_painter_create_imageid
- * DESCRIPTION
- * Create a painter that draws a image
- *
- * Note: it's preferred to use image ID instead of raw data because
- * image ID can be drawn with downloadable theme.
- * PARAMETERS
- * p [OUT] created painter object
- * imageid [IN] image to be drawn
- * RETURNS
- * void
- *****************************************************************************/
- void gui_util_painter_create_imageid(gui_util_painter_struct *p, MMI_ID_TYPE imageid)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- p->type = GUI_UTIL_PAINTER_TYPE_IMAGEID;
- p->_u.imageid = imageid;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_util_painter_create_imageid
- * DESCRIPTION
- * Create a painter that uses a callback to draw the region
- * PARAMETERS
- * p [OUT] created painter object
- * callback [IN] callback draw function
- * RETURNS
- * void
- *****************************************************************************/
- void gui_util_painter_create_callback(gui_util_painter_struct *p, gui_util_painter_callback_type callback)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- p->type = GUI_UTIL_PAINTER_TYPE_CALLBACK;
- p->_u.callback = callback;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_util_painter_create_filler
- * DESCRIPTION
- * Create a painter that draws a filler
- * PARAMETERS
- * p [OUT] created painter object
- * filler [IN] filler (must not be released before the painter object is released)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_util_painter_create_filler(gui_util_painter_struct *p, const UI_filled_area *filler)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- p->type = GUI_UTIL_PAINTER_TYPE_FILLER;
- p->_u.filler = filler;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_util_painter_show_clipped
- * DESCRIPTION
- * Draw a painter in a clipped region
- *
- * Note: if (x, y) is outside (clip_x1, clip_y1, clip_x2, clip_y2), it is clipped.
- *
- * For example, when it draws an image, the left-top corner of the image is
- * (x, y), but the displayed area is (clip_x1, clip_y1, clip_x2, clip_y2).
- * PARAMETERS
- * p [IN] painter object
- * x [IN] x coordinate of left-top corner of painting area
- * y [IN] y coordinate of left-top corner of painting area
- * clip_x1 [IN] clipping area
- * clip_y1 [IN] clipping area
- * clip_x2 [IN] clipping area
- * clip_y2 [IN] clipping area
- * RETURNS
- * void
- *****************************************************************************/
- void gui_util_painter_show_clipped(
- const gui_util_painter_struct *p,
- S32 x,
- S32 y,
- S32 clip_x1,
- S32 clip_y1,
- S32 clip_x2,
- S32 clip_y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (x > clip_x2 || y > clip_y2 || clip_x2 < 0 || clip_y2 < 0 ||
- x >= UI_device_width || y >= UI_device_height)
- {
- return;
- }
- if (x > clip_x1)
- {
- clip_x1 = x;
- }
- if (y > clip_y1)
- {
- clip_y1 = y;
- }
-
- gui_push_clip();
- gui_set_clip(clip_x1, clip_y1, clip_x2, clip_y2);
- switch (p->type)
- {
- case GUI_UTIL_PAINTER_TYPE_TRANSPARENT:
- gdi_draw_solid_rect(clip_x1, clip_y1, clip_x2, clip_y2, GDI_COLOR_TRANSPARENT);
- break;
-
- case GUI_UTIL_PAINTER_TYPE_IMAGEID:
- gui_show_transparent_image(
- x,
- y,
- (PU8) GetImage(p->_u.imageid),
- UI_DEFAULT_TRANSPARENT_COLOR);
- break;
- case GUI_UTIL_PAINTER_TYPE_CALLBACK:
- p->_u.callback(x, y, clip_x1, clip_y1, clip_x2, clip_y2);
- break;
- case GUI_UTIL_PAINTER_TYPE_FILLER:
- /* Some types of filler have starting point, so we use x/y instead of clip_x1/clip_y1 */
- gui_draw_filled_area(x, y, clip_x2, clip_y2, (UI_filled_area *) p->_u.filler);
- break;
-
- default:
- /* Do nothing */
- break;
- }
-
- gui_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * gui_util_painter_show
- * DESCRIPTION
- * Draw a painter
- * PARAMETERS
- * p [IN] painter object
- * x1 [IN] x coordinate of left-top corner
- * y1 [IN] y coordinate of left-top corner
- * x2 [IN] x coordinate of right-bottom corner
- * y2 [IN] y coordinate of right-bottom corner
- * RETURNS
- * void
- *****************************************************************************/
- void gui_util_painter_show(const gui_util_painter_struct *p, S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_util_painter_show_clipped(p, x1, y1, x1, y1, x2, y2);
- }
- /*
- * Clean-up of GUI components
- * To avoid clean-up each UI component explicitly in WGUI/draw manager/widget,
- * general cleanup mechanism is provided here.
- */
- static gui_cleanup_hook_hdlr g_mmi_gui_cleanup_hooks[GUI_MAX_CLEANUP_HOOK];
- /*****************************************************************************
- * FUNCTION
- * gui_add_cleanup_hook
- * DESCRIPTION
- *
- * PARAMETERS
- * fp [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_add_cleanup_hook(gui_cleanup_hook_hdlr fp)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- gui_cleanup_hook_hdlr *item = g_mmi_gui_cleanup_hooks;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!fp)
- {
- return;
- }
- for (i = 0; i < GUI_MAX_CLEANUP_HOOK; i++)
- {
- if (*item == fp)
- {
- return;
- }
- item++;
- }
- item = g_mmi_gui_cleanup_hooks;
- for (i = 0; i < GUI_MAX_CLEANUP_HOOK; i++)
- {
- if (!*item)
- {
- *item = fp;
- return;
- }
- item++;
- }
- /* The table is full */
- MMI_ASSERT(0);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_remove_cleanup_hook
- * DESCRIPTION
- *
- * PARAMETERS
- * fp [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_remove_cleanup_hook(gui_cleanup_hook_hdlr fp)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- gui_cleanup_hook_hdlr *item = g_mmi_gui_cleanup_hooks;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < GUI_MAX_CLEANUP_HOOK; i++)
- {
- if (*item == fp)
- {
- *item = NULL;
- return;
- }
- item++;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_cleanup
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_cleanup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- gui_cleanup_hook_hdlr *item = g_mmi_gui_cleanup_hooks;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < GUI_MAX_CLEANUP_HOOK; i++)
- {
- if (*item)
- {
- (*item) ();
- *item = NULL; /* remove handler */
- }
- item++;
- }
- }
- /*
- * Pre Clean-up of GUI components
- * general pre cleanup mechanism is provided here.
- */
- static gui_pre_cleanup_hook_hdlr g_mmi_gui_pre_cleanup_hooks[GUI_MAX_CLEANUP_HOOK];
- /*****************************************************************************
- * FUNCTION
- * gui_add_pre_cleanup_hook
- * DESCRIPTION
- *
- * PARAMETERS
- * fp [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_add_pre_cleanup_hook(gui_cleanup_hook_hdlr fp)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- gui_cleanup_hook_hdlr *item = g_mmi_gui_pre_cleanup_hooks;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!fp)
- {
- return;
- }
- for (i = 0; i < GUI_MAX_CLEANUP_HOOK; i++)
- {
- if (*item == fp)
- {
- return;
- }
- item++;
- }
- item = g_mmi_gui_pre_cleanup_hooks;
- for (i = 0; i < GUI_MAX_CLEANUP_HOOK; i++)
- {
- if (!*item)
- {
- *item = fp;
- return;
- }
- item++;
- }
- /* The table is full */
- MMI_ASSERT(0);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_remove_pre_cleanup_hook
- * DESCRIPTION
- *
- * PARAMETERS
- * fp [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_remove_pre_cleanup_hook(gui_cleanup_hook_hdlr fp)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- gui_cleanup_hook_hdlr *item = g_mmi_gui_pre_cleanup_hooks;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < GUI_MAX_CLEANUP_HOOK; i++)
- {
- if (*item == fp)
- {
- *item = NULL;
- return;
- }
- item++;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_pre_cleanup
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_pre_cleanup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- gui_cleanup_hook_hdlr *item = g_mmi_gui_pre_cleanup_hooks;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < GUI_MAX_CLEANUP_HOOK; i++)
- {
- if (*item)
- {
- (*item) ();
- *item = NULL; /* remove handler */
- }
- item++;
- }
- }