2020-02-27 12:01:09 +00:00
|
|
|
#ifndef __qwaq_event_h
|
|
|
|
#define __qwaq_event_h
|
|
|
|
|
|
|
|
typedef enum {
|
2020-02-29 15:40:55 +00:00
|
|
|
qe_none,
|
2020-02-27 12:01:09 +00:00
|
|
|
qe_key,
|
|
|
|
qe_mouse,
|
2020-02-29 15:40:55 +00:00
|
|
|
qe_command, // application level command
|
2020-02-27 12:01:09 +00:00
|
|
|
} qwaq_etype;
|
|
|
|
|
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-02-27 12:01:09 +00:00
|
|
|
int buttons;
|
|
|
|
} 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 {
|
|
|
|
qwaq_etype event_type;
|
|
|
|
union {
|
|
|
|
int key;
|
|
|
|
qwaq_mevent_t mouse;
|
2020-02-29 15:40:55 +00:00
|
|
|
qwaq_message_t message;
|
2020-02-27 12:01:09 +00:00
|
|
|
} e;
|
|
|
|
} 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
|
|
|
|
|
|
|
|
@protocol TakeFocus <HandleEvent>
|
|
|
|
-takeFocus;
|
|
|
|
-loseFocus;
|
|
|
|
@end
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2020-02-27 12:01:09 +00:00
|
|
|
#endif//__qwaq_event_h
|