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

📄 gui_fixed_menus.c

📁 详细介绍MTK平台图层运用的好东西
💻 C
📖 第 1 页 / 共 5 页
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 *  gui_fixed_menus.c
 *
 * Project:
 * --------
 *  MAUI
 *
 * Description:
 * ------------
 *  Fixed-list menu - UI component
 *
 *  1. The number of menu items stays unchanged after the UI component is created.
 *  2. The storage of all menu item data is preallocated.
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/

/***************************************************************************** 
 * Include
 *****************************************************************************/
#include "MMI_Features.h"
#include "gui_config.h"
#include "gui_fixed_menus.h"
#include "CustMenuRes.h"
#include "wgui_inline_edit.h"
#include "gui_windows.h"
#include "DebugInitDef.h"
#include "gui_themes.h"
#include "wgui_categories_util.h"
#include "gui_setting.h"
#include "kal_non_specific_general_types.h"
#include "lcd_sw_rnd.h"
#include "gdi_include.h"
#include "wgui.h"

#include "MainMenuDef.h"//qinyelu 2008.06.24

/***************************************************************************** 
 * Static Declaration
 *****************************************************************************/

/***************************************************************************** 
 * Global Variable
 *****************************************************************************/
extern gdi_handle wgui_layer_1;
extern gdi_handle wgui_base_layer;
extern PU8 get_image(MMI_ID_TYPE);
extern S32 MMI_current_menu_type;

/* for R2L characters */
extern BOOL r2lMMIFlag;

extern S32 menu_item_inline_multiline_box(void);

extern int gdi_layer_get_bit_per_pixel(void);
extern PU8 get_image(U16 i);

S32 current_fixed_list_menuitem_display_index = -1;

UI_fixed_list_menu_theme *current_fixed_list_menu_theme = NULL;
UI_fixed_matrix_menu_theme *current_fixed_matrix_menu_theme = NULL;

#ifdef __MMI_UI_MATRIX_MAIN_MENU_SLIDE_EFFECT__

// TODO: THE MATRIX MAIN MENU ITEM NUMBER SHOULD BE CHANGED TO A REAL VALUE.
#define MAX_MATRIX_MM_ITEM_NUM  12
 
S32 matrix_mm_active_image_num = 0;
gui_image_rect matrix_mm_rect[MAX_MATRIX_MM_ITEM_NUM];
#endif /* __MMI_UI_MATRIX_MAIN_MENU_SLIDE_EFFECT__ */

/***************************************************************************** 
 * Local Function
 *****************************************************************************/

/***************************************************************************** 
 * Global Function
 *****************************************************************************/

/* 
 * List menu
 */

/*****************************************************************************
 * FUNCTION
 *  UI_dummy_menuitem_displayed_function
 * DESCRIPTION
 *  Dummy item after display callback. This function is OBSOLETE.
 * PARAMETERS
 *  index       [IN]        item index
 *  x1          [IN]        x1
 *  y1          [IN]        y1
 *  x2          [IN]        x2
 *  y2          [IN]        y2
 * RETURNS
 *  void
 *****************************************************************************/
void UI_dummy_menuitem_displayed_function(S32 index, S32 x1, S32 y1, S32 x2, S32 y2)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    UI_UNUSED_PARAMETER(index);
    UI_UNUSED_PARAMETER(x1);
    UI_UNUSED_PARAMETER(y1);
    UI_UNUSED_PARAMETER(x2);
    UI_UNUSED_PARAMETER(y2);
}


/*****************************************************************************
 * FUNCTION
 *  gui_set_fixed_list_menu_current_theme
 * DESCRIPTION
 *  Apply the current theme to a fixed list menu.
 * PARAMETERS
 *  m       [IN]        fixed list menu object
 * RETURNS
 *  void
 *****************************************************************************/
void gui_set_fixed_list_menu_current_theme(fixed_list_menu *m)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    m->flags |= current_fixed_list_menu_theme->flags;
    m->focussed_filler = current_fixed_list_menu_theme->focussed_filler;
    m->normal_filler = current_fixed_list_menu_theme->normal_filler;
    gui_resize_vertical_scrollbar(&m->vbar, current_fixed_list_menu_theme->vbar_width, m->vbar.height);
    gui_move_vertical_scrollbar(&m->vbar, m->x + m->width - current_fixed_list_menu_theme->vbar_width, m->y);
}


/*****************************************************************************
 * FUNCTION
 *  gui_set_fixed_list_menu_theme
 * DESCRIPTION
 *  Apply the given theme to a fixed list menu.
 * PARAMETERS
 *  m       [IN]        fixed list menu object
 *  t       [IN]        menu theme
 * RETURNS
 *  void
 *****************************************************************************/
void gui_set_fixed_list_menu_theme(fixed_list_menu *m, UI_fixed_list_menu_theme *t)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    m->flags |= t->flags;
    m->focussed_filler = t->focussed_filler;
    m->normal_filler = t->normal_filler;
    gui_resize_vertical_scrollbar(&m->vbar, t->vbar_width, m->vbar.height);
    gui_move_vertical_scrollbar(&m->vbar, m->x + m->width - current_fixed_list_menu_theme->vbar_width, m->y);
}


/*****************************************************************************
 * FUNCTION
 *  gui_create_fixed_list_menu
 * DESCRIPTION
 *  Create a fixed list menu.
 * PARAMETERS
 *  m           [IN]        fixed list menu object
 *  x           [IN]        x1
 *  y           [IN]        y1
 *  width       [IN]        width
 *  height      [IN]        height
 * RETURNS
 *  void
 *****************************************************************************/
void gui_create_fixed_list_menu(fixed_list_menu *m, S32 x, S32 y, S32 width, S32 height)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    m->flags = 0;
    m->x = x;
    m->y = y;
    m->width = width;
    m->height = height;
    m->n_items = 0;
    m->highlighted_item = 0;
    m->first_displayed_item = 0;
    m->last_displayed_item = 0;
    m->displayed_items = 0;
    m->spacing = 0;
    m->top = 0;
    gui_set_fixed_list_menu_current_theme(m);
    gui_create_vertical_scrollbar(
        &m->vbar,
        m->x + m->width - current_fixed_list_menu_theme->vbar_width,
        m->y,
        current_fixed_list_menu_theme->vbar_width,
        m->height);
    m->item_highlighted = UI_dummy_function_s32;
    m->item_unhighlighted = UI_dummy_function_s32;
    m->item_display_function = UI_fixed_menuitem_dummy_display_function;
    m->item_hide_function = UI_fixed_menuitem_dummy_display_function;
    m->item_measure_function = UI_fixed_menuitem_dummy_measure_function;
    m->item_highlight_function = UI_fixed_menuitem_dummy_highlight_function;
    m->item_remove_highlight_function = UI_fixed_menuitem_dummy_remove_highlight_function;
    m->item_resize_function = UI_fixed_menuitem_dummy_resize_function;
    m->items = NULL;
    m->common_item_data = NULL;
    m->item_displayed_callback = UI_dummy_menuitem_displayed_function;
    m->resized_before_locate = MMI_FALSE;
    m->act_layer_handle = GDI_LAYER_MAIN_BASE_LAYER_HANDLE;
    m->act_lcd_handle = GDI_LCD_MAIN_LCD_HANDLE;
#ifdef __MMI_TOUCH_SCREEN__
    m->pen_event_current_selected_callback_function = NULL;
    m->pen_event_default_selected_callback_function = NULL;
    m->pen_redraw_menu_function = NULL;
    m->item_pen_function = UI_fixed_menuitem_dummy_pen_function;
    m->disable_move_highlight = MMI_FALSE;
    m->disable_up_select = MMI_FALSE;
    m->pen_scroll_delay_time = 0;
    m->pen_scroll_after_delay = -1;
    memset(&(m->pen_state), 0, sizeof(gui_list_pen_state_struct));
#endif /* __MMI_TOUCH_SCREEN__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  gui_resize_fixed_list_menu

⌨️ 快捷键说明

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