00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CSUTIL_BINDER_H__
00020 #define __CSUTIL_BINDER_H__
00021
00022 #include "iutil/event.h"
00023 #include "csutil/csevent.h"
00024 #include "iutil/eventh.h"
00025 #include "csutil/hashmap.h"
00026
00031 extern csHashKey csHashComputeEvent (iEvent *ev);
00032
00033 struct csEvBind
00034 {
00035 void *x, *y;
00036 };
00037
00042 class csInputBinder : public iEventHandler
00043 {
00044 private:
00045 csHashMap *Hash;
00046
00047 public:
00048 SCF_DECLARE_IBASE;
00049
00054 csInputBinder (int size = 127);
00055
00059 virtual ~csInputBinder ();
00060
00066 bool HandleEvent (iEvent &ev);
00067
00079 void Bind (iEvent *ev, int *xvar = NULL, int *yvar = NULL);
00080
00081 void Bind (csEvent &ev, int *xvar = NULL, int *yvar = NULL);
00082
00086 bool Unbind (iEvent *ev);
00087
00088 bool Unbind (csEvent &ev);
00089
00093 bool UnbindAll();
00094 };
00095
00096 #endif // __CSUTIL_BINDER_H__