00001
00022 #ifndef INC_MGUI_TIMER_H
00023 #define INC_MGUI_TIMER_H
00024
00025 #ifndef INC_MGUI_BASE_H
00026 #include <mgui/base.h>
00027 #endif
00028
00029 #ifndef INC_MI32_XBASE_H
00030 #include <mi32/xbase.h>
00031 #endif
00032
00033 namespace MGUI {
00034
00046 class TIMER {
00047 public:
00048
00049
00050 TIMER ();
00051
00052
00053 ~TIMER ();
00054
00059 ERRVALUE Activate (
00060 double seconds,
00061 bool autorepeat = false
00062 );
00063
00065 void Deactivate (
00066 );
00067
00069 bool IsActive (
00070 ) const { return (m_IdTimer != 0); }
00071
00073 void SetDelegate (
00074 DELEGATE_VOID_NOPARMS delegate
00075 ) { m_delegate = delegate; }
00076
00079 void SetLimitToMainLoop (
00080 bool LimitToMainLoop
00081 ) { m_LimitToMainLoop = LimitToMainLoop; }
00082
00083 private:
00084 #ifndef GENERATING_DOXYGEN_OUTPUT
00085 DELEGATE_VOID_NOPARMS m_delegate;
00086
00087 #ifdef X_NATIVE
00088 XtIntervalId m_IdTimer;
00089
00090 static void OnTimeX (TIMER*, XtIntervalId*);
00091
00092 #else // Windows
00093 UINT_PTR m_IdTimer;
00094
00095 static VOID CALLBACK OnTimeW (HWND, UINT, UINT_PTR, DWORD);
00096
00097 #endif
00098
00099 double m_value;
00100 bool m_AutoRepeat;
00101 bool m_LimitToMainLoop;
00102
00103 TIMER (const TIMER&);
00104 TIMER& operator= (const TIMER&);
00105 #endif // GENERATING_DOXYGEN_OUTPUT
00106 };
00107
00108
00109 }
00110
00111 #endif // INC_MGUI_TIMER_H