X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1df23991564a5a288463eaef440ebc0ab1c1db3..b0802e642190c07d819d1c01bd7c315453d091d0:/src/palmos/utils.cpp diff --git a/src/palmos/utils.cpp b/src/palmos/utils.cpp index 71db037551..81988757ca 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 ///////////////////////////////////////////////////////////////////////////// @@ -90,7 +90,7 @@ bool wxGetUserName(wxChar *buf, int maxSize) wxStrncpy (buf, wxConvertMB2WX(id), maxSize - 1); - // free the buffer + // free the buffer MemPtrUnlock(id); return true; @@ -106,11 +106,6 @@ wxChar *wxGetUserHome(const wxString& WXUNUSED(user)) return NULL; } -bool wxDirExists(const wxString& dir) -{ - return false; -} - bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) { return false; @@ -151,12 +146,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 +177,7 @@ long wxGetFreeMemory() freeTotal+=freeHeap; } - return freeTotal; + return (wxMemorySize)freeTotal; } unsigned long wxGetProcessId() @@ -187,9 +193,20 @@ 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() @@ -244,8 +261,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) {