X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1df23991564a5a288463eaef440ebc0ab1c1db3..2e98aa124386e26c78ca725430c0b0c692db9fc2:/src/palmos/utils.cpp diff --git a/src/palmos/utils.cpp b/src/palmos/utils.cpp index 71db037551..3185ed3ea6 100644 --- a/src/palmos/utils.cpp +++ b/src/palmos/utils.cpp @@ -1,11 +1,11 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: palmos/utils.cpp +// Name: src/palmos/utils.cpp // Purpose: Various utilities -// Author: William Osborne -// Modified by: +// Author: William Osborne - minimal working wxPalmOS port +// Modified by: Wlodzimierz ABX Skiba - real functionality // Created: 10/13/04 -// RCS-ID: $Id: -// Copyright: (c) William Osborne +// RCS-ID: $Id$ +// Copyright: (c) William Osborne, Wlodzimierz Skiba // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -39,6 +39,7 @@ #include #include #include +#include // ============================================================================ // implementation @@ -90,7 +91,7 @@ bool wxGetUserName(wxChar *buf, int maxSize) wxStrncpy (buf, wxConvertMB2WX(id), maxSize - 1); - // free the buffer + // free the buffer MemPtrUnlock(id); return true; @@ -106,12 +107,7 @@ wxChar *wxGetUserHome(const wxString& WXUNUSED(user)) return NULL; } -bool wxDirExists(const wxString& dir) -{ - return false; -} - -bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) +bool wxGetDiskSpace(const wxString& path, wxDiskspaceSize_t *pTotal, wxDiskspaceSize_t *pFree) { return false; } @@ -151,12 +147,23 @@ bool wxShutdown(wxShutdownFlags wFlags) return false; } +wxPowerType wxGetPowerType() +{ + return wxPOWER_BATTERY; +} + +wxBatteryState wxGetBatteryState() +{ + // TODO + return wxBATTERY_UNKNOWN_STATE; +} + // ---------------------------------------------------------------------------- // misc // ---------------------------------------------------------------------------- // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) -long wxGetFreeMemory() +wxMemorySize wxGetFreeMemory() { uint32_t freeTotal = 0; uint32_t freeHeap; @@ -171,7 +178,7 @@ long wxGetFreeMemory() freeTotal+=freeHeap; } - return freeTotal; + return (wxMemorySize)freeTotal; } unsigned long wxGetProcessId() @@ -187,14 +194,26 @@ void wxBell() wxString wxGetOsDescription() { - wxString str; + wxString strOS = _T("PalmOS"); - return str; + char *version = SysGetOSVersionString(); + if(version) + { + wxString str = wxString::FromAscii(version); + MemPtrFree(version); + if(!str.empty()) + { + strOS << _(" ") << str; + } + } + + return strOS; } wxToolkitInfo& wxAppTraits::GetToolkitInfo() { static wxToolkitInfo info; + info.os = wxPALMOS; info.name = _T("wxBase"); return info; } @@ -244,8 +263,6 @@ extern long wxCharsetToCodepage(const wxChar *name) #else // !wxUSE_FONTMAP -#include "wx/palmos/registry.h" - // this should work if Internet Exploiter is installed extern long wxCharsetToCodepage(const wxChar *name) {