quakeforge/ruamoko/qwaq/event.h
Bill Currie d88a091fc6 [qwaq] Use protocols to distinguish object abilities
Well, that took a fair bit more than it should have to get working: had
to implement the protocol support in qfcc and engine-side ruamoko.
2020-03-02 15:22:54 +09:00

47 lines
752 B
Objective-C

#ifndef __qwaq_event_h
#define __qwaq_event_h
typedef enum {
qe_none,
qe_key,
qe_mouse,
qe_command, // application level command
} qwaq_etype;
typedef enum {
qc_valid,
qc_exit,
qc_error,
} qwaq_command;
typedef struct qwaq_mevent_s {
int x, y;
int buttons;
} qwaq_mevent_t;
typedef struct qwaq_message_s {
qwaq_command command;
} qwaq_message_t;
typedef struct qwaq_event_s {
qwaq_etype event_type;
union {
int key;
qwaq_mevent_t mouse;
qwaq_message_t message;
} e;
} qwaq_event_t;
#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
#endif//__qwaq_event_h