imtk
view src/imtk.h @ 25:bb358d8c4903
added $(PREFIX)/include and $(PREFIX)/lib into the paths
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Tue, 04 Oct 2011 19:24:51 +0300 |
parents | c7a7ddbe7714 |
children | 48e708baa7be |
line source
1 #ifndef IMTK_H_
2 #define IMTK_H_
4 #include <stdlib.h>
5 #include <limits.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_TOP_COLOR,
26 IMTK_BOTTOM_COLOR,
27 IMTK_BEVEL_LIT_COLOR,
28 IMTK_BEVEL_SHAD_COLOR,
29 IMTK_CURSOR_COLOR,
30 IMTK_SELECTION_COLOR,
31 IMTK_CHECK_COLOR
32 };
34 enum {
35 IMTK_HORIZONTAL,
36 IMTK_VERTICAL
37 };
39 #define IMTK_FOCUS_BIT 0x100
40 #define IMTK_PRESS_BIT 0x200
41 #define IMTK_SEL_BIT 0x400
43 #define IMTK_AUTO INT_MIN
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
50 void imtk_inp_key(int key, int state);
51 void imtk_inp_mouse(int bn, int state);
52 void imtk_inp_motion(int x, int y);
54 void imtk_set_viewport(int x, int y);
55 void imtk_get_viewport(int *width, int *height);
57 void imtk_post_redisplay(void);
59 void imtk_begin(void);
60 void imtk_end(void);
62 void imtk_label(const char *str, int x, int y);
63 int imtk_button(int id, const char *label, int x, int y);
64 int imtk_checkbox(int id, const char *label, int x, int y, int state);
65 void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y);
66 float imtk_slider(int id, float pos, float min, float max, int x, int y);
67 void imtk_progress(int id, float pos, int x, int y);
68 int imtk_listbox(int id, const char *list, int sel, int x, int y);
69 int imtk_radiogroup(int id, const char *list, int sel, int x, int y);
71 int imtk_begin_frame(int id, const char *label, int x, int y);
72 void imtk_end_frame(void);
74 /* helper functions to create and destroy item lists for listboxes */
75 char *imtk_create_list(const char *first, ...);
76 void imtk_free_list(char *list);
78 /* automatic layout */
79 int imtk_layout_push(void);
80 int imtk_layout_pop(void);
81 void imtk_layout_start(int x, int y);
82 void imtk_layout_dir(int dir);
83 void imtk_layout_spacing(int spacing);
84 void imtk_layout_advance(int width, int height);
85 void imtk_layout_newline(void);
86 void imtk_layout_get_pos(int *x, int *y);
87 void imtk_layout_get_bounds(int *bbox);
89 /* defined in draw.c */
90 void imtk_set_color(unsigned int col, float r, float g, float b, float a);
91 float *imtk_get_color(unsigned int col);
92 void imtk_set_alpha(float a);
93 float imtk_get_alpha(void);
94 void imtk_set_bevel_width(float b);
95 float imtk_get_bevel_width(void);
96 void imtk_set_focus_factor(float fact);
97 float imtk_get_focus_factor(void);
98 void imtk_set_press_factor(float fact);
99 float imtk_get_press_factor(void);
101 #ifdef __cplusplus
102 }
103 #endif
105 #endif /* IMTK_H_ */