X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8193d58f178b7d6a2e5eb1ab591dad6c0b5c063c..fd0fca1a25931e51d7e56695875fba5030bf3e07:/src/msw/display.cpp diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 6066895d21..536bd14811 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -1,9 +1,9 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: display.cpp +// Name: src/msw/display.cpp // Purpose: MSW Implementation of wxDisplay class // Author: Royce Mitchell III // Modified by: VZ (resolutions enumeration/change support, DirectDraw, ...) -// Ryan Norton (IsPrimary override) +// Ryan Norton (IsPrimary override) // Created: 06/21/02 // RCS-ID: $Id$ // Copyright: (c) wxWidgets team @@ -18,10 +18,6 @@ // headers // --------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "display.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -58,9 +54,11 @@ // with mingw32, we must include windows.h first and it doesn't hurt with other // compilers -#include +#include "wx/msw/wrapwin.h" -#include +#ifndef __WXWINCE__ + #include +#endif // !__WXWINCE__ #ifdef _MSC_VER #pragma warning(default:4706) @@ -329,6 +327,7 @@ wxVideoMode ConvertToVideoMode(const DEVMODE& dm) dm.dmDisplayFrequency > 1 ? dm.dmDisplayFrequency : 0); } +#ifndef __WXWINCE__ // emulation of ChangeDisplaySettingsEx() for Win95 LONG WINAPI ChangeDisplaySettingsExForWin95(LPCTSTR WXUNUSED(lpszDeviceName), LPDEVMODE lpDevMode, @@ -338,6 +337,7 @@ LONG WINAPI ChangeDisplaySettingsExForWin95(LPCTSTR WXUNUSED(lpszDeviceName), { return ::ChangeDisplaySettings(lpDevMode, dwFlags); } +#endif // !__WXWINCE__ // ---------------------------------------------------------------------------- // wxDisplayModule @@ -382,10 +382,12 @@ size_t wxDisplayBase::GetCount() { InitDisplays(); - // I'm not sure if they really always return the same thing and if this is - // not true I'd like to know in which situation does it happen - wxASSERT_MSG( gs_displays->GetCount() == (size_t)::GetSystemMetrics(SM_CMONITORS), - _T("So how many displays does this system have?") ); + //RN: FIXME: This is wrong - the display info array should reload after every call + //to GetCount() - otherwise it will not be accurate. + //The user can change the number of displays in display properties/settings + //after GetCount or similar is called and really mess this up... + //wxASSERT_MSG( gs_displays->GetCount() == (size_t)::GetSystemMetrics(SM_CMONITORS), + // _T("So how many displays does this system have?") ); return gs_displays->GetCount(); } @@ -729,7 +731,11 @@ bool wxDisplay::DoChangeModeWindows(const wxVideoMode& mode) pDevMode = &dm; +#ifdef __WXWINCE__ + flags = 0; +#else // !__WXWINCE__ flags = CDS_FULLSCREEN; +#endif // __WXWINCE__/!__WXWINCE__ } @@ -748,12 +754,14 @@ bool wxDisplay::DoChangeModeWindows(const wxVideoMode& mode) } //else: huh, no user32.dll?? +#ifndef __WXWINCE__ if ( !pfnChangeDisplaySettingsEx ) { // we must be under Win95 and so there is no multiple monitors // support anyhow pfnChangeDisplaySettingsEx = ChangeDisplaySettingsExForWin95; } +#endif // !__WXWINCE__ } // do change the mode