2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: platinfo.h
|
|
|
|
// Purpose: documentation for wxPlatformInfo class
|
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxPlatformInfo
|
|
|
|
@wxheader{platinfo.h}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This class holds informations about the operating system and the toolkit that
|
|
|
|
the application
|
|
|
|
is running under and some basic architecture info of the machine where it's
|
|
|
|
running.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxbase}
|
|
|
|
@category{FIXME}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@seealso
|
|
|
|
wxGetOSVersion, wxIsPlatformLittleEndian, wxIsPlatform64Bit, wxAppTraits
|
|
|
|
*/
|
|
|
|
class wxPlatformInfo : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Initializes the object using given values.
|
|
|
|
*/
|
|
|
|
wxPlatformInfo();
|
2008-03-08 09:43:31 -05:00
|
|
|
wxPlatformInfo(wxPortId pid = wxPORT_UNKNOWN,
|
|
|
|
int tkMajor = -1,
|
|
|
|
int tkMinor = -1,
|
|
|
|
wxOperatingSystemId id = wxOS_UNKNOWN,
|
|
|
|
int osMajor = -1,
|
|
|
|
int osMinor = -1,
|
|
|
|
wxArchitecture arch = wxARCH_INVALID,
|
|
|
|
wxEndianness endian = wxENDIAN_INVALID);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the OS version is at least @c major.minor.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetOSMajorVersion(), GetOSMinorVersion(),
|
|
|
|
CheckToolkitVersion()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool CheckOSVersion(int major, int minor);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the toolkit version is at least @c major.minor.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetToolkitMajorVersion(),
|
|
|
|
GetToolkitMinorVersion(), CheckOSVersion()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool CheckToolkitVersion(int major, int minor);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the global wxPlatformInfo object, initialized with the values for the
|
|
|
|
currently running platform.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
static const wxPlatformInfo Get();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Converts the given string to a wxArchitecture enum value or to
|
|
|
|
wxARCH_INVALID if the given string is not a valid architecture string
|
|
|
|
(i.e. does not contain nor @c 32 nor @c 64 strings).
|
|
|
|
*/
|
|
|
|
static wxArchitecture GetArch(const wxString& arch);
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the name for the architecture of this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
static wxString GetArchName(wxArchitecture arch);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxString GetArchName();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the architecture ID of this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
wxArchitecture GetArchitecture();
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the endianness ID of this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
static wxEndianness GetEndianness(const wxString& end);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxEndianness GetEndianness();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the name for the endianness of this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
static wxString GetEndiannessName(wxEndianness end);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxString GetEndiannessName();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the run-time major version of the OS associated with this
|
|
|
|
wxPlatformInfo instance.
|
|
|
|
See wxGetOsVersion for more info.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CheckOSVersion()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
int GetOSMajorVersion();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the run-time minor version of the OS associated with this
|
|
|
|
wxPlatformInfo instance.
|
|
|
|
See wxGetOsVersion for more info.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CheckOSVersion()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
int GetOSMinorVersion();
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the operating system family name of the OS associated with this
|
|
|
|
wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
static wxString GetOperatingSystemFamilyName(wxOperatingSystemId os);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxString GetOperatingSystemFamilyName();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the operating system ID of this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
static wxOperatingSystemId GetOperatingSystemId(const wxString& name);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxOperatingSystemId GetOperatingSystemId();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the operating system name of the OS associated with this wxPlatformInfo
|
|
|
|
instance.
|
|
|
|
*/
|
|
|
|
static wxString GetOperatingSystemIdName(wxOperatingSystemId os);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxString GetOperatingSystemIdName();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the wxWidgets port ID associated with this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
static wxPortId GetPortId(const wxString& portname);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxPortId GetPortId();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the name of the wxWidgets port ID associated with this wxPlatformInfo
|
|
|
|
instance.
|
|
|
|
*/
|
|
|
|
static wxString GetPortIdName(wxPortId port, bool usingUniversal);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxString GetPortIdName();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Returns the short name of the wxWidgets port ID associated with this
|
|
|
|
wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
static wxString GetPortIdShortName(wxPortId port,
|
|
|
|
bool usingUniversal);
|
2008-03-08 09:43:31 -05:00
|
|
|
wxString GetPortIdShortName();
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the run-time major version of the toolkit associated with this
|
|
|
|
wxPlatformInfo instance.
|
|
|
|
Note that if GetPortId() returns wxPORT_BASE, then this value is zero (unless
|
|
|
|
externally modified with wxPlatformInfo::SetToolkitVersion); that is, no native toolkit is in use.
|
|
|
|
See wxAppTraits::GetToolkitVersion for more info.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CheckToolkitVersion()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
int GetToolkitMajorVersion();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the run-time minor version of the toolkit associated with this
|
|
|
|
wxPlatformInfo instance.
|
|
|
|
Note that if GetPortId() returns wxPORT_BASE, then this value is zero (unless
|
|
|
|
externally modified with wxPlatformInfo::SetToolkitVersion); that is, no native toolkit is in use.
|
|
|
|
See wxAppTraits::GetToolkitVersion for more info.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CheckToolkitVersion()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
int GetToolkitMinorVersion();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if this instance is fully initialized with valid values.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
bool IsOk();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if this wxPlatformInfo describes wxUniversal build.
|
|
|
|
*/
|
|
|
|
bool IsUsingUniversalWidgets();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the architecture enum value associated with this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
void SetArchitecture(wxArchitecture n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the endianness enum value associated with this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
void SetEndianness(wxEndianness n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the version of the operating system associated with this wxPlatformInfo
|
|
|
|
instance.
|
|
|
|
*/
|
|
|
|
void SetOSVersion(int major, int minor);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the operating system associated with this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
void SetOperatingSystemId(wxOperatingSystemId n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the wxWidgets port ID associated with this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
void SetPortId(wxPortId n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the version of the toolkit associated with this wxPlatformInfo instance.
|
|
|
|
*/
|
|
|
|
void SetToolkitVersion(int major, int minor);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Inequality operator. Tests all class' internal variables.
|
|
|
|
*/
|
|
|
|
bool operator!=(const wxPlatformInfo& t);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Equality operator. Tests all class' internal variables.
|
|
|
|
*/
|
|
|
|
bool operator==(const wxPlatformInfo& t);
|
|
|
|
};
|