Subversion Repositories Kolibri OS

Rev

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

Rev 2770 Rev 2814
Line 31... Line 31...
31
#define true		1
31
#define true		1
32
#define false		0
32
#define false		0
Line 33... Line 33...
33
 
33
 
-
 
34
 
34
 
35
 
35
 
36
struct mouse
36
struct mouse{
37
{
Line 37... Line 38...
37
	unsigned int x,y,lkm,pkm,hor,vert;
38
	unsigned int x,y,lkm,pkm,hor,vert;
Line 74... Line 75...
74
	//hor = EAX;
75
	//hor = EAX;
75
	vert = EBX;
76
	vert = EBX;
76
}
77
}
Line 77... Line 78...
77
 
78
 
78
//---------------------------------------------------------------------------
79
//---------------------------------------------------------------------------
-
 
80
struct proc_info
-
 
81
{
79
struct proc_info{
82
	#define SelfInfo -1
80
	dword	use_cpu;
83
	dword	use_cpu;
81
	word	pos_in_stack,num_slot,rezerv1;
84
	word	pos_in_stack,num_slot,rezerv1;
82
	char	name[11];
85
	char	name[11];
83
	char	rezerv2;
86
	char	rezerv2;
84
	dword	adress,use_memory,ID,left,top,width,height;
87
	dword	adress,use_memory,ID,left,top,width,height;
85
	word	status_slot,rezerv3;
88
	word	status_slot,rezerv3;
86
	dword	work_left,work_top,work_width,work_height;
89
	dword	work_left,work_top,work_width,work_height;
87
	char	status_window;
90
	char	status_window;
88
	void	GetInfo(dword ECX);
91
	void	GetInfo( ECX);
89
	byte    reserved[1024-71];
-
 
90
#define SelfInfo -1
92
	byte    reserved[1024-71];
Line 91... Line 93...
91
};
93
};
92
 
94
 
93
void proc_info::GetInfo(dword EBX, ECX)
95
void proc_info::GetInfo( EBX, ECX)
94
{
96
{
95
	EAX = 9;
97
	$mov eax,9;
Line 96... Line 98...
96
	$int  0x40
98
	$int 0x40
97
}
99
}
98
 
100
 
99
inline fastcall int GetSlot(dword ECX)
101
inline fastcall int GetSlot( ECX)
100
{
102
{
101
	EAX = 18;
103
	$mov eax,18;
Line 102... Line 104...
102
	EBX = 21;
104
	$mov ebx,21;
103
	$int 0x40
105
	$int 0x40
104
}
106
}
105
 
107
 
106
inline fastcall int ActiveProcess()
108
inline fastcall int ActiveProcess()
107
{
109
{
Line 108... Line 110...
108
	EAX = 18;
110
	$mov eax,18;
Line 109... Line 111...
109
	EBX = 7;
111
	$mov ebx,7;
110
	$int 0x40
112
	$int 0x40
111
}
113
}
112
 
114
 
Line 113... Line 115...
113
//-------------------------------------------------------------------------------
115
//-------------------------------------------------------------------------------
114
 
116
 
115
inline fastcall dword WaitEvent(){
117
inline fastcall dword WaitEvent(){
116
	EAX = 10;              // wait here for event
118
	$mov eax,10;
117
	$int 0x40
119
	$int 0x40
Line 118... Line 120...
118
}
120
}
119
 
121
 
120
inline fastcall void SetEventMask(dword EBX)
122
inline fastcall void SetEventMask( EBX)
121
{
123
{
122
	EAX = 40;
124
	EAX = 40;
123
	$int 0x40
125
	$int 0x40
Line 150... Line 152...
150
	EAX = -1;            // close this program
152
	EAX = -1;            // close this program
151
	$int 0x40
153
	$int 0x40
152
}
154
}
Line 153... Line 155...
153
 
155
 
154
inline fastcall void Pause(dword EBX){				
156
inline fastcall void Pause(dword EBX){				
155
	$mov eax, 5       // ã§ , ¢ á®âëå ¤®«ïå ᥪ㭤ë
157
	$mov eax, 5
156
	$int 0x40
158
	$int 0x40
Line 157... Line 159...
157
}
159
}
158
 
160
 
Line 174... Line 176...
174
	EAX = 12;              // function 12:tell os about windowdraw
176
	EAX = 12;              // function 12:tell os about windowdraw
175
	EBX = 2;
177
	EBX = 2;
176
	$int 0x40
178
	$int 0x40
177
}
179
}
Line 178... Line 180...
178
 
180
 
179
inline fastcall void CreateThread(dword ECX,EDX)
181
inline fastcall void CreateThread( ECX,EDX)
180
{
182
{
181
	EAX = 51;
183
	EAX = 51;
182
	EBX = 1;
184
	EBX = 1;
183
	$int 0x40
185
	$int 0x40
Line 184... Line 186...
184
}
186
}
185
 
187
 
186
inline fastcall void DrawTitle(dword ECX){
188
inline fastcall void DrawTitle( ECX){
187
	EAX = 71;
189
	EAX = 71;
188
	EBX = 1;
190
	EBX = 1;
Line 202... Line 204...
202
	$int 0x40
204
	$int 0x40
203
	//$shr eax, 16
205
	//$shr eax, 16
204
	$and eax,0x0000FFFF
206
	$and eax,0x0000FFFF
205
}
207
}
Line 206... Line 208...
206
 
208
 
207
inline fastcall void MoveSize(dword EBX,ECX,EDX,ESI){
209
inline fastcall void MoveSize( EBX,ECX,EDX,ESI){
208
	EAX = 67;
210
	$mov eax,67;
209
	$int 0x40
211
	$int 0x40
Line 210... Line 212...
210
}
212
}
Line 211... Line 213...
211
 
213
 
-
 
214
//------------------------------------------------------------------------------
212
//------------------------------------------------------------------------------
215
 
213
 
216
inline fastcall dword strlen( EDI)
214
inline fastcall dword strlen(EDI){
217
{
215
	asm {
218
	asm {
216
	  xor ecx, ecx
219
	  xor ecx, ecx
Line 221... Line 224...
221
	  sub eax, ecx
224
	  sub eax, ecx
222
	}
225
	}
223
}
226
}
Line 224... Line 227...
224
 
227
 
225
 
228
 
226
inline fastcall copystr(dword ESI,EDI)
229
inline fastcall copystr( ESI,EDI)
227
{
230
{
228
	$cld
231
	$cld
229
l1:
232
l1:
230
	$lodsb
233
	$lodsb
231
	$stosb
234
	$stosb
232
	$test al,al
235
	$test al,al
Line 233... Line 236...
233
	$jnz l1
236
	$jnz l1
234
}
237
}
235
 
238
 
236
char buffer[11];
239
char buffer[11];
237
inline fastcall dword IntToStr(dword ESI)
240
inline fastcall dword IntToStr( ESI)
238
{
241
{
239
     $mov     edi, #buffer
242
     $mov     edi, #buffer
Line 315... Line 318...
315
	} while(AL!=0);
318
	} while(AL!=0);
316
	return last;
319
	return last;
317
}
320
}
Line 318... Line 321...
318
 
321
 
319
 
322
 
320
inline fastcall ChangeCase(dword EDX)
323
inline fastcall ChangeCase( EDX)
321
{
324
{
322
	AL=DSBYTE[EDX];
325
	AL=DSBYTE[EDX];
323
	IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
326
	IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
Line 332... Line 335...
332
	}while(AL!=0);
335
	}while(AL!=0);
333
}
336
}
Line 334... Line 337...
334
 
337
 
335
 
338
 
-
 
339
//------------------------------------------------------------------------------
336
//------------------------------------------------------------------------------
340
inline fastcall void PutPixel( EBX,ECX,EDX)
337
inline fastcall void PutPixel(dword EBX,ECX,EDX){
341
{
338
  EAX=1;
342
  EAX=1;
Line 339... Line 343...
339
  $int 0x40
343
  $int 0x40
Line 349... Line 353...
349
	ECX = y<<16+h;
353
	ECX = y<<16+h;
350
 	$pop edx
354
 	$pop edx
351
	$int 0x40
355
	$int 0x40
352
}
356
}
Line 353... Line 357...
353
 
357
 
354
inline fastcall void DeleteButton(dword EDX)
358
inline fastcall void DeleteButton( EDX)
355
{
359
{
356
	EAX = 8;
360
	EAX = 8;
357
	EDX += BT_DEL;
361
	EDX += BT_DEL;
358
	$int 0x40;
362
	$int 0x40;
Line 366... Line 370...
366
	$int 0x40;
370
	$int 0x40;
367
}
371
}
Line 368... Line 372...
368
 
372
 
369
void DrawBar(dword x,y,w,h,EDX)
373
void DrawBar(dword x,y,w,h,EDX)
370
{
-
 
371
	#speed
374
{
372
	EAX = 13;
375
	EAX = 13;
373
	EBX = x<<16+w;
376
	EBX = x<<16+w;
374
	ECX = y<<16+h;
377
	ECX = y<<16+h;
375
 	$int 0x40
-
 
376
	#codesize
378
 	$int 0x40
Line 377... Line 379...
377
}
379
}
378
 
380
 
379
void DrawRegion_3D(dword x,y,width,height,color1,color2)
381
void DrawRegion_3D(dword x,y,width,height,color1,color2)
380
{
382
{
381
	DrawBar(x,y,width+1,1,color1); //¯®«®á  £®à ᢥàåã
383
	DrawBar(x,y,width+1,1,color1);
382
	DrawBar(x,y+1,1,height-1,color1); //¯®«®á  á«¥¢ 
384
	DrawBar(x,y+1,1,height-1,color1);
383
	DrawBar(x+width,y+1,1,height,color2); //¯®«®á  á¯à ¢ 
385
	DrawBar(x+width,y+1,1,height,color2);
Line 384... Line 386...
384
	DrawBar(x,y+height,width,1,color2); //¯®«®á  £®à á­¨§ã
386
	DrawBar(x,y+height,width,1,color2);
385
}
387
}
386
 
388
 
387
void DrawFlatButton(dword x,y,width,height,id,color,text)
389
void DrawFlatButton(dword x,y,width,height,id,color,text)
388
{
390
{
389
	DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
391
	DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
390
	DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
392
	DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
391
	DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª 
393
	DrawBar(x+2,y+2,width-3,height-3,color);
Line 392... Line 394...
392
	IF (id<>0)	DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF); //ª­®¯ª 
394
	IF (id<>0)	DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF);
393
	WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
395
	WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
Line 410... Line 412...
410
	EDX = x<<16+y;
412
	EDX = x<<16+y;
411
	$int 0x40
413
	$int 0x40
412
}
414
}
Line 413... Line 415...
413
 
415
 
414
//------------------------------------------------------------------------------
416
//------------------------------------------------------------------------------
415
inline fastcall void WriteDebug(dword EDX)
417
inline fastcall void debug( EDX)
416
{
418
{
417
	$mov eax, 63
419
	$mov eax, 63
418
	$mov ebx, 1
420
	$mov ebx, 1
419
next_char:
421
next_char:
Line 428... Line 430...
428
	$int 0x40
430
	$int 0x40
429
	$mov cl, 10
431
	$mov cl, 10
430
	$int 0x40
432
	$int 0x40
431
}
433
}
Line 432... Line 434...
432
 
434
 
433
inline fastcall void WriteFullDebug(dword ESI)
435
inline fastcall void WriteFullDebug( ESI)
434
{
436
{
435
	WriteDebug("");
437
	WriteDebug("");
Line 436... Line 438...
436
	WriteDebug(ESI);
438
	WriteDebug(ESI);