X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b98bd6af23c1c73eb2cddf14da18455e5668de6d..f54e5c1a4f6952c62ed4480f7d26feddc20f98ba:/include/wx/platinfo.h?ds=inline diff --git a/include/wx/platinfo.h b/include/wx/platinfo.h index c5f8a6cf81..2a4e8621cf 100644 --- a/include/wx/platinfo.h +++ b/include/wx/platinfo.h @@ -58,7 +58,11 @@ enum wxOperatingSystemId // 1<<13 and 1<<14 available for other Unix flavours wxOS_DOS = 1 << 15, // Microsoft DOS - wxOS_OS2 = 1 << 16 // OS/2 + wxOS_OS2 = 1 << 16, // OS/2 + + wxOS_PALM_OS = 1 << 17, // Pure Palm OS + wxOS_PALM_LINUX = 1 << 18, // Palm over linux + wxOS_PALM = wxOS_PALM_OS | wxOS_PALM_LINUX }; // list of wxWidgets ports - some of them can be used with more than @@ -74,11 +78,14 @@ enum wxPortId wxPORT_GTK = 1 << 3, // wxGTK, using GTK+ 1.x, 2.x, GPE or Maemo wxPORT_MGL = 1 << 4, // wxMGL, using wxUniversal wxPORT_X11 = 1 << 5, // wxX11, using wxUniversal - wxPORT_OS2 = 1 << 6, // wxOS2, using OS/2 Presentation Manager - wxPORT_MAC = 1 << 7, // wxMac, using Carbon or Classic Mac API + wxPORT_PM = 1 << 6, // wxOS2, using OS/2 Presentation Manager + wxPORT_OS2 = wxPORT_PM, // wxOS2, using OS/2 Presentation Manager + wxPORT_MAC = 1 << 7, // wxOSX (former wxMac), using Cocoa, Carbon or iPhone API + wxPORT_OSX = wxPORT_MAC, // wxOSX, using Cocoa, Carbon or iPhone API wxPORT_COCOA = 1 << 8, // wxCocoa, using Cocoa NextStep/Mac API wxPORT_WINCE = 1 << 9, // wxWinCE, toolkit is WinCE SDK API - wxPORT_PALMOS = 1 << 10 // wxPalmOS, toolkit is PalmOS API + wxPORT_PALMOS = 1 << 10, // wxPalmOS, toolkit is PalmOS API + wxPORT_DFB = 1 << 11 // wxDFB, using wxUniversal }; // architecture of the operating system @@ -128,6 +135,11 @@ public: bool operator!=(const wxPlatformInfo &t) const { return !(*this == t); } + // Gets a wxPlatformInfo already initialized with the values for + // the currently running platform. + static const wxPlatformInfo& Get(); + + // string -> enum conversions // --------------------------------- @@ -157,11 +169,28 @@ public: int GetOSMinorVersion() const { return m_osVersionMinor; } + // return true if the OS version >= major.minor + bool CheckOSVersion(int major, int minor) const + { + return DoCheckVersion(GetOSMajorVersion(), + GetOSMinorVersion(), + major, + minor); + } + int GetToolkitMajorVersion() const { return m_tkVersionMajor; } int GetToolkitMinorVersion() const { return m_tkVersionMinor; } + bool CheckToolkitVersion(int major, int minor) const + { + return DoCheckVersion(GetToolkitMajorVersion(), + GetToolkitMinorVersion(), + major, + minor); + } + bool IsUsingUniversalWidgets() const { return m_usingUniversal; } @@ -200,13 +229,13 @@ public: { m_tkVersionMajor=major; m_tkVersionMinor=minor; } void SetOperatingSystemId(wxOperatingSystemId n) - { m_os=n; } + { m_os = n; } void SetPortId(wxPortId n) - { m_port=n; } + { m_port = n; } void SetArchitecture(wxArchitecture n) - { m_arch=n; } + { m_arch = n; } void SetEndianness(wxEndianness n) - { m_endian=n; } + { m_endian = n; } // miscellaneous // ----------------- @@ -222,12 +251,21 @@ public: protected: + static bool DoCheckVersion(int majorCur, int minorCur, int major, int minor) + { + return majorCur > major || (majorCur == major && minorCur >= minor); + } + + void InitForCurrentPlatform(); + + // OS stuff // ----------------- // Version of the OS; valid if m_os != wxOS_UNKNOWN // (-1 means not initialized yet). - int m_osVersionMajor, m_osVersionMinor; + int m_osVersionMajor, + m_osVersionMinor; // Operating system ID. wxOperatingSystemId m_os;