?? strings.c
字號:
0x0000
};
#endif
#ifdef __Persian__
WORD code gDynamicPersian[] = {
0x0000
};
#endif
WORD code gFontCodeTable[] = {
0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x00E9,0x00F3,0x4E0D,0x4E2A,0x4E2D,0x4E3D,0x4E50,0x4E94,0x4EA4,0x4EAE,0x4EBA,0x4F4D,0x4F4E,0x4F53,0x4F55,0x4F8B,
0x4FDD,0x4FE1,0x50CF,0x5165,0x5168,0x5173,0x51B7,0x51C6,0x51E0,0x5220,0x5236,0x524D,0x529F,0x52A8,0x5355,0x53D6,
0x53F0,0x53F7,0x540C,0x548C,0x566A,0x56FE,0x573A,0x5747,0x5782,0x58F0,0x590D,0x5931,0x5B58,0x5B9A,0x5BF9,0x5C4F,
0x5E38,0x5E73,0x5EA6,0x5F00,0x5F0F,0x5F31,0x5F3A,0x5F53,0x5F69,0x5F71,0x5FAE,0x5FC3,0x606F,0x6237,0x624B,0x6301,
0x6362,0x63D2,0x641C,0x652F,0x6548,0x6574,0x6587,0x65B0,0x65E0,0x65F6,0x660E,0x6670,0x6696,0x67D4,0x6807,0x6A21,
0x6B63,0x6B65,0x6BB5,0x6BD4,0x6C34,0x6D88,0x6E05,0x6E29,0x7387,0x7406,0x7528,0x7535,0x76EE,0x76F4,0x76F8,0x7720,
0x7761,0x786E,0x7ACB,0x7BA1,0x7CFB,0x7D22,0x7EA2,0x7EDF,0x7EFF,0x7F6E,0x80FD,0x8111,0x81EA,0x8272,0x83DC,0x84DD,
0x884C,0x8861,0x89C6,0x8A00,0x8BBE,0x8BED,0x8C03,0x8C61,0x8DF3,0x8FC7,0x900F,0x9053,0x91CD,0x91CF,0x949F,0x95F4,
0x95FB,0x964D,0x9664,0x9759,0x97F3,0x9891,0x9971,0x9AD8,0x0000
};
code WORD code *ptrToDynamicStr[] = {
#ifdef __English__
&gDynamicEnglish[0],
#endif
#ifdef __Chinese_Pic__
&gDynamicChinese_Pic[0],
#endif
#ifdef __Chinese_Pc__
&gDynamicChinese_Pc[0],
#endif
#ifdef __Chinese_Sound__
&gDynamicChinese_Sound[0],
#endif
#ifdef __Chinese_Func__
&gDynamicChinese_Func[0],
#endif
#ifdef __Chinese_Geometry__
&gDynamicChinese_Geometry[0],
#endif
#ifdef __Chinese_Sys__
&gDynamicChinese_Sys[0],
#endif
#ifdef __Chinese_Channel__
&gDynamicChinese_Channel[0],
#endif
#ifdef __Chinese_Other__
&gDynamicChinese_Other[0],
#endif
#ifdef __German__
&gDynamicGerman[0],
#endif
#ifdef __French__
&gDynamicFrench[0],
#endif
#ifdef __Spanish__
&gDynamicSpanish[0],
#endif
#ifdef __Italian__
&gDynamicItalian[0],
#endif
#ifdef __Danish__
&gDynamicDanish[0],
#endif
#ifdef __Finnish__
&gDynamicFinnish[0],
#endif
#ifdef __Swedish__
&gDynamicSwedish[0],
#endif
#ifdef __Greek__
&gDynamicGreek[0],
#endif
#ifdef __Norwegian__
&gDynamicNorwegian[0],
#endif
#ifdef __Dutch__
&gDynamicDutch[0],
#endif
#ifdef __Portuguese__
&gDynamicPortuguese[0],
#endif
#ifdef __Polish__
&gDynamicPolish[0],
#endif
#ifdef __Turkish__
&gDynamicTurkish[0],
#endif
#ifdef __Russian__
&gDynamicRussian[0],
#endif
#ifdef __Hebrew__
&gDynamicHebrew[0],
#endif
#ifdef __Arabian__
&gDynamicArabian[0],
#endif
#ifdef __Persian__
&gDynamicPersian[0],
#endif
&gFontCodeTable[0]
};
WORD code gSpecial[] =
{
0,
};
BYTE code gSpecialLength[] =
{
1,
};
WORD code listbox_Nothing[] =
{
strDummy,
};
extern code WORD *ListboxArrays[] =
{
listbox_Nothing,
};
BYTE code ListboxLength[][2] =
{
{ 0, 1 },
};
//----------------------------------------------------------------------------
static BYTE bCurrFontTableId = 0;
//----------------------------------------------------------------------------
void SetCurrFontTable(BYTE tbl)
{
bCurrFontTableId = tbl;
}
//----------------------------------------------------------------------------
WORD GetTableLength(BYTE tbl)
{
WORD *ptr, len = 0;
ptr = ptrToDynamicStr[tbl];
while (*ptr++)
{
len ++;
}
return len;
}
//----------------------------------------------------------------------------
WORD GetCodeFromTable(BYTE ndx, BYTE tbl)
{
WORD *ptr = ptrToDynamicStr[tbl];
return ptr[ndx];
}
//----------------------------------------------------------------------------
WORD GetMatrixIndexByCode(WORD unicode)
{
WORD *ptr, w, ndx = 0;
ptr = ptrToDynamicStr[strFontCodeTable];
while (w = *ptr++)
{
if (w == unicode)
return ndx;
ndx ++;
}
return unicode;
}
//----------------------------------------------------------------------------
WORD GetDynamicLoadOffset(BYTE id)
{
return tblDynamicLoadOffset[id];
}
//----------------------------------------------------------------------------
BYTE GetCurrentIndexByCode(WORD unicode)
{
WORD *ptr, w, ndx;
if (unicode >= 0x20 && unicode < 0x80)
{
ptr = gDynamicEnglish;
ndx = 0x00;
}
else
{
ptr = ptrToDynamicStr[bCurrFontTableId];
ndx = GetDynamicLoadOffset(bCurrFontTableId);
}
while (w = *ptr++)
{
if (w == unicode)
return ndx;
ndx ++;
}
return unicode;
}
//----------------------------------------------------------------------------
BYTE GetStringLength(WORD id, BYTE lan)
{
BYTE len = gStringLength[lan][id];
if (len == 0)
len = gStringLength[lanEnglish][id];
return len;
}
//----------------------------------------------------------------------------
WORD GetStrStartPosition(WORD id, BYTE lan)
{
WORD i, start = 0;
for (i = 0; i < id; i ++)
start += gStringLength[lan][i];
return start;
}
//----------------------------------------------------------------------------
void GetStringToBuffer(WORD id, BYTE lan, BYTE *s)
{
BYTE *ptr;
BYTE i, len = gStringLength[lan][id];
if (len == 0)
{
lan = lanEnglish;
len = gStringLength[lan][id];
}
ptr = ptrToLanguage[lan];
ptr += GetStrStartPosition(id, lan);
for (i = 0; i < len; i ++)
{
s[i] = *ptr++;
}
}
//----------------------------------------------------------------------------
void OsdPutChar(BYTE x, BYTE y, WORD ndx)
{
msOsdDrawChar(x, y, ndx*2);
msOsdDrawChar(x + 1, y, ndx*2+1);
}
//----------------------------------------------------------------------------
void OsdTextOut(BYTE x, BYTE y, BYTE *s)
{
WORD c, index;
while (c = *s++)
{
index = GetCurrentIndexByCode(c);
OsdPutChar(x, y, index);
x += 2;
}
}
//----------------------------------------------------------------------------
void WriteStringFromBuffer(BYTE x, BYTE y, BYTE *s, BYTE len, BYTE width, BYTE align)
{
BYTE i, xofs = 2;
switch (align)
{
case alLeft:
for (i = 0; i < len; i ++)
{
OsdPutChar(x, y, *s++);
x += xofs;
}
for (; i < width; i ++)
{
OsdPutChar(x, y, 0);
x += xofs;
}
break;
case alRight:
for (i = 0; i < width - len; i ++)
{
OsdPutChar(x, y, 0);
x += xofs;
}
for (i = 0; i < len; i ++)
{
OsdPutChar(x, y, *s++);
x += xofs;
}
break;
case alCenter:
for (i = 0; i < (width - len) / 2; i ++)
{
OsdPutChar(x, y, 0);
x += xofs;
}
for (i = 0; i < len; i ++)
{
OsdPutChar(x, y, *s++);
x += xofs;
}
for (i = (width - len) / 2 + len; i < width; i ++)
{
OsdPutChar(x, y, 0);
x += xofs;
}
break;
case alIgnore:
for (i = 0; i < len; i ++)
{
OsdPutChar(x, y, *s++);
x += xofs;
}
break;
case alClient:
len = strlen(s);
for (i = 0; i < len; i ++)
{
msOsdDrawChar(x++, y, *s++);
}
break;
}
}
//----------------------------------------------------------------------------
WORD GetSpecialStartPosition(WORD id)
{
WORD i, start = 0;
for (i = strSpecialStart + 1; i < id; i ++)
start += gSpecialLength[i - strSpecialStart - 1];
return start;
}
//----------------------------------------------------------------------------
void OsdDrawString(BYTE x, BYTE y, WORD id, BYTE width, BYTE align)
{
BYTE len, s[40];
WORD pos, i;
if (id < strSpecialStart)
{
GetStringToBuffer(id, gstOsdLanguage, s);
len = GetStringLength(id, gstOsdLanguage);
WriteStringFromBuffer(x, y, s, len, width, align);
}
else
{
len = gSpecialLength[id - strSpecialStart - 1];
pos = GetSpecialStartPosition(id);
for (i = 0; i < len; i ++)
{
msOsdDrawChar(x++, y, gSpecial[pos + i]);
}
}
}
//----------------------------------------------------------------------------
BYTE GetListboxLength(WORD id)
{
if (id > lsbMinId && id < lsbMaxId)
{
return ListboxLength[id - lsbMinId - 1][0];
}
else
{
return 20;
}
}
//----------------------------------------------------------------------------
BYTE GetListboxMaxValue(WORD id)
{
if (id > lsbMinId && id < lsbMaxId)
{
return ListboxLength[id - lsbMinId - 1][1];
}
else
{
return 255;
}
}
//----------------------------------------------------------------------------
WORD GetListboxString(WORD id, BYTE ndx)
{
WORD *ArrayAddress;
ArrayAddress = ListboxArrays[id - lsbMinId - 1];
return ArrayAddress[ndx];
}
//----------------------------------------------------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -