/programs/develop/ktcc/trunk/bin/lib/clayer/loadboxlib.o |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programs/develop/ktcc/trunk/bin/lib/libbox.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/x-archive |
Property changes: |
Added: svn:mime-type |
+application/x-archive |
\ No newline at end of property |
/programs/develop/ktcc/trunk/bin/lib/libbuf2d.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/x-archive |
Property changes: |
Added: svn:mime-type |
+application/x-archive |
\ No newline at end of property |
/programs/develop/ktcc/trunk/lib/clayer/loadboxlib.asm |
---|
File deleted |
/programs/develop/ktcc/trunk/lib/boxlib/Makefile |
---|
0,0 → 1,10 |
all: |
fasm boxlib.asm |
ar -crs libbox.a boxlib.o |
clean: |
rm -f *.a |
rm -f *.o |
install: |
mv libbox.a ../../bin/lib |
/programs/develop/ktcc/trunk/lib/boxlib/boxlib.asm |
---|
0,0 → 1,231 |
; writed by maxñodehack |
; adaptation of clayer for ktcc |
format elf |
use32 ; Tell compiler to use 32 bit instructions |
; ELF section |
section '.text' executable |
include '../../../../../proc32.inc' |
include '../../../../../macros.inc' |
purge section,mov,add,sub |
include '../../../../../dll.inc' |
public init_boxlib as 'kolibri_boxlib_init' |
proc init_boxlib |
local retval dd ? |
mov [retval], eax |
pusha |
mcall 68, 11 |
test eax, eax |
jnz @f |
mov [retval], -1 |
jmp exit_init_boxlib |
@@: |
stdcall dll.Load, @IMPORT |
test eax, eax |
jz exit_init_boxlib |
mov [retval], -1 |
exit_init_boxlib: |
popa |
mov eax, [retval] |
ret |
endp |
;; Wrapper to handle edit_box_key function for editboxes. |
;; Call this baby from C (refer kolibri_editbox.h for details) |
;public editbox_key_thunk as '_editbox_key@4' ; renamed due to ambiguity |
;public press_key as '_press_key' |
;; replaced by siemargl as inline ASM in C wrapper |
;editbox_key_thunk: |
; mov [oldebp], ebp ;Save ebp because GCC is crazy for it otherwise. |
; pop ebp ;Save return address in ebp. Stack top is param now. |
; mov eax, dword [press_key] |
; call [edit_box_key] ; The pointer we passed should be on the stack already. |
; push ebp ;push the return address back to stack |
; mov ebp, [oldebp] |
; ret |
;oldebp dd ? |
;press_key dd ? |
section '.data' writeable |
@IMPORT: |
library lib_boxlib, 'box_lib.obj' |
import lib_boxlib, \ |
edit_box_draw, 'edit_box' , \ |
edit_box_key, 'edit_box_key' , \ |
edit_box_mouse, 'edit_box_mouse', \ |
edit_box_set_text, 'edit_box_set_text' , \ |
init_checkbox2, 'init_checkbox2' , \ |
check_box_draw2, 'check_box_draw2' , \ |
check_box_mouse2, 'check_box_mouse2' , \ |
option_box_draw, 'option_box_draw' , \ |
option_box_mouse, 'option_box_mouse' , \ |
scrollbar_v_draw, 'scrollbar_v_draw' , \ |
scrollbar_v_mouse, 'scrollbar_v_mouse' , \ |
scrollbar_h_draw, 'scrollbar_h_draw' , \ |
scrollbar_h_mouse, 'scrollbar_h_mouse' , \ |
dynamic_button_draw, 'dbutton_draw' , \ |
dynamic_button_mouse, 'dbutton_mouse' , \ |
menu_bar_draw, 'menu_bar_draw' , \ |
menu_bar_mouse, 'menu_bar_mouse' , \ |
menu_bar_activate, 'menu_bar_activate' , \ |
fb_draw_panel, 'FileBrowser_draw' , \ |
fb_mouse, 'FileBrowser_mouse' , \ |
fb_key, 'FileBrowser_key' , \ |
tl_data_init, 'tl_data_init' , \ |
tl_data_clear, 'tl_data_clear' , \ |
tl_info_clear, 'tl_info_clear' , \ |
tl_key, 'tl_key' , \ |
tl_mouse, 'tl_mouse' , \ |
tl_draw, 'tl_draw' , \ |
tl_info_undo, 'tl_info_undo' , \ |
tl_info_redo, 'tl_info_redo' , \ |
tl_node_add, 'tl_node_add' , \ |
tl_node_set_data, 'tl_node_set_data' , \ |
tl_node_get_data, 'tl_node_get_data' , \ |
tl_node_delete, 'tl_node_delete' , \ |
tl_cur_beg, 'tl_cur_beg' , \ |
tl_cur_next, 'tl_cur_next' , \ |
tl_cur_perv, 'tl_cur_perv' , \ |
tl_node_close_open, 'tl_node_close_open' , \ |
tl_node_lev_inc, 'tl_node_lev_inc' , \ |
tl_node_lev_dec, 'tl_node_lev_dec' , \ |
tl_node_move_up, 'tl_node_move_up' , \ |
tl_node_move_down, 'tl_node_move_down' , \ |
tl_node_poi_get_info, 'tl_node_poi_get_info' , \ |
tl_node_poi_get_next_info, 'tl_node_poi_get_next_info' , \ |
tl_node_poi_get_data, 'tl_node_poi_get_data' , \ |
tl_save_mem, 'tl_save_mem' , \ |
tl_load_mem, 'tl_load_mem' , \ |
tl_get_mem_size, 'tl_get_mem_size' , \ |
path_show_prepare, 'PathShow_prepare' , \ |
path_show_draw, 'PathShow_draw' , \ |
ted_but_sumb_upper, 'ted_but_sumb_upper' , \ |
ted_but_sumb_lover, 'ted_but_sumb_lover' , \ |
ted_but_convert_by_table, 'ted_but_convert_by_table' , \ |
ted_can_save, 'ted_can_save' , \ |
ted_clear, 'ted_clear' , \ |
ted_delete, 'ted_delete' , \ |
ted_draw, 'ted_draw' , \ |
ted_init, 'ted_init' , \ |
ted_init_scroll_bars, 'ted_init_scroll_bars' , \ |
ted_init_syntax_file, 'ted_init_syntax_file' , \ |
ted_is_select, 'ted_is_select' , \ |
ted_key, 'ted_key' , \ |
ted_mouse, 'ted_mouse' , \ |
ted_open_file, 'ted_open_file' , \ |
ted_save_file, 'ted_save_file' , \ |
ted_text_add, 'ted_text_add' , \ |
ted_but_select_word, 'ted_but_select_word' , \ |
ted_but_cut, 'ted_but_cut' , \ |
ted_but_copy, 'ted_but_copy' , \ |
ted_but_paste, 'ted_but_paste' , \ |
ted_but_undo, 'ted_but_undo' , \ |
ted_but_redo, 'ted_but_redo' , \ |
ted_but_reverse, 'ted_but_reverse' , \ |
ted_but_find, 'ted_but_find' , \ |
ted_but_replace, 'ted_but_replace' , \ |
ted_text_colored, 'ted_text_colored' , \ |
ted_go_to_position, 'ted_go_to_position' , \ |
frame_draw, 'frame_draw' , \ |
progressbar_draw,'progressbar_draw' , \ |
progressbar_progress, 'progressbar_progress' |
public edit_box_draw as 'edit_box_draw' |
public edit_box_key as 'edit_box_key' |
public edit_box_mouse as 'edit_box_mouse' |
public edit_box_set_text as 'edit_box_set_text' |
public check_box_draw2 as 'check_box_draw2' |
public check_box_mouse2 as 'check_box_mouse2' |
public init_checkbox2 as 'init_checkbox2' |
public progressbar_draw as 'progressbar_draw' |
public progressbar_progress as 'progressbar_progress' |
public frame_draw as 'frame_draw' |
public scrollbar_v_draw as 'scrollbar_v_draw' |
public scrollbar_v_mouse as 'scrollbar_v_mouse' |
public scrollbar_h_draw as 'scrollbar_h_draw' |
public scrollbar_h_mouse as 'scrollbar_h_mouse' |
public option_box_draw as 'option_box_draw' |
public option_box_mouse as 'option_box_mouse' |
public menu_bar_draw as 'menu_bar_draw' |
public menu_bar_mouse as 'menu_bar_mouse' |
public menu_bar_activate as 'menu_bar_activate' |
public dynamic_button_draw as 'dynamic_button_draw' |
public dynamic_button_mouse as 'dynamic_button_mouse' |
public path_show_prepare as 'path_show_prepare' |
public path_show_draw as 'path_show_draw' |
public fb_draw_panel as 'filebrowse_draw' |
public fb_mouse as 'filebrowse_mouse' |
public fb_key as 'filebrowse_key' |
public ted_but_sumb_upper as 'ted_but_sumb_upper' |
public ted_but_sumb_lover as 'ted_but_sumb_lover' |
public ted_but_convert_by_table as 'ted_but_convert_by_table' |
public ted_can_save as 'ted_can_save' |
public ted_clear as 'ted_clear' |
public ted_delete as 'ted_delete' |
public ted_draw as 'ted_draw' |
public ted_init as 'ted_init' |
public ted_init_scroll_bars as 'ted_init_scroll_bars' |
public ted_init_syntax_file as 'ted_init_syntax_file' |
public ted_is_select as 'ted_is_select' |
public ted_key as 'ted_key_asm' |
public ted_mouse as 'ted_mouse' |
public ted_open_file as 'ted_open_file_asm' |
public ted_save_file as 'ted_save_file_asm' |
public ted_text_add as '_ted_text_add' |
public ted_but_select_word as 'ted_but_select_word' |
public ted_but_cut as 'ted_but_cut' |
public ted_but_copy as 'ted_but_copy' |
public ted_but_paste as 'ted_but_paste' |
public ted_but_undo as 'ted_but_undo' |
public ted_but_redo as 'ted_but_redo' |
public ted_but_reverse as 'ted_but_reverse' |
public ted_but_find as 'ted_but_find' |
public ted_but_replace as 'ted_but_replace' |
public ted_text_colored as 'ted_text_colored_asm' |
public ted_go_to_position as 'ted_go_to_position' |
public tl_data_init as 'tl_data_init' |
public tl_data_clear as 'tl_data_clear' |
public tl_info_clear as 'tl_info_clear' |
public tl_key as 'tl_key_asm' |
public tl_mouse as 'tl_mouse' |
public tl_draw as 'tl_draw' |
public tl_info_undo as 'tl_info_undo' |
public tl_info_redo as 'tl_info_redo' |
public tl_node_add as 'tl_node_add' |
public tl_node_set_data as 'tl_node_set_data' |
public tl_node_get_data as 'tl_node_get_data' |
public tl_node_delete as 'tl_node_delete' |
public tl_cur_beg as 'tl_cur_beg' |
public tl_cur_next as 'tl_cur_next' |
public tl_cur_perv as 'tl_cur_perv' |
public tl_node_close_open as 'tl_node_close_open' |
public tl_node_lev_inc as 'tl_node_lev_inc' |
public tl_node_lev_dec as 'tl_node_lev_dec' |
public tl_node_move_up as 'tl_node_move_up' |
public tl_node_move_down as 'tl_node_move_down' |
public tl_node_poi_get_info as 'tl_node_poi_get_info' |
public tl_node_poi_get_next_info as 'tl_node_poi_get_next_info' |
public tl_node_poi_get_data as 'tl_node_poi_get_data' |
public tl_save_mem as 'tl_save_mem_asm' |
public tl_load_mem as 'tl_load_mem_asm' |
public tl_get_mem_size as 'tl_get_mem_size_asm' |
/programs/develop/ktcc/trunk/lib/buf2d/Makefile |
---|
0,0 → 1,10 |
all: |
fasm buf2d.asm buf2d.o |
ar -csr libbuf2d.a buf2d.o |
clean: |
rm -f *.a |
rm -f *.o |
install: |
mv *.a ../../bin/lib |
/programs/develop/ktcc/trunk/lib/buf2d/buf2d.asm |
---|
0,0 → 1,90 |
format elf |
use32 ; Tell compiler to use 32 bit instructions |
section '.text' executable |
include '../../../../../proc32.inc' |
include '../../../../../macros.inc' |
purge section,mov,add,sub |
include '../../../../../dll.inc' |
;public lib_init as 'kolibri_buf2d_init' |
;;; Returns 0 on success. -1 on failure. |
public init_buf2d as 'kolibri_buf2d_init' |
proc init_buf2d |
pusha |
mcall 68,11 |
stdcall dll.Load, @IMPORT |
popa |
ret |
endp |
section '.data' writeable |
@IMPORT: |
library lib_buf2d, 'buf2d.obj' |
import lib_buf2d, \ |
libbuf2d_init, 'lib_init' , \ |
buf2d_create, 'buf2d_create' , \ |
buf2d_clear, 'buf2d_clear' , \ |
buf2d_draw, 'buf2d_draw' , \ |
buf2d_delete, 'buf2d_delete', \ |
buf2d_rotate, 'buf2d_rotate', \ |
buf2d_resize, 'buf2d_resize', \ |
buf2d_line, 'buf2d_line', \ |
buf2d_line_sm, 'buf2d_line_sm', \ |
buf2d_rect_by_size, 'buf2d_rect_by_size', \ |
buf2d_filled_rect_by_size, 'buf2d_filled_rect_by_size', \ |
buf2d_circle, 'buf2d_circle', \ |
buf2d_img_hdiv2, 'buf2d_img_hdiv2', \ |
buf2d_img_wdiv2, 'buf2d_img_wdiv2', \ |
buf2d_conv_24_to_8, 'buf2d_conv_24_to_8', \ |
buf2d_conv_24_to_32, 'buf2d_conv_24_to_32', \ |
buf2d_bit_blt, 'buf2d_bit_blt', \ |
buf2d_bit_blt_transp, 'buf2d_bit_blt_transp', \ |
buf2d_bit_blt_alpha, 'buf2d_bit_blt_alpha', \ |
buf2d_curve_bezier, 'buf2d_curve_bezier', \ |
buf2d_convert_text_matrix, 'buf2d_convert_text_matrix', \ |
buf2d_draw_text, 'buf2d_draw_text', \ |
buf2d_crop_color, 'buf2d_crop_color', \ |
buf2d_offset_h, 'buf2d_offset_h', \ |
buf2d_flood_fill, 'buf2d_flood_fill', \ |
buf2d_set_pixel, 'buf2d_set_pixel', \ |
buf2d_get_pixel, 'buf2d_get_pixel', \ |
buf2d_flip_h, 'buf2d_flip_h', \ |
buf2d_flip_v, 'buf2d_flip_v', \ |
buf2d_filter_dither, 'buf2d_filter_dither' |
public libbuf2d_init as 'libimg_init' |
public buf2d_create as 'buf2d_create_asm' |
public buf2d_clear as 'buf2d_clear' |
public buf2d_draw as 'buf2d_draw' |
public buf2d_delete as 'buf2d_delete' |
public buf2d_rotate as 'buf2d_rotate' |
public buf2d_resize as 'buf2d_resize' |
public buf2d_line as 'buf2d_line' |
public buf2d_line_sm as 'buf2d_line_sm' |
public buf2d_rect_by_size as 'buf2d_rect_by_size' |
public buf2d_filled_rect_by_size as 'buf2d_filled_rect_by_size' |
public buf2d_circle as 'buf2d_circle' |
public buf2d_img_hdiv2 as 'buf2d_img_hdiv2' |
public buf2d_img_wdiv2 as 'buf2d_img_wdiv2' |
public buf2d_conv_24_to_8 as 'buf2d_conv_24_to_8' |
public buf2d_conv_24_to_32 as 'buf2d_conv_24_to_32' |
public buf2d_bit_blt as 'buf2d_bit_blt' |
public buf2d_bit_blt_transp as 'buf2d_bit_blt_transp' |
public buf2d_bit_blt_alpha as 'buf2d_bit_blt_alpha' |
public buf2d_curve_bezier as 'buf2d_curve_bezier_asm' |
public buf2d_convert_text_matrix as 'buf2d_convert_text_matrix' |
public buf2d_draw_text as 'buf2d_draw_text' |
public buf2d_crop_color as 'buf2d_crop_color' |
public buf2d_offset_h as 'buf2d_offset_h' |
public buf2d_flood_fill as 'buf2d_flood_fill' |
public buf2d_set_pixel as 'buf2d_set_pixel' |
public buf2d_get_pixel as 'buf2d_get_pixel' |
public buf2d_flip_h as 'buf2d_flip_h' |
public buf2d_flip_v as 'buf2d_flip_v' |
public buf2d_filter_dither as 'buf2d_filter_dither' |
/programs/develop/ktcc/trunk/libc/include/clayer/readme.txt |
---|
File deleted |
\ No newline at end of file |
/programs/develop/ktcc/trunk/libc/include/clayer/buf2d.h |
---|
0,0 → 1,83 |
#ifndef KOLIBRI_BUF2D_H |
#define KOLIBRI_BUF2D_H |
#include <stdint.h> |
/*ToDo |
* voxel function |
*/ |
extern int kolibri_buf2d_init(void); |
typedef struct { |
unsigned int *buf_pointer; |
uint16_t left; |
uint16_t top; |
unsigned int width; |
unsigned int height; |
unsigned int bgcolor; |
uint8_t color_bit; |
} __attribute__ ((__packed__))buf2d_struct; |
enum BUF2D_ALGORITM_FILTR { |
SIERRA_LITE, |
FLOYD_STEINBERG, |
BURKERS, |
HEAVYIRON_MOD, |
ATKINSON |
}; |
enum BUF2D_OPT_CROP { |
BUF2D_OPT_CROP_TOP = 1, |
BUF2D_OPT_CROP_LEFT = 2, |
BUF2D_OPT_CROP_BOTTOM = 4, |
BUF2D_OPT_CROP_RIGHT = 8 |
}; |
extern void (*buf2d_create_asm __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_curve_bezier_asm __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
buf2d_struct* buf2d_create(uint16_t tlx, uint16_t tly, unsigned int sizex, unsigned int sizey, unsigned int font_bgcolor, uint8_t color_bit) |
{ |
buf2d_struct *new_buf2d_struct = (buf2d_struct *)malloc(sizeof(buf2d_struct)); |
new_buf2d_struct -> left = tlx; |
new_buf2d_struct -> top = tly; |
new_buf2d_struct -> width = sizex; |
new_buf2d_struct -> height = sizey; |
new_buf2d_struct -> bgcolor = font_bgcolor; |
new_buf2d_struct -> color_bit = color_bit; |
buf2d_create_asm(new_buf2d_struct); |
return new_buf2d_struct; |
} |
void buf2d_curve_bezier(buf2d_struct *buf, unsigned int p0_x, unsigned int p0_y, unsigned int p1_x, unsigned int p1_y, unsigned int p2_x, unsigned int p2_y, unsigned int color) |
{ |
buf2d_curve_bezier_asm(buf, (p0_x<<16)+p0_y, (p1_x<<16)+p1_y, (p2_x<<16)+p2_y, color); |
} |
extern void (*buf2d_draw __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_clear __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
extern void (*buf2d_delete __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_rotate __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
extern void (*buf2d_resize __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_line __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_line_sm __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_rect_by_size __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_filled_rect_by_size __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_circle __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_img_hdiv2 __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_img_wdiv2 __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_conv_24_to_8 __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
extern void (*buf2d_conv_24_to_32 __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
extern void (*buf2d_bit_blt_transp __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *); |
extern void (*buf2d_bit_blt_alpha __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, buf2d_struct *); |
extern void (*buf2d_convert_text_matrix __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_draw_text __attribute__((__stdcall__)))(buf2d_struct *, buf2d_struct *, const char *, unsigned int, unsigned int); |
extern void (*buf2d_crop_color __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int); |
extern void (*buf2d_offset_h __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_flood_fill __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int, unsigned int); |
extern void (*buf2d_set_pixel __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int, unsigned int); |
extern unsigned int (*buf2d_get_pixel __attribute__((__stdcall__)))(buf2d_struct *, unsigned int, unsigned int); |
extern void (*buf2d_flip_h __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_flip_v __attribute__((__stdcall__)))(buf2d_struct *); |
extern void (*buf2d_filter_dither __attribute__((__stdcall__)))(buf2d_struct *, unsigned int); |
#endif /* KOLIBRI_BUF2D_H */ |
/programs/develop/ktcc/trunk/libc/include/clayer/libimg.h |
---|
0,0 → 1,64 |
#ifndef KOLIBRI_LIBIMG_H |
#define KOLIBRI_LIBIMG_H |
extern int kolibri_libimg_init(void); |
//list of format id's |
#define LIBIMG_FORMAT_BMP 1 |
#define LIBIMG_FORMAT_ICO 2 |
#define LIBIMG_FORMAT_CUR 3 |
#define LIBIMG_FORMAT_GIF 4 |
#define LIBIMG_FORMAT_PNG 5 |
#define LIBIMG_FORMAT_JPEG 6 |
#define LIBIMG_FORMAT_TGA 7 |
#define LIBIMG_FORMAT_PCX 8 |
#define LIBIMG_FORMAT_XCF 9 |
#define LIBIMG_FORMAT_TIFF 10 |
#define LIBIMG_FORMAT_PNM 11 |
#define LIBIMG_FORMAT_WBMP 12 |
#define LIBIMG_FORMAT_XBM 13 |
#define LIBIMG_FORMAT_Z80 14 |
//error codes |
#define LIBIMG_ERROR_OUT_OF_MEMORY 1 |
#define LIBIMG_ERROR_FORMAT 2 |
#define LIBIMG_ERROR_CONDITIONS 3 |
#define LIBIMG_ERROR_BIT_DEPTH 4 |
#define LIBIMG_ERROR_ENCODER 5 |
#define LIBIMG_ERROR_SRC_TYPE 6 |
#define LIBIMG_ERROR_SCALE 7 |
#define LIBIMG_ERROR_INTER 8 |
#define LIBIMG_ERROR_NOT_INPLEMENTED 9 |
#define LIBIMG_ERROR_INVALID_INPUT 10 |
//encode flags (byte 0x02 of _common option) |
#define LIBIMG_ENCODE_STRICT_SPECIFIC 0x01 |
#define LIBIMG_ENCODE_STRICT_BIT_DEPTH 0x02 |
#define LIBIMG_ENCODE_DELETE_ALPHA 0x08 |
#define LIBIMG_ENCODE_FLUSH_ALPHA 0x10 |
#define FLIP_VERTICAL 0x01 |
#define FLIP_HORIZONTAL 0x02 |
#define ROTATE_90_CW 0x01 |
#define ROTATE_180 0x02 |
#define ROTATE_270_CW 0x03 |
#define ROTATE_90_CCW ROTATE_270_CW |
#define ROTATE_270_CCW ROTATE_90_CW |
extern void* (*img_decode __attribute__((__stdcall__)))(void *, uint32_t, uint32_t); |
extern void* (*img_encode __attribute__((__stdcall__)))(void *, uint32_t, uint32_t); |
extern void* (*img_create __attribute__((__stdcall__)))(uint32_t, uint32_t, uint32_t); |
extern void (*img_to_rgb2 __attribute__((__stdcall__)))(void *, void *); |
extern void* (*img_to_rgb __attribute__((__stdcall__)))(void *); |
extern uint32_t (*img_flip __attribute__((__stdcall__)))(void *, uint32_t); |
extern uint32_t (*img_flip_layer __attribute__((__stdcall__)))(void *, uint32_t); |
extern uint32_t (*img_rotate __attribute__((__stdcall__)))(void *, uint32_t); |
extern uint32_t (*img_rotate_layer __attribute__((__stdcall__)))(void *, uint32_t); |
extern void (*img_draw __attribute__((__stdcall__)))(void *, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t ); |
extern uint32_t (*img_count __attribute__((__stdcall__)))(void *); |
extern uint32_t (*img_destroy __attribute__((__stdcall__)))(void *) ; |
extern uint32_t (*img_destroy_layer __attribute__((__stdcall__)))(void *); |
#endif /* KOLIBRI_LIBIMG_H */ |
/programs/develop/ktcc/trunk/libc/include/clayer/msgbox.h |
---|
0,0 → 1,55 |
#ifndef KOLIBRI_MSGBOX_H |
#define KOLIBRI_MSGBOX_H |
#include <stdarg.h> |
#include <stddef.h> |
#include <stdlib.h> |
#include <string.h> |
typedef struct { |
uint8_t retval; // 0 - win closed, 1 to n - button num, also default button on start |
uint8_t reserv; |
char texts[2048]; // must be enough ;-) |
char msgbox_stack[1024]; |
uint32_t top_stack; |
}__attribute__((packed)) msgbox; |
typedef void (*msgbox_callback)(void); |
extern void (*msgbox_create __attribute__((__stdcall__)))(msgbox *, void *thread); // clears callbacks, ! if fix lib, we can return eax as of Fn51 |
extern void (*msgbox_setfunctions __attribute__((__stdcall__)))(msgbox_callback*); // must be called immediately after create, zero-ended array |
extern void (*msgbox_reinit __attribute__((__stdcall__)))(msgbox *) ; // recalc sizes when structure changes, called auto when MsgBoxCreate |
static inline msgbox* kolibri_new_msgbox(char* title, char* text, int def_but, ...) |
/// text can be multilined by code 13 = "\r" |
/// def_but - highlighted and used on Enter (if zero - default is [X]), user may use Tabs or Arrows |
/// last params are buttons text, max 8. last must set as NULL |
{ |
va_list vl=0; |
va_start(vl, def_but); |
msgbox* box = calloc(sizeof(msgbox), 1); |
box->retval = (uint8_t)def_but; |
char *pc = box->texts; |
strcpy(pc, title); |
pc += strlen(title) + 1; |
strcpy(pc, text); |
pc += strlen(text) + 1; |
char *but_text = va_arg(vl, char*); |
while (but_text) |
{ |
strcpy(pc, but_text); |
pc += strlen(but_text) + 1; |
but_text = va_arg(vl, char*); |
} |
va_end(vl); |
return box; |
} |
static inline void kolibri_start_msgbox(msgbox* box, msgbox_callback cb[]) |
{ |
(*msgbox_create)(box, &box->top_stack); |
if (cb) (*msgbox_setfunctions)(cb); |
} |
#endif |
/programs/develop/ktcc/trunk/libc/include/clayer/rasterworks.h |
---|
0,0 → 1,11 |
#ifndef KOLIBRI_RASTERWORKS_H |
#define KOLIBRI_RASTERWORKS_H |
//extern int kolibri_rasterworks_init(void); |
extern void (*drawText __attribute__((__stdcall__)))(void *canvas, int x, int y, const char *string, int charQuantity, int fontColor, int params); |
extern int (*countUTF8Z __attribute__((__stdcall__)))(const char *string, int byteQuantity); |
extern int (*charsFit __attribute__((__stdcall__)))(int areaWidth, int charHeight); |
extern int (*strWidth __attribute__((__stdcall__)))(int charQuantity, int charHeight); |
#endif /* KOLIBRI_RASTERWORKS_H */ |
/programs/develop/ktcc/trunk/libc/include/kos/libimg.h |
---|
File deleted |
/programs/develop/ktcc/trunk/libc/include/kos/msgbox.h |
---|
File deleted |
/programs/develop/ktcc/trunk/libc/include/kos/rasterworks.h |
---|
File deleted |
/programs/develop/ktcc/trunk/samples/libimgdemo.c |
---|
File deleted |
/programs/develop/ktcc/trunk/samples/msgbox.c |
---|
File deleted |
/programs/develop/ktcc/trunk/samples/cxx_price.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Deleted: svn:mime-type |
-image/png |
\ No newline at end of property |
/programs/develop/ktcc/trunk/samples/rasterworks.c |
---|
File deleted |
/programs/develop/ktcc/trunk/samples/build_all.sh |
---|
5,8 → 5,8 |
../tcc winbasics.c /kolibrios/develop/tcc/lib/libck.a -o winbasics |
../tcc dynamic.c -lconsole -lhttp -linputbox -o dynamic |
../tcc load_coff.c -o load_coff -lck |
../tcc msgbox.c -lck -lmsgbox -o msgbox |
../tcc clayer/msgbox.c -lck -lmsgbox -o msgbox |
../tcc graphics.c -lck -lgb -o graphics |
../tcc libimgdemo.c -lck -limg -o libimgdemo |
../tcc rasterworks.c -lck -lrasterworks -o rasterworks |
../tcc clayer/rasterworks.c -lck -lrasterworks -o rasterworks |
../tcc clayer/boxlib.c -lck -lbox -o boxlib_ex |
exit |
/programs/develop/ktcc/trunk/samples/clayer/readme.txt |
---|
File deleted |
\ No newline at end of file |
/programs/develop/ktcc/trunk/samples/clayer/boxlib.c |
---|
1,4 → 1,3 |
// sample writed by maxcodehack |
#include <kos32sys1.h> |
#include <stdlib.h> |
#include <clayer/boxlib.h> |
/programs/develop/ktcc/trunk/samples/clayer/msgbox.c |
---|
0,0 → 1,8 |
#include <clayer/msgbox.h> |
int main() |
{ |
msgbox *msg1=NULL; |
msg1 = kolibri_new_msgbox("MsgBoxTest", "Hello world!", 0, "ok"); |
kolibri_start_msgbox(msg1, NULL); |
} |
/programs/develop/ktcc/trunk/samples/clayer/rasterworks.c |
---|
0,0 → 1,45 |
#include <stdlib.h> |
#include <string.h> |
#include <stdio.h> |
#include <kos32sys1.h> |
#include <clayer/rasterworks.h> |
int main() |
{ |
unsigned int event; |
int ln_str = countUTF8Z("Example", -1); |
void *buffi = malloc(768*256*3 * sizeof(char)); |
*((int*)buffi) = 768; |
*((int*)buffi+1) = 256; |
memset((char*)buffi+8, (char)-1, 768*256*3); |
drawText(buffi, 0, 0, "Example", ln_str, 0xFF000000, 0x30C18); |
drawText(buffi, 0, 32, "Example", ln_str, 0xFF000000, 0x1030C18); |
drawText(buffi, 0, 64, "Example", ln_str, 0xFF000000, 0x2030C18); |
drawText(buffi, 0, 96, "Example", ln_str, 0xFF000000, 0x4030C18); |
drawText(buffi, 0, 128, "Example", ln_str, 0xFF000000, 0x8030C18); |
drawText(buffi, 0, 160, "Example", ln_str, 0xFF000000, 0x0F031428); |
for (;;){ |
event = get_os_event(); |
switch (event) |
{ |
case 1: |
begin_draw(); |
sys_create_window(50, 50, 800, 300, "rasterworks example" ,0x34f0f0f0, 0x14); |
draw_bitmap(buffi, 5, 25, 768, 256); |
end_draw(); |
break; |
case 2: |
get_key(); |
break; |
case 3: |
if (1==get_os_button()) |
{ |
exit(0); |
} |
break; |
}; |
} |
exit(0); |
} |