imtk

annotate src/imtk.h @ 13:9c7987064bb0

- fixed the frame drawing a bit - added global alpha value and various drawing parameters - backported the checkbox check mark from glamtk - fixed progress bar drawing so that the bevels of the trough and the bar won't overlap
author John Tsiombikas <nuclear@siggraph.org>
date Mon, 18 Apr 2011 06:15:46 +0300
parents 467a520f5c00
children df2bc9406561
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@5 5
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@13 25 IMTK_BASE_COLOR,
nuclear@13 26 IMTK_FOCUS_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@7 34
nuclear@7 35 #ifdef __cplusplus
nuclear@7 36 extern "C" {
nuclear@7 37 #endif
nuclear@7 38
nuclear@7 39
nuclear@0 40 void imtk_inp_key(int key, int state);
nuclear@0 41 void imtk_inp_mouse(int bn, int state);
nuclear@0 42 void imtk_inp_motion(int x, int y);
nuclear@7 43
nuclear@7 44 void imtk_set_viewport(int x, int y);
nuclear@7 45 void imtk_get_viewport(int *width, int *height);
nuclear@0 46
nuclear@5 47 void imtk_post_redisplay(void);
nuclear@5 48
nuclear@0 49 void imtk_begin(void);
nuclear@0 50 void imtk_end(void);
nuclear@0 51
nuclear@13 52 void imtk_label(const char *str, int x, int y);
nuclear@0 53 int imtk_button(int id, const char *label, int x, int y);
nuclear@1 54 int imtk_checkbox(int id, const char *label, int x, int y, int state);
nuclear@2 55 void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y);
nuclear@3 56 float imtk_slider(int id, float pos, float min, float max, int x, int y);
nuclear@3 57 void imtk_progress(int id, float pos, int x, int y);
nuclear@10 58 int imtk_listbox(int id, const char *list, int sel, int x, int y);
nuclear@7 59 /*
nuclear@4 60 int imtk_combobox(int id, char *textbuf, size_t buf_sz, const char *list, int sel, int x, int y);
nuclear@7 61 */
nuclear@4 62
nuclear@4 63 /* helper functions to create and destroy item lists for listboxes and comboboxes */
nuclear@4 64 char *imtk_create_list(const char *first, ...);
nuclear@4 65 void imtk_free_list(char *list);
nuclear@7 66
nuclear@13 67 /* defined in draw.c */
nuclear@13 68 void imtk_set_color(int col, float r, float g, float b, float a);
nuclear@13 69 void imtk_set_alpha(float a);
nuclear@13 70 float imtk_get_alpha(void);
nuclear@13 71 void imtk_set_bevel_width(float b);
nuclear@13 72 float imtk_get_bevel_width(void);
nuclear@13 73
nuclear@7 74 #ifdef __cplusplus
nuclear@7 75 }
nuclear@7 76 #endif
nuclear@0 77
nuclear@0 78 #endif /* IMTK_H_ */