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
74 lines
1.7 KiB
C++
74 lines
1.7 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: src/gtk/timer.cpp
|
|
// Purpose: wxTimer implementation
|
|
// Author: Robert Roebling
|
|
// Copyright: (c) 1998 Robert Roebling
|
|
// Licence: wxWindows licence
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// For compilers that support precompilation, includes "wx.h".
|
|
#include "wx/wxprec.h"
|
|
|
|
#if wxUSE_TIMER
|
|
|
|
#include "wx/gtk/private/timer.h"
|
|
#include "wx/app.h"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// wxTimerImpl
|
|
// ----------------------------------------------------------------------------
|
|
|
|
extern "C" {
|
|
|
|
static gboolean timeout_callback(gpointer data)
|
|
{
|
|
wxGTKTimerImpl *timer = (wxGTKTimerImpl*)data;
|
|
|
|
const bool keepGoing = !timer->IsOneShot();
|
|
if ( !keepGoing )
|
|
timer->Stop();
|
|
|
|
// When getting called from GDK's timer handler we
|
|
// are no longer within GDK's grab on the GUI
|
|
// thread so we must lock it here ourselves.
|
|
gdk_threads_enter();
|
|
|
|
timer->Notify();
|
|
|
|
// Release lock again.
|
|
gdk_threads_leave();
|
|
|
|
wxApp* app = wxTheApp;
|
|
if (app)
|
|
app->WakeUpIdle();
|
|
|
|
return keepGoing;
|
|
}
|
|
|
|
} // extern "C"
|
|
|
|
bool wxGTKTimerImpl::Start(int millisecs, bool oneShot)
|
|
{
|
|
if ( !wxTimerImpl::Start(millisecs, oneShot) )
|
|
return false;
|
|
|
|
wxASSERT_MSG( !m_sourceId, wxT("shouldn't be still running") );
|
|
|
|
m_sourceId = g_timeout_add(m_milli, timeout_callback, this);
|
|
|
|
return true;
|
|
}
|
|
|
|
void wxGTKTimerImpl::Stop()
|
|
{
|
|
wxASSERT_MSG( m_sourceId, wxT("should be running") );
|
|
|
|
g_source_remove(m_sourceId);
|
|
m_sourceId = 0;
|
|
}
|
|
|
|
#endif // wxUSE_TIMER
|
|
|