1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Common GDI classes, types and declarations
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 // ---------------------------------------------------------------------------
17 // ---------------------------------------------------------------------------
21 #include "wx/string.h"
22 #include "wx/fontenc.h"
23 #include "wx/hashmap.h"
26 // ---------------------------------------------------------------------------
27 // forward declarations
28 // ---------------------------------------------------------------------------
30 class WXDLLIMPEXP_FWD_CORE wxBitmap
;
31 class WXDLLIMPEXP_FWD_CORE wxBrush
;
32 class WXDLLIMPEXP_FWD_CORE wxColour
;
33 class WXDLLIMPEXP_FWD_CORE wxCursor
;
34 class WXDLLIMPEXP_FWD_CORE wxFont
;
35 class WXDLLIMPEXP_FWD_CORE wxIcon
;
36 class WXDLLIMPEXP_FWD_CORE wxPalette
;
37 class WXDLLIMPEXP_FWD_CORE wxPen
;
38 class WXDLLIMPEXP_FWD_CORE wxRegion
;
39 class WXDLLIMPEXP_FWD_BASE wxString
;
40 class WXDLLIMPEXP_FWD_CORE wxIconBundle
;
41 class WXDLLIMPEXP_FWD_CORE wxPoint
;
43 // ---------------------------------------------------------------------------
45 // ---------------------------------------------------------------------------
50 wxBITMAP_TYPE_INVALID
, // should be == 0 for compatibility!
52 wxBITMAP_TYPE_BMP_RESOURCE
,
53 wxBITMAP_TYPE_RESOURCE
= wxBITMAP_TYPE_BMP_RESOURCE
,
55 wxBITMAP_TYPE_ICO_RESOURCE
,
57 wxBITMAP_TYPE_CUR_RESOURCE
,
59 wxBITMAP_TYPE_XBM_DATA
,
61 wxBITMAP_TYPE_XPM_DATA
,
63 wxBITMAP_TYPE_TIF_RESOURCE
,
65 wxBITMAP_TYPE_GIF_RESOURCE
,
67 wxBITMAP_TYPE_PNG_RESOURCE
,
69 wxBITMAP_TYPE_JPEG_RESOURCE
,
71 wxBITMAP_TYPE_PNM_RESOURCE
,
73 wxBITMAP_TYPE_PCX_RESOURCE
,
75 wxBITMAP_TYPE_PICT_RESOURCE
,
77 wxBITMAP_TYPE_ICON_RESOURCE
,
81 wxBITMAP_TYPE_MACCURSOR
,
82 wxBITMAP_TYPE_MACCURSOR_RESOURCE
,
85 wxBITMAP_TYPE_ANY
= 50
91 wxCURSOR_NONE
, // should be 0
101 wxCURSOR_MIDDLE_BUTTON
,
103 wxCURSOR_PAINT_BRUSH
,
106 wxCURSOR_POINT_RIGHT
,
107 wxCURSOR_QUESTION_ARROW
,
108 wxCURSOR_RIGHT_BUTTON
,
119 wxCURSOR_DEFAULT
, // standard X11 cursor
122 wxCURSOR_COPY_ARROW
, // MacOS Theme Plus arrow
125 // Not yet implemented for Windows
126 wxCURSOR_CROSS_REVERSE
,
127 wxCURSOR_DOUBLE_ARROW
,
128 wxCURSOR_BASED_ARROW_UP
,
129 wxCURSOR_BASED_ARROW_DOWN
,
138 #define wxCURSOR_DEFAULT wxCURSOR_ARROW
141 // ---------------------------------------------------------------------------
143 // ---------------------------------------------------------------------------
145 /* Useful macro for creating icons portably, for example:
147 wxIcon *icon = new wxICON(mondrian);
151 wxIcon *icon = new wxIcon("mondrian"); // On wxMSW
152 wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK
156 // Load from a resource
157 #define wxICON(X) wxIcon(wxT(#X))
158 #elif defined(__WXPM__)
159 // Load from a resource
160 #define wxICON(X) wxIcon(wxT(#X))
161 #elif defined(__WXMGL__)
162 // Initialize from an included XPM
163 #define wxICON(X) wxIcon( X##_xpm )
164 #elif defined(__WXDFB__)
165 // Initialize from an included XPM
166 #define wxICON(X) wxIcon( X##_xpm )
167 #elif defined(__WXGTK__)
168 // Initialize from an included XPM
169 #define wxICON(X) wxIcon( X##_xpm )
170 #elif defined(__WXMAC__)
171 // Initialize from an included XPM
172 #define wxICON(X) wxIcon( X##_xpm )
173 #elif defined(__WXMOTIF__)
174 // Initialize from an included XPM
175 #define wxICON(X) wxIcon( X##_xpm )
176 #elif defined(__WXX11__)
177 // Initialize from an included XPM
178 #define wxICON(X) wxIcon( X##_xpm )
180 // This will usually mean something on any platform
181 #define wxICON(X) wxIcon(wxT(#X))
184 /* Another macro: this one is for portable creation of bitmaps. We assume that
185 under Unix bitmaps live in XPMs and under Windows they're in ressources.
188 #if defined(__WXMSW__) || defined(__WXPM__)
189 #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
190 #elif defined(__WXGTK__) || \
191 defined(__WXMOTIF__) || \
192 defined(__WXX11__) || \
193 defined(__WXMAC__) || \
194 defined(__WXMGL__) || \
195 defined(__WXDFB__) || \
197 // Initialize from an included XPM
198 #define wxBITMAP(name) wxBitmap(name##_xpm)
199 #else // other platforms
200 #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
203 // ===========================================================================
205 // ===========================================================================
207 // ---------------------------------------------------------------------------
209 // ---------------------------------------------------------------------------
211 class WXDLLIMPEXP_CORE wxSize
214 // members are public for compatibility, don't use them directly.
218 wxSize() : x(0), y(0) { }
219 wxSize(int xx
, int yy
) : x(xx
), y(yy
) { }
221 // no copy ctor or assignment operator - the defaults are ok
223 wxSize
& operator+=(const wxSize
& sz
) { x
+= sz
.x
; y
+= sz
.y
; return *this; }
224 wxSize
& operator-=(const wxSize
& sz
) { x
-= sz
.x
; y
-= sz
.y
; return *this; }
225 wxSize
& operator/=(int i
) { x
/= i
; y
/= i
; return *this; }
226 wxSize
& operator*=(int i
) { x
*= i
; y
*= i
; return *this; }
228 void IncTo(const wxSize
& sz
)
229 { if ( sz
.x
> x
) x
= sz
.x
; if ( sz
.y
> y
) y
= sz
.y
; }
230 void DecTo(const wxSize
& sz
)
231 { if ( sz
.x
< x
) x
= sz
.x
; if ( sz
.y
< y
) y
= sz
.y
; }
233 void IncBy(int dx
, int dy
) { x
+= dx
; y
+= dy
; }
234 void IncBy(const wxSize
& sz
) { IncBy(sz
.x
, sz
.y
); }
235 void IncBy(int d
) { IncBy(d
, d
); }
237 void DecBy(int dx
, int dy
) { IncBy(-dx
, -dy
); }
238 void DecBy(const wxSize
& sz
) { DecBy(sz
.x
, sz
.y
); }
239 void DecBy(int d
) { DecBy(d
, d
); }
242 wxSize
& Scale(float xscale
, float yscale
)
243 { x
= (int)(x
*xscale
); y
= (int)(y
*yscale
); return *this; }
246 void Set(int xx
, int yy
) { x
= xx
; y
= yy
; }
247 void SetWidth(int w
) { x
= w
; }
248 void SetHeight(int h
) { y
= h
; }
250 int GetWidth() const { return x
; }
251 int GetHeight() const { return y
; }
253 bool IsFullySpecified() const { return x
!= wxDefaultCoord
&& y
!= wxDefaultCoord
; }
255 // combine this size with the other one replacing the default (i.e. equal
256 // to wxDefaultCoord) components of this object with those of the other
257 void SetDefaults(const wxSize
& size
)
259 if ( x
== wxDefaultCoord
)
261 if ( y
== wxDefaultCoord
)
266 int GetX() const { return x
; }
267 int GetY() const { return y
; }
271 inline bool operator==(const wxSize
& s1
, const wxSize
& s2
)
273 return s1
.x
== s2
.x
&& s1
.y
== s2
.y
;
276 inline bool operator!=(const wxSize
& s1
, const wxSize
& s2
)
278 return s1
.x
!= s2
.x
|| s1
.y
!= s2
.y
;
282 inline wxSize
operator+(const wxSize
& s1
, const wxSize
& s2
)
284 return wxSize(s1
.x
+ s2
.x
, s1
.y
+ s2
.y
);
288 inline wxSize
operator-(const wxSize
& s1
, const wxSize
& s2
)
290 return wxSize(s1
.x
- s2
.x
, s1
.y
- s2
.y
);
294 inline wxSize
operator/(const wxSize
& s
, int i
)
296 return wxSize(s
.x
/ i
, s
.y
/ i
);
300 inline wxSize
operator*(const wxSize
& s
, int i
)
302 return wxSize(s
.x
* i
, s
.y
* i
);
306 inline wxSize
operator*(int i
, const wxSize
& s
)
308 return wxSize(s
.x
* i
, s
.y
* i
);
314 // ---------------------------------------------------------------------------
315 // Point classes: with real or integer coordinates
316 // ---------------------------------------------------------------------------
318 class WXDLLIMPEXP_CORE wxRealPoint
324 wxRealPoint() : x(0.0), y(0.0) { }
325 wxRealPoint(double xx
, double yy
) : x(xx
), y(yy
) { }
329 inline bool operator==(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
331 return wxIsSameDouble(p1
.x
, p2
.x
) && wxIsSameDouble(p1
.y
, p2
.y
);
335 inline bool operator!=(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
341 inline wxRealPoint
operator+(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
343 return wxRealPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
347 inline wxRealPoint
operator-(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
349 return wxRealPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
353 // ----------------------------------------------------------------------------
354 // wxPoint: 2D point with integer coordinates
355 // ----------------------------------------------------------------------------
357 class WXDLLIMPEXP_CORE wxPoint
362 wxPoint() : x(0), y(0) { }
363 wxPoint(int xx
, int yy
) : x(xx
), y(yy
) { }
365 // no copy ctor or assignment operator - the defaults are ok
367 //assignment operators
368 wxPoint
& operator+=(const wxPoint
& p
) { x
+= p
.x
; y
+= p
.y
; return *this; }
369 wxPoint
& operator-=(const wxPoint
& p
) { x
-= p
.x
; y
-= p
.y
; return *this; }
371 wxPoint
& operator+=(const wxSize
& s
) { x
+= s
.GetWidth(); y
+= s
.GetHeight(); return *this; }
372 wxPoint
& operator-=(const wxSize
& s
) { x
-= s
.GetWidth(); y
-= s
.GetHeight(); return *this; }
377 inline bool operator==(const wxPoint
& p1
, const wxPoint
& p2
)
379 return p1
.x
== p2
.x
&& p1
.y
== p2
.y
;
382 inline bool operator!=(const wxPoint
& p1
, const wxPoint
& p2
)
388 // arithmetic operations (component wise)
389 inline wxPoint
operator+(const wxPoint
& p1
, const wxPoint
& p2
)
391 return wxPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
394 inline wxPoint
operator-(const wxPoint
& p1
, const wxPoint
& p2
)
396 return wxPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
399 inline wxPoint
operator+(const wxPoint
& p
, const wxSize
& s
)
401 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
404 inline wxPoint
operator-(const wxPoint
& p
, const wxSize
& s
)
406 return wxPoint(p
.x
- s
.x
, p
.y
- s
.y
);
409 inline wxPoint
operator+(const wxSize
& s
, const wxPoint
& p
)
411 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
414 inline wxPoint
operator-(const wxSize
& s
, const wxPoint
& p
)
416 return wxPoint(s
.x
- p
.x
, s
.y
- p
.y
);
419 inline wxPoint
operator-(const wxPoint
& p
)
421 return wxPoint(-p
.x
, -p
.y
);
424 WX_DECLARE_LIST_WITH_DECL(wxPoint
, wxPointList
, class WXDLLIMPEXP_CORE
);
426 // ---------------------------------------------------------------------------
428 // ---------------------------------------------------------------------------
430 class WXDLLIMPEXP_CORE wxRect
434 : x(0), y(0), width(0), height(0)
436 wxRect(int xx
, int yy
, int ww
, int hh
)
437 : x(xx
), y(yy
), width(ww
), height(hh
)
439 wxRect(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
440 wxRect(const wxPoint
& pt
, const wxSize
& size
)
441 : x(pt
.x
), y(pt
.y
), width(size
.x
), height(size
.y
)
443 wxRect(const wxSize
& size
)
444 : x(0), y(0), width(size
.x
), height(size
.y
)
447 // default copy ctor and assignment operators ok
449 int GetX() const { return x
; }
450 void SetX(int xx
) { x
= xx
; }
452 int GetY() const { return y
; }
453 void SetY(int yy
) { y
= yy
; }
455 int GetWidth() const { return width
; }
456 void SetWidth(int w
) { width
= w
; }
458 int GetHeight() const { return height
; }
459 void SetHeight(int h
) { height
= h
; }
461 wxPoint
GetPosition() const { return wxPoint(x
, y
); }
462 void SetPosition( const wxPoint
&p
) { x
= p
.x
; y
= p
.y
; }
464 wxSize
GetSize() const { return wxSize(width
, height
); }
465 void SetSize( const wxSize
&s
) { width
= s
.GetWidth(); height
= s
.GetHeight(); }
467 bool IsEmpty() const { return (width
<= 0) || (height
<= 0); }
469 int GetLeft() const { return x
; }
470 int GetTop() const { return y
; }
471 int GetBottom() const { return y
+ height
- 1; }
472 int GetRight() const { return x
+ width
- 1; }
474 void SetLeft(int left
) { x
= left
; }
475 void SetRight(int right
) { width
= right
- x
+ 1; }
476 void SetTop(int top
) { y
= top
; }
477 void SetBottom(int bottom
) { height
= bottom
- y
+ 1; }
479 wxPoint
GetTopLeft() const { return GetPosition(); }
480 wxPoint
GetLeftTop() const { return GetTopLeft(); }
481 void SetTopLeft(const wxPoint
&p
) { SetPosition(p
); }
482 void SetLeftTop(const wxPoint
&p
) { SetTopLeft(p
); }
484 wxPoint
GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
485 wxPoint
GetRightBottom() const { return GetBottomRight(); }
486 void SetBottomRight(const wxPoint
&p
) { SetRight(p
.x
); SetBottom(p
.y
); }
487 void SetRightBottom(const wxPoint
&p
) { SetBottomRight(p
); }
489 wxPoint
GetTopRight() const { return wxPoint(GetRight(), GetTop()); }
490 wxPoint
GetRightTop() const { return GetTopRight(); }
491 void SetTopRight(const wxPoint
&p
) { SetRight(p
.x
); SetTop(p
.y
); }
492 void SetRightTop(const wxPoint
&p
) { SetTopLeft(p
); }
494 wxPoint
GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); }
495 wxPoint
GetLeftBottom() const { return GetBottomLeft(); }
496 void SetBottomLeft(const wxPoint
&p
) { SetLeft(p
.x
); SetBottom(p
.y
); }
497 void SetLeftBottom(const wxPoint
&p
) { SetBottomLeft(p
); }
499 // operations with rect
500 wxRect
& Inflate(wxCoord dx
, wxCoord dy
);
501 wxRect
& Inflate(const wxSize
& d
) { return Inflate(d
.x
, d
.y
); }
502 wxRect
& Inflate(wxCoord d
) { return Inflate(d
, d
); }
503 wxRect
Inflate(wxCoord dx
, wxCoord dy
) const
510 wxRect
& Deflate(wxCoord dx
, wxCoord dy
) { return Inflate(-dx
, -dy
); }
511 wxRect
& Deflate(const wxSize
& d
) { return Inflate(-d
.x
, -d
.y
); }
512 wxRect
& Deflate(wxCoord d
) { return Inflate(-d
); }
513 wxRect
Deflate(wxCoord dx
, wxCoord dy
) const
520 void Offset(wxCoord dx
, wxCoord dy
) { x
+= dx
; y
+= dy
; }
521 void Offset(const wxPoint
& pt
) { Offset(pt
.x
, pt
.y
); }
523 wxRect
& Intersect(const wxRect
& rect
);
524 wxRect
Intersect(const wxRect
& rect
) const
531 wxRect
& Union(const wxRect
& rect
);
532 wxRect
Union(const wxRect
& rect
) const
539 // return true if the point is (not strcitly) inside the rect
540 bool Contains(int x
, int y
) const;
541 bool Contains(const wxPoint
& pt
) const { return Contains(pt
.x
, pt
.y
); }
542 // return true if the rectangle 'rect' is (not strictly) inside this rect
543 bool Contains(const wxRect
& rect
) const;
545 #if WXWIN_COMPATIBILITY_2_6
546 // use Contains() instead
547 wxDEPRECATED( bool Inside(int x
, int y
) const );
548 wxDEPRECATED( bool Inside(const wxPoint
& pt
) const );
549 wxDEPRECATED( bool Inside(const wxRect
& rect
) const );
550 #endif // WXWIN_COMPATIBILITY_2_6
552 // return true if the rectangles have a non empty intersection
553 bool Intersects(const wxRect
& rect
) const;
555 // like Union() but don't ignore empty rectangles
556 wxRect
& operator+=(const wxRect
& rect
);
558 // intersections of two rectrangles not testing for empty rectangles
559 wxRect
& operator*=(const wxRect
& rect
);
561 // centre this rectangle in the given (usually, but not necessarily,
563 wxRect
CentreIn(const wxRect
& r
, int dir
= wxBOTH
) const
565 return wxRect(dir
& wxHORIZONTAL
? r
.x
+ (r
.width
- width
)/2 : x
,
566 dir
& wxVERTICAL
? r
.y
+ (r
.height
- height
)/2 : y
,
570 wxRect
CenterIn(const wxRect
& r
, int dir
= wxBOTH
) const
572 return CentreIn(r
, dir
);
576 int x
, y
, width
, height
;
580 // compare rectangles
581 inline bool operator==(const wxRect
& r1
, const wxRect
& r2
)
583 return (r1
.x
== r2
.x
) && (r1
.y
== r2
.y
) &&
584 (r1
.width
== r2
.width
) && (r1
.height
== r2
.height
);
587 inline bool operator!=(const wxRect
& r1
, const wxRect
& r2
)
592 // like Union() but don't treat empty rectangles specially
593 WXDLLIMPEXP_CORE wxRect
operator+(const wxRect
& r1
, const wxRect
& r2
);
595 // intersections of two rectangles
596 WXDLLIMPEXP_CORE wxRect
operator*(const wxRect
& r1
, const wxRect
& r2
);
601 #if WXWIN_COMPATIBILITY_2_6
602 inline bool wxRect::Inside(int cx
, int cy
) const { return Contains(cx
, cy
); }
603 inline bool wxRect::Inside(const wxPoint
& pt
) const { return Contains(pt
); }
604 inline bool wxRect::Inside(const wxRect
& rect
) const { return Contains(rect
); }
605 #endif // WXWIN_COMPATIBILITY_2_6
608 // ---------------------------------------------------------------------------
609 // Management of pens, brushes and fonts
610 // ---------------------------------------------------------------------------
612 typedef wxInt8 wxDash
;
614 class WXDLLIMPEXP_CORE wxGDIObjListBase
{
623 WX_DECLARE_STRING_HASH_MAP(wxColour
*, wxStringToColourHashMap
);
625 class WXDLLIMPEXP_CORE wxColourDatabase
631 // find colour by name or name for the given colour
632 wxColour
Find(const wxString
& name
) const;
633 wxString
FindName(const wxColour
& colour
) const;
635 // add a new colour to the database
636 void AddColour(const wxString
& name
, const wxColour
& colour
);
638 #if WXWIN_COMPATIBILITY_2_6
639 // deprecated, use Find() instead
640 wxDEPRECATED( wxColour
*FindColour(const wxString
& name
) );
641 #endif // WXWIN_COMPATIBILITY_2_6
645 // PM keeps its own type of colour table
651 // load the database with the built in colour values when called for the
652 // first time, do nothing after this
655 wxStringToColourHashMap
*m_map
;
658 class WXDLLIMPEXP_CORE wxResourceCache
: public wxList
661 wxResourceCache() { }
663 wxResourceCache(const unsigned int keyType
) : wxList(keyType
) { }
665 virtual ~wxResourceCache();
668 // ---------------------------------------------------------------------------
670 // ---------------------------------------------------------------------------
675 wxStockGDI creates the stock GDI objects on demand. Pointers to the
676 created objects are stored in the ms_stockObject array, which is indexed
677 by the Item enum values. Platorm-specific fonts can be created by
678 implementing a derived class with an override for the GetFont function.
679 wxStockGDI operates as a singleton, accessed through the ms_instance
680 pointer. By default this pointer is set to an instance of wxStockGDI.
681 A derived class must arrange to set this pointer to an instance of itself.
683 class WXDLLIMPEXP_CORE wxStockGDI
725 virtual ~wxStockGDI();
726 static void DeleteAll();
728 static wxStockGDI
& instance() { return *ms_instance
; }
730 static const wxBrush
* GetBrush(Item item
);
731 static const wxColour
* GetColour(Item item
);
732 static const wxCursor
* GetCursor(Item item
);
733 // Can be overridden by platform-specific derived classes
734 virtual const wxFont
* GetFont(Item item
);
735 static const wxPen
* GetPen(Item item
);
738 static wxStockGDI
* ms_instance
;
740 static wxObject
* ms_stockObject
[ITEMCOUNT
];
742 DECLARE_NO_COPY_CLASS(wxStockGDI
)
745 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
746 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
747 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
748 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
750 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
751 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
752 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
753 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
754 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
755 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
756 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
757 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
758 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
759 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
761 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
762 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
763 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
764 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
765 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
766 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
767 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
768 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
769 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
770 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
772 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
773 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
774 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
775 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
776 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
777 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
778 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
780 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
781 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
782 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
785 extern WXDLLIMPEXP_DATA_CORE(wxBitmap
) wxNullBitmap
;
786 extern WXDLLIMPEXP_DATA_CORE(wxIcon
) wxNullIcon
;
787 extern WXDLLIMPEXP_DATA_CORE(wxCursor
) wxNullCursor
;
788 extern WXDLLIMPEXP_DATA_CORE(wxPen
) wxNullPen
;
789 extern WXDLLIMPEXP_DATA_CORE(wxBrush
) wxNullBrush
;
790 extern WXDLLIMPEXP_DATA_CORE(wxPalette
) wxNullPalette
;
791 extern WXDLLIMPEXP_DATA_CORE(wxFont
) wxNullFont
;
792 extern WXDLLIMPEXP_DATA_CORE(wxColour
) wxNullColour
;
793 extern WXDLLIMPEXP_DATA_CORE(wxIconBundle
) wxNullIconBundle
;
795 extern WXDLLIMPEXP_DATA_CORE(wxColourDatabase
*) wxTheColourDatabase
;
797 extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr
[];
799 extern WXDLLIMPEXP_DATA_CORE(const wxSize
) wxDefaultSize
;
800 extern WXDLLIMPEXP_DATA_CORE(const wxPoint
) wxDefaultPosition
;
802 // ---------------------------------------------------------------------------
804 // ---------------------------------------------------------------------------
806 // resource management
807 extern void WXDLLIMPEXP_CORE
wxInitializeStockLists();
808 extern void WXDLLIMPEXP_CORE
wxDeleteStockLists();
810 // is the display colour (or monochrome)?
811 extern bool WXDLLIMPEXP_CORE
wxColourDisplay();
813 // Returns depth of screen
814 extern int WXDLLIMPEXP_CORE
wxDisplayDepth();
815 #define wxGetDisplayDepth wxDisplayDepth
817 // get the display size
818 extern void WXDLLIMPEXP_CORE
wxDisplaySize(int *width
, int *height
);
819 extern wxSize WXDLLIMPEXP_CORE
wxGetDisplaySize();
820 extern void WXDLLIMPEXP_CORE
wxDisplaySizeMM(int *width
, int *height
);
821 extern wxSize WXDLLIMPEXP_CORE
wxGetDisplaySizeMM();
823 // Get position and size of the display workarea
824 extern void WXDLLIMPEXP_CORE
wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
);
825 extern wxRect WXDLLIMPEXP_CORE
wxGetClientDisplayRect();
828 extern void WXDLLIMPEXP_CORE
wxSetCursor(const wxCursor
& cursor
);