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

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_menuitems.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   Maui_Software
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *  menuitems 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.  ****************************************************************************/
  108. /*
  109.  * Copyright Notice
  110.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  111.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  112.  *  (It is illegal to remove this copyright notice from this software or any
  113.  *  portion of it)
  114.  */
  115. /**********************************************************************************
  116.    Filename:      wgui_fixed_menuitems.c
  117.    Author:        manju
  118.    Date Created:  August-07-2002
  119.    Contains:      PixTel UI wrapper routines for Fixed Menuitems
  120. **********************************************************************************/
  121. #include "MMI_features.h"
  122. #include "wgui_fixed_menuitems.h"
  123. #ifdef __MMI_SLIM_LISTMENU__
  124. #include "GlobalDefs.h"
  125. #endif 
  126. #include "MainMenuDef.h"
  127. #include "CustMenuRes.h"
  128. integrated_menuitem integratedMenus;
  129. void (*wgui_text_menuitem_reset_scrolling) (void) = UI_dummy_function;
  130. void (*wgui_text_menuitem_restart_scrolling) (void) = UI_dummy_function;
  131. /* Fixed text item wrappers            */
  132. fixed_text_menuitem MMI_fixed_text_menuitem;
  133. /* fixed_text_menuitem_type                             MMI_fixed_text_menuitems[MAX_FIXED_TEXT_MENU_ITEMS]; */
  134. fixed_text_menuitem_type *MMI_fixed_text_menuitems = (fixed_text_menuitem_type *) & integratedMenus;
  135. S32 *fixed_text_menu_n_items;
  136. /* MTK Leo add */
  137. extern U8 GetMenuItemHeight(U8 font_height);
  138. extern U16 gCurrLangIndex;
  139. extern S32 MMI_menuitem_height;
  140. /* MTK Leo end */
  141. /* void pointers required for fixed menuitems   */
  142. /* This value should not be less than the    
  143.    maximum number of items possible to be
  144.    displayed in menus.                    */
  145. void *MMI_fixed_menuitem_pointers[MAX_FIXED_MENU_ITEM_POINTERS];
  146. /* MTK Leo add 20050225, for new list_matrix menu style */
  147. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  148. void *MMI_fixed_menuitem_pointers2[MAX_MAIN_MENU_ITEMS];
  149. #endif 
  150. /* MTK Leo end 20050225 */
  151. /*****************************************************************************
  152.  * FUNCTION
  153.  *  get_menu_item_height
  154.  * DESCRIPTION
  155.  *  Get the height of menuitem according to current font height
  156.  * PARAMETERS
  157.  *  void
  158.  * RETURNS
  159.  *  void
  160.  *****************************************************************************/
  161. U8 get_menu_item_height()
  162. {
  163.     /*----------------------------------------------------------------*/
  164.     /* Local Variables                                                */
  165.     /*----------------------------------------------------------------*/
  166.     U8 font_height;
  167.     U8 height;
  168.     /*----------------------------------------------------------------*/
  169.     /* Code Body                                                      */
  170.     /*----------------------------------------------------------------*/
  171.     font_height = (U8) Get_FontHeight(MMI_medium_font, (U8) gCurrLangIndex);
  172.     height = GetMenuItemHeight(font_height);
  173.     if (height == 0)
  174.     {
  175.         return (U8) MMI_menuitem_height;
  176.     }
  177.     else
  178.     {
  179.         return height;
  180.     }
  181. }
  182. /*****************************************************************************
  183.  * FUNCTION
  184.  *  fixed_text_menuitem_apply_current_theme
  185.  * DESCRIPTION
  186.  *  Apply the current theme for the fixed text menuitems
  187.  * PARAMETERS
  188.  *  void
  189.  * RETURNS
  190.  *  void
  191.  *****************************************************************************/
  192. void fixed_text_menuitem_apply_current_theme(void)
  193. {
  194.     /*----------------------------------------------------------------*/
  195.     /* Local Variables                                                */
  196.     /*----------------------------------------------------------------*/
  197.     /*----------------------------------------------------------------*/
  198.     /* Code Body                                                      */
  199.     /*----------------------------------------------------------------*/
  200.     gui_set_fixed_text_menuitem_current_theme(&MMI_fixed_text_menuitem);
  201. }
  202. /*****************************************************************************
  203.  * FUNCTION
  204.  *  fixed_text_menuitem_apply_theme
  205.  * DESCRIPTION
  206.  *  Apply the given theme to the fixed text menuitems
  207.  * PARAMETERS
  208.  *  t       [?]     
  209.  * RETURNS
  210.  *  void
  211.  *****************************************************************************/
  212. void fixed_text_menuitem_apply_theme(UI_fixed_text_menuitem_theme *t)
  213. {
  214.     /*----------------------------------------------------------------*/
  215.     /* Local Variables                                                */
  216.     /*----------------------------------------------------------------*/
  217.     /*----------------------------------------------------------------*/
  218.     /* Code Body                                                      */
  219.     /*----------------------------------------------------------------*/
  220.     gui_set_fixed_text_menuitem_theme(&MMI_fixed_text_menuitem, t);
  221. }
  222. /*****************************************************************************
  223.  * FUNCTION
  224.  *  create_fixed_text_menuitems
  225.  * DESCRIPTION
  226.  *  Creates an array of fixed text menuitems and configures
  227.  *  the common data
  228.  * PARAMETERS
  229.  *  void
  230.  * RETURNS
  231.  *  void
  232.  *****************************************************************************/
  233. void create_fixed_text_menuitems(void)
  234. {
  235.     /*----------------------------------------------------------------*/
  236.     /* Local Variables                                                */
  237.     /*----------------------------------------------------------------*/
  238.     S32 i;
  239.     /*----------------------------------------------------------------*/
  240.     /* Code Body                                                      */
  241.     /*----------------------------------------------------------------*/
  242.     gui_create_fixed_text_menuitem(&MMI_fixed_text_menuitem, 108, 18);
  243.     gui_fixed_text_menuitem_set_text_position(&MMI_fixed_text_menuitem, 2, 0);
  244.     MMI_fixed_text_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  245.     for (i = 0; i < MAX_FIXED_TEXT_MENU_ITEMS && i < MAX_FIXED_MENU_ITEM_POINTERS; i++)
  246.     {
  247.         MMI_fixed_text_menuitems[i].flags = 0;
  248.         MMI_fixed_menuitem_pointers[i] = (void*)&MMI_fixed_text_menuitems[i];
  249.     }
  250.     fixed_text_menuitem_apply_current_theme();
  251. }
  252. /*****************************************************************************
  253.  * FUNCTION
  254.  *  resize_fixed_text_menuitems
  255.  * DESCRIPTION
  256.  *  Changes the size of all fixed text menuitems
  257.  * PARAMETERS
  258.  *  width       [IN]        Are the new dimensions
  259.  *  height      [IN]        Are the new dimensions
  260.  * RETURNS
  261.  *  void
  262.  *****************************************************************************/
  263. void resize_fixed_text_menuitems(S32 width, S32 height)
  264. {
  265.     /*----------------------------------------------------------------*/
  266.     /* Local Variables                                                */
  267.     /*----------------------------------------------------------------*/
  268.     /*----------------------------------------------------------------*/
  269.     /* Code Body                                                      */
  270.     /*----------------------------------------------------------------*/
  271.     if (width == 0)
  272.     {
  273.         width = MMI_fixed_text_menuitem.width;
  274.     }
  275.     if (height == 0)
  276.     {
  277.         height = MMI_fixed_text_menuitem.height;
  278.     }
  279.     gui_resize_fixed_text_menuitem(&MMI_fixed_text_menuitem, width, height);
  280. }
  281. /*****************************************************************************
  282.  * FUNCTION
  283.  *  associate_fixed_text_list
  284.  * DESCRIPTION
  285.  *  Associates fixed text menuitems with the fixed list menu
  286.  * PARAMETERS
  287.  *  void
  288.  * RETURNS
  289.  *  void
  290.  *****************************************************************************/
  291. void associate_fixed_text_list(void)
  292. {
  293.     /*----------------------------------------------------------------*/
  294.     /* Local Variables                                                */
  295.     /*----------------------------------------------------------------*/
  296.     /*----------------------------------------------------------------*/
  297.     /* Code Body                                                      */
  298.     /*----------------------------------------------------------------*/
  299.     clear_fixed_list_highlight_handler();
  300.     gui_set_fixed_list_menu_item_functions(
  301.         &MMI_fixed_list_menu,
  302.         gui_show_fixed_text_menuitem,
  303.         gui_measure_fixed_text_menuitem,
  304.         gui_highlight_fixed_text_menuitem,
  305.         gui_remove_highlight_fixed_text_menuitem,
  306.         UI_fixed_menuitem_dummy_hide_function,
  307.         resize_fixed_text_menuitems);
  308. #ifdef __MMI_TOUCH_SCREEN__
  309.     gui_set_fixed_list_menu_item_pen_function(
  310.         &MMI_fixed_list_menu,
  311.         UI_fixed_menuitem_dummy_pen_function,
  312.         MMI_FALSE,
  313.         MMI_FALSE);
  314. #endif /* __MMI_TOUCH_SCREEN__ */ 
  315. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  316.     set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
  317. #endif 
  318.     MMI_fixed_list_menu.first_displayed_item = 0;
  319.     MMI_fixed_list_menu.highlighted_item = 0;
  320.     fixed_text_menu_n_items = &MMI_fixed_list_menu.n_items;
  321.     MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
  322.     MMI_fixed_list_menu.common_item_data = &MMI_fixed_text_menuitem;
  323.     MMI_fixed_text_menuitem.parent_list = &MMI_fixed_list_menu;
  324.     MMI_fixed_text_menuitem.parent_matrix = NULL;
  325.     MMI_fixed_text_menuitem.flags &= ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_DISABLE_HIGHLIGHT);
  326.     MMI_fixed_text_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  327. #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
  328.     MMI_fixed_text_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
  329. #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
  330.     MMI_fixed_text_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
  331. #endif 
  332.     (*fixed_text_menu_n_items) = 0;
  333.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_SCROLLBAR)
  334.     {
  335.         resize_fixed_text_menuitems(MMI_fixed_list_menu.width - 4, get_menu_item_height());
  336.     }
  337.     else
  338.     {
  339.         resize_fixed_text_menuitems(
  340.             MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1,
  341.             get_menu_item_height());
  342.     }
  343. #ifdef __MMI_TOUCH_SCREEN__
  344.     MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
  345.     MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
  346. #endif /* __MMI_TOUCH_SCREEN__ */ 
  347.     MMI_disable_title_shortcut_display = 0;
  348.     set_MMI_current_fixed_text_menuitem_theme_list();
  349.     gui_set_fixed_text_menuitem_current_theme(&MMI_fixed_text_menuitem);
  350.     wgui_text_menuitem_reset_scrolling = gui_fixed_text_menuitem_stop_scroll;
  351.     wgui_text_menuitem_restart_scrolling = gui_fixed_text_menuitem_start_scroll;
  352. }
  353. /* For Draw Manager  */
  354. /*****************************************************************************
  355.  * FUNCTION
  356.  *  fixed_matrix_auto_disable_scrollbar
  357.  * DESCRIPTION
  358.  *  Associates fixed text menuitems with the fixed list menu
  359.  * PARAMETERS
  360.  *  void
  361.  * RETURNS
  362.  *  void
  363.  *****************************************************************************/
  364. S32 fixed_matrix_auto_disable_scrollbar(void)
  365. {
  366.     /*----------------------------------------------------------------*/
  367.     /* Local Variables                                                */
  368.     /*----------------------------------------------------------------*/
  369.     /*----------------------------------------------------------------*/
  370.     /* Code Body                                                      */
  371.     /*----------------------------------------------------------------*/
  372.     /* return(gui_fixed_matrix_auto_disable_scrollbar(&MMI_fixed_text_menuitem)); */
  373.     return (gui_fixed_matrix_auto_disable_scrollbar(&MMI_fixed_matrix_menu));
  374. }
  375. /*****************************************************************************
  376.  * FUNCTION
  377.  *  associate_fixed_text_matrix
  378.  * DESCRIPTION
  379.  *  Associates fixed text menuitems with the fixed matrix menu
  380.  * PARAMETERS
  381.  *  void
  382.  * RETURNS
  383.  *  void
  384.  *****************************************************************************/
  385. void associate_fixed_text_matrix(void)
  386. {
  387.     /*----------------------------------------------------------------*/
  388.     /* Local Variables                                                */
  389.     /*----------------------------------------------------------------*/
  390.     /*----------------------------------------------------------------*/
  391.     /* Code Body                                                      */
  392.     /*----------------------------------------------------------------*/
  393.     clear_fixed_matrix_highlight_handler();
  394.     gui_set_fixed_matrix_menu_item_functions(
  395.         &MMI_fixed_matrix_menu,
  396.         gui_show_fixed_text_menuitem,
  397.         gui_measure_fixed_text_menuitem,
  398.         gui_highlight_fixed_text_menuitem,
  399.         gui_remove_highlight_fixed_text_menuitem,
  400.         UI_fixed_menuitem_dummy_hide_function);
  401.     MMI_fixed_matrix_menu.displayed_columns = 0;
  402.     MMI_fixed_matrix_menu.displayed_rows = 0;
  403.     MMI_fixed_matrix_menu.first_displayed_column = 0;
  404.     MMI_fixed_matrix_menu.first_displayed_row = 0;
  405.     MMI_fixed_matrix_menu.highlighted_column = 0;
  406.     MMI_fixed_matrix_menu.highlighted_row = 0;
  407.     MMI_fixed_matrix_menu.highlighted_item = 0;
  408.     fixed_text_menu_n_items = &MMI_fixed_matrix_menu.n_items;
  409.     MMI_fixed_matrix_menu.items = MMI_fixed_menuitem_pointers;
  410.     MMI_fixed_matrix_menu.common_item_data = &MMI_fixed_text_menuitem;
  411. #ifdef __MMI_TOUCH_SCREEN__
  412.     MMI_fixed_matrix_menu.pen_event_current_selected_callback_function = NULL;
  413.     MMI_fixed_matrix_menu.pen_event_default_selected_callback_function = NULL;
  414. #endif /* __MMI_TOUCH_SCREEN__ */ 
  415.     MMI_fixed_text_menuitem.parent_list = NULL;
  416.     MMI_fixed_text_menuitem.parent_matrix = &MMI_fixed_matrix_menu;    
  417.     MMI_fixed_text_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_DISABLE_BACKGROUND;
  418.     (*fixed_text_menu_n_items) = 0;
  419.     resize_fixed_matrix_menuitems = resize_fixed_text_menuitems;
  420.     MMI_disable_title_shortcut_display = 1;
  421.     set_MMI_current_fixed_text_menuitem_theme_matrix();
  422.     gui_set_fixed_text_menuitem_current_theme(&MMI_fixed_text_menuitem);
  423. }
  424. /*****************************************************************************
  425.  * FUNCTION
  426.  *  add_fixed_text_item
  427.  * DESCRIPTION
  428.  *  Adds an item to the list of fixed text menuitems
  429.  *  
  430.  *  Adds the menuitem to the end of the list
  431.  * PARAMETERS
  432.  *  s       [IN]        Is the string that is displayed for this menuitem
  433.  * RETURNS
  434.  *  void
  435.  *****************************************************************************/
  436. void add_fixed_text_item(UI_string_type s)
  437. {
  438.     /*----------------------------------------------------------------*/
  439.     /* Local Variables                                                */
  440.     /*----------------------------------------------------------------*/
  441.     /*----------------------------------------------------------------*/
  442.     /* Code Body                                                      */
  443.     /*----------------------------------------------------------------*/
  444.     if ((*fixed_text_menu_n_items) >= MAX_FIXED_TEXT_MENU_ITEMS)
  445.     {
  446.         return;
  447.     }
  448.     MMI_fixed_text_menuitems[(*fixed_text_menu_n_items)].text = s;
  449.     (*fixed_text_menu_n_items)++;
  450. }
  451. /*****************************************************************************
  452.  * FUNCTION
  453.  *  add_location_fixed_text_item
  454.  * DESCRIPTION
  455.  *  Adds an item to the list of fixed text menuitems
  456.  *  
  457.  *  The item is added at the specified location
  458.  * PARAMETERS
  459.  *  index       [IN]        (zero based) is the location at which the new item is added
  460.  *  s           [IN]        Is the string that is displayed for this menuitem
  461.  * RETURNS
  462.  *  void
  463.  *****************************************************************************/
  464. void add_location_fixed_text_item(S32 index, UI_string_type s)
  465. {
  466.     /*----------------------------------------------------------------*/
  467.     /* Local Variables                                                */
  468.     /*----------------------------------------------------------------*/
  469.     S32 i;
  470.     /*----------------------------------------------------------------*/
  471.     /* Code Body                                                      */
  472.     /*----------------------------------------------------------------*/
  473.     if ((*fixed_text_menu_n_items) >= MAX_FIXED_TEXT_MENU_ITEMS)
  474.     {
  475.         return;
  476.     }
  477.     for (i = (*fixed_text_menu_n_items); i > index; i--)
  478.     {
  479.         MMI_fixed_text_menuitems[i] = MMI_fixed_text_menuitems[i - 1];
  480.     }
  481.     MMI_fixed_text_menuitems[index].text = s;
  482.     (*fixed_text_menu_n_items)++;
  483. }
  484. /*****************************************************************************
  485.  * FUNCTION
  486.  *  remove_fixed_text_item
  487.  * DESCRIPTION
  488.  *  Removes a specified item from the fixed list
  489.  * PARAMETERS
  490.  *  index       [IN]        (zero based) is the location of the item to be removed
  491.  * RETURNS
  492.  *  void
  493.  *****************************************************************************/
  494. void remove_fixed_text_item(S32 index)
  495. {
  496.     /*----------------------------------------------------------------*/
  497.     /* Local Variables                                                */
  498.     /*----------------------------------------------------------------*/
  499.     S32 i;
  500.     /*----------------------------------------------------------------*/
  501.     /* Code Body                                                      */
  502.     /*----------------------------------------------------------------*/
  503.     if ((*fixed_text_menu_n_items) <= 0)
  504.     {
  505.         return;
  506.     }
  507.     for (i = index; i < (*fixed_text_menu_n_items) - 1; i++)
  508.     {
  509.         MMI_fixed_text_menuitems[i] = MMI_fixed_text_menuitems[i + 1];
  510.     }
  511.     (*fixed_text_menu_n_items)--;
  512. }
  513. /*****************************************************************************
  514.  * FUNCTION
  515.  *  add_fixed_text_items
  516.  * DESCRIPTION
  517.  *  Adds an array of items to the list of fixed text menuitems
  518.  *  
  519.  *  Items are added in the same order as in the input arrays
  520.  * PARAMETERS
  521.  *  n_items     [IN]        Is the number of items to be added
  522.  *  s           [IN]        Is an array of strings, each string is displayed as
  523.  *  one(?)      [IN]        Menuitem
  524.  * RETURNS
  525.  *  void
  526.  *****************************************************************************/
  527. void add_fixed_text_items(S32 n_items, UI_string_type *s)
  528. {
  529.     /*----------------------------------------------------------------*/
  530.     /* Local Variables                                                */
  531.     /*----------------------------------------------------------------*/
  532.     S32 i;
  533.     /*----------------------------------------------------------------*/
  534.     /* Code Body                                                      */
  535.     /*----------------------------------------------------------------*/
  536.     if (n_items > MAX_FIXED_TEXT_MENU_ITEMS)
  537.     {
  538.         n_items = MAX_FIXED_TEXT_MENU_ITEMS;
  539.     }
  540.     for (i = 0; i < n_items; i++)
  541.     {
  542.         MMI_fixed_text_menuitems[i].text = s[i];
  543.     }
  544.     (*fixed_text_menu_n_items) = n_items;
  545. }
  546. /* Fixed icontext item wrappers        */
  547. fixed_icontext_menuitem MMI_fixed_icontext_menuitem;
  548. /* fixed_icontext_menuitem_type                 MMI_fixed_icontext_menuitems[MAX_FIXED_ICONTEXT_MENU_ITEMS]; */
  549. fixed_icontext_menuitem_type *MMI_fixed_icontext_menuitems = (fixed_icontext_menuitem_type *) & integratedMenus;
  550. S32 *fixed_icontext_menu_n_items;
  551. /* PMT VIKAS START 20050630 */
  552. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  553. /*****************************************************************************
  554.  * FUNCTION
  555.  *  disable_fixed_icontext_menuitem_transparent_effect
  556.  * DESCRIPTION
  557.  *  Disable the transparent effect flag for inline category screen
  558.  * PARAMETERS
  559.  *  void
  560.  * RETURNS
  561.  *  void
  562.  *****************************************************************************/
  563. void disable_fixed_icontext_menuitem_transparent_effect(void)
  564. {
  565.     /*----------------------------------------------------------------*/
  566.     /* Local Variables                                                */
  567.     /*----------------------------------------------------------------*/
  568.     /*----------------------------------------------------------------*/
  569.     /* Code Body                                                      */
  570.     /*----------------------------------------------------------------*/
  571.     gui_fixed_icontext_disable_transparent_effect(&MMI_fixed_icontext_menuitem);
  572.     gui_block_transparency_effect();
  573. }
  574. /*****************************************************************************
  575.  * FUNCTION
  576.  *  enable_fixed_icontext_menuitem_transparent_effect
  577.  * DESCRIPTION
  578.  *  Enable the transparent effect flag.
  579.  * PARAMETERS
  580.  *  void
  581.  * RETURNS
  582.  *  void
  583.  *****************************************************************************/
  584. void enable_fixed_icontext_menuitem_transparent_effect(void)
  585. {
  586.     /*----------------------------------------------------------------*/
  587.     /* Local Variables                                                */
  588.     /*----------------------------------------------------------------*/
  589.     /*----------------------------------------------------------------*/
  590.     /* Code Body                                                      */
  591.     /*----------------------------------------------------------------*/
  592.     gui_unblock_transparency_effect();
  593.     gui_fixed_icontext_enable_transparent_effect(&MMI_fixed_icontext_menuitem);
  594. }
  595. #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
  596. /* PMT VIKAS END 20050630 */
  597. /*****************************************************************************
  598.  * FUNCTION
  599.  *  fixed_icontext_menuitem_apply_current_theme
  600.  * DESCRIPTION
  601.  *  Applies the current theme to the fixed icontext menuitems
  602.  * PARAMETERS
  603.  *  void
  604.  * RETURNS
  605.  *  void
  606.  *****************************************************************************/
  607. void fixed_icontext_menuitem_apply_current_theme(void)
  608. {
  609.     /*----------------------------------------------------------------*/
  610.     /* Local Variables                                                */
  611.     /*----------------------------------------------------------------*/
  612.     /*----------------------------------------------------------------*/
  613.     /* Code Body                                                      */
  614.     /*----------------------------------------------------------------*/
  615.     gui_set_fixed_icontext_menuitem_current_theme(&MMI_fixed_icontext_menuitem);
  616. }
  617. /*****************************************************************************
  618.  * FUNCTION
  619.  *  fixed_icontext_menuitem_apply_theme
  620.  * DESCRIPTION
  621.  *  Applies the given theme to the fixed icontext menuitems
  622.  * PARAMETERS
  623.  *  t       [?]     
  624.  * RETURNS
  625.  *  void
  626.  *****************************************************************************/
  627. void fixed_icontext_menuitem_apply_theme(UI_fixed_icontext_menuitem_theme *t)
  628. {
  629.     /*----------------------------------------------------------------*/
  630.     /* Local Variables                                                */
  631.     /*----------------------------------------------------------------*/
  632.     /*----------------------------------------------------------------*/
  633.     /* Code Body                                                      */
  634.     /*----------------------------------------------------------------*/
  635.     gui_set_fixed_icontext_menuitem_theme(&MMI_fixed_icontext_menuitem, t);
  636. }
  637. /*****************************************************************************
  638.  * FUNCTION
  639.  *  create_fixed_icontext_menuitems
  640.  * DESCRIPTION
  641.  *  Creates a list of icontext menuitems
  642.  * PARAMETERS
  643.  *  void
  644.  * RETURNS
  645.  *  void
  646.  *****************************************************************************/
  647. void create_fixed_icontext_menuitems(void)
  648. {
  649.     /*----------------------------------------------------------------*/
  650.     /* Local Variables                                                */
  651.     /*----------------------------------------------------------------*/
  652.     S32 i;
  653.     /*----------------------------------------------------------------*/
  654.     /* Code Body                                                      */
  655.     /*----------------------------------------------------------------*/
  656.     gui_create_fixed_icontext_menuitem(&MMI_fixed_icontext_menuitem, 108, 18);
  657.     gui_fixed_icontext_menuitem_set_text_position(&MMI_fixed_icontext_menuitem, 24, 0);
  658.     MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  659.     MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
  660. MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  661.     /* PMT NEERAJ START 20050825 */
  662. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  663.     gui_set_current_two_line_menuitem_data = set_current_two_line_menuitem_data;
  664.     MMI_fixed_icontext_menuitem.ext_flags &= ~UI_MENUITEM_EXT_SHOW_TWO_LINE_SELECT;
  665. #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */ 
  666.     /* PMT NEERAJ END 20050825 */
  667.     for (i = 0; i < MAX_FIXED_ICONTEXT_MENU_ITEMS && i < MAX_FIXED_MENU_ITEM_POINTERS; i++)
  668.     {
  669.         MMI_fixed_icontext_menuitems[i].flags = 0;
  670.         /* PMT  MANISH  START  20050722 */
  671.     #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  672.         MMI_fixed_icontext_menuitems[i].ext_flags = 0;
  673.     #endif 
  674.         /* PMT  MANISH  END  20050722 */
  675.         MMI_fixed_menuitem_pointers[i] = (void*)&MMI_fixed_icontext_menuitems[i];
  676.         MMI_fixed_icontext_menuitems[i].item_icon_handle = GDI_ERROR_HANDLE;
  677.     }
  678. }
  679. /*****************************************************************************
  680.  * FUNCTION
  681.  *  stop_fixed_icontext_menuitem_animation
  682.  * DESCRIPTION
  683.  *  Creates a list of icontext menuitems
  684.  * PARAMETERS
  685.  *  index       [IN]        
  686.  * RETURNS
  687.  *  void
  688.  *****************************************************************************/
  689. void stop_fixed_icontext_menuitem_animation(S32 index)
  690. {
  691.     /*----------------------------------------------------------------*/
  692.     /* Local Variables                                                */
  693.     /*----------------------------------------------------------------*/
  694.     /*----------------------------------------------------------------*/
  695.     /* Code Body                                                      */
  696.     /*----------------------------------------------------------------*/
  697.     if (MMI_fixed_icontext_menuitems[index].item_icon_handle != GDI_ERROR_HANDLE)
  698.     {
  699.         gdi_image_stop_animation(MMI_fixed_icontext_menuitems[index].item_icon_handle);
  700.     }
  701. }
  702. /*****************************************************************************
  703.  * FUNCTION
  704.  *  resize_fixed_icontext_menuitems
  705.  * DESCRIPTION
  706.  *  Resizes all fixed icontext menuitems
  707.  * PARAMETERS
  708.  *  width       [IN]        Are the new dimensions
  709.  *  height      [IN]        Are the new dimensions
  710.  * RETURNS
  711.  *  void
  712.  *****************************************************************************/
  713. void resize_fixed_icontext_menuitems(S32 width, S32 height)
  714. {
  715.     /*----------------------------------------------------------------*/
  716.     /* Local Variables                                                */
  717.     /*----------------------------------------------------------------*/
  718.     /*----------------------------------------------------------------*/
  719.     /* Code Body                                                      */
  720.     /*----------------------------------------------------------------*/
  721.     if (width == 0)
  722.     {
  723.         width = MMI_fixed_icontext_menuitem.width;
  724.     }
  725.     if (height == 0)
  726.     {
  727.         height = MMI_fixed_icontext_menuitem.height;
  728.     }
  729.     gui_resize_fixed_icontext_menuitem(&MMI_fixed_icontext_menuitem, width, height);
  730. }
  731. /*****************************************************************************
  732.  * FUNCTION
  733.  *  associate_fixed_icontext_list
  734.  * DESCRIPTION
  735.  *  Associates the list of fixed icontext menuitems with the fixed list
  736.  * PARAMETERS
  737.  *  void
  738.  *  width(?)        [IN]        Height are the new dimensions
  739.  * RETURNS
  740.  *  void
  741.  *****************************************************************************/
  742. void associate_fixed_icontext_list(void)
  743. {
  744.     /*----------------------------------------------------------------*/
  745.     /* Local Variables                                                */
  746.     /*----------------------------------------------------------------*/
  747.     /*----------------------------------------------------------------*/
  748.     /* Code Body                                                      */
  749.     /*----------------------------------------------------------------*/
  750.     clear_fixed_list_highlight_handler();
  751.     gui_set_fixed_list_menu_item_functions(
  752.         &MMI_fixed_list_menu,
  753.         gui_show_fixed_icontext_menuitem,
  754.         gui_measure_fixed_icontext_menuitem,
  755.         gui_highlight_fixed_icontext_menuitem,
  756.         gui_remove_highlight_fixed_icontext_menuitem,
  757.         gui_hide_fixed_icontext_menuitem,
  758.         resize_fixed_icontext_menuitems);
  759. #ifdef __MMI_TOUCH_SCREEN__
  760.     gui_set_fixed_list_menu_item_pen_function(
  761.         &MMI_fixed_list_menu,
  762.         gui_fixed_icontext_menuitem_translate_pen_event,
  763.         MMI_FALSE,
  764.         MMI_FALSE);
  765. #endif /* __MMI_TOUCH_SCREEN__ */ 
  766. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  767.     set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
  768. #endif 
  769.     MMI_fixed_list_menu.first_displayed_item = 0;
  770.     MMI_fixed_list_menu.highlighted_item = 0;
  771.     fixed_icontext_menu_n_items = &MMI_fixed_list_menu.n_items;
  772.     MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
  773.     MMI_fixed_icontext_menuitem.parent_list = &MMI_fixed_list_menu;
  774.     MMI_fixed_icontext_menuitem.parent_matrix = NULL;
  775.     MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_DISABLE_HIGHLIGHT;
  776.     /* PMT NEERAJ START 20050712 */
  777. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  778.     MMI_fixed_icontext_menuitem.ext_flags &= ~UI_MENUITEM_SHOW_ALL_HINTS;
  779.     MMI_fixed_icontext_menuitem.ext_flags &= ~UI_MENUITEM_SHOW_HIGHLIGHTED_HINT;
  780.     MMI_fixed_icontext_menuitem.ext_flags &= ~UI_MENUITEM_SHOW_ICON_ONLY_ON_HIGHLIGHT;
  781. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  782.     /* PMT NEERAJ END 20050712 */
  783.     MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  784. #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
  785.     MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
  786. #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
  787.     MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
  788. #endif 
  789.     MMI_fixed_list_menu.common_item_data = (void*)&MMI_fixed_icontext_menuitem;
  790. #ifdef __MMI_TOUCH_SCREEN__
  791.     MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
  792.     MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
  793. #endif /* __MMI_TOUCH_SCREEN__ */ 
  794.     (*fixed_icontext_menu_n_items) = 0;
  795.     //      resize_fixed_icontext_menuitems(MMI_fixed_list_menu.width-MMI_fixed_list_menu.vbar.width-3,MMI_MENUITEM_HEIGHT);
  796.     //MTK Leo add, leave 1 pixel between hilightbar and scrollbar
  797.     resize_fixed_icontext_menuitems(
  798.         MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1,
  799.         get_menu_item_height());
  800.     MMI_disable_title_shortcut_display = 0;
  801.     set_MMI_current_fixed_icontext_menuitem_theme_list();
  802.     gui_set_fixed_icontext_menuitem_current_theme(&MMI_fixed_icontext_menuitem);
  803.     wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_menuitem_stop_scroll;
  804.     wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_menuitem_start_scroll;
  805. }
  806. /*****************************************************************************
  807.  * FUNCTION
  808.  *  associate_fixed_icontext_matrix
  809.  * DESCRIPTION
  810.  *  Associates the list of fixed icontext menuitems with the fixed matrix
  811.  * PARAMETERS
  812.  *  void
  813.  *  width(?)        [IN]        Height are the new dimensions
  814.  * RETURNS
  815.  *  void
  816.  *****************************************************************************/
  817. void associate_fixed_icontext_matrix(void)
  818. {
  819.     /*----------------------------------------------------------------*/
  820.     /* Local Variables                                                */
  821.     /*----------------------------------------------------------------*/
  822.     /*----------------------------------------------------------------*/
  823.     /* Code Body                                                      */
  824.     /*----------------------------------------------------------------*/
  825.     clear_fixed_matrix_highlight_handler();
  826.     gui_set_fixed_matrix_menu_item_functions(
  827.         &MMI_fixed_matrix_menu,
  828.         gui_show_fixed_icontext_menuitem,
  829.         gui_measure_fixed_icontext_menuitem,
  830.         gui_highlight_fixed_icontext_menuitem,
  831.         gui_remove_highlight_fixed_icontext_menuitem,
  832.         gui_hide_fixed_icontext_menuitem);
  833.     MMI_fixed_matrix_menu.displayed_columns = 0;
  834.     MMI_fixed_matrix_menu.displayed_rows = 0;
  835.     MMI_fixed_matrix_menu.first_displayed_column = 0;
  836.     MMI_fixed_matrix_menu.first_displayed_row = 0;
  837.     MMI_fixed_matrix_menu.highlighted_column = 0;
  838.     MMI_fixed_matrix_menu.highlighted_row = 0;
  839.     MMI_fixed_matrix_menu.highlighted_item = 0;
  840.     MMI_fixed_matrix_menu.last_hilited_x = -1;
  841.     MMI_fixed_matrix_menu.last_hilited_y = -1;
  842.     MMI_fixed_matrix_menu.last_highlighted_item = -1;
  843. #ifdef __MMI_TOUCH_SCREEN__
  844.     MMI_fixed_matrix_menu.pen_event_current_selected_callback_function = NULL;
  845.     MMI_fixed_matrix_menu.pen_event_default_selected_callback_function = NULL;
  846. #endif /* __MMI_TOUCH_SCREEN__ */ 
  847.     fixed_icontext_menu_n_items = &MMI_fixed_matrix_menu.n_items;
  848.     MMI_fixed_matrix_menu.items = MMI_fixed_menuitem_pointers;
  849.     MMI_fixed_icontext_menuitem.parent_list = NULL;
  850.     MMI_fixed_icontext_menuitem.parent_matrix = &MMI_fixed_matrix_menu;        
  851.     MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  852.     MMI_fixed_matrix_menu.common_item_data = &MMI_fixed_icontext_menuitem;
  853.     (*fixed_icontext_menu_n_items) = 0;
  854.     resize_fixed_matrix_menuitems = resize_fixed_icontext_menuitems;
  855.     MMI_disable_title_shortcut_display = 1;
  856.     set_MMI_current_fixed_icontext_menuitem_theme_matrix();
  857.     gui_set_fixed_icontext_menuitem_current_theme(&MMI_fixed_icontext_menuitem);
  858.     /* MTK Leo add 20050225, for new list_matrix menu style */
  859. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  860.     wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_menuitem_stop_scroll;
  861.     wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_menuitem_start_scroll;
  862. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  863.     /* MTK Leo add 20050225 end */
  864. }
  865. /*****************************************************************************
  866.  * FUNCTION
  867.  *  center_fixed_icontext_positions
  868.  * DESCRIPTION
  869.  *  Sets center justification of text and icons within the fixed icontext menuitems
  870.  * PARAMETERS
  871.  *  tx      [IN]        Center text horizontally   |  These flags can have the values
  872.  *  ty      [IN]        Center text vertically     |  0 or 1. If a flag is 1, then the
  873.  *  ix      [IN]        Center icon horizontally   |  action specified with the flag will
  874.  *  iy      [IN]        Center icon vertically     |  be performed.
  875.  * RETURNS
  876.  *  void
  877.  *****************************************************************************/
  878. void center_fixed_icontext_positions(U8 tx, U8 ty, U8 ix, U8 iy)
  879. {
  880.     /*----------------------------------------------------------------*/
  881.     /* Local Variables                                                */
  882.     /*----------------------------------------------------------------*/
  883.     /*----------------------------------------------------------------*/
  884.     /* Code Body                                                      */
  885.     /*----------------------------------------------------------------*/
  886.     MMI_fixed_icontext_menuitem.flags &=
  887.         ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_CENTER_TEXT_Y | UI_MENUITEM_CENTER_ICON_X |
  888.           UI_MENUITEM_CENTER_ICON_Y);
  889.     if (tx)
  890.     {
  891.         MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X;
  892.     }
  893.     if (ty)
  894.     {
  895.         MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  896.     }
  897.     if (ix)
  898.     {
  899.         MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_X;
  900.     }
  901.     if (iy)
  902.     {
  903.         MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
  904.     }
  905. }
  906. /*****************************************************************************
  907.  * FUNCTION
  908.  *  set_fixed_icontext_positions
  909.  * DESCRIPTION
  910.  *  Sets the positions of text and icons within the fixed icontext menuitems
  911.  * PARAMETERS
  912.  *  tx      [IN]        X position of text   |  If this value is 0, the text will be centered horizontally
  913.  *  ty      [IN]        Y position of text   |  If this value is 0, the text will be centered vertically
  914.  *  ix      [IN]        X position of icon   |  If this value is 0, the icon will be centered horizontally
  915.  *  iy      [IN]        Y position of icon   |  If this value is 0, the icon will be centered vertically
  916.  * RETURNS
  917.  *  void
  918.  *****************************************************************************/
  919. void set_fixed_icontext_positions(S32 tx, S32 ty, S32 ix, S32 iy)
  920. {
  921.     /*----------------------------------------------------------------*/
  922.     /* Local Variables                                                */
  923.     /*----------------------------------------------------------------*/
  924.     /*----------------------------------------------------------------*/
  925.     /* Code Body                                                      */
  926.     /*----------------------------------------------------------------*/
  927.     MMI_fixed_icontext_menuitem.flags &=
  928.         ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_CENTER_TEXT_Y | UI_MENUITEM_CENTER_ICON_X |
  929.           UI_MENUITEM_CENTER_ICON_Y);
  930.     if (tx)
  931.     {
  932.         MMI_fixed_icontext_menuitem.text_x = tx;
  933.         gui_resize_fixed_icontext_menuitem(
  934.             &MMI_fixed_icontext_menuitem,
  935.             MMI_fixed_icontext_menuitem.width,
  936.             MMI_fixed_icontext_menuitem.height);
  937.     }
  938.     else
  939.     {
  940.         MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X;
  941.     }
  942.     if (ty)
  943.     {
  944.         MMI_fixed_icontext_menuitem.text_y = ty;
  945.     }
  946.     else
  947.     {
  948.         MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  949.     }
  950.     if (ix)
  951.     {
  952.         MMI_fixed_icontext_menuitem.icon_x = ix;
  953.     }
  954.     else
  955.     {
  956.         MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_X;
  957.     }
  958.     if (iy)
  959.     {
  960.         MMI_fixed_icontext_menuitem.icon_y = iy;
  961.     }
  962.     else
  963.     {
  964.         MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
  965.     }
  966. }
  967. /*****************************************************************************
  968.  * FUNCTION
  969.  *  add_fixed_icontext_item
  970.  * DESCRIPTION
  971.  *  Adds a new item to the list of fixed icontext menuitems
  972.  *  
  973.  *  Adds the item to the end of the list
  974.  * PARAMETERS
  975.  *  s       [IN]        Is the string for the item
  976.  *  img     [IN]        Is the icon for the item
  977.  * RETURNS
  978.  *  void
  979.  *****************************************************************************/
  980. void add_fixed_icontext_item(UI_string_type s, PU8 img)
  981. {
  982.     /*----------------------------------------------------------------*/
  983.     /* Local Variables                                                */
  984.     /*----------------------------------------------------------------*/
  985.     /*----------------------------------------------------------------*/
  986.     /* Code Body                                                      */
  987.     /*----------------------------------------------------------------*/
  988.     if ((*fixed_icontext_menu_n_items) >= MAX_FIXED_ICONTEXT_MENU_ITEMS)
  989.     {
  990.         return;
  991.     }
  992.     MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items)].item_text = s;
  993.     MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items)].item_icon = img;
  994.     MMI_fixed_icontext_menuitems[(*fixed_icontext_menu_n_items)].item_icon_handle = GDI_ERROR_HANDLE;
  995.     (*fixed_icontext_menu_n_items)++;
  996. }
  997. /*****************************************************************************
  998.  * FUNCTION
  999.  *  change_fixed_icontext_item
  1000.  * DESCRIPTION
  1001.  *  
  1002.  * PARAMETERS
  1003.  *  index       [IN]        
  1004.  *  s           [IN]        
  1005.  *  img         [IN]        
  1006.  * RETURNS
  1007.  *  void
  1008.  *****************************************************************************/
  1009. void change_fixed_icontext_item(S32 index, UI_string_type s, PU8 img)
  1010. {
  1011.     /*----------------------------------------------------------------*/
  1012.     /* Local Variables                                                */
  1013.     /*----------------------------------------------------------------*/
  1014.     /*----------------------------------------------------------------*/
  1015.     /* Code Body                                                      */
  1016.     /*----------------------------------------------------------------*/
  1017.     MMI_fixed_icontext_menuitems[index].item_text = s;
  1018.     MMI_fixed_icontext_menuitems[index].item_icon = img;
  1019. }
  1020. /*****************************************************************************
  1021.  * FUNCTION
  1022.  *  add_location_fixed_icontext_item
  1023.  * DESCRIPTION
  1024.  *  Adds a new item to the list of fixed icontext menuitems
  1025.  *  
  1026.  *  Adds the item at the specified location
  1027.  * PARAMETERS
  1028.  *  index       [IN]        (zero based) is the location at which the item is added
  1029.  *  s           [IN]        Is the string for the item
  1030.  *  img         [IN]        Is the icon for the item
  1031.  * RETURNS
  1032.  *  void
  1033.  *****************************************************************************/
  1034. void add_location_fixed_icontext_item(S32 index, UI_string_type s, PU8 img)
  1035. {
  1036.     /*----------------------------------------------------------------*/
  1037.     /* Local Variables                                                */
  1038.     /*----------------------------------------------------------------*/
  1039.     S32 i;
  1040.     /*----------------------------------------------------------------*/
  1041.     /* Code Body                                                      */
  1042.     /*----------------------------------------------------------------*/
  1043.     if ((*fixed_icontext_menu_n_items) >= MAX_FIXED_ICONTEXT_MENU_ITEMS)
  1044.     {
  1045.         return;
  1046.     }
  1047.     for (i = (*fixed_icontext_menu_n_items); i > index; i--)
  1048.     {
  1049.         MMI_fixed_icontext_menuitems[i] = MMI_fixed_icontext_menuitems[i - 1];
  1050.     }
  1051.     MMI_fixed_icontext_menuitems[index].item_text = s;
  1052.     MMI_fixed_icontext_menuitems[index].item_icon = img;
  1053.     (*fixed_icontext_menu_n_items)++;
  1054. }
  1055. /*****************************************************************************
  1056.  * FUNCTION
  1057.  *  remove_fixed_icontext_item
  1058.  * DESCRIPTION
  1059.  *  Removes a specified item
  1060.  * PARAMETERS
  1061.  *  index       [IN]        (zero based) is the location of the item to be removed
  1062.  * RETURNS
  1063.  *  void
  1064.  *****************************************************************************/
  1065. void remove_fixed_icontext_item(S32 index)
  1066. {
  1067.     /*----------------------------------------------------------------*/
  1068.     /* Local Variables                                                */
  1069.     /*----------------------------------------------------------------*/
  1070.     S32 i;
  1071.     /*----------------------------------------------------------------*/
  1072.     /* Code Body                                                      */
  1073.     /*----------------------------------------------------------------*/
  1074.     if ((*fixed_icontext_menu_n_items) <= 0)
  1075.     {
  1076.         return;
  1077.     }
  1078.     for (i = index; i < (*fixed_icontext_menu_n_items) - 1; i++)
  1079.     {
  1080.         MMI_fixed_icontext_menuitems[i] = MMI_fixed_icontext_menuitems[i + 1];
  1081.     }
  1082.     (*fixed_icontext_menu_n_items)--;
  1083. }
  1084. /*****************************************************************************
  1085.  * FUNCTION
  1086.  *  add_fixed_icontext_items
  1087.  * DESCRIPTION
  1088.  *  Adds an array of items
  1089.  *  
  1090.  *  Adds items to the list in the same order as they were specified in the input arrays
  1091.  * PARAMETERS
  1092.  *  n_items     [IN]        Is the number of items to be added
  1093.  *  s           [IN]        Is an array of strings, each string is taken as one item
  1094.  *  img         [OUT]       Is an array of images, each image is associated with one item
  1095.  * RETURNS
  1096.  *  void
  1097.  *****************************************************************************/
  1098. void add_fixed_icontext_items(S32 n_items, UI_string_type *s, PU8 *img)
  1099. {
  1100.     /*----------------------------------------------------------------*/
  1101.     /* Local Variables                                                */
  1102.     /*----------------------------------------------------------------*/
  1103.     S32 i;
  1104.     /*----------------------------------------------------------------*/
  1105.     /* Code Body                                                      */
  1106.     /*----------------------------------------------------------------*/
  1107.     if (n_items > MAX_FIXED_ICONTEXT_MENU_ITEMS)
  1108.     {
  1109.         n_items = MAX_FIXED_ICONTEXT_MENU_ITEMS;
  1110.     }
  1111.     for (i = 0; i < n_items; i++)
  1112.     {
  1113.         MMI_fixed_icontext_menuitems[i].item_text = s[i];
  1114.     #ifdef __MMI_SLIM_LISTMENU__
  1115.         MMI_fixed_icontext_menuitems[i].item_icon = (PU8) GetImage(IMG_GLOBAL_L1 + i);
  1116.     #else 
  1117.         MMI_fixed_icontext_menuitems[i].item_icon = img[i];
  1118.     #endif 
  1119.     }
  1120.     (*fixed_icontext_menu_n_items) = n_items;
  1121. }
  1122. /* fixed icontext list wrappers        */
  1123. fixed_icontext_list_menuitem MMI_fixed_icontext_list_menuitem;
  1124. /* fixed_icontext_list_menuitem_type                    MMI_fixed_icontext_list_menuitems[MAX_FIXED_ICONTEXT_LIST_MENU_ITEMS]; */
  1125. fixed_icontext_list_menuitem_type *MMI_fixed_icontext_list_menuitems =
  1126.     (fixed_icontext_list_menuitem_type *) & integratedMenus;
  1127. S32 *fixed_icontext_list_menu_n_items;
  1128. /* MTK Leo add 20050225, for new list_matrix menu style */
  1129. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1130. fixed_icontext_list_menuitem_type _MMI_fixed_icontext_list_menuitems[MAX_MAIN_MENU_ITEMS];
  1131. /* fixed_icontext_list_menuitem_type*                           MMI_fixed_icontext_list_menuitems2= _MMI_fixed_icontext_list_menuitems; */
  1132. /*****************************************************************************
  1133.  * FUNCTION
  1134.  *  set_fixed_icontext_list_type2
  1135.  * DESCRIPTION
  1136.  *  
  1137.  * PARAMETERS
  1138.  *  void
  1139.  * RETURNS
  1140.  *  void
  1141.  *****************************************************************************/
  1142. void set_fixed_icontext_list_type2(void)
  1143. {
  1144.     /*----------------------------------------------------------------*/
  1145.     /* Local Variables                                                */
  1146.     /*----------------------------------------------------------------*/
  1147.     /*----------------------------------------------------------------*/
  1148.     /* Code Body                                                      */
  1149.     /*----------------------------------------------------------------*/
  1150.     MMI_fixed_icontext_list_menuitems = _MMI_fixed_icontext_list_menuitems;
  1151. }
  1152. /*****************************************************************************
  1153.  * FUNCTION
  1154.  *  restore_fixed_icontext_list_type
  1155.  * DESCRIPTION
  1156.  *  
  1157.  * PARAMETERS
  1158.  *  void
  1159.  * RETURNS
  1160.  *  void
  1161.  *****************************************************************************/
  1162. void restore_fixed_icontext_list_type(void)
  1163. {
  1164.     /*----------------------------------------------------------------*/
  1165.     /* Local Variables                                                */
  1166.     /*----------------------------------------------------------------*/
  1167.     /*----------------------------------------------------------------*/
  1168.     /* Code Body                                                      */
  1169.     /*----------------------------------------------------------------*/
  1170.     MMI_fixed_icontext_list_menuitems = (fixed_icontext_list_menuitem_type*) & integratedMenus;
  1171. }
  1172. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  1173. /* MTK Leo add 20050225 end */
  1174. /*****************************************************************************
  1175.  * FUNCTION
  1176.  *  fixed_icontext_list_menuitem_total
  1177.  * DESCRIPTION
  1178.  *  to get total number of icontext list menuitem
  1179.  * PARAMETERS
  1180.  *  void
  1181.  * RETURNS
  1182.  *  number of icontext list menuitem
  1183.  *****************************************************************************/
  1184. S32 fixed_icontext_list_menuitem_total(void)
  1185. {
  1186.     /*----------------------------------------------------------------*/
  1187.     /* Local Variables                                                */
  1188.     /*----------------------------------------------------------------*/
  1189.     /*----------------------------------------------------------------*/
  1190.     /* Code Body                                                      */
  1191.     /*----------------------------------------------------------------*/
  1192.     return (*fixed_icontext_list_menu_n_items);
  1193. }
  1194. /*****************************************************************************
  1195.  * FUNCTION
  1196.  *  fixed_icontext_list_menuitem_apply_current_theme
  1197.  * DESCRIPTION
  1198.  *  Applies the current theme to the fixed icontext list menuitems
  1199.  * PARAMETERS
  1200.  *  void
  1201.  * RETURNS
  1202.  *  void
  1203.  *****************************************************************************/
  1204. void fixed_icontext_list_menuitem_apply_current_theme(void)
  1205. {
  1206.     /*----------------------------------------------------------------*/
  1207.     /* Local Variables                                                */
  1208.     /*----------------------------------------------------------------*/
  1209.     /*----------------------------------------------------------------*/
  1210.     /* Code Body                                                      */
  1211.     /*----------------------------------------------------------------*/
  1212.     gui_set_fixed_icontext_list_menuitem_current_theme(&MMI_fixed_icontext_list_menuitem);
  1213. }
  1214. /*****************************************************************************
  1215.  * FUNCTION
  1216.  *  fixed_icontext_list_menuitem_apply_theme
  1217.  * DESCRIPTION
  1218.  *  Applies the given theme to the fixed icontext list menuitems
  1219.  * PARAMETERS
  1220.  *  t       [?]     
  1221.  * RETURNS
  1222.  *  void
  1223.  *****************************************************************************/
  1224. void fixed_icontext_list_menuitem_apply_theme(UI_fixed_icontext_list_menuitem_theme *t)
  1225. {
  1226.     /*----------------------------------------------------------------*/
  1227.     /* Local Variables                                                */
  1228.     /*----------------------------------------------------------------*/
  1229.     /*----------------------------------------------------------------*/
  1230.     /* Code Body                                                      */
  1231.     /*----------------------------------------------------------------*/
  1232.     gui_set_fixed_icontext_list_menuitem_theme(&MMI_fixed_icontext_list_menuitem, t);
  1233. }
  1234. /*****************************************************************************
  1235.  * FUNCTION
  1236.  *  create_fixed_icontext_list_menuitems
  1237.  * DESCRIPTION
  1238.  *  Creates a list of fixed icontext list menuitems
  1239.  * PARAMETERS
  1240.  *  n_text_columns      [IN]        Is the number of text columns in each item
  1241.  *  n_icon_columns      [IN]        Is the number of icon columns in each item
  1242.  * RETURNS
  1243.  *  void
  1244.  *****************************************************************************/
  1245. void create_fixed_icontext_list_menuitems(S32 n_text_columns, S32 n_icon_columns)
  1246. {
  1247.     /*----------------------------------------------------------------*/
  1248.     /* Local Variables                                                */
  1249.     /*----------------------------------------------------------------*/
  1250.     S32 i;
  1251.     /*----------------------------------------------------------------*/
  1252.     /* Code Body                                                      */
  1253.     /*----------------------------------------------------------------*/
  1254.     gui_create_fixed_icontext_list_menuitem(&MMI_fixed_icontext_list_menuitem, 108, 18, n_text_columns, n_icon_columns);
  1255.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  1256.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
  1257.     for (i = 0; i < MAX_FIXED_ICONTEXT_LIST_MENU_ITEMS && i < MAX_FIXED_MENU_ITEM_POINTERS; i++)
  1258.     {
  1259.         S32 j = 0;
  1260.         MMI_fixed_icontext_list_menuitems[i].flags = 0;
  1261.         MMI_fixed_menuitem_pointers[i] = (void*)&MMI_fixed_icontext_list_menuitems[i];
  1262.         for (j = 0; j < FIXED_ICONTEXT_LIST_MAX_ICON_COLUMNS; j++)
  1263.         {
  1264.             MMI_fixed_icontext_list_menuitems[i].item_icon_handles[j] = GDI_ERROR_HANDLE;
  1265.         }
  1266.     }
  1267. }
  1268. /* MTK Leo add 20050225, for new list_matrix menu style */
  1269. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1270. /*****************************************************************************
  1271.  * FUNCTION
  1272.  *  create_fixed_icontext_list_menuitems2
  1273.  * DESCRIPTION
  1274.  *  
  1275.  * PARAMETERS
  1276.  *  n_text_columns      [IN]        
  1277.  *  n_icon_columns      [IN]        
  1278.  * RETURNS
  1279.  *  void
  1280.  *****************************************************************************/
  1281. void create_fixed_icontext_list_menuitems2(S32 n_text_columns, S32 n_icon_columns)
  1282. {
  1283.     /*----------------------------------------------------------------*/
  1284.     /* Local Variables                                                */
  1285.     /*----------------------------------------------------------------*/
  1286.     S32 i;
  1287.     /*----------------------------------------------------------------*/
  1288.     /* Code Body                                                      */
  1289.     /*----------------------------------------------------------------*/
  1290.     gui_create_fixed_icontext_list_menuitem(&MMI_fixed_icontext_list_menuitem, 108, 18, n_text_columns, n_icon_columns);
  1291.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  1292.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
  1293.     for (i = 0; i < MAX_MAIN_MENU_ITEMS; i++)
  1294.     {
  1295.         MMI_fixed_icontext_list_menuitems[i].flags = 0;
  1296.         MMI_fixed_menuitem_pointers2[i] = (void*)&MMI_fixed_icontext_list_menuitems[i];
  1297.     }
  1298. }
  1299. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  1300. /* MTK Leo end 20050225 */
  1301. /*****************************************************************************
  1302.  * FUNCTION
  1303.  *  set_fixed_icontext_list_menuitems_post_display
  1304.  * DESCRIPTION
  1305.  *  Register callback handler after an icontext-list menu item is displayed
  1306.  *  
  1307.  *  Icontext-list menu item is a general form of menu item that has more than one text & icon item
  1308.  *  It can be further extended by registering post-display function.
  1309.  * PARAMETERS
  1310.  *  post_display_function       [IN]        Callback function
  1311.  * RETURNS
  1312.  *  void
  1313.  *****************************************************************************/
  1314. void
  1315. set_fixed_icontext_list_menuitems_post_display(
  1316.     void (*post_display_function) (void *item, void *common_item_data, S32 x, S32 y))
  1317. {
  1318.     /*----------------------------------------------------------------*/
  1319.     /* Local Variables                                                */
  1320.     /*----------------------------------------------------------------*/
  1321.     /*----------------------------------------------------------------*/
  1322.     /* Code Body                                                      */
  1323.     /*----------------------------------------------------------------*/
  1324.     gui_fixed_icontext_list_menuitem_set_post_display(&MMI_fixed_icontext_list_menuitem, post_display_function);
  1325. }
  1326. /*****************************************************************************
  1327.  * FUNCTION
  1328.  *  resize_fixed_icontext_list_menuitems
  1329.  * DESCRIPTION
  1330.  *  Resizes all the fixed icontext list menuitems
  1331.  * PARAMETERS
  1332.  *  width       [IN]        Are the new dimensions
  1333.  *  height      [IN]        Are the new dimensions
  1334.  * RETURNS
  1335.  *  void
  1336.  *****************************************************************************/
  1337. void resize_fixed_icontext_list_menuitems(S32 width, S32 height)
  1338. {
  1339.     /*----------------------------------------------------------------*/
  1340.     /* Local Variables                                                */
  1341.     /*----------------------------------------------------------------*/
  1342.     /*----------------------------------------------------------------*/
  1343.     /* Code Body                                                      */
  1344.     /*----------------------------------------------------------------*/
  1345.     if (width == 0)
  1346.     {
  1347.         width = MMI_fixed_icontext_list_menuitem.width;
  1348.     }
  1349.     if (height == 0)
  1350.     {
  1351.         height = MMI_fixed_icontext_list_menuitem.height;
  1352.     }
  1353.     gui_resize_fixed_icontext_list_menuitem(&MMI_fixed_icontext_list_menuitem, width, height);
  1354. }
  1355. /*****************************************************************************
  1356.  * FUNCTION
  1357.  *  set_fixed_icontext_list_text_coordinates
  1358.  * DESCRIPTION
  1359.  *  Sets the co-ordinates of a given text column
  1360.  * PARAMETERS
  1361.  *  c           [IN]        Is the index of the text column (zero based)
  1362.  *  x           [IN]        Position of the text column within the item
  1363.  *  y           [IN]        Position of the text column within the item
  1364.  *  width       [IN]        Are the dimensions of the text column
  1365.  *  height      [IN]        Are the dimensions of the text column
  1366.  * RETURNS
  1367.  *  void
  1368.  *****************************************************************************/
  1369. void set_fixed_icontext_list_text_coordinates(S32 c, S32 x, S32 y, S32 width, S32 height)
  1370. {
  1371.     /*----------------------------------------------------------------*/
  1372.     /* Local Variables                                                */
  1373.     /*----------------------------------------------------------------*/
  1374.     /*----------------------------------------------------------------*/
  1375.     /* Code Body                                                      */
  1376.     /*----------------------------------------------------------------*/
  1377.     gui_fixed_icontext_list_menuitem_set_text_coordinates(&MMI_fixed_icontext_list_menuitem, c, x, y, width, height);
  1378. }
  1379. /*****************************************************************************
  1380.  * FUNCTION
  1381.  *  set_fixed_icontext_list_icon_coordinates
  1382.  * DESCRIPTION
  1383.  *  Sets the co-ordinates of a given icon column
  1384.  * PARAMETERS
  1385.  *  c           [IN]        Is the index of the icon column (zero based)
  1386.  *  x           [IN]        Position of the icon column within the item
  1387.  *  y           [IN]        Position of the icon column within the item
  1388.  *  width       [IN]        Are the dimensions of the icon column
  1389.  *  height      [IN]        Are the dimensions of the icon column
  1390.  * RETURNS
  1391.  *  void
  1392.  *****************************************************************************/
  1393. void set_fixed_icontext_list_icon_coordinates(S32 c, S32 x, S32 y, S32 width, S32 height)
  1394. {
  1395.     /*----------------------------------------------------------------*/
  1396.     /* Local Variables                                                */
  1397.     /*----------------------------------------------------------------*/
  1398.     /*----------------------------------------------------------------*/
  1399.     /* Code Body                                                      */
  1400.     /*----------------------------------------------------------------*/
  1401.     gui_fixed_icontext_list_menuitem_set_icon_coordinates(&MMI_fixed_icontext_list_menuitem, c, x, y, width, height);
  1402. }
  1403. /*****************************************************************************
  1404.  * FUNCTION
  1405.  *  associate_fixed_icontext_list_list
  1406.  * DESCRIPTION
  1407.  *  Associates the list of fixed icontext list menu items with the fixed list
  1408.  * PARAMETERS
  1409.  *  void
  1410.  * RETURNS
  1411.  *  void
  1412.  *****************************************************************************/
  1413. void associate_fixed_icontext_list_list(void)
  1414. {
  1415.     /*----------------------------------------------------------------*/
  1416.     /* Local Variables                                                */
  1417.     /*----------------------------------------------------------------*/
  1418.     /*----------------------------------------------------------------*/
  1419.     /* Code Body                                                      */
  1420.     /*----------------------------------------------------------------*/
  1421.     clear_fixed_list_highlight_handler();
  1422.     gui_set_fixed_list_menu_item_functions(
  1423.         &MMI_fixed_list_menu,
  1424.         gui_show_fixed_icontext_list_menuitem,
  1425.         gui_measure_fixed_icontext_list_menuitem,
  1426.         gui_highlight_fixed_icontext_list_menuitem,
  1427.         gui_remove_highlight_fixed_icontext_list_menuitem,
  1428.         UI_fixed_menuitem_dummy_hide_function,
  1429.         resize_fixed_icontext_list_menuitems);
  1430. #ifdef __MMI_TOUCH_SCREEN__
  1431.     gui_set_fixed_list_menu_item_pen_function(
  1432.         &MMI_fixed_list_menu,
  1433.         UI_fixed_menuitem_dummy_pen_function,
  1434.         MMI_FALSE,
  1435.         MMI_FALSE);
  1436. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1437. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1438.     set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
  1439. #endif 
  1440.     MMI_fixed_list_menu.first_displayed_item = 0;
  1441.     MMI_fixed_list_menu.highlighted_item = 0;
  1442.     fixed_icontext_list_menu_n_items = &MMI_fixed_list_menu.n_items;
  1443.     MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
  1444.     MMI_fixed_icontext_list_menuitem.parent_list = &MMI_fixed_list_menu;
  1445.     MMI_fixed_icontext_list_menuitem.parent_matrix = NULL;
  1446.     MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_DISABLE_HIGHLIGHT;
  1447.     MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_AUTO_CHOOSE_MARQUEE;
  1448.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  1449. #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
  1450.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
  1451. #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
  1452.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
  1453. #endif 
  1454.     MMI_fixed_list_menu.common_item_data = &MMI_fixed_icontext_list_menuitem;
  1455. #ifdef __MMI_TOUCH_SCREEN__
  1456.     MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
  1457.     MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
  1458. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1459.     (*fixed_icontext_list_menu_n_items) = 0;
  1460.     resize_fixed_icontext_list_menuitems(MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1, get_menu_item_height());       /* MMI_menuitem_height); */
  1461.     MMI_disable_title_shortcut_display = 0;
  1462.     set_MMI_current_fixed_icontext_list_menuitem_theme_list();
  1463.     gui_set_fixed_icontext_list_menuitem_current_theme(&MMI_fixed_icontext_list_menuitem);
  1464.     wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_list_menuitem_stop_scroll;
  1465.     wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_list_menuitem_start_scroll;
  1466. }
  1467. /* MTK Leo add 20050225, for new list_matrix menu style */
  1468. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1469. /*****************************************************************************
  1470.  * FUNCTION
  1471.  *  associate_fixed_icontext_list_list2
  1472.  * DESCRIPTION
  1473.  *  
  1474.  * PARAMETERS
  1475.  *  void
  1476.  * RETURNS
  1477.  *  void
  1478.  *****************************************************************************/
  1479. void associate_fixed_icontext_list_list2(void)
  1480. {
  1481.     /*----------------------------------------------------------------*/
  1482.     /* Local Variables                                                */
  1483.     /*----------------------------------------------------------------*/
  1484.     /*----------------------------------------------------------------*/
  1485.     /* Code Body                                                      */
  1486.     /*----------------------------------------------------------------*/
  1487.     associate_fixed_icontext_list_list();
  1488.     MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers2;
  1489. }
  1490. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  1491. /* MTK Leo end 20050225 */
  1492. /*****************************************************************************
  1493.  * FUNCTION
  1494.  *  associate_fixed_icontext_list_matrix
  1495.  * DESCRIPTION
  1496.  *  Associates the list of fixed icontext list menu items with the fixed matrix
  1497.  * PARAMETERS
  1498.  *  void
  1499.  * RETURNS
  1500.  *  void
  1501.  *****************************************************************************/
  1502. void associate_fixed_icontext_list_matrix(void)
  1503. {
  1504.     /*----------------------------------------------------------------*/
  1505.     /* Local Variables                                                */
  1506.     /*----------------------------------------------------------------*/
  1507.     /*----------------------------------------------------------------*/
  1508.     /* Code Body                                                      */
  1509.     /*----------------------------------------------------------------*/
  1510.     clear_fixed_matrix_highlight_handler();
  1511.     gui_set_fixed_matrix_menu_item_functions(
  1512.         &MMI_fixed_matrix_menu,
  1513.         gui_show_fixed_icontext_list_menuitem,
  1514.         gui_measure_fixed_icontext_list_menuitem,
  1515.         gui_highlight_fixed_icontext_list_menuitem,
  1516.         gui_remove_highlight_fixed_icontext_list_menuitem,
  1517.         UI_fixed_menuitem_dummy_hide_function);
  1518.     MMI_fixed_matrix_menu.displayed_columns = 0;
  1519.     MMI_fixed_matrix_menu.displayed_rows = 0;
  1520.     MMI_fixed_matrix_menu.first_displayed_column = 0;
  1521.     MMI_fixed_matrix_menu.first_displayed_row = 0;
  1522.     MMI_fixed_matrix_menu.highlighted_column = 0;
  1523.     MMI_fixed_matrix_menu.highlighted_row = 0;
  1524.     MMI_fixed_matrix_menu.highlighted_item = 0;
  1525. #ifdef __MMI_TOUCH_SCREEN__
  1526.     MMI_fixed_matrix_menu.pen_event_current_selected_callback_function = NULL;
  1527.     MMI_fixed_matrix_menu.pen_event_default_selected_callback_function = NULL;
  1528. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1529.     fixed_icontext_list_menu_n_items = &MMI_fixed_matrix_menu.n_items;
  1530.     MMI_fixed_matrix_menu.items = MMI_fixed_menuitem_pointers;
  1531.     MMI_fixed_icontext_list_menuitem.parent_list = NULL;
  1532.     MMI_fixed_icontext_list_menuitem.parent_matrix = &MMI_fixed_matrix_menu;            
  1533.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  1534.     MMI_fixed_matrix_menu.common_item_data = &MMI_fixed_icontext_list_menuitem;
  1535.     (*fixed_icontext_list_menu_n_items) = 0;
  1536.     resize_fixed_matrix_menuitems = resize_fixed_icontext_list_menuitems;
  1537.     MMI_disable_title_shortcut_display = 1;
  1538.     set_MMI_current_fixed_icontext_list_menuitem_theme_matrix();
  1539.     gui_set_fixed_icontext_list_menuitem_current_theme(&MMI_fixed_icontext_list_menuitem);
  1540. }
  1541. /*****************************************************************************
  1542.  * FUNCTION
  1543.  *  remove_all_fixed_icontext_item
  1544.  * DESCRIPTION
  1545.  *  remove all items in fixed list menu
  1546.  *  
  1547.  *  See fixed_icontext_list_item_insert()
  1548.  * PARAMETERS
  1549.  *  void
  1550.  *  img(?)          [IN]        Is the image to be displayed in this item
  1551.  *  n_items(?)      [IN]        (zero based) index of the item
  1552.  *  s(?)            [IN]        Is the string to be displayed in this item
  1553.  * RETURNS
  1554.  *  void
  1555.  *****************************************************************************/
  1556. void remove_all_fixed_icontext_item(void)
  1557. {
  1558.     /*----------------------------------------------------------------*/
  1559.     /* Local Variables                                                */
  1560.     /*----------------------------------------------------------------*/
  1561.     /*----------------------------------------------------------------*/
  1562.     /* Code Body                                                      */
  1563.     /*----------------------------------------------------------------*/
  1564.     if ((*fixed_icontext_list_menu_n_items) <= 0)
  1565.     {
  1566.         return;
  1567.     }
  1568.     (*fixed_icontext_list_menu_n_items) = 0;
  1569. }
  1570. /*****************************************************************************
  1571.  * FUNCTION
  1572.  *  add_fixed_icontext_items_200
  1573.  * DESCRIPTION
  1574.  *  add one item in fixed icontext list menu for category200
  1575.  *  
  1576.  *  See fixed_icontext_list_item_insert()
  1577.  * PARAMETERS
  1578.  *  n_items     [IN]        (zero based) index of the item
  1579.  *  s           [IN]        Is the string to be displayed in this item
  1580.  *  img         [IN]        Is the image to be displayed in this item
  1581.  * RETURNS
  1582.  *  void
  1583.  *****************************************************************************/
  1584. void add_fixed_icontext_items_200(S32 n_items, UI_string_type *s, PU8 *img)
  1585. {
  1586.     /*----------------------------------------------------------------*/
  1587.     /* Local Variables                                                */
  1588.     /*----------------------------------------------------------------*/
  1589.     S32 i;
  1590.     /*----------------------------------------------------------------*/
  1591.     /* Code Body                                                      */
  1592.     /*----------------------------------------------------------------*/
  1593.     if (n_items > MAX_FIXED_ICONTEXT_MENU_ITEMS)
  1594.     {
  1595.         n_items = MAX_FIXED_ICONTEXT_MENU_ITEMS;
  1596.     }
  1597.     for (i = 0; i < n_items; i++)
  1598.     {
  1599.         MMI_fixed_icontext_list_menuitems[i].item_texts[0] = s[i];
  1600.         MMI_fixed_icontext_list_menuitems[i].item_icons[0] = img[i];
  1601.     }
  1602.     (*fixed_icontext_menu_n_items) = n_items;
  1603. }
  1604. /*****************************************************************************
  1605.  * FUNCTION
  1606.  *  add_fixed_icontext_list_item_text
  1607.  * DESCRIPTION
  1608.  *  changes the text in the specified column of an item
  1609.  *  
  1610.  *  See fixed_icontext_list_item_insert()
  1611.  * PARAMETERS
  1612.  *  index       [IN]        (zero based) index of the item
  1613.  *  c           [IN]        Is the text column index (zero based)
  1614.  *  s           [IN]        Is the string to be displayed in this text column
  1615.  * RETURNS
  1616.  *  void
  1617.  *****************************************************************************/
  1618. void add_fixed_icontext_list_item_text(S32 index, S32 c, UI_string_type s)
  1619. {
  1620.     /*----------------------------------------------------------------*/
  1621.     /* Local Variables                                                */
  1622.     /*----------------------------------------------------------------*/
  1623.     /*----------------------------------------------------------------*/
  1624.     /* Code Body                                                      */
  1625.     /*----------------------------------------------------------------*/
  1626.     MMI_fixed_icontext_list_menuitems[index].item_texts[c] = s;
  1627. }
  1628. /*****************************************************************************
  1629.  * FUNCTION
  1630.  *  add_fixed_icontext_list_item_icon
  1631.  * DESCRIPTION
  1632.  *  changes the icon in the specified column of an item
  1633.  *  
  1634.  *  See fixed_icontext_list_item_insert()
  1635.  * PARAMETERS
  1636.  *  index       [IN]        (zero based) index of the item
  1637.  *  c           [IN]        Is the icon column index (zero based)
  1638.  *  img         [IN]        Is the icon to be displayed in this icon column
  1639.  * RETURNS
  1640.  *  void
  1641.  *****************************************************************************/
  1642. void add_fixed_icontext_list_item_icon(S32 index, S32 c, PU8 img)
  1643. {
  1644.     /*----------------------------------------------------------------*/
  1645.     /* Local Variables                                                */
  1646.     /*----------------------------------------------------------------*/
  1647.     /*----------------------------------------------------------------*/
  1648.     /* Code Body                                                      */
  1649.     /*----------------------------------------------------------------*/
  1650.     MMI_fixed_icontext_list_menuitems[index].item_icons[c] = img;
  1651. }
  1652. /*****************************************************************************
  1653.  * FUNCTION
  1654.  *  fixed_icontext_list_item_insert
  1655.  * DESCRIPTION
  1656.  *  Inserts a new item to the list of fixed icontext list menuitems
  1657.  *  
  1658.  *  Automatically shifts the items to insert the new item
  1659.  *  This function is normally called before calling
  1660.  *  add_fixed_icontext_list_item_text() and
  1661.  *  add_fixed_icontext_list_item_icon()
  1662.  * PARAMETERS
  1663.  *  index       [IN]        (zero based) index at which a new item is inserted
  1664.  * RETURNS
  1665.  *  void
  1666.  *****************************************************************************/
  1667. void fixed_icontext_list_item_insert(S32 index)
  1668. {
  1669.     /*----------------------------------------------------------------*/
  1670.     /* Local Variables                                                */
  1671.     /*----------------------------------------------------------------*/
  1672.     S32 i;
  1673.     /*----------------------------------------------------------------*/
  1674.     /* Code Body                                                      */
  1675.     /*----------------------------------------------------------------*/
  1676.     if ((*fixed_icontext_list_menu_n_items) >= MAX_FIXED_ICONTEXT_LIST_MENU_ITEMS)
  1677.     {
  1678.         return;
  1679.     }
  1680.     for (i = 0; i < FIXED_ICONTEXT_LIST_MAX_ICON_COLUMNS; i++)
  1681.     {
  1682.         MMI_fixed_icontext_list_menuitems[index].item_icons[i] = NULL;
  1683.         MMI_fixed_icontext_list_menuitems[index].item_icon_handles[i] = GDI_ERROR_HANDLE;
  1684.     }
  1685.     for (i = 0; i < FIXED_ICONTEXT_LIST_MAX_TEXT_COLUMNS; i++)
  1686.     {
  1687.         MMI_fixed_icontext_list_menuitems[index].item_texts[i] = NULL;
  1688.     }
  1689.     for (i = (*fixed_icontext_list_menu_n_items); i > index; i--)
  1690.     {
  1691.         MMI_fixed_icontext_list_menuitems[i] = MMI_fixed_icontext_list_menuitems[i - 1];
  1692.     }
  1693.     (*fixed_icontext_list_menu_n_items)++;
  1694. }
  1695. /*****************************************************************************
  1696.  * FUNCTION
  1697.  *  remove_fixed_icontext_list_item
  1698.  * DESCRIPTION
  1699.  *  Removes an item at the specified index
  1700.  * PARAMETERS
  1701.  *  index       [IN]        (zero based) index of the item to be removed
  1702.  * RETURNS
  1703.  *  void
  1704.  *****************************************************************************/
  1705. void remove_fixed_icontext_list_item(S32 index)
  1706. {
  1707.     /*----------------------------------------------------------------*/
  1708.     /* Local Variables                                                */
  1709.     /*----------------------------------------------------------------*/
  1710.     S32 i;
  1711.     /*----------------------------------------------------------------*/
  1712.     /* Code Body                                                      */
  1713.     /*----------------------------------------------------------------*/
  1714.     if ((*fixed_icontext_list_menu_n_items) <= 0)
  1715.     {
  1716.         return;
  1717.     }
  1718.     for (i = index; i < (*fixed_icontext_list_menu_n_items) - 1; i++)
  1719.     {
  1720.         MMI_fixed_icontext_list_menuitems[i] = MMI_fixed_icontext_list_menuitems[i + 1];
  1721.     }
  1722.     (*fixed_icontext_list_menu_n_items)--;
  1723. }
  1724. /* Fixed twostate item wrappers        */
  1725. fixed_twostate_menuitem MMI_fixed_twostate_menuitem;
  1726. fixed_twostate_menuitem_type *MMI_fixed_twostate_menuitems = (fixed_twostate_menuitem_type *) & integratedMenus;
  1727. /* fixed_twostate_menuitem_type                 MMI_fixed_twostate_menuitems[MAX_FIXED_TWOSTATE_MENU_ITEMS]; */
  1728. S32 *fixed_twostate_menu_n_items;
  1729. /*****************************************************************************
  1730.  * FUNCTION
  1731.  *  fixed_twostate_menuitem_apply_current_theme
  1732.  * DESCRIPTION
  1733.  *  Applies the current theme to the fixed twostate menuitems
  1734.  * PARAMETERS
  1735.  *  void
  1736.  * RETURNS
  1737.  *  void
  1738.  *****************************************************************************/
  1739. void fixed_twostate_menuitem_apply_current_theme(void)
  1740. {
  1741.     /*----------------------------------------------------------------*/
  1742.     /* Local Variables                                                */
  1743.     /*----------------------------------------------------------------*/
  1744.     /*----------------------------------------------------------------*/
  1745.     /* Code Body                                                      */
  1746.     /*----------------------------------------------------------------*/
  1747.     gui_set_fixed_twostate_menuitem_current_theme(&MMI_fixed_twostate_menuitem);
  1748. }
  1749. /*****************************************************************************
  1750.  * FUNCTION
  1751.  *  fixed_twostate_menuitem_apply_theme
  1752.  * DESCRIPTION
  1753.  *  Applies the current theme to the fixed twostate menuitems
  1754.  * PARAMETERS
  1755.  *  t       [?]     
  1756.  * RETURNS
  1757.  *  void
  1758.  *****************************************************************************/
  1759. void fixed_twostate_menuitem_apply_theme(UI_fixed_twostate_menuitem_theme *t)
  1760. {
  1761.     /*----------------------------------------------------------------*/
  1762.     /* Local Variables                                                */
  1763.     /*----------------------------------------------------------------*/
  1764.     /*----------------------------------------------------------------*/
  1765.     /* Code Body                                                      */
  1766.     /*----------------------------------------------------------------*/
  1767.     gui_set_fixed_twostate_menuitem_theme(&MMI_fixed_twostate_menuitem, t);
  1768. }
  1769. /*****************************************************************************
  1770.  * FUNCTION
  1771.  *  create_fixed_twostate_menuitems
  1772.  * DESCRIPTION
  1773.  *  Creates a list of fixed twostate menuitems
  1774.  * PARAMETERS
  1775.  *  ON_icon         [IN]        
  1776.  *  OFF_icon        [IN]        
  1777.  * RETURNS
  1778.  *  void
  1779.  *****************************************************************************/
  1780. void create_fixed_twostate_menuitems(PU8 ON_icon, PU8 OFF_icon)
  1781. {
  1782.     /*----------------------------------------------------------------*/
  1783.     /* Local Variables                                                */
  1784.     /*----------------------------------------------------------------*/
  1785.     S32 i;
  1786.     /*----------------------------------------------------------------*/
  1787.     /* Code Body                                                      */
  1788.     /*----------------------------------------------------------------*/
  1789.     gui_create_fixed_twostate_menuitem(&MMI_fixed_twostate_menuitem, 108, MMI_MENUITEM_HEIGHT, ON_icon, OFF_icon);      /* 082205 Calvin modified */
  1790.     gui_fixed_twostate_menuitem_set_text_position(&MMI_fixed_twostate_menuitem, 24, 0);
  1791.     MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  1792.     MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
  1793.     for (i = 0; i < MAX_FIXED_TWOSTATE_MENU_ITEMS && i < MAX_FIXED_MENU_ITEM_POINTERS; i++)
  1794.     {
  1795.         MMI_fixed_twostate_menuitems[i].flags = 0;
  1796.         MMI_fixed_menuitem_pointers[i] = (void*)&MMI_fixed_twostate_menuitems[i];
  1797.     }
  1798. }
  1799. /*****************************************************************************
  1800.  * FUNCTION
  1801.  *  resize_fixed_twostate_menuitems
  1802.  * DESCRIPTION
  1803.  *  Resizes all the fixed twostate menuitems
  1804.  * PARAMETERS
  1805.  *  width       [IN]        Are the new dimensions
  1806.  *  height      [IN]        Are the new dimensions
  1807.  * RETURNS
  1808.  *  void
  1809.  *****************************************************************************/
  1810. void resize_fixed_twostate_menuitems(S32 width, S32 height)
  1811. {
  1812.     /*----------------------------------------------------------------*/
  1813.     /* Local Variables                                                */
  1814.     /*----------------------------------------------------------------*/
  1815.     /*----------------------------------------------------------------*/
  1816.     /* Code Body                                                      */
  1817.     /*----------------------------------------------------------------*/
  1818.     if (width == 0)
  1819.     {
  1820.         width = MMI_fixed_twostate_menuitem.width;
  1821.     }
  1822.     if (height == 0)
  1823.     {
  1824.         height = MMI_fixed_twostate_menuitem.height;
  1825.     }
  1826.     gui_resize_fixed_twostate_menuitem(&MMI_fixed_twostate_menuitem, width, height);
  1827. }
  1828. /*****************************************************************************
  1829.  * FUNCTION
  1830.  *  associate_fixed_twostate_list
  1831.  * DESCRIPTION
  1832.  *  Associates the list of fixed twostate menuitems with the fixed list
  1833.  * PARAMETERS
  1834.  *  void
  1835.  *  width(?)        [IN]        Height are the new dimensions
  1836.  * RETURNS
  1837.  *  void
  1838.  *****************************************************************************/
  1839. void associate_fixed_twostate_list(void)
  1840. {
  1841.     /*----------------------------------------------------------------*/
  1842.     /* Local Variables                                                */
  1843.     /*----------------------------------------------------------------*/
  1844.     /*----------------------------------------------------------------*/
  1845.     /* Code Body                                                      */
  1846.     /*----------------------------------------------------------------*/
  1847.     clear_fixed_list_highlight_handler();
  1848.     gui_set_fixed_list_menu_item_functions(
  1849.         &MMI_fixed_list_menu,
  1850.         gui_show_fixed_twostate_menuitem,
  1851.         gui_measure_fixed_twostate_menuitem,
  1852.         gui_highlight_fixed_twostate_menuitem,
  1853.         gui_remove_highlight_fixed_twostate_menuitem,
  1854.         UI_fixed_menuitem_dummy_hide_function,
  1855.         resize_fixed_twostate_menuitems);
  1856. #ifdef __MMI_TOUCH_SCREEN__
  1857.     gui_set_fixed_list_menu_item_pen_function(
  1858.         &MMI_fixed_list_menu,
  1859.         gui_fixed_twostate_menuitem_translate_pen_event,
  1860.         MMI_FALSE,
  1861.         MMI_TRUE);
  1862. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1863. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1864.     set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
  1865. #endif 
  1866.     MMI_fixed_list_menu.first_displayed_item = 0;
  1867.     MMI_fixed_list_menu.highlighted_item = 0;
  1868.     fixed_twostate_menu_n_items = &MMI_fixed_list_menu.n_items;
  1869.     MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
  1870.     MMI_fixed_twostate_menuitem.parent_list = &MMI_fixed_list_menu;
  1871.     MMI_fixed_twostate_menuitem.parent_matrix = NULL;    
  1872.     MMI_fixed_twostate_menuitem.flags &= ~UI_MENUITEM_DISABLE_HIGHLIGHT;
  1873.     MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  1874. #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
  1875.     MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
  1876. #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
  1877.     MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
  1878. #endif 
  1879.     MMI_fixed_list_menu.common_item_data = (void*)&MMI_fixed_twostate_menuitem;
  1880. #ifdef __MMI_TOUCH_SCREEN__
  1881.     MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
  1882.     MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
  1883. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1884.     (*fixed_twostate_menu_n_items) = 0;
  1885.     resize_fixed_twostate_menuitems(MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1, get_menu_item_height());    /* MMI_menuitem_height); */
  1886.     MMI_disable_title_shortcut_display = 0;
  1887.     set_MMI_current_fixed_twostate_menuitem_theme_list();
  1888.     gui_set_fixed_twostate_menuitem_current_theme(&MMI_fixed_twostate_menuitem);
  1889.     wgui_text_menuitem_reset_scrolling = gui_fixed_twostate_menuitem_stop_scroll;
  1890.     wgui_text_menuitem_restart_scrolling = gui_fixed_twostate_menuitem_start_scroll;
  1891. }
  1892. /*****************************************************************************
  1893.  * FUNCTION
  1894.  *  associate_fixed_twostate_matrix
  1895.  * DESCRIPTION
  1896.  *  Associates the list of fixed twostate menuitems with the fixed matrix
  1897.  * PARAMETERS
  1898.  *  void
  1899.  *  width(?)        [IN]        Height are the new dimensions
  1900.  * RETURNS
  1901.  *  void
  1902.  *****************************************************************************/
  1903. void associate_fixed_twostate_matrix(void)
  1904. {
  1905.     /*----------------------------------------------------------------*/
  1906.     /* Local Variables                                                */
  1907.     /*----------------------------------------------------------------*/
  1908.     /*----------------------------------------------------------------*/
  1909.     /* Code Body                                                      */
  1910.     /*----------------------------------------------------------------*/
  1911.     clear_fixed_matrix_highlight_handler();
  1912.     gui_set_fixed_matrix_menu_item_functions(
  1913.         &MMI_fixed_matrix_menu,
  1914.         gui_show_fixed_twostate_menuitem,
  1915.         gui_measure_fixed_twostate_menuitem,
  1916.         gui_highlight_fixed_twostate_menuitem,
  1917.         gui_remove_highlight_fixed_twostate_menuitem,
  1918.         UI_fixed_menuitem_dummy_hide_function);
  1919.     MMI_fixed_matrix_menu.displayed_columns = 0;
  1920.     MMI_fixed_matrix_menu.displayed_rows = 0;
  1921.     MMI_fixed_matrix_menu.first_displayed_column = 0;
  1922.     MMI_fixed_matrix_menu.first_displayed_row = 0;
  1923.     MMI_fixed_matrix_menu.highlighted_column = 0;
  1924.     MMI_fixed_matrix_menu.highlighted_row = 0;
  1925.     MMI_fixed_matrix_menu.highlighted_item = 0;
  1926. #ifdef __MMI_TOUCH_SCREEN__
  1927.     MMI_fixed_matrix_menu.pen_event_current_selected_callback_function = NULL;
  1928.     MMI_fixed_matrix_menu.pen_event_default_selected_callback_function = NULL;
  1929. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1930.     fixed_twostate_menu_n_items = &MMI_fixed_matrix_menu.n_items;
  1931.     MMI_fixed_matrix_menu.items = MMI_fixed_menuitem_pointers;
  1932.     MMI_fixed_twostate_menuitem.parent_list = NULL;
  1933.     MMI_fixed_twostate_menuitem.parent_matrix = &MMI_fixed_matrix_menu;                
  1934.     MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  1935.     MMI_fixed_matrix_menu.common_item_data = &MMI_fixed_twostate_menuitem;
  1936.     (*fixed_twostate_menu_n_items) = 0;
  1937.     resize_fixed_matrix_menuitems = resize_fixed_twostate_menuitems;
  1938.     MMI_disable_title_shortcut_display = 1;
  1939.     set_MMI_current_fixed_twostate_menuitem_theme_matrix();
  1940.     gui_set_fixed_twostate_menuitem_current_theme(&MMI_fixed_twostate_menuitem);
  1941. }
  1942. /*****************************************************************************
  1943.  * FUNCTION
  1944.  *  center_fixed_twostate_positions
  1945.  * DESCRIPTION
  1946.  *  Sets center justification of text and icons within the fixed twostate menuitems
  1947.  * PARAMETERS
  1948.  *  tx      [IN]        Center text horizontally   |  These flags can have the values
  1949.  *  ty      [IN]        Center text vertically     |  0 or 1. If a flag is 1, then the
  1950.  *  ix      [IN]        Center icon horizontally   |  action specified with the flag will
  1951.  *  iy      [IN]        Center icon vertically     |  be performed.
  1952.  * RETURNS
  1953.  *  void
  1954.  *****************************************************************************/
  1955. void center_fixed_twostate_positions(U8 tx, U8 ty, U8 ix, U8 iy)
  1956. {
  1957.     /*----------------------------------------------------------------*/
  1958.     /* Local Variables                                                */
  1959.     /*----------------------------------------------------------------*/
  1960.     /*----------------------------------------------------------------*/
  1961.     /* Code Body                                                      */
  1962.     /*----------------------------------------------------------------*/
  1963.     MMI_fixed_twostate_menuitem.flags &=
  1964.         ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_CENTER_TEXT_Y | UI_MENUITEM_CENTER_ICON_X |
  1965.           UI_MENUITEM_CENTER_ICON_Y);
  1966.     if (tx)
  1967.     {
  1968.         MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X;
  1969.     }
  1970.     if (ty)
  1971.     {
  1972.         MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  1973.     }
  1974.     if (ix)
  1975.     {
  1976.         MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_ICON_X;
  1977.     }
  1978.     if (iy)
  1979.     {
  1980.         MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
  1981.     }
  1982. }
  1983. /*****************************************************************************
  1984.  * FUNCTION
  1985.  *  set_fixed_twostate_positions
  1986.  * DESCRIPTION
  1987.  *  Sets the positions of text and icons within the fixed twostate menuitems
  1988.  * PARAMETERS
  1989.  *  tx      [IN]        X position of text   |  If this value is 0, the text will be centered horizontally
  1990.  *  ty      [IN]        Y position of text   |  If this value is 0, the text will be centered vertically
  1991.  *  ix      [IN]        X position of icon   |  If this value is 0, the icon will be centered horizontally
  1992.  *  iy      [IN]        Y position of icon   |  If this value is 0, the icon will be centered vertically
  1993.  * RETURNS
  1994.  *  void
  1995.  *****************************************************************************/
  1996. void set_fixed_twostate_positions(S32 tx, S32 ty, S32 ix, S32 iy)
  1997. {
  1998.     /*----------------------------------------------------------------*/
  1999.     /* Local Variables                                                */
  2000.     /*----------------------------------------------------------------*/
  2001.     /*----------------------------------------------------------------*/
  2002.     /* Code Body                                                      */
  2003.     /*----------------------------------------------------------------*/
  2004.     MMI_fixed_twostate_menuitem.flags &=
  2005.         ~(UI_MENUITEM_CENTER_TEXT_X | UI_MENUITEM_CENTER_TEXT_Y | UI_MENUITEM_CENTER_ICON_X |
  2006.           UI_MENUITEM_CENTER_ICON_Y);
  2007.     /* if(tx)       MMI_fixed_twostate_menuitem.text_x=tx; */
  2008.     if (tx)
  2009.     {
  2010.         MMI_fixed_twostate_menuitem.text_x = tx;
  2011.         gui_resize_fixed_twostate_menuitem(
  2012.             &MMI_fixed_twostate_menuitem,
  2013.             MMI_fixed_twostate_menuitem.width,
  2014.             MMI_fixed_twostate_menuitem.height);
  2015.     }
  2016.     else