+extern void WXDLLEXPORT wxWakeUpIdle();
+
+// Post a message to the given eventhandler which will be processed during the
+// next event loop iteration
+inline void wxPostEvent(wxEvtHandler *dest, wxEvent& event)
+{
+ wxCHECK_RET( dest, wxT("need an object to post event to in wxPostEvent") );
+
+#if wxUSE_GUI
+ dest->AddPendingEvent(event);
+#else
+ dest->ProcessEvent(event);
+#endif // wxUSE_GUI
+}
+
+// console applications may avoid using DECLARE_APP and IMPLEMENT_APP macros
+// and call these functions instead at the program startup and termination
+// -------------------------------------------------------------------------
+
+#if !wxUSE_GUI
+
+// initialize the library (may be called as many times as needed, but each
+// call to wxInitialize() must be matched by wxUninitialize())
+extern bool WXDLLEXPORT wxInitialize();
+
+// clean up - the library can't be used any more after the last call to
+// wxUninitialize()
+extern void WXDLLEXPORT wxUninitialize();
+
+// create an object of this class on stack to initialize/cleanup thel ibrary
+// automatically
+class WXDLLEXPORT wxInitializer
+{
+public:
+ // initialize the library
+ wxInitializer() { m_ok = wxInitialize(); }
+
+ // has the initialization been successful? (explicit test)
+ bool IsOk() const { return m_ok; }
+
+ // has the initialization been successful? (implicit test)
+ operator bool() const { return m_ok; }
+
+ // dtor only does clean up if we initialized the library properly
+ ~wxInitializer() { if ( m_ok ) wxUninitialize(); }
+
+private:
+ bool m_ok;
+};
+
+#endif // !wxUSE_GUI