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
,
83 wxBITMAP_TYPE_ANY
= 50
89 wxCURSOR_NONE
, // should be 0
99 wxCURSOR_MIDDLE_BUTTON
,
101 wxCURSOR_PAINT_BRUSH
,
104 wxCURSOR_POINT_RIGHT
,
105 wxCURSOR_QUESTION_ARROW
,
106 wxCURSOR_RIGHT_BUTTON
,
117 wxCURSOR_DEFAULT
, // standard X11 cursor
120 wxCURSOR_COPY_ARROW
, // MacOS Theme Plus arrow
123 // Not yet implemented for Windows
124 wxCURSOR_CROSS_REVERSE
,
125 wxCURSOR_DOUBLE_ARROW
,
126 wxCURSOR_BASED_ARROW_UP
,
127 wxCURSOR_BASED_ARROW_DOWN
,
136 #define wxCURSOR_DEFAULT wxCURSOR_ARROW
139 // ---------------------------------------------------------------------------
141 // ---------------------------------------------------------------------------
143 /* Useful macro for creating icons portably, for example:
145 wxIcon *icon = new wxICON(mondrian);
149 wxIcon *icon = new wxIcon("mondrian"); // On wxMSW
150 wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK
154 // Load from a resource
155 #define wxICON(X) wxIcon(wxT(#X))
156 #elif defined(__WXPM__)
157 // Load from a resource
158 #define wxICON(X) wxIcon(wxT(#X))
159 #elif defined(__WXMGL__)
160 // Initialize from an included XPM
161 #define wxICON(X) wxIcon( (const char**) X##_xpm )
162 #elif defined(__WXDFB__)
163 // Initialize from an included XPM
164 #define wxICON(X) wxIcon( (const char**) X##_xpm )
165 #elif defined(__WXGTK__)
166 // Initialize from an included XPM
167 #define wxICON(X) wxIcon( (const char**) X##_xpm )
168 #elif defined(__WXMAC__)
169 // Initialize from an included XPM
170 #define wxICON(X) wxIcon( (const char**) X##_xpm )
171 #elif defined(__WXMOTIF__)
172 // Initialize from an included XPM
173 #define wxICON(X) wxIcon( X##_xpm )
174 #elif defined(__WXX11__)
175 // Initialize from an included XPM
176 #define wxICON(X) wxIcon( X##_xpm )
178 // This will usually mean something on any platform
179 #define wxICON(X) wxIcon(wxT(#X))
182 /* Another macro: this one is for portable creation of bitmaps. We assume that
183 under Unix bitmaps live in XPMs and under Windows they're in ressources.
186 #if defined(__WXMSW__) || defined(__WXPM__)
187 #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
188 #elif defined(__WXGTK__) || \
189 defined(__WXMOTIF__) || \
190 defined(__WXX11__) || \
191 defined(__WXMAC__) || \
192 defined(__WXMGL__) || \
193 defined(__WXDFB__) || \
195 // Initialize from an included XPM
196 #define wxBITMAP(name) wxBitmap( (const char**) name##_xpm )
197 #else // other platforms
198 #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
201 // ===========================================================================
203 // ===========================================================================
205 // ---------------------------------------------------------------------------
207 // ---------------------------------------------------------------------------
209 class WXDLLEXPORT wxSize
212 // members are public for compatibility, don't use them directly.
216 wxSize() : x(0), y(0) { }
217 wxSize(int xx
, int yy
) : x(xx
), y(yy
) { }
219 // no copy ctor or assignment operator - the defaults are ok
221 wxSize
& operator+=(const wxSize
& sz
) { x
+= sz
.x
; y
+= sz
.y
; return *this; }
222 wxSize
& operator-=(const wxSize
& sz
) { x
-= sz
.x
; y
-= sz
.y
; return *this; }
223 wxSize
& operator/=(int i
) { x
/= i
; y
/= i
; return *this; }
224 wxSize
& operator*=(int i
) { x
*= i
; y
*= i
; return *this; }
226 void IncTo(const wxSize
& sz
)
227 { if ( sz
.x
> x
) x
= sz
.x
; if ( sz
.y
> y
) y
= sz
.y
; }
228 void DecTo(const wxSize
& sz
)
229 { if ( sz
.x
< x
) x
= sz
.x
; if ( sz
.y
< y
) y
= sz
.y
; }
231 void IncBy(int dx
, int dy
) { x
+= dx
; y
+= dy
; }
232 void IncBy(const wxSize
& sz
) { IncBy(sz
.x
, sz
.y
); }
233 void IncBy(int d
) { IncBy(d
, d
); }
235 void DecBy(int dx
, int dy
) { IncBy(-dx
, -dy
); }
236 void DecBy(const wxSize
& sz
) { DecBy(sz
.x
, sz
.y
); }
237 void DecBy(int d
) { DecBy(d
, d
); }
240 wxSize
& Scale(float xscale
, float yscale
)
241 { x
= (int)(x
*xscale
); y
= (int)(y
*yscale
); return *this; }
244 void Set(int xx
, int yy
) { x
= xx
; y
= yy
; }
245 void SetWidth(int w
) { x
= w
; }
246 void SetHeight(int h
) { y
= h
; }
248 int GetWidth() const { return x
; }
249 int GetHeight() const { return y
; }
251 bool IsFullySpecified() const { return x
!= wxDefaultCoord
&& y
!= wxDefaultCoord
; }
253 // combine this size with the other one replacing the default (i.e. equal
254 // to wxDefaultCoord) components of this object with those of the other
255 void SetDefaults(const wxSize
& size
)
257 if ( x
== wxDefaultCoord
)
259 if ( y
== wxDefaultCoord
)
264 int GetX() const { return x
; }
265 int GetY() const { return y
; }
269 inline bool operator==(const wxSize
& s1
, const wxSize
& s2
)
271 return s1
.x
== s2
.x
&& s1
.y
== s2
.y
;
274 inline bool operator!=(const wxSize
& s1
, const wxSize
& s2
)
276 return s1
.x
!= s2
.x
|| s1
.y
!= s2
.y
;
280 inline wxSize
operator+(const wxSize
& s1
, const wxSize
& s2
)
282 return wxSize(s1
.x
+ s2
.x
, s1
.y
+ s2
.y
);
286 inline wxSize
operator-(const wxSize
& s1
, const wxSize
& s2
)
288 return wxSize(s1
.x
- s2
.x
, s1
.y
- s2
.y
);
292 inline wxSize
operator/(const wxSize
& s
, int i
)
294 return wxSize(s
.x
/ i
, s
.y
/ i
);
298 inline wxSize
operator*(const wxSize
& s
, int i
)
300 return wxSize(s
.x
* i
, s
.y
* i
);
304 inline wxSize
operator*(int i
, const wxSize
& s
)
306 return wxSize(s
.x
* i
, s
.y
* i
);
312 // ---------------------------------------------------------------------------
313 // Point classes: with real or integer coordinates
314 // ---------------------------------------------------------------------------
316 class WXDLLEXPORT wxRealPoint
322 wxRealPoint() : x(0.0), y(0.0) { }
323 wxRealPoint(double xx
, double yy
) : x(xx
), y(yy
) { }
327 inline bool operator==(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
329 return wxIsSameDouble(p1
.x
, p2
.x
) && wxIsSameDouble(p1
.y
, p2
.y
);
333 inline bool operator!=(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
339 inline wxRealPoint
operator+(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
341 return wxRealPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
345 inline wxRealPoint
operator-(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
347 return wxRealPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
351 // ----------------------------------------------------------------------------
352 // wxPoint: 2D point with integer coordinates
353 // ----------------------------------------------------------------------------
355 class WXDLLEXPORT wxPoint
360 wxPoint() : x(0), y(0) { }
361 wxPoint(int xx
, int yy
) : x(xx
), y(yy
) { }
363 // no copy ctor or assignment operator - the defaults are ok
365 //assignment operators
366 wxPoint
& operator+=(const wxPoint
& p
) { x
+= p
.x
; y
+= p
.y
; return *this; }
367 wxPoint
& operator-=(const wxPoint
& p
) { x
-= p
.x
; y
-= p
.y
; return *this; }
369 wxPoint
& operator+=(const wxSize
& s
) { x
+= s
.GetWidth(); y
+= s
.GetHeight(); return *this; }
370 wxPoint
& operator-=(const wxSize
& s
) { x
-= s
.GetWidth(); y
-= s
.GetHeight(); return *this; }
375 inline bool operator==(const wxPoint
& p1
, const wxPoint
& p2
)
377 return p1
.x
== p2
.x
&& p1
.y
== p2
.y
;
380 inline bool operator!=(const wxPoint
& p1
, const wxPoint
& p2
)
386 // arithmetic operations (component wise)
387 inline wxPoint
operator+(const wxPoint
& p1
, const wxPoint
& p2
)
389 return wxPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
392 inline wxPoint
operator-(const wxPoint
& p1
, const wxPoint
& p2
)
394 return wxPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
397 inline wxPoint
operator+(const wxPoint
& p
, const wxSize
& s
)
399 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
402 inline wxPoint
operator-(const wxPoint
& p
, const wxSize
& s
)
404 return wxPoint(p
.x
- s
.x
, p
.y
- s
.y
);
407 inline wxPoint
operator+(const wxSize
& s
, const wxPoint
& p
)
409 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
412 inline wxPoint
operator-(const wxSize
& s
, const wxPoint
& p
)
414 return wxPoint(s
.x
- p
.x
, s
.y
- p
.y
);
417 inline wxPoint
operator-(const wxPoint
& p
)
419 return wxPoint(-p
.x
, -p
.y
);
423 // ---------------------------------------------------------------------------
425 // ---------------------------------------------------------------------------
427 class WXDLLEXPORT wxRect
431 : x(0), y(0), width(0), height(0)
433 wxRect(int xx
, int yy
, int ww
, int hh
)
434 : x(xx
), y(yy
), width(ww
), height(hh
)
436 wxRect(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
437 wxRect(const wxPoint
& pt
, const wxSize
& size
)
438 : x(pt
.x
), y(pt
.y
), width(size
.x
), height(size
.y
)
440 wxRect(const wxSize
& size
)
441 : x(0), y(0), width(size
.x
), height(size
.y
)
444 // default copy ctor and assignment operators ok
446 int GetX() const { return x
; }
447 void SetX(int xx
) { x
= xx
; }
449 int GetY() const { return y
; }
450 void SetY(int yy
) { y
= yy
; }
452 int GetWidth() const { return width
; }
453 void SetWidth(int w
) { width
= w
; }
455 int GetHeight() const { return height
; }
456 void SetHeight(int h
) { height
= h
; }
458 wxPoint
GetPosition() const { return wxPoint(x
, y
); }
459 void SetPosition( const wxPoint
&p
) { x
= p
.x
; y
= p
.y
; }
461 wxSize
GetSize() const { return wxSize(width
, height
); }
462 void SetSize( const wxSize
&s
) { width
= s
.GetWidth(); height
= s
.GetHeight(); }
464 bool IsEmpty() const { return (width
<= 0) || (height
<= 0); }
466 int GetLeft() const { return x
; }
467 int GetTop() const { return y
; }
468 int GetBottom() const { return y
+ height
- 1; }
469 int GetRight() const { return x
+ width
- 1; }
471 void SetLeft(int left
) { x
= left
; }
472 void SetRight(int right
) { width
= right
- x
+ 1; }
473 void SetTop(int top
) { y
= top
; }
474 void SetBottom(int bottom
) { height
= bottom
- y
+ 1; }
476 wxPoint
GetTopLeft() const { return GetPosition(); }
477 wxPoint
GetLeftTop() const { return GetTopLeft(); }
478 void SetTopLeft(const wxPoint
&p
) { SetPosition(p
); }
479 void SetLeftTop(const wxPoint
&p
) { SetTopLeft(p
); }
481 wxPoint
GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
482 wxPoint
GetRightBottom() const { return GetBottomRight(); }
483 void SetBottomRight(const wxPoint
&p
) { SetRight(p
.x
); SetBottom(p
.y
); }
484 void SetRightBottom(const wxPoint
&p
) { SetBottomRight(p
); }
486 wxPoint
GetTopRight() const { return wxPoint(GetRight(), GetTop()); }
487 wxPoint
GetRightTop() const { return GetTopRight(); }
488 void SetTopRight(const wxPoint
&p
) { SetRight(p
.x
); SetTop(p
.y
); }
489 void SetRightTop(const wxPoint
&p
) { SetTopLeft(p
); }
491 wxPoint
GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); }
492 wxPoint
GetLeftBottom() const { return GetBottomLeft(); }
493 void SetBottomLeft(const wxPoint
&p
) { SetLeft(p
.x
); SetBottom(p
.y
); }
494 void SetLeftBottom(const wxPoint
&p
) { SetBottomLeft(p
); }
496 // operations with rect
497 wxRect
& Inflate(wxCoord dx
, wxCoord dy
);
498 wxRect
& Inflate(const wxSize
& d
) { return Inflate(d
.x
, d
.y
); }
499 wxRect
& Inflate(wxCoord d
) { return Inflate(d
, d
); }
500 wxRect
Inflate(wxCoord dx
, wxCoord dy
) const
507 wxRect
& Deflate(wxCoord dx
, wxCoord dy
) { return Inflate(-dx
, -dy
); }
508 wxRect
& Deflate(const wxSize
& d
) { return Inflate(-d
.x
, -d
.y
); }
509 wxRect
& Deflate(wxCoord d
) { return Inflate(-d
); }
510 wxRect
Deflate(wxCoord dx
, wxCoord dy
) const
517 void Offset(wxCoord dx
, wxCoord dy
) { x
+= dx
; y
+= dy
; }
518 void Offset(const wxPoint
& pt
) { Offset(pt
.x
, pt
.y
); }
520 wxRect
& Intersect(const wxRect
& rect
);
521 wxRect
Intersect(const wxRect
& rect
) const
528 wxRect
& Union(const wxRect
& rect
);
529 wxRect
Union(const wxRect
& rect
) const
536 // return true if the point is (not strcitly) inside the rect
537 bool Contains(int x
, int y
) const;
538 bool Contains(const wxPoint
& pt
) const { return Contains(pt
.x
, pt
.y
); }
539 // return true if the rectangle is (not strcitly) inside the rect
540 bool Contains(const wxRect
& rect
) const;
542 #if WXWIN_COMPATIBILITY_2_6
543 // use Contains() instead
544 wxDEPRECATED( bool Inside(int x
, int y
) const );
545 wxDEPRECATED( bool Inside(const wxPoint
& pt
) const );
546 wxDEPRECATED( bool Inside(const wxRect
& rect
) const );
547 #endif // WXWIN_COMPATIBILITY_2_6
549 // return true if the rectangles have a non empty intersection
550 bool Intersects(const wxRect
& rect
) const;
552 // like Union() but don't ignore empty rectangles
553 wxRect
& operator+=(const wxRect
& rect
);
555 // intersections of two rectrangles not testing for empty rectangles
556 wxRect
& operator*=(const wxRect
& rect
);
558 // centre this rectangle in the given (usually, but not necessarily,
560 wxRect
CentreIn(const wxRect
& r
, int dir
= wxBOTH
) const
562 return wxRect(dir
& wxHORIZONTAL
? r
.x
+ (r
.width
- width
)/2 : x
,
563 dir
& wxVERTICAL
? r
.y
+ (r
.height
- height
)/2 : y
,
567 wxRect
CenterIn(const wxRect
& r
, int dir
= wxBOTH
) const
569 return CentreIn(r
, dir
);
573 int x
, y
, width
, height
;
577 // compare rectangles
578 inline bool operator==(const wxRect
& r1
, const wxRect
& r2
)
580 return (r1
.x
== r2
.x
) && (r1
.y
== r2
.y
) &&
581 (r1
.width
== r2
.width
) && (r1
.height
== r2
.height
);
584 inline bool operator!=(const wxRect
& r1
, const wxRect
& r2
)
589 // like Union() but don't treat empty rectangles specially
590 WXDLLIMPEXP_CORE wxRect
operator+(const wxRect
& r1
, const wxRect
& r2
);
592 // intersections of two rectangles
593 WXDLLIMPEXP_CORE wxRect
operator*(const wxRect
& r1
, const wxRect
& r2
);
598 #if WXWIN_COMPATIBILITY_2_6
599 inline bool wxRect::Inside(int cx
, int cy
) const { return Contains(cx
, cy
); }
600 inline bool wxRect::Inside(const wxPoint
& pt
) const { return Contains(pt
); }
601 inline bool wxRect::Inside(const wxRect
& rect
) const { return Contains(rect
); }
602 #endif // WXWIN_COMPATIBILITY_2_6
605 // ---------------------------------------------------------------------------
606 // Management of pens, brushes and fonts
607 // ---------------------------------------------------------------------------
609 typedef wxInt8 wxDash
;
611 class WXDLLIMPEXP_CORE wxGDIObjListBase
{
620 class WXDLLIMPEXP_CORE wxPenList
: public wxGDIObjListBase
623 wxPen
*FindOrCreatePen(const wxColour
& colour
, int width
, int style
);
624 #if WXWIN_COMPATIBILITY_2_6
625 wxDEPRECATED( void AddPen(wxPen
*) );
626 wxDEPRECATED( void RemovePen(wxPen
*) );
630 class WXDLLIMPEXP_CORE wxBrushList
: public wxGDIObjListBase
633 wxBrush
*FindOrCreateBrush(const wxColour
& colour
, int style
= wxSOLID
);
634 #if WXWIN_COMPATIBILITY_2_6
635 wxDEPRECATED( void AddBrush(wxBrush
*) );
636 wxDEPRECATED( void RemoveBrush(wxBrush
*) );
640 class WXDLLIMPEXP_CORE wxFontList
: public wxGDIObjListBase
643 wxFont
*FindOrCreateFont(int pointSize
, int family
, int style
, int weight
,
644 bool underline
= false,
645 const wxString
& face
= wxEmptyString
,
646 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
647 #if WXWIN_COMPATIBILITY_2_6
648 wxDEPRECATED( void AddFont(wxFont
*) );
649 wxDEPRECATED( void RemoveFont(wxFont
*) );
653 WX_DECLARE_STRING_HASH_MAP(wxColour
*, wxStringToColourHashMap
);
655 class WXDLLEXPORT wxColourDatabase
661 // find colour by name or name for the given colour
662 wxColour
Find(const wxString
& name
) const;
663 wxString
FindName(const wxColour
& colour
) const;
665 // add a new colour to the database
666 void AddColour(const wxString
& name
, const wxColour
& colour
);
668 #if WXWIN_COMPATIBILITY_2_6
669 // deprecated, use Find() instead
670 wxDEPRECATED( wxColour
*FindColour(const wxString
& name
) );
671 #endif // WXWIN_COMPATIBILITY_2_6
675 // PM keeps its own type of colour table
681 // load the database with the built in colour values when called for the
682 // first time, do nothing after this
685 wxStringToColourHashMap
*m_map
;
688 class WXDLLEXPORT wxResourceCache
: public wxList
691 wxResourceCache() { }
693 wxResourceCache(const unsigned int keyType
) : wxList(keyType
) { }
695 virtual ~wxResourceCache();
698 // ---------------------------------------------------------------------------
700 // ---------------------------------------------------------------------------
702 // Lists of GDI objects
703 extern WXDLLEXPORT_DATA(wxPenList
*) wxThePenList
;
704 extern WXDLLEXPORT_DATA(wxBrushList
*) wxTheBrushList
;
705 extern WXDLLEXPORT_DATA(wxFontList
*) wxTheFontList
;
709 wxStockGDI creates the stock GDI objects on demand. Pointers to the
710 created objects are stored in the ms_stockObject array, which is indexed
711 by the Item enum values. Platorm-specific fonts can be created by
712 implementing a derived class with an override for the GetFont function.
713 wxStockGDI operates as a singleton, accessed through the ms_instance
714 pointer. By default this pointer is set to an instance of wxStockGDI.
715 A derived class must arrange to set this pointer to an instance of itself.
717 class WXDLLIMPEXP_CORE wxStockGDI
759 virtual ~wxStockGDI();
760 static void DeleteAll();
762 static wxStockGDI
& instance() { return *ms_instance
; }
764 static const wxBrush
* GetBrush(Item item
);
765 static const wxColour
* GetColour(Item item
);
766 static const wxCursor
* GetCursor(Item item
);
767 // Can be overridden by platform-specific derived classes
768 virtual const wxFont
* GetFont(Item item
);
769 static const wxPen
* GetPen(Item item
);
772 static wxStockGDI
* ms_instance
;
774 static wxObject
* ms_stockObject
[ITEMCOUNT
];
776 DECLARE_NO_COPY_CLASS(wxStockGDI
)
779 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
780 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
781 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
782 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
784 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
785 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
786 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
787 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
788 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
789 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
790 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
791 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
792 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
793 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
795 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
796 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
797 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
798 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
799 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
800 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
801 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
802 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
803 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
804 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
806 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
807 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
808 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
809 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
810 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
811 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
812 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
814 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
815 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
816 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
819 extern WXDLLEXPORT_DATA(wxBitmap
) wxNullBitmap
;
820 extern WXDLLEXPORT_DATA(wxIcon
) wxNullIcon
;
821 extern WXDLLEXPORT_DATA(wxCursor
) wxNullCursor
;
822 extern WXDLLEXPORT_DATA(wxPen
) wxNullPen
;
823 extern WXDLLEXPORT_DATA(wxBrush
) wxNullBrush
;
824 extern WXDLLEXPORT_DATA(wxPalette
) wxNullPalette
;
825 extern WXDLLEXPORT_DATA(wxFont
) wxNullFont
;
826 extern WXDLLEXPORT_DATA(wxColour
) wxNullColour
;
827 extern WXDLLEXPORT_DATA(wxIconBundle
) wxNullIconBundle
;
829 extern WXDLLEXPORT_DATA(wxColourDatabase
*) wxTheColourDatabase
;
831 extern WXDLLEXPORT_DATA(const wxChar
) wxPanelNameStr
[];
833 extern WXDLLEXPORT_DATA(const wxSize
) wxDefaultSize
;
834 extern WXDLLEXPORT_DATA(const wxPoint
) wxDefaultPosition
;
836 // ---------------------------------------------------------------------------
838 // ---------------------------------------------------------------------------
840 // resource management
841 extern void WXDLLEXPORT
wxInitializeStockLists();
842 extern void WXDLLEXPORT
wxDeleteStockLists();
844 // is the display colour (or monochrome)?
845 extern bool WXDLLEXPORT
wxColourDisplay();
847 // Returns depth of screen
848 extern int WXDLLEXPORT
wxDisplayDepth();
849 #define wxGetDisplayDepth wxDisplayDepth
851 // get the display size
852 extern void WXDLLEXPORT
wxDisplaySize(int *width
, int *height
);
853 extern wxSize WXDLLEXPORT
wxGetDisplaySize();
854 extern void WXDLLEXPORT
wxDisplaySizeMM(int *width
, int *height
);
855 extern wxSize WXDLLEXPORT
wxGetDisplaySizeMM();
857 // Get position and size of the display workarea
858 extern void WXDLLEXPORT
wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
);
859 extern wxRect WXDLLEXPORT
wxGetClientDisplayRect();
862 extern void WXDLLEXPORT
wxSetCursor(const wxCursor
& cursor
);