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:
parent
3c589c7f47
commit
621ccd8a82
@ -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
|
||||
|
@ -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_
|
||||
|
@ -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.
|
||||
}
|
||||
|
@ -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
|
||||
// ---------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user