use unsigned for display count

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41548 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2006-10-02 05:38:05 +00:00
parent b143cf708b
commit 4e675101a7
8 changed files with 48 additions and 48 deletions

View File

@@ -19,7 +19,7 @@ None
\membersection{wxDisplay::wxDisplay}\label{wxdisplayctor} \membersection{wxDisplay::wxDisplay}\label{wxdisplayctor}
\func{}{wxDisplay}{\param{size\_t }{index = 0}} \func{}{wxDisplay}{\param{unsigned }{index = 0}}
Constructor, setting up a wxDisplay instance with the specified display. Constructor, setting up a wxDisplay instance with the specified display.
@@ -73,7 +73,7 @@ there is a taskbar (or equivalent) on this display.
\membersection{wxDisplay::GetCount}\label{wxdisplaygetcount} \membersection{wxDisplay::GetCount}\label{wxdisplaygetcount}
\func{static size\_t}{GetCount}{\void} \func{static unsigned }{GetCount}{\void}
Returns the number of connected displays. Returns the number of connected displays.

View File

@@ -45,7 +45,7 @@ public:
// //
// the displays are numbered from 0 to GetCount() - 1, 0 is always the // the displays are numbered from 0 to GetCount() - 1, 0 is always the
// primary display and the only one which is always supported // primary display and the only one which is always supported
wxDisplay(size_t n = 0); wxDisplay(unsigned n = 0);
// dtor is not virtual as this is a concrete class not meant to be derived // dtor is not virtual as this is a concrete class not meant to be derived
// from // from
@@ -54,7 +54,7 @@ public:
// return the number of available displays, valid parameters to // return the number of available displays, valid parameters to
// wxDisplay ctor are from 0 up to this number // wxDisplay ctor are from 0 up to this number
static size_t GetCount(); static unsigned GetCount();
// find the display where the given point lies, return wxNOT_FOUND if // find the display where the given point lies, return wxNOT_FOUND if
// it doesn't belong to any display // it doesn't belong to any display

View File

@@ -26,10 +26,10 @@ public:
// create a new display object // create a new display object
// //
// it can return a NULL pointer if the display creation failed // it can return a NULL pointer if the display creation failed
virtual wxDisplayImpl *CreateDisplay(size_t n) = 0; virtual wxDisplayImpl *CreateDisplay(unsigned n) = 0;
// get the total number of displays // get the total number of displays
virtual size_t GetCount() = 0; virtual unsigned GetCount() = 0;
// return the display for the given point or wxNOT_FOUND // return the display for the given point or wxNOT_FOUND
virtual int GetFromPoint(const wxPoint& pt) = 0; virtual int GetFromPoint(const wxPoint& pt) = 0;
@@ -61,7 +61,7 @@ public:
virtual wxString GetName() const = 0; virtual wxString GetName() const = 0;
// return the index of this display // return the index of this display
size_t GetIndex() const { return m_index; } unsigned GetIndex() const { return m_index; }
// return true if this is the primary monitor (usually one with index 0) // return true if this is the primary monitor (usually one with index 0)
virtual bool IsPrimary() const { return GetIndex() == 0; } virtual bool IsPrimary() const { return GetIndex() == 0; }
@@ -80,11 +80,11 @@ public:
protected: protected:
// create the object providing access to the display with the given index // create the object providing access to the display with the given index
wxDisplayImpl(size_t n) : m_index(n) { } wxDisplayImpl(unsigned n) : m_index(n) { }
// the index of this display (0 is always the primary one) // the index of this display (0 is always the primary one)
const size_t m_index; const unsigned m_index;
friend class wxDisplayFactory; friend class wxDisplayFactory;
@@ -101,8 +101,8 @@ protected:
class WXDLLEXPORT wxDisplayFactorySingle : public wxDisplayFactory class WXDLLEXPORT wxDisplayFactorySingle : public wxDisplayFactory
{ {
public: public:
virtual wxDisplayImpl *CreateDisplay(size_t n); virtual wxDisplayImpl *CreateDisplay(unsigned n);
virtual size_t GetCount() { return 1; } virtual unsigned GetCount() { return 1; }
virtual int GetFromPoint(const wxPoint& pt); virtual int GetFromPoint(const wxPoint& pt);
}; };

View File

@@ -37,7 +37,7 @@
class wxDisplayImplMacOSX : public wxDisplayImpl class wxDisplayImplMacOSX : public wxDisplayImpl
{ {
public: public:
wxDisplayImplMacOSX(size_t n, CGDirectDisplayID id_) wxDisplayImplMacOSX(unsigned n, CGDirectDisplayID id_)
: wxDisplayImpl(n), : wxDisplayImpl(n),
m_id(id_) m_id(id_)
{ {
@@ -61,8 +61,8 @@ class wxDisplayFactoryMacOSX : public wxDisplayFactory
public: public:
wxDisplayFactoryMacOSX() { } wxDisplayFactoryMacOSX() { }
virtual wxDisplayImpl *CreateDisplay(size_t n); virtual wxDisplayImpl *CreateDisplay(unsigned n);
virtual size_t GetCount(); virtual unsigned GetCount();
virtual int GetFromPoint(const wxPoint& pt); virtual int GetFromPoint(const wxPoint& pt);
protected: protected:
@@ -73,7 +73,7 @@ protected:
// wxDisplayFactoryMacOSX implementation // wxDisplayFactoryMacOSX implementation
// ============================================================================ // ============================================================================
size_t wxDisplayFactoryMacOSX::GetCount() unsigned wxDisplayFactoryMacOSX::GetCount()
{ {
CGDisplayCount count; CGDisplayCount count;
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
@@ -121,7 +121,7 @@ int wxDisplayFactoryMacOSX::GetFromPoint(const wxPoint& p)
return nWhich; return nWhich;
} }
wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(unsigned n)
{ {
CGDisplayCount theCount = GetCount(); CGDisplayCount theCount = GetCount();
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount]; CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];

View File

@@ -118,7 +118,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDisplayModule, wxModule)
// ctor/dtor // ctor/dtor
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxDisplay::wxDisplay(size_t n) wxDisplay::wxDisplay(unsigned n)
{ {
wxASSERT_MSG( n < GetCount(), wxASSERT_MSG( n < GetCount(),
wxT("An invalid index was passed to wxDisplay") ); wxT("An invalid index was passed to wxDisplay") );
@@ -135,7 +135,7 @@ wxDisplay::~wxDisplay()
// static functions forwarded to wxDisplayFactory // static functions forwarded to wxDisplayFactory
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/* static */ size_t wxDisplay::GetCount() /* static */ unsigned wxDisplay::GetCount()
{ {
return Factory().GetCount(); return Factory().GetCount();
} }
@@ -247,7 +247,7 @@ int wxDisplayFactory::GetFromWindow(wxWindow *window)
// ============================================================================ // ============================================================================
/* static */ /* static */
wxDisplayImpl *wxDisplayFactorySingle::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactorySingle::CreateDisplay(unsigned n)
{ {
// we recognize the main display only // we recognize the main display only
return n != 0 ? NULL : new wxDisplayImplSingle; return n != 0 ? NULL : new wxDisplayImplSingle;

View File

@@ -56,7 +56,7 @@
class wxDisplayImplMacOSX : public wxDisplayImpl class wxDisplayImplMacOSX : public wxDisplayImpl
{ {
public: public:
wxDisplayImplMacOSX(size_t n, CGDirectDisplayID id) wxDisplayImplMacOSX(unsigned n, CGDirectDisplayID id)
: wxDisplayImpl(n), : wxDisplayImpl(n),
m_id(id) m_id(id)
{ {
@@ -80,8 +80,8 @@ class wxDisplayFactoryMacOSX : public wxDisplayFactory
public: public:
wxDisplayFactoryMacOSX() {} wxDisplayFactoryMacOSX() {}
virtual wxDisplayImpl *CreateDisplay(size_t n); virtual wxDisplayImpl *CreateDisplay(unsigned n);
virtual size_t GetCount(); virtual unsigned GetCount();
virtual int GetFromPoint(const wxPoint& pt); virtual int GetFromPoint(const wxPoint& pt);
protected: protected:
@@ -92,7 +92,7 @@ protected:
// wxDisplayFactoryMacOSX implementation // wxDisplayFactoryMacOSX implementation
// ============================================================================ // ============================================================================
size_t wxDisplayFactoryMacOSX::GetCount() unsigned wxDisplayFactoryMacOSX::GetCount()
{ {
CGDisplayCount count; CGDisplayCount count;
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
@@ -140,7 +140,7 @@ int wxDisplayFactoryMacOSX::GetFromPoint(const wxPoint& p)
return nWhich; return nWhich;
} }
wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(unsigned n)
{ {
CGDisplayCount theCount = GetCount(); CGDisplayCount theCount = GetCount();
CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount]; CGDirectDisplayID* theIDs = new CGDirectDisplayID[theCount];
@@ -256,7 +256,7 @@ bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode )
class wxDisplayImplMac : public wxDisplayImpl class wxDisplayImplMac : public wxDisplayImpl
{ {
public: public:
wxDisplayImplMac(size_t n, GDHandle hndl) wxDisplayImplMac(unsigned n, GDHandle hndl)
: wxDisplayImpl(n), : wxDisplayImpl(n),
m_hndl(hndl) m_hndl(hndl)
{ {
@@ -280,8 +280,8 @@ class wxDisplayFactoryMac : public wxDisplayFactory
public: public:
wxDisplayFactoryMac(); wxDisplayFactoryMac();
virtual wxDisplayImpl *CreateDisplay(size_t n); virtual wxDisplayImpl *CreateDisplay(unsigned n);
virtual size_t GetCount(); virtual unsigned GetCount();
virtual int GetFromPoint(const wxPoint& pt); virtual int GetFromPoint(const wxPoint& pt);
protected: protected:
@@ -292,9 +292,9 @@ protected:
// wxDisplayFactoryMac implementation // wxDisplayFactoryMac implementation
// ============================================================================ // ============================================================================
size_t wxDisplayFactoryMac::GetCount() unsigned wxDisplayFactoryMac::GetCount()
{ {
size_t num = 0; unsigned num = 0;
GDHandle hndl = DMGetFirstScreenDevice(true); GDHandle hndl = DMGetFirstScreenDevice(true);
while(hndl) while(hndl)
{ {
@@ -306,7 +306,7 @@ size_t wxDisplayFactoryMac::GetCount()
int wxDisplayFactoryMac::GetFromPoint(const wxPoint &p) int wxDisplayFactoryMac::GetFromPoint(const wxPoint &p)
{ {
size_t num = 0; unsigned num = 0;
GDHandle hndl = DMGetFirstScreenDevice(true); GDHandle hndl = DMGetFirstScreenDevice(true);
while(hndl) while(hndl)
{ {
@@ -325,9 +325,9 @@ int wxDisplayFactoryMac::GetFromPoint(const wxPoint &p)
return wxNOT_FOUND; return wxNOT_FOUND;
} }
wxDisplayImpl *wxDisplayFactoryMac::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactoryMac::CreateDisplay(unsigned n)
{ {
size_t nOrig = n; unsigned nOrig = n;
GDHandle hndl = DMGetFirstScreenDevice(true); GDHandle hndl = DMGetFirstScreenDevice(true);
while(hndl) while(hndl)

View File

@@ -174,7 +174,7 @@ WX_DEFINE_ARRAY_PTR(wxDisplayInfo *, wxDisplayInfoArray);
class wxDisplayImplWin32Base : public wxDisplayImpl class wxDisplayImplWin32Base : public wxDisplayImpl
{ {
public: public:
wxDisplayImplWin32Base(size_t n, wxDisplayInfo& info) wxDisplayImplWin32Base(unsigned n, wxDisplayInfo& info)
: wxDisplayImpl(n), : wxDisplayImpl(n),
m_info(info) m_info(info)
{ {
@@ -219,7 +219,7 @@ public:
bool IsOk() const { return !m_displays.empty(); } bool IsOk() const { return !m_displays.empty(); }
virtual size_t GetCount() { return m_displays.size(); } virtual unsigned GetCount() { return unsigned(m_displays.size()); }
virtual int GetFromPoint(const wxPoint& pt); virtual int GetFromPoint(const wxPoint& pt);
virtual int GetFromWindow(wxWindow *window); virtual int GetFromWindow(wxWindow *window);
@@ -257,7 +257,7 @@ protected:
class wxDisplayImplMultimon : public wxDisplayImplWin32Base class wxDisplayImplMultimon : public wxDisplayImplWin32Base
{ {
public: public:
wxDisplayImplMultimon(size_t n, wxDisplayInfo& info) wxDisplayImplMultimon(unsigned n, wxDisplayInfo& info)
: wxDisplayImplWin32Base(n, info) : wxDisplayImplWin32Base(n, info)
{ {
} }
@@ -274,7 +274,7 @@ class wxDisplayFactoryMultimon : public wxDisplayFactoryWin32Base
public: public:
wxDisplayFactoryMultimon(); wxDisplayFactoryMultimon();
virtual wxDisplayImpl *CreateDisplay(size_t n); virtual wxDisplayImpl *CreateDisplay(unsigned n);
private: private:
// EnumDisplayMonitors() callback // EnumDisplayMonitors() callback
@@ -324,7 +324,7 @@ struct wxDisplayInfoDirectDraw : wxDisplayInfo
class wxDisplayImplDirectDraw : public wxDisplayImplWin32Base class wxDisplayImplDirectDraw : public wxDisplayImplWin32Base
{ {
public: public:
wxDisplayImplDirectDraw(size_t n, wxDisplayInfo& info, IDirectDraw2 *pDD2) wxDisplayImplDirectDraw(unsigned n, wxDisplayInfo& info, IDirectDraw2 *pDD2)
: wxDisplayImplWin32Base(n, info), : wxDisplayImplWin32Base(n, info),
m_pDD2(pDD2) m_pDD2(pDD2)
{ {
@@ -351,7 +351,7 @@ public:
wxDisplayFactoryDirectDraw(); wxDisplayFactoryDirectDraw();
virtual ~wxDisplayFactoryDirectDraw(); virtual ~wxDisplayFactoryDirectDraw();
virtual wxDisplayImpl *CreateDisplay(size_t n); virtual wxDisplayImpl *CreateDisplay(unsigned n);
private: private:
// callback used with DirectDrawEnumerateEx() // callback used with DirectDrawEnumerateEx()
@@ -647,7 +647,7 @@ void wxDisplayFactoryMultimon::AddDisplay(HMONITOR hMonitor, LPRECT lprcMonitor)
// wxDisplayFactoryMultimon inherited pure virtuals implementation // wxDisplayFactoryMultimon inherited pure virtuals implementation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxDisplayImpl *wxDisplayFactoryMultimon::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactoryMultimon::CreateDisplay(unsigned n)
{ {
wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") ); wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") );
@@ -888,7 +888,7 @@ void wxDisplayFactoryDirectDraw::AddDisplay(const GUID& guid,
// wxDisplayFactoryDirectDraw inherited pure virtuals implementation // wxDisplayFactoryDirectDraw inherited pure virtuals implementation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n)
{ {
wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") ); wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") );

View File

@@ -71,7 +71,7 @@ public:
operator const XineramaScreenInfo *() const { return m_screens; } operator const XineramaScreenInfo *() const { return m_screens; }
size_t GetCount() const { return wx_static_cast(size_t, m_num); } unsigned GetCount() const { return wx_static_cast(unsigned, m_num); }
private: private:
XineramaScreenInfo *m_screens; XineramaScreenInfo *m_screens;
@@ -85,7 +85,7 @@ private:
class WXDLLEXPORT wxDisplayImplX11 : public wxDisplayImpl class WXDLLEXPORT wxDisplayImplX11 : public wxDisplayImpl
{ {
public: public:
wxDisplayImplX11(size_t n, const XineramaScreenInfo& info) wxDisplayImplX11(unsigned n, const XineramaScreenInfo& info)
: wxDisplayImpl(n), : wxDisplayImpl(n),
m_rect(info.x_org, info.y_org, info.width, info.height) m_rect(info.x_org, info.y_org, info.width, info.height)
{ {
@@ -110,8 +110,8 @@ class wxDisplayFactoryX11 : public wxDisplayFactory
public: public:
wxDisplayFactoryX11() { } wxDisplayFactoryX11() { }
virtual wxDisplayImpl *CreateDisplay(size_t n); virtual wxDisplayImpl *CreateDisplay(unsigned n);
virtual size_t GetCount(); virtual unsigned GetCount();
virtual int GetFromPoint(const wxPoint& pt); virtual int GetFromPoint(const wxPoint& pt);
protected: protected:
@@ -122,7 +122,7 @@ protected:
// wxDisplayFactoryX11 implementation // wxDisplayFactoryX11 implementation
// ============================================================================ // ============================================================================
size_t wxDisplayFactoryX11::GetCount() unsigned wxDisplayFactoryX11::GetCount()
{ {
return ScreensInfo().GetCount(); return ScreensInfo().GetCount();
} }
@@ -131,8 +131,8 @@ int wxDisplayFactoryX11::GetFromPoint(const wxPoint& p)
{ {
ScreensInfo screens; ScreensInfo screens;
const size_t numscreens(screens.GetCount()); const unsigned numscreens(screens.GetCount());
for ( size_t i = 0; i < numscreens; ++i ) for ( unsigned i = 0; i < numscreens; ++i )
{ {
const XineramaScreenInfo& s = screens[i]; const XineramaScreenInfo& s = screens[i];
if ( p.x >= s.x_org && p.x < s.x_org + s.width && if ( p.x >= s.x_org && p.x < s.x_org + s.width &&
@@ -145,7 +145,7 @@ int wxDisplayFactoryX11::GetFromPoint(const wxPoint& p)
return wxNOT_FOUND; return wxNOT_FOUND;
} }
wxDisplayImpl *wxDisplayFactoryX11::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactoryX11::CreateDisplay(unsigned n)
{ {
ScreensInfo screens; ScreensInfo screens;