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

MTK

开发平台:

C/C++

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