X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c4a8e4107300d99d0c6ec0e6c60d4899b093654..e11898f903183f897a2b2a50a4447ea73ba7273f:/src/mac/carbon/display.cpp diff --git a/src/mac/carbon/display.cpp b/src/mac/carbon/display.cpp index bd1d5e8d73..313c2f26cc 100644 --- a/src/mac/carbon/display.cpp +++ b/src/mac/carbon/display.cpp @@ -1,11 +1,11 @@ ///////////////////////////////////////////////////////////////////////////// // Name: display.cpp // Purpose: Mac implementation of wxDisplay class -// Author: Brian Victor -// Modified by: Royce Mitchell III & Ryan Norton +// Author: Ryan Norton & Brian Victor +// Modified by: Royce Mitchell III // Created: 06/21/02 // RCS-ID: $Id$ -// Copyright: (c) wxWindows team +// Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -25,6 +25,7 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/log.h" + #include "wx/msgdlg.h" #endif #ifdef __DARWIN__ @@ -243,10 +244,14 @@ wxArrayVideoModes DMListType pModes; DMDisplayModeListIteratorUPP uppMLI; DisplayIDType nDisplayID; + OSErr err; - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); + err = DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false); + wxASSERT(err == noErr); + //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, wxT("Could not create a new display mode list") ); + err = DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes); + wxASSERT_MSG(err == noErr, wxT("Could not create a new display mode list") ); uppMLI = NewDMDisplayModeListIteratorUPP(DMModeListIteratorProc); wxASSERT(uppMLI); @@ -256,11 +261,13 @@ wxArrayVideoModes sModeInfo.pMatchMode = &mode; for (DMListIndexType i = 0; i < nNumModes; ++i) { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); + err = DMGetIndexedDisplayModeFromList(pModes, i, NULL, uppMLI, &sModeInfo); + wxASSERT(err == noErr); } DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); + + err = DMDisposeList(pModes); + wxASSERT(err == noErr); } else //DM 1.0, 1.2, 1.x { @@ -289,11 +296,14 @@ wxVideoMode wxDisplay::GetCurrentMode() const DMListType pModes; DMDisplayModeListIteratorUPP uppMLI; DisplayIDType nDisplayID; + OSErr err; - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); + err = DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false); + wxASSERT(err == noErr); + //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, - wxT("Could not create a new display mode list") ); + err = DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes); + wxASSERT_MSG(err == noErr, wxT("Could not create a new display mode list") ); uppMLI = NewDMDisplayModeListIteratorUPP(DMModeTransProc); wxASSERT(uppMLI); @@ -303,8 +313,8 @@ wxVideoMode wxDisplay::GetCurrentMode() const sModeInfo.psMode = &sMode; for (DMListIndexType i = 0; i < nNumModes; ++i) { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); + err = DMGetIndexedDisplayModeFromList(pModes, i, NULL, uppMLI, &sModeInfo); + wxASSERT(err == noErr); if ( sModeInfo.bMatched == true ) { @@ -314,7 +324,9 @@ wxVideoMode wxDisplay::GetCurrentMode() const } DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); + + err = DMDisposeList(pModes); + wxASSERT(err == noErr); } else //Can't get current mode? { @@ -367,11 +379,14 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode) DMListType pModes; DMDisplayModeListIteratorUPP uppMLI; DisplayIDType nDisplayID; + OSErr err; - wxASSERT(DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false) == noErr); + err = DMGetDisplayIDByGDevice(m_priv->m_hndl, &nDisplayID, false); + wxASSERT(err == noErr); + //Create a new list... - wxASSERT_MSG(DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes) == noErr, - wxT("Could not create a new display mode list") ); + err = DMNewDisplayModeList(nDisplayID, NULL, NULL, &nNumModes, &pModes); + wxASSERT_MSG(err == noErr, wxT("Could not create a new display mode list") ); uppMLI = NewDMDisplayModeListIteratorUPP(DMModeInfoProc); wxASSERT(uppMLI); @@ -382,8 +397,9 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode) unsigned int i; for(i = 0; i < nNumModes; ++i) { - wxASSERT(DMGetIndexedDisplayModeFromList(pModes, i, NULL, - uppMLI, &sModeInfo) == noErr); + err = DMGetIndexedDisplayModeFromList(pModes, i, NULL, uppMLI, &sModeInfo); + wxASSERT(err == noErr); + if (sModeInfo.bMatched == true) { sMode = sModeInfo.sMode; @@ -394,7 +410,9 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode) return false; DisposeDMDisplayModeListIteratorUPP(uppMLI); - wxASSERT(DMDisposeList(pModes) == noErr); + + err = DMDisposeList(pModes); + wxASSERT(err == noErr); // For the really paranoid - // unsigned long flags;