Subversion Repositories Kolibri OS

Rev

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

Rev 5576 Rev 5582
Line 1... Line 1...
1
//CODED by Veliant, Leency, Nable. GNU GPL licence.
1
//CODED by Veliant, Leency, Nable. GNU GPL licence.
Line 2... Line 2...
2
 
2
 
Line 3... Line 3...
3
#define LIB_KOLIBRI_H
3
#define INCLUDE_KOLIBRI_H
4
 
4
 
Line 5... Line 5...
5
#startaddress 0
5
#startaddress 0
Line 90... Line 90...
90
 *  tmp - time keycode 
90
 *  tmp - time keycode 
91
 *  down - key event press
91
 *  down - key event press
92
 *  up - key release events
92
 *  up - key release events
93
 *  move - event mouse movements
93
 *  move - event mouse movements
94
 *  click - when clicked
94
 *  click - when clicked
95
 *  dblclick - double-click the default 50 ms
95
 *  dblclick - double-click the default 50 (500 ms)
96
 */
96
 */
Line 97... Line 97...
97
 
97
 
98
dword __TMP_TIME,MOUSE_TIME;
98
:dword __TMP_TIME,MOUSE_TIME;
99
:struct mouse
99
:struct mouse
100
{
100
{
101
	signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,left,top;
101
	signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,left,top;
102
	dword handle,_;
102
	dword handle,_;
Line 294... Line 294...
294
	EDX = 40;
294
	EDX = 40;
295
	$int 0x40
295
	$int 0x40
296
}
296
}
Line 297... Line 297...
297
 
297
 
298
//------------------------------------------------------------------------------
298
//------------------------------------------------------------------------------
299
dword wait_event_code;
299
:dword wait_event_code;
300
inline fastcall dword WaitEvent()
300
inline fastcall dword WaitEvent()
301
{
301
{
302
	$mov eax,10
302
	$mov eax,10
303
	$int 0x40
303
	$int 0x40
Line 373... Line 373...
373
	$mov ebx, 16
373
	$mov ebx, 16
374
	$int 0x40
374
	$int 0x40
375
	//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
375
	//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
376
}
376
}
Line -... Line 377...
-
 
377
 
-
 
378
inline void draw_line(dword x1,y1,x2,y2,color)
-
 
379
{
-
 
380
	x2--;y2--;y1--;
-
 
381
	$mov EAX,38
-
 
382
	EBX = x1<<16;
-
 
383
	EBX |= x2;
-
 
384
	ECX = y1<<16;
-
 
385
	ECX |= y2;
-
 
386
	$mov EDX,color
-
 
387
	$int 0x40
-
 
388
}
377
 
389
 
378
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
390
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
379
{
391
{
380
	$mov eax, 68
392
	$mov eax, 68
381
	$mov ebx, 16
393
	$mov ebx, 16
Line 759... Line 771...
759
	EBX = x<<16+w;
771
	EBX = x<<16+w;
760
	ECX = y<<16+h;
772
	ECX = y<<16+h;
761
	$int 0x40
773
	$int 0x40
762
}
774
}
Line -... Line 775...
-
 
775
 
-
 
776
inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
-
 
777
{
-
 
778
	EAX = 18;
-
 
779
	EBX = 22;
-
 
780
	ECX = 3;
-
 
781
	EDX = ID_REFRESH;
-
 
782
	$int 0x40
-
 
783
	EAX = 18;
-
 
784
	EBX = 3;
-
 
785
	EDX = ID_ACTIVE;
-
 
786
	$int 0x40
-
 
787
}
763
 
788
 
764
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
789
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
765
{
790
{
766
	EAX = 8;
791
	EAX = 8;
767
	EBX = x<<16+w;
792
	EBX = x<<16+w;
Line 806... Line 831...
806
	ALERT_TEXT = text;
831
	ALERT_TEXT = text;
807
	CreateThread(#dialog_alert,mem+4092);
832
	CreateThread(#dialog_alert,mem+4092);
808
	return mem;
833
	return mem;
809
}
834
}
Line -... Line 835...
-
 
835
 
-
 
836
:struct _screen
-
 
837
{
-
 
838
	dword width,height;
-
 
839
} screen;
-
 
840
 
-
 
841
:struct _skin
-
 
842
{
-
 
843
	dword width,height;
-
 
844
} skin;
810
 
845
 
Line 811... Line 846...
811
dword __generator;  // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
846
dword __generator;  // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
Line 812... Line 847...
812
 
847
 
813
dword program_path_length;
848
:dword program_path_length;
814
 
849
 
-
 
850
//The initialization of the initial data before running
-
 
851
void load_init_main()
-
 
852
{
-
 
853
	skin.height   = GetSkinHeight();
-
 
854
	
815
//The initialization of the initial data before running
855
	screen.width  = GetScreenWidth();
816
void load_init_main()
856
	screen.height = GetScreenHeight();
817
{
857
	
-
 
858
	//program_path_length = strlen(I_Path);
818
	//program_path_length = strlen(program_path);
859
	MOUSE_TIME = 50; //Default 500 ms.
819
	MOUSE_TIME = 50; //Default 500 ms.
860
	__generator = GetStartTime();
820
	__generator = GetStartTime();
861
	//mem_Init();