Files
wxWidgets/src/common/timerimpl.cpp
Vadim Zeitlin 3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00

84 lines
2.3 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: src/common/timerimpl.cpp
// Purpose: wxTimerBase implementation
// Author: Julian Smart, Guillermo Rodriguez, Vadim Zeitlin
// Modified by: VZ: extracted all non-wxTimer stuff in stopwatch.cpp (20.06.03)
// Created: 04/01/98
// Copyright: (c) Julian Smart
// (c) 1999 Guillermo Rodriguez <guille@iies.es>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// wxWin headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_TIMER
#include "wx/private/timer.h"
#include "wx/utils.h" // for wxNewId()
#include "wx/thread.h"
wxTimerImpl::wxTimerImpl(wxTimer *timer)
{
m_timer = timer;
m_owner = NULL;
m_idTimer = wxID_ANY;
m_milli = 0;
m_oneShot = false;
}
void wxTimerImpl::SetOwner(wxEvtHandler *owner, int timerid)
{
m_owner = owner;
m_idTimer = timerid == wxID_ANY ? wxNewId() : timerid;
}
void wxTimerImpl::SendEvent()
{
wxTimerEvent event(*m_timer);
(void)m_owner->SafelyProcessEvent(event);
}
bool wxTimerImpl::Start(int milliseconds, bool oneShot)
{
// under MSW timers only work when they're started from the main thread so
// let the caller know about it
#if wxUSE_THREADS
wxASSERT_MSG( wxThread::IsMain(),
wxT("timer can only be started from the main thread") );
#endif // wxUSE_THREADS
if ( IsRunning() )
{
// not stopping the already running timer might work for some
// platforms (no problems under MSW) but leads to mysterious crashes
// on the others (GTK), so to be on the safe side do it here
Stop();
}
if ( milliseconds != -1 )
{
m_milli = milliseconds;
}
m_oneShot = oneShot;
return true;
}
#endif // wxUSE_TIMER