/////////////////////////////////////////////////////////////////////////////
-// 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
/////////////////////////////////////////////////////////////////////////////
#include <MemoryMgr.h>
#include <DLServer.h>
#include <SoundMgr.h>
+#include <SysUtils.h>
// ============================================================================
// implementation
wxStrncpy (buf, wxConvertMB2WX(id), maxSize - 1);
- // free the buffer
+ // free the buffer
MemPtrUnlock(id);
return true;
return NULL;
}
-bool wxDirExists(const wxString& dir)
-{
- return false;
-}
-
bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
{
return false;
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;
freeTotal+=freeHeap;
}
- return freeTotal;
+ return (wxMemorySize)freeTotal;
}
unsigned long wxGetProcessId()
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;
}
#else // !wxUSE_FONTMAP
-#include "wx/palmos/registry.h"
-
// this should work if Internet Exploiter is installed
extern long wxCharsetToCodepage(const wxChar *name)
{