]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/utilsgui.cpp
Changes corresponding to patch #841324 from Ian Brown:
[wxWidgets.git] / src / os2 / utilsgui.cpp
index 492cfa2e61d743bba45a2be2e3f347bcc0ed16ec..d5153224f1a735d3d8df478026b5804173476f38 100644 (file)
@@ -31,6 +31,9 @@
     #include "wx/cursor.h"
 #endif //WX_PRECOMP
 
+#include "wx/apptrait.h"
+#include "wx/timer.h"
+
 #include "wx/os2/private.h"     // includes <windows.h>
 
 // ============================================================================
@@ -470,6 +473,42 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
     wxDisplaySize(width, height);
 }
 
+void wxGUIAppTraits::InitializeGui(unsigned long &ulHab)
+{
+    ulHab = ::WinInitialize(0);
+}
+
+void wxGUIAppTraits::TerminateGui(unsigned long ulHab)
+{
+    ::WinTerminate(ulHab);
+}
+
+wxToolkitInfo & wxGUIAppTraits::GetToolkitInfo()
+{
+    static wxToolkitInfo           vInfo;
+    ULONG                           ulSysInfo[QSV_MAX] = {0};
+    APIRET                          ulrc;
+
+    vInfo.shortName = _T("PM");
+    vInfo.name = _T("wxOS2");
+#ifdef __WXUNIVERSAL__
+    vInfo.shortName << _T("univ");
+    vInfo.name << _T("/wxUniversal");
+#endif
+    ulrc = ::DosQuerySysInfo( 1L
+                             ,QSV_MAX
+                             ,(PVOID)ulSysInfo
+                             ,sizeof(ULONG) * QSV_MAX
+                            );
+    if (ulrc == 0L)
+    {
+        vInfo.versionMajor = ulSysInfo[QSV_VERSION_MAJOR] / 10;
+        vInfo.versionMinor = ulSysInfo[QSV_VERSION_MINOR];
+    }
+    vInfo.os = wxOS2_PM;
+    return vInfo;
+}
+
 // ---------------------------------------------------------------------------
 // window information functions
 // ---------------------------------------------------------------------------