-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmywin.h
72 lines (59 loc) · 1.44 KB
/
mywin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#define WIN_TITLE 1
#define WIN_CLOSE 2
#define WIN_SUNKEN 3
#define WIN_BUTTON 4
#define WIN_SLIDE 5
#define WIN_ICON 8
#define WIN_FOCUS 1
#define WIN_LOOSF 2
#define VERT 2
#define WIN_EXIT (-1)
struct my_obj {
int x,y; /* x,y of the object */
int sx,sy; /* size of x,y of the object */
int type; /* type of the object */
int needupdate; /* need update on object */
void ( * init) ( struct my_obj *);
void ( * update) (struct my_obj *);
void ( * change) (struct my_obj *,int );
void ( * destroy) (struct my_obj *);
void ( * inobj) (struct my_obj *, int );
struct my_win * win; /* we are in this window */
struct my_obj * next;
union {
struct button {
int type; /* do we have pixmap or text */
int val; /* for callback */
int size; /* size of border */
char label[256]; /* label for the button */
char *data; /* data for pixmap */
int state; /* active / sunken */
int locst; /* data for button */
} button;
struct slider {
int type; /* vert. or horiz.*/
int pos; /* current position */
float max; /* max value */
float cur; /* current value */
} slider;
} u;
};
struct my_win {
int x;
int y;
int sx;
int sy;
int focus;
int type;
int len;
int opt;
int flag;
char text[80];
struct my_win *next;
struct my_obj *obj;
struct my_obj *objfocus;
void (* update)( struct my_win *);
};
struct my_win * first;
struct my_win * focus;
struct my_obj * my_alloc_obj(struct my_win *);