wgui_fixed_menuitems.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:178k
源码类别:
MTK
开发平台:
C/C++
- /*******************************************************************************
- * Modification Notice:
- * --------------------------
- * This software is modified by MediaTek Inc. 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:
- * ---------
- * wgui_fixed_menuitems.c
- *
- * Project:
- * --------
- * Maui_Software
- *
- * Description:
- * ------------
- * menuitems related funtions
- *
- * Author:
- * -------
- * -------
- *
- *------------------------------------------------------------------------------
- * $Log$
- *
- * 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!
- *
- *
- ****************************************************************************/
- /*
- * 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: wgui_fixed_menuitems.c
- Author: manju
- Date Created: August-07-2002
- Contains: PixTel UI wrapper routines for Fixed Menuitems
- **********************************************************************************/
- #include "MMI_features.h"
- #include "wgui_fixed_menuitems.h"
- #ifdef __MMI_SLIM_LISTMENU__
- #include "GlobalDefs.h"
- #endif
- #include "MainMenuDef.h"
- #include "CustMenuRes.h"
- integrated_menuitem integratedMenus;
- void (*wgui_text_menuitem_reset_scrolling) (void) = UI_dummy_function;
- void (*wgui_text_menuitem_restart_scrolling) (void) = UI_dummy_function;
- /* Fixed text item wrappers */
- fixed_text_menuitem MMI_fixed_text_menuitem;
- /* fixed_text_menuitem_type MMI_fixed_text_menuitems[MAX_FIXED_TEXT_MENU_ITEMS]; */
- fixed_text_menuitem_type *MMI_fixed_text_menuitems = (fixed_text_menuitem_type *) & integratedMenus;
- S32 *fixed_text_menu_n_items;
- /* MTK Leo add */
- extern U8 GetMenuItemHeight(U8 font_height);
- extern U16 gCurrLangIndex;
- extern S32 MMI_menuitem_height;
- /* MTK Leo end */
- /* void pointers required for fixed menuitems */
- /* This value should not be less than the
- maximum number of items possible to be
- displayed in menus. */
- void *MMI_fixed_menuitem_pointers[MAX_FIXED_MENU_ITEM_POINTERS];
- /* MTK Leo add 20050225, for new list_matrix menu style */
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- void *MMI_fixed_menuitem_pointers2[MAX_MAIN_MENU_ITEMS];
- #endif
- /* MTK Leo end 20050225 */
- /*****************************************************************************
- * FUNCTION
- * get_menu_item_height
- * DESCRIPTION
- * Get the height of menuitem according to current font height
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 get_menu_item_height()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 font_height;
- U8 height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- font_height = (U8) Get_FontHeight(MMI_medium_font, (U8) gCurrLangIndex);
- height = GetMenuItemHeight(font_height);
- if (height == 0)
- {
- return (U8) MMI_menuitem_height;
- }
- else
- {
- return height;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_text_menuitem_apply_current_theme
- * DESCRIPTION
- * Apply the current theme for the fixed text menuitems
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_text_menuitem_apply_current_theme(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_fixed_text_menuitem_current_theme(&MMI_fixed_text_menuitem);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_text_menuitem_apply_theme
- * DESCRIPTION
- * Apply the given theme to the fixed text menuitems
- * PARAMETERS
- * t [?]
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_text_menuitem_apply_theme(UI_fixed_text_menuitem_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_fixed_text_menuitem_theme(&MMI_fixed_text_menuitem, t);
- }
- /*****************************************************************************
- * FUNCTION
- * create_fixed_text_menuitems
- * DESCRIPTION
- * Creates an array of fixed text menuitems and configures
- * the common data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void create_fixed_text_menuitems(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_create_fixed_text_menuitem(&MMI_fixed_text_menuitem, 108, 18);
- gui_fixed_text_menuitem_set_text_position(&MMI_fixed_text_menuitem, 2, 0);
- MMI_fixed_text_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- for (i = 0; i < MAX_FIXED_TEXT_MENU_ITEMS && i < MAX_FIXED_MENU_ITEM_POINTERS; i++)
- {
- MMI_fixed_text_menuitems[i].flags = 0;
- MMI_fixed_menuitem_pointers[i] = (void*)&MMI_fixed_text_menuitems[i];
- }
- fixed_text_menuitem_apply_current_theme();
- }
- /*****************************************************************************
- * FUNCTION
- * resize_fixed_text_menuitems
- * DESCRIPTION
- * Changes the size of all fixed text menuitems
- * PARAMETERS
- * width [IN] Are the new dimensions
- * height [IN] Are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void resize_fixed_text_menuitems(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (width == 0)
- {
- width = MMI_fixed_text_menuitem.width;
- }
- if (height == 0)
- {
- height = MMI_fixed_text_menuitem.height;
- }
- gui_resize_fixed_text_menuitem(&MMI_fixed_text_menuitem, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_text_list
- * DESCRIPTION
- * Associates fixed text menuitems with the fixed list menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_text_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_fixed_list_highlight_handler();
- gui_set_fixed_list_menu_item_functions(
- &MMI_fixed_list_menu,
- gui_show_fixed_text_menuitem,
- gui_measure_fixed_text_menuitem,
- gui_highlight_fixed_text_menuitem,
- gui_remove_highlight_fixed_text_menuitem,
- UI_fixed_menuitem_dummy_hide_function,
- resize_fixed_text_menuitems);
- #ifdef __MMI_TOUCH_SCREEN__
- gui_set_fixed_list_menu_item_pen_function(
- &MMI_fixed_list_menu,
- UI_fixed_menuitem_dummy_pen_function,
- MMI_FALSE,
- MMI_FALSE);
- #endif /* __MMI_TOUCH_SCREEN__ */
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
- #endif
- MMI_fixed_list_menu.first_displayed_item = 0;
- MMI_fixed_list_menu.highlighted_item = 0;
- fixed_text_menu_n_items = &MMI_fixed_list_menu.n_items;
- MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
- MMI_fixed_list_menu.common_item_data = &MMI_fixed_text_menuitem;
- MMI_fixed_text_menuitem.parent_list = &MMI_fixed_list_menu;
- MMI_fixed_text_menuitem.parent_matrix = NULL;
- MMI_fixed_text_menuitem.flags &= ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_DISABLE_HIGHLIGHT);
- MMI_fixed_text_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
- #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
- MMI_fixed_text_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
- #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
- MMI_fixed_text_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
- #endif
- (*fixed_text_menu_n_items) = 0;
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_SCROLLBAR)
- {
- resize_fixed_text_menuitems(MMI_fixed_list_menu.width - 4, get_menu_item_height());
- }
- else
- {
- resize_fixed_text_menuitems(
- MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1,
- get_menu_item_height());
- }
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
- MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
- #endif /* __MMI_TOUCH_SCREEN__ */
- MMI_disable_title_shortcut_display = 0;
- set_MMI_current_fixed_text_menuitem_theme_list();
- gui_set_fixed_text_menuitem_current_theme(&MMI_fixed_text_menuitem);
- wgui_text_menuitem_reset_scrolling = gui_fixed_text_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_text_menuitem_start_scroll;
- }
- /* For Draw Manager */
- /*****************************************************************************
- * FUNCTION
- * fixed_matrix_auto_disable_scrollbar
- * DESCRIPTION
- * Associates fixed text menuitems with the fixed list menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 fixed_matrix_auto_disable_scrollbar(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* return(gui_fixed_matrix_auto_disable_scrollbar(&MMI_fixed_text_menuitem)); */
- return (gui_fixed_matrix_auto_disable_scrollbar(&MMI_fixed_matrix_menu));
- }
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_text_matrix
- * DESCRIPTION
- * Associates fixed text menuitems with the fixed matrix menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_text_matrix(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_fixed_matrix_highlight_handler();
- gui_set_fixed_matrix_menu_item_functions(
- &MMI_fixed_matrix_menu,
- gui_show_fixed_text_menuitem,
- gui_measure_fixed_text_menuitem,
- gui_highlight_fixed_text_menuitem,
- gui_remove_highlight_fixed_text_menuitem,
- UI_fixed_menuitem_dummy_hide_function);
- MMI_fixed_matrix_menu.displayed_columns = 0;
- MMI_fixed_matrix_menu.displayed_rows = 0;
- MMI_fixed_matrix_menu.first_displayed_column = 0;
- MMI_fixed_matrix_menu.first_displayed_row = 0;
- MMI_fixed_matrix_menu.highlighted_column = 0;
- MMI_fixed_matrix_menu.highlighted_row = 0;
- MMI_fixed_matrix_menu.highlighted_item = 0;
- fixed_text_menu_n_items = &MMI_fixed_matrix_menu.n_items;
- MMI_fixed_matrix_menu.items = MMI_fixed_menuitem_pointers;
- MMI_fixed_matrix_menu.common_item_data = &MMI_fixed_text_menuitem;
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_fixed_matrix_menu.pen_event_current_selected_callback_function = NULL;
- MMI_fixed_matrix_menu.pen_event_default_selected_callback_function = NULL;
- #endif /* __MMI_TOUCH_SCREEN__ */
- MMI_fixed_text_menuitem.parent_list = NULL;
- MMI_fixed_text_menuitem.parent_matrix = &MMI_fixed_matrix_menu;
- MMI_fixed_text_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_DISABLE_BACKGROUND;
- (*fixed_text_menu_n_items) = 0;
- resize_fixed_matrix_menuitems = resize_fixed_text_menuitems;
- MMI_disable_title_shortcut_display = 1;
- set_MMI_current_fixed_text_menuitem_theme_matrix();
- gui_set_fixed_text_menuitem_current_theme(&MMI_fixed_text_menuitem);
- }
- /*****************************************************************************
- * FUNCTION
- * add_fixed_text_item
- * DESCRIPTION
- * Adds an item to the list of fixed text menuitems
- *
- * Adds the menuitem to the end of the list
- * PARAMETERS
- * s [IN] Is the string that is displayed for this menuitem
- * RETURNS
- * void
- *****************************************************************************/
- void add_fixed_text_item(UI_string_type s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_text_menu_n_items) >= MAX_FIXED_TEXT_MENU_ITEMS)
- {
- return;
- }
- MMI_fixed_text_menuitems[(*fixed_text_menu_n_items)].text = s;
- (*fixed_text_menu_n_items)++;
- }
- /*****************************************************************************
- * FUNCTION
- * add_location_fixed_text_item
- * DESCRIPTION
- * Adds an item to the list of fixed text menuitems
- *
- * The item is added at the specified location
- * PARAMETERS
- * index [IN] (zero based) is the location at which the new item is added
- * s [IN] Is the string that is displayed for this menuitem
- * RETURNS
- * void
- *****************************************************************************/
- void add_location_fixed_text_item(S32 index, UI_string_type s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_text_menu_n_items) >= MAX_FIXED_TEXT_MENU_ITEMS)
- {
- return;
- }
- for (i = (*fixed_text_menu_n_items); i > index; i--)
- {
- MMI_fixed_text_menuitems[i] = MMI_fixed_text_menuitems[i - 1];
- }
- MMI_fixed_text_menuitems[index].text = s;
- (*fixed_text_menu_n_items)++;
- }
- /*****************************************************************************
- * FUNCTION
- * remove_fixed_text_item
- * DESCRIPTION
- * Removes a specified item from the fixed list
- * PARAMETERS
- * index [IN] (zero based) is the location of the item to be removed
- * RETURNS
- * void
- *****************************************************************************/
- void remove_fixed_text_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_text_menu_n_items) <= 0)
- {
- return;
- }
- for (i = index; i < (*fixed_text_menu_n_items) - 1; i++)
- {
- MMI_fixed_text_menuitems[i] = MMI_fixed_text_menuitems[i + 1];
- }
- (*fixed_text_menu_n_items)--;
- }
- /*****************************************************************************
- * FUNCTION
- * add_fixed_text_items
- * DESCRIPTION
- * Adds an array of items to the list of fixed text menuitems
- *
- * Items are added in the same order as in the input arrays
- * PARAMETERS
- * n_items [IN] Is the number of items to be added
- * s [IN] Is an array of strings, each string is displayed as
- * one(?) [IN] Menuitem
- * RETURNS
- * void
- *****************************************************************************/
- void add_fixed_text_items(S32 n_items, UI_string_type *s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_items > MAX_FIXED_TEXT_MENU_ITEMS)
- {
- n_items = MAX_FIXED_TEXT_MENU_ITEMS;
- }
- for (i = 0; i < n_items; i++)
- {
- MMI_fixed_text_menuitems[i].text = s[i];
- }
- (*fixed_text_menu_n_items) = n_items;
- }
- /* Fixed icontext item wrappers */
- fixed_icontext_menuitem MMI_fixed_icontext_menuitem;
- /* fixed_icontext_menuitem_type MMI_fixed_icontext_menuitems[MAX_FIXED_ICONTEXT_MENU_ITEMS]; */
- fixed_icontext_menuitem_type *MMI_fixed_icontext_menuitems = (fixed_icontext_menuitem_type *) & integratedMenus;
- S32 *fixed_icontext_menu_n_items;
- /* PMT VIKAS START 20050630 */
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- /*****************************************************************************
- * FUNCTION
- * disable_fixed_icontext_menuitem_transparent_effect
- * DESCRIPTION
- * Disable the transparent effect flag for inline category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void disable_fixed_icontext_menuitem_transparent_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_fixed_icontext_disable_transparent_effect(&MMI_fixed_icontext_menuitem);
- gui_block_transparency_effect();
- }
- /*****************************************************************************
- * FUNCTION
- * enable_fixed_icontext_menuitem_transparent_effect
- * DESCRIPTION
- * Enable the transparent effect flag.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void enable_fixed_icontext_menuitem_transparent_effect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_unblock_transparency_effect();
- gui_fixed_icontext_enable_transparent_effect(&MMI_fixed_icontext_menuitem);
- }
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- /* PMT VIKAS END 20050630 */
- /*****************************************************************************
- * FUNCTION
- * fixed_icontext_menuitem_apply_current_theme
- * DESCRIPTION
- * Applies the current theme to the fixed icontext menuitems
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_icontext_menuitem_apply_current_theme(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_fixed_icontext_menuitem_current_theme(&MMI_fixed_icontext_menuitem);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_icontext_menuitem_apply_theme
- * DESCRIPTION
- * Applies the given theme to the fixed icontext menuitems
- * PARAMETERS
- * t [?]
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_icontext_menuitem_apply_theme(UI_fixed_icontext_menuitem_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_fixed_icontext_menuitem_theme(&MMI_fixed_icontext_menuitem, t);
- }
- /*****************************************************************************
- * FUNCTION
- * create_fixed_icontext_menuitems
- * DESCRIPTION
- * Creates a list of icontext menuitems
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void create_fixed_icontext_menuitems(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_create_fixed_icontext_menuitem(&MMI_fixed_icontext_menuitem, 108, 18);
- gui_fixed_icontext_menuitem_set_text_position(&MMI_fixed_icontext_menuitem, 24, 0);
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
- /* PMT NEERAJ START 20050825 */
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- gui_set_current_two_line_menuitem_data = set_current_two_line_menuitem_data;
- MMI_fixed_icontext_menuitem.ext_flags &= ~UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT;
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- /* PMT NEERAJ END 20050825 */
- for (i = 0; i < MAX_FIXED_ICONTEXT_MENU_ITEMS && i < MAX_FIXED_MENU_ITEM_POINTERS; i++)
- {
- MMI_fixed_icontext_menuitems[i].flags = 0;
- /* PMT MANISH START 20050722 */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- MMI_fixed_icontext_menuitems[i].ext_flags = 0;
- #endif
- /* PMT MANISH END 20050722 */
- MMI_fixed_menuitem_pointers[i] = (void*)&MMI_fixed_icontext_menuitems[i];
- MMI_fixed_icontext_menuitems[i].item_icon_handle = GDI_ERROR_HANDLE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * stop_fixed_icontext_menuitem_animation
- * DESCRIPTION
- * Creates a list of icontext menuitems
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void stop_fixed_icontext_menuitem_animation(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_icontext_menuitems[index].item_icon_handle != GDI_ERROR_HANDLE)
- {
- gdi_image_stop_animation(MMI_fixed_icontext_menuitems[index].item_icon_handle);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * resize_fixed_icontext_menuitems
- * DESCRIPTION
- * Resizes all fixed icontext menuitems
- * PARAMETERS
- * width [IN] Are the new dimensions
- * height [IN] Are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void resize_fixed_icontext_menuitems(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (width == 0)
- {
- width = MMI_fixed_icontext_menuitem.width;
- }
- if (height == 0)
- {
- height = MMI_fixed_icontext_menuitem.height;
- }
- gui_resize_fixed_icontext_menuitem(&MMI_fixed_icontext_menuitem, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_icontext_list
- * DESCRIPTION
- * Associates the list of fixed icontext menuitems with the fixed list
- * PARAMETERS
- * void
- * width(?) [IN] Height are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_icontext_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_fixed_list_highlight_handler();
- gui_set_fixed_list_menu_item_functions(
- &MMI_fixed_list_menu,
- gui_show_fixed_icontext_menuitem,
- gui_measure_fixed_icontext_menuitem,
- gui_highlight_fixed_icontext_menuitem,
- gui_remove_highlight_fixed_icontext_menuitem,
- gui_hide_fixed_icontext_menuitem,
- resize_fixed_icontext_menuitems);
- #ifdef __MMI_TOUCH_SCREEN__
- gui_set_fixed_list_menu_item_pen_function(
- &MMI_fixed_list_menu,
- gui_fixed_icontext_menuitem_translate_pen_event,
- MMI_FALSE,
- MMI_FALSE);
- #endif /* __MMI_TOUCH_SCREEN__ */
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
- #endif
- MMI_fixed_list_menu.first_displayed_item = 0;
- MMI_fixed_list_menu.highlighted_item = 0;
- fixed_icontext_menu_n_items = &MMI_fixed_list_menu.n_items;
- MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
- MMI_fixed_icontext_menuitem.parent_list = &MMI_fixed_list_menu;
- MMI_fixed_icontext_menuitem.parent_matrix = NULL;
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_DISABLE_HIGHLIGHT;
- /* PMT NEERAJ START 20050712 */
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- MMI_fixed_icontext_menuitem.ext_flags &= ~UI_MENUITEM_SHOW_ALL_HINTS;
- MMI_fixed_icontext_menuitem.ext_flags &= ~UI_MENUITEM_SHOW_HIGHLIGHTED_HINT;
- MMI_fixed_icontext_menuitem.ext_flags &= ~UI_MENUITEM_SHOW_ICON_ONLY_ON_HIGHLIGHT;
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- /* PMT NEERAJ END 20050712 */
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
- #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
- #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
- #endif
- MMI_fixed_list_menu.common_item_data = (void*)&MMI_fixed_icontext_menuitem;
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
- MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
- #endif /* __MMI_TOUCH_SCREEN__ */
- (*fixed_icontext_menu_n_items) = 0;
- // resize_fixed_icontext_menuitems(MMI_fixed_list_menu.width-MMI_fixed_list_menu.vbar.width-3,MMI_MENUITEM_HEIGHT);
- //MTK Leo add, leave 1 pixel between hilightbar and scrollbar
- resize_fixed_icontext_menuitems(
- MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1,
- get_menu_item_height());
- MMI_disable_title_shortcut_display = 0;
- set_MMI_current_fixed_icontext_menuitem_theme_list();
- gui_set_fixed_icontext_menuitem_current_theme(&MMI_fixed_icontext_menuitem);
- wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_menuitem_start_scroll;
- }
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_icontext_matrix
- * DESCRIPTION
- * Associates the list of fixed icontext menuitems with the fixed matrix
- * PARAMETERS
- * void
- * width(?) [IN] Height are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_icontext_matrix(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_fixed_matrix_highlight_handler();
- gui_set_fixed_matrix_menu_item_functions(
- &MMI_fixed_matrix_menu,
- gui_show_fixed_icontext_menuitem,
- gui_measure_fixed_icontext_menuitem,
- gui_highlight_fixed_icontext_menuitem,
- gui_remove_highlight_fixed_icontext_menuitem,
- gui_hide_fixed_icontext_menuitem);
- MMI_fixed_matrix_menu.displayed_columns = 0;
- MMI_fixed_matrix_menu.displayed_rows = 0;
- MMI_fixed_matrix_menu.first_displayed_column = 0;
- MMI_fixed_matrix_menu.first_displayed_row = 0;
- MMI_fixed_matrix_menu.highlighted_column = 0;
- MMI_fixed_matrix_menu.highlighted_row = 0;
- MMI_fixed_matrix_menu.highlighted_item = 0;
- MMI_fixed_matrix_menu.last_hilited_x = -1;
- MMI_fixed_matrix_menu.last_hilited_y = -1;
- MMI_fixed_matrix_menu.last_highlighted_item = -1;
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_fixed_matrix_menu.pen_event_current_selected_callback_function = NULL;
- MMI_fixed_matrix_menu.pen_event_default_selected_callback_function = NULL;
- #endif /* __MMI_TOUCH_SCREEN__ */
- fixed_icontext_menu_n_items = &MMI_fixed_matrix_menu.n_items;
- MMI_fixed_matrix_menu.items = MMI_fixed_menuitem_pointers;
- MMI_fixed_icontext_menuitem.parent_list = NULL;
- MMI_fixed_icontext_menuitem.parent_matrix = &MMI_fixed_matrix_menu;
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
- MMI_fixed_matrix_menu.common_item_data = &MMI_fixed_icontext_menuitem;
- (*fixed_icontext_menu_n_items) = 0;
- resize_fixed_matrix_menuitems = resize_fixed_icontext_menuitems;
- MMI_disable_title_shortcut_display = 1;
- set_MMI_current_fixed_icontext_menuitem_theme_matrix();
- gui_set_fixed_icontext_menuitem_current_theme(&MMI_fixed_icontext_menuitem);
- /* MTK Leo add 20050225, for new list_matrix menu style */
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_menuitem_start_scroll;
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- /* MTK Leo add 20050225 end */
- }
- /*****************************************************************************
- * FUNCTION
- * center_fixed_icontext_positions
- * DESCRIPTION
- * Sets center justification of text and icons within the fixed icontext menuitems
- * PARAMETERS
- * tx [IN] Center text horizontally | These flags can have the values
- * ty [IN] Center text vertically | 0 or 1. If a flag is 1, then the
- * ix [IN] Center icon horizontally | action specified with the flag will
- * iy [IN] Center icon vertically | be performed.
- * RETURNS
- * void
- *****************************************************************************/
- void center_fixed_icontext_positions(U8 tx, U8 ty, U8 ix, U8 iy)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_menuitem.flags &=
- ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_CENTER_TEXT_Y | UI_MENUITEM_CENTER_ICON_X |
- UI_MENUITEM_CENTER_ICON_Y);
- if (tx)
- {
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X;
- }
- if (ty)
- {
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- }
- if (ix)
- {
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_X;
- }
- if (iy)
- {
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * set_fixed_icontext_positions
- * DESCRIPTION
- * Sets the positions of text and icons within the fixed icontext menuitems
- * PARAMETERS
- * tx [IN] X position of text | If this value is 0, the text will be centered horizontally
- * ty [IN] Y position of text | If this value is 0, the text will be centered vertically
- * ix [IN] X position of icon | If this value is 0, the icon will be centered horizontally
- * iy [IN] Y position of icon | If this value is 0, the icon will be centered vertically
- * RETURNS
- * void
- *****************************************************************************/
- void set_fixed_icontext_positions(S32 tx, S32 ty, S32 ix, S32 iy)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_menuitem.flags &=
- ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_CENTER_TEXT_Y | UI_MENUITEM_CENTER_ICON_X |
- UI_MENUITEM_CENTER_ICON_Y);
- if (tx)
- {
- MMI_fixed_icontext_menuitem.text_x = tx;
- gui_resize_fixed_icontext_menuitem(
- &MMI_fixed_icontext_menuitem,
- MMI_fixed_icontext_menuitem.width,
- MMI_fixed_icontext_menuitem.height);
- }
- else
- {
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X;
- }
- if (ty)
- {
- MMI_fixed_icontext_menuitem.text_y = ty;
- }
- else
- {
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- }
- if (ix)
- {
- MMI_fixed_icontext_menuitem.icon_x = ix;
- }
- else
- {
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_X;
- }
- if (iy)
- {
- MMI_fixed_icontext_menuitem.icon_y = iy;
- }
- else
- {
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * add_fixed_icontext_item
- * DESCRIPTION
- * Adds a new item to the list of fixed icontext menuitems
- *
- * Adds the item to the end of the list
- * PARAMETERS
- * s [IN] Is the string for the item
- * img [IN] Is the icon for the item
- * RETURNS
- * void
- *****************************************************************************/
- void add_fixed_icontext_item(UI_string_type s, PU8 img)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_icontext_menu_n_items) >= MAX_FIXED_ICONTEXT_MENU_ITEMS)
- {
- return;
- }
- MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items)].item_text = s;
- MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items)].item_icon = img;
- MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items)].item_icon_handle = GDI_ERROR_HANDLE;
- (*fixed_icontext_menu_n_items)++;
- }
- /*****************************************************************************
- * FUNCTION
- * change_fixed_icontext_item
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * s [IN]
- * img [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void change_fixed_icontext_item(S32 index, UI_string_type s, PU8 img)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_menuitems[index].item_text = s;
- MMI_fixed_icontext_menuitems[index].item_icon = img;
- }
- /*****************************************************************************
- * FUNCTION
- * add_location_fixed_icontext_item
- * DESCRIPTION
- * Adds a new item to the list of fixed icontext menuitems
- *
- * Adds the item at the specified location
- * PARAMETERS
- * index [IN] (zero based) is the location at which the item is added
- * s [IN] Is the string for the item
- * img [IN] Is the icon for the item
- * RETURNS
- * void
- *****************************************************************************/
- void add_location_fixed_icontext_item(S32 index, UI_string_type s, PU8 img)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_icontext_menu_n_items) >= MAX_FIXED_ICONTEXT_MENU_ITEMS)
- {
- return;
- }
- for (i = (*fixed_icontext_menu_n_items); i > index; i--)
- {
- MMI_fixed_icontext_menuitems[i] = MMI_fixed_icontext_menuitems[i - 1];
- }
- MMI_fixed_icontext_menuitems[index].item_text = s;
- MMI_fixed_icontext_menuitems[index].item_icon = img;
- (*fixed_icontext_menu_n_items)++;
- }
- /*****************************************************************************
- * FUNCTION
- * remove_fixed_icontext_item
- * DESCRIPTION
- * Removes a specified item
- * PARAMETERS
- * index [IN] (zero based) is the location of the item to be removed
- * RETURNS
- * void
- *****************************************************************************/
- void remove_fixed_icontext_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_icontext_menu_n_items) <= 0)
- {
- return;
- }
- for (i = index; i < (*fixed_icontext_menu_n_items) - 1; i++)
- {
- MMI_fixed_icontext_menuitems[i] = MMI_fixed_icontext_menuitems[i + 1];
- }
- (*fixed_icontext_menu_n_items)--;
- }
- /*****************************************************************************
- * FUNCTION
- * add_fixed_icontext_items
- * DESCRIPTION
- * Adds an array of items
- *
- * Adds items to the list in the same order as they were specified in the input arrays
- * PARAMETERS
- * n_items [IN] Is the number of items to be added
- * s [IN] Is an array of strings, each string is taken as one item
- * img [OUT] Is an array of images, each image is associated with one item
- * RETURNS
- * void
- *****************************************************************************/
- void add_fixed_icontext_items(S32 n_items, UI_string_type *s, PU8 *img)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_items > MAX_FIXED_ICONTEXT_MENU_ITEMS)
- {
- n_items = MAX_FIXED_ICONTEXT_MENU_ITEMS;
- }
- for (i = 0; i < n_items; i++)
- {
- MMI_fixed_icontext_menuitems[i].item_text = s[i];
- #ifdef __MMI_SLIM_LISTMENU__
- MMI_fixed_icontext_menuitems[i].item_icon = (PU8) GetImage(IMG_GLOBAL_L1 + i);
- #else
- MMI_fixed_icontext_menuitems[i].item_icon = img[i];
- #endif
- }
- (*fixed_icontext_menu_n_items) = n_items;
- }
- /* fixed icontext list wrappers */
- fixed_icontext_list_menuitem MMI_fixed_icontext_list_menuitem;
- /* fixed_icontext_list_menuitem_type MMI_fixed_icontext_list_menuitems[MAX_FIXED_ICONTEXT_LIST_MENU_ITEMS]; */
- fixed_icontext_list_menuitem_type *MMI_fixed_icontext_list_menuitems =
- (fixed_icontext_list_menuitem_type *) & integratedMenus;
- S32 *fixed_icontext_list_menu_n_items;
- /* MTK Leo add 20050225, for new list_matrix menu style */
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- fixed_icontext_list_menuitem_type _MMI_fixed_icontext_list_menuitems[MAX_MAIN_MENU_ITEMS];
- /* fixed_icontext_list_menuitem_type* MMI_fixed_icontext_list_menuitems2= _MMI_fixed_icontext_list_menuitems; */
- /*****************************************************************************
- * FUNCTION
- * set_fixed_icontext_list_type2
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void set_fixed_icontext_list_type2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_list_menuitems = _MMI_fixed_icontext_list_menuitems;
- }
- /*****************************************************************************
- * FUNCTION
- * restore_fixed_icontext_list_type
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void restore_fixed_icontext_list_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_list_menuitems = (fixed_icontext_list_menuitem_type*) & integratedMenus;
- }
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- /* MTK Leo add 20050225 end */
- /*****************************************************************************
- * FUNCTION
- * fixed_icontext_list_menuitem_total
- * DESCRIPTION
- * to get total number of icontext list menuitem
- * PARAMETERS
- * void
- * RETURNS
- * number of icontext list menuitem
- *****************************************************************************/
- S32 fixed_icontext_list_menuitem_total(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (*fixed_icontext_list_menu_n_items);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_icontext_list_menuitem_apply_current_theme
- * DESCRIPTION
- * Applies the current theme to the fixed icontext list menuitems
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_icontext_list_menuitem_apply_current_theme(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_fixed_icontext_list_menuitem_current_theme(&MMI_fixed_icontext_list_menuitem);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_icontext_list_menuitem_apply_theme
- * DESCRIPTION
- * Applies the given theme to the fixed icontext list menuitems
- * PARAMETERS
- * t [?]
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_icontext_list_menuitem_apply_theme(UI_fixed_icontext_list_menuitem_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_fixed_icontext_list_menuitem_theme(&MMI_fixed_icontext_list_menuitem, t);
- }
- /*****************************************************************************
- * FUNCTION
- * create_fixed_icontext_list_menuitems
- * DESCRIPTION
- * Creates a list of fixed icontext list menuitems
- * PARAMETERS
- * n_text_columns [IN] Is the number of text columns in each item
- * n_icon_columns [IN] Is the number of icon columns in each item
- * RETURNS
- * void
- *****************************************************************************/
- void create_fixed_icontext_list_menuitems(S32 n_text_columns, S32 n_icon_columns)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_create_fixed_icontext_list_menuitem(&MMI_fixed_icontext_list_menuitem, 108, 18, n_text_columns, n_icon_columns);
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
- for (i = 0; i < MAX_FIXED_ICONTEXT_LIST_MENU_ITEMS && i < MAX_FIXED_MENU_ITEM_POINTERS; i++)
- {
- S32 j = 0;
- MMI_fixed_icontext_list_menuitems[i].flags = 0;
- MMI_fixed_menuitem_pointers[i] = (void*)&MMI_fixed_icontext_list_menuitems[i];
- for (j = 0; j < FIXED_ICONTEXT_LIST_MAX_ICON_COLUMNS; j++)
- {
- MMI_fixed_icontext_list_menuitems[i].item_icon_handles[j] = GDI_ERROR_HANDLE;
- }
- }
- }
- /* MTK Leo add 20050225, for new list_matrix menu style */
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- /*****************************************************************************
- * FUNCTION
- * create_fixed_icontext_list_menuitems2
- * DESCRIPTION
- *
- * PARAMETERS
- * n_text_columns [IN]
- * n_icon_columns [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void create_fixed_icontext_list_menuitems2(S32 n_text_columns, S32 n_icon_columns)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_create_fixed_icontext_list_menuitem(&MMI_fixed_icontext_list_menuitem, 108, 18, n_text_columns, n_icon_columns);
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
- for (i = 0; i < MAX_MAIN_MENU_ITEMS; i++)
- {
- MMI_fixed_icontext_list_menuitems[i].flags = 0;
- MMI_fixed_menuitem_pointers2[i] = (void*)&MMI_fixed_icontext_list_menuitems[i];
- }
- }
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- /* MTK Leo end 20050225 */
- /*****************************************************************************
- * FUNCTION
- * set_fixed_icontext_list_menuitems_post_display
- * DESCRIPTION
- * Register callback handler after an icontext-list menu item is displayed
- *
- * Icontext-list menu item is a general form of menu item that has more than one text & icon item
- * It can be further extended by registering post-display function.
- * PARAMETERS
- * post_display_function [IN] Callback function
- * RETURNS
- * void
- *****************************************************************************/
- void
- set_fixed_icontext_list_menuitems_post_display(
- void (*post_display_function) (void *item, void *common_item_data, S32 x, S32 y))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_fixed_icontext_list_menuitem_set_post_display(&MMI_fixed_icontext_list_menuitem, post_display_function);
- }
- /*****************************************************************************
- * FUNCTION
- * resize_fixed_icontext_list_menuitems
- * DESCRIPTION
- * Resizes all the fixed icontext list menuitems
- * PARAMETERS
- * width [IN] Are the new dimensions
- * height [IN] Are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void resize_fixed_icontext_list_menuitems(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (width == 0)
- {
- width = MMI_fixed_icontext_list_menuitem.width;
- }
- if (height == 0)
- {
- height = MMI_fixed_icontext_list_menuitem.height;
- }
- gui_resize_fixed_icontext_list_menuitem(&MMI_fixed_icontext_list_menuitem, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * set_fixed_icontext_list_text_coordinates
- * DESCRIPTION
- * Sets the co-ordinates of a given text column
- * PARAMETERS
- * c [IN] Is the index of the text column (zero based)
- * x [IN] Position of the text column within the item
- * y [IN] Position of the text column within the item
- * width [IN] Are the dimensions of the text column
- * height [IN] Are the dimensions of the text column
- * RETURNS
- * void
- *****************************************************************************/
- void set_fixed_icontext_list_text_coordinates(S32 c, S32 x, S32 y, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_fixed_icontext_list_menuitem_set_text_coordinates(&MMI_fixed_icontext_list_menuitem, c, x, y, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * set_fixed_icontext_list_icon_coordinates
- * DESCRIPTION
- * Sets the co-ordinates of a given icon column
- * PARAMETERS
- * c [IN] Is the index of the icon column (zero based)
- * x [IN] Position of the icon column within the item
- * y [IN] Position of the icon column within the item
- * width [IN] Are the dimensions of the icon column
- * height [IN] Are the dimensions of the icon column
- * RETURNS
- * void
- *****************************************************************************/
- void set_fixed_icontext_list_icon_coordinates(S32 c, S32 x, S32 y, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_fixed_icontext_list_menuitem_set_icon_coordinates(&MMI_fixed_icontext_list_menuitem, c, x, y, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_icontext_list_list
- * DESCRIPTION
- * Associates the list of fixed icontext list menu items with the fixed list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_icontext_list_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_fixed_list_highlight_handler();
- gui_set_fixed_list_menu_item_functions(
- &MMI_fixed_list_menu,
- gui_show_fixed_icontext_list_menuitem,
- gui_measure_fixed_icontext_list_menuitem,
- gui_highlight_fixed_icontext_list_menuitem,
- gui_remove_highlight_fixed_icontext_list_menuitem,
- UI_fixed_menuitem_dummy_hide_function,
- resize_fixed_icontext_list_menuitems);
- #ifdef __MMI_TOUCH_SCREEN__
- gui_set_fixed_list_menu_item_pen_function(
- &MMI_fixed_list_menu,
- UI_fixed_menuitem_dummy_pen_function,
- MMI_FALSE,
- MMI_FALSE);
- #endif /* __MMI_TOUCH_SCREEN__ */
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
- #endif
- MMI_fixed_list_menu.first_displayed_item = 0;
- MMI_fixed_list_menu.highlighted_item = 0;
- fixed_icontext_list_menu_n_items = &MMI_fixed_list_menu.n_items;
- MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
- MMI_fixed_icontext_list_menuitem.parent_list = &MMI_fixed_list_menu;
- MMI_fixed_icontext_list_menuitem.parent_matrix = NULL;
- MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_DISABLE_HIGHLIGHT;
- MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_AUTO_CHOOSE_MARQUEE;
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
- #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
- #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
- #endif
- MMI_fixed_list_menu.common_item_data = &MMI_fixed_icontext_list_menuitem;
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
- MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
- #endif /* __MMI_TOUCH_SCREEN__ */
- (*fixed_icontext_list_menu_n_items) = 0;
- resize_fixed_icontext_list_menuitems(MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1, get_menu_item_height()); /* MMI_menuitem_height); */
- MMI_disable_title_shortcut_display = 0;
- set_MMI_current_fixed_icontext_list_menuitem_theme_list();
- gui_set_fixed_icontext_list_menuitem_current_theme(&MMI_fixed_icontext_list_menuitem);
- wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_list_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_list_menuitem_start_scroll;
- }
- /* MTK Leo add 20050225, for new list_matrix menu style */
- #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_icontext_list_list2
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_icontext_list_list2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- associate_fixed_icontext_list_list();
- MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers2;
- }
- #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */
- /* MTK Leo end 20050225 */
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_icontext_list_matrix
- * DESCRIPTION
- * Associates the list of fixed icontext list menu items with the fixed matrix
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_icontext_list_matrix(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_fixed_matrix_highlight_handler();
- gui_set_fixed_matrix_menu_item_functions(
- &MMI_fixed_matrix_menu,
- gui_show_fixed_icontext_list_menuitem,
- gui_measure_fixed_icontext_list_menuitem,
- gui_highlight_fixed_icontext_list_menuitem,
- gui_remove_highlight_fixed_icontext_list_menuitem,
- UI_fixed_menuitem_dummy_hide_function);
- MMI_fixed_matrix_menu.displayed_columns = 0;
- MMI_fixed_matrix_menu.displayed_rows = 0;
- MMI_fixed_matrix_menu.first_displayed_column = 0;
- MMI_fixed_matrix_menu.first_displayed_row = 0;
- MMI_fixed_matrix_menu.highlighted_column = 0;
- MMI_fixed_matrix_menu.highlighted_row = 0;
- MMI_fixed_matrix_menu.highlighted_item = 0;
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_fixed_matrix_menu.pen_event_current_selected_callback_function = NULL;
- MMI_fixed_matrix_menu.pen_event_default_selected_callback_function = NULL;
- #endif /* __MMI_TOUCH_SCREEN__ */
- fixed_icontext_list_menu_n_items = &MMI_fixed_matrix_menu.n_items;
- MMI_fixed_matrix_menu.items = MMI_fixed_menuitem_pointers;
- MMI_fixed_icontext_list_menuitem.parent_list = NULL;
- MMI_fixed_icontext_list_menuitem.parent_matrix = &MMI_fixed_matrix_menu;
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
- MMI_fixed_matrix_menu.common_item_data = &MMI_fixed_icontext_list_menuitem;
- (*fixed_icontext_list_menu_n_items) = 0;
- resize_fixed_matrix_menuitems = resize_fixed_icontext_list_menuitems;
- MMI_disable_title_shortcut_display = 1;
- set_MMI_current_fixed_icontext_list_menuitem_theme_matrix();
- gui_set_fixed_icontext_list_menuitem_current_theme(&MMI_fixed_icontext_list_menuitem);
- }
- /*****************************************************************************
- * FUNCTION
- * remove_all_fixed_icontext_item
- * DESCRIPTION
- * remove all items in fixed list menu
- *
- * See fixed_icontext_list_item_insert()
- * PARAMETERS
- * void
- * img(?) [IN] Is the image to be displayed in this item
- * n_items(?) [IN] (zero based) index of the item
- * s(?) [IN] Is the string to be displayed in this item
- * RETURNS
- * void
- *****************************************************************************/
- void remove_all_fixed_icontext_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_icontext_list_menu_n_items) <= 0)
- {
- return;
- }
- (*fixed_icontext_list_menu_n_items) = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * add_fixed_icontext_items_200
- * DESCRIPTION
- * add one item in fixed icontext list menu for category200
- *
- * See fixed_icontext_list_item_insert()
- * PARAMETERS
- * n_items [IN] (zero based) index of the item
- * s [IN] Is the string to be displayed in this item
- * img [IN] Is the image to be displayed in this item
- * RETURNS
- * void
- *****************************************************************************/
- void add_fixed_icontext_items_200(S32 n_items, UI_string_type *s, PU8 *img)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_items > MAX_FIXED_ICONTEXT_MENU_ITEMS)
- {
- n_items = MAX_FIXED_ICONTEXT_MENU_ITEMS;
- }
- for (i = 0; i < n_items; i++)
- {
- MMI_fixed_icontext_list_menuitems[i].item_texts[0] = s[i];
- MMI_fixed_icontext_list_menuitems[i].item_icons[0] = img[i];
- }
- (*fixed_icontext_menu_n_items) = n_items;
- }
- /*****************************************************************************
- * FUNCTION
- * add_fixed_icontext_list_item_text
- * DESCRIPTION
- * changes the text in the specified column of an item
- *
- * See fixed_icontext_list_item_insert()
- * PARAMETERS
- * index [IN] (zero based) index of the item
- * c [IN] Is the text column index (zero based)
- * s [IN] Is the string to be displayed in this text column
- * RETURNS
- * void
- *****************************************************************************/
- void add_fixed_icontext_list_item_text(S32 index, S32 c, UI_string_type s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_list_menuitems[index].item_texts[c] = s;
- }
- /*****************************************************************************
- * FUNCTION
- * add_fixed_icontext_list_item_icon
- * DESCRIPTION
- * changes the icon in the specified column of an item
- *
- * See fixed_icontext_list_item_insert()
- * PARAMETERS
- * index [IN] (zero based) index of the item
- * c [IN] Is the icon column index (zero based)
- * img [IN] Is the icon to be displayed in this icon column
- * RETURNS
- * void
- *****************************************************************************/
- void add_fixed_icontext_list_item_icon(S32 index, S32 c, PU8 img)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_list_menuitems[index].item_icons[c] = img;
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_icontext_list_item_insert
- * DESCRIPTION
- * Inserts a new item to the list of fixed icontext list menuitems
- *
- * Automatically shifts the items to insert the new item
- * This function is normally called before calling
- * add_fixed_icontext_list_item_text() and
- * add_fixed_icontext_list_item_icon()
- * PARAMETERS
- * index [IN] (zero based) index at which a new item is inserted
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_icontext_list_item_insert(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_icontext_list_menu_n_items) >= MAX_FIXED_ICONTEXT_LIST_MENU_ITEMS)
- {
- return;
- }
- for (i = 0; i < FIXED_ICONTEXT_LIST_MAX_ICON_COLUMNS; i++)
- {
- MMI_fixed_icontext_list_menuitems[index].item_icons[i] = NULL;
- MMI_fixed_icontext_list_menuitems[index].item_icon_handles[i] = GDI_ERROR_HANDLE;
- }
- for (i = 0; i < FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS; i++)
- {
- MMI_fixed_icontext_list_menuitems[index].item_texts[i] = NULL;
- }
- for (i = (*fixed_icontext_list_menu_n_items); i > index; i--)
- {
- MMI_fixed_icontext_list_menuitems[i] = MMI_fixed_icontext_list_menuitems[i - 1];
- }
- (*fixed_icontext_list_menu_n_items)++;
- }
- /*****************************************************************************
- * FUNCTION
- * remove_fixed_icontext_list_item
- * DESCRIPTION
- * Removes an item at the specified index
- * PARAMETERS
- * index [IN] (zero based) index of the item to be removed
- * RETURNS
- * void
- *****************************************************************************/
- void remove_fixed_icontext_list_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((*fixed_icontext_list_menu_n_items) <= 0)
- {
- return;
- }
- for (i = index; i < (*fixed_icontext_list_menu_n_items) - 1; i++)
- {
- MMI_fixed_icontext_list_menuitems[i] = MMI_fixed_icontext_list_menuitems[i + 1];
- }
- (*fixed_icontext_list_menu_n_items)--;
- }
- /* Fixed twostate item wrappers */
- fixed_twostate_menuitem MMI_fixed_twostate_menuitem;
- fixed_twostate_menuitem_type *MMI_fixed_twostate_menuitems = (fixed_twostate_menuitem_type *) & integratedMenus;
- /* fixed_twostate_menuitem_type MMI_fixed_twostate_menuitems[MAX_FIXED_TWOSTATE_MENU_ITEMS]; */
- S32 *fixed_twostate_menu_n_items;
- /*****************************************************************************
- * FUNCTION
- * fixed_twostate_menuitem_apply_current_theme
- * DESCRIPTION
- * Applies the current theme to the fixed twostate menuitems
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_twostate_menuitem_apply_current_theme(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_fixed_twostate_menuitem_current_theme(&MMI_fixed_twostate_menuitem);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_twostate_menuitem_apply_theme
- * DESCRIPTION
- * Applies the current theme to the fixed twostate menuitems
- * PARAMETERS
- * t [?]
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_twostate_menuitem_apply_theme(UI_fixed_twostate_menuitem_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_fixed_twostate_menuitem_theme(&MMI_fixed_twostate_menuitem, t);
- }
- /*****************************************************************************
- * FUNCTION
- * create_fixed_twostate_menuitems
- * DESCRIPTION
- * Creates a list of fixed twostate menuitems
- * PARAMETERS
- * ON_icon [IN]
- * OFF_icon [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void create_fixed_twostate_menuitems(PU8 ON_icon, PU8 OFF_icon)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_create_fixed_twostate_menuitem(&MMI_fixed_twostate_menuitem, 108, MMI_MENUITEM_HEIGHT, ON_icon, OFF_icon); /* 082205 Calvin modified */
- gui_fixed_twostate_menuitem_set_text_position(&MMI_fixed_twostate_menuitem, 24, 0);
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
- for (i = 0; i < MAX_FIXED_TWOSTATE_MENU_ITEMS && i < MAX_FIXED_MENU_ITEM_POINTERS; i++)
- {
- MMI_fixed_twostate_menuitems[i].flags = 0;
- MMI_fixed_menuitem_pointers[i] = (void*)&MMI_fixed_twostate_menuitems[i];
- }
- }
- /*****************************************************************************
- * FUNCTION
- * resize_fixed_twostate_menuitems
- * DESCRIPTION
- * Resizes all the fixed twostate menuitems
- * PARAMETERS
- * width [IN] Are the new dimensions
- * height [IN] Are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void resize_fixed_twostate_menuitems(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (width == 0)
- {
- width = MMI_fixed_twostate_menuitem.width;
- }
- if (height == 0)
- {
- height = MMI_fixed_twostate_menuitem.height;
- }
- gui_resize_fixed_twostate_menuitem(&MMI_fixed_twostate_menuitem, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_twostate_list
- * DESCRIPTION
- * Associates the list of fixed twostate menuitems with the fixed list
- * PARAMETERS
- * void
- * width(?) [IN] Height are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_twostate_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_fixed_list_highlight_handler();
- gui_set_fixed_list_menu_item_functions(
- &MMI_fixed_list_menu,
- gui_show_fixed_twostate_menuitem,
- gui_measure_fixed_twostate_menuitem,
- gui_highlight_fixed_twostate_menuitem,
- gui_remove_highlight_fixed_twostate_menuitem,
- UI_fixed_menuitem_dummy_hide_function,
- resize_fixed_twostate_menuitems);
- #ifdef __MMI_TOUCH_SCREEN__
- gui_set_fixed_list_menu_item_pen_function(
- &MMI_fixed_list_menu,
- gui_fixed_twostate_menuitem_translate_pen_event,
- MMI_FALSE,
- MMI_TRUE);
- #endif /* __MMI_TOUCH_SCREEN__ */
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
- #endif
- MMI_fixed_list_menu.first_displayed_item = 0;
- MMI_fixed_list_menu.highlighted_item = 0;
- fixed_twostate_menu_n_items = &MMI_fixed_list_menu.n_items;
- MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
- MMI_fixed_twostate_menuitem.parent_list = &MMI_fixed_list_menu;
- MMI_fixed_twostate_menuitem.parent_matrix = NULL;
- MMI_fixed_twostate_menuitem.flags &= ~UI_MENUITEM_DISABLE_HIGHLIGHT;
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
- #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
- #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
- #endif
- MMI_fixed_list_menu.common_item_data = (void*)&MMI_fixed_twostate_menuitem;
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
- MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
- #endif /* __MMI_TOUCH_SCREEN__ */
- (*fixed_twostate_menu_n_items) = 0;
- resize_fixed_twostate_menuitems(MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1, get_menu_item_height()); /* MMI_menuitem_height); */
- MMI_disable_title_shortcut_display = 0;
- set_MMI_current_fixed_twostate_menuitem_theme_list();
- gui_set_fixed_twostate_menuitem_current_theme(&MMI_fixed_twostate_menuitem);
- wgui_text_menuitem_reset_scrolling = gui_fixed_twostate_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_twostate_menuitem_start_scroll;
- }
- /*****************************************************************************
- * FUNCTION
- * associate_fixed_twostate_matrix
- * DESCRIPTION
- * Associates the list of fixed twostate menuitems with the fixed matrix
- * PARAMETERS
- * void
- * width(?) [IN] Height are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void associate_fixed_twostate_matrix(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_fixed_matrix_highlight_handler();
- gui_set_fixed_matrix_menu_item_functions(
- &MMI_fixed_matrix_menu,
- gui_show_fixed_twostate_menuitem,
- gui_measure_fixed_twostate_menuitem,
- gui_highlight_fixed_twostate_menuitem,
- gui_remove_highlight_fixed_twostate_menuitem,
- UI_fixed_menuitem_dummy_hide_function);
- MMI_fixed_matrix_menu.displayed_columns = 0;
- MMI_fixed_matrix_menu.displayed_rows = 0;
- MMI_fixed_matrix_menu.first_displayed_column = 0;
- MMI_fixed_matrix_menu.first_displayed_row = 0;
- MMI_fixed_matrix_menu.highlighted_column = 0;
- MMI_fixed_matrix_menu.highlighted_row = 0;
- MMI_fixed_matrix_menu.highlighted_item = 0;
- #ifdef __MMI_TOUCH_SCREEN__
- MMI_fixed_matrix_menu.pen_event_current_selected_callback_function = NULL;
- MMI_fixed_matrix_menu.pen_event_default_selected_callback_function = NULL;
- #endif /* __MMI_TOUCH_SCREEN__ */
- fixed_twostate_menu_n_items = &MMI_fixed_matrix_menu.n_items;
- MMI_fixed_matrix_menu.items = MMI_fixed_menuitem_pointers;
- MMI_fixed_twostate_menuitem.parent_list = NULL;
- MMI_fixed_twostate_menuitem.parent_matrix = &MMI_fixed_matrix_menu;
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
- MMI_fixed_matrix_menu.common_item_data = &MMI_fixed_twostate_menuitem;
- (*fixed_twostate_menu_n_items) = 0;
- resize_fixed_matrix_menuitems = resize_fixed_twostate_menuitems;
- MMI_disable_title_shortcut_display = 1;
- set_MMI_current_fixed_twostate_menuitem_theme_matrix();
- gui_set_fixed_twostate_menuitem_current_theme(&MMI_fixed_twostate_menuitem);
- }
- /*****************************************************************************
- * FUNCTION
- * center_fixed_twostate_positions
- * DESCRIPTION
- * Sets center justification of text and icons within the fixed twostate menuitems
- * PARAMETERS
- * tx [IN] Center text horizontally | These flags can have the values
- * ty [IN] Center text vertically | 0 or 1. If a flag is 1, then the
- * ix [IN] Center icon horizontally | action specified with the flag will
- * iy [IN] Center icon vertically | be performed.
- * RETURNS
- * void
- *****************************************************************************/
- void center_fixed_twostate_positions(U8 tx, U8 ty, U8 ix, U8 iy)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_twostate_menuitem.flags &=
- ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_CENTER_TEXT_Y | UI_MENUITEM_CENTER_ICON_X |
- UI_MENUITEM_CENTER_ICON_Y);
- if (tx)
- {
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X;
- }
- if (ty)
- {
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- }
- if (ix)
- {
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_ICON_X;
- }
- if (iy)
- {
- MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * set_fixed_twostate_positions
- * DESCRIPTION
- * Sets the positions of text and icons within the fixed twostate menuitems
- * PARAMETERS
- * tx [IN] X position of text | If this value is 0, the text will be centered horizontally
- * ty [IN] Y position of text | If this value is 0, the text will be centered vertically
- * ix [IN] X position of icon | If this value is 0, the icon will be centered horizontally
- * iy [IN] Y position of icon | If this value is 0, the icon will be centered vertically
- * RETURNS
- * void
- *****************************************************************************/
- void set_fixed_twostate_positions(S32 tx, S32 ty, S32 ix, S32 iy)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_twostate_menuitem.flags &=
- ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_CENTER_TEXT_Y | UI_MENUITEM_CENTER_ICON_X |
- UI_MENUITEM_CENTER_ICON_Y);
- /* if(tx) MMI_fixed_twostate_menuitem.text_x=tx; */
- if (tx)
- {
- MMI_fixed_twostate_menuitem.text_x = tx;
- gui_resize_fixed_twostate_menuitem(
- &MMI_fixed_twostate_menuitem,
- MMI_fixed_twostate_menuitem.width,
- MMI_fixed_twostate_menuitem.height);
- }
- else