/////////////////////////////////////////////////////////////////////////////
-// Name: timer.h
+// Name: wx/gtk/timer.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
-// Licence: wxWindows licence
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+#ifndef _WX_GTK_TIMER_H_
+#define _WX_GTK_TIMER_H_
-#ifndef __GTKTIMERH__
-#define __GTKTIMERH__
+//-----------------------------------------------------------------------------
+// wxTimer
+//-----------------------------------------------------------------------------
-#ifdef __GNUG__
-#pragma interface
-#endif
+class WXDLLIMPEXP_CORE wxTimer : public wxTimerBase
+{
+public:
+ wxTimer() { Init(); }
+ wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id)
+ { Init(); }
+ virtual ~wxTimer();
-#include "wx/defs.h"
-#include "wx/object.h"
+ virtual bool Start(int millisecs = -1, bool oneShot = false);
+ virtual void Stop();
-//-----------------------------------------------------------------------------
-// derived classes
-//-----------------------------------------------------------------------------
+ virtual bool IsRunning() const { return m_sourceId != 0; }
-class wxTimer;
+private:
+ void Init();
-//-----------------------------------------------------------------------------
-// wxTimer
-//-----------------------------------------------------------------------------
+ unsigned m_sourceId;
-class wxTimer: public wxObject
-{
- DECLARE_DYNAMIC_CLASS(wxTimer)
-
- public:
-
- wxTimer(void);
- ~wxTimer(void);
- int Interval(void);
- bool OneShot(void);
- virtual void Notify(void);
- void Start( int millisecs = -1, bool oneShot = FALSE );
- void Stop(void);
-
- private:
-
- int m_tag;
- int m_time;
- bool m_oneShot;
+ DECLARE_ABSTRACT_CLASS(wxTimer)
};
-#endif // __GTKTIMERH__
+#endif // _WX_GTK_TIMER_H_