Fixed AppTraits handling on OS/2.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -119,7 +119,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
|||||||
</set>
|
</set>
|
||||||
|
|
||||||
<set var="BASE_OS2_SRC" hints="files">
|
<set var="BASE_OS2_SRC" hints="files">
|
||||||
src/unix/baseunix.cpp
|
|
||||||
src/os2/dir.cpp
|
src/os2/dir.cpp
|
||||||
src/os2/mimetype.cpp
|
src/os2/mimetype.cpp
|
||||||
src/os2/thread.cpp
|
src/os2/thread.cpp
|
||||||
|
@@ -134,7 +134,7 @@ public:
|
|||||||
// Unix code (and otherwise __UNIX__ wouldn't be defined)
|
// Unix code (and otherwise __UNIX__ wouldn't be defined)
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
#include "wx/msw/apptbase.h"
|
#include "wx/msw/apptbase.h"
|
||||||
#elif defined(__UNIX__)
|
#elif defined(__UNIX__) && !defined(__EMX__)
|
||||||
#include "wx/unix/apptbase.h"
|
#include "wx/unix/apptbase.h"
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
#include "wx/mac/apptbase.h"
|
#include "wx/mac/apptbase.h"
|
||||||
@@ -215,15 +215,22 @@ public:
|
|||||||
|
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
#include "wx/msw/apptrait.h"
|
#include "wx/msw/apptrait.h"
|
||||||
#elif defined(__UNIX__)
|
#elif defined(__UNIX__) && !defined(__EMX__)
|
||||||
#include "wx/unix/apptrait.h"
|
#include "wx/unix/apptrait.h"
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
#include "wx/mac/apptrait.h"
|
#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
|
#if wxUSE_GUI
|
||||||
typedef wxGUIAppTraitsBase wxGUIAppTraits;
|
class wxGUIAppTraits : public wxGUIAppTraitsBase
|
||||||
|
{
|
||||||
|
virtual wxToolkitInfo& GetToolkitInfo();
|
||||||
|
};
|
||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
typedef wxConsoleAppTraitsBase wxConsoleAppTraits;
|
class wxConsoleAppTraits: public wxConsoleAppTraitsBase
|
||||||
|
{
|
||||||
|
virtual wxToolkitInfo& GetToolkitInfo();
|
||||||
|
};
|
||||||
#endif // platform
|
#endif // platform
|
||||||
|
|
||||||
#endif // _WX_APPTRAIT_H_
|
#endif // _WX_APPTRAIT_H_
|
||||||
|
@@ -343,15 +343,14 @@ void wxBell()
|
|||||||
{
|
{
|
||||||
DosBeep(1000,1000); // 1kHz during 1 sec.
|
DosBeep(1000,1000); // 1kHz during 1 sec.
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
int wxGUIAppTraits::GetOSVersion(
|
wxToolkitInfo & wxConsoleAppTraits::GetToolkitInfo()
|
||||||
int* pMajorVsn
|
|
||||||
, int* pMinorVsn
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
static wxToolkitInfo vInfo;
|
||||||
ULONG ulSysInfo[QSV_MAX] = {0};
|
ULONG ulSysInfo[QSV_MAX] = {0};
|
||||||
APIRET ulrc;
|
APIRET ulrc;
|
||||||
|
|
||||||
|
vInfo.name = _T("wxBase");
|
||||||
ulrc = ::DosQuerySysInfo( 1L
|
ulrc = ::DosQuerySysInfo( 1L
|
||||||
,QSV_MAX
|
,QSV_MAX
|
||||||
,(PVOID)ulSysInfo
|
,(PVOID)ulSysInfo
|
||||||
@@ -359,14 +358,13 @@ int wxGUIAppTraits::GetOSVersion(
|
|||||||
);
|
);
|
||||||
if (ulrc == 0L)
|
if (ulrc == 0L)
|
||||||
{
|
{
|
||||||
*pMajorVsn = ulSysInfo[QSV_VERSION_MAJOR];
|
vInfo.versionMajor = ulSysInfo[QSV_VERSION_MAJOR] / 10;
|
||||||
*pMajorVsn = *pMajorVsn/10;
|
vInfo.versionMinor = ulSysInfo[QSV_VERSION_MINOR];
|
||||||
*pMinorVsn = ulSysInfo[QSV_VERSION_MINOR];
|
|
||||||
return wxWINDOWS_OS2;
|
|
||||||
}
|
}
|
||||||
return wxWINDOWS; // error if we get here, return generic value
|
vInfo.os = wxOS2_PM;
|
||||||
|
return vInfo;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
const wxChar* wxGetHomeDir(
|
const wxChar* wxGetHomeDir(
|
||||||
wxString* pStr
|
wxString* pStr
|
||||||
@@ -501,3 +499,12 @@ wxString WXDLLEXPORT wxPMErrorToStr(
|
|||||||
}
|
}
|
||||||
return(sError);
|
return(sError);
|
||||||
} // end of wxPMErrorToStr
|
} // 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.
|
||||||
|
}
|
||||||
|
@@ -470,6 +470,32 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
|
|||||||
wxDisplaySize(width, 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
|
// window information functions
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user