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

📄 wgui_fixed_menus.c

📁 详细介绍MTK平台图层运用的好东西
💻 C
📖 第 1 页 / 共 5 页
字号:
	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_out);
	
	//gui_measure_image(pi->item_icon,&icon_w,&icon_h);

	limit_x = MAIN_MENU_ICON_LEFT_START_X;


#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;

		kal_prompt_trace(MOD_UEM,"gui_icon_move_right_to_left_out::next_item==%d",next_item);

	kal_prompt_trace(MOD_UEM,"gui_icon_move_right_to_left_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_right_to_left_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_right_to_left_out);
	}
	else
	{
		m->icon_x = MAIN_MENU_ICON_RIGHT_START_X;
		gui_icon_move_right_to_left_in();
	}
	
}

void PageShowAnimation(void)
{
	if(Lanimation == 1)
	{
		if(item_falg)
		{
			next_item = page_item_index;
		}
		else
		{
			next_item = MMI_fixed_list_menu.highlighted_item+1;
		}
		
		
		gui_cancel_timer(gui_icon_move_left_to_right_out);
		gui_cancel_timer(gui_icon_move_left_to_right_in);
		gui_icon_move_right_to_left_out();

	}
	else if(Ranimation == 1)
	{
		if(item_falg)
		{
			previous_item = page_item_index;
		}
		else
		{
			previous_item = MMI_fixed_list_menu.highlighted_item -1;		
		}
		gui_cancel_timer(gui_icon_move_right_to_left_out);
		gui_cancel_timer(gui_icon_move_right_to_left_in);
		gui_icon_move_left_to_right_out();
	}
	Lanimation = 0;
	Ranimation = 0;
}
#endif

/*****************************************************************************
 * FUNCTION
 *  fixed_list_goto_previous_item
 * DESCRIPTION
 *  Go to the previous item.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void fixed_list_goto_previous_item(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    gdi_handle act_lcd;
	
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (MMI_fixed_list_menu.n_items <= 0)
    {
        return;
    }

    /* do nothing if there is only 1 menu item */
    if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
    {
        return;
    }

//wangzhk 2009.02.15
#ifdef __T5650__
	if(Isanimation == 0)
	{
		Ranimation = 1;
		Lanimation = 0;
	}

	if((GetActiveScreenId() == MAIN_MENU_SCREENID)&&(MMI_main_menu_type == PAGE_MENU)&&(Ranimation == 1))
	{	
			Isanimation = 1;
			item_falg = FALSE;
			kal_prompt_trace(MOD_UEM,"fixed_list_goto_previous_item:::highlighted_item==%d",MMI_fixed_list_menu.highlighted_item);
			PageShowAnimation();
			gui_goto_item_callback(fixed_list_goto_previous_item);
			//gui_start_timer(1000, fixed_list_goto_previous_item);
			
			return;
	}
	
	if((GetActiveScreenId() == MAIN_MENU_SCREENID)&&(MMI_main_menu_type == PAGE_MENU))
	{
		/*{
			fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;
			m->icon_x = -72;
			gui_icon_move_left_to_right_in();
		}*/
		//gui_cancel_timer(fixed_list_goto_previous_item);
		//wangzhk 2009.02.24
		gui_cancel_timer(gui_icon_move_left_to_right_out);
		gui_cancel_timer(gui_icon_move_left_to_right_in);
		item_falg = TRUE;
		Isanimation = 0;
		Lanimation = 0;
		Ranimation = 0;
	}
	
#endif
    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 

    gui_list_effect_slide_start();
    /* Max: to redraw list if there is only 1 item. */
    if (!((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0)))   /* return; */
    {
    #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
        if (MMI_current_menu_type == PAGE_MENU)
        {
            is_next_item = 0;
            show_animated_balls();
        }
        else
    #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */ 
        {
            gui_fixed_list_menu_goto_previous_item(&MMI_fixed_list_menu);
        }
    }

#ifdef __MMI_UI_TECHNO_MAINMENU__
    if (MMI_current_menu_type == PAGE_MENU)
    {
        is_next_item = 0;
        associate_techno_item_positions(0);
        show_techno_menu_animation();
    }
#endif /* __MMI_UI_TECHNO_MAINMENU__ */ 

    if (MMI_current_menu_type == PAGE_MENU)
    {
        gdi_layer_pop_and_restore_active();
        gdi_lcd_set_active(act_lcd);    
        return;
    }

    if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
    {
        draw_bg();
        draw_bg_animation();
    }

#ifdef __MMI_INTERACTIVE_PROFILNG__
    mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
#endif

    redraw_fixed_list();

#ifdef __MMI_INTERACTIVE_PROFILNG__
    mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
#endif
    
    gui_list_effect_slide_end();
    
    gdi_layer_pop_and_restore_active();
    gdi_lcd_set_active(act_lcd);
}
/*****************************************************************************
 * FUNCTION
 *  fixed_list_goto_next_item
 * DESCRIPTION
 *  Go to the next item.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/

void fixed_list_goto_next_item(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    gdi_handle act_lcd;
	
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (MMI_fixed_list_menu.n_items <= 0)
    {
        return;
    }

    /* do nothing if there is only 1 menu item */
    if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
    {
        return;
    }
//wangzhk 2009.02.15
#ifdef __T5650__
	if(Isanimation == 0)
	{
		Lanimation = 1;
		Ranimation = 0;
	}

	if((GetActiveScreenId() == MAIN_MENU_SCREENID)&&(MMI_main_menu_type == PAGE_MENU)&&(Lanimation == 1))
	{		
			Isanimation = 1;
			item_falg = FALSE;
			kal_prompt_trace(MOD_UEM,"fixed_list_goto_next_item:::highlighted_item==%d",MMI_fixed_list_menu.highlighted_item);
			PageShowAnimation();
			gui_goto_item_callback(fixed_list_goto_next_item);

			//gui_start_timer(1000, fixed_list_goto_next_item);
			
			return;
	}
	
	if((GetActiveScreenId() == MAIN_MENU_SCREENID)&&(MMI_main_menu_type == PAGE_MENU))
	{
		/*{
			fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;
			m->icon_x = 312;
			gui_icon_move_right_to_left_in();
		}*/
		//gui_cancel_timer(fixed_list_goto_next_item);
		//wangzhk 2009.02.24
		gui_cancel_timer(gui_icon_move_right_to_left_out);
		gui_cancel_timer(gui_icon_move_right_to_left_in);
		item_falg = TRUE;
		Isanimation = 0;
		Lanimation = 0;
		Ranimation = 0;
	}
	
#endif

    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 

    gui_list_effect_slide_start();
    /* Max: to redraw list if there is only 1 item. */
    if (!((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0)))   /* return; */
    {
    #if defined(__MMI_UI_DALMATIAN_MAINMENU__)
        if (MMI_current_menu_type == PAGE_MENU)
        {
            is_next_item = 1;
            show_animated_balls();
        }
        else
    #endif /* defined(__MMI_UI_DALMATIAN_MAINMENU__) */ 
        {
            gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
        }
    }

#ifdef __MMI_UI_TECHNO_MAINMENU__
    if (MMI_current_menu_type == PAGE_MENU)
    {
        is_next_item = 1;
        associate_techno_item_positions(1);
        show_techno_menu_animation();
    }
#endif /* __MMI_UI_TECHNO_MAINMENU__ */ 
    if (MMI_current_menu_type == PAGE_MENU)
    {
        gdi_layer_pop_and_restore_active();
        gdi_lcd_set_active(act_lcd);
        return;
    }

    if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
    {
        draw_bg();
        draw_bg_animation();
    }

#ifdef __MMI_INTERACTIVE_PROFILNG__
    mmi_frm_profiling_delay_start_timer(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);
#endif

    redraw_fixed_list();
    
#ifdef __MMI_INTERACTIVE_PROFILNG__
    mmi_frm_profiling_delay_perform(MMI_FRM_PROFILING_DELAY_LIST_HIGHLIGHT);    
#endif

    gui_list_effect_slide_end();

    gdi_layer_pop_and_restore_active();
    gdi_lcd_set_active(act_lcd);
}

/*****************************************************************************
 * FUNCTION
 *  fixed_list_goto_home
 * DESCRIPTION
 *  Go to the first item.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void fixed_list_goto_home(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    gdi_handle act_lcd;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (MMI_fixed_list_menu.n_items <= 0)
    {
        return;
    }
    if ((MMI_fixed_list_menu.n_items == 1) && (MMI_fixed_list_menu.highlighted_item == 0))
    {
        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 
    gui_fixed_list_menu_goto_first_item(&MMI_fixed_list_menu);
    if (MMI_fixed_list_menu.flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
    {
        draw_bg();
        draw_bg_animation();
    }
    redraw_fixed_list();
    gdi_layer_pop_and_restore_active();
    gdi_lcd_set_active(act_lcd);
}


/*****************************************************************************
 * FUNCTION
 *  fix

⌨️ 快捷键说明

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