+ // Send OnIdle events to all windows
+ bool needMore = SendIdleEvents();
+
+ if (needMore)
+ event.RequestMore(TRUE);
+
+ inOnIdle = FALSE;
+}
+
+// Send idle event to all top-level windows
+bool wxApp::SendIdleEvents()
+{
+ bool needMore = FALSE;
+ wxNode* node = wxTopLevelWindows.First();
+ while (node)
+ {
+ wxWindow* win = (wxWindow*) node->Data();
+ if (SendIdleEvents(win))
+ needMore = TRUE;
+
+ node = node->Next();
+ }
+ return needMore;
+}
+
+// Send idle event to window and all subwindows
+bool wxApp::SendIdleEvents(wxWindow* win)
+{
+ bool needMore = FALSE;
+
+ wxIdleEvent event;
+ event.SetEventObject(win);
+ win->ProcessEvent(event);
+
+ if (event.MoreRequested())
+ needMore = TRUE;
+
+ wxNode* node = win->GetChildren()->First();
+ while (node)
+ {
+ wxWindow* win = (wxWindow*) node->Data();
+ if (SendIdleEvents(win))
+ needMore = TRUE;
+
+ node = node->Next();
+ }
+ return needMore ;
+}
+
+void wxApp::DeletePendingObjects()
+{
+ wxNode *node = wxPendingDelete.First();
+ while (node)
+ {
+ wxObject *obj = (wxObject *)node->Data();
+
+ delete obj;
+
+ if (wxPendingDelete.Member(obj))
+ delete node;
+
+ // Deleting one object may have deleted other pending
+ // objects, so start from beginning of list again.
+ node = wxPendingDelete.First();
+ }
+}
+
+wxLog* wxApp::CreateLogTarget()
+{
+ return new wxLogGui;
+}
+
+wxWindow* wxApp::GetTopWindow() const
+{
+ if (m_topWindow)
+ return m_topWindow;
+ else if (wxTopLevelWindows.Number() > 0)
+ return (wxWindow*) wxTopLevelWindows.First()->Data();
+ else
+ return NULL;
+}
+
+void wxExit()
+{
+ wxApp::CommonCleanUp();
+/*
+ * TODO: Exit in some platform-specific way. Not recommended that the app calls this:
+ * only for emergencies.
+ */
+}
+
+// Yield to other processes
+bool wxYield()
+{
+ /*
+ * TODO
+ */
+ return TRUE;
+}