/////////////////////////////////////////////////////////////////////////////
// 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
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "display.h"
#endif
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);
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
{
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);
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 )
{
}
DisposeDMDisplayModeListIteratorUPP(uppMLI);
- wxASSERT(DMDisposeList(pModes) == noErr);
+
+ err = DMDisposeList(pModes);
+ wxASSERT(err == noErr);
}
else //Can't get current 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);
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;
return false;
DisposeDMDisplayModeListIteratorUPP(uppMLI);
- wxASSERT(DMDisposeList(pModes) == noErr);
+
+ err = DMDisposeList(pModes);
+ wxASSERT(err == noErr);
// For the really paranoid -
// unsigned long flags;