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"
27 // ---------------------------------------------------------------------------
28 // forward declarations
29 // ---------------------------------------------------------------------------
31 class WXDLLIMPEXP_FWD_CORE wxBitmap
;
32 class WXDLLIMPEXP_FWD_CORE wxBrush
;
33 class WXDLLIMPEXP_FWD_CORE wxColour
;
34 class WXDLLIMPEXP_FWD_CORE wxCursor
;
35 class WXDLLIMPEXP_FWD_CORE wxFont
;
36 class WXDLLIMPEXP_FWD_CORE wxIcon
;
37 class WXDLLIMPEXP_FWD_CORE wxPalette
;
38 class WXDLLIMPEXP_FWD_CORE wxPen
;
39 class WXDLLIMPEXP_FWD_CORE wxRegion
;
40 class WXDLLIMPEXP_FWD_BASE wxString
;
41 class WXDLLIMPEXP_FWD_CORE wxIconBundle
;
42 class WXDLLIMPEXP_FWD_CORE wxPoint
;
44 // ---------------------------------------------------------------------------
46 // ---------------------------------------------------------------------------
51 wxBITMAP_TYPE_INVALID
, // should be == 0 for compatibility!
53 wxBITMAP_TYPE_BMP_RESOURCE
,
54 wxBITMAP_TYPE_RESOURCE
= wxBITMAP_TYPE_BMP_RESOURCE
,
56 wxBITMAP_TYPE_ICO_RESOURCE
,
58 wxBITMAP_TYPE_CUR_RESOURCE
,
60 wxBITMAP_TYPE_XBM_DATA
,
62 wxBITMAP_TYPE_XPM_DATA
,
64 wxBITMAP_TYPE_TIF_RESOURCE
,
66 wxBITMAP_TYPE_GIF_RESOURCE
,
68 wxBITMAP_TYPE_PNG_RESOURCE
,
70 wxBITMAP_TYPE_JPEG_RESOURCE
,
72 wxBITMAP_TYPE_PNM_RESOURCE
,
74 wxBITMAP_TYPE_PCX_RESOURCE
,
76 wxBITMAP_TYPE_PICT_RESOURCE
,
78 wxBITMAP_TYPE_ICON_RESOURCE
,
82 wxBITMAP_TYPE_MACCURSOR
,
83 wxBITMAP_TYPE_MACCURSOR_RESOURCE
,
84 wxBITMAP_TYPE_ANY
= 50
90 wxCURSOR_NONE
, // should be 0
100 wxCURSOR_MIDDLE_BUTTON
,
102 wxCURSOR_PAINT_BRUSH
,
105 wxCURSOR_POINT_RIGHT
,
106 wxCURSOR_QUESTION_ARROW
,
107 wxCURSOR_RIGHT_BUTTON
,
118 wxCURSOR_DEFAULT
, // standard X11 cursor
121 wxCURSOR_COPY_ARROW
, // MacOS Theme Plus arrow
124 // Not yet implemented for Windows
125 wxCURSOR_CROSS_REVERSE
,
126 wxCURSOR_DOUBLE_ARROW
,
127 wxCURSOR_BASED_ARROW_UP
,
128 wxCURSOR_BASED_ARROW_DOWN
,
137 #define wxCURSOR_DEFAULT wxCURSOR_ARROW
140 // ---------------------------------------------------------------------------
142 // ---------------------------------------------------------------------------
144 /* Useful macro for creating icons portably, for example:
146 wxIcon *icon = new wxICON(mondrian);
150 wxIcon *icon = new wxIcon("mondrian"); // On wxMSW
151 wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK
155 // Load from a resource
156 #define wxICON(X) wxIcon(wxT(#X))
157 #elif defined(__WXPM__)
158 // Load from a resource
159 #define wxICON(X) wxIcon(wxT(#X))
160 #elif defined(__WXMGL__)
161 // Initialize from an included XPM
162 #define wxICON(X) wxIcon( X##_xpm )
163 #elif defined(__WXDFB__)
164 // Initialize from an included XPM
165 #define wxICON(X) wxIcon( X##_xpm )
166 #elif defined(__WXGTK__)
167 // Initialize from an included XPM
168 #define wxICON(X) wxIcon( X##_xpm )
169 #elif defined(__WXMAC__)
170 // Initialize from an included XPM
171 #define wxICON(X) wxIcon( X##_xpm )
172 #elif defined(__WXMOTIF__)
173 // Initialize from an included XPM
174 #define wxICON(X) wxIcon( X##_xpm )
175 #elif defined(__WXX11__)
176 // Initialize from an included XPM
177 #define wxICON(X) wxIcon( X##_xpm )
179 // This will usually mean something on any platform
180 #define wxICON(X) wxIcon(wxT(#X))
183 /* Another macro: this one is for portable creation of bitmaps. We assume that
184 under Unix bitmaps live in XPMs and under Windows they're in ressources.
187 #if defined(__WXMSW__) || defined(__WXPM__)
188 #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
189 #elif defined(__WXGTK__) || \
190 defined(__WXMOTIF__) || \
191 defined(__WXX11__) || \
192 defined(__WXMAC__) || \
193 defined(__WXMGL__) || \
194 defined(__WXDFB__) || \
196 // Initialize from an included XPM
197 #define wxBITMAP(name) wxBitmap(name##_xpm)
198 #else // other platforms
199 #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
202 // ===========================================================================
204 // ===========================================================================
206 // ---------------------------------------------------------------------------
208 // ---------------------------------------------------------------------------
210 class WXDLLEXPORT wxSize
213 // members are public for compatibility, don't use them directly.
217 wxSize() : x(0), y(0) { }
218 wxSize(int xx
, int yy
) : x(xx
), y(yy
) { }
220 // no copy ctor or assignment operator - the defaults are ok
222 wxSize
& operator+=(const wxSize
& sz
) { x
+= sz
.x
; y
+= sz
.y
; return *this; }
223 wxSize
& operator-=(const wxSize
& sz
) { x
-= sz
.x
; y
-= sz
.y
; return *this; }
224 wxSize
& operator/=(int i
) { x
/= i
; y
/= i
; return *this; }
225 wxSize
& operator*=(int i
) { x
*= i
; y
*= i
; return *this; }
227 void IncTo(const wxSize
& sz
)
228 { if ( sz
.x
> x
) x
= sz
.x
; if ( sz
.y
> y
) y
= sz
.y
; }
229 void DecTo(const wxSize
& sz
)
230 { if ( sz
.x
< x
) x
= sz
.x
; if ( sz
.y
< y
) y
= sz
.y
; }
232 void IncBy(int dx
, int dy
) { x
+= dx
; y
+= dy
; }
233 void IncBy(const wxSize
& sz
) { IncBy(sz
.x
, sz
.y
); }
234 void IncBy(int d
) { IncBy(d
, d
); }
236 void DecBy(int dx
, int dy
) { IncBy(-dx
, -dy
); }
237 void DecBy(const wxSize
& sz
) { DecBy(sz
.x
, sz
.y
); }
238 void DecBy(int d
) { DecBy(d
, d
); }
241 wxSize
& Scale(float xscale
, float yscale
)
242 { x
= (int)(x
*xscale
); y
= (int)(y
*yscale
); return *this; }
245 void Set(int xx
, int yy
) { x
= xx
; y
= yy
; }
246 void SetWidth(int w
) { x
= w
; }
247 void SetHeight(int h
) { y
= h
; }
249 int GetWidth() const { return x
; }
250 int GetHeight() const { return y
; }
252 bool IsFullySpecified() const { return x
!= wxDefaultCoord
&& y
!= wxDefaultCoord
; }
254 // combine this size with the other one replacing the default (i.e. equal
255 // to wxDefaultCoord) components of this object with those of the other
256 void SetDefaults(const wxSize
& size
)
258 if ( x
== wxDefaultCoord
)
260 if ( y
== wxDefaultCoord
)
265 int GetX() const { return x
; }
266 int GetY() const { return y
; }
270 inline bool operator==(const wxSize
& s1
, const wxSize
& s2
)
272 return s1
.x
== s2
.x
&& s1
.y
== s2
.y
;
275 inline bool operator!=(const wxSize
& s1
, const wxSize
& s2
)
277 return s1
.x
!= s2
.x
|| s1
.y
!= s2
.y
;
281 inline wxSize
operator+(const wxSize
& s1
, const wxSize
& s2
)
283 return wxSize(s1
.x
+ s2
.x
, s1
.y
+ s2
.y
);
287 inline wxSize
operator-(const wxSize
& s1
, const wxSize
& s2
)
289 return wxSize(s1
.x
- s2
.x
, s1
.y
- s2
.y
);
293 inline wxSize
operator/(const wxSize
& s
, int i
)
295 return wxSize(s
.x
/ i
, s
.y
/ i
);
299 inline wxSize
operator*(const wxSize
& s
, int i
)
301 return wxSize(s
.x
* i
, s
.y
* i
);
305 inline wxSize
operator*(int i
, const wxSize
& s
)
307 return wxSize(s
.x
* i
, s
.y
* i
);
313 // ---------------------------------------------------------------------------
314 // Point classes: with real or integer coordinates
315 // ---------------------------------------------------------------------------
317 class WXDLLEXPORT wxRealPoint
323 wxRealPoint() : x(0.0), y(0.0) { }
324 wxRealPoint(double xx
, double yy
) : x(xx
), y(yy
) { }
328 inline bool operator==(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
330 return wxIsSameDouble(p1
.x
, p2
.x
) && wxIsSameDouble(p1
.y
, p2
.y
);
334 inline bool operator!=(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
340 inline wxRealPoint
operator+(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
342 return wxRealPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
346 inline wxRealPoint
operator-(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
348 return wxRealPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
352 // ----------------------------------------------------------------------------
353 // wxPoint: 2D point with integer coordinates
354 // ----------------------------------------------------------------------------
356 class WXDLLEXPORT wxPoint
361 wxPoint() : x(0), y(0) { }
362 wxPoint(int xx
, int yy
) : x(xx
), y(yy
) { }
364 // no copy ctor or assignment operator - the defaults are ok
366 //assignment operators
367 wxPoint
& operator+=(const wxPoint
& p
) { x
+= p
.x
; y
+= p
.y
; return *this; }
368 wxPoint
& operator-=(const wxPoint
& p
) { x
-= p
.x
; y
-= p
.y
; return *this; }
370 wxPoint
& operator+=(const wxSize
& s
) { x
+= s
.GetWidth(); y
+= s
.GetHeight(); return *this; }
371 wxPoint
& operator-=(const wxSize
& s
) { x
-= s
.GetWidth(); y
-= s
.GetHeight(); return *this; }
376 inline bool operator==(const wxPoint
& p1
, const wxPoint
& p2
)
378 return p1
.x
== p2
.x
&& p1
.y
== p2
.y
;
381 inline bool operator!=(const wxPoint
& p1
, const wxPoint
& p2
)
387 // arithmetic operations (component wise)
388 inline wxPoint
operator+(const wxPoint
& p1
, const wxPoint
& p2
)
390 return wxPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
393 inline wxPoint
operator-(const wxPoint
& p1
, const wxPoint
& p2
)
395 return wxPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
398 inline wxPoint
operator+(const wxPoint
& p
, const wxSize
& s
)
400 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
403 inline wxPoint
operator-(const wxPoint
& p
, const wxSize
& s
)
405 return wxPoint(p
.x
- s
.x
, p
.y
- s
.y
);
408 inline wxPoint
operator+(const wxSize
& s
, const wxPoint
& p
)
410 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
413 inline wxPoint
operator-(const wxSize
& s
, const wxPoint
& p
)
415 return wxPoint(s
.x
- p
.x
, s
.y
- p
.y
);
418 inline wxPoint
operator-(const wxPoint
& p
)
420 return wxPoint(-p
.x
, -p
.y
);
423 WX_DECLARE_LIST_WITH_DECL(wxPoint
, wxPointList
, class WXDLLIMPEXP_CORE
);
425 // ---------------------------------------------------------------------------
427 // ---------------------------------------------------------------------------
429 class WXDLLEXPORT wxRect
433 : x(0), y(0), width(0), height(0)
435 wxRect(int xx
, int yy
, int ww
, int hh
)
436 : x(xx
), y(yy
), width(ww
), height(hh
)
438 wxRect(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
439 wxRect(const wxPoint
& pt
, const wxSize
& size
)
440 : x(pt
.x
), y(pt
.y
), width(size
.x
), height(size
.y
)
442 wxRect(const wxSize
& size
)
443 : x(0), y(0), width(size
.x
), height(size
.y
)
446 // default copy ctor and assignment operators ok
448 int GetX() const { return x
; }
449 void SetX(int xx
) { x
= xx
; }
451 int GetY() const { return y
; }
452 void SetY(int yy
) { y
= yy
; }
454 int GetWidth() const { return width
; }
455 void SetWidth(int w
) { width
= w
; }
457 int GetHeight() const { return height
; }
458 void SetHeight(int h
) { height
= h
; }
460 wxPoint
GetPosition() const { return wxPoint(x
, y
); }
461 void SetPosition( const wxPoint
&p
) { x
= p
.x
; y
= p
.y
; }
463 wxSize
GetSize() const { return wxSize(width
, height
); }
464 void SetSize( const wxSize
&s
) { width
= s
.GetWidth(); height
= s
.GetHeight(); }
466 bool IsEmpty() const { return (width
<= 0) || (height
<= 0); }
468 int GetLeft() const { return x
; }
469 int GetTop() const { return y
; }
470 int GetBottom() const { return y
+ height
- 1; }
471 int GetRight() const { return x
+ width
- 1; }
473 void SetLeft(int left
) { x
= left
; }
474 void SetRight(int right
) { width
= right
- x
+ 1; }
475 void SetTop(int top
) { y
= top
; }
476 void SetBottom(int bottom
) { height
= bottom
- y
+ 1; }
478 wxPoint
GetTopLeft() const { return GetPosition(); }
479 wxPoint
GetLeftTop() const { return GetTopLeft(); }
480 void SetTopLeft(const wxPoint
&p
) { SetPosition(p
); }
481 void SetLeftTop(const wxPoint
&p
) { SetTopLeft(p
); }
483 wxPoint
GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
484 wxPoint
GetRightBottom() const { return GetBottomRight(); }
485 void SetBottomRight(const wxPoint
&p
) { SetRight(p
.x
); SetBottom(p
.y
); }
486 void SetRightBottom(const wxPoint
&p
) { SetBottomRight(p
); }
488 wxPoint
GetTopRight() const { return wxPoint(GetRight(), GetTop()); }
489 wxPoint
GetRightTop() const { return GetTopRight(); }
490 void SetTopRight(const wxPoint
&p
) { SetRight(p
.x
); SetTop(p
.y
); }
491 void SetRightTop(const wxPoint
&p
) { SetTopLeft(p
); }
493 wxPoint
GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); }
494 wxPoint
GetLeftBottom() const { return GetBottomLeft(); }
495 void SetBottomLeft(const wxPoint
&p
) { SetLeft(p
.x
); SetBottom(p
.y
); }
496 void SetLeftBottom(const wxPoint
&p
) { SetBottomLeft(p
); }
498 // operations with rect
499 wxRect
& Inflate(wxCoord dx
, wxCoord dy
);
500 wxRect
& Inflate(const wxSize
& d
) { return Inflate(d
.x
, d
.y
); }
501 wxRect
& Inflate(wxCoord d
) { return Inflate(d
, d
); }
502 wxRect
Inflate(wxCoord dx
, wxCoord dy
) const
509 wxRect
& Deflate(wxCoord dx
, wxCoord dy
) { return Inflate(-dx
, -dy
); }
510 wxRect
& Deflate(const wxSize
& d
) { return Inflate(-d
.x
, -d
.y
); }
511 wxRect
& Deflate(wxCoord d
) { return Inflate(-d
); }
512 wxRect
Deflate(wxCoord dx
, wxCoord dy
) const
519 void Offset(wxCoord dx
, wxCoord dy
) { x
+= dx
; y
+= dy
; }
520 void Offset(const wxPoint
& pt
) { Offset(pt
.x
, pt
.y
); }
522 wxRect
& Intersect(const wxRect
& rect
);
523 wxRect
Intersect(const wxRect
& rect
) const
530 wxRect
& Union(const wxRect
& rect
);
531 wxRect
Union(const wxRect
& rect
) const
538 // return true if the point is (not strcitly) inside the rect
539 bool Contains(int x
, int y
) const;
540 bool Contains(const wxPoint
& pt
) const { return Contains(pt
.x
, pt
.y
); }
541 // return true if the rectangle 'rect' is (not strictly) inside this rect
542 bool Contains(const wxRect
& rect
) const;
544 #if WXWIN_COMPATIBILITY_2_6
545 // use Contains() instead
546 wxDEPRECATED( bool Inside(int x
, int y
) const );
547 wxDEPRECATED( bool Inside(const wxPoint
& pt
) const );
548 wxDEPRECATED( bool Inside(const wxRect
& rect
) const );
549 #endif // WXWIN_COMPATIBILITY_2_6
551 // return true if the rectangles have a non empty intersection
552 bool Intersects(const wxRect
& rect
) const;
554 // like Union() but don't ignore empty rectangles
555 wxRect
& operator+=(const wxRect
& rect
);
557 // intersections of two rectrangles not testing for empty rectangles
558 wxRect
& operator*=(const wxRect
& rect
);
560 // centre this rectangle in the given (usually, but not necessarily,
562 wxRect
CentreIn(const wxRect
& r
, int dir
= wxBOTH
) const
564 return wxRect(dir
& wxHORIZONTAL
? r
.x
+ (r
.width
- width
)/2 : x
,
565 dir
& wxVERTICAL
? r
.y
+ (r
.height
- height
)/2 : y
,
569 wxRect
CenterIn(const wxRect
& r
, int dir
= wxBOTH
) const
571 return CentreIn(r
, dir
);
575 int x
, y
, width
, height
;
579 // compare rectangles
580 inline bool operator==(const wxRect
& r1
, const wxRect
& r2
)
582 return (r1
.x
== r2
.x
) && (r1
.y
== r2
.y
) &&
583 (r1
.width
== r2
.width
) && (r1
.height
== r2
.height
);
586 inline bool operator!=(const wxRect
& r1
, const wxRect
& r2
)
591 // like Union() but don't treat empty rectangles specially
592 WXDLLIMPEXP_CORE wxRect
operator+(const wxRect
& r1
, const wxRect
& r2
);
594 // intersections of two rectangles
595 WXDLLIMPEXP_CORE wxRect
operator*(const wxRect
& r1
, const wxRect
& r2
);
600 #if WXWIN_COMPATIBILITY_2_6
601 inline bool wxRect::Inside(int cx
, int cy
) const { return Contains(cx
, cy
); }
602 inline bool wxRect::Inside(const wxPoint
& pt
) const { return Contains(pt
); }
603 inline bool wxRect::Inside(const wxRect
& rect
) const { return Contains(rect
); }
604 #endif // WXWIN_COMPATIBILITY_2_6
607 // ---------------------------------------------------------------------------
608 // Management of pens, brushes and fonts
609 // ---------------------------------------------------------------------------
611 typedef wxInt8 wxDash
;
613 class WXDLLIMPEXP_CORE wxGDIObjListBase
{
622 class WXDLLIMPEXP_CORE wxPenList
: public wxGDIObjListBase
625 wxPen
*FindOrCreatePen(const wxColour
& colour
, int width
, int style
);
626 #if WXWIN_COMPATIBILITY_2_6
627 wxDEPRECATED( void AddPen(wxPen
*) );
628 wxDEPRECATED( void RemovePen(wxPen
*) );
632 class WXDLLIMPEXP_CORE wxBrushList
: public wxGDIObjListBase
635 wxBrush
*FindOrCreateBrush(const wxColour
& colour
, wxBrushStyle style
= wxBRUSHSTYLE_SOLID
);
636 #if WXWIN_COMPATIBILITY_2_6
637 wxDEPRECATED( void AddBrush(wxBrush
*) );
638 wxDEPRECATED( void RemoveBrush(wxBrush
*) );
642 class WXDLLIMPEXP_CORE wxFontList
: public wxGDIObjListBase
645 wxFont
*FindOrCreateFont(int pointSize
, int family
, int style
, int weight
,
646 bool underline
= false,
647 const wxString
& face
= wxEmptyString
,
648 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
649 #if WXWIN_COMPATIBILITY_2_6
650 wxDEPRECATED( void AddFont(wxFont
*) );
651 wxDEPRECATED( void RemoveFont(wxFont
*) );
655 WX_DECLARE_STRING_HASH_MAP(wxColour
*, wxStringToColourHashMap
);
657 class WXDLLEXPORT wxColourDatabase
663 // find colour by name or name for the given colour
664 wxColour
Find(const wxString
& name
) const;
665 wxString
FindName(const wxColour
& colour
) const;
667 // add a new colour to the database
668 void AddColour(const wxString
& name
, const wxColour
& colour
);
670 #if WXWIN_COMPATIBILITY_2_6
671 // deprecated, use Find() instead
672 wxDEPRECATED( wxColour
*FindColour(const wxString
& name
) );
673 #endif // WXWIN_COMPATIBILITY_2_6
677 // PM keeps its own type of colour table
683 // load the database with the built in colour values when called for the
684 // first time, do nothing after this
687 wxStringToColourHashMap
*m_map
;
690 class WXDLLEXPORT wxResourceCache
: public wxList
693 wxResourceCache() { }
695 wxResourceCache(const unsigned int keyType
) : wxList(keyType
) { }
697 virtual ~wxResourceCache();
700 // ---------------------------------------------------------------------------
702 // ---------------------------------------------------------------------------
704 // Lists of GDI objects
705 extern WXDLLEXPORT_DATA(wxPenList
*) wxThePenList
;
706 extern WXDLLEXPORT_DATA(wxBrushList
*) wxTheBrushList
;
707 extern WXDLLEXPORT_DATA(wxFontList
*) wxTheFontList
;
711 wxStockGDI creates the stock GDI objects on demand. Pointers to the
712 created objects are stored in the ms_stockObject array, which is indexed
713 by the Item enum values. Platorm-specific fonts can be created by
714 implementing a derived class with an override for the GetFont function.
715 wxStockGDI operates as a singleton, accessed through the ms_instance
716 pointer. By default this pointer is set to an instance of wxStockGDI.
717 A derived class must arrange to set this pointer to an instance of itself.
719 class WXDLLIMPEXP_CORE wxStockGDI
761 virtual ~wxStockGDI();
762 static void DeleteAll();
764 static wxStockGDI
& instance() { return *ms_instance
; }
766 static const wxBrush
* GetBrush(Item item
);
767 static const wxColour
* GetColour(Item item
);
768 static const wxCursor
* GetCursor(Item item
);
769 // Can be overridden by platform-specific derived classes
770 virtual const wxFont
* GetFont(Item item
);
771 static const wxPen
* GetPen(Item item
);
774 static wxStockGDI
* ms_instance
;
776 static wxObject
* ms_stockObject
[ITEMCOUNT
];
778 DECLARE_NO_COPY_CLASS(wxStockGDI
)
781 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
782 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
783 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
784 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
786 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
787 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
788 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
789 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
790 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
791 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
792 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
793 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
794 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
795 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
797 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
798 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
799 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
800 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
801 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
802 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
803 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
804 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
805 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
806 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
808 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
809 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
810 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
811 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
812 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
813 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
814 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
816 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
817 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
818 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
821 extern WXDLLEXPORT_DATA(wxBitmap
) wxNullBitmap
;
822 extern WXDLLEXPORT_DATA(wxIcon
) wxNullIcon
;
823 extern WXDLLEXPORT_DATA(wxCursor
) wxNullCursor
;
824 extern WXDLLEXPORT_DATA(wxPen
) wxNullPen
;
825 extern WXDLLEXPORT_DATA(wxBrush
) wxNullBrush
;
826 extern WXDLLEXPORT_DATA(wxPalette
) wxNullPalette
;
827 extern WXDLLEXPORT_DATA(wxFont
) wxNullFont
;
828 extern WXDLLEXPORT_DATA(wxColour
) wxNullColour
;
829 extern WXDLLEXPORT_DATA(wxIconBundle
) wxNullIconBundle
;
831 extern WXDLLEXPORT_DATA(wxColourDatabase
*) wxTheColourDatabase
;
833 extern WXDLLEXPORT_DATA(const char) wxPanelNameStr
[];
835 extern WXDLLEXPORT_DATA(const wxSize
) wxDefaultSize
;
836 extern WXDLLEXPORT_DATA(const wxPoint
) wxDefaultPosition
;
838 // ---------------------------------------------------------------------------
840 // ---------------------------------------------------------------------------
842 // resource management
843 extern void WXDLLEXPORT
wxInitializeStockLists();
844 extern void WXDLLEXPORT
wxDeleteStockLists();
846 // is the display colour (or monochrome)?
847 extern bool WXDLLEXPORT
wxColourDisplay();
849 // Returns depth of screen
850 extern int WXDLLEXPORT
wxDisplayDepth();
851 #define wxGetDisplayDepth wxDisplayDepth
853 // get the display size
854 extern void WXDLLEXPORT
wxDisplaySize(int *width
, int *height
);
855 extern wxSize WXDLLEXPORT
wxGetDisplaySize();
856 extern void WXDLLEXPORT
wxDisplaySizeMM(int *width
, int *height
);
857 extern wxSize WXDLLEXPORT
wxGetDisplaySizeMM();
859 // Get position and size of the display workarea
860 extern void WXDLLEXPORT
wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
);
861 extern wxRect WXDLLEXPORT
wxGetClientDisplayRect();
864 extern void WXDLLEXPORT
wxSetCursor(const wxCursor
& cursor
);