Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

D:/Programming/GUI Editor (Source)/EventHandler.h

00001 #ifndef EVENTHANDLER_H 00002 #define EVENTHANDLER_H 00003 00004 #include "Common.h" 00005 00006 #define MAX_MESSAGES 64 00007 00008 /*********** Message structure ************/ 00009 struct tMessage 00010 { 00011 UINT uiMessage; 00012 DWORD dwParam[2]; // Various data passed using those 00013 double dwCreateTime; // Time of creation of this message 00014 UINT dwTimeout; // How long this message exists in a queue 00015 bool bUsed; 00016 00017 tMessage() 00018 { 00019 uiMessage = dwTimeout = dwCreateTime = dwParam[0] = dwParam[1] = 0; 00020 bUsed = false; 00021 00022 #ifdef USE_GLOBAL_TIMER 00023 dwCreateTime = CGlobalTimer::GetSingleton().GetAbsoluteTime(); 00024 #endif 00025 }; 00026 00027 virtual ~tMessage() 00028 { 00029 00030 }; 00031 }; 00032 00033 class CEventHandler 00034 { 00035 00036 public: 00037 CEventHandler(); 00038 CEventHandler(UINT MaxMessages); 00039 virtual ~CEventHandler(); 00040 00041 virtual int PostMessage(UINT uiMessageIndex, DWORD Param1 = 0, DWORD Param2 = 0, UINT uiTimeoutMs = 0); 00042 tMessage* GetMessage(UINT uiMessageIndex); 00043 UINT GetMessageCount(); 00044 00045 virtual void Destroy(); 00046 virtual void Dispatch(bool bOnce = true) = 0; 00047 virtual void Flush() = 0; 00048 00049 protected: 00050 00051 tMessage *m_pMessages; 00052 UINT m_uiMessageCount; 00053 UINT m_uiLastUnusedMessage; 00054 00055 CTimer m_Timer; 00056 }; 00057 00058 #endif

Generated on Sun Jul 17 21:34:26 2005 for OpenGL GUI by doxygen 1.3.8