void mmi_idle_sublcd_diplay_clockwise(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
gdi_handle active_layer;
applib_time_struct t;
U16 image_nHour = 0;
U16 image_nMin = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (srv_backlight_is_lcd_sleep())
{
StopTimer(SUBLCD_ANALOG_CLOCK_TIMER);
return;
}
applib_dt_get_date_time(&t);
if (t.nHour > 12)
t.nHour = t.nHour - 12;
image_nHour = (t.nHour * 5) + t.nMin /12;
image_nMin = t.nMin;
gdi_layer_get_active(&active_layer);
gdi_push_and_set_alpha_blending_source_layer(active_layer);
gdi_image_draw_id(0, 0, (IMG_SUBLCD_CLOCKWISE_00 + image_nHour));
gdi_image_draw_id(0, 0, (IMG_SUBLCD_MINUTE_HAND_00 + image_nMin));
gdi_pop_and_restore_alpha_blending_source_layer();
}
void mmi_idle_sublcd_analog_clock(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
GDI_HANDLE act_lcd = GDI_ERROR_HANDLE;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (srv_backlight_is_lcd_sleep())
{
StopTimer(SUBLCD_ANALOG_CLOCK_TIMER);
return;
}
gdi_lcd_get_active(&act_lcd);
if (act_lcd != GDI_LCD_SUB_LCD_HANDLE)
{
UI_set_sub_LCD_graphics_context();
}
gdi_layer_lock_frame_buffer();
gdi_layer_push_clip();
gdi_layer_reset_clip();
gdi_image_draw(0, 0, get_image(IMG_SUBLCD_ANALOG_CLOCK_BG));
wgui_clock_show_sub_lcd();
mmi_idle_sublcd_diplay_clockwise();
gdi_layer_pop_clip();
gdi_layer_unlock_frame_buffer();
gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
if (act_lcd == GDI_LCD_MAIN_LCD_HANDLE)
{
UI_set_main_LCD_graphics_context();
}
StartTimer(SUBLCD_ANALOG_CLOCK_TIMER,1000,mmi_idle_sublcd_analog_clock);
}
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
gdi_handle active_layer;
applib_time_struct t;
U16 image_nHour = 0;
U16 image_nMin = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (srv_backlight_is_lcd_sleep())
{
StopTimer(SUBLCD_ANALOG_CLOCK_TIMER);
return;
}
applib_dt_get_date_time(&t);
if (t.nHour > 12)
t.nHour = t.nHour - 12;
image_nHour = (t.nHour * 5) + t.nMin /12;
image_nMin = t.nMin;
gdi_layer_get_active(&active_layer);
gdi_push_and_set_alpha_blending_source_layer(active_layer);
gdi_image_draw_id(0, 0, (IMG_SUBLCD_CLOCKWISE_00 + image_nHour));
gdi_image_draw_id(0, 0, (IMG_SUBLCD_MINUTE_HAND_00 + image_nMin));
gdi_pop_and_restore_alpha_blending_source_layer();
}
void mmi_idle_sublcd_analog_clock(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
GDI_HANDLE act_lcd = GDI_ERROR_HANDLE;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (srv_backlight_is_lcd_sleep())
{
StopTimer(SUBLCD_ANALOG_CLOCK_TIMER);
return;
}
gdi_lcd_get_active(&act_lcd);
if (act_lcd != GDI_LCD_SUB_LCD_HANDLE)
{
UI_set_sub_LCD_graphics_context();
}
gdi_layer_lock_frame_buffer();
gdi_layer_push_clip();
gdi_layer_reset_clip();
gdi_image_draw(0, 0, get_image(IMG_SUBLCD_ANALOG_CLOCK_BG));
wgui_clock_show_sub_lcd();
mmi_idle_sublcd_diplay_clockwise();
gdi_layer_pop_clip();
gdi_layer_unlock_frame_buffer();
gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
if (act_lcd == GDI_LCD_MAIN_LCD_HANDLE)
{
UI_set_main_LCD_graphics_context();
}
StartTimer(SUBLCD_ANALOG_CLOCK_TIMER,1000,mmi_idle_sublcd_analog_clock);
}