]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed AppTraits handling on OS/2.
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 31 Aug 2003 18:15:10 +0000 (18:15 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 31 Aug 2003 18:15:10 +0000 (18:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/bakefiles/files.bkl
include/wx/apptrait.h
src/os2/utils.cpp
src/os2/utilsgui.cpp

index cc8ba0b4c42e8792e48c695659b02b480bf5265f..c8edd533e3da9e022ff5fc43df4416b6172fa54a 100644 (file)
@@ -119,7 +119,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
 </set>
 
 <set var="BASE_OS2_SRC" hints="files">
-    src/unix/baseunix.cpp
     src/os2/dir.cpp
     src/os2/mimetype.cpp
     src/os2/thread.cpp
index 8a2b8c265e98a1fcec41740be80d1b3eb2fcc93e..1f3e30f3b7976d7c39715d59bf2ac94dd2d8dad3 100644 (file)
@@ -134,7 +134,7 @@ public:
 //     Unix code (and otherwise __UNIX__ wouldn't be defined)
 #if defined(__WXMSW__)
     #include "wx/msw/apptbase.h"
-#elif defined(__UNIX__)
+#elif defined(__UNIX__) && !defined(__EMX__)
     #include "wx/unix/apptbase.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/apptbase.h"
@@ -215,15 +215,22 @@ public:
 
 #if defined(__WXMSW__)
     #include "wx/msw/apptrait.h"
-#elif defined(__UNIX__)
+#elif defined(__UNIX__) && !defined(__EMX__)
     #include "wx/unix/apptrait.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/apptrait.h"
-#else // no platform-specific methods to add to wxAppTraits
+#else 
+    // at least, we need an implementation of GetToolkitInfo !
     #if wxUSE_GUI
-        typedef wxGUIAppTraitsBase wxGUIAppTraits;
+        class wxGUIAppTraits : public wxGUIAppTraitsBase
+        {
+            virtual wxToolkitInfo& GetToolkitInfo();
+        };
     #endif // wxUSE_GUI
-    typedef wxConsoleAppTraitsBase wxConsoleAppTraits;
+    class wxConsoleAppTraits: public wxConsoleAppTraitsBase 
+    {
+        virtual wxToolkitInfo& GetToolkitInfo();
+    };
 #endif // platform
 
 #endif // _WX_APPTRAIT_H_
index 68b0e3e6af550d59263e307461eeae6b106e56b1..f6c06af9491ff046e4ef3c52d05cfcc3b588227a 100644 (file)
@@ -343,15 +343,14 @@ void wxBell()
 {
     DosBeep(1000,1000); // 1kHz during 1 sec.
 }
-#if 0
-int wxGUIAppTraits::GetOSVersion(
-  int*                              pMajorVsn
-, int*                              pMinorVsn
-)
+
+wxToolkitInfo & wxConsoleAppTraits::GetToolkitInfo()
 {
+    static wxToolkitInfo           vInfo;
     ULONG                           ulSysInfo[QSV_MAX] = {0};
     APIRET                          ulrc;
 
+    vInfo.name = _T("wxBase");
     ulrc = ::DosQuerySysInfo( 1L
                              ,QSV_MAX
                              ,(PVOID)ulSysInfo
@@ -359,14 +358,13 @@ int wxGUIAppTraits::GetOSVersion(
                             );
     if (ulrc == 0L)
     {
-        *pMajorVsn = ulSysInfo[QSV_VERSION_MAJOR];
-        *pMajorVsn = *pMajorVsn/10;
-        *pMinorVsn = ulSysInfo[QSV_VERSION_MINOR];
-        return wxWINDOWS_OS2;
+        vInfo.versionMajor = ulSysInfo[QSV_VERSION_MAJOR] / 10;
+        vInfo.versionMinor = ulSysInfo[QSV_VERSION_MINOR];
     }
-    return wxWINDOWS; // error if we get here, return generic value
+    vInfo.os = wxOS2_PM;
+    return vInfo;
 }
-#endif
+
 // ---------------------------------------------------------------------------
 const wxChar* wxGetHomeDir(
   wxString*                         pStr
@@ -501,3 +499,12 @@ wxString WXDLLEXPORT wxPMErrorToStr(
     }
     return(sError);
 } // end of wxPMErrorToStr
+
+// replacement for implementation in unix/utilsunx.cpp,
+// to be used by all X11 based ports.
+struct wxEndProcessData;
+
+void wxHandleProcessTermination(wxEndProcessData *proc_data)
+{
+    // For now, just do nothing. To be filled in as needed.
+}
index 492cfa2e61d743bba45a2be2e3f347bcc0ed16ec..f77d16db2c9342ca5b04022d8d348baf0700538c 100644 (file)
@@ -470,6 +470,32 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
     wxDisplaySize(width, height);
 }
 
+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
 // ---------------------------------------------------------------------------