#include #include #include #include #include #include "termkit.h" #define OK 0 #define ER 1 #define USR_ERR 2 int tk_sty_init(tk_style_t **sty, uint16_t fg, uint16_t bg) { (*sty) = calloc(sizeof(tk_style_t), 1); CHECK(*sty, ERR) err_t e; e = bowl_malloc(&(*sty)->styles, HASH); if(e) goto fail; e = bowl_malloc(&(*sty)->decorators, HASH); if(e) goto fail; return OK; fail: free((*sty)->styles); free((*sty)->decorators); free(*sty); return ERR; } int tk_sty_add_col(tk_style_t *sty, char *name, uint16_t fg, uint16_t bg) { CHECK(sty, USR_ERR) return OK; } // int init() // { // return tb_init(); // } // void draw(char *str, int rootX, int rootY, uint16_t fg, uint16_t bg) // { // size_t len = strlen(str); // int x = rootX; // for(int i = 0; i < len; i++) { // tb_change_cell(x, rootY, str[i], fg, bg); // x += 1; // } // } // void draw_xy(char *str, int rootX, int rootY, // int8_t h, int8_t v, // uint16_t fg, uint16_t bg) // { // size_t len = strlen(str); // int x = rootX; // int y = rootY; // for(int i = 0; i < len; i++) { // tb_change_cell(x, y, str[i], fg, bg); // x += h; y += v; // } // }