]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/timer.h
wxUsleep() introduced (and documented) to try to work around usleep() bug in
[wxWidgets.git] / include / wx / gtk1 / timer.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: timer.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __GTKTIMERH__
12 #define __GTKTIMERH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/defs.h"
19 #include "wx/object.h"
20
21 //-----------------------------------------------------------------------------
22 // derived classes
23 //-----------------------------------------------------------------------------
24
25 class wxTimer;
26
27 //-----------------------------------------------------------------------------
28 // global functions
29 //-----------------------------------------------------------------------------
30
31 /* Timer functions (milliseconds) */
32 void wxStartTimer();
33
34 /* Gets time since last wxStartTimer or wxGetElapsedTime */
35 long wxGetElapsedTime(bool resetTimer = TRUE);
36
37 /* EXPERIMENTAL: comment this out if it doesn't compile. */
38 bool wxGetLocalTime(long *timeZone, int *dstObserved);
39
40 /* Get number of seconds since 00:00:00 GMT, Jan 1st 1970. */
41 long wxGetCurrentTime();
42
43 //-----------------------------------------------------------------------------
44 // wxTimer
45 //-----------------------------------------------------------------------------
46
47 class wxTimer: public wxObject
48 {
49 public:
50 wxTimer();
51 ~wxTimer();
52
53 int Interval() const { return m_time; }
54
55 bool OneShot() const { return m_oneShot; }
56
57 virtual bool Start( int millisecs = -1, bool oneShot = FALSE );
58 virtual void Stop();
59
60 virtual void Notify() = 0; // override this
61
62 protected:
63 int m_tag;
64 int m_time;
65 bool m_oneShot;
66
67 private:
68 DECLARE_ABSTRACT_CLASS(wxTimer)
69 };
70
71 #endif // __GTKTIMERH__