Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 974 → Rev 975

/programs/fs/Eolite/trunk/lib/kolibri.h--
46,7 → 46,7
$shr eax, 16
$and ebx,0x0000FFFF
x = EAX;
y = EBX-skin_width;
y = EBX;
EAX = 37;
EBX = 2;
$int 0x40
67,21 → 67,6
}
 
//---------------------------------------------------------------------------
struct BDVK{
dword attr;
byte type_name;
byte rez1, rez2, rez3;
dword timecreate;
dword datecreate;
dword timelastaccess;
dword datelastaccess;
dword timelastedit;
dword datelastedit;
dword sizelo;
dword sizehi;
char name[518];
};
//---------------------------------------------------------------------------
struct proc_info{
dword use_cpu;
word pos_in_stack,num_slot,rezerv1;
148,6 → 133,13
$int 0x40
}
 
inline fastcall dword CreateThread(dword ECX,EDX)
{
EAX = 51;
EBX = 1;
$int 0x40
}
 
inline fastcall void DrawTitle(dword ECX){
EAX = 71;
EBX = 1;
221,43 → 213,81
}
 
 
inline fastcall int strcmp(dword EAX,EBX)
inline fastcall int strcmp(ESI, EDI)
{
#speed
ESI=EAX;
EBX--;
TOP:
EBX++;
$LODSB
$CMP AL,0
$JE HERE
$CMP DSBYTE[EBX],AL
$JE TOP
HERE:
AL-=DSBYTE[EBX];
return AL;
#codesize
loop()
{
IF (DSBYTE[ESI]<DSBYTE[EDI]) RETURN -1;
IF (DSBYTE[ESI]>DSBYTE[EDI]) RETURN 1;
IF (DSBYTE[ESI]=='\0') RETURN 0;
ESI++;
EDI++;
}
}
 
 
inline fastcall unsigned int find_symbol(ESI,BL)
{
int jj=0, last=-1;
do{
jj++;
$lodsb
IF(AL==BL) last=jj;
} while(AL!=0);
return last;
}
 
 
inline fastcall memmov( EDI, ESI, ECX)
{
asm {
MOV EAX, ECX
CMP EDI, ESI
JG L1
JE L2
SAR ECX, 2
JS L2
REP MOVSD
MOV ECX, EAX
AND ECX, 3
REP MOVSB
JMP SHORT L2
L1: LEA ESI, DSDWORD[ ESI+ECX-4]
LEA EDI, DSDWORD[ EDI+ECX-4]
SAR ECX, 2
JS L2
STD
REP MOVSD
MOV ECX, EAX
AND ECX, 3
ADD ESI, 3
ADD EDI, 3
REP MOVSB
CLD
L2:
}
}
 
 
inline fastcall dword ChangeCase(dword EDX)
{
#speed
AL=DSBYTE[EDX];
IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32; //à-ï
IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80; //à-ï
do{
EDX++;
do{
AL=DSBYTE[EDX];
IF(AL>='A')&&(AL<='Z')DSBYTE[EDX]=AL|0x20;
EDX++;
IF(AL>='A')&&(AL<='Z'){DSBYTE[EDX]=AL|0x20; continue;}
IF(AL>='€')&&(AL<='')DSBYTE[EDX]=AL|0x20; // -¯
IF (AL>=144) && (AL<=159) DSBYTE[EDX] = AL + 80; //à-ï
}while(AL!=0);
#codesize
}
 
 
//------------------------------------------------------------------------------
inline fastcall void PutPixel(dword EBX,ECX,EDX){
EAX=1;
ECX+=skin_width;
$int 0x40
}
 
264,7 → 294,7
void DefineButton(dword x,y,w,h,EDX,ESI){
EAX = 8;
EBX = x<<16+w;
ECX = skin_width+y<<16+h;
ECX = y<<16+h;
$int 0x40
}
 
278,7 → 308,7
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
{
EAX = 4;
EBX = x<<16+skin_width+y;
EBX = x<<16+y;
ECX = fontType<<24+color;
$int 0x40;
}
288,26 → 318,23
#speed
EAX = 13;
EBX = x<<16+w;
ECX = skin_width+y<<16+h;
ECX = y<<16+h;
$int 0x40
#codesize
}
 
void DrawRegion(dword x,y,width,height,color1)
void DrawRegion_3D(dword x,y,width,height,color1,color2)
{
DrawBar(x,y,width,1,color1); //¯®«®á  £®à ᢥàåã
DrawBar(x,y+height,width,1,color1); //¯®«®á  £®à á­¨§ã
DrawBar(x,y,1,height,color1); //¯®«®á  ¢¥àåã á«¥¢ 
DrawBar(x+width,y,1,height+1,color1); //¯®«®á  ¢¥àåã á¯à ¢ 
DrawBar(x,y,width+1,1,color1); //¯®«®á  £®à ᢥàåã
DrawBar(x,y+1,1,height-1,color1); //¯®«®á  á«¥¢ 
DrawBar(x+width,y+1,1,height,color2); //¯®«®á  á¯à ¢ 
DrawBar(x,y+height,width,1,color2); //¯®«®á  £®à á­¨§ã
}
 
void DrawFlatButton(dword x,y,width,height,id,color,text)
{
DrawRegion(x,y,width,height,0x94AECE);
DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //¯®«®á  £®à ¡¥« ï
DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //¢¥­¬ ¢¥à¢
DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //¯®«®á  ¢¥à¢ ¡¥« ¯
DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //¢¥­¬ ¢¥à¢
DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª 
IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //ª­®¯ª 
WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
317,7 → 344,7
{
EAX = 7;
ECX = w<<16+h;
EDX = x<<16+y+skin_width;
EDX = x<<16+y;
$int 0x40
}
 
325,7 → 352,7
{
EAX = 65;
ECX = w<<16+h;
EDX = x<<16+y+skin_width;
EDX = x<<16+y;
ESI = 8;
EBP = 0;
$int 0x40