X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/df91131cb0f90ee8bfb194926a13b1a108ca3c6e..6f026b5b63fe7ccb025e84509886f74772b9df13:/src/cocoa/display.mm diff --git a/src/cocoa/display.mm b/src/cocoa/display.mm index 0694473028..721fe3b425 100644 --- a/src/cocoa/display.mm +++ b/src/cocoa/display.mm @@ -4,7 +4,6 @@ // Author: Ryan Norton // Modified by: // Created: 2004-10-03 -// RCS-ID: $Id$ // Copyright: (c) Ryan Norton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -23,10 +22,10 @@ #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/string.h" + #include "wx/gdicmn.h" #endif #include "wx/display_impl.h" -#include "wx/gdicmn.h" #import @@ -37,7 +36,7 @@ class wxDisplayImplMacOSX : public wxDisplayImpl { public: - wxDisplayImplMacOSX(size_t n, CGDirectDisplayID id_) + wxDisplayImplMacOSX(unsigned n, CGDirectDisplayID id_) : wxDisplayImpl(n), m_id(id_) { @@ -53,7 +52,7 @@ public: private: CGDirectDisplayID m_id; - DECLARE_NO_COPY_CLASS(wxDisplayImplMacOSX) + wxDECLARE_NO_COPY_CLASS(wxDisplayImplMacOSX); }; class wxDisplayFactoryMacOSX : public wxDisplayFactory @@ -61,27 +60,23 @@ class wxDisplayFactoryMacOSX : public wxDisplayFactory public: wxDisplayFactoryMacOSX() { } - virtual wxDisplayImpl *CreateDisplay(size_t n); - virtual size_t GetCount(); + virtual wxDisplayImpl *CreateDisplay(unsigned n); + virtual unsigned GetCount(); virtual int GetFromPoint(const wxPoint& pt); protected: - DECLARE_NO_COPY_CLASS(wxDisplayFactoryMacOSX) + wxDECLARE_NO_COPY_CLASS(wxDisplayFactoryMacOSX); }; // ============================================================================ // wxDisplayFactoryMacOSX implementation // ============================================================================ -size_t wxDisplayFactoryMacOSX::GetCount() +unsigned wxDisplayFactoryMacOSX::GetCount() { CGDisplayCount count; -#ifdef __WXDEBUG__ - CGDisplayErr err = -#endif - CGGetActiveDisplayList(0, NULL, &count); - - wxASSERT(err == CGDisplayNoErr); + CGDisplayErr err = CGGetActiveDisplayList(0, NULL, &count); + wxCHECK_MSG( err != CGDisplayNoErr, 0, "CGGetActiveDisplayList() failed" ); return count; } @@ -121,17 +116,14 @@ int wxDisplayFactoryMacOSX::GetFromPoint(const wxPoint& p) return nWhich; } -wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(size_t n) +wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(unsigned n) { CGDisplayCount theCount = GetCount(); CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount]; -#ifdef __WXDEBUG__ - CGDisplayErr err = -#endif - CGGetActiveDisplayList(theCount, theIDs, &theCount); + CGDisplayErr err = CGGetActiveDisplayList(theCount, theIDs, &theCount); + wxCHECK_MSG( err != CGDisplayNoErr, NULL, "CGGetActiveDisplayList() failed" ); - wxASSERT( err == CGDisplayNoErr ); wxASSERT( n < theCount ); wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);