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

MTK

开发平台:

C/C++

  1. /*******************************************************************************
  2. *  Modification Notice:
  3. *  --------------------------
  4. *  This software is modified by MediaTek Inc. and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *******************************************************************************/
  35.  /*******************************************************************************
  36.  * Filename:
  37.  * ---------
  38.  *   wgui_softkeys.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   Maui_Software
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *  softkey related funtions
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  *
  52.  *------------------------------------------------------------------------------
  53.  * $Log$
  54.  *
  55.  * removed!
  56.  * removed!
  57.  * 
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * 
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * 
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * 
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * 
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * 
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * 
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * 
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * 
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * 
  94.  *
  95.  *******************************************************************************/
  96. /**
  97.  * Copyright Notice
  98.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  99.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  100.  *  (It is illegal to remove this copyright notice from this software or any
  101.  *  portion of it)
  102.  */
  103. /**********************************************************************************
  104.    Filename:      wgui_softkeys.c
  105.    Author:        manju
  106.    Date Created:  August-07-2002
  107.    Contains:      PixTel UI wrapper routines for Softkeys
  108. **********************************************************************************/
  109. #include "MMI_features.h"
  110. #include "wgui_softkeys.h"
  111. #include "gui_themes.h"
  112. #include "FrameworkStruct.h"
  113. #include "DebugInitDef.h"
  114. #include "gdi_include.h"
  115. #include "wgui_status_icons.h"//061506 double buffer
  116. /* Globals                 */
  117. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  118. U8 is_button_bar_shuffled = 0;
  119. extern MMI_white_color;
  120. void (*pixtel_shuffle_draw_background) (void);
  121. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  122. /* softkey width */
  123. S32 MMI_softkey_width = MMI_SOFTKEY_WIDTH;
  124. /* softkey height */
  125. S32 MMI_softkey_height = MMI_SOFTKEY_HEIGHT;
  126. /* Softkey wrappers        */
  127. icontext_button MMI_softkeys[WGUI_MAX_SOFTKEYS];
  128. #define  MMI_left_softkey  MMI_softkeys[MMI_LEFT_SOFTKEY]
  129. #define  MMI_right_softkey MMI_softkeys[MMI_RIGHT_SOFTKEY]
  130. #ifdef __MMI_WGUI_CSK_ENABLE__
  131. #define  MMI_center_softkey   MMI_softkeys[MMI_CENTER_SOFTKEY]
  132. #endif 
  133. /* LSK key handler */
  134. U8 left_softkey_keyboard_handler_active = 0;
  135. /* RSKk key handler */
  136. U8 right_softkey_keyboard_handler_active = 0;
  137. #ifdef __MMI_WGUI_CSK_ENABLE__
  138. /* CSK key handler */
  139. U8 center_softkey_keyboard_handler_active = 0;
  140. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  141. #define  WGUI_MAX_SOFTKEY_FUNCTIONS 3
  142. void (*softkey_functions[WGUI_MAX_SOFTKEYS][WGUI_MAX_SOFTKEY_FUNCTIONS]) (void);
  143. #define           left_softkey_functions  softkey_functions[MMI_LEFT_SOFTKEY]
  144. #define           right_softkey_functions    softkey_functions[MMI_RIGHT_SOFTKEY]
  145. #define           center_softkey_functions      softkey_functions[MMI_CENTER_SOFTKEY]
  146. /* Functions to hide softkeys */
  147. void (*hide_softkey[WGUI_MAX_SOFTKEYS]) (void);
  148. #ifdef __MMI_T9__
  149. extern void (*t9_inputbox_LSK_function) (void);
  150. #endif 
  151. void softkey_keyboard_handler(S32 vkey_code, S32 key_state);
  152. extern UI_string_type get_string(MMI_ID_TYPE i);
  153. extern PU8 get_image(MMI_ID_TYPE i);
  154. /*****************************************************************************
  155.  * FUNCTION
  156.  *  clear_softkey_button_background_callback
  157.  * DESCRIPTION
  158.  *  Clear the background of softkey. Used of callback function in icontext_button.clear_background_fp
  159.  * PARAMETERS
  160.  *  button_object       [IN]        The target button
  161.  * RETURNS
  162.  *  void
  163.  *****************************************************************************/
  164. void clear_softkey_button_background_callback(void *button_object)
  165. {
  166.     /*----------------------------------------------------------------*/
  167.     /* Local Variables                                                */
  168.     /*----------------------------------------------------------------*/
  169.     S32 i;
  170.     /*----------------------------------------------------------------*/
  171.     /* Code Body                                                      */
  172.     /*----------------------------------------------------------------*/
  173.     for (i = 0; i < WGUI_MAX_SOFTKEYS; i++)
  174.     {
  175.         if (button_object == (void*)&MMI_softkeys[i])
  176.         {
  177.             (hide_softkey[i]) ();
  178.             return;
  179.         }
  180.     }
  181.     MMI_DBG_ASSERT(0);
  182. }
  183. /*****************************************************************************
  184.  * FUNCTION
  185.  *  create_softkeys
  186.  * DESCRIPTION
  187.  *  Creates and set default value of softkeys
  188.  * PARAMETERS
  189.  *  void
  190.  * RETURNS
  191.  *  void
  192.  *****************************************************************************/
  193. void create_softkeys(void)
  194. {
  195.     /*----------------------------------------------------------------*/
  196.     /* Local Variables                                                */
  197.     /*----------------------------------------------------------------*/
  198.     U8 i = 0, key = 0;
  199.     /*----------------------------------------------------------------*/
  200.     /* Code Body                                                      */
  201.     /*----------------------------------------------------------------*/
  202.     /* set theme of LSK */
  203.     set_MMI_LSK_theme();
  204.     /* careate button */
  205.     gui_create_icontext_button(
  206.         &MMI_softkeys[MMI_LEFT_SOFTKEY],
  207.         0,
  208.         UI_device_height - MMI_softkey_height,
  209.         MMI_softkey_width,
  210.         MMI_softkey_height,
  211.         NULL,
  212.         NULL);
  213. #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)
  214. #if defined(__MMI_UI_TECHNO_SOFTKEYS__)
  215.     MMI_softkeys[MMI_LEFT_SOFTKEY].flags |=
  216.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_LEFT_ALIGN | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_TEXT_X |
  217.          UI_BUTTON_CENTER_ICON_Y | UI_BUTTON_ALIGN_ICON_TEXT);
  218. #elif defined(__MMI_UI_DALMATIAN_SOFTKEYS__)
  219.     MMI_softkeys[MMI_LEFT_SOFTKEY].flags |=
  220.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_TEXT_X | UI_BUTTON_CENTER_ICON_Y |
  221.          UI_BUTTON_ALIGN_ICON_TEXT);
  222. #else 
  223.     MMI_softkeys[MMI_LEFT_SOFTKEY].flags |=
  224.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_LEFT_ALIGN | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_ICON_Y |
  225.          UI_BUTTON_ALIGN_ICON_TEXT | UI_BUTTON_DISABLE_BACKGND_DISPLAY);
  226. #endif 
  227. #else /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  228.     MMI_softkeys[MMI_LEFT_SOFTKEY].flags |=
  229.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_CENTER_TEXT_X | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_ICON_Y |
  230.          UI_BUTTON_ALIGN_ICON_TEXT);
  231. #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  232.     /* set theme of RSK */
  233.     set_MMI_RSK_theme();
  234.     /* create RK button */
  235. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  236.     gui_create_icontext_button(
  237.         &MMI_softkeys[MMI_RIGHT_SOFTKEY],
  238.         UI_device_width - MMI_softkey_width,
  239.         UI_device_height - MMI_softkey_height - (MMI_BUTTON_BAR_HEIGHT - MMI_softkey_height),
  240.         MMI_softkey_width,
  241.         MMI_softkey_height,
  242.         NULL,
  243.         NULL);
  244. #else /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  245.     gui_create_icontext_button(
  246.         &MMI_softkeys[MMI_RIGHT_SOFTKEY],
  247.         UI_device_width - MMI_softkey_width,
  248.         UI_device_height - MMI_softkey_height,
  249.         MMI_softkey_width,
  250.         MMI_softkey_height,
  251.         NULL,
  252.         NULL);
  253. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  254. #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)
  255. #if defined(__MMI_UI_TECHNO_SOFTKEYS__)
  256.     MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |=
  257.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_RIGHT_ALIGN | UI_BUTTON_CENTER_TEXT_X | UI_BUTTON_CENTER_TEXT_Y |
  258.          UI_BUTTON_CENTER_ICON_Y | UI_BUTTON_ALIGN_ICON_TEXT);
  259. #elif defined(__MMI_UI_DALMATIAN_SOFTKEYS__)
  260.     MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |=
  261.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_CENTER_TEXT_X | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_ICON_Y |
  262.          UI_BUTTON_ALIGN_ICON_TEXT);
  263. #else 
  264.     MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |=
  265.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_RIGHT_ALIGN | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_ICON_Y |
  266.          UI_BUTTON_ALIGN_ICON_TEXT | UI_BUTTON_DISABLE_BACKGND_DISPLAY);
  267. #endif 
  268. #else /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  269.     MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |=
  270.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_CENTER_TEXT_X | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_ICON_Y |
  271.          UI_BUTTON_ALIGN_ICON_TEXT);
  272. #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  273. #ifdef __MMI_WGUI_CSK_ENABLE__
  274.     /* create CSK button */
  275.     gui_create_icontext_button(
  276.         &MMI_softkeys[MMI_CENTER_SOFTKEY],
  277.         MMI_softkey_width + ((UI_device_width - (MMI_softkey_width) * 3) >> 1),
  278.         UI_device_height - MMI_softkey_height,
  279.         MMI_softkey_width,
  280.         MMI_softkey_height,
  281.         NULL,
  282.         NULL);
  283. #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)
  284.     MMI_center_softkey.flags |=
  285.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_CENTER_TEXT_X | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_ICON_Y |
  286.          UI_BUTTON_ALIGN_ICON_TEXT | UI_BUTTON_DISABLE_BACKGND_DISPLAY);
  287. #else /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  288.     MMI_center_softkey.flags |=
  289.         (UI_BUTTON_SHIFT_BUTTON1 | UI_BUTTON_CENTER_TEXT_Y | UI_BUTTON_CENTER_ICON_Y | UI_BUTTON_ALIGN_ICON_TEXT);
  290. #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  291. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  292.     /* initilaize softkey functions to dummy func */
  293.     for (key = 0; key < WGUI_MAX_SOFTKEYS; key++)
  294.     {
  295.         MMI_softkeys[key].clear_background_fp = clear_softkey_button_background_callback;
  296.         hide_softkey[key] = UI_dummy_function;
  297.         for (i = 0; i < WGUI_MAX_SOFTKEY_FUNCTIONS; i++)
  298.         {
  299.             softkey_functions[key][i] = UI_dummy_function;
  300.         }
  301.     }
  302.     register_keyboard_global_key_handler(softkey_keyboard_handler);
  303. }
  304. /*****************************************************************************
  305.  * FUNCTION
  306.  *  restore_softkeys
  307.  * DESCRIPTION
  308.  *  set the softkeys to the MMI's default positions and sizes
  309.  * PARAMETERS
  310.  *  void
  311.  * RETURNS
  312.  *  void
  313.  *****************************************************************************/
  314. void restore_softkeys(void)
  315. {
  316.     /*----------------------------------------------------------------*/
  317.     /* Local Variables                                                */
  318.     /*----------------------------------------------------------------*/
  319.     U8 key = 0;
  320.     /*----------------------------------------------------------------*/
  321.     /* Code Body                                                      */
  322.     /*----------------------------------------------------------------*/
  323.     for (key = 0; key < WGUI_MAX_SOFTKEYS; key++)
  324.     {
  325.         gui_resize_icontext_button(&MMI_softkeys[key], MMI_softkey_width, MMI_softkey_height);
  326.         gui_move_icontext_button(&MMI_softkeys[key], 0, UI_device_height - MMI_softkey_height);
  327.         gui_set_icontext_button_current_theme(&MMI_softkeys[key]);
  328.     }
  329. }
  330. /*****************************************************************************
  331.  * FUNCTION
  332.  *  resize_softkey_by_string_length
  333.  * DESCRIPTION
  334.  *  resize the left softkey width according the the string
  335.  * PARAMETERS
  336.  *  s       [IN]        String
  337.  *  key     [IN]        Softkey enum
  338.  * RETURNS
  339.  *  void
  340.  *****************************************************************************/
  341. void resize_softkey_by_string_length(UI_string_type s, WGUI_SOFTKEY_ENUM key)
  342. {
  343.     /*----------------------------------------------------------------*/
  344.     /* Local Variables                                                */
  345.     /*----------------------------------------------------------------*/
  346.     S32 sw, sh;
  347.     /*----------------------------------------------------------------*/
  348.     /* Code Body                                                      */
  349.     /*----------------------------------------------------------------*/
  350.     gui_set_font(MMI_softkeys[key].text_font);
  351.     gui_measure_string(s, &sw, &sh);
  352.     gui_resize_icontext_button(&MMI_softkeys[key], sw + WGUI_SOFTKEY_STRING_GAP, MMI_softkeys[key].height);
  353.     gui_move_icontext_button(&MMI_softkeys[key], 0, UI_device_height - MMI_softkeys[key].height);
  354. }
  355. /*****************************************************************************
  356.  * FUNCTION
  357.  *  set_softkey_label
  358.  * DESCRIPTION
  359.  *  Changes the label of softkeys
  360.  * PARAMETERS
  361.  *  s       [IN]        String
  362.  *  key     [IN]        Softkey enum
  363.  * RETURNS
  364.  *  void
  365.  *****************************************************************************/
  366. void set_softkey_label(UI_string_type s, WGUI_SOFTKEY_ENUM key)
  367. {
  368.     /*----------------------------------------------------------------*/
  369.     /* Local Variables                                                */
  370.     /*----------------------------------------------------------------*/
  371.     /*----------------------------------------------------------------*/
  372.     /* Code Body                                                      */
  373.     /*----------------------------------------------------------------*/
  374.     MMI_softkeys[key].text = s;
  375.     if (MMI_softkeys[key].normal_down_icon == NULL)
  376.     {
  377.         MMI_softkeys[key].flags &= ~UI_BUTTON_CENTER_ICON_X;
  378.     #ifdef __MMI_WGUI_CSK_ENABLE__
  379.         if (key == MMI_CENTER_SOFTKEY)
  380.         {
  381.             MMI_softkeys[key].flags |= UI_BUTTON_CENTER_TEXT_X;
  382.         }
  383.     #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  384.     #if !(defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__))
  385.         MMI_softkeys[key].flags |= UI_BUTTON_CENTER_TEXT_X;
  386.     #endif 
  387.     }
  388.     gui_resize_icontext_button(&MMI_softkeys[key], MMI_softkeys[key].width, MMI_softkeys[key].height);
  389. }
  390. /*****************************************************************************
  391.  * FUNCTION
  392.  *  set_softkey_icon
  393.  * DESCRIPTION
  394.  *  Changes the icon of softkeys
  395.  * PARAMETERS
  396.  *  icon        [IN]        Icon
  397.  *  key         [IN]        Softkey enum
  398.  * RETURNS
  399.  *  void
  400.  *****************************************************************************/
  401. void set_softkey_icon(PU8 icon, WGUI_SOFTKEY_ENUM key)
  402. {
  403.     /*----------------------------------------------------------------*/
  404.     /* Local Variables                                                */
  405.     /*----------------------------------------------------------------*/
  406.     PU8 new_icon = icon;
  407.     /*----------------------------------------------------------------*/
  408.     /* Code Body                                                      */
  409.     /*----------------------------------------------------------------*/
  410.     if ((icon != NULL) && (icon[0] == 0))
  411.     {
  412.         new_icon = NULL;
  413.     }
  414.     if (icon != NULL && icon == MMI_softkeys[key].normal_up_icon)
  415.     {
  416.         return;
  417.     }
  418.     /* set icon of LSK button */
  419.     gui_icontext_button_set_icon(&MMI_softkeys[key], new_icon, gui_transparent_color(0, 0, 0));
  420.     if (MMI_softkeys[key].text == NULL)
  421.     {
  422.     #if !(defined __MMI_UI_TECHNO_SOFTKEYS__ || defined __MMI_UI_DALMATIAN_SOFTKEYS__ )
  423.         MMI_softkeys[key].flags &= ~UI_BUTTON_CENTER_TEXT_X;
  424.     #endif 
  425.         MMI_softkeys[key].flags |= UI_BUTTON_CENTER_ICON_X;
  426.     }
  427.     gui_resize_icontext_button(&MMI_softkeys[key], MMI_softkeys[key].width, MMI_softkeys[key].height);
  428. }
  429. /*****************************************************************************
  430.  * FUNCTION
  431.  *  change_softkey
  432.  * DESCRIPTION
  433.  *  Changes the string and icon of softkeys
  434.  * PARAMETERS
  435.  *  s       [IN]        String
  436.  *  i       [IN]        Icon
  437.  *  key     [IN]        Softkey enum
  438.  * RETURNS
  439.  *  void
  440.  *****************************************************************************/
  441. void change_softkey(U16 s, U16 i, WGUI_SOFTKEY_ENUM key)
  442. {
  443.     /*----------------------------------------------------------------*/
  444.     /* Local Variables                                                */
  445.     /*----------------------------------------------------------------*/
  446.     /*----------------------------------------------------------------*/
  447.     /* Code Body                                                      */
  448.     /*----------------------------------------------------------------*/
  449.     if (s != STRING_ID_NULL)
  450.     {
  451.         UI_string_type str = get_string(s);
  452.         set_softkey_label(str, key);
  453.     }
  454.     else
  455.     {
  456.         set_softkey_label(NULL, key);
  457.     }
  458.     if (i != IMAGE_ID_NULL)
  459.     {
  460.         PU8 img = get_image(i);
  461.         set_softkey_icon(img, key);
  462.     }
  463.     else
  464.     {
  465.         set_softkey_icon(NULL, key);
  466.     }
  467. }
  468. /*****************************************************************************
  469.  * FUNCTION
  470.  *  set_softkey_function
  471.  * DESCRIPTION
  472.  *  Changes the handler of softkeys
  473.  * PARAMETERS
  474.  *  f       [IN]        Handler function
  475.  *  k       [IN]        Key event type
  476.  *  key     [IN]        Softkey enum
  477.  * RETURNS
  478.  *  void
  479.  *****************************************************************************/
  480. void set_softkey_function(void (*f) (void), MMI_key_event_type k, WGUI_SOFTKEY_ENUM key)
  481. {
  482.     /*----------------------------------------------------------------*/
  483.     /* Local Variables                                                */
  484.     /*----------------------------------------------------------------*/
  485.     /*----------------------------------------------------------------*/
  486.     /* Code Body                                                      */
  487.     /*----------------------------------------------------------------*/
  488.     if (k >= WGUI_MAX_SOFTKEY_FUNCTIONS)
  489.     {
  490.         return;
  491.     }
  492.     switch (key)
  493.     {
  494.         case MMI_LEFT_SOFTKEY:
  495.             if (k == KEY_LONG_PRESS)
  496.             {
  497.                 SetKeyHandler(f, KEY_LSK, KEY_LONG_PRESS);
  498.             }
  499.             softkey_functions[key][k] = f;
  500.             break;
  501.         case MMI_RIGHT_SOFTKEY:
  502.             if (k == KEY_LONG_PRESS)
  503.             {
  504.                 SetKeyHandler(f, KEY_RSK, KEY_LONG_PRESS);
  505.             }
  506.             softkey_functions[key][k] = f;
  507.             break;
  508.         #ifdef __MMI_WGUI_CSK_ENABLE__
  509.         case MMI_CENTER_SOFTKEY:
  510.             if (k == KEY_LONG_PRESS)
  511.             {
  512.                 SetKeyHandler(f, KEY_CSK, KEY_LONG_PRESS);
  513.             }
  514.             softkey_functions[key][k] = f;
  515.             break;
  516.         #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  517.     }
  518. }
  519. /*****************************************************************************
  520.  * FUNCTION
  521.  *  get_softkey_function
  522.  * DESCRIPTION
  523.  *  get softkey handlers
  524.  * PARAMETERS
  525.  *  k       [IN]        Key event
  526.  *  key     [IN]        Softkey enum
  527.  * RETURNS
  528.  *  void
  529.  *****************************************************************************/
  530. FuncPtr get_softkey_function(MMI_key_event_type k, WGUI_SOFTKEY_ENUM key)
  531. {
  532.     /*----------------------------------------------------------------*/
  533.     /* Local Variables                                                */
  534.     /*----------------------------------------------------------------*/
  535.     /*----------------------------------------------------------------*/
  536.     /* Code Body                                                      */
  537.     /*----------------------------------------------------------------*/
  538.     if (k >= WGUI_MAX_SOFTKEY_FUNCTIONS)
  539.     {
  540.         return NULL;
  541.     }
  542.     return softkey_functions[key][k];
  543. }
  544. /*****************************************************************************
  545.  * FUNCTION
  546.  *  execute_softkey_function
  547.  * DESCRIPTION
  548.  *  execute softkey handlers
  549.  * PARAMETERS
  550.  *  k       [IN]        Key event
  551.  *  key     [IN]        Softkey enum
  552.  * RETURNS
  553.  *  void
  554.  *****************************************************************************/
  555. void execute_softkey_function(MMI_key_event_type k, WGUI_SOFTKEY_ENUM key)
  556. {
  557.     /*----------------------------------------------------------------*/
  558.     /* Local Variables                                                */
  559.     /*----------------------------------------------------------------*/
  560.     /*----------------------------------------------------------------*/
  561.     /* Code Body                                                      */
  562.     /*----------------------------------------------------------------*/
  563.     if (k >= WGUI_MAX_SOFTKEY_FUNCTIONS)
  564.     {
  565.         return;
  566.     }
  567.     if (softkey_functions[key][k] != NULL)
  568.     {
  569.         softkey_functions[key][k] ();
  570.     }
  571. }
  572. /*****************************************************************************
  573.  * FUNCTION
  574.  *  set_softkey
  575.  * DESCRIPTION
  576.  *  Sets the label and the function to be called for the softkey
  577.  * PARAMETERS
  578.  *  s       [IN]        New string to be used as the softkey label
  579.  *  f       [IN]        Function that is called when a particular softkey event occurs
  580.  *  k       [IN]        Key event
  581.  *  key     [IN]        Softkey enum
  582.  * RETURNS
  583.  *  void
  584.  *****************************************************************************/
  585. void set_softkey(UI_string_type s, void (*f) (void), MMI_key_event_type k, WGUI_SOFTKEY_ENUM key)
  586. {
  587.     /*----------------------------------------------------------------*/
  588.     /* Local Variables                                                */
  589.     /*----------------------------------------------------------------*/
  590.     /*----------------------------------------------------------------*/
  591.     /* Code Body                                                      */
  592.     /*----------------------------------------------------------------*/
  593.     if (k >= WGUI_MAX_SOFTKEY_FUNCTIONS)
  594.     {
  595.         return;
  596.     }
  597.     set_softkey_label(s, key);
  598.     set_softkey_function(f, k, key);
  599. }
  600. /*****************************************************************************
  601.  * FUNCTION
  602.  *  clear_softkey_display_functions
  603.  * DESCRIPTION
  604.  *  Clear the functions of the softkey
  605.  * PARAMETERS
  606.  *  key     [IN]        Softkey enum
  607.  * RETURNS
  608.  *  void
  609.  *****************************************************************************/
  610. void clear_softkey_display_functions(WGUI_SOFTKEY_ENUM key)
  611. {
  612.     /*----------------------------------------------------------------*/
  613.     /* Local Variables                                                */
  614.     /*----------------------------------------------------------------*/
  615.     U8 i = 0;
  616.     /*----------------------------------------------------------------*/
  617.     /* Code Body                                                      */
  618.     /*----------------------------------------------------------------*/
  619.     hide_softkey[key] = UI_dummy_function;
  620.     for (i = 0; i < WGUI_MAX_SOFTKEY_FUNCTIONS; i++)
  621.     {
  622.         softkey_functions[key][i] = UI_dummy_function;
  623.     }
  624. }
  625. /*****************************************************************************
  626.  * FUNCTION
  627.  *  show_softkey
  628.  * DESCRIPTION
  629.  *  Displays softkey
  630.  * PARAMETERS
  631.  *  key     [IN]        Softkey enum
  632.  * RETURNS
  633.  *  void
  634.  *****************************************************************************/
  635. void show_softkey(WGUI_SOFTKEY_ENUM key)
  636. {
  637.     /*----------------------------------------------------------------*/
  638.     /* Local Variables                                                */
  639.     /*----------------------------------------------------------------*/
  640.     /*----------------------------------------------------------------*/
  641.     /* Code Body                                                      */
  642.     /*----------------------------------------------------------------*/
  643.     if ((MMI_softkeys[key].text == NULL) && (MMI_softkeys[key].normal_up_icon == NULL))
  644.     {
  645.         clear_softkey_handler(key);
  646.         return;
  647.     }
  648. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  649.     switch (key)
  650.     {
  651.         case MMI_LEFT_SOFTKEY:
  652.             gui_show_icontext_button(&MMI_softkeys[key]);
  653.             break;
  654.         case MMI_RIGHT_SOFTKEY:
  655.             /* To show right key bottom aligned */
  656.             if ((MMI_left_softkey.text == NULL) && (MMI_left_softkey.normal_up_icon == NULL))
  657.             {
  658.                 MMI_right_softkey.y = MMI_left_softkey.y;
  659.             }
  660.             gui_show_icontext_button(&MMI_softkeys[key]);
  661.             /*  Reset the right softkey position which is changed whn left is null. */
  662.             if ((MMI_left_softkey.text == NULL) && (MMI_left_softkey.normal_up_icon == NULL))
  663.             {
  664.                 MMI_right_softkey.y =
  665.                     UI_device_height - MMI_softkey_height - (MMI_BUTTON_BAR_HEIGHT - MMI_softkey_height);
  666.             }
  667.             break;
  668.     }
  669. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  670. #ifndef __MMI_UI_DALMATIAN_SOFTKEYS__
  671.     gui_show_icontext_button(&MMI_softkeys[key]);
  672. #endif 
  673. }
  674. /*****************************************************************************
  675.  * FUNCTION
  676.  *  move_softkey
  677.  * DESCRIPTION
  678.  *  change the position of softkey
  679.  * PARAMETERS
  680.  *  x       [IN]        New x-coordinate of softkey
  681.  *  y       [IN]        New y-coordinate of softkey
  682.  *  key     [IN]        Softkey enum
  683.  * RETURNS
  684.  *  void
  685.  *****************************************************************************/
  686. void move_softkey(S32 x, S32 y, WGUI_SOFTKEY_ENUM key)
  687. {
  688.     /*----------------------------------------------------------------*/
  689.     /* Local Variables                                                */
  690.     /*----------------------------------------------------------------*/
  691.     /*----------------------------------------------------------------*/
  692.     /* Code Body                                                      */
  693.     /*----------------------------------------------------------------*/
  694.     gui_move_icontext_button(&MMI_softkeys[key], x, y);
  695. }
  696. /*****************************************************************************
  697.  * FUNCTION
  698.  *  resize_softkey
  699.  * DESCRIPTION
  700.  *  change the width and height of softkey
  701.  * PARAMETERS
  702.  *  width       [IN]        New width of softkey
  703.  *  height      [IN]        New height of softkey
  704.  *  key         [IN]        Softkey enum
  705.  * RETURNS
  706.  *  void
  707.  *****************************************************************************/
  708. void resize_softkey(S32 width, S32 height, WGUI_SOFTKEY_ENUM key)
  709. {
  710.     /*----------------------------------------------------------------*/
  711.     /* Local Variables                                                */
  712.     /*----------------------------------------------------------------*/
  713.     /*----------------------------------------------------------------*/
  714.     /* Code Body                                                      */
  715.     /*----------------------------------------------------------------*/
  716.     gui_resize_icontext_button(&MMI_softkeys[key], width, height);
  717. }
  718. /*****************************************************************************
  719.  * FUNCTION
  720.  *  redraw_softkey
  721.  * DESCRIPTION
  722.  *  Redraw softkey
  723.  * PARAMETERS
  724.  *  key     [IN]        Softkey enum
  725.  * RETURNS
  726.  *  void
  727.  *****************************************************************************/
  728. void redraw_softkey(WGUI_SOFTKEY_ENUM key)
  729. {
  730.     /*----------------------------------------------------------------*/
  731.     /* Local Variables                                                */
  732.     /*----------------------------------------------------------------*/
  733.     S32 idx = 0;//061506 double buffer
  734. #ifndef __MMI_UI_DALMATIAN_SOFTKEYS__
  735.     /*----------------------------------------------------------------*/
  736.     /* Code Body                                                      */
  737.     /*----------------------------------------------------------------*/
  738.     hide_softkey[key] ();
  739.     show_softkey(key);
  740. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  741.     switch (key)
  742.     {
  743.         case MMI_LEFT_SOFTKEY:
  744.     #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  745.             if (!is_on_idlescreen())
  746.             {
  747.                 show_softkey_background();
  748.             }
  749.             if ((MMI_left_softkey.text == NULL) && (MMI_left_softkey.normal_up_icon == NULL))
  750.             {
  751.                 /* To draw right softkey always above the left key. */
  752.                 redraw_right_softkey();
  753.                 gdi_layer_blt_previous(MMI_softkeys[MMI_LEFT_SOFTKEY].x, UI_device_height - MMI_BUTTON_BAR_HEIGHT, UI_device_width - 1, UI_device_height - 1);  /* vikas modified 20050331 */
  754.                 return;
  755.             }
  756.             show_softkey(key);
  757.             redraw_right_softkey();
  758.             gdi_layer_blt_previous(MMI_softkeys[MMI_LEFT_SOFTKEY].x, UI_device_height - MMI_BUTTON_BAR_HEIGHT, UI_device_width - 1, UI_device_height - 1);      /* vikas modified 20050331 */
  759.     #else /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  760.             gdi_layer_blt_previous(
  761.                 MMI_softkeys[MMI_LEFT_SOFTKEY].x,
  762.                 MMI_softkeys[MMI_LEFT_SOFTKEY].y,
  763.                 (MMI_softkeys[MMI_LEFT_SOFTKEY].x + MMI_softkeys[MMI_LEFT_SOFTKEY].width + 2),
  764.                 (MMI_softkeys[MMI_LEFT_SOFTKEY].y + MMI_softkeys[MMI_LEFT_SOFTKEY].height + 2));
  765.     #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  766.             break;
  767.         case MMI_RIGHT_SOFTKEY:
  768.         #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  769.             /* set the right key position to bottom aligned when left is NULL  */
  770.             if ((MMI_left_softkey.text == NULL) && (MMI_left_softkey.normal_up_icon == NULL))
  771.             {
  772.                 MMI_softkeys[MMI_RIGHT_SOFTKEY].y = UI_device_height - MMI_softkey_height;
  773.             }
  774.             show_softkey(key);
  775.             gdi_layer_blt_previous(
  776.                 MMI_softkeys[MMI_RIGHT_SOFTKEY].x,
  777.                 MMI_softkeys[MMI_RIGHT_SOFTKEY].y,
  778.                 (MMI_softkeys[MMI_RIGHT_SOFTKEY].x + MMI_softkeys[MMI_RIGHT_SOFTKEY].width + 2),
  779.                 (MMI_softkeys[MMI_RIGHT_SOFTKEY].y + MMI_softkeys[MMI_RIGHT_SOFTKEY].height + 2));
  780.             /* Reset the right key positions in its original position. */
  781.             if ((MMI_left_softkey.text == NULL) && (MMI_left_softkey.normal_up_icon == NULL))
  782.             {
  783.                 MMI_softkeys[MMI_RIGHT_SOFTKEY].y =
  784.                     UI_device_height - MMI_softkey_height - (MMI_BUTTON_BAR_HEIGHT - MMI_softkey_height);
  785.             }
  786.         #else /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  787.             gdi_layer_blt_previous(
  788.                 MMI_softkeys[MMI_RIGHT_SOFTKEY].x,
  789.                 MMI_softkeys[MMI_RIGHT_SOFTKEY].y,
  790.                 (MMI_softkeys[MMI_RIGHT_SOFTKEY].x + MMI_softkeys[MMI_RIGHT_SOFTKEY].width + 2),
  791.                 (MMI_softkeys[MMI_RIGHT_SOFTKEY].y + MMI_softkeys[MMI_RIGHT_SOFTKEY].height + 2));
  792.         #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  793.             break;
  794.         #ifdef __MMI_WGUI_CSK_ENABLE__
  795.         case MMI_CENTER_SOFTKEY:
  796.             gdi_layer_blt_previous(
  797.                 MMI_softkeys[MMI_CENTER_SOFTKEY].x,
  798.                 MMI_softkeys[MMI_CENTER_SOFTKEY].y,
  799.                 (MMI_softkeys[MMI_CENTER_SOFTKEY].x + MMI_softkeys[MMI_CENTER_SOFTKEY].width + 2),
  800.                 (MMI_softkeys[MMI_CENTER_SOFTKEY].y + MMI_softkeys[MMI_CENTER_SOFTKEY].height + 2));
  801.             break;
  802.         #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  803.     }
  804.     /* 061506 double buffer Start */
  805.     for (idx=0; idx<MAX_STATUS_ICON_BARS; idx++)
  806.     {
  807.         if(get_status_icon_bar_type((U8)idx)&STATUS_ICON_BAR_ENABLE_DOUBLE_BUFFER)
  808.         {
  809.             gdi_layer_push_and_set_active(get_status_icon_bar_layer((U8)idx));
  810.             gdi_layer_toggle_double();
  811.             gdi_layer_copy_double();//070306 copy double
  812.             gdi_layer_pop_and_restore_active();
  813.         }
  814.     }
  815.     /* 061506 double buffer End */
  816. }
  817. /*****************************************************************************
  818.  * FUNCTION
  819.  *  left_softkey_down
  820.  * DESCRIPTION
  821.  *  Handles left softkey down event
  822.  * PARAMETERS
  823.  *  void
  824.  * RETURNS
  825.  *  void
  826.  *****************************************************************************/
  827. void left_softkey_down(void)
  828. {
  829.     /*----------------------------------------------------------------*/
  830.     /* Local Variables                                                */
  831.     /*----------------------------------------------------------------*/
  832.     /*----------------------------------------------------------------*/
  833.     /* Code Body                                                      */
  834.     /*----------------------------------------------------------------*/
  835.     if (!(MMI_softkeys[MMI_LEFT_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED))
  836.     {                                       /* change the state of LSK button */
  837.         MMI_softkeys[MMI_LEFT_SOFTKEY].flags |= UI_BUTTON_STATE_CLICKED;
  838.         MMI_softkeys[MMI_LEFT_SOFTKEY].flags |= UI_BUTTON_STATE_DOWN;
  839.     #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  840.         /* Set status of shuffling on click & call shuffle. */
  841.         is_button_bar_shuffled = 0;
  842.         gui_call_shuffle();
  843.     #else /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  844.         redraw_softkey(MMI_LEFT_SOFTKEY);   /* redraw LSK */
  845.         /* call function handlers of LSK down */
  846.     #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  847.         execute_softkey_function(KEY_EVENT_DOWN, MMI_LEFT_SOFTKEY);
  848.     }
  849. }
  850. /*****************************************************************************
  851.  * FUNCTION
  852.  *  left_softkey_up
  853.  * DESCRIPTION
  854.  *  Handles left softkey up event
  855.  * PARAMETERS
  856.  *  void
  857.  * RETURNS
  858.  *  void
  859.  *****************************************************************************/
  860. void left_softkey_up(void)
  861. {
  862.     /*----------------------------------------------------------------*/
  863.     /* Local Variables                                                */
  864.     /*----------------------------------------------------------------*/
  865.     /*----------------------------------------------------------------*/
  866.     /* Code Body                                                      */
  867.     /*----------------------------------------------------------------*/
  868.     if (MMI_softkeys[MMI_LEFT_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED)
  869.     {   /* change the state of LSK button */
  870.         MMI_softkeys[MMI_LEFT_SOFTKEY].flags &= ~UI_BUTTON_STATE_CLICKED;
  871.         MMI_softkeys[MMI_LEFT_SOFTKEY].flags &= ~UI_BUTTON_STATE_DOWN;
  872.     #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  873.         /* Reset status of shuffling on click & call shuffle. */
  874.         is_button_bar_shuffled = 1;
  875.         gui_call_shuffle();
  876.     #else /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  877.         redraw_softkey(MMI_LEFT_SOFTKEY);
  878.     #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  879.         /* call function handlers of LSK Up */
  880.         execute_softkey_function(KEY_EVENT_UP, MMI_LEFT_SOFTKEY);
  881.     }
  882. }
  883. /*****************************************************************************
  884.  * FUNCTION
  885.  *  left_softkey_up
  886.  * DESCRIPTION
  887.  *  Handles left softkey up event but no redraw
  888.  * PARAMETERS
  889.  *  void
  890.  * RETURNS
  891.  *  void
  892.  *****************************************************************************/
  893. void update_softkey_state_no_redraw( U16 KeyCode, U16 KeyType)
  894. {
  895. if ( KeyCode == KEY_LSK )
  896. {
  897. if ( KeyType == KEY_EVENT_UP )
  898. {
  899. if (MMI_softkeys[MMI_LEFT_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED)
  900. {   /* change the state of LSK button */
  901. MMI_softkeys[MMI_LEFT_SOFTKEY].flags &= ~UI_BUTTON_STATE_CLICKED;
  902. MMI_softkeys[MMI_LEFT_SOFTKEY].flags &= ~UI_BUTTON_STATE_DOWN;
  903. }
  904. }
  905. else if ( KeyType == KEY_EVENT_DOWN )
  906. {
  907. if (!(MMI_softkeys[MMI_LEFT_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED))
  908. {
  909. /* change the state of LSK button */
  910. MMI_softkeys[MMI_LEFT_SOFTKEY].flags |= UI_BUTTON_STATE_CLICKED;
  911. MMI_softkeys[MMI_LEFT_SOFTKEY].flags |= UI_BUTTON_STATE_DOWN;
  912. }
  913. }
  914. }
  915. else if ( KeyCode == KEY_RSK )
  916. {
  917. if ( KeyType == KEY_EVENT_UP )
  918. {
  919. if (MMI_softkeys[MMI_RIGHT_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED)
  920. {   /* change the state of RSK button */
  921. MMI_softkeys[MMI_RIGHT_SOFTKEY].flags &= ~UI_BUTTON_STATE_CLICKED;
  922. MMI_softkeys[MMI_RIGHT_SOFTKEY].flags &= ~UI_BUTTON_STATE_DOWN;
  923. }
  924. }
  925. else if ( KeyType == KEY_EVENT_DOWN )
  926. {
  927. if (!(MMI_softkeys[MMI_RIGHT_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED))
  928. {
  929. /* change the state of RSK button */
  930. MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |= UI_BUTTON_STATE_CLICKED;
  931. MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |= UI_BUTTON_STATE_DOWN;
  932. }
  933. }
  934. }
  935. }
  936. /*****************************************************************************
  937.  * FUNCTION
  938.  *  right_softkey_down
  939.  * DESCRIPTION
  940.  *  Handles right softkey down event
  941.  * PARAMETERS
  942.  *  void
  943.  * RETURNS
  944.  *  void
  945.  *****************************************************************************/
  946. void right_softkey_down(void)
  947. {
  948.     /*----------------------------------------------------------------*/
  949.     /* Local Variables                                                */
  950.     /*----------------------------------------------------------------*/
  951.     /*----------------------------------------------------------------*/
  952.     /* Code Body                                                      */
  953.     /*----------------------------------------------------------------*/
  954.     if (!(MMI_softkeys[MMI_RIGHT_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED))
  955.     {
  956.         /* change the state of RSK button */
  957.         MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |= UI_BUTTON_STATE_CLICKED;
  958.         MMI_softkeys[MMI_RIGHT_SOFTKEY].flags |= UI_BUTTON_STATE_DOWN;
  959.     #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  960.         /* Set status of shuffling on click & call shuffle. */
  961.         is_button_bar_shuffled = 0;
  962.         gui_call_shuffle(); /* shuffle_softkeys */
  963.     #else /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  964.         redraw_softkey(MMI_RIGHT_SOFTKEY);
  965.     #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  966.         execute_softkey_function(KEY_EVENT_DOWN, MMI_RIGHT_SOFTKEY);
  967.     }
  968. }
  969. /*****************************************************************************
  970.  * FUNCTION
  971.  *  right_softkey_up
  972.  * DESCRIPTION
  973.  *  Handles right softkey up event
  974.  * PARAMETERS
  975.  *  void
  976.  * RETURNS
  977.  *  void
  978.  *****************************************************************************/
  979. void right_softkey_up(void)
  980. {
  981.     /*----------------------------------------------------------------*/
  982.     /* Local Variables                                                */
  983.     /*----------------------------------------------------------------*/
  984.     /*----------------------------------------------------------------*/
  985.     /* Code Body                                                      */
  986.     /*----------------------------------------------------------------*/
  987.     if (MMI_softkeys[MMI_RIGHT_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED)
  988.     {
  989.         /* change the state of LSK button */
  990.         MMI_softkeys[MMI_RIGHT_SOFTKEY].flags &= ~UI_BUTTON_STATE_CLICKED;
  991.         MMI_softkeys[MMI_RIGHT_SOFTKEY].flags &= ~UI_BUTTON_STATE_DOWN;
  992.     #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  993.         /* Reset status of shuffling on click & call shuffle. */
  994.         is_button_bar_shuffled = 1;
  995.         gui_call_shuffle();
  996.     #else /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  997.         redraw_softkey(MMI_RIGHT_SOFTKEY);
  998.     #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  999.         execute_softkey_function(KEY_EVENT_UP, MMI_RIGHT_SOFTKEY);
  1000.     }
  1001. }
  1002. #ifdef __MMI_WGUI_CSK_ENABLE__
  1003. /*****************************************************************************
  1004.  * FUNCTION
  1005.  *  center_softkey_down
  1006.  * DESCRIPTION
  1007.  *  Handles center softkey down event
  1008.  * PARAMETERS
  1009.  *  void
  1010.  * RETURNS
  1011.  *  void
  1012.  *****************************************************************************/
  1013. void center_softkey_down(void)
  1014. {
  1015.     /*----------------------------------------------------------------*/
  1016.     /* Local Variables                                                */
  1017.     /*----------------------------------------------------------------*/
  1018.     /*----------------------------------------------------------------*/
  1019.     /* Code Body                                                      */
  1020.     /*----------------------------------------------------------------*/
  1021.     if (!(MMI_softkeys[MMI_CENTER_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED))
  1022.     {   /* change the state of LSK button */
  1023.         MMI_softkeys[MMI_CENTER_SOFTKEY].flags |= UI_BUTTON_STATE_CLICKED;
  1024.         MMI_softkeys[MMI_CENTER_SOFTKEY].flags |= UI_BUTTON_STATE_DOWN;
  1025.         redraw_softkey(MMI_CENTER_SOFTKEY);
  1026.         /* call function handlers of LSK down  */
  1027.         execute_softkey_function(KEY_EVENT_DOWN, MMI_CENTER_SOFTKEY);
  1028.     }
  1029. }
  1030. /*****************************************************************************
  1031.  * FUNCTION
  1032.  *  center_softkey_up
  1033.  * DESCRIPTION
  1034.  *  Handles left softkey up event
  1035.  * PARAMETERS
  1036.  *  void
  1037.  * RETURNS
  1038.  *  void
  1039.  *****************************************************************************/
  1040. void center_softkey_up(void)
  1041. {
  1042.     /*----------------------------------------------------------------*/
  1043.     /* Local Variables                                                */
  1044.     /*----------------------------------------------------------------*/
  1045.     /*----------------------------------------------------------------*/
  1046.     /* Code Body                                                      */
  1047.     /*----------------------------------------------------------------*/
  1048.     if (MMI_softkeys[MMI_CENTER_SOFTKEY].flags & UI_BUTTON_STATE_CLICKED)
  1049.     {   /* change the state of LSK button */
  1050.         MMI_softkeys[MMI_CENTER_SOFTKEY].flags &= ~UI_BUTTON_STATE_CLICKED;
  1051.         MMI_softkeys[MMI_CENTER_SOFTKEY].flags &= ~UI_BUTTON_STATE_DOWN;
  1052.         redraw_softkey(MMI_CENTER_SOFTKEY);
  1053.         /* call function handlers of LSK Up */
  1054.         execute_softkey_function(KEY_EVENT_UP, MMI_CENTER_SOFTKEY);
  1055.     }
  1056. }
  1057. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  1058. /*****************************************************************************
  1059.  * FUNCTION
  1060.  *  register_softkey_handler
  1061.  * DESCRIPTION
  1062.  *  Register handlers of softkeys
  1063.  * PARAMETERS
  1064.  *  key     [IN]        Softkey enum
  1065.  * RETURNS
  1066.  *  void
  1067.  *****************************************************************************/
  1068. void register_softkey_handler(WGUI_SOFTKEY_ENUM key)
  1069. {
  1070.     /*----------------------------------------------------------------*/
  1071.     /* Local Variables                                                */
  1072.     /*----------------------------------------------------------------*/
  1073.     /*----------------------------------------------------------------*/
  1074.     /* Code Body                                                      */
  1075.     /*----------------------------------------------------------------*/
  1076.     if ((MMI_softkeys[key].text == NULL) && (MMI_softkeys[key].normal_up_icon == NULL))
  1077.     {
  1078.         return;
  1079.     }
  1080.     switch (key)
  1081.     {
  1082.         case MMI_LEFT_SOFTKEY:
  1083.             SetKeyHandler(left_softkey_down, KEY_LSK, KEY_EVENT_DOWN);
  1084.             SetKeyHandler(left_softkey_up, KEY_LSK, KEY_EVENT_UP);
  1085.             left_softkey_keyboard_handler_active = 1;
  1086.             break;
  1087.         case MMI_RIGHT_SOFTKEY:
  1088.             SetKeyHandler(right_softkey_down, KEY_RSK, KEY_EVENT_DOWN);
  1089.             SetKeyHandler(right_softkey_up, KEY_RSK, KEY_EVENT_UP);
  1090.             right_softkey_keyboard_handler_active = 1;
  1091.             break;
  1092.     #ifdef __MMI_WGUI_CSK_ENABLE__
  1093.         case MMI_CENTER_SOFTKEY:
  1094.             SetKeyHandler(center_softkey_down, KEY_CSK, KEY_EVENT_DOWN);
  1095.             SetKeyHandler(center_softkey_up, KEY_CSK, KEY_EVENT_UP);
  1096.             center_softkey_keyboard_handler_active = 1;
  1097.             break;
  1098.     #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  1099.     }
  1100. }
  1101. #ifdef __MMI_WGUI_CSK_ENABLE__
  1102. /*****************************************************************************
  1103.  * FUNCTION
  1104.  *  register_center_softkey_to_enter_key
  1105.  * DESCRIPTION
  1106.  *  Register center softkey handlers to enter key
  1107.  * PARAMETERS
  1108.  *  void
  1109.  * RETURNS
  1110.  *  void
  1111.  *****************************************************************************/
  1112. void register_center_softkey_to_enter_key(void)
  1113. {
  1114.     /*----------------------------------------------------------------*/
  1115.     /* Local Variables                                                */
  1116.     /*----------------------------------------------------------------*/
  1117.     /*----------------------------------------------------------------*/
  1118.     /* Code Body                                                      */
  1119.     /*----------------------------------------------------------------*/
  1120.     SetKeyHandler(center_softkey_up, KEY_ENTER, KEY_EVENT_UP);
  1121.     SetKeyHandler(center_softkey_down, KEY_ENTER, KEY_EVENT_DOWN);
  1122. }
  1123. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  1124. /*****************************************************************************
  1125.  * FUNCTION
  1126.  *  clear_softkey_handler
  1127.  * DESCRIPTION
  1128.  *  Register handlers of softkeys
  1129.  * PARAMETERS
  1130.  *  key     [IN]        Softkey enum
  1131.  * RETURNS
  1132.  *  void
  1133.  *****************************************************************************/
  1134. void clear_softkey_handler(WGUI_SOFTKEY_ENUM key)
  1135. {
  1136.     /*----------------------------------------------------------------*/
  1137.     /* Local Variables                                                */
  1138.     /*----------------------------------------------------------------*/
  1139.     /*----------------------------------------------------------------*/
  1140.     /* Code Body                                                      */
  1141.     /*----------------------------------------------------------------*/
  1142.     switch (key)
  1143.     {
  1144.         case MMI_LEFT_SOFTKEY:
  1145.             ClearKeyHandler(KEY_LSK, KEY_EVENT_DOWN);
  1146.             ClearKeyHandler(KEY_LSK, KEY_EVENT_UP);
  1147.             left_softkey_keyboard_handler_active = 0;
  1148.             break;
  1149.         case MMI_RIGHT_SOFTKEY:
  1150.             ClearKeyHandler(KEY_RSK, KEY_EVENT_DOWN);
  1151.             ClearKeyHandler(KEY_RSK, KEY_EVENT_UP);
  1152.             right_softkey_keyboard_handler_active = 0;
  1153.             break;
  1154.     #ifdef __MMI_WGUI_CSK_ENABLE__
  1155.         case MMI_CENTER_SOFTKEY:
  1156.             ClearKeyHandler(KEY_CSK, KEY_EVENT_DOWN);
  1157.             ClearKeyHandler(KEY_CSK, KEY_EVENT_UP);
  1158.             center_softkey_keyboard_handler_active = 0;
  1159.             break;
  1160.     #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  1161.     }
  1162. }
  1163. /*****************************************************************************
  1164.  * FUNCTION
  1165.  *  softkey_keyboard_handler
  1166.  * DESCRIPTION
  1167.  *  Keyboard handler (Simulator) for softkeys
  1168.  * PARAMETERS
  1169.  *  vkey_code       [IN]        Key type
  1170.  *  key_state       [IN]        Key event type
  1171.  * RETURNS
  1172.  *  void
  1173.  *****************************************************************************/
  1174. void softkey_keyboard_handler(S32 vkey_code, S32 key_state)
  1175. {
  1176.     /*----------------------------------------------------------------*/
  1177.     /* Local Variables                                                */
  1178.     /*----------------------------------------------------------------*/
  1179.     /*----------------------------------------------------------------*/
  1180.     /* Code Body                                                      */
  1181.     /*----------------------------------------------------------------*/
  1182.     if (key_state)
  1183.     {
  1184.         switch (vkey_code)
  1185.         {
  1186.             case 112:
  1187.                 if (left_softkey_keyboard_handler_active)
  1188.                 {
  1189.                     left_softkey_down();
  1190.                 }
  1191.                 break;
  1192.             case 113:
  1193.                 if (right_softkey_keyboard_handler_active)
  1194.                 {
  1195.                     right_softkey_down();
  1196.                 }
  1197.                 break;
  1198.         }
  1199.     }
  1200.     else
  1201.     {
  1202.         switch (vkey_code)
  1203.         {
  1204.             case 112:
  1205.                 if (left_softkey_keyboard_handler_active)
  1206.                 {
  1207.                     left_softkey_up();
  1208.                 }
  1209.                 break;
  1210.             case 113:
  1211.                 if (right_softkey_keyboard_handler_active)
  1212.                 {
  1213.                     right_softkey_up();
  1214.                 }
  1215.                 break;
  1216.         }
  1217.     }
  1218. }
  1219. /*****************************************************************************
  1220.  * FUNCTION
  1221.  *  register_hide_softkey
  1222.  * DESCRIPTION
  1223.  *  Register handlers of hide softkeys
  1224.  * PARAMETERS
  1225.  *  f       [IN]        Callback function to hide softkey
  1226.  *  key     [IN]        Softkey enum
  1227.  * RETURNS
  1228.  *  void
  1229.  *****************************************************************************/
  1230. void register_hide_softkey(void (*f) (void), WGUI_SOFTKEY_ENUM key)
  1231. {
  1232.     /*----------------------------------------------------------------*/
  1233.     /* Local Variables                                                */
  1234.     /*----------------------------------------------------------------*/
  1235.     /*----------------------------------------------------------------*/
  1236.     /* Code Body                                                      */
  1237.     /*----------------------------------------------------------------*/
  1238.     hide_softkey[key] = f;
  1239. }
  1240. /*****************************************************************************
  1241.  * FUNCTION
  1242.  *  reset_softkeys
  1243.  * DESCRIPTION
  1244.  *  Sets the softkey states to normal and clears the hide functions
  1245.  * PARAMETERS
  1246.  *  void
  1247.  * RETURNS
  1248.  *  void
  1249.  *****************************************************************************/
  1250. void reset_softkeys(void)
  1251. {
  1252.     /*----------------------------------------------------------------*/
  1253.     /* Local Variables                                                */
  1254.     /*----------------------------------------------------------------*/
  1255.     U8 i = 0;
  1256.     /*----------------------------------------------------------------*/
  1257.     /* Code Body                                                      */
  1258.     /*----------------------------------------------------------------*/
  1259.     for (i = 0; i < WGUI_MAX_SOFTKEYS; i++)
  1260.     {
  1261.         MMI_softkeys[i].flags &= ~UI_BUTTON_STATE_CLICKED;
  1262.         MMI_softkeys[i].flags &= ~UI_BUTTON_STATE_DOWN;
  1263.         MMI_softkeys[i].flags &= ~UI_BUTTON_STATE_DISABLED;
  1264.         MMI_softkeys[i].flags &= ~UI_BUTTON_ALWAYS_SEND_PEN_UP_INSIDE;
  1265.         MMI_softkeys[i].flags &= ~UI_BUTTON_NO_SHIFT_BUTTON;
  1266.         hide_softkey[i] = UI_dummy_function;
  1267.     }
  1268. }
  1269. /*****************************************************************************
  1270.  * FUNCTION
  1271.  *  reset_softkey
  1272.  * DESCRIPTION
  1273.  *  Sets the softkey states to normal and clears the hide functions
  1274.  * PARAMETERS
  1275.  *  key     [IN]        
  1276.  * RETURNS
  1277.  *  void
  1278.  *****************************************************************************/
  1279. void reset_softkey(WGUI_SOFTKEY_ENUM key)
  1280. {
  1281.     /*----------------------------------------------------------------*/
  1282.     /* Local Variables                                                */
  1283.     /*----------------------------------------------------------------*/
  1284.     /*----------------------------------------------------------------*/
  1285.     /* Code Body                                                      */
  1286.     /*----------------------------------------------------------------*/
  1287.     MMI_softkeys[key].flags &= ~UI_BUTTON_STATE_CLICKED;
  1288.     MMI_softkeys[key].flags &= ~UI_BUTTON_STATE_DOWN;
  1289.     MMI_softkeys[key].flags &= ~UI_BUTTON_STATE_DISABLED;
  1290.     MMI_softkeys[key].flags &= ~UI_BUTTON_ALWAYS_SEND_PEN_UP_INSIDE;
  1291.     /* Do not reset UI_BUTTON_NO_SHIFT_BUTTON and hide_softkey[] */
  1292. }
  1293. /*****************************************************************************
  1294.  * FUNCTION
  1295.  *  disable_softkey_background
  1296.  * DESCRIPTION
  1297.  *  Set some flags to disable background display of softkeys
  1298.  * PARAMETERS
  1299.  *  void
  1300.  * RETURNS
  1301.  *  void
  1302.  *****************************************************************************/
  1303. void disable_softkey_background(void)
  1304. {
  1305.     /*----------------------------------------------------------------*/
  1306.     /* Local Variables                                                */
  1307.     /*----------------------------------------------------------------*/
  1308.     U8 i = 0;
  1309.     /*----------------------------------------------------------------*/
  1310.     /* Code Body                                                      */
  1311.     /*----------------------------------------------------------------*/
  1312.     for (i = 0; i < WGUI_MAX_SOFTKEYS; i++)
  1313.     {
  1314.     #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)
  1315.         MMI_softkeys[i].flags |= UI_BUTTON_NO_UNDER_BAR;
  1316.     #else 
  1317.         MMI_softkeys[i].flags |= UI_BUTTON_DISABLE_BACKGND_DISPLAY;
  1318.     #endif 
  1319.     }
  1320. }
  1321. /*****************************************************************************
  1322.  * FUNCTION
  1323.  *  enable_softkey_background
  1324.  * DESCRIPTION
  1325.  *  Set some flags to disable background display of softkeys
  1326.  * PARAMETERS
  1327.  *  void
  1328.  * RETURNS
  1329.  *  void
  1330.  *****************************************************************************/
  1331. void enable_softkey_background(void)
  1332. {
  1333.     /*----------------------------------------------------------------*/
  1334.     /* Local Variables                                                */
  1335.     /*----------------------------------------------------------------*/
  1336.     U8 i = 0;
  1337.     /*----------------------------------------------------------------*/
  1338.     /* Code Body                                                      */
  1339.     /*----------------------------------------------------------------*/
  1340.     for (i = 0; i < WGUI_MAX_SOFTKEYS; i++)
  1341.     {
  1342.     #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)
  1343.         MMI_softkeys[i].flags &= ~UI_BUTTON_NO_UNDER_BAR;
  1344.     #else 
  1345.         MMI_softkeys[i].flags &= ~UI_BUTTON_DISABLE_BACKGND_DISPLAY;
  1346.     #endif 
  1347.     }
  1348. }
  1349. /*****************************************************************************
  1350.  * FUNCTION
  1351.  *  set_softkey_flags_on
  1352.  * DESCRIPTION
  1353.  *  turn on flag of softkeys
  1354.  * PARAMETERS
  1355.  *  flag        [IN]        
  1356.  *  key         [IN]        
  1357.  * RETURNS
  1358.  *  void
  1359.  *****************************************************************************/
  1360. void set_softkey_flags_on(S32 flag, WGUI_SOFTKEY_ENUM key)
  1361. {
  1362.     /*----------------------------------------------------------------*/
  1363.     /* Local Variables                                                */
  1364.     /*----------------------------------------------------------------*/
  1365.     /*----------------------------------------------------------------*/
  1366.     /* Code Body                                                      */
  1367.     /*----------------------------------------------------------------*/
  1368.     MMI_softkeys[key].flags |= flag;
  1369. }
  1370. /*****************************************************************************
  1371.  * FUNCTION
  1372.  *  set_softkey_flags_off
  1373.  * DESCRIPTION
  1374.  *  turn off  flag of softkeys
  1375.  * PARAMETERS
  1376.  *  flag        [IN]        
  1377.  *  key         [IN]        
  1378.  * RETURNS
  1379.  *  void
  1380.  *****************************************************************************/
  1381. void set_softkey_flags_off(S32 flag, WGUI_SOFTKEY_ENUM key)
  1382. {
  1383.     /*----------------------------------------------------------------*/
  1384.     /* Local Variables                                                */
  1385.     /*----------------------------------------------------------------*/
  1386.     /*----------------------------------------------------------------*/
  1387.     /* Code Body                                                      */
  1388.     /*----------------------------------------------------------------*/
  1389.     MMI_softkeys[key].flags &= ~flag;
  1390. }
  1391. #ifdef __MMI_TOUCH_SCREEN__
  1392. /*****************************************************************************
  1393.  * FUNCTION
  1394.  *  translate_softkey_pen_event
  1395.  * DESCRIPTION
  1396.  *  translate low level key events to softkey related events
  1397.  * PARAMETERS
  1398.  *  key                 [IN]            One of value of WGUI_SOFTKEY_ENUM
  1399.  *  pen_event           [IN]            Low level pen event type
  1400.  *  x                   [IN]            X-coordinate of pen event
  1401.  *  y                   [IN]            Y-coordinate of pen event
  1402.  *  button_event        [IN/OUT]        Softkey related event type
  1403.  * RETURNS
  1404.  *  void
  1405.  *****************************************************************************/
  1406. BOOL translate_softkey_pen_event(
  1407.         WGUI_SOFTKEY_ENUM key,
  1408.         mmi_pen_event_type_enum pen_event,
  1409.         S16 x,
  1410.         S16 y,
  1411.         gui_button_pen_enum *button_event)
  1412. {
  1413.     /*----------------------------------------------------------------*/
  1414.     /* Local Variables                                                */
  1415.     /*----------------------------------------------------------------*/
  1416.     /*----------------------------------------------------------------*/
  1417.     /* Code Body                                                      */
  1418.     /*----------------------------------------------------------------*/
  1419.     return gui_icontext_button_translate_pen_event(&MMI_softkeys[key], pen_event, x, y, button_event);
  1420. }
  1421. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1422. /*****************************************************************************
  1423.  * FUNCTION
  1424.  *  wgui_softkey_get_dimension
  1425.  * DESCRIPTION
  1426.  *  get softkey dimenstion
  1427.  * PARAMETERS
  1428.  *  key         [IN]            One of value of WGUI_SOFTKEY_ENUM
  1429.  *  width       [IN/OUT]        Width of softkey
  1430.  *  height      [IN/OUT]        Height of softkey
  1431.  * RETURNS
  1432.  *  void
  1433.  *****************************************************************************/
  1434. void wgui_softkey_get_dimension(WGUI_SOFTKEY_ENUM key, S32 *width, S32 *height)
  1435. {
  1436.     /*----------------------------------------------------------------*/
  1437.     /* Local Variables                                                */
  1438.     /*----------------------------------------------------------------*/
  1439.     /*----------------------------------------------------------------*/
  1440.     /* Code Body                                                      */
  1441.     /*----------------------------------------------------------------*/
  1442.     *width = MMI_softkeys[key].width;
  1443.     *height = MMI_softkeys[key].height;
  1444. }
  1445. /*****************************************************************************
  1446.  * FUNCTION
  1447.  *  wgui_softkey_get_position
  1448.  * DESCRIPTION
  1449.  *  get softkey position
  1450.  * PARAMETERS
  1451.  *  key         [IN]            One of value of WGUI_SOFTKEY_ENUM
  1452.  *  x           [IN/OUT]        X-position of softkey
  1453.  *  y           [?]             
  1454.  *  yx(?)       [IN/OUT]        Y-positino of softkey
  1455.  * RETURNS
  1456.  *  void
  1457.  *****************************************************************************/
  1458. void wgui_softkey_get_position(WGUI_SOFTKEY_ENUM key, S32 *x, S32 *y)
  1459. {
  1460.     /*----------------------------------------------------------------*/
  1461.     /* Local Variables                                                */
  1462.     /*----------------------------------------------------------------*/
  1463.     /*----------------------------------------------------------------*/
  1464.     /* Code Body                                                      */
  1465.     /*----------------------------------------------------------------*/
  1466.     *x = MMI_softkeys[key].x;
  1467.     *y = MMI_softkeys[key].y;
  1468. }
  1469. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1470. /*****************************************************************************
  1471.  * FUNCTION
  1472.  *  gui_register_button_shuffle
  1473.  * DESCRIPTION
  1474.  *  Registers the function to be called to shuffle the softkeys
  1475.  * PARAMETERS
  1476.  *  f               [IN]        
  1477.  *  function(?)     [IN]        Pointer
  1478.  * RETURNS
  1479.  *  void
  1480.  *****************************************************************************/
  1481. void gui_register_button_shuffle(void (*f) (void))
  1482. {
  1483.     /*----------------------------------------------------------------*/
  1484.     /* Local Variables                                                */
  1485.     /*----------------------------------------------------------------*/
  1486.     /*----------------------------------------------------------------*/
  1487.     /* Code Body                                                      */
  1488.     /*----------------------------------------------------------------*/
  1489.     pixtel_shuffle_draw_background = f;
  1490. }
  1491. /*****************************************************************************
  1492.  * FUNCTION
  1493.  *  gui_call_shuffle
  1494.  * DESCRIPTION
  1495.  *  Called the shuffle Registered function for the softkeys
  1496.  * PARAMETERS
  1497.  *  void
  1498.  * RETURNS
  1499.  *  void
  1500.  *****************************************************************************/
  1501. void gui_call_shuffle(void)
  1502. {
  1503.     /*----------------------------------------------------------------*/
  1504.     /* Local Variables                                                */
  1505.     /*----------------------------------------------------------------*/
  1506.     /*----------------------------------------------------------------*/
  1507.     /* Code Body                                                      */
  1508.     /*----------------------------------------------------------------*/
  1509.     gdi_layer_lock_frame_buffer();
  1510.     gdi_layer_push_clip();
  1511.     gdi_layer_set_clip(0, UI_device_height - MMI_BUTTON_BAR_HEIGHT, UI_device_width - 1, UI_device_height - 1);
  1512.     pixtel_shuffle_draw_background();
  1513.     if (is_button_bar_shuffled == 0)
  1514.     {
  1515.         MMI_right_softkey.y = UI_device_height - MMI_softkey_height;
  1516.         MMI_left_softkey.y = UI_device_height - MMI_softkey_height - (MMI_BUTTON_BAR_HEIGHT - MMI_softkey_height);
  1517.         show_right_softkey();
  1518.         show_left_softkey();
  1519.     }
  1520.     else
  1521.     {
  1522.         MMI_left_softkey.y = UI_device_height - MMI_softkey_height;
  1523.         MMI_right_softkey.y = UI_device_height - MMI_softkey_height - (MMI_BUTTON_BAR_HEIGHT - MMI_softkey_height);
  1524.         show_left_softkey();
  1525.         show_right_softkey();
  1526.     }
  1527.     gdi_layer_pop_clip();
  1528.     gdi_layer_unlock_frame_buffer();
  1529.     gdi_layer_blt_previous(0, UI_device_height - MMI_BUTTON_BAR_HEIGHT, UI_device_width - 1, UI_device_height - 1);
  1530. }
  1531. /*****************************************************************************
  1532.  * FUNCTION
  1533.  *  shuffle_draw_white
  1534.  * DESCRIPTION
  1535.  *  Common Function for draw white background in shuffle
  1536.  * PARAMETERS
  1537.  *  void
  1538.  * RETURNS
  1539.  *  void
  1540.  *****************************************************************************/
  1541. void shuffle_draw_white(void)
  1542. {
  1543.     /*----------------------------------------------------------------*/
  1544.     /* Local Variables                                                */
  1545.     /*----------------------------------------------------------------*/
  1546.     /*----------------------------------------------------------------*/
  1547.     /* Code Body                                                      */
  1548.     /*----------------------------------------------------------------*/
  1549.     gdi_draw_solid_rect(
  1550.         0,
  1551.         UI_device_height - MMI_BUTTON_BAR_HEIGHT,
  1552.         UI_device_width - 1,
  1553.         UI_device_height - 1,
  1554.         GDI_COLOR_WHITE);
  1555. }
  1556. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */