Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8106 → Rev 8107

/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