Types - Constants - Structures reference |
MX-Windows help
|
typedef int
Bool; /* accepts Allegro TRUE / FALSE */
typedef unsigned long
ID;
typedef ID
Window;
typedef ID
Dialog;
typedef ID
Cursor;
/* events */
#define WindowExpose
1
#define ButtonPress
2
#define ButtonDown
4
#define ButtonRelease
8
#define PointerStart
16
#define PointerEnter
32
#define PointerMove
64
#define PointerLeave
128
#define PointerStop
256
#define KeyPress
512
typedef struct WindowInfo {
Window window;
/* window handle */
int x1;
/* window global position - */
int y1;
/* measured from screen 0, 0 */
int x2;
int y2;
int border_width;
void *extension;
/* extension - used for hook to user data */
} WindowInfo;
typedef struct ExposeEvent {
int type;
/* common field to all events */
int x1;
/* exposed area - */
int y1;
/* coordinates measured from */
int x2;
/* screen 0, 0 */
int y2;
int count;
/* how many exposure events are pending */
} ExposeEvent;
typedef struct ButtonEvent {
int type;
int root_x;
/* mouse position equal to mouse_x, mouse_y */
int root_y;
int window_x;
/* mouse position relative to window */
int window_y;
Window pointer_child;
/* child window that the mouse is on */
int button;
/* button pressed */
int clicks;
/* clicks at the time of the event */
int time;
/* time in miliseconds since first button press */
} ButtonEvent;
typedef struct PointerEvent {
int type;
int root_x;
/* mouse position relative to screen 0, 0 */
int root_y;
int window_x;
/* mouse position relative to window */
int window_y;
Window pointer_child;
/* child that the pointer is on */
Window crossed_child;
/* child that the pointer was on */
} PointerEvent;
typedef struct KeyEvent {
int type;
int keyread;
/* value returned from readkey() */
} KeyEvent;
typedef union Event {
int type;
ExposeEvent expose;
ButtonEvent button;
PointerEvent pointer;
KeyEvent key;
} Event;