/contrib/C_Layer/ASM/loadboxlib.asm |
---|
11,25 → 11,15 |
include '../../../programs/system/run/trunk/txtbut.inc' |
include '../../../programs/dll.inc' |
public init_boxlib as '_init_boxlib_asm' |
public init_boxlib as '_kolibri_boxlib_init' |
public editbox_key_thunk as '_editbox_key@4' ; renamed due to ambiguity |
public press_key as '_press_key' |
;;; Returns 0 on success. -1 on failure. |
proc init_boxlib |
mcall 68,11 |
stdcall dll.Load, @IMPORT |
test eax, eax |
jnz error |
mov eax, 0 |
ret |
error: |
mov eax, -1 |
ret |
endp |
;; Wrapper to handle edit_box_key function for editboxes. |
/contrib/C_Layer/ASM/loadbuf2d.asm |
---|
10,23 → 10,13 |
include '../../../programs/dll.inc' |
public init_buf2d as '_init_buf2d_asm' |
public init_buf2d as '_kolibri_buf2d_init' |
;;; Returns 0 on success. -1 on failure. |
proc init_buf2d |
mcall 68,11 |
stdcall dll.Load, @IMPORT |
test eax, eax |
jnz error |
mov eax, 0 |
ret |
error: |
mov eax, -1 |
ret |
endp |
@IMPORT: |
/contrib/C_Layer/ASM/loadhttp.asm |
---|
16,24 → 16,14 |
http_msg http_msg |
end virtual |
public init_network as '_init_network_asm' |
public init_network as '_kolibri_http_init' |
;;; Returns 0 on success. -1 on failure. |
proc init_network |
mcall 68,11 |
stdcall dll.Load, @IMPORT |
test eax, eax |
jnz error |
mov eax, 0 |
ret |
error: |
mov eax, -1 |
ret |
endp |
@IMPORT: |
/contrib/C_Layer/ASM/loadkmenu.asm |
---|
9,23 → 9,13 |
include '../../../programs/dll.inc' |
public init_kmenu as '_init_kmenu_asm' |
public init_kmenu as '_kolibri_kmenu_init' |
;;; Returns 0 on success. -1 on failure. |
proc init_kmenu |
mcall 68,11 |
stdcall dll.Load, @IMPORT |
test eax, eax |
jnz error |
mov eax, 0 |
ret |
error: |
mov eax, -1 |
ret |
endp |
@IMPORT: |
/contrib/C_Layer/ASM/loadlibimg.asm |
---|
10,23 → 10,13 |
include '../../../programs/dll.inc' |
public init_libimg as '_init_libimg_asm' |
public init_libimg as '_kolibri_libimg_init' |
;;; Returns 0 on success. -1 on failure. |
proc init_libimg |
mcall 68,11 |
stdcall dll.Load, @IMPORT |
test eax, eax |
jnz error |
mov eax, 0 |
ret |
error: |
mov eax, -1 |
ret |
endp |
@IMPORT: |
/contrib/C_Layer/ASM/loadlibini.asm |
---|
10,24 → 10,14 |
include '../../../programs/dll.inc' |
public init_libini as '_init_libini_asm' |
public init_libini as '_kolibri_libini_init' |
;;; Returns 0 on success. -1 on failure. |
proc init_libini |
mcall 68,11 |
stdcall dll.Load, @IMPORT |
test eax, eax |
jnz error |
mov eax, 0 |
ret |
error: |
mov eax, -1 |
ret |
endp |
@IMPORT: |
/contrib/C_Layer/ASM/loadproclib.asm |
---|
10,23 → 10,13 |
include '../../../programs/dll.inc' |
public init_proclib as '_init_proclib_asm' |
public init_proclib as '_kolibri_proclib_init' |
;;; Returns 0 on success. -1 on failure. |
proc init_proclib |
mcall 68,11 |
stdcall dll.Load, @IMPORT |
test eax, eax |
jnz error |
mov eax, 0 |
ret |
error: |
mov eax, -1 |
ret |
endp |
@IMPORT: |
/contrib/C_Layer/EXAMPLE/rasterworks/rasterworks_example.c |
---|
14,13 → 14,14 |
kolibri_gui_init(); |
kolibri_rasterworks_init(); |
/* Set gui_event to REDRAW so that window is drawn in first iteration */ |
unsigned int gui_event = KOLIBRI_EVENT_REDRAW; |
unsigned int gui_event; |
oskey_t key; |
unsigned int pressed_button |
//extern volatile unsigned press_key; |
kolibri_window *main_window = kolibri_new_window(50, 50, 800, 300, "rasterworks example"); |
extern volatile unsigned press_key; |
int ln_str = countUTF8Z("Пример работы", -1); |
void *buffi = malloc(768*256*3 * sizeof(char)); |
38,40 → 39,28 |
drawText(buffi, 0, 128, "Пример работы", ln_str, 0xFF000000, 0x8030C18); |
drawText(buffi, 0, 160, "Пример работы", ln_str, 0xFF000000, 0x0F031428); |
do /* Start of main activity loop */ |
while(gui_event = get_os_event()) |
{ |
if(gui_event == KOLIBRI_EVENT_REDRAW) |
switch (gui_event) |
{ |
case KOLIBRI_EVENT_REDRAW: |
kolibri_handle_event_redraw(main_window); |
DrawBitmap(buffi, 5, 5, 768, 256); |
} |
else if(gui_event == KOLIBRI_EVENT_KEY) |
{ |
key = get_key(); |
switch (key.code) |
{ |
} |
press_key = key.val; |
break; |
kolibri_handle_event_key(main_window); |
} |
else if(gui_event == KOLIBRI_EVENT_BUTTON) |
{ |
unsigned int pressed_button = kolibri_button_get_identifier(); |
case KOLIBRI_EVENT_BUTTON: |
pressed_button = kolibri_button_get_identifier(); |
switch (pressed_button) |
{ |
case BUTTON_CLOSE: |
kolibri_exit(); |
} |
} |
else if(gui_event == KOLIBRI_EVENT_MOUSE) |
{ |
break; |
case KOLIBRI_EVENT_MOUSE: |
kolibri_handle_event_mouse(main_window); |
break; |
} |
} while((gui_event = get_os_event())); /* End of main activity loop */ |
/* kolibri_quit(); */ |
} |
return 0; |
} |
/contrib/C_Layer/INCLUDE/kolibri_boxlib.h |
---|
1,18 → 1,6 |
#ifndef KOLIBRI_BOXLIB_H |
#define KOLIBRI_BOXLIB_H |
extern int init_boxlib_asm(void); |
extern int kolibri_boxlib_init(void); |
int kolibri_boxlib_init(void) |
{ |
int asm_init_status = init_boxlib_asm(); |
/* just return asm_init_status? or return init_boxlib_asm() ?*/ |
if(asm_init_status == 0) |
return 0; |
else |
return 1; |
} |
#endif /* KOLIBRI_BOXLIB_H */ |
/contrib/C_Layer/INCLUDE/kolibri_buf2d.h |
---|
5,21 → 5,8 |
* voxel function |
*/ |
extern int init_buf2d_asm(void); |
extern int kolibri_buf2d_init(void); |
int kolibri_buf2d_init(void) |
{ |
int asm_init_status = init_buf2d_asm(); |
/* just return asm_init_status? or return init_boxlib_asm() ?*/ |
if(asm_init_status == 0) |
return 0; |
else |
return 1; |
} |
typedef struct { |
unsigned int *buf_pointer; |
uint16_t left; |
/contrib/C_Layer/INCLUDE/kolibri_kmenu.h |
---|
1,22 → 1,20 |
#ifndef KOLIBRI_KMENU_H |
#define KOLIBRI_KMENU_H |
extern int init_kmenu_asm(void); |
#define KMENUITEM_NORMAL 0 |
#define KMENUITEM_SUBMENU 1 |
#define KMENUITEM_SEPARATOR 2 |
int kolibri_kmenu_init(void) |
{ |
int asm_init_status = init_kmenu_asm(); |
#define KMENUITEM_MAINMENU 0x80000000 |
/* just return asm_init_status? or return init_boxlib_asm() ?*/ |
#define KMENUITEM_SEPARATOR_WIDTH 10//170 |
#define KMENUITEM_SEPARATOR_HEIGHT 2 |
if(asm_init_status == 0) |
return 0; |
else |
return 1; |
} |
#define KMENU_LBORDER_SIZE 2 |
#define KMENU_DBORDER_SIZE 1 |
extern int kolibri_kmenu_init(void); |
extern void (*kmainmenu_draw)(void *) __attribute__((__stdcall__)); |
extern void (*kmainmenu_dispatch_cursorevent)(void *) __attribute__((__stdcall__)); |
extern void (*kmenu_init)(void *) __attribute__((__stdcall__)); |
/contrib/C_Layer/INCLUDE/kolibri_libimg.h |
---|
1,18 → 1,8 |
#ifndef KOLIBRI_LIBIMG_H |
#define KOLIBRI_LIBIMG_H |
int kolibri_libimg_init(void) |
{ |
int asm_init_status = init_libimg_asm(); |
extern int kolibri_libimg_init(void); |
/* just return asm_init_status? or return init_libimg_asm() ?*/ |
if(asm_init_status == 0) |
return 0; |
else |
return 1; |
} |
//list of format id's |
#define LIBIMG_FORMAT_BMP 1 |
#define LIBIMG_FORMAT_ICO 2 |
/contrib/C_Layer/INCLUDE/kolibri_libini.h |
---|
1,20 → 1,8 |
#ifndef KOLIBRI_LIBINI_H |
#define KOLIBRI_LIBINI_H |
extern int init_libini_asm(void); |
extern int kolibri_libini_init(void); |
int kolibri_libini_init(void) |
{ |
int asm_init_status = init_libini_asm(); |
/* just return asm_init_status? or return init_boxlib_asm() ?*/ |
if(asm_init_status == 0) |
return 0; |
else |
return 1; |
} |
extern uint32_t (*LIBINI_enum_sections)(const char*, void*) __attribute__((__stdcall__)); |
extern uint32_t (*LIBINI_enum_keys)(const char*, const char*, void*) __attribute__((__stdcall__)); |
/contrib/C_Layer/INCLUDE/kolibri_proclib.h |
---|
1,18 → 1,8 |
#ifndef KOLIBRI_PROCLIB_H |
#define KOLIBRI_PROCLIB_H |
int kolibri_proclib_init(void) |
{ |
int asm_init_status = init_proclib_asm(); |
extern int kolibri_proclib_init(void) |
/* just return asm_init_status? or return init_proclib_asm() ?*/ |
if(asm_init_status == 0) |
return 0; |
else |
return 1; |
} |
enum Mode { |
OD_OPEN, |
OD_SAVE, |