Subversion Repositories Kolibri OS

Rev

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

Rev 2839 Rev 2874
Line 31... Line 31...
31
 
31
 
Line 32... Line 32...
32
//-------------------------------------------------------------------------
32
//-------------------------------------------------------------------------
33
 
33
 
34
struct mouse
34
struct mouse
35
{
35
{
36
	dword x,y,lkm,pkm,hor,vert;
36
	int x,y,lkm,pkm,hor,vert;
Line 37... Line 37...
37
	void get();
37
	void get();
38
};
38
};
Line 163... Line 163...
163
	char	status_window;
163
	char	status_window;
164
	void	GetInfo( ECX);
164
	void	GetInfo( ECX);
165
	byte    reserved[1024-71];
165
	byte    reserved[1024-71];
166
};
166
};
Line 167... Line 167...
167
 
167
 
168
void GetProcessInfo( EBX, ECX)
168
inline fastcall void GetProcessInfo( EBX, ECX)
169
{
169
{
170
	$mov eax,9;
170
	$mov eax,9;
171
	$int  0x40
171
	$int  0x40
Line 203... Line 203...
203
	$mov eax,68
203
	$mov eax,68
204
	$mov ebx,1
204
	$mov ebx,1
205
	$int 0x40
205
	$int 0x40
206
}
206
}
Line 207... Line 207...
207
 
207
 
208
inline fastcall ExitProcess()
208
inline fastcall int KillProcess( ECX)
209
{
209
{
-
 
210
	$mov eax,18;
210
	$mov eax,-1;
211
	$mov ebx,18;
211
	$int 0x40
212
	$int 0x40
Line 212... Line 213...
212
}
213
}
213
 
214
 
-
 
215
inline fastcall int ExitSystem( ECX)
-
 
216
{
-
 
217
	#define TURN_OFF 2
-
 
218
	#define REBOOT 3
214
inline fastcall int KillProcess( ECX)
219
	#define KERNEL 4
-
 
220
	
-
 
221
	$mov eax, 18
-
 
222
	$mov ebx, 9
-
 
223
	$int 0x40
-
 
224
}
-
 
225
 
215
{
226
inline fastcall ExitProcess()
216
	$mov eax,18;
227
{
217
	$mov ebx,18;
228
	$mov eax,-1;
Line 218... Line 229...
218
	$int 0x40
229
	$int 0x40
Line 226... Line 237...
226
	EAX = 26;
237
	EAX = 26;
227
	EBX = 5;
238
	EBX = 5;
228
	$int 0x40
239
	$int 0x40
229
}
240
}
Line 230... Line 241...
230
 
241
 
231
inline fastcall dword GetSkinWidth()
242
inline fastcall dword GetSkinHeight()
232
{
243
{
233
	$push ebx
244
	$push ebx
234
	$mov  eax,48
245
	$mov  eax,48
235
	$mov  ebx,4
246
	$mov  ebx,4
Line 242... Line 253...
242
	EAX = 48;
253
	EAX = 48;
243
	EBX = 8;
254
	EBX = 8;
244
	$int 0x40
255
	$int 0x40
245
}
256
}
Line 246... Line 257...
246
 
257
 
247
inline fastcall dword GetScreenWidth()
258
inline fastcall int GetScreenWidth()
248
{
259
{
249
	EAX = 14;
-
 
250
	EBX = 4;
260
	$mov eax, 14
251
	$int 0x40
261
	$int 0x40
-
 
262
	$shr eax, 16
-
 
263
}
-
 
264
 
-
 
265
inline fastcall int GetScreenHeight()
-
 
266
{
-
 
267
	$mov eax, 14
252
	$shr eax, 16
268
	$int 0x40
253
	$and eax,0x0000FFFF
269
	$and eax,0x0000FFFF
Line 254... Line 270...
254
}
270
}
255
 
271
 
256
inline fastcall dword LoadLibrary( ECX)
272
inline fastcall dword LoadLibrary( ECX)
257
{
273
{
258
	$mov eax, 68 
274
	$mov eax, 68 
259
	$mov ebx, 19
275
	$mov ebx, 19
Line 260... Line 276...
260
	$int  0x40
276
	$int  0x40
261
}
277
}
262
 
278
 
263
byte fastcall TestBit( EAX, CL)
279
inline fastcall int TestBit( EAX, CL)
264
{
280
{
Line 265... Line 281...
265
	$shr eax,cl
281
	$shr eax,cl
Line 266... Line 282...
266
	$and eax,1
282
	$and eax,1
267
}
283
}
268
 
284
 
269
 
285
 
270
//------------------------------------------------------------------------------
286
//------------------------------------------------------------------------------
Line -... Line 287...
-
 
287
 
271
 
288
void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAreaColor, EDI)
272
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
289
{
273
{
290
	EAX = 12;              // function 12:tell os about windowdraw
274
	EAX = 12;              // function 12:tell os about windowdraw
-
 
275
	EBX = 1;
-
 
276
	$int 0x40
291
	EBX = 1;
Line 277... Line 292...
277
	
292
	$int 0x40
278
	EBX = x << 16 + sizeX;
293
	
279
	ECX = y << 16 + sizeY;
294
	EAX = 0;
280
	EDX = mainAreaType << 24 | mainAreaColour;
295
	EBX = x << 16 + sizeX;
Line 281... Line 296...
281
	ESI = headerType << 24 | headerColour;
296
	ECX = y << 16 + sizeY;
282
	$xor eax,eax
297
	EDX = WindowType << 24 | WindowAreaColor;
283
	$int 0x40
298
	$int 0x40
284
 
299
 
285
	EAX = 12;              // function 12:tell os about windowdraw
300
	EAX = 12;              // function 12:tell os about windowdraw
Line 286... Line 301...
286
	EBX = 2;
301
	EBX = 2;
287
	$int 0x40
302
	$int 0x40
Line 314... Line 329...
314
  ECX = sizeX << 16 + sizeY;
329
  ECX = sizeX << 16 + sizeY;
315
  EDX = x << 16 + y;
330
  EDX = x << 16 + y;
316
  $int  0x40;
331
  $int  0x40;
317
}
332
}
Line -... Line 333...
-
 
333
 
-
 
334
dword GetPixelColor(dword x, x_size, y)
-
 
335
{
-
 
336
	$mov eax, 35
-
 
337
	EBX= y*x_size+x;
-
 
338
	$int 0x40
-
 
339
}
318
 
340
 
319
void PutImage(dword EBX,w,h,x,y)
341
void PutImage(dword EBX,w,h,x,y)
320
{
342
{
321
	EAX = 7;
343
	EAX = 7;
322
	ECX = w<<16+h;
344
	ECX = w<<16+h;
Line 363... Line 385...
363
}
385
}
Line 364... Line 386...
364
 
386
 
Line 365... Line 387...
365
 
387
 
366
//------------------------------------------------------------------------------
388
//------------------------------------------------------------------------------
367
 
389
 
368
void DrawRegion(dword x,y,width,height,color1)
390
:void DrawRegion(dword x,y,width,height,color1)
369
{
391
{
370
	DrawBar(x,y,width,1,color1); //¯®«®á  £®à ᢥàåã
392
	DrawBar(x,y,width,1,color1); //¯®«®á  £®à ᢥàåã
371
	DrawBar(x,y+height,width,1,color1); //¯®«®á  £®à á­¨§ã
393
	DrawBar(x,y+height,width,1,color1); //¯®«®á  £®à á­¨§ã
Line 372... Line 394...
372
	DrawBar(x,y,1,height,color1); //¯®«®á  ¢¥àåã á«¥¢ 
394
	DrawBar(x,y,1,height,color1); //¯®«®á  ¢¥àåã á«¥¢ 
373
	DrawBar(x+width,y,1,height+1,color1); //¯®«®á  ¢¥àåã á¯à ¢ 
395
	DrawBar(x+width,y,1,height+1,color1); //¯®«®á  ¢¥àåã á¯à ¢ 
374
}
396
}
375
 
397
 
376
void DrawRegion_3D(dword x,y,width,height,color1,color2)
398
:void DrawRegion_3D(dword x,y,width,height,color1,color2)
377
{
399
{
378
	DrawBar(x,y,width+1,1,color1); //¯®«®á  £®à ᢥàåã
400
	DrawBar(x,y,width+1,1,color1); //¯®«®á  £®à ᢥàåã
Line 379... Line 401...
379
	DrawBar(x,y+1,1,height-1,color1); //¯®«®á  á«¥¢ 
401
	DrawBar(x,y+1,1,height-1,color1); //¯®«®á  á«¥¢ 
380
	DrawBar(x+width,y+1,1,height,color2); //¯®«®á  á¯à ¢ 
402
	DrawBar(x+width,y+1,1,height,color2); //¯®«®á  á¯à ¢ 
381
	DrawBar(x,y+height,width,1,color2); //¯®«®á  £®à á­¨§ã
403
	DrawBar(x,y+height,width,1,color2); //¯®«®á  £®à á­¨§ã
382
}
404
}
383
 
405
 
384
void DrawFlatButton(dword x,y,width,height,id,color,text)
406
:void DrawFlatButton(dword x,y,width,height,id,color,text)
385
{
407
{
386
	DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
408
	DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
387
	DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
409
	DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
Line 388... Line 410...
388
	DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª 
410
	DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª 
389
	IF (id<>0)	DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //ª­®¯ª 
411
	IF (id<>0)	DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //ª­®¯ª 
390
	//WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
412
	//WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
391
	WriteText(width/2+x+1,height/2-3+y,0x80,0,text,0);
413
	WriteText(width/2+x+1,height/2-3+y,0x80,0,text,0);
392
}
414
}
393
 
415