imtk

view 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
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 enum {
24 IMTK_TEXT_COLOR,
25 IMTK_BASE_COLOR,
26 IMTK_FOCUS_COLOR,
27 IMTK_BEVEL_LIT_COLOR,
28 IMTK_BEVEL_SHAD_COLOR,
29 IMTK_CURSOR_COLOR,
30 IMTK_SELECTION_COLOR,
31 IMTK_CHECK_COLOR
32 };
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
40 void imtk_inp_key(int key, int state);
41 void imtk_inp_mouse(int bn, int state);
42 void imtk_inp_motion(int x, int y);
44 void imtk_set_viewport(int x, int y);
45 void imtk_get_viewport(int *width, int *height);
47 void imtk_post_redisplay(void);
49 void imtk_begin(void);
50 void imtk_end(void);
52 void imtk_label(const char *str, int x, int y);
53 int imtk_button(int id, const char *label, int x, int y);
54 int imtk_checkbox(int id, const char *label, int x, int y, int state);
55 void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y);
56 float imtk_slider(int id, float pos, float min, float max, int x, int y);
57 void imtk_progress(int id, float pos, int x, int y);
58 int imtk_listbox(int id, const char *list, int sel, int x, int y);
59 /*
60 int imtk_combobox(int id, char *textbuf, size_t buf_sz, const char *list, int sel, int x, int y);
61 */
63 /* helper functions to create and destroy item lists for listboxes and comboboxes */
64 char *imtk_create_list(const char *first, ...);
65 void imtk_free_list(char *list);
67 /* defined in draw.c */
68 void imtk_set_color(int col, float r, float g, float b, float a);
69 void imtk_set_alpha(float a);
70 float imtk_get_alpha(void);
71 void imtk_set_bevel_width(float b);
72 float imtk_get_bevel_width(void);
74 #ifdef __cplusplus
75 }
76 #endif
78 #endif /* IMTK_H_ */