Subversion Repositories Kolibri OS

Rev

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

Rev 8170 Rev 8184
Line 1... Line 1...
1
#ifndef __KOLIBRI_H_INCLUDED_
1
#ifndef __KOLIBRI_H_INCLUDED_
2
#define __KOLIBRI_H_INCLUDED_
2
#define __KOLIBRI_H_INCLUDED_
Line 3... Line 3...
3
 
3
 
Line 4... Line 4...
4
#include 
4
#include "kos_lib.h"
Line 5... Line 5...
5
 
5
 
6
// Kolibri interface.
6
// Kolibri interface.
Line 35... Line 35...
35
 
35
 
36
	// Some functions have two forms: the fast form with (thread_data) parameter and the form without it.
36
	// Some functions have two forms: the fast form with (thread_data) parameter and the form without it.
Line 37... Line 37...
37
	// Note: pass only thread data of current thread as (thread_data) parameter to these functions.
37
	// Note: pass only thread data of current thread as (thread_data) parameter to these functions.
-
 
38
 
38
 
39
	void Main();   // Main function is called at program startup.
39
	void Main();   // Main function is called at program startup.
40
	void DrawButton(long id, long color, long x, long y, long c_x, long c_y);   // Draw Standard button
40
	void* ThreadMain(void *user = 0, void *stack_begin = 0);
41
	void* ThreadMain(void *user = 0, void *stack_begin = 0);
41
			// Called at thread startup, (user) is placed in thread data as a user dword,
42
			// Called at thread startup, (user) is placed in thread data as a user dword,
42
			//_ (stack_begin) is placed in thread data as a stack beginning.
43
			//_ (stack_begin) is placed in thread data as a stack beginning.
Line 52... Line 53...
52
	void Invalidate(int frame = 0);   // Redraw current window when no message will be is the queue,
53
	void Invalidate(int frame = 0);   // Redraw current window when no message will be is the queue,
53
	void Invalidate(int frame, TThreadData thread_data);   //_ if (frame) is positive redraw the frame too,
54
	void Invalidate(int frame, TThreadData thread_data);   //_ if (frame) is positive redraw the frame too,
54
														   //_ if (frame) is negative do nothing.
55
														   //_ if (frame) is negative do nothing.
55
	void MoveWindow(const int window_rect[/* 4 */]);   // Move and resize current window.
56
	void MoveWindow(const int window_rect[/* 4 */]);   // Move and resize current window.
Line 56... Line 57...
56
 
57
 
57
	void Abort();   // Abnormally terminate a program.
58
	void ExitDebug();    // Abnormally terminate a program.
58
	void ExitProcess();   // Exit from the process, don't call any destructors of global varyables
59
	void ExitProcess();  // Exit from the process, don't call any destructors of global varyables
59
	void ExitThread();   // Exit from the current thread
60
	void ExitThread();   // Exit from the current thread
60
	void ExitThread(TThreadData thread_data);
61
	void ExitThread(TThreadData thread_data);
61
	void ReturnMessageLoop();   // Return to the message loop of the thread. Exit from the thread
62
	void ReturnMessageLoop();   // Return to the message loop of the thread. Exit from the thread
Line 132... Line 133...
132
			//_ If (stack_end) is zero, create stack in dynamic memory of size (stack_size) or
133
			//_ If (stack_end) is zero, create stack in dynamic memory of size (stack_size) or
133
			//_ the same size as the main thread if (stack_size) less that 4096. Set the beginning
134
			//_ the same size as the main thread if (stack_size) less that 4096. Set the beginning
134
			//_ of the stack if (stack_end) is zero or (stack_size) is not zero, in this case stack
135
			//_ of the stack if (stack_end) is zero or (stack_size) is not zero, in this case stack
135
			//_ will be deleted automaticaly from dynamic memory at the finish of the thread.
136
			//_ will be deleted automaticaly from dynamic memory at the finish of the thread.
136
	void DrawText(short x, short y, int color, const char* string);
137
	void DrawText(short x, short y, int color, const char* string);
-
 
138
	void SetWindowCaption(const char* caption);
137
}
139
}
Line 138... Line 140...
138
 
140
 
Line 139... Line 141...
139
// Function, defined outside.
141
// Function, defined outside.
Line 143... Line 145...
143
bool KolibriOnClose(Kolibri::TThreadData thread_data);     // Window will be closed iff return value is true.
145
bool KolibriOnClose(Kolibri::TThreadData thread_data);     // Window will be closed iff return value is true.
144
int KolibriOnIdle(Kolibri::TThreadData thread_data);       // Return the time to wait next message.
146
int KolibriOnIdle(Kolibri::TThreadData thread_data);       // Return the time to wait next message.
145
void KolibriOnSize(int window_rect[/* 4 */], Kolibri::TThreadData thread_data);  // When the window is resized.
147
void KolibriOnSize(int window_rect[/* 4 */], Kolibri::TThreadData thread_data);  // When the window is resized.
146
void KolibriOnKeyPress(Kolibri::TThreadData thread_data);  // When user press a key.
148
void KolibriOnKeyPress(Kolibri::TThreadData thread_data);  // When user press a key.
147
void KolibriOnMouse(Kolibri::TThreadData thread_data);     // When user move a mouse.
149
void KolibriOnMouse(Kolibri::TThreadData thread_data);     // When user move a mouse.
-
 
150
void KolibriOnButton(long id, Kolibri::TThreadData th);
Line 148... Line 151...
148
 
151
 
Line 149... Line 152...
149
#ifdef __KOLIBRI__
152
#ifdef __KOLIBRI__
150
 
153
 
Line 247... Line 250...
247
 
250
 
Line 248... Line 251...
248
	inline int GetThreadNumber() {return _ThreadNumber;}
251
	inline int GetThreadNumber() {return _ThreadNumber;}
Line 249... Line 252...
249
 
252
 
Line 250... Line 253...
250
// Constants from fasm.
253
// Constants from fasm.
Line 251... Line 254...
251
 
254
 
252
#include 
255
#include "kos_func.inc"