X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..0acb94947f39951a1688bbaa57d3a4bf5be40dbb:/include/wx/gdicmn.h diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 36c371c91c..93320b4b3f 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -21,12 +21,14 @@ #include "wx/hash.h" #include "wx/setup.h" -#ifdef __WINDOWS__ +#ifdef __WXMSW__ #include "wx/msw/colour.h" -#elif defined(__MOTIF__) +#elif defined(__WXMOTIF__) #include "wx/xt/colour.h" -#elif defined(__GTK__) +#elif defined(__WXGTK__) #include "wx/gtk/colour.h" +#elif defined(__WXQT__) +#include "wx/qt/colour.h" #endif // Standard cursors @@ -65,42 +67,54 @@ typedef enum { #endif } _standard_cursors_t; -class WXDLLEXPORT wxSize: public wxObject +class WXDLLEXPORT wxSize { public: long x; long y; - inline wxSize(void) { x = 0; y = 0; } + inline wxSize() { x = 0; y = 0; } inline wxSize(long xx, long yy) { x = xx; y = yy; } inline wxSize(const wxSize& sz) { x = sz.x; y = sz.y; } inline void operator = (const wxSize& sz) { x = sz.x; y = sz.y; } + inline wxSize operator + (const wxSize& sz) { return wxSize(x + sz.x, y + sz.y); } + inline wxSize operator - (const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); } inline void Set(long xx, long yy) { x = xx; y = yy; } inline long GetX() const { return x; } inline long GetY() const { return y; } }; // Point -class WXDLLEXPORT wxRealPoint: public wxObject +class WXDLLEXPORT wxRealPoint { - DECLARE_DYNAMIC_CLASS(wxRealPoint) public: double x; double y; - inline wxRealPoint(void) { x = 0.0; y = 0.0; }; - inline wxRealPoint(double the_x, double the_y) { x = the_x; y = the_y; }; + inline wxRealPoint() { x = 0.0; y = 0.0; }; + inline wxRealPoint(double _x, double _y) { x = _x; y = _y; }; + inline wxRealPoint operator + (const wxRealPoint& pt) { return wxRealPoint(x + pt.x, y + pt.y); } + inline wxRealPoint operator - (const wxRealPoint& pt) { return wxRealPoint(x - pt.x, y - pt.y); } inline void operator = (const wxRealPoint& pt) { x = pt.x; y = pt.y; } }; -class WXDLLEXPORT wxPoint: public wxObject +class WXDLLEXPORT wxPoint { - DECLARE_DYNAMIC_CLASS(wxPoint) public: +#if defined(__WXMSW__) && !defined(__WIN32__) + int x; + int y; +#else long x; long y; - inline wxPoint(void) { x = 0; y = 0; }; +#endif + + inline wxPoint() { x = 0; y = 0; }; wxPoint(long the_x, long the_y) { x = the_x; y = the_y; }; + wxPoint(const wxPoint& pt) { x = pt.x; y = pt.y; }; + inline void operator = (const wxPoint& pt) { x = pt.x; y = pt.y; } + inline wxPoint operator + (const wxPoint& pt) { return wxPoint(x + pt.x, y + pt.y); } + inline wxPoint operator - (const wxPoint& pt) { return wxPoint(x - pt.x, y - pt.y); } }; #if WXWIN_COMPATIBILITY @@ -108,31 +122,31 @@ class WXDLLEXPORT wxPoint: public wxObject #define wxRectangle wxRect #endif -class WXDLLEXPORT wxRect : public wxObject { - DECLARE_DYNAMIC_CLASS(wxRect) +class WXDLLEXPORT wxRect +{ public: - wxRect(void) ; - wxRect(const long x, const long y, const long w, const long h); + wxRect() ; + wxRect(long x, long y, long w, long h); wxRect(const wxPoint& topLeft, const wxPoint& bottomRight); wxRect(const wxPoint& pos, const wxSize& size); wxRect(const wxRect& rect); - inline long GetX(void) const { return x; } - inline void SetX(const long X) { x = X; } - inline long GetY(void) const { return y; } - inline void SetY(const long Y) { y = Y; } + inline long GetX() const { return x; } + inline void SetX(long X) { x = X; } + inline long GetY() const { return y; } + inline void SetY(long Y) { y = Y; } inline long GetWidth() const { return width; } - inline void SetWidth(const long w) { width = w; } + inline void SetWidth(long w) { width = w; } inline long GetHeight() const { return height; } - inline void SetHeight(const long h) { height = h; } + inline void SetHeight(long h) { height = h; } - inline wxPoint GetPosition(void) { return wxPoint(x, y); } - inline wxSize GetSize(void) { return wxSize(width, height); } + inline wxPoint GetPosition() { return wxPoint(x, y); } + inline wxSize GetSize() { return wxSize(width, height); } - inline long GetLeft(void) const { return x; } - inline long GetTop(void) const { return y; } - inline long GetBottom(void) const { return y + height; } - inline long GetRight(void) const { return x + width; } + inline long GetLeft() const { return x; } + inline long GetTop() const { return y; } + inline long GetBottom() const { return y + height; } + inline long GetRight() const { return x + width; } wxRect& operator = (const wxRect& rect); bool operator == (const wxRect& rect); @@ -184,26 +198,26 @@ class WXDLLEXPORT wxPenList: public wxList { DECLARE_DYNAMIC_CLASS(wxPenList) public: - inline wxPenList(void) + inline wxPenList() { } - ~wxPenList(void); + ~wxPenList(); void AddPen(wxPen *pen); void RemovePen(wxPen *pen); - wxPen *FindOrCreatePen(const wxColour& colour, const int width, const int style); - wxPen *FindOrCreatePen(const wxString& colour, const int width, const int style); + wxPen *FindOrCreatePen(const wxColour& colour, int width, int style); + wxPen *FindOrCreatePen(const wxString& colour, int width, int style); }; class WXDLLEXPORT wxBrushList: public wxList { DECLARE_DYNAMIC_CLASS(wxBrushList) public: - inline wxBrushList(void) + inline wxBrushList() { } - ~wxBrushList(void); + ~wxBrushList(); void AddBrush(wxBrush *brush); void RemoveBrush(wxBrush *brush); - wxBrush *FindOrCreateBrush(const wxColour& colour, const int style); - wxBrush *FindOrCreateBrush(const wxString& colour, const int style); + wxBrush *FindOrCreateBrush(const wxColour& colour, int style); + wxBrush *FindOrCreateBrush(const wxString& colour, int style); }; WXDLLEXPORT_DATA(extern const char*) wxEmptyString; @@ -212,13 +226,13 @@ class WXDLLEXPORT wxFontList: public wxList { DECLARE_DYNAMIC_CLASS(wxFontList) public: - inline wxFontList(void) + inline wxFontList() { } - ~wxFontList(void); + ~wxFontList(); void AddFont(wxFont *font); void RemoveFont(wxFont *font); - wxFont *FindOrCreateFont(const int pointSize, const int family, const int style, const int weight, - const bool underline = FALSE, const wxString& face = wxEmptyString); + wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight, + bool underline = FALSE, const wxString& face = wxEmptyString); }; class WXDLLEXPORT wxColourDatabase: public wxList @@ -226,19 +240,19 @@ class WXDLLEXPORT wxColourDatabase: public wxList DECLARE_CLASS(wxColourDatabase) public: wxColourDatabase(int type); - ~wxColourDatabase(void) ; + ~wxColourDatabase() ; // Not const because it may add a name to the database wxColour *FindColour(const wxString& colour) ; wxString FindName(const wxColour& colour) const; - void Initialize(void); + void Initialize(); }; class WXDLLEXPORT wxBitmapList: public wxList { DECLARE_DYNAMIC_CLASS(wxBitmapList) public: - wxBitmapList(void); - ~wxBitmapList(void); + wxBitmapList(); + ~wxBitmapList(); void AddBitmap(wxBitmap *bitmap); void RemoveBitmap(wxBitmap *bitmap); @@ -302,21 +316,25 @@ WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR; WXDLLEXPORT_DATA(extern wxCursor*) wxCROSS_CURSOR; WXDLLEXPORT_DATA(extern wxColourDatabase*) wxTheColourDatabase; -extern void WXDLLEXPORT wxInitializeStockObjects(void); -extern void WXDLLEXPORT wxDeleteStockObjects(void); +extern void WXDLLEXPORT wxInitializeStockObjects(); +extern void WXDLLEXPORT wxInitializeStockLists(); +extern void WXDLLEXPORT wxDeleteStockObjects(); +extern void WXDLLEXPORT wxDeleteStockLists(); -extern bool WXDLLEXPORT wxColourDisplay(void); +extern bool WXDLLEXPORT wxColourDisplay(); // Returns depth of screen -extern int WXDLLEXPORT wxDisplayDepth(void); +extern int WXDLLEXPORT wxDisplayDepth(); +#define wxGetDisplayDepth wxDisplayDepth extern void WXDLLEXPORT wxDisplaySize(int *width, int *height); +extern wxSize WXDLLEXPORT wxGetDisplaySize(); extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor); // Useful macro for create icons portably -#ifdef __WINDOWS__ +#ifdef __WXMSW__ # define wxICON(X) wxIcon(X##_icon); #elif defined(__X__) # define wxICON(X) wxIcon(X##_bits, X##_width, X##_height); @@ -331,5 +349,14 @@ extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor); wxIcon *icon = new wxICON(wxbuild); */ +class WXDLLEXPORT wxResourceCache: public wxList +{ + DECLARE_DYNAMIC_CLASS(wxResourceCache) + public: + wxResourceCache(); + wxResourceCache(const unsigned int the_key_type); + ~wxResourceCache(); +}; + #endif // __GDICMNH__