wgui_fixed_menus.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:186k
源码类别:

MTK

开发平台:

C/C++

  1. /*******************************************************************************
  2. *  Modification Notice:
  3. *  --------------------------
  4. *  This software is modified by MediaTek Inc. and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *******************************************************************************/
  35.  /*******************************************************************************
  36.  * Filename:
  37.  * ---------
  38.  *   wgui_fixed_menus.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   Maui_Software
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *  fixed menu related funtions
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  *
  52.  *------------------------------------------------------------------------------
  53.  * $Log$
  54.  *
  55.  * removed!
  56.  * removed!
  57.  * 
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * 
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * 
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * 
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * 
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * 
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * 
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * 
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * 
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * 
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * 
  98.  *
  99.  * removed!
  100.  * removed!
  101.  * 
  102.  *
  103.  * removed!
  104.  * removed!
  105.  * 
  106.  *
  107.  * removed!
  108.  * removed!
  109.  * 
  110.  *
  111.  * removed!
  112.  * removed!
  113.  * 
  114.  *
  115.  * removed!
  116.  * removed!
  117.  * 
  118.  *
  119.  * removed!
  120.  * removed!
  121.  * 
  122.  *
  123.  * removed!
  124.  * removed!
  125.  * 
  126.  *
  127.  * removed!
  128.  * removed!
  129.  * 
  130.  *
  131.  * removed!
  132.  * removed!
  133.  * 
  134.  *
  135.  * removed!
  136.  * removed!
  137.  * 
  138.  *
  139.  ****************************************************************************/
  140. /*
  141.  * Copyright Notice
  142.  * (c) 2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  143.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  144.  *  (It is illegal to remove this copyright notice from this software or any
  145.  *  portion of it)
  146.  */
  147. /**********************************************************************************
  148.    Filename:      wgui_fixed_menus.c
  149.    Author:        manju
  150.    Date Created:  August-07-2002
  151.    Contains:      PixTel UI wrapper routines for Fixed Menus
  152. **********************************************************************************/
  153. #include "CustDataRes.h"
  154. #include "wgui_fixed_menus.h"
  155. #include "wgui_categories.h"
  156. #include "wgui_categories_defs.h"
  157. #include "gui_custom_menus.h"
  158. #include "gdi_include.h"
  159. #include "MainMenuType.h"
  160. #include "DebugInitDef.h"
  161. /* PMT HIMANSHU START 20050625 */
  162. #ifdef __MMI_UI_TECHNO_MAINMENU__
  163. #include "MainMenuDef.h"
  164. #endif 
  165. //PMT HIMANSHU END
  166. //PMT VIKAS START 20050707
  167. //PMT VIKAS START 20051217
  168. #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
  169. /* PMT VIKAS END 20051217 */
  170. #include "MainMenuDef.h"
  171. #define NUMBER_OF_FRAMES 7      /* Number of transitions in Ball Animation in Main Menu. */
  172. /* size of buffer allocated to ball. */
  173. #define BALL_BUFFER ((BALL_WIDTH) * (BALL_HEIGHT) * 2)
  174. #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */ 
  175. /* PMT VIKAS END 20050707 */
  176. #include "GlobalDefs.h" /* 051105 Calvin added */
  177. #include "wgui_draw_manager.h"
  178. /* PMT NEERAJ START 20050616 */
  179. #ifdef __MMI_UI_TAB_PANE__
  180. #include "wgui_tab.h"
  181. #endif 
  182. /* PMT NEERAJ END 20050616 */
  183. #include "ProfilingEngine.h"
  184. BOOL wgui_fixed_list_show_empty = MMI_TRUE; /* 051605 Calvin added */
  185. extern BOOL r2lMMIFlag; /* 051105 Calvin added */
  186. /* PMT HIMANSHU START 20050625 */
  187. #ifdef __MMI_UI_TECHNO_MAINMENU__
  188. enum
  189. {
  190.     TECHNO_MENU_ANIMATION_FRAME_ONE = 0,
  191.     TECHNO_MENU_ANIMATION_FRAME_TWO = 0,
  192.     TECHNO_MENU_ANIMATION_FRAME_THREE = 0,
  193.     TECHNO_MENU_ANIMATION_FRAME_FOUR,
  194.     TECHNO_MENU_ANIMATION_FRAME_FIVE
  195. };
  196. PU8 Techno_bgimage[BACKGROUND_FRAMES];
  197. MMTechno_animo_menu Techno_menu[MAX_MAIN_MENU_ITEMS];
  198. S32 frame = 0;
  199. S32 current_frame = 1;
  200. U8 is_next_item = 0;
  201. #endif /* __MMI_UI_TECHNO_MAINMENU__ */ 
  202. /* PMT HIMANSHU END */
  203. /* 072904 Calvin moved for centralized control */
  204. // #define ENABLE_LIST_MENU_FRAME_SKIPPING              1
  205. /* Calvin end */
  206. /* MTK Leo add for new main menu category 1216 */
  207. extern void draw_bg(void);
  208. extern void draw_bg_animation(void);
  209. /* MTK Leo end 1216 */
  210. /* Dummy highlight handler             */
  211. /*****************************************************************************
  212.  * FUNCTION
  213.  *  dummy_highlight_handler
  214.  * DESCRIPTION
  215.  *  
  216.  * PARAMETERS
  217.  *  item_index      [IN]        
  218.  * RETURNS
  219.  *  void
  220.  *****************************************************************************/
  221. void dummy_highlight_handler(S32 item_index)
  222. {
  223.     /*----------------------------------------------------------------*/
  224.     /* Local Variables                                                */
  225.     /*----------------------------------------------------------------*/
  226.     /*----------------------------------------------------------------*/
  227.     /* Code Body                                                      */
  228.     /*----------------------------------------------------------------*/
  229.     UI_UNUSED_PARAMETER(item_index);
  230. }
  231. /* void pointers required for fixed menuitems   */
  232. /* This value should not be less than the    
  233.    maximum number of items possible to be
  234.    displayed in menus.                    */
  235. /* void*        MMI_fixed_menuitem_pointers[MAX_FIXED_MENU_ITEM_POINTERS]; */
  236. /* Fixed list menu Wrappers               */
  237. void (*_MMI_hide_fixed_list_menu) (void) = UI_dummy_function;
  238. fixed_list_menu MMI_fixed_list_menu;
  239. #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
  240. S32 wgui_fixed_list_menu_frame_counter = 0;
  241. #endif 
  242. //PMT VIKAS START 20050707
  243. //PMT VIKAS START 20051217
  244. #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
  245. #ifdef __MMI_MAINLCD_176X220__
  246. S32 ball1pos[NUMBER_OF_FRAMES][2] = { {116, 41},
  247. {97, 51},
  248. {81, 71},
  249. {80, 86},
  250. {81, 71},
  251. {97, 51},
  252. {116, 41}
  253. };
  254. S32 ball2pos[NUMBER_OF_FRAMES][2] = { {-2, 134},
  255. {7, 111},
  256. {38, 93},
  257. {35, 86},
  258. {38, 93},
  259. {7, 134},
  260. {-2, 134}
  261. };
  262. #elif defined(__MMI_MAINLCD_128X160__)
  263. S32 ball1pos[NUMBER_OF_FRAMES][2] = { {85, 12},
  264. {68, 30},
  265. {50, 40},
  266. {40, 50},
  267. {50, 40},
  268. {68, 30},
  269. {85, 12}
  270. };
  271. S32 ball2pos[NUMBER_OF_FRAMES][2] = { {-8, 95},
  272. {1, 80},
  273. {10, 60},
  274. {20, 50},
  275. {10, 60},
  276. {1, 80},
  277. {-8, 95}
  278. };
  279. #endif 
  280. /* PMT VIKAS END 20051217 */
  281. MM_balls ball[NUMBER_OF_BALLS];
  282. U8 ballimgdata[NUMBER_OF_BALLS][BALL_BUFFER];
  283. U8 is_next_item = 0;
  284. /*****************************************************************************
  285.  * FUNCTION
  286.  *  initialize_balls
  287.  * DESCRIPTION
  288.  *  initialize the balls position and buffer.
  289.  * PARAMETERS
  290.  *  void
  291.  * RETURNS
  292.  *  void
  293.  *****************************************************************************/
  294. void initialize_balls(void)
  295. {
  296.     /*----------------------------------------------------------------*/
  297.     /* Local Variables                                                */
  298.     /*----------------------------------------------------------------*/
  299.     /*----------------------------------------------------------------*/
  300.     /* Code Body                                                      */
  301.     /*----------------------------------------------------------------*/
  302.     ball[0].position = &ball1pos[0][0];
  303.     ball[1].position = &ball2pos[0][0];
  304.     memset(&ball[0].image, 0, sizeof(bitmap));
  305.     memset(&ball[1].image, 0, sizeof(bitmap));
  306.     memset(&ballimgdata[0], 0, BALL_BUFFER);
  307.     memset(&ballimgdata[1], 0, BALL_BUFFER);
  308.     ball[0].image.data = ballimgdata[0];
  309.     ball[1].image.data = ballimgdata[1];
  310. }
  311. #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */ 
  312. /* PMT VIKAS END 20050707 */
  313. /*****************************************************************************
  314.  * FUNCTION
  315.  *  create_fixed_list
  316.  * DESCRIPTION
  317.  *  Creates a fixed list menu
  318.  * PARAMETERS
  319.  *  void
  320.  * RETURNS
  321.  *  void
  322.  *****************************************************************************/
  323. void create_fixed_list(void)
  324. {
  325.     /*----------------------------------------------------------------*/
  326.     /* Local Variables                                                */
  327.     /*----------------------------------------------------------------*/
  328.     /*----------------------------------------------------------------*/
  329.     /* Code Body                                                      */
  330.     /*----------------------------------------------------------------*/
  331.     gui_create_fixed_list_menu(
  332.         &MMI_fixed_list_menu,
  333.         MMI_content_x,
  334.         MMI_content_y,
  335.         MMI_content_width,
  336.         MMI_content_height);
  337. #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
  338.     wgui_fixed_list_menu_frame_counter = 0;
  339. #endif 
  340.     /* PMT NEERAJ START 20050825 */
  341. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  342.     reset_fixed_icontext_menuitem_type();
  343. #endif 
  344.     /* PMT NEERAJ END 20050825 */
  345. }
  346. /*****************************************************************************
  347.  * FUNCTION
  348.  *  plain_fixed_list
  349.  * DESCRIPTION
  350.  *  The fixed list will be displayed in plain mode
  351.  *  (No background or scrollbars)
  352.  * PARAMETERS
  353.  *  void
  354.  * RETURNS
  355.  *  void
  356.  *****************************************************************************/
  357. void plain_fixed_list(void)
  358. {
  359.     /*----------------------------------------------------------------*/
  360.     /* Local Variables                                                */
  361.     /*----------------------------------------------------------------*/
  362.     /*----------------------------------------------------------------*/
  363.     /* Code Body                                                      */
  364.     /*----------------------------------------------------------------*/
  365.     MMI_fixed_list_menu.flags |= (UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_DISABLE_SCROLLBAR);
  366. }
  367. /*****************************************************************************
  368.  * FUNCTION
  369.  *  normal_fixed_list
  370.  * DESCRIPTION
  371.  *  Puts the list menu back into normal display mode
  372.  * PARAMETERS
  373.  *  void
  374.  * RETURNS
  375.  *  void
  376.  *****************************************************************************/
  377. void normal_fixed_list(void)
  378. {
  379.     /*----------------------------------------------------------------*/
  380.     /* Local Variables                                                */
  381.     /*----------------------------------------------------------------*/
  382.     /*----------------------------------------------------------------*/
  383.     /* Code Body                                                      */
  384.     /*----------------------------------------------------------------*/
  385.     MMI_fixed_list_menu.flags &=
  386.         ~(UI_LIST_MENU_ALIGN_TO_TOP | UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_DISABLE_SCROLLBAR |
  387.           UI_LIST_MENU_ENABLE_TRANSITION | UI_LIST_MENU_DISABLE_CACHE_DYNAMIC_DATA |
  388.           UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER | UI_LIST_MENU_DISABLE_PEN);
  389. MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
  390.     _MMI_hide_fixed_list_menu = UI_dummy_function;
  391. }
  392. /*****************************************************************************
  393.  * FUNCTION
  394.  *  register_hide_fixed_list
  395.  * DESCRIPTION
  396.  *  Registers a function to be used to hide the list menu
  397.  *  during plain display
  398.  * PARAMETERS
  399.  *  f           [IN]        Is the function that is called whenever the fixed list
  400.  *  menu(?)     [IN]        Needs to be hidden.
  401.  * RETURNS
  402.  *  void
  403.  *****************************************************************************/
  404. void register_hide_fixed_list(void (*f) (void))
  405. {
  406.     /*----------------------------------------------------------------*/
  407.     /* Local Variables                                                */
  408.     /*----------------------------------------------------------------*/
  409.     /*----------------------------------------------------------------*/
  410.     /* Code Body                                                      */
  411.     /*----------------------------------------------------------------*/
  412.     _MMI_hide_fixed_list_menu = f;
  413. }
  414. /*****************************************************************************
  415.  * FUNCTION
  416.  *  move_fixed_list
  417.  * DESCRIPTION
  418.  *  Moves the fixed list menu
  419.  * PARAMETERS
  420.  *  x       [IN]        Is the new menu position
  421.  *  y       [IN]        Is the new menu position
  422.  * RETURNS
  423.  *  void
  424.  *****************************************************************************/
  425. void move_fixed_list(S32 x, S32 y)
  426. {   /* Pixtel - Gurinder - 1/21/04 - Move the fixed list 1 pixel right and 1 pixel down if ListBox is defined. */
  427. #if defined(__MMI_PLUTO_LISTBOX__)
  428.     /*----------------------------------------------------------------*/
  429.     /* Local Variables                                                */
  430.     /*----------------------------------------------------------------*/
  431.     /*----------------------------------------------------------------*/
  432.     /* Code Body                                                      */
  433.     /*----------------------------------------------------------------*/
  434.     gui_move_fixed_list_menu(&MMI_fixed_list_menu, x + 1, y + 1);
  435. #else /* defined(__MMI_PLUTO_LISTBOX__) */ 
  436.     gui_move_fixed_list_menu(&MMI_fixed_list_menu, x, y);
  437. #endif /* defined(__MMI_PLUTO_LISTBOX__) */ 
  438. }
  439. /*****************************************************************************
  440.  * FUNCTION
  441.  *  register_fixed_list_highlight_handler
  442.  * DESCRIPTION
  443.  *  Registers the highlight handler for the fixed list
  444.  * PARAMETERS
  445.  *  f               [IN]        Is the function that acts as the highlight handler
  446.  *  which(?)        [IN]        Is the index number of the item that was highlighted (zero based)
  447.  *  This(?)         [IN]        Function is called with the parameter item_index,
  448.  * RETURNS
  449.  *  void
  450.  *****************************************************************************/
  451. void register_fixed_list_highlight_handler(void (*f) (S32 item_index))
  452. {
  453.     /*----------------------------------------------------------------*/
  454.     /* Local Variables                                                */
  455.     /*----------------------------------------------------------------*/
  456.     /*----------------------------------------------------------------*/
  457.     /* Code Body                                                      */
  458.     /*----------------------------------------------------------------*/
  459.     MMI_fixed_list_menu.item_highlighted = f;
  460. }
  461. /*****************************************************************************
  462.  * FUNCTION
  463.  *  register_fixed_list_unhighlight_handler
  464.  * DESCRIPTION
  465.  *  Registers the highlight handler for the fixed list
  466.  * PARAMETERS
  467.  *  f               [IN]        Is the function that acts as the handler when a control is unhighlighted
  468.  *  which(?)        [IN]        Is the index number of the item that was highlighted (zero based)
  469.  *  This(?)         [IN]        Function is called with the parameter item_index,
  470.  * RETURNS
  471.  *  void
  472.  *****************************************************************************/
  473. void register_fixed_list_unhighlight_handler(void (*f) (S32 item_index))
  474. {
  475.     /*----------------------------------------------------------------*/
  476.     /* Local Variables                                                */
  477.     /*----------------------------------------------------------------*/
  478.     /*----------------------------------------------------------------*/
  479.     /* Code Body                                                      */
  480.     /*----------------------------------------------------------------*/
  481.     MMI_fixed_list_menu.item_unhighlighted = f;
  482. }
  483. /* PMT NEERAJ START 20050425 */
  484. #ifdef __MMI_UI_LIST_TRANSITION__
  485. #include "gdi_include.h"
  486. #ifdef MMI_ON_WIN32
  487. #define MMI_UI_LIST_TRANSITION_COUNT   20;
  488. #else 
  489. #define MMI_UI_LIST_TRANSITION_COUNT   10;
  490. #endif 
  491. wgui_transition_styles MMI_list_transition_style = WGUI_TRANSITION_NONE;
  492. S32 MMI_check_list_for_transition = 1;
  493. /*****************************************************************************
  494.  * FUNCTION
  495.  *  set_list_transition
  496.  * DESCRIPTION
  497.  *  This functions sets the transition style for list
  498.  * PARAMETERS
  499.  *  style       [IN]        The style in which the list should transiate T2D or D2T
  500.  * RETURNS
  501.  *  void
  502.  *****************************************************************************/
  503. void set_list_transition(wgui_transition_styles style)
  504. {
  505.     /*----------------------------------------------------------------*/
  506.     /* Local Variables                                                */
  507.     /*----------------------------------------------------------------*/
  508.     /*----------------------------------------------------------------*/
  509.     /* Code Body                                                      */
  510.     /*----------------------------------------------------------------*/
  511.     MMI_list_transition_style = style;
  512. }
  513. /*****************************************************************************
  514.  * FUNCTION
  515.  *  get_list_transition
  516.  * DESCRIPTION
  517.  *  This functions returns the transition style for list
  518.  * PARAMETERS
  519.  *  void
  520.  * RETURNS
  521.  *  The style in which the list is transiating T2D or D2T
  522.  *****************************************************************************/
  523. wgui_transition_styles get_list_transition(void)
  524. {
  525.     /*----------------------------------------------------------------*/
  526.     /* Local Variables                                                */
  527.     /*----------------------------------------------------------------*/
  528.     /*----------------------------------------------------------------*/
  529.     /* Code Body                                                      */
  530.     /*----------------------------------------------------------------*/
  531.     return MMI_list_transition_style;
  532. }
  533. /*****************************************************************************
  534.  * FUNCTION
  535.  *  reset_list_transition
  536.  * DESCRIPTION
  537.  *  This functions resets the transition style for list to none
  538.  * PARAMETERS
  539.  *  void
  540.  * RETURNS
  541.  *  void
  542.  *****************************************************************************/
  543. void reset_list_transition(void)
  544. {
  545.     /*----------------------------------------------------------------*/
  546.     /* Local Variables                                                */
  547.     /*----------------------------------------------------------------*/
  548.     /*----------------------------------------------------------------*/
  549.     /* Code Body                                                      */
  550.     /*----------------------------------------------------------------*/
  551.     MMI_list_transition_style = WGUI_TRANSITION_NONE;
  552. }
  553. /*****************************************************************************
  554.  * FUNCTION
  555.  *  draw_transition_list
  556.  * DESCRIPTION
  557.  *  This functions draws the transition list
  558.  * PARAMETERS
  559.  *  void
  560.  * RETURNS
  561.  *  void
  562.  *****************************************************************************/
  563. void draw_transition_list(void)
  564. {
  565.     /*----------------------------------------------------------------*/
  566.     /* Local Variables                                                */
  567.     /*----------------------------------------------------------------*/
  568.     /*----------------------------------------------------------------*/
  569.     /* Code Body                                                      */
  570.     /*----------------------------------------------------------------*/
  571.     switch (MMI_list_transition_style)
  572.     {
  573.         case WGUI_TRANSITION_D2T:
  574.         {
  575.             S32 prev_y = MMI_fixed_list_menu.y;
  576.             S32 prev_height = MMI_fixed_list_menu.height;
  577.             S32 i, transition_count;
  578.             S32 transition_resolution;
  579.             i = transition_count = MMI_UI_LIST_TRANSITION_COUNT;
  580.             transition_resolution = MMI_fixed_list_menu.height / transition_count;
  581.             MMI_fixed_list_menu.y = MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 1;
  582.             MMI_fixed_list_menu.height = 0;
  583.             /* 051005 Calvin modified */
  584.             /* flag = MMI_fixed_list_menu.flags; */
  585.             MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_ENABLE_TRANSITION;
  586.             /* MMI_fixed_list_menu.flags|=UI_LIST_MENU_DISABLE_BACKGROUND|UI_LIST_MENU_ENABLE_TRANSITION|UI_LIST_MENU_DISABLE_SCROLLBAR; */
  587.             while (i - 1)
  588.             {
  589.                 MMI_fixed_list_menu.y -= transition_resolution;
  590.                 MMI_fixed_list_menu.height += transition_resolution;
  591.                 move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
  592.                 resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
  593.                 MMI_fixed_list_menu.top = 0;
  594.                 show_fixed_list();
  595.                 i--;
  596.             }
  597.             /* MMI_fixed_list_menu.flags = flag | UI_LIST_MENU_DISABLE_BACKGROUND|UI_LIST_MENU_ENABLE_TRANSITION; */
  598.             MMI_fixed_list_menu.height = prev_height;
  599.             MMI_fixed_list_menu.y = prev_y;
  600.             move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
  601.             resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
  602.             /* Calvin end */
  603.             show_fixed_list();
  604.         }
  605.             break;
  606.         case WGUI_TRANSITION_T2D:
  607.         {
  608.             S32 prev_y = MMI_fixed_list_menu.y;
  609.             S32 prev_height = MMI_fixed_list_menu.height;
  610.             S32 i, transition_count;
  611.             S32 transition_resolution;
  612.             i = transition_count = MMI_UI_LIST_TRANSITION_COUNT;
  613.             transition_resolution = MMI_fixed_list_menu.height / transition_count;
  614.             MMI_fixed_list_menu.y -= (MMI_fixed_list_menu.height - 1);
  615.             /* 051005 Calvin modified */
  616.             /* flag = MMI_fixed_list_menu.flags; */
  617.             MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_ENABLE_TRANSITION;
  618.             /* MMI_fixed_list_menu.flags|=UI_LIST_MENU_DISABLE_BACKGROUND|UI_LIST_MENU_ENABLE_TRANSITION|UI_LIST_MENU_DISABLE_SCROLLBAR; */
  619.             while (i - 1)
  620.             {
  621.                 MMI_fixed_list_menu.y += transition_resolution;
  622.                 move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
  623.                 resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
  624.                 MMI_fixed_list_menu.top = 0;
  625.                 show_fixed_list();
  626.                 gui_BLT_double_buffer(
  627.                     MMI_fixed_list_menu.x,
  628.                     prev_y,
  629.                     MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  630.                     prev_y + prev_height - 1);
  631.                 i--;
  632.             }
  633.             /* MMI_fixed_list_menu.flags = flag | UI_LIST_MENU_DISABLE_BACKGROUND|UI_LIST_MENU_ENABLE_TRANSITION; */
  634.             MMI_fixed_list_menu.height = prev_height;
  635.             MMI_fixed_list_menu.y = prev_y;
  636.             move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
  637.             resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
  638.             /* Calvin end */
  639.             show_fixed_list();
  640.             gui_BLT_double_buffer(
  641.                 MMI_fixed_list_menu.x,
  642.                 prev_y,
  643.                 MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  644.                 prev_y + prev_height - 1);
  645.             leave_full_screen();
  646.         }
  647.             break;
  648.     }
  649. }
  650. /* PMT VIKAS START 20051209 */
  651. #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
  652. static S32 g_in_list_transition = 0;
  653. static S32 g_prev_list_y;
  654. static S32 g_prev_list_height;
  655. /*****************************************************************************
  656.  * FUNCTION
  657.  *  wgui_list_tranisition_abort_cleanup_function
  658.  * DESCRIPTION
  659.  *  This is the clean uo function for the list transition style
  660.  * PARAMETERS
  661.  *  void
  662.  * RETURNS
  663.  *  void
  664.  *****************************************************************************/
  665. void wgui_list_tranisition_abort_cleanup_function(void)
  666. {
  667.     /*----------------------------------------------------------------*/
  668.     /* Local Variables                                                */
  669.     /*----------------------------------------------------------------*/
  670.     /*----------------------------------------------------------------*/
  671.     /* Code Body                                                      */
  672.     /*----------------------------------------------------------------*/
  673.     wgui_stop_list_transition_non_blocking();
  674. }
  675. /*****************************************************************************
  676.  * FUNCTION
  677.  *  draw_transition_list_non_blocking
  678.  * DESCRIPTION
  679.  *  This function is used to draw list transition with timer
  680.  * PARAMETERS
  681.  *  void
  682.  * RETURNS
  683.  *  void
  684.  *****************************************************************************/
  685. void draw_transition_list_non_blocking(void)
  686. {
  687.     /*----------------------------------------------------------------*/
  688.     /* Local Variables                                                */
  689.     /*----------------------------------------------------------------*/
  690.     static S32 temp_count, transition_count;
  691.     static S32 transition_resolution;
  692.     /*----------------------------------------------------------------*/
  693.     /* Code Body                                                      */
  694.     /*----------------------------------------------------------------*/
  695.     switch (MMI_list_transition_style)
  696.     {
  697.         case WGUI_TRANSITION_D2T:
  698.         {
  699.             if (is_in_nonblocking_list_transition() == 0)
  700.             {
  701.                 g_in_list_transition = 1;
  702.                 save_copy_original_list_data();
  703.                 temp_count = transition_count = MMI_UI_LIST_TRANSITION_COUNT;
  704.                 transition_resolution = MMI_fixed_list_menu.height / transition_count;
  705.                 MMI_fixed_list_menu.y = MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 1;
  706.                 MMI_fixed_list_menu.height = 0;
  707.                 MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_ENABLE_TRANSITION;
  708.                 gui_add_cleanup_hook(wgui_list_tranisition_abort_cleanup_function);
  709.             }
  710.             MMI_fixed_list_menu.y -= transition_resolution;
  711.             MMI_fixed_list_menu.height += transition_resolution;
  712.             move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
  713.             resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
  714.             MMI_fixed_list_menu.top = 0;
  715.             show_fixed_list();
  716.             gui_BLT_double_buffer(
  717.                 MMI_fixed_list_menu.x,
  718.                 g_prev_list_y,
  719.                 MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  720.                 g_prev_list_y + g_prev_list_height - 1);
  721.             temp_count--;
  722.             if (temp_count > 1)
  723.             {
  724.                 gui_start_timer(LIST_TRANSITION_NON_BLOCKING_TIMER, draw_transition_list_non_blocking);
  725.             }
  726.             else
  727.             {
  728.                 restore_saved_original_list_data();
  729.                 wgui_stop_list_transition_non_blocking();
  730.                 g_in_list_transition = 0;
  731.                 move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
  732.                 resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
  733.                 show_fixed_list();
  734.             }
  735.             break;
  736.         }
  737.         case WGUI_TRANSITION_T2D:
  738.         {
  739.             if (is_in_nonblocking_list_transition() == 0)
  740.             {
  741.                 g_in_list_transition = 1;
  742.                 save_copy_original_list_data();
  743.                 temp_count = transition_count = MMI_UI_LIST_TRANSITION_COUNT;
  744.                 transition_resolution = MMI_fixed_list_menu.height / transition_count;
  745.                 MMI_fixed_list_menu.y -= (MMI_fixed_list_menu.height - 1);
  746.                 MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_ENABLE_TRANSITION;
  747.                 gui_add_cleanup_hook(wgui_list_tranisition_abort_cleanup_function);
  748.             }
  749.             MMI_fixed_list_menu.y += transition_resolution;
  750.             move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
  751.             resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
  752.             MMI_fixed_list_menu.top = 0;
  753.             gui_lock_double_buffer();
  754.             gui_push_clip();
  755.             gui_set_clip(
  756.                 MMI_fixed_list_menu.x,
  757.                 g_prev_list_y,
  758.                 MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  759.                 g_prev_list_y + g_prev_list_height - 1);
  760.             show_fixed_list();
  761.             gui_pop_clip();
  762.             draw_title();
  763.             show_status_icons();
  764.             gui_unlock_double_buffer();
  765.             gui_BLT_double_buffer(
  766.                 MMI_fixed_list_menu.x,
  767.                 0,
  768.                 MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  769.                 g_prev_list_y + g_prev_list_height - 1);
  770.             temp_count--;
  771.             if (temp_count > 1)
  772.             {
  773.                 gui_start_timer(LIST_TRANSITION_NON_BLOCKING_TIMER, draw_transition_list_non_blocking);
  774.             }
  775.             else
  776.             {
  777.                 restore_saved_original_list_data();
  778.                 move_fixed_list(MMI_fixed_list_menu.x, MMI_fixed_list_menu.y);
  779.                 resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height);
  780.                 wgui_stop_list_transition_non_blocking();
  781.                 show_fixed_list();
  782.                 gui_BLT_double_buffer(
  783.                     MMI_fixed_list_menu.x,
  784.                     g_prev_list_y,
  785.                     MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  786.                     g_prev_list_y + g_prev_list_height - 1);
  787.             }
  788.             break;
  789.         }
  790.     }
  791. }
  792. /*****************************************************************************
  793.  * FUNCTION
  794.  *  wgui_stop_list_transition_non_blocking
  795.  * DESCRIPTION
  796.  *  This function is used to stop the timer for list transition & reset variables
  797.  * PARAMETERS
  798.  *  void
  799.  * RETURNS
  800.  *  void
  801.  *****************************************************************************/
  802. void wgui_stop_list_transition_non_blocking(void)
  803. {
  804.     /*----------------------------------------------------------------*/
  805.     /* Local Variables                                                */
  806.     /*----------------------------------------------------------------*/
  807.     /*----------------------------------------------------------------*/
  808.     /* Code Body                                                      */
  809.     /*----------------------------------------------------------------*/
  810.     if (is_in_nonblocking_list_transition())
  811.     {
  812.         MMI_fixed_list_menu.height = g_prev_list_height;
  813.         MMI_fixed_list_menu.y = g_prev_list_y;
  814.         g_in_list_transition = 0;
  815.     }
  816.     reset_list_transition();
  817.     gui_cancel_timer(draw_transition_list_non_blocking);
  818. }
  819. /*****************************************************************************
  820.  * FUNCTION
  821.  *  is_in_nonblocking_list_transition
  822.  * DESCRIPTION
  823.  *  This function return the non blocking list transition flag
  824.  * PARAMETERS
  825.  *  void
  826.  * RETURNS
  827.  *  S32
  828.  *****************************************************************************/
  829. S32 is_in_nonblocking_list_transition(void)
  830. {
  831.     /*----------------------------------------------------------------*/
  832.     /* Local Variables                                                */
  833.     /*----------------------------------------------------------------*/
  834.     /*----------------------------------------------------------------*/
  835.     /* Code Body                                                      */
  836.     /*----------------------------------------------------------------*/
  837.     return g_in_list_transition;
  838. }
  839. /*****************************************************************************
  840.  * FUNCTION
  841.  *  get_original_prev_list_y_value
  842.  * DESCRIPTION
  843.  *  This function return the original value of list start y position
  844.  * PARAMETERS
  845.  *  void
  846.  * RETURNS
  847.  *  S32
  848.  *****************************************************************************/
  849. S32 get_original_prev_list_y_value(void)
  850. {
  851.     /*----------------------------------------------------------------*/
  852.     /* Local Variables                                                */
  853.     /*----------------------------------------------------------------*/
  854.     /*----------------------------------------------------------------*/
  855.     /* Code Body                                                      */
  856.     /*----------------------------------------------------------------*/
  857.     return g_prev_list_y;
  858. }
  859. /*****************************************************************************
  860.  * FUNCTION
  861.  *  save_copy_original_list_data
  862.  * DESCRIPTION
  863.  *  This function save the original value of list start y position and list height
  864.  * PARAMETERS
  865.  *  void
  866.  * RETURNS
  867.  *  void
  868.  *****************************************************************************/
  869. void save_copy_original_list_data(void)
  870. {
  871.     /*----------------------------------------------------------------*/
  872.     /* Local Variables                                                */
  873.     /*----------------------------------------------------------------*/
  874.     /*----------------------------------------------------------------*/
  875.     /* Code Body                                                      */
  876.     /*----------------------------------------------------------------*/
  877.     g_prev_list_y = MMI_fixed_list_menu.y;
  878.     g_prev_list_height = MMI_fixed_list_menu.height;
  879. }
  880. /*****************************************************************************
  881.  * FUNCTION
  882.  *  restore_saved_original_list_data
  883.  * DESCRIPTION
  884.  *  This function restore the original value of list start y position and list height
  885.  * PARAMETERS
  886.  *  void
  887.  * RETURNS
  888.  *  void
  889.  *****************************************************************************/
  890. void restore_saved_original_list_data(void)
  891. {
  892.     /*----------------------------------------------------------------*/
  893.     /* Local Variables                                                */
  894.     /*----------------------------------------------------------------*/
  895.     /*----------------------------------------------------------------*/
  896.     /* Code Body                                                      */
  897.     /*----------------------------------------------------------------*/
  898.     MMI_fixed_list_menu.height = g_prev_list_height;
  899.     MMI_fixed_list_menu.y = g_prev_list_y;
  900. }
  901. #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */ 
  902. /* PMT VIKAS END 20051209 */
  903. #endif /* __MMI_UI_LIST_TRANSITION__ */ 
  904. /* PMT NEERAJ END 20050425 */
  905. /*****************************************************************************
  906.  * FUNCTION
  907.  *  wgui_list_menu_show_empty_label_if_needed
  908.  * DESCRIPTION
  909.  *  Displays "empty" in list menu if it's empty
  910.  * PARAMETERS
  911.  *  void
  912.  * RETURNS
  913.  *  void
  914.  *****************************************************************************/
  915. void wgui_list_menu_show_empty_label_if_needed(void)
  916. {
  917.     /*----------------------------------------------------------------*/
  918.     /* Local Variables                                                */
  919.     /*----------------------------------------------------------------*/
  920.     S32 offset_x;
  921.     S32 offset_y;
  922.     S32 str_width;
  923.     S32 str_height;
  924.     S8 *str_ptr;
  925.     
  926.     /*----------------------------------------------------------------*/
  927.     /* Code Body                                                      */
  928.     /*----------------------------------------------------------------*/
  929.     if (MMI_fixed_list_menu.n_items > 0 || !wgui_fixed_list_show_empty)
  930.     {
  931.         return;
  932.     }
  933.     gdi_layer_set_clip(
  934.         MMI_fixed_list_menu.x,
  935.         MMI_fixed_list_menu.y,
  936.         MMI_fixed_list_menu.x + MMI_fixed_list_menu.width - 1,
  937.         MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 1);
  938.     gui_set_font(&MMI_medium_font);
  939.     gui_set_text_color(gui_color(0, 0, 0));
  940.     str_ptr = GetString(STR_GLOBAL_EMPTY);
  941.     gui_measure_string((UI_string_type) str_ptr, &str_width, &str_height);
  942.     offset_x = MMI_fixed_list_menu.x + ((MMI_fixed_list_menu.width - str_width) >> 1);
  943.     offset_y = MMI_fixed_list_menu.y + ((MMI_fixed_list_menu.height - str_height) >> 1);
  944.     if (r2lMMIFlag)
  945.     {
  946.         gui_move_text_cursor(offset_x + str_width, offset_y);
  947.     }
  948.     else
  949.     {
  950.         gui_move_text_cursor(offset_x, offset_y);
  951.     }
  952.     gui_print_text((UI_string_type) str_ptr);
  953. }
  954. /*****************************************************************************
  955.  * FUNCTION
  956.  *  show_fixed_list
  957.  * DESCRIPTION
  958.  *  Displays the fixed list
  959.  * PARAMETERS
  960.  *  void
  961.  * RETURNS
  962.  *  void
  963.  *****************************************************************************/
  964. void wgui_display_fixed_text_list_pop_up_description(void);
  965. void show_fixed_list(void)
  966. {
  967.     /*----------------------------------------------------------------*/
  968.     /* Local Variables                                                */
  969.     /*----------------------------------------------------------------*/
  970.     gdi_handle act_lcd;
  971.     /*----------------------------------------------------------------*/
  972.     /* Code Body                                                      */
  973.     /*----------------------------------------------------------------*/
  974.     gdi_lcd_get_active(&act_lcd);
  975.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  976.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  977. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  978.     gui_stop_list_highlight_effect();
  979.     gui_add_cleanup_hook(gui_stop_list_highlight_effect);
  980. #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  981. #ifdef __MMI_UI_LIST_TRANSITION__
  982.     if (MMI_check_list_for_transition && MMI_list_transition_style)
  983.     {
  984.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  985.         gui_reset_current_list_effect();
  986.     #endif 
  987.         MMI_check_list_for_transition = 0;
  988.     #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
  989.         if (is_in_nonblocking_list_transition() == 0)
  990.         {
  991.             draw_transition_list_non_blocking();
  992.         }
  993.     #else /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */ 
  994.         draw_transition_list();
  995.     #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */ 
  996.         MMI_check_list_for_transition = 1;
  997.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  998.     #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
  999.         if (is_in_nonblocking_list_transition() == 0)
  1000.     #endif 
  1001.             gui_restore_current_list_effect();
  1002.     #else /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1003.         return;
  1004.     #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1005.     }
  1006. #endif /* __MMI_UI_LIST_TRANSITION__ */ 
  1007.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
  1008.     {
  1009.         _MMI_hide_fixed_list_menu();
  1010.     }
  1011. gui_show_fixed_list_menu(&MMI_fixed_list_menu);
  1012.     wgui_display_fixed_text_list_pop_up_description();
  1013. #ifdef __MMI_UI_LIST_TRANSITION__
  1014. #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
  1015.     if (get_list_transition() == WGUI_TRANSITION_T2D && !MMI_check_list_for_transition ||
  1016.         is_in_nonblocking_list_transition() == 1)
  1017.     {
  1018.         return;
  1019.     }
  1020. #else /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */ 
  1021.     if (get_list_transition() == WGUI_TRANSITION_T2D && !MMI_check_list_for_transition)
  1022.     {
  1023.         return;
  1024.     }
  1025. #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */ 
  1026. #endif /* __MMI_UI_LIST_TRANSITION__ */ 
  1027.     /* if is emtpty folder, show a empty string */
  1028.     wgui_list_menu_show_empty_label_if_needed();
  1029.         
  1030.     gdi_layer_blt_previous(
  1031.         MMI_fixed_list_menu.x,
  1032.         MMI_fixed_list_menu.y,
  1033.         MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  1034.         MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
  1035.     gdi_layer_pop_and_restore_active();
  1036.     gdi_lcd_set_active(act_lcd);
  1037. }
  1038. #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
  1039. /*****************************************************************************
  1040.  * FUNCTION
  1041.  *  wgui_fixed_list_menu_end_frame
  1042.  * DESCRIPTION
  1043.  *  
  1044.  * PARAMETERS
  1045.  *  void
  1046.  * RETURNS
  1047.  *  void
  1048.  *****************************************************************************/
  1049. void wgui_fixed_list_menu_end_frame(void)
  1050. {
  1051.     /*----------------------------------------------------------------*/
  1052.     /* Local Variables                                                */
  1053.     /*----------------------------------------------------------------*/
  1054.     /*----------------------------------------------------------------*/
  1055.     /* Code Body                                                      */
  1056.     /*----------------------------------------------------------------*/
  1057.     if (wgui_fixed_list_menu_frame_counter >= 1)
  1058.     {
  1059.         if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
  1060.         {
  1061.             _MMI_hide_fixed_list_menu();
  1062.         }
  1063.         gui_hide_animations();
  1064.         gui_lock_double_buffer();
  1065.         gui_show_fixed_list_menu(&MMI_fixed_list_menu);
  1066.         wgui_display_fixed_text_list_pop_up_description();
  1067.         gui_unlock_double_buffer();
  1068.         gui_BLT_double_buffer(
  1069.             MMI_fixed_list_menu.x,
  1070.             MMI_fixed_list_menu.y,
  1071.             MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  1072.             MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
  1073.         wgui_fixed_list_menu_frame_counter = 0;
  1074.         gui_start_timer(UI_FRAME_SKIP_TIMEOUT, wgui_fixed_list_menu_end_frame);
  1075.     }
  1076. }
  1077. #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */ 
  1078. /*****************************************************************************
  1079.  * FUNCTION
  1080.  *  redraw_fixed_list
  1081.  * DESCRIPTION
  1082.  *  
  1083.  * PARAMETERS
  1084.  *  void
  1085.  * RETURNS
  1086.  *  void
  1087.  *****************************************************************************/
  1088. void redraw_fixed_list(void)
  1089. {
  1090.     /*----------------------------------------------------------------*/
  1091.     /* Local Variables                                                */
  1092.     /*----------------------------------------------------------------*/
  1093.     gdi_handle act_lcd;
  1094.     /*----------------------------------------------------------------*/
  1095.     /* Code Body                                                      */
  1096.     /*----------------------------------------------------------------*/
  1097.     if (MMI_current_menu_type == ANI_BG_LIST_MENU)
  1098.     {
  1099.         return;
  1100.     }
  1101.     gdi_lcd_get_active(&act_lcd);
  1102.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1103.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1104. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1105.     gui_stop_list_highlight_effect();
  1106. #endif 
  1107.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1108.     {
  1109.         gdi_layer_lock_frame_buffer();
  1110.         if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
  1111.         {
  1112.             _MMI_hide_fixed_list_menu();
  1113.         }
  1114.         gui_show_fixed_list_menu(&MMI_fixed_list_menu);
  1115.         wgui_display_fixed_text_list_pop_up_description();
  1116.         gdi_layer_unlock_frame_buffer();
  1117.         gdi_layer_blt_previous(
  1118.             MMI_fixed_list_menu.x,
  1119.             MMI_fixed_list_menu.y,
  1120.             MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  1121.             MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
  1122.     }
  1123.     else
  1124.     {
  1125.     #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
  1126.         if (wgui_fixed_list_menu_frame_counter > 0)
  1127.         {
  1128.             wgui_fixed_list_menu_frame_counter++;
  1129.             gui_show_fixed_list_menu_no_draw(&MMI_fixed_list_menu);
  1130.         }
  1131.         else
  1132.         {
  1133.             wgui_fixed_list_menu_frame_counter = 1;
  1134.             gui_show_fixed_list_menu_no_draw(&MMI_fixed_list_menu);
  1135.             gui_start_timer(UI_FRAME_START_TIMEOUT, wgui_fixed_list_menu_end_frame);
  1136.         }
  1137.     #else /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */ 
  1138.         gdi_layer_lock_frame_buffer();
  1139.         if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
  1140.         {
  1141.             _MMI_hide_fixed_list_menu();
  1142.         }
  1143.         gui_show_fixed_list_menu(&MMI_fixed_list_menu);
  1144.         wgui_display_fixed_text_list_pop_up_description();
  1145.         gdi_layer_unlock_frame_buffer();
  1146.     #ifdef __MMI_UI_LIST_TRANSITION__
  1147.     #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
  1148.         if (get_list_transition() == WGUI_TRANSITION_T2D && is_in_nonblocking_list_transition() == 1)
  1149.         {
  1150.             gdi_layer_blt_previous(
  1151.                 MMI_fixed_list_menu.x,
  1152.                 g_prev_list_y,
  1153.                 MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  1154.                 g_prev_list_y + g_prev_list_height - 1);
  1155.         }
  1156.         else
  1157.     #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */ 
  1158.     #endif /* __MMI_UI_LIST_TRANSITION__ */ 
  1159.             gdi_layer_blt_previous(
  1160.                 MMI_fixed_list_menu.x,
  1161.                 MMI_fixed_list_menu.y,
  1162.                 MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
  1163.                 MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
  1164.     #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */ 
  1165.         gdi_layer_pop_and_restore_active();
  1166.         gdi_lcd_set_active(act_lcd);
  1167.     }
  1168. }
  1169. /*****************************************************************************
  1170.  * FUNCTION
  1171.  *  clear_fixed_list_highlight_handler
  1172.  * DESCRIPTION
  1173.  *  Clears the highlight handler for the fixed list
  1174.  * PARAMETERS
  1175.  *  void
  1176.  * RETURNS
  1177.  *  void
  1178.  *****************************************************************************/
  1179. void clear_fixed_list_highlight_handler(void)
  1180. {
  1181.     /*----------------------------------------------------------------*/
  1182.     /* Local Variables                                                */
  1183.     /*----------------------------------------------------------------*/
  1184.     /*----------------------------------------------------------------*/
  1185.     /* Code Body                                                      */
  1186.     /*----------------------------------------------------------------*/
  1187.     MMI_fixed_list_menu.item_highlighted = dummy_highlight_handler;
  1188. }
  1189. /*****************************************************************************
  1190.  * FUNCTION
  1191.  *  fixed_list_goto_previous_item
  1192.  * DESCRIPTION
  1193.  *  Highlights the previous item
  1194.  * PARAMETERS
  1195.  *  void
  1196.  * RETURNS
  1197.  *  void
  1198.  *****************************************************************************/
  1199. void fixed_list_goto_previous_item(void)
  1200. {
  1201.     /*----------------------------------------------------------------*/
  1202.     /* Local Variables                                                */
  1203.     /*----------------------------------------------------------------*/
  1204.     gdi_handle act_lcd;
  1205.     /*----------------------------------------------------------------*/
  1206.     /* Code Body                                                      */
  1207.     /*----------------------------------------------------------------*/
  1208.     if (MMI_fixed_list_menu.n_items <= 0)
  1209.     {
  1210.         return;
  1211.     }
  1212.     gdi_lcd_get_active(&act_lcd);
  1213.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1214.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1215. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1216.     gui_stop_list_highlight_effect();
  1217. #endif 
  1218.     /* Max: to redraw list if there is only 1 item. */
  1219.     if (!((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0)))   /* return; */
  1220.     {
  1221.     #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
  1222.         if (MMI_current_menu_type == PAGE_MENU)
  1223.         {
  1224.             is_next_item = 0;
  1225.             show_animated_balls();
  1226.         }
  1227.         else
  1228.     #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */ 
  1229.         {
  1230.             gui_fixed_list_menu_goto_previous_item(&MMI_fixed_list_menu);
  1231.         }
  1232.     }
  1233. #ifdef __MMI_UI_TAB_PANE__
  1234.     if (is_tab_pane_displayed_on_current_screen())
  1235.     {
  1236.         register_tab_pane_keys();
  1237.     }
  1238. #endif /* __MMI_UI_TAB_PANE__ */ 
  1239. #ifdef __MMI_UI_TECHNO_MAINMENU__
  1240.     if (MMI_current_menu_type == PAGE_MENU)
  1241.     {
  1242.         is_next_item = 0;
  1243.         associate_techno_item_positions(0);
  1244.         show_techno_menu_animation();
  1245.     }
  1246. #endif /* __MMI_UI_TECHNO_MAINMENU__ */ 
  1247.     if (MMI_current_menu_type == PAGE_MENU)
  1248.     {
  1249.         gdi_layer_pop_and_restore_active();
  1250.         gdi_lcd_set_active(act_lcd);    
  1251.         return;
  1252.     }
  1253.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1254.     {
  1255.         draw_bg();
  1256.         draw_bg_animation();
  1257.     }
  1258. #ifdef __MMI_INTERACTIVE_PROFILNG__
  1259.     mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
  1260. #endif
  1261. gdi_layer_clear(GDI_COLOR_TRANSPARENT);
  1262.     redraw_fixed_list();
  1263. #ifdef __MMI_INTERACTIVE_PROFILNG__
  1264.     mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
  1265. #endif
  1266.     
  1267.     gdi_layer_pop_and_restore_active();
  1268.     gdi_lcd_set_active(act_lcd);
  1269. }
  1270. /*****************************************************************************
  1271.  * FUNCTION
  1272.  *  fixed_list_goto_next_item
  1273.  * DESCRIPTION
  1274.  *  Highlights the next item
  1275.  * PARAMETERS
  1276.  *  void
  1277.  * RETURNS
  1278.  *  void
  1279.  *****************************************************************************/
  1280. void fixed_list_goto_next_item(void)
  1281. {
  1282.     /*----------------------------------------------------------------*/
  1283.     /* Local Variables                                                */
  1284.     /*----------------------------------------------------------------*/
  1285.     gdi_handle act_lcd;
  1286.     /*----------------------------------------------------------------*/
  1287.     /* Code Body                                                      */
  1288.     /*----------------------------------------------------------------*/
  1289.     if (MMI_fixed_list_menu.n_items <= 0)
  1290.     {
  1291.         return;
  1292.     }
  1293.     gdi_lcd_get_active(&act_lcd);
  1294.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1295.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1296. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1297.     gui_stop_list_highlight_effect();
  1298. #endif 
  1299.     /* Max: to redraw list if there is only 1 item. */
  1300.     if (!((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0)))   /* return; */
  1301.     {
  1302.     #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
  1303.         if (MMI_current_menu_type == PAGE_MENU)
  1304.         {
  1305.             is_next_item = 1;
  1306.             show_animated_balls();
  1307.         }
  1308.         else
  1309.     #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */ 
  1310.             gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
  1311.     }
  1312. #ifdef __MMI_UI_TAB_PANE__
  1313.     if (is_tab_pane_displayed_on_current_screen())
  1314.     {
  1315.         register_tab_pane_keys();
  1316.     }
  1317. #endif /* __MMI_UI_TAB_PANE__ */ 
  1318. #ifdef __MMI_UI_TECHNO_MAINMENU__
  1319.     if (MMI_current_menu_type == PAGE_MENU)
  1320.     {
  1321.         is_next_item = 1;
  1322.         associate_techno_item_positions(1);
  1323.         show_techno_menu_animation();
  1324.     }
  1325. #endif /* __MMI_UI_TECHNO_MAINMENU__ */ 
  1326.     if (MMI_current_menu_type == PAGE_MENU)
  1327.     {
  1328.         gdi_layer_pop_and_restore_active();
  1329.         gdi_lcd_set_active(act_lcd);
  1330.         return;
  1331.     }
  1332.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1333.     {
  1334.         draw_bg();
  1335.         draw_bg_animation();
  1336.     }
  1337. #ifdef __MMI_INTERACTIVE_PROFILNG__
  1338.     mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
  1339. #endif
  1340. gdi_layer_clear(GDI_COLOR_TRANSPARENT);
  1341.     redraw_fixed_list();
  1342.     
  1343. #ifdef __MMI_INTERACTIVE_PROFILNG__
  1344.     mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);    
  1345. #endif
  1346.     gdi_layer_pop_and_restore_active();
  1347.     gdi_lcd_set_active(act_lcd);
  1348. }
  1349. /*****************************************************************************
  1350.  * FUNCTION
  1351.  *  fixed_list_goto_home
  1352.  * DESCRIPTION
  1353.  *  Highlights the first item
  1354.  * PARAMETERS
  1355.  *  void
  1356.  * RETURNS
  1357.  *  void
  1358.  *****************************************************************************/
  1359. void fixed_list_goto_home(void)
  1360. {
  1361.     /*----------------------------------------------------------------*/
  1362.     /* Local Variables                                                */
  1363.     /*----------------------------------------------------------------*/
  1364.     gdi_handle act_lcd;
  1365.     /*----------------------------------------------------------------*/
  1366.     /* Code Body                                                      */
  1367.     /*----------------------------------------------------------------*/
  1368.     if (MMI_fixed_list_menu.n_items <= 0)
  1369.     {
  1370.         return;
  1371.     }
  1372.     if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
  1373.     {
  1374.         return;
  1375.     }
  1376.     gdi_lcd_get_active(&act_lcd);
  1377.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1378.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1379. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1380.     gui_stop_list_highlight_effect();
  1381. #endif 
  1382.     gui_fixed_list_menu_goto_first_item(&MMI_fixed_list_menu);
  1383.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1384.     {
  1385.         draw_bg();
  1386.         draw_bg_animation();
  1387.     }
  1388.     redraw_fixed_list();
  1389.     gdi_layer_pop_and_restore_active();
  1390.     gdi_lcd_set_active(act_lcd);
  1391. }
  1392. /*****************************************************************************
  1393.  * FUNCTION
  1394.  *  fixed_list_goto_end
  1395.  * DESCRIPTION
  1396.  *  Highlights the last item
  1397.  * PARAMETERS
  1398.  *  void
  1399.  * RETURNS
  1400.  *  void
  1401.  *****************************************************************************/
  1402. void fixed_list_goto_end(void)
  1403. {
  1404.     /*----------------------------------------------------------------*/
  1405.     /* Local Variables                                                */
  1406.     /*----------------------------------------------------------------*/
  1407.     gdi_handle act_lcd;
  1408.     /*----------------------------------------------------------------*/
  1409.     /* Code Body                                                      */
  1410.     /*----------------------------------------------------------------*/
  1411.     if (MMI_fixed_list_menu.n_items <= 0)
  1412.     {
  1413.         return;
  1414.     }
  1415.     if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
  1416.     {
  1417.         return;
  1418.     }
  1419.     gdi_lcd_get_active(&act_lcd);
  1420.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1421.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1422. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1423.     gui_stop_list_highlight_effect();
  1424. #endif 
  1425.     gui_fixed_list_menu_goto_last_item(&MMI_fixed_list_menu);
  1426.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1427.     {
  1428.         draw_bg();
  1429.         draw_bg_animation();
  1430.     }
  1431.     redraw_fixed_list();
  1432.     gdi_layer_pop_and_restore_active();
  1433.     gdi_lcd_set_active(act_lcd);
  1434. }
  1435. /*****************************************************************************
  1436.  * FUNCTION
  1437.  *  fixed_list_goto_previous_page
  1438.  * DESCRIPTION
  1439.  *  Highlights an item in the previous page
  1440.  * PARAMETERS
  1441.  *  void
  1442.  * RETURNS
  1443.  *  void
  1444.  *****************************************************************************/
  1445. void fixed_list_goto_previous_page(void)
  1446. {
  1447.     /*----------------------------------------------------------------*/
  1448.     /* Local Variables                                                */
  1449.     /*----------------------------------------------------------------*/
  1450.     gdi_handle act_lcd;
  1451.     /*----------------------------------------------------------------*/
  1452.     /* Code Body                                                      */
  1453.     /*----------------------------------------------------------------*/
  1454.     if (MMI_fixed_list_menu.n_items <= 0)
  1455.     {
  1456.         return;
  1457.     }
  1458.     if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
  1459.     {
  1460.         return;
  1461.     }
  1462.     gdi_lcd_get_active(&act_lcd);
  1463.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1464.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1465. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1466.     gui_stop_list_highlight_effect();
  1467. #endif 
  1468.     gui_fixed_list_menu_goto_previous_page(&MMI_fixed_list_menu);
  1469.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1470.     {
  1471.         draw_bg();
  1472.         draw_bg_animation();
  1473.     }
  1474.     redraw_fixed_list();
  1475.     gdi_layer_pop_and_restore_active();
  1476.     gdi_lcd_set_active(act_lcd);
  1477. }
  1478. /*****************************************************************************
  1479.  * FUNCTION
  1480.  *  fixed_list_goto_next_page
  1481.  * DESCRIPTION
  1482.  *  Highlights an item in the next page
  1483.  * PARAMETERS
  1484.  *  void
  1485.  * RETURNS
  1486.  *  void
  1487.  *****************************************************************************/
  1488. void fixed_list_goto_next_page(void)
  1489. {
  1490.     /*----------------------------------------------------------------*/
  1491.     /* Local Variables                                                */
  1492.     /*----------------------------------------------------------------*/
  1493.     gdi_handle act_lcd;
  1494.     /*----------------------------------------------------------------*/
  1495.     /* Code Body                                                      */
  1496.     /*----------------------------------------------------------------*/
  1497.     if (MMI_fixed_list_menu.n_items <= 0)
  1498.     {
  1499.         return;
  1500.     }
  1501.     if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
  1502.     {
  1503.         return;
  1504.     }
  1505.     gdi_lcd_get_active(&act_lcd);
  1506.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1507.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1508. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1509.     gui_stop_list_highlight_effect();
  1510. #endif 
  1511.     gui_fixed_list_menu_goto_next_page(&MMI_fixed_list_menu);
  1512.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1513.     {
  1514.         draw_bg();
  1515.         draw_bg_animation();
  1516.     }
  1517.     redraw_fixed_list();
  1518.     gdi_layer_pop_and_restore_active();
  1519.     gdi_lcd_set_active(act_lcd);
  1520. }
  1521. /*****************************************************************************
  1522.  * FUNCTION
  1523.  *  fixed_list_goto_item
  1524.  * DESCRIPTION
  1525.  *  Highlights a particular item
  1526.  * PARAMETERS
  1527.  *  item_index      [IN]        Is the index number of the item to be highlighted (zero based)
  1528.  * RETURNS
  1529.  *  void
  1530.  *****************************************************************************/
  1531. void fixed_list_goto_item(S32 item_index)
  1532. {
  1533.     /*----------------------------------------------------------------*/
  1534.     /* Local Variables                                                */
  1535.     /*----------------------------------------------------------------*/
  1536.     gdi_handle act_lcd;
  1537. #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
  1538.     S32 i;
  1539. #endif 
  1540.     /*----------------------------------------------------------------*/
  1541.     /* Code Body                                                      */
  1542.     /*----------------------------------------------------------------*/
  1543.     if (MMI_fixed_list_menu.n_items <= 0)
  1544.     {
  1545.         return;
  1546.     }
  1547.     if (item_index == MMI_fixed_list_menu.highlighted_item)
  1548.     {
  1549.         return;
  1550.     }
  1551.     gdi_lcd_get_active(&act_lcd);
  1552.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1553.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1554. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1555.     if (item_index >= MMI_fixed_list_menu.n_items)
  1556.     {
  1557.         gdi_layer_pop_and_restore_active();
  1558.         return;
  1559.     }
  1560.     gui_stop_list_highlight_effect();
  1561. #endif /* __MMI_UI_LIST_HIGHLIGHT_EFFECTS__ */ 
  1562.     gui_fixed_list_menu_goto_item(&MMI_fixed_list_menu, item_index);
  1563. #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
  1564.     if (MMI_current_menu_type == PAGE_MENU)
  1565.     {
  1566.         gdi_layer_push_clip();
  1567.         gdi_layer_set_clip(
  1568.             MMI_content_x,
  1569.             MMI_content_y,
  1570.             UI_device_width - 1,
  1571.             UI_device_height - MMI_button_bar_height - 1);
  1572.         for (i = 0; i < NUMBER_OF_BALLS; i++)
  1573.         {
  1574.             gui_show_image(*(ball[i].position + 0), *(ball[i].position + 1), get_image(MAIN_MENU_DALMATIAN_BALL));
  1575.         }
  1576.         gdi_layer_pop_clip();
  1577.     }
  1578. #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */ 
  1579. #ifdef __MMI_UI_TAB_PANE__
  1580.     if (is_tab_pane_displayed_on_current_screen())
  1581.     {
  1582.         register_tab_pane_keys();
  1583.     }
  1584. #endif /* __MMI_UI_TAB_PANE__ */ 
  1585.     if (MMI_current_menu_type == PAGE_MENU)
  1586.     {
  1587.         gdi_layer_pop_and_restore_active();
  1588.         gdi_lcd_set_active(act_lcd);    
  1589.         return;
  1590.     }
  1591.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1592.     {
  1593.         draw_bg();
  1594.         draw_bg_animation();
  1595.     }
  1596.     redraw_fixed_list();
  1597.     gdi_layer_pop_and_restore_active();
  1598.     gdi_lcd_set_active(act_lcd);
  1599. }
  1600. /*****************************************************************************
  1601.  * FUNCTION
  1602.  *  fixed_list_goto_item_push_first
  1603.  * DESCRIPTION
  1604.  *  Highlights a particular item and if possible makes it the first displayed item
  1605.  * PARAMETERS
  1606.  *  item_index      [IN]        Is the index number of the item to be highlighted (zero based)
  1607.  * RETURNS
  1608.  *  void
  1609.  *****************************************************************************/
  1610. void fixed_list_goto_item_push_first(S32 item_index)
  1611. {
  1612.     /*----------------------------------------------------------------*/
  1613.     /* Local Variables                                                */
  1614.     /*----------------------------------------------------------------*/
  1615.     gdi_handle act_lcd;
  1616.     /*----------------------------------------------------------------*/
  1617.     /* Code Body                                                      */
  1618.     /*----------------------------------------------------------------*/
  1619.     if (MMI_fixed_list_menu.n_items <= 0)
  1620.     {
  1621.         return;
  1622.     }
  1623.     if (item_index == MMI_fixed_list_menu.highlighted_item)
  1624.     {
  1625.         return;
  1626.     }
  1627.     gdi_lcd_get_active(&act_lcd);
  1628.     gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
  1629.     gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);
  1630. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1631.     gui_stop_list_highlight_effect();
  1632. #endif 
  1633.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_FIRST_SHIFT_HIGHLIGHTED_ITEM;
  1634.     gui_fixed_list_menu_goto_item(&MMI_fixed_list_menu, item_index);
  1635.     MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_FIRST_SHIFT_HIGHLIGHTED_ITEM;
  1636.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
  1637.     {
  1638.         draw_bg();
  1639.         draw_bg_animation();
  1640.     }
  1641.     redraw_fixed_list();
  1642.     gdi_layer_pop_and_restore_active();
  1643.     gdi_lcd_set_active(act_lcd);
  1644. }
  1645. /*****************************************************************************
  1646.  * FUNCTION
  1647.  *  fixed_list_goto_item_no_redraw
  1648.  * DESCRIPTION
  1649.  *  Highlights a particular item, but doesn't redraw the fixed list
  1650.  * PARAMETERS
  1651.  *  item_index      [IN]        Is the index number of the item to be highlighted (zero based)
  1652.  * RETURNS
  1653.  *  void
  1654.  *****************************************************************************/
  1655. void fixed_list_goto_item_no_redraw(S32 item_index)
  1656. {
  1657.     /*----------------------------------------------------------------*/
  1658.     /* Local Variables                                                */
  1659.     /*----------------------------------------------------------------*/
  1660.     /*----------------------------------------------------------------*/
  1661.     /* Code Body                                                      */
  1662.     /*----------------------------------------------------------------*/
  1663.     if (MMI_fixed_list_menu.n_items <= 0)
  1664.     {
  1665.         return;
  1666.     }
  1667.     if (item_index < 0)
  1668.     {
  1669.         item_index = 0;
  1670.     }
  1671.     if (item_index > (MMI_fixed_list_menu.n_items - 1))
  1672.     {
  1673.         item_index = MMI_fixed_list_menu.n_items - 1;
  1674.     }
  1675.     MMI_fixed_list_menu.highlighted_item = -1;
  1676.     gui_fixed_list_menu_goto_item(&MMI_fixed_list_menu, item_index);
  1677. }
  1678. /*****************************************************************************
  1679.  * FUNCTION
  1680.  *  register_fixed_list_shortcut_handler
  1681.  * DESCRIPTION
  1682.  *  Registers the shortcut handler for the fixed list
  1683.  * PARAMETERS
  1684.  *  void
  1685.  * RETURNS
  1686.  *  void
  1687.  *****************************************************************************/
  1688. void register_fixed_list_shortcut_handler(void)
  1689. {
  1690.     /*----------------------------------------------------------------*/
  1691.     /* Local Variables                                                */
  1692.     /*----------------------------------------------------------------*/
  1693.     /*----------------------------------------------------------------*/
  1694.     /* Code Body                                                      */
  1695.     /*----------------------------------------------------------------*/
  1696.     register_menu_shortcut_keys();
  1697.     register_menu_shortcut_handler(fixed_list_goto_item);
  1698. }
  1699. /*****************************************************************************
  1700.  * FUNCTION
  1701.  *  fixed_list_key_handler
  1702.  * DESCRIPTION
  1703.  *  Keyboard (simulator) handler for the fixed list
  1704.  *  
  1705.  *  Internal function
  1706.  * PARAMETERS
  1707.  *  vkey_code       [IN]        
  1708.  *  key_state       [IN]        
  1709.  * RETURNS
  1710.  *  void
  1711.  *****************************************************************************/
  1712. void fixed_list_key_handler(S32 vkey_code, S32 key_state)
  1713. {
  1714. #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
  1715.     /*----------------------------------------------------------------*/
  1716.     /* Local Variables                                                */
  1717.     /*----------------------------------------------------------------*/
  1718.     /*----------------------------------------------------------------*/
  1719.     /* Code Body                                                      */
  1720.     /*----------------------------------------------------------------*/
  1721.     if (key_state)
  1722.     {
  1723.         switch (vkey_code)
  1724.         {
  1725.             case 37:
  1726.                 break;
  1727.             case 39:
  1728.                 break;
  1729.             case 38:
  1730.                 fixed_list_goto_previous_item();
  1731.                 break;
  1732.             case 40:
  1733.                 fixed_list_goto_next_item();
  1734.                 break;
  1735.             case 36:
  1736.                 fixed_list_goto_home();
  1737.                 break;
  1738.             case 35:
  1739.                 fixed_list_goto_end();
  1740.                 break;
  1741.             case 33:
  1742.                 fixed_list_goto_previous_page();
  1743.                 break;
  1744.             case 34:
  1745.                 fixed_list_goto_next_page();
  1746.                 break;
  1747.         }
  1748.     }
  1749. #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */ 
  1750.     UI_UNUSED_PARAMETER(vkey_code);
  1751.     UI_UNUSED_PARAMETER(key_state);
  1752. #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */ 
  1753. }
  1754. /*****************************************************************************
  1755.  * FUNCTION
  1756.  *  fixed_list_keyboard_input_handler
  1757.  * DESCRIPTION
  1758.  *  Keyboard input (simulator) handler for the fixed list
  1759.  *  
  1760.  *  Internal function
  1761.  * PARAMETERS
  1762.  *  keyc        [IN]        
  1763.  * RETURNS
  1764.  *  void
  1765.  *****************************************************************************/
  1766. void fixed_list_keyboard_input_handler(S32 keyc)
  1767. {
  1768.     /*----------------------------------------------------------------*/
  1769.     /* Local Variables                                                */
  1770.     /*----------------------------------------------------------------*/
  1771.     /*----------------------------------------------------------------*/
  1772.     /* Code Body                                                      */
  1773.     /*----------------------------------------------------------------*/
  1774.     UI_UNUSED_PARAMETER(keyc);
  1775. }
  1776. /*****************************************************************************
  1777.  * FUNCTION
  1778.  *  fixed_list_measure
  1779.  * DESCRIPTION
  1780.  *  Gets the dimensions of the fixed list
  1781.  * PARAMETERS
  1782.  *  width       [OUT]       Are the dimensions
  1783.  *  height      [OUT]       Are the dimensions
  1784.  * RETURNS
  1785.  *  void
  1786.  *****************************************************************************/
  1787. void fixed_list_measure(S32 *width, S32 *height)
  1788. {
  1789.     /*----------------------------------------------------------------*/
  1790.     /* Local Variables                                                */
  1791.     /*----------------------------------------------------------------*/
  1792.     /*----------------------------------------------------------------*/
  1793.     /* Code Body                                                      */
  1794.     /*----------------------------------------------------------------*/
  1795.     *width = MMI_fixed_list_menu.width;
  1796.     *height = MMI_fixed_list_menu.height;
  1797. }
  1798. /*****************************************************************************
  1799.  * FUNCTION
  1800.  *  resize_fixed_list
  1801.  * DESCRIPTION
  1802.  *  Changes the size of the fixed list
  1803.  * PARAMETERS
  1804.  *  width       [IN]        Are the new dimensions
  1805.  *  height      [IN]        Are the new dimensions
  1806.  * RETURNS
  1807.  *  void
  1808.  *****************************************************************************/
  1809. void resize_fixed_list(S32 width, S32 height)
  1810. {
  1811.     /*----------------------------------------------------------------*/
  1812.     /* Local Variables                                                */
  1813.     /*----------------------------------------------------------------*/
  1814.     /* Auto resize the height based on height of menu-items and the specified height */
  1815.     /* FIXME. move the following code to gui_resize_fixed_list_menu */
  1816.     S32 w, h = 0, new_height = height;
  1817.     S32 ih, mh, rh, sh, th, count;
  1818.     /*----------------------------------------------------------------*/
  1819.     /* Code Body                                                      */
  1820.     /*----------------------------------------------------------------*/
  1821.     if (MMI_fixed_list_menu.items != NULL)
  1822.     {
  1823.         MMI_fixed_list_menu.item_measure_function(
  1824.                                 MMI_fixed_list_menu.items[0],
  1825.                                 MMI_fixed_list_menu.common_item_data,
  1826.                                 &w,
  1827.                                 &h);
  1828.     }
  1829.     else
  1830.     {
  1831.         MMI_fixed_list_menu.item_measure_function(NULL, MMI_fixed_list_menu.common_item_data, &w, &h);
  1832.     }
  1833.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_ALIGN_TO_TOP)
  1834.     {
  1835.         MMI_fixed_list_menu.spacing = 0;
  1836.         MMI_fixed_list_menu.top = 1;    /* FIXME. remove the magic number */
  1837.     }
  1838.     else if (h > 0)
  1839.     {
  1840.         ih = h;
  1841.         count = height / ih;    /* MMI_fixed_list_menu.height/ih; */
  1842.         mh = count * ih;
  1843.         rh = height - mh;       /* MMI_fixed_list_menu.height - mh; */
  1844.         sh = rh / (count + 1);
  1845.         th = (rh - (sh * (count - 1))) / 2;
  1846.         MMI_fixed_list_menu.spacing = sh;
  1847.         MMI_fixed_list_menu.top = rh - (sh * (count - 1)) - th;
  1848.     }
  1849.     if (MMI_fixed_list_menu.item_resize_function != NULL)
  1850.     {
  1851.         MMI_fixed_list_menu.item_resize_function(w, 0); /* Change width of menuitem according to list menu at the same time. */
  1852.     }
  1853.     gui_resize_fixed_list_menu(&MMI_fixed_list_menu, width, new_height);
  1854. }
  1855. /*****************************************************************************
  1856.  * FUNCTION
  1857.  *  register_fixed_list_keys
  1858.  * DESCRIPTION
  1859.  *  Registers the keyboard (simulator) and keypad handlers for the fixed list
  1860.  * PARAMETERS
  1861.  *  void
  1862.  * RETURNS
  1863.  *  void
  1864.  *****************************************************************************/
  1865. void register_fixed_list_keys(void)
  1866. {
  1867.     /*----------------------------------------------------------------*/
  1868.     /* Local Variables                                                */
  1869.     /*----------------------------------------------------------------*/
  1870.     /*----------------------------------------------------------------*/
  1871.     /* Code Body                                                      */
  1872.     /*----------------------------------------------------------------*/
  1873.     register_keyboard_key_handler(fixed_list_key_handler);
  1874.     SetKeyHandler(fixed_list_goto_previous_item, KEY_UP_ARROW, KEY_EVENT_DOWN);
  1875.     SetKeyHandler(fixed_list_goto_next_item, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  1876.     SetKeyHandler(fixed_list_goto_previous_item, KEY_VOL_UP, KEY_EVENT_DOWN);
  1877.     SetKeyHandler(fixed_list_goto_next_item, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1878. }
  1879. /* PMT NEERAJ START 20050425 */
  1880. #ifdef __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__
  1881. /*****************************************************************************
  1882.  * FUNCTION
  1883.  *  register_horizontal_fixed_list_keys
  1884.  * DESCRIPTION
  1885.  *  Registers the keyboard (simulator) and keypad handlers for the horizontal fixed list
  1886.  * PARAMETERS
  1887.  *  void
  1888.  * RETURNS
  1889.  *  void
  1890.  *****************************************************************************/
  1891. void register_horizontal_fixed_list_keys(void)
  1892. {
  1893.     /*----------------------------------------------------------------*/
  1894.     /* Local Variables                                                */
  1895.     /*----------------------------------------------------------------*/
  1896.     /*----------------------------------------------------------------*/
  1897.     /* Code Body                                                      */
  1898.     /*----------------------------------------------------------------*/
  1899.     SetKeyHandler(fixed_list_goto_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1900.     SetKeyHandler(fixed_list_goto_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1901. }
  1902. #endif /* __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__ */ 
  1903. /* PMT NEERAJ END 20050425 */
  1904. /*****************************************************************************
  1905.  * FUNCTION
  1906.  *  reset_fixed_list
  1907.  * DESCRIPTION
  1908.  *  Clears the key and highlight handlers for the fixed list
  1909.  * PARAMETERS
  1910.  *  void
  1911.  * RETURNS
  1912.  *  void
  1913.  *****************************************************************************/
  1914. void reset_fixed_list(void)
  1915. {
  1916.     /*----------------------------------------------------------------*/
  1917.     /* Local Variables                                                */
  1918.     /*----------------------------------------------------------------*/
  1919.     /*----------------------------------------------------------------*/
  1920.     /* Code Body                                                      */
  1921.     /*----------------------------------------------------------------*/
  1922.     /* PMT VIKAS START 20050720 */
  1923. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1924.     gui_stop_list_highlight_effect();
  1925. #endif 
  1926.     /* PMT VIKAS END 20050720 */
  1927. #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
  1928.     gui_cancel_timer(wgui_fixed_list_menu_end_frame);
  1929.     wgui_fixed_list_menu_frame_counter = 0;
  1930. #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */ 
  1931.     normal_fixed_list();
  1932.     /* PMT VIKAS START 20050610 */
  1933. #if defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__)      /* 072505 Calvin modified */
  1934.     gui_reset_transparent_source_layer();
  1935. #endif 
  1936.     /* PMT VIKAS END */
  1937.     clear_keyboard_key_handler();
  1938.     ClearKeyHandler(KEY_UP_ARROW, KEY_EVENT_DOWN);
  1939.     ClearKeyHandler(KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  1940.     MMI_fixed_list_menu.item_highlighted = dummy_highlight_handler;
  1941.     MMI_fixed_list_menu.highlighted_item = -1;
  1942.     wgui_text_menuitem_reset_scrolling();
  1943.     gui_fixed_icontext_list_menuitem_stop_scroll();
  1944.     /* PMT NEERAJ START 20050825 */
  1945. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  1946.     reset_fixed_icontext_menuitem_type();
  1947. #endif 
  1948.     /* PMT NEERAJ END 20050825 */
  1949. }
  1950. /*****************************************************************************
  1951.  * FUNCTION
  1952.  *  fixed_list_disable_looping
  1953.  * DESCRIPTION
  1954.  *  Disables looping
  1955.  * PARAMETERS
  1956.  *  void
  1957.  * RETURNS
  1958.  *  void
  1959.  *****************************************************************************/
  1960. void fixed_list_disable_looping(void)
  1961. {
  1962.     /*----------------------------------------------------------------*/
  1963.     /* Local Variables                                                */
  1964.     /*----------------------------------------------------------------*/
  1965.     /*----------------------------------------------------------------*/
  1966.     /* Code Body                                                      */
  1967.     /*----------------------------------------------------------------*/
  1968.     MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_LOOP;
  1969. }
  1970. /*****************************************************************************
  1971.  * FUNCTION
  1972.  *  fixed_list_enable_looping
  1973.  * DESCRIPTION
  1974.  *  Enables looping
  1975.  * PARAMETERS
  1976.  *  void
  1977.  * RETURNS
  1978.  *  void
  1979.  *****************************************************************************/
  1980. void fixed_list_enable_looping(void)
  1981. {
  1982.     /*----------------------------------------------------------------*/
  1983.     /* Local Variables                                                */
  1984.     /*----------------------------------------------------------------*/
  1985.     /*----------------------------------------------------------------*/
  1986.     /* Code Body                                                      */
  1987.     /*----------------------------------------------------------------*/
  1988.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_LOOP;
  1989. }
  1990. /* Fixed matrix menu wrappers          */
  1991. fixed_matrix_menu MMI_fixed_matrix_menu;
  1992. /*****************************************************************************
  1993.  * FUNCTION
  1994.  *  dummy_fixed_matrix_resize_function
  1995.  * DESCRIPTION
  1996.  *  
  1997.  * PARAMETERS
  1998.  *  item_width      [IN]        
  1999.  *  item_height     [IN]        
  2000.  * RETURNS
  2001.  *  void
  2002.  *****************************************************************************/
  2003. void dummy_fixed_matrix_resize_function(S32 item_width, S32 item_height)
  2004. {
  2005.     /*----------------------------------------------------------------*/
  2006.     /* Local Variables                                                */
  2007.     /*----------------------------------------------------------------*/
  2008.     /*----------------------------------------------------------------*/
  2009.     /* Code Body                                                      */
  2010.     /*----------------------------------------------------------------*/
  2011.     UI_UNUSED_PARAMETER(item_width);
  2012.     UI_UNUSED_PARAMETER(item_height);
  2013. }
  2014. void (*resize_fixed_matrix_menuitems) (S32 item_width, S32 item_height) = dummy_fixed_matrix_resize_function;
  2015. /*****************************************************************************
  2016.  * FUNCTION
  2017.  *  create_fixed_matrix
  2018.  * DESCRIPTION
  2019.  *  Creates a fixed matrix menu
  2020.  * PARAMETERS
  2021.  *  void
  2022.  * RETURNS
  2023.  *  void
  2024.  *****************************************************************************/
  2025. void create_fixed_matrix(void)
  2026. {
  2027.     /*----------------------------------------------------------------*/
  2028.     /* Local Variables                                                */
  2029.     /*----------------------------------------------------------------*/
  2030.     /*----------------------------------------------------------------*/
  2031.     /* Code Body                                                      */
  2032.     /*----------------------------------------------------------------*/
  2033.     gui_create_fixed_matrix_menu(
  2034.         &MMI_fixed_matrix_menu,
  2035.         MMI_content_x,
  2036.         MMI_content_y,
  2037.         MMI_content_width,
  2038.         MMI_content_height - MMI_matrix_bar_height);
  2039. }
  2040. /*****************************************************************************
  2041.  * FUNCTION
  2042.  *  move_fixed_matrix
  2043.  * DESCRIPTION
  2044.  *  Moves the fixed matrix menu to a new location
  2045.  * PARAMETERS
  2046.  *  x       [IN]        Is the new left-top corner location
  2047.  *  y       [IN]        Is the new left-top corner location
  2048.  * RETURNS
  2049.  *  void
  2050.  *****************************************************************************/
  2051. void move_fixed_matrix(S32 x, S32 y)
  2052. {
  2053.     /*----------------------------------------------------------------*/
  2054.     /* Local Variables                                                */
  2055.     /*----------------------------------------------------------------*/
  2056.     /*----------------------------------------------------------------*/
  2057.     /* Code Body                                                      */
  2058.     /*----------------------------------------------------------------*/
  2059.     gui_move_fixed_matrix_menu(&MMI_fixed_matrix_menu, x, y);
  2060. }
  2061. /*****************************************************************************
  2062.  * FUNCTION
  2063.  *  show_fixed_matrix
  2064.  * DESCRIPTION
  2065.  *  Displays the fixed matrix
  2066.  * PARAMETERS
  2067.  *  void
  2068.  * RETURNS
  2069.  *  void
  2070.  *****************************************************************************/
  2071. #ifdef __MMI_MATRIX_MAIN_MENU_OPTIMIZE__
  2072. extern PU8 MMI_mm_animation;
  2073. #endif 
  2074. void show_fixed_matrix(void)
  2075. {
  2076.     /*----------------------------------------------------------------*/
  2077.     /* Local Variables                                                */
  2078.     /*----------------------------------------------------------------*/
  2079.     /*----------------------------------------------------------------*/
  2080.     /* Code Body                                                      */
  2081.     /*----------------------------------------------------------------*/
  2082.     gui_lock_double_buffer();
  2083.     /* gdi_image_stop_animation_all(); */
  2084.     if (MMI_current_menu_type == MATRIX_MENU_EMS)
  2085.     {
  2086.         gui_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
  2087.     }
  2088.     else
  2089.     {
  2090.     #ifdef __MMI_MATRIX_MAIN_MENU_OPTIMIZE__
  2091.         if (MMI_fixed_matrix_menu.flags & UI_MATRIX_MENU_FOR_MAINMENU)
  2092.         {
  2093.             gui_measure_image(
  2094.                 MMI_mm_animation,
  2095.                 &(MMI_fixed_matrix_menu.highlighted_item_width),
  2096.                 &(MMI_fixed_matrix_menu.highlighted_item_height));
  2097.             if (MMI_fixed_matrix_menu.last_highlighted_item != -1)
  2098.             {
  2099.                 mtk_UI_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
  2100.             }
  2101.             else
  2102.             {
  2103.                 gui_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
  2104.             }
  2105.         }
  2106.         else
  2107.         {
  2108.             MMI_fixed_matrix_menu.highlighted_item_width = MMI_fixed_matrix_menu.item_width;
  2109.             MMI_fixed_matrix_menu.highlighted_item_height = MMI_fixed_matrix_menu.item_height;
  2110.             gui_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
  2111.         }
  2112.     #else /* __MMI_MATRIX_MAIN_MENU_OPTIMIZE__ */ 
  2113.         gui_show_fixed_matrix_menu(&MMI_fixed_matrix_menu);
  2114.     #endif /* __MMI_MATRIX_MAIN_MENU_OPTIMIZE__ */ 
  2115.     }
  2116.     gui_unlock_double_buffer();
  2117.     gui_BLT_double_buffer(
  2118.         MMI_fixed_matrix_menu.x,
  2119.         MMI_fixed_matrix_menu.y,
  2120.         MMI_fixed_matrix_menu.x + MMI_fixed_matrix_menu.width - 1,
  2121.         MMI_fixed_matrix_menu.y + MMI_fixed_matrix_menu.height - 1);
  2122. }
  2123. /* For Draw Manager  */
  2124. /*****************************************************************************
  2125.  * FUNCTION
  2126.  *  reset_fixed_matrix_col_rows
  2127.  * DESCRIPTION
  2128.  *  Reset the fixed matrix
  2129.  * PARAMETERS
  2130.  *  void
  2131.  * RETURNS
  2132.  *  void
  2133.  *****************************************************************************/
  2134. void reset_fixed_matrix_col_rows(void)
  2135. {
  2136.     /*----------------------------------------------------------------*/
  2137.     /* Local Variables                                                */
  2138.     /*----------------------------------------------------------------*/
  2139.     /*----------------------------------------------------------------*/
  2140.     /* Code Body                                                      */
  2141.     /*----------------------------------------------------------------*/
  2142.     gui_reset_fixed_matrix_col_rows(&MMI_fixed_matrix_menu);
  2143. }
  2144. /*****************************************************************************
  2145.  * FUNCTION
  2146.  *  configure_fixed_matrix
  2147.  * DESCRIPTION
  2148.  *  Sets the number of columns and rows and the dimensions of the menuitems
  2149.  * PARAMETERS
  2150.  *  item_width      [IN]        Is the width of each item        |  Any one of these must be specified and the other
  2151.  *  item_height     [IN]        Is the height of each item       |  Any one of these must be specified and the other
  2152.  *  n_columns       [IN]        Is the number of columns to display |  parameter can be zero
  2153.  *  n_rows          [IN]        Is the number of rows to display |  parameter can be zero
  2154.  * RETURNS
  2155.  *  void
  2156.  *****************************************************************************/
  2157. void configure_fixed_matrix(S32 item_width, S32 item_height, S32 n_columns, S32 n_rows)
  2158. {
  2159.     /*----------------------------------------------------------------*/
  2160.     /* Local Variables                                                */
  2161.     /*----------------------------------------------------------------*/
  2162.     /*----------------------------------------------------------------*/
  2163.     /* Code Body                                                      */
  2164.     /*----------------------------------------------------------------*/
  2165.     gui_fixed_matrix_menu_setup(&MMI_fixed_matrix_menu, item_width, item_height, n_columns, n_rows);
  2166.     resize_fixed_matrix_menuitems(MMI_fixed_matrix_menu.item_width, MMI_fixed_matrix_menu.item_height);
  2167. }
  2168. /*****************************************************************************
  2169.  * FUNCTION
  2170.  *  register_fixed_matrix_highlight_handler
  2171.  * DESCRIPTION
  2172.  *  Registers the highlight handler for the fixed matrix menu
  2173.  * PARAMETERS
  2174.  *  f               [IN]        Is the function that is called when an item is highlighted
  2175.  *  which(?)        [IN]        Is the index number of the highlighted item (zero based)
  2176.  *  This(?)         [IN]        Function is called with the parameter item_index,
  2177.  * RETURNS
  2178.  *  void
  2179.  *****************************************************************************/
  2180. void register_fixed_matrix_highlight_handler(void (*f) (S32 item_index))
  2181. {
  2182.     /*----------------------------------------------------------------*/
  2183.     /* Local Variables                                                */
  2184.     /*----------------------------------------------------------------*/
  2185.     /*----------------------------------------------------------------*/
  2186.     /* Code Body                                                      */
  2187.     /*----------------------------------------------------------------*/
  2188.     MMI_fixed_matrix_menu.item_highlighted = f;
  2189. }
  2190. /*****************************************************************************
  2191.  * FUNCTION
  2192.  *  clear_fixed_matrix_highlight_handler
  2193.  * DESCRIPTION
  2194.  *  Clears the highlight handler for the fixed matrix menu
  2195.  * PARAMETERS
  2196.  *  void
  2197.  * RETURNS
  2198.  *  void
  2199.  *****************************************************************************/
  2200. void clear_fixed_matrix_highlight_handler(void)
  2201. {
  2202.     /*----------------------------------------------------------------*/
  2203.     /* Local Variables                                                */
  2204.     /*----------------------------------------------------------------*/
  2205.     /*----------------------------------------------------------------*/
  2206.     /* Code Body                                                      */
  2207.     /*----------------------------------------------------------------*/
  2208.     MMI_fixed_matrix_menu.item_highlighted = dummy_highlight_handler;
  2209. }
  2210. /*****************************************************************************
  2211.  * FUNCTION
  2212.  *  fixed_matrix_goto_previous_item
  2213.  * DESCRIPTION
  2214.  *  Highlights the previous item
  2215.  * PARAMETERS
  2216.  *  void
  2217.  * RETURNS
  2218.  *  void
  2219.  *****************************************************************************/
  2220. void fixed_matrix_goto_previous_item(void)
  2221. {
  2222.     /*----------------------------------------------------------------*/
  2223.     /* Local Variables                                                */
  2224.     /*----------------------------------------------------------------*/
  2225.     /*----------------------------------------------------------------*/
  2226.     /* Code Body                                                      */
  2227.     /*----------------------------------------------------------------*/
  2228.     MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
  2229. #ifdef __MMI_INTERACTIVE_PROFILNG__
  2230.     mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
  2231. #endif
  2232.     gui_fixed_matrix_menu_goto_previous_item(&MMI_fixed_matrix_menu);
  2233.     show_fixed_matrix();
  2234. #ifdef __MMI_INTERACTIVE_PROFILNG__
  2235.     mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
  2236. #endif    
  2237. }
  2238. /*****************************************************************************
  2239.  * FUNCTION
  2240.  *  fixed_matrix_goto_next_item
  2241.  * DESCRIPTION
  2242.  *  Highlights the next item
  2243.  * PARAMETERS
  2244.  *  void
  2245.  * RETURNS
  2246.  *  void
  2247.  *****************************************************************************/
  2248. void fixed_matrix_goto_next_item(void)
  2249. {
  2250.     /*----------------------------------------------------------------*/
  2251.     /* Local Variables                                                */
  2252.     /*----------------------------------------------------------------*/
  2253.     /*----------------------------------------------------------------*/
  2254.     /* Code Body                                                      */
  2255.     /*----------------------------------------------------------------*/
  2256.     MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
  2257. #ifdef __MMI_INTERACTIVE_PROFILNG__
  2258.     mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
  2259. #endif
  2260.     gui_fixed_matrix_menu_goto_next_item(&MMI_fixed_matrix_menu);
  2261.     show_fixed_matrix();
  2262. #ifdef __MMI_INTERACTIVE_PROFILNG__
  2263.     mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
  2264. #endif        
  2265. }
  2266. /*****************************************************************************
  2267.  * FUNCTION
  2268.  *  fixed_matrix_goto_previous_column
  2269.  * DESCRIPTION
  2270.  *  Highlights an item in the previous column
  2271.  * PARAMETERS
  2272.  *  void
  2273.  * RETURNS
  2274.  *  void
  2275.  *****************************************************************************/
  2276. void fixed_matrix_goto_previous_column(void)
  2277. {
  2278.     /*----------------------------------------------------------------*/
  2279.     /* Local Variables                                                */
  2280.     /*----------------------------------------------------------------*/
  2281.     /*----------------------------------------------------------------*/
  2282.     /* Code Body                                                      */
  2283.     /*----------------------------------------------------------------*/
  2284.     MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
  2285.     gui_fixed_matrix_menu_goto_previous_column(&MMI_fixed_matrix_menu);
  2286.     show_fixed_matrix();
  2287. }
  2288. /*****************************************************************************
  2289.  * FUNCTION
  2290.  *  fixed_matrix_goto_next_column
  2291.  * DESCRIPTION
  2292.  *  Highlights an item in the next column
  2293.  * PARAMETERS
  2294.  *  void
  2295.  * RETURNS
  2296.  *  void
  2297.  *****************************************************************************/
  2298. void fixed_matrix_goto_next_column(void)
  2299. {
  2300.     /*----------------------------------------------------------------*/
  2301.     /* Local Variables                                                */
  2302.     /*----------------------------------------------------------------*/
  2303.     /*----------------------------------------------------------------*/
  2304.     /* Code Body                                                      */
  2305.     /*----------------------------------------------------------------*/
  2306.     MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
  2307.     gui_fixed_matrix_menu_goto_next_column(&MMI_fixed_matrix_menu);
  2308.     show_fixed_matrix();
  2309. }
  2310. /*****************************************************************************
  2311.  * FUNCTION
  2312.  *  fixed_matrix_goto_previous_row
  2313.  * DESCRIPTION
  2314.  *  Highlights an item in the previous row
  2315.  * PARAMETERS
  2316.  *  void
  2317.  * RETURNS
  2318.  *  void
  2319.  *****************************************************************************/
  2320. void fixed_matrix_goto_previous_row(void)
  2321. {
  2322.     /*----------------------------------------------------------------*/
  2323.     /* Local Variables                                                */
  2324.     /*----------------------------------------------------------------*/
  2325.     /*----------------------------------------------------------------*/
  2326.     /* Code Body                                                      */
  2327.     /*----------------------------------------------------------------*/
  2328.     MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
  2329. #ifdef __MMI_INTERACTIVE_PROFILNG__
  2330.     mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
  2331. #endif
  2332.     
  2333.     gui_fixed_matrix_menu_goto_previous_row(&MMI_fixed_matrix_menu);
  2334.     show_fixed_matrix();
  2335. #ifdef __MMI_INTERACTIVE_PROFILNG__
  2336.     mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
  2337. #endif    
  2338. }
  2339. /*****************************************************************************
  2340.  * FUNCTION
  2341.  *  fixed_matrix_goto_next_row
  2342.  * DESCRIPTION
  2343.  *  Highlights an item in the next row
  2344.  * PARAMETERS
  2345.  *  void
  2346.  * RETURNS
  2347.  *  void
  2348.  *****************************************************************************/
  2349. void fixed_matrix_goto_next_row(void)
  2350. {
  2351.     /*----------------------------------------------------------------*/
  2352.     /* Local Variables                                                */
  2353.     /*----------------------------------------------------------------*/
  2354.     /*----------------------------------------------------------------*/
  2355.     /* Code Body                                                      */
  2356.     /*----------------------------------------------------------------*/
  2357.     MMI_fixed_matrix_menu.last_highlighted_item = MMI_fixed_matrix_menu.highlighted_item;
  2358. #ifdef __MMI_INTERACTIVE_PROFILNG__
  2359.     mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);
  2360. #endif
  2361.     
  2362.     gui_fixed_matrix_menu_goto_next_row(&MMI_fixed_matrix_menu);
  2363.     show_fixed_matrix();
  2364. #ifdef __MMI_INTERACTIVE_PROFILNG__
  2365.     mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_MATRIX_HIGHLIGHT);