-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathWindow.h
53 lines (45 loc) · 2 KB
/
Window.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
typedef struct s_window * WINDOW;
#ifndef WINDOW_t
#define WINDOW_t WINDOW
#else
WINDOW_t window_ctor (WINDOW_t, WORD widgets, ULONG ident,
const char * name, GRECT *, BOOL modal);
WINDOW window_dtor (WINDOW_t);
#endif
typedef struct s_window { /* all of the following are private attributes, */
WORD Handle; /* only to be read, by foreign modules */
WORD Widgets; /* as in wind_create (kind, ...): mover, sizer, etc. */
ULONG Ident; /* four characters as runtime type information */
WINDOW Prev, Next; /* still private, keep away */
BOOL isModal;
BOOL isIcon;
BOOL isFull;
BOOL isScrn; /* special full screen mode as from F11 in Mozilla/IE */
GRECT Curr; /* outer extents of the window */
char Name[80]; /* title bar string */
/***/
WINDOW(*destruct)(WINDOW_t);
BOOL (*evMessage)(WINDOW_t, WORD msg[], PXY, UWORD kstate);
void (*evButton) (WINDOW_t, WORD bmask, PXY, UWORD kstate, WORD clicks);
void (*evKeybrd) (WINDOW_t, WORD scan, WORD ascii, UWORD kstate);
void (*drawWork) (WINDOW_t, const GRECT *);
void (*drawIcon) (WINDOW_t, const GRECT *);
BOOL (*close) (WINDOW_t, UWORD kstate);
void (*raised) (WINDOW_t, BOOL topNbot);
void (*moved) (WINDOW_t);
BOOL (*sized) (WINDOW_t);
void (*iconified)(WINDOW_t);
} WINDOWBASE;
#undef WINDOW_t
#define delete_window(WINDOW) {if (WINDOW) free((*(WINDOW)->destruct)(WINDOW));}
WINDOW window_byHandle (WORD);
WINDOW window_byIdent (ULONG);
#define WINDOW_IDENT(a,b,c,d) ((((((((ULONG)a)<<8)|b)<<8)|c)<<8)|d)
BOOL window_evMessage (WORD msg[], PXY mouse, UWORD kstate);
void window_evButton (WORD bmask, PXY mouse, UWORD kstate, WORD clicks);
void window_evKeybrd (UWORD key, UWORD kstate);
void window_redraw (WINDOW, const GRECT *);
const char * window_setName (WINDOW, const char *);
BOOL window_setBevent (WINDOW);
void window_raise (WINDOW, BOOL topNbot, const GRECT *);
void window_resize (WINDOW, const GRECT *, BOOL fulled);