wgui_calendar.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:258k
源码类别:
MTK
开发平台:
C/C++
- memset(&myTime, 0, sizeof(MYTIME));
- memset(&incTime, 0, sizeof(MYTIME));
- myTime.nDay = 1;
- myTime.nMonth = (U8) MMI_calendar_current_month;
- myTime.nYear = MMI_calendar_current_year;
- incTime.nMonth = 1;
- IncrementTime(myTime, incTime, &resultTime);
- MMI_calendar_highlighted_day = resultTime.nDay;
- MMI_calendar_current_month = resultTime.nMonth;
- MMI_calendar_current_year = resultTime.nYear;
- }
- else
- {
- MMI_calendar_highlighted_day = 1;
- MMI_calendar_current_month = 1;
- MMI_calendar_current_year = CLNDR_FIRST_NAVI_YEAR;
- }
- wgui_calendar_control_update_handler();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_calendar_previous_month_day
- * DESCRIPTION
- * Side down key handler, go to 1st day of previous month.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_calendar_previous_month_day(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_calendar_current_year != CLNDR_FIRST_NAVI_YEAR || MMI_calendar_current_month != 1)
- {
- MYTIME myTime, incTime, resultTime;
- memset(&myTime, 0, sizeof(MYTIME));
- memset(&incTime, 0, sizeof(MYTIME));
- myTime.nDay = 1;
- myTime.nMonth = (U8) MMI_calendar_current_month; /* 091905 Calvin */
- myTime.nYear = MMI_calendar_current_year;
- incTime.nDay = 1;
- DecrementTime(myTime, incTime, &resultTime);
- MMI_calendar_highlighted_day = resultTime.nDay;
- MMI_calendar_current_month = resultTime.nMonth;
- MMI_calendar_current_year = resultTime.nYear;
- }
- else
- {
- MMI_calendar_highlighted_day = 31;
- MMI_calendar_current_month = 12;
- MMI_calendar_current_year = CLNDR_LAST_NAVI_YEAR;
- }
- wgui_calendar_control_update_handler();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_calendar_next_month_week
- * DESCRIPTION
- * go to the same DoW of next week
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_calendar_next_month_week(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_calendar_current_year != CLNDR_LAST_NAVI_YEAR || MMI_calendar_current_month != 12)
- {
- MYTIME myTime, incTime, resultTime;
- memset(&myTime, 0, sizeof(MYTIME));
- memset(&incTime, 0, sizeof(MYTIME));
- myTime.nDay = MMI_calendar_highlighted_day;
- myTime.nMonth = (U8) MMI_calendar_current_month;
- myTime.nYear = MMI_calendar_current_year;
- incTime.nDay = 7;
- IncrementTime(myTime, incTime, &resultTime);
- MMI_calendar_highlighted_day = resultTime.nDay;
- MMI_calendar_current_month = resultTime.nMonth;
- MMI_calendar_current_year = resultTime.nYear;
- }
- else
- {
- MMI_calendar_highlighted_day = 1;
- MMI_calendar_current_month = 1;
- MMI_calendar_current_year = CLNDR_FIRST_NAVI_YEAR;
- }
- wgui_calendar_control_update_handler();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_calendar_previous_month_week
- * DESCRIPTION
- * go to the same DoW of previous week
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_calendar_previous_month_week(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_calendar_current_year != CLNDR_FIRST_NAVI_YEAR || MMI_calendar_current_month != 1)
- {
- MYTIME myTime, incTime, resultTime;
- memset(&myTime, 0, sizeof(MYTIME));
- memset(&incTime, 0, sizeof(MYTIME));
- myTime.nDay = MMI_calendar_highlighted_day;
- myTime.nMonth = (U8) MMI_calendar_current_month;
- myTime.nYear = MMI_calendar_current_year;
- incTime.nDay = 7;
- DecrementTime(myTime, incTime, &resultTime);
- MMI_calendar_highlighted_day = resultTime.nDay;
- MMI_calendar_current_month = resultTime.nMonth;
- MMI_calendar_current_year = resultTime.nYear;
- }
- else
- {
- MMI_calendar_highlighted_day = 31;
- MMI_calendar_current_month = 12;
- MMI_calendar_current_year = CLNDR_LAST_NAVI_YEAR;
- }
- wgui_calendar_control_update_handler();
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * SetCalendarMonthChangeFunctions
- * DESCRIPTION
- * Register function pointers of previous/next month navigation of calendar
- * PARAMETERS
- * previous_month [IN] )(void) a function pointer which handle navigation to previous month
- * next_month [IN]
- * void(?) [IN] (*month_next_day)(void) a function pointer which handle navigation to next month
- * RETURNS
- * void
- *****************************************************************************/
- void SetCalendarMonthChangeFunctions(void (*previous_month) (void), void (*next_month) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (previous_month != NULL)
- {
- MMI_calendar_control.previous_month_function = previous_month;
- }
- if (next_month != NULL)
- {
- MMI_calendar_control.next_month_function = next_month;
- }
- }
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- /*****************************************************************************
- * FUNCTION
- * SetCalendarYearChangeFunctions
- * DESCRIPTION
- * Register function pointers of previous/next year navigation of calendar
- * PARAMETERS
- * previous_year [IN] )(void) a function pointer which handle navigation to previous year
- * next_year [IN] )(void) a function pointer which handle navigation to next year
- * RETURNS
- * void
- *****************************************************************************/
- void SetCalendarYearChangeFunctions(void (*previous_year) (void), void (*next_year) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (previous_year != NULL)
- {
- MMI_calendar_control.previous_year_function = previous_year;
- }
- if (next_year != NULL)
- {
- MMI_calendar_control.next_year_function = next_year;
- }
- }
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * RegisterCalendarHighlightHandler
- * DESCRIPTION
- * Register calendar highlight function
- * PARAMETERS
- * f [IN] )(S32 index) function pointer
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterCalendarHighlightHandler(void (*f) (S32 index))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (f != NULL)
- {
- MMI_calendar_control_highlight_handler = f;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterCalendarUpdateHandler
- * DESCRIPTION
- * Register calendar update function
- * PARAMETERS
- * f [IN] )(S32 day,S32 month,S32 year) function pointer
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterCalendarUpdateHandler(void (*f) (S32 day, S32 month, S32 year))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (f != NULL)
- {
- MMI_calendar_control_update_handler = f;
- }
- }
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- /*****************************************************************************
- * FUNCTION
- * RegisterCalendarUpdateInfoBoxHandler
- * DESCRIPTION
- * Register calendar update info box function
- * PARAMETERS
- * f [IN] )(S32 *p_n_info, U16 ** p_icon_list, U8 ***p_description_list) function pointer
- * this(?) [IN] Function should update the value pointed by each pointer
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterCalendarUpdateInfoBoxHandler(void (*f) (S32 *p_n_info, U16 **p_icon_list, U8 ***p_description_list))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (f != NULL)
- {
- MMI_calendar_control.update_info_box = f;
- }
- }
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- /*****************************************************************************
- * FUNCTION
- * SetCalendarDay
- * DESCRIPTION
- * set the flag of particular day of month
- * PARAMETERS
- * day [IN] Day
- * flags [IN] Flag (normal/current/task day )
- * RETURNS
- * void
- *****************************************************************************/
- void SetCalendarDay(S32 day, U8 flags)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_calendar_days[day] |= flags;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCalendarHighlightedDay
- * DESCRIPTION
- * get highlighted day
- * PARAMETERS
- * void
- * RETURNS
- * S32 :- highlight day
- *****************************************************************************/
- S32 GetCalendarHighlightedDay(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (MMI_calendar_highlighted_day);
- }
- /*****************************************************************************
- * FUNCTION
- * SetCalendarHighlightedDay
- * DESCRIPTION
- * set calendar highlighted day
- * PARAMETERS
- * day [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCalendarHighlightedDay(S32 day)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (day >= 0 && day < MAX_CALENDAR_DAYS)
- {
- MMI_calendar_highlighted_day = day;
- gui_calendar_highlight_day(&MMI_calendar_control, MMI_calendar_highlighted_day);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SetCalendarPopupDay
- * DESCRIPTION
- * set calendar poup messages and flag of day to calendar popup day
- * PARAMETERS
- * day [IN] Popup day
- * message1 [IN] Mesage 1
- * message2 [IN] Message 2
- * message3 [IN] Message 3
- * RETURNS
- * void
- *****************************************************************************/
- void SetCalendarPopupDay(S32 day, U8 *message1, U8 *message2, U8 *message3)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (day >= 0 && day < MAX_CALENDAR_DAYS)
- {
- MMI_calendar_days[day] |= CALENDAR_POPUP_DAY;
- MMI_calendar_messages1 = message1;
- MMI_calendar_messages2 = message2;
- MMI_calendar_messages3 = message3;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * set_calendar_control_background_limits
- * DESCRIPTION
- * set calendar bkg y positions
- * PARAMETERS
- * y1 [IN] Start y position
- * y2 [IN] End y position
- * RETURNS
- * void
- *****************************************************************************/
- void set_calendar_control_background_limits(S32 y1, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- calendar_control_background_y1 = y1;
- calendar_control_background_y2 = y2;
- }
- /*****************************************************************************
- * FUNCTION
- * calendar_control_header_display
- * DESCRIPTION
- * set calendar header
- * PARAMETERS
- * x1 [IN] Start x position
- * y1 [IN] Start y position
- * RETURNS
- * void
- *****************************************************************************/
- void calendar_control_header_display(S32 x1, S32 y1)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *DOW[] = { (U8*) "S ",
- (U8*) "M ",
- (U8*) "T ",
- (U8*) "W ",
- (U8*) "T ",
- (U8*) "F ",
- (U8*) "S ",
- };
- color c1 = gui_color(255, 255, 255);
- color c2 = gui_color(0, 0, 0);
- S32 w, cw, i, x, tx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* set font */
- gui_set_font(MMI_calendar_control.theme->text_font);
- /* set text color */
- gui_set_text_color(c1);
- /* set text border color */
- gui_set_text_border_color(c2);
- cw = MMI_calendar_control.cell_width;
- x = x1;
- for (i = 0; i < 7; i++)
- {
- w = gui_get_character_width((UI_character_type) DOW[i][0]);
- tx = x + (cw >> 1) - (w >> 1);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(tx + w, y1);
- }
- else
- {
- gui_move_text_cursor(tx, y1);
- }
- gui_print_bordered_text((UI_string_type) DOW[i]);
- x += cw;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * calendar_control_background_display_function
- * DESCRIPTION
- * set calendar bkg image
- * PARAMETERS
- * x1 [IN] Start x position
- * y1 [IN] Start y position
- * x2 [IN] End x position
- * y2 [IN] End y position
- * RETURNS
- * void
- *****************************************************************************/
- void calendar_control_background_display_function(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x = x1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- y1 = calendar_control_background_y1;
- y2 = calendar_control_background_y2;
- x1 = 0;
- x2 = UI_device_width - 1;
- #if(CALENDAR_FULL_SCREEN_BACKGROUND)
- if (MMI_calendar_control.flags & CALENDAR_HIDE_POPUP)
- {
- gui_set_clip(x1, y1, x2, y2);
- }
- else
- {
- gui_set_clip(x1, 0, x2, y2);
- }
- gdi_layer_set_text_clip(x, y1, x2, y2);
- #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
- gui_reset_clip();
- #endif
- gui_show_image(x1, 0, calendar_control_background_image);
- #else /* (CALENDAR_FULL_SCREEN_BACKGROUND) */
- gui_set_clip(x1, y1, x2, y2);
- gdi_layer_set_text_clip(x, y1, x2, y2);
- gui_show_image(x1, y1, calendar_control_background_image);
- #endif /* (CALENDAR_FULL_SCREEN_BACKGROUND) */
- if (calendar_control_title_image != NULL)
- #if ( defined (__MMI_MAINLCD_128X128__) || defined (__MMI_MAINLCD_128X160__) )
- /* PMT VIKAS START 20051217 */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else /* __MMI_UI_DALMATIAN_CALENDAR__ */
- gui_show_transparent_image(x1, y1 + 1, calendar_control_title_image, 0);
- #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */
- /* PMT VIKAS END 20051217 */
- #elif defined( __MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
- /* PMT VIKAS START 20051217 */
- #if 0
- /* under construction !*/
- #else
- //jerson modify begin 20070622
- #ifdef __MMI_MAINLCD_240X320__
- gui_show_transparent_image(x1, y1 + 1, calendar_control_title_image, 0);
- #else
- gui_show_transparent_image(cat82_title2_x1, y1 + 1, calendar_control_title_image, 0);
- #endif
- //jerson modify end 20070622
- //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
- #endif
- /* PMT VIKAS END 20051217 */
- #else
- gui_show_transparent_image(x1, y1 + 1, calendar_control_title_image, 0);
- #endif
- else
- #if 0
- /* under construction !*/
- #ifdef __MMI_MAINLCD_176X220__
- /* under construction !*/
- #elif defined(__MMI_MAINLCD_128X160__)
- /* under construction !*/
- #endif
- /* under construction !*/
- #else /* __MMI_UI_DALMATIAN_CALENDAR__ */
- calendar_control_header_display(x, y1 + 5);
- #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */
- }
- /*****************************************************************************
- * FUNCTION
- * SetCalendarBackground
- * DESCRIPTION
- * set image of calendar bkg
- * PARAMETERS
- * image_ID [IN]
- * imageid(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCalendarBackground(U16 image_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_calendar_control.theme = &_calendar_control_theme_data;
- MMI_calendar_control.draw_background_function = calendar_control_background_display_function;
- #ifdef __MMI_THEMES_V2_SUPPORT__
- calendar_control_background_image = get_image(image_ID);
- #endif
- calendar_control_background_image = get_image(image_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * SetCalendarTitleImage
- * DESCRIPTION
- * set the image of title of calendar
- * PARAMETERS
- * image_ID [IN]
- * imageid(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCalendarTitleImage(U16 image_ID)
- {
- #ifdef __MMI_UI_DALMATIAN_CALENDAR__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- calendar_control_title_image = get_image(dalmatian_calendar_current_week_image());
- #else /* __MMI_UI_DALMATIAN_CALENDAR__ */
- calendar_control_title_image = get_image(image_ID);
- #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */
- }
- /*****************************************************************************
- * FUNCTION
- * Calendar_hide_left_softkey
- * DESCRIPTION
- * Hides the left softkey
- *
- * Calendar hide left softkey function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Calendar_hide_left_softkey(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gui_set_clip(
- MMI_softkeys[MMI_LEFT_SOFTKEY].x,
- UI_device_height - MMI_button_bar_height,
- MMI_softkeys[MMI_LEFT_SOFTKEY].x + MMI_softkeys[MMI_LEFT_SOFTKEY].width + 2,
- UI_device_height - 1);
- #if(CALENDAR_FULL_SCREEN_BACKGROUND)
- gui_show_image(0, 0, calendar_control_background_image);
- #else
- gui_show_image(0, calendar_control_background_y1, calendar_control_background_image);
- #endif
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * Calendar_hide_right_softkey
- * DESCRIPTION
- * Hides the right softkey
- *
- * Calendar hide right softkey function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Calendar_hide_right_softkey(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gui_set_clip(
- MMI_softkeys[MMI_RIGHT_SOFTKEY].x,
- UI_device_height - MMI_button_bar_height,
- MMI_softkeys[MMI_RIGHT_SOFTKEY].x + MMI_softkeys[MMI_RIGHT_SOFTKEY].width + 2,
- UI_device_height - 1);
- #if(CALENDAR_FULL_SCREEN_BACKGROUND)
- gui_show_image(0, 0, calendar_control_background_image);
- #else
- gui_show_image(0, calendar_control_background_y1, calendar_control_background_image);
- #endif
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory80Screen
- * DESCRIPTION
- * Redraws the Calendar App category screen solar calendar
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory80Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- clear_screen();
- gdi_layer_push_clip();
- gdi_layer_push_text_clip();
- gui_reset_clip();
- gui_set_font(&MMI_default_font);
- #ifdef __MMI_UI_DALMATIAN_CALENDAR__
- set_dalmatian_calendar_highlighter_box();
- SetCalendarTitleImage(dalmatian_calendar_current_week_image());
- #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */
- wgui_show_calendar();
- ChangeCategory82Title1(Cat82_title1);
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- ChangeCategory82Title1Month(Cat82_title1_month);
- #endif
- #if ( defined (__MMI_MAINLCD_128X128__) || defined (__MMI_MAINLCD_128X160__) )
- show_softkey_background();
- #elif defined( __MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
- disable_softkey_background();
- #else
- show_softkey_background();
- #endif
- show_left_softkey();
- show_right_softkey();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- gdi_layer_pop_clip();
- gdi_layer_pop_text_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * InitializeCategory80Screen
- * DESCRIPTION
- * Initializes the Calendar App category screen
- *
- * Must be called once before calling ShowCategory80Screen
- * PARAMETERS
- * first_day_of_week [IN] See the constants in wgui_calendar.h
- * last_day_of_month [IN] Ex: 28, 29, 30 or 31
- * current_day [IN]
- * current_month [IN]
- * current_year [IN]
- * INT(?) [IN] Current day Current day number (ex: 1 to 31)
- * RETURNS
- * void
- *****************************************************************************/
- void InitializeCategory80Screen(
- S32 first_day_of_week,
- S32 last_day_of_month,
- S32 current_day,
- S32 current_month,
- S32 current_year)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- lunar_calendar_present = FALSE;
- wgui_setup_calendar(
- 0,
- 0,
- UI_device_width / CALENDAR_N_COLUMNS,
- UI_device_height / CALENDAR_N_ROWS,
- first_day_of_week,
- last_day_of_month,
- current_day,
- current_month,
- current_year,
- 0);
- /* PMT VIKAS START 20051217 */
- #ifdef __MMI_UI_DALMATIAN_CALENDAR__
- set_current_month_year_for_dalmatian(current_day, current_month, current_year);
- #endif
- /* PMT VIKAS END 20051217 */
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory80Screen
- * DESCRIPTION
- * Displays the Calendar App category screen
- *
- * Must call InitializeCategory80Screen before calling this screen
- * PARAMETERS
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * history_buffer [IN] History buffer
- * STRING(?) [IN] Title Title string (ex: Month and Year)
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory80Screen(
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ShowCalendarCommomCategoryScreen(
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- history_buffer);
- #ifdef __MMI_MAINLCD_240X320__
- register_hide_left_softkey(Calendar_hide_left_softkey);
- register_hide_right_softkey(Calendar_hide_right_softkey);
- //#else /* __MMI_MAINLCD_240X320__ */ //083006 calendar softkey
- #elif defined(__MMI_MAINLCD_176X220__)
- disable_softkey_background();
- #endif /* __MMI_MAINLCD_240X320__ */
- SetCategory82Title1((U8*) MMI_title_string);
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- SetCategory82Title1Month((U8*) MMI_calendar_title_string_month);
- #endif
- ExitCategoryFunction = ExitCategory80Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- RedrawCategoryFunction = dm_redraw_category_screen;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY80_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory80Screen
- * DESCRIPTION
- * Exits the Calendar App category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory80Screen(void)
- { /* close calenar ..stop popup timer */
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_close_calendar();
- leave_full_screen();
- enable_softkey_background();
- reset_softkeys(); /* reset softkeys */
- #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
- gui_register_button_shuffle(shuffle_draw_white); /* register the background drower */
- #endif
- #if defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__)
- ResetCalendarTitle1Arrow();
- ResetCalendarTitle1MonthArrow();
- #endif /* defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__) */
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * InitializeCategory81Screen
- * DESCRIPTION
- * Initializes the Calendar App category screen
- *
- * Must be called once before calling ShowCategory81Screen
- * PARAMETERS
- * first_day_of_week [IN] See the constants in wgui_calendar.h
- * last_day_of_month [IN] Ex: 28, 29, 30 or 31
- * current_day [IN]
- * current_month [IN] Current month (ex: 1 to 12)
- * current_year [IN] Current year (ex: 1970 to 2030)
- * INT(?) [IN] Current day Current day number (ex: 1 to 31)
- * RETURNS
- * void
- *****************************************************************************/
- void InitializeCategory81Screen(
- S32 first_day_of_week,
- S32 last_day_of_month,
- S32 current_day,
- S32 current_month,
- S32 current_year)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_setup_calendar(
- 0,
- 0,
- UI_device_width / CALENDAR_N_COLUMNS,
- UI_device_height / CALENDAR_N_ROWS,
- first_day_of_week,
- last_day_of_month,
- current_day,
- current_month,
- current_year,
- 0);
- /* PMT VIKAS START 20051217 */
- #ifdef __MMI_UI_DALMATIAN_CALENDAR__
- set_current_month_year_for_dalmatian(current_day, current_month, current_year);
- #endif
- /* PMT VIKAS END 20051217 */
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory81Screen
- * DESCRIPTION
- * Displays the Health Calendar App category screen
- * PARAMETERS
- * title [IN] Title string (ex: Month and Year)
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * message1 [IN] Sub title message 1
- * message2 [IN] Sub title message 2
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory81Screen(
- U8 *title,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *message1,
- U8 *message2,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- color c = *(current_MMI_theme->UI_black_color);
- color wc = *(current_MMI_theme->UI_white_color);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- dm_reset_context();
- ShowCalendarCommomCategoryScreen(
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- history_buffer);
- #ifdef __MMI_MAINLCD_240X320__
- register_hide_left_softkey(Calendar_hide_left_softkey);
- register_hide_right_softkey(Calendar_hide_right_softkey);
- //#else /* __MMI_MAINLCD_240X320__ */ //083006 calendar softkey
- #elif defined(__MMI_MAINLCD_176X220__)
- disable_softkey_background();
- #endif /* __MMI_MAINLCD_240X320__ */
- SetCategory82Title1((U8*) MMI_title_string);
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- #ifdef __MMI_TOUCH_SCREEN__
- DisableCalendarTitle1Arrow();
- #endif
- SetCategory82Title1Month((U8*) MMI_calendar_title_string_month);
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- ExitCategoryFunction = ExitCategory81Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- RedrawCategoryFunction = dm_redraw_category_screen;
- dm_add_back_fill_area(MMI_calendar_control.theme->special2_day_filler);
- dm_add_rectangle(c, 0);
- dm_add_back_fill_area(MMI_calendar_control.theme->special1_day_filler);
- dm_add_rectangle(c, 0);
- dm_add_string((UI_string_type) message1, &MMI_default_font, wc, c, NULL);
- dm_add_string((UI_string_type) message2, &MMI_default_font, wc, c, NULL);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY81_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory81Screen
- * DESCRIPTION
- * Exits the Health Calendar App category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory81Screen(void)
- { /* close health calendar */
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_close_calendar();
- leave_full_screen();
- reset_softkeys();
- enable_softkey_background();
- #ifdef __MMI_UI_DALMATIAN_CALENDAR__
- set_dalmatian_calendar_highlighter_enable();
- #endif
- #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
- gui_register_button_shuffle(shuffle_draw_white); /* register the background drower */
- #endif
- #if defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__)
- ResetCalendarTitle1Arrow();
- ResetCalendarTitle1MonthArrow();
- #endif /* defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__) */
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * SetCategory82Title1
- * DESCRIPTION
- * set title 1 of lunar calendar
- * PARAMETERS
- * title [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory82Title1(U8 *title)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title1 = title;
- }
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- /*****************************************************************************
- * FUNCTION
- * SetCategory82Title1Month
- * DESCRIPTION
- * set title 1 month of lunar calendar
- * PARAMETERS
- * title [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory82Title1Month(U8 *title)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title1_month = title;
- }
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- /*****************************************************************************
- * FUNCTION
- * SetCategory82Title2
- * DESCRIPTION
- * set title 2 of lunar calendar
- * PARAMETERS
- * title [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory82Title2(U8 *title)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title2 = title;
- }
- /*****************************************************************************
- * FUNCTION
- * SetCategory82Title3
- * DESCRIPTION
- * set title 3 of lunar calendar
- * PARAMETERS
- * title [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory82Title3(U8 *title)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title3 = title;
- }
- /*****************************************************************************
- * FUNCTION
- * ChangeCategory82Title1
- * DESCRIPTION
- * change title 1 of lunar calendar and display
- * PARAMETERS
- * title [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeCategory82Title1(U8 *title)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1 = cat82_title1_x1;
- S32 y1 = cat82_title1_y1;
- S32 x2 = cat82_title1_x2;
- S32 y2 = cat82_title1_y2;
- S32 w, h;
- color tc = *(current_MMI_theme->UI_black_color);
- #if(CALENDAR_BORDERED_TITLES)
- color wc = *(current_MMI_theme->UI_white_color);
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title1 = title;
- gdi_layer_push_clip();
- gdi_layer_push_text_clip();
- gui_reset_clip();
- gdi_layer_set_text_clip(x1, y1, x2, y2);
- #if(CALENDAR_FULL_SCREEN_BACKGROUND)
- gui_set_clip(x1, y1, x2, y2);
- #if !defined(__MMI_MAINLCD_176X220__) && !defined(__MMI_MAINLCD_240X320__)
- gui_show_image(x1, 0, calendar_control_background_image);
- #else
- gui_show_image(0, 0, calendar_control_background_image);
- #endif
- #else /* (CALENDAR_FULL_SCREEN_BACKGROUND) */
- gui_fill_rectangle(x1, y1, x2, y2, tc);
- #endif /* (CALENDAR_FULL_SCREEN_BACKGROUND) */
- #ifdef __MMI_TOUCH_SCREEN__
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- if (!(lunar_calendar_present && IsChineseSet()))
- {
- if (!Cat82_title1_arrow_disable) /* Year arrows on title 1 */
- {
- gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x1 + MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
- 0);
- gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
- 0);
- }
- }
- #else /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- if (!(lunar_calendar_present && IsChineseSet()))
- {
- gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x1 + MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
- 0);
- gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
- 0);
- }
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- #endif /* __MMI_TOUCH_SCREEN__ */
- gui_set_font(calendar_title_font);
- /* measure width and height ot title 1 in pixels */
- gui_measure_string((UI_string_type) Cat82_title1, &w, &h);
- /* move text cursor */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else /* __MMI_UI_DALMATIAN_CALENDAR__ */
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1) + w, y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
- }
- else
- {
- gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1), y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
- }
- #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */
- #if(CALENDAR_BORDERED_TITLES)
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else /* __MMI_UI_DALMATIAN_CALENDAR__ */
- gui_set_text_border_color(tc);
- gui_set_text_color(wc);
- #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */
- gui_print_bordered_text((UI_string_type) Cat82_title1);
- #else /* (CALENDAR_BORDERED_TITLES) */
- gui_set_text_color(tc);
- /* pritnt title 1 */
- gui_print_text((UI_string_type) Cat82_title1);
- #endif /* (CALENDAR_BORDERED_TITLES) */
- gdi_layer_blt_previous(x1, y1, x2, y2);
- gdi_layer_pop_clip();
- gdi_layer_pop_text_clip();
- }
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- /*****************************************************************************
- * FUNCTION
- * ChangeCategory82Title1Month
- * DESCRIPTION
- * change title 1 month of lunar calendar and display
- * PARAMETERS
- * title [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeCategory82Title1Month(U8 *title)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1 = cat82_title1_month_x1;
- S32 y1 = cat82_title1_month_y1;
- S32 x2 = cat82_title1_month_x2;
- S32 y2 = cat82_title1_month_y2;
- S32 w, h;
- color tc = *(current_MMI_theme->UI_black_color);
- #if(CALENDAR_BORDERED_TITLES)
- color wc = *(current_MMI_theme->UI_white_color);
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (calendar_show_title_month == 0) /* Don't wanna show month info on title 1 : Month */
- {
- return;
- }
- Cat82_title1_month = title;
- gdi_layer_push_clip();
- gdi_layer_push_text_clip();
- if ((lunar_calendar_present && IsChineseSet()) && calendar_show_title3)
- {
- x2 = cat82_title3_x1 - 1;
- }
- gui_reset_clip();
- gdi_layer_set_text_clip(x1, y1, x2, y2);
- if (lunar_calendar_present && IsChineseSet()) /* Shown by lunar calnedar */
- {
- color bc = {182, 200, 255, 100};
- gui_fill_rectangle(x1, y1, x2, y2, bc);
- gui_set_font(&MMI_default_font);
- }
- else /* Shown by normal calnedar */
- {
- #if(CALENDAR_FULL_SCREEN_BACKGROUND)
- gui_set_clip(x1, y1, x2, y2);
- #if !defined(__MMI_MAINLCD_176X220__) && !defined(__MMI_MAINLCD_240X320__)
- gui_show_image(cat82_title1_x1, 0, calendar_control_background_image);
- #else
- gui_show_image(0, 0, calendar_control_background_image);
- #endif
- #else /* (CALENDAR_FULL_SCREEN_BACKGROUND) */
- gui_fill_rectangle(x1, y1, x2, y2, tc);
- #endif /* (CALENDAR_FULL_SCREEN_BACKGROUND) */
- gui_set_font(calendar_title_month_font);
- }
- #ifdef __MMI_TOUCH_SCREEN__
- if (!Cat82_title1_month_arrow_disable)
- {
- gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x1 + MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
- 0);
- gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
- 0);
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /* measure width and height ot title 1 in pixels */
- gui_measure_string((UI_string_type) Cat82_title1_month, &w, &h);
- /* move text cursor */
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1) + w, y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
- }
- else
- {
- gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1), y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
- }
- #if(CALENDAR_BORDERED_TITLES)
- if (lunar_calendar_present && IsChineseSet())
- {
- gui_set_text_color(tc);
- gui_print_text((UI_string_type) Cat82_title1_month);
- }
- else
- {
- gui_set_text_border_color(tc);
- gui_set_text_color(wc);
- gui_print_bordered_text((UI_string_type) Cat82_title1_month);
- }
- #else /* (CALENDAR_BORDERED_TITLES) */
- gui_set_text_color(tc);
- /* pritnt title 1 */
- gui_print_text((UI_string_type) Cat82_title1_month);
- #endif /* (CALENDAR_BORDERED_TITLES) */
- gdi_layer_blt_previous(x1, y1, x2, y2);
- gdi_layer_pop_clip();
- gdi_layer_pop_text_clip();
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * DisableCalendarTitle1Arrow
- * DESCRIPTION
- * disable arrows functionning in title1
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DisableCalendarTitle1Arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title1_arrow_disable = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * ResetCalendarTitle1Arrow
- * DESCRIPTION
- * reset arrows functionning in title1
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ResetCalendarTitle1Arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title1_arrow_disable = MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * DisableCalendarTitle1MonthArrow
- * DESCRIPTION
- * disable arrows functionning in title1 month
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DisableCalendarTitle1MonthArrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title1_month_arrow_disable = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * ResetCalendarTitle1MonthArrow
- * DESCRIPTION
- * reset arrows functionning in title1 month
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ResetCalendarTitle1MonthArrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat82_title1_month_arrow_disable = MMI_FALSE;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- /*****************************************************************************
- * FUNCTION
- * ChangeCategory82Title2
- * DESCRIPTION
- * change title 2 of lunar calendar and display
- * PARAMETERS
- * title [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeCategory82Title2(U8 *title)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1 = cat82_title2_x1;
- S32 y1 = cat82_title2_y1;
- S32 x2 = cat82_title2_x2;
- #if 0
- /* under construction !*/
- #else
- S32 y2 = cat82_title2_y2;
- #endif
- S32 w, h;
- color tc = *(current_MMI_theme->UI_black_color);
- //color bc = {182, 200, 255, 100};//120406 warning remove
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Update Title2 and Title3 For Lunar calendar only */
- if (!lunar_calendar_present)
- {
- return;
- }
- if (calendar_show_title2 == 0)
- {
- return;
- }
- #if 0
- /* under construction !*/
- #else /* __MMI_UI_DALMATIAN_CALENDAR__ */
- Cat82_title2 = title;
- #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */
- gdi_layer_push_clip();
- gdi_layer_push_text_clip();
- #ifndef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- if (calendar_show_title3)
- {
- x2 = cat82_title3_x1 - 1;
- }
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- gui_reset_clip();
- gdi_layer_set_text_clip(x1, y1, x2, y2);
- //gui_fill_rectangle(x1, y1, x2, y2, bc);
- #ifdef __MMI_TOUCH_SCREEN__
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- if ((lunar_calendar_present && IsChineseSet())) /* Year arrow on title 2 */
- {
- if (!Cat82_title1_arrow_disable)
- {
- gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x1 + MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
- 0);
- gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
- 0);
- }
- }
- #else /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- if ((lunar_calendar_present && IsChineseSet())) /* Year/Month arrow on title 2 */
- {
- if (calendar_show_title3)
- {
- 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 */
- }
- gui_measure_image((PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x1 + MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_LEFT_ARROW_UP_IMAGE),
- 0);
- gui_measure_image((PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE), &calendar_arrow_width, &calendar_arrow_height);
- gui_show_transparent_image(
- x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_RIGHT_ARROW_UP_IMAGE),
- 0);
- }
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- #endif /* __MMI_TOUCH_SCREEN__ */
- /* set text font */
- gui_set_font(&MMI_default_font);
- /* set text color */
- gui_set_text_color(tc);
- /* measue width and hieht of title 2 of lunar calendar */
- gui_measure_string((UI_string_type) Cat82_title2, &w, &h);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1) + w, y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
- }
- else
- {
- gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1), y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
- }
- gui_print_text((UI_string_type) Cat82_title2);
- gdi_layer_blt_previous(x1, y1, x2, y2);
- gdi_layer_pop_clip();
- gdi_layer_pop_text_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * ChangeCategory82Title3
- * DESCRIPTION
- * change title 3 of lunar calendar and display
- * PARAMETERS
- * title [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeCategory82Title3(U8 *title)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1 = cat82_title3_x1;
- S32 y1 = cat82_title3_y1;
- S32 x2 = cat82_title3_x2;
- #if 0
- /* under construction !*/
- #else
- S32 y2 = cat82_title3_y2;
- #endif
- S32 w, h;
- color tc = *(current_MMI_theme->UI_black_color);
- color bc = {255, 255, 255, 255};
- color bb = {0, 0, 0, 100};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Update Title2 and Title3 For Lunar calendar only */
- if (!lunar_calendar_present)
- {
- return;
- }
- if (calendar_show_title3 == 0)
- {
- return;
- }
- Cat82_title3 = title;
- gdi_layer_push_clip();
- gdi_layer_push_text_clip();
- gui_reset_clip();
- gdi_layer_set_text_clip(x1, y1, x2, y2);
- gui_fill_rectangle(x1, y1, x2, y2, bc);
- gui_set_font(&MMI_default_font);
- gui_set_text_color(tc);
- gui_measure_string((UI_string_type) Cat82_title3, &w, &h);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1) + w, y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
- }
- else
- {
- gui_move_text_cursor(x1 + ((x2 - x1 + 1) >> 1) - (w >> 1), y1 + ((y2 - y1 + 1) >> 1) - (h >> 1));
- }
- gui_print_text((UI_string_type) Cat82_title3);
- gui_draw_rectangle(x1, y1, x2, y2, bb);
- gdi_layer_blt_previous(x1, y1, x2, y2);
- gdi_layer_pop_clip();
- gdi_layer_pop_text_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory82Screen
- * DESCRIPTION
- * Redraws the Calendar App category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory82Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- clear_screen();
- gui_reset_clip();
- #ifdef __MMI_UI_DALMATIAN_CALENDAR__
- set_dalmatian_calendar_highlighter_box();
- SetCalendarTitleImage(dalmatian_calendar_current_week_image());
- #endif /* __MMI_UI_DALMATIAN_CALENDAR__ */
- wgui_show_calendar();
- ChangeCategory82Title1(Cat82_title1);
- ChangeCategory82Title2(Cat82_title2);
- ChangeCategory82Title3(Cat82_title3);
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- ChangeCategory82Title1Month(Cat82_title1_month);
- #endif
- #if ( defined (__MMI_MAINLCD_128X128__) || defined (__MMI_MAINLCD_128X160__) )
- show_softkey_background();
- #elif defined( __MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
- disable_softkey_background();
- #else
- show_softkey_background();
- #endif
- show_left_softkey();
- show_right_softkey();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * InitializeCategory82Screen
- * DESCRIPTION
- * Initializes the Calendar App category screen
- *
- * Must be called once before calling ShowCategory82Screen
- * PARAMETERS
- * first_day_of_week [IN] See the constants in wgui_calendar.h
- * last_day_of_month [IN] Ex: 28, 29, 30 or 31
- * current_day [IN]
- * current_month [IN]
- * current_year [IN]
- * INT(?) [IN] Current day Current day number (ex: 1 to 31)
- * RETURNS
- * void
- *****************************************************************************/
- void InitializeCategory82Screen(
- S32 first_day_of_week,
- S32 last_day_of_month,
- S32 current_day,
- S32 current_month,
- S32 current_year)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_setup_calendar(
- 0,
- 0,
- UI_device_width / CALENDAR_N_COLUMNS,
- UI_device_height / CALENDAR_N_ROWS,
- first_day_of_week,
- last_day_of_month,
- current_day,
- current_month,
- current_year,
- CALENDAR_ENABLE_POPUP);
- lunar_calendar_present = MMI_TRUE;
- /* PMT VIKAS START 20051217 */
- #ifdef __MMI_UI_DALMATIAN_CALENDAR__
- set_current_month_year_for_dalmatian(current_day, current_month, current_year);
- #endif
- /* PMT VIKAS END 20051217 */
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory82Screen
- * DESCRIPTION
- * Displays the Calendar App category screen
- *
- * Must call InitializeCategory82Screen before calling this screen
- * PARAMETERS
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * history_buffer [IN] History buffer
- * STRING(?) [IN] Title Title string (ex: Month and Year)
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory82Screen(
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ShowCalendarCommomCategoryScreen(
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- history_buffer);
- #ifdef __MMI_MAINLCD_240X320__
- register_hide_left_softkey(Calendar_hide_left_softkey);
- register_hide_right_softkey(Calendar_hide_right_softkey);
- //#else /* __MMI_MAINLCD_240X320__ */ //083006 calendar softkey
- #elif defined(__MMI_MAINLCD_176X220__)
- disable_softkey_background();
- #endif /* __MMI_MAINLCD_240X320__ */
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- SetCategory82Title1Month((U8*) MMI_calendar_title_string_month);
- #endif
- RedrawCategoryFunction = dm_redraw_category_screen;
- ExitCategoryFunction = ExitCategory82Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY82_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory82Screen
- * DESCRIPTION
- * Exits the Calendar App category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory82Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_close_calendar();
- leave_full_screen();
- enable_softkey_background();
- reset_softkeys();
- #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
- gui_register_button_shuffle(shuffle_draw_white); /* register the background drower */
- #endif
- lunar_calendar_present = MMI_FALSE;
- #if defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__)
- ResetCalendarTitle1Arrow();
- ResetCalendarTitle1MonthArrow();
- #endif /* defined(__MMI_UI_CALENDAR_WITH_INFO_BOX__) && defined (__MMI_TOUCH_SCREEN__) */
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- #ifdef __MMI_TOUCH_SCREEN__
- static BOOL g_calendar_pen_event = MMI_FALSE;
- /*****************************************************************************
- * FUNCTION
- * wgui_calendar_translate_pen_event
- * DESCRIPTION
- *
- * PARAMETERS
- * c [?]
- * pen_event [IN]
- * x [IN]
- * y [IN]
- * calendar_event [?]
- * RETURNS
- *
- *****************************************************************************/
- BOOL wgui_calendar_translate_pen_event(
- calendar_control *c,
- mmi_pen_event_type_enum pen_event,
- S16 x,
- S16 y,
- gui_calendar_pen_enum *calendar_event)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* If event is on Title of Calendar, handle that otherwise pass control to gui layer of calendar for handling pen events */
- BOOL ret;
- S32 x1, y1, x2, y2;
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- S32 xx1, yy1, xx2, yy2;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- /* for month info */
- x1 = cat82_title1_month_x1;
- y1 = cat82_title1_month_y1;
- x2 = cat82_title1_month_x2;
- y2 = cat82_title1_month_y2;
- /* for year info */
- if (lunar_calendar_present && IsChineseSet()) /* year info on title 1 */
- {
- xx1 = cat82_title2_x1;
- yy1 = cat82_title2_y1;
- xx2 = cat82_title2_x2;
- yy2 = cat82_title2_y2;
- }
- else /* year info on title 2 */
- {
- xx1 = cat82_title1_x1;
- yy1 = cat82_title1_y1;
- xx2 = cat82_title1_x2;
- yy2 = cat82_title1_y2;
- }
- #else /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- if (lunar_calendar_present && IsChineseSet()) /* Title2 will be used to display the year and month */
- {
- x1 = cat82_title2_x1;
- y1 = cat82_title2_y1;
- x2 = cat82_title2_x2;
- x2 = (calendar_show_title3) ? cat82_title3_x1 - 1 : cat82_title2_x2;
- y2 = cat82_title2_y2;
- }
- else /* Title1 will be used to display the year and month */
- {
- x1 = cat82_title1_x1;
- y1 = cat82_title1_y1;
- x2 = cat82_title1_x2;
- y2 = cat82_title1_y2;
- }
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- ret = MMI_TRUE;
- *calendar_event = GUI_CALENDAR_PEN_NONE;
- switch (pen_event)
- {
- case MMI_PEN_EVENT_DOWN:
- g_calendar_pen_event = MMI_FALSE;
- if (PEN_CHECK_BOUND(x, y, x1, y1, (x2 - x1), (y2 - y1))) /* Event is on the Title of the calendar */
- {
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- if (!Cat82_title1_month_arrow_disable) /* check if month info is disabled, do not check in original mode */
- #endif
- {
- if (PEN_CHECK_BOUND
- (x, y, x1 + MMI_CALENDAR_ARROW_OFFSET, y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- calendar_arrow_width, calendar_arrow_height))
- {
- /* First Arrow Pressed */
- gdi_layer_lock_frame_buffer();
- gui_show_transparent_image(
- x1 + MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_LEFT_ARROW_DOWN_IMAGE),
- 0);
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(
- x1 + MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- x1 + 2 * calendar_arrow_width + MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1) + calendar_arrow_height);
- c->previous_month_function();
- }
- if (PEN_CHECK_BOUND
- (x, y, x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1), calendar_arrow_width,
- calendar_arrow_height))
- {
- /* Second Arrow Pressed */
- gdi_layer_lock_frame_buffer();
- gui_show_transparent_image(
- x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_RIGHT_ARROW_DOWN_IMAGE),
- 0);
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(
- x2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1),
- x2 - MMI_CALENDAR_ARROW_OFFSET,
- y1 + ((y2 - y1 + 1) >> 1) - (calendar_arrow_height >> 1) + calendar_arrow_height);
- c->next_month_function();
- }
- }
- }
- #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
- else if (PEN_CHECK_BOUND(x, y, xx1, yy1, (xx2 - xx1), (yy2 - yy1))) /* Event is on the Title of the calendar */
- {
- if (!Cat82_title1_arrow_disable) /* check if year info is disabled */
- {
- if (PEN_CHECK_BOUND
- (x, y, xx1 + MMI_CALENDAR_ARROW_OFFSET,
- yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1), calendar_arrow_width,
- calendar_arrow_height))
- {
- /* First Arrow Pressed */
- gdi_layer_lock_frame_buffer();
- gui_show_transparent_image(
- xx1 + MMI_CALENDAR_ARROW_OFFSET,
- yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_LEFT_ARROW_DOWN_IMAGE),
- 0);
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(
- xx1 + MMI_CALENDAR_ARROW_OFFSET,
- yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1),
- xx1 + 2 * calendar_arrow_width + MMI_CALENDAR_ARROW_OFFSET,
- yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1) + calendar_arrow_height);
- c->previous_year_function();
- }
- if (PEN_CHECK_BOUND
- (x, y, xx2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1), calendar_arrow_width,
- calendar_arrow_height))
- {
- /* Second Arrow Pressed */
- gdi_layer_lock_frame_buffer();
- gui_show_transparent_image(
- xx2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1),
- (PU8) GetImage(CAL_RIGHT_ARROW_DOWN_IMAGE),
- 0);
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(
- xx2 - calendar_arrow_width - MMI_CALENDAR_ARROW_OFFSET,
- yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1),
- xx2 - MMI_CALENDAR_ARROW_OFFSET,
- yy1 + ((yy2 - yy1 + 1) >> 1) - (calendar_arrow_height >> 1) + calendar_arrow_height);
- c->next_year_function();
- }
- }
- }
- #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */
- else
- {
- /* Give control to gui layer */
- ret = gui_calendar_translate_pen_event(c, pen_event, x, y, calendar_event);
- if (ret)
- {
- g_calendar_pen_event = MMI_TRUE;
- }
- }
- break;
- case MMI_PEN_EVENT_UP:
- if (g_calendar_pen_event)
- {
- ret = gui_calendar_translate_pen_event(c, pen_event, x, y, calendar_event);
- }
- break;
- case MMI_PEN_EVENT_MOVE:
- if (g_calendar_pen_event)
- {
- ret = gui_calendar_translate_pen_event(c, pen_event, x, y, calendar_event);
- }
- break;
- case MMI_PEN_EVENT_LONG_TAP:
- /* Do nothing */
- break;
- case MMI_PEN_EVENT_REPEAT:
- /* Do nothing */
- break;
- case MMI_PEN_EVENT_ABORT:
- /* Do nothing */
- break;
- default:
- MMI_ASSERT(0);
- }
- return ret;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- #endif /* (ENABLE_CALENDAR_CONTROL) */
- /* 072406 new calendar Start */
- #ifdef __MMI_UI_INTEGRATED_CALENDAR_SUPPORT__
- #include "ScrMemMgrGprot.h"
- #ifdef __MMI_TOUCH_SCREEN__
- #include "wgui_touch_screen.h"
- #endif
- typedef struct
- {
- UI_image_ID_type left_up;
- UI_image_ID_type left_down;
- UI_image_ID_type right_up;
- UI_image_ID_type right_down;
- Cat83EventFuncPtr left_handler;
- Cat83EventFuncPtr right_handler;
- U8 *string;
- U32 align_type;
- S32 left_width;
- S32 left_height;
- S32 right_width;
- S32 right_height;
- U8 left_pressed;
- U8 right_pressed;
- U8 is_updated;
- } wgui_cat83_horizontal_select_struct;
- typedef struct
- {
- UI_image_ID_type top_up;
- UI_image_ID_type top_down;
- UI_image_ID_type bottom_up;
- UI_image_ID_type bottom_down;
- Cat83EventFuncPtr top_handler;
- Cat83EventFuncPtr bottom_handler;
- U8 **string_list;
- U32 align_type;
- S32 top_width;
- S32 top_height;
- S32 bottom_width;
- S32 bottom_height;
- U8 top_pressed;
- U8 bottom_pressed;
- U8 is_updated;
- } wgui_cat83_vertical_select_struct;
- typedef struct
- {
- U8 color_index1;
- U8 *string1;
- U8 color_index2;
- U8 *string2;
- FuncPtr show_title;
- U8 is_updated;
- } wgui_cat83_title_struct;
- typedef struct
- {
- U8 **string_list;
- U8 is_updated;
- } wgui_cat83_horizontal_string_struct;
- typedef struct
- {
- wgui_cat83_cell_struct *cell;
- U8 bg_fill_type;
- U8 text_display_type;
- U8 icon_display_type;
- U8 is_updated;
- #ifdef __MMI_TOUCH_SCREEN__
- U8 pen_on_highlighted;
- #endif
- } wgui_cat83_cell_array_struct;
- typedef struct
- {
- U8 *message1;
- U8 *message2;
- U8 *message3;
- U8 need_popup;
- U8 is_drawed;
- } wgui_cat83_popup_struct;
- typedef enum
- {
- CAT83_TITLE_NORMAL,
- CAT83_TITLE_MENSTRUAL,
- CAT83_TITLE_TOTAL
- } CAT83_TITLE_TYPE;
- void wgui_calendar_init(U32 calendar_type, U32 row_num, U32 column_num, U8* cell_buf, U8* popup_buf);
- static void wgui_cat83_redraw_bg(void);
- static void wgui_cat83_redraw_select_horizontal1(void);
- static void wgui_cat83_redraw_select_horizontal2(void);
- static void wgui_cat83_redraw_horizontal_string(void);
- static void wgui_cat83_redraw_select_vertical(void);
- static void wgui_cat83_redraw_normal_title(void);
- static void wgui_cat83_redraw_menstrual_title(void);
- void wgui_calendar_redraw_cell_arry(void);
- static void wgui_calendar_redraw_cell(S32 cell_x, S32 cell_y, S32 cell_width, S32 cell_height, wgui_cat83_cell_struct *cell);
- static void wgui_calendar_highlight_cell(U32 highlighted_row, U32 highlighted_column);
- static void wgui_calendar_unhighlight_cell(U32 highlighted_row, U32 highlighted_column);
- static void RedrawCategory83Screen(void);
- static void wgui_calendar_redraw_popup(void);
- MMI_BOOL (*Cat83AppCellHighlightHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
- MMI_BOOL (*Cat83AppLeftArrowKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
- MMI_BOOL (*Cat83AppRightArrowKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
- MMI_BOOL (*Cat83AppUpArrowKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
- MMI_BOOL (*Cat83AppDownArrowKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
- MMI_BOOL (*Cat83AppUpSideKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
- MMI_BOOL (*Cat83AppDownSideKeyHanlder)(U32 highlighted_row, U32 highlighted_column) = NULL;
- //FuncPtr Cat83ShowTitleArray[CAT83_TITLE_TOTAL] = { cat83_show_normal_title,
- // cat83_show_menstrual_title };
- //void (*cat83_show_title)(void) = cat83_show_normal_title;
- //static color cat83_cell_bg_color[CAT83_COLOR_TOTAL];//120406 warning remove
- //static color cat83_cell_highlight_color = {255, 0, 0, 255};
- static wgui_cat83_horizontal_select_struct cat83_horizontal_select[2];
- static wgui_cat83_vertical_select_struct cat83_vertical_select;
- static wgui_cat83_title_struct cat83_title;
- static wgui_cat83_horizontal_string_struct cat83_horizontal_string;
- static wgui_cat83_cell_array_struct cat83_cell_array;
- static wgui_cat83_popup_struct cat83_popup;
- //static MMI_BOOL cat83_horizontal_select1_display = MMI_TRUE;
- //static MMI_BOOL cat83_horizontal_select2_display = MMI_TRUE;
- static MMI_BOOL cat83_vertical_select_display = MMI_TRUE;
- //static MMI_BOOL cat83_infobox_display = MMI_TRUE;
- static S32 cat83_content_x;
- static S32 cat83_content_y;
- static S32 cat83_content_width;
- static S32 cat83_content_height;
- static S32 cat83_horizontal_select_x;
- static S32 cat83_horizontal_select_y;
- static S32 cat83_horizontal_select_width;
- static S32 cat83_horizontal_select_height;
- static S32 cat83_title_x;
- static S32 cat83_title_y;
- static S32 cat83_title_width;
- static S32 cat83_title_height;
- static S32 cat83_vertical_select_x;
- static S32 cat83_vertical_select_y;
- static S32 cat83_vertical_select_width;
- static S32 cat83_vertical_select_height;
- static S32 cat83_horizontal_string_x;
- static S32 cat83_horizontal_string_y;
- static S32 cat83_horizontal_string_width;
- static S32 cat83_horizontal_string_height;
- static S32 cat83_cell_array_x;
- static S32 cat83_cell_array_y;
- static S32 cat83_cell_array_width;
- static S32 cat83_cell_array_height;
- static S32 cat83_cell_width;
- static S32 cat83_cell_height;
- static gdi_image_cache_bmp_struct cat83_cell_cache;
- static gdi_image_cache_bmp_struct cat83_popup_cache;
- static S32 cat83_frame_line_pixel;
- static S32 cat83_popup_x;