X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/923d28da0eed674dfd7f4a497568ac14a29f0189..a7cfad3ad6bc8080b33a0878a14b1c02ca33fe3e:/src/palmos/app.cpp diff --git a/src/palmos/app.cpp b/src/palmos/app.cpp index 3361595e65..8ff97b1088 100644 --- a/src/palmos/app.cpp +++ b/src/palmos/app.cpp @@ -39,14 +39,15 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/log.h" + #include "wx/module.h" #endif #include "wx/apptrait.h" #include "wx/filename.h" -#include "wx/module.h" #include "wx/dynlib.h" +#include "wx/evtloop.h" #if wxUSE_TOOLTIPS #include "wx/tooltip.h" @@ -63,8 +64,6 @@ // global variables // --------------------------------------------------------------------------- -extern wxList WXDLLEXPORT wxPendingDelete; - // NB: all "NoRedraw" classes must have the same names as the "normal" classes // with NR suffix - wxWindow::MSWCreate() supposes this const wxChar *wxCanvasClassName = wxT("wxWindowClass"); @@ -101,11 +100,6 @@ void *wxGUIAppTraits::BeforeChildWaitLoop() return NULL; } -void wxGUIAppTraits::AlwaysYield() -{ - wxYield(); -} - void wxGUIAppTraits::AfterChildWaitLoop(void *dataOrig) { } @@ -115,22 +109,23 @@ bool wxGUIAppTraits::DoMessageFromThreadWait() return false; } -wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() +wxPortId wxGUIAppTraits::GetToolkitVersion(int *majVer, int *minVer) const { - static wxToolkitInfo info; - wxToolkitInfo& baseInfo = wxAppTraits::GetToolkitInfo(); - info.versionMajor = baseInfo.versionMajor; - info.versionMinor = baseInfo.versionMinor; - info.os = baseInfo.os; - info.shortName = _T("palmos"); - info.name = _T("wxPalmOS"); -#ifdef __WXUNIVERSAL__ - info.shortName << _T("univ"); - info.name << _T("/wxUniversal"); -#endif - return info; + // TODO: how to get PalmOS GUI system version ? + return wxPORT_PALMOS; } +#if wxUSE_TIMER +wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer *timer) +{ + return new wxPalmOSTimerImpl(timer); +}; +#endif // wxUSE_TIMER + +wxEventLoopBase* wxGUIAppTraits::CreateEventLoop() +{ + return new wxEventLoop; +} // =========================================================================== // wxApp implementation // =========================================================================== @@ -144,7 +139,6 @@ int wxApp::m_nCmdShow = 0; IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler) BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) - EVT_IDLE(wxApp::OnIdle) EVT_END_SESSION(wxApp::OnEndSession) EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession) END_EVENT_TABLE() @@ -215,8 +209,7 @@ void wxApp::CleanUp() // unregister the classes now UnregisterWindowClasses(); - delete wxWinHandleHash; - wxWinHandleHash = NULL; + wxDELETE(wxWinHandleHash); } // ---------------------------------------------------------------------------- @@ -230,28 +223,27 @@ wxApp::wxApp() wxApp::~wxApp() { + wxChar **argv_tmp; + argv_tmp = argv; + // src/palmos/main.cpp // our cmd line arguments are allocated inside wxEntry(HINSTANCE), they // don't come from main(), so we have to free them - while ( argc ) { // m_argv elements were allocated by wxStrdup() - free(argv[--argc]); + if (argv_tmp[--argc]) { + free((void *)(argv_tmp[--argc])); + } } - // but m_argv itself -- using new[] - delete [] argv; + delete [] argv_tmp; + //argv = NULL; } // ---------------------------------------------------------------------------- // wxApp idle handling // ---------------------------------------------------------------------------- -void wxApp::OnIdle(wxIdleEvent& event) -{ - wxAppBase::OnIdle(event); -} - void wxApp::WakeUpIdle() { } @@ -287,13 +279,6 @@ int wxApp::GetComCtl32Version() return 0; } -// Yield to incoming messages - -bool wxApp::Yield(bool onlyIfNeeded) -{ - return true; -} - #if wxUSE_EXCEPTIONS // ----------------------------------------------------------------------------