wingui.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:231k
- UI_UNUSED_PARAMETER(r);
- UI_UNUSED_PARAMETER(g);
- UI_UNUSED_PARAMETER(b);
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_color
- * DESCRIPTION
- *
- * PARAMETERS
- * r [IN]
- * g [IN]
- * b [IN]
- * RETURNS
- *
- *****************************************************************************/
- color UI_color(U8 r, U8 g, U8 b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = r;
- c.b = b;
- c.g = g;
- c.alpha = 100;
- return (c);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_color32
- * DESCRIPTION
- *
- * PARAMETERS
- * r [IN]
- * g [IN]
- * b [IN]
- * alpha [IN]
- * RETURNS
- *
- *****************************************************************************/
- color UI_color32(U8 r, U8 g, U8 b, U8 alpha)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = r;
- c.b = b;
- c.g = g;
- c.alpha = alpha;
- return (c);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_color_RGB
- * DESCRIPTION
- *
- * PARAMETERS
- * c [IN]
- * r [?]
- * g [?]
- * b [?]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_color_RGB(color c, U8 *r, U8 *g, U8 *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *r = c.r;
- *g = c.g;
- *b = c.b;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_lock_double_buffer
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_lock_double_buffer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- }
- /*****************************************************************************
- * FUNCTION
- * UI_unlock_double_buffer
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_unlock_double_buffer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_unlock_frame_buffer();
- }
- /*****************************************************************************
- * FUNCTION
- * UI_BLT_double_buffer
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_BLT_double_buffer(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_blt_previous(x1, y1, x2, y2);
- }
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /* System keyboard handler */
- void keyboard_key_handler(S32 vkey_code, S32 key_state);
- void keyboard_input_handler(S32 vkey_code);
- void keyboard_global_key_handler(S32 vkey_code, S32 key_state);
- void keyboard_global_input_handler(S32 vkey_code);
- extern void toggle_temp_sublcd_display(void);
- /*****************************************************************************
- * FUNCTION
- * MMI_system_keybord_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * key_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void MMI_system_keybord_handler(S32 key_code, S32 key_state)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- keyboard_global_key_handler(key_code, key_state);
- keyboard_key_handler(key_code, key_state);
- /* Character input for the MMI */
- if (!((key_code >= 0x70) && (key_code <= 0x7F)) &&
- (key_code != 0x91) &&
- (key_code != 0x90) && !((key_code >= 0x21) && (key_code <= 0x28)) && (key_code != 0x2D) && (key_code != 0x2E))
- {
- if (key_state == WM_KEYBRD_PRESS)
- { /* Translate the key_code to ASCII here */
- /* Need to add Translation of code */
- /* Check for Shift, Caps key --etc */
- keyboard_input_handler(key_code);
- keyboard_global_input_handler(key_code);
- }
- }
- /* Temp: Toggles a sample Sub LCD display */
- if ((key_state == 256) && (key_code == 116))
- {
- toggle_temp_sublcd_display();
- }
- }
- #elif(MMI_BUILD_TYPE==BUILD_TYPE_HW_PLUTO)
- /*****************************************************************************
- * FUNCTION
- * MMI_system_keybord_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * key_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void MMI_system_keybord_handler(S32 key_code, S32 key_state)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key_code);
- UI_UNUSED_PARAMETER(key_state);
- }
- #endif
- #if(!WINGUI_USE_OS_TIMERS)
- /* Software timers required by the UI */
- typedef struct _timer
- {
- S32 counter;
- void (*callback) (void);
- } timer;
- #include "TimerEvents.h"
- timer timer_functions[MAX_TIMERS];
- S32 n_timers = 0;
- S32 patch_timer_counter = 0;
- U8 UI_timer_active = 1;
- extern U16 StartMyTimerInt(U16 nTimerId, U32 nTimeDuration, oslTimerFuncPtr TimerExpiry, U8 alignment);
- extern U16 StopMyTimer(U16 nTimerId);
- /*****************************************************************************
- * FUNCTION
- * SW_StartTimer
- * DESCRIPTION
- *
- * PARAMETERS
- * timerid [IN]
- * delay [IN]
- * funcPtr [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SW_StartTimer(U16 timerid, U32 delay, FuncPtr funcPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StartMyTimerInt(timerid, delay, (oslTimerFuncPtr) funcPtr, 1);
- }
- /*****************************************************************************
- * FUNCTION
- * SW_StopTimer
- * DESCRIPTION
- *
- * PARAMETERS
- * timerid [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SW_StopTimer(U16 timerid)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopMyTimer(timerid);
- }
- void UI_timer(void);
- /*****************************************************************************
- * FUNCTION
- * UI_timer_control
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_control(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SW_StartTimer(UI_ELEMENTS_TIMER, UI_TIMER_RESOLUTION, UI_timer_control);
- UI_timer_active = 1;
- UI_timer();
- }
- /*****************************************************************************
- * FUNCTION
- * UI_start_timer
- * DESCRIPTION
- *
- * PARAMETERS
- * count [IN]
- * callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_start_timer(S32 count, void (*callback) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* start the OS/hardware timer if necessary */
- if (n_timers >= MAX_TIMERS)
- {
- return;
- }
- /* Patch for the timer start bug:
- Note, for some reasons, the OS timer will not call UI_timer_control.
- So, when UI_start_timer is called again, we'll check if the OS timer
- is stuck. If its stuck, then we'll start the OS timer again */
- if (n_timers > 0)
- {
- if (timer_functions[0].counter == patch_timer_counter)
- {
- SW_StartTimer(UI_ELEMENTS_TIMER, UI_TIMER_RESOLUTION, UI_timer_control);
- UI_timer_active = 1;
- }
- }
- if ((n_timers == 0) || (!UI_timer_active))
- {
- SW_StartTimer(UI_ELEMENTS_TIMER, UI_TIMER_RESOLUTION, UI_timer_control);
- UI_timer_active = 1;
- }
- else
- { /* check if this function has already been hooked. If yes, remove it */
- for (i = 0; i < n_timers; i++)
- {
- if (timer_functions[i].callback == callback)
- {
- for (j = i; j < n_timers - 1; j++)
- {
- timer_functions[j] = timer_functions[j + 1];
- }
- n_timers--;
- }
- }
- }
- timer_functions[n_timers].counter = count / UI_TIMER_RESOLUTION;
- timer_functions[n_timers].callback = callback;
- n_timers++;
- /* Patch for the timer start bug */
- patch_timer_counter = timer_functions[0].counter;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_cancel_timer
- * DESCRIPTION
- *
- * PARAMETERS
- * callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_cancel_timer(void (*callback) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_timers <= 0)
- {
- return;
- }
- /* If the callback function has already been hooked, remove it */
- for (i = 0; i < n_timers; i++)
- {
- if (timer_functions[i].callback == callback)
- {
- for (j = i; j < n_timers - 1; j++)
- {
- timer_functions[j] = timer_functions[j + 1];
- }
- n_timers--;
- }
- }
- /* if all software timers have expired, release the OS/hardware timer */
- if (n_timers == 0)
- {
- SW_StopTimer(UI_ELEMENTS_TIMER);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * UI_cancel_all_timers
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_cancel_all_timers(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- n_timers = 0;
- SW_StopTimer(UI_ELEMENTS_TIMER);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- void (*callback) (void);
- if (n_timers == 0)
- {
- if (UI_timer_active)
- {
- SW_StopTimer(UI_ELEMENTS_TIMER);
- }
- return;
- }
- for (i = 0; i < n_timers; i++)
- {
- timer_functions[i].counter--;
- if (timer_functions[i].counter <= 0)
- {
- callback = timer_functions[i].callback;
- for (j = i; j < n_timers - 1; j++)
- {
- timer_functions[j] = timer_functions[j + 1];
- }
- n_timers--;
- callback();
- }
- }
- /* if all software timers have expired, release the OS/hardware timer */
- if (n_timers == 0)
- {
- SW_StopTimer(UI_ELEMENTS_TIMER);
- }
- }
- #else /* (!WINGUI_USE_OS_TIMERS) */
- /* Externals */
- extern U16 StartMyTimerInt(U16 nTimerId, U32 nTimeDuration, oslTimerFuncPtr TimerExpiry, U8 alignment);
- extern U16 StopMyTimer(U16 nTimerId);
- U8 HW_alignment_timer_flag = TIMER_IS_ALIGNMENT;
- /*****************************************************************************
- * FUNCTION
- * UI_enable_alignment_timers
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_enable_alignment_timers(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_alignment_timer_flag = TIMER_IS_ALIGNMENT;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_disable_alignment_timers
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_disable_alignment_timers(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_alignment_timer_flag = TIMER_IS_NO_ALIGNMENT;
- }
- /*****************************************************************************
- * FUNCTION
- * HW_StartTimer
- * DESCRIPTION
- *
- * PARAMETERS
- * timerid [IN]
- * delay [IN]
- * funcPtr [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HW_StartTimer(U16 timerid, U32 delay, FuncPtr funcPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StartMyTimerInt(timerid, delay, (oslTimerFuncPtr) funcPtr, TIMER_IS_NO_ALIGNMENT);
- }
- /*****************************************************************************
- * FUNCTION
- * HW_StopTimer
- * DESCRIPTION
- *
- * PARAMETERS
- * timerid [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HW_StopTimer(U16 timerid)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopMyTimer(timerid);
- }
- #define MAX_UI_TIMERS (sizeof(UI_timer_IDs)/sizeof(UI_timer_IDs[0]))
- U16 UI_timer_IDs[] =
- {
- UI_TIMER_ID_BASE + 0,
- UI_TIMER_ID_BASE + 1,
- UI_TIMER_ID_BASE + 2,
- UI_TIMER_ID_BASE + 3,
- UI_TIMER_ID_BASE + 4,
- UI_TIMER_ID_BASE + 5,
- UI_TIMER_ID_BASE + 6,
- UI_TIMER_ID_BASE + 7,
- UI_TIMER_ID_BASE + 8,
- UI_TIMER_ID_BASE + 9,
- };
- void (*UI_timer_callbacks[MAX_UI_TIMERS]) (void);
- /* Flag=0 indicates timer is available */
- U8 UI_timer_ID_flags[MAX_UI_TIMERS];
- /* OS callback functions */
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_0
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_0(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[0]);
- UI_timer_ID_flags[0] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[0] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_1
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[1]);
- UI_timer_ID_flags[1] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[1] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_2
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[2]);
- UI_timer_ID_flags[2] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[2] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_3
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_3(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[3]);
- UI_timer_ID_flags[3] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[3] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_4
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_4(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[4]);
- UI_timer_ID_flags[4] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[4] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_5
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_5(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[5]);
- UI_timer_ID_flags[5] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[5] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_6
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_6(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[6]);
- UI_timer_ID_flags[6] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[6] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_7
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_7(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[7]);
- UI_timer_ID_flags[7] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[7] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_8
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_8(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[8]);
- UI_timer_ID_flags[8] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[8] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_timer_callback_9
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_timer_callback_9(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HW_StopTimer(UI_timer_IDs[9]);
- UI_timer_ID_flags[9] = 0;
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_TRUE;
- #endif
- UI_timer_callbacks[9] ();
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * UI_start_timer
- * DESCRIPTION
- *
- * PARAMETERS
- * count [IN]
- * callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_start_timer(S32 count, void (*callback) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 i;
- U8 all_timers_used = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* check if this function has already been hooked. If yes, remove it */
- for (i = 0; i < MAX_UI_TIMERS; i++)
- {
- if ((UI_timer_ID_flags[i]) && (UI_timer_callbacks[i] == callback))
- {
- HW_StopTimer(UI_timer_IDs[i]);
- UI_timer_callbacks[i] = UI_dummy_function;
- UI_timer_ID_flags[i] = 0;
- }
- }
- /* Check for free timer */
- for (i = 0; i < MAX_UI_TIMERS; i++)
- {
- if (UI_timer_ID_flags[i] == 0)
- {
- all_timers_used = 0;
- break;
- }
- }
- /* If all timers are used, return */
- if (all_timers_used)
- {
- return;
- }
- /* Hook the callback function and start the OS timer */
- UI_timer_callbacks[i] = callback;
- switch (i)
- {
- case 0:
- HW_StartTimer(UI_timer_IDs[0], (U16) count, UI_timer_callback_0);
- break;
- case 1:
- HW_StartTimer(UI_timer_IDs[1], (U16) count, UI_timer_callback_1);
- break;
- case 2:
- HW_StartTimer(UI_timer_IDs[2], (U16) count, UI_timer_callback_2);
- break;
- case 3:
- HW_StartTimer(UI_timer_IDs[3], (U16) count, UI_timer_callback_3);
- break;
- case 4:
- HW_StartTimer(UI_timer_IDs[4], (U16) count, UI_timer_callback_4);
- break;
- case 5:
- HW_StartTimer(UI_timer_IDs[5], (U16) count, UI_timer_callback_5);
- break;
- case 6:
- HW_StartTimer(UI_timer_IDs[6], (U16) count, UI_timer_callback_6);
- break;
- case 7:
- HW_StartTimer(UI_timer_IDs[7], (U16) count, UI_timer_callback_7);
- break;
- case 8:
- HW_StartTimer(UI_timer_IDs[8], (U16) count, UI_timer_callback_8);
- break;
- case 9:
- HW_StartTimer(UI_timer_IDs[9], (U16) count, UI_timer_callback_9);
- break;
- }
- /* Set the timer to busy */
- UI_timer_ID_flags[i] = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_cancel_timer
- * DESCRIPTION
- *
- * PARAMETERS
- * callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_cancel_timer(void (*callback) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Check if this callback function is hooked */
- for (i = 0; i < MAX_UI_TIMERS; i++)
- {
- if (UI_timer_ID_flags[i] && UI_timer_callbacks[i] == callback)
- {
- UI_timer_ID_flags[i] = 0;
- HW_StopTimer(UI_timer_IDs[i]);
- break;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * UI_cancel_all_timers
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_cancel_all_timers(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MAX_UI_TIMERS; i++)
- {
- if (UI_timer_ID_flags[i])
- {
- UI_timer_ID_flags[i] = 0;
- HW_StopTimer(UI_timer_IDs[i]);
- break;
- }
- }
- }
- #endif /* (!WINGUI_USE_OS_TIMERS) */
- /* Internal bitmap format: Device specific */
- animated_image *animated_images[MAX_ANIMATED_IMAGES];
- S32 n_animated_images = 0;
- void (*UI_hide_animation_frame_function) (void) = UI_dummy_function;
- /*****************************************************************************
- * FUNCTION
- * _measure_bitmap
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * width [?]
- * height [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _measure_bitmap(bitmap *b, S32 *width, S32 *height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b == NULL)
- {
- *width = 0;
- *height = 0;
- }
- else
- {
- *width = b->xsize;
- *height = b->ysize;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * _show_bitmap
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * b [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _show_bitmap(S32 x1, S32 y1, bitmap *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- S32 layer_width;
- S32 layer_height;
- S32 layer_offset_x;
- S32 layer_offset_y;
- S32 layer_clip_x1;
- S32 layer_clip_x2;
- S32 layer_clip_y1;
- S32 layer_clip_y2;
- S32 start_x, end_x, start_y, end_y;
- U8 *layer_buf_ptr;
- U8 *bmp_data_ptr;
- S32 x2, y2;
- S32 vlaid_width;
- S32 byte_per_pixel;
- /* set active layer to base layer for pixtel's drawing */
- gdi_handle base_handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_get_base_handle(&base_handle);
- gdi_layer_push_and_set_active(base_handle);
- bmp_data_ptr = b->data;
- gdi_layer_get_buffer_ptr(&layer_buf_ptr);
- gdi_layer_get_clip(&layer_clip_x1, &layer_clip_y1, &layer_clip_x2, &layer_clip_y2);
- gdi_layer_get_dimension(&layer_width, &layer_height);
- gdi_layer_get_position(&layer_offset_x, &layer_offset_y);
- byte_per_pixel = gdi_layer_get_bit_per_pixel()>>3;
- layer_clip_x1 -= layer_offset_x;
- layer_clip_x2 -= layer_offset_x;
- layer_clip_y1 -= layer_offset_y;
- layer_clip_y2 -= layer_offset_y;
- x2 = x1 + b->xsize - 1;
- y2 = y1 + b->ysize - 1;
- /* out of clip region */
- if ((x1 > layer_clip_x2) || (y1 > layer_clip_y2) || (x2 < layer_clip_x1) || (y2 < layer_clip_y1))
- {
- gdi_layer_pop_and_restore_active();
- return;
- }
- /* Calculate valid region */
- if (x1 < layer_clip_x1)
- {
- start_x = layer_clip_x1;
- }
- else
- {
- start_x = x1;
- }
- if (x2 > layer_clip_x2)
- {
- end_x = layer_clip_x2;
- }
- else
- {
- end_x = x2;
- }
- if (y1 < layer_clip_y1)
- {
- start_y = layer_clip_y1;
- }
- else
- {
- start_y = y1;
- }
- if (y2 > layer_clip_y2)
- {
- end_y = layer_clip_y2;
- }
- else
- {
- end_y = y2;
- }
- /* find update width */
- vlaid_width = end_x - start_x + 1;
- /* shift to bmp buffer start position */
- /* PMT VIKAS START 20051209 */
- bmp_data_ptr += (start_y - y1) * b->row_bytes + (start_x - x1) * byte_per_pixel;
- /* PMT VIKAS END 20051209 */
- /* shift to layer buffer start position */
- layer_buf_ptr += ((start_y - layer_offset_y) * layer_width + (start_x - layer_offset_x)) * byte_per_pixel;
- /* fill bitmap buffer */
- for (i = start_y; i <= end_y; i++)
- {
- memcpy(layer_buf_ptr, bmp_data_ptr, vlaid_width * byte_per_pixel);
- bmp_data_ptr += b->row_bytes;
- layer_buf_ptr += layer_width * byte_per_pixel;
- }
- /* restore current active layer */
- gdi_layer_pop_and_restore_active();
- }
- /*****************************************************************************
- * FUNCTION
- * _get_bitmap
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * b [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _get_bitmap(S32 x1, S32 y1, S32 x2, S32 y2, bitmap *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- S32 layer_width;
- S32 layer_height;
- S32 layer_offset_x;
- S32 layer_offset_y;
- S32 layer_clip_x1;
- S32 layer_clip_x2;
- S32 layer_clip_y1;
- S32 layer_clip_y2;
- S32 start_x, end_x, start_y, end_y;
- U8 *layer_buf_ptr;
- U8 *bmp_data_ptr;
- S32 byte_per_pixel;
- /* set active layer to base layer for pixtel's drawing */
- gdi_handle base_handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_get_base_handle(&base_handle);
- gdi_layer_push_and_set_active(base_handle);
- bmp_data_ptr = b->data;
- gdi_layer_get_buffer_ptr(&layer_buf_ptr);
- gdi_layer_get_clip(&layer_clip_x1, &layer_clip_y1, &layer_clip_x2, &layer_clip_y2);
- gdi_layer_get_dimension(&layer_width, &layer_height);
- gdi_layer_get_position(&layer_offset_x, &layer_offset_y);
- byte_per_pixel = gdi_layer_get_bit_per_pixel()>>3;
- layer_clip_x1 -= layer_offset_x;
- layer_clip_x2 -= layer_offset_x;
- layer_clip_y1 -= layer_offset_y;
- layer_clip_y2 -= layer_offset_y;
- /* out of clip region */
- if ((x1 > layer_clip_x2) || (y1 > layer_clip_y2) || (x2 < layer_clip_x1) || (y2 < layer_clip_y1))
- {
- b->xsize = 0;
- b->xsize = 0;
- b->row_bytes = 0;
- gdi_layer_pop_and_restore_active();
- return;
- }
- /* Calculate valid region */
- if (x1 < layer_clip_x1)
- {
- start_x = layer_clip_x1;
- }
- else
- {
- start_x = x1;
- }
- if (x2 > layer_clip_x2)
- {
- end_x = layer_clip_x2;
- }
- else
- {
- end_x = x2;
- }
- if (y1 < layer_clip_y1)
- {
- start_y = layer_clip_y1;
- }
- else
- {
- start_y = y1;
- }
- if (y2 > layer_clip_y2)
- {
- end_y = layer_clip_y2;
- }
- else
- {
- end_y = y2;
- }
- /* fill bitmap info */
- b->xsize = end_x - start_x + 1;
- b->ysize = end_y - start_y + 1;
- b->row_bytes = b->xsize * byte_per_pixel; /* 16-bit specific */
- /* find source buffer start position of the active layer */
- /* shift to layer's coordiante */
- layer_offset_x = start_x - layer_offset_x;
- layer_offset_y = start_y - layer_offset_y;
- layer_buf_ptr += (layer_offset_y * layer_width + layer_offset_x) * byte_per_pixel; /* 16-bit */
- /* fill bitmap buffer */
- for (i = 0; i < b->ysize; i++)
- {
- memcpy(bmp_data_ptr, layer_buf_ptr, b->row_bytes);
- bmp_data_ptr += b->row_bytes;
- layer_buf_ptr += layer_width * byte_per_pixel; /* just to next row */
- }
- /* restore current active layer */
- gdi_layer_pop_and_restore_active();
- }
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_hide_animation_function
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_dummy_hide_animation_function(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(x1);
- UI_UNUSED_PARAMETER(y1);
- UI_UNUSED_PARAMETER(x2);
- UI_UNUSED_PARAMETER(y2);
- }
- /*****************************************************************************
- * FUNCTION
- * _measure_image
- * DESCRIPTION
- *
- * PARAMETERS
- * image [?]
- * width [?]
- * height [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _measure_image(U8 *image, S32 *width, S32 *height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (image == NULL)
- {
- return;
- }
- gdi_image_get_dimension((U8*) image, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_get_image_n_frames
- * DESCRIPTION
- *
- * PARAMETERS
- * image [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 UI_get_image_n_frames(U8 *image)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- bytestream bfile;
- S32 image_length /* ,n */ ;
- U8 image_identifier;
- S32 frame_count;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (image == NULL)
- {
- return (0);
- }
- image_identifier = (U8) (image[0]);
- if (image_identifier == IMAGE_TYPE_INVALID)
- {
- return (0);
- }
- image_length = _read_image_length(image);
- bytestream_initialize(&bfile, (U8*) (image + 6), image_length);
- switch (image_identifier)
- {
- case IMAGE_TYPE_BMP:
- case IMAGE_TYPE_BMP_SEQUENCE:
- case IMAGE_TYPE_GIF:
- case IMAGE_TYPE_DEVICE_BITMAP:
- case IMAGE_TYPE_DEVICE_BITMAP_SEQUENCE:
- case IMAGE_TYPE_JPG: /* JL 040616 added for JPEG image ID */
- case IMAGE_TYPE_AVI: /* 120304 Calvin added */
- case IMAGE_TYPE_3GP: /* 120304 Calvin added */
- case IMAGE_TYPE_MP4: /* 120304 Calvin added */
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- case IMAGE_TYPE_BMP_FILE_OFFSET: /* Vikram added BMPFILEOFFSET Support */
- case IMAGE_TYPE_GIF_FILE_OFFSET:
- #endif /* __MMI_DOWNLOADABLE_THEMES_SUPPORT__ */
- gdi_image_get_frame_count(image, &frame_count);
- return frame_count;
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * _show_animation
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * image [?]
- * RETURNS
- *
- *****************************************************************************/
- animated_image *_show_animation(S32 x, S32 y, U8 *image)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- animated_image *a = NULL;
- U8 image_identifier;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (image == NULL)
- {
- return (NULL);
- }
- image_identifier = (U8) (image[0]);
- if (image_identifier == IMAGE_TYPE_INVALID)
- {
- return (NULL);
- }
- if ((image_identifier == IMAGE_TYPE_BMP) || (image_identifier == IMAGE_TYPE_BMP_FILE) ||
- (image_identifier == IMAGE_TYPE_WBMP_FILE))
- {
- gdi_image_draw(x, y, image);
- return (NULL);
- }
- if (n_animated_images >= MAX_ANIMATED_IMAGES)
- {
- return (NULL);
- }
- a = (animated_image*) gui_malloc(sizeof(animated_image));
- if (a == NULL)
- {
- return (NULL);
- }
- a->last_frame_function = NULL;
- GET_GRAPHICS_CONTEXT(a->graphics_context);
- a->x = x;
- a->y = y;
- gui_get_clip(&a->clip_x1, &a->clip_y1, &a->clip_x2, &a->clip_y2);
- a->frame_rate = ANIMATED_IMAGE_FRAME_RATE;
- a->flags = 0;
- a->frame_counter = 0;
- a->hide_function = UI_dummy_hide_animation_function;
- _load_animation_frames(image, a);
- a->start_frame = 0;
- a->end_frame = (S16) (a->n_frames - 1);
- if (a->n_frames > 0)
- {
- _show_animated_image(x, y, a);
- return (a);
- }
- else
- {
- gui_free(a);
- gdi_image_draw(x, y, image);
- return (NULL);
- }
- }
- /* 071205 Calvin removed */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /* 071205 Calvin end */
- /*****************************************************************************
- * FUNCTION
- * _load_animation_frames
- * DESCRIPTION
- *
- * PARAMETERS
- * image [?]
- * a [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _load_animation_frames(U8 *image, animated_image *a)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 image_length;
- U8 image_identifier;
- S32 n_frames = 0, i;
- U32 offset = 0;
- S16 image_counter = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (image == NULL)
- {
- return;
- }
- image_identifier = (U8) (image[0]);
- switch (image_identifier)
- {
- case IMAGE_TYPE_INVALID:
- return;
- case IMAGE_TYPE_BMP_SEQUENCE:
- {
- n_frames = (S16) image[1];
- if (a == NULL)
- {
- return;
- }
- a->n_frames = 0;
- if (n_frames <= 0)
- {
- return;
- }
- for (i = 0; i < n_frames; i++)
- {
- image_identifier = (U8) (image[offset]);
- image_length = _read_image_length((U8*) (image + offset));
- if (image_identifier != 0)
- {
- a->images[image_counter] = (U8*) (image + offset);
- image_counter++;
- }
- offset += (image_length + 6);
- }
- }
- break;
- case IMAGE_TYPE_GIF:
- {
- if (a == NULL)
- {
- return;
- }
- a->n_frames = 0;
- image_length = _read_image_length((U8*) image);
- gdi_image_get_frame_count(image, &n_frames);
- a->images[image_counter] = (U8*) image;
- }
- break;
- }
- a->n_frames = (S16) n_frames;
- }
- /*****************************************************************************
- * FUNCTION
- * _show_animated_image
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * a [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _show_animated_image(S32 x, S32 y, animated_image *a)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(x);
- UI_UNUSED_PARAMETER(y);
- if (n_animated_images >= MAX_ANIMATED_IMAGES)
- {
- return;
- }
- animated_images[n_animated_images] = a;
- n_animated_images++;
- if (n_animated_images == 1)
- {
- _animated_image_processor();
- }
- else
- {
- U8 gc_flag;
- S32 x1, y1, x2, y2;
- S32 width, height;
- U8 image_identifier = (U8) a->images[0][0];
- gui_push_clip();
- if ((image_identifier == 3) || (image_identifier == 7))
- {
- _measure_image(a->images[0], &width, &height);
- }
- else
- {
- _measure_image(a->images[a->frame_counter], &width, &height);
- }
- x1 = a->x;
- y1 = a->y;
- x2 = x1 + width - 1;
- y2 = y1 + height - 1;
- SWITCH_GRAPHICS_CONTEXT(a->graphics_context, gc_flag);
- gui_reset_clip();
- a->hide_function(x1, y1, x2, y2);
- gui_set_clip(a->clip_x1, a->clip_y1, a->clip_x2, a->clip_y2);
- if ((image_identifier == 3) || (image_identifier == 7))
- {
- if (a->flags & ANIMATED_IMAGE_TRANSPARENT)
- {
- _show_transparent_animation_frame(x1, y1, a->images[0], 0, a->frame_counter);
- }
- else
- {
- _show_animation_frame(x1, y1, a->images[0], a->frame_counter);
- }
- }
- else
- {
- if (a->flags & ANIMATED_IMAGE_TRANSPARENT)
- {
- _show_transparent_image(x1, y1, (a->images[a->frame_counter]), 0);
- }
- else
- {
- gdi_image_draw(x1, y1, (a->images[a->frame_counter]));
- }
- }
- gui_BLT_double_buffer(x1, y1, x2, y2);
- RESTORE_GRAPHICS_CONTEXT(gc_flag);
- gui_pop_clip();
- }
- }
- /* 071205 Calvin removed */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /* 071205 Calvin end */
- /*****************************************************************************
- * FUNCTION
- * _animated_image_processor
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void _animated_image_processor(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, x1, y1, x2, y2;
- S32 width, height;
- animated_image *a;
- U8 gc_flag;
- U8 image_identifier;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_push_clip();
- UI_hide_animation_frame_function();
- for (i = 0; i < n_animated_images; i++)
- {
- a = animated_images[i];
- image_identifier = a->images[0][0];
- if ((image_identifier == 3) || (image_identifier == 7))
- {
- _measure_image(a->images[0], &width, &height);
- }
- else
- {
- _measure_image(a->images[a->frame_counter], &width, &height);
- }
- x1 = a->x;
- y1 = a->y;
- x2 = x1 + width - 1;
- y2 = y1 + height - 1;
- a->frame_counter++;
- if (a->frame_counter > a->end_frame)
- {
- a->frame_counter = a->start_frame;
- }
- SWITCH_GRAPHICS_CONTEXT(a->graphics_context, gc_flag);
- gui_reset_clip();
- a->hide_function(x1, y1, x2, y2);
- gui_set_clip(a->clip_x1, a->clip_y1, a->clip_x2, a->clip_y2);
- if ((image_identifier == 3) || (image_identifier == 7))
- {
- if (a->flags & ANIMATED_IMAGE_TRANSPARENT)
- {
- if (_show_transparent_animation_frame(x1, y1, a->images[0], 0, a->frame_counter))
- {
- if (a->n_frames > (a->frame_counter + 1))
- {
- a->n_frames = a->frame_counter + 1;
- if (a->end_frame > (a->n_frames - 1))
- {
- a->end_frame = a->n_frames - 1;
- }
- if (a->frame_counter > a->end_frame)
- {
- a->frame_counter = a->start_frame;
- }
- }
- if (a->last_frame_function != NULL)
- {
- a->last_frame_function();
- }
- }
- else if ((a->n_frames >= 0) && (a->frame_counter >= (a->n_frames - 1)))
- {
- if (a->last_frame_function != NULL)
- {
- a->last_frame_function();
- }
- }
- }
- else
- {
- if (_show_animation_frame(x1, y1, a->images[0], a->frame_counter))
- {
- if (a->n_frames > (a->frame_counter + 1))
- {
- a->n_frames = a->frame_counter + 1;
- if (a->end_frame > (a->n_frames - 1))
- {
- a->end_frame = a->n_frames - 1;
- }
- if (a->frame_counter > a->end_frame)
- {
- a->frame_counter = a->start_frame;
- }
- }
- if (a->last_frame_function != NULL)
- {
- a->last_frame_function();
- }
- }
- else if ((a->n_frames >= 0) && (a->frame_counter >= (a->n_frames - 1)))
- {
- if (a->last_frame_function != NULL)
- {
- a->last_frame_function();
- }
- }
- }
- }
- else
- {
- if (a->flags & ANIMATED_IMAGE_TRANSPARENT)
- {
- _show_transparent_image(x1, y1, (a->images[a->frame_counter]), 0);
- }
- else
- {
- gdi_image_draw(x1, y1, (a->images[a->frame_counter]));
- }
- }
- gui_BLT_double_buffer(x1, y1, x2, y2);
- RESTORE_GRAPHICS_CONTEXT(gc_flag);
- }
- gui_pop_clip();
- gui_start_timer(ANIMATED_IMAGE_FRAME_RATE, _animated_image_processor);
- }
- /* 071205 Calvin removed */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /* 071205 Calvin end */
- /*****************************************************************************
- * FUNCTION
- * mtk_show_animation_frames
- * DESCRIPTION
- * Gets the number of images (frames) in a GIF file
- *
- * !!! FUNCTION IS NOT OPTIMIZED. DECODES THE ENTIRE FILE
- * JUST TO FIND THE NUMBER OF FRAMES !!!
- * PARAMETERS
- * x [IN]
- * y [IN]
- * image [?]
- * start_frame [IN]
- * file(?) [IN] The GIF file in bytestream format
- * total_frames(?) [OUT] Is the number of frames in the GIF.
- * RETURNS
- * 0 if GIF_get_n_frames failed (invalid GIF image)(?)
- * 1 if GIF_get_n_frames is successful(?)
- *****************************************************************************/
- /* Image related procedures for Images stored in memory */
- /* File system storage of images has been discontinued */
- void (*wingui_animation_last_frame_function) (void) = NULL;
- /* Bear 040303 - Fix cant show download gif problem - still adapt to pixtel draw from file */
- void mtk_show_animation_frames(S32 x, S32 y, U8 *image, S32 start_frame)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 image_identifier;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (image == NULL)
- {
- return;
- }
- image_identifier = image[0];
- switch (image_identifier)
- {
- case IMAGE_TYPE_INVALID:
- return; /* not used */
- case IMAGE_TYPE_BMP: /* same as case 2 */
- case IMAGE_TYPE_BMP_SEQUENCE: /* BMP */
- {
- /* MTK added by Bear 030923 for transparent BMP issue */
- _show_transparent_image(x, y, image, 0);
- /* MTK end */
- return;
- }
- case IMAGE_TYPE_GIF: /* GIF */
- {
- gdi_image_draw_animation_frames(x, y, image, NULL, (U16) start_frame);
- }
- break;
- case IMAGE_TYPE_DEVICE_BITMAP:
- case IMAGE_TYPE_DEVICE_BITMAP_SEQUENCE:
- case IMAGE_TYPE_BMP_FILE:
- case IMAGE_TYPE_WBMP_FILE:
- {
- gdi_image_draw(x, y, image);
- return;
- }
- case IMAGE_TYPE_GIF_FILE:
- {
- _show_animation(x, y, image);
- return;
- }
- default:
- break;
- /* assert(0); */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mtk_show_animation
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * image [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mtk_show_animation(S32 x, S32 y, U8 *image)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mtk_show_animation_frames(x, y, image, 0);
- }
- /*****************************************************************************
- * FUNCTION
- * _show_image
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * image [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _show_image(S32 x, S32 y, U8 *image)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Leo add 20040823 */
- gdi_image_draw(x, y, image);
- }
- /*****************************************************************************
- * FUNCTION
- * _show_transparent_image
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * image [?]
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void _show_transparent_image(S32 x, S32 y, U8 *image, UI_transparent_color_type t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* ignore transparent function and treat as normal image */
- gdi_image_draw(x, y, image);
- }
- /*****************************************************************************
- * FUNCTION
- * _show_animation_frame
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * image [?]
- * frame_number [IN]
- * RETURNS
- *
- *****************************************************************************/
- U8 _show_animation_frame(S32 x, S32 y, U8 *image, S16 frame_number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 image_identifier;
- S32 ret;
- /* set active layer to base layer for pixtel's drawing */
- gdi_handle base_handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (image == NULL)
- {
- return (0);
- }
- gdi_layer_get_base_handle(&base_handle);
- gdi_layer_push_and_set_active(base_handle);
- image_identifier = (U8) (image[0]);
- switch (image_identifier)
- {
- case IMAGE_TYPE_INVALID:
- break;
- case IMAGE_TYPE_BMP:
- case IMAGE_TYPE_BMP_SEQUENCE:
- case IMAGE_TYPE_GIF:
- case IMAGE_TYPE_DEVICE_BITMAP:
- case IMAGE_TYPE_DEVICE_BITMAP_SEQUENCE:
- ret = gdi_image_draw_animation_single_frame(x, y, image, (U16) frame_number);
- gdi_layer_pop_and_restore_active();
- if (ret == GDI_IMAGE_SUCCEED)
- {
- return (1);
- }
- else
- {
- return (0);
- }
- }
- /* restore current active layer */
- gdi_layer_pop_and_restore_active();
- return (1);
- }
- /*****************************************************************************
- * FUNCTION
- * _show_transparent_animation_frame
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * image [?]
- * t [IN]
- * frame_number [IN]
- * RETURNS
- *
- *****************************************************************************/
- U8 _show_transparent_animation_frame(S32 x, S32 y, U8 *image, UI_transparent_color_type t, S16 frame_number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* set active layer to base layer for pixtel's drawing */
- gdi_handle base_handle;
- U8 image_identifier;
- S32 ret;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (image == NULL)
- {
- return (0);
- }
- gdi_layer_get_base_handle(&base_handle);
- gdi_layer_push_and_set_active(base_handle);
- image_identifier = (U8) (image[0]);
- switch (image_identifier)
- {
- case IMAGE_TYPE_INVALID:
- gdi_layer_pop_and_restore_active();
- return (0);
- case IMAGE_TYPE_BMP:
- case IMAGE_TYPE_BMP_SEQUENCE:
- case IMAGE_TYPE_GIF:
- case IMAGE_TYPE_DEVICE_BITMAP:
- case IMAGE_TYPE_DEVICE_BITMAP_SEQUENCE:
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__ /* ritesh */
- case IMAGE_TYPE_BMP_FILE_OFFSET:
- case IMAGE_TYPE_GIF_FILE_OFFSET:
- #endif /* __MMI_DOWNLOADABLE_THEMES_SUPPORT__ */ /* ritesh */
- ret = gdi_image_draw_animation_single_frame(x, y, image, (U16) frame_number);
- gdi_layer_pop_and_restore_active();
- if (ret == GDI_IMAGE_SUCCEED)
- {
- return (1);
- }
- else
- {
- return (0);
- }
- }
- /* restore current active layer */
- gdi_layer_pop_and_restore_active();
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * _hide_animations
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void _hide_animations(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j;
- animated_image *a;
- S32 n = n_animated_images;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < n_animated_images; i++)
- {
- a = animated_images[i];
- if (TEST_MAIN_LCD_GRAPHICS_CONTEXT(a->graphics_context))
- {
- gui_free(a);
- for (j = i; j < n_animated_images - 1; j++)
- {
- animated_images[j] = animated_images[j + 1];
- }
- n_animated_images--;
- }
- }
- if ((n > 0) && (n_animated_images <= 0))
- {
- UI_cancel_timer(_animated_image_processor);
- }
- /* MTK00612 Bear */
- /* stop MTK animator timer */
- gdi_image_stop_animation_all();
- }
- /* Character set functions */
- /*****************************************************************************
- * FUNCTION
- * UI_get_next_UCS2_character
- * DESCRIPTION
- *
- * PARAMETERS
- * s [?]
- * RETURNS
- *
- *****************************************************************************/
- UI_character_type UI_get_next_UCS2_character(UI_string_type *s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type c = **s;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- (*s)++;
- return (c);
- }
- /*****************************************************************************
- * FUNCTION
- * UI_get_previous_UCS2_character
- * DESCRIPTION
- *
- * PARAMETERS
- * s [?]
- * RETURNS
- *
- *****************************************************************************/
- UI_character_type UI_get_previous_UCS2_character(UI_string_type *s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type c = **s;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- (*s)--;
- return (c);
- }
- /************************************************************************/
- /* LCD Context Swtich */
- /************************************************************************/
- /* this function will be called by categories */
- /*****************************************************************************
- * FUNCTION
- * UI_test_sub_LCD_graphics_context
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U8 UI_test_sub_LCD_graphics_context(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd_handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_lcd_get_active(&act_lcd_handle);
- if (act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE)
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
- /* UI wrappers to perform graphics context switching */
- /*****************************************************************************
- * FUNCTION
- * UI_set_main_LCD_graphics_context
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_set_main_LCD_graphics_context(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd_handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_lcd_get_active(&act_lcd_handle);
- /* already is Main LCD, do nothing */
- if (act_lcd_handle == GDI_LCD_MAIN_LCD_HANDLE)
- {
- return;
- }
- /* set Main Lcd as active lcd */
- gdi_lcd_set_active(GDI_LCD_MAIN_LCD_HANDLE);
- current_LCD_device_bitmap = &main_LCD_device_bitmap;
- /* init UI golbal var for Main LCD */
- UI_device_width = MAIN_LCD_device_width;
- UI_device_height = MAIN_LCD_device_height;
- UI_clip_x1 = 0;
- UI_clip_x2 = UI_device_width - 1;
- UI_clip_y1 = 0;
- UI_clip_y2 = UI_device_height - 1;
- UI_old_clip_x1 = 0;
- UI_old_clip_y1 = 0;
- UI_old_clip_x2 = UI_device_width - 1;
- UI_old_clip_y2 = UI_device_height - 1;
- UI_text_x = 0;
- UI_text_y = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * UI_set_sub_LCD_graphics_context
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_set_sub_LCD_graphics_context(void)
- {
- #ifdef __MMI_SUBLCD__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gdi_handle act_lcd_handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_lcd_get_active(&act_lcd_handle);
- /* already is Main LCD, do nothing */
- if (act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE)
- {
- return;
- }
- /* set Sub Lcd and active lcd */
- gdi_lcd_set_active(GDI_LCD_SUB_LCD_HANDLE);
- current_LCD_device_bitmap = &sub_LCD_device_bitmap;
- /* init UI golbal var for Sub LCD */
- UI_device_width = SUB_LCD_device_width;
- UI_device_height = SUB_LCD_device_height;
- UI_clip_x1 = 0;
- UI_clip_x2 = SUB_LCD_device_width - 1;
- UI_clip_y1 = 0;
- UI_clip_y2 = SUB_LCD_device_height - 1;
- UI_old_clip_x1 = 0;
- UI_old_clip_y1 = 0;
- UI_old_clip_x2 = SUB_LCD_device_width - 1;
- UI_old_clip_y2 = SUB_LCD_device_height - 1;
- UI_text_x = 0;
- UI_text_y = 0;
- #endif /* __MMI_SUBLCD__ */
- }
- /*****************************************************************************
- * FUNCTION
- * setup_UI_wrappers
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void setup_UI_wrappers(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Setup the main LCD device bitmap */
- /* this is uses some where out side wingui, cant be removed */
- main_LCD_device_bitmap.xsize = MAIN_LCD_device_width;
- main_LCD_device_bitmap.ysize = MAIN_LCD_device_height;
- main_LCD_device_bitmap.color_depth = GDI_MAINLCD_BIT_PER_PIXEL; /* internal use 565 */
- main_LCD_device_bitmap.row_bytes = (MAIN_LCD_device_width * GDI_MAINLCD_BIT_PER_PIXEL) >> 3;
- main_LCD_device_bitmap.palette = NULL;
- #ifdef __MMI_SUBLCD__
- /* Setup the sub LCD device bitmap */
- /* this is uses some where out side wingui, cant be removed */
- sub_LCD_device_bitmap.xsize = SUB_LCD_device_width;
- sub_LCD_device_bitmap.ysize = SUB_LCD_device_height;
- sub_LCD_device_bitmap.color_depth = GDI_SUBLCD_BIT_PER_PIXEL; /* internal use 565 */
- sub_LCD_device_bitmap.row_bytes = (SUB_LCD_device_width * GDI_SUBLCD_BIT_PER_PIXEL) >> 3;
- sub_LCD_device_bitmap.palette = NULL;
- #endif /* __MMI_SUBLCD__ */
- /* init Main LCD first */
- current_LCD_device_bitmap = &main_LCD_device_bitmap;
- /* init UI golbal var for Main LCD */
- UI_device_width = MAIN_LCD_device_width;
- UI_device_height = MAIN_LCD_device_height;
- UI_clip_x1 = 0;
- UI_clip_x2 = UI_device_width - 1;
- UI_clip_y1 = 0;
- UI_clip_y2 = UI_device_height - 1;
- UI_old_clip_x1 = 0;
- UI_old_clip_y1 = 0;
- UI_old_clip_x2 = UI_device_width - 1;
- UI_old_clip_y2 = UI_device_height - 1;
- UI_text_x = 0;
- UI_text_y = 0;
- UI_text_color.alpha = 100;
- UI_text_color.r = 0;
- UI_text_color.g = 0;
- UI_text_color.b = 0;
- /* assign UI function pointers */
- gui_cross_hatch_fill_rectangle = UI_cross_hatch_fill_rectangle;
- gui_hatch_fill_rectangle = UI_hatch_fill_rectangle;
- gui_alternate_cross_hatch_fill_rectangle = UI_alternate_cross_hatch_fill_rectangle;
- gui_alternate_hatch_fill_rectangle = UI_alternate_hatch_fill_rectangle;
- gui_line = UI_line;
- gui_wline = UI_wline;
- gui_set_text_clip = UI_set_text_clip;
- gui_get_text_clip = UI_get_text_clip;
- gui_set_text_clip_preset = UI_set_text_clip_preset;
- gui_set_clip = UI_set_clip;
- gui_set_clip_with_bounding_box = UI_set_clip_with_bounding_box;
- gui_get_clip = UI_get_clip;
- gui_set_clip_preset = UI_set_clip_preset;
- gui_reset_clip = UI_reset_clip;
- gui_reset_text_clip = UI_reset_text_clip;
- gui_move_text_cursor = UI_move_text_cursor;
- gui_set_line_height = UI_set_line_height;
- gui_set_text_color = UI_set_text_color;
- gui_set_text_border_color = UI_set_text_border_color;
- gui_printf = UI_printf;
- gui_sprintf = UI_sprintf;
- gui_print_text = UI_print_text;
- gui_print_bordered_text = UI_print_bordered_text;
- /* MTk Terry Add to support print n characters */
- gui_print_text_n = UI_print_text_n;
- gui_print_bordered_text_n = UI_print_bordered_text_n;
- /* MTK end */
- gui_print_character = UI_print_character;
- /* MTK Elvis for stacked characters */
- gui_print_stacked_character = UI_print_stacked_character;
- gui_print_bordered_stacked_character = UI_print_bordered_stacked_character;
- /* MTK end */
- gui_print_bordered_character = UI_print_bordered_character;
- gui_push_text_clip = UI_push_text_clip;
- gui_pop_text_clip = UI_pop_text_clip;
- gui_push_clip = UI_push_clip;
- gui_pop_clip = UI_pop_clip;
- gui_malloc = UI_malloc;
- gui_free = UI_free;
- gui_get_character_width = UI_get_character_width;
- gui_get_character_height = UI_get_character_height;
- gui_measure_character = UI_measure_character;
- gui_get_string_width = UI_get_string_width;
- gui_get_string_width_n = UI_get_string_width_n;
- gui_get_string_width_w = UI_get_string_width_w;
- gui_get_string_width_wn = UI_get_string_width_wn;
- gui_get_string_height = UI_get_string_height;
- gui_measure_string = UI_measure_string;
- gui_measure_string_n = UI_measure_string_n;
- gui_measure_string_w = UI_measure_string_w;
- gui_measure_string_wn = UI_measure_string_wn;
- gui_strlen = UI_strlen;
- gui_strcpy = UI_strcpy;
- gui_strncpy = UI_strncpy;
- gui_strcmp = UI_strcmp;
- gui_strncmp = UI_strncmp;
- gui_strcat = UI_strcat;
- gui_itoa = UI_itoa;
- gui_atoi = UI_atoi;
- gui_set_font = UI_set_font;
- // gui_show_animated_image = _show_animation;
- // gui_show_transparent_animated_image = _show_transparent_animation;
- // gui_show_transparent_animated_image_frames= _show_transparent_animation_frames;//071205 Calvin removed
- gui_measure_image = _measure_image;
- gui_start_timer = UI_start_timer;
- gui_cancel_timer = UI_cancel_timer;
- gui_transparent_color = UI_transparent_color;
- gui_color = UI_color;
- gui_color32 = UI_color32;
- gui_color_RGB = UI_color_RGB;
- gui_image_n_frames = UI_get_image_n_frames;
- gui_memcpy = UI_memcpy;
- gui_get_next_character = UI_get_next_UCS2_character;
- gui_get_previous_character = UI_get_previous_UCS2_character;
- gui_putpixel = UI_putpixel;
- gui_draw_vertical_line = UI_draw_vertical_line;
- gui_draw_horizontal_line = UI_draw_horizontal_line;
- gui_fill_rectangle = UI_fill_rectangle;
- gui_draw_rectangle = UI_draw_rectangle;
- gui_hide_animations = _hide_animations;
- gui_show_image = _show_image;
- gui_show_transparent_image = _show_transparent_image;
- gui_show_animated_image_frame = _show_animation_frame;
- gui_show_transparent_animated_image_frame = _show_transparent_animation_frame;
- gui_lock_double_buffer = UI_lock_double_buffer;
- gui_unlock_double_buffer = UI_unlock_double_buffer;
- gui_BLT_double_buffer = UI_BLT_double_buffer;
- /* Bear 040227 - init gui golbal variable */
- /* declare at wgui.c */
- MMI_status_bar_height = MMI_STATUS_BAR_HEIGHT;
- #ifdef __MMI_SCREEN_ROTATE__
- /*
- * NOTE: not all basic definitions of UI components has rotated value
- * because we do not support rotation of all category screens in current design.
- */
- if (mmi_frm_is_screen_width_height_swapped())
- {
- MMI_content_x = MMI_ROTATED_CONTENT_X;
- MMI_content_y = MMI_ROTATED_CONTENT_Y;
- MMI_content_height = MMI_ROTATED_CONTENT_HEIGHT;
- MMI_content_width = MMI_ROTATED_CONTENT_WIDTH;
- }
- else
- #endif /* __MMI_SCREEN_ROTATE__ */
- {
- MMI_content_x = MMI_CONTENT_X;
- MMI_content_y = MMI_CONTENT_Y;
- MMI_content_height = MMI_CONTENT_HEIGHT;
- MMI_content_width = MMI_CONTENT_WIDTH;
- }
- /* declare at wgui_categories.c */
- MMI_matrix_bar_height = MMI_MATRIX_BAR_HEIGHT;
- MMI_matrix_bar_x = MMI_MATRIX_BAR_X;
- MMI_matrix_bar_y = MMI_MATRIX_BAR_Y;
- MMI_matrix_bar_width = MMI_MATRIX_BAR_WIDTH;
- #ifdef __MMI_SCREEN_ROTATE__
- if (mmi_frm_is_screen_width_height_swapped())
- {
- MMI_title_height = MMI_ROTATED_TITLE_HEIGHT;
- MMI_title_width = MMI_ROTATED_TITLE_WIDTH;
- MMI_title_x = MMI_ROTATED_TITLE_X;
- MMI_title_y = MMI_ROTATED_TITLE_Y;
- }
- else
- #endif /* __MMI_SCREEN_ROTATE__ */
- {
- MMI_title_height = MMI_TITLE_HEIGHT;
- MMI_title_width = MMI_TITLE_WIDTH;
- MMI_title_x = MMI_TITLE_X;
- MMI_title_y = MMI_TITLE_Y;
- }
- MMI_button_bar_height = MMI_BUTTON_BAR_HEIGHT;
- #ifdef __MMI_SCREEN_ROTATE__
- if (mmi_frm_is_screen_width_height_swapped())
- {
- MMI_pop_up_dialog_x = MMI_ROTATED_POP_UP_DIALOG_X;
- MMI_pop_up_dialog_y = MMI_ROTATED_POP_UP_DIALOG_Y;
- MMI_pop_up_dialog_width = MMI_ROTATED_POP_UP_DIALOG_WIDTH;
- MMI_pop_up_dialog_height = MMI_ROTATED_POP_UP_DIALOG_HEIGHT;
- MMI_pop_up_dialog_full_height = MMI_ROTATED_POP_UP_DIALOG_FULL_HEIGHT;
- }
- else
- #endif /* __MMI_SCREEN_ROTATE__ */
- {
- MMI_pop_up_dialog_x = MMI_POP_UP_DIALOG_X;
- MMI_pop_up_dialog_y = MMI_POP_UP_DIALOG_Y;
- MMI_pop_up_dialog_width = MMI_POP_UP_DIALOG_WIDTH;
- MMI_pop_up_dialog_height = MMI_POP_UP_DIALOG_HEIGHT;
- MMI_pop_up_dialog_full_height = MMI_POP_UP_DIALOG_FULL_HEIGHT;
- }
- /* declare at wgui_inputs.c */
- MMI_multitap_x = MMI_MULTITAP_X;
- MMI_multitap_y = MMI_MULTITAP_Y;
- MMI_multitap_width = MMI_MULTITAP_WIDTH;
- MMI_multitap_height = MMI_MULTITAP_HEIGHT;
- MMI_singleline_inputbox_x = MMI_SINGLELINE_INPUTBOX_X;
- MMI_singleline_inputbox_y = MMI_SINGLELINE_INPUTBOX_Y;
- MMI_singleline_inputbox_width = MMI_SINGLELINE_INPUTBOX_WIDTH;
- MMI_singleline_inputbox_height = MMI_SINGLELINE_INPUTBOX_HEIGHT;
- MMI_multiline_inputbox_x = MMI_MULTILINE_INPUTBOX_X;
- MMI_multiline_inputbox_y = MMI_MULTILINE_INPUTBOX_Y;
- MMI_multiline_inputbox_width = MMI_MULTILINE_INPUTBOX_WIDTH;
- MMI_multiline_inputbox_height = MMI_MULTILINE_INPUTBOX_HEIGHT;
- MMI_general_inputbox_x = MMI_GENERAL_INPUTBOX_X;
- MMI_general_inputbox_y = MMI_GENERAL_INPUTBOX_Y;
- MMI_general_inputbox_width = MMI_GENERAL_INPUTBOX_WIDTH;
- MMI_general_inputbox_height = MMI_GENERAL_INPUTBOX_HEIGHT;
- MMI_menuitem_height = MMI_MENUITEM_HEIGHT;
- /* declare at wgui_status_icons.h */
- MMI_status_icon_bars[0].x = 0; /* x */
- MMI_status_icon_bars[0].y = 0; /* y */
- MMI_status_icon_bars[0].flags = 0; /* FLAGS */
- MMI_status_icon_bars[0].x1 = 0; /* x1 */
- MMI_status_icon_bars[0].y1 = 0; /* y1 */
- MMI_status_icon_bars[0].x2 = UI_device_width - 1; /* x2 */
- MMI_status_icon_bars[0].y2 = MMI_STATUS_BAR_HEIGHT - 1; /* y2 */
- MMI_status_icon_bars[0].group_ID = 0; /* GROUP */
- MMI_status_icon_bars[0].n_icons = 0; /* N_ICONS */
- MMI_status_icon_bars[0].icon_list = MMI_status_icons_list1; /* ICON_LIST */
- MMI_status_icon_bars[0].graphics_context = &main_LCD_device_bitmap; /* LCD CONTEXT */
- MMI_status_icon_bars[0].layer_buffer= NULL; /* LAYER BUFFER */ //061506 double buffer
- MMI_status_icon_bars[0].layer_handle= GDI_ERROR_HANDLE; /* LAYER HANDLE */ //061506 double buffer
- MMI_status_icon_bars[1].x = UI_device_width - 17; /* x */
- MMI_status_icon_bars[1].y = 16; /* y */
- MMI_status_icon_bars[1].flags = 0; /* FLAGS */
- MMI_status_icon_bars[1].x1 = UI_device_width - 18; /* x1 */
- MMI_status_icon_bars[1].y1 = 16; /* y1 */
- MMI_status_icon_bars[1].x2 = UI_device_width - 1; /* x2 */
- MMI_status_icon_bars[1].y2 = 80; /* y2 */
- MMI_status_icon_bars[1].group_ID = 0; /* GROUP */
- MMI_status_icon_bars[1].n_icons = 0; /* N_ICONS */
- MMI_status_icon_bars[1].icon_list = MMI_status_icons_list2; /* ICON_LIST */
- MMI_status_icon_bars[1].graphics_context = &main_LCD_device_bitmap; /* LCD CONTEXT */
- MMI_status_icon_bars[1].layer_buffer= NULL; /* LAYER BUFFER */ //061506 double buffer
- MMI_status_icon_bars[1].layer_handle= GDI_ERROR_HANDLE; /* LAYER HANDLE */ //061506 double buffer
- MMI_status_icon_bars[2].x = 0; /* x */
- MMI_status_icon_bars[2].y = 0; /* y */
- MMI_status_icon_bars[2].flags = 0; /* FLAGS */
- MMI_status_icon_bars[2].x1 = 0; /* x1 */
- MMI_status_icon_bars[2].y1 = 0; /* y1 */
- MMI_status_icon_bars[2].x2 = 48 - 1; /* x2 */
- MMI_status_icon_bars[2].y2 = 14; /* y2 */
- MMI_status_icon_bars[2].group_ID = 0; /* GROUP */
- MMI_status_icon_bars[2].n_icons = 0; /* N_ICONS */
- MMI_status_icon_bars[2].icon_list = MMI_status_icons_list3; /* ICON_LIST */
- MMI_status_icon_bars[2].graphics_context = &sub_LCD_device_bitmap; /* LCD CONTEXT */
- MMI_status_icon_bars[2].layer_buffer= NULL; /* LAYER BUFFER */ //061506 double buffer
- MMI_status_icon_bars[2].layer_handle= GDI_ERROR_HANDLE; /* LAYER HANDLE */ //061506 double buffer
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
- pixtel_shuffle_draw_background = shuffle_draw_white; /* Common background filler */
- #endif
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- line_draw = 1;
- inline_bottom_line_draw = 0;
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- /* PMT VIKAS END 20050707 */
- }
- /*****************************************************************************
- * FUNCTION
- * InitDebugPrint
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitDebugPrint(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static BOOL is_debug_print_init = FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!is_debug_print_init)
- {
- gdi_handle base_handle;
- /* init graphic library. including lcd and all drawing related modules */
- gdi_init();
- setup_UI_wrappers();
- gdi_layer_get_base_handle(&base_handle);
- gdi_layer_set_active(base_handle);
- gdi_layer_clear(GDI_COLOR_WHITE);
- gdi_layer_reset_clip();
- gdi_layer_reset_text_clip();
- is_debug_print_init = TRUE;
- }
- }
- extern U32 ShowDebugString(S32 x, S32 y, stFontAttribute Font, U8 *String, S32 len, U32 LineHeight, U32 Bordered);
- /*****************************************************************************
- * FUNCTION
- * DebugPrint
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * s [?]
- * RETURNS
- * void
- *****************************************************************************/
- void DebugPrint(U8 x, U8 y, S8 *s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #define DEBUG_CHAR_COUNT (256)
- S8 buffer[(DEBUG_CHAR_COUNT + 1) * ENCODING_LENGTH];
- stFontAttribute debug_font = {0, 0, 0, SMALL_FONT, 0, 0};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef MMI_ON_HARDWARE_P
- custom_cfg_gpio_set_level(GPIO_DEV_LED_MAINLCD, LED_LIGHT_LEVEL5);
- #endif
- InitDebugPrint();
- /* flattern all layer content to base layer */
- gdi_layer_flatten_previous_to_base();
- /* set base layer as active layer */
- gdi_layer_set_active(GDI_LAYER_MAIN_BASE_LAYER_HANDLE);
-
- /* init font setting */
- UI_set_font(&debug_font);
- UI_set_text_color(UI_color(0, 0, 0));
- UI_set_text_border_color(UI_color(255, 255, 255));
- memset(buffer, 0, (DEBUG_CHAR_COUNT + 1) * ENCODING_LENGTH);
- AnsiiNToUnicodeString((PS8) buffer, s, DEBUG_CHAR_COUNT);
- UI_move_text_cursor(x, y);
- /* UI_print_text((UI_string_type)buffer); */
- UI_set_current_text_color(UI_text_color);
- ShowDebugString(UI_text_x, UI_text_y, *UI_font, (U8*) buffer, -1, UI_text_height, 1);
- gdi_layer_debug_blt();
- }
- #ifdef MMI_ON_HARDWARE_P
- /*****************************************************************************
- * FUNCTION
- * MMISWChangeWarning
- * DESCRIPTION
- *
- * PARAMETERS
- * type [IN]
- * space [IN]
- * codeversion [IN]
- * diskversion [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void MMISWChangeWarning(kal_uint8 type, kal_uint32 space, kal_uint8 const *codeversion, kal_uint8 const *diskversion)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
- kal_uint8 dspl_text[80];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- InitDebugPrint();
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "SW Change:n");
- DebugPrint(0, 10, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, " From: %sn", diskversion);
- DebugPrint(0, 20, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, " To: %sn", codeversion);
- DebugPrint(0, 30, (S8*) dspl_text);
- if (type == 0)
- {
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "Err: Lack of space:n");
- DebugPrint(0, 40, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, " %d bytes needed.n", space);
- DebugPrint(0, 50, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "Fix:Delete from USER.n");
- DebugPrint(0, 60, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "SW Change aborted.n");
- DebugPrint(0, 70, (S8*) dspl_text);
- }
- else
- {
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "Err: Critical changes.n");
- DebugPrint(0, 40, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "Fix:Backup please.n");
- DebugPrint(0, 50, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "SW change aborted.n");
- DebugPrint(0, 60, (S8*) dspl_text);
- }
- #endif /* !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI) */
- }
- #endif /* MMI_ON_HARDWARE_P */
- /* MTK modified by Lisen 11/30/2003 */
- #ifdef MMI_ON_HARDWARE_P
- /*****************************************************************************
- * FUNCTION
- * MMIResourceMismatchWarning
- * DESCRIPTION
- *
- * PARAMETERS
- * errType [IN]
- * errResType [IN]
- * codeversion [IN]
- * resversion [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void MMIResourceMismatchWarning(
- kal_int8 errType,
- kal_int8 errResType,
- kal_uint8 const *codeversion,
- kal_uint8 const *resversion)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
- kal_uint8 dspl_text[80];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- InitDebugPrint();
- if (errType < 0)
- {
- return;
- }
- if (errResType == 0)
- {
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "Err: AUDIO Ver:n");
- DebugPrint(0, 10, (S8*) dspl_text);
- }
- else if (errResType == 1)
- {
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "Err: IMAGE Ver:n");
- DebugPrint(0, 10, (S8*) dspl_text);
- }
- else if (errResType == 2)
- {
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "Err: FONT Ver:n");
- DebugPrint(0, 10, (S8*) dspl_text);
- }
- else
- {
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, "Err: Res Ver:n");
- DebugPrint(0, 10, (S8*) dspl_text);
- }
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, " %sn", resversion);
- DebugPrint(0, 20, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, " Expected ver#:n");
- DebugPrint(0, 40, (S8*) dspl_text);
- kal_mem_set(dspl_text, ' ', sizeof(dspl_text));
- sprintf((char*)dspl_text, " %sn", codeversion);
- DebugPrint(0, 50, (S8*) dspl_text);
- while (1);
- #endif /* !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI) */
- }
- #endif /* MMI_ON_HARDWARE_P */
- /* MTK end */
- /*****************************************************************************
- * FUNCTION
- * MMIGetGDIShowFullScreenTime
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- kal_uint32 MMIGetGDIShowFullScreenTime(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
-
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return gdi_image_estimate_show_fullscreen_time();
- #else
- return 0;
- #endif /* !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI) */
- }
- /* Scan disk and display first logo image */
- /*****************************************************************************
- * FUNCTION
- * MMICheckDiskDisplay
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void MMICheckDiskDisplay(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
- S32 height, width;
- S32 x, y;
- S32 UI_device_width = LCD_WIDTH;
- S32 UI_device_height = LCD_HEIGHT;
- static U8 PicHasBeenShown = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 5/1/2004 Lisen Added to avoid screen flash when it is called for several times */
- if (PicHasBeenShown == 0)
- {
- PicHasBeenShown = 1;
- }
- else
- {
- return;
- }
- /* init graphic library. including lcd and all drawing related modules */
- gdi_init();
-
- #if defined(__MMI_RESOURCE_ENFB_SUPPORT__)
- /*
- * Init Resource Memory Manamger for E-NFB
- */
- mmi_frm_resmem_init();
- #endif /* __MMI_RESOURCE_ENFB_SUPPORT__ */
-
- InitDebugPrint();
- gdi_image_get_dimension_id(IMG_BOOTUP_SCANNING_LOGO, &width, &height);
- if (width > UI_device_width)
- {
- x = 0;
- }
- else
- {
- x = (UI_device_width >> 1) - (width >> 1);
- }
- if (height > UI_device_height)
- {
- y = 0;
- }
- else
- {
- y = (UI_device_height >> 1) - (height >> 1);
- }
- gdi_layer_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
- gdi_layer_clear(GDI_COLOR_BLACK);
- gdi_image_draw_id(x, y, IMG_BOOTUP_SCANNING_LOGO);
- gdi_layer_blt(GDI_LAYER_MAIN_BASE_LAYER_HANDLE, 0, 0, 0, 0, 0, UI_device_width - 1, UI_device_height - 1);
- #ifdef MMI_ON_HARDWARE_P
- custom_cfg_gpio_set_level(GPIO_DEV_LED_MAINLCD, LED_LIGHT_LEVEL5);
- #endif
- #endif /* !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI) */
- #endif /* MMI_ON_HARDWARE_P */
- }
- /* MTK end */
- /* added for BkLight Simulation */
- #ifdef MMI_ON_WIN32
- /*****************************************************************************
- * FUNCTION
- * simulate_lcd_bklight_turn_off
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void simulate_lcd_bklight_turn_off()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * simulate_sublcd_bklight_turn_off
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void simulate_sublcd_bklight_turn_off()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * simulate_lcd_bklight_turn_on
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void simulate_lcd_bklight_turn_on()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * simulate_sublcd_bklight_turn_on
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void simulate_sublcd_bklight_turn_on()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- #endif /* MMI_ON_WIN32 */ /* MMI_ON_WIN32//BkLight SImulation Code */
- /* PMT VIKAS START 20050518 */
- /******** Transparency Code *********************/
- //Added for transparency effect
- // It will take opacity value in calculation.
- /* PMT VIKAS START 20051217 */
- #if defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__) || defined (__MMI_UI_TRANSPARENT_EFFECT_IN_DALMATIAN_CALENDAR__) /* 072505 Calvin modified */
- gdi_handle non_default_layer = GDI_LAYER_EMPTY_HANDLE;
- /*****************************************************************************
- * FUNCTION
- * gui_set_transparent_source_layer
- * DESCRIPTION
- *
- * PARAMETERS
- * layer [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_transparent_source_layer(gdi_handle layer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- non_default_layer = layer;
- }
- /* 110705 WAP menu Calvin Start */
- /*****************************************************************************
- * FUNCTION
- * gui_get_transparent_source_layer
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- gdi_handle gui_get_transparent_source_layer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return non_default_layer;
- }
- /* 110705 WAP menu Calvin End */
- /*****************************************************************************
- * FUNCTION
- * gui_reset_transparent_source_layer
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_reset_transparent_source_layer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- non_default_layer = GDI_LAYER_EMPTY_HANDLE;
- }
- /* PMT VIKAS START 20050630 */
- /*****************************************************************************
- * FUNCTION
- * gui_is_current_transparency_with_multi_layer
- * DESCRIPTION
- * This function returns if multilayer is enabled in transparency effect
- * PARAMETERS
- * void
- * RETURNS
- * TRUE/FALSE
- *****************************************************************************/
- S32 gui_is_current_transparency_with_multi_layer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (non_default_layer == GDI_LAYER_EMPTY_HANDLE) ? 0 : 1;
- }
- /* PMT VIKAS END 20050630 */
- /*****************************************************************************
- * FUNCTION
- * gui_fill_transparent_color
- * DESCRIPTION
- * Fill the transparent color rectangle
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * c [IN]
- * start(?) [IN] X, start y, end x, end y, color value
- * RETURNS
- * void
- *****************************************************************************/
- void gui_fill_transparent_color(S32 x1, S32 y1, S32 x2, S32 y2, color c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 alpha = ((U32) c.alpha) * 255 / 100;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (non_default_layer != GDI_LAYER_EMPTY_HANDLE)
- {
- gdi_effect_alpha_blending_rect(non_default_layer, x1, y1, x2, y2, alpha, c.r, c.g, c.b);
- }
- else
- {
- gdi_handle active_layer;
- gdi_layer_get_active(&active_layer);
- gdi_effect_alpha_blending_rect(active_layer, x1, y1, x2, y2, alpha, c.r, c.g, c.b);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_transparent_color_filler
- * DESCRIPTION
- * Choose the color filler
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * c [IN]
- * start(?) [IN] X, start y, end x, end y, color value
- * RETURNS
- * void
- *****************************************************************************/
- void gui_transparent_color_filler(S32 x1, S32 y1, S32 x2, S32 y2, color c)
- {
- #ifdef __MMI_SUBLCD__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 alpha_value;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GDI_LCD->act_handle != GDI_LCD_MAIN_LCD_HANDLE)
- {
- alpha_value = ((c.alpha) << 8) / 100;
- if (256 == alpha_value)
- {
- alpha_value = 255;
- }
- gdi_draw_solid_rect(x1, y1, x2, y2, gdi_act_color_from_rgb(alpha_value, c.r, c.g, c.b));
- }
- else
- #endif /* __MMI_SUBLCD__ */
- {
- /* 070306 Alpha layer Start */
- #if __MMI_MAIN_BASE_LAYER_FORMAT__ == GDI_COLOR_FORMAT_32
- U32 alpha_value;
-
- alpha_value = ((c.alpha) << 8) / 100;
- if (256 == alpha_value)
- {
- alpha_value = 255;
- }
- gdi_draw_solid_rect(x1, y1, x2, y2, gdi_act_color_from_rgb(alpha_value, c.r, c.g, c.b));
- #else
- gui_fill_transparent_color(x1, y1, x2, y2, c);
- #endif
- /* 070306 Alpha layer End */
- }
- }
- #endif /* defined (__MMI_UI_TRANSPARENT_EFFECT__) || defined (__MMI_UI_LIST_HIGHLIGHT_EFFECTS__) || defined (__MMI_UI_TRANSPARENT_EFFECT_IN_DALMATIAN_CALENDAR__) */
- /* PMT VIKAS END */