00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __IUTIL_EVENT_H__
00021 #define __IUTIL_EVENT_H__
00022
00023 #include "iutil/evdefs.h"
00024 #include "csutil/scf.h"
00025
00026 struct iEventHandler;
00027
00028 SCF_VERSION (iEvent, 0, 0, 1);
00029
00045 struct iEvent : public iBase
00046 {
00047 uchar Type;
00048 uchar Category;
00049 uchar SubCategory;
00050 uchar Flags;
00051 csTicks Time;
00052 union
00053 {
00054 struct
00055 {
00056 int Code;
00057 int Char;
00058 int Modifiers;
00059 } Key;
00060 struct
00061 {
00062 int x,y;
00063 int Button;
00064 int Modifiers;
00065 } Mouse;
00066 struct
00067 {
00068 int number;
00069 int x, y;
00070 int Button;
00071 int Modifiers;
00072 } Joystick;
00073 struct
00074 {
00075 uint Code;
00076 void *Info;
00077 } Command;
00078 };
00079 };
00080
00120 SCF_VERSION (iEventPlug, 0, 0, 1);
00121
00130 struct iEventPlug : public iBase
00131 {
00140 virtual unsigned GetPotentiallyConflictingEvents () = 0;
00141
00150 virtual unsigned QueryEventPriority (unsigned iType) = 0;
00151
00159 virtual void EnableEvents (unsigned , bool ) {}
00160 };
00161
00162 SCF_VERSION (iEventOutlet, 0, 1, 0);
00163
00178 struct iEventOutlet : public iBase
00179 {
00188 virtual iEvent* CreateEvent () = 0;
00189
00196 virtual void Post (iEvent*) = 0;
00197
00215 virtual void Key (int iKey, int iChar, bool iDown) = 0;
00216
00224 virtual void Mouse (int iButton, bool iDown, int x, int y) = 0;
00225
00233 virtual void Joystick(int iNumber, int iButton, bool iDown, int x,int y) = 0;
00234
00244 virtual void Broadcast (int iCode, void *iInfo = NULL) = 0;
00245
00261 virtual void ImmediateBroadcast (int iCode, void *iInfo) = 0;
00262 };
00263
00264 SCF_VERSION (iEventCord, 0, 0, 2);
00265
00273 struct iEventCord
00274 {
00282 virtual int Insert (iEventHandler*, int priority) = 0;
00283
00287 virtual void Remove (iEventHandler*) = 0;
00288
00293 virtual bool GetPass () const = 0;
00294
00299 virtual void SetPass (bool) = 0;
00300
00302 virtual int GetCategory() const = 0;
00303
00304 virtual int GetSubcategory() const = 0;
00305 };
00306
00307 #endif // __IUTIL_EVENT_H__