wgui_fixed_menus.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:186k
源码类别:
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_menus.c
- *
- * Project:
- * --------
- * Maui_Software
- *
- * Description:
- * ------------
- * fixed menu 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!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- ****************************************************************************/
- /*
- * Copyright Notice
- * (c) 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_menus.c
- Author: manju
- Date Created: August-07-2002
- Contains: PixTel UI wrapper routines for Fixed Menus
- **********************************************************************************/
- #include "CustDataRes.h"
- #include "wgui_fixed_menus.h"
- #include "wgui_categories.h"
- #include "wgui_categories_defs.h"
- #include "gui_custom_menus.h"
- #include "gdi_include.h"
- #include "MainMenuType.h"
- #include "DebugInitDef.h"
- /* PMT HIMANSHU START 20050625 */
- #ifdef __MMI_UI_TECHNO_MAINMENU__
- #include "MainMenuDef.h"
- #endif
- //PMT HIMANSHU END
- //PMT VIKAS START 20050707
- //PMT VIKAS START 20051217
- #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
- /* PMT VIKAS END 20051217 */
- #include "MainMenuDef.h"
- #define NUMBER_OF_FRAMES 7 /* Number of transitions in Ball Animation in Main Menu. */
- /* size of buffer allocated to ball. */
- #define BALL_BUFFER ((BALL_WIDTH) * (BALL_HEIGHT) * 2)
- #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */
- /* PMT VIKAS END 20050707 */
- #include "GlobalDefs.h" /* 051105 Calvin added */
- #include "wgui_draw_manager.h"
- /* PMT NEERAJ START 20050616 */
- #ifdef __MMI_UI_TAB_PANE__
- #include "wgui_tab.h"
- #endif
- /* PMT NEERAJ END 20050616 */
- #include "ProfilingEngine.h"
- BOOL wgui_fixed_list_show_empty = MMI_TRUE; /* 051605 Calvin added */
- extern BOOL r2lMMIFlag; /* 051105 Calvin added */
- /* PMT HIMANSHU START 20050625 */
- #ifdef __MMI_UI_TECHNO_MAINMENU__
- enum
- {
- TECHNO_MENU_ANIMATION_FRAME_ONE = 0,
- TECHNO_MENU_ANIMATION_FRAME_TWO = 0,
- TECHNO_MENU_ANIMATION_FRAME_THREE = 0,
- TECHNO_MENU_ANIMATION_FRAME_FOUR,
- TECHNO_MENU_ANIMATION_FRAME_FIVE
- };
- PU8 Techno_bgimage[BACKGROUND_FRAMES];
- MMTechno_animo_menu Techno_menu[MAX_MAIN_MENU_ITEMS];
- S32 frame = 0;
- S32 current_frame = 1;
- U8 is_next_item = 0;
- #endif /* __MMI_UI_TECHNO_MAINMENU__ */
- /* PMT HIMANSHU END */
- /* 072904 Calvin moved for centralized control */
- // #define ENABLE_LIST_MENU_FRAME_SKIPPING 1
- /* Calvin end */
- /* MTK Leo add for new main menu category 1216 */
- extern void draw_bg(void);
- extern void draw_bg_animation(void);
- /* MTK Leo end 1216 */
- /* Dummy highlight handler */
- /*****************************************************************************
- * FUNCTION
- * dummy_highlight_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void dummy_highlight_handler(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item_index);
- }
- /* 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]; */
- /* Fixed list menu Wrappers */
- void (*_MMI_hide_fixed_list_menu) (void) = UI_dummy_function;
- fixed_list_menu MMI_fixed_list_menu;
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
- S32 wgui_fixed_list_menu_frame_counter = 0;
- #endif
- //PMT VIKAS START 20050707
- //PMT VIKAS START 20051217
- #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
- #ifdef __MMI_MAINLCD_176X220__
- S32 ball1pos[NUMBER_OF_FRAMES][2] = { {116, 41},
- {97, 51},
- {81, 71},
- {80, 86},
- {81, 71},
- {97, 51},
- {116, 41}
- };
- S32 ball2pos[NUMBER_OF_FRAMES][2] = { {-2, 134},
- {7, 111},
- {38, 93},
- {35, 86},
- {38, 93},
- {7, 134},
- {-2, 134}
- };
- #elif defined(__MMI_MAINLCD_128X160__)
- S32 ball1pos[NUMBER_OF_FRAMES][2] = { {85, 12},
- {68, 30},
- {50, 40},
- {40, 50},
- {50, 40},
- {68, 30},
- {85, 12}
- };
- S32 ball2pos[NUMBER_OF_FRAMES][2] = { {-8, 95},
- {1, 80},
- {10, 60},
- {20, 50},
- {10, 60},
- {1, 80},
- {-8, 95}
- };
- #endif
- /* PMT VIKAS END 20051217 */
- MM_balls ball[NUMBER_OF_BALLS];
- U8 ballimgdata[NUMBER_OF_BALLS][BALL_BUFFER];
- U8 is_next_item = 0;
- /*****************************************************************************
- * FUNCTION
- * initialize_balls
- * DESCRIPTION
- * initialize the balls position and buffer.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void initialize_balls(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ball[0].position = &ball1pos[0][0];
- ball[1].position = &ball2pos[0][0];
- memset(&ball[0].image, 0, sizeof(bitmap));
- memset(&ball[1].image, 0, sizeof(bitmap));
- memset(&ballimgdata[0], 0, BALL_BUFFER);
- memset(&ballimgdata[1], 0, BALL_BUFFER);
- ball[0].image.data = ballimgdata[0];
- ball[1].image.data = ballimgdata[1];
- }
- #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */
- /* PMT VIKAS END 20050707 */
- /*****************************************************************************
- * FUNCTION
- * create_fixed_list
- * DESCRIPTION
- * Creates a fixed list menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void create_fixed_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_create_fixed_list_menu(
- &MMI_fixed_list_menu,
- MMI_content_x,
- MMI_content_y,
- MMI_content_width,
- MMI_content_height);
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
- wgui_fixed_list_menu_frame_counter = 0;
- #endif
- /* PMT NEERAJ START 20050825 */
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- reset_fixed_icontext_menuitem_type();
- #endif
- /* PMT NEERAJ END 20050825 */
- }
- /*****************************************************************************
- * FUNCTION
- * plain_fixed_list
- * DESCRIPTION
- * The fixed list will be displayed in plain mode
- * (No background or scrollbars)
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void plain_fixed_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.flags |= (UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_DISABLE_SCROLLBAR);
- }
- /*****************************************************************************
- * FUNCTION
- * normal_fixed_list
- * DESCRIPTION
- * Puts the list menu back into normal display mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void normal_fixed_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.flags &=
- ~(UI_LIST_MENU_ALIGN_TO_TOP | UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_DISABLE_SCROLLBAR |
- UI_LIST_MENU_ENABLE_TRANSITION | UI_LIST_MENU_DISABLE_CACHE_DYNAMIC_DATA |
- UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER | UI_LIST_MENU_DISABLE_PEN);
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
- _MMI_hide_fixed_list_menu = UI_dummy_function;
- }
- /*****************************************************************************
- * FUNCTION
- * register_hide_fixed_list
- * DESCRIPTION
- * Registers a function to be used to hide the list menu
- * during plain display
- * PARAMETERS
- * f [IN] Is the function that is called whenever the fixed list
- * menu(?) [IN] Needs to be hidden.
- * RETURNS
- * void
- *****************************************************************************/
- void register_hide_fixed_list(void (*f) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- _MMI_hide_fixed_list_menu = f;
- }
- /*****************************************************************************
- * FUNCTION
- * move_fixed_list
- * DESCRIPTION
- * Moves the fixed list menu
- * PARAMETERS
- * x [IN] Is the new menu position
- * y [IN] Is the new menu position
- * RETURNS
- * void
- *****************************************************************************/
- void move_fixed_list(S32 x, S32 y)
- { /* Pixtel - Gurinder - 1/21/04 - Move the fixed list 1 pixel right and 1 pixel down if ListBox is defined. */
- #if defined(__MMI_PLUTO_LISTBOX__)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_fixed_list_menu(&MMI_fixed_list_menu, x + 1, y + 1);
- #else /* defined(__MMI_PLUTO_LISTBOX__) */
- gui_move_fixed_list_menu(&MMI_fixed_list_menu, x, y);
- #endif /* defined(__MMI_PLUTO_LISTBOX__) */
- }
- /*****************************************************************************
- * FUNCTION
- * register_fixed_list_highlight_handler
- * DESCRIPTION
- * Registers the highlight handler for the fixed list
- * PARAMETERS
- * f [IN] Is the function that acts as the highlight handler
- * which(?) [IN] Is the index number of the item that was highlighted (zero based)
- * This(?) [IN] Function is called with the parameter item_index,
- * RETURNS
- * void
- *****************************************************************************/
- void register_fixed_list_highlight_handler(void (*f) (S32 item_index))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.item_highlighted = f;
- }
- /*****************************************************************************
- * FUNCTION
- * register_fixed_list_unhighlight_handler
- * DESCRIPTION
- * Registers the highlight handler for the fixed list
- * PARAMETERS
- * f [IN] Is the function that acts as the handler when a control is unhighlighted
- * which(?) [IN] Is the index number of the item that was highlighted (zero based)
- * This(?) [IN] Function is called with the parameter item_index,
- * RETURNS
- * void
- *****************************************************************************/
- void register_fixed_list_unhighlight_handler(void (*f) (S32 item_index))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.item_unhighlighted = f;
- }
- /* PMT NEERAJ START 20050425 */
- #ifdef __MMI_UI_LIST_TRANSITION__
- #include "gdi_include.h"
- #ifdef MMI_ON_WIN32
- #define MMI_UI_LIST_TRANSITION_COUNT 20;
- #else
- #define MMI_UI_LIST_TRANSITION_COUNT 10;
- #endif
- wgui_transition_styles MMI_list_transition_style = WGUI_TRANSITION_NONE;
- S32 MMI_check_list_for_transition = 1;
- /*****************************************************************************
- * FUNCTION
- * set_list_transition
- * DESCRIPTION
- * This functions sets the transition style for list
- * PARAMETERS
- * style [IN] The style in which the list should transiate T2D or D2T
- * RETURNS
- * void
- *****************************************************************************/
- void set_list_transition(wgui_transition_styles style)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_list_transition_style = style;
- }
- /*****************************************************************************
- * FUNCTION
- * get_list_transition
- * DESCRIPTION
- * This functions returns the transition style for list
- * PARAMETERS
- * void
- * RETURNS
- * The style in which the list is transiating T2D or D2T
- *****************************************************************************/
- wgui_transition_styles get_list_transition(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return MMI_list_transition_style;
- }
- /*****************************************************************************
- * FUNCTION
- * reset_list_transition
- * DESCRIPTION
- * This functions resets the transition style for list to none
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void reset_list_transition(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_list_transition_style = WGUI_TRANSITION_NONE;
- }
- /*****************************************************************************
- * FUNCTION
- * draw_transition_list
- * DESCRIPTION
- * This functions draws the transition list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void draw_transition_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (MMI_list_transition_style)
- {
- case WGUI_TRANSITION_D2T:
- {
- S32 prev_y = MMI_fixed_list_menu.y;
- S32 prev_height = MMI_fixed_list_menu.height;
- S32 i, transition_count;
- S32 transition_resolution;
- i = transition_count = MMI_UI_LIST_TRANSITION_COUNT;
- transition_resolution = MMI_fixed_list_menu.height / transition_count;
- MMI_fixed_list_menu.y = MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 1;
- MMI_fixed_list_menu.height = 0;
- /* 051005 Calvin modified */
- /* flag = MMI_fixed_list_menu.flags; */
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_ENABLE_TRANSITION;
- /* MMI_fixed_list_menu.flags|=UI_LIST_MENU_DISABLE_BACKGROUND|UI_LIST_MENU_ENABLE_TRANSITION|UI_LIST_MENU_DISABLE_SCROLLBAR; */
- while (i - 1)
- {
- MMI_fixed_list_menu.y -= transition_resolution;
- MMI_fixed_list_menu.height += transition_resolution;
- move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
- MMI_fixed_list_menu.top = 0;
- show_fixed_list();
- i--;
- }
- /* MMI_fixed_list_menu.flags = flag | UI_LIST_MENU_DISABLE_BACKGROUND|UI_LIST_MENU_ENABLE_TRANSITION; */
- MMI_fixed_list_menu.height = prev_height;
- MMI_fixed_list_menu.y = prev_y;
- move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
- /* Calvin end */
- show_fixed_list();
- }
- break;
- case WGUI_TRANSITION_T2D:
- {
- S32 prev_y = MMI_fixed_list_menu.y;
- S32 prev_height = MMI_fixed_list_menu.height;
- S32 i, transition_count;
- S32 transition_resolution;
- i = transition_count = MMI_UI_LIST_TRANSITION_COUNT;
- transition_resolution = MMI_fixed_list_menu.height / transition_count;
- MMI_fixed_list_menu.y -= (MMI_fixed_list_menu.height - 1);
- /* 051005 Calvin modified */
- /* flag = MMI_fixed_list_menu.flags; */
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_ENABLE_TRANSITION;
- /* MMI_fixed_list_menu.flags|=UI_LIST_MENU_DISABLE_BACKGROUND|UI_LIST_MENU_ENABLE_TRANSITION|UI_LIST_MENU_DISABLE_SCROLLBAR; */
- while (i - 1)
- {
- MMI_fixed_list_menu.y += transition_resolution;
- move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
- MMI_fixed_list_menu.top = 0;
- show_fixed_list();
- gui_BLT_double_buffer(
- MMI_fixed_list_menu.x,
- prev_y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- prev_y + prev_height - 1);
- i--;
- }
- /* MMI_fixed_list_menu.flags = flag | UI_LIST_MENU_DISABLE_BACKGROUND|UI_LIST_MENU_ENABLE_TRANSITION; */
- MMI_fixed_list_menu.height = prev_height;
- MMI_fixed_list_menu.y = prev_y;
- move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
- /* Calvin end */
- show_fixed_list();
- gui_BLT_double_buffer(
- MMI_fixed_list_menu.x,
- prev_y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- prev_y + prev_height - 1);
- leave_full_screen();
- }
- break;
- }
- }
- /* PMT VIKAS START 20051209 */
- #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
- static S32 g_in_list_transition = 0;
- static S32 g_prev_list_y;
- static S32 g_prev_list_height;
- /*****************************************************************************
- * FUNCTION
- * wgui_list_tranisition_abort_cleanup_function
- * DESCRIPTION
- * This is the clean uo function for the list transition style
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_list_tranisition_abort_cleanup_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_stop_list_transition_non_blocking();
- }
- /*****************************************************************************
- * FUNCTION
- * draw_transition_list_non_blocking
- * DESCRIPTION
- * This function is used to draw list transition with timer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void draw_transition_list_non_blocking(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static S32 temp_count, transition_count;
- static S32 transition_resolution;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (MMI_list_transition_style)
- {
- case WGUI_TRANSITION_D2T:
- {
- if (is_in_nonblocking_list_transition() == 0)
- {
- g_in_list_transition = 1;
- save_copy_original_list_data();
- temp_count = transition_count = MMI_UI_LIST_TRANSITION_COUNT;
- transition_resolution = MMI_fixed_list_menu.height / transition_count;
- MMI_fixed_list_menu.y = MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 1;
- MMI_fixed_list_menu.height = 0;
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_ENABLE_TRANSITION;
- gui_add_cleanup_hook(wgui_list_tranisition_abort_cleanup_function);
- }
- MMI_fixed_list_menu.y -= transition_resolution;
- MMI_fixed_list_menu.height += transition_resolution;
- move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
- MMI_fixed_list_menu.top = 0;
- show_fixed_list();
- gui_BLT_double_buffer(
- MMI_fixed_list_menu.x,
- g_prev_list_y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- g_prev_list_y + g_prev_list_height - 1);
- temp_count--;
- if (temp_count > 1)
- {
- gui_start_timer(LIST_TRANSITION_NON_BLOCKING_TIMER, draw_transition_list_non_blocking);
- }
- else
- {
- restore_saved_original_list_data();
- wgui_stop_list_transition_non_blocking();
- g_in_list_transition = 0;
- move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
- show_fixed_list();
- }
- break;
- }
- case WGUI_TRANSITION_T2D:
- {
- if (is_in_nonblocking_list_transition() == 0)
- {
- g_in_list_transition = 1;
- save_copy_original_list_data();
- temp_count = transition_count = MMI_UI_LIST_TRANSITION_COUNT;
- transition_resolution = MMI_fixed_list_menu.height / transition_count;
- MMI_fixed_list_menu.y -= (MMI_fixed_list_menu.height - 1);
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_ENABLE_TRANSITION;
- gui_add_cleanup_hook(wgui_list_tranisition_abort_cleanup_function);
- }
- MMI_fixed_list_menu.y += transition_resolution;
- move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
- MMI_fixed_list_menu.top = 0;
- gui_lock_double_buffer();
- gui_push_clip();
- gui_set_clip(
- MMI_fixed_list_menu.x,
- g_prev_list_y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- g_prev_list_y + g_prev_list_height - 1);
- show_fixed_list();
- gui_pop_clip();
- draw_title();
- show_status_icons();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(
- MMI_fixed_list_menu.x,
- 0,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- g_prev_list_y + g_prev_list_height - 1);
- temp_count--;
- if (temp_count > 1)
- {
- gui_start_timer(LIST_TRANSITION_NON_BLOCKING_TIMER, draw_transition_list_non_blocking);
- }
- else
- {
- restore_saved_original_list_data();
- move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
- wgui_stop_list_transition_non_blocking();
- show_fixed_list();
- gui_BLT_double_buffer(
- MMI_fixed_list_menu.x,
- g_prev_list_y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- g_prev_list_y + g_prev_list_height - 1);
- }
- break;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_stop_list_transition_non_blocking
- * DESCRIPTION
- * This function is used to stop the timer for list transition & reset variables
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_stop_list_transition_non_blocking(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (is_in_nonblocking_list_transition())
- {
- MMI_fixed_list_menu.height = g_prev_list_height;
- MMI_fixed_list_menu.y = g_prev_list_y;
- g_in_list_transition = 0;
- }
- reset_list_transition();
- gui_cancel_timer(draw_transition_list_non_blocking);
- }
- /*****************************************************************************
- * FUNCTION
- * is_in_nonblocking_list_transition
- * DESCRIPTION
- * This function return the non blocking list transition flag
- * PARAMETERS
- * void
- * RETURNS
- * S32
- *****************************************************************************/
- S32 is_in_nonblocking_list_transition(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_in_list_transition;
- }
- /*****************************************************************************
- * FUNCTION
- * get_original_prev_list_y_value
- * DESCRIPTION
- * This function return the original value of list start y position
- * PARAMETERS
- * void
- * RETURNS
- * S32
- *****************************************************************************/
- S32 get_original_prev_list_y_value(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_prev_list_y;
- }
- /*****************************************************************************
- * FUNCTION
- * save_copy_original_list_data
- * DESCRIPTION
- * This function save the original value of list start y position and list height
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void save_copy_original_list_data(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_prev_list_y = MMI_fixed_list_menu.y;
- g_prev_list_height = MMI_fixed_list_menu.height;
- }
- /*****************************************************************************
- * FUNCTION
- * restore_saved_original_list_data
- * DESCRIPTION
- * This function restore the original value of list start y position and list height
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void restore_saved_original_list_data(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.height = g_prev_list_height;
- MMI_fixed_list_menu.y = g_prev_list_y;
- }
- #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */
- /* PMT VIKAS END 20051209 */
- #endif /* __MMI_UI_LIST_TRANSITION__ */
- /* PMT NEERAJ END 20050425 */
- /*****************************************************************************
- * FUNCTION
- * wgui_list_menu_show_empty_label_if_needed
- * DESCRIPTION
- * Displays "empty" in list menu if it's empty
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_list_menu_show_empty_label_if_needed(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 offset_x;
- S32 offset_y;
- S32 str_width;
- S32 str_height;
- S8 *str_ptr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items > 0 || !wgui_fixed_list_show_empty)
- {
- return;
- }
- gdi_layer_set_clip(
- MMI_fixed_list_menu.x,
- MMI_fixed_list_menu.y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width - 1,
- MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 1);
- gui_set_font(&MMI_medium_font);
- gui_set_text_color(gui_color(0, 0, 0));
- str_ptr = GetString(STR_GLOBAL_EMPTY);
- gui_measure_string((UI_string_type) str_ptr, &str_width, &str_height);
- offset_x = MMI_fixed_list_menu.x + ((MMI_fixed_list_menu.width - str_width) >> 1);
- offset_y = MMI_fixed_list_menu.y + ((MMI_fixed_list_menu.height - str_height) >> 1);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(offset_x + str_width, offset_y);
- }
- else
- {
- gui_move_text_cursor(offset_x, offset_y);
- }
- gui_print_text((UI_string_type) str_ptr);
- }
- /*****************************************************************************
- * FUNCTION
- * show_fixed_list
- * DESCRIPTION
- * Displays the fixed list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_display_fixed_text_list_pop_up_description(void);
- void show_fixed_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- gui_add_cleanup_hook(gui_stop_list_highlight_effect);
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- #ifdef __MMI_UI_LIST_TRANSITION__
- if (MMI_check_list_for_transition && MMI_list_transition_style)
- {
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_reset_current_list_effect();
- #endif
- MMI_check_list_for_transition = 0;
- #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
- if (is_in_nonblocking_list_transition() == 0)
- {
- draw_transition_list_non_blocking();
- }
- #else /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */
- draw_transition_list();
- #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */
- MMI_check_list_for_transition = 1;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
- if (is_in_nonblocking_list_transition() == 0)
- #endif
- gui_restore_current_list_effect();
- #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- return;
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- }
- #endif /* __MMI_UI_LIST_TRANSITION__ */
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
- {
- _MMI_hide_fixed_list_menu();
- }
- gui_show_fixed_list_menu(&MMI_fixed_list_menu);
- wgui_display_fixed_text_list_pop_up_description();
- #ifdef __MMI_UI_LIST_TRANSITION__
- #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
- if (get_list_transition() == WGUI_TRANSITION_T2D && !MMI_check_list_for_transition ||
- is_in_nonblocking_list_transition() == 1)
- {
- return;
- }
- #else /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */
- if (get_list_transition() == WGUI_TRANSITION_T2D && !MMI_check_list_for_transition)
- {
- return;
- }
- #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */
- #endif /* __MMI_UI_LIST_TRANSITION__ */
- /* if is emtpty folder, show a empty string */
- wgui_list_menu_show_empty_label_if_needed();
- gdi_layer_blt_previous(
- MMI_fixed_list_menu.x,
- MMI_fixed_list_menu.y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
- /*****************************************************************************
- * FUNCTION
- * wgui_fixed_list_menu_end_frame
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_fixed_list_menu_end_frame(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_fixed_list_menu_frame_counter >= 1)
- {
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
- {
- _MMI_hide_fixed_list_menu();
- }
- gui_hide_animations();
- gui_lock_double_buffer();
- gui_show_fixed_list_menu(&MMI_fixed_list_menu);
- wgui_display_fixed_text_list_pop_up_description();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(
- MMI_fixed_list_menu.x,
- MMI_fixed_list_menu.y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
- wgui_fixed_list_menu_frame_counter = 0;
- gui_start_timer(UI_FRAME_SKIP_TIMEOUT, wgui_fixed_list_menu_end_frame);
- }
- }
- #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */
- /*****************************************************************************
- * FUNCTION
- * redraw_fixed_list
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_fixed_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_current_menu_type == ANI_BG_LIST_MENU)
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- gdi_layer_lock_frame_buffer();
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
- {
- _MMI_hide_fixed_list_menu();
- }
- gui_show_fixed_list_menu(&MMI_fixed_list_menu);
- wgui_display_fixed_text_list_pop_up_description();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(
- MMI_fixed_list_menu.x,
- MMI_fixed_list_menu.y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
- }
- else
- {
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
- if (wgui_fixed_list_menu_frame_counter > 0)
- {
- wgui_fixed_list_menu_frame_counter++;
- gui_show_fixed_list_menu_no_draw(&MMI_fixed_list_menu);
- }
- else
- {
- wgui_fixed_list_menu_frame_counter = 1;
- gui_show_fixed_list_menu_no_draw(&MMI_fixed_list_menu);
- gui_start_timer(UI_FRAME_START_TIMEOUT, wgui_fixed_list_menu_end_frame);
- }
- #else /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */
- gdi_layer_lock_frame_buffer();
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
- {
- _MMI_hide_fixed_list_menu();
- }
- gui_show_fixed_list_menu(&MMI_fixed_list_menu);
- wgui_display_fixed_text_list_pop_up_description();
- gdi_layer_unlock_frame_buffer();
- #ifdef __MMI_UI_LIST_TRANSITION__
- #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
- if (get_list_transition() == WGUI_TRANSITION_T2D && is_in_nonblocking_list_transition() == 1)
- {
- gdi_layer_blt_previous(
- MMI_fixed_list_menu.x,
- g_prev_list_y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- g_prev_list_y + g_prev_list_height - 1);
- }
- else
- #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */
- #endif /* __MMI_UI_LIST_TRANSITION__ */
- gdi_layer_blt_previous(
- MMI_fixed_list_menu.x,
- MMI_fixed_list_menu.y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
- MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
- #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * clear_fixed_list_highlight_handler
- * DESCRIPTION
- * Clears the highlight handler for the fixed list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void clear_fixed_list_highlight_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.item_highlighted = dummy_highlight_handler;
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_previous_item
- * DESCRIPTION
- * Highlights the previous item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_previous_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- /* Max: to redraw list if there is only 1 item. */
- if (!((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))) /* return; */
- {
- #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
- if (MMI_current_menu_type == PAGE_MENU)
- {
- is_next_item = 0;
- show_animated_balls();
- }
- else
- #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */
- {
- gui_fixed_list_menu_goto_previous_item(&MMI_fixed_list_menu);
- }
- }
- #ifdef __MMI_UI_TAB_PANE__
- if (is_tab_pane_displayed_on_current_screen())
- {
- register_tab_pane_keys();
- }
- #endif /* __MMI_UI_TAB_PANE__ */
- #ifdef __MMI_UI_TECHNO_MAINMENU__
- if (MMI_current_menu_type == PAGE_MENU)
- {
- is_next_item = 0;
- associate_techno_item_positions(0);
- show_techno_menu_animation();
- }
- #endif /* __MMI_UI_TECHNO_MAINMENU__ */
- if (MMI_current_menu_type == PAGE_MENU)
- {
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- return;
- }
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- draw_bg();
- draw_bg_animation();
- }
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
- #endif
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- redraw_fixed_list();
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
- #endif
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_next_item
- * DESCRIPTION
- * Highlights the next item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_next_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- /* Max: to redraw list if there is only 1 item. */
- if (!((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))) /* return; */
- {
- #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
- if (MMI_current_menu_type == PAGE_MENU)
- {
- is_next_item = 1;
- show_animated_balls();
- }
- else
- #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */
- gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
- }
- #ifdef __MMI_UI_TAB_PANE__
- if (is_tab_pane_displayed_on_current_screen())
- {
- register_tab_pane_keys();
- }
- #endif /* __MMI_UI_TAB_PANE__ */
- #ifdef __MMI_UI_TECHNO_MAINMENU__
- if (MMI_current_menu_type == PAGE_MENU)
- {
- is_next_item = 1;
- associate_techno_item_positions(1);
- show_techno_menu_animation();
- }
- #endif /* __MMI_UI_TECHNO_MAINMENU__ */
- if (MMI_current_menu_type == PAGE_MENU)
- {
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- return;
- }
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- draw_bg();
- draw_bg_animation();
- }
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
- #endif
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- redraw_fixed_list();
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
- #endif
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_home
- * DESCRIPTION
- * Highlights the first item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_home(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- gui_fixed_list_menu_goto_first_item(&MMI_fixed_list_menu);
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- draw_bg();
- draw_bg_animation();
- }
- redraw_fixed_list();
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_end
- * DESCRIPTION
- * Highlights the last item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_end(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- gui_fixed_list_menu_goto_last_item(&MMI_fixed_list_menu);
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- draw_bg();
- draw_bg_animation();
- }
- redraw_fixed_list();
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_previous_page
- * DESCRIPTION
- * Highlights an item in the previous page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_previous_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- gui_fixed_list_menu_goto_previous_page(&MMI_fixed_list_menu);
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- draw_bg();
- draw_bg_animation();
- }
- redraw_fixed_list();
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_next_page
- * DESCRIPTION
- * Highlights an item in the next page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_next_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- gui_fixed_list_menu_goto_next_page(&MMI_fixed_list_menu);
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- draw_bg();
- draw_bg_animation();
- }
- redraw_fixed_list();
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_item
- * DESCRIPTION
- * Highlights a particular item
- * PARAMETERS
- * item_index [IN] Is the index number of the item to be highlighted (zero based)
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_item(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
- S32 i;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- if (item_index == MMI_fixed_list_menu.highlighted_item)
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- if (item_index >= MMI_fixed_list_menu.n_items)
- {
- gdi_layer_pop_and_restore_active();
- return;
- }
- gui_stop_list_highlight_effect();
- #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */
- gui_fixed_list_menu_goto_item(&MMI_fixed_list_menu, item_index);
- #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
- if (MMI_current_menu_type == PAGE_MENU)
- {
- gdi_layer_push_clip();
- gdi_layer_set_clip(
- MMI_content_x,
- MMI_content_y,
- UI_device_width - 1,
- UI_device_height - MMI_button_bar_height - 1);
- for (i = 0; i < NUMBER_OF_BALLS; i++)
- {
- gui_show_image(*(ball[i].position + 0), *(ball[i].position + 1), get_image(MAIN_MENU_DALMATIAN_BALL));
- }
- gdi_layer_pop_clip();
- }
- #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */
- #ifdef __MMI_UI_TAB_PANE__
- if (is_tab_pane_displayed_on_current_screen())
- {
- register_tab_pane_keys();
- }
- #endif /* __MMI_UI_TAB_PANE__ */
- if (MMI_current_menu_type == PAGE_MENU)
- {
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- return;
- }
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- draw_bg();
- draw_bg_animation();
- }
- redraw_fixed_list();
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_item_push_first
- * DESCRIPTION
- * Highlights a particular item and if possible makes it the first displayed item
- * PARAMETERS
- * item_index [IN] Is the index number of the item to be highlighted (zero based)
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_item_push_first(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- if (item_index == MMI_fixed_list_menu.highlighted_item)
- {
- return;
- }
- gdi_lcd_get_active(&act_lcd);
- gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
- gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_FIRST_SHIFT_HIGHLIGHTED_ITEM;
- gui_fixed_list_menu_goto_item(&MMI_fixed_list_menu, item_index);
- MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_FIRST_SHIFT_HIGHLIGHTED_ITEM;
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
- {
- draw_bg();
- draw_bg_animation();
- }
- redraw_fixed_list();
- gdi_layer_pop_and_restore_active();
- gdi_lcd_set_active(act_lcd);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_goto_item_no_redraw
- * DESCRIPTION
- * Highlights a particular item, but doesn't redraw the fixed list
- * PARAMETERS
- * item_index [IN] Is the index number of the item to be highlighted (zero based)
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_goto_item_no_redraw(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.n_items <= 0)
- {
- return;
- }
- if (item_index < 0)
- {
- item_index = 0;
- }
- if (item_index > (MMI_fixed_list_menu.n_items - 1))
- {
- item_index = MMI_fixed_list_menu.n_items - 1;
- }
- MMI_fixed_list_menu.highlighted_item = -1;
- gui_fixed_list_menu_goto_item(&MMI_fixed_list_menu, item_index);
- }
- /*****************************************************************************
- * FUNCTION
- * register_fixed_list_shortcut_handler
- * DESCRIPTION
- * Registers the shortcut handler for the fixed list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_fixed_list_shortcut_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_menu_shortcut_keys();
- register_menu_shortcut_handler(fixed_list_goto_item);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_key_handler
- * DESCRIPTION
- * Keyboard (simulator) handler for the fixed list
- *
- * Internal function
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_key_handler(S32 vkey_code, S32 key_state)
- {
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_state)
- {
- switch (vkey_code)
- {
- case 37:
- break;
- case 39:
- break;
- case 38:
- fixed_list_goto_previous_item();
- break;
- case 40:
- fixed_list_goto_next_item();
- break;
- case 36:
- fixed_list_goto_home();
- break;
- case 35:
- fixed_list_goto_end();
- break;
- case 33:
- fixed_list_goto_previous_page();
- break;
- case 34:
- fixed_list_goto_next_page();
- break;
- }
- }
- #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- UI_UNUSED_PARAMETER(vkey_code);
- UI_UNUSED_PARAMETER(key_state);
- #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_keyboard_input_handler
- * DESCRIPTION
- * Keyboard input (simulator) handler for the fixed list
- *
- * Internal function
- * PARAMETERS
- * keyc [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_keyboard_input_handler(S32 keyc)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(keyc);
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_measure
- * DESCRIPTION
- * Gets the dimensions of the fixed list
- * PARAMETERS
- * width [OUT] Are the dimensions
- * height [OUT] Are the dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_measure(S32 *width, S32 *height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *width = MMI_fixed_list_menu.width;
- *height = MMI_fixed_list_menu.height;
- }
- /*****************************************************************************
- * FUNCTION
- * resize_fixed_list
- * DESCRIPTION
- * Changes the size of the fixed list
- * PARAMETERS
- * width [IN] Are the new dimensions
- * height [IN] Are the new dimensions
- * RETURNS
- * void
- *****************************************************************************/
- void resize_fixed_list(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* Auto resize the height based on height of menu-items and the specified height */
- /* FIXME. move the following code to gui_resize_fixed_list_menu */
- S32 w, h = 0, new_height = height;
- S32 ih, mh, rh, sh, th, count;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.items != NULL)
- {
- MMI_fixed_list_menu.item_measure_function(
- MMI_fixed_list_menu.items[0],
- MMI_fixed_list_menu.common_item_data,
- &w,
- &h);
- }
- else
- {
- MMI_fixed_list_menu.item_measure_function(NULL, MMI_fixed_list_menu.common_item_data, &w, &h);
- }
- if (MMI_fixed_list_menu.flags & UI_LIST_MENU_ALIGN_TO_TOP)
- {
- MMI_fixed_list_menu.spacing = 0;
- MMI_fixed_list_menu.top = 1; /* FIXME. remove the magic number */
- }
- else if (h > 0)
- {
- ih = h;
- count = height / ih; /* MMI_fixed_list_menu.height/ih; */
- mh = count * ih;
- rh = height - mh; /* MMI_fixed_list_menu.height - mh; */
- sh = rh / (count + 1);
- th = (rh - (sh * (count - 1))) / 2;
- MMI_fixed_list_menu.spacing = sh;
- MMI_fixed_list_menu.top = rh - (sh * (count - 1)) - th;
- }
- if (MMI_fixed_list_menu.item_resize_function != NULL)
- {
- MMI_fixed_list_menu.item_resize_function(w, 0); /* Change width of menuitem according to list menu at the same time. */
- }
- gui_resize_fixed_list_menu(&MMI_fixed_list_menu, width, new_height);
- }
- /*****************************************************************************
- * FUNCTION
- * register_fixed_list_keys
- * DESCRIPTION
- * Registers the keyboard (simulator) and keypad handlers for the fixed list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_fixed_list_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_keyboard_key_handler(fixed_list_key_handler);
- SetKeyHandler(fixed_list_goto_previous_item, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(fixed_list_goto_next_item, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(fixed_list_goto_previous_item, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(fixed_list_goto_next_item, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- }
- /* PMT NEERAJ START 20050425 */
- #ifdef __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__
- /*****************************************************************************
- * FUNCTION
- * register_horizontal_fixed_list_keys
- * DESCRIPTION
- * Registers the keyboard (simulator) and keypad handlers for the horizontal fixed list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_horizontal_fixed_list_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(fixed_list_goto_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(fixed_list_goto_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__ */
- /* PMT NEERAJ END 20050425 */
- /*****************************************************************************
- * FUNCTION
- * reset_fixed_list
- * DESCRIPTION
- * Clears the key and highlight handlers for the fixed list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void reset_fixed_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT VIKAS START 20050720 */
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- /* PMT VIKAS END 20050720 */
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
- gui_cancel_timer(wgui_fixed_list_menu_end_frame);
- wgui_fixed_list_menu_frame_counter = 0;
- #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */
- normal_fixed_list();
- /* PMT VIKAS START 20050610 */
- #if defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__) /* 072505 Calvin modified */
- gui_reset_transparent_source_layer();
- #endif
- /* PMT VIKAS END */
- clear_keyboard_key_handler();
- ClearKeyHandler(KEY_UP_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- MMI_fixed_list_menu.item_highlighted = dummy_highlight_handler;
- MMI_fixed_list_menu.highlighted_item = -1;
- wgui_text_menuitem_reset_scrolling();
- gui_fixed_icontext_list_menuitem_stop_scroll();
- /* PMT NEERAJ START 20050825 */
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- reset_fixed_icontext_menuitem_type();
- #endif
- /* PMT NEERAJ END 20050825 */
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_disable_looping
- * DESCRIPTION
- * Disables looping
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_disable_looping(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_LOOP;
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_list_enable_looping
- * DESCRIPTION
- * Enables looping
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_list_enable_looping(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_LOOP;
- }
- /* Fixed matrix menu wrappers */
- fixed_matrix_menu MMI_fixed_matrix_menu;
- /*****************************************************************************
- * FUNCTION
- * dummy_fixed_matrix_resize_function
- * DESCRIPTION
- *
- * PARAMETERS
- * item_width [IN]
- * item_height [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void dummy_fixed_matrix_resize_function(S32 item_width, S32 item_height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(item_width);
- UI_UNUSED_PARAMETER(item_height);
- }
- void (*resize_fixed_matrix_menuitems) (S32 item_width, S32 item_height) = dummy_fixed_matrix_resize_function;
- /*****************************************************************************
- * FUNCTION
- * create_fixed_matrix
- * DESCRIPTION
- * Creates a fixed matrix menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void create_fixed_matrix(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_create_fixed_matrix_menu(
- &MMI_fixed_matrix_menu,
- MMI_content_x,
- MMI_content_y,
- MMI_content_width,
- MMI_content_height - MMI_matrix_bar_height);
- }
- /*****************************************************************************
- * FUNCTION
- * move_fixed_matrix
- * DESCRIPTION
- * Moves the fixed matrix menu to a new location
- * PARAMETERS
- * x [IN] Is the new left-top corner location
- * y [IN] Is the new left-top corner location
- * RETURNS
- * void
- *****************************************************************************/
- void move_fixed_matrix(S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_fixed_matrix_menu(&MMI_fixed_matrix_menu, x, y);
- }
- /*****************************************************************************
- * FUNCTION
- * show_fixed_matrix
- * DESCRIPTION
- * Displays the fixed matrix
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_MATRIX_MAIN_MENU_OPTIMIZE__
- extern PU8 MMI_mm_animation;
- #endif
- void show_fixed_matrix(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- /* gdi_image_stop_animation_all(); */
- if (MMI_current_menu_type == MATRIX_MENU_EMS)
- {
- gui_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
- }
- else
- {
- #ifdef __MMI_MATRIX_MAIN_MENU_OPTIMIZE__
- if (MMI_fixed_matrix_menu.flags & UI_MATRIX_MENU_FOR_MAINMENU)
- {
- gui_measure_image(
- MMI_mm_animation,
- &(MMI_fixed_matrix_menu.highlighted_item_width),
- &(MMI_fixed_matrix_menu.highlighted_item_height));
- if (MMI_fixed_matrix_menu.last_highlighted_item != -1)
- {
- mtk_UI_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
- }
- else
- {
- gui_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
- }
- }
- else
- {
- MMI_fixed_matrix_menu.highlighted_item_width = MMI_fixed_matrix_menu.item_width;
- MMI_fixed_matrix_menu.highlighted_item_height = MMI_fixed_matrix_menu.item_height;
- gui_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
- }
- #else /* __MMI_MATRIX_MAIN_MENU_OPTIMIZE__ */
- gui_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
- #endif /* __MMI_MATRIX_MAIN_MENU_OPTIMIZE__ */
- }
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(
- MMI_fixed_matrix_menu.x,
- MMI_fixed_matrix_menu.y,
- MMI_fixed_matrix_menu.x + MMI_fixed_matrix_menu.width - 1,
- MMI_fixed_matrix_menu.y + MMI_fixed_matrix_menu.height - 1);
- }
- /* For Draw Manager */
- /*****************************************************************************
- * FUNCTION
- * reset_fixed_matrix_col_rows
- * DESCRIPTION
- * Reset the fixed matrix
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void reset_fixed_matrix_col_rows(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_reset_fixed_matrix_col_rows(&MMI_fixed_matrix_menu);
- }
- /*****************************************************************************
- * FUNCTION
- * configure_fixed_matrix
- * DESCRIPTION
- * Sets the number of columns and rows and the dimensions of the menuitems
- * PARAMETERS
- * item_width [IN] Is the width of each item | Any one of these must be specified and the other
- * item_height [IN] Is the height of each item | Any one of these must be specified and the other
- * n_columns [IN] Is the number of columns to display | parameter can be zero
- * n_rows [IN] Is the number of rows to display | parameter can be zero
- * RETURNS
- * void
- *****************************************************************************/
- void configure_fixed_matrix(S32 item_width, S32 item_height, S32 n_columns, S32 n_rows)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_fixed_matrix_menu_setup(&MMI_fixed_matrix_menu, item_width, item_height, n_columns, n_rows);
- resize_fixed_matrix_menuitems(MMI_fixed_matrix_menu.item_width, MMI_fixed_matrix_menu.item_height);
- }
- /*****************************************************************************
- * FUNCTION
- * register_fixed_matrix_highlight_handler
- * DESCRIPTION
- * Registers the highlight handler for the fixed matrix menu
- * PARAMETERS
- * f [IN] Is the function that is called when an item is highlighted
- * which(?) [IN] Is the index number of the highlighted item (zero based)
- * This(?) [IN] Function is called with the parameter item_index,
- * RETURNS
- * void
- *****************************************************************************/
- void register_fixed_matrix_highlight_handler(void (*f) (S32 item_index))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_matrix_menu.item_highlighted = f;
- }
- /*****************************************************************************
- * FUNCTION
- * clear_fixed_matrix_highlight_handler
- * DESCRIPTION
- * Clears the highlight handler for the fixed matrix menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void clear_fixed_matrix_highlight_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_matrix_menu.item_highlighted = dummy_highlight_handler;
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_matrix_goto_previous_item
- * DESCRIPTION
- * Highlights the previous item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_matrix_goto_previous_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
- #endif
- gui_fixed_matrix_menu_goto_previous_item(&MMI_fixed_matrix_menu);
- show_fixed_matrix();
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_matrix_goto_next_item
- * DESCRIPTION
- * Highlights the next item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_matrix_goto_next_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
- #endif
- gui_fixed_matrix_menu_goto_next_item(&MMI_fixed_matrix_menu);
- show_fixed_matrix();
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_matrix_goto_previous_column
- * DESCRIPTION
- * Highlights an item in the previous column
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_matrix_goto_previous_column(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
- gui_fixed_matrix_menu_goto_previous_column(&MMI_fixed_matrix_menu);
- show_fixed_matrix();
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_matrix_goto_next_column
- * DESCRIPTION
- * Highlights an item in the next column
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_matrix_goto_next_column(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
- gui_fixed_matrix_menu_goto_next_column(&MMI_fixed_matrix_menu);
- show_fixed_matrix();
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_matrix_goto_previous_row
- * DESCRIPTION
- * Highlights an item in the previous row
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_matrix_goto_previous_row(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
- #endif
- gui_fixed_matrix_menu_goto_previous_row(&MMI_fixed_matrix_menu);
- show_fixed_matrix();
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * fixed_matrix_goto_next_row
- * DESCRIPTION
- * Highlights an item in the next row
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void fixed_matrix_goto_next_row(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
- #endif
- gui_fixed_matrix_menu_goto_next_row(&MMI_fixed_matrix_menu);
- show_fixed_matrix();
- #ifdef __MMI_INTERACTIVE_PROFILNG__
- mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);