imtk

annotate src/imtk.h @ 25:bb358d8c4903

added $(PREFIX)/include and $(PREFIX)/lib into the paths
author John Tsiombikas <nuclear@mutantstargoat.com>
date Tue, 04 Oct 2011 19:24:51 +0300
parents c7a7ddbe7714
children 48e708baa7be
rev   line source
nuclear@0 1 #ifndef IMTK_H_
nuclear@0 2 #define IMTK_H_
nuclear@0 3
nuclear@5 4 #include <stdlib.h>
nuclear@20 5 #include <limits.h>
nuclear@5 6
nuclear@4 7 #define IMUID (__LINE__ << 10)
nuclear@4 8 #define IMUID_IDX(i) ((__LINE__ << 10) + ((i) << 1))
nuclear@1 9
nuclear@1 10
nuclear@0 11 /* key/button state enum */
nuclear@0 12 enum {
nuclear@0 13 IMTK_UP,
nuclear@0 14 IMTK_DOWN
nuclear@0 15 };
nuclear@0 16
nuclear@0 17 enum {
nuclear@0 18 IMTK_LEFT_BUTTON,
nuclear@0 19 IMTK_MIDDLE_BUTTON,
nuclear@0 20 IMTK_RIGHT_BUTTON
nuclear@0 21 };
nuclear@0 22
nuclear@13 23 enum {
nuclear@13 24 IMTK_TEXT_COLOR,
nuclear@14 25 IMTK_TOP_COLOR,
nuclear@14 26 IMTK_BOTTOM_COLOR,
nuclear@13 27 IMTK_BEVEL_LIT_COLOR,
nuclear@13 28 IMTK_BEVEL_SHAD_COLOR,
nuclear@13 29 IMTK_CURSOR_COLOR,
nuclear@13 30 IMTK_SELECTION_COLOR,
nuclear@13 31 IMTK_CHECK_COLOR
nuclear@13 32 };
nuclear@13 33
nuclear@20 34 enum {
nuclear@20 35 IMTK_HORIZONTAL,
nuclear@20 36 IMTK_VERTICAL
nuclear@20 37 };
nuclear@20 38
nuclear@14 39 #define IMTK_FOCUS_BIT 0x100
nuclear@14 40 #define IMTK_PRESS_BIT 0x200
nuclear@15 41 #define IMTK_SEL_BIT 0x400
nuclear@14 42
nuclear@20 43 #define IMTK_AUTO INT_MIN
nuclear@7 44
nuclear@7 45 #ifdef __cplusplus
nuclear@7 46 extern "C" {
nuclear@7 47 #endif
nuclear@7 48
nuclear@7 49
nuclear@0 50 void imtk_inp_key(int key, int state);
nuclear@0 51 void imtk_inp_mouse(int bn, int state);
nuclear@0 52 void imtk_inp_motion(int x, int y);
nuclear@7 53
nuclear@7 54 void imtk_set_viewport(int x, int y);
nuclear@7 55 void imtk_get_viewport(int *width, int *height);
nuclear@0 56
nuclear@5 57 void imtk_post_redisplay(void);
nuclear@5 58
nuclear@0 59 void imtk_begin(void);
nuclear@0 60 void imtk_end(void);
nuclear@0 61
nuclear@13 62 void imtk_label(const char *str, int x, int y);
nuclear@0 63 int imtk_button(int id, const char *label, int x, int y);
nuclear@1 64 int imtk_checkbox(int id, const char *label, int x, int y, int state);
nuclear@2 65 void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y);
nuclear@3 66 float imtk_slider(int id, float pos, float min, float max, int x, int y);
nuclear@3 67 void imtk_progress(int id, float pos, int x, int y);
nuclear@10 68 int imtk_listbox(int id, const char *list, int sel, int x, int y);
nuclear@18 69 int imtk_radiogroup(int id, const char *list, int sel, int x, int y);
nuclear@4 70
nuclear@23 71 int imtk_begin_frame(int id, const char *label, int x, int y);
nuclear@23 72 void imtk_end_frame(void);
nuclear@23 73
nuclear@20 74 /* helper functions to create and destroy item lists for listboxes */
nuclear@4 75 char *imtk_create_list(const char *first, ...);
nuclear@4 76 void imtk_free_list(char *list);
nuclear@7 77
nuclear@20 78 /* automatic layout */
nuclear@23 79 int imtk_layout_push(void);
nuclear@23 80 int imtk_layout_pop(void);
nuclear@23 81 void imtk_layout_start(int x, int y);
nuclear@20 82 void imtk_layout_dir(int dir);
nuclear@23 83 void imtk_layout_spacing(int spacing);
nuclear@20 84 void imtk_layout_advance(int width, int height);
nuclear@20 85 void imtk_layout_newline(void);
nuclear@20 86 void imtk_layout_get_pos(int *x, int *y);
nuclear@20 87 void imtk_layout_get_bounds(int *bbox);
nuclear@20 88
nuclear@13 89 /* defined in draw.c */
nuclear@14 90 void imtk_set_color(unsigned int col, float r, float g, float b, float a);
nuclear@14 91 float *imtk_get_color(unsigned int col);
nuclear@13 92 void imtk_set_alpha(float a);
nuclear@13 93 float imtk_get_alpha(void);
nuclear@13 94 void imtk_set_bevel_width(float b);
nuclear@13 95 float imtk_get_bevel_width(void);
nuclear@14 96 void imtk_set_focus_factor(float fact);
nuclear@14 97 float imtk_get_focus_factor(void);
nuclear@14 98 void imtk_set_press_factor(float fact);
nuclear@14 99 float imtk_get_press_factor(void);
nuclear@13 100
nuclear@7 101 #ifdef __cplusplus
nuclear@7 102 }
nuclear@7 103 #endif
nuclear@0 104
nuclear@0 105 #endif /* IMTK_H_ */