2020-02-27 12:01:09 +00:00
|
|
|
#ifndef __qwaq_event_h
|
|
|
|
#define __qwaq_event_h
|
|
|
|
|
|
|
|
typedef enum {
|
2020-03-04 13:09:40 +00:00
|
|
|
qe_mousedown = 0x0001,
|
|
|
|
qe_mouseup = 0x0002,
|
|
|
|
qe_mouseclick= 0x0004,
|
|
|
|
qe_mousemove = 0x0008,
|
|
|
|
qe_mouseauto = 0x0010,
|
|
|
|
} qwaq_mouse_event;
|
|
|
|
|
2020-03-21 12:05:34 +00:00
|
|
|
typedef enum {
|
|
|
|
qe_mouse1 = 0x0001,
|
|
|
|
qe_mouse2 = 0x0002,
|
|
|
|
qe_mouse3 = 0x0004,
|
|
|
|
qe_mouse4 = 0x0008,
|
|
|
|
qe_mouse5 = 0x0010,
|
|
|
|
} qwaq_button;
|
|
|
|
|
2020-03-04 13:09:40 +00:00
|
|
|
typedef enum {
|
|
|
|
qe_keydown = 0x0020,
|
|
|
|
} qwaq_key_event;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
qe_command = 0x0200, // application level command
|
|
|
|
qe_broadcast = 0x0400,
|
|
|
|
} qwaq_message_event;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
qe_none = 0x0000,
|
|
|
|
qe_mouse = 0x001f,
|
|
|
|
qe_key = 0x0020,
|
|
|
|
qe_system = 0x01c0,
|
|
|
|
qe_message = 0xfe00,
|
|
|
|
|
|
|
|
qe_focused = qe_key | qe_command,
|
2020-03-05 06:44:53 +00:00
|
|
|
qe_positional = qe_mouse,
|
2020-03-04 13:09:40 +00:00
|
|
|
} qwaq_event_mask;
|
2020-02-27 12:01:09 +00:00
|
|
|
|
2020-02-29 15:40:55 +00:00
|
|
|
typedef enum {
|
|
|
|
qc_valid,
|
|
|
|
qc_exit,
|
|
|
|
qc_error,
|
|
|
|
} qwaq_command;
|
|
|
|
|
2020-02-27 12:01:09 +00:00
|
|
|
typedef struct qwaq_mevent_s {
|
2020-02-27 12:08:12 +00:00
|
|
|
int x, y;
|
2020-03-21 12:05:34 +00:00
|
|
|
qwaq_button buttons; // current button state
|
2020-03-04 13:09:40 +00:00
|
|
|
int click;
|
2020-02-27 12:01:09 +00:00
|
|
|
} qwaq_mevent_t;
|
|
|
|
|
2020-02-29 15:40:55 +00:00
|
|
|
typedef struct qwaq_message_s {
|
|
|
|
qwaq_command command;
|
|
|
|
} qwaq_message_t;
|
|
|
|
|
2020-02-27 12:01:09 +00:00
|
|
|
typedef struct qwaq_event_s {
|
2020-03-04 13:09:40 +00:00
|
|
|
int what;
|
2020-02-27 12:01:09 +00:00
|
|
|
union {
|
|
|
|
int key;
|
|
|
|
qwaq_mevent_t mouse;
|
2020-02-29 15:40:55 +00:00
|
|
|
qwaq_message_t message;
|
2020-03-04 10:10:09 +00:00
|
|
|
};
|
2020-02-27 12:01:09 +00:00
|
|
|
} qwaq_event_t;
|
|
|
|
|
2020-03-02 06:22:54 +00:00
|
|
|
#ifdef __QFCC__ // don't want C gcc to see this :)
|
|
|
|
@protocol HandleEvent
|
|
|
|
-handleEvent: (struct qwaq_event_s *) event;
|
|
|
|
@end
|
|
|
|
|
2020-03-03 12:30:47 +00:00
|
|
|
@protocol HandleFocusedEvent <HandleEvent>
|
2020-03-02 06:22:54 +00:00
|
|
|
-takeFocus;
|
|
|
|
-loseFocus;
|
|
|
|
@end
|
|
|
|
|
2020-03-03 12:30:47 +00:00
|
|
|
@protocol HandleMouseEvent <HandleEvent>
|
|
|
|
-(struct Rect_s *)getRect;
|
|
|
|
@end
|
|
|
|
|
2020-03-02 06:22:54 +00:00
|
|
|
#endif
|
|
|
|
|
2020-02-27 12:01:09 +00:00
|
|
|
#endif//__qwaq_event_h
|