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

MTK

开发平台:

C/C++

  1.         UICtrlAccessPtr_p++;
  2.     }
  3.     else if (*UICtrlAccessPtr_p == DM_DEFAULT_BUTTON_BAR_FLAG || *UICtrlAccessPtr_p == DM_DEFAULT_BUTTON_BAR)
  4.     {
  5.     #ifdef __MMI_SCREEN_ROTATE__
  6.         if (mmi_frm_is_screen_width_height_swapped())
  7.         {
  8.             dm_coordinate_info->s16X = MMI_ROTATED_BUTTON_BAR_X;
  9.             dm_coordinate_info->s16Y = MMI_ROTATED_BUTTON_BAR_Y;
  10.             dm_coordinate_info->s16Width = MMI_ROTATED_BUTTON_BAR_WIDTH;
  11.             dm_coordinate_info->s16Height = MMI_ROTATED_BUTTON_BAR_HEIGHT;
  12.         }
  13.         else
  14.     #endif /* __MMI_SCREEN_ROTATE__ */ 
  15.         {
  16.             dm_coordinate_info->s16X = 0;
  17.             /* PMT SUKRIT START 20060104 */
  18.         #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  19.             dm_coordinate_info->s16Y = MAIN_LCD_DEVICE_HEIGHT - MMI_BUTTON_BAR_HEIGHT;
  20.         #else 
  21.             dm_coordinate_info->s16Y = MAIN_LCD_DEVICE_HEIGHT - MMI_BUTTON_BAR_HEIGHT + 1;
  22.         #endif 
  23.             /* PMT SUKRIT END 20060104 */
  24.             dm_coordinate_info->s16Width = MAIN_LCD_DEVICE_WIDTH;
  25.             dm_coordinate_info->s16Height = MMI_BUTTON_BAR_HEIGHT;
  26.         }
  27.         if (*UICtrlAccessPtr_p == DM_DEFAULT_BUTTON_BAR_FLAG)
  28.         {
  29.             dm_coordinate_info->Flags = DM_NO_FLAGS;
  30.         }
  31.         else
  32.         {
  33.             UICtrlAccessPtr_p++;
  34.             dm_coordinate_info->Flags = *UICtrlAccessPtr_p;
  35.         }
  36.         UICtrlAccessPtr_p++;
  37.     }
  38.     else
  39.     {
  40.         dm_coordinate_info->s16X = *UICtrlAccessPtr_p;
  41.         UICtrlAccessPtr_p++;
  42.         dm_coordinate_info->s16Y = *UICtrlAccessPtr_p;
  43.         UICtrlAccessPtr_p++;
  44.         dm_coordinate_info->s16Width = *UICtrlAccessPtr_p;
  45.         UICtrlAccessPtr_p++;
  46.         dm_coordinate_info->s16Height = *UICtrlAccessPtr_p;
  47.         UICtrlAccessPtr_p++;
  48.         dm_coordinate_info->Flags = *UICtrlAccessPtr_p;
  49.         UICtrlAccessPtr_p++;
  50.     }
  51.     if (dm_coordinate_info->Flags & DM_PREVIOUS_CONTROL_END_X)
  52.     {
  53.         dm_coordinate_info->s16X = prev_control_coordinates.s16X2 + dm_coordinate_info->s16X;
  54.     }
  55.     else if (dm_coordinate_info->Flags & DM_PREVIOUS_CONTROL_END_X_OFFSET_WIDTH)
  56.     {
  57.         dm_coordinate_info->s16X = prev_control_coordinates.s16X2 - dm_coordinate_info->s16Width;
  58.     }
  59. #ifndef __GDI_MEMORY_PROFILE_2__
  60.     else
  61.     {
  62.         if (new_layer_x != 0)
  63.         {
  64.             dm_coordinate_info->s16X += new_layer_x;
  65.         }
  66.     }
  67. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  68.     if (dm_coordinate_info->Flags & DM_PREVIOUS_CONTROL_END_Y)
  69.     {
  70.         dm_coordinate_info->s16Y = prev_control_coordinates.s16Y2 + dm_coordinate_info->s16Y;
  71.     }
  72.     else if (dm_coordinate_info->Flags & DM_PREVIOUS_CONTROL_END_Y_OFFSET_HEIGHT)
  73.     {
  74.         dm_coordinate_info->s16Y = prev_control_coordinates.s16Y2 - dm_coordinate_info->s16Height;
  75.     }
  76. #ifndef __GDI_MEMORY_PROFILE_2__
  77.     else
  78.     {
  79.         if (new_layer_y != 0)
  80.         {
  81.             dm_coordinate_info->s16Y += new_layer_y;
  82.         }
  83.     }
  84. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  85.     if (dm_coordinate_info->Flags & DM_WIDTH_OFFSET_PREVIOUS_CONTROL_END_X)
  86.     {
  87.         dm_coordinate_info->s16Width -= prev_control_coordinates.s16X2;
  88.     }
  89.     if (dm_coordinate_info->Flags & DM_HEIGHT_OFFSET_PREVIOUS_CONTROL_END_Y)
  90.     {
  91.         dm_coordinate_info->s16Height -= prev_control_coordinates.s16Y2;
  92.     }
  93.     if (dm_coordinate_info->Flags & DM_HEIGHT_PREVIOUS_CONTROL_HEIGHT)
  94.     {
  95.         dm_coordinate_info->s16Height = prev_control_coordinates.coordinate.s16Height;
  96.     }
  97.     if (dm_coordinate_info->Flags & DM_WIDTH_PREVIOUS_CONTROL_WIDTH)
  98.     {
  99.         dm_coordinate_info->s16Width = prev_control_coordinates.coordinate.s16Width;
  100.     }
  101.     setup_previous_control(dm_coordinate_info);
  102.     return UICtrlAccessPtr_p;
  103. }
  104. /*****************************************************************************
  105.  * FUNCTION
  106.  *  dm_get_cat_scr_coordinates
  107.  * DESCRIPTION
  108.  *  This function is used obtain the category screen coordinates
  109.  * PARAMETERS
  110.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  111.  *  dm_cat_scr_info         [IN/OUT]        Category screen coordinate info.
  112.  * RETURNS
  113.  *  void
  114.  *****************************************************************************/
  115. S16 *dm_get_cat_scr_coordinates(S16 *UICtrlAccessPtr_p, dm_cat_scr_info_struct *dm_cat_scr_info)
  116. {
  117.     /*----------------------------------------------------------------*/
  118.     /* Local Variables                                                */
  119.     /*----------------------------------------------------------------*/
  120.     /*----------------------------------------------------------------*/
  121.     /* Code Body                                                      */
  122.     /*----------------------------------------------------------------*/
  123.     /* Check if full screen display */
  124.     if ((*UICtrlAccessPtr_p == DM_FULL_SCREEN_COORDINATE_FLAG) || (*UICtrlAccessPtr_p == DM_FULL_SCREEN_COORDINATE))
  125.     {
  126.         dm_cat_scr_info->x1 = 0;
  127.         dm_cat_scr_info->y1 = 0;
  128.         dm_cat_scr_info->x2 = UI_device_width;
  129.         dm_cat_scr_info->y2 = UI_device_height;
  130.         if (*UICtrlAccessPtr_p == DM_FULL_SCREEN_COORDINATE_FLAG)
  131.         {
  132.             dm_cat_scr_info->flags = DM_NO_FLAGS;
  133.             UICtrlAccessPtr_p++;
  134.             return UICtrlAccessPtr_p;
  135.         }
  136.         UICtrlAccessPtr_p++;
  137.     }
  138.     else
  139.     {
  140.         dm_cat_scr_info->x1 = *UICtrlAccessPtr_p;
  141.         UICtrlAccessPtr_p++;
  142.         dm_cat_scr_info->y1 = *UICtrlAccessPtr_p;
  143.         UICtrlAccessPtr_p++;
  144.         dm_cat_scr_info->x2 = *UICtrlAccessPtr_p;
  145.         UICtrlAccessPtr_p++;
  146.         dm_cat_scr_info->y2 = *UICtrlAccessPtr_p;
  147.         UICtrlAccessPtr_p++;
  148.     }
  149.     dm_cat_scr_info->flags = *UICtrlAccessPtr_p;
  150.     UICtrlAccessPtr_p++;
  151.     return UICtrlAccessPtr_p;
  152. }   /* end of dm_get_cat_scr_coordinates */
  153. /*****************************************************************************
  154.  * FUNCTION
  155.  *  dm_get_status_icon_bar_coordinates
  156.  * DESCRIPTION
  157.  *  This function is used obtain the status icon bar coordinates.
  158.  * PARAMETERS
  159.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  160.  *  dm_status_info          [IN/OUT]        Status bar coordinate info.
  161.  * RETURNS
  162.  *  void
  163.  *****************************************************************************/
  164. S16 *dm_get_status_icon_bar_coordinates(S16 *UICtrlAccessPtr_p, dm_status_info_struct *dm_status_info)
  165. {
  166.     /*----------------------------------------------------------------*/
  167.     /* Local Variables                                                */
  168.     /*----------------------------------------------------------------*/
  169.     /*----------------------------------------------------------------*/
  170.     /* Code Body                                                      */
  171.     /*----------------------------------------------------------------*/
  172.     if (*UICtrlAccessPtr_p == DM_DEFAULT_STATUS_BAR_FLAG || *UICtrlAccessPtr_p == DM_DEFAULT_STATUS_BAR)
  173.     {
  174.         /* status bar is not suported in rotated screen */
  175.         dm_status_info->x = 0;
  176.         dm_status_info->y = 0;
  177.         dm_status_info->x1 = 0;
  178.         dm_status_info->y1 = 0;
  179.         dm_status_info->x2 = MAIN_LCD_DEVICE_WIDTH;
  180.         dm_status_info->y2 = MMI_STATUS_BAR_HEIGHT;
  181.         if (*UICtrlAccessPtr_p == DM_DEFAULT_STATUS_BAR_FLAG)
  182.         {
  183.             dm_status_info->flags = DM_NO_FLAGS;
  184.         }
  185.         else
  186.         {
  187.             UICtrlAccessPtr_p++;
  188.             dm_status_info->flags = *UICtrlAccessPtr_p;
  189.         }
  190.         UICtrlAccessPtr_p++;
  191.     }
  192.     else
  193.     {
  194.         dm_status_info->x = *UICtrlAccessPtr_p;
  195.         UICtrlAccessPtr_p++;
  196.         dm_status_info->y = *UICtrlAccessPtr_p;
  197.         UICtrlAccessPtr_p++;
  198.         dm_status_info->x1 = *UICtrlAccessPtr_p;
  199.         UICtrlAccessPtr_p++;
  200.         dm_status_info->y1 = *UICtrlAccessPtr_p;
  201.         UICtrlAccessPtr_p++;
  202.         dm_status_info->x2 = *UICtrlAccessPtr_p;
  203.         UICtrlAccessPtr_p++;
  204.         dm_status_info->y2 = *UICtrlAccessPtr_p;
  205.         UICtrlAccessPtr_p++;
  206.         dm_status_info->flags = *UICtrlAccessPtr_p;
  207.         UICtrlAccessPtr_p++;
  208.     }
  209.     return UICtrlAccessPtr_p;
  210. }   /* end of dm_get_status_icon_bar_coordinates */
  211. /*****************************************************************************
  212.  * FUNCTION
  213.  *  dm_get_button_bar_coordinates
  214.  * DESCRIPTION
  215.  *  This function is used obtain the button bar coordinates.
  216.  * PARAMETERS
  217.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  218.  *  dm_buttonbar_info       [IN/OUT]        Button bar coordinate info.
  219.  * RETURNS
  220.  *  void
  221.  *****************************************************************************/
  222. S16 *dm_get_button_bar_coordinates(S16 *UICtrlAccessPtr_p, dm_buttonbar_info_struct *dm_buttonbar_info)
  223. {
  224.     /*----------------------------------------------------------------*/
  225.     /* Local Variables                                                */
  226.     /*----------------------------------------------------------------*/
  227.     /*----------------------------------------------------------------*/
  228.     /* Code Body                                                      */
  229.     /*----------------------------------------------------------------*/
  230.     UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, &dm_buttonbar_info->coordinate);
  231.     dm_buttonbar_info->button_width = *UICtrlAccessPtr_p;
  232.     UICtrlAccessPtr_p++;
  233.     return UICtrlAccessPtr_p;
  234. }   /* end of dm_get_button_bar_coordinates */
  235. /*****************************************************************************
  236.  * FUNCTION
  237.  *  dm_get_calendar_coordinates
  238.  * DESCRIPTION
  239.  *  This function is used obtain the calendar control coordinates.
  240.  * PARAMETERS
  241.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  242.  *  dm_calendar_info        [IN/OUT]        Calendar control coordinate info.
  243.  * RETURNS
  244.  *  void
  245.  *****************************************************************************/
  246. S16 *dm_get_calendar_coordinates(S16 *UICtrlAccessPtr_p, dm_calendar_info_struct *dm_calendar_info)
  247. {
  248.     /*----------------------------------------------------------------*/
  249.     /* Local Variables                                                */
  250.     /*----------------------------------------------------------------*/
  251.     /*----------------------------------------------------------------*/
  252.     /* Code Body                                                      */
  253.     /*----------------------------------------------------------------*/
  254.     UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, &dm_calendar_info->coordinate);
  255.     dm_calendar_info->calendar_background_y = *UICtrlAccessPtr_p;
  256.     UICtrlAccessPtr_p++;
  257.     dm_calendar_info->calendar_background_width = *UICtrlAccessPtr_p;
  258.     UICtrlAccessPtr_p++;
  259.     dm_calendar_info->calendar_columns = *UICtrlAccessPtr_p;
  260.     UICtrlAccessPtr_p++;
  261.     dm_calendar_info->calendar_rows = *UICtrlAccessPtr_p;
  262.     UICtrlAccessPtr_p++;
  263.     dm_calendar_info->title1_x = *UICtrlAccessPtr_p;
  264.     UICtrlAccessPtr_p++;
  265.     dm_calendar_info->title1_y = *UICtrlAccessPtr_p;
  266.     UICtrlAccessPtr_p++;
  267.     dm_calendar_info->title1_width = *UICtrlAccessPtr_p;
  268.     UICtrlAccessPtr_p++;
  269.     dm_calendar_info->title1_height = *UICtrlAccessPtr_p;
  270.     UICtrlAccessPtr_p++;
  271.     dm_calendar_info->title1_font = *UICtrlAccessPtr_p;
  272.     UICtrlAccessPtr_p++;
  273. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  274.     dm_calendar_info->title1_month_x = *UICtrlAccessPtr_p;
  275.     UICtrlAccessPtr_p++;
  276.     dm_calendar_info->title1_month_y = *UICtrlAccessPtr_p;
  277.     UICtrlAccessPtr_p++;
  278.     dm_calendar_info->title1_month_width = *UICtrlAccessPtr_p;
  279.     UICtrlAccessPtr_p++;
  280.     dm_calendar_info->title1_month_height = *UICtrlAccessPtr_p;
  281.     UICtrlAccessPtr_p++;
  282.     dm_calendar_info->title1_month_font = *UICtrlAccessPtr_p;
  283.     UICtrlAccessPtr_p++;
  284.     dm_calendar_info->title1_month_show = *UICtrlAccessPtr_p;
  285.     UICtrlAccessPtr_p++;
  286. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  287.     dm_calendar_info->title2_x = *UICtrlAccessPtr_p;
  288.     UICtrlAccessPtr_p++;
  289.     dm_calendar_info->title2_y = *UICtrlAccessPtr_p;
  290.     UICtrlAccessPtr_p++;
  291.     dm_calendar_info->title2_width = *UICtrlAccessPtr_p;
  292.     UICtrlAccessPtr_p++;
  293.     dm_calendar_info->title2_height = *UICtrlAccessPtr_p;
  294.     UICtrlAccessPtr_p++;
  295.     dm_calendar_info->title2_show = *UICtrlAccessPtr_p;
  296.     UICtrlAccessPtr_p++;
  297.     dm_calendar_info->title3_x = *UICtrlAccessPtr_p;
  298.     UICtrlAccessPtr_p++;
  299.     dm_calendar_info->title3_y = *UICtrlAccessPtr_p;
  300.     UICtrlAccessPtr_p++;
  301.     dm_calendar_info->title3_width = *UICtrlAccessPtr_p;
  302.     UICtrlAccessPtr_p++;
  303.     dm_calendar_info->title3_height = *UICtrlAccessPtr_p;
  304.     UICtrlAccessPtr_p++;
  305.     dm_calendar_info->title3_show = *UICtrlAccessPtr_p;
  306.     UICtrlAccessPtr_p++;
  307. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  308.     dm_calendar_info->infobox_x = *UICtrlAccessPtr_p;
  309.     UICtrlAccessPtr_p++;
  310.     dm_calendar_info->infobox_y = *UICtrlAccessPtr_p;
  311.     UICtrlAccessPtr_p++;
  312.     dm_calendar_info->infobox_width = *UICtrlAccessPtr_p;
  313.     UICtrlAccessPtr_p++;
  314.     dm_calendar_info->infobox_height = *UICtrlAccessPtr_p;
  315.     UICtrlAccessPtr_p++;
  316.     dm_calendar_info->infobox_max = *UICtrlAccessPtr_p;
  317.     UICtrlAccessPtr_p++;
  318.     dm_calendar_info->infobox_show = *UICtrlAccessPtr_p;
  319.     UICtrlAccessPtr_p++;
  320. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  321.     return UICtrlAccessPtr_p;
  322. }
  323. /*****************************************************************************
  324.  * FUNCTION
  325.  *  dm_get_typical_stopwatch_coordinates
  326.  * DESCRIPTION
  327.  *  This function is used obtain the typical stopwatch control coordinates.
  328.  * PARAMETERS
  329.  *  UICtrlAccessPtr_p               [IN/OUT]        It specifies the start position to take out the coordinates.
  330.  *  dm_typical_stopwatch_info       [?]             
  331.  *  dm_calendar_info(?)             [IN/OUT]        Calendar control coordinate info.
  332.  * RETURNS
  333.  *  void
  334.  *****************************************************************************/
  335. S16 *dm_get_typical_stopwatch_coordinates(
  336.         S16 *UICtrlAccessPtr_p,
  337.         dm_typical_stopwatch_info_struct *dm_typical_stopwatch_info)
  338. {
  339.     /*----------------------------------------------------------------*/
  340.     /* Local Variables                                                */
  341.     /*----------------------------------------------------------------*/
  342.     /*----------------------------------------------------------------*/
  343.     /* Code Body                                                      */
  344.     /*----------------------------------------------------------------*/
  345.     UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, &dm_typical_stopwatch_info->coordinate);
  346.     dm_typical_stopwatch_info->typ_timer_x = *UICtrlAccessPtr_p;
  347.     UICtrlAccessPtr_p++;
  348.     dm_typical_stopwatch_info->typ_timer_y = *UICtrlAccessPtr_p;
  349.     UICtrlAccessPtr_p++;
  350.     dm_typical_stopwatch_info->typ_milsec_x = *UICtrlAccessPtr_p;
  351.     UICtrlAccessPtr_p++;
  352.     dm_typical_stopwatch_info->typ_milsec_y = *UICtrlAccessPtr_p;
  353.     UICtrlAccessPtr_p++;
  354.     dm_typical_stopwatch_info->typ_history_height = *UICtrlAccessPtr_p;
  355.     UICtrlAccessPtr_p++;
  356.     dm_typical_stopwatch_info->typ_timer_x += dm_typical_stopwatch_info->coordinate.s16X;
  357.     dm_typical_stopwatch_info->typ_timer_y += dm_typical_stopwatch_info->coordinate.s16Y;
  358.     dm_typical_stopwatch_info->typ_milsec_x += dm_typical_stopwatch_info->coordinate.s16X;
  359.     dm_typical_stopwatch_info->typ_milsec_y += dm_typical_stopwatch_info->coordinate.s16Y;
  360.     return UICtrlAccessPtr_p;
  361. }
  362. /*****************************************************************************
  363.  * FUNCTION
  364.  *  dm_get_nway_stopwatch_coordinates
  365.  * DESCRIPTION
  366.  *  This function is used obtain the N Way stopwatch control coordinates.
  367.  * PARAMETERS
  368.  *  UICtrlAccessPtr_p           [IN/OUT]        It specifies the start position to take out the coordinates.
  369.  *  dm_nway_stopwatch_info      [?]             
  370.  *  dm_calendar_info(?)         [IN/OUT]        Calendar control coordinate info.
  371.  * RETURNS
  372.  *  void
  373.  *****************************************************************************/
  374. S16 *dm_get_nway_stopwatch_coordinates(S16 *UICtrlAccessPtr_p, dm_nway_stopwatch_info_struct *dm_nway_stopwatch_info)
  375. {
  376.     /*----------------------------------------------------------------*/
  377.     /* Local Variables                                                */
  378.     /*----------------------------------------------------------------*/
  379.     /*----------------------------------------------------------------*/
  380.     /* Code Body                                                      */
  381.     /*----------------------------------------------------------------*/
  382.     UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, &dm_nway_stopwatch_info->coordinate);
  383.     dm_nway_stopwatch_info->nway_main_timer_x1 = *UICtrlAccessPtr_p;
  384.     UICtrlAccessPtr_p++;
  385.     dm_nway_stopwatch_info->nway_main_timer_y1 = *UICtrlAccessPtr_p;
  386.     UICtrlAccessPtr_p++;
  387.     dm_nway_stopwatch_info->nway_main_timer_x2 = *UICtrlAccessPtr_p;
  388.     UICtrlAccessPtr_p++;
  389.     dm_nway_stopwatch_info->nway_main_timer_y2 = *UICtrlAccessPtr_p;
  390.     UICtrlAccessPtr_p++;
  391.     dm_nway_stopwatch_info->nway_dialog_x1 = *UICtrlAccessPtr_p;
  392.     UICtrlAccessPtr_p++;
  393.     dm_nway_stopwatch_info->nway_dialog_y1 = *UICtrlAccessPtr_p;
  394.     UICtrlAccessPtr_p++;
  395.     dm_nway_stopwatch_info->nway_dialog_x2 = *UICtrlAccessPtr_p;
  396.     UICtrlAccessPtr_p++;
  397.     dm_nway_stopwatch_info->nway_dialog_y2 = *UICtrlAccessPtr_p;
  398.     UICtrlAccessPtr_p++;
  399.     dm_nway_stopwatch_info->separator_height = *UICtrlAccessPtr_p;
  400.     UICtrlAccessPtr_p++;
  401.     dm_nway_stopwatch_info->nway_main_timer_x1 += dm_nway_stopwatch_info->coordinate.s16X;
  402.     dm_nway_stopwatch_info->nway_main_timer_y1 += dm_nway_stopwatch_info->coordinate.s16Y;
  403.     dm_nway_stopwatch_info->nway_main_timer_x2 += dm_nway_stopwatch_info->coordinate.s16X;
  404.     dm_nway_stopwatch_info->nway_main_timer_y2 += dm_nway_stopwatch_info->coordinate.s16Y;
  405.     dm_nway_stopwatch_info->nway_dialog_x1 += dm_nway_stopwatch_info->coordinate.s16X;
  406.     dm_nway_stopwatch_info->nway_dialog_y1 += dm_nway_stopwatch_info->coordinate.s16Y;
  407.     dm_nway_stopwatch_info->nway_dialog_x2 += dm_nway_stopwatch_info->coordinate.s16X;
  408.     dm_nway_stopwatch_info->nway_dialog_y2 += dm_nway_stopwatch_info->coordinate.s16Y;
  409.     return UICtrlAccessPtr_p;
  410. }
  411. /*****************************************************************************
  412.  * FUNCTION
  413.  *  dm_get_category_history
  414.  * DESCRIPTION
  415.  *  This function is used obtain the category history.
  416.  * PARAMETERS
  417.  *  history_buffer      [IN/OUT]        Buffer of history data.
  418.  * RETURNS
  419.  *  U8 history
  420.  *****************************************************************************/
  421. U8 *dm_get_category_history(U8 *history_buffer)
  422. {
  423.     /*----------------------------------------------------------------*/
  424.     /* Local Variables                                                */
  425.     /*----------------------------------------------------------------*/
  426.     U8 u8NoOfUICtrls = 0;
  427.     U8 u8CtrlCt = 0;
  428.     U8 *control_set_ptr = NULL;
  429.     S16 *coordinate_set_p;
  430.     dm_data_struct *p_dm_data = NULL;
  431.     /*----------------------------------------------------------------*/
  432.     /* Code Body                                                      */
  433.     /*----------------------------------------------------------------*/
  434.     if (g_dm_data.s32CatId)
  435.     {
  436.         p_dm_data = &g_dm_data;
  437.     }
  438.     else if (g_dm_sublcd_data.s32CatId)
  439.     {
  440.         p_dm_data = &g_dm_sublcd_data;
  441.     }
  442.     else
  443.     {
  444.         MMI_ASSERT(0);
  445.     }
  446.     control_set_ptr = dm_search_control_set((U16) p_dm_data->s32CatId, &coordinate_set_p);
  447.     /* First element in Category-Controls map specifies the number of controls */
  448.     u8NoOfUICtrls = control_set_ptr[0];
  449.     for (u8CtrlCt = 1; u8CtrlCt <= u8NoOfUICtrls; u8CtrlCt++)
  450.     {
  451.         switch (control_set_ptr[u8CtrlCt])
  452.         {
  453.             case DM_CIRCULAR_MENU1:
  454.             {
  455.                 get_circular_menu_category_history((U16) p_dm_data->s32CatId, history_buffer);
  456.                 break;
  457.             }
  458.             case DM_LIST1:
  459.             {
  460.                 get_list_menu_category_history((U16) p_dm_data->s32CatId, history_buffer);
  461.                 break;
  462.             }
  463.             case DM_DYNAMIC_LIST1:
  464.             {
  465.                 get_list_menu_category_history((U16) p_dm_data->s32CatId, history_buffer);
  466.                 break;
  467.             }
  468.             case DM_ASYNCDYNAMIC_LIST1:
  469.             {
  470.                 get_list_menu_category_history((U16) p_dm_data->s32CatId, history_buffer);
  471.                 break;
  472.             }
  473.             case DM_MATRIX_MENU1:
  474.             {
  475.                 get_matrix_menu_category_history((U16) p_dm_data->s32CatId, history_buffer);
  476.                 break;
  477.             }
  478.             case DM_MULTILINE_INPUTBOX1:
  479.             {
  480.                 get_multiline_inputbox_category_history(
  481.                     (U16) p_dm_data->s32CatId,
  482.                     history_buffer,
  483.                     MMI_current_input_type);
  484.                 break;
  485.             }
  486.             case DM_EMS_INPUTBOX1:
  487.             {
  488.                 get_EMS_inputbox_category_history((U16) p_dm_data->s32CatId, history_buffer, MMI_current_input_type);
  489.                 break;
  490.             }
  491.             case DM_DIALER_INPUT_BOX1:
  492.             {
  493.                 get_dialer_inputbox_category_history((U16) p_dm_data->s32CatId, history_buffer);
  494.                 break;
  495.             }
  496.             case DM_SINGLELINE_INPUTBOX1:
  497.             {
  498.                 get_singleline_inputbox_category_history(
  499.                     (U16) p_dm_data->s32CatId,
  500.                     history_buffer,
  501.                     MMI_current_input_type);
  502.                 break;
  503.             }
  504.             case DM_LSK:
  505.             {
  506.                 /* No history currently for this control */
  507.                 break;
  508.             }
  509.             case DM_RSK:
  510.             {
  511.                 /* No history currently for this control */
  512.                 break;
  513.             }
  514.             case DM_TITLE1:
  515.             {
  516.                 /* No history currently for this control */
  517.                 break;
  518.             }
  519.             case DM_STATUS_BAR1:
  520.             {
  521.                 /* No history currently for this control */
  522.                 break;
  523.             }
  524.             case DM_INLINE_FIXED_LIST1:
  525.             {
  526.                 wgui_get_inline_history((U16) p_dm_data->s32CatId, history_buffer);
  527.                 break;
  528.             }
  529.             case DM_SLIDE_CONTROL:
  530.             {
  531.                 get_slide_control_category_history((U16) p_dm_data->s32CatId, history_buffer);
  532.                 break;
  533.             }
  534.             case DM_TYPICAL_STOPWATCH:
  535.             {
  536.                 get_list_menu_category_history((U16) p_dm_data->s32CatId, history_buffer);
  537.                 break;
  538.             }
  539.         #ifdef __MMI_STOPWATCH__
  540.             case DM_NWAY_STOPWATCH:
  541.             {
  542.                 get_stop_watch_history((U16) p_dm_data->s32CatId, history_buffer);
  543.                 break;
  544.             }
  545.         #endif /* __MMI_STOPWATCH__ */ 
  546.             default:
  547.             {
  548.                 break;
  549.             }
  550.         }
  551.     }
  552.     return history_buffer;
  553. }   /* end of dm_get_category_history */
  554. /*****************************************************************************
  555.  * FUNCTION
  556.  *  dm_get_category_history_size
  557.  * DESCRIPTION
  558.  *  This function is used obtain the category history.
  559.  * PARAMETERS
  560.  *  void
  561.  * RETURNS
  562.  *  S32 history_size
  563.  *****************************************************************************/
  564. S32 dm_get_category_history_size(void)
  565. {
  566.     /*----------------------------------------------------------------*/
  567.     /* Local Variables                                                */
  568.     /*----------------------------------------------------------------*/
  569.     S32 u8CtrlCt = -1;
  570.     S32 u8NoOfUICtrls = -1;
  571.     U8 *control_set_ptr = NULL;
  572.     S16 *coordinate_set_ptr = NULL;
  573.     /*----------------------------------------------------------------*/
  574.     /* Code Body                                                      */
  575.     /*----------------------------------------------------------------*/
  576.     if (g_dm_data.s32CatId)
  577.     {
  578.         control_set_ptr = dm_search_control_set((U16) g_dm_data.s32CatId, &coordinate_set_ptr);
  579.     }
  580.     else if (g_dm_sublcd_data.s32CatId)
  581.     {
  582.         control_set_ptr = dm_search_control_set((U16) g_dm_sublcd_data.s32CatId, &coordinate_set_ptr);
  583.     }
  584.     else
  585.     {
  586.         MMI_ASSERT(0);
  587.     }
  588.     /* First element in Category-Controls map specifies the number of controls */
  589.     u8NoOfUICtrls = control_set_ptr[0];
  590.     for (u8CtrlCt = 1; u8CtrlCt <= u8NoOfUICtrls; u8CtrlCt++)
  591.     {
  592.         switch (control_set_ptr[u8CtrlCt])
  593.         {
  594.             case DM_CIRCULAR_MENU1:
  595.             {
  596.                 return (sizeof(circular_menu_category_history));
  597.             }
  598.             case DM_LIST1:
  599.             {
  600.                 return (sizeof(list_menu_category_history));
  601.             }
  602.             case DM_DYNAMIC_LIST1:
  603.             {
  604.                 return (sizeof(list_menu_category_history));
  605.             }
  606.             case DM_ASYNCDYNAMIC_LIST1:
  607.             {
  608.                 return (sizeof(list_menu_category_history));
  609.             }
  610.             case DM_MATRIX_MENU1:
  611.             {
  612.                 return (sizeof(matrix_menu_category_history));
  613.             }
  614.             case DM_MULTILINE_INPUTBOX1:
  615.             {
  616.                 return (sizeof(multiline_inputbox_category_history));
  617.             }
  618.             case DM_DIALER_INPUT_BOX1:
  619.             {
  620.                 return (sizeof(dialer_inputbox_category_history));
  621.             }
  622.             case DM_SINGLELINE_INPUTBOX1:
  623.             {
  624.                 return (sizeof(singleline_inputbox_category_history));
  625.             }
  626.             case DM_LSK:
  627.             {
  628.                 /* No history currently for this control */
  629.                 return 0;
  630.             }
  631.             case DM_RSK:
  632.             {
  633.                 /* No history currently for this control */
  634.                 return 0;
  635.             }
  636.             case DM_TITLE1:
  637.             {
  638.                 /* No history currently for this control */
  639.                 return 0;
  640.             }
  641.             case DM_STATUS_BAR1:
  642.             {
  643.                 /* No history currently for this control */
  644.                 return 0;
  645.             }
  646.             case DM_INLINE_FIXED_LIST1:
  647.             {
  648.                 return (wgui_get_inline_history_size());
  649.             }
  650.             case DM_SLIDE_CONTROL:
  651.             {
  652.                 return (sizeof(slide_control_category_history));
  653.             }
  654.             case DM_TYPICAL_STOPWATCH:
  655.             {
  656.                 return (sizeof(list_menu_category_history));
  657.                 break;
  658.             }
  659.         #ifdef __MMI_STOPWATCH__
  660.             case DM_NWAY_STOPWATCH:
  661.             {
  662.                 return (sizeof(UI_stop_watch_history));
  663.                 break;
  664.             }
  665.         #endif /* __MMI_STOPWATCH__ */ 
  666.             default:
  667.             {
  668.                 PRINT_INFORMATION(("WARNING: Can't find any control to calculate history size"));
  669.                 MMI_ASSERT(0);
  670.                 return 0;
  671.             }
  672.         }
  673.     }
  674.     return 0;
  675. }   /* end of dm_get_category_history_size */
  676. /*****************************************************************************
  677.  * FUNCTION
  678.  *  dm_reset_title_coordinates
  679.  * DESCRIPTION
  680.  *  Reset function for the title coordinates so that other category screens get the original values only.
  681.  * PARAMETERS
  682.  *  void
  683.  * RETURNS
  684.  *  void
  685.  *****************************************************************************/
  686. void dm_reset_title_coordinates(void)
  687. {
  688.     /*----------------------------------------------------------------*/
  689.     /* Local Variables                                                */
  690.     /*----------------------------------------------------------------*/
  691.     /*----------------------------------------------------------------*/
  692.     /* Code Body                                                      */
  693.     /*----------------------------------------------------------------*/
  694.     MMI_title_x = MMI_TITLE_X;
  695.     MMI_title_y = MMI_TITLE_Y;
  696.     MMI_title_height = MMI_TITLE_HEIGHT;
  697.     MMI_title_width = MMI_TITLE_WIDTH;
  698. }   /* end of dm_reset_title_coordinates */
  699. /*****************************************************************************
  700.  * FUNCTION
  701.  *  dm_reset_fixed_list_coordinates
  702.  * DESCRIPTION
  703.  *  Reset function for the fixed list coordinates so that other category screens get the original values only.
  704.  * PARAMETERS
  705.  *  void
  706.  * RETURNS
  707.  *  void
  708.  *****************************************************************************/
  709. void dm_reset_fixed_list_coordinates(void)
  710. {
  711.     /*----------------------------------------------------------------*/
  712.     /* Local Variables                                                */
  713.     /*----------------------------------------------------------------*/
  714.     /*----------------------------------------------------------------*/
  715.     /* Code Body                                                      */
  716.     /*----------------------------------------------------------------*/
  717.     MMI_fixed_list_menu.x = MMI_content_x;
  718.     MMI_fixed_list_menu.y = MMI_content_y;
  719.     MMI_fixed_list_menu.width = MMI_content_width;
  720.     MMI_fixed_list_menu.height = MMI_content_height;
  721. }   /* end of dm_reset_fixed_list_coordinates */
  722. /*****************************************************************************
  723.  * FUNCTION
  724.  *  dm_reset_inline_fixed_list_coordinates
  725.  * DESCRIPTION
  726.  *  Reset function for the inline fixed list coordinates so that other category screens get the original values only.
  727.  * PARAMETERS
  728.  *  void
  729.  * RETURNS
  730.  *  void
  731.  *****************************************************************************/
  732. void dm_reset_inline_fixed_list_coordinates(void)
  733. {
  734.     /*----------------------------------------------------------------*/
  735.     /* Local Variables                                                */
  736.     /*----------------------------------------------------------------*/
  737.     /*----------------------------------------------------------------*/
  738.     /* Code Body                                                      */
  739.     /*----------------------------------------------------------------*/
  740.     MMI_fixed_list_menu.x = MMI_content_x;
  741.     MMI_fixed_list_menu.y = MMI_content_y;
  742.     MMI_fixed_list_menu.width = MMI_content_width;
  743.     MMI_fixed_list_menu.height = MMI_content_height;
  744. }   /* end of dm_reset_inline_fixed_list_coordinates */
  745. /*****************************************************************************
  746.  * FUNCTION
  747.  *  dm_reset_lsk_coordinates
  748.  * DESCRIPTION
  749.  *  Reset function for the lsk coordinates so that other category screens get the original values only.
  750.  * PARAMETERS
  751.  *  void
  752.  * RETURNS
  753.  *  void
  754.  *****************************************************************************/
  755. void dm_reset_lsk_coordinates(void)
  756. {
  757.     /*----------------------------------------------------------------*/
  758.     /* Local Variables                                                */
  759.     /*----------------------------------------------------------------*/
  760.     /*----------------------------------------------------------------*/
  761.     /* Code Body                                                      */
  762.     /*----------------------------------------------------------------*/
  763.     MMI_softkeys[MMI_LEFT_SOFTKEY].x = 0;
  764.     MMI_softkeys[MMI_LEFT_SOFTKEY].y = UI_device_height - MMI_softkey_height;
  765.     MMI_softkeys[MMI_LEFT_SOFTKEY].width = MMI_softkey_width;
  766.     MMI_softkeys[MMI_LEFT_SOFTKEY].height = MMI_softkey_height;
  767. }   /* end of dm_reset_lsk_coordinates */
  768. /*****************************************************************************
  769.  * FUNCTION
  770.  *  dm_reset_rsk_coordinates
  771.  * DESCRIPTION
  772.  *  Reset function for the rsk coordinates so that other category screens get the original values only.
  773.  * PARAMETERS
  774.  *  void
  775.  * RETURNS
  776.  *  void
  777.  *****************************************************************************/
  778. void dm_reset_rsk_coordinates(void)
  779. {
  780.     /*----------------------------------------------------------------*/
  781.     /* Local Variables                                                */
  782.     /*----------------------------------------------------------------*/
  783.     /*----------------------------------------------------------------*/
  784.     /* Code Body                                                      */
  785.     /*----------------------------------------------------------------*/
  786.     MMI_softkeys[MMI_RIGHT_SOFTKEY].x = UI_device_width - MMI_softkey_width;
  787.     MMI_softkeys[MMI_RIGHT_SOFTKEY].y = UI_device_height - MMI_softkey_height;
  788.     MMI_softkeys[MMI_RIGHT_SOFTKEY].width = MMI_softkey_width;
  789.     MMI_softkeys[MMI_RIGHT_SOFTKEY].height = MMI_softkey_height;
  790. }   /* end of dm_reset_rsk_coordinates */
  791. /*****************************************************************************
  792.  * FUNCTION
  793.  *  dm_reset_multitaps_coordinates
  794.  * DESCRIPTION
  795.  *  Reset function for the multitap coordinates so that other category screens get the original values only.
  796.  * PARAMETERS
  797.  *  void
  798.  * RETURNS
  799.  *  void
  800.  *****************************************************************************/
  801. void dm_reset_multitaps_coordinates(void)
  802. {
  803.     /*----------------------------------------------------------------*/
  804.     /* Local Variables                                                */
  805.     /*----------------------------------------------------------------*/
  806.     /*----------------------------------------------------------------*/
  807.     /* Code Body                                                      */
  808.     /*----------------------------------------------------------------*/
  809.     set_numberless_multitap();
  810.     set_normal_multitap();
  811. }   /* end of dm_reset_multitaps_coordinates */
  812. /*****************************************************************************
  813.  * FUNCTION
  814.  *  dm_update_multitap_coordinates
  815.  * DESCRIPTION
  816.  *  This function updates the multitap coordinates depending on the multitap coordinates
  817.  * PARAMETERS
  818.  *  dm_multiline_inputbox_info      [IN]        Multiline inputbox information structure.
  819.  *  dm_cat_scr_info                 [IN]        Category Screen information structure.
  820.  * RETURNS
  821.  *  void
  822.  *****************************************************************************/
  823. void dm_update_multitap_coordinates(
  824.         dm_coordinates *dm_multiline_inputbox_info,
  825.         dm_cat_scr_info_struct *dm_cat_scr_info)
  826. {
  827.     /*----------------------------------------------------------------*/
  828.     /* Local Variables                                                */
  829.     /*----------------------------------------------------------------*/
  830.     U8 u8MultiTapCt = 0;
  831.     /*----------------------------------------------------------------*/
  832.     /* Code Body                                                      */
  833.     /*----------------------------------------------------------------*/
  834.     /* Move the multitap depending on inputbox coordinates */
  835.     for (u8MultiTapCt = 0; u8MultiTapCt < MAX_MULTITAPS; u8MultiTapCt++)
  836.     {
  837.         multitap_input *ami = NULL;
  838.         switch (MMI_current_multitap_mode)
  839.         {
  840.             case 0:
  841.                 ami = &MMI_uppercase_multitaps[u8MultiTapCt];
  842.                 break;
  843.             case 1:
  844.                 ami = &MMI_lowercase_multitaps[u8MultiTapCt];
  845.                 break;
  846.                 /* MTK Elvis to add two more multitap modes */
  847.             case INPUT_MODE_MMI_MULTITAP_BPMF:
  848.                 ami = &MMI_bpmf_multitaps[u8MultiTapCt];
  849.                 break;
  850.             case INPUT_MODE_MMI_MULTITAP_PINYIN:
  851.                 ami = &MMI_lowercase_multitaps[u8MultiTapCt];
  852.                 break;
  853.             case INPUT_MODE_MMI_LOWERCASE_ABC:
  854.                 ami = &MMI_lowercase_multitaps[u8MultiTapCt];
  855.                 /* MTK end */
  856.         #if defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__)
  857.             case INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC:
  858.                 ami = &MMI_uppercase_numberless_multitaps[u8MultiTapCt];
  859.                 break;
  860.             case INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC:
  861.                 ami = &MMI_lowercase_numberless_multitaps[u8MultiTapCt];
  862.                 break;
  863.         #endif /* defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__) */ 
  864.                 /* MTK Terry for Spanish French German Italian */
  865.         #if defined(__MMI_MULTITAP_SPANISH__)
  866.             case INPUT_MODE_MULTITAP_UPPERCASE_SPANISH:
  867.                 ami = &MMI_spanish_uppercase_multitaps[u8MultiTapCt];
  868.                 break;
  869.             case INPUT_MODE_MULTITAP_LOWERCASE_SPANISH:
  870.                 ami = &MMI_spanish_lowercase_multitaps[u8MultiTapCt];
  871.                 break;
  872.             case INPUT_MODE_MMI_LOWERCASE_SPANISH:
  873.                 ami = &MMI_spanish_lowercase_multitaps[u8MultiTapCt];
  874.                 break;
  875.         #endif /* defined(__MMI_MULTITAP_SPANISH__) */ 
  876.                 /* PMT CZ_PO_TU START 20050812 */
  877.         #if defined(__MMI_MULTITAP_POLISH__)
  878.             case INPUT_MODE_MULTITAP_UPPERCASE_POLISH:
  879.                 ami = &MMI_polish_uppercase_multitaps[u8MultiTapCt];
  880.                 break;
  881.             case INPUT_MODE_MULTITAP_LOWERCASE_POLISH:
  882.                 ami = &MMI_polish_lowercase_multitaps[u8MultiTapCt];
  883.                 break;
  884.             case INPUT_MODE_MMI_LOWERCASE_POLISH:
  885.                 ami = &MMI_polish_lowercase_multitaps[u8MultiTapCt];
  886.                 break;
  887.         #endif /* defined(__MMI_MULTITAP_POLISH__) */ 
  888.                 //PMT CZ_PO_TU END 20050812     
  889.                 //PMT CZ_PO_TU START 20050812   
  890.         #if defined(__MMI_MULTITAP_CZECH__)
  891.             case INPUT_MODE_MULTITAP_UPPERCASE_CZECH:
  892.                 ami = &MMI_czech_uppercase_multitaps[u8MultiTapCt];
  893.                 break;
  894.             case INPUT_MODE_MULTITAP_LOWERCASE_CZECH:
  895.                 ami = &MMI_czech_lowercase_multitaps[u8MultiTapCt];
  896.                 break;
  897.             case INPUT_MODE_MMI_LOWERCASE_CZECH:
  898.                 ami = &MMI_czech_lowercase_multitaps[u8MultiTapCt];
  899.                 break;
  900.         #endif /* defined(__MMI_MULTITAP_CZECH__) */ 
  901.                 //PMT CZ_PO_TU END 20050812     
  902.                 //PMT CZ_PO_TU START 20050812    
  903.         #if defined(__MMI_MULTITAP_TURKISH__)
  904.             case INPUT_MODE_MULTITAP_UPPERCASE_TURKISH:
  905.                 ami = &MMI_turkish_uppercase_multitaps[u8MultiTapCt];
  906.                 break;
  907.             case INPUT_MODE_MULTITAP_LOWERCASE_TURKISH:
  908.                 ami = &MMI_turkish_lowercase_multitaps[u8MultiTapCt];
  909.                 break;
  910.             case INPUT_MODE_MMI_LOWERCASE_TURKISH:
  911.                 ami = &MMI_turkish_lowercase_multitaps[u8MultiTapCt];
  912.                 break;
  913.         #endif /* defined(__MMI_MULTITAP_TURKISH__) */ 
  914.                 /* PMT CZ_PO_TU END 20050812 */
  915.         #if defined(__MMI_MULTITAP_FRENCH__)
  916.             case INPUT_MODE_MULTITAP_UPPERCASE_FRENCH:
  917.                 ami = &MMI_french_uppercase_multitaps[u8MultiTapCt];
  918.                 break;
  919.             case INPUT_MODE_MULTITAP_LOWERCASE_FRENCH:
  920.                 ami = &MMI_french_lowercase_multitaps[u8MultiTapCt];
  921.                 break;
  922.             case INPUT_MODE_MMI_LOWERCASE_FRENCH:
  923.                 ami = &MMI_french_lowercase_multitaps[u8MultiTapCt];
  924.                 break;
  925.         #endif /* defined(__MMI_MULTITAP_FRENCH__) */ 
  926.         #if defined(__MMI_MULTITAP_GERMAN__)
  927.             case INPUT_MODE_MULTITAP_UPPERCASE_GERMAN:
  928.                 ami = &MMI_german_uppercase_multitaps[u8MultiTapCt];
  929.                 break;
  930.             case INPUT_MODE_MULTITAP_LOWERCASE_GERMAN:
  931.                 ami = &MMI_german_lowercase_multitaps[u8MultiTapCt];
  932.                 break;
  933.             case INPUT_MODE_MMI_LOWERCASE_GERMAN:
  934.                 ami = &MMI_german_lowercase_multitaps[u8MultiTapCt];
  935.                 break;
  936.         #endif /* defined(__MMI_MULTITAP_GERMAN__) */ 
  937.         #if defined(__MMI_MULTITAP_ITALIAN__)
  938.             case INPUT_MODE_MULTITAP_UPPERCASE_ITALIAN:
  939.                 ami = &MMI_italian_uppercase_multitaps[u8MultiTapCt];
  940.                 break;
  941.             case INPUT_MODE_MULTITAP_LOWERCASE_ITALIAN:
  942.                 ami = &MMI_italian_lowercase_multitaps[u8MultiTapCt];
  943.                 break;
  944.             case INPUT_MODE_MMI_LOWERCASE_ITALIAN:
  945.                 ami = &MMI_italian_lowercase_multitaps[u8MultiTapCt];
  946.                 break;
  947.         #endif /* defined(__MMI_MULTITAP_ITALIAN__) */ 
  948.                 /* PMT BHASKAR START 20052907 */
  949.         #if defined(__MMI_MULTITAP_VIETNAMESE__)
  950.             case INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE:
  951.                 ami = &MMI_vietnamese_uppercase_multitaps[u8MultiTapCt];
  952.                 break;
  953.             case INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE:
  954.                 ami = &MMI_vietnamese_lowercase_multitaps[u8MultiTapCt];
  955.                 break;
  956.             case INPUT_MODE_MMI_LOWERCASE_VIETNAMESE:
  957.                 ami = &MMI_vietnamese_lowercase_multitaps[u8MultiTapCt];
  958.                 break;
  959.         #endif /* defined(__MMI_MULTITAP_VIETNAMESE__) */ 
  960.                 /* PMT BHASKAR END 20052907 */
  961.                 /* PMT Gurdev Start 20050729 */
  962.         #if defined(__MMI_MULTITAP_INDONESIAN__)
  963.             case INPUT_MODE_MULTITAP_UPPERCASE_INDONESIAN:
  964.                 ami = &MMI_indonesian_uppercase_multitaps[u8MultiTapCt];
  965.                 break;
  966.             case INPUT_MODE_MULTITAP_LOWERCASE_INDONESIAN:
  967.                 ami = &MMI_indonesian_lowercase_multitaps[u8MultiTapCt];
  968.                 break;
  969.             case INPUT_MODE_MMI_LOWERCASE_INDONESIAN:
  970.                 ami = &MMI_indonesian_lowercase_multitaps[u8MultiTapCt];
  971.                 break;
  972.         #endif /* defined(__MMI_MULTITAP_INDONESIAN__) */ 
  973.                 //PMT Gurdev End 20050729
  974.                 //MTK end
  975.                 //MTK end
  976.                 //PMT VIKASG START 20050729
  977.         #if defined(__MMI_MULTITAP_DANISH__)
  978.             case INPUT_MODE_MULTITAP_UPPERCASE_DANISH:
  979.                 ami = &MMI_danish_uppercase_multitaps[u8MultiTapCt];
  980.                 break;
  981.             case INPUT_MODE_MULTITAP_LOWERCASE_DANISH:
  982.                 ami = &MMI_danish_lowercase_multitaps[u8MultiTapCt];
  983.                 break;
  984.             case INPUT_MODE_MMI_LOWERCASE_DANISH:
  985.                 ami = &MMI_danish_lowercase_multitaps[u8MultiTapCt];
  986.                 break;
  987.         #endif /* defined(__MMI_MULTITAP_DANISH__) */ 
  988.                 /* PMT VIKASG END 20050729 */
  989.                 /* PMT SHARIQ START 20050729 */
  990.         #if defined(__MMI_MULTITAP_PORTUGUESE__)
  991.             case INPUT_MODE_MULTITAP_UPPERCASE_PORTUGUESE:
  992.                 ami = &MMI_portuguese_uppercase_multitaps[u8MultiTapCt];
  993.                 break;
  994.             case INPUT_MODE_MULTITAP_LOWERCASE_PORTUGUESE:
  995.                 ami = &MMI_portuguese_lowercase_multitaps[u8MultiTapCt];
  996.                 break;
  997.             case INPUT_MODE_MMI_LOWERCASE_PORTUGUESE:
  998.                 ami = &MMI_portuguese_lowercase_multitaps[u8MultiTapCt];
  999.                 break;
  1000.         #endif /* defined(__MMI_MULTITAP_PORTUGUESE__) */ 
  1001.                 //PMT SHARIQ END 20050729
  1002.                 //PMT START HU_FI 20050825
  1003.         #if defined(__MMI_MULTITAP_FINNISH__)
  1004.             case INPUT_MODE_MULTITAP_UPPERCASE_FINNISH:
  1005.                 ami = &MMI_finnish_uppercase_multitaps[u8MultiTapCt];
  1006.                 break;
  1007.             case INPUT_MODE_MULTITAP_LOWERCASE_FINNISH:
  1008.                 ami = &MMI_finnish_lowercase_multitaps[u8MultiTapCt];
  1009.                 break;
  1010.             case INPUT_MODE_MMI_LOWERCASE_FINNISH:
  1011.                 ami = &MMI_finnish_lowercase_multitaps[u8MultiTapCt];
  1012.                 break;
  1013.         #endif /* defined(__MMI_MULTITAP_FINNISH__) */ 
  1014.                 //PMT END HU_FI 20050825
  1015.                 //PMT NO_AR_SL_DU START 20050909
  1016.         #if defined(__MMI_MULTITAP_SLOVAK__)
  1017.             case INPUT_MODE_MULTITAP_UPPERCASE_SLOVAK:
  1018.                 ami = &MMI_slovak_uppercase_multitaps[u8MultiTapCt];
  1019.                 break;
  1020.             case INPUT_MODE_MULTITAP_LOWERCASE_SLOVAK:
  1021.                 ami = &MMI_slovak_lowercase_multitaps[u8MultiTapCt];
  1022.                 break;
  1023.             case INPUT_MODE_MMI_LOWERCASE_SLOVAK:
  1024.                 ami = &MMI_slovak_lowercase_multitaps[u8MultiTapCt];
  1025.                 break;
  1026.         #endif /* defined(__MMI_MULTITAP_SLOVAK__) */ 
  1027.         #if defined(__MMI_MULTITAP_DUTCH__)
  1028.             case INPUT_MODE_MULTITAP_UPPERCASE_DUTCH:
  1029.                 ami = &MMI_dutch_uppercase_multitaps[u8MultiTapCt];
  1030.                 break;
  1031.             case INPUT_MODE_MULTITAP_LOWERCASE_DUTCH:
  1032.                 ami = &MMI_dutch_lowercase_multitaps[u8MultiTapCt];
  1033.                 break;
  1034.             case INPUT_MODE_MMI_LOWERCASE_DUTCH:
  1035.                 ami = &MMI_dutch_lowercase_multitaps[u8MultiTapCt];
  1036.                 break;
  1037.         #endif /* defined(__MMI_MULTITAP_DUTCH__) */ 
  1038.                 /* PMT BULGARIAN START 20051201 */
  1039.         #if defined(__MMI_MULTITAP_BULGARIAN__)
  1040.             case INPUT_MODE_MULTITAP_UPPERCASE_BULGARIAN:
  1041.                 ami = &MMI_bulgarian_uppercase_multitaps[u8MultiTapCt];
  1042.                 break;
  1043.             case INPUT_MODE_MULTITAP_LOWERCASE_BULGARIAN:
  1044.                 ami = &MMI_bulgarian_lowercase_multitaps[u8MultiTapCt];
  1045.                 break;
  1046.             case INPUT_MODE_MMI_LOWERCASE_BULGARIAN:
  1047.                 ami = &MMI_bulgarian_lowercase_multitaps[u8MultiTapCt];
  1048.                 break;
  1049.         #endif /* defined(__MMI_MULTITAP_BULGARIAN__) */ 
  1050.                 /* PMT BULGARIAN END 20051201 */
  1051.         #if defined(__MMI_MULTITAP_ARABIC__)
  1052.             case INPUT_MODE_MULTITAP_ARABIC:
  1053.                 ami = &MMI_arabic_multitaps[u8MultiTapCt];
  1054.                 break;
  1055.         #endif /* defined(__MMI_MULTITAP_ARABIC__) */
  1056.         /* PMT START PERSIAN */
  1057.         #if defined(__MMI_MULTITAP_PERSIAN__)
  1058.             case INPUT_MODE_MULTITAP_PERSIAN:
  1059.                 ami = &MMI_persian_multitaps[u8MultiTapCt];
  1060.                 break;
  1061.         #endif /* defined(__MMI_MULTITAP_PERSIAN__) */ 
  1062.         //PMT END PERSIAN 
  1063.                 /* Norwegian start */
  1064.         #if defined(__MMI_MULTITAP_NORWEGIAN__)
  1065.             case INPUT_MODE_MULTITAP_UPPERCASE_NORWEGIAN:
  1066.                 ami = &MMI_norwegian_uppercase_multitaps[u8MultiTapCt];
  1067.                 break;
  1068.             case INPUT_MODE_MULTITAP_LOWERCASE_NORWEGIAN:
  1069.                 ami = &MMI_norwegian_lowercase_multitaps[u8MultiTapCt];
  1070.                 break;
  1071.             case INPUT_MODE_MMI_LOWERCASE_NORWEGIAN:
  1072.                 ami = &MMI_norwegian_lowercase_multitaps[u8MultiTapCt];
  1073.                 break;
  1074.         #endif /* defined(__MMI_MULTITAP_NORWEGIAN__) */ 
  1075.                 //Norwegian end
  1076.                 //PMT NO_AR_SL_DU END 20050909
  1077.                 //PMT START SWEDISH 20050916
  1078.         #if defined(__MMI_MULTITAP_SWEDISH__)
  1079.             case INPUT_MODE_MULTITAP_UPPERCASE_SWEDISH:
  1080.                 ami = &MMI_swedish_uppercase_multitaps[u8MultiTapCt];
  1081.                 break;
  1082.             case INPUT_MODE_MULTITAP_LOWERCASE_SWEDISH:
  1083.                 ami = &MMI_swedish_lowercase_multitaps[u8MultiTapCt];
  1084.                 break;
  1085.             case INPUT_MODE_MMI_LOWERCASE_SWEDISH:
  1086.                 ami = &MMI_swedish_lowercase_multitaps[u8MultiTapCt];
  1087.                 break;
  1088.         #endif /* defined(__MMI_MULTITAP_SWEDISH__) */ 
  1089.                 //PMT END SWEDISH 20050916
  1090.                 //PMT START CR_ROM_SLO 20050923
  1091.         #if defined(__MMI_MULTITAP_CROATIAN__)
  1092.             case INPUT_MODE_MULTITAP_UPPERCASE_CROATIAN:
  1093.                 ami = &MMI_croatian_uppercase_multitaps[u8MultiTapCt];
  1094.                 break;
  1095.             case INPUT_MODE_MULTITAP_LOWERCASE_CROATIAN:
  1096.                 ami = &MMI_croatian_lowercase_multitaps[u8MultiTapCt];
  1097.                 break;
  1098.             case INPUT_MODE_MMI_LOWERCASE_CROATIAN:
  1099.                 ami = &MMI_croatian_lowercase_multitaps[u8MultiTapCt];
  1100.                 break;
  1101.         #endif /* defined(__MMI_MULTITAP_CROATIAN__) */ 
  1102.         #if defined(__MMI_MULTITAP_ROMANIAN__)
  1103.             case INPUT_MODE_MULTITAP_UPPERCASE_ROMANIAN:
  1104.                 ami = &MMI_romanian_uppercase_multitaps[u8MultiTapCt];
  1105.                 break;
  1106.             case INPUT_MODE_MULTITAP_LOWERCASE_ROMANIAN:
  1107.                 ami = &MMI_romanian_lowercase_multitaps[u8MultiTapCt];
  1108.                 break;
  1109.             case INPUT_MODE_MMI_LOWERCASE_ROMANIAN:
  1110.                 ami = &MMI_romanian_lowercase_multitaps[u8MultiTapCt];
  1111.                 break;
  1112.         #endif /* defined(__MMI_MULTITAP_ROMANIAN__) */ 
  1113.         #if defined(__MMI_MULTITAP_SLOVENIAN__)
  1114.             case INPUT_MODE_MULTITAP_UPPERCASE_SLOVENIAN:
  1115.                 ami = &MMI_slovenian_uppercase_multitaps[u8MultiTapCt];
  1116.                 break;
  1117.             case INPUT_MODE_MULTITAP_LOWERCASE_SLOVENIAN:
  1118.                 ami = &MMI_slovenian_lowercase_multitaps[u8MultiTapCt];
  1119.                 break;
  1120.             case INPUT_MODE_MMI_LOWERCASE_SLOVENIAN:
  1121.                 ami = &MMI_slovenian_lowercase_multitaps[u8MultiTapCt];
  1122.                 break;
  1123.         #endif /* defined(__MMI_MULTITAP_SLOVENIAN__) */ 
  1124.                 //PMT END CR_ROM_SLO 20050923
  1125.                 //PMT START GR_HE_CZ_FI_DA_HU 20051007
  1126.         #if defined(__MMI_MULTITAP_GREEK__)
  1127.             case INPUT_MODE_MULTITAP_UPPERCASE_GREEK:
  1128.                 ami = &MMI_greek_uppercase_multitaps[u8MultiTapCt];
  1129.                 break;
  1130.             case INPUT_MODE_MULTITAP_LOWERCASE_GREEK:
  1131.                 ami = &MMI_greek_lowercase_multitaps[u8MultiTapCt];
  1132.                 break;
  1133.             case INPUT_MODE_MMI_LOWERCASE_GREEK:
  1134.                 ami = &MMI_greek_lowercase_multitaps[u8MultiTapCt];
  1135.                 break;
  1136.         #endif /* defined(__MMI_MULTITAP_GREEK__) */ 
  1137.         #if defined(__MMI_MULTITAP_HUNGARIAN__)
  1138.             case INPUT_MODE_MULTITAP_UPPERCASE_HUNGARIAN:
  1139.                 ami = &MMI_hungarian_uppercase_multitaps[u8MultiTapCt];
  1140.                 break;
  1141.             case INPUT_MODE_MULTITAP_LOWERCASE_HUNGARIAN:
  1142.                 ami = &MMI_hungarian_lowercase_multitaps[u8MultiTapCt];
  1143.                 break;
  1144.             case INPUT_MODE_MMI_LOWERCASE_HUNGARIAN:
  1145.                 ami = &MMI_hungarian_lowercase_multitaps[u8MultiTapCt];
  1146.                 break;
  1147.         #endif /* defined(__MMI_MULTITAP_HUNGARIAN__) */ 
  1148.                 /* PMT END GR_HE_CZ_FI_DA_HU 20051007 */
  1149.             default:
  1150.                 PRINT_INFORMATION(("nWARNING: Control should never come here."));
  1151.         }
  1152.         if (ami != NULL)
  1153.         {
  1154.             ami->x = dm_multiline_inputbox_info->s16X + 2;
  1155.             ami->y = dm_multiline_inputbox_info->s16Y + dm_multiline_inputbox_info->s16Height - MMI_multitap_height;    /* This should be with wrt to Multiline inputbox */
  1156.             /* ami->y = dm_cat_scr_info->s16Y1 + dm_multiline_inputbox_info->coordinate.s16Height;          //This is with respect to starting of the category screen which is 0 by default so dm_cat_scr_info.s32Y1 is added */
  1157.             ami->width = dm_multiline_inputbox_info->s16Width - 4;
  1158.             ami->height = MMI_multitap_height;
  1159.         }
  1160.     }
  1161. }   /* end of dm_update_multitap_coordinates */
  1162. /*****************************************************************************
  1163.  * FUNCTION
  1164.  *  dm_register_category_controlled_callback
  1165.  * DESCRIPTION
  1166.  *  Register the callback function for category controlled area
  1167.  * PARAMETERS
  1168.  *  f       [IN]        Callback function
  1169.  * RETURNS
  1170.  *  void
  1171.  *****************************************************************************/
  1172. void dm_register_category_controlled_callback(void (*f) (dm_coordinates *coordinate))
  1173. {
  1174.     /*----------------------------------------------------------------*/
  1175.     /* Local Variables                                                */
  1176.     /*----------------------------------------------------------------*/
  1177.     /*----------------------------------------------------------------*/
  1178.     /* Code Body                                                      */
  1179.     /*----------------------------------------------------------------*/
  1180.     dm_category_controlled_area_callback = f;
  1181. }   /* end of dm_register_category_controlled_callback */
  1182. /*****************************************************************************
  1183.  * FUNCTION
  1184.  *  dm_register_category_controlled2_callback
  1185.  * DESCRIPTION
  1186.  *  Register the callback function for category controlled area2
  1187.  * PARAMETERS
  1188.  *  f       [IN]        Callback function
  1189.  * RETURNS
  1190.  *  void
  1191.  *****************************************************************************/
  1192. void dm_register_category_controlled2_callback(void (*f) (dm_coordinates *coordinate))
  1193. {
  1194.     /*----------------------------------------------------------------*/
  1195.     /* Local Variables                                                */
  1196.     /*----------------------------------------------------------------*/
  1197.     /*----------------------------------------------------------------*/
  1198.     /* Code Body                                                      */
  1199.     /*----------------------------------------------------------------*/
  1200.     dm_category_controlled_area2_callback = f;
  1201. }   /* end of dm_register_category_controlled_callback */
  1202. /*****************************************************************************
  1203.  * FUNCTION
  1204.  *  dm_reset_category_controlled_callback
  1205.  * DESCRIPTION
  1206.  *  Reset the callback function for category controlled area.
  1207.  * PARAMETERS
  1208.  *  void
  1209.  * RETURNS
  1210.  *  void
  1211.  *****************************************************************************/
  1212. void dm_reset_category_controlled_callback(void)
  1213. {
  1214.     /*----------------------------------------------------------------*/
  1215.     /* Local Variables                                                */
  1216.     /*----------------------------------------------------------------*/
  1217.     /*----------------------------------------------------------------*/
  1218.     /* Code Body                                                      */
  1219.     /*----------------------------------------------------------------*/
  1220.     dm_category_controlled_area_callback = NULL;
  1221.     dm_category_controlled_area2_callback = NULL;
  1222. }   /* end of dm_reset_category_controlled_callback */
  1223. #ifdef __MMI_SUBLCD__
  1224. /*****************************************************************************
  1225.  * FUNCTION
  1226.  *  dm_register_sub_category_controlled_callback
  1227.  * DESCRIPTION
  1228.  *  Register the callback function for category controlled area
  1229.  * PARAMETERS
  1230.  *  f       [IN]        Callback function
  1231.  * RETURNS
  1232.  *  void
  1233.  *****************************************************************************/
  1234. void dm_register_sub_category_controlled_callback(void (*f) (dm_coordinates *coordinate))
  1235. {
  1236.     /*----------------------------------------------------------------*/
  1237.     /* Local Variables                                                */
  1238.     /*----------------------------------------------------------------*/
  1239.     /*----------------------------------------------------------------*/
  1240.     /* Code Body                                                      */
  1241.     /*----------------------------------------------------------------*/
  1242.     dm_sub_category_controlled_area_callback = f;
  1243. }   /* end of dm_register_sub_category_controlled_callback */
  1244. /*****************************************************************************
  1245.  * FUNCTION
  1246.  *  dm_reset_sub_category_controlled_callback
  1247.  * DESCRIPTION
  1248.  *  Reset the callback function for category controlled area.
  1249.  * PARAMETERS
  1250.  *  void
  1251.  * RETURNS
  1252.  *  void
  1253.  *****************************************************************************/
  1254. void dm_reset_sub_category_controlled_callback(void)
  1255. {
  1256.     /*----------------------------------------------------------------*/
  1257.     /* Local Variables                                                */
  1258.     /*----------------------------------------------------------------*/
  1259.     /*----------------------------------------------------------------*/
  1260.     /* Code Body                                                      */
  1261.     /*----------------------------------------------------------------*/
  1262.     dm_sub_category_controlled_area_callback = NULL;
  1263. }   /* end of dm_reset_sub_category_controlled_callback */
  1264. #endif /* __MMI_SUBLCD__ */ 
  1265. /*****************************************************************************
  1266.  * FUNCTION
  1267.  *  dm_reset_str_image
  1268.  * DESCRIPTION
  1269.  *  This function ius used to reset the image and string areas count to 0.
  1270.  * PARAMETERS
  1271.  *  void
  1272.  *  UICtrlAccessPtr_p(?)        [IN/OUT]        It specifies the start position to take out the coordinates.
  1273.  *  *(?)
  1274.  * RETURNS
  1275.  *  void
  1276.  *****************************************************************************/
  1277. void dm_reset_str_image(void)
  1278. {
  1279.     /*----------------------------------------------------------------*/
  1280.     /* Local Variables                                                */
  1281.     /*----------------------------------------------------------------*/
  1282.     /*----------------------------------------------------------------*/
  1283.     /* Code Body                                                      */
  1284.     /*----------------------------------------------------------------*/
  1285.     dm_string_count = 0;
  1286.     dm_image_count = 0;
  1287.     dm_back_fill_count = 0;
  1288.     dm_rectangle_count = 0;
  1289.     dm_line_count = 0;
  1290. }
  1291. #if (0)
  1292. /* under construction !*/
  1293. /* under construction !*/
  1294. /* under construction !*/
  1295. /* under construction !*/
  1296. /* under construction !*/
  1297. /* under construction !*/
  1298. /* under construction !*/
  1299. /* under construction !*/
  1300. /* under construction !*/
  1301. /* under construction !*/
  1302. /* under construction !*/
  1303. /* under construction !*/
  1304. /* under construction !*/
  1305. /* under construction !*/
  1306. /* under construction !*/
  1307. /* under construction !*/
  1308. /* under construction !*/
  1309. /* under construction !*/
  1310. /* under construction !*/
  1311. /* under construction !*/
  1312. /* under construction !*/
  1313. /* under construction !*/
  1314. /* under construction !*/
  1315. /* under construction !*/
  1316. /* under construction !*/
  1317. /* under construction !*/
  1318. /* under construction !*/
  1319. /* under construction !*/
  1320. /* under construction !*/
  1321. /* under construction !*/
  1322. /* under construction !*/
  1323. /* under construction !*/
  1324. /* under construction !*/
  1325. /* under construction !*/
  1326. /* under construction !*/
  1327. /* under construction !*/
  1328. /* under construction !*/
  1329. /* under construction !*/
  1330. /* under construction !*/
  1331. /* under construction !*/
  1332. /* under construction !*/
  1333. /* under construction !*/
  1334. /* under construction !*/
  1335. #endif /* (0) */ 
  1336. /*****************************************************************************
  1337.  * FUNCTION
  1338.  *  dm_add_image
  1339.  * DESCRIPTION
  1340.  *  This function is used to add image data. To be called by Category Screen
  1341.  * PARAMETERS
  1342.  *  img                         [IN]        
  1343.  *  image_name                  [IN]        
  1344.  *  background                  [IN]        Background Fill for the image
  1345.  *  transparent_color(?)        [IN]        Transparent Color for the Image
  1346.  *  image(?)                    [IN]        Image to be displayed.
  1347.  *  *(?)
  1348.  * RETURNS
  1349.  *  void
  1350.  *****************************************************************************/
  1351. void dm_add_image(PU8 img, UI_string_type image_name, UI_filled_area *background)
  1352. {
  1353.     /*----------------------------------------------------------------*/
  1354.     /* Local Variables                                                */
  1355.     /*----------------------------------------------------------------*/
  1356.     GDI_HANDLE act_lcd_handle;
  1357.     /*----------------------------------------------------------------*/
  1358.     /* Code Body                                                      */
  1359.     /*----------------------------------------------------------------*/
  1360.     /* img & image_name can't be NULL at the same time */
  1361.     /* MMI_ASSERT ( img!=NULL || image_name!=NULL ); */
  1362.     gdi_lcd_get_active(&act_lcd_handle);
  1363. #ifdef __MMI_SUBLCD__
  1364.     if (act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE)
  1365.     {
  1366.         MMI_ASSERT(dm_image_count_sub < DM_MAX_SUBLCD_IMAGES);
  1367.         dm_image_array_sub[dm_image_count_sub].back_fill = background;
  1368.         dm_image_array_sub[dm_image_count_sub].image = (PU8) img;
  1369.         dm_image_array_sub[dm_image_count_sub].name = image_name;
  1370.         dm_image_array_sub[dm_image_count_sub++].image_handle = GDI_ERROR_HANDLE;
  1371.     }
  1372.     else
  1373. #endif /* __MMI_SUBLCD__ */ 
  1374.     {
  1375.         MMI_ASSERT(dm_image_count < DM_MAX_IMAGES);
  1376.         dm_image_array[dm_image_count].back_fill = background;
  1377.         dm_image_array[dm_image_count].image = (PU8) img;
  1378.         dm_image_array[dm_image_count].name = image_name;
  1379.         dm_image_array[dm_image_count++].image_handle = GDI_ERROR_HANDLE;
  1380.     }
  1381. }
  1382. /*****************************************************************************
  1383.  * FUNCTION
  1384.  *  dm_get_image_handle
  1385.  * DESCRIPTION
  1386.  *  This function is used to get the animation handle. To be called by Category Screen
  1387.  * PARAMETERS
  1388.  *  count                       [IN]        the nummer of the animation
  1389.  * RETURNS
  1390.  *  gdi_handle
  1391.  *****************************************************************************/
  1392. gdi_handle dm_get_image_handle(S32 count)//070706 Cylen, SWFlash
  1393. {
  1394.     return dm_image_array[count].image_handle;
  1395. }
  1396. /*****************************************************************************
  1397.  * FUNCTION
  1398.  *  dm_change_image
  1399.  * DESCRIPTION
  1400.  *  This function is used to change image data. To be called by Category Screen
  1401.  * PARAMETERS
  1402.  *  image       [IN]        Image to be changed.
  1403.  *  name        [IN]        Image Name to be changed
  1404.  *  index       [IN]        Index in dm_image_struct
  1405.  *  *(?)
  1406.  * RETURNS
  1407.  *  void
  1408.  *****************************************************************************/
  1409. void dm_change_image(PU8 image, UI_string_type name, S32 index)
  1410. {
  1411.     /*----------------------------------------------------------------*/
  1412.     /* Local Variables                                                */
  1413.     /*----------------------------------------------------------------*/
  1414.     /*----------------------------------------------------------------*/
  1415.     /* Code Body                                                      */
  1416.     /*----------------------------------------------------------------*/
  1417.     /* Only image or name should be changed at one time */
  1418.     //      MMI_ASSERT ( ( name==NULL || image==NULL ) && ( name!= NULL || image!=NULL ) );
  1419.     //      if ( ( name!=NULL && image!=NULL ) || ( name== NULL && image==NULL ) )
  1420.     //              MMI_ASSERT(0);//Only one of two should be assigned.
  1421.     /* undefined image */
  1422.     MMI_ASSERT(index < dm_image_count);
  1423.     dm_image_array[index].image = image;
  1424.     dm_image_array[index].name = name;
  1425. }
  1426. /*****************************************************************************
  1427.  * FUNCTION
  1428.  *  dm_add_string
  1429.  * DESCRIPTION
  1430.  *  This function is used to add string data. To be called by Category Screen
  1431.  * PARAMETERS
  1432.  *  string              [IN]        String to be displayed.
  1433.  *  font                [IN]        Font to be used to draw the string
  1434.  *  text_color          [IN]        Text Color for the string
  1435.  *  border_color        [IN]        Border Color for the string
  1436.  *  background          [IN]        Background Fill for the string
  1437.  *  *(?)
  1438.  * RETURNS
  1439.  *  void
  1440.  *****************************************************************************/
  1441. void dm_add_string(
  1442.         UI_string_type string,
  1443.         UI_font_type font,
  1444.         color text_color,
  1445.         color border_color,
  1446.         UI_filled_area *background)
  1447. {
  1448.     /*----------------------------------------------------------------*/
  1449.     /* Local Variables                                                */
  1450.     /*----------------------------------------------------------------*/
  1451.     GDI_HANDLE act_lcd_handle;
  1452.     /*----------------------------------------------------------------*/
  1453.     /* Code Body                                                      */
  1454.     /*----------------------------------------------------------------*/
  1455.     gdi_lcd_get_active(&act_lcd_handle);
  1456. #ifdef __MMI_SUBLCD__
  1457.     if (act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE)
  1458.     {
  1459.         MMI_ASSERT(dm_string_count_sub < DM_MAX_SUBLCD_STRINGS);
  1460.         dm_string_array_sub[dm_string_count_sub].text_color = text_color;
  1461.         dm_string_array_sub[dm_string_count_sub].border_color = border_color;
  1462.         dm_string_array_sub[dm_string_count_sub].font = font;
  1463.         if (background)
  1464.         {
  1465.             dm_string_array_sub[dm_string_count_sub].back_fill = *background;
  1466.         }
  1467.         dm_string_array_sub[dm_string_count_sub++].string = string;
  1468.     }
  1469.     else
  1470. #endif /* __MMI_SUBLCD__ */ 
  1471.     {
  1472.         MMI_ASSERT(dm_string_count < DM_MAX_STRINGS);
  1473.         dm_string_array[dm_string_count].text_color = text_color;
  1474.         dm_string_array[dm_string_count].border_color = border_color;
  1475.         dm_string_array[dm_string_count].font = font;
  1476.         if (background)
  1477.         {
  1478.             dm_string_array[dm_string_count].back_fill = *background;
  1479.         }
  1480.         dm_string_array[dm_string_count++].string = string;
  1481.     }
  1482. }
  1483. /*****************************************************************************
  1484.  * FUNCTION
  1485.  *  dm_reset_button_bar_coordinates
  1486.  * DESCRIPTION
  1487.  *  This function resets button bar to its original height.
  1488.  *  Reuired till all categories are moved to Draw Manager
  1489.  * PARAMETERS
  1490.  *  void
  1491.  *  UICtrlAccessPtr_p(?)        [IN/OUT]        It specifies the start position to take out the coordinates.
  1492.  *  dm_image_info_struct I  N/OUT image area coordinate info.(?)
  1493.  * RETURNS
  1494.  *  void
  1495.  *****************************************************************************/
  1496. void dm_reset_button_bar_coordinates(void)
  1497. {
  1498.     /*----------------------------------------------------------------*/
  1499.     /* Local Variables                                                */
  1500.     /*----------------------------------------------------------------*/
  1501.     /*----------------------------------------------------------------*/
  1502.     /* Code Body                                                      */
  1503.     /*----------------------------------------------------------------*/
  1504.     set_button_bar_height(MMI_BUTTON_BAR_HEIGHT);
  1505.     /* Right softkey always have UI_BUTTON_RIGHT_ALIGN */
  1506.     set_softkey_flags_off(UI_BUTTON_RIGHT_ALIGN, MMI_LEFT_SOFTKEY);
  1507.     set_softkey_flags_on(UI_BUTTON_LEFT_ALIGN, MMI_LEFT_SOFTKEY);
  1508. #ifdef __MMI_WGUI_CSK_ENABLE__
  1509.     set_softkey_flags_off(UI_BUTTON_RIGHT_ALIGN, MMI_CENTER_SOFTKEY);
  1510. #endif 
  1511. }
  1512. /*****************************************************************************
  1513.  * FUNCTION
  1514.  *  dm_add_back_fill_area
  1515.  * DESCRIPTION
  1516.  *  This function is used to add back fill. To be called by Category Screen
  1517.  * PARAMETERS
  1518.  *  background      [IN]        Background Fill for the area
  1519.  *  *(?)
  1520.  * RETURNS
  1521.  *  void
  1522.  *****************************************************************************/
  1523. void dm_add_back_fill_area(UI_filled_area *background)
  1524. {
  1525.     /*----------------------------------------------------------------*/
  1526.     /* Local Variables                                                */
  1527.     /*----------------------------------------------------------------*/
  1528.     /*----------------------------------------------------------------*/
  1529.     /* Code Body                                                      */
  1530.     /*----------------------------------------------------------------*/
  1531.     if (dm_back_fill_count >= DM_MAX_FILL_AREAS)
  1532.     {
  1533.         return;
  1534.     }
  1535.     dm_back_fill_array[dm_back_fill_count++] = background;
  1536. }
  1537. /*****************************************************************************
  1538.  * FUNCTION
  1539.  *  dm_add_rectangle
  1540.  * DESCRIPTION
  1541.  *  This function is used to add rectangle. To be called by Category Screen
  1542.  * PARAMETERS
  1543.  *  line_color          [IN]        Color for the reactangle
  1544.  *  fill_rectangle      [IN]        In Whether the rectangle needs to be filled from inside
  1545.  *  *(?)
  1546.  * RETURNS
  1547.  *  void
  1548.  *****************************************************************************/
  1549. /* START VIJAY PMT 20050930 */
  1550. void dm_add_rectangle(color line_color, dm_rectangle_fill_style fill_rectangle)
  1551. /* END VIJAY PMT 20050930 */
  1552. {
  1553.     /*----------------------------------------------------------------*/
  1554.     /* Local Variables                                                */
  1555.     /*----------------------------------------------------------------*/
  1556.     /*----------------------------------------------------------------*/
  1557.     /* Code Body                                                      */
  1558.     /*----------------------------------------------------------------*/
  1559.     if (dm_rectangle_count >= DM_MAX_RECTANGLES)
  1560.     {
  1561.         return;
  1562.     }
  1563.     dm_rectangle_array[dm_rectangle_count].fill_rectangle = fill_rectangle;
  1564.     dm_rectangle_array[dm_rectangle_count++].line_color = line_color;
  1565. }
  1566. /*****************************************************************************
  1567.  * FUNCTION
  1568.  *  dm_add_line
  1569.  * DESCRIPTION
  1570.  *  This function is used to add line. To be called by Category Screen
  1571.  * PARAMETERS
  1572.  *  line_color      [IN]        Color for the reactangle
  1573.  *  *(?)
  1574.  * RETURNS
  1575.  *  void
  1576.  *****************************************************************************/
  1577. void dm_add_line(color line_color)
  1578. {
  1579.     /*----------------------------------------------------------------*/
  1580.     /* Local Variables                                                */
  1581.     /*----------------------------------------------------------------*/
  1582.     /*----------------------------------------------------------------*/
  1583.     /* Code Body                                                      */
  1584.     /*----------------------------------------------------------------*/
  1585.     if (dm_line_count >= DM_MAX_LINES)
  1586.     {
  1587.         return;
  1588.     }
  1589.     dm_line_array[dm_line_count++] = line_color;
  1590. }
  1591. /*****************************************************************************
  1592.  * FUNCTION
  1593.  *  dm_add_slide_control
  1594.  * DESCRIPTION
  1595.  *  This function is used to add slide control. To be called by Category Screen
  1596.  * PARAMETERS
  1597.  *  lower_limit         [IN]        
  1598.  *  upper_limit         [IN]        
  1599.  *  current_value       [IN]        
  1600.  *  change_callback     [IN]        
  1601.  *  label_string        [?]         
  1602.  *  line_color(?)       [IN]        Color for the reactangle
  1603.  * RETURNS
  1604.  *  void
  1605.  *****************************************************************************/
  1606. void dm_add_slide_control(
  1607.         S32 lower_limit,
  1608.         S32 upper_limit,
  1609.         S32 current_value,
  1610.         void (*change_callback) (S32 value),
  1611.         U8 *label_string)
  1612. {
  1613.     /*----------------------------------------------------------------*/
  1614.     /* Local Variables                                                */
  1615.     /*----------------------------------------------------------------*/
  1616.     /*----------------------------------------------------------------*/
  1617.     /* Code Body                                                      */
  1618.     /*----------------------------------------------------------------*/
  1619.     if (dm_slide_control_count >= MMI_MAX_SLIDE_CONTROL)
  1620.     {
  1621.         MMI_ASSERT(dm_slide_control_count < MMI_MAX_SLIDE_CONTROL);
  1622.         return;
  1623.     }
  1624.     wgui_setup_slide_control(
  1625.         &MMI_slide_control[dm_slide_control_count],
  1626.         0,
  1627.         0,
  1628.         lower_limit,
  1629.         upper_limit,
  1630.         current_value,
  1631.         change_callback);
  1632.     set_slide_control_label(&MMI_slide_control[dm_slide_control_count++], label_string);
  1633. }
  1634. /*****************************************************************************
  1635.  * FUNCTION
  1636.  *  dm_get_slide_control_count
  1637.  * DESCRIPTION
  1638.  *  This function is used to get count of active slide controls. To be called by Category Screen
  1639.  * PARAMETERS
  1640.  *  void
  1641.  * RETURNS
  1642.  *  S32
  1643.  *****************************************************************************/
  1644. S32 dm_get_slide_control_count(void)
  1645. {
  1646.     /*----------------------------------------------------------------*/
  1647.     /* Local Variables                                                */
  1648.     /*----------------------------------------------------------------*/
  1649.     /*----------------------------------------------------------------*/
  1650.     /* Code Body                                                      */
  1651.     /*----------------------------------------------------------------*/
  1652.     return dm_slide_control_count;
  1653. }
  1654. /*****************************************************************************
  1655.  * FUNCTION
  1656.  *  dm_scroll_text_handler
  1657.  * DESCRIPTION
  1658.  *  
  1659.  * PARAMETERS
  1660.  *  void
  1661.  * RETURNS
  1662.  *  void
  1663.  *****************************************************************************/
  1664. void dm_scroll_text_handler(void)
  1665. {
  1666.     /*----------------------------------------------------------------*/
  1667.     /* Local Variables                                                */
  1668.     /*----------------------------------------------------------------*/
  1669.     /*----------------------------------------------------------------*/
  1670.     /* Code Body                                                      */
  1671.     /*----------------------------------------------------------------*/
  1672.     gui_handle_scrolling_text(dm_current_scroll_text);
  1673. }
  1674. /*****************************************************************************
  1675.  * FUNCTION
  1676.  *  dm_add_scroll_text
  1677.  * DESCRIPTION
  1678.  *  This function is used to add scroll text. To be called by Category Screen
  1679.  * PARAMETERS
  1680.  *  text                [IN]        
  1681.  *  timer_callback      [IN]        
  1682.  *  draw_background     [IN]        
  1683.  *  text_color          [IN]        
  1684.  *  border_color        [IN]        
  1685.  *  line_color(?)       [IN]        Color for the reactangle
  1686.  * RETURNS
  1687.  *  void
  1688.  *****************************************************************************/
  1689. extern UI_string_type UI_strcpy(UI_string_type text1, UI_string_type text2);
  1690. void dm_add_scroll_text(
  1691.         UI_string_type text,
  1692.         void (*timer_callback) (void),
  1693.         void (*draw_background) (S32 x1, S32 y1, S32 x2, S32 y2),
  1694.         color text_color,
  1695.         color border_color)
  1696. {
  1697.     /*----------------------------------------------------------------*/
  1698.     /* Local Variables                                                */
  1699.     /*----------------------------------------------------------------*/
  1700.     S32 string_width = 0, string_height = 0;
  1701.     /*----------------------------------------------------------------*/
  1702.     /* Code Body                                                      */
  1703.     /*----------------------------------------------------------------*/
  1704.     if (dm_scroll_text_count >= DM_MAX_SCROLL_TEXT)
  1705.     {
  1706.         MMI_ASSERT(dm_scroll_text_count < DM_MAX_SCROLL_TEXT);
  1707.         return;
  1708.     }
  1709.     if (text == NULL)
  1710.     {
  1711.         dm_scroll_text_buf[dm_scroll_text_count][0] = 0;
  1712.         dm_scroll_text_buf[dm_scroll_text_count][1] = 0;
  1713.     }
  1714.     else
  1715.     {
  1716.         UI_strcpy((UI_string_type) dm_scroll_text_buf[dm_scroll_text_count], text);
  1717.         dm_current_scroll_text = &dm_scroll_text[dm_scroll_text_count];
  1718.         gui_measure_string(text, &string_width, &string_height);
  1719.         gui_create_scrolling_text(
  1720.             dm_current_scroll_text,
  1721.             20,
  1722.             20,
  1723.             string_width,
  1724.             string_height,
  1725.             (UI_string_type) dm_scroll_text_buf[dm_scroll_text_count++],
  1726.             dm_scroll_text_handler,
  1727.             draw_background,
  1728.             text_color,
  1729.             border_color);
  1730.         if (text_color.r != border_color.r || text_color.g != border_color.g || text_color.b != border_color.b)
  1731.         {
  1732.             dm_current_scroll_text->flags |= UI_SCROLLING_TEXT_BORDERED_TEXT;
  1733.         }
  1734.     }
  1735. }
  1736. /*****************************************************************************
  1737.  * FUNCTION
  1738.  *  dm_add_button
  1739.  * DESCRIPTION
  1740.  *  This function is used to add icon button. To be called by Category Screen
  1741.  * PARAMETERS
  1742.  *  text            [IN]        
  1743.  *  up_image        [IN]        Button up image
  1744.  *  down_image      [IN]        Button down image
  1745.  *  clear_fp        [IN]        
  1746.  * RETURNS
  1747.  *  U16         index
  1748.  *****************************************************************************/
  1749. U16 dm_add_button(UI_string_type text, PU8 up_image, PU8 down_image, gui_button_clear_background_hdlr clear_fp)
  1750. {
  1751.     /*----------------------------------------------------------------*/
  1752.     /* Local Variables                                                */
  1753.     /*----------------------------------------------------------------*/
  1754.     U16 curr_idx = dm_button_count++;
  1755.     /*----------------------------------------------------------------*/
  1756.     /* Code Body                                                      */
  1757.     /*----------------------------------------------------------------*/
  1758.     gui_create_icontext_button(&dm_button_array[curr_idx], -1, -1, -1, -1, text, up_image);
  1759.     dm_button_array[curr_idx].flags |= UI_BUTTON_DISABLE_BACKGND_DISPLAY | UI_BUTTON_SHIFT_BUTTON1;
  1760.     if (text != NULL)
  1761.     {
  1762.         dm_button_array[curr_idx].flags |= UI_BUTTON_CENTER_TEXT_X | UI_BUTTON_CENTER_TEXT_Y;
  1763.     }
  1764.     if (up_image != NULL || down_image != NULL)
  1765.     {
  1766.         dm_button_array[curr_idx].flags |= UI_BUTTON_CENTER_ICON_X | UI_BUTTON_CENTER_ICON_Y;
  1767.     }
  1768.     dm_button_array[curr_idx].clicked_down_icon = down_image;
  1769.     dm_button_array[curr_idx].clear_background_fp = clear_fp;
  1770.     return curr_idx;
  1771. }
  1772. /*****************************************************************************
  1773.  * FUNCTION
  1774.  *  dm_move_button
  1775.  * DESCRIPTION
  1776.  *  This function is used to move icon button. To be called by Category Screen
  1777.  * PARAMETERS
  1778.  *  index       [IN]        Index of dm_button_array
  1779.  *  x           [IN]        X coordinate
  1780.  *  y           [IN]        Y coordinate
  1781.  * RETURNS
  1782.  *  void
  1783.  *****************************************************************************/
  1784. void dm_move_button(U16 index, S32 x, S32 y)
  1785. {
  1786.     /*----------------------------------------------------------------*/
  1787.     /* Local Variables                                                */
  1788.     /*----------------------------------------------------------------*/
  1789.     /*----------------------------------------------------------------*/
  1790.     /* Code Body                                                      */
  1791.     /*----------------------------------------------------------------*/
  1792.     gui_move_icontext_button(&dm_button_array[dm_button_count], x, y);
  1793. }
  1794. /*****************************************************************************
  1795.  * FUNCTION
  1796.  *  dm_resize_button
  1797.  * DESCRIPTION
  1798.  *  This function is used to move icon button. To be called by Category Screen
  1799.  * PARAMETERS
  1800.  *  index       [IN]        Index of dm_button_array
  1801.  *  width       [IN]        Width of icon button
  1802.  *  height      [IN]        Height of icon button
  1803.  * RETURNS
  1804.  *  void
  1805.  *****************************************************************************/
  1806. void dm_resize_button(U16 index, S32 width, S32 height)
  1807. {
  1808.     /*----------------------------------------------------------------*/
  1809.     /* Local Variables                                                */
  1810.     /*----------------------------------------------------------------*/
  1811.     /*----------------------------------------------------------------*/
  1812.     /* Code Body                                                      */
  1813.     /*----------------------------------------------------------------*/
  1814.     gui_resize_icontext_button(&dm_button_array[dm_button_count], width, height);
  1815.     dm_button_array[dm_button_count].icon_x = 0;
  1816.     dm_button_array[dm_button_count].icon_y = 0;
  1817. }
  1818. /*****************************************************************************
  1819.  * FUNCTION
  1820.  *  dm_redraw_button
  1821.  * DESCRIPTION
  1822.  *  This function is used to redraw icon button. To be called by Category Screen
  1823.  * PARAMETERS
  1824.  *  index       [IN]        Index of dm_button_array
  1825.  * RETURNS
  1826.  *  void
  1827.  *****************************************************************************/
  1828. void dm_redraw_button(U16 index)
  1829. {
  1830.     /*----------------------------------------------------------------*/
  1831.     /* Local Variables                                                */
  1832.     /*----------------------------------------------------------------*/
  1833.     /*----------------------------------------------------------------*/
  1834.     /* Code Body                                                      */
  1835.     /*----------------------------------------------------------------*/
  1836.     gui_show_icontext_button(&dm_button_array[dm_button_count]);
  1837. }
  1838. /*****************************************************************************
  1839.  * FUNCTION
  1840.  *  dm_get_control_coordinates_from_category
  1841.  * DESCRIPTION
  1842.  *  This function is used obtain the line coordinates.
  1843.  * PARAMETERS
  1844.  *  S32ScrId                    [IN]            
  1845.  *  S32CatId                    [IN]            
  1846.  *  control                     [IN]            
  1847.  *  index                       [IN]            
  1848.  *  coordinate                  [?]             Info.
  1849.  *  UICtrlAccessPtr_p(?)        [IN/OUT]        It specifies the start position to take out the coordinates.
  1850.  * RETURNS
  1851.  *  void
  1852.  *****************************************************************************/
  1853. void dm_get_control_coordinates_from_category(
  1854.         S32 S32ScrId,
  1855.         S32 S32CatId,
  1856.         mmi_dm_control_ids_enum control,
  1857.         S32 index,
  1858.         dm_coordinates *coordinate)
  1859. {
  1860.     /*----------------------------------------------------------------*/
  1861.     /* Local Variables                                                */
  1862.     /*----------------------------------------------------------------*/
  1863.     S32 u8CtrlCt = 0;
  1864.     S32 u8NoOfUICtrls = 0;
  1865.     S16 *UICtrlAccessPtr_p = NULL, *DeafultCoordinateSet_p = NULL;
  1866.     typedef struct
  1867.     {
  1868.         dm_coordinates coordinates;
  1869.         S16 array[100];
  1870.     } temp_coordinates_struct;
  1871.     temp_coordinates_struct temp_coordinates;
  1872.     S32 idx = index;
  1873.     U8 *control_set_ptr;
  1874.     /*----------------------------------------------------------------*/
  1875.     /* Code Body                                                      */
  1876.     /*----------------------------------------------------------------*/
  1877.     control_set_ptr = dm_search_control_set(S32CatId, &DeafultCoordinateSet_p);
  1878.     /* First element in Category-Controls map specifies the number of controls */
  1879.     u8NoOfUICtrls = control_set_ptr[0];
  1880.     if (S32ScrId >= 0)
  1881.     {
  1882.         UICtrlAccessPtr_p = dm_search_coordinate_set(S32ScrId);
  1883.     }
  1884.     if (UICtrlAccessPtr_p == NULL)
  1885.     {
  1886.         UICtrlAccessPtr_p = DeafultCoordinateSet_p;
  1887.     }
  1888.     /* Fist element in coordinate set specifies the coordinates of complete category screen */
  1889.     UICtrlAccessPtr_p = dm_get_cat_scr_coordinates(UICtrlAccessPtr_p, (dm_cat_scr_info_struct*) & temp_coordinates);
  1890.     for (u8CtrlCt = 1; u8CtrlCt <= u8NoOfUICtrls; u8CtrlCt++)
  1891.     {
  1892.         switch (control_set_ptr[u8CtrlCt])
  1893.         {
  1894.             case DM_BASE_LAYER_START:
  1895.             case DM_NEW_LAYER_END:
  1896.             case DM_BASE_CONTROL_SET1:
  1897.             case DM_ALIGNED_AREA_END:
  1898.                 break;
  1899.             case DM_NEW_LAYER_START:
  1900.             {
  1901.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1902.                 break;
  1903.             }
  1904.             case DM_CIRCULAR_MENU1:
  1905.             {
  1906.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1907.                 break;
  1908.             }
  1909.             case DM_LIST1:
  1910.             {
  1911.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1912.                 break;
  1913.             }
  1914.             case DM_DYNAMIC_LIST1:
  1915.             {
  1916.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1917.                 break;
  1918.             }
  1919.             case DM_MATRIX_MENU1:
  1920.             {
  1921.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1922.                 break;
  1923.             }
  1924.             case DM_MULTILINE_INPUTBOX1:
  1925.             {
  1926.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1927.                 break;
  1928.             }
  1929.             case DM_DIALER_INPUT_BOX1:
  1930.             {
  1931.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1932.                 break;
  1933.             }
  1934.             case DM_SINGLELINE_INPUTBOX1:
  1935.             {
  1936.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1937.                 break;
  1938.             }
  1939.             case DM_LSK:
  1940.             case DM_RSK:
  1941.             {
  1942.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1943.                 break;
  1944.             }
  1945.             case DM_TITLE1:
  1946.             {
  1947.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1948.                 break;
  1949.             }
  1950.             case DM_CATEGORY_CONTROLLED_AREA:
  1951.             case DM_CATEGORY_CONTROLLED_AREA2:
  1952.             {
  1953.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1954.                 break;
  1955.             }
  1956.             case DM_STATUS_BAR1:
  1957.             {
  1958.                 UICtrlAccessPtr_p = dm_get_status_icon_bar_coordinates(UICtrlAccessPtr_p, (dm_status_info_struct*) & temp_coordinates);
  1959.                 break;
  1960.             }
  1961.             case DM_BUTTON_BAR1:
  1962.             {
  1963.                 UICtrlAccessPtr_p = dm_get_button_bar_coordinates(UICtrlAccessPtr_p, (dm_buttonbar_info_struct*) & temp_coordinates);
  1964.                 break;
  1965.             }
  1966.             case DM_INLINE_FIXED_LIST1:
  1967.             {
  1968.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1969.                 break;
  1970.             }
  1971.             case DM_ALIGNED_AREA_START:
  1972.             {
  1973.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1974.                 break;
  1975.             }
  1976.             case DM_STRING:
  1977.             {
  1978.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1979.                 if (control == control_set_ptr[u8CtrlCt])
  1980.                 {
  1981.                     idx--;
  1982.                 }
  1983.                 break;
  1984.             }
  1985.             case DM_IMAGE:
  1986.             {
  1987.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  1988.                 if (control == control_set_ptr[u8CtrlCt])
  1989.                 {
  1990.                     idx--;
  1991.                 }
  1992.                 break;
  1993.             }
  1994.             case DM_CALENDAR:
  1995.             {
  1996.                 UICtrlAccessPtr_p = dm_get_calendar_coordinates(UICtrlAccessPtr_p, (dm_calendar_info_struct*) & temp_coordinates);
  1997.                 break;
  1998.             }
  1999.             case DM_BACK_FILL_AREA:
  2000.             {
  2001.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  2002.                 if (control == control_set_ptr[u8CtrlCt])
  2003.                 {
  2004.                     idx--;
  2005.                 }
  2006.                 break;
  2007.             }
  2008.             case DM_RECTANGLE:
  2009.             {
  2010.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  2011.                 if (control == control_set_ptr[u8CtrlCt])
  2012.                 {
  2013.                     idx--;
  2014.                 }
  2015.                 break;
  2016.             }
  2017.             case DM_LINE:
  2018.             {
  2019.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  2020.                 if (control == control_set_ptr[u8CtrlCt])
  2021.                 {
  2022.                     idx--;
  2023.                 }
  2024.                 break;
  2025.             }
  2026.             case DM_SLIDE_CONTROL:
  2027.             {
  2028.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  2029.                 if (control == control_set_ptr[u8CtrlCt])
  2030.                 {
  2031.                     idx--;
  2032.                 }
  2033.                 break;
  2034.             }
  2035.             case DM_TYPICAL_STOPWATCH:
  2036.             {
  2037.                 UICtrlAccessPtr_p = dm_get_coordinates(UICtrlAccessPtr_p, (dm_coordinates*) & temp_coordinates);
  2038.                 break;
  2039.             }
  2040.             case DM_NWAY_STOPWATCH:
  2041.             {
  2042.                 UICtrlAccessPtr_p = dm_get_typical_stopwatch_coordinates(
  2043.                                         UICtrlAccessPtr_p,
  2044.                                         (dm_typical_stopwatch_info_struct*) & temp_coordinates);
  2045.                 break;
  2046.             }
  2047.             case DM_POPUP_BACKGROUND:
  2048.             {
  2049.                 UICtrlAccessPtr_p = dm_get_nway_stopwatch_coordinates(
  2050.                                         UICtrlAccessPtr_p,
  2051.                                         (dm_nway_stopwatch_info_struct*) & temp_coordinates);
  2052.                 break;
  2053.             }
  2054.         }
  2055.         if (idx == -1 && control == control_set_ptr[u8CtrlCt])
  2056.         {
  2057.             *coordinate = temp_coordinates.coordinates;
  2058.             return;
  2059.         }
  2060.     }
  2061. }
  2062. /*****************************************************************************
  2063.  * FUNCTION
  2064.  *  dm_create_layer
  2065.  * DESCRIPTION
  2066.  *  This function is to create new layer which is not defined in control_set
  2067.  * PARAMETERS
  2068.  *  x               [IN]        X-coordinate of new layer
  2069.  *  y               [IN]        Y-coordinate of new layer
  2070.  *  width           [IN]        Width of new layer
  2071.  *  height          [IN]        Height of new layer
  2072.  *  handle_ptr      [?]         
  2073.  *  flags           [IN]        Flags to identify the index of new layer
  2074.  * RETURNS
  2075.  *  GDI_RESULT  result of create layer
  2076.  *****************************************************************************/
  2077. GDI_RESULT dm_create_layer(S32 x, S32 y, S32 width, S32 height, gdi_handle *handle_ptr, U32 flags)
  2078. {
  2079.     /*----------------------------------------------------------------*/
  2080.     /* Local Variables                                                */
  2081.     /*----------------------------------------------------------------*/
  2082.     U16 idx = 0, act_layer_idx = 0, *act_dm_layers_count = NULL;
  2083.     U16 i = 0; //061506 double buffer
  2084.     GDI_HANDLE act_layer = GDI_ERROR_HANDLE, *act_dm_layers = NULL;
  2085.     GDI_RESULT ret = 0;
  2086.     gdi_handle act_lcd_handle;
  2087.     /*----------------------------------------------------------------*/
  2088.     /* Code Body                                                      */
  2089.     /*----------------------------------------------------------------*/
  2090.     gdi_lcd_get_active(&act_lcd_handle);
  2091. #ifdef __MMI_SUBLCD__
  2092.     if (act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE)
  2093.     {
  2094.         act_dm_layers = dm_layers_sub;
  2095.         act_dm_layers_count = &dm_layers_count_sub;
  2096.     }
  2097.     else if (act_lcd_handle == GDI_LCD_MAIN_LCD_HANDLE)
  2098. #endif /* __MMI_SUBLCD__ */ 
  2099.     {
  2100.         act_dm_layers = dm_layers;
  2101.         act_dm_layers_count = &dm_layers_count;
  2102.     }
  2103.     switch (flags)
  2104.     {
  2105.         case DM_LAYER_BOTTOM:
  2106.             /* move each layer forward */
  2107.             /* 061506 double buffer Start */
  2108.             for (idx = *act_dm_layers_count; idx > 0; idx--)
  2109.             {
  2110.                 act_dm_layers[idx] = act_dm_layers[idx-1];
  2111.             }
  2112.             /* 061506 double buffer End */
  2113.             /* create new layer using GDI APIs */
  2114.             ret = gdi_layer_create(x, y, width, height, &act_dm_layers[0]);
  2115.             *handle_ptr = act_dm_layers[0];
  2116.             (*act_dm_layers_count)++;
  2117.             break;
  2118.         case DM_LAYER_TOP:
  2119.             /* create new layer using GDI APIs */
  2120.             ret = gdi_layer_create(x, y, width, height, &act_dm_layers[*act_dm_layers_count]);
  2121.             *handle_ptr = act_dm_layers[(*act_dm_layers_count)];
  2122.             (*act_dm_layers_count)++;
  2123.             break;
  2124.         case DM_LAYER_ACTIVE_TOP:
  2125.             /* get active layer handle */
  2126.             gdi_layer_get_active(&act_layer);
  2127.             /* find out active layer index in dm_layers */
  2128.             for (idx = 0; idx < *act_dm_layers_count; idx++)
  2129.                 if (act_dm_layers[idx] == act_layer)
  2130.                 {
  2131.                     break;
  2132.                 }
  2133.             act_layer_idx = idx;
  2134.             /* move each layer forward */
  2135.             /* 061506 double buffer Start */
  2136.             for (i = *act_dm_layers_count; i > idx; i--)
  2137.             {
  2138.                 act_dm_layers[i] = act_dm_layers[i-1];
  2139.             }
  2140.             /* 061506 double buffer End */
  2141.             (*act_dm_layers_count)++;
  2142.             /* create new layer using GDI APIs */
  2143.             ret = gdi_layer_create(x, y, width, height, &act_dm_layers[act_layer_idx]);
  2144.             *handle_ptr = act_dm_layers[act_layer_idx];
  2145.             break;
  2146.         case DM_LAYER_ACTIVE_BOTTOM:
  2147.             if (*act_dm_layers_count == 0)
  2148.             {
  2149.                 act_layer_idx = 0;
  2150.                 ret = gdi_layer_create(x, y, width, height, &act_dm_layers[act_layer_idx]);
  2151.                 *act_dm_layers_count = 1;
  2152.                 *handle_ptr = act_dm_layers[act_layer_idx];
  2153.                 break;
  2154.             }
  2155.             /* get active layer handle */
  2156.             gdi_layer_get_active(&act_layer);
  2157.             /* find out active layer index in dm_layers */
  2158.             for (idx = 0; idx < *act_dm_layers_count; idx++)
  2159.                 if (act_dm_layers[idx] == act_layer)
  2160.                 {
  2161.                     break;
  2162.                 }
  2163.             act_layer_idx = ++idx;
  2164.             /* move each layer forward */
  2165.             /* 061506 double buffer Start */
  2166.             for (i = *act_dm_layers_count; i > idx; i--)
  2167.             {
  2168.                 act_dm_layers[i] = act_dm_layers[i-1];
  2169.             }
  2170.             /* 061506 double buffer End */
  2171.             (*act_dm_layers_count)++;
  2172.             /* create new layer using GDI APIs */
  2173.             ret = gdi_layer_create(x, y, width, height, &act_dm_layers[act_layer_idx]);
  2174.             *handle_ptr = act_dm_layers[act_layer_idx];
  2175.             break;
  2176.     }
  2177.     gdi_layer_set_blt_layer(act_dm_layers[0], act_dm_layers[1], act_dm_layers[2], act_dm_layers[3]);
  2178.     return ret;
  2179. }
  2180. /*****************************************************************************
  2181.  * FUNCTION
  2182.  *  dm_create_layer_using_outside_memory
  2183.  * DESCRIPTION
  2184.  *  This function is to create new layer which is not defined in control_set and use outside memory
  2185.  * PARAMETERS
  2186.  *  x                       [IN]        X-coordinate of new layer
  2187.  *  y                       [IN]        Y-coordinate of new layer
  2188.  *  width                   [IN]        Width of new layer
  2189.  *  height                  [IN]        Height of new layer
  2190.  *  handle_ptr              [IN]        
  2191.  *  outside_memory          [IN]        Outside memory pointer
  2192.  *  outside_memory_size     [IN]        Outside memory size
  2193.  *  flags                   [IN]        Flags to identify the index of new layer
  2194.  * RETURNS
  2195.  *  void
  2196.  *****************************************************************************/
  2197. GDI_RESULT dm_create_layer_using_outside_memory(
  2198.             S32 x,
  2199.             S32 y,
  2200.             S32 width,
  2201.             S32 height,
  2202.             gdi_handle **handle_ptr,
  2203.             U8 *outside_memory,
  2204.             S32 outside_memory_size,
  2205.             U32 flags)
  2206. {
  2207.     /*----------------------------------------------------------------*/
  2208.     /* Local Variables                                                */
  2209.     /*----------------------------------------------------------------*/
  2210.     U16 idx = 0, act_layer_idx = 0, *act_dm_layers_count = NULL;
  2211.     U16 i = 0; //061506 double buffer
  2212.     GDI_HANDLE act_layer = GDI_ERROR_HANDLE, *act_dm_layers = NULL;
  2213.     GDI_RESULT ret = 0;
  2214.     gdi_handle act_lcd_handle;
  2215.     /*----------------------------------------------------------------*/
  2216.     /* Code Body                                                      */
  2217.     /*----------------------------------------------------------------*/
  2218.     gdi_lcd_get_active(&act_lcd_handle);
  2219. #ifdef __MMI_SUBLCD__
  2220.     if (act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE)
  2221.     {
  2222.         act_dm_layers = dm_layers_sub;
  2223.         act_dm_layers_count = &dm_layers_count_sub;
  2224.     }
  2225.     else if (act_lcd_handle == GDI_LCD_MAIN_LCD_HANDLE)
  2226. #endif /* __MMI_SUBLCD__ */ 
  2227.     {
  2228.         act_dm_layers = dm_layers;
  2229.         act_dm_layers_count = &dm_layers_count;
  2230.     }
  2231.     switch (flags)
  2232.     {
  2233.         case DM_LAYER_BOTTOM:
  2234.             /* move each layer forward */
  2235.             /* 061506 double buffer Start */
  2236.             for (idx = *act_dm_layers_count; idx > 0; idx--)
  2237.             {
  2238.                 act_dm_layers[idx] = act_dm_layers[idx-1];
  2239.             }
  2240.             /* 061506 double buffer End */
  2241.             /* create new layer using GDI APIs */
  2242.             ret = gdi_layer_create_using_outside_memory(
  2243.                     x,
  2244.                     y,
  2245.                     width,
  2246.                     height,
  2247.                     &act_dm_layers[0],
  2248.                     outside_memory,
  2249.                     outside_memory_size);
  2250.             (*act_dm_layers_count)++;
  2251.             *handle_ptr = &act_dm_layers[0];
  2252.             break;
  2253.         case DM_LAYER_TOP:
  2254.             /* create new layer using GDI APIs */
  2255.             ret = gdi_layer_create_using_outside_memory(
  2256.                     x,
  2257.                     y,
  2258.                     width,
  2259.                     height,
  2260.                     &act_dm_layers[*act_dm_layers_count],
  2261.                     outside_memory,
  2262.                     outside_memory_size);
  2263.             *handle_ptr = &act_dm_layers[*act_dm_layers_count];
  2264.             (*act_dm_layers_count)++;
  2265.             break;
  2266.         case DM_LAYER_ACTIVE_TOP:
  2267.             /* get active layer handle */
  2268.             gdi_layer_get_active(&act_layer);
  2269.             /* find out active layer index in dm_layers */
  2270.             for (idx = 0; idx < *act_dm_layers_count; idx++)
  2271.                 if (act_dm_layers[idx] == act_layer)
  2272.                 {
  2273.                     break;
  2274.                 }
  2275.             act_layer_idx = idx;
  2276.             /* move each layer forward */
  2277.             /* 061506 double buffer Start */
  2278.             for (i = *act_dm_layers_count; i > idx; i--)
  2279.             {
  2280.                 act_dm_layers[i] = act_dm_layers[i-1];
  2281.             }
  2282.             /* 061506 double buffer End */
  2283.             (*act_dm_layers_count)++;
  2284.             /* create new layer using GDI APIs */
  2285.             ret = gdi_layer_create_using_outside_memory(
  2286.                     x,
  2287.                     y,
  2288.                     width,
  2289.                     height,
  2290.                     &act_dm_layers[act_layer_idx],
  2291.                     outside_memory,
  2292.                     outside_memory_size);
  2293.             *handle_ptr = &act_dm_layers[act_layer_idx];
  2294.             break;
  2295.         case DM_LAYER_ACTIVE_BOTTOM:
  2296.             /* get active layer handle */
  2297.             gdi_layer_get_active(&act_layer);
  2298.             /* find out active layer index in dm_layers */
  2299.             for (idx = 0; idx < *act_dm_layers_count; idx++)
  2300.                 if (act_dm_layers[idx] == act_layer)
  2301.                 {
  2302.                     break;
  2303.                 }
  2304.             act_layer_idx = ++idx;
  2305.             /* move each layer forward */
  2306.             /* 061506 double buffer Start */
  2307.             for (i = *act_dm_layers_count; i > idx; i--)
  2308.             {
  2309.                 act_dm_layers[i] = act_dm_layers[i-1];
  2310.             }
  2311.             /* 061506 double buffer End */
  2312.             (*act_dm_layers_count)++;
  2313.             /* create new layer using GDI APIs */
  2314.             ret = gdi_layer_create_using_outside_memory(
  2315.                     x,
  2316.                     y,
  2317.                     width,
  2318.                     height,
  2319.                     &act_dm_layers[act_layer_idx],
  2320.                     outside_memory,
  2321.                     outside_memory_size);
  2322.             *handle_ptr = &act_dm_layers[act_layer_idx];
  2323.             break;
  2324.     }
  2325.     gdi_layer_set_blt_layer(act_dm_layers[0], act_dm_layers[1], act_dm_layers[2], act_dm_layers[3]);
  2326.     return ret;
  2327. }
  2328. /*****************************************************************************
  2329.  * FUNCTION
  2330.  *  dm_add_blt_layer
  2331.  * DESCRIPTION
  2332.  *  This function is to add new layer into blt layer list
  2333.  * PARAMETERS
  2334.  *  handle_ptr      [IN]        New layer handle
  2335.  *  flags           [IN]        Flags to identify the index of new layer
  2336.  * RETURNS
  2337.  *  MMI_BOOL result of adding layer
  2338.  *****************************************************************************/
  2339. MMI_BOOL dm_add_blt_layer(gdi_handle handle_ptr, U32 flags)
  2340. {
  2341.     /*----------------------------------------------------------------*/
  2342.     /* Local Variables                                                */
  2343.     /*----------------------------------------------------------------*/
  2344.     U16 idx = 0, act_layer_idx = 0, *act_dm_layers_count = NULL;
  2345.     U16 i = 0; //061506 double buffer
  2346.     GDI_HANDLE act_layer = GDI_ERROR_HANDLE, *act_dm_layers = NULL;
  2347.     gdi_handle act_lcd_handle;
  2348.     /*----------------------------------------------------------------*/
  2349.     /* Code Body                                                      */
  2350.     /*----------------------------------------------------------------*/
  2351.     gdi_lcd_get_active(&act_lcd_handle);
  2352. #ifdef __MMI_SUBLCD__
  2353.     if (act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE)
  2354.     {
  2355.         act_dm_layers = dm_layers_sub;
  2356.         act_dm_layers_count = &dm_layers_count_sub;
  2357.     }
  2358.     else if (act_lcd_handle == GDI_LCD_MAIN_LCD_HANDLE)
  2359. #endif /* __MMI_SUBLCD__ */ 
  2360.     {
  2361.         act_dm_layers = dm_layers;
  2362.         act_dm_layers_count = &dm_layers_count;
  2363.     }
  2364.     for (idx = 0; idx < *act_dm_layers_count; idx++)
  2365.     {
  2366.         if (act_dm_layers[idx] == handle_ptr)
  2367.         {
  2368.             return MMI_FALSE;
  2369.         }
  2370.     }
  2371.     switch (flags)
  2372.     {
  2373.         case DM_LAYER_BOTTOM:
  2374.             /* move each layer forward */
  2375.             /* 061506 double buffer Start */
  2376.             for (idx = *act_dm_layers_count; idx > 0; idx--)
  2377.             {
  2378.                 act_dm_layers[idx] = act_dm_layers[idx-1];
  2379.             }
  2380.             /* 061506 double buffer End */
  2381.             act_dm_layers[0] = handle_ptr;
  2382.             (*act_dm_layers_count)++;
  2383.             break;
  2384.         case DM_LAYER_TOP:
  2385.             act_dm_layers[(*act_dm_layers_count)] = handle_ptr;
  2386.             (*act_dm_layers_count)++;
  2387.             break;
  2388.         case DM_LAYER_ACTIVE_TOP:
  2389.             /* get active layer handle */
  2390.             gdi_layer_get_active(&act_layer);
  2391.             /* find out active layer index in dm_layers */
  2392.             for (idx = 0; idx < *act_dm_layers_count; idx++)
  2393.                 if (act_dm_layers[idx] == act_layer)
  2394.                 {
  2395.                     break;
  2396.                 }
  2397.             act_layer_idx = idx;
  2398.             /* move each layer forward */
  2399.             /* 061506 double buffer Start */
  2400.             for (i = *act_dm_layers_count; i > idx; i--)
  2401.             {
  2402.                 act_dm_layers[i] = act_dm_layers[i-1];
  2403.             }
  2404.             /* 061506 double buffer End */
  2405.             (*act_dm_layers_count)++;
  2406.             act_dm_layers[act_layer_idx] = handle_ptr;
  2407.             break;
  2408.         case DM_LAYER_ACTIVE_BOTTOM:
  2409.             /* get active layer handle */
  2410.             gdi_layer_get_active(&act_layer);
  2411.             /* find out active layer index in dm_layers */
  2412.             for (idx = 0; idx < *act_dm_layers_count; idx++)
  2413.                 if (act_dm_layers[idx] == act_layer)
  2414.                 {
  2415.                     break;
  2416.                 }
  2417.             act_layer_idx = ++idx;
  2418.             /* move each layer forward */
  2419.             /* 061506 double buffer Start */
  2420.             for (i = *act_dm_layers_count; i > idx; i--)
  2421.             {
  2422.                 act_dm_layers[i] = act_dm_layers[i-1];
  2423.             }
  2424.             /* 061506 double buffer End */
  2425.             (*act_dm_layers_count)++;
  2426.             act_dm_layers[act_layer_idx] = handle_ptr;
  2427.             break;
  2428.     }
  2429.     gdi_layer_set_blt_layer(act_dm_layers[0], act_dm_layers[1], act_dm_layers[2], act_dm_layers[3]);
  2430.     return MMI_TRUE;
  2431. }
  2432. /*****************************************************************************
  2433.  * FUNCTION
  2434.  *  dm_set_blt_layer
  2435.  * DESCRIPTION
  2436.  *  This function is to set blt layer sequence
  2437.  * PARAMETERS
  2438.  *  void
  2439.  * RETURNS
  2440.  *  void
  2441.  *****************************************************************************/
  2442. GDI_RESULT dm_set_blt_layer(void)
  2443. {
  2444.     /*----------------------------------------------------------------*/
  2445.     /* Local Variables                                                */
  2446.     /*----------------------------------------------------------------*/
  2447.     /*----------------------------------------------------------------*/
  2448.     /* Code Body                                                      */
  2449.     /*----------------------------------------------------------------*/
  2450.     return gdi_layer_set_blt_layer(dm_layers[0], dm_layers[1], dm_layers[2], dm_layers[3]);
  2451. }
  2452. /* Leo start 20050722, add button control */
  2453. /*****************************************************************************
  2454.  * FUNCTION
  2455.  *  dm_register_button_functions
  2456.  * DESCRIPTION
  2457.  *  set handling functions of buttons
  2458.  * PARAMETERS
  2459.  *  button_index        [IN]        Index of dm_button_array
  2460.  *  key_type            [IN]        Key event type
  2461.  *  f                   [IN]        Handling function pointer
  2462.  * RETURNS
  2463.  *  void
  2464.  *****************************************************************************/
  2465. void dm_register_button_functions(U16 button_index, U16 key_type, FuncPtr f)
  2466. {
  2467.     /*----------------------------------------------------------------*/
  2468.     /* Local Variables                                                */
  2469.     /*----------------------------------------------------------------*/
  2470.     /*----------------------------------------------------------------*/
  2471.     /* Code Body                                                      */
  2472.     /*----------------------------------------------------------------*/
  2473.     MMI_ASSERT(button_index < DM_MAX_BUTTONS);
  2474.     dm_button_func_ptrs[button_index][key_type] = f;
  2475. }
  2476. /*****************************************************************************
  2477.  * FUNCTION
  2478.  *  dm_reset_button_functions
  2479.  * DESCRIPTION
  2480.  *  reset handling functions of buttons
  2481.  * PARAMETERS
  2482.  *  void
  2483.  * RETURNS
  2484.  *  void
  2485.  *****************************************************************************/
  2486. void dm_reset_button_functions(void)
  2487. {
  2488.     /*----------------------------------------------------------------*/
  2489.     /* Local Variables                                                */
  2490.     /*----------------------------------------------------------------*/
  2491.     U8 button_index, key_type = 0;
  2492.     /*----------------------------------------------------------------*/
  2493.     /* Code Body                                                      */
  2494.     /*----------------------------------------------------------------*/
  2495.     for (button_index = 0; button_index < DM_MAX_BUTTONS; button_index++)
  2496.         for (key_type = 0; key_type < MAX_KEY_TYPE; key_type++)
  2497.         {
  2498.             dm_button_func_ptrs[button_index][key_type] = NULL;
  2499.         }
  2500. }
  2501. /*****************************************************************************
  2502.  * FUNCTION
  2503.  *  dm_execute_button_handler
  2504.  * DESCRIPTION
  2505.  *  Execute left softkey handler from pen
  2506.  * PARAMETERS
  2507.  *  btn_index       [IN]        
  2508.  *  key_type        [IN]        - KEY_EVENT_DOWN, KEY_EVENT_UP, KEY_LONG_PRESS
  2509.  * RETURNS
  2510.  *  void
  2511.  *****************************************************************************/
  2512. void dm_execute_button_handler(U16 btn_index, U16 key_type)
  2513. {
  2514.     /*----------------------------------------------------------------*/
  2515.     /* Local Variables                                                */
  2516.     /*----------------------------------------------------------------*/
  2517.     /*----------------------------------------------------------------*/
  2518.     /* Code Body                                                      */
  2519.     /*----------------------------------------------------------------*/
  2520.     MMI_ASSERT(btn_index < DM_MAX_BUTTONS);
  2521.     MMI_ASSERT(key_type < MAX_KEY_TYPE);
  2522.     if (dm_button_func_ptrs[btn_index][key_type] != NULL)
  2523.     {
  2524.         dm_button_func_ptrs[btn_index][key_type] ();
  2525.     }
  2526. }
  2527. /*****************************************************************************
  2528.  * FUNCTION
  2529.  *  dm_is_redraw_screen
  2530.  * DESCRIPTION
  2531.  *  Execute left softkey handler from pen
  2532.  * PARAMETERS
  2533.  *  void
  2534.  *  key_type - KEY_EVENT_DOWN, KEY_EVENT_UP, KEY_LONG_PRESS(?)
  2535.  * RETURNS
  2536.  *  void
  2537.  *****************************************************************************/
  2538. MMI_BOOL dm_is_redraw_screen(void)
  2539. {
  2540. #ifdef __MMI_SUBLCD__
  2541.     /*----------------------------------------------------------------*/
  2542.     /* Local Variables                                                */
  2543.     /*----------------------------------------------------------------*/
  2544.     /*----------------------------------------------------------------*/
  2545.     /* Code Body                                                      */
  2546.     /*----------------------------------------------------------------*/
  2547.     if (g_dm_data.s32flags == DM_SUB_LCD_CONTEXT)
  2548.     {
  2549.         if (g_dm_cntx.redraw_screen_sub == REDRAW_2_REDRAW)
  2550.         {
  2551.             return MMI_TRUE;
  2552.         }
  2553.         else
  2554.         {
  2555.             return MMI_FALSE;
  2556.         }
  2557.     }
  2558.     else
  2559. #endif /* __MMI_SUBLCD__ */ 
  2560.     {
  2561.         if (g_dm_cntx.redraw_screen_main == REDRAW_2_REDRAW)
  2562.         {
  2563.             return MMI_TRUE;
  2564.         }
  2565.         else
  2566.         {
  2567.             return MMI_FALSE;
  2568.         }
  2569.     }
  2570. }
  2571. #ifdef __MMI_TOUCH_SCREEN__
  2572. /*****************************************************************************
  2573.  * FUNCTION
  2574.  *  dm_check_image_bound
  2575.  * DESCRIPTION
  2576.  *  check image bounder controlled by draw manager
  2577.  * PARAMETERS
  2578.  *  index       [IN]        Index of images
  2579.  *  point       [IN]        Pen point
  2580.  * RETURNS
  2581.  *  void
  2582.  *****************************************************************************/
  2583. MMI_BOOL dm_check_image_bound(U16 index, mmi_pen_point_struct point)
  2584. {
  2585.     /*----------------------------------------------------------------*/
  2586.     /* Local Variables                                                */
  2587.     /*----------------------------------------------------------------*/
  2588.     /*----------------------------------------------------------------*/
  2589.     /* Code Body                                                      */
  2590.     /*----------------------------------------------------------------*/
  2591.     return (PEN_CHECK_BOUND(
  2592.                 point.x,
  2593.                 point.y,
  2594.                 dm_image_array[index].x,
  2595.                 dm_image_array[index].y,
  2596.                 dm_image_array[index].width,
  2597.                 dm_image_array[index].height));
  2598. }
  2599. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2600. /*****************************************************************************
  2601.  * FUNCTION
  2602.  *  dm_get_layer_handle
  2603.  * DESCRIPTION
  2604.  *  
  2605.  * PARAMETERS
  2606.  *  index       [IN]        
  2607.  * RETURNS
  2608.  *  
  2609.  *****************************************************************************/
  2610. GDI_HANDLE dm_get_layer_handle(U8 index)
  2611. {
  2612.     /*----------------------------------------------------------------*/
  2613.     /* Local Variables                                                */
  2614.     /*----------------------------------------------------------------*/
  2615.     /*----------------------------------------------------------------*/
  2616.     /* Code Body                                                      */
  2617.     /*----------------------------------------------------------------*/
  2618.     return dm_layers[index];
  2619. }
  2620. /*****************************************************************************
  2621.  * FUNCTION
  2622.  *  dm_get_layer_handle_ptr
  2623.  * DESCRIPTION
  2624.  *  
  2625.  * PARAMETERS
  2626.  *  index       [IN]        
  2627.  * RETURNS
  2628.  *  
  2629.  *****************************************************************************/
  2630. GDI_HANDLE *dm_get_layer_handle_ptr(U8 index)
  2631. {
  2632.     /*----------------------------------------------------------------*/
  2633.     /* Local Variables                                                */
  2634.     /*----------------------------------------------------------------*/
  2635.     /*----------------------------------------------------------------*/
  2636.     /* Code Body                                                      */
  2637.     /*----------------------------------------------------------------*/
  2638.     return &(dm_layers[index]);
  2639. }
  2640. /*****************************************************************************
  2641.  * FUNCTION
  2642.  *  dm_add_percentage_bar
  2643.  * DESCRIPTION
  2644.  *  
  2645.  * PARAMETERS
  2646.  *  init_value              [IN]   
  2647.  *  string                  [IN]
  2648.  *  bar_color               [IN]        
  2649.  *  bg_image                [IN]        
  2650.  *  left_side_image         [IN]        
  2651.  *  right_side_image        [IN]        
  2652.  * RETURNS
  2653.  *  
  2654.  *****************************************************************************/
  2655. U16 dm_add_percentage_bar(U16 init_value, U8 *string, color bar_color, U16 bg_image, U16 left_side_image, U16 right_side_image)
  2656. {
  2657.     /*----------------------------------------------------------------*/
  2658.     /* Local Variables                                                */
  2659.     /*----------------------------------------------------------------*/
  2660.     dm_percentage_bar_struct *act_bar = &dm_percentage_bar_array[dm_percentage_bar_count];
  2661.     /*----------------------------------------------------------------*/
  2662.     /* Code Body                                                      */
  2663.     /*----------------------------------------------------------------*/
  2664.     act_bar->value = init_value;
  2665.     act_bar->bar_color = bar_color;
  2666.     act_bar->bg_image = bg_image;
  2667.     act_bar->left_side_image = left_side_image;
  2668.     act_bar->right_side_image = right_side_image;
  2669.     act_bar->progres_string = string;
  2670.     return dm_percentage_bar_count++;
  2671. }
  2672. /*****************************************************************************
  2673.  * FUNCTION
  2674.  *  dm_update_percentage_bar_value
  2675.  * DESCRIPTION
  2676.  *  
  2677.  * PARAMETERS
  2678.  *  id          [IN]        
  2679.  *  value       [IN]        
  2680.  *  string      [IN]
  2681.  * RETURNS
  2682.  *  void
  2683.  *****************************************************************************/
  2684. void dm_update_percentage_bar_value(S32 id, U16 value, U8* string)
  2685. {
  2686.     /*----------------------------------------------------------------*/
  2687.     /* Local Variables                                                */
  2688.     /*----------------------------------------------------------------*/
  2689.     /*----------------------------------------------------------------*/
  2690.     /* Code Body                                                      */
  2691.     /*----------------------------------------------------------------*/
  2692.     dm_percentage_bar_array[id].value = value;
  2693.     dm_percentage_bar_array[id].progres_string = string;
  2694. }
  2695. /*****************************************************************************
  2696.  * FUNCTION
  2697.  *  dm_change_percentage_bar_color
  2698.  * DESCRIPTION
  2699.  *  
  2700.  * PARAMETERS
  2701.  *  id      [IN]        
  2702.  *  c       [IN]        
  2703.  * RETURNS
  2704.  *  void
  2705.  *****************************************************************************/
  2706. void dm_change_percentage_bar_color(S32 id, color c)
  2707. {
  2708.     /*----------------------------------------------------------------*/
  2709.     /* Local Variables                                                */
  2710.     /*----------------------------------------------------------------*/
  2711.     /*----------------------------------------------------------------*/
  2712.     /* Code Body                                                      */
  2713.     /*----------------------------------------------------------------*/
  2714.     dm_percentage_bar_array[id].bar_color = c;
  2715. }
  2716. /*****************************************************************************
  2717.  * FUNCTION
  2718.  *  dm_redraw_percentage_bar
  2719.  * DESCRIPTION
  2720.  *  
  2721.  * PARAMETERS
  2722.  *  id      [IN]        
  2723.  * RETURNS
  2724.  *  void
  2725.  *****************************************************************************/
  2726. void dm_redraw_percentage_bar(S32 id)
  2727. {
  2728.     /*----------------------------------------------------------------*/
  2729.     /* Local Variables                                                */
  2730.     /*----------------------------------------------------------------*/
  2731.     dm_percentage_bar_struct *act_bar = &dm_percentage_bar_array[id];
  2732.     S32 x = act_bar->x;
  2733.     S32 y = act_bar->y;
  2734.     S32 width = act_bar->width;
  2735.     S32 height = act_bar->height;
  2736.     U16 str_buf[5];
  2737.     S32 str_width = 0, str_height = 0;
  2738.     S32 img_x = 0, img_y = 0;
  2739.     S32 img_width = 0, img_height = 0;
  2740.     S32 left_image_width = 0, left_image_height = 0;
  2741.     S32 right_image_width = 0, right_image_height = 0;
  2742.     /*----------------------------------------------------------------*/
  2743.     /* Code Body                                                      */
  2744.     /*----------------------------------------------------------------*/
  2745.     if (act_bar->progres_string == NULL)
  2746.     {
  2747.         gui_itoa(act_bar->value, (UI_string_type) & str_buf, 10);
  2748.         UCS2StrAppendChar((S8*)&str_buf,'%');
  2749.         gui_measure_string((UI_string_type) str_buf, &str_width, &str_height);
  2750.     }
  2751.     else
  2752.     {
  2753.         gui_measure_string((UI_string_type) act_bar->progres_string, &str_width, &str_height);
  2754.     }
  2755.     gdi_image_get_dimension_id(act_bar->bg_image, &img_width, &img_height);
  2756.     gdi_image_get_dimension_id(act_bar->left_side_image, &left_image_width, &left_image_height);
  2757.     gdi_image_get_dimension_id(act_bar->right_side_image, &right_image_width, &right_image_height);
  2758.     /* clear background */
  2759.     gdi_draw_solid_rect(x, y, x + width - 1, y + height - 1, GDI_COLOR_TRANSPARENT);
  2760.     /* update text */
  2761.     if (r2lMMIFlag)
  2762.     {
  2763.         gui_move_text_cursor(x + ((width - str_width) >> 1) + str_width, y + ((height - str_height - img_height) / 3));
  2764.     }
  2765.     else
  2766.     {
  2767.         gui_move_text_cursor(x + ((width - str_width) >> 1), y + ((height - str_height - img_height) / 3));
  2768.     }
  2769.     gui_set_text_color(gui_color(0,0,0));
  2770.     
  2771.     if (act_bar->progres_string == NULL)
  2772.     {
  2773.         gui_print_text((UI_string_type) str_buf);
  2774.     }
  2775.     else
  2776.     {
  2777.         gui_print_text((UI_string_type) act_bar->progres_string);
  2778.     }
  2779.     /* update image */
  2780.     img_x = x + ((width - img_width - left_image_width - right_image_width) >> 1);
  2781.     img_y = y + height - ((height - str_height - img_height) / 3 + img_height);
  2782.     gdi_draw_solid_rect(
  2783.         img_x + left_image_width,
  2784.         img_y + 1,
  2785.         img_x + left_image_width + ((img_width * act_bar->value) / 100),
  2786.         img_y + img_height - 2,
  2787.         gdi_act_color_from_rgb(255, act_bar->bar_color.r, act_bar->bar_color.g, act_bar->bar_color.b));
  2788.     gdi_image_draw(img_x, img_y, (U8*) get_image(act_bar->left_side_image));
  2789.     gdi_image_draw(img_x + left_image_width - 1, img_y, (U8*) get_image(act_bar->bg_image));
  2790.     gdi_image_draw(img_x + left_image_width + img_width - 1, img_y, (U8*) get_image(act_bar->right_side_image));
  2791.     gdi_layer_blt_previous(x, y, x + width - 1, y + height - 1);
  2792. }
  2793. #endif /* __MMI_DRAW_MANAGER__ */