move_EMS_inputbox (0, 120); MMI_multitap_height = 17 resize_EMS_inputbox(176, 63); hide_multitap
gui_show_EMS_input_box_ext
MMI_multitap_height is for the softkeyboard under the input text.
scroll bar:
void gui_set_vertical_scrollbar_scale(vertical_scrollbar *v, S32 scale) : length
void gui_set_vertical_scrollbar_range(vertical_scrollbar *v, S32 range) : total length void gui_set_vertical_scrollbar_value(vertical_scrollbar *v, S32 value) : position
void gui_move_vertical_scrollbar(vertical_scrollbar *v, S32 x, S32 y) void gui_show_vertical_scrollbar(vertical_scrollbar *v)
从ems中取出输入的数据: EMSData *pEMS;
GetEMSDataForEdit(&pEMS, 0);
5 screen管理
5.1 U8 GoBackToHistory(U16 scrnid)
回到history中的某个screen,返回值:0 失败,1 成功
入栈操作为:historyData[++currHistoryIndex] = data;currHistoryIndex 初始值为-1
16
5.2
void GoBacknHistory(U16 n)
返回到上 n+1 个history
5.3
historyData[50] 是个栈,最大可以有50个history
综合考虑闹钟,短信息,电话等等综合因素,screen切换要慎重。
screen只能作为显示,因为是screen manager来自动管理,即自动调用exit和entry函数的,因此程序的逻辑最好不要放在screen中,以免出错
6 多国语言支持
ref_list.txt
E:\\mtk_base\\plutommi\\Customer\\CustResource\\PLUTO_MMI *
E:\\MTK_BASE\\PLUTOMMI\\Customer\\CustResource 这个是根据上面的文件生成的文件
? ? ?
各个条目之间用 tab 分隔
在设置语言后,代码里要重新getstring,从而替换语言 不要修改长度项,6, … 随他去
language有个code,各个公司定义的不同,要注意。 比如:联桥的阿拉伯文定义就是0x9660,和其他不同
gCurrLangIndex
这是个很好的专题
FontRes.c里面的
typedef struct _CustFontData {
U8 nHeight; U8 nWidth; U8 nAscent; U8 nDescent;
17
U8 nEquiDistant;
U8 nCharBytes; U16 nMaxChars;
#ifdef __MMI_INDIC_ALG__
U8 *pDWidthArray; /* vijay added during merge */ #endif
U8 *pWidthArray; U32 *pOffsetArray; U8 *pDataArray; U32 *pRange;
U16 pFontType[MAX_FONT_TYPES][2]; const RangeDetails *pRangeDetails; } sCustFontData;
GB2312_Data_small
GB2312_RangeOffset_small
ShowString:
bidi_get_char_type:根据输入的字符串,获取字符方向:从右到左还是从左到右 ShowString_internal:
GetFontdata
画字符时,如果是控制字符,则转化为空格
UI_print_text ShowString ShowString_internal
7 键盘处理
MMI_key_input_handler
EMS_inputbox_multitap_input
clear_category_screen_key_handlers();
change_left_softkey(left_softkey, left_softkey_icon);
18
change_right_softkey(right_softkey, right_softkey_icon); clear_left_softkey(); clear_right_softkey();
register_left_softkey_handler(); register_right_softkey_handler(); register_default_hide_softkeys();
//get_softkey_function(KEY_EVENT_DOWN, MMI_RIGHT_SOFTKEY)
//GetKeyHandler(KEY_RSK, KEY_EVENT_DOWN)
execute_softkey_function(KEY_EVENT_UP, MMI_RIGHT_SOFTKEY);
8 YUV-RGB
#if 0
static long int crv_tab[256]; static long int cbu_tab[256]; static long int cgu_tab[256]; static long int cgv_tab[256]; static long int tab_76309[256];
static unsigned char clp[1024]; //for clip in CCIR601
void mbm_InitYUV2RGBTbl() {
long int crv,cbu,cgu,cgv; int i,ind;
crv = 104597; cbu = 132201; cgu = 25675; cgv = 53279;
for (i = 0; i < 256; i++) { crv_tab[i] = (i-128) * crv; cbu_tab[i] = (i-128) * cbu; cgu_tab[i] = (i-128) * cgu; cgv_tab[i] = (i-128) * cgv; tab_76309[i] = 76309*(i-16); }
for (i=0; i<384; i++) clp[i] =0; ind=384;
19
for (i=0;i<256; i++) clp[ind++]=i; ind=640;
for (i=0;i<384;i++) clp[ind++]=255; }
void mbm_Yuv420ToRGB565(char *yuvBuf, char *rgbBuf, int width, int height) {
unsigned char *src0; unsigned char *src1; unsigned char *src2; int y1,y2,u,v;
unsigned char *py1,*py2; int i,j, c1, c2, c3, c4; unsigned char *d1, *d2;
unsigned char r,g,b;
int imgSize = width * height; int doubWidth = width<<1;
src0=(unsigned char *)yuvBuf; src1=src0 + imgSize;
src2=src1+ (imgSize>>2);
py1=src0;
py2=py1+width;
d1=(unsigned char *)rgbBuf; d2=d1+doubWidth;
for (j = 0; j < height; j += 2) { for (i = 0; i < width; i += 2) {
u = *src1++; v = *src2++;
c1 = crv_tab[v]; c2 = cgu_tab[u]; c3 = cgv_tab[v]; c4 = cbu_tab[u]; //up-left
y1 = tab_76309[*py1++]; b = clp[384+((y1 + c4)>>16)]; g = clp[384+((y1 - c2 - c3)>>16)];
20