]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/display.mm
Give NULL explicit type to make interface recognizeable
[wxWidgets.git] / src / cocoa / display.mm
index d5bd1dbebaca7297a78e716af5e50fd833a44112..3e375d45c956487335f7d84073e9dccdcae265a6 100644 (file)
 
 #if wxUSE_DISPLAY
 
+#include "wx/display.h"
+
 #ifndef WX_PRECOMP
-   #include "wx/dynarray.h"
+    #include "wx/dynarray.h"
+    #include "wx/string.h"
+    #include "wx/gdicmn.h"
 #endif
 
-#include "wx/display.h"
 #include "wx/display_impl.h"
-#include "wx/gdicmn.h"
-#include "wx/string.h"
 
 #import <Foundation/Foundation.h>
 
 class wxDisplayImplMacOSX : public wxDisplayImpl
 {
 public:
-    wxDisplayImplMacOSX(CGDirectDisplayID id_) : m_id(id_) { }
+    wxDisplayImplMacOSX(unsigned n, CGDirectDisplayID id_)
+        : wxDisplayImpl(n),
+          m_id(id_)
+    {
+    }
 
     virtual wxRect GetGeometry() const;
     virtual wxString GetName() const { return wxString(); }
@@ -54,10 +59,10 @@ private:
 class wxDisplayFactoryMacOSX : public wxDisplayFactory
 {
 public:
-    wxDisplayFactoryMacOSX();
+    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:
@@ -68,7 +73,7 @@ protected:
 // wxDisplayFactoryMacOSX implementation
 // ============================================================================
 
-size_t wxDisplayFactoryMacOSX::GetCount()
+unsigned wxDisplayFactoryMacOSX::GetCount()
 {
     CGDisplayCount count;
 #ifdef __WXDEBUG__
@@ -116,7 +121,7 @@ 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];
@@ -129,7 +134,7 @@ wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(size_t n)
     wxASSERT( err == CGDisplayNoErr );
     wxASSERT( n < theCount );
 
-    wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(theIDs[n]);
+    wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
 
     delete [] theIDs;
 
@@ -218,8 +223,7 @@ bool wxDisplayImplMacOSX::ChangeMode(const wxVideoMode& mode)
 
 /* static */ wxDisplayFactory *wxDisplay::CreateFactory()
 {
-    return new wxDisplayFactoryMac;
+    return new wxDisplayFactoryMacOSX;
 }
 
 #endif // wxUSE_DISPLAY
-