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

MTK

开发平台:

C/C++

  1.         memset(&myTime, 0, sizeof(MYTIME));
  2.         memset(&incTime, 0, sizeof(MYTIME));
  3.         myTime.nDay = 1;
  4.         myTime.nMonth = (U8) MMI_calendar_current_month;
  5.         myTime.nYear = MMI_calendar_current_year;
  6.         incTime.nMonth = 1;
  7.         IncrementTime(myTime, incTime, &resultTime);
  8.         MMI_calendar_highlighted_day = resultTime.nDay;
  9.         MMI_calendar_current_month = resultTime.nMonth;
  10.         MMI_calendar_current_year = resultTime.nYear;
  11.     }
  12.     else
  13.     {
  14.         MMI_calendar_highlighted_day = 1;
  15.         MMI_calendar_current_month = 1;
  16.         MMI_calendar_current_year = CLNDR_FIRST_NAVI_YEAR;
  17.     }
  18.     wgui_calendar_control_update_handler();
  19. }
  20. /*****************************************************************************
  21.  * FUNCTION
  22.  *  wgui_calendar_previous_month_day
  23.  * DESCRIPTION
  24.  *  Side down key handler, go to 1st day of previous month.
  25.  * PARAMETERS
  26.  *  void
  27.  * RETURNS
  28.  *  void
  29.  *****************************************************************************/
  30. void wgui_calendar_previous_month_day(void)
  31. {
  32.     /*----------------------------------------------------------------*/
  33.     /* Local Variables                                                */
  34.     /*----------------------------------------------------------------*/
  35.     /*----------------------------------------------------------------*/
  36.     /* Code Body                                                      */
  37.     /*----------------------------------------------------------------*/
  38.     if (MMI_calendar_current_year != CLNDR_FIRST_NAVI_YEAR || MMI_calendar_current_month != 1)
  39.     {
  40.         MYTIME myTime, incTime, resultTime;
  41.         memset(&myTime, 0, sizeof(MYTIME));
  42.         memset(&incTime, 0, sizeof(MYTIME));
  43.         myTime.nDay = 1;
  44.         myTime.nMonth = (U8) MMI_calendar_current_month;    /* 091905 Calvin */
  45.         myTime.nYear = MMI_calendar_current_year;
  46.         incTime.nDay = 1;
  47.         DecrementTime(myTime, incTime, &resultTime);
  48.         MMI_calendar_highlighted_day = resultTime.nDay;
  49.         MMI_calendar_current_month = resultTime.nMonth;
  50.         MMI_calendar_current_year = resultTime.nYear;
  51.     }
  52.     else
  53.     {
  54.         MMI_calendar_highlighted_day = 31;
  55.         MMI_calendar_current_month = 12;
  56.         MMI_calendar_current_year = CLNDR_LAST_NAVI_YEAR;
  57.     }
  58.     wgui_calendar_control_update_handler();
  59. }
  60. /*****************************************************************************
  61.  * FUNCTION
  62.  *  wgui_calendar_next_month_week
  63.  * DESCRIPTION
  64.  *  go to the same DoW of next week
  65.  * PARAMETERS
  66.  *  void
  67.  * RETURNS
  68.  *  void
  69.  *****************************************************************************/
  70. void wgui_calendar_next_month_week(void)
  71. {
  72.     /*----------------------------------------------------------------*/
  73.     /* Local Variables                                                */
  74.     /*----------------------------------------------------------------*/
  75.     /*----------------------------------------------------------------*/
  76.     /* Code Body                                                      */
  77.     /*----------------------------------------------------------------*/
  78.     if (MMI_calendar_current_year != CLNDR_LAST_NAVI_YEAR || MMI_calendar_current_month != 12)
  79.     {
  80.         MYTIME myTime, incTime, resultTime;
  81.         memset(&myTime, 0, sizeof(MYTIME));
  82.         memset(&incTime, 0, sizeof(MYTIME));
  83.         myTime.nDay = MMI_calendar_highlighted_day;
  84.         myTime.nMonth = (U8) MMI_calendar_current_month;
  85.         myTime.nYear = MMI_calendar_current_year;
  86.         incTime.nDay = 7;
  87.         IncrementTime(myTime, incTime, &resultTime);
  88.         MMI_calendar_highlighted_day = resultTime.nDay;
  89.         MMI_calendar_current_month = resultTime.nMonth;
  90.         MMI_calendar_current_year = resultTime.nYear;
  91.     }
  92.     else
  93.     {
  94.         MMI_calendar_highlighted_day = 1;
  95.         MMI_calendar_current_month = 1;
  96.         MMI_calendar_current_year = CLNDR_FIRST_NAVI_YEAR;
  97.     }
  98.     wgui_calendar_control_update_handler();
  99. }
  100. /*****************************************************************************
  101.  * FUNCTION
  102.  *  wgui_calendar_previous_month_week
  103.  * DESCRIPTION
  104.  *  go to the same DoW of previous week
  105.  * PARAMETERS
  106.  *  void
  107.  * RETURNS
  108.  *  void
  109.  *****************************************************************************/
  110. void wgui_calendar_previous_month_week(void)
  111. {
  112.     /*----------------------------------------------------------------*/
  113.     /* Local Variables                                                */
  114.     /*----------------------------------------------------------------*/
  115.     /*----------------------------------------------------------------*/
  116.     /* Code Body                                                      */
  117.     /*----------------------------------------------------------------*/
  118.     if (MMI_calendar_current_year != CLNDR_FIRST_NAVI_YEAR || MMI_calendar_current_month != 1)
  119.     {
  120.         MYTIME myTime, incTime, resultTime;
  121.         memset(&myTime, 0, sizeof(MYTIME));
  122.         memset(&incTime, 0, sizeof(MYTIME));
  123.         myTime.nDay = MMI_calendar_highlighted_day;
  124.         myTime.nMonth = (U8) MMI_calendar_current_month;
  125.         myTime.nYear = MMI_calendar_current_year;
  126.         incTime.nDay = 7;
  127.         DecrementTime(myTime, incTime, &resultTime);
  128.         MMI_calendar_highlighted_day = resultTime.nDay;
  129.         MMI_calendar_current_month = resultTime.nMonth;
  130.         MMI_calendar_current_year = resultTime.nYear;
  131.     }
  132.     else
  133.     {
  134.         MMI_calendar_highlighted_day = 31;
  135.         MMI_calendar_current_month = 12;
  136.         MMI_calendar_current_year = CLNDR_LAST_NAVI_YEAR;
  137.     }
  138.     wgui_calendar_control_update_handler();
  139. }
  140. #ifdef __MMI_TOUCH_SCREEN__
  141. /*****************************************************************************
  142.  * FUNCTION
  143.  *  SetCalendarMonthChangeFunctions
  144.  * DESCRIPTION
  145.  *  Register function pointers of previous/next month navigation of calendar
  146.  * PARAMETERS
  147.  *  previous_month      [IN]        )(void)      a function pointer which handle navigation to previous month
  148.  *  next_month          [IN]        
  149.  *  void(?)             [IN]        (*month_next_day)(void)     a function pointer which handle navigation to next month
  150.  * RETURNS
  151.  *  void
  152.  *****************************************************************************/
  153. void SetCalendarMonthChangeFunctions(void (*previous_month) (void), void (*next_month) (void))
  154. {
  155.     /*----------------------------------------------------------------*/
  156.     /* Local Variables                                                */
  157.     /*----------------------------------------------------------------*/
  158.     /*----------------------------------------------------------------*/
  159.     /* Code Body                                                      */
  160.     /*----------------------------------------------------------------*/
  161.     if (previous_month != NULL)
  162.     {
  163.         MMI_calendar_control.previous_month_function = previous_month;
  164.     }
  165.     if (next_month != NULL)
  166.     {
  167.         MMI_calendar_control.next_month_function = next_month;
  168.     }
  169. }
  170. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  171. /*****************************************************************************
  172.  * FUNCTION
  173.  *  SetCalendarYearChangeFunctions
  174.  * DESCRIPTION
  175.  *  Register function pointers of previous/next year navigation of calendar
  176.  * PARAMETERS
  177.  *  previous_year       [IN]        )(void)       a function pointer which handle navigation to previous year
  178.  *  next_year           [IN]        )(void)    a function pointer which handle navigation to next year
  179.  * RETURNS
  180.  *  void
  181.  *****************************************************************************/
  182. void SetCalendarYearChangeFunctions(void (*previous_year) (void), void (*next_year) (void))
  183. {
  184.     /*----------------------------------------------------------------*/
  185.     /* Local Variables                                                */
  186.     /*----------------------------------------------------------------*/
  187.     /*----------------------------------------------------------------*/
  188.     /* Code Body                                                      */
  189.     /*----------------------------------------------------------------*/
  190.     if (previous_year != NULL)
  191.     {
  192.         MMI_calendar_control.previous_year_function = previous_year;
  193.     }
  194.     if (next_year != NULL)
  195.     {
  196.         MMI_calendar_control.next_year_function = next_year;
  197.     }
  198. }
  199. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  200. #endif /* __MMI_TOUCH_SCREEN__ */ 
  201. /*****************************************************************************
  202.  * FUNCTION
  203.  *  RegisterCalendarHighlightHandler
  204.  * DESCRIPTION
  205.  *  Register calendar highlight function
  206.  * PARAMETERS
  207.  *  f       [IN]        )(S32 index) function pointer
  208.  * RETURNS
  209.  *  void
  210.  *****************************************************************************/
  211. void RegisterCalendarHighlightHandler(void (*f) (S32 index))
  212. {
  213.     /*----------------------------------------------------------------*/
  214.     /* Local Variables                                                */
  215.     /*----------------------------------------------------------------*/
  216.     /*----------------------------------------------------------------*/
  217.     /* Code Body                                                      */
  218.     /*----------------------------------------------------------------*/
  219.     if (f != NULL)
  220.     {
  221.         MMI_calendar_control_highlight_handler = f;
  222.     }
  223. }
  224. /*****************************************************************************
  225.  * FUNCTION
  226.  *  RegisterCalendarUpdateHandler
  227.  * DESCRIPTION
  228.  *  Register calendar update function
  229.  * PARAMETERS
  230.  *  f       [IN]        )(S32 day,S32 month,S32 year)  function pointer
  231.  * RETURNS
  232.  *  void
  233.  *****************************************************************************/
  234. void RegisterCalendarUpdateHandler(void (*f) (S32 day, S32 month, S32 year))
  235. {
  236.     /*----------------------------------------------------------------*/
  237.     /* Local Variables                                                */
  238.     /*----------------------------------------------------------------*/
  239.     /*----------------------------------------------------------------*/
  240.     /* Code Body                                                      */
  241.     /*----------------------------------------------------------------*/
  242.     if (f != NULL)
  243.     {
  244.         MMI_calendar_control_update_handler = f;
  245.     }
  246. }
  247. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  248. /*****************************************************************************
  249.  * FUNCTION
  250.  *  RegisterCalendarUpdateInfoBoxHandler
  251.  * DESCRIPTION
  252.  *  Register calendar update info box function
  253.  * PARAMETERS
  254.  *  f           [IN]        )(S32 *p_n_info, U16 ** p_icon_list, U8 ***p_description_list)  function pointer
  255.  *  this(?)     [IN]        Function should update the value pointed by each pointer
  256.  * RETURNS
  257.  *  void
  258.  *****************************************************************************/
  259. void RegisterCalendarUpdateInfoBoxHandler(void (*f) (S32 *p_n_info, U16 **p_icon_list, U8 ***p_description_list))
  260. {
  261.     /*----------------------------------------------------------------*/
  262.     /* Local Variables                                                */
  263.     /*----------------------------------------------------------------*/
  264.     /*----------------------------------------------------------------*/
  265.     /* Code Body                                                      */
  266.     /*----------------------------------------------------------------*/
  267.     if (f != NULL)
  268.     {
  269.         MMI_calendar_control.update_info_box = f;
  270.     }
  271. }
  272. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  273. /*****************************************************************************
  274.  * FUNCTION
  275.  *  SetCalendarDay
  276.  * DESCRIPTION
  277.  *  set the flag of particular day of month
  278.  * PARAMETERS
  279.  *  day         [IN]        Day
  280.  *  flags       [IN]        Flag (normal/current/task day )
  281.  * RETURNS
  282.  *  void
  283.  *****************************************************************************/
  284. void SetCalendarDay(S32 day, U8 flags)
  285. {
  286.     /*----------------------------------------------------------------*/
  287.     /* Local Variables                                                */
  288.     /*----------------------------------------------------------------*/
  289.     /*----------------------------------------------------------------*/
  290.     /* Code Body                                                      */
  291.     /*----------------------------------------------------------------*/
  292.     MMI_calendar_days[day] |= flags;
  293. }
  294. /*****************************************************************************
  295.  * FUNCTION
  296.  *  GetCalendarHighlightedDay
  297.  * DESCRIPTION
  298.  *  get highlighted day
  299.  * PARAMETERS
  300.  *  void
  301.  * RETURNS
  302.  *  S32 :- highlight day
  303.  *****************************************************************************/
  304. S32 GetCalendarHighlightedDay(void)
  305. {
  306.     /*----------------------------------------------------------------*/
  307.     /* Local Variables                                                */
  308.     /*----------------------------------------------------------------*/
  309.     /*----------------------------------------------------------------*/
  310.     /* Code Body                                                      */
  311.     /*----------------------------------------------------------------*/
  312.     return (MMI_calendar_highlighted_day);
  313. }
  314. /*****************************************************************************
  315.  * FUNCTION
  316.  *  SetCalendarHighlightedDay
  317.  * DESCRIPTION
  318.  *  set calendar highlighted day
  319.  * PARAMETERS
  320.  *  day     [IN]        
  321.  * RETURNS
  322.  *  void
  323.  *****************************************************************************/
  324. void SetCalendarHighlightedDay(S32 day)
  325. {
  326.     /*----------------------------------------------------------------*/
  327.     /* Local Variables                                                */
  328.     /*----------------------------------------------------------------*/
  329.     /*----------------------------------------------------------------*/
  330.     /* Code Body                                                      */
  331.     /*----------------------------------------------------------------*/
  332.     if (day >= 0 && day < MAX_CALENDAR_DAYS)
  333.     {
  334.         MMI_calendar_highlighted_day = day;
  335.         gui_calendar_highlight_day(&MMI_calendar_control, MMI_calendar_highlighted_day);
  336.     }
  337. }
  338. /*****************************************************************************
  339.  * FUNCTION
  340.  *  SetCalendarPopupDay
  341.  * DESCRIPTION
  342.  *  set calendar poup messages and flag of day to calendar popup day
  343.  * PARAMETERS
  344.  *  day             [IN]        Popup day
  345.  *  message1        [IN]        Mesage 1
  346.  *  message2        [IN]        Message 2
  347.  *  message3        [IN]        Message 3
  348.  * RETURNS
  349.  *  void
  350.  *****************************************************************************/
  351. void SetCalendarPopupDay(S32 day, U8 *message1, U8 *message2, U8 *message3)
  352. {
  353.     /*----------------------------------------------------------------*/
  354.     /* Local Variables                                                */
  355.     /*----------------------------------------------------------------*/
  356.     /*----------------------------------------------------------------*/
  357.     /* Code Body                                                      */
  358.     /*----------------------------------------------------------------*/
  359.     if (day >= 0 && day < MAX_CALENDAR_DAYS)
  360.     {
  361.         MMI_calendar_days[day] |= CALENDAR_POPUP_DAY;
  362.         MMI_calendar_messages1 = message1;
  363.         MMI_calendar_messages2 = message2;
  364.         MMI_calendar_messages3 = message3;
  365.     }
  366. }
  367. /*****************************************************************************
  368.  * FUNCTION
  369.  *  set_calendar_control_background_limits
  370.  * DESCRIPTION
  371.  *  set calendar bkg y positions
  372.  * PARAMETERS
  373.  *  y1      [IN]        Start y position
  374.  *  y2      [IN]        End y position
  375.  * RETURNS
  376.  *  void
  377.  *****************************************************************************/
  378. void set_calendar_control_background_limits(S32 y1, S32 y2)
  379. {
  380.     /*----------------------------------------------------------------*/
  381.     /* Local Variables                                                */
  382.     /*----------------------------------------------------------------*/
  383.     /*----------------------------------------------------------------*/
  384.     /* Code Body                                                      */
  385.     /*----------------------------------------------------------------*/
  386.     calendar_control_background_y1 = y1;
  387.     calendar_control_background_y2 = y2;
  388. }
  389. /*****************************************************************************
  390.  * FUNCTION
  391.  *  calendar_control_header_display
  392.  * DESCRIPTION
  393.  *  set calendar header
  394.  * PARAMETERS
  395.  *  x1      [IN]        Start x position
  396.  *  y1      [IN]        Start y position
  397.  * RETURNS
  398.  *  void
  399.  *****************************************************************************/
  400. void calendar_control_header_display(S32 x1, S32 y1)
  401. {
  402.     /*----------------------------------------------------------------*/
  403.     /* Local Variables                                                */
  404.     /*----------------------------------------------------------------*/
  405.     U8 *DOW[] = { (U8*) "S",
  406.         (U8*) "M",
  407.         (U8*) "T",
  408.         (U8*) "W",
  409.         (U8*) "T",
  410.         (U8*) "F",
  411.         (U8*) "S",
  412.     };
  413.     color c1 = gui_color(255, 255, 255);
  414.     color c2 = gui_color(0, 0, 0);
  415.     S32 w, cw, i, x, tx;
  416.     /*----------------------------------------------------------------*/
  417.     /* Code Body                                                      */
  418.     /*----------------------------------------------------------------*/
  419.     /* set font */
  420.     gui_set_font(MMI_calendar_control.theme->text_font);
  421.     /* set text color */
  422.     gui_set_text_color(c1);
  423.     /* set text border color */
  424.     gui_set_text_border_color(c2);
  425.     cw = MMI_calendar_control.cell_width;
  426.     x = x1;
  427.     for (i = 0; i < 7; i++)
  428.     {
  429.         w = gui_get_character_width((UI_character_type) DOW[i][0]);
  430.         tx = x + (cw >> 1) - (w >> 1);
  431.         if (r2lMMIFlag)
  432.         {
  433.             gui_move_text_cursor(tx + w, y1);
  434.         }
  435.         else
  436.         {
  437.             gui_move_text_cursor(tx, y1);
  438.         }
  439.         gui_print_bordered_text((UI_string_type) DOW[i]);
  440.         x += cw;
  441.     }
  442. }
  443. /*****************************************************************************
  444.  * FUNCTION
  445.  *  calendar_control_background_display_function
  446.  * DESCRIPTION
  447.  *  set calendar bkg image
  448.  * PARAMETERS
  449.  *  x1      [IN]        Start x position
  450.  *  y1      [IN]        Start y position
  451.  *  x2      [IN]        End x position
  452.  *  y2      [IN]        End y position
  453.  * RETURNS
  454.  *  void
  455.  *****************************************************************************/
  456. void calendar_control_background_display_function(S32 x1, S32 y1, S32 x2, S32 y2)
  457. {
  458.     /*----------------------------------------------------------------*/
  459.     /* Local Variables                                                */
  460.     /*----------------------------------------------------------------*/
  461.     S32 x = x1;
  462.     /*----------------------------------------------------------------*/
  463.     /* Code Body                                                      */
  464.     /*----------------------------------------------------------------*/
  465.     y1 = calendar_control_background_y1;
  466.     y2 = calendar_control_background_y2;
  467.     x1 = 0;
  468.     x2 = UI_device_width - 1;
  469. #if(CALENDAR_FULL_SCREEN_BACKGROUND)
  470.     if (MMI_calendar_control.flags & CALENDAR_HIDE_POPUP)
  471.     {
  472.         gui_set_clip(x1, y1, x2, y2);
  473.     }
  474.     else
  475.     {
  476.         gui_set_clip(x1, 0, x2, y2);
  477.     }
  478.     gdi_layer_set_text_clip(x, y1, x2, y2);
  479. #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
  480.     gui_reset_clip();
  481. #endif 
  482.     gui_show_image(x1, 0, calendar_control_background_image);
  483. #else /* (CALENDAR_FULL_SCREEN_BACKGROUND) */ 
  484.     gui_set_clip(x1, y1, x2, y2);
  485.     gdi_layer_set_text_clip(x, y1, x2, y2);
  486.     gui_show_image(x1, y1, calendar_control_background_image);
  487. #endif /* (CALENDAR_FULL_SCREEN_BACKGROUND) */ 
  488.     if (calendar_control_title_image != NULL)
  489. #if ( defined  (__MMI_MAINLCD_128X128__) || defined (__MMI_MAINLCD_128X160__) )
  490.         /* PMT VIKAS START 20051217 */
  491. #if 0
  492. /* under construction !*/
  493. /* under construction !*/
  494. /* under construction !*/
  495. /* under construction !*/
  496. /* under construction !*/
  497. #else /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  498.         gui_show_transparent_image(x1, y1 + 1, calendar_control_title_image, 0);
  499. #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  500.     /* PMT VIKAS END 20051217 */
  501. #elif defined( __MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
  502.         /* PMT VIKAS START 20051217 */
  503. #if 0
  504. /* under construction !*/
  505. #else 
  506. //jerson modify begin 20070622
  507. #ifdef __MMI_MAINLCD_240X320__
  508.         gui_show_transparent_image(x1, y1 + 1, calendar_control_title_image, 0);     
  509. #else
  510. gui_show_transparent_image(cat82_title2_x1, y1 + 1, calendar_control_title_image, 0);
  511. #endif
  512. //jerson modify end 20070622
  513. //Old:gui_show_transparent_image(cat82_title2_x1, y1 + 1, calendar_control_title_image, 0);     //KP Jerry modify for calendar_control_title_image display on center on 2006-11-25
  514. #endif 
  515.     /* PMT VIKAS END 20051217 */
  516. #else 
  517.         gui_show_transparent_image(x1, y1 + 1, calendar_control_title_image, 0);
  518. #endif 
  519.     else
  520. #if 0
  521. /* under construction !*/
  522. #ifdef __MMI_MAINLCD_176X220__
  523. /* under construction !*/
  524. #elif defined(__MMI_MAINLCD_128X160__)
  525. /* under construction !*/
  526. #endif 
  527. /* under construction !*/
  528. #else /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  529.         calendar_control_header_display(x, y1 + 5);
  530. #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  531. }
  532. /*****************************************************************************
  533.  * FUNCTION
  534.  *  SetCalendarBackground
  535.  * DESCRIPTION
  536.  *  set image of calendar bkg
  537.  * PARAMETERS
  538.  *  image_ID        [IN]        
  539.  *  imageid(?)      [IN]        
  540.  * RETURNS
  541.  *  void
  542.  *****************************************************************************/
  543. void SetCalendarBackground(U16 image_ID)
  544. {
  545.     /*----------------------------------------------------------------*/
  546.     /* Local Variables                                                */
  547.     /*----------------------------------------------------------------*/
  548.     /*----------------------------------------------------------------*/
  549.     /* Code Body                                                      */
  550.     /*----------------------------------------------------------------*/
  551.     MMI_calendar_control.theme = &_calendar_control_theme_data;
  552.     MMI_calendar_control.draw_background_function = calendar_control_background_display_function;
  553. #ifdef __MMI_THEMES_V2_SUPPORT__
  554.     calendar_control_background_image = get_image(image_ID);
  555. #endif 
  556.     calendar_control_background_image = get_image(image_ID);
  557. }
  558. /*****************************************************************************
  559.  * FUNCTION
  560.  *  SetCalendarTitleImage
  561.  * DESCRIPTION
  562.  *  set the image of title of calendar
  563.  * PARAMETERS
  564.  *  image_ID        [IN]        
  565.  *  imageid(?)      [IN]        
  566.  * RETURNS
  567.  *  void
  568.  *****************************************************************************/
  569. void SetCalendarTitleImage(U16 image_ID)
  570. {
  571. #ifdef __MMI_UI_DALMATIAN_CALENDAR__
  572.     /*----------------------------------------------------------------*/
  573.     /* Local Variables                                                */
  574.     /*----------------------------------------------------------------*/
  575.     /*----------------------------------------------------------------*/
  576.     /* Code Body                                                      */
  577.     /*----------------------------------------------------------------*/
  578.     calendar_control_title_image = get_image(dalmatian_calendar_current_week_image());
  579. #else /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  580.     calendar_control_title_image = get_image(image_ID);
  581. #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  582. }
  583. /*****************************************************************************
  584.  * FUNCTION
  585.  *  Calendar_hide_left_softkey
  586.  * DESCRIPTION
  587.  *  Hides the left softkey
  588.  *  
  589.  *  Calendar hide left softkey function
  590.  * PARAMETERS
  591.  *  void
  592.  * RETURNS
  593.  *  void
  594.  *****************************************************************************/
  595. void Calendar_hide_left_softkey(void)
  596. {
  597.     /*----------------------------------------------------------------*/
  598.     /* Local Variables                                                */
  599.     /*----------------------------------------------------------------*/
  600.     /*----------------------------------------------------------------*/
  601.     /* Code Body                                                      */
  602.     /*----------------------------------------------------------------*/
  603.     gdi_layer_push_clip();
  604.     gui_set_clip(
  605.         MMI_softkeys[MMI_LEFT_SOFTKEY].x,
  606.         UI_device_height - MMI_button_bar_height,
  607.         MMI_softkeys[MMI_LEFT_SOFTKEY].x + MMI_softkeys[MMI_LEFT_SOFTKEY].width + 2,
  608.         UI_device_height - 1);
  609. #if(CALENDAR_FULL_SCREEN_BACKGROUND)
  610.     gui_show_image(0, 0, calendar_control_background_image);
  611. #else 
  612.     gui_show_image(0, calendar_control_background_y1, calendar_control_background_image);
  613. #endif 
  614.     gdi_layer_pop_clip();
  615. }
  616. /*****************************************************************************
  617.  * FUNCTION
  618.  *  Calendar_hide_right_softkey
  619.  * DESCRIPTION
  620.  *  Hides the right softkey
  621.  *  
  622.  *  Calendar hide right softkey function
  623.  * PARAMETERS
  624.  *  void
  625.  * RETURNS
  626.  *  void
  627.  *****************************************************************************/
  628. void Calendar_hide_right_softkey(void)
  629. {
  630.     /*----------------------------------------------------------------*/
  631.     /* Local Variables                                                */
  632.     /*----------------------------------------------------------------*/
  633.     /*----------------------------------------------------------------*/
  634.     /* Code Body                                                      */
  635.     /*----------------------------------------------------------------*/
  636.     gdi_layer_push_clip();
  637.     gui_set_clip(
  638.         MMI_softkeys[MMI_RIGHT_SOFTKEY].x,
  639.         UI_device_height - MMI_button_bar_height,
  640.         MMI_softkeys[MMI_RIGHT_SOFTKEY].x + MMI_softkeys[MMI_RIGHT_SOFTKEY].width + 2,
  641.         UI_device_height - 1);
  642. #if(CALENDAR_FULL_SCREEN_BACKGROUND)
  643.     gui_show_image(0, 0, calendar_control_background_image);
  644. #else 
  645.     gui_show_image(0, calendar_control_background_y1, calendar_control_background_image);
  646. #endif 
  647.     gdi_layer_pop_clip();
  648. }
  649. /*****************************************************************************
  650.  * FUNCTION
  651.  *  RedrawCategory80Screen
  652.  * DESCRIPTION
  653.  *  Redraws the Calendar App category screen solar calendar
  654.  * PARAMETERS
  655.  *  void
  656.  * RETURNS
  657.  *  void
  658.  *****************************************************************************/
  659. void RedrawCategory80Screen(void)
  660. {
  661.     /*----------------------------------------------------------------*/
  662.     /* Local Variables                                                */
  663.     /*----------------------------------------------------------------*/
  664.     /*----------------------------------------------------------------*/
  665.     /* Code Body                                                      */
  666.     /*----------------------------------------------------------------*/
  667.     gdi_layer_lock_frame_buffer();
  668.     clear_screen();
  669.     gdi_layer_push_clip();
  670.     gdi_layer_push_text_clip();
  671.     gui_reset_clip();
  672.     gui_set_font(&MMI_default_font);
  673. #ifdef __MMI_UI_DALMATIAN_CALENDAR__
  674.     set_dalmatian_calendar_highlighter_box();
  675.     SetCalendarTitleImage(dalmatian_calendar_current_week_image());
  676. #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  677.     wgui_show_calendar();
  678.     ChangeCategory82Title1(Cat82_title1);
  679. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  680.     ChangeCategory82Title1Month(Cat82_title1_month);
  681. #endif 
  682. #if ( defined (__MMI_MAINLCD_128X128__) || defined (__MMI_MAINLCD_128X160__) )
  683.     show_softkey_background();
  684. #elif defined( __MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
  685.     disable_softkey_background();
  686. #else 
  687.     show_softkey_background();
  688. #endif 
  689.     show_left_softkey();
  690.     show_right_softkey();
  691.     gdi_layer_unlock_frame_buffer();
  692.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  693.     gdi_layer_pop_clip();
  694.     gdi_layer_pop_text_clip();
  695. }
  696. /*****************************************************************************
  697.  * FUNCTION
  698.  *  InitializeCategory80Screen
  699.  * DESCRIPTION
  700.  *  Initializes the Calendar App category screen
  701.  *  
  702.  *  Must be called once before calling ShowCategory80Screen
  703.  * PARAMETERS
  704.  *  first_day_of_week       [IN]        See the constants in wgui_calendar.h
  705.  *  last_day_of_month       [IN]        Ex: 28, 29, 30 or 31
  706.  *  current_day             [IN]        
  707.  *  current_month           [IN]        
  708.  *  current_year            [IN]        
  709.  *  INT(?)                  [IN]        Current day          Current day number (ex: 1 to 31)
  710.  * RETURNS
  711.  *  void
  712.  *****************************************************************************/
  713. void InitializeCategory80Screen(
  714.         S32 first_day_of_week,
  715.         S32 last_day_of_month,
  716.         S32 current_day,
  717.         S32 current_month,
  718.         S32 current_year)
  719. {
  720.     /*----------------------------------------------------------------*/
  721.     /* Local Variables                                                */
  722.     /*----------------------------------------------------------------*/
  723.     /*----------------------------------------------------------------*/
  724.     /* Code Body                                                      */
  725.     /*----------------------------------------------------------------*/
  726.     lunar_calendar_present = FALSE;
  727.     wgui_setup_calendar(
  728.         0,
  729.         0,
  730.         UI_device_width / CALENDAR_N_COLUMNS,
  731.         UI_device_height / CALENDAR_N_ROWS,
  732.         first_day_of_week,
  733.         last_day_of_month,
  734.         current_day,
  735.         current_month,
  736.         current_year,
  737.         0);
  738.     /* PMT VIKAS START 20051217 */
  739. #ifdef __MMI_UI_DALMATIAN_CALENDAR__
  740.     set_current_month_year_for_dalmatian(current_day, current_month, current_year);
  741. #endif 
  742.     /* PMT VIKAS END 20051217 */
  743. }
  744. /*****************************************************************************
  745.  * FUNCTION
  746.  *  ShowCategory80Screen
  747.  * DESCRIPTION
  748.  *  Displays the Calendar App category screen
  749.  *  
  750.  *  Must call InitializeCategory80Screen before calling this screen
  751.  * PARAMETERS
  752.  *  left_softkey            [IN]        Left softkey label
  753.  *  left_softkey_icon       [IN]        Icon for the left softkey
  754.  *  right_softkey           [IN]        Right softkey label
  755.  *  right_softkey_icon      [IN]        Icon for the right softkey
  756.  *  history_buffer          [IN]        History buffer
  757.  *  STRING(?)               [IN]        Title             Title string (ex: Month and Year)
  758.  * RETURNS
  759.  *  void
  760.  *****************************************************************************/
  761. void ShowCategory80Screen(
  762.         U16 left_softkey,
  763.         U16 left_softkey_icon,
  764.         U16 right_softkey,
  765.         U16 right_softkey_icon,
  766.         U8 *history_buffer)
  767. {
  768.     /*----------------------------------------------------------------*/
  769.     /* Local Variables                                                */
  770.     /*----------------------------------------------------------------*/
  771.     dm_data_struct dm_data;
  772.     /*----------------------------------------------------------------*/
  773.     /* Code Body                                                      */
  774.     /*----------------------------------------------------------------*/
  775.     ShowCalendarCommomCategoryScreen(
  776.         left_softkey,
  777.         left_softkey_icon,
  778.         right_softkey,
  779.         right_softkey_icon,
  780.         history_buffer);
  781. #ifdef __MMI_MAINLCD_240X320__
  782.     register_hide_left_softkey(Calendar_hide_left_softkey);
  783.     register_hide_right_softkey(Calendar_hide_right_softkey);
  784. //#else /* __MMI_MAINLCD_240X320__ */ //083006 calendar softkey
  785. #elif defined(__MMI_MAINLCD_176X220__)
  786.     disable_softkey_background();
  787. #endif /* __MMI_MAINLCD_240X320__ */ 
  788.     SetCategory82Title1((U8*) MMI_title_string);
  789. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  790.     SetCategory82Title1Month((U8*) MMI_calendar_title_string_month);
  791. #endif 
  792.     ExitCategoryFunction = ExitCategory80Screen;
  793.     GetCategoryHistory = dummy_get_history;
  794.     GetCategoryHistorySize = dummy_get_history_size;
  795.     RedrawCategoryFunction = dm_redraw_category_screen;
  796.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  797.     dm_data.s32CatId = MMI_CATEGORY80_ID;
  798.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  799.     dm_setup_data(&dm_data);
  800.     dm_redraw_category_screen();
  801. }
  802. /*****************************************************************************
  803.  * FUNCTION
  804.  *  ExitCategory80Screen
  805.  * DESCRIPTION
  806.  *  Exits the Calendar App category screen
  807.  * PARAMETERS
  808.  *  void
  809.  * RETURNS
  810.  *  void
  811.  *****************************************************************************/
  812. void ExitCategory80Screen(void)
  813. {   /* close calenar ..stop popup timer */
  814.     /*----------------------------------------------------------------*/
  815.     /* Local Variables                                                */
  816.     /*----------------------------------------------------------------*/
  817.     /*----------------------------------------------------------------*/
  818.     /* Code Body                                                      */
  819.     /*----------------------------------------------------------------*/
  820.     wgui_close_calendar();
  821.     leave_full_screen();
  822.     enable_softkey_background();
  823.     reset_softkeys();   /* reset softkeys */
  824. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  825.     gui_register_button_shuffle(shuffle_draw_white);    /* register the background drower */
  826. #endif 
  827. #if defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__)
  828.     ResetCalendarTitle1Arrow();
  829.     ResetCalendarTitle1MonthArrow();
  830. #endif /* defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__) */ 
  831.     ExitCategoryFunction = MMI_dummy_function;
  832.     RedrawCategoryFunction = MMI_dummy_function;
  833.     GetCategoryHistory = dummy_get_history;
  834.     GetCategoryHistorySize = dummy_get_history_size;
  835. }
  836. /*****************************************************************************
  837.  * FUNCTION
  838.  *  InitializeCategory81Screen
  839.  * DESCRIPTION
  840.  *  Initializes the Calendar App category screen
  841.  *  
  842.  *  Must be called once before calling ShowCategory81Screen
  843.  * PARAMETERS
  844.  *  first_day_of_week       [IN]        See the constants in wgui_calendar.h
  845.  *  last_day_of_month       [IN]        Ex: 28, 29, 30 or 31
  846.  *  current_day             [IN]        
  847.  *  current_month           [IN]        Current month (ex: 1 to 12)
  848.  *  current_year            [IN]        Current  year (ex: 1970 to 2030)
  849.  *  INT(?)                  [IN]        Current day          Current day number (ex: 1 to 31)
  850.  * RETURNS
  851.  *  void
  852.  *****************************************************************************/
  853. void InitializeCategory81Screen(
  854.         S32 first_day_of_week,
  855.         S32 last_day_of_month,
  856.         S32 current_day,
  857.         S32 current_month,
  858.         S32 current_year)
  859. {
  860.     /*----------------------------------------------------------------*/
  861.     /* Local Variables                                                */
  862.     /*----------------------------------------------------------------*/
  863.     /*----------------------------------------------------------------*/
  864.     /* Code Body                                                      */
  865.     /*----------------------------------------------------------------*/
  866.     wgui_setup_calendar(
  867.         0,
  868.         0,
  869.         UI_device_width / CALENDAR_N_COLUMNS,
  870.         UI_device_height / CALENDAR_N_ROWS,
  871.         first_day_of_week,
  872.         last_day_of_month,
  873.         current_day,
  874.         current_month,
  875.         current_year,
  876.         0);
  877.     /* PMT VIKAS START 20051217 */
  878. #ifdef __MMI_UI_DALMATIAN_CALENDAR__
  879.     set_current_month_year_for_dalmatian(current_day, current_month, current_year);
  880. #endif 
  881.     /* PMT VIKAS END 20051217 */
  882. }
  883. /*****************************************************************************
  884.  * FUNCTION
  885.  *  ShowCategory81Screen
  886.  * DESCRIPTION
  887.  *  Displays the Health Calendar App category screen
  888.  * PARAMETERS
  889.  *  title                   [IN]        Title string (ex: Month and Year)
  890.  *  left_softkey            [IN]        Left softkey label
  891.  *  left_softkey_icon       [IN]        Icon for the left softkey
  892.  *  right_softkey           [IN]        Right softkey label
  893.  *  right_softkey_icon      [IN]        Icon for the right softkey
  894.  *  message1                [IN]        Sub title message 1
  895.  *  message2                [IN]        Sub title message 2
  896.  *  history_buffer          [IN]        History buffer
  897.  * RETURNS
  898.  *  void
  899.  *****************************************************************************/
  900. void ShowCategory81Screen(
  901.         U8 *title,
  902.         U16 left_softkey,
  903.         U16 left_softkey_icon,
  904.         U16 right_softkey,
  905.         U16 right_softkey_icon,
  906.         U8 *message1,
  907.         U8 *message2,
  908.         U8 *history_buffer)
  909. {
  910.     /*----------------------------------------------------------------*/
  911.     /* Local Variables                                                */
  912.     /*----------------------------------------------------------------*/
  913.     dm_data_struct dm_data;
  914.     color c = *(current_MMI_theme->UI_black_color);
  915.     color wc = *(current_MMI_theme->UI_white_color);
  916.     /*----------------------------------------------------------------*/
  917.     /* Code Body                                                      */
  918.     /*----------------------------------------------------------------*/
  919.     dm_reset_context();
  920.     ShowCalendarCommomCategoryScreen(
  921.         left_softkey,
  922.         left_softkey_icon,
  923.         right_softkey,
  924.         right_softkey_icon,
  925.         history_buffer);
  926. #ifdef __MMI_MAINLCD_240X320__
  927.     register_hide_left_softkey(Calendar_hide_left_softkey);
  928.     register_hide_right_softkey(Calendar_hide_right_softkey);
  929. //#else /* __MMI_MAINLCD_240X320__ */ //083006 calendar softkey
  930. #elif defined(__MMI_MAINLCD_176X220__)
  931.     disable_softkey_background();
  932. #endif /* __MMI_MAINLCD_240X320__ */ 
  933.     SetCategory82Title1((U8*) MMI_title_string);
  934. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  935. #ifdef __MMI_TOUCH_SCREEN__
  936.     DisableCalendarTitle1Arrow();
  937. #endif 
  938.     SetCategory82Title1Month((U8*) MMI_calendar_title_string_month);
  939. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  940.     ExitCategoryFunction = ExitCategory81Screen;
  941.     GetCategoryHistory = dummy_get_history;
  942.     GetCategoryHistorySize = dummy_get_history_size;
  943.     RedrawCategoryFunction = dm_redraw_category_screen;
  944.     dm_add_back_fill_area(MMI_calendar_control.theme->special2_day_filler);
  945.     dm_add_rectangle(c, 0);
  946.     dm_add_back_fill_area(MMI_calendar_control.theme->special1_day_filler);
  947.     dm_add_rectangle(c, 0);
  948.     dm_add_string((UI_string_type) message1, &MMI_default_font, wc, c, NULL);
  949.     dm_add_string((UI_string_type) message2, &MMI_default_font, wc, c, NULL);
  950.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  951.     dm_data.s32CatId = MMI_CATEGORY81_ID;
  952.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  953.     dm_setup_data(&dm_data);
  954.     dm_redraw_category_screen();
  955. }
  956. /*****************************************************************************
  957.  * FUNCTION
  958.  *  ExitCategory81Screen
  959.  * DESCRIPTION
  960.  *  Exits the Health Calendar App category screen
  961.  * PARAMETERS
  962.  *  void
  963.  * RETURNS
  964.  *  void
  965.  *****************************************************************************/
  966. void ExitCategory81Screen(void)
  967. {   /* close health calendar */
  968.     /*----------------------------------------------------------------*/
  969.     /* Local Variables                                                */
  970.     /*----------------------------------------------------------------*/
  971.     /*----------------------------------------------------------------*/
  972.     /* Code Body                                                      */
  973.     /*----------------------------------------------------------------*/
  974.     wgui_close_calendar();
  975.     leave_full_screen();
  976.     reset_softkeys();
  977.     enable_softkey_background();
  978. #ifdef __MMI_UI_DALMATIAN_CALENDAR__
  979.     set_dalmatian_calendar_highlighter_enable();
  980. #endif 
  981. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  982.     gui_register_button_shuffle(shuffle_draw_white);    /* register the background drower */
  983. #endif 
  984. #if defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__)
  985.     ResetCalendarTitle1Arrow();
  986.     ResetCalendarTitle1MonthArrow();
  987. #endif /* defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__) */ 
  988.     ExitCategoryFunction = MMI_dummy_function;
  989.     RedrawCategoryFunction = MMI_dummy_function;
  990.     GetCategoryHistory = dummy_get_history;
  991.     GetCategoryHistorySize = dummy_get_history_size;
  992. }
  993. /*****************************************************************************
  994.  * FUNCTION
  995.  *  SetCategory82Title1
  996.  * DESCRIPTION
  997.  *  set title 1 of lunar calendar
  998.  * PARAMETERS
  999.  *  title       [IN]        
  1000.  * RETURNS
  1001.  *  void
  1002.  *****************************************************************************/
  1003. void SetCategory82Title1(U8 *title)
  1004. {
  1005.     /*----------------------------------------------------------------*/
  1006.     /* Local Variables                                                */
  1007.     /*----------------------------------------------------------------*/
  1008.     /*----------------------------------------------------------------*/
  1009.     /* Code Body                                                      */
  1010.     /*----------------------------------------------------------------*/
  1011.     Cat82_title1 = title;
  1012. }
  1013. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1014. /*****************************************************************************
  1015.  * FUNCTION
  1016.  *  SetCategory82Title1Month
  1017.  * DESCRIPTION
  1018.  *  set title 1 month of lunar calendar
  1019.  * PARAMETERS
  1020.  *  title       [IN]        
  1021.  * RETURNS
  1022.  *  void
  1023.  *****************************************************************************/
  1024. void SetCategory82Title1Month(U8 *title)
  1025. {
  1026.     /*----------------------------------------------------------------*/
  1027.     /* Local Variables                                                */
  1028.     /*----------------------------------------------------------------*/
  1029.     /*----------------------------------------------------------------*/
  1030.     /* Code Body                                                      */
  1031.     /*----------------------------------------------------------------*/
  1032.     Cat82_title1_month = title;
  1033. }
  1034. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1035. /*****************************************************************************
  1036.  * FUNCTION
  1037.  *  SetCategory82Title2
  1038.  * DESCRIPTION
  1039.  *  set title 2 of lunar calendar
  1040.  * PARAMETERS
  1041.  *  title       [IN]        
  1042.  * RETURNS
  1043.  *  void
  1044.  *****************************************************************************/
  1045. void SetCategory82Title2(U8 *title)
  1046. {
  1047.     /*----------------------------------------------------------------*/
  1048.     /* Local Variables                                                */
  1049.     /*----------------------------------------------------------------*/
  1050.     /*----------------------------------------------------------------*/
  1051.     /* Code Body                                                      */
  1052.     /*----------------------------------------------------------------*/
  1053.     Cat82_title2 = title;
  1054. }
  1055. /*****************************************************************************
  1056.  * FUNCTION
  1057.  *  SetCategory82Title3
  1058.  * DESCRIPTION
  1059.  *  set title 3 of lunar calendar
  1060.  * PARAMETERS
  1061.  *  title       [IN]        
  1062.  * RETURNS
  1063.  *  void
  1064.  *****************************************************************************/
  1065. void SetCategory82Title3(U8 *title)
  1066. {
  1067.     /*----------------------------------------------------------------*/
  1068.     /* Local Variables                                                */
  1069.     /*----------------------------------------------------------------*/
  1070.     /*----------------------------------------------------------------*/
  1071.     /* Code Body                                                      */
  1072.     /*----------------------------------------------------------------*/
  1073.     Cat82_title3 = title;
  1074. }
  1075. /*****************************************************************************
  1076.  * FUNCTION
  1077.  *  ChangeCategory82Title1
  1078.  * DESCRIPTION
  1079.  *  change title 1 of lunar calendar and display
  1080.  * PARAMETERS
  1081.  *  title       [IN]        
  1082.  * RETURNS
  1083.  *  void
  1084.  *****************************************************************************/
  1085. void ChangeCategory82Title1(U8 *title)
  1086. {
  1087.     /*----------------------------------------------------------------*/
  1088.     /* Local Variables                                                */
  1089.     /*----------------------------------------------------------------*/
  1090.     S32 x1 = cat82_title1_x1;
  1091.     S32 y1 = cat82_title1_y1;
  1092.     S32 x2 = cat82_title1_x2;
  1093.     S32 y2 = cat82_title1_y2;
  1094.     S32 w, h;
  1095.     color tc = *(current_MMI_theme->UI_black_color);
  1096. #if(CALENDAR_BORDERED_TITLES)
  1097.     color wc = *(current_MMI_theme->UI_white_color);
  1098. #endif 
  1099.     /*----------------------------------------------------------------*/
  1100.     /* Code Body                                                      */
  1101.     /*----------------------------------------------------------------*/
  1102.     Cat82_title1 = title;
  1103.     gdi_layer_push_clip();
  1104.     gdi_layer_push_text_clip();
  1105.     gui_reset_clip();
  1106.     gdi_layer_set_text_clip(x1, y1, x2, y2);
  1107. #if(CALENDAR_FULL_SCREEN_BACKGROUND)
  1108.     gui_set_clip(x1, y1, x2, y2);
  1109. #if !defined(__MMI_MAINLCD_176X220__) && !defined(__MMI_MAINLCD_240X320__)
  1110.     gui_show_image(x1, 0, calendar_control_background_image);
  1111. #else 
  1112.     gui_show_image(0, 0, calendar_control_background_image);
  1113. #endif 
  1114. #else /* (CALENDAR_FULL_SCREEN_BACKGROUND) */ 
  1115.     gui_fill_rectangle(x1, y1, x2, y2, tc);
  1116. #endif /* (CALENDAR_FULL_SCREEN_BACKGROUND) */ 
  1117. #ifdef __MMI_TOUCH_SCREEN__
  1118. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1119.     if (!(lunar_calendar_present && IsChineseSet()))
  1120.     {
  1121.         if (!Cat82_title1_arrow_disable)    /* Year arrows on title 1 */
  1122.         {
  1123.             gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1124.             gui_show_transparent_image(
  1125.                 x1 + MMI_CALENDAR_ARROW_OFFSET,
  1126.                 y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1127.                 (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
  1128.                 0);
  1129.             gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1130.             gui_show_transparent_image(
  1131.                 x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1132.                 y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1133.                 (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
  1134.                 0);
  1135.         }
  1136.     }
  1137. #else /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1138.     if (!(lunar_calendar_present && IsChineseSet()))
  1139.     {
  1140.         gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1141.         gui_show_transparent_image(
  1142.             x1 + MMI_CALENDAR_ARROW_OFFSET,
  1143.             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1144.             (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
  1145.             0);
  1146.         gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1147.         gui_show_transparent_image(
  1148.             x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1149.             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1150.             (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
  1151.             0);
  1152.     }
  1153. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1154. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1155.     gui_set_font(calendar_title_font);
  1156.     /* measure width and height ot title 1 in pixels */
  1157.     gui_measure_string((UI_string_type) Cat82_title1, &w, &h);
  1158.     /* move text cursor */
  1159. #if 0
  1160. /* under construction !*/
  1161. /* under construction !*/
  1162. /* under construction !*/
  1163. /* under construction !*/
  1164. /* under construction !*/
  1165. /* under construction !*/
  1166. /* under construction !*/
  1167. /* under construction !*/
  1168. /* under construction !*/
  1169. #else /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  1170.     if (r2lMMIFlag)
  1171.     {
  1172.         gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1) + w, y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
  1173.     }
  1174.     else
  1175.     {
  1176.         gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1), y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
  1177.     }
  1178. #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  1179. #if(CALENDAR_BORDERED_TITLES)
  1180. #if 0 
  1181. /* under construction !*/
  1182. /* under construction !*/
  1183. /* under construction !*/
  1184. #else /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  1185.     gui_set_text_border_color(tc);
  1186.     gui_set_text_color(wc);
  1187. #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  1188.     gui_print_bordered_text((UI_string_type) Cat82_title1);
  1189. #else /* (CALENDAR_BORDERED_TITLES) */ 
  1190.     gui_set_text_color(tc);
  1191.     /* pritnt title 1 */
  1192.     gui_print_text((UI_string_type) Cat82_title1);
  1193. #endif /* (CALENDAR_BORDERED_TITLES) */ 
  1194.     gdi_layer_blt_previous(x1, y1, x2, y2);
  1195.     gdi_layer_pop_clip();
  1196.     gdi_layer_pop_text_clip();
  1197. }
  1198. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1199. /*****************************************************************************
  1200.  * FUNCTION
  1201.  *  ChangeCategory82Title1Month
  1202.  * DESCRIPTION
  1203.  *  change title 1 month of lunar calendar and display
  1204.  * PARAMETERS
  1205.  *  title       [IN]        
  1206.  * RETURNS
  1207.  *  void
  1208.  *****************************************************************************/
  1209. void ChangeCategory82Title1Month(U8 *title)
  1210. {
  1211.     /*----------------------------------------------------------------*/
  1212.     /* Local Variables                                                */
  1213.     /*----------------------------------------------------------------*/
  1214.     S32 x1 = cat82_title1_month_x1;
  1215.     S32 y1 = cat82_title1_month_y1;
  1216.     S32 x2 = cat82_title1_month_x2;
  1217.     S32 y2 = cat82_title1_month_y2;
  1218.     S32 w, h;
  1219.     color tc = *(current_MMI_theme->UI_black_color);
  1220. #if(CALENDAR_BORDERED_TITLES)
  1221.     color wc = *(current_MMI_theme->UI_white_color);
  1222. #endif 
  1223.     /*----------------------------------------------------------------*/
  1224.     /* Code Body                                                      */
  1225.     /*----------------------------------------------------------------*/
  1226.     if (calendar_show_title_month == 0) /* Don't wanna show month info on title 1 : Month */
  1227.     {
  1228.         return;
  1229.     }
  1230.     Cat82_title1_month = title;
  1231.     gdi_layer_push_clip();
  1232.     gdi_layer_push_text_clip();
  1233.     if ((lunar_calendar_present && IsChineseSet()) && calendar_show_title3)
  1234.     {
  1235.         x2 = cat82_title3_x1 - 1;
  1236.     }
  1237.     gui_reset_clip();
  1238.     gdi_layer_set_text_clip(x1, y1, x2, y2);
  1239.     if (lunar_calendar_present && IsChineseSet())   /* Shown by lunar calnedar */
  1240.     {
  1241.         color bc = {182, 200, 255, 100};
  1242.         gui_fill_rectangle(x1, y1, x2, y2, bc);
  1243.         gui_set_font(&MMI_default_font);
  1244.     }
  1245.     else    /* Shown by normal calnedar */
  1246.     {
  1247.     #if(CALENDAR_FULL_SCREEN_BACKGROUND)
  1248.         gui_set_clip(x1, y1, x2, y2);
  1249.     #if !defined(__MMI_MAINLCD_176X220__) && !defined(__MMI_MAINLCD_240X320__)
  1250.         gui_show_image(cat82_title1_x1, 0, calendar_control_background_image);
  1251.     #else 
  1252.         gui_show_image(0, 0, calendar_control_background_image);
  1253.     #endif 
  1254.     #else /* (CALENDAR_FULL_SCREEN_BACKGROUND) */ 
  1255.         gui_fill_rectangle(x1, y1, x2, y2, tc);
  1256.     #endif /* (CALENDAR_FULL_SCREEN_BACKGROUND) */ 
  1257.         gui_set_font(calendar_title_month_font);
  1258.     }
  1259. #ifdef __MMI_TOUCH_SCREEN__
  1260.     if (!Cat82_title1_month_arrow_disable)
  1261.     {
  1262.         gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1263.         gui_show_transparent_image(
  1264.             x1 + MMI_CALENDAR_ARROW_OFFSET,
  1265.             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1266.             (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
  1267.             0);
  1268.         gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1269.         gui_show_transparent_image(
  1270.             x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1271.             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1272.             (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
  1273.             0);
  1274.     }
  1275. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1276.     /* measure width and height ot title 1 in pixels */
  1277.     gui_measure_string((UI_string_type) Cat82_title1_month, &w, &h);
  1278.     /* move text cursor */
  1279.     if (r2lMMIFlag)
  1280.     {
  1281.         gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1) + w, y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
  1282.     }
  1283.     else
  1284.     {
  1285.         gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1), y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
  1286.     }
  1287. #if(CALENDAR_BORDERED_TITLES)
  1288.     if (lunar_calendar_present && IsChineseSet())
  1289.     {
  1290.         gui_set_text_color(tc);
  1291.         gui_print_text((UI_string_type) Cat82_title1_month);
  1292.     }
  1293.     else
  1294.     {
  1295.         gui_set_text_border_color(tc);
  1296.         gui_set_text_color(wc);
  1297.         gui_print_bordered_text((UI_string_type) Cat82_title1_month);
  1298.     }
  1299. #else /* (CALENDAR_BORDERED_TITLES) */ 
  1300.     gui_set_text_color(tc);
  1301.     /* pritnt title 1 */
  1302.     gui_print_text((UI_string_type) Cat82_title1_month);
  1303. #endif /* (CALENDAR_BORDERED_TITLES) */ 
  1304.     gdi_layer_blt_previous(x1, y1, x2, y2);
  1305.     gdi_layer_pop_clip();
  1306.     gdi_layer_pop_text_clip();
  1307. }
  1308. #ifdef __MMI_TOUCH_SCREEN__
  1309. /*****************************************************************************
  1310.  * FUNCTION
  1311.  *  DisableCalendarTitle1Arrow
  1312.  * DESCRIPTION
  1313.  *  disable arrows functionning in title1
  1314.  * PARAMETERS
  1315.  *  void
  1316.  * RETURNS
  1317.  *  void
  1318.  *****************************************************************************/
  1319. void DisableCalendarTitle1Arrow(void)
  1320. {
  1321.     /*----------------------------------------------------------------*/
  1322.     /* Local Variables                                                */
  1323.     /*----------------------------------------------------------------*/
  1324.     /*----------------------------------------------------------------*/
  1325.     /* Code Body                                                      */
  1326.     /*----------------------------------------------------------------*/
  1327.     Cat82_title1_arrow_disable = MMI_TRUE;
  1328. }
  1329. /*****************************************************************************
  1330.  * FUNCTION
  1331.  *  ResetCalendarTitle1Arrow
  1332.  * DESCRIPTION
  1333.  *  reset arrows functionning in title1
  1334.  * PARAMETERS
  1335.  *  void
  1336.  * RETURNS
  1337.  *  void
  1338.  *****************************************************************************/
  1339. void ResetCalendarTitle1Arrow(void)
  1340. {
  1341.     /*----------------------------------------------------------------*/
  1342.     /* Local Variables                                                */
  1343.     /*----------------------------------------------------------------*/
  1344.     /*----------------------------------------------------------------*/
  1345.     /* Code Body                                                      */
  1346.     /*----------------------------------------------------------------*/
  1347.     Cat82_title1_arrow_disable = MMI_FALSE;
  1348. }
  1349. /*****************************************************************************
  1350.  * FUNCTION
  1351.  *  DisableCalendarTitle1MonthArrow
  1352.  * DESCRIPTION
  1353.  *  disable arrows functionning in title1 month
  1354.  * PARAMETERS
  1355.  *  void
  1356.  * RETURNS
  1357.  *  void
  1358.  *****************************************************************************/
  1359. void DisableCalendarTitle1MonthArrow(void)
  1360. {
  1361.     /*----------------------------------------------------------------*/
  1362.     /* Local Variables                                                */
  1363.     /*----------------------------------------------------------------*/
  1364.     /*----------------------------------------------------------------*/
  1365.     /* Code Body                                                      */
  1366.     /*----------------------------------------------------------------*/
  1367.     Cat82_title1_month_arrow_disable = MMI_TRUE;
  1368. }
  1369. /*****************************************************************************
  1370.  * FUNCTION
  1371.  *  ResetCalendarTitle1MonthArrow
  1372.  * DESCRIPTION
  1373.  *  reset arrows functionning in title1 month
  1374.  * PARAMETERS
  1375.  *  void
  1376.  * RETURNS
  1377.  *  void
  1378.  *****************************************************************************/
  1379. void ResetCalendarTitle1MonthArrow(void)
  1380. {
  1381.     /*----------------------------------------------------------------*/
  1382.     /* Local Variables                                                */
  1383.     /*----------------------------------------------------------------*/
  1384.     /*----------------------------------------------------------------*/
  1385.     /* Code Body                                                      */
  1386.     /*----------------------------------------------------------------*/
  1387.     Cat82_title1_month_arrow_disable = MMI_FALSE;
  1388. }
  1389. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1390. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1391. /*****************************************************************************
  1392.  * FUNCTION
  1393.  *  ChangeCategory82Title2
  1394.  * DESCRIPTION
  1395.  *  change title 2 of lunar calendar and display
  1396.  * PARAMETERS
  1397.  *  title       [IN]        
  1398.  * RETURNS
  1399.  *  void
  1400.  *****************************************************************************/
  1401. void ChangeCategory82Title2(U8 *title)
  1402. {
  1403.     /*----------------------------------------------------------------*/
  1404.     /* Local Variables                                                */
  1405.     /*----------------------------------------------------------------*/
  1406.     S32 x1 = cat82_title2_x1;
  1407.     S32 y1 = cat82_title2_y1;
  1408.     S32 x2 = cat82_title2_x2;
  1409. #if 0 
  1410. /* under construction !*/
  1411. #else 
  1412.     S32 y2 = cat82_title2_y2;
  1413. #endif 
  1414.     S32 w, h;
  1415.     color tc = *(current_MMI_theme->UI_black_color);
  1416.     //color bc = {182, 200, 255, 100};//120406 warning remove
  1417.     /*----------------------------------------------------------------*/
  1418.     /* Code Body                                                      */
  1419.     /*----------------------------------------------------------------*/
  1420.     /* Update Title2 and Title3 For Lunar calendar only */
  1421.     if (!lunar_calendar_present)
  1422.     {
  1423.         return;
  1424.     }
  1425.     if (calendar_show_title2 == 0)
  1426.     {
  1427.         return;
  1428.     }
  1429. #if 0
  1430. /* under construction !*/
  1431. #else /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  1432.     Cat82_title2 = title;
  1433. #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  1434.     gdi_layer_push_clip();
  1435.     gdi_layer_push_text_clip();
  1436. #ifndef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1437.     if (calendar_show_title3)
  1438.     {
  1439.         x2 = cat82_title3_x1 - 1;
  1440.     }
  1441. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1442.     gui_reset_clip();
  1443.     gdi_layer_set_text_clip(x1, y1, x2, y2);
  1444.     //gui_fill_rectangle(x1, y1, x2, y2, bc);
  1445. #ifdef __MMI_TOUCH_SCREEN__
  1446. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1447.     if ((lunar_calendar_present && IsChineseSet())) /* Year arrow on title 2 */
  1448.     {
  1449.         if (!Cat82_title1_arrow_disable)
  1450.         {
  1451.             gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1452.             gui_show_transparent_image(
  1453.                 x1 + MMI_CALENDAR_ARROW_OFFSET,
  1454.                 y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1455.                 (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
  1456.                 0);
  1457.             gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1458.             gui_show_transparent_image(
  1459.                 x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1460.                 y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1461.                 (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
  1462.                 0);
  1463.         }
  1464.     }
  1465. #else /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1466.     if ((lunar_calendar_present && IsChineseSet())) /* Year/Month  arrow on title 2 */
  1467.     {
  1468.         if (calendar_show_title3)
  1469.         {
  1470.             x2 = cat82_title3_x1 - 1;   /* Align Title2 contents in middle if Title3 is present as we want to show left and right arrow keys on title2 */
  1471.         }
  1472.         gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1473.         gui_show_transparent_image(
  1474.             x1 + MMI_CALENDAR_ARROW_OFFSET,
  1475.             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1476.             (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
  1477.             0);
  1478.         gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
  1479.         gui_show_transparent_image(
  1480.             x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1481.             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1482.             (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
  1483.             0);
  1484.     }
  1485. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1486. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1487.     /* set text font */
  1488.     gui_set_font(&MMI_default_font);
  1489.     /* set text color */
  1490.     gui_set_text_color(tc);
  1491.     /* measue width and hieht of title 2 of lunar calendar */
  1492.     gui_measure_string((UI_string_type) Cat82_title2, &w, &h);
  1493.     if (r2lMMIFlag)
  1494.     {
  1495.         gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1) + w, y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
  1496.     }
  1497.     else
  1498.     {
  1499.         gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1), y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
  1500.     }
  1501.     gui_print_text((UI_string_type) Cat82_title2);
  1502.     gdi_layer_blt_previous(x1, y1, x2, y2);
  1503.     gdi_layer_pop_clip();
  1504.     gdi_layer_pop_text_clip();
  1505. }
  1506. /*****************************************************************************
  1507.  * FUNCTION
  1508.  *  ChangeCategory82Title3
  1509.  * DESCRIPTION
  1510.  *  change title 3 of lunar calendar and display
  1511.  * PARAMETERS
  1512.  *  title       [IN]        
  1513.  * RETURNS
  1514.  *  void
  1515.  *****************************************************************************/
  1516. void ChangeCategory82Title3(U8 *title)
  1517. {
  1518.     /*----------------------------------------------------------------*/
  1519.     /* Local Variables                                                */
  1520.     /*----------------------------------------------------------------*/
  1521.     S32 x1 = cat82_title3_x1;
  1522.     S32 y1 = cat82_title3_y1;
  1523.     S32 x2 = cat82_title3_x2;
  1524. #if 0
  1525. /* under construction !*/
  1526. #else 
  1527.     S32 y2 = cat82_title3_y2;
  1528. #endif 
  1529.     S32 w, h;
  1530.     color tc = *(current_MMI_theme->UI_black_color);
  1531.     color bc = {255, 255, 255, 255};
  1532.     color bb = {0, 0, 0, 100};
  1533.     /*----------------------------------------------------------------*/
  1534.     /* Code Body                                                      */
  1535.     /*----------------------------------------------------------------*/
  1536.     /* Update Title2 and Title3 For Lunar calendar only */
  1537.     if (!lunar_calendar_present)
  1538.     {
  1539.         return;
  1540.     }
  1541.     if (calendar_show_title3 == 0)
  1542.     {
  1543.         return;
  1544.     }
  1545.     Cat82_title3 = title;
  1546.     gdi_layer_push_clip();
  1547.     gdi_layer_push_text_clip();
  1548.     gui_reset_clip();
  1549.     gdi_layer_set_text_clip(x1, y1, x2, y2);
  1550.     gui_fill_rectangle(x1, y1, x2, y2, bc);
  1551.     gui_set_font(&MMI_default_font);
  1552.     gui_set_text_color(tc);
  1553.     gui_measure_string((UI_string_type) Cat82_title3, &w, &h);
  1554.     if (r2lMMIFlag)
  1555.     {
  1556.         gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1) + w, y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
  1557.     }
  1558.     else
  1559.     {
  1560.         gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1), y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
  1561.     }
  1562.     gui_print_text((UI_string_type) Cat82_title3);
  1563.     gui_draw_rectangle(x1, y1, x2, y2, bb);
  1564.     gdi_layer_blt_previous(x1, y1, x2, y2);
  1565.     gdi_layer_pop_clip();
  1566.     gdi_layer_pop_text_clip();
  1567. }
  1568. /*****************************************************************************
  1569.  * FUNCTION
  1570.  *  RedrawCategory82Screen
  1571.  * DESCRIPTION
  1572.  *  Redraws the Calendar App category screen
  1573.  * PARAMETERS
  1574.  *  void
  1575.  * RETURNS
  1576.  *  void
  1577.  *****************************************************************************/
  1578. void RedrawCategory82Screen(void)
  1579. {
  1580.     /*----------------------------------------------------------------*/
  1581.     /* Local Variables                                                */
  1582.     /*----------------------------------------------------------------*/
  1583.     /*----------------------------------------------------------------*/
  1584.     /* Code Body                                                      */
  1585.     /*----------------------------------------------------------------*/
  1586.     gdi_layer_lock_frame_buffer();
  1587.     clear_screen();
  1588.     gui_reset_clip();
  1589. #ifdef __MMI_UI_DALMATIAN_CALENDAR__
  1590.     set_dalmatian_calendar_highlighter_box();
  1591.     SetCalendarTitleImage(dalmatian_calendar_current_week_image());
  1592. #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */ 
  1593.     wgui_show_calendar();
  1594.     ChangeCategory82Title1(Cat82_title1);
  1595.     ChangeCategory82Title2(Cat82_title2);
  1596.     ChangeCategory82Title3(Cat82_title3);
  1597. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1598.     ChangeCategory82Title1Month(Cat82_title1_month);
  1599. #endif 
  1600. #if ( defined (__MMI_MAINLCD_128X128__) || defined (__MMI_MAINLCD_128X160__) )
  1601.     show_softkey_background();
  1602. #elif defined( __MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
  1603.     disable_softkey_background();
  1604. #else 
  1605.     show_softkey_background();
  1606. #endif 
  1607.     show_left_softkey();
  1608.     show_right_softkey();
  1609.     gdi_layer_unlock_frame_buffer();
  1610.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  1611. }
  1612. /*****************************************************************************
  1613.  * FUNCTION
  1614.  *  InitializeCategory82Screen
  1615.  * DESCRIPTION
  1616.  *  Initializes the Calendar App category screen
  1617.  *  
  1618.  *  Must be called once before calling ShowCategory82Screen
  1619.  * PARAMETERS
  1620.  *  first_day_of_week       [IN]        See the constants in wgui_calendar.h
  1621.  *  last_day_of_month       [IN]        Ex: 28, 29, 30 or 31
  1622.  *  current_day             [IN]        
  1623.  *  current_month           [IN]        
  1624.  *  current_year            [IN]        
  1625.  *  INT(?)                  [IN]        Current day          Current day number (ex: 1 to 31)
  1626.  * RETURNS
  1627.  *  void
  1628.  *****************************************************************************/
  1629. void InitializeCategory82Screen(
  1630.         S32 first_day_of_week,
  1631.         S32 last_day_of_month,
  1632.         S32 current_day,
  1633.         S32 current_month,
  1634.         S32 current_year)
  1635. {
  1636.     /*----------------------------------------------------------------*/
  1637.     /* Local Variables                                                */
  1638.     /*----------------------------------------------------------------*/
  1639.     /*----------------------------------------------------------------*/
  1640.     /* Code Body                                                      */
  1641.     /*----------------------------------------------------------------*/
  1642.     wgui_setup_calendar(
  1643.         0,
  1644.         0,
  1645.         UI_device_width / CALENDAR_N_COLUMNS,
  1646.         UI_device_height / CALENDAR_N_ROWS,
  1647.         first_day_of_week,
  1648.         last_day_of_month,
  1649.         current_day,
  1650.         current_month,
  1651.         current_year,
  1652.         CALENDAR_ENABLE_POPUP);
  1653.     lunar_calendar_present = MMI_TRUE;
  1654.     /* PMT VIKAS START 20051217 */
  1655. #ifdef __MMI_UI_DALMATIAN_CALENDAR__
  1656.     set_current_month_year_for_dalmatian(current_day, current_month, current_year);
  1657. #endif 
  1658.     /* PMT VIKAS END 20051217 */
  1659. }
  1660. /*****************************************************************************
  1661.  * FUNCTION
  1662.  *  ShowCategory82Screen
  1663.  * DESCRIPTION
  1664.  *  Displays the Calendar App category screen
  1665.  *  
  1666.  *  Must call InitializeCategory82Screen before calling this screen
  1667.  * PARAMETERS
  1668.  *  left_softkey            [IN]        Left softkey label
  1669.  *  left_softkey_icon       [IN]        Icon for the left softkey
  1670.  *  right_softkey           [IN]        Right softkey label
  1671.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1672.  *  history_buffer          [IN]        History buffer
  1673.  *  STRING(?)               [IN]        Title             Title string (ex: Month and Year)
  1674.  * RETURNS
  1675.  *  void
  1676.  *****************************************************************************/
  1677. void ShowCategory82Screen(
  1678.         U16 left_softkey,
  1679.         U16 left_softkey_icon,
  1680.         U16 right_softkey,
  1681.         U16 right_softkey_icon,
  1682.         U8 *history_buffer)
  1683. {
  1684.     /*----------------------------------------------------------------*/
  1685.     /* Local Variables                                                */
  1686.     /*----------------------------------------------------------------*/
  1687.     dm_data_struct dm_data;
  1688.     /*----------------------------------------------------------------*/
  1689.     /* Code Body                                                      */
  1690.     /*----------------------------------------------------------------*/
  1691.     ShowCalendarCommomCategoryScreen(
  1692.         left_softkey,
  1693.         left_softkey_icon,
  1694.         right_softkey,
  1695.         right_softkey_icon,
  1696.         history_buffer);
  1697. #ifdef __MMI_MAINLCD_240X320__
  1698.     register_hide_left_softkey(Calendar_hide_left_softkey);
  1699.     register_hide_right_softkey(Calendar_hide_right_softkey);
  1700. //#else /* __MMI_MAINLCD_240X320__ */ //083006 calendar softkey
  1701. #elif defined(__MMI_MAINLCD_176X220__)
  1702.     disable_softkey_background();
  1703. #endif /* __MMI_MAINLCD_240X320__ */ 
  1704. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1705.     SetCategory82Title1Month((U8*) MMI_calendar_title_string_month);
  1706. #endif 
  1707.     RedrawCategoryFunction = dm_redraw_category_screen;
  1708.     ExitCategoryFunction = ExitCategory82Screen;
  1709.     GetCategoryHistory = dummy_get_history;
  1710.     GetCategoryHistorySize = dummy_get_history_size;
  1711.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1712.     dm_data.s32CatId = MMI_CATEGORY82_ID;
  1713.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  1714.     dm_setup_data(&dm_data);
  1715.     dm_redraw_category_screen();
  1716. }
  1717. /*****************************************************************************
  1718.  * FUNCTION
  1719.  *  ExitCategory82Screen
  1720.  * DESCRIPTION
  1721.  *  Exits the Calendar App category screen
  1722.  * PARAMETERS
  1723.  *  void
  1724.  * RETURNS
  1725.  *  void
  1726.  *****************************************************************************/
  1727. void ExitCategory82Screen(void)
  1728. {
  1729.     /*----------------------------------------------------------------*/
  1730.     /* Local Variables                                                */
  1731.     /*----------------------------------------------------------------*/
  1732.     /*----------------------------------------------------------------*/
  1733.     /* Code Body                                                      */
  1734.     /*----------------------------------------------------------------*/
  1735.     wgui_close_calendar();
  1736.     leave_full_screen();
  1737.     enable_softkey_background();
  1738.     reset_softkeys();
  1739. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1740.     gui_register_button_shuffle(shuffle_draw_white);    /* register the background drower */
  1741. #endif 
  1742.     lunar_calendar_present = MMI_FALSE;
  1743. #if defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__)
  1744.     ResetCalendarTitle1Arrow();
  1745.     ResetCalendarTitle1MonthArrow();
  1746. #endif /* defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__) */ 
  1747.     ExitCategoryFunction = MMI_dummy_function;
  1748.     RedrawCategoryFunction = MMI_dummy_function;
  1749.     GetCategoryHistory = dummy_get_history;
  1750.     GetCategoryHistorySize = dummy_get_history_size;
  1751. }
  1752. #ifdef __MMI_TOUCH_SCREEN__
  1753. static BOOL g_calendar_pen_event = MMI_FALSE;
  1754. /*****************************************************************************
  1755.  * FUNCTION
  1756.  *  wgui_calendar_translate_pen_event
  1757.  * DESCRIPTION
  1758.  *  
  1759.  * PARAMETERS
  1760.  *  c                   [?]         
  1761.  *  pen_event           [IN]        
  1762.  *  x                   [IN]        
  1763.  *  y                   [IN]        
  1764.  *  calendar_event      [?]         
  1765.  * RETURNS
  1766.  *  
  1767.  *****************************************************************************/
  1768. BOOL wgui_calendar_translate_pen_event(
  1769.         calendar_control *c,
  1770.         mmi_pen_event_type_enum pen_event,
  1771.         S16 x,
  1772.         S16 y,
  1773.         gui_calendar_pen_enum *calendar_event)
  1774. {
  1775.     /*----------------------------------------------------------------*/
  1776.     /* Local Variables                                                */
  1777.     /*----------------------------------------------------------------*/
  1778.     /* If event is on Title of Calendar, handle that otherwise pass control to gui layer of calendar for handling pen events  */
  1779.     BOOL ret;
  1780.     S32 x1, y1, x2, y2;
  1781. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1782.     S32 xx1, yy1, xx2, yy2;
  1783. #endif 
  1784.     /*----------------------------------------------------------------*/
  1785.     /* Code Body                                                      */
  1786.     /*----------------------------------------------------------------*/
  1787. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1788.     /* for month info */
  1789.     x1 = cat82_title1_month_x1;
  1790.     y1 = cat82_title1_month_y1;
  1791.     x2 = cat82_title1_month_x2;
  1792.     y2 = cat82_title1_month_y2;
  1793.     /* for year info */
  1794.     if (lunar_calendar_present && IsChineseSet())   /* year info on title 1 */
  1795.     {
  1796.         xx1 = cat82_title2_x1;
  1797.         yy1 = cat82_title2_y1;
  1798.         xx2 = cat82_title2_x2;
  1799.         yy2 = cat82_title2_y2;
  1800.     }
  1801.     else    /* year info on title 2 */
  1802.     {
  1803.         xx1 = cat82_title1_x1;
  1804.         yy1 = cat82_title1_y1;
  1805.         xx2 = cat82_title1_x2;
  1806.         yy2 = cat82_title1_y2;
  1807.     }
  1808. #else /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1809.     if (lunar_calendar_present && IsChineseSet())   /* Title2 will be used to display the year and month */
  1810.     {
  1811.         x1 = cat82_title2_x1;
  1812.         y1 = cat82_title2_y1;
  1813.         x2 = cat82_title2_x2;
  1814.         x2 = (calendar_show_title3) ? cat82_title3_x1 - 1 : cat82_title2_x2;
  1815.         y2 = cat82_title2_y2;
  1816.     }
  1817.     else    /* Title1 will be used to display the year and month */
  1818.     {
  1819.         x1 = cat82_title1_x1;
  1820.         y1 = cat82_title1_y1;
  1821.         x2 = cat82_title1_x2;
  1822.         y2 = cat82_title1_y2;
  1823.     }
  1824. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1825.     ret = MMI_TRUE;
  1826.     *calendar_event = GUI_CALENDAR_PEN_NONE;
  1827.     switch (pen_event)
  1828.     {
  1829.         case MMI_PEN_EVENT_DOWN:
  1830.             g_calendar_pen_event = MMI_FALSE;
  1831.             if (PEN_CHECK_BOUND(x, y, x1, y1, (x2 - x1), (y2 - y1)))    /* Event is on the Title of the calendar */
  1832.             {
  1833.             #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1834.                 if (!Cat82_title1_month_arrow_disable)  /* check if month info is disabled, do not check in original mode */
  1835.             #endif 
  1836.                 {
  1837.                     if (PEN_CHECK_BOUND
  1838.                         (x, y, x1 + MMI_CALENDAR_ARROW_OFFSET, y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1839.                          calendar_arrow_width, calendar_arrow_height))
  1840.                     {
  1841.                         /* First Arrow Pressed */
  1842.                         gdi_layer_lock_frame_buffer();
  1843.                         gui_show_transparent_image(
  1844.                             x1 + MMI_CALENDAR_ARROW_OFFSET,
  1845.                             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1846.                             (PU8) GetImage(CAL_LEFT_ARROW_DOWN_IMAGE),
  1847.                             0);
  1848.                         gdi_layer_unlock_frame_buffer();
  1849.                         gdi_layer_blt_previous(
  1850.                             x1 + MMI_CALENDAR_ARROW_OFFSET,
  1851.                             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1852.                             x1 + 2 * calendar_arrow_width + MMI_CALENDAR_ARROW_OFFSET,
  1853.                             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1) + calendar_arrow_height);
  1854.                         c->previous_month_function();
  1855.                     }
  1856.                     if (PEN_CHECK_BOUND
  1857.                         (x, y, x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1858.                          y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1), calendar_arrow_width,
  1859.                          calendar_arrow_height))
  1860.                     {
  1861.                         /* Second Arrow Pressed */
  1862.                         gdi_layer_lock_frame_buffer();
  1863.                         gui_show_transparent_image(
  1864.                             x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1865.                             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1866.                             (PU8) GetImage(CAL_RIGHT_ARROW_DOWN_IMAGE),
  1867.                             0);
  1868.                         gdi_layer_unlock_frame_buffer();
  1869.                         gdi_layer_blt_previous(
  1870.                             x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1871.                             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1872.                             x2 - MMI_CALENDAR_ARROW_OFFSET,
  1873.                             y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1) + calendar_arrow_height);
  1874.                         c->next_month_function();
  1875.                     }
  1876.                 }
  1877.             }
  1878.         #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  1879.             else if (PEN_CHECK_BOUND(x, y, xx1, yy1, (xx2 - xx1), (yy2 - yy1))) /* Event is on the Title of the calendar */
  1880.             {
  1881.                 if (!Cat82_title1_arrow_disable)    /* check if year info is disabled */
  1882.                 {
  1883.                     if (PEN_CHECK_BOUND
  1884.                         (x, y, xx1 + MMI_CALENDAR_ARROW_OFFSET,
  1885.                          yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1), calendar_arrow_width,
  1886.                          calendar_arrow_height))
  1887.                     {
  1888.                         /* First Arrow Pressed */
  1889.                         gdi_layer_lock_frame_buffer();
  1890.                         gui_show_transparent_image(
  1891.                             xx1 + MMI_CALENDAR_ARROW_OFFSET,
  1892.                             yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1893.                             (PU8) GetImage(CAL_LEFT_ARROW_DOWN_IMAGE),
  1894.                             0);
  1895.                         gdi_layer_unlock_frame_buffer();
  1896.                         gdi_layer_blt_previous(
  1897.                             xx1 + MMI_CALENDAR_ARROW_OFFSET,
  1898.                             yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1899.                             xx1 + 2 * calendar_arrow_width + MMI_CALENDAR_ARROW_OFFSET,
  1900.                             yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1) + calendar_arrow_height);
  1901.                         c->previous_year_function();
  1902.                     }
  1903.                     if (PEN_CHECK_BOUND
  1904.                         (x, y, xx2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1905.                          yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1), calendar_arrow_width,
  1906.                          calendar_arrow_height))
  1907.                     {
  1908.                         /* Second Arrow Pressed */
  1909.                         gdi_layer_lock_frame_buffer();
  1910.                         gui_show_transparent_image(
  1911.                             xx2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1912.                             yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1913.                             (PU8) GetImage(CAL_RIGHT_ARROW_DOWN_IMAGE),
  1914.                             0);
  1915.                         gdi_layer_unlock_frame_buffer();
  1916.                         gdi_layer_blt_previous(
  1917.                             xx2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
  1918.                             yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1),
  1919.                             xx2 - MMI_CALENDAR_ARROW_OFFSET,
  1920.                             yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1) + calendar_arrow_height);
  1921.                         c->next_year_function();
  1922.                     }
  1923.                 }
  1924.             }
  1925.         #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  1926.             else
  1927.             {
  1928.                 /* Give control to gui layer */
  1929.                 ret = gui_calendar_translate_pen_event(c, pen_event, x, y, calendar_event);
  1930.                 if (ret)
  1931.                 {
  1932.                     g_calendar_pen_event = MMI_TRUE;
  1933.                 }
  1934.             }
  1935.             break;
  1936.         case MMI_PEN_EVENT_UP:
  1937.             if (g_calendar_pen_event)
  1938.             {
  1939.                 ret = gui_calendar_translate_pen_event(c, pen_event, x, y, calendar_event);
  1940.             }
  1941.             break;
  1942.         case MMI_PEN_EVENT_MOVE:
  1943.             if (g_calendar_pen_event)
  1944.             {
  1945.                 ret = gui_calendar_translate_pen_event(c, pen_event, x, y, calendar_event);
  1946.             }
  1947.             break;
  1948.         case MMI_PEN_EVENT_LONG_TAP:
  1949.             /* Do nothing */
  1950.             break;
  1951.         case MMI_PEN_EVENT_REPEAT:
  1952.             /* Do nothing */
  1953.             break;
  1954.         case MMI_PEN_EVENT_ABORT:
  1955.             /* Do nothing */
  1956.             break;
  1957.         default:
  1958.             MMI_ASSERT(0);
  1959.     }
  1960.     return ret;
  1961. }
  1962. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1963. #endif /* (ENABLE_CALENDAR_CONTROL) */ 
  1964. /* 072406 new calendar Start */
  1965. #ifdef __MMI_UI_INTEGRATED_CALENDAR_SUPPORT__
  1966. #include "ScrMemMgrGprot.h"
  1967. #ifdef __MMI_TOUCH_SCREEN__
  1968. #include "wgui_touch_screen.h"
  1969. #endif
  1970. typedef struct
  1971. {
  1972.     UI_image_ID_type left_up;
  1973.     UI_image_ID_type left_down;
  1974.     UI_image_ID_type right_up;
  1975.     UI_image_ID_type right_down;
  1976.     Cat83EventFuncPtr left_handler;
  1977.     Cat83EventFuncPtr right_handler;    
  1978.     U8 *string;
  1979.     U32 align_type;
  1980.     S32 left_width;
  1981.     S32 left_height;
  1982.     S32 right_width;
  1983.     S32 right_height;
  1984.     U8 left_pressed;
  1985.     U8 right_pressed;
  1986.     U8 is_updated;
  1987. } wgui_cat83_horizontal_select_struct;
  1988. typedef struct
  1989. {
  1990.     UI_image_ID_type top_up;
  1991.     UI_image_ID_type top_down;
  1992.     UI_image_ID_type bottom_up;
  1993.     UI_image_ID_type bottom_down;
  1994.     Cat83EventFuncPtr top_handler;
  1995.     Cat83EventFuncPtr bottom_handler; 
  1996.     U8 **string_list;
  1997.     U32 align_type;
  1998.     S32 top_width;
  1999.     S32 top_height;
  2000.     S32 bottom_width;
  2001.     S32 bottom_height;
  2002.     U8 top_pressed;
  2003.     U8 bottom_pressed;
  2004.     U8 is_updated;
  2005. } wgui_cat83_vertical_select_struct;
  2006. typedef struct
  2007. {
  2008.     U8 color_index1;
  2009.     U8 *string1;
  2010.     U8 color_index2;
  2011.     U8 *string2;
  2012.     FuncPtr show_title;
  2013.     U8 is_updated;
  2014. } wgui_cat83_title_struct;
  2015. typedef struct
  2016. {
  2017.     U8 **string_list;
  2018.     U8 is_updated;
  2019. } wgui_cat83_horizontal_string_struct;
  2020. typedef struct
  2021. {
  2022.     wgui_cat83_cell_struct *cell;
  2023.     U8 bg_fill_type;
  2024.     U8 text_display_type;
  2025.     U8 icon_display_type;
  2026.     U8 is_updated;
  2027. #ifdef __MMI_TOUCH_SCREEN__
  2028.     U8 pen_on_highlighted;
  2029. #endif
  2030. } wgui_cat83_cell_array_struct;
  2031. typedef struct
  2032. {
  2033.     U8 *message1;
  2034.     U8 *message2;
  2035.     U8 *message3;
  2036.     U8 need_popup;
  2037.     U8 is_drawed;
  2038. } wgui_cat83_popup_struct;
  2039.     
  2040. typedef enum
  2041. {
  2042.     CAT83_TITLE_NORMAL,
  2043.     CAT83_TITLE_MENSTRUAL,
  2044.     CAT83_TITLE_TOTAL
  2045. } CAT83_TITLE_TYPE;
  2046. void wgui_calendar_init(U32 calendar_type, U32 row_num, U32 column_num, U8* cell_buf, U8* popup_buf);
  2047. static void wgui_cat83_redraw_bg(void);
  2048. static void wgui_cat83_redraw_select_horizontal1(void);
  2049. static void wgui_cat83_redraw_select_horizontal2(void);
  2050. static void wgui_cat83_redraw_horizontal_string(void);
  2051. static void wgui_cat83_redraw_select_vertical(void);
  2052. static void wgui_cat83_redraw_normal_title(void);
  2053. static void wgui_cat83_redraw_menstrual_title(void);
  2054. void wgui_calendar_redraw_cell_arry(void);
  2055. static void wgui_calendar_redraw_cell(S32 cell_x, S32 cell_y, S32 cell_width, S32 cell_height, wgui_cat83_cell_struct *cell);
  2056. static void wgui_calendar_highlight_cell(U32 highlighted_row, U32 highlighted_column);
  2057. static void wgui_calendar_unhighlight_cell(U32 highlighted_row, U32 highlighted_column);
  2058. static void RedrawCategory83Screen(void);
  2059. static void wgui_calendar_redraw_popup(void);
  2060. MMI_BOOL (*Cat83AppCellHighlightHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
  2061. MMI_BOOL (*Cat83AppLeftArrowKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
  2062. MMI_BOOL (*Cat83AppRightArrowKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
  2063. MMI_BOOL (*Cat83AppUpArrowKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
  2064. MMI_BOOL (*Cat83AppDownArrowKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
  2065. MMI_BOOL (*Cat83AppUpSideKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
  2066. MMI_BOOL (*Cat83AppDownSideKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
  2067. //FuncPtr Cat83ShowTitleArray[CAT83_TITLE_TOTAL] = {  cat83_show_normal_title,
  2068. //                                                    cat83_show_menstrual_title  };
  2069. //void (*cat83_show_title)(void) = cat83_show_normal_title;
  2070. //static color cat83_cell_bg_color[CAT83_COLOR_TOTAL];//120406 warning remove
  2071. //static color cat83_cell_highlight_color = {255, 0, 0, 255};
  2072. static wgui_cat83_horizontal_select_struct cat83_horizontal_select[2];
  2073. static wgui_cat83_vertical_select_struct cat83_vertical_select;
  2074. static wgui_cat83_title_struct cat83_title;
  2075. static wgui_cat83_horizontal_string_struct cat83_horizontal_string;
  2076. static wgui_cat83_cell_array_struct cat83_cell_array;
  2077. static wgui_cat83_popup_struct cat83_popup;
  2078. //static MMI_BOOL cat83_horizontal_select1_display = MMI_TRUE;
  2079. //static MMI_BOOL cat83_horizontal_select2_display = MMI_TRUE;
  2080. static MMI_BOOL cat83_vertical_select_display = MMI_TRUE;
  2081. //static MMI_BOOL cat83_infobox_display = MMI_TRUE;
  2082. static S32 cat83_content_x;
  2083. static S32 cat83_content_y;
  2084. static S32 cat83_content_width;
  2085. static S32 cat83_content_height;
  2086. static S32 cat83_horizontal_select_x;
  2087. static S32 cat83_horizontal_select_y;
  2088. static S32 cat83_horizontal_select_width;
  2089. static S32 cat83_horizontal_select_height;
  2090. static S32 cat83_title_x;
  2091. static S32 cat83_title_y;
  2092. static S32 cat83_title_width;
  2093. static S32 cat83_title_height;
  2094. static S32 cat83_vertical_select_x;
  2095. static S32 cat83_vertical_select_y;
  2096. static S32 cat83_vertical_select_width;
  2097. static S32 cat83_vertical_select_height;
  2098. static S32 cat83_horizontal_string_x;
  2099. static S32 cat83_horizontal_string_y;
  2100. static S32 cat83_horizontal_string_width;
  2101. static S32 cat83_horizontal_string_height;
  2102. static S32 cat83_cell_array_x;
  2103. static S32 cat83_cell_array_y;
  2104. static S32 cat83_cell_array_width;
  2105. static S32 cat83_cell_array_height;
  2106. static S32 cat83_cell_width;
  2107. static S32 cat83_cell_height;
  2108. static gdi_image_cache_bmp_struct cat83_cell_cache;
  2109. static gdi_image_cache_bmp_struct cat83_popup_cache;
  2110. static S32 cat83_frame_line_pixel;
  2111. static S32 cat83_popup_x;