Subversion Repositories Kolibri OS

Rev

Rev 2750 | Rev 7495 | 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
 
125
extern "C" void * __cdecl memcpy( void *dst, const void *src, size_t bytesCount );
126
extern "C" void memset( Byte *dst, Byte filler, Dword count );
127
//#pragma intrinsic(memcpy,memset)
128
#elif defined AUTOBUILD
1764 clevermous 129
void memcpy( void *dst, const void *src, size_t bytesCount );
130
void memset( Byte *dst, Byte filler, Dword count );
131
#else
990 barsuk 132
void * __cdecl memcpy( void *dst, const void *src, size_t bytesCount );
133
void memset( Byte *dst, Byte filler, Dword count );
134
#endif
135
136
 
137
//
138
Dword rtlInterlockedExchange( Dword *target, Dword value );
139
// функция -1 завершения процесса
140
void kos_ExitApp();
141
// функция 0
142
void kos_DefineAndDrawWindow(
143
	Word x, Word y,
144
	Word sizeX, Word sizeY,
145
	Byte mainAreaType, Dword mainAreaColour,
146
	Byte headerType, Dword headerColour,
147
	Dword borderColour
148
	);
149
// функция 1 поставить точку
150
void kos_PutPixel( Dword x, Dword y, Dword colour );
151
// функция 2 получить код нажатой клавиши
152
bool kos_GetKey( Byte &keyCode );
153
// функция 3 получить время
154
Dword kos_GetSystemClock();
155
// функция 4
156
void __declspec(noinline) kos_WriteTextToWindow(
1764 clevermous 157
	Word x, Word y,
990 barsuk 158
	Byte fontType,
159
	Dword textColour,
160
	char *textPtr,
161
	Dword textLen
162
	);
163
// функция 7 нарисовать изображение
164
void kos_PutImage( RGB * imagePtr, Word sizeX, Word sizeY, Word x, Word y );
165
// функция 8 определить кнопку
166
void __declspec(noinline) kos_DefineButton( Word x, Word y, Word sizeX, Word sizeY, Dword buttonID, Dword colour );
1764 clevermous 167
// функция 5 пауза, в сотых долях секунды
990 barsuk 168
void kos_Pause( Dword value );
169
// функция 9 - информация о процессе
170
Dword kos_ProcessInfo( sProcessInfo *targetPtr, Dword processID = PROCESS_ID_SELF );
171
// функция 10
172
Dword kos_WaitForEvent();
173
// функция 11
174
Dword kos_CheckForEvent();
175
// функция 12
176
void kos_WindowRedrawStatus( Dword status );
177
// функция 13 нарисовать полосу
178
void __declspec(noinline) kos_DrawBar( Word x, Word y, Word sizeX, Word sizeY, Dword colour );
1764 clevermous 179
// функция 17
990 barsuk 180
bool kos_GetButtonID( Dword &buttonID );
181
// функция 23
182
Dword kos_WaitForEventTimeout( Dword timeOut );
2750 leency 183
//
990 barsuk 184
enum eNumberBase
185
{
186
	nbDecimal = 0,
187
	nbHex,
188
	nbBin
189
};
190
// получение информации о состоянии "мыши" функция 37
191
void kos_GetMouseState( Dword & buttons, int & cursorX, int & cursorY );
192
// функция 40 установить маску событий
193
void kos_SetMaskForEvents( Dword mask );
194
// функция 47 вывести в окно приложения число
195
void kos_DisplayNumberToWindow(
196
   Dword value,
197
   Dword digitsNum,
198
   Word x,
199
   Word y,
200
   Dword colour,
201
   eNumberBase nBase = nbDecimal,
202
   bool valueIsPointer = false
203
   );
204
// функция 58 доступ к файловой системе
205
Dword kos_FileSystemAccess( kosFileInfo *fileInfo );
206
// функция 63
207
void kos_DebugOutChar( char ccc );
208
//
209
void rtlDebugOutString( char *str );
210
// функция 64 изменить параметры окна, параметр == -1 не меняется
211
void kos_ChangeWindow( Dword x, Dword y, Dword sizeX, Dword sizeY );
212
// функция 67 изменение количества памяти, выделенной для программы
213
bool kos_ApplicationMemoryResize( Dword targetSize );
214
// функция 66 режим получения данных от клавиатуры
215
void kos_SetKeyboardDataMode( Dword mode );
216
217
 
218
219
 
220
void kos_Main();
221