merged wxDisplayModeInfo and wxVideoMode in a single class, extracted it in a separate wx/vidmode.h header

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-09-27 12:55:46 +00:00
parent 3dd514f167
commit fedec98126
5 changed files with 85 additions and 84 deletions

View File

@@ -19,60 +19,13 @@
#endif
#include "wx/dynarray.h"
#include "wx/vidmode.h"
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxPoint;
class WXDLLEXPORT wxRect;
class WXDLLEXPORT wxString;
// ----------------------------------------------------------------------------
// wxVideoMode: contains video mode parameters for a display
// ----------------------------------------------------------------------------
struct WXDLLEXPORT wxVideoMode
{
wxVideoMode(int width = 0, int height = 0, int depth = 0, int freq = 0)
{
w = width;
h = height;
bpp = depth;
refresh = freq;
}
// default copy ctor and assignment operator are ok
bool operator==(const wxVideoMode& m) const
{
return w == m.w && h == m.h && bpp == m.bpp && refresh == m.refresh;
}
bool operator!=(const wxVideoMode& mode) const
{
return !operator==(mode);
}
// returns true if this mode matches the other one in the sense that all
// non zero fields of the other mode have the same value in this one
// (except for refresh which is allowed to have a greater value)
bool Matches(const wxVideoMode& other) const
{
return (!other.w || w == other.w) &&
(!other.h || h == other.h) &&
(!other.bpp || bpp == other.bpp) &&
(!other.refresh || refresh >= other.refresh);
}
// the screen size in pixels (e.g. 640*480), 0 means unspecified
int w, h;
// bits per pixel (e.g. 32), 1 is monochrome and 0 means unspecified/known
int bpp;
// refresh frequency in Hz, 0 means unspecified/unknown
int refresh;
};
WX_DECLARE_EXPORTED_OBJARRAY(wxVideoMode, wxArrayVideoModes);
// default, uninitialized, video mode object