+void wxAppConsoleBase::WakeUpIdle()
+{
+ wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+
+ if ( loop )
+ loop->WakeUp();
+}
+
+bool wxAppConsoleBase::ProcessIdle()
+{
+ // synthesize an idle event and check if more of them are needed
+ wxIdleEvent event;
+ event.SetEventObject(this);
+ ProcessEvent(event);
+
+#if wxUSE_LOG
+ // flush the logged messages if any (do this after processing the events
+ // which could have logged new messages)
+ wxLog::FlushActive();
+#endif
+
+ // Garbage collect all objects previously scheduled for destruction.
+ DeletePendingObjects();
+
+ return event.MoreRequested();
+}
+
+bool wxAppConsoleBase::UsesEventLoop() const
+{
+ // in console applications we don't know whether we're going to have an
+ // event loop so assume we won't -- unless we already have one running
+ return wxEventLoopBase::GetActive() != NULL;
+}
+
+// ----------------------------------------------------------------------------
+// events
+// ----------------------------------------------------------------------------
+
+/* static */
+bool wxAppConsoleBase::IsMainLoopRunning()
+{
+ const wxAppConsole * const app = GetInstance();
+
+ return app && app->m_mainLoop != NULL;
+}
+
+int wxAppConsoleBase::FilterEvent(wxEvent& WXUNUSED(event))
+{
+ // process the events normally by default
+ return Event_Skip;
+}
+
+void wxAppConsoleBase::DelayPendingEventHandler(wxEvtHandler* toDelay)
+{
+ wxENTER_CRIT_SECT(m_handlersWithPendingEventsLocker);
+
+ // move the handler from the list of handlers with processable pending events
+ // to the list of handlers with pending events which needs to be processed later
+ m_handlersWithPendingEvents.Remove(toDelay);
+
+ if (m_handlersWithPendingDelayedEvents.Index(toDelay) == wxNOT_FOUND)
+ m_handlersWithPendingDelayedEvents.Add(toDelay);
+
+ wxLEAVE_CRIT_SECT(m_handlersWithPendingEventsLocker);
+}
+
+void wxAppConsoleBase::RemovePendingEventHandler(wxEvtHandler* toRemove)
+{
+ wxENTER_CRIT_SECT(m_handlersWithPendingEventsLocker);
+
+ if (m_handlersWithPendingEvents.Index(toRemove) != wxNOT_FOUND)