imtk
view src/imtk.h @ 8:10604ff95527
imtk_draw_rect
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 14 Apr 2011 23:21:56 +0300 |
parents | 09b6e8a5dc14 |
children | 467a520f5c00 |
line source
1 #ifndef IMTK_H_
2 #define IMTK_H_
4 #include <stdlib.h>
7 #define IMUID (__LINE__ << 10)
8 #define IMUID_IDX(i) ((__LINE__ << 10) + ((i) << 1))
11 /* key/button state enum */
12 enum {
13 IMTK_UP,
14 IMTK_DOWN
15 };
17 enum {
18 IMTK_LEFT_BUTTON,
19 IMTK_MIDDLE_BUTTON,
20 IMTK_RIGHT_BUTTON
21 };
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
29 void imtk_inp_key(int key, int state);
30 void imtk_inp_mouse(int bn, int state);
31 void imtk_inp_motion(int x, int y);
33 void imtk_set_viewport(int x, int y);
34 void imtk_get_viewport(int *width, int *height);
36 void imtk_post_redisplay(void);
38 void imtk_begin(void);
39 void imtk_end(void);
41 int imtk_button(int id, const char *label, int x, int y);
42 int imtk_checkbox(int id, const char *label, int x, int y, int state);
43 void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y);
44 float imtk_slider(int id, float pos, float min, float max, int x, int y);
45 void imtk_progress(int id, float pos, int x, int y);
46 /*
47 int imtk_listbox(int id, const char *list, int sel, int x, int y);
48 int imtk_combobox(int id, char *textbuf, size_t buf_sz, const char *list, int sel, int x, int y);
49 */
51 /* helper functions to create and destroy item lists for listboxes and comboboxes */
52 /*
53 char *imtk_create_list(const char *first, ...);
54 void imtk_free_list(char *list);
55 */
57 #ifdef __cplusplus
58 }
59 #endif
61 #endif /* IMTK_H_ */