nuclear@0: #ifndef IMTK_H_ nuclear@0: #define IMTK_H_ nuclear@0: nuclear@5: #include nuclear@20: #include nuclear@5: nuclear@4: #define IMUID (__LINE__ << 10) nuclear@4: #define IMUID_IDX(i) ((__LINE__ << 10) + ((i) << 1)) nuclear@1: nuclear@1: nuclear@0: /* key/button state enum */ nuclear@0: enum { nuclear@0: IMTK_UP, nuclear@0: IMTK_DOWN nuclear@0: }; nuclear@0: nuclear@0: enum { nuclear@0: IMTK_LEFT_BUTTON, nuclear@0: IMTK_MIDDLE_BUTTON, nuclear@0: IMTK_RIGHT_BUTTON nuclear@0: }; nuclear@0: nuclear@13: enum { nuclear@13: IMTK_TEXT_COLOR, nuclear@14: IMTK_TOP_COLOR, nuclear@14: IMTK_BOTTOM_COLOR, nuclear@13: IMTK_BEVEL_LIT_COLOR, nuclear@13: IMTK_BEVEL_SHAD_COLOR, nuclear@13: IMTK_CURSOR_COLOR, nuclear@13: IMTK_SELECTION_COLOR, nuclear@13: IMTK_CHECK_COLOR nuclear@13: }; nuclear@13: nuclear@20: enum { nuclear@20: IMTK_HORIZONTAL, nuclear@20: IMTK_VERTICAL nuclear@20: }; nuclear@20: nuclear@14: #define IMTK_FOCUS_BIT 0x100 nuclear@14: #define IMTK_PRESS_BIT 0x200 nuclear@15: #define IMTK_SEL_BIT 0x400 nuclear@14: nuclear@20: #define IMTK_AUTO INT_MIN nuclear@7: nuclear@7: #ifdef __cplusplus nuclear@7: extern "C" { nuclear@7: #endif nuclear@7: nuclear@7: nuclear@0: void imtk_inp_key(int key, int state); nuclear@0: void imtk_inp_mouse(int bn, int state); nuclear@0: void imtk_inp_motion(int x, int y); nuclear@7: nuclear@7: void imtk_set_viewport(int x, int y); nuclear@7: void imtk_get_viewport(int *width, int *height); nuclear@0: nuclear@5: void imtk_post_redisplay(void); nuclear@5: nuclear@0: void imtk_begin(void); nuclear@0: void imtk_end(void); nuclear@0: nuclear@13: void imtk_label(const char *str, int x, int y); nuclear@0: int imtk_button(int id, const char *label, int x, int y); nuclear@1: int imtk_checkbox(int id, const char *label, int x, int y, int state); nuclear@2: void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y); nuclear@3: float imtk_slider(int id, float pos, float min, float max, int x, int y); nuclear@3: void imtk_progress(int id, float pos, int x, int y); nuclear@10: int imtk_listbox(int id, const char *list, int sel, int x, int y); nuclear@18: int imtk_radiogroup(int id, const char *list, int sel, int x, int y); nuclear@4: nuclear@23: int imtk_begin_frame(int id, const char *label, int x, int y); nuclear@23: void imtk_end_frame(void); nuclear@23: nuclear@20: /* helper functions to create and destroy item lists for listboxes */ nuclear@4: char *imtk_create_list(const char *first, ...); nuclear@4: void imtk_free_list(char *list); nuclear@7: nuclear@20: /* automatic layout */ nuclear@23: int imtk_layout_push(void); nuclear@23: int imtk_layout_pop(void); nuclear@23: void imtk_layout_start(int x, int y); nuclear@20: void imtk_layout_dir(int dir); nuclear@23: void imtk_layout_spacing(int spacing); nuclear@20: void imtk_layout_advance(int width, int height); nuclear@20: void imtk_layout_newline(void); nuclear@20: void imtk_layout_get_pos(int *x, int *y); nuclear@20: void imtk_layout_get_bounds(int *bbox); nuclear@20: nuclear@13: /* defined in draw.c */ nuclear@14: void imtk_set_color(unsigned int col, float r, float g, float b, float a); nuclear@14: float *imtk_get_color(unsigned int col); nuclear@13: void imtk_set_alpha(float a); nuclear@13: float imtk_get_alpha(void); nuclear@13: void imtk_set_bevel_width(float b); nuclear@13: float imtk_get_bevel_width(void); nuclear@14: void imtk_set_focus_factor(float fact); nuclear@14: float imtk_get_focus_factor(void); nuclear@14: void imtk_set_press_factor(float fact); nuclear@14: float imtk_get_press_factor(void); nuclear@13: nuclear@7: #ifdef __cplusplus nuclear@7: } nuclear@7: #endif nuclear@0: nuclear@0: #endif /* IMTK_H_ */