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

📄 wgui_categories_mm.c

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

    }
    ExecuteCurrHiliteHandler(item_index);
#if(UI_ENABLE_POP_UP_DESCRIPTIONS)
    gui_pop_up_description_stop_scroll();
    wgui_current_pop_up_description_index = item_index;
#endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */ 
}


/*****************************************************************************
 * FUNCTION
 *  hide_main_menu_animation_frame
 * DESCRIPTION
 *  Hides the animating icon in a menu
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void hide_main_menu_animation_frame(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    switch (MMI_main_menu_type)
    {
        case LIST_MENU:
            break;
        case MATRIX_MENU:
            gui_hide_fixed_matrix_menu_highlighted_item(&MMI_fixed_matrix_menu);
            break;
    }
}


/*****************************************************************************
 * FUNCTION
 *  draw_main_menu_list_type_title
 * DESCRIPTION
 *  Redraws the category14 screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void draw_main_menu_list_type_title(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* Do not redraw status bar because that will let integrated title status icons gone. */
    // show_title_status_icon();
    draw_title();
}


/*****************************************************************************
 * FUNCTION
 *  category14_main_menu_list_highlight_handler
 * DESCRIPTION
 *  highlight handler for main menu lsit of category 14
 * PARAMETERS
 *  item_index      [IN]        Index of current highlighted item
 * RETURNS
 *  void
 *****************************************************************************/
void category14_main_menu_list_highlight_handler(S32 item_index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#if(TITLE_TRANSITION_STYLE_NON_BLOCKING)
    if (MMI_main_menu_type == PAGE_MENU)
    {
        wgui_stop_transition_title_non_blocking();
        reset_title_transition();
    }
#ifndef TITLE_TRANSITION_WITH_PREVIOUS_TITLE_MOVEMENT
    set_previous_title_shortcut(MMI_menu_shortcut_number);
#endif 
#endif /* (TITLE_TRANSITION_STYLE_NON_BLOCKING) */ 
    MMI_menu_shortcut_number = item_index + 1;
    MMI_highlighted_item_text = get_item_text(item_index);
    MMI_title_string = MMI_highlighted_item_text;
    gdi_layer_lock_frame_buffer();
    MMI_list_highlight_handler(item_index);

    if (!menu_shortcut_handler_display)
    {
        draw_main_menu_list_type_title();
    }

    gui_hide_animations();

#ifdef __MMI_MAINLCD_320X240__
    /* change page background images */
    if (MMI_current_menu_type == PAGE_MENU)
    {
        dm_set_scr_bg_image(gMainMenuAnimation[item_index], NULL, -1, -1, 255);       
        /* check GDI_ERROR_HANDLE to prevent the goto item before the SCR BG layer is created. */
        if (dm_get_scr_bg_layer() != GDI_ERROR_HANDLE)
        {
            dm_draw_scr_bg_image();
        }
    }
#endif /* __MMI_MAINLCD_320X240__ */

#if (!defined(__MMI_UI_TECHNO_MAINMENU__))
    MMI_fixed_list_menu.item_display_function(
                            MMI_fixed_list_menu.items[MMI_fixed_list_menu.highlighted_item],
                            MMI_fixed_list_menu.common_item_data,
                            MMI_fixed_list_menu.x,
                            MMI_fixed_list_menu.y);
#endif /* (!defined(__MMI_UI_TECHNO_MAINMENU__)) */ 

    gdi_layer_unlock_frame_buffer();
#ifndef __MMI_UI_DALMATIAN_MAINMENU__
#ifdef __MMI_UI_TITLE_TRANSITION__
    if (MMI_main_menu_type == PAGE_MENU && is_mmi_title_transition_on_keys() == 0)
    {
        U16 keyCode, keyType;

        GetkeyInfo(&keyCode, &keyType);
    #ifdef __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__
        if (keyCode == KEY_RIGHT_ARROW)
    #else 
        if (keyCode == KEY_DOWN_ARROW || keyCode == KEY_VOL_DOWN)
    #endif 
        {
            set_title_transition(WGUI_TRANSITION_L2R);
            draw_title();
        #if(!TITLE_TRANSITION_STYLE_NON_BLOCKING)
            reset_title_transition();
        #endif 
        }
        else
    #ifdef __MMI_UI_MM_HORIZONTAL_PAGE_STYLE__
        if (keyCode == KEY_LEFT_ARROW)
    #else 
        if (keyCode == KEY_UP_ARROW || keyCode == KEY_VOL_UP)
    #endif 
        {

            set_title_transition(WGUI_TRANSITION_R2L);
            draw_title();
        #if(!TITLE_TRANSITION_STYLE_NON_BLOCKING)
            reset_title_transition();
        #endif 
        }

    }
    else if (MMI_main_menu_type == PAGE_MENU && is_mmi_title_transition_on_keys() == 1)
    {
        draw_title();
    #if(!TITLE_TRANSITION_STYLE_NON_BLOCKING)
        reset_title_transition();
    #endif 
    }
#endif /* __MMI_UI_TITLE_TRANSITION__ */ 
#endif /* __MMI_UI_DALMATIAN_MAINMENU__ */ 
    gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
}


/*****************************************************************************
 * FUNCTION
 *  initialize_mainmenu_title_icons
 * DESCRIPTION
 *  Called once during bootup to initialize category screens
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void initialize_mainmenu_title_icons(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 i = 0;
    MMI_ID_TYPE mm_iconID[MAX_MAIN_MENU_ITEMS];

#ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
    U8 j = 0;
    U8 num_of_group = 0;
    U8 num_of_child = 0;
    U16 total_number = 0;
    U16 menu_id = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    num_of_group = (U8) GetNumOfChild(IDLE_SCREEN_MENU_ID);
    for (i = 0; i < num_of_group; i++)
    {
        menu_id = GetSeqItemId(IDLE_SCREEN_MENU_ID, (U16) i);
        num_of_child = (U8) GetNumOfChild(menu_id);
        GetSequenceImageIds(menu_id, mm_iconID);
        for (j = 0; j < num_of_child; j++)
        {
            MMI_ASSERT(total_number < MAX_MAIN_MENU_ITEMS);
            gMainMenuTitleIcon[total_number++] = MAIN_MENU_TITLE_ICON_BASE + mm_iconID[j] - MAIN_MENU_ICON_IMGBASE;
        }
    }
#else /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
    GetSequenceImageIds(IDLE_SCREEN_MENU_ID, mm_iconID);
    for (i = 0; i < MAX_MAIN_MENU_ITEMS; i++)
    {
        gMainMenuTitleIcon[i] = MAIN_MENU_TITLE_ICON_BASE + mm_iconID[i] - MAIN_MENU_ICON_IMGBASE;
    }
#endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
}


#ifdef __T5650__ //wangzhk 2009002.15
static GDI_HANDLE g_main_animation_layer=GDI_LAYER_EMPTY_HANDLE;
#define MAIN_MENU_LAYER_W GDI_LCD_WIDTH
#define MAIN_MENU_LAYER_H	GDI_LCD_HEIGHT
#define MAIN_MENU_BUFFER      ((MAIN_MENU_LAYER_W*MAIN_MENU_LAYER_H*GDI_MAINLCD_BIT_PER_PIXEL)>>3)
PU8 MainmenuBuffer=NULL;

extern U8 TouchIsanimation;
extern U8 Lanimation;
extern U8 Ranimation;

extern void gui_icon_move_left_to_right_in(void);
extern void gui_icon_move_right_to_left_in(void);
extern void gui_icon_move_left_to_right_out(void);
extern void gui_icon_move_right_to_left_out(void);



void gdi_creat_Layer_main_menu_icon(void)
{
	if (g_main_animation_layer == GDI_LAYER_EMPTY_HANDLE)
	{
		gdi_layer_create(0, 0, UI_device_width, UI_device_height, &g_main_animation_layer);
	}

	MMI_ASSERT(g_main_animation_layer != GDI_LAYER_EMPTY_HANDLE);
	gdi_layer_push_and_set_active(g_main_animation_layer);
	gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);				
	gdi_layer_clear(GDI_COLOR_TRANSPARENT);
	gdi_layer_pop_and_restore_active();	
	dm_add_blt_layer(g_main_animation_layer, DM_LAYER_TOP);

}

void gdi_mainmenu_ext_layer_free(void)
{
	if (g_main_animation_layer != GDI_LAYER_EMPTY_HANDLE)
	{
		gdi_layer_free(g_main_animation_layer);
		g_main_animation_layer = GDI_LAYER_EMPTY_HANDLE;
	}
}

void gdi_exit_mainmenu_free_timer(void)
{
	TouchIsanimation = 0;
	Lanimation = 0;
	Ranimation = 0;
	gui_cancel_timer(gui_icon_move_left_to_right_out);
	gui_cancel_timer(gui_icon_move_left_to_right_in);
	gui_cancel_timer(gui_icon_move_right_to_left_out);
	gui_cancel_timer(gui_icon_move_right_to_left_in);
	gdi_mainmenu_ext_layer_free();
}
#endif


/*----------------------------------------------------------------------------
Function:		category14callback
Description:		callback from draw manager used to draw category 14 controlled area
Input Parameters:	co-ordinates
Output Parameters:	Void
Returns:			void
Remarks:			
----------------------------------------------------------------------------*/
#if defined __MMI_UI_TECHNO_MAINMENU__ || defined __MMI_UI_DALMATIAN_MAINMENU__
void category14_callback(dm_coordinates *coordinate)
{
#if defined(__MMI_UI_DALMATIAN_MAINMENU__)
	s32 i;
	s32 x1, y1, x2, y2;
#endif

#if defined(__MMI_UI_TECHNO_MAINMENU__)
	show_techno_menu();
#else
	show_fixed_list();
#endif

#ifdef __T5650__ //wangzhk 2009002.15
	gdi_creat_Layer_main_menu_icon();
#endif

#if defined(__MMI_UI_DALMATIAN_MAINMENU__)
	gui_push_clip();
	initialize_balls();
	for(i = 0; i < NUMBER_OF_BALLS; i++)
	{
		x1 = *(ball[i].position + 0);
		y1 = *(ball[i].position + 1);
		x2 = x1 + BALL_WIDTH - 1;
		y2 = y1 + BALL_HEIGHT -1;
		if(x1 < MMI_content_x)
			x1 = MMI_content_x;
		if(y1 < MMI_content_y)
			y1 = MMI_content_y;
		if(x2> UI_device_width - 1)
			x2 = UI_device_width - 1;
		if(y2> UI_device_height - MMI_button_bar_height)
			y2 = UI_device_height - MMI_button_bar_height;
		_get_bitmap(x1, y1, x2, y2,	&ball[i].image);
	}
	gui_set_clip(MMI_content_x, MMI_content_y,
			UI_device_width - 1,
			UI_device_height - MMI_button_bar_height - 1);
	for(i = 0; i < NUMBER_OF_BALLS; i++)
	{
		gui_show_image(*(ball[i].position + 0),
				*(ball[i].position + 1),
				get_image(MAIN_MENU_DALMATIAN_BALL));
	}
	gui_pop_clip();
#endif

}
#endif


/*****************************************************************************
 * FUNCTION
 *  ShowCategory14Screen
 * DESCRIPTION
 *  Displays the category14 screen . this is a scrren to show main menu
 * PARAMETERS
 *  title                   [IN]        Title for the screen
 *  title_icon              [IN]        Icon displayed with the title
 *  left_softkey            [IN]        Left softkey label

⌨️ 快捷键说明

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