imtk

view src/imtk.h @ 6:38609a9f7586

reorganizing ...
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 14 Apr 2011 14:22:42 +0300
parents 00a4ea4ee6dc
children 6d35e6c7b2ca
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 };
23 void imtk_inp_key(int key, int state);
24 void imtk_inp_mouse(int bn, int state);
25 void imtk_inp_motion(int x, int y);
26 void imtk_inp_reshape(int x, int y);
28 void imtk_post_redisplay(void);
30 void imtk_begin(void);
31 void imtk_end(void);
33 int imtk_button(int id, const char *label, int x, int y);
34 int imtk_checkbox(int id, const char *label, int x, int y, int state);
35 void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y);
36 float imtk_slider(int id, float pos, float min, float max, int x, int y);
37 void imtk_progress(int id, float pos, int x, int y);
38 int imtk_listbox(int id, const char *list, int sel, int x, int y);
39 int imtk_combobox(int id, char *textbuf, size_t buf_sz, const char *list, int sel, int x, int y);
41 /* helper functions to create and destroy item lists for listboxes and comboboxes */
42 char *imtk_create_list(const char *first, ...);
43 void imtk_free_list(char *list);
45 #endif /* IMTK_H_ */