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

📄 wgui_categories_mm.c

📁 详细介绍MTK平台图层运用的好东西
💻 C
📖 第 1 页 / 共 5 页
字号:
static U8 mm_bg_opacity;
static S32 mm_bg_flags;
#endif /* defined (__MMI_WALLPAPER_ON_BOTTOM__) */ 
/* 082806 240x320 matrix End */

#endif /* (ENABLE_DIRECT_MAIN_MENU_IMPLEMENTATION) */ 

/* For 3D circular main menu */
extern gdi_handle animation_handle;

#ifdef __MMI_UI_TECHNO_STATUS_ICON__
extern void arrange_status_icons();
extern void show_status_icons();
#endif /* __MMI_UI_TECHNO_STATUS_ICON__ */ 
#if((ENABLE_CIRCULAR_3D_MENU) || (ENABLE_ROTATE_MENU))
extern void stop_rotate_circular_menu(void);
#endif 

#if ENABLE_CIRCULAR_3D_MENU

/*****************************************************************************
 * FUNCTION
 *  set_circular_menu_category_history
 * DESCRIPTION
 *  set main menu matirx history
 * PARAMETERS
 *  history_ID          [IN]        History ID
 *  history_buffer      [IN]        History buffer
 * RETURNS
 *  void
 *****************************************************************************/
U8 set_circular_menu_category_history(U16 history_ID, U8 *history_buffer)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (history_buffer != NULL)
    {
        circular_menu_category_history *h = (circular_menu_category_history*) history_buffer;

        if (history_valid(h->history_ID, history_ID))
        {
            wgui_CM3D_menu.highlighted_item = h->highlighted_item;
            wgui_CM3D_menu.flags = h->flags;
            return (1);
        }
    }
    return (0);
}


/*****************************************************************************
 * FUNCTION
 *  get_circular_menu_category_history
 * DESCRIPTION
 *  get main menu matirx history
 * PARAMETERS
 *  history_ID          [IN]        History ID
 *  history_buffer      [OUT]       History buffer
 * RETURNS
 *  void
 *****************************************************************************/
void get_circular_menu_category_history(U16 history_ID, U8 *history_buffer)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (history_buffer != NULL)
    {
        U16 hID = (U16) (history_ID | 0x8000);
        circular_menu_category_history *h = (circular_menu_category_history*) history_buffer;

        h->history_ID = hID;
        h->highlighted_item = (S16) wgui_CM3D_menu.highlighted_item;
        h->flags = wgui_CM3D_menu.flags;
    }
}

#endif /* ENABLE_CIRCULAR_3D_MENU */


/*****************************************************************************
 * FUNCTION
 *  draw_bg_animation
 * DESCRIPTION
 *  Displays the background image for new mainmenu category
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void draw_bg_animation(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 iw, ih;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gui_measure_image(MMI_bg_animation, &iw, &ih);
    if (animation_handle != GDI_ERROR_HANDLE)
    {
        gdi_image_stop_animation(animation_handle);
    }
    wgui_set_animation_image(MMI_content_width - iw, UI_device_height - MMI_button_bar_height - ih, MMI_bg_animation);
    gui_set_clip(
        MMI_content_width - iw,
        UI_device_height - MMI_button_bar_height - ih,
        MMI_content_width - 1,
        UI_device_height - MMI_button_bar_height);
    gdi_image_draw_animation(
        MMI_content_width - iw,
        UI_device_height - MMI_button_bar_height - ih,
        MMI_bg_animation,
        &animation_handle);
}


/*****************************************************************************
 * FUNCTION
 *  draw_bg
 * DESCRIPTION
 *  Displays the background image for new mainmenu category
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void draw_bg(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 iwidth, iheight, character_height, tx, w;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gdi_layer_lock_frame_buffer();
    gdi_layer_push_clip();
    gdi_layer_push_text_clip();
    gui_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
    gdi_layer_set_text_clip(
        MMI_title_x,
        MMI_title_y,
        MMI_title_x + MMI_title_width - 1,
        MMI_title_y + MMI_title_height - 1);
    if (MMI_bg_image != NULL)
    {
        gui_measure_image(MMI_bg_image, &iwidth, &iheight);
        gui_show_image(0, 0, MMI_bg_image);
    }

    if (!r2lMMIFlag)
    {
        tx = 2;
    }
    else
    {
        tx = MMI_title_width - 2;
    }

    if (MMI_bg_string != NULL)  /* Fix for long titles  */
    {
        S32 tw;

        if (!r2lMMIFlag)
        {
            tw = MMI_title_width - tx;
        }
        else
        {
            tw = tx;
        }

        gui_set_font((UI_font_type) (current_MMI_theme->window_title_font));
        gui_measure_string(MMI_bg_string, &w, &character_height);
        gui_set_text_color(*current_MMI_theme->title_text_color);
        gui_set_text_border_color(*current_MMI_theme->title_text_border_color);
        if (r2lMMIFlag)
        {
            gui_move_text_cursor(
                MMI_title_x + tx + w,
                MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)));
        }
        else
        {
            gui_move_text_cursor(MMI_title_x + tx, MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)));
        }
        if (!MMI_disable_title_shortcut_display && MMI_menu_shortcut_number >= 0)
        {
            tw -= MMI_menu_shortcut_box.width;
            if (w < tw)
            {
                S32 _tx = tx;

                if (!r2lMMIFlag)
                {
                    tx = tx + (tw >> 1) - (w >> 1); /* Centers the title */
                    if (tx < _tx)
                    {
                        tx = _tx;
                    }
                }
                else
                {
                    tx = (MMI_title_width >> 1) - (w >> 1);
                    tx += w;
                    if (tx > _tx)
                    {
                        tx = _tx;
                    }
                }
            }
        }
        else
        {
            if (w < tw)
            {
                S32 _tx = tx;

                if (!r2lMMIFlag)
                {
                    tx = (MMI_title_width >> 1) - (w >> 1);
                    if (tx < _tx)
                    {
                        tx = _tx;
                    }
                }
                else
                {
                    tx = (MMI_title_width >> 1) - (w >> 1);
                    tx += w;
                    if (tx > _tx)
                    {
                        tx = _tx;
                    }
                }
            }
        }
    #if defined(__MMI_DEFAULT_THEME_3__) || defined(__MMI_DEFAULT_THEME_1__)
        gui_print_truncated_borderd_text(
            MMI_title_x + tx,
            MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)),
            tw,
            MMI_bg_string);
    #else /* defined(__MMI_DEFAULT_THEME_3__) || defined(__MMI_DEFAULT_THEME_1__) */ 
        gui_print_truncated_text(
            MMI_title_x + tx,
            MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)),
            tw,
            MMI_bg_string);
    #endif /* defined(__MMI_DEFAULT_THEME_3__) || defined(__MMI_DEFAULT_THEME_1__) */ 
    }
    gdi_layer_unlock_frame_buffer();
    show_menu_shortcut();
    gdi_layer_blt_previous(
        MMI_title_x,
        MMI_title_y,
        MMI_title_x + MMI_title_width - 1,
        MMI_title_y + MMI_title_height - 1);
}


/*****************************************************************************
 * FUNCTION
 *  standard_circular_3d_highlight_handler
 * DESCRIPTION
 *  System Highlight handler of 3d circular list
 *  
 *  Internal function
 * PARAMETERS
 *  item_index      [IN]        Index of current highlighted item
 * RETURNS
 *  void
 *****************************************************************************/
void standard_circular_3d_highlight_handler(S32 item_index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_menu_shortcut_number = item_index + 1;
    MMI_highlighted_item_text = get_item_text(item_index);
    MMI_circular_3D_highlight_handler(item_index);
}


/*****************************************************************************
 * FUNCTION
 *  standard_bg_ani_list_highlight_handler
 * DESCRIPTION
 *  System Highlight handler of bg_ani_list
 *  
 *  Internal function
 * PARAMETERS
 *  item_index      [IN]        Index of current highlighted item
 * RETURNS
 *  void
 *****************************************************************************/
void standard_bg_ani_list_highlight_handler(S32 item_index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gui_hide_animations();
    MMI_menu_shortcut_number = item_index + 1;
    MMI_highlighted_item_text = get_item_text(item_index);
    MMI_bg_string = MMI_highlighted_item_text;
    MMI_bg_image = get_image((MMI_ID_TYPE) (MAIN_MENU_BG_IMAGE_BASE + item_index));
    switch (item_index)
    {
        case 0:
        case 1:
            MMI_bg_animation = get_image((MMI_ID_TYPE) (MAIN_MENU_PHONEBOOK_ICON + item_index));
            break;
        case 2:
            MMI_bg_animation = get_image((MMI_ID_TYPE) (MAIN_MENU_CALL_HISTORY_ICON));
            break;
        case 3:
            MMI_bg_animation = get_image((MMI_ID_TYPE) (MAIN_MENU_SETTINGS_ICON));
            break;
        case 4:
            MMI_bg_animation = get_image((MMI_ID_TYPE) (MAIN_MENU_FUNANDGAMES_ICON));
            break;
        case 5:
            MMI_bg_animation = get_image((MMI_ID_TYPE) (MAIN_MENU_PROFILES_ICON));
            break;
        case 6:
            MMI_bg_animation = get_image((MMI_ID_TYPE) (MAIN_MENU_ORGANIZER_ICON));
            break;
        case 7:
            MMI_bg_animation = get_image((MMI_ID_TYPE) (MAIN_MENU_SERVICES_ICON));
            break;
        case 8:
            MMI_bg_animation = get_image((MMI_ID_TYPE) (MAIN_MENU_SHORTCUTS_ICON));
            break;

⌨️ 快捷键说明

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