diff options
author | Ashish Gupta <ashmew2@gmail.com> | 2017-04-05 21:39:01 +0200 |
---|---|---|
committer | Ashish Gupta <ashmew2@gmail.com> | 2017-06-10 08:24:39 +0200 |
commit | 6fd280bb5b27842a0ef2977798566c37bd4e1d0e (patch) | |
tree | 8e5dd8aa1adf8c6550b955d130c81c36b3db9ea5 /frontends/kolibrios/kolibri_checkbox.h | |
parent | 9bf5ecfa87d022645e986249270c5a89e27f46fe (diff) | |
download | netsurf-6fd280bb5b27842a0ef2977798566c37bd4e1d0e.tar.gz netsurf-6fd280bb5b27842a0ef2977798566c37bd4e1d0e.tar.bz2 |
Add kolibrios/ dir : Step 1 towards porting this to Kolibri OS
Diffstat (limited to 'frontends/kolibrios/kolibri_checkbox.h')
-rw-r--r-- | frontends/kolibrios/kolibri_checkbox.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/frontends/kolibrios/kolibri_checkbox.h b/frontends/kolibrios/kolibri_checkbox.h new file mode 100644 index 000000000..cc0248150 --- /dev/null +++ b/frontends/kolibrios/kolibri_checkbox.h @@ -0,0 +1,43 @@ +#ifndef KOLIBRI_CHECKBOX_H +#define KOLIBRI_CHECKBOX_H + +#include "kolibri_colors.h" + +enum CHECKBOX_FLAGS { + CHECKBOX_IS_SET = 0x00000002 + /* Add more flags later */ +}; + +struct check_box { + unsigned int left_s; + unsigned int top_s; + unsigned int ch_text_margin; + unsigned int color; + unsigned int border_color; + unsigned int text_color; + char *text; + unsigned int flags; + + /* Users can use members above this */ + unsigned int size_of_str; +}; + +struct check_box* kolibri_new_check_box(unsigned int tlx, unsigned int tly, unsigned int sizex, unsigned int sizey, char *label_text) +{ + struct check_box* new_checkbox = (struct check_box *)malloc(sizeof(struct check_box)); + new_checkbox -> left_s = (tlx << 16) + sizex; + new_checkbox -> top_s = (tly << 16) + sizey; + new_checkbox -> ch_text_margin = 10; + new_checkbox -> color = 0xFFFFFFFF; + new_checkbox -> border_color = kolibri_color_table.color_work_graph; + new_checkbox -> text_color = kolibri_color_table.color_work_text; + new_checkbox -> text = label_text; + new_checkbox -> flags = 0x00000008; + + return new_checkbox; +} + +extern void (*check_box_draw2)(struct check_box *) __attribute__((__stdcall__)); +extern void (*check_box_mouse2)(struct check_box *)__attribute__((__stdcall__)); + +#endif /* KOLIBRI_CHECKBOX_H */ |