Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
990 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)
990 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
 
2753 clevermous 83
union sProcessInfo
990 barsuk 84
{
85
	Byte rawData[1024];
86
	struct
87
	{
88
		Dword cpu_usage;
89
		Word window_stack_position;
90
		Word window_stack_value;
91
		Word reserved1;
92
		char process_name[12];
93
		Dword memory_start;
94
		Dword used_memory;
95
		Dword PID;
96
		Dword x_start;
97
		Dword y_start;
98
		Dword x_size;
99
		Dword y_size;
100
		Word slot_state;
101
	} processInfo;
102
};
103
#pragma pack(pop)
2753 clevermous 104
990 barsuk 105
 
1764 clevermous 106
//
990 barsuk 107
extern char *kosExePath;
108
#endif
1764 clevermous 109
990 barsuk 110
 
111
void crtStartUp();
112
//
113
int __cdecl _purecall();
114
//
115
int __cdecl atexit( void (__cdecl *func )( void ));
116
//
117
void rtlSrand( Dword seed );
118
Dword rtlRand( void );
119
//
120
char * __cdecl strcpy( char *target, const char *source );
121
int __cdecl strlen( const char *line );
122
char * __cdecl strrchr( const char * string, int c );
123
124
 
7495 leency 125
#if _MSC_VER < 1400
990 barsuk 126
extern "C" void * __cdecl memcpy( void *dst, const void *src, size_t bytesCount );
127
extern "C" void memset( Byte *dst, Byte filler, Dword count );
128
//#pragma intrinsic(memcpy,memset)
129
#elif defined AUTOBUILD
1764 clevermous 130
*/
7495 leency 131
void memcpy( void *dst, const void *src, size_t bytesCount );
1764 clevermous 132
void memset( Byte *dst, Byte filler, Dword count );
133
/*
7495 leency 134
#else
990 barsuk 135
void * __cdecl memcpy( void *dst, const void *src, size_t bytesCount );
136
void memset( Byte *dst, Byte filler, Dword count );
137
#endif
138
*/
7495 leency 139
990 barsuk 140
 
141
//
142
Dword rtlInterlockedExchange( Dword *target, Dword value );
143
// функция -1 завершения процесса
144
void kos_ExitApp();
145
// функция 0
146
void kos_DefineAndDrawWindow(
147
	Word x, Word y,
148
	Word sizeX, Word sizeY,
149
	Byte mainAreaType, Dword mainAreaColour,
150
	Byte headerType, Dword headerColour,
151
	Dword borderColour
152
	);
153
// функция 1 поставить точку
154
void kos_PutPixel( Dword x, Dword y, Dword colour );
155
// функция 2 получить код нажатой клавиши
156
bool kos_GetKey( Byte &keyCode );
157
// функция 3 получить время
158
Dword kos_GetSystemClock();
159
// функция 4
160
void __declspec(noinline) kos_WriteTextToWindow(
1764 clevermous 161
	Word x, Word y,
990 barsuk 162
	Byte fontType,
163
	Dword textColour,
164
	char *textPtr,
165
	Dword textLen
166
	);
167
// функция 7 нарисовать изображение
168
void kos_PutImage( RGB * imagePtr, Word sizeX, Word sizeY, Word x, Word y );
169
// функция 8 определить кнопку
170
void __declspec(noinline) kos_DefineButton( Word x, Word y, Word sizeX, Word sizeY, Dword buttonID, Dword colour );
1764 clevermous 171
// функция 5 пауза, в сотых долях секунды
990 barsuk 172
void kos_Pause( Dword value );
173
// функция 9 - информация о процессе
174
Dword kos_ProcessInfo( sProcessInfo *targetPtr, Dword processID = PROCESS_ID_SELF );
175
// функция 10
176
Dword kos_WaitForEvent();
177
// функция 11
178
Dword kos_CheckForEvent();
179
// функция 12
180
void kos_WindowRedrawStatus( Dword status );
181
// функция 13 нарисовать полосу
182
void __declspec(noinline) kos_DrawBar( Word x, Word y, Word sizeX, Word sizeY, Dword colour );
1764 clevermous 183
// функция 17
990 barsuk 184
bool kos_GetButtonID( Dword &buttonID );
185
// функция 23
186
Dword kos_WaitForEventTimeout( Dword timeOut );
2750 leency 187
//
990 barsuk 188
enum eNumberBase
189
{
190
	nbDecimal = 0,
191
	nbHex,
192
	nbBin
193
};
194
// получение информации о состоянии "мыши" функция 37
195
void kos_GetMouseState( Dword & buttons, int & cursorX, int & cursorY );
196
// функция 40 установить маску событий
197
void kos_SetMaskForEvents( Dword mask );
198
// функция 47 вывести в окно приложения число
199
void kos_DisplayNumberToWindow(
200
   Dword value,
201
   Dword digitsNum,
202
   Word x,
203
   Word y,
204
   Dword colour,
205
   eNumberBase nBase = nbDecimal,
206
   bool valueIsPointer = false
207
   );
208
// функция 58 доступ к файловой системе
209
Dword kos_FileSystemAccess( kosFileInfo *fileInfo );
210
// функция 63
211
void kos_DebugOutChar( char ccc );
212
//
213
void rtlDebugOutString( char *str );
214
// функция 64 изменить параметры окна, параметр == -1 не меняется
215
void kos_ChangeWindow( Dword x, Dword y, Dword sizeX, Dword sizeY );
216
// функция 67 изменение количества памяти, выделенной для программы
217
bool kos_ApplicationMemoryResize( Dword targetSize );
218
// функция 66 режим получения данных от клавиатуры
219
void kos_SetKeyboardDataMode( Dword mode );
220
221
 
222
223
 
224
void kos_Main();
225