X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d238d403f1fcef34bc125a68c063092919f3a277..e75390d4aa51b46b9217dc4699267c1345893054:/src/msw/display.cpp diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 1d4817a7d3..d64dc163fb 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -88,9 +88,9 @@ // display functions are found in different DLLs under WinCE and normal Win32 #ifdef __WXWINCE__ -static const wxChar displayDllName[] = _T("coredll.dll"); +static const wxChar displayDllName[] = wxT("coredll.dll"); #else -static const wxChar displayDllName[] = _T("user32.dll"); +static const wxChar displayDllName[] = wxT("user32.dll"); #endif // ---------------------------------------------------------------------------- @@ -256,7 +256,7 @@ protected: wxDisplayInfoArray m_displays; - DECLARE_NO_COPY_CLASS(wxDisplayFactoryWin32Base) + wxDECLARE_NO_COPY_CLASS(wxDisplayFactoryWin32Base); }; // ---------------------------------------------------------------------------- @@ -275,7 +275,7 @@ public: virtual bool ChangeMode(const wxVideoMode& mode); private: - DECLARE_NO_COPY_CLASS(wxDisplayImplMultimon) + wxDECLARE_NO_COPY_CLASS(wxDisplayImplMultimon); }; class wxDisplayFactoryMultimon : public wxDisplayFactoryWin32Base @@ -327,7 +327,7 @@ struct wxDisplayInfoDirectDraw : wxDisplayInfo const GUID m_guid; - DECLARE_NO_COPY_CLASS(wxDisplayInfoDirectDraw) + wxDECLARE_NO_COPY_CLASS(wxDisplayInfoDirectDraw); }; class wxDisplayImplDirectDraw : public wxDisplayImplWin32Base @@ -351,7 +351,7 @@ public: private: IDirectDraw2 *m_pDD2; - DECLARE_NO_COPY_CLASS(wxDisplayImplDirectDraw) + wxDECLARE_NO_COPY_CLASS(wxDisplayImplDirectDraw); }; class wxDisplayFactoryDirectDraw : public wxDisplayFactoryWin32Base @@ -380,7 +380,7 @@ private: // dynamically resolved DirectDrawCreate() DirectDrawCreate_t m_pfnDirectDrawCreate; - DECLARE_NO_COPY_CLASS(wxDisplayFactoryDirectDraw) + wxDECLARE_NO_COPY_CLASS(wxDisplayFactoryDirectDraw); }; #endif // wxUSE_DIRECTDRAW @@ -401,7 +401,7 @@ private: // system option #if wxUSE_DIRECTDRAW - if ( wxSystemOptions::GetOptionInt(_T("msw.display.directdraw")) ) + if ( wxSystemOptions::GetOptionInt(wxT("msw.display.directdraw")) ) { wxDisplayFactoryDirectDraw *factoryDD = new wxDisplayFactoryDirectDraw; if ( factoryDD->IsOk() ) @@ -433,7 +433,7 @@ void wxDisplayInfo::Initialize() WinStruct monInfo; if ( !gs_GetMonitorInfo(m_hmon, (LPMONITORINFO)&monInfo) ) { - wxLogLastError(_T("GetMonitorInfo")); + wxLogLastError(wxT("GetMonitorInfo")); m_flags = 0; return; } @@ -498,7 +498,7 @@ wxVideoMode wxDisplayImplWin32Base::GetCurrentMode() const dm.dmDriverExtra = 0; if ( !::EnumDisplaySettings(deviceName, ENUM_CURRENT_SETTINGS, &dm) ) { - wxLogLastError(_T("EnumDisplaySettings(ENUM_CURRENT_SETTINGS)")); + wxLogLastError(wxT("EnumDisplaySettings(ENUM_CURRENT_SETTINGS)")); } else { @@ -644,7 +644,7 @@ void wxDisplayFactoryMultimon::AddDisplay(HMONITOR hMonitor, LPRECT lprcMonitor) wxDisplayImpl *wxDisplayFactoryMultimon::CreateDisplay(unsigned n) { - wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") ); + wxCHECK_MSG( n < m_displays.size(), NULL, wxT("invalid display index") ); return new wxDisplayImplMultimon(n, *(m_displays[n])); } @@ -699,26 +699,26 @@ bool wxDisplayImplMultimon::ChangeMode(const wxVideoMode& mode) } else // change to the given mode { - wxCHECK_MSG( mode.w && mode.h, false, - _T("at least the width and height must be specified") ); + wxCHECK_MSG( mode.GetWidth() && mode.GetHeight(), false, + wxT("at least the width and height must be specified") ); wxZeroMemory(dm); dm.dmSize = sizeof(dm); dm.dmDriverExtra = 0; dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; - dm.dmPelsWidth = mode.w; - dm.dmPelsHeight = mode.h; + dm.dmPelsWidth = mode.GetWidth(); + dm.dmPelsHeight = mode.GetHeight(); - if ( mode.bpp ) + if ( mode.GetDepth() ) { dm.dmFields |= DM_BITSPERPEL; - dm.dmBitsPerPel = mode.bpp; + dm.dmBitsPerPel = mode.GetDepth(); } - if ( mode.refresh ) + if ( mode.GetRefresh() ) { dm.dmFields |= DM_DISPLAYFREQUENCY; - dm.dmDisplayFrequency = mode.refresh; + dm.dmDisplayFrequency = mode.GetRefresh(); } pDevMode = &dm; @@ -776,7 +776,7 @@ bool wxDisplayImplMultimon::ChangeMode(const wxVideoMode& mode) if (frameTop && frameTop->IsFullScreen()) { wxVideoMode current = GetCurrentMode(); - frameTop->SetClientSize(current.w, current.h); + frameTop->SetClientSize(current.GetWidth(), current.GetHeight()); } } return true; @@ -786,7 +786,7 @@ bool wxDisplayImplMultimon::ChangeMode(const wxVideoMode& mode) break; default: - wxFAIL_MSG( _T("unexpected ChangeDisplaySettingsEx() return value") ); + wxFAIL_MSG( wxT("unexpected ChangeDisplaySettingsEx() return value") ); } return false; @@ -808,7 +808,7 @@ wxDisplayFactoryDirectDraw::wxDisplayFactoryDirectDraw() if ( !ms_supportsMultimon ) return; - m_dllDDraw.Load(_T("ddraw.dll"), wxDL_VERBATIM | wxDL_QUIET); + m_dllDDraw.Load(wxT("ddraw.dll"), wxDL_VERBATIM | wxDL_QUIET); if ( !m_dllDDraw.IsLoaded() ) return; @@ -827,7 +827,7 @@ wxDisplayFactoryDirectDraw::wxDisplayFactoryDirectDraw() this, DDENUM_ATTACHEDSECONDARYDEVICES) != DD_OK ) { - wxLogLastError(_T("DirectDrawEnumerateEx")); + wxLogLastError(wxT("DirectDrawEnumerateEx")); } } @@ -852,7 +852,7 @@ wxDisplayFactoryDirectDraw::DDEnumExCallback(GUID *pGuid, if ( pGuid ) { wxDisplayFactoryDirectDraw * self = - wx_static_cast(wxDisplayFactoryDirectDraw *, lpContext); + static_cast(lpContext); self->AddDisplay(*pGuid, hmon, driverName); } //else: we're called for the primary monitor, skip it @@ -878,10 +878,10 @@ void wxDisplayFactoryDirectDraw::AddDisplay(const GUID& guid, wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n) { - wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") ); + wxCHECK_MSG( n < m_displays.size(), NULL, wxT("invalid display index") ); wxDisplayInfoDirectDraw * - info = wx_static_cast(wxDisplayInfoDirectDraw *, m_displays[n]); + info = static_cast(m_displays[n]); if ( !info->m_pDD2 ) { @@ -892,7 +892,7 @@ wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n) if ( FAILED(hr) || !pDD ) { // what to do?? - wxLogApiError(_T("DirectDrawCreate"), hr); + wxLogApiError(wxT("DirectDrawCreate"), hr); return NULL; } @@ -902,7 +902,7 @@ wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n) if ( FAILED(hr) || !info->m_pDD2 ) { - wxLogApiError(_T("IDirectDraw::QueryInterface(IDD2)"), hr); + wxLogApiError(wxT("IDirectDraw::QueryInterface(IDD2)"), hr); return NULL; } @@ -944,7 +944,7 @@ private: wxArrayVideoModes& m_modes; const wxVideoMode& m_modeMatch; - DECLARE_NO_COPY_CLASS(wxDDVideoModesAdder) + wxDECLARE_NO_COPY_CLASS(wxDDVideoModesAdder); }; HRESULT WINAPI wxDDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc, @@ -955,7 +955,7 @@ HRESULT WINAPI wxDDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc, if ( (lpDDSurfaceDesc->dwFlags & FLAGS_REQUIRED) == FLAGS_REQUIRED ) { wxDDVideoModesAdder * const vmodes = - wx_static_cast(wxDDVideoModesAdder *, lpContext); + static_cast(lpContext); vmodes->Add(wxVideoMode(lpDDSurfaceDesc->dwWidth, lpDDSurfaceDesc->dwHeight, @@ -983,7 +983,7 @@ wxDisplayImplDirectDraw::GetModes(const wxVideoMode& modeMatch) const if ( FAILED(hr) ) { - wxLogApiError(_T("IDirectDraw::EnumDisplayModes"), hr); + wxLogApiError(wxT("IDirectDraw::EnumDisplayModes"), hr); } return modes; @@ -996,7 +996,7 @@ wxDisplayImplDirectDraw::GetModes(const wxVideoMode& modeMatch) const bool wxDisplayImplDirectDraw::ChangeMode(const wxVideoMode& mode) { wxWindow *winTop = wxTheApp->GetTopWindow(); - wxCHECK_MSG( winTop, false, _T("top level window required for DirectX") ); + wxCHECK_MSG( winTop, false, wxT("top level window required for DirectX") ); HRESULT hr = m_pDD2->SetCooperativeLevel ( @@ -1005,7 +1005,7 @@ bool wxDisplayImplDirectDraw::ChangeMode(const wxVideoMode& mode) ); if ( FAILED(hr) ) { - wxLogApiError(_T("IDirectDraw2::SetCooperativeLevel"), hr); + wxLogApiError(wxT("IDirectDraw2::SetCooperativeLevel"), hr); return false; } @@ -1013,7 +1013,7 @@ bool wxDisplayImplDirectDraw::ChangeMode(const wxVideoMode& mode) hr = m_pDD2->SetDisplayMode(mode.w, mode.h, mode.bpp, mode.refresh, 0); if ( FAILED(hr) ) { - wxLogApiError(_T("IDirectDraw2::SetDisplayMode"), hr); + wxLogApiError(wxT("IDirectDraw2::SetDisplayMode"), hr); return false; }