Subversion Repositories Kolibri OS

Rev

Rev 3081 | Rev 3114 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3081 Rev 3107
Line 33... Line 33...
33
 
33
 
Line 34... Line 34...
34
//-------------------------------------------------------------------------
34
//-------------------------------------------------------------------------
35
 
35
 
36
struct mouse
36
struct mouse
37
{
37
{
38
	int x,y,lkm,pkm,hor,vert;
38
	signed int x,y,lkm,pkm,hor,vert;
Line 39... Line 39...
39
	void get();
39
	void get();
40
};
40
};
Line 119... Line 119...
119
}
119
}
Line 120... Line 120...
120
 
120
 
121
inline fastcall word GetKey()  //+Gluk fix
121
inline fastcall word GetKey()  //+Gluk fix
122
{
122
{
123
		$push edx
123
		$push edx
124
@getkey:
124
GETKEY:
125
		$mov  eax,2
125
		$mov  eax,2
126
		$int  0x40
126
		$int  0x40
127
		$cmp eax,1
127
		$cmp eax,1
128
		$jne getkeyi
128
		$jne GETKEYI
129
		$mov ah,dh
129
		$mov ah,dh
130
		$jmp getkeyii //jz?
130
		$jmp GETKEYII //jz?
131
@getkeyi:
131
GETKEYI:
132
		$mov dh,ah
132
		$mov dh,ah
133
		$jmp getkey
133
		$jmp GETKEY
134
@getkeyii:
134
GETKEYII:
135
		$pop edx
135
		$pop edx
136
		$shr eax,8
136
		$shr eax,8
Line 185... Line 185...
185
	char	rezerv2;
185
	char	rezerv2;
186
	dword	adress,use_memory,ID,left,top,width,height;
186
	dword	adress,use_memory,ID,left,top,width,height;
187
	word	status_slot,rezerv3;
187
	word	status_slot,rezerv3;
188
	dword	work_left,work_top,work_width,work_height;
188
	dword	work_left,work_top,work_width,work_height;
189
	char	status_window;
189
	char	status_window;
190
	void	GetInfo( ECX);
190
	dword   cwidth,cheight;
191
	byte    reserved[1024-71];
191
	byte    reserved[1024-71-8];
192
};
192
};
Line 193... Line 193...
193
 
193
 
194
inline fastcall void GetProcessInfo( EBX, ECX)
194
inline fastcall void GetProcessInfo( EBX, ECX)
195
{
195
{
196
	$mov eax,9;
196
	$mov eax,9;
-
 
197
	$int  0x40
-
 
198
	DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
197
	$int  0x40
199
	DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
Line 198... Line 200...
198
}
200
}
199
 
201
 
200
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
202
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
Line 318... Line 320...
318
{
320
{
319
	$push ebx
321
	$push ebx
320
	$push ecx
322
	$push ecx
321
	$mov eax, 63
323
	$mov eax, 63
322
	$mov ebx, 1
324
	$mov ebx, 1
323
next_char:
325
NEXT_CHAR:
324
	$mov ecx, DSDWORD[edx]
326
	$mov ecx, DSDWORD[edx]
325
	$or	 cl, cl
327
	$or	 cl, cl
326
	$jz  done
328
	$jz  DONE
327
	$int 0x40
329
	$int 0x40
328
	$inc edx
330
	$inc edx
329
	$jmp next_char
331
	$jmp NEXT_CHAR
330
done:
332
DONE:
331
	$mov cl, 13
333
	$mov cl, 13
332
	$int 0x40
334
	$int 0x40
333
	$mov cl, 10
335
	$mov cl, 10
334
	$int 0x40
336
	$int 0x40
335
	$pop ecx
337
	$pop ecx
Line 359... Line 361...
359
	EAX = 12;              // function 12:tell os about windowdraw
361
	EAX = 12;              // function 12:tell os about windowdraw
360
	EBX = 2;
362
	EBX = 2;
361
	$int 0x40
363
	$int 0x40
362
}
364
}
Line 363... Line -...
363
 
-
 
364
inline fastcall DeleteAllButtons()
-
 
365
{
-
 
366
	EAX = 12;              // function 12:tell os about windowdraw
-
 
367
	EBX = 1;
-
 
368
	$int 0x40
-
 
369
	EBX = 2;
-
 
370
	$int 0x40
-
 
371
}
-
 
372
 
365
 
373
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
366
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
374
{
367
{
375
	$mov eax, 67
368
	$mov eax, 67
376
	$int 0x40
369
	$int 0x40
Line 381... Line 374...
381
	EAX = 71;
374
	EAX = 71;
382
	EBX = 1;
375
	EBX = 1;
383
	$int 0x40;
376
	$int 0x40;
384
}
377
}
Line -... Line 378...
-
 
378
 
-
 
379
void WriteTextB(dword x,y,byte fontType, dword color, EDX)
-
 
380
{
-
 
381
	EAX = 4;
-
 
382
	EBX = x<<16+y;
-
 
383
	ECX = fontType<<24+color;
-
 
384
	$int 0x40;
-
 
385
	$add ebx, 1<<16
-
 
386
	$int 0x40
-
 
387
}
385
 
388
 
386
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
389
void WriteText(dword x,y,byte fontType, dword color, EDX)
387
{
390
{
388
	EAX = 4;
391
	EAX = 4;
389
	EBX = x<<16+y;
392
	EBX = x<<16+y;
-
 
393
	ECX = fontType<<24+color;
390
	ECX = fontType<<24+color;
394
	$xor esi, esi
391
	$int 0x40;
395
	$int 0x40;
Line 392... Line 396...
392
}
396
}
393
 
397
 
Line 446... Line 450...
446
  $int 0x40
450
  $int 0x40
447
}
451
}
Line 448... Line 452...
448
 
452
 
449
void DrawBar(dword x,y,w,h,EDX)
453
void DrawBar(dword x,y,w,h,EDX)
-
 
454
{
450
{
455
	if (h<=0) || (h>65000) return; //bad boy :)
451
	EAX = 13;
456
	EAX = 13;
452
	EBX = x<<16+w;
457
	EBX = x<<16+w;
453
	ECX = y<<16+h;
458
	ECX = y<<16+h;
454
 	$int 0x40
459
 	$int 0x40
Line 455... Line 460...
455
}
460
}
456
 
461
 
457
void DefineButton(dword x,y,w,h,EDX,ESI)
462
void DefineButton(dword x,y,w,h,EDX,ESI)
-
 
463
{
-
 
464
	EAX = 8;
-
 
465
	$push edx
-
 
466
	EDX += BT_DEL;
-
 
467
	$int 0x40;
-
 
468
	$pop edx
-
 
469
	EBX = x<<16+w;
-
 
470
	ECX = y<<16+h;
-
 
471
	$int 0x40
-
 
472
}
-
 
473
 
-
 
474
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
458
{
475
{
459
 	EAX = 8;
476
	EAX = 8;
460
	EBX = x<<16+w;
477
	EBX = x<<16+w;
461
	ECX = y<<16+h;
478
	ECX = y<<16+h;