X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a6c0a8bdadc52e87e6d1e315d1bf6f192880bd0..c96faa7c9b1926d63a2fff32ac4508d3138a7bee:/include/wx/gdicmn.h diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index dec74b5bb9..111b6ba1d8 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __GDICMNH__ -#define __GDICMNH__ +#ifndef _WX_GDICMNH__ +#define _WX_GDICMNH__ #ifdef __GNUG__ #pragma interface "gdicmn.h" @@ -19,18 +19,13 @@ #include "wx/object.h" #include "wx/list.h" #include "wx/hash.h" +#include "wx/string.h" #include "wx/setup.h" - -#ifdef __WINDOWS__ -#include "wx/msw/colour.h" -#elif defined(__MOTIF__) -#include "wx/xt/colour.h" -#elif defined(__GTK__) -#include "wx/gtk/colour.h" -#endif +#include "wx/colour.h" // Standard cursors typedef enum { + wxCURSOR_NONE = 0, wxCURSOR_ARROW = 1, wxCURSOR_BULLSEYE, wxCURSOR_CHAR, @@ -63,7 +58,7 @@ typedef enum { wxCURSOR_BASED_ARROW_UP, wxCURSOR_BASED_ARROW_DOWN #endif -} _standard_cursors_t; +} wxStockCursor; class WXDLLEXPORT wxSize { @@ -74,6 +69,7 @@ public: 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 bool operator == (const wxSize& sz) const { return (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; } @@ -93,12 +89,13 @@ class WXDLLEXPORT wxRealPoint 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; } + inline bool operator == (const wxRealPoint& pt) const { return (x == pt.x && y == pt.y); } }; class WXDLLEXPORT wxPoint { public: -#if defined(__WINDOWS__) && !defined(__WIN32__) +#if defined(__WXMSW__) && !defined(__WIN32__) int x; int y; #else @@ -111,6 +108,7 @@ class WXDLLEXPORT wxPoint wxPoint(const wxPoint& pt) { x = pt.x; y = pt.y; }; inline void operator = (const wxPoint& pt) { x = pt.x; y = pt.y; } + inline bool operator == (const wxPoint& pt) const { return (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); } }; @@ -161,6 +159,7 @@ class WXDLLEXPORT wxCursor; class WXDLLEXPORT wxFont; class WXDLLEXPORT wxPalette; class WXDLLEXPORT wxPalette; +class WXDLLEXPORT wxRegion; /* * Bitmap flags @@ -183,6 +182,8 @@ class WXDLLEXPORT wxPalette; #define wxBITMAP_TYPE_GIF_RESOURCE 14 #define wxBITMAP_TYPE_PNG 15 #define wxBITMAP_TYPE_PNG_RESOURCE 16 +#define wxBITMAP_TYPE_JPEG 17 +#define wxBITMAP_TYPE_JPEG_RESOURCE 18 #define wxBITMAP_TYPE_ANY 50 #define wxBITMAP_TYPE_RESOURCE wxBITMAP_TYPE_BMP_RESOURCE @@ -190,6 +191,8 @@ class WXDLLEXPORT wxPalette; class WXDLLEXPORT wxBitmap; class WXDLLEXPORT wxCursor; class WXDLLEXPORT wxIcon; +class WXDLLEXPORT wxColour; +class WXDLLEXPORT wxString; // Management of pens, brushes and fonts class WXDLLEXPORT wxPenList: public wxList @@ -202,7 +205,6 @@ class WXDLLEXPORT wxPenList: public wxList void AddPen(wxPen *pen); void RemovePen(wxPen *pen); wxPen *FindOrCreatePen(const wxColour& colour, int width, int style); - wxPen *FindOrCreatePen(const wxString& colour, int width, int style); }; class WXDLLEXPORT wxBrushList: public wxList @@ -215,10 +217,9 @@ class WXDLLEXPORT wxBrushList: public wxList void AddBrush(wxBrush *brush); void RemoveBrush(wxBrush *brush); wxBrush *FindOrCreateBrush(const wxColour& colour, int style); - wxBrush *FindOrCreateBrush(const wxString& colour, int style); }; -WXDLLEXPORT_DATA(extern const char*) wxEmptyString; +WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; class WXDLLEXPORT wxFontList: public wxList { @@ -315,7 +316,9 @@ WXDLLEXPORT_DATA(extern wxCursor*) wxCROSS_CURSOR; WXDLLEXPORT_DATA(extern wxColourDatabase*) wxTheColourDatabase; extern void WXDLLEXPORT wxInitializeStockObjects(); +extern void WXDLLEXPORT wxInitializeStockLists(); extern void WXDLLEXPORT wxDeleteStockObjects(); +extern void WXDLLEXPORT wxDeleteStockLists(); extern bool WXDLLEXPORT wxColourDisplay(); @@ -328,22 +331,42 @@ extern wxSize WXDLLEXPORT wxGetDisplaySize(); extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor); -// Useful macro for create icons portably +// Useful macro for creating icons portably + +#ifdef __WXMSW__ +// Load from a resource +# define wxICON(X) wxIcon("" #X "") -#ifdef __WINDOWS__ -# define wxICON(X) wxIcon(X##_icon); -#elif defined(__X__) -# define wxICON(X) wxIcon(X##_bits, X##_width, X##_height); +#elif defined(__WXGTK__) +// Initialize from an included XPM +# define wxICON(X) wxIcon( (const char**) X##_xpm ) +#elif defined(__WXMOTIF__) +// Initialize from an included XPM +# define wxICON(X) wxIcon( X##_xpm ) #else -# define wxICON wxIcon + +// This will usually mean something on any platform +# define wxICON(X) wxIcon("" #X "") #endif /* Example: - #define wxbuild_icon "wxbuild" - - wxIcon *icon = new wxICON(wxbuild); + wxIcon *icon = new wxICON(mondrian); + expands into: + wxIcon *icon = new wxIcon("mondrian"); // On wxMSW + wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK */ +class WXDLLEXPORT wxResourceCache: public wxList +{ +public: + wxResourceCache() { } + wxResourceCache(const unsigned int keyType) : wxList(keyType) { } + ~wxResourceCache(); + +private: + DECLARE_DYNAMIC_CLASS(wxResourceCache) +}; + #endif - // __GDICMNH__ + // _WX_GDICMNH__