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

MTK

开发平台:

C/C++

  1.     {
  2.         MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X;
  3.     }
  4.     if (ty)
  5.     {
  6.         MMI_fixed_twostate_menuitem.text_y = ty;
  7.     }
  8.     else
  9.     {
  10.         MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  11.     }
  12.     if (ix)
  13.     {
  14.         MMI_fixed_twostate_menuitem.icon_x = ix;
  15.     }
  16.     else
  17.     {
  18.         MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_ICON_X;
  19.     }
  20.     if (iy)
  21.     {
  22.         MMI_fixed_twostate_menuitem.icon_y = iy;
  23.     }
  24.     else
  25.     {
  26.         MMI_fixed_twostate_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
  27.     }
  28. }
  29. /*****************************************************************************
  30.  * FUNCTION
  31.  *  set_fixed_twostate_icons
  32.  * DESCRIPTION
  33.  *  Changes the icons to be used in fixed twostate menuitems
  34.  * PARAMETERS
  35.  *  ON_icon         [IN]        Is the icon to be displayed when an item is selected
  36.  *  OFF_icon        [IN]        Is the icon to be displayed when the item is not selected
  37.  * RETURNS
  38.  *  void
  39.  *****************************************************************************/
  40. void set_fixed_twostate_icons(PU8 ON_icon, PU8 OFF_icon)
  41. {
  42.     /*----------------------------------------------------------------*/
  43.     /* Local Variables                                                */
  44.     /*----------------------------------------------------------------*/
  45.     /*----------------------------------------------------------------*/
  46.     /* Code Body                                                      */
  47.     /*----------------------------------------------------------------*/
  48.     gui_fixed_twostate_menuitem_set_icons(&MMI_fixed_twostate_menuitem, ON_icon, OFF_icon);
  49. }
  50. /*****************************************************************************
  51.  * FUNCTION
  52.  *  add_fixed_twostate_item
  53.  * DESCRIPTION
  54.  *  Adds an item to the list of fixed twostate menuitems
  55.  *  
  56.  *  Adds an item to the end of the list
  57.  * PARAMETERS
  58.  *  s       [IN]        Is the string that is displayed with the item
  59.  * RETURNS
  60.  *  void
  61.  *****************************************************************************/
  62. void add_fixed_twostate_item(UI_string_type s)
  63. {
  64.     /*----------------------------------------------------------------*/
  65.     /* Local Variables                                                */
  66.     /*----------------------------------------------------------------*/
  67.     /*----------------------------------------------------------------*/
  68.     /* Code Body                                                      */
  69.     /*----------------------------------------------------------------*/
  70.     if ((*fixed_twostate_menu_n_items) >= MAX_FIXED_TWOSTATE_MENU_ITEMS)
  71.     {
  72.         return;
  73.     }
  74.     MMI_fixed_twostate_menuitems[(*fixed_twostate_menu_n_items)].item_text = s;
  75.     MMI_fixed_twostate_menuitems[(*fixed_twostate_menu_n_items)].flags = 0;
  76.     (*fixed_twostate_menu_n_items)++;
  77. }
  78. /*****************************************************************************
  79.  * FUNCTION
  80.  *  add_location_fixed_twostate_item
  81.  * DESCRIPTION
  82.  *  Adds an item to the list of fixed twostate menuitems
  83.  *  
  84.  *  Adds an item at the specified location
  85.  * PARAMETERS
  86.  *  index       [IN]        (zero based) index at which the item is added
  87.  *  s           [IN]        Is the string that is displayed with the item
  88.  * RETURNS
  89.  *  void
  90.  *****************************************************************************/
  91. void add_location_fixed_twostate_item(S32 index, UI_string_type s)
  92. {
  93.     /*----------------------------------------------------------------*/
  94.     /* Local Variables                                                */
  95.     /*----------------------------------------------------------------*/
  96.     S32 i;
  97.     /*----------------------------------------------------------------*/
  98.     /* Code Body                                                      */
  99.     /*----------------------------------------------------------------*/
  100.     if ((*fixed_twostate_menu_n_items) >= MAX_FIXED_TWOSTATE_MENU_ITEMS)
  101.     {
  102.         return;
  103.     }
  104.     for (i = (*fixed_twostate_menu_n_items); i > index; i--)
  105.     {
  106.         MMI_fixed_twostate_menuitems[i] = MMI_fixed_twostate_menuitems[i - 1];
  107.     }
  108.     MMI_fixed_twostate_menuitems[index].item_text = s;
  109.     MMI_fixed_twostate_menuitems[index].flags = 0;
  110.     (*fixed_twostate_menu_n_items)++;
  111. }
  112. /*****************************************************************************
  113.  * FUNCTION
  114.  *  remove_fixed_twostate_item
  115.  * DESCRIPTION
  116.  *  Removes an item at the specified location
  117.  * PARAMETERS
  118.  *  index       [IN]        (zero based) index at which the item is removed
  119.  * RETURNS
  120.  *  void
  121.  *****************************************************************************/
  122. void remove_fixed_twostate_item(S32 index)
  123. {
  124.     /*----------------------------------------------------------------*/
  125.     /* Local Variables                                                */
  126.     /*----------------------------------------------------------------*/
  127.     S32 i;
  128.     /*----------------------------------------------------------------*/
  129.     /* Code Body                                                      */
  130.     /*----------------------------------------------------------------*/
  131.     if ((*fixed_twostate_menu_n_items) <= 0)
  132.     {
  133.         return;
  134.     }
  135.     for (i = index; i < (*fixed_twostate_menu_n_items) - 1; i++)
  136.     {
  137.         MMI_fixed_twostate_menuitems[i] = MMI_fixed_twostate_menuitems[i + 1];
  138.     }
  139.     (*fixed_twostate_menu_n_items)--;
  140. }
  141. /*****************************************************************************
  142.  * FUNCTION
  143.  *  add_fixed_twostate_items
  144.  * DESCRIPTION
  145.  *  Adds an array of items to the fixed twostate menuitem list
  146.  * PARAMETERS
  147.  *  n_items     [IN]        Is the number of items in the array.
  148.  *  s           [IN]        Is the array of strings, each string is associated with one item
  149.  * RETURNS
  150.  *  void
  151.  *****************************************************************************/
  152. void add_fixed_twostate_items(S32 n_items, UI_string_type *s)
  153. {
  154.     /*----------------------------------------------------------------*/
  155.     /* Local Variables                                                */
  156.     /*----------------------------------------------------------------*/
  157.     S32 i;
  158.     /*----------------------------------------------------------------*/
  159.     /* Code Body                                                      */
  160.     /*----------------------------------------------------------------*/
  161.     if (n_items > MAX_FIXED_TWOSTATE_MENU_ITEMS)
  162.     {
  163.         n_items = MAX_FIXED_TWOSTATE_MENU_ITEMS;
  164.     }
  165.     for (i = 0; i < n_items; i++)
  166.     {
  167.         MMI_fixed_twostate_menuitems[i].item_text = s[i];
  168.         MMI_fixed_twostate_menuitems[i].flags = 0;
  169.     }
  170.     (*fixed_twostate_menu_n_items) = n_items;
  171. }
  172. /*****************************************************************************
  173.  * FUNCTION
  174.  *  select_fixed_twostate_item
  175.  * DESCRIPTION
  176.  *  Selects an item (sets the item to ON state)
  177.  * PARAMETERS
  178.  *  index       [IN]        (zero based) index of the item to be selected
  179.  * RETURNS
  180.  *  void
  181.  *****************************************************************************/
  182. void select_fixed_twostate_item(S32 index)
  183. {
  184.     /*----------------------------------------------------------------*/
  185.     /* Local Variables                                                */
  186.     /*----------------------------------------------------------------*/
  187.     /*----------------------------------------------------------------*/
  188.     /* Code Body                                                      */
  189.     /*----------------------------------------------------------------*/
  190.     if (index >= 0 && index < (*fixed_twostate_menu_n_items))
  191.     {
  192.         MMI_fixed_twostate_menuitems[index].flags |= UI_MENUITEM_STATE_SELECTED;
  193.     }
  194. }
  195. /*****************************************************************************
  196.  * FUNCTION
  197.  *  unselect_fixed_twostate_item
  198.  * DESCRIPTION
  199.  *  Un-selects an item (sets the item to OFF state)
  200.  * PARAMETERS
  201.  *  index       [IN]        (zero based) index of the item to be selected
  202.  * RETURNS
  203.  *  void
  204.  *****************************************************************************/
  205. void unselect_fixed_twostate_item(S32 index)
  206. {
  207.     /*----------------------------------------------------------------*/
  208.     /* Local Variables                                                */
  209.     /*----------------------------------------------------------------*/
  210.     /*----------------------------------------------------------------*/
  211.     /* Code Body                                                      */
  212.     /*----------------------------------------------------------------*/
  213.     if (index >= 0 && index < (*fixed_twostate_menu_n_items))
  214.     {
  215.         MMI_fixed_twostate_menuitems[index].flags &= ~UI_MENUITEM_STATE_SELECTED;
  216.     }
  217. }
  218. /*****************************************************************************
  219.  * FUNCTION
  220.  *  toggle_fixed_twostate_item
  221.  * DESCRIPTION
  222.  *  Toggles the state of the item (ON to OFF or OFF to ON)
  223.  * PARAMETERS
  224.  *  index       [IN]        (zero based) index of the item to be selected
  225.  * RETURNS
  226.  *  void
  227.  *****************************************************************************/
  228. void toggle_fixed_twostate_item(S32 index)
  229. {
  230.     /*----------------------------------------------------------------*/
  231.     /* Local Variables                                                */
  232.     /*----------------------------------------------------------------*/
  233.     /*----------------------------------------------------------------*/
  234.     /* Code Body                                                      */
  235.     /*----------------------------------------------------------------*/
  236.     if (index >= 0 && index < (*fixed_twostate_menu_n_items))
  237.     {
  238.         if (MMI_fixed_twostate_menuitems[index].flags & UI_MENUITEM_STATE_SELECTED)
  239.         {
  240.             MMI_fixed_twostate_menuitems[index].flags &= ~UI_MENUITEM_STATE_SELECTED;
  241.         }
  242.         else
  243.         {
  244.             MMI_fixed_twostate_menuitems[index].flags |= UI_MENUITEM_STATE_SELECTED;
  245.         }
  246.     }
  247. }
  248. /*****************************************************************************
  249.  * FUNCTION
  250.  *  get_fixed_twostate_item_state
  251.  * DESCRIPTION
  252.  *  Returns the state of the item at the given index
  253.  * PARAMETERS
  254.  *  index       [IN]        (zero based) index of the item
  255.  * RETURNS
  256.  *  0 if the item is unselected and 1 if the item is selected
  257.  *****************************************************************************/
  258. U8 get_fixed_twostate_item_state(S32 index)
  259. {
  260.     /*----------------------------------------------------------------*/
  261.     /* Local Variables                                                */
  262.     /*----------------------------------------------------------------*/
  263.     /*----------------------------------------------------------------*/
  264.     /* Code Body                                                      */
  265.     /*----------------------------------------------------------------*/
  266.     if (index >= 0 && index < (*fixed_twostate_menu_n_items))
  267.     {
  268.         if (MMI_fixed_twostate_menuitems[index].flags & UI_MENUITEM_STATE_SELECTED)
  269.         {
  270.             return (1);
  271.         }
  272.         else
  273.         {
  274.             return (0);
  275.         }
  276.     }
  277.     else
  278.     {
  279.         return (0);
  280.     }
  281. }
  282. /*****************************************************************************
  283.  * FUNCTION
  284.  *  resize_fixed_icontext_menuitems_to_list_width
  285.  * DESCRIPTION
  286.  *  
  287.  * PARAMETERS
  288.  *  void
  289.  * RETURNS
  290.  *  void
  291.  *****************************************************************************/
  292. extern S32 MMI_current_menu_type;
  293. void resize_fixed_icontext_menuitems_to_list_width(void)
  294. {
  295.     /*----------------------------------------------------------------*/
  296.     /* Local Variables                                                */
  297.     /*----------------------------------------------------------------*/
  298.     /*----------------------------------------------------------------*/
  299.     /* Code Body                                                      */
  300.     /*----------------------------------------------------------------*/
  301.     if (MMI_current_menu_type == PAGE_MENU)
  302.     {
  303.         resize_fixed_icontext_menuitems(MMI_fixed_list_menu.width, MMI_fixed_icontext_menuitem.height);
  304.     }
  305.     else if (MMI_fixed_list_menu.flags & UI_LIST_MENU_AUTO_DISABLE_SCROLLBAR)
  306.     {
  307.         MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_DRAW;
  308.         gui_show_fixed_list_menu(&MMI_fixed_list_menu);
  309.         MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_DRAW;
  310.         if (MMI_fixed_list_menu.vbar.scale >= MMI_fixed_list_menu.vbar.range)
  311.         {
  312.             resize_fixed_icontext_menuitems(MMI_fixed_list_menu.width - 4, MMI_fixed_icontext_menuitem.height);
  313.         }
  314.     }
  315.     else if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_SCROLLBAR)
  316.     {
  317.         resize_fixed_icontext_menuitems(MMI_fixed_list_menu.width - 4, MMI_fixed_icontext_menuitem.height);
  318.     }
  319. }
  320. /*****************************************************************************
  321.  * FUNCTION
  322.  *  resize_fixed_text_menuitems_to_list_width
  323.  * DESCRIPTION
  324.  *  
  325.  * PARAMETERS
  326.  *  void
  327.  * RETURNS
  328.  *  void
  329.  *****************************************************************************/
  330. void resize_fixed_text_menuitems_to_list_width(void)
  331. {
  332.     /*----------------------------------------------------------------*/
  333.     /* Local Variables                                                */
  334.     /*----------------------------------------------------------------*/
  335.     /*----------------------------------------------------------------*/
  336.     /* Code Body                                                      */
  337.     /*----------------------------------------------------------------*/
  338.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_AUTO_DISABLE_SCROLLBAR)
  339.     {
  340.         MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_DRAW;
  341.         gui_show_fixed_list_menu(&MMI_fixed_list_menu);
  342.         MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_DRAW;
  343.         if (MMI_fixed_list_menu.vbar.scale >= MMI_fixed_list_menu.vbar.range)
  344.         {
  345.             resize_fixed_text_menuitems(MMI_fixed_list_menu.width - 4, get_menu_item_height());
  346.         }
  347.     }
  348.     else if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_SCROLLBAR)
  349.     {
  350.         resize_fixed_text_menuitems(MMI_fixed_list_menu.width - 4, get_menu_item_height());
  351.     }
  352. }
  353. /*****************************************************************************
  354.  * FUNCTION
  355.  *  resize_fixed_icontext_list_menuitems_to_list_width
  356.  * DESCRIPTION
  357.  *  
  358.  * PARAMETERS
  359.  *  void
  360.  * RETURNS
  361.  *  void
  362.  *****************************************************************************/
  363. void resize_fixed_icontext_list_menuitems_to_list_width(void)
  364. {
  365.     /*----------------------------------------------------------------*/
  366.     /* Local Variables                                                */
  367.     /*----------------------------------------------------------------*/
  368.     /*----------------------------------------------------------------*/
  369.     /* Code Body                                                      */
  370.     /*----------------------------------------------------------------*/
  371.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_AUTO_DISABLE_SCROLLBAR)
  372.     {
  373.         MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_DRAW;
  374.         gui_show_fixed_list_menu(&MMI_fixed_list_menu);
  375.         MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_DRAW;
  376.         if (MMI_fixed_list_menu.vbar.scale >= MMI_fixed_list_menu.vbar.range)
  377.         {
  378.             resize_fixed_icontext_list_menuitems(MMI_fixed_list_menu.width - 4, get_menu_item_height());
  379.         }
  380.     }
  381.     else if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_SCROLLBAR)
  382.     {
  383.         resize_fixed_icontext_list_menuitems(MMI_fixed_list_menu.width - 4, get_menu_item_height());
  384.     }
  385. }
  386. /*****************************************************************************
  387.  * FUNCTION
  388.  *  resize_fixed_twostate_menuitems_to_list_width
  389.  * DESCRIPTION
  390.  *  
  391.  * PARAMETERS
  392.  *  void
  393.  * RETURNS
  394.  *  void
  395.  *****************************************************************************/
  396. void resize_fixed_twostate_menuitems_to_list_width(void)
  397. {
  398.     /*----------------------------------------------------------------*/
  399.     /* Local Variables                                                */
  400.     /*----------------------------------------------------------------*/
  401.     /*----------------------------------------------------------------*/
  402.     /* Code Body                                                      */
  403.     /*----------------------------------------------------------------*/
  404.     if (MMI_fixed_list_menu.flags & UI_LIST_MENU_AUTO_DISABLE_SCROLLBAR)
  405.     {
  406.         MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_DRAW;
  407.         gui_show_fixed_list_menu(&MMI_fixed_list_menu);
  408.         MMI_fixed_list_menu.flags &= ~UI_LIST_MENU_DISABLE_DRAW;
  409.         if (MMI_fixed_list_menu.vbar.scale >= MMI_fixed_list_menu.vbar.range)
  410.         {
  411.             resize_fixed_twostate_menuitems(MMI_fixed_list_menu.width - 4, get_menu_item_height());
  412.         }
  413.     }
  414.     else if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_SCROLLBAR)
  415.     {
  416.         resize_fixed_twostate_menuitems(MMI_fixed_list_menu.width - 4, get_menu_item_height());
  417.     }
  418. }
  419. /*****************************************************************************
  420.  * FUNCTION
  421.  *  associate_fixed_multirow_list_list
  422.  * DESCRIPTION
  423.  *  Associates the list of fixed multirow list menu items with the fixed list
  424.  * PARAMETERS
  425.  *  menu_item_height        [IN]        
  426.  * RETURNS
  427.  *  void
  428.  *****************************************************************************/
  429. void associate_fixed_multirow_list_list(S32 menu_item_height)
  430. {
  431.     /*----------------------------------------------------------------*/
  432.     /* Local Variables                                                */
  433.     /*----------------------------------------------------------------*/
  434.     /*----------------------------------------------------------------*/
  435.     /* Code Body                                                      */
  436.     /*----------------------------------------------------------------*/
  437.     clear_fixed_list_highlight_handler();
  438.     gui_set_fixed_list_menu_item_functions(
  439.         &MMI_fixed_list_menu,
  440.         gui_show_fixed_icontext_list_menuitem,
  441.         gui_measure_fixed_icontext_list_menuitem,
  442.         gui_highlight_fixed_icontext_list_menuitem,
  443.         gui_remove_highlight_fixed_icontext_list_menuitem,
  444.         UI_fixed_menuitem_dummy_hide_function,
  445.         resize_fixed_icontext_list_menuitems);
  446. #ifdef __MMI_TOUCH_SCREEN__
  447.     gui_set_fixed_list_menu_item_pen_function(
  448.         &MMI_fixed_list_menu,
  449.         UI_fixed_menuitem_dummy_pen_function,
  450.         MMI_FALSE,
  451.         MMI_FALSE);
  452. #endif /* __MMI_TOUCH_SCREEN__ */ 
  453. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  454.     set_start_position_and_item_parameters_for_list_highlighter_effect(NULL, NULL, 0, 0);
  455. #endif 
  456.     MMI_fixed_list_menu.first_displayed_item = 0;
  457.     MMI_fixed_list_menu.highlighted_item = 0;
  458.     MMI_fixed_icontext_list_menuitem.flags |= MENU_MUTLIROW_ICON_LIST;
  459.     fixed_icontext_list_menu_n_items = &MMI_fixed_list_menu.n_items;
  460.     MMI_fixed_list_menu.items = MMI_fixed_menuitem_pointers;
  461.     MMI_fixed_icontext_list_menuitem.parent_list = &MMI_fixed_list_menu;
  462.     MMI_fixed_icontext_list_menuitem.parent_matrix = NULL;        
  463.     MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_DISABLE_HIGHLIGHT;
  464.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_DISABLE_BACKGROUND;
  465. #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
  466.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
  467. #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
  468.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
  469. #endif 
  470.     MMI_fixed_list_menu.common_item_data = &MMI_fixed_icontext_list_menuitem;
  471. #ifdef __MMI_TOUCH_SCREEN__
  472.     MMI_fixed_list_menu.pen_event_current_selected_callback_function = NULL;
  473.     MMI_fixed_list_menu.pen_event_default_selected_callback_function = NULL;
  474. #endif /* __MMI_TOUCH_SCREEN__ */ 
  475.     (*fixed_icontext_list_menu_n_items) = 0;
  476.     resize_fixed_icontext_list_menuitems(
  477.         MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 3,
  478.         menu_item_height);
  479.     MMI_disable_title_shortcut_display = 0;
  480.     set_MMI_current_fixed_icontext_list_menuitem_theme_list();
  481.     gui_set_fixed_icontext_list_menuitem_current_theme(&MMI_fixed_icontext_list_menuitem);
  482.     wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_list_menuitem_stop_scroll;
  483.     wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_list_menuitem_start_scroll;
  484. }
  485. /*****************************************************************************
  486.  * FUNCTION
  487.  *  set_single_row_iconlist_fixed_list
  488.  * DESCRIPTION
  489.  *  
  490.  * PARAMETERS
  491.  *  void
  492.  * RETURNS
  493.  *  void
  494.  *****************************************************************************/
  495. void set_single_row_iconlist_fixed_list(void)
  496. {
  497.     /*----------------------------------------------------------------*/
  498.     /* Local Variables                                                */
  499.     /*----------------------------------------------------------------*/
  500.     /*----------------------------------------------------------------*/
  501.     /* Code Body                                                      */
  502.     /*----------------------------------------------------------------*/
  503.     MMI_fixed_icontext_list_menuitem.flags &= ~MENU_MUTLIROW_ICON_LIST;
  504. }
  505. /* PMT NEERAJ START 20050712 */
  506. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  507. /*****************************************************************************
  508.  * FUNCTION
  509.  *  wgui_enable_hints_in_icontext_menuitem
  510.  * DESCRIPTION
  511.  *  Enables Hints within menu item
  512.  * PARAMETERS
  513.  *  void
  514.  * RETURNS
  515.  *  void
  516.  *****************************************************************************/
  517. void wgui_enable_hints_in_icontext_menuitem(void)
  518. {
  519.     /*----------------------------------------------------------------*/
  520.     /* Local Variables                                                */
  521.     /*----------------------------------------------------------------*/
  522.     /*----------------------------------------------------------------*/
  523.     /* Code Body                                                      */
  524.     /*----------------------------------------------------------------*/
  525.     MMI_fixed_icontext_menuitem.ext_flags |= UI_MENUITEM_SHOW_ALL_HINTS;
  526.     /* Unset in normal_fixed_list() */
  527.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_ALIGN_TO_TOP;
  528. }
  529. /*****************************************************************************
  530.  * FUNCTION
  531.  *  wgui_enable_hint_highlight_in_icontext_menuitem
  532.  * DESCRIPTION
  533.  *  Enables Hints within only highlighted menu item
  534.  * PARAMETERS
  535.  *  void
  536.  * RETURNS
  537.  *  void
  538.  *****************************************************************************/
  539. void wgui_enable_hint_highlight_in_icontext_menuitem(void)
  540. {
  541.     /*----------------------------------------------------------------*/
  542.     /* Local Variables                                                */
  543.     /*----------------------------------------------------------------*/
  544.     /*----------------------------------------------------------------*/
  545.     /* Code Body                                                      */
  546.     /*----------------------------------------------------------------*/
  547.     MMI_fixed_icontext_menuitem.ext_flags |= UI_MENUITEM_SHOW_HIGHLIGHTED_HINT;
  548.     /* Unset in normal_fixed_list() */
  549.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_ALIGN_TO_TOP;
  550. }
  551. /*****************************************************************************
  552.  * FUNCTION
  553.  *  wgui_show_icon_only_highlight_in_icontext_menuitem
  554.  * DESCRIPTION
  555.  *  Shows Icon only if the menu item is highlighted
  556.  * PARAMETERS
  557.  *  void
  558.  * RETURNS
  559.  *  void
  560.  *****************************************************************************/
  561. void wgui_show_icon_only_highlight_in_icontext_menuitem(void)
  562. {
  563.     /*----------------------------------------------------------------*/
  564.     /* Local Variables                                                */
  565.     /*----------------------------------------------------------------*/
  566.     /*----------------------------------------------------------------*/
  567.     /* Code Body                                                      */
  568.     /*----------------------------------------------------------------*/
  569.     MMI_fixed_icontext_menuitem.ext_flags |= UI_MENUITEM_SHOW_ICON_ONLY_ON_HIGHLIGHT;
  570.     /* Unset in normal_fixed_list() */
  571.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_ALIGN_TO_TOP;
  572. }
  573. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  574. /* PMT NEERAJ END 20050712 */
  575. /*
  576.  * Two-line menu item
  577.  */
  578. #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
  579. scrolling_text wgui_two_line_scroll_text;
  580. extern BOOL r2lMMIFlag;
  581. #endif /* (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__) */ 
  582. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  583. #include "wgui_categories_defs.h"
  584. #include "wgui_categories_util.h"
  585. #define INLINE_LEVEL_SELECT_USE_IMAGE  1
  586. #define MAXIMUM_TWO_LINE_LENGTH        256
  587. wgui_horizontal_select_menuitem_struct two_line_horizontal_select_menuitem;
  588. wgui_level_select_menutitem_struct two_line_level_select_menuitem;
  589. U8 two_line_string_data[MAXIMUM_TWO_LINE_LENGTH * ENCODING_LENGTH + ENCODING_LENGTH];
  590. /*****************************************************************************
  591.  * FUNCTION
  592.  *  wgui_resize_two_line_two_line_level_select
  593.  * DESCRIPTION
  594.  *  This function resizes the two line volume selct menu
  595.  * PARAMETERS
  596.  *  width       [IN]        
  597.  *  height      [IN]        
  598.  * RETURNS
  599.  *  string to be displayed(?)
  600.  *****************************************************************************/
  601. void wgui_resize_two_line_two_line_level_select(S32 width, S32 height)
  602. {
  603.     /*----------------------------------------------------------------*/
  604.     /* Local Variables                                                */
  605.     /*----------------------------------------------------------------*/
  606.     /*----------------------------------------------------------------*/
  607.     /* Code Body                                                      */
  608.     /*----------------------------------------------------------------*/
  609.     two_line_level_select_menuitem.width = width;
  610.     two_line_level_select_menuitem.height = height;
  611. }
  612. /*****************************************************************************
  613.  * FUNCTION
  614.  *  gui_show_two_line_inline_level_select
  615.  * DESCRIPTION
  616.  *  shows the two line level volume select
  617.  * PARAMETERS
  618.  *  void
  619.  * RETURNS
  620.  *  void
  621.  *****************************************************************************/
  622. #if defined(__MMI_UI_TWO_LINE_MENUITEM_STYLES__) && defined(__MMI_TOUCH_SCREEN__)
  623. static wgui_two_line_arrow_struct mmi_menuitem_right_arrow;
  624. static wgui_two_line_arrow_struct mmi_menuitem_left_arrow;
  625. #endif
  626. void gui_show_two_line_inline_level_select(void)
  627. {
  628.     /*----------------------------------------------------------------*/
  629.     /* Local Variables                                                */
  630.     /*----------------------------------------------------------------*/
  631.     S32 x1, y1, x2, y2;
  632.     S32 icon_x;
  633.     S32 icon_end_x;
  634.     PU8 left_arrow;
  635.     PU8 right_arrow;
  636. #if(INLINE_LEVEL_SELECT_USE_IMAGE)
  637.     PU8 volume_image;
  638.     S32 ix, iy;
  639.     U16 i;
  640. #endif /* (INLINE_LEVEL_SELECT_USE_IMAGE) */ 
  641.     S32 width, height;
  642.     S32 lx, ly, rx, ry;
  643.     /*----------------------------------------------------------------*/
  644.     /* Code Body                                                      */
  645.     /*----------------------------------------------------------------*/
  646.     if (!two_line_level_select_menuitem.two_line_select_get_data)
  647.     {
  648.         return;
  649.     }
  650.     x1 = two_line_level_select_menuitem.x;
  651.     y1 = two_line_level_select_menuitem.y;
  652.     x2 = x1 + two_line_level_select_menuitem.width - 1;
  653.     y2 = y1 + two_line_level_select_menuitem.height - 1;
  654.     left_arrow = get_image(LEFT_RED_ARROW);
  655.     right_arrow = get_image(RIGHT_RED_ARROW);
  656. #if(INLINE_LEVEL_SELECT_USE_IMAGE)
  657.     volume_image = get_image(TWO_LINE_VOLUME_IMAGE);
  658. #endif 
  659.     gui_measure_image(left_arrow, &width, &height);
  660. #ifdef __MMI_TOUCH_SCREEN__
  661.     mmi_menuitem_left_arrow.width = width;
  662.     mmi_menuitem_left_arrow.height = height;
  663. #endif /* __MMI_TOUCH_SCREEN__ */
  664.     lx = 0;
  665.     icon_x = lx + width;
  666.     ly = (two_line_level_select_menuitem.height >> 1) - (height >> 1);
  667.     gui_measure_image(right_arrow, &width, &height);
  668.     rx = two_line_level_select_menuitem.width - width - 1;
  669.     icon_end_x = rx;
  670.     ry = (two_line_level_select_menuitem.height >> 1) - (height >> 1);
  671.     gui_measure_image(right_arrow, &width, &height);
  672. #ifdef __MMI_TOUCH_SCREEN__
  673.     mmi_menuitem_right_arrow.width = width;
  674.     mmi_menuitem_right_arrow.height = height;
  675. #endif /* __MMI_TOUCH_SCREEN__ */
  676.     gui_push_clip();
  677.     gui_set_clip(x1, y1, x2, y2);
  678. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  679.     if (!gui_is_current_transparency_with_multi_layer())
  680.     {
  681.         gui_fixed_icontext_disable_transparent_effect(&MMI_fixed_icontext_menuitem);    /* To hide text below scrolling text */
  682.     }
  683. #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
  684.     gui_draw_filled_area(x1 + 1, y1, x2, y2, MMI_fixed_icontext_menuitem.focussed_filler);
  685. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  686.     gui_fixed_icontext_enable_transparent_effect(&MMI_fixed_icontext_menuitem); /* To hide text below scrolling text */
  687. #endif 
  688.     if (two_line_level_select_menuitem.current_item)
  689.     {
  690.         gui_show_transparent_image(x1 + lx, y1 + ly, left_arrow, 0);
  691.     }
  692. #ifdef __MMI_TOUCH_SCREEN__
  693.     mmi_menuitem_left_arrow.x = x1 + lx;
  694.     mmi_menuitem_left_arrow.y = y1 + ly;
  695. #endif /* __MMI_TOUCH_SCREEN__ */
  696.     if (two_line_level_select_menuitem.current_item < two_line_level_select_menuitem.no_of_items - 1)
  697.     {
  698.         gui_show_transparent_image(x1 + rx, y1 + ry, right_arrow, 0);
  699.     }
  700. #ifdef __MMI_TOUCH_SCREEN__
  701. mmi_menuitem_right_arrow.x = x1 + rx;
  702. mmi_menuitem_right_arrow.y = y1 + ry;
  703. #endif /* __MMI_TOUCH_SCREEN__ */
  704.     gui_set_clip(x1 + icon_x, y1, x1 + icon_end_x, y2);
  705. #if(INLINE_LEVEL_SELECT_USE_IMAGE)
  706.     gui_measure_image(volume_image, &width, &height);
  707.     iy = (two_line_level_select_menuitem.height >> 1) - (height >> 1);
  708.     if (width < icon_end_x - icon_x + 1)
  709.     {
  710.         ix = ((icon_end_x - icon_x + 1) >> 1) - (width >> 1);
  711.     }
  712.     else
  713.     {
  714.         ix = 0;
  715.     }
  716.     for (i = 0; i <= two_line_level_select_menuitem.current_item; i++)
  717.     {
  718.         gdi_image_draw_animation_single_frame(x1 + icon_x, y1 + iy, volume_image, i);
  719.     }
  720. #else /* (INLINE_LEVEL_SELECT_USE_IMAGE) */ 
  721.     {
  722.         S32 total_width = icon_end_x - icon_x + 1;
  723.         S32 total_height = two_line_level_select_menuitem.height - 2;
  724.         S32 x_gap = total_width / (((two_line_level_select_menuitem.no_of_items - 1) << 1) + 1);
  725.         S32 y_gap = total_height / (two_line_level_select_menuitem.no_of_items - 1);
  726.         S32 i;
  727.         color colori;
  728.         y2 = y2 - 1;
  729.         for (i = 0; i < two_line_level_select_menuitem.no_of_items - 1; i++)
  730.         {
  731.             x1 = icon_x + (x_gap * ((i + 1) * 2 - 1));
  732.             x2 = x1 + x_gap;
  733.             y1 = two_line_level_select_menuitem.y + (y_gap * (two_line_level_select_menuitem.no_of_items - 1 - i));
  734.             if (i < two_line_level_select_menuitem.current_item)
  735.             {
  736.                 colori = UI_COLOR_BLACK;
  737.             }
  738.             else
  739.             {
  740.                 colori = UI_COLOR_WHITE;
  741.             }
  742.             gui_fill_rectangle(x1, y1, x2, y2, colori);
  743.         }
  744.     }
  745. #endif /* (INLINE_LEVEL_SELECT_USE_IMAGE) */ 
  746.     gui_pop_clip();
  747. }
  748. /*****************************************************************************
  749.  * FUNCTION
  750.  *  wgui_two_line_level_select_volume_move_next_item
  751.  * DESCRIPTION
  752.  *  This is called when the user presses right arrow key on volume select
  753.  * PARAMETERS
  754.  *  void
  755.  * RETURNS
  756.  *  void
  757.  *****************************************************************************/
  758. void wgui_two_line_level_select_volume_move_next_item(void)
  759. {
  760.     /*----------------------------------------------------------------*/
  761.     /* Local Variables                                                */
  762.     /*----------------------------------------------------------------*/
  763.     /*----------------------------------------------------------------*/
  764.     /* Code Body                                                      */
  765.     /*----------------------------------------------------------------*/
  766.     if (two_line_level_select_menuitem.current_item == two_line_level_select_menuitem.no_of_items - 1)
  767.     {
  768.         return;
  769.     }
  770.     else
  771.     {
  772.         if (!two_line_level_select_menuitem.
  773.             two_line_select_get_data(
  774.                 MMI_fixed_list_menu.highlighted_item,
  775.                 two_line_level_select_menuitem.current_item + 1))
  776.         {
  777.             return;
  778.         }
  779.         two_line_level_select_menuitem.current_item++;
  780.     }
  781.     gui_show_two_line_inline_level_select();
  782.     gui_BLT_double_buffer(
  783.         two_line_level_select_menuitem.x,
  784.         two_line_level_select_menuitem.y,
  785.         two_line_level_select_menuitem.x + two_line_level_select_menuitem.width - 1,
  786.         two_line_level_select_menuitem.y + two_line_level_select_menuitem.height - 1);
  787.     return;
  788. }
  789. /*****************************************************************************
  790.  * FUNCTION
  791.  *  wgui_two_line_level_select_volume_move_previous_item
  792.  * DESCRIPTION
  793.  *  This is called when the user presses left arrow key on volume select
  794.  * PARAMETERS
  795.  *  void
  796.  * RETURNS
  797.  *  void
  798.  *****************************************************************************/
  799. void wgui_two_line_level_select_volume_move_previous_item(void)
  800. {
  801.     /*----------------------------------------------------------------*/
  802.     /* Local Variables                                                */
  803.     /*----------------------------------------------------------------*/
  804.     /*----------------------------------------------------------------*/
  805.     /* Code Body                                                      */
  806.     /*----------------------------------------------------------------*/
  807.     if (two_line_level_select_menuitem.current_item == 0)
  808.     {
  809.         return;
  810.     }
  811.     else
  812.     {
  813.         if (!two_line_level_select_menuitem.
  814.             two_line_select_get_data(
  815.                 MMI_fixed_list_menu.highlighted_item,
  816.                 two_line_level_select_menuitem.current_item - 1))
  817.         {
  818.             return;
  819.         }
  820.         two_line_level_select_menuitem.current_item--;
  821.     }
  822.     gui_show_two_line_inline_level_select();
  823.     gui_BLT_double_buffer(
  824.         two_line_level_select_menuitem.x,
  825.         two_line_level_select_menuitem.y,
  826.         two_line_level_select_menuitem.x + two_line_level_select_menuitem.width - 1,
  827.         two_line_level_select_menuitem.y + two_line_level_select_menuitem.height - 1);
  828.     return;
  829. }
  830. /*****************************************************************************
  831.  * FUNCTION
  832.  *  wgui_move_and_set_keyhandlers_two_line_level_select
  833.  * DESCRIPTION
  834.  *  This function sets the x and y for inline volume select and its key handlers
  835.  * PARAMETERS
  836.  *  x       [IN]        
  837.  *  y       [IN]        
  838.  * RETURNS
  839.  *  string to be displayed(?)
  840.  *****************************************************************************/
  841. void wgui_move_and_set_keyhandlers_two_line_level_select(S32 x, S32 y)
  842. {
  843.     /*----------------------------------------------------------------*/
  844.     /* Local Variables                                                */
  845.     /*----------------------------------------------------------------*/
  846.     /*----------------------------------------------------------------*/
  847.     /* Code Body                                                      */
  848.     /*----------------------------------------------------------------*/
  849.     two_line_level_select_menuitem.x = x;
  850.     two_line_level_select_menuitem.y = y;
  851.     if (two_line_level_select_menuitem.two_line_default_value)
  852.     {
  853.         two_line_level_select_menuitem.current_item = two_line_level_select_menuitem.two_line_default_value(MMI_fixed_list_menu.highlighted_item);
  854.     }
  855.     SetKeyHandler(wgui_two_line_level_select_volume_move_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  856.     SetKeyHandler(wgui_two_line_level_select_volume_move_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  857.     ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_UP);
  858.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_UP);
  859. }
  860. /*****************************************************************************
  861.  * FUNCTION
  862.  *  wgui_complete_two_line_level_select
  863.  * DESCRIPTION
  864.  *  This function is called when the users moves out from the current volume selct
  865.  * PARAMETERS
  866.  *  void
  867.  * RETURNS
  868.  *  void
  869.  *****************************************************************************/
  870. void wgui_complete_two_line_level_select(void)
  871. {
  872.     /*----------------------------------------------------------------*/
  873.     /* Local Variables                                                */
  874.     /*----------------------------------------------------------------*/
  875.     /*----------------------------------------------------------------*/
  876.     /* Code Body                                                      */
  877.     /*----------------------------------------------------------------*/
  878.     ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_UP);
  879.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_UP);
  880.     ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  881.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  882.     gui_scrolling_text_stop(&wgui_two_line_scroll_text);
  883.     if (two_line_level_select_menuitem.two_line_select_complete)
  884.     {
  885.         two_line_level_select_menuitem.two_line_select_complete(
  886.                                         MMI_fixed_list_menu.highlighted_item,
  887.                                         two_line_level_select_menuitem.current_item);
  888.     }
  889. }
  890. /*****************************************************************************
  891.  * FUNCTION
  892.  *  gui_initialise_and_set_two_line_level_select_callbacks
  893.  * DESCRIPTION
  894.  *  This function is called to set the callbacks for the current volume select
  895.  * PARAMETERS
  896.  *  no_of_items                 [IN]        
  897.  *  get_data_callback           [IN]        
  898.  *  default_value_callback      [IN]        
  899.  *  complete_callback           [IN]        
  900.  * RETURNS
  901.  *  void
  902.  *****************************************************************************/
  903. void gui_initialise_and_set_two_line_level_select_callbacks(
  904.         S32 no_of_items,
  905.         wgui_two_line_get_level_select_data_callback get_data_callback,
  906.         wgui_two_line_menuitem_get_default_callback default_value_callback,
  907.         wgui_two_line_menuitem_complete_callback complete_callback)
  908. {
  909.     /*----------------------------------------------------------------*/
  910.     /* Local Variables                                                */
  911.     /*----------------------------------------------------------------*/
  912.     /*----------------------------------------------------------------*/
  913.     /* Code Body                                                      */
  914.     /*----------------------------------------------------------------*/
  915.     two_line_level_select_menuitem.width = 0;
  916.     two_line_level_select_menuitem.height = 0;
  917.     two_line_level_select_menuitem.current_item = 0;
  918.     two_line_level_select_menuitem.no_of_items = no_of_items;
  919.     two_line_level_select_menuitem.two_line_select_get_data = get_data_callback;
  920.     two_line_level_select_menuitem.two_line_select_complete = complete_callback;
  921.     two_line_level_select_menuitem.two_line_default_value = default_value_callback;
  922.     gui_show_two_line_menuitem_part = gui_show_two_line_inline_level_select;
  923.     gui_move_two_line_menuitem_part = wgui_move_and_set_keyhandlers_two_line_level_select;
  924.     gui_resize_two_line_menuitem_part = wgui_resize_two_line_two_line_level_select;
  925.     gui_reset_current_two_line_menuitem_data = wgui_complete_two_line_level_select;
  926.     gui_reset_two_line = wgui_two_line_reset_all_pointers;
  927. }
  928. /*****************************************************************************
  929.  * FUNCTION
  930.  *  reset_fixed_icontext_menuitem_type
  931.  * DESCRIPTION
  932.  *  This function resets the callbakcs to theirdefault style and sets all the two line display style to none.
  933.  * PARAMETERS
  934.  *  void
  935.  * RETURNS
  936.  *  void
  937.  *****************************************************************************/
  938. void reset_fixed_icontext_menuitem_type(void)
  939. {
  940.     /*----------------------------------------------------------------*/
  941.     /* Local Variables                                                */
  942.     /*----------------------------------------------------------------*/
  943.     /*----------------------------------------------------------------*/
  944.     /* Code Body                                                      */
  945.     /*----------------------------------------------------------------*/
  946.     //      S32 i;
  947.     //      for(i=0;i<MAX_FIXED_ICONTEXT_MENU_ITEMS;i++)
  948.     //              fixed_icontext_menuitem_display_style[i].display_style=0;
  949.     gui_scrolling_text_stop(&wgui_two_line_scroll_text);
  950.     gui_get_two_line_menuitem_height = UI_dummy_get_two_line_menuitem_height;
  951.     gui_set_current_two_line_menuitem_data = UI_dummy_set_current_two_line_menuitem_data;
  952.     gui_reset_current_two_line_menuitem_data = UI_dummy_reset_current_two_line_menuitem_data;
  953.     gui_two_line_toggle_thumbnail_direction = UI_dummy_function;
  954.     gui_two_line_get_thumbnail_flags = UI_dummy_two_line_get_thumbnail_flags;
  955. }
  956. // TODO: add symbol name prefixes and comments
  957. static wgui_get_display_style get_current_menu_item_displaystyle = NULL;
  958. static wgui_two_line_menuitem_struct current_menu_item_properties;
  959. static wgui_get_two_line_menu_item_properties get_current_menu_item_properties = NULL;
  960. /*****************************************************************************
  961.  * FUNCTION
  962.  *  wgui_two_line_reset_all_pointers
  963.  * DESCRIPTION
  964.  *  This function reset pointers related to two line function
  965.  *  
  966.  *  This is called by cleanup function in GUI layer
  967.  * PARAMETERS
  968.  *  void
  969.  * RETURNS
  970.  *  void
  971.  *****************************************************************************/
  972. void wgui_two_line_reset_all_pointers(void)
  973. {
  974.     /*----------------------------------------------------------------*/
  975.     /* Local Variables                                                */
  976.     /*----------------------------------------------------------------*/
  977.     /*----------------------------------------------------------------*/
  978.     /* Code Body                                                      */
  979.     /*----------------------------------------------------------------*/
  980.     wgui_set_pfn_to_get_display_style(NULL);
  981.     wgui_set_pfn_to_get_current_menu_item_properties(NULL);
  982.     gui_reset_two_line = UI_dummy_function;
  983.     two_line_level_select_menuitem.two_line_select_complete = NULL;
  984.     two_line_horizontal_select_menuitem.two_line_select_complete = NULL;
  985. }
  986. /*****************************************************************************
  987.  * FUNCTION
  988.  *  wgui_two_line_get_thumbnail_flags
  989.  * DESCRIPTION
  990.  *  This function returns the thumbnail flag
  991.  *  
  992.  *  This is called by GUI Layer
  993.  * PARAMETERS
  994.  *  void
  995.  * RETURNS
  996.  *  Current Thumbnail Flag
  997.  *****************************************************************************/
  998. U8 wgui_two_line_get_thumbnail_flags(void)
  999. {
  1000.     /*----------------------------------------------------------------*/
  1001.     /* Local Variables                                                */
  1002.     /*----------------------------------------------------------------*/
  1003.     /*----------------------------------------------------------------*/
  1004.     /* Code Body                                                      */
  1005.     /*----------------------------------------------------------------*/
  1006.     return current_menu_item_properties.image_flags;
  1007. }
  1008. /*****************************************************************************
  1009.  * FUNCTION
  1010.  *  wgui_two_line_toggle_thumbnail_direction
  1011.  * DESCRIPTION
  1012.  *  This function toggles the thumbnail direction
  1013.  *  
  1014.  *  This is called by GUI layer
  1015.  * PARAMETERS
  1016.  *  void
  1017.  * RETURNS
  1018.  *  void
  1019.  *****************************************************************************/
  1020. void wgui_two_line_toggle_thumbnail_direction(void)
  1021. {
  1022.     /*----------------------------------------------------------------*/
  1023.     /* Local Variables                                                */
  1024.     /*----------------------------------------------------------------*/
  1025.     /*----------------------------------------------------------------*/
  1026.     /* Code Body                                                      */
  1027.     /*----------------------------------------------------------------*/
  1028.     current_menu_item_properties.image_flags ^= UI_TWO_LINE_TOGGLE_THUMBNAIL_DIRECTION_MASK;
  1029. }
  1030. /*****************************************************************************
  1031.  * FUNCTION
  1032.  *  wgui_set_pfn_to_get_display_style
  1033.  * DESCRIPTION
  1034.  *  This function sets a pointer to get current
  1035.  *  menu item display style function in application layer
  1036.  *  
  1037.  *  This is called by application layer
  1038.  * PARAMETERS
  1039.  *  pfn     [IN]        
  1040.  * RETURNS
  1041.  *  void
  1042.  *****************************************************************************/
  1043. void wgui_set_pfn_to_get_display_style(wgui_get_display_style pfn)
  1044. {
  1045.     /*----------------------------------------------------------------*/
  1046.     /* Local Variables                                                */
  1047.     /*----------------------------------------------------------------*/
  1048.     /*----------------------------------------------------------------*/
  1049.     /* Code Body                                                      */
  1050.     /*----------------------------------------------------------------*/
  1051.     get_current_menu_item_displaystyle = pfn;
  1052.     if (pfn)
  1053.     {
  1054.         /* Unset in normal_fixed_list() */
  1055.         MMI_fixed_list_menu.flags |= UI_LIST_MENU_ALIGN_TO_TOP;
  1056.         gui_get_two_line_menuitem_height = get_two_line_menuitem_height;
  1057.         gui_add_cleanup_hook(two_line_menuitem_cleanup_function);//053006 2 line Calvin
  1058.     }
  1059.     else
  1060.     {
  1061.         gui_get_two_line_menuitem_height = UI_dummy_get_two_line_menuitem_height;
  1062.     }
  1063. }
  1064. /*****************************************************************************
  1065.  * FUNCTION
  1066.  *  wgui_set_pfn_to_get_current_menu_item_properties
  1067.  * DESCRIPTION
  1068.  *  This function sets a pointer to get current
  1069.  *  menu item properties function in application layer
  1070.  *  
  1071.  *  This is called by application layer
  1072.  * PARAMETERS
  1073.  *  pfn     [IN]        
  1074.  * RETURNS
  1075.  *  void
  1076.  *****************************************************************************/
  1077. void wgui_set_pfn_to_get_current_menu_item_properties(wgui_get_two_line_menu_item_properties pfn)
  1078. {
  1079.     /*----------------------------------------------------------------*/
  1080.     /* Local Variables                                                */
  1081.     /*----------------------------------------------------------------*/
  1082.     /*----------------------------------------------------------------*/
  1083.     /* Code Body                                                      */
  1084.     /*----------------------------------------------------------------*/
  1085.     get_current_menu_item_properties = pfn;
  1086. }
  1087. /*****************************************************************************
  1088.  * FUNCTION
  1089.  *  set_current_two_line_menuitem_data
  1090.  * DESCRIPTION
  1091.  *  check if two line  horizontal select or level and sets the data for a particular
  1092.  *  menuitem.
  1093.  * PARAMETERS
  1094.  *  void
  1095.  * RETURNS
  1096.  *  void
  1097.  *****************************************************************************/
  1098. void set_current_two_line_menuitem_data(void)
  1099. {
  1100.     /*----------------------------------------------------------------*/
  1101.     /* Local Variables                                                */
  1102.     /*----------------------------------------------------------------*/
  1103.     U8 style;
  1104.     /*----------------------------------------------------------------*/
  1105.     /* Code Body                                                      */
  1106.     /*----------------------------------------------------------------*/
  1107.     if (get_current_menu_item_displaystyle)
  1108.     {
  1109.         style = get_current_menu_item_displaystyle(MMI_fixed_list_menu.highlighted_item);
  1110.     }
  1111.     else
  1112.     {
  1113.         return;
  1114.     }
  1115.     switch (style)
  1116.     {
  1117.         case TWO_LINE_MENUITEM_STYLE_DISPLAY_HORIZONTAL_SELECT:
  1118.             get_current_menu_item_properties(MMI_fixed_list_menu.highlighted_item, &current_menu_item_properties);
  1119.             wgui_initialise_and_set_two_line_horizontal_select_callbacks(
  1120.                 current_menu_item_properties.num_of_items,
  1121.                 (wgui_two_line_get_horizontal_select_data_callback) current_menu_item_properties. two_line_data_callback. get_data_for_horizontal_select,
  1122.                 (wgui_two_line_menuitem_get_default_callback) current_menu_item_properties. defualt_value_callback,
  1123.                 (wgui_two_line_menuitem_complete_callback) current_menu_item_properties. complete_callback);
  1124.             break;
  1125.         case TWO_LINE_MENUITEM_STYLE_DISPLAY_LEVEL_SELECT:
  1126.             get_current_menu_item_properties(MMI_fixed_list_menu.highlighted_item, &current_menu_item_properties);
  1127.             gui_initialise_and_set_two_line_level_select_callbacks(
  1128.                 current_menu_item_properties.num_of_items,
  1129.                 (wgui_two_line_get_level_select_data_callback) current_menu_item_properties.two_line_data_callback. get_data_for_level_select,
  1130.                 (wgui_two_line_menuitem_get_default_callback) current_menu_item_properties.defualt_value_callback,
  1131.                 (wgui_two_line_menuitem_complete_callback) current_menu_item_properties.complete_callback);
  1132.             break;
  1133.         default:
  1134.             break;
  1135.     }
  1136. }
  1137. #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */ 
  1138. /*****************************************************************************
  1139.  * FUNCTION
  1140.  *  two_line_scrolling_text_timer_handler
  1141.  * DESCRIPTION
  1142.  *  This function is the handler for two line select text
  1143.  *  
  1144.  *  This is called by application layer
  1145.  * PARAMETERS
  1146.  *  void
  1147.  * RETURNS
  1148.  *  void
  1149.  *****************************************************************************/
  1150. #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
  1151. void two_line_scrolling_text_timer_handler(void)
  1152. {
  1153.     /*----------------------------------------------------------------*/
  1154.     /* Local Variables                                                */
  1155.     /*----------------------------------------------------------------*/
  1156.     /*----------------------------------------------------------------*/
  1157.     /* Code Body                                                      */
  1158.     /*----------------------------------------------------------------*/
  1159.     gui_handle_scrolling_text(&wgui_two_line_scroll_text);
  1160. }
  1161. /*****************************************************************************
  1162.  * FUNCTION
  1163.  *  wgui_scrolling_text_draw_two_line_background
  1164.  * DESCRIPTION
  1165.  *  This function is used to draw the two line select text background
  1166.  *  
  1167.  *  This is called by application layer
  1168.  * PARAMETERS
  1169.  *  x1      [IN]        
  1170.  *  y1      [IN]        
  1171.  *  x2      [IN]        
  1172.  *  y2      [IN]        
  1173.  * RETURNS
  1174.  *  void
  1175.  *****************************************************************************/
  1176. void wgui_scrolling_text_draw_two_line_background(S32 x1, S32 y1, S32 x2, S32 y2)
  1177. {
  1178. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1179.     /*----------------------------------------------------------------*/
  1180.     /* Local Variables                                                */
  1181.     /*----------------------------------------------------------------*/
  1182.     /*----------------------------------------------------------------*/
  1183.     /* Code Body                                                      */
  1184.     /*----------------------------------------------------------------*/
  1185.     if (!gui_is_current_transparency_with_multi_layer())
  1186.     {
  1187.         gui_fixed_icontext_disable_transparent_effect(&MMI_fixed_icontext_menuitem);    /* To hide text below scrolling text */
  1188.     }
  1189. #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
  1190.     gui_draw_filled_area(x1, y1, x2, y2, MMI_fixed_icontext_menuitem.focussed_filler);
  1191. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1192.     gui_fixed_icontext_enable_transparent_effect(&MMI_fixed_icontext_menuitem); /* To hide text below scrolling text */
  1193. #endif 
  1194. }
  1195. #endif /* (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__) */ 
  1196. /*****************************************************************************
  1197.  * FUNCTION
  1198.  *  wgui_initialise_and_set_two_line_horizontal_select_callbacks
  1199.  * DESCRIPTION
  1200.  *  initialiases the two line horizontal select
  1201.  * PARAMETERS
  1202.  *  no_of_items                 [IN]        
  1203.  *  get_data_callback           [IN]        
  1204.  *  default_value_callback      [IN]        
  1205.  *  complete_callback           [IN]        
  1206.  * RETURNS
  1207.  *  string to be displayed(?)
  1208.  *****************************************************************************/
  1209. #if defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  1210. void wgui_initialise_and_set_two_line_horizontal_select_callbacks(
  1211.         S32 no_of_items,
  1212.         wgui_two_line_get_horizontal_select_data_callback get_data_callback,
  1213.         wgui_two_line_menuitem_get_default_callback default_value_callback,
  1214.         wgui_two_line_menuitem_complete_callback complete_callback)
  1215. {
  1216.     /*----------------------------------------------------------------*/
  1217.     /* Local Variables                                                */
  1218.     /*----------------------------------------------------------------*/
  1219.     /*----------------------------------------------------------------*/
  1220.     /* Code Body                                                      */
  1221.     /*----------------------------------------------------------------*/
  1222.     two_line_horizontal_select_menuitem.width = 0;
  1223.     two_line_horizontal_select_menuitem.height = 0;
  1224.     two_line_horizontal_select_menuitem.current_item = 0;
  1225.     two_line_horizontal_select_menuitem.no_of_items = no_of_items;
  1226.     two_line_horizontal_select_menuitem.two_line_select_get_data = get_data_callback;
  1227.     two_line_horizontal_select_menuitem.two_line_select_complete = complete_callback;
  1228.     two_line_horizontal_select_menuitem.two_line_default_value = default_value_callback;
  1229.     gui_show_two_line_menuitem_part = wgui_show_two_line_horizontal_select;
  1230.     gui_move_two_line_menuitem_part = wgui_move_and_set_keyhandlers_two_line_horizontal_select;
  1231.     gui_resize_two_line_menuitem_part = wgui_resize_two_line_horizontal_select;
  1232.     gui_reset_current_two_line_menuitem_data = wgui_complete_two_line_horizontal_select;
  1233.     gui_reset_two_line = wgui_two_line_reset_all_pointers;
  1234.     gui_two_line_toggle_thumbnail_direction = wgui_two_line_toggle_thumbnail_direction;
  1235.     gui_two_line_get_thumbnail_flags = wgui_two_line_get_thumbnail_flags;
  1236. }
  1237. /*****************************************************************************
  1238.  * FUNCTION
  1239.  *  wgui_move_and_set_keyhandlers_two_line_horizontal_select
  1240.  * DESCRIPTION
  1241.  *  Moves the two line inline select and sets its key handlers
  1242.  * PARAMETERS
  1243.  *  x       [IN]        
  1244.  *  y       [IN]        
  1245.  * RETURNS
  1246.  *  void
  1247.  *****************************************************************************/
  1248. void wgui_move_and_set_keyhandlers_two_line_horizontal_select(S32 x, S32 y)
  1249. {
  1250.     /*----------------------------------------------------------------*/
  1251.     /* Local Variables                                                */
  1252.     /*----------------------------------------------------------------*/
  1253.     /*----------------------------------------------------------------*/
  1254.     /* Code Body                                                      */
  1255.     /*----------------------------------------------------------------*/
  1256.     two_line_horizontal_select_menuitem.x = x;
  1257.     two_line_horizontal_select_menuitem.y = y;
  1258.     if (two_line_horizontal_select_menuitem.two_line_default_value)
  1259.     {
  1260.         two_line_horizontal_select_menuitem.current_item = two_line_horizontal_select_menuitem.two_line_default_value(MMI_fixed_list_menu.highlighted_item);
  1261.     }
  1262.     if (two_line_horizontal_select_menuitem.no_of_items > 1)
  1263.     {
  1264.         SetKeyHandler(wgui_two_line_horizontal_select_move_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1265.         SetKeyHandler(wgui_two_line_horizontal_select_move_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1266.         ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_UP);
  1267.         ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1268.     }
  1269. }
  1270. /*****************************************************************************
  1271.  * FUNCTION
  1272.  *  wgui_resize_two_line_horizontal_select
  1273.  * DESCRIPTION
  1274.  *  Rsizes the two line inline select menuitem
  1275.  * PARAMETERS
  1276.  *  width       [IN]        
  1277.  *  height      [IN]        
  1278.  * RETURNS
  1279.  *  string to be displayed(?)
  1280.  *****************************************************************************/
  1281. void wgui_resize_two_line_horizontal_select(S32 width, S32 height)
  1282. {
  1283.     /*----------------------------------------------------------------*/
  1284.     /* Local Variables                                                */
  1285.     /*----------------------------------------------------------------*/
  1286.     /*----------------------------------------------------------------*/
  1287.     /* Code Body                                                      */
  1288.     /*----------------------------------------------------------------*/
  1289.     two_line_horizontal_select_menuitem.width = width;
  1290.     two_line_horizontal_select_menuitem.height = height;
  1291. }
  1292. /*****************************************************************************
  1293.  * FUNCTION
  1294.  *  wgui_show_two_line_horizontal_select
  1295.  * DESCRIPTION
  1296.  *  shows the two line horizontal select
  1297.  * PARAMETERS
  1298.  *  void
  1299.  * RETURNS
  1300.  *  void
  1301.  *****************************************************************************/
  1302. void wgui_show_two_line_horizontal_select(void)
  1303. {
  1304.     /*----------------------------------------------------------------*/
  1305.     /* Local Variables                                                */
  1306.     /*----------------------------------------------------------------*/
  1307.     S32 x1 = 0, y1 = 0, x2 = 0, y2 = 0;
  1308.     S32 text_x;
  1309.     S32 text_end_x;
  1310.     S32 sw, sh;
  1311.     S32 text_y;
  1312.     PU8 image_data;
  1313.     PU8 left_arrow;
  1314.     PU8 right_arrow;
  1315.     S32 width, height;
  1316.     S32 lx, ly, rx, ry;
  1317.     S32 ix, iy;
  1318.     wgui_thumbnail_image_union thumbnail;
  1319.     U8 thumbnail_area_width, thumbnail_area_height;
  1320.     S32 thumb_x = 0, thumb_y = 0, thumb_width = 0, thumb_height = 0;
  1321.     S32 width_for_horizontal_select;
  1322.     S8 ret_val_resize = 0;
  1323.     /*----------------------------------------------------------------*/
  1324.     /* Code Body                                                      */
  1325.     /*----------------------------------------------------------------*/
  1326. #define THUMBNAIL_GAP_FROM_SIDES 2
  1327.     if (!two_line_horizontal_select_menuitem.two_line_select_get_data)
  1328.     {
  1329.         return;
  1330.     }
  1331.     if (!two_line_horizontal_select_menuitem.
  1332.         two_line_select_get_data(
  1333.             MMI_fixed_list_menu.highlighted_item,
  1334.             two_line_horizontal_select_menuitem.current_item,
  1335.             (UI_string_type) two_line_string_data,
  1336.             &image_data,
  1337.             &thumbnail))
  1338.     {
  1339.         return;
  1340.     }
  1341.     if (current_menu_item_properties.image_flags)
  1342.     {
  1343.         thumbnail_area_width = thumbnail_area_height = two_line_horizontal_select_menuitem.height << 1;
  1344.         width_for_horizontal_select = two_line_horizontal_select_menuitem.width - thumbnail_area_width;
  1345.         if (current_menu_item_properties.image_flags & UI_TWO_LINE_MENUITEM_LEFT_ALIGN_THUMBNAIL)
  1346.         {
  1347.             x1 = two_line_horizontal_select_menuitem.x + thumbnail_area_width;
  1348.             y1 = two_line_horizontal_select_menuitem.y;
  1349.             x2 = x1 + width_for_horizontal_select;
  1350.             y2 = y1 + two_line_horizontal_select_menuitem.height - 1;
  1351.             thumb_x = two_line_horizontal_select_menuitem.x;
  1352.             thumb_y = two_line_horizontal_select_menuitem.y - two_line_horizontal_select_menuitem.height + 1;
  1353.             thumb_height = thumb_width = thumbnail_area_width - (THUMBNAIL_GAP_FROM_SIDES << 1);
  1354.         }
  1355.         else if (current_menu_item_properties.image_flags & UI_TWO_LINE_MENUITEM_RIGHT_ALIGN_THUMBNAIL)
  1356.         {
  1357.             x1 = two_line_horizontal_select_menuitem.x;
  1358.             y1 = two_line_horizontal_select_menuitem.y;
  1359.             x2 = x1 + width_for_horizontal_select;
  1360.             y2 = y1 + two_line_horizontal_select_menuitem.height - 1;
  1361.             thumb_x = x2 + (THUMBNAIL_GAP_FROM_SIDES << 1);
  1362.             thumb_y = two_line_horizontal_select_menuitem.y - two_line_horizontal_select_menuitem.height + 1;
  1363.             /* thumb_width=thumbnail_area_width; */
  1364.             thumb_width = thumb_height = thumbnail_area_height - (THUMBNAIL_GAP_FROM_SIDES << 1);
  1365.         }
  1366.     }
  1367.     else
  1368.     {
  1369.         x1 = two_line_horizontal_select_menuitem.x;
  1370.         y1 = two_line_horizontal_select_menuitem.y;
  1371.         x2 = x1 + two_line_horizontal_select_menuitem.width - 1;
  1372.         y2 = y1 + two_line_horizontal_select_menuitem.height - 1;
  1373.         width_for_horizontal_select = two_line_horizontal_select_menuitem.width;
  1374.     }
  1375.     left_arrow = get_image(LEFT_RED_ARROW);
  1376.     right_arrow = get_image(RIGHT_RED_ARROW);
  1377.     gui_measure_image(left_arrow, &width, &height);
  1378. #ifdef __MMI_TOUCH_SCREEN__
  1379.     mmi_menuitem_left_arrow.width = width;
  1380.     mmi_menuitem_left_arrow.height = height;
  1381. #endif /* __MMI_TOUCH_SCREEN__ */
  1382.     lx = 2;
  1383.     text_x = lx + width + 2;
  1384.     ly = (two_line_horizontal_select_menuitem.height >> 1) - (height >> 1);
  1385.     gui_measure_image(right_arrow, &width, &height);
  1386. #ifdef __MMI_TOUCH_SCREEN__
  1387.     mmi_menuitem_right_arrow.width = width;
  1388.     mmi_menuitem_right_arrow.height = height;
  1389. #endif /* __MMI_TOUCH_SCREEN__ */
  1390.     rx = width_for_horizontal_select - width - 2;
  1391.     text_end_x = rx;
  1392.     ry = (two_line_horizontal_select_menuitem.height >> 1) - (height >> 1);
  1393.     gui_measure_image(right_arrow, &width, &height);
  1394.     gui_push_clip();
  1395.     gui_push_text_clip();
  1396.     gui_set_clip(x1, y1, x2, y2);
  1397. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1398.     if (!gui_is_current_transparency_with_multi_layer())
  1399.     {
  1400.         gui_fixed_icontext_disable_transparent_effect(&MMI_fixed_icontext_menuitem);    /* To hide text below scrolling text */
  1401.     }
  1402. #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
  1403.     gui_draw_filled_area(x1 + 1, y1, x2, y2, MMI_fixed_icontext_menuitem.focussed_filler);
  1404. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  1405.     gui_fixed_icontext_enable_transparent_effect(&MMI_fixed_icontext_menuitem); /* To hide text below scrolling text */
  1406. #endif 
  1407.     if (two_line_horizontal_select_menuitem.no_of_items > 1)
  1408.     {
  1409.         gui_show_transparent_image(x1 + lx, y1 + ly, left_arrow, 0);
  1410.         gui_show_transparent_image(x1 + rx, y1 + ry, right_arrow, 0);
  1411.     #ifdef __MMI_TOUCH_SCREEN__
  1412.         mmi_menuitem_left_arrow.x = x1 + lx;
  1413.         mmi_menuitem_left_arrow.y = y1 + ly;
  1414.         mmi_menuitem_right_arrow.x = x1 + rx;
  1415.         mmi_menuitem_right_arrow.y = y1 + ry;
  1416.     #endif /* __MMI_TOUCH_SCREEN__ */
  1417.     }
  1418.     else
  1419.     {
  1420.         text_x = lx = width = 0;
  1421.         text_end_x = rx = width_for_horizontal_select - 2;
  1422.     #ifdef __MMI_TOUCH_SCREEN__
  1423.         mmi_menuitem_left_arrow.x = 0;
  1424.         mmi_menuitem_left_arrow.y = 0;
  1425.         mmi_menuitem_left_arrow.width = 0;
  1426.         mmi_menuitem_left_arrow.height = 0;
  1427.         mmi_menuitem_right_arrow.x = 0;
  1428.         mmi_menuitem_right_arrow.x = 0;
  1429.         mmi_menuitem_right_arrow.x = 0;
  1430.         mmi_menuitem_right_arrow.x = 0;
  1431.     #endif /* __MMI_TOUCH_SCREEN__ */
  1432.     }
  1433.     if (image_data)
  1434.     {
  1435.         ix = lx + width + 2;
  1436.         gui_measure_image(image_data, &width, &height);
  1437.         iy = (two_line_horizontal_select_menuitem.height >> 1) - (height >> 1);
  1438.         if (!r2lMMIFlag)
  1439.         {
  1440.             text_x = ix + width + 4;
  1441.             gui_show_transparent_image(x1 + ix, y1 + iy, image_data, 0);
  1442.         }
  1443.         else
  1444.         {
  1445.             gui_show_transparent_image(x1 + text_end_x - width, y1 + iy, image_data, 0);
  1446.             text_end_x = text_end_x - width - 4;
  1447.         }
  1448.     }
  1449.     gui_set_text_clip(x1, y1, x2, y2);
  1450.     gui_set_font(MMI_fixed_icontext_menuitem.text_font);
  1451.     gui_measure_string((UI_string_type) two_line_string_data, &sw, &sh);
  1452.     text_y = (two_line_horizontal_select_menuitem.height >> 1) - (sh >> 1);
  1453.     gui_set_text_color(MMI_fixed_icontext_menuitem.focussed_text_color);
  1454.     if (sw < text_end_x - text_x - 1)
  1455.     {
  1456.         if (!r2lMMIFlag)
  1457.         {
  1458.             gui_move_text_cursor(x1 + text_x, y1 + text_y);
  1459.         }
  1460.         else
  1461.         {
  1462.             if (HaveThaiCharacter((UI_string_type) two_line_string_data))
  1463.             {
  1464.                 gui_move_text_cursor(x1 + text_end_x - sw, y1 + text_y);
  1465.             }
  1466.             else
  1467.             {
  1468.                 gui_move_text_cursor(x1 + text_end_x, y1 + text_y);
  1469.             }
  1470.         }
  1471.         gui_print_text((UI_string_type) two_line_string_data);
  1472.     }
  1473.     else
  1474.     {
  1475.         gui_create_scrolling_text(
  1476.             &wgui_two_line_scroll_text,
  1477.             x1 + text_x,
  1478.             y1 + text_y,
  1479.             text_end_x - text_x - 1,
  1480.             sh + 1,
  1481.             (UI_string_type) two_line_string_data,
  1482.             two_line_scrolling_text_timer_handler,
  1483.             wgui_scrolling_text_draw_two_line_background,
  1484.             MMI_fixed_icontext_menuitem.focussed_text_color,
  1485.             MMI_fixed_icontext_menuitem.focussed_text_color);
  1486.         gui_show_scrolling_text(&wgui_two_line_scroll_text);
  1487.     }
  1488.     gui_pop_text_clip();
  1489.     gui_pop_clip();
  1490.     if (current_menu_item_properties.image_flags & UI_TWO_LINE_MENUITEM_THUMBNAIL_IS_ID)
  1491.     {
  1492.         PU8 thumbmeasure;
  1493.         S32 tw, th;
  1494.         gui_push_clip();
  1495.         gui_set_clip(thumb_x - THUMBNAIL_GAP_FROM_SIDES, thumb_y, thumb_x + thumb_width, thumb_y + thumb_height);
  1496.         thumbmeasure = (PU8) GetImage(thumbnail.id);
  1497.         gui_measure_image(thumbmeasure, &tw, &th);
  1498.         if (tw > thumb_width && th > thumb_height)
  1499.         {
  1500.             ret_val_resize = gdi_image_draw_resized_id(
  1501.                                 thumb_x,
  1502.                                 thumb_y + THUMBNAIL_GAP_FROM_SIDES,
  1503.                                 thumb_width,
  1504.                                 thumb_height,
  1505.                                 thumbnail.id);
  1506.         }
  1507.         else
  1508.         {
  1509.             S32 start_x, start_y;
  1510.             start_x = thumb_x + ((thumb_width - tw) >> 1);
  1511.             start_y = thumb_y + ((thumb_height - th) >> 1);
  1512.             ret_val_resize = gdi_image_draw_resized_id(start_x, start_y + THUMBNAIL_GAP_FROM_SIDES, tw, th, thumbnail.id);
  1513.         }
  1514.         gui_pop_clip();
  1515.     }
  1516.     else if (current_menu_item_properties.image_flags & UI_TWO_LINE_MENUITEM_THUMBNAIL_IS_FILE)
  1517.     {
  1518.         S32 tw, th;
  1519.         gui_push_clip();
  1520.         gui_set_clip(thumb_x - THUMBNAIL_GAP_FROM_SIDES, thumb_y, thumb_x + thumb_width, thumb_y + thumb_height);
  1521.         gdi_image_get_dimension_file(thumbnail.path, &tw, &th);
  1522.         if (tw > thumb_width && th > thumb_height)
  1523.         {
  1524.             ret_val_resize = gdi_image_draw_resized_file(
  1525.                                 thumb_x,
  1526.                                 thumb_y + THUMBNAIL_GAP_FROM_SIDES,
  1527.                                 thumb_width,
  1528.                                 thumb_height,
  1529.                                 thumbnail.path);
  1530.         }
  1531.         else
  1532.         {
  1533.             S32 start_x, start_y;
  1534.             start_x = thumb_x + ((thumb_width - tw) >> 1);
  1535.             start_y = thumb_y + ((thumb_height - th) >> 1);
  1536.             ret_val_resize = gdi_image_draw_resized_file(start_x, start_y + THUMBNAIL_GAP_FROM_SIDES, tw, th, thumbnail.path);
  1537.         }
  1538.         gui_pop_clip();
  1539.     }
  1540.     if (ret_val_resize != GDI_SUCCEED)
  1541.     {
  1542.         /* Draw wire frame */
  1543.         gui_draw_vertical_line(
  1544.             thumb_y + THUMBNAIL_GAP_FROM_SIDES,
  1545.             thumb_y + thumb_height,
  1546.             thumb_x,
  1547.             MMI_fixed_icontext_menuitem.normal_text_color);
  1548.         gui_draw_vertical_line(
  1549.             thumb_y + THUMBNAIL_GAP_FROM_SIDES,
  1550.             thumb_y + thumb_height,
  1551.             thumb_x - THUMBNAIL_GAP_FROM_SIDES + thumb_width,
  1552.             MMI_fixed_icontext_menuitem.normal_text_color);
  1553.         gui_draw_horizontal_line(
  1554.             thumb_x,
  1555.             thumb_x - THUMBNAIL_GAP_FROM_SIDES + thumb_width,
  1556.             thumb_y + THUMBNAIL_GAP_FROM_SIDES,
  1557.             MMI_fixed_icontext_menuitem.normal_text_color);
  1558.         gui_draw_horizontal_line(
  1559.             thumb_x,
  1560.             thumb_x - THUMBNAIL_GAP_FROM_SIDES + thumb_width,
  1561.             thumb_y + thumb_height,
  1562.             MMI_fixed_icontext_menuitem.normal_text_color);
  1563.     }
  1564. }
  1565. /*****************************************************************************
  1566.  * FUNCTION
  1567.  *  wgui_complete_two_line_horizontal_select
  1568.  * DESCRIPTION
  1569.  *  This called when user moves away from horizontal select
  1570.  * PARAMETERS
  1571.  *  void
  1572.  * RETURNS
  1573.  *  void
  1574.  *****************************************************************************/
  1575. void wgui_complete_two_line_horizontal_select(void)
  1576. {
  1577.     /*----------------------------------------------------------------*/
  1578.     /* Local Variables                                                */
  1579.     /*----------------------------------------------------------------*/
  1580.     /*----------------------------------------------------------------*/
  1581.     /* Code Body                                                      */
  1582.     /*----------------------------------------------------------------*/
  1583.     ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_UP);
  1584.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1585.     ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1586.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1587.     gui_scrolling_text_stop(&wgui_two_line_scroll_text);
  1588.     if (two_line_horizontal_select_menuitem.two_line_select_complete)
  1589.     {
  1590.         two_line_horizontal_select_menuitem.two_line_select_complete(
  1591.                                                 MMI_fixed_list_menu.highlighted_item,
  1592.                                                 two_line_horizontal_select_menuitem.current_item);
  1593.     }
  1594. }
  1595. /*****************************************************************************
  1596.  * FUNCTION
  1597.  *  wgui_two_line_horizontal_select_move_next_item
  1598.  * DESCRIPTION
  1599.  *  This is called when users presses right arraw key on horizontal select
  1600.  * PARAMETERS
  1601.  *  void
  1602.  * RETURNS
  1603.  *  void
  1604.  *****************************************************************************/
  1605. void wgui_two_line_horizontal_select_move_next_item(void)
  1606. {
  1607.     /*----------------------------------------------------------------*/
  1608.     /* Local Variables                                                */
  1609.     /*----------------------------------------------------------------*/
  1610.     /*----------------------------------------------------------------*/
  1611.     /* Code Body                                                      */
  1612.     /*----------------------------------------------------------------*/
  1613.     gui_scrolling_text_stop(&wgui_two_line_scroll_text);
  1614.     if (two_line_horizontal_select_menuitem.current_item == two_line_horizontal_select_menuitem.no_of_items - 1)
  1615.     {
  1616.         two_line_horizontal_select_menuitem.current_item = 0;
  1617.     }
  1618.     else
  1619.     {
  1620.         two_line_horizontal_select_menuitem.current_item++;
  1621.     }
  1622.     wgui_show_two_line_horizontal_select();
  1623.     gui_BLT_double_buffer(
  1624.         two_line_horizontal_select_menuitem.x,
  1625.         two_line_horizontal_select_menuitem.y,
  1626.         two_line_horizontal_select_menuitem.x + two_line_horizontal_select_menuitem.width - 1,
  1627.         two_line_horizontal_select_menuitem.y + two_line_horizontal_select_menuitem.height - 1);
  1628.     return;
  1629. }
  1630. /*****************************************************************************
  1631.  * FUNCTION
  1632.  *  wgui_two_line_horizontal_select_move_previous_item
  1633.  * DESCRIPTION
  1634.  *  This is called when users presses left arraw key on horizontal select
  1635.  * PARAMETERS
  1636.  *  void
  1637.  * RETURNS
  1638.  *  void
  1639.  *****************************************************************************/
  1640. void wgui_two_line_horizontal_select_move_previous_item(void)
  1641. {
  1642.     /*----------------------------------------------------------------*/
  1643.     /* Local Variables                                                */
  1644.     /*----------------------------------------------------------------*/
  1645.     /*----------------------------------------------------------------*/
  1646.     /* Code Body                                                      */
  1647.     /*----------------------------------------------------------------*/
  1648.     gui_scrolling_text_stop(&wgui_two_line_scroll_text);
  1649.     if (two_line_horizontal_select_menuitem.current_item == 0)
  1650.     {
  1651.         two_line_horizontal_select_menuitem.current_item = two_line_horizontal_select_menuitem.no_of_items - 1;
  1652.     }
  1653.     else
  1654.     {
  1655.         two_line_horizontal_select_menuitem.current_item--;
  1656.     }
  1657.     wgui_show_two_line_horizontal_select();
  1658.     gui_BLT_double_buffer(
  1659.         two_line_horizontal_select_menuitem.x,
  1660.         two_line_horizontal_select_menuitem.y,
  1661.         two_line_horizontal_select_menuitem.x + two_line_horizontal_select_menuitem.width - 1,
  1662.         two_line_horizontal_select_menuitem.y + two_line_horizontal_select_menuitem.height - 1);
  1663.     return;
  1664. }
  1665. /*****************************************************************************
  1666.  * FUNCTION
  1667.  *  get_two_line_menuitem_height
  1668.  * DESCRIPTION
  1669.  *  This is the callback regsitered for getting whether the current item is two line in case of fixed list
  1670.  * PARAMETERS
  1671.  *  void
  1672.  * RETURNS
  1673.  *  TRUE/FALSE
  1674.  *****************************************************************************/
  1675. pBOOL get_two_line_menuitem_height(void)
  1676. {
  1677.     /*----------------------------------------------------------------*/
  1678.     /* Local Variables                                                */
  1679.     /*----------------------------------------------------------------*/
  1680.     /*----------------------------------------------------------------*/
  1681.     /* Code Body                                                      */
  1682.     /*----------------------------------------------------------------*/
  1683.     if (get_current_menu_item_displaystyle && get_current_menu_item_displaystyle(MMI_fixed_list_menu.highlighted_item))
  1684.     {
  1685.         return 1;
  1686.     }
  1687.     return 0;
  1688. }
  1689. two_line_dynamic_menuitem_style two_line_display_asyncdynamic_menuitem_callback;
  1690. /*****************************************************************************
  1691.  * FUNCTION
  1692.  *  get_two_line_asyncdynamic_menuitem_height
  1693.  * DESCRIPTION
  1694.  *  This is the callback regsitered for getting whether the current item is two line in case of asyncdynamic list
  1695.  * PARAMETERS
  1696.  *  void
  1697.  * RETURNS
  1698.  *  TRUE/FALSE
  1699.  *****************************************************************************/
  1700. pBOOL get_two_line_asyncdynamic_menuitem_height(void)
  1701. {
  1702.     /*----------------------------------------------------------------*/
  1703.     /* Local Variables                                                */
  1704.     /*----------------------------------------------------------------*/
  1705.     S32 index, menuitem_index;
  1706.     /*----------------------------------------------------------------*/
  1707.     /* Code Body                                                      */
  1708.     /*----------------------------------------------------------------*/
  1709.     if (current_fixed_list_menuitem_display_index == -1)
  1710.     {
  1711.         index = MMI_fixed_list_menu.highlighted_item;
  1712.         menuitem_index = (index - asyncdynamic_item_buffer.head_item_index +
  1713.                           asyncdynamic_item_buffer.head) & MASK_ASYNCDYNAMIC_ITEMS_BUFF;
  1714.         if (two_line_display_asyncdynamic_menuitem_callback)
  1715.         {
  1716.             if (two_line_display_asyncdynamic_menuitem_callback(index, menuitem_index))
  1717.             {
  1718.                 gui_get_two_line_menuitem_height = get_two_line_asyncdynamic_menuitem_height;
  1719.                 return 1;
  1720.             }
  1721.             else
  1722.             {
  1723.                 return 0;
  1724.             }
  1725.         }
  1726.         else
  1727.         {
  1728.             return 0;
  1729.         }
  1730.     }
  1731.     else
  1732.     {
  1733.         return 0;
  1734.     }
  1735. }
  1736. /*****************************************************************************
  1737.  * FUNCTION
  1738.  *  set_two_line_display_for_asyncdynamic_menus
  1739.  * DESCRIPTION
  1740.  *  This is function which needs to be called from application to set the callback for getting disply style in case of asyncdynamic menus
  1741.  * PARAMETERS
  1742.  *  callback        [IN]        
  1743.  * RETURNS
  1744.  *  TRUE/FALSE(?)
  1745.  *****************************************************************************/
  1746. void set_two_line_display_for_asyncdynamic_menus(two_line_dynamic_menuitem_style callback)
  1747. {
  1748.     /*----------------------------------------------------------------*/
  1749.     /* Local Variables                                                */
  1750.     /*----------------------------------------------------------------*/
  1751.     /*----------------------------------------------------------------*/
  1752.     /* Code Body                                                      */
  1753.     /*----------------------------------------------------------------*/
  1754.     two_line_display_asyncdynamic_menuitem_callback = callback;
  1755.     gui_get_two_line_menuitem_height = get_two_line_asyncdynamic_menuitem_height;
  1756. }
  1757. two_line_dynamic_menuitem_style two_line_display_dynamic_menuitem_callback;
  1758. /*****************************************************************************
  1759.  * FUNCTION
  1760.  *  get_two_line_dynamic_menuitem_height
  1761.  * DESCRIPTION
  1762.  *  This is the callback regsitered for getting whether the current item is two line in case of dynamic list
  1763.  * PARAMETERS
  1764.  *  void
  1765.  * RETURNS
  1766.  *  TRUE/FALSE
  1767.  *****************************************************************************/
  1768. pBOOL get_two_line_dynamic_menuitem_height(void)
  1769. {
  1770.     /*----------------------------------------------------------------*/
  1771.     /* Local Variables                                                */
  1772.     /*----------------------------------------------------------------*/
  1773.     S32 index, menuitem_index;
  1774.     /*----------------------------------------------------------------*/
  1775.     /* Code Body                                                      */
  1776.     /*----------------------------------------------------------------*/
  1777.     if (current_fixed_list_menuitem_display_index == -1)
  1778.     {
  1779.         index = MMI_fixed_list_menu.highlighted_item;
  1780.         menuitem_index = (index - dynamic_item_buffer.head_item_index +
  1781.                           dynamic_item_buffer.head) & MASK_DYNAMIC_ITEMS_BUFF;
  1782.         if (two_line_display_dynamic_menuitem_callback)
  1783.         {
  1784.             if (two_line_display_dynamic_menuitem_callback(index, menuitem_index))
  1785.             {
  1786.                 gui_get_two_line_menuitem_height = get_two_line_dynamic_menuitem_height;
  1787.                 return 1;
  1788.             }
  1789.             else
  1790.             {
  1791.                 return 0;
  1792.             }
  1793.         }
  1794.         else
  1795.         {
  1796.             return 0;
  1797.         }
  1798.     }
  1799.     else
  1800.     {
  1801.         return 0;
  1802.     }
  1803. }
  1804. /*****************************************************************************
  1805.  * FUNCTION
  1806.  *  set_two_line_display_for_dynamic_menus
  1807.  * DESCRIPTION
  1808.  *  This is function which needs to be called from application to set the callback for getting disply style in case of dynamic menus
  1809.  * PARAMETERS
  1810.  *  callback        [IN]        
  1811.  * RETURNS
  1812.  *  TRUE/FALSE(?)
  1813.  *****************************************************************************/
  1814. void set_two_line_display_for_dynamic_menus(two_line_dynamic_menuitem_style callback)
  1815. {
  1816.     /*----------------------------------------------------------------*/
  1817.     /* Local Variables                                                */
  1818.     /*----------------------------------------------------------------*/
  1819.     /*----------------------------------------------------------------*/
  1820.     /* Code Body                                                      */
  1821.     /*----------------------------------------------------------------*/
  1822.     two_line_display_dynamic_menuitem_callback = callback;
  1823.     gui_get_two_line_menuitem_height = get_two_line_dynamic_menuitem_height;
  1824. }
  1825. #endif /* defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */ 
  1826. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  1827. /*****************************************************************************
  1828.  * FUNCTION
  1829.  *  gui_disable_scroller_for_hints
  1830.  * DESCRIPTION
  1831.  *  
  1832.  * PARAMETERS
  1833.  *  void
  1834.  * RETURNS
  1835.  *  void
  1836.  *****************************************************************************/
  1837. void gui_disable_scroller_for_hints(void)
  1838. {
  1839.     /*----------------------------------------------------------------*/
  1840.     /* Local Variables                                                */
  1841.     /*----------------------------------------------------------------*/
  1842.     /*----------------------------------------------------------------*/
  1843.     /* Code Body                                                      */
  1844.     /*----------------------------------------------------------------*/
  1845.     gui_scrolling_text_stop(&wgui_two_line_scroll_text);
  1846.     gui_reset_current_two_line_menuitem_data = UI_dummy_reset_current_two_line_menuitem_data;
  1847. }
  1848. /*****************************************************************************
  1849.  * FUNCTION
  1850.  *  gui_show_two_line_hint_part
  1851.  * DESCRIPTION
  1852.  *  
  1853.  * PARAMETERS
  1854.  *  hint_x1         [IN]        
  1855.  *  hint_x2         [IN]        
  1856.  *  hint_y1         [IN]        
  1857.  *  hint_y2         [IN]        
  1858.  *  _hint_text      [IN]        
  1859.  *  flags           [IN]        
  1860.  * RETURNS
  1861.  *  void
  1862.  *****************************************************************************/
  1863. void gui_show_two_line_hint_part(
  1864.         S32 hint_x1,
  1865.         S32 hint_x2,
  1866.         S32 hint_y1,
  1867.         S32 hint_y2,
  1868.         UI_string_type _hint_text,
  1869.         U32 flags)
  1870. {
  1871.     /*----------------------------------------------------------------*/
  1872.     /* Local Variables                                                */
  1873.     /*----------------------------------------------------------------*/
  1874.     S32 sw, sh;
  1875.     /*----------------------------------------------------------------*/
  1876.     /* Code Body                                                      */
  1877.     /*----------------------------------------------------------------*/
  1878.     gui_reset_current_two_line_menuitem_data = gui_disable_scroller_for_hints;
  1879.     gui_push_text_clip();
  1880.     gui_set_text_clip(hint_x1, hint_y1, hint_x2, hint_y2);
  1881.     gui_set_font(MMI_fixed_icontext_menuitem.text_font);
  1882.     gui_measure_string(_hint_text, &sw, &sh);
  1883.     hint_y1 += ((hint_y2 - hint_y1) >> 1) - (sh >> 1);  /* Center Vertically */
  1884.     /* gui_set_text_color(MMI_fixed_icontext_menuitem.focussed_text_color); */
  1885.     if (sw < hint_x2 - hint_x1 - 1 || (!(flags & UI_MENUITEM_STATE_FOCUSSED)))
  1886.     {
  1887.         if (!r2lMMIFlag)
  1888.         {
  1889.             gui_move_text_cursor(hint_x1, hint_y1);
  1890.         }
  1891.         else
  1892.         {
  1893.             gui_move_text_cursor(hint_x2, hint_y1);
  1894.         }
  1895.         gui_print_text((UI_string_type) _hint_text);
  1896.     }
  1897.     else
  1898.     {
  1899.         gui_create_scrolling_text(
  1900.             &wgui_two_line_scroll_text,
  1901.             hint_x1,
  1902.             hint_y1,
  1903.             hint_x2 - hint_x1,
  1904.             sh + 1,
  1905.             (UI_string_type) _hint_text,
  1906.             two_line_scrolling_text_timer_handler,
  1907.             wgui_scrolling_text_draw_two_line_background,
  1908.             MMI_fixed_icontext_menuitem.focussed_text_color,
  1909.             MMI_fixed_icontext_menuitem.focussed_text_color);
  1910.         gui_show_scrolling_text(&wgui_two_line_scroll_text);
  1911.     }
  1912.     gui_pop_text_clip();
  1913. }
  1914. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  1915. /*****************************************************************************
  1916.  * FUNCTION
  1917.  *  wgui_two_line_disable_complete_callback
  1918.  * DESCRIPTION
  1919.  *  
  1920.  * PARAMETERS
  1921.  *  void
  1922.  * RETURNS
  1923.  *  void
  1924.  *****************************************************************************/
  1925. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  1926. static BOOL wgui_two_line_disable_complete_callback_flag = TRUE;
  1927. void wgui_two_line_disable_complete_callback(void)
  1928. {
  1929.     /*----------------------------------------------------------------*/
  1930.     /* Local Variables                                                */
  1931.     /*----------------------------------------------------------------*/
  1932.     /*----------------------------------------------------------------*/
  1933.     /* Code Body                                                      */
  1934.     /*----------------------------------------------------------------*/
  1935.     wgui_two_line_disable_complete_callback_flag = FALSE;
  1936. }
  1937. #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */ 
  1938. /*****************************************************************************
  1939.  * FUNCTION
  1940.  *  wgui_two_line_stop_scroller
  1941.  * DESCRIPTION
  1942.  *  This function is used to stop the scroll timer.
  1943.  * PARAMETERS
  1944.  *  void
  1945.  * RETURNS
  1946.  *  void
  1947.  *****************************************************************************/
  1948. #if (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__)
  1949. void wgui_two_line_stop_scroller(void)
  1950. {
  1951. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  1952.     /*----------------------------------------------------------------*/
  1953.     /* Local Variables                                                */
  1954.     /*----------------------------------------------------------------*/
  1955.     /*----------------------------------------------------------------*/
  1956.     /* Code Body                                                      */
  1957.     /*----------------------------------------------------------------*/
  1958.     if (!wgui_two_line_disable_complete_callback_flag)
  1959.     {
  1960.         wgui_two_line_disable_complete_callback_flag = TRUE;
  1961.         return;
  1962.     }
  1963. #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */ 
  1964.     gui_scrolling_text_stop(&wgui_two_line_scroll_text);
  1965. #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
  1966.     if (two_line_level_select_menuitem.two_line_select_complete)
  1967.     {
  1968.         two_line_level_select_menuitem.two_line_select_complete(
  1969.                                         MMI_fixed_list_menu.highlighted_item,
  1970.                                         two_line_level_select_menuitem.current_item);
  1971.     }
  1972.     if (two_line_horizontal_select_menuitem.two_line_select_complete)
  1973.     {
  1974.         two_line_horizontal_select_menuitem.two_line_select_complete(
  1975.                                                 MMI_fixed_list_menu.highlighted_item,
  1976.                                                 two_line_horizontal_select_menuitem.current_item);
  1977.     }
  1978. #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */ 
  1979.     gui_two_line_scroller_stop();
  1980. }
  1981. #endif /* (defined __MMI_UI_TWO_LINE_MENUITEM_STYLES__ || defined __MMI_UI_HINTS_IN_MENUITEM__) */ 
  1982. #if defined(__MMI_UI_TWO_LINE_MENUITEM_STYLES__) && defined(__MMI_TOUCH_SCREEN__)
  1983. /*****************************************************************************
  1984.  * FUNCTION
  1985.  *  mmi_two_line_translate_pen_event
  1986.  * DESCRIPTION
  1987.  *  
  1988.  * PARAMETERS
  1989.  *  x               [IN]
  1990.  *  y               [IN]
  1991.  *  pen_event       [IN]
  1992.  *  menuitem_event  [OUT]
  1993.  * RETURNS
  1994.  *  void
  1995.  *****************************************************************************/
  1996. /* FIXME. This functinon should not be called from underlying gui layer. */
  1997. void mmi_two_line_translate_pen_event(S32 x, S32 y, mmi_pen_event_type_enum pen_event,gui_list_pen_enum *menuitem_event)
  1998. {
  1999.     if(PEN_CHECK_BOUND(
  2000.         x,
  2001.         y,
  2002.         mmi_menuitem_left_arrow.x,
  2003.         mmi_menuitem_left_arrow.y,
  2004.         mmi_menuitem_left_arrow.width,
  2005.         mmi_menuitem_left_arrow.height))
  2006.     {
  2007.         *menuitem_event = GUI_LIST_PEN_TWO_LINE_PREVIOUS;
  2008.     }
  2009.     else if(PEN_CHECK_BOUND(
  2010.                 x,
  2011.                 y,
  2012.                 mmi_menuitem_right_arrow.x,
  2013.                 mmi_menuitem_right_arrow.y,
  2014.                 mmi_menuitem_right_arrow.width,
  2015.                 mmi_menuitem_right_arrow.height))
  2016.     {
  2017.      *menuitem_event = GUI_LIST_PEN_TWO_LINE_NEXT;
  2018.     }
  2019. }
  2020. #endif /* defined(__MMI_UI_TWO_LINE_MENUITEM_STYLES__) && defined(__MMI_TOUCH_SCREEN__) */