gui_fixed_menuitems.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:278k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * gui_fixed_menuitems.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * Menu items in fixed menu - UI component
- *
- * [Text menu item]
- * [Icontext menu item]
- * [Icontext-list menu item]
- * [Twostate menu item]
- *
- * Author:
- * -------
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**********************************************************************************
- Filename: gui_fixed_menuitems.c
- Author: manju
- Date Created: July-22-2002
- Contains: PixTel UI routines for Fixed Menuitems
- **********************************************************************************/
- #include "MMI_features.h"
- #include "gui_fixed_menuitems.h"
- #include "gui_common_menus.h"
- #include "kal_non_specific_general_types.h"
- #include "gdi_include.h"
- #include "lcd_sw_rnd.h"
- #include "wgui.h"
- #include "CustMenuRes.h"
- /* For R2L characters */
- #include "BIDIDEF.h"
- #include "BIDIProt.h"
- #include "UCS2Prot.h"
- #include "wgui_fixed_menuitems.h"
- #include "DebugInitDef.h"
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- #include "MMI_features.h" /* Add for Effect type entry for Title & highlighter */
- #include "wgui_categories_defs.h"
- #include "wgui_categories_util.h"
- /* For list highlighter effects */
- static S32 flash_feel_last_frame = 0;
- static S32 gblock_list_effect = 0;
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
- #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
- #include "mainmenudef.h"
- #endif
- //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
- /* Text scrolling related data */
- S32 UI_text_menuitem_scroll_time = UI_TEXT_MENUITEM_SCROLL_TIME;
- S32 UI_text_menuitem_scroll_size = UI_TEXT_MENUITEM_SCROLL_SIZE;
- S32 UI_text_menuitem_scroll_gap = UI_TEXT_MENUITEM_SCROLL_GAP;
- S32 UI_text_menuitem_scroll_pause = UI_TEXT_MENUITEM_SCROLL_PAUSE;
- /* Orange color poup dialog */
- UI_filled_area colorangewgui_pop_up_dialog_background =
- {UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_VERTICAL_FILL | UI_FILLED_AREA_SINGLE_BORDER,
- UI_NULL_IMAGE,
- NULL,
- {255, 220, 185, 100},
- {0, 0, 0, 0},
- {255, 163, 70, 100},
- {50, 50, 50, 100},
- 0
- };
- UI_filled_area f1={
- UI_FILLED_AREA_TYPE_COLOR|UI_FILLED_AREA_BORDER|UI_FILLED_AREA_ROUNDED_BORDER,
- UI_IMAGE_ID_NULL,
- NULL,
- {255,255,255,100},
- {0,0,0,100},
- {255,255,255,100},
- {0,0,0,100},
- 0};
- extern PU8 MMI_mm_animation;
- extern BOOL r2lMMIFlag;
- #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
- #define GUI_TWO_LINE_TEXT_ICON_GAP 5
- #endif
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- BOOL inline_bottom_line_draw;
- BOOL line_draw;
- #define TEXT_ICON_GAP 5 /* for display gap of text from grid */
- extern fixed_list_menu MMI_fixed_list_menu;
- extern MMI_theme *current_MMI_theme;
- /*****************************************************************************
- * FUNCTION
- * gui_disable_fixed_list_line_draw
- * DESCRIPTION
- * function for disable line draw
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_disable_fixed_list_line_draw(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- line_draw = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_enable_fixed_list_line_draw
- * DESCRIPTION
- * function for disable line draw
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_enable_fixed_list_line_draw(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- line_draw = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_disable_inline_bottom_line_draw
- * DESCRIPTION
- * function for disable inline bottom line draw for inline item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_disable_inline_bottom_line_draw(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_bottom_line_draw = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_enable_inline_bottom_line_draw
- * DESCRIPTION
- * function for inable bottom line draw for inline item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_enable_inline_bottom_line_draw(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_bottom_line_draw = 1;
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- /* Pop up description related data */
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_display_pop_up_description
- * DESCRIPTION
- * dummy function of display popup
- * PARAMETERS
- * x [IN] Start x position
- * y [IN] Start y position
- * width [IN] Width of popup
- * height [IN] Hieght of popup
- * RETURNS
- * void
- *****************************************************************************/
- void UI_dummy_display_pop_up_description(S32 x, S32 y, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(x);
- UI_UNUSED_PARAMETER(y);
- UI_UNUSED_PARAMETER(width);
- UI_UNUSED_PARAMETER(height);
- }
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_get_current_pop_up_description_string
- * DESCRIPTION
- * dummy function to get popup description string
- * PARAMETERS
- * void
- * RETURNS
- * string to be displayed
- *****************************************************************************/
- UI_string_type UI_dummy_get_current_pop_up_description_string(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return NULL;
- }
- UI_string_type(*gui_get_current_pop_up_description_string) (void) = UI_dummy_get_current_pop_up_description_string;
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- void (*gui_display_pop_up_description) (S32 x, S32 y, S32 width, S32 height) = UI_dummy_display_pop_up_description;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- static BOOL block_transparency = FALSE;
- /*****************************************************************************
- * FUNCTION
- * gui_block_transparency_effect
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_block_transparency_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- block_transparency = TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_unblock_transparency_effect
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_unblock_transparency_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- block_transparency = FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_enable_transparent_effect
- * DESCRIPTION
- * enable the transparent effect flag
- * PARAMETERS
- * m [?]
- * RETURNS
- * void
- *****************************************************************************/
- UI_filled_area non_transparent_focussed_filler;
- UI_filled_area *backup_focussed_filler;
- S32 transparency_in_list = 0;
- void gui_fixed_icontext_enable_transparent_effect(fixed_icontext_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (block_transparency)
- {
- return;
- }
- /* to enable transparency only when it is required */
- if (transparency_in_list)
- {
- m->focussed_filler = backup_focussed_filler;
- }
- transparency_in_list = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_disable_transparent_effect
- * DESCRIPTION
- * Disable the transparent effect flag
- * PARAMETERS
- * m [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_disable_transparent_effect(fixed_icontext_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (block_transparency)
- {
- return;
- }
- /* disable transparency only when it is enabled */
- if (m->focussed_filler->flags & UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR)
- {
- transparency_in_list = 1;
- backup_focussed_filler = m->focussed_filler;
- non_transparent_focussed_filler = *backup_focussed_filler;
- m->focussed_filler = &non_transparent_focussed_filler;
- m->focussed_filler->flags = m->focussed_filler->flags & ~UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_enable_transparent_effect
- * DESCRIPTION
- * enable the transparent effect flag
- * PARAMETERS
- * m [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_enable_transparent_effect(fixed_icontext_list_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (block_transparency)
- {
- return;
- }
- if (transparency_in_list)
- {
- m->focussed_filler = backup_focussed_filler;
- }
- transparency_in_list = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_list_disable_transparent_effect
- * DESCRIPTION
- * Disable the transparent effect flag
- * PARAMETERS
- * m [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_list_disable_transparent_effect(fixed_icontext_list_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (block_transparency)
- {
- return;
- }
- if (m->focussed_filler->flags & UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR)
- {
- transparency_in_list = 1;
- backup_focussed_filler = m->focussed_filler;
- non_transparent_focussed_filler = *backup_focussed_filler;
- m->focussed_filler = &non_transparent_focussed_filler;
- m->focussed_filler->flags = m->focussed_filler->flags & ~UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_text_menuitem_enable_transparent_effect
- * DESCRIPTION
- * enable the transparent effect flag
- * PARAMETERS
- * m [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_text_menuitem_enable_transparent_effect(fixed_text_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (block_transparency)
- {
- return;
- }
- if (transparency_in_list)
- {
- m->focussed_filler = backup_focussed_filler;
- }
- transparency_in_list = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_text_menuitem_disable_transparent_effect
- * DESCRIPTION
- * Disable the transparent effect flag
- * PARAMETERS
- * m [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_text_menuitem_disable_transparent_effect(fixed_text_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (block_transparency)
- {
- return;
- }
- if (m->focussed_filler->flags & UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR)
- {
- transparency_in_list = 1;
- backup_focussed_filler = m->focussed_filler;
- non_transparent_focussed_filler = *backup_focussed_filler;
- m->focussed_filler = &non_transparent_focussed_filler;
- m->focussed_filler->flags = m->focussed_filler->flags & ~UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_menuitem_enable_transparent_effect
- * DESCRIPTION
- * enable the transparent effect flag
- * PARAMETERS
- * m [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_twostate_menuitem_enable_transparent_effect(fixed_twostate_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (block_transparency)
- {
- return;
- }
- if (transparency_in_list)
- {
- m->focussed_filler = backup_focussed_filler;
- }
- transparency_in_list = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_twostate_menuitem_disable_transparent_effect
- * DESCRIPTION
- * Disable the transparent effect flag
- * PARAMETERS
- * m [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_twostate_menuitem_disable_transparent_effect(fixed_twostate_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (block_transparency)
- {
- return;
- }
- if (m->focussed_filler->flags & UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR)
- {
- transparency_in_list = 1;
- backup_focussed_filler = m->focussed_filler;
- non_transparent_focussed_filler = *backup_focussed_filler;
- m->focussed_filler = &non_transparent_focussed_filler;
- m->focussed_filler->flags = m->focussed_filler->flags & ~UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- /* Fixed menuitem dummy functions: Do not delete any of these functions */
- /*****************************************************************************
- * FUNCTION
- * UI_fixed_menuitem_dummy_display_function
- * DESCRIPTION
- * dummy func of UI_fixed_menuitem_dummy_display_function
- * PARAMETERS
- * item [IN]
- * common_item_data [IN]
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_fixed_menuitem_dummy_display_function(void *item, void *common_item_data, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- UI_UNUSED_PARAMETER(common_item_data);
- UI_UNUSED_PARAMETER(x);
- UI_UNUSED_PARAMETER(y);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_fixed_menuitem_dummy_hide_function
- * DESCRIPTION
- * dummy hide func
- * PARAMETERS
- * item [IN]
- * common_item_data [IN]
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_fixed_menuitem_dummy_hide_function(void *item, void *common_item_data, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- UI_UNUSED_PARAMETER(common_item_data);
- UI_UNUSED_PARAMETER(x);
- UI_UNUSED_PARAMETER(y);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_fixed_menuitem_dummy_measure_function
- * DESCRIPTION
- * dummy measure func
- * PARAMETERS
- * item [IN]
- * common_item_data [IN]
- * width [?]
- * height [?]
- * x(?) [IN]
- * y(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_fixed_menuitem_dummy_measure_function(void *item, void *common_item_data, S32 *width, S32 *height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- UI_UNUSED_PARAMETER(common_item_data);
- UI_UNUSED_PARAMETER(width);
- UI_UNUSED_PARAMETER(height);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_fixed_menuitem_dummy_highlight_function
- * DESCRIPTION
- * dummy highlight func
- * PARAMETERS
- * item [IN]
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_fixed_menuitem_dummy_highlight_function(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- UI_UNUSED_PARAMETER(common_item_data);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_fixed_menuitem_dummy_remove_highlight_function
- * DESCRIPTION
- * dummy remove highlight func
- * PARAMETERS
- * item [IN]
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_fixed_menuitem_dummy_remove_highlight_function(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- UI_UNUSED_PARAMETER(common_item_data);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_fixed_menuitem_dummy_resize_function
- * DESCRIPTION
- * dummy resize function
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_fixed_menuitem_dummy_resize_function(S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(x);
- UI_UNUSED_PARAMETER(y);
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * UI_fixed_menuitem_dummy_pen_function
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * common_item_data [?]
- * item_x [IN]
- * item_y [IN]
- * pen_event [IN]
- * x [IN]
- * y [IN]
- * menuitem_event [?]
- * menuitem_param [?]
- * RETURNS
- *
- *****************************************************************************/
- BOOL UI_fixed_menuitem_dummy_pen_function(
- void *item,
- void *common_item_data,
- S32 item_x,
- S32 item_y,
- mmi_pen_event_type_enum pen_event,
- S16 x,
- S16 y,
- gui_list_pen_enum *menuitem_event,
- gui_pen_event_param_struct *menuitem_param)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- UI_UNUSED_PARAMETER(common_item_data);
- UI_UNUSED_PARAMETER(pen_event);
- UI_UNUSED_PARAMETER(x);
- UI_UNUSED_PARAMETER(y);
- UI_UNUSED_PARAMETER(menuitem_event);
- UI_UNUSED_PARAMETER(menuitem_param);
- return MMI_FALSE;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /* GUI: fixed text menuitem functions */
- UI_fixed_text_menuitem_theme *current_fixed_text_menuitem_theme = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_set_fixed_text_menuitem_theme
- * DESCRIPTION
- * Applies the given theme to a fixed text menuitem
- * PARAMETERS
- * m [IN] Is the fixed text menuitem object (common data)
- * t [IN] Is the theme
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- UI_filled_area fixed_text_menuitem_transparent_filled_area;
- #endif
- void gui_set_fixed_text_menuitem_theme(fixed_text_menuitem *m, UI_fixed_text_menuitem_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->normal_filler = t->normal_filler;
- m->disabled_filler = t->disabled_filler;
- m->selected_filler = t->selected_filler;
- m->focussed_filler = t->focussed_filler;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- /* This is to replace the UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR flag and alpha value from the themecomponent.h */
- if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
- {
- fixed_text_menuitem_transparent_filled_area = *(m->focussed_filler);
- m->focussed_filler = &fixed_text_menuitem_transparent_filled_area;
- fixed_text_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- fixed_text_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- m->normal_text_color = t->normal_text_color;
- m->disabled_text_color = t->disabled_text_color;
- m->selected_text_color = t->selected_text_color;
- m->focussed_text_color = t->focussed_text_color;
- m->text_font = t->text_font;
- m->flags |= t->flags;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_fixed_text_menuitem_current_theme
- * DESCRIPTION
- * Applies the current theme to a fixed text menuitem
- * PARAMETERS
- * m [IN] Is the fixed text menuitem object (common data)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_fixed_text_menuitem_current_theme(fixed_text_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* set th normal filler color of menu item equal to current theme */
- m->normal_filler = current_fixed_text_menuitem_theme->normal_filler;
- m->disabled_filler = current_fixed_text_menuitem_theme->disabled_filler;
- m->selected_filler = current_fixed_text_menuitem_theme->selected_filler;
- m->focussed_filler = current_fixed_text_menuitem_theme->focussed_filler;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- /* This is to replace the UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR flag and alpha value from the themecomponent.h */
- if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
- {
- fixed_text_menuitem_transparent_filled_area = *(m->focussed_filler);
- m->focussed_filler = &fixed_text_menuitem_transparent_filled_area;
- fixed_text_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- m->normal_text_color = current_fixed_text_menuitem_theme->normal_text_color;
- m->disabled_text_color = current_fixed_text_menuitem_theme->disabled_text_color;
- m->selected_text_color = current_fixed_text_menuitem_theme->selected_text_color;
- m->focussed_text_color = current_fixed_text_menuitem_theme->focussed_text_color;
- m->text_font = current_fixed_text_menuitem_theme->text_font;
- m->flags |= current_fixed_text_menuitem_theme->flags;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_fixed_text_menuitem
- * DESCRIPTION
- * Creates a fixed text menuitem
- * PARAMETERS
- * m [IN] Is the fixed text menuitem object (common data)
- * width [IN] Width is the width of the fixed text menuitem
- * height [IN] Height is the height of the fixed text menuitem
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_fixed_text_menuitem(fixed_text_menuitem *m, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->width = width;
- m->height = height;
- m->flags = 0;
- m->ext_flags = 0;
- gui_set_fixed_text_menuitem_current_theme(m);
- m->text_x = 0;
- m->text_y = 0;
- m->scroll_x = 0;
- m->scroll_width = width;
- m->parent_list = NULL;
- m->parent_matrix = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_text_menuitem_set_text_position
- * DESCRIPTION
- * Sets the text position within a fixed text menuitem
- * PARAMETERS
- * m [IN] Is the fixed text menuitem object (common data)
- * x [IN] Is the position of the text (offset from the left-top corner of the menuitem)
- * y [IN] Is the position of the text (offset from the left-top corner of the menuitem)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_text_menuitem_set_text_position(fixed_text_menuitem *m, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->text_x = x;
- m->text_y = y;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_resize_fixed_text_menuitem
- * DESCRIPTION
- * Changes the size of a fixed text menuitem
- * PARAMETERS
- * m [IN] Is the fixed text menuitem object (common data)
- * width [IN] Is the new width
- * height [IN] Is the new height
- * RETURNS
- * void
- *****************************************************************************/
- void gui_resize_fixed_text_menuitem(fixed_text_menuitem *m, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->width = width;
- m->height = height;
- m->scroll_width = width;
- }
- /* Text scrolling related functions within the menu item */
- fixed_text_menuitem *GUI_current_fixed_text_menuitem_common_data = NULL;
- fixed_text_menuitem_type *GUI_current_fixed_text_menuitem_data = NULL;
- U8 GUI_current_fixed_text_menuitem_scroll = 0;
- U8 GUI_current_fixed_text_menuitem_scroll_direction;
- S32 GUI_current_fixed_text_menuitem_x;
- S32 GUI_current_fixed_text_menuitem_y;
- S32 GUI_current_fixed_text_menuitem_scroll_counter = 0;
- UI_string_type GUI_current_fixed_text_menuitem_scroll_text = NULL;
- UI_string_type GUI_current_fixed_text_menuitem_scroll_text_end = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_text_menuitem_scroll_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_text_menuitem_scroll_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 flags = GUI_current_fixed_text_menuitem_common_data->flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags |= GUI_current_fixed_text_menuitem_data->flags;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_reset_current_list_effect();
- #endif
- if (GUI_current_fixed_text_menuitem_scroll_counter)
- {
- GUI_current_fixed_text_menuitem_scroll_counter--;
- }
- else
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- GUI_current_fixed_text_menuitem_scroll_text = GUI_current_fixed_text_menuitem_scroll_text_end;
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if (flags & UI_MENUITEM_MARQUEE_SCROLL)
- {
- if (r2lMMIFlag)
- {
- GUI_current_fixed_text_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_text_menuitem_common_data->scroll_x >=
- (GUI_current_fixed_text_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap))
- {
- GUI_current_fixed_text_menuitem_common_data->scroll_x = 0;
- }
- }
- else
- {
- GUI_current_fixed_text_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_text_menuitem_common_data->scroll_x <=
- (-(GUI_current_fixed_text_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap)))
- {
- GUI_current_fixed_text_menuitem_common_data->scroll_x = 0;
- }
- }
- }
- else
- {
- if (GUI_current_fixed_text_menuitem_scroll_direction == 0)
- {
- GUI_current_fixed_text_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
- if ((GUI_current_fixed_text_menuitem_common_data->scroll_x +
- GUI_current_fixed_text_menuitem_common_data->text_width) <=
- (GUI_current_fixed_text_menuitem_common_data->scroll_width))
- {
- GUI_current_fixed_text_menuitem_scroll_direction = 1;
- GUI_current_fixed_text_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- }
- }
- else if (GUI_current_fixed_text_menuitem_scroll_direction == 1)
- {
- GUI_current_fixed_text_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_text_menuitem_common_data->scroll_x >= 0)
- {
- GUI_current_fixed_text_menuitem_scroll_direction = 0;
- GUI_current_fixed_text_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- }
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- GUI_current_fixed_text_menuitem_common_data->ext_flags |= UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- if (!gui_is_current_transparency_with_multi_layer())
- {
- gui_fixed_text_menuitem_disable_transparent_effect(GUI_current_fixed_text_menuitem_common_data); /* To disable transparency for scrolling text */
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- gui_show_fixed_text_menuitem(
- (void*)GUI_current_fixed_text_menuitem_data,
- (void*)GUI_current_fixed_text_menuitem_common_data,
- GUI_current_fixed_text_menuitem_x,
- GUI_current_fixed_text_menuitem_y);
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- gui_fixed_text_menuitem_enable_transparent_effect(GUI_current_fixed_text_menuitem_common_data); /* To enable transparency */
- #endif
- GUI_current_fixed_text_menuitem_common_data->ext_flags &= ~UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
- gui_BLT_double_buffer(
- GUI_current_fixed_text_menuitem_x,
- GUI_current_fixed_text_menuitem_y,
- GUI_current_fixed_text_menuitem_x + GUI_current_fixed_text_menuitem_common_data->width - 1,
- GUI_current_fixed_text_menuitem_y + GUI_current_fixed_text_menuitem_common_data->height - 1);
- }
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_text_menuitem_scroll_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_text_menuitem_start_scroll
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_text_menuitem_start_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_text_menuitem_type *t = (fixed_text_menuitem_type*) GUI_current_fixed_text_menuitem_data;
- fixed_text_menuitem *m = (fixed_text_menuitem*) GUI_current_fixed_text_menuitem_common_data;
- S32 w;
- U32 flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = m->flags;
- flags |= t->flags;
- gui_set_font(m->text_font);
- w = gui_get_string_width(t->text);
- m->text_width = w;
- m->scroll_x = 0;
- if (w >= (m->scroll_width - 1))
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- GUI_current_fixed_text_menuitem_scroll_text = t->text;
- GUI_current_fixed_text_menuitem_scroll = 1;
- GUI_current_fixed_text_menuitem_scroll_direction = 0;
- GUI_current_fixed_text_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (gui_get_current_list_effect() && gblock_list_effect != 1)
- {
- gui_register_callback_menuitem_scroll(gui_fixed_text_menuitem_scroll_handler);
- }
- else
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_text_menuitem_scroll_handler);
- }
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if ((flags & UI_MENUITEM_MARQUEE_SCROLL) || (flags & UI_MENUITEM_TWO_DIRECTION_SCROLL))
- {
- GUI_current_fixed_text_menuitem_scroll = 1;
- GUI_current_fixed_text_menuitem_scroll_direction = 0;
- GUI_current_fixed_text_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (gui_get_current_list_effect() && gblock_list_effect != 1)
- {
- gui_register_callback_menuitem_scroll(gui_fixed_text_menuitem_scroll_handler);
- }
- else
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_text_menuitem_scroll_handler);
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- }
- else
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- {
- gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
- GUI_current_fixed_text_menuitem_scroll = 0;
- }
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- GUI_current_fixed_text_menuitem_scroll = 0;
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_text_menuitem_stop_scroll
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_text_menuitem_stop_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GUI_current_fixed_text_menuitem_scroll)
- {
- gui_cancel_timer(gui_fixed_text_menuitem_scroll_handler);
- GUI_current_fixed_text_menuitem_scroll = 0;
- }
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
- gui_restore_current_list_effect();
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_show_fixed_text_menuitem
- * DESCRIPTION
- * Displays the fixed text menuitem
- * PARAMETERS
- * item [IN] Is a specific fixed text menuitem object
- * common_item_data [IN] Is the fixed text menuitem object (common_data)
- * x [IN] Is the position at which the menuitem is displayed
- * y [IN] Is the position at which the menuitem is displayed
- * RETURNS
- * void
- *****************************************************************************/
- void gui_show_fixed_text_menuitem(void *item, void *common_item_data, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2;
- S32 text_x, text_y;
- color text_color;
- UI_filled_area *f = NULL;
- fixed_text_menuitem *m = (fixed_text_menuitem*) common_item_data;
- fixed_text_menuitem_type *mi = (fixed_text_menuitem_type*) item;
- U32 flags;
- UI_string_type _text;
- S32 sw, sh;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = mi->flags;
- flags |= m->flags;
- _text = mi->text;
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- GUI_current_fixed_text_menuitem_x = x;
- GUI_current_fixed_text_menuitem_y = y;
- }
- /* Autocalculate the text position based on font */
- gui_set_font(m->text_font);
- gui_measure_string(_text, &sw, &sh);
- if (flags & UI_MENUITEM_CENTER_TEXT_X)
- {
- if (m->width > sw)
- {
- m->text_x = (m->width >> 1) - (sw >> 1);
- }
- else
- {
- m->text_x = 0;
- }
- }
- if (flags & UI_MENUITEM_CENTER_TEXT_Y)
- {
- if (m->height > sh)
- {
- m->text_y = (m->height >> 1) - (sh >> 1);
- }
- else
- {
- m->text_y = 0;
- }
- }
- x1 = x;
- y1 = y;
- y2 = y1 + m->height - 1;
- x2 = x1 + m->width - 1;
- if (r2lMMIFlag)
- {
- text_x = m->width - 1 - m->text_x;
- }
- else
- {
- text_x = m->text_x;
- }
- text_y = m->text_y;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- /* To hide the text of the menuitem up to the last frame for flash feel effect */
- if (gblock_list_effect == 0)
- {
- if (gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING)
- {
- if (flash_feel_last_frame == 0)
- {
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- flags |= UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- }
- }
- }
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- if (flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- text_x += m->scroll_x;
- }
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(flags & UI_MENUITEM_DISABLE_HIGHLIGHT))
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
- {
- f = m->focussed_filler;
- }
- text_color = m->focussed_text_color;
- }
- else if (flags & UI_MENUITEM_STATE_DISABLED)
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND) && !(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
- {
- f = m->disabled_filler;
- }
- text_color = m->focussed_text_color;
- }
- else if (flags & UI_MENUITEM_STATE_SELECTED)
- {
- f = m->selected_filler;
- text_color = m->selected_text_color;
- }
- else
- {
- if (!(flags & UI_MENUITEM_DISABLE_BACKGROUND) && !(flags & UI_MENUITEM_DISABLE_BACKGROUND_ALWAYS))
- {
- f = m->normal_filler;
- }
- text_color = m->normal_text_color;
- }
- if (f != NULL)
- {
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (is_draw_next_frame_list_highlight_effect_value())
- #endif
- {
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = MMI_SCREEN_HIGHLIGHT_TEXT_ITEM;
- }
- #endif
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- set_start_position_and_item_parameters_for_list_highlighter_effect(item, common_item_data, x1, y1);
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (r2lMMIFlag)
- {
- gui_draw_list_filled_area(x1 + 1, y1 + 1, x2, y2, f);
- }
- else
- {
- gui_draw_list_filled_area(x1, y1 + 1, x2 - 1, y2, f);
- }
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- gui_draw_list_filled_area(x1, y1, x2, y2, f);
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- gui_draw_filled_area(x1, y1, x2, y2, f);
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- /* To hide the text of the menuitem up to the last frame for flash feel effect */
- if (!
- ((gui_get_current_list_effect() == MMI_UI_LIST_HIGHLIGHT_EFFECT_FLASH_FEELING) &&
- (flags & UI_MENUITEM_DISABLE_TEXT_DISPLAY) && (gblock_list_effect == 0)))
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_push_text_clip();
- gui_set_text_clip(x1, y1, x2, y2);
- gui_move_text_cursor(x1 + text_x, y1 + text_y);
- gui_set_line_height(sh);
- gui_set_text_color(text_color);
- #if(UI_USE_WORD_SCROLLING_TEXT)
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && GUI_current_fixed_text_menuitem_scroll)
- {
- GUI_current_fixed_text_menuitem_scroll_text_end = GUI_current_fixed_text_menuitem_scroll_text;
- if (gui_print_truncated_text2
- (x1 + text_x, y1 + text_y, m->width, &GUI_current_fixed_text_menuitem_scroll_text_end))
- {
- GUI_current_fixed_text_menuitem_scroll_text_end = _text;
- }
- }
- else
- {
- gui_print_truncated_text2(x1 + text_x, y1 + text_y, m->width, &_text);
- }
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- gui_print_text(_text);
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && (flags & UI_MENUITEM_MARQUEE_SCROLL) &&
- GUI_current_fixed_text_menuitem_scroll)
- {
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + text_x - (m->text_width + UI_text_menuitem_scroll_gap), y1 + text_y);
- }
- else
- {
- gui_move_text_cursor(x1 + text_x + m->text_width + UI_text_menuitem_scroll_gap, y1 + text_y);
- }
- gui_set_line_height(sh);
- gui_print_text(_text);
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- gui_pop_text_clip();
- }
- #if(UI_ENABLE_POP_UP_DESCRIPTIONS)
- if ((flags & UI_MENUITEM_STATE_FOCUSSED) && !(m->ext_flags & UI_MENUITEM_EXT_SHOW_IN_MARQUEE))
- {
- gui_display_pop_up_description(x, y, m->width, m->height);
- }
- #endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_measure_fixed_text_menuitem
- * DESCRIPTION
- * Measures a fixed text menuitem
- * PARAMETERS
- * item [?]
- * common_item_data [IN] Is the fixed text menuitem object (common_data)
- * width [OUT]
- * height [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_measure_fixed_text_menuitem(void *item, void *common_item_data, S32 *width, S32 *height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_text_menuitem *m = (fixed_text_menuitem*) common_item_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item);
- *width = m->width;
- *height = m->height;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_highlight_fixed_text_menuitem
- * DESCRIPTION
- * Highlights a fixed text menuitem (not visually)
- * PARAMETERS
- * item [IN] Is a specific fixed text menuitem object
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_highlight_fixed_text_menuitem(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_text_menuitem_type *t = (fixed_text_menuitem_type*) item;
- fixed_text_menuitem *m = (fixed_text_menuitem*) common_item_data;
- U32 flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = m->flags;
- flags |= t->flags;
- GUI_current_fixed_text_menuitem_common_data = m;
- GUI_current_fixed_text_menuitem_data = t;
- gui_fixed_text_menuitem_stop_scroll();
- gui_fixed_text_menuitem_start_scroll();
- if (t->flags & UI_MENUITEM_DISABLE_HIGHLIGHT)
- {
- return;
- }
- t->flags |= UI_MENUITEM_STATE_FOCUSSED;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_remove_highlight_fixed_text_menuitem
- * DESCRIPTION
- * Removes the highlight of a fixed text menuitem (not visually)
- * PARAMETERS
- * item [IN] Is a specific fixed text menuitem object
- * common_item_data [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_remove_highlight_fixed_text_menuitem(void *item, void *common_item_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_text_menuitem_type *t = (fixed_text_menuitem_type*) item;
- fixed_text_menuitem *m = (fixed_text_menuitem*) common_item_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(common_item_data);
- m->scroll_x = 0;
- t->flags &= ~UI_MENUITEM_STATE_FOCUSSED;
- }
- /* GUI: fixed icon text menuitem functions */
- UI_fixed_icontext_menuitem_theme *current_fixed_icontext_menuitem_theme = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_set_fixed_icontext_menuitem_current_theme
- * DESCRIPTION
- * Applies the current theme to a fixed icontext menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext menuitem object (common data)
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- UI_filled_area fixed_icontext_menuitem_transparent_filled_area;
- #endif
- void gui_set_fixed_icontext_menuitem_current_theme(fixed_icontext_menuitem *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->disabled_filler = current_fixed_icontext_menuitem_theme->disabled_filler;
- m->disabled_text_color = current_fixed_icontext_menuitem_theme->disabled_text_color;
- m->flags |= current_fixed_icontext_menuitem_theme->flags;
- m->focussed_filler = current_fixed_icontext_menuitem_theme->focussed_filler;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- /* This is to replace the UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR flag and alpha value from the themecomponent.h */
- if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
- {
- fixed_icontext_menuitem_transparent_filled_area = *(m->focussed_filler);
- m->focussed_filler = &fixed_icontext_menuitem_transparent_filled_area;
- fixed_icontext_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- fixed_icontext_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- m->focussed_text_color = current_fixed_icontext_menuitem_theme->focussed_text_color;
- m->normal_filler = current_fixed_icontext_menuitem_theme->normal_filler;
- m->normal_text_color = current_fixed_icontext_menuitem_theme->normal_text_color;
- m->selected_filler = current_fixed_icontext_menuitem_theme->selected_filler;
- m->selected_text_color = current_fixed_icontext_menuitem_theme->selected_text_color;
- m->text_font = current_fixed_icontext_menuitem_theme->text_font;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_fixed_icontext_menuitem_theme
- * DESCRIPTION
- * Applies the given theme to a fixed icontext menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext menuitem object (common data)
- * t [IN] Is the theme
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_fixed_icontext_menuitem_theme(fixed_icontext_menuitem *m, UI_fixed_icontext_menuitem_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->disabled_filler = t->disabled_filler;
- m->disabled_text_color = t->disabled_text_color;
- m->flags |= t->flags;
- m->focussed_filler = t->focussed_filler;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- /* This is to replace the UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR flag and alpha value from the themecomponent.h */
- if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
- {
- fixed_icontext_menuitem_transparent_filled_area = *(m->focussed_filler);
- m->focussed_filler = &fixed_icontext_menuitem_transparent_filled_area;
- fixed_icontext_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
- fixed_icontext_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- m->focussed_text_color = t->focussed_text_color;
- m->normal_filler = t->normal_filler;
- m->normal_text_color = t->normal_text_color;
- m->selected_filler = t->selected_filler;
- m->selected_text_color = t->selected_text_color;
- m->text_font = t->text_font;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_fixed_icontext_menuitem
- * DESCRIPTION
- * Creates a fixed icontext menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext menuitem object (common data)
- * width [IN] Width is the width of the fixed icontext menuitem
- * height [IN] Height is the height of the fixed icontext menuitem
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_fixed_icontext_menuitem(fixed_icontext_menuitem *m, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->width = width;
- m->height = height;
- m->flags = 0;
- m->ext_flags = 0;
- m->icon_transparent_color = gui_transparent_color(0, 0, 0);
- gui_set_fixed_icontext_menuitem_current_theme(m);
- m->text_x = 0;
- m->text_y = 0;
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- m->icon_x = 2; /* To display gap of icon from left side border */
- #else
- m->icon_x = 0;
- #endif
- m->icon_y = 0;
- m->scroll_x = 0;
- m->scroll_width = width;
- m->parent_list = NULL;
- m->parent_matrix = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_menuitem_set_text_position
- * DESCRIPTION
- * Sets the text position within a fixed icontext menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext menuitem object (common data)
- * x [IN] Is the position of the text (offset from the left-top corner of the menuitem)
- * y [IN] Is the position of the text (offset from the left-top corner of the menuitem)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_menuitem_set_text_position(fixed_icontext_menuitem *m, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->text_x = x;
- m->text_y = y;
- if (m->icon_x > m->text_x)
- {
- m->scroll_width = m->icon_x - m->text_x;
- }
- else
- {
- m->scroll_width = m->width - m->text_x;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_menuitem_set_icon_position
- * DESCRIPTION
- * Sets the icon position within a fixed icontext menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext menuitem object (common data)
- * x [IN] Is the position of the icon (offset from the left-top corner of the menuitem)
- * y [IN] Is the position of the icon (offset from the left-top corner of the menuitem)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_menuitem_set_icon_position(fixed_icontext_menuitem *m, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->icon_x = x;
- m->icon_x = y;
- if (m->icon_x > m->text_x)
- {
- m->scroll_width = m->icon_x - m->text_x;
- }
- else
- {
- m->scroll_width = m->width - m->text_x;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_resize_fixed_icontext_menuitem
- * DESCRIPTION
- * Changes the size of a fixed icontext menuitem
- * PARAMETERS
- * m [IN] Is the fixed icontext menuitem object (common data)
- * width [IN] Is the new width
- * height [IN] Is the new height
- * RETURNS
- * void
- *****************************************************************************/
- void gui_resize_fixed_icontext_menuitem(fixed_icontext_menuitem *m, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->width = width;
- m->height = height;
- if (m->icon_x > m->text_x)
- {
- m->scroll_width = m->icon_x - m->text_x;
- }
- /* PMT VIKAS START 20051202 */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- else
- {
- m->scroll_width = m->width - (m->text_x + TEXT_ICON_GAP); /* As TEXT_ICON_GAP is add in text x to start show text */
- }
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- else
- {
- m->scroll_width = m->width - m->text_x;
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- /* PMT VIKAS END 20051202 */
- }
- /* Text scrolling related functions within the menu item */
- fixed_icontext_menuitem *GUI_current_fixed_icontext_menuitem_common_data = NULL;
- fixed_icontext_menuitem_type *GUI_current_fixed_icontext_menuitem_data = NULL;
- U8 GUI_current_fixed_icontext_menuitem_scroll = 0;
- U8 GUI_current_fixed_icontext_menuitem_scroll_direction;
- S32 GUI_current_fixed_icontext_menuitem_x;
- S32 GUI_current_fixed_icontext_menuitem_y;
- S32 GUI_current_fixed_icontext_menuitem_scroll_counter = 0;
- UI_string_type GUI_current_fixed_icontext_menuitem_scroll_text = NULL;
- UI_string_type GUI_current_fixed_icontext_menuitem_scroll_text_end = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_menuitem_scroll_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_menuitem_scroll_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 flags = GUI_current_fixed_icontext_menuitem_common_data->flags;
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_reset_current_list_effect();
- #endif
- if (!(flags & UI_MENUITEM_MARQUEE_SCROLL) && !(flags & UI_MENUITEM_TWO_DIRECTION_SCROLL))
- {
- return;
- }
- if (GUI_current_fixed_icontext_menuitem_scroll == 0)
- {
- return;
- }
- if (GUI_current_fixed_icontext_menuitem_common_data->parent_list)
- {
- fixed_list_menu *parent_list = GUI_current_fixed_icontext_menuitem_common_data->parent_list;
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(parent_list->act_lcd_handle);
- gdi_layer_push_and_set_active(parent_list->act_layer_handle);
- }
- flags |= GUI_current_fixed_icontext_menuitem_data->flags;
- if (GUI_current_fixed_icontext_menuitem_scroll_counter)
- {
- GUI_current_fixed_icontext_menuitem_scroll_counter--;
- }
- else
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- GUI_current_fixed_icontext_menuitem_scroll_text = GUI_current_fixed_icontext_menuitem_scroll_text_end;
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if (flags & UI_MENUITEM_MARQUEE_SCROLL)
- {
- if (r2lMMIFlag)
- {
- GUI_current_fixed_icontext_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_icontext_menuitem_common_data->scroll_x >=
- (GUI_current_fixed_icontext_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap))
- {
- GUI_current_fixed_icontext_menuitem_common_data->scroll_x = 0;
- }
- }
- else
- {
- GUI_current_fixed_icontext_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_icontext_menuitem_common_data->scroll_x <=
- (-(GUI_current_fixed_icontext_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap)))
- {
- GUI_current_fixed_icontext_menuitem_common_data->scroll_x = 0;
- }
- }
- }
- else
- {
- if (GUI_current_fixed_icontext_menuitem_scroll_direction == 0)
- {
- GUI_current_fixed_icontext_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
- if ((GUI_current_fixed_icontext_menuitem_common_data->scroll_x +
- GUI_current_fixed_icontext_menuitem_common_data->text_width) <=
- (GUI_current_fixed_icontext_menuitem_common_data->scroll_width))
- {
- GUI_current_fixed_icontext_menuitem_scroll_direction = 1;
- GUI_current_fixed_icontext_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- }
- }
- else if (GUI_current_fixed_icontext_menuitem_scroll_direction == 1)
- {
- GUI_current_fixed_icontext_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
- if (GUI_current_fixed_icontext_menuitem_common_data->scroll_x >= 0)
- {
- GUI_current_fixed_icontext_menuitem_scroll_direction = 0;
- GUI_current_fixed_icontext_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- }
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- GUI_current_fixed_icontext_menuitem_common_data->ext_flags |= UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- if (!gui_is_current_transparency_with_multi_layer())
- {
- gui_fixed_icontext_disable_transparent_effect(GUI_current_fixed_icontext_menuitem_common_data); /* To hide text below scrolling text */
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- gui_show_fixed_icontext_menuitem(
- (void*)GUI_current_fixed_icontext_menuitem_data,
- (void*)GUI_current_fixed_icontext_menuitem_common_data,
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y);
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- gui_fixed_icontext_enable_transparent_effect(GUI_current_fixed_icontext_menuitem_common_data); /* Enable after scrolling text */
- #endif
- GUI_current_fixed_icontext_menuitem_common_data->ext_flags &= ~UI_MENUITEM_EXT_SHOW_IN_MARQUEE;
- #if defined(__MMI_UI_TWO_LINE_MENUITEM_STYLES__) && defined(__MMI_UI_HINTS_IN_MENUITEM__)
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- if (GUI_current_fixed_icontext_menuitem_common_data->ext_flags & UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT)
- {
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y,
- GUI_current_fixed_icontext_menuitem_x + GUI_current_fixed_icontext_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_menuitem_y + (GUI_current_fixed_icontext_menuitem_common_data->height << 1) - 1);
- }
- else if ((GUI_current_fixed_icontext_menuitem_common_data->ext_flags & UI_MENUITEM_SHOW_ALL_HINTS ||
- ((GUI_current_fixed_icontext_menuitem_data->flags & UI_MENUITEM_STATE_FOCUSSED) &&
- (GUI_current_fixed_icontext_menuitem_common_data->ext_flags & UI_MENUITEM_SHOW_HIGHLIGHTED_HINT))) &&
- (gui_get_current_pop_up_description_string()))
- {
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y,
- GUI_current_fixed_icontext_menuitem_x + GUI_current_fixed_icontext_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_menuitem_y + (GUI_current_fixed_icontext_menuitem_common_data->height << 1) - 1);
- }
- else
- {
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y,
- GUI_current_fixed_icontext_menuitem_x + GUI_current_fixed_icontext_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_menuitem_y + GUI_current_fixed_icontext_menuitem_common_data->height - 1);
- }
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- #else /* defined(__MMI_UI_TWO_LINE_MENUITEM_STYLES__) && defined(__MMI_UI_HINTS_IN_MENUITEM__) */
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- if (GUI_current_fixed_icontext_menuitem_common_data->ext_flags & UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT)
- {
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y,
- GUI_current_fixed_icontext_menuitem_x + GUI_current_fixed_icontext_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_menuitem_y + (GUI_current_fixed_icontext_menuitem_common_data->height << 1) - 1);
- }
- else
- {
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y,
- GUI_current_fixed_icontext_menuitem_x + GUI_current_fixed_icontext_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_menuitem_y + GUI_current_fixed_icontext_menuitem_common_data->height - 1);
- }
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- #else /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- //PMT NEERAJ END 20050825
- //PMT NEERAJ START 20050712
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- if ((GUI_current_fixed_icontext_menuitem_common_data->ext_flags & UI_MENUITEM_SHOW_ALL_HINTS ||
- ((GUI_current_fixed_icontext_menuitem_data->flags & UI_MENUITEM_STATE_FOCUSSED) &&
- (GUI_current_fixed_icontext_menuitem_common_data->ext_flags & UI_MENUITEM_SHOW_HIGHLIGHTED_HINT))) &&
- (gui_get_current_pop_up_description_string()))
- {
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y,
- GUI_current_fixed_icontext_menuitem_x + GUI_current_fixed_icontext_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_menuitem_y + (GUI_current_fixed_icontext_menuitem_common_data->height << 1) - 1);
- }
- else
- {
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y,
- GUI_current_fixed_icontext_menuitem_x + GUI_current_fixed_icontext_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_menuitem_y + GUI_current_fixed_icontext_menuitem_common_data->height - 1);
- }
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- #else /* __MMI_UI_HINTS_IN_MENUITEM__ */
- /* PMT NEERAJ END 20050712 */
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_BLT_double_buffer(
- GUI_current_fixed_icontext_menuitem_x,
- GUI_current_fixed_icontext_menuitem_y,
- GUI_current_fixed_icontext_menuitem_x + GUI_current_fixed_icontext_menuitem_common_data->width - 1,
- GUI_current_fixed_icontext_menuitem_y + GUI_current_fixed_icontext_menuitem_common_data->height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- /* PMT NEERAJ START 20050712 */
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- //PMT NEERAJ END 20050712
- //PMT NEERAJ START 20050825
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- #endif /* defined(__MMI_UI_TWO_LINE_MENUITEM_STYLES__) && defined(__MMI_UI_HINTS_IN_MENUITEM__) */
- }
- if (GUI_current_fixed_icontext_menuitem_common_data->parent_list)
- {
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_menuitem_scroll_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_menuitem_start_scroll
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_menuitem_start_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- fixed_icontext_menuitem_type *t = (fixed_icontext_menuitem_type*) GUI_current_fixed_icontext_menuitem_data;
- fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) GUI_current_fixed_icontext_menuitem_common_data;
- S32 w;
- U32 flags;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- flags = m->flags;
- flags |= t->flags;
- gui_set_font(m->text_font);
- w = gui_get_string_width(t->item_text);
- m->text_width = w;
- m->scroll_x = 0;
- if (w > (m->scroll_width))
- {
- #if(UI_USE_WORD_SCROLLING_TEXT)
- GUI_current_fixed_icontext_menuitem_scroll_text = t->item_text;
- GUI_current_fixed_icontext_menuitem_scroll = 1;
- GUI_current_fixed_icontext_menuitem_scroll_direction = 0;
- GUI_current_fixed_icontext_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (gui_get_current_list_effect() && gblock_list_effect != 1)
- {
- gui_register_callback_menuitem_scroll(gui_fixed_icontext_menuitem_scroll_handler);
- }
- else
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_menuitem_scroll_handler);
- }
- #else /* (UI_USE_WORD_SCROLLING_TEXT) */
- if ((flags & UI_MENUITEM_MARQUEE_SCROLL) || (flags & UI_MENUITEM_TWO_DIRECTION_SCROLL))
- {
- GUI_current_fixed_icontext_menuitem_scroll = 1;
- GUI_current_fixed_icontext_menuitem_scroll_direction = 0;
- GUI_current_fixed_icontext_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (gui_get_current_list_effect() && gblock_list_effect != 1)
- {
- gui_register_callback_menuitem_scroll(gui_fixed_icontext_menuitem_scroll_handler);
- }
- else
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- gui_start_timer(UI_text_menuitem_scroll_time, gui_fixed_icontext_menuitem_scroll_handler);
- }
- }
- #endif /* (UI_USE_WORD_SCROLLING_TEXT) */
- }
- else
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- {
- gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
- GUI_current_fixed_icontext_menuitem_scroll = 0;
- }
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- {
- GUI_current_fixed_icontext_menuitem_scroll = 0;
- }
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_fixed_icontext_menuitem_stop_scroll
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fixed_icontext_menuitem_stop_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GUI_current_fixed_icontext_menuitem_scroll)
- {
- gui_cancel_timer(gui_fixed_icontext_menuitem_scroll_handler);
- GUI_current_fixed_icontext_menuitem_scroll = 0;
- }
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_register_callback_menuitem_scroll(gui_dummy_scroll_handler_for_list_effects);
- gui_restore_current_list_effect();
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- /* External used to display inline edit menu items */
- void wgui_show_inline_edit_menuitem(S32 x1, S32 y1, S32 width, S32 height);
- /*****************************************************************************
- * FUNCTION
- * print_wrap_string
- * DESCRIPTION
- * Displays the fixed icontext menuitem
- * PARAMETERS
- * s [IN]
- * x [IN] Is the position at which the menuitem is displayed
- * y [IN] Is the position at which the menuitem is displayed
- * number_of_rows [IN]
- * line_width [IN]
- * item(?) [IN] Is a specific fixed icontext menuitem object
- * common_item_data(?) [IN] Is the fixed icontext menuitem object (common_data)
- * RETURNS
- * void
- *****************************************************************************/
- extern S32 MMI_current_menu_type;
- extern fixed_matrix_menu MMI_fixed_matrix_menu;
- extern gdi_handle animation_handle;
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- void print_wrap_string(UI_string_type s, S32 x, S32 y, S32 number_of_rows, S32 line_width)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 line_height = 0, current_line_width = 0, char_width = 0, char_height = 0, cursor_pos_x = x, cursor_pos_y = y;
- U16 char_index = 0;
- S32 total_rows = 1;
- S32 es_width = 0, es_height = 0;
- UI_character_type es[] = { '.', ' ' };
- UI_character_type terminal[] = { ' ' };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_measure_string(es, &es_width, &es_height);
- if (!s)
- {
- return;