Subversion Repositories Kolibri OS

Rev

Rev 1005 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1005 barsuk 1
 
2
3
 
4
typedef unsigned __int16 Word;
5
typedef unsigned __int8 Byte;
6
//typedef unsigned __int32 size_t;
7
8
 
9
10
 
11
12
 
13
#define FO_WRITE				2
14
15
 
16
#define EM_KEY_PRESS			2
17
#define EM_BUTTON_CLICK			4
18
#define EM_APP_CLOSE			8
19
#define EM_DRAW_BACKGROUND		16
20
#define EM_MOUSE_EVENT			32
21
#define EM_IPC					64
22
#define EM_NETWORK				256
23
24
 
25
#define KM_SCANS				1
26
27
 
28
#define WRS_END					2
29
30
 
31
32
 
33
34
 
1764 clevermous 35
extern "C" double __cdecl asin(double x);
36
extern "C" double __cdecl floor(double x);
37
extern "C" double __cdecl round(double x);
38
#pragma function(acos,asin)
1005 barsuk 39
#if _MSC_VER > 1200
40
#pragma function(floor)
41
#endif
42
43
 
44
 
45
{
46
	Dword rwMode;
47
	Dword OffsetLow;
48
	Dword OffsetHigh;
49
	Dword dataCount;
50
	Byte *bufferPtr;
51
	char fileURL[MAX_PATH];
52
};
53
54
 
55
 
56
{
57
	Byte b;
58
	Byte g;
59
	Byte r;
60
	//
61
	RGB() {};
62
	//
63
	RGB( Dword value )
64
	{
65
		r = (Byte)(value >> 16);
66
		g = (Byte)(value >> 8);
67
		b = (Byte)value;
68
	};
69
	//
70
	bool operator != ( RGB &another )
71
	{
72
		return this->b != another.b || this->g != another.g || this->r != another.r;
73
	};
74
	//
75
	bool operator == ( RGB &another )
76
	{
77
		return this->b == another.b && this->g == another.g && this->r == another.r;
78
	};
79
};
80
81
 
82
 
83
{
84
	Byte rawData[1024];
85
	struct
86
	{
87
		Dword cpu_usage;
88
		Word window_stack_position;
89
		Word window_stack_value;
90
		Word reserved1;
91
		char process_name[12];
92
		Dword memory_start;
93
		Dword used_memory;
94
		Dword PID;
95
		Dword x_start;
96
		Dword y_start;
97
		Dword x_size;
98
		Dword y_size;
99
		Word slot_state;
100
	} processInfo;
101
};
102
103
 
1764 clevermous 104
//
1005 barsuk 105
extern char *kosExePath;
106
#endif
1764 clevermous 107
1005 barsuk 108
 
109
void crtStartUp();
110
//
111
int __cdecl _purecall();
112
//
113
int __cdecl atexit( void (__cdecl *func )( void ));
114
//
115
void rtlSrand( Dword seed );
116
Dword rtlRand( void );
117
//
118
char * __cdecl strcpy( char *target, const char *source );
119
int __cdecl strlen( const char *line );
120
char * __cdecl strrchr( const char * string, int c );
121
122
 
123
extern "C" void * __cdecl memcpy( void *dst, const void *src, size_t bytesCount );
1764 clevermous 124
extern "C" void memset( Byte *dst, Byte filler, Dword count );
125
//#pragma intrinsic(memcpy,memset)
1005 barsuk 126
#elif defined AUTOBUILD
1764 clevermous 127
void memcpy( void *dst, const void *src, size_t bytesCount );
128
void memset( Byte *dst, Byte filler, Dword count );
129
#else
1005 barsuk 130
void * __cdecl memcpy( void *dst, const void *src, size_t bytesCount );
131
void memset( Byte *dst, Byte filler, Dword count );
132
#endif
133
134
 
135
//
136
Dword rtlInterlockedExchange( Dword *target, Dword value );
137
// функция -1 завершения процесса
138
void kos_ExitApp();
139
// функция 0
140
void kos_DefineAndDrawWindow(
141
	Word x, Word y,
142
	Word sizeX, Word sizeY,
143
	Byte mainAreaType, Dword mainAreaColour,
144
	Byte headerType, Dword headerColour,
145
	Dword borderColour
146
	);
147
// функция 1 поставить точку
148
void kos_PutPixel( Dword x, Dword y, Dword colour );
149
// функция 2 получить код нажатой клавиши
150
bool kos_GetKey( Byte &keyCode );
151
// функция 3 получить время
152
Dword kos_GetSystemClock();
153
// функция 4
154
void __declspec(noinline) kos_WriteTextToWindow(
1764 clevermous 155
	Word x, Word y,
1005 barsuk 156
	Byte fontType,
157
	Dword textColour,
158
	char *textPtr,
159
	Dword textLen
160
	);
161
// функция 7 нарисовать изображение
162
void kos_PutImage( RGB * imagePtr, Word sizeX, Word sizeY, Word x, Word y );
163
// функция 8 определить кнопку
164
void __declspec(noinline) kos_DefineButton( Word x, Word y, Word sizeX, Word sizeY, Dword buttonID, Dword colour );
1764 clevermous 165
// функция 5 пауза, в сотых долях секунды
1005 barsuk 166
void kos_Pause( Dword value );
167
// функция 9 - информация о процессе
168
Dword kos_ProcessInfo( sProcessInfo *targetPtr, Dword processID = PROCESS_ID_SELF );
169
// функция 10
170
Dword kos_WaitForEvent();
171
// функция 11
172
Dword kos_CheckForEvent();
173
// функция 12
174
void kos_WindowRedrawStatus( Dword status );
175
// функция 13 нарисовать полосу
176
void __declspec(noinline) kos_DrawBar( Word x, Word y, Word sizeX, Word sizeY, Dword colour );
1764 clevermous 177
// функция 17
1005 barsuk 178
bool kos_GetButtonID( Dword &buttonID );
179
// функция 23
180
Dword kos_WaitForEvent( Dword timeOut );
181
//
182
enum eNumberBase
183
{
184
	nbDecimal = 0,
185
	nbHex,
186
	nbBin
187
};
188
// получение информации о состоянии "мыши" функция 37
189
void kos_GetMouseState( Dword & buttons, int & cursorX, int & cursorY );
190
// функция 40 установить маску событий
191
void kos_SetMaskForEvents( Dword mask );
192
// функция 47 вывести в окно приложения число
193
void kos_DisplayNumberToWindow(
194
   Dword value,
195
   Dword digitsNum,
196
   Word x,
197
   Word y,
198
   Dword colour,
199
   eNumberBase nBase = nbDecimal,
200
   bool valueIsPointer = false
201
   );
202
// функция 58 доступ к файловой системе
203
Dword kos_FileSystemAccess( kosFileInfo *fileInfo );
204
// функция 63
205
void kos_DebugOutChar( char ccc );
206
//
207
void rtlDebugOutString( char *str );
208
// функция 64 изменить параметры окна, параметр == -1 не меняется
209
void kos_ChangeWindow( Dword x, Dword y, Dword sizeX, Dword sizeY );
210
// функция 67 изменение количества памяти, выделенной для программы
211
bool kos_ApplicationMemoryResize( Dword targetSize );
212
// функция 66 режим получения данных от клавиатуры
213
void kos_SetKeyboardDataMode( Dword mode );
214
215
 
216
217
 
218
void kos_Main();
219