⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wgui_fixed_menus.c

📁 详细介绍MTK平台图层运用的好东西
💻 C
📖 第 1 页 / 共 5 页
字号:

#if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))


/*****************************************************************************
 * FUNCTION
 *  wgui_fixed_list_menu_end_frame
 * DESCRIPTION
 *  Show the fixed list for the last frame.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void wgui_fixed_list_menu_end_frame(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (wgui_fixed_list_menu_frame_counter >= 1)
    {
        if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
        {
            _MMI_hide_fixed_list_menu();
        }
        gui_hide_animations();
        gui_lock_double_buffer();
        gui_show_fixed_list_menu(&MMI_fixed_list_menu);
        wgui_display_fixed_text_list_pop_up_description();
        gui_unlock_double_buffer();
        gui_BLT_double_buffer(
            MMI_fixed_list_menu.x,
            MMI_fixed_list_menu.y,
            MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
            MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
        wgui_fixed_list_menu_frame_counter = 0;
        gui_start_timer(UI_FRAME_SKIP_TIMEOUT, wgui_fixed_list_menu_end_frame);
    }
}

#endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */ 


/*****************************************************************************
 * FUNCTION
 *  redraw_fixed_list
 * DESCRIPTION
 *  Redraw the fixed list.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void redraw_fixed_list(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    gdi_handle act_lcd;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (MMI_current_menu_type == ANI_BG_LIST_MENU)
    {
        return;
    }

    gdi_lcd_get_active(&act_lcd);
    gdi_lcd_set_active(MMI_fixed_list_menu.act_lcd_handle);
    gdi_layer_push_and_set_active(MMI_fixed_list_menu.act_layer_handle);

#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
    gui_stop_list_highlight_effect();
#endif 

    if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
    {
        gdi_layer_lock_frame_buffer();
        if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
        {
            _MMI_hide_fixed_list_menu();
        }
        gui_show_fixed_list_menu(&MMI_fixed_list_menu);
        wgui_display_fixed_text_list_pop_up_description();
        gdi_layer_unlock_frame_buffer();
        gdi_layer_blt_previous(
            MMI_fixed_list_menu.x,
            MMI_fixed_list_menu.y,
            MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
            MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);
    }
    else
    {
    #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING))
        if (wgui_fixed_list_menu_frame_counter > 0)
        {
            wgui_fixed_list_menu_frame_counter++;
            gui_show_fixed_list_menu_no_draw(&MMI_fixed_list_menu);
        }
        else
        {
            wgui_fixed_list_menu_frame_counter = 1;
            gui_show_fixed_list_menu_no_draw(&MMI_fixed_list_menu);
            gui_start_timer(UI_FRAME_START_TIMEOUT, wgui_fixed_list_menu_end_frame);
        }
    #else /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */ 
        gdi_layer_lock_frame_buffer();

        if (MMI_fixed_list_menu.flags & UI_LIST_MENU_DISABLE_BACKGROUND)
        {
            _MMI_hide_fixed_list_menu();
        }
        gui_show_fixed_list_menu(&MMI_fixed_list_menu);
        wgui_display_fixed_text_list_pop_up_description();

        gdi_layer_unlock_frame_buffer();

    #ifdef __MMI_UI_LIST_TRANSITION__
    #if(LIST_TRANSITION_STYLE_NON_BLOCKING)
        if (get_list_transition() == WGUI_TRANSITION_T2D && is_in_nonblocking_list_transition() == 1)
        {
            gdi_layer_blt_previous(
                MMI_fixed_list_menu.x,
                g_prev_list_y,
                MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
                g_prev_list_y + g_prev_list_height - 1);
        }
        else
    #endif /* (LIST_TRANSITION_STYLE_NON_BLOCKING) */ 
    #endif /* __MMI_UI_LIST_TRANSITION__ */ 
            gdi_layer_blt_previous(
                MMI_fixed_list_menu.x,
                MMI_fixed_list_menu.y,
                MMI_fixed_list_menu.x + MMI_fixed_list_menu.width,
                MMI_fixed_list_menu.y + MMI_fixed_list_menu.height);

    #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_LIST_MENU_FRAME_SKIPPING)) */ 
        gdi_layer_pop_and_restore_active();
        gdi_lcd_set_active(act_lcd);
    }
}


/*****************************************************************************
 * FUNCTION
 *  clear_fixed_list_highlight_handler
 * DESCRIPTION
 *  Clear the highlight handler of the fixed list.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void clear_fixed_list_highlight_handler(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_fixed_list_menu.item_highlighted = dummy_highlight_handler;
}

#ifdef __T5650__
//wangzhk 2009.02.15
#define MAIN_MENU_RECT_Y	73
#define MAIN_MENU_ICON_Y	128
#define MAIN_MENU_ICON_LIMIT_X 56
#define MAIN_MENU_ICON_Y_OFFSET 20
#define MAIN_MENU_ICON_LEFT_START_X -119//-72
#define MAIN_MENU_ICON_RIGHT_START_X 312

S32 previous_item = 0;
S32 next_item = 0;
extern BOOL item_falg;
extern S32 page_item_index;
static U8 gui_move_previous_or_next_time;
static void (*gui_move_previous_or_next_item) (void);

void gui_goto_item_callback(void (*f) (void))
{
	gui_move_previous_or_next_item = f;
}

void gui_icon_move_left_to_right_in(void)
{
       BOOL restart_flag = FALSE;
	GDI_HANDLE layer = dm_get_layer_handle(1);
	
	S32 x1,y1,x2,y2;
	S32 limit_x = 0;
	S32 off_x = 25;
	S32 i;
	S32 icon_w, icon_h;
	
	fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;

	fixed_icontext_menuitem_type *mi = (MMI_fixed_list_menu.highlighted_item==0)?(fixed_icontext_menuitem_type*) MMI_fixed_list_menu.items[MMI_fixed_list_menu.n_items-1]:(fixed_icontext_menuitem_type*) MMI_fixed_list_menu.items[previous_item];

	
	x1 = 0;
	x2 = UI_device_width - 1;
	y1 = MAIN_MENU_RECT_Y+2;
	y2 = MAIN_MENU_RECT_Y+MAIN_MENU_ICON_Y+2;

	gui_cancel_timer(gui_icon_move_left_to_right_in);
	
	//gui_measure_image(mi->item_icon,&icon_w,&icon_h);

	limit_x = MAIN_MENU_ICON_LIMIT_X;//(UI_device_width - icon_w)/2; 
	kal_prompt_trace(MOD_UEM,"gui_icon_move_left_to_right_in::previous_item==%d",previous_item);
	kal_prompt_trace(MOD_UEM,"gui_icon_move_left_to_right_in::highlighted_item==%d",MMI_fixed_list_menu.highlighted_item);


#if(UI_DOUBLE_BUFFER_SUPPORT)
	gui_lock_double_buffer();
#endif
	
	gdi_layer_push_and_set_active(layer);		
	gdi_layer_push_clip();
	gdi_layer_set_clip(x1,y1,x2,y2);
	m->icon_x += off_x;

	if (m->icon_x < limit_x)
	{
		restart_flag = TRUE;
		gdi_draw_solid_rect(x1,y1,x2,y2, GDI_COLOR_TRANSPARENT);

		kal_prompt_trace(MOD_UEM,"gui_icon_move_left_to_right_in::m->icon_x++%d",m->icon_x);


		gdi_image_draw_animation_single_frame(m->icon_x, m->icon_y+20, (U8*) mi->item_icon, 0);
		
	}

	gdi_layer_pop_clip();
	
	gdi_layer_pop_and_restore_active();

#if(UI_DOUBLE_BUFFER_SUPPORT)
	gui_unlock_double_buffer();
	gui_BLT_double_buffer(x1,y1,x2,y2);
#endif	

	
	if (restart_flag == TRUE)
	{
		gui_start_timer(10, gui_icon_move_left_to_right_in);
	}
	else
	{
		gui_move_previous_or_next_item();
	}
	
}
void gui_icon_move_left_to_right_out(void)
{
       BOOL restart_flag = FALSE;
	 
	GDI_HANDLE layer = dm_get_layer_handle(1);
	S32 x1,y1,x2,y2;
	S32 limit_x = 0;
	S32 off_x = 25;
	S32 icon_w, icon_h;
	fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;
	fixed_icontext_menuitem_type *pi =(fixed_icontext_menuitem_type*) MMI_fixed_list_menu.items[MMI_fixed_list_menu.highlighted_item];

	x1 = 0;
	x2 = UI_device_width - 1;
	y1 = MAIN_MENU_RECT_Y+2;
	y2 = MAIN_MENU_RECT_Y+MAIN_MENU_ICON_Y+2;

	gui_cancel_timer(gui_icon_move_left_to_right_out);
	
	//gui_measure_image(pi->item_icon,&icon_w,&icon_h);

	limit_x = UI_device_width; 
	
#if(UI_DOUBLE_BUFFER_SUPPORT)
	gui_lock_double_buffer();
#endif
kal_prompt_trace(MOD_UEM,"gui_icon_move_left_to_right_out::previous_item==%d",previous_item);
kal_prompt_trace(MOD_UEM,"gui_icon_move_left_to_right_out::m->icon_x==%d",m->icon_x);

	gdi_layer_push_and_set_active(layer);		
	gdi_layer_push_clip();
	gdi_layer_set_clip(x1,y1,x2,y2);
	gdi_draw_solid_rect(x1,y1,x2,y2, GDI_COLOR_TRANSPARENT);
	m->icon_x += off_x;
	
	kal_prompt_trace(MOD_UEM,"gui_icon_move_left_to_right_out::highlighted_item==%d",MMI_fixed_list_menu.highlighted_item);


	if (m->icon_x < limit_x)
	{
		restart_flag = TRUE;	
		//gdi_draw_solid_rect(x1,y1,x2,y2, GDI_COLOR_TRANSPARENT);

		kal_prompt_trace(MOD_UEM,"gui_icon_move_left_to_right_out::m->icon_x++%d",m->icon_x);

		gdi_image_draw_animation_single_frame(m->icon_x, m->icon_y+20, (U8*) pi->item_icon, 0);
		
	}
	gdi_layer_pop_clip();
	
	gdi_layer_pop_and_restore_active();

#if(UI_DOUBLE_BUFFER_SUPPORT)
	gui_unlock_double_buffer();
	gui_BLT_double_buffer(x1,y1,x2,y2);
#endif	

	
	if (restart_flag == TRUE)
	{
		gui_start_timer(10, gui_icon_move_left_to_right_out);
	}
	else
	{
		m->icon_x = MAIN_MENU_ICON_LEFT_START_X;
		gui_icon_move_left_to_right_in();
	}
	
}

void gui_icon_move_right_to_left_in(void)
{
       BOOL restart_flag = FALSE;

	GDI_HANDLE layer = dm_get_layer_handle(1);
	S32 x1,y1,x2,y2;
	S32 limit_x = 0;
	S32 off_x = 25;
	S32 icon_w, icon_h;
	fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;

	fixed_icontext_menuitem_type *mi =(MMI_fixed_list_menu.highlighted_item == 11)?((fixed_icontext_menuitem_type*) MMI_fixed_list_menu.items[MMI_fixed_list_menu.n_items-12]):((fixed_icontext_menuitem_type*) MMI_fixed_list_menu.items[next_item]);
	
	
	x1 = 0;
	x2 = UI_device_width - 1;
	y1 = MAIN_MENU_RECT_Y+2;
	y2 = MAIN_MENU_RECT_Y+MAIN_MENU_ICON_Y+2;

	gui_cancel_timer(gui_icon_move_right_to_left_in);
	
	//gui_measure_image(mi->item_icon,&icon_w,&icon_h);

	limit_x = MAIN_MENU_ICON_LIMIT_X;//(UI_device_width - icon_w)/2; 
	
	kal_prompt_trace(MOD_UEM,"gui_icon_move_right_to_left_in::next_item==%d",next_item);

	kal_prompt_trace(MOD_UEM,"gui_icon_move_right_to_left_in::highlighted_item==%d",MMI_fixed_list_menu.highlighted_item);

#if(UI_DOUBLE_BUFFER_SUPPORT)
	gui_lock_double_buffer();
#endif
	
	gdi_layer_push_and_set_active(layer);		
	gdi_layer_push_clip();
	gdi_layer_set_clip(x1,y1,x2,y2);

	m->icon_x -= off_x;
	

	if (m->icon_x > limit_x)
	{
		restart_flag = TRUE;
		gdi_draw_solid_rect(x1,y1,x2,y2, GDI_COLOR_TRANSPARENT);

		kal_prompt_trace(MOD_UEM,"gui_icon_move_right_to_left_in::m->icon_x++%d",m->icon_x);

		gdi_image_draw_animation_single_frame(m->icon_x, m->icon_y+20, (U8*) mi->item_icon, 0);
		
	}


	gdi_layer_pop_clip();
	
	gdi_layer_pop_and_restore_active();

#if(UI_DOUBLE_BUFFER_SUPPORT)
	gui_unlock_double_buffer();
	gui_BLT_double_buffer(x1,y1,x2,y2);
#endif	

	
	if (restart_flag == TRUE)
	{
		gui_start_timer(10, gui_icon_move_right_to_left_in);
	}
	else
		gui_move_previous_or_next_item();
}

void gui_icon_move_right_to_left_out(void)
{
       BOOL restart_flag = FALSE;
	
	GDI_HANDLE layer = dm_get_layer_handle(1);
	S32 x1,y1,x2,y2;
	S32 limit_x = 0;
	S32 off_x = 25;
	S32 icon_w, icon_h;
	fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;
	fixed_icontext_menuitem_type *pi =(fixed_icontext_menuitem_type*) MMI_fixed_list_menu.items[MMI_fixed_list_menu.highlighted_item];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -