📄 im_gui.c
字号:
#ifdef __IM_APPLICATION__
#include "IM_prot.h"
/*****************************************************************************
* Include
*****************************************************************************/
#include "MMI_Features.h"
#include "gui_config.h"
#include "gui_dynamic_menus.h"
#include "wgui_dynamic_menuitems.h"
#include "gui_windows.h"
#include "DebugInitDef.h"
#include "wgui_categories_util.h"
#include "gdi_include.h"
#include "SettingProfile.h"
/*
// color define
// black
// blue
#define QGDI_BLUE_BUDDY_SEL_FILL gdi_act_color_from_rgb(255,0xc1,0xd4,0xfd)
#define QGDI_BLUE_BUDDY_SEL_FRAME gdi_act_color_from_rgb(255,0x88,0xa8,0xf4)
#define QGDI_BLUE_NOTIFY_BG gdi_act_color_from_rgb(255,0xcd,0xdd,0xf8)
#define QGDI_BLUE_MENU_BG gdi_act_color_from_rgb(255,0xff,0xff,0xff)
#define QGDI_BLUE_MENU_SEL_FILL gdi_act_color_from_rgb(255,0xa9,0xbd,0xf6)
#define QGDI_BLUE_MENU_FRAME gdi_act_color_from_rgb(255,0x2e,0x57,0xc2)
#define QGUI_BLUE_MENU_TEXT Q_UI_color(0x3c,0x79,0xaa)
// pink
#define QGDI_PINK_BUDDY_SEL_FILL gdi_act_color_from_rgb(255,0xfe,0xcc,0xec)
#define QGDI_PINK_BUDDY_SEL_FRAME gdi_act_color_from_rgb(255,0xf5,0x90,0xce)
#define QGDI_PINK_NOTIFY_BG gdi_act_color_from_rgb(255,0xfb,0x96,0xfd)
#define QGDI_PINK_MENU_BG gdi_act_color_from_rgb(255,0xf9,0xff,0xfc)
#define QGDI_PINK_MENU_SEL_FILL gdi_act_color_from_rgb(255,0xfd,0xaf,0xff)
#define QGDI_PINK_MENU_FRAME gdi_act_color_from_rgb(255,0xaf,0x3a,0xb5)
#define QGUI_PINK_MENU_TEXT Q_UI_color(0xaf,0x3a,0xb5)
// red
#define QGDI_RED_BUDDY_SEL_FILL gdi_act_color_from_rgb(255,0xfe,0xcc,0xd1)
#define QGDI_RED_BUDDY_SEL_FRAME gdi_act_color_from_rgb(255,0xf3,0x90,0x98)
#define QGDI_RED_NOTIFY_BG gdi_act_color_from_rgb(255,0xff,0x9b,0x9d)
#define QGDI_RED_MENU_BG gdi_act_color_from_rgb(255,0xff,0xf2,0xf4)
#define QGDI_RED_MENU_SEL_FILL QGDI_RED_BUDDY_SEL_FILL
#define QGDI_RED_MENU_FRAME gdi_act_color_from_rgb(255,0xb7,0x3d,0x40)
#define QGUI_RED_MENU_TEXT Q_UI_color(0xb7,0x3d,0x40)
//new
//blue
#define QGDI_BLUE_TAB_BG_FILL gdi_act_color_from_rgb(255,0x77,0x92,0xc2)
#define QGDI_BLUE_TAB_FRAME gdi_act_color_from_rgb(255,0x4a,0x61,0x8b)
#define QGDI_BLUE_TAB_SEL_FILL gdi_act_color_from_rgb(255,0xd8,0xe0,0xeb)
#define QGDI_BLUE_BMENU_FILL gdi_act_color_from_rgb(255,0x8c,0xa4,0xce)
#define QGDI_BLUE_BMENU_ISFRAME gdi_act_color_from_rgb(255,0x9f,0xb4,0xdc)
#define QGDI_BLUE_BMENU_OSFRAME gdi_act_color_from_rgb(255,0x69,0x86,0xb4)
#define QGDI_BLUE_LOGIN_BG_FILL gdi_act_color_from_rgb(255,0xeb,0xf1,0xfa)
#define QGDI_BLUE_SCROLL_FRAME gdi_act_color_from_rgb(255,0x48,0x6a,0xa7)
#define QGDI_BLUE_SCROLL_FILL gdi_act_color_from_rgb(255,0x68,0x89,0xc5)
// black
// pink
#define QGDI_PINK_TAB_BG_FILL gdi_act_color_from_rgb(255,0xdf,0x39,0xe8)
#define QGDI_PINK_TAB_FRAME gdi_act_color_from_rgb(255,0x9e,0x21,0x98)
#define QGDI_PINK_TAB_SEL_FILL gdi_act_color_from_rgb(255,0xff,0xef,0xff)
#define QGDI_PINK_BMENU_FILL QGDI_PINK_TAB_BG_FILL
#define QGDI_PINK_BMENU_ISFRAME gdi_act_color_from_rgb(255,0xfc,0x97,0xfe)
#define QGDI_PINK_BMENU_OSFRAME gdi_act_color_from_rgb(255,0xbf,0x19,0xcb)
#define QGDI_PINK_LOGIN_BG_FILL GDI_COLOR_WHITE
#define QGDI_PINK_SCROLL_FRAME gdi_act_color_from_rgb(255,0x82,0x01,0x82)
#define QGDI_PINK_SCROLL_FILL gdi_act_color_from_rgb(255,0xf4,0x00,0xf4)
// red
#define QGDI_RED_TAB_BG_FILL gdi_act_color_from_rgb(255,0xe9,0x3a,0x46)
#define QGDI_RED_TAB_FRAME gdi_act_color_from_rgb(255,0x9e,0x24,0x21)
#define QGDI_RED_TAB_SEL_FILL gdi_act_color_from_rgb(255,0xfe,0xe8,0xe8)
#define QGDI_RED_BMENU_FILL QGDI_RED_TAB_BG_FILL
#define QGDI_RED_BMENU_ISFRAME gdi_act_color_from_rgb(255,0xfe,0x81,0x8f)
#define QGDI_RED_BMENU_OSFRAME gdi_act_color_from_rgb(255,0xcb,0x19,0x24)
#define QGDI_RED_LOGIN_BG_FILL GDI_COLOR_WHITE
#define QGDI_RED_SCROLL_FRAME gdi_act_color_from_rgb(255,0x82,0x01,0x3b)
#define QGDI_RED_SCROLL_FILL gdi_act_color_from_rgb(255,0xf4,0x00,0x6e)
#define QGDI_BLACK_BUDDY_SEL_FILL gdi_act_color_from_rgb(255,0xb7,0xb7,0xb7)
#define QGDI_BLACK_BUDDY_SEL_FRAME gdi_act_color_from_rgb(255,0x9b,0x9b,0x9b)
#define QGDI_BLACK_NOTIFY_BG gdi_act_color_from_rgb(255,0x9d,0x9d,0x9d)
#define QGDI_BLACK_MENU_BG GDI_COLOR_WHITE
#define QGDI_BLACK_MENU_SEL_FILL gdi_act_color_from_rgb(255,0xc4,0xc4,0xc4)
#define QGDI_BLACK_MENU_FRAME GDI_COLOR_BLACK
#define QGUI_BLACK_MENU_TEXT Q_UI_color(0,0,0)
#define QGDI_BLACK_TAB_BG_FILL gdi_act_color_from_rgb(255,0x56,0x56,0x56)
#define QGDI_BLACK_TAB_FRAME gdi_act_color_from_rgb(255,0x39,0x39,0x39)
#define QGDI_BLACK_TAB_SEL_FILL gdi_act_color_from_rgb(255,0xee,0xed,0xed)
#define QGDI_BLACK_BMENU_FILL QGDI_BLACK_TAB_BG_FILL
#define QGDI_BLACK_BMENU_ISFRAME gdi_act_color_from_rgb(255,0x92,0x91,0x8e)
#define QGDI_BLACK_BMENU_OSFRAME gdi_act_color_from_rgb(255,0x45,0x44,0x44)
#define QGDI_BLACK_LOGIN_BG_FILL GDI_COLOR_WHITE
#define QGDI_BLACK_SCROLL_FRAME gdi_act_color_from_rgb(255,0x4e,0x4d,0x4d)
#define QGDI_BLACK_SCROLL_FILL gdi_act_color_from_rgb(255,0x7a,0x7a,0x7a)
*/
//System 系统色
UI_filled_area list_background_system={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0,0,0,100},
{0,0,0,100},
{0,0,0,100},
{0,0,0,100}, 0
};
UI_filled_area list_item_select_background_system={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0,0,255,100},
{0,0,0,100}, {0,0,0,100}, {0,0,0,100}, 0
};
//Gray 高级灰
UI_filled_area list_background_gray={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0xff,0xff,0xff,100},
{0,0,0,100},
{0,0,0,100},
{0,0,0,100}, 0
};
UI_filled_area list_item_select_background_gray={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0xb7,0xb7,0xb7,100},
{0,0,0,100},
{0x9b,0x9b,0x9b,100},
{0,0,0,100}, 0
};
//Blue 水晶蓝
UI_filled_area list_background_blue={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0xff,0xff,0xff,100},
{0,0,0,100},
{0,0,0,100},
{0,0,0,100}, 0
};
UI_filled_area list_item_select_background_blue={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0xc1,0xd4,0xfd,100},
{0,0,0,100},
{0x88,0xa8,0xf4,100},
{0,0,0,100}, 0
};
//Purple 贵族紫
UI_filled_area list_background_purple={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0xf9,0xff,0xfc,100},
{0,0,0,100},
{0,0,0,100},
{0,0,0,100}, 0
};
UI_filled_area list_item_select_background_purple={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0xfe,0xcc,0xec,100},
{0,0,0,100},
{0xf5,0x90,0xce,100},
{0,0,0,100}, 0
};
//Red 玫瑰红
UI_filled_area list_background_red={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0xff,0xf2,0xf4,100},
{0,0,0,100},
{0,0,0,100},
{0,0,0,100}, 0
};
UI_filled_area list_item_select_background_red={
UI_FILLED_AREA_TYPE_COLOR, UI_IMAGE_ID_NULL, NULL,
{0xfe,0xcc,0xd1,100},
{0,0,0,100},
{0xf3,0x90,0x98,100},
{0,0,0,100}, 0
};
im_gui_theme_struct IM_theme[5] =
{
{ //System
&list_background_system,
&list_item_select_background_system,
{0,0,0,100}
},
{ //Gray
&list_background_gray,
&list_item_select_background_gray,
{0,0,0,100}
},
{ //Blue
&list_background_blue,
&list_item_select_background_blue,
{0x3c,0x79,0xaa,100}
},
{ //Purple
&list_background_purple,
&list_item_select_background_purple,
{0xaf,0x3a,0xb5,100}
},
{ //Red
&list_background_red,
&list_item_select_background_red,
{0xb7,0x3d,0x40,100}
}
};
S32 IM_gui_curr_theme_index = 0;
S32 IM_current_fixed_list_display_index = -1;
static S32 IM_ui_latest_anim_index = -1;
S32* IM_current_fixed_list_highlighted_index = &MMI_fixed_list_menu.highlighted_item;
im_common_menuitem_struct IM_common_menuitem;
S32 IM_list_screen_ticks = 0;
scrolling_text statusbar_scrolling_text;
U8* statusbar_icon = NULL;
S32 statusbar_height = MMI_MENUITEM_HEIGHT;
#define IM_CHECK_MENUITEM_Y2(y2) { (y2) = (((y2) > MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 2) ? (MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 2) : (y2));}
const U16 IM_index_icons[15] =
{
IMG_GLOBAL_L1,
IMG_GLOBAL_L2,
IMG_GLOBAL_L3,
IMG_GLOBAL_L4,
IMG_GLOBAL_L5,
IMG_GLOBAL_L6,
IMG_GLOBAL_L7,
IMG_GLOBAL_L8,
IMG_GLOBAL_L9,
IMG_GLOBAL_L10,
IMG_GLOBAL_L11,
IMG_GLOBAL_L12,
IMG_GLOBAL_L13,
IMG_GLOBAL_L14,
IMG_GLOBAL_L15,
};
extern void dummy_highlight_handler(S32 item_index);
extern void ExitListCategoryScreen(void);
extern U8 *GetListCategoryHistory(U8 *history_buffer);
extern multi_line_input_box MMI_multiline_inputbox;
void IM_show_fixed_list(void);
BOOL IM_gui_fixed_list_menu_translate_pen_event(
fixed_list_menu *m, mmi_pen_event_type_enum pen_event,
S16 x, S16 y, gui_list_pen_enum *menu_event);
S32 IM_list_arrow_key_handler(U16 key);
/*****************************************************************************
* FUNCTION
* IM_gui_fixed_list_menu_locate_highlighted_item
* DESCRIPTION
* Locate the highlighted menu item.
* PARAMETERS
* m [IN] fixed list menu object
* RETURNS
* void
*****************************************************************************/
void IM_gui_fixed_list_menu_locate_highlighted_item(fixed_list_menu *m)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 iwidth, iheight;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (m->flags & UI_LIST_MENU_FIRST_SHIFT_HIGHLIGHTED_ITEM)
{
S32 total_height = 0, i;
U8 done = 0;
S32 list_height = m->height;
m->flags &= ~UI_LIST_MENU_FIRST_SHIFT_HIGHLIGHTED_ITEM;
m->first_displayed_item = m->highlighted_item;
for (i = m->n_items - 1; (i >= 0) && (!done); i--)
{
IM_current_fixed_list_display_index = i;
m->item_measure_function(m->items[i], m->common_item_data, &iwidth, &iheight);
total_height += iheight;
if (total_height > list_height + 1)
{
if (m->first_displayed_item > i)
{
done = 1;
m->first_displayed_item = i + 1;
m->last_displayed_item = m->n_items - 1;
}
break;
}
}
if (total_height <= list_height)
{
m->first_displayed_item = 0;
}
total_height = 0;
for (i = m->first_displayed_item; (i < m->n_items) && (!done); i++)
{
IM_current_fixed_list_display_index = i;
m->item_measure_function(m->items[i], m->common_item_data, &iwidth, &iheight);
total_height += iheight;
if (total_height > list_height + 1)
{
done = 1;
m->last_displayed_item = i - 1;
}
}
}
else if (m->flags & UI_LIST_MENU_LAST_SHIFT_HIGHLIGHTED_ITEM)
{
S32 total_height = 0, i;
U8 done = 0;
S32 list_height = m->height;
m->flags &= ~UI_LIST_MENU_LAST_SHIFT_HIGHLIGHTED_ITEM;
m->last_displayed_item = m->highlighted_item;
/* Check if in the first page */
for (i = 0; (i < m->n_items) && !done; i++)
{
IM_current_fixed_list_display_index = i;
m->item_measure_function(m->items[i], m->common_item_data, &iwidth, &iheight);
total_height += iheight;
if (total_height > list_height + 1)
{
if (m->last_displayed_item < i)
{
done = 1;
m->first_displayed_item = 0;
m->last_displayed_item = i - 1;
}
break;
}
}
/* Check if in the last page */
if (!done && total_height <= list_height)
{
done = 1;
m->first_displayed_item = 0;
m->last_displayed_item = m->n_items - 1;
}
/* Align to the bottom */
total_height = 0;
if (!done)
{
for (i = m->last_displayed_item; (i >= 0) && (!done); i--)
{
IM_current_fixed_list_display_index = i;
m->item_measure_function(m->items[i], m->common_item_data, &iwidth, &iheight);
total_height += iheight;
if (total_height > list_height + 1)
{
done = 1;
m->first_displayed_item = i + 1;
}
}
if (!done)
{
m->first_displayed_item = 0;
}
}
}
else if (m->flags & UI_LIST_MENU_CENTER_HIGHLIGHTED)
{
m->first_displayed_item = m->highlighted_item - 1;
if (m->first_displayed_item < 0)
{
m->first_displayed_item = m->n_items - 1;
}
m->last_displayed_item = m->highlighted_item + 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -