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
88 // Polygon filling mode
89 enum wxPolygonFillMode
98 wxCURSOR_NONE
, // should be 0
100 wxCURSOR_RIGHT_ARROW
,
106 wxCURSOR_LEFT_BUTTON
,
108 wxCURSOR_MIDDLE_BUTTON
,
110 wxCURSOR_PAINT_BRUSH
,
113 wxCURSOR_POINT_RIGHT
,
114 wxCURSOR_QUESTION_ARROW
,
115 wxCURSOR_RIGHT_BUTTON
,
126 wxCURSOR_DEFAULT
, // standard X11 cursor
129 wxCURSOR_COPY_ARROW
, // MacOS Theme Plus arrow
133 wxCURSOR_CLOSED_HAND
,
135 // TODO CS supply openhand and closedhand cursors
136 wxCURSOR_OPEN_HAND
= wxCURSOR_HAND
,
137 wxCURSOR_CLOSED_HAND
= wxCURSOR_HAND
,
140 // Not yet implemented for Windows
141 wxCURSOR_CROSS_REVERSE
,
142 wxCURSOR_DOUBLE_ARROW
,
143 wxCURSOR_BASED_ARROW_UP
,
144 wxCURSOR_BASED_ARROW_DOWN
,
153 #define wxCURSOR_DEFAULT wxCURSOR_ARROW
156 // ---------------------------------------------------------------------------
158 // ---------------------------------------------------------------------------
160 /* Useful macro for creating icons portably, for example:
162 wxIcon *icon = new wxICON(mondrian);
166 wxIcon *icon = new wxIcon("mondrian"); // On wxMSW
167 wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK
171 // Load from a resource
172 #define wxICON(X) wxIcon(wxT(#X))
173 #elif defined(__WXPM__)
174 // Load from a resource
175 #define wxICON(X) wxIcon(wxT(#X))
176 #elif defined(__WXMGL__)
177 // Initialize from an included XPM
178 #define wxICON(X) wxIcon( X##_xpm )
179 #elif defined(__WXDFB__)
180 // Initialize from an included XPM
181 #define wxICON(X) wxIcon( X##_xpm )
182 #elif defined(__WXGTK__)
183 // Initialize from an included XPM
184 #define wxICON(X) wxIcon( X##_xpm )
185 #elif defined(__WXMAC__)
186 // Initialize from an included XPM
187 #define wxICON(X) wxIcon( X##_xpm )
188 #elif defined(__WXMOTIF__)
189 // Initialize from an included XPM
190 #define wxICON(X) wxIcon( X##_xpm )
191 #elif defined(__WXX11__)
192 // Initialize from an included XPM
193 #define wxICON(X) wxIcon( X##_xpm )
195 // This will usually mean something on any platform
196 #define wxICON(X) wxIcon(wxT(#X))
199 /* Another macro: this one is for portable creation of bitmaps. We assume that
200 under Unix bitmaps live in XPMs and under Windows they're in ressources.
203 #if defined(__WXMSW__) || defined(__WXPM__)
204 #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
205 #elif defined(__WXGTK__) || \
206 defined(__WXMOTIF__) || \
207 defined(__WXX11__) || \
208 defined(__WXMAC__) || \
209 defined(__WXMGL__) || \
210 defined(__WXDFB__) || \
212 // Initialize from an included XPM
213 #define wxBITMAP(name) wxBitmap(name##_xpm)
214 #else // other platforms
215 #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
218 // ===========================================================================
220 // ===========================================================================
222 // ---------------------------------------------------------------------------
224 // ---------------------------------------------------------------------------
226 class WXDLLIMPEXP_CORE wxSize
229 // members are public for compatibility, don't use them directly.
233 wxSize() : x(0), y(0) { }
234 wxSize(int xx
, int yy
) : x(xx
), y(yy
) { }
236 // no copy ctor or assignment operator - the defaults are ok
238 wxSize
& operator+=(const wxSize
& sz
) { x
+= sz
.x
; y
+= sz
.y
; return *this; }
239 wxSize
& operator-=(const wxSize
& sz
) { x
-= sz
.x
; y
-= sz
.y
; return *this; }
240 wxSize
& operator/=(int i
) { x
/= i
; y
/= i
; return *this; }
241 wxSize
& operator*=(int i
) { x
*= i
; y
*= i
; return *this; }
243 void IncTo(const wxSize
& sz
)
244 { if ( sz
.x
> x
) x
= sz
.x
; if ( sz
.y
> y
) y
= sz
.y
; }
245 void DecTo(const wxSize
& sz
)
246 { if ( sz
.x
< x
) x
= sz
.x
; if ( sz
.y
< y
) y
= sz
.y
; }
248 void IncBy(int dx
, int dy
) { x
+= dx
; y
+= dy
; }
249 void IncBy(const wxSize
& sz
) { IncBy(sz
.x
, sz
.y
); }
250 void IncBy(int d
) { IncBy(d
, d
); }
252 void DecBy(int dx
, int dy
) { IncBy(-dx
, -dy
); }
253 void DecBy(const wxSize
& sz
) { DecBy(sz
.x
, sz
.y
); }
254 void DecBy(int d
) { DecBy(d
, d
); }
257 wxSize
& Scale(float xscale
, float yscale
)
258 { x
= (int)(x
*xscale
); y
= (int)(y
*yscale
); return *this; }
261 void Set(int xx
, int yy
) { x
= xx
; y
= yy
; }
262 void SetWidth(int w
) { x
= w
; }
263 void SetHeight(int h
) { y
= h
; }
265 int GetWidth() const { return x
; }
266 int GetHeight() const { return y
; }
268 bool IsFullySpecified() const { return x
!= wxDefaultCoord
&& y
!= wxDefaultCoord
; }
270 // combine this size with the other one replacing the default (i.e. equal
271 // to wxDefaultCoord) components of this object with those of the other
272 void SetDefaults(const wxSize
& size
)
274 if ( x
== wxDefaultCoord
)
276 if ( y
== wxDefaultCoord
)
281 int GetX() const { return x
; }
282 int GetY() const { return y
; }
286 inline bool operator==(const wxSize
& s1
, const wxSize
& s2
)
288 return s1
.x
== s2
.x
&& s1
.y
== s2
.y
;
291 inline bool operator!=(const wxSize
& s1
, const wxSize
& s2
)
293 return s1
.x
!= s2
.x
|| s1
.y
!= s2
.y
;
297 inline wxSize
operator+(const wxSize
& s1
, const wxSize
& s2
)
299 return wxSize(s1
.x
+ s2
.x
, s1
.y
+ s2
.y
);
303 inline wxSize
operator-(const wxSize
& s1
, const wxSize
& s2
)
305 return wxSize(s1
.x
- s2
.x
, s1
.y
- s2
.y
);
309 inline wxSize
operator/(const wxSize
& s
, int i
)
311 return wxSize(s
.x
/ i
, s
.y
/ i
);
315 inline wxSize
operator*(const wxSize
& s
, int i
)
317 return wxSize(s
.x
* i
, s
.y
* i
);
321 inline wxSize
operator*(int i
, const wxSize
& s
)
323 return wxSize(s
.x
* i
, s
.y
* i
);
329 // ---------------------------------------------------------------------------
330 // Point classes: with real or integer coordinates
331 // ---------------------------------------------------------------------------
333 class WXDLLIMPEXP_CORE wxRealPoint
339 wxRealPoint() : x(0.0), y(0.0) { }
340 wxRealPoint(double xx
, double yy
) : x(xx
), y(yy
) { }
344 inline bool operator==(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
346 return wxIsSameDouble(p1
.x
, p2
.x
) && wxIsSameDouble(p1
.y
, p2
.y
);
350 inline bool operator!=(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
356 inline wxRealPoint
operator+(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
358 return wxRealPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
362 inline wxRealPoint
operator-(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
364 return wxRealPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
368 // ----------------------------------------------------------------------------
369 // wxPoint: 2D point with integer coordinates
370 // ----------------------------------------------------------------------------
372 class WXDLLIMPEXP_CORE wxPoint
377 wxPoint() : x(0), y(0) { }
378 wxPoint(int xx
, int yy
) : x(xx
), y(yy
) { }
380 // no copy ctor or assignment operator - the defaults are ok
382 //assignment operators
383 wxPoint
& operator+=(const wxPoint
& p
) { x
+= p
.x
; y
+= p
.y
; return *this; }
384 wxPoint
& operator-=(const wxPoint
& p
) { x
-= p
.x
; y
-= p
.y
; return *this; }
386 wxPoint
& operator+=(const wxSize
& s
) { x
+= s
.GetWidth(); y
+= s
.GetHeight(); return *this; }
387 wxPoint
& operator-=(const wxSize
& s
) { x
-= s
.GetWidth(); y
-= s
.GetHeight(); return *this; }
392 inline bool operator==(const wxPoint
& p1
, const wxPoint
& p2
)
394 return p1
.x
== p2
.x
&& p1
.y
== p2
.y
;
397 inline bool operator!=(const wxPoint
& p1
, const wxPoint
& p2
)
403 // arithmetic operations (component wise)
404 inline wxPoint
operator+(const wxPoint
& p1
, const wxPoint
& p2
)
406 return wxPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
409 inline wxPoint
operator-(const wxPoint
& p1
, const wxPoint
& p2
)
411 return wxPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
414 inline wxPoint
operator+(const wxPoint
& p
, const wxSize
& s
)
416 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
419 inline wxPoint
operator-(const wxPoint
& p
, const wxSize
& s
)
421 return wxPoint(p
.x
- s
.x
, p
.y
- s
.y
);
424 inline wxPoint
operator+(const wxSize
& s
, const wxPoint
& p
)
426 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
429 inline wxPoint
operator-(const wxSize
& s
, const wxPoint
& p
)
431 return wxPoint(s
.x
- p
.x
, s
.y
- p
.y
);
434 inline wxPoint
operator-(const wxPoint
& p
)
436 return wxPoint(-p
.x
, -p
.y
);
439 WX_DECLARE_LIST_WITH_DECL(wxPoint
, wxPointList
, class WXDLLIMPEXP_CORE
);
441 // ---------------------------------------------------------------------------
443 // ---------------------------------------------------------------------------
445 class WXDLLIMPEXP_CORE wxRect
449 : x(0), y(0), width(0), height(0)
451 wxRect(int xx
, int yy
, int ww
, int hh
)
452 : x(xx
), y(yy
), width(ww
), height(hh
)
454 wxRect(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
455 wxRect(const wxPoint
& pt
, const wxSize
& size
)
456 : x(pt
.x
), y(pt
.y
), width(size
.x
), height(size
.y
)
458 wxRect(const wxSize
& size
)
459 : x(0), y(0), width(size
.x
), height(size
.y
)
462 // default copy ctor and assignment operators ok
464 int GetX() const { return x
; }
465 void SetX(int xx
) { x
= xx
; }
467 int GetY() const { return y
; }
468 void SetY(int yy
) { y
= yy
; }
470 int GetWidth() const { return width
; }
471 void SetWidth(int w
) { width
= w
; }
473 int GetHeight() const { return height
; }
474 void SetHeight(int h
) { height
= h
; }
476 wxPoint
GetPosition() const { return wxPoint(x
, y
); }
477 void SetPosition( const wxPoint
&p
) { x
= p
.x
; y
= p
.y
; }
479 wxSize
GetSize() const { return wxSize(width
, height
); }
480 void SetSize( const wxSize
&s
) { width
= s
.GetWidth(); height
= s
.GetHeight(); }
482 bool IsEmpty() const { return (width
<= 0) || (height
<= 0); }
484 int GetLeft() const { return x
; }
485 int GetTop() const { return y
; }
486 int GetBottom() const { return y
+ height
- 1; }
487 int GetRight() const { return x
+ width
- 1; }
489 void SetLeft(int left
) { x
= left
; }
490 void SetRight(int right
) { width
= right
- x
+ 1; }
491 void SetTop(int top
) { y
= top
; }
492 void SetBottom(int bottom
) { height
= bottom
- y
+ 1; }
494 wxPoint
GetTopLeft() const { return GetPosition(); }
495 wxPoint
GetLeftTop() const { return GetTopLeft(); }
496 void SetTopLeft(const wxPoint
&p
) { SetPosition(p
); }
497 void SetLeftTop(const wxPoint
&p
) { SetTopLeft(p
); }
499 wxPoint
GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
500 wxPoint
GetRightBottom() const { return GetBottomRight(); }
501 void SetBottomRight(const wxPoint
&p
) { SetRight(p
.x
); SetBottom(p
.y
); }
502 void SetRightBottom(const wxPoint
&p
) { SetBottomRight(p
); }
504 wxPoint
GetTopRight() const { return wxPoint(GetRight(), GetTop()); }
505 wxPoint
GetRightTop() const { return GetTopRight(); }
506 void SetTopRight(const wxPoint
&p
) { SetRight(p
.x
); SetTop(p
.y
); }
507 void SetRightTop(const wxPoint
&p
) { SetTopLeft(p
); }
509 wxPoint
GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); }
510 wxPoint
GetLeftBottom() const { return GetBottomLeft(); }
511 void SetBottomLeft(const wxPoint
&p
) { SetLeft(p
.x
); SetBottom(p
.y
); }
512 void SetLeftBottom(const wxPoint
&p
) { SetBottomLeft(p
); }
514 // operations with rect
515 wxRect
& Inflate(wxCoord dx
, wxCoord dy
);
516 wxRect
& Inflate(const wxSize
& d
) { return Inflate(d
.x
, d
.y
); }
517 wxRect
& Inflate(wxCoord d
) { return Inflate(d
, d
); }
518 wxRect
Inflate(wxCoord dx
, wxCoord dy
) const
525 wxRect
& Deflate(wxCoord dx
, wxCoord dy
) { return Inflate(-dx
, -dy
); }
526 wxRect
& Deflate(const wxSize
& d
) { return Inflate(-d
.x
, -d
.y
); }
527 wxRect
& Deflate(wxCoord d
) { return Inflate(-d
); }
528 wxRect
Deflate(wxCoord dx
, wxCoord dy
) const
535 void Offset(wxCoord dx
, wxCoord dy
) { x
+= dx
; y
+= dy
; }
536 void Offset(const wxPoint
& pt
) { Offset(pt
.x
, pt
.y
); }
538 wxRect
& Intersect(const wxRect
& rect
);
539 wxRect
Intersect(const wxRect
& rect
) const
546 wxRect
& Union(const wxRect
& rect
);
547 wxRect
Union(const wxRect
& rect
) const
554 // return true if the point is (not strcitly) inside the rect
555 bool Contains(int x
, int y
) const;
556 bool Contains(const wxPoint
& pt
) const { return Contains(pt
.x
, pt
.y
); }
557 // return true if the rectangle 'rect' is (not strictly) inside this rect
558 bool Contains(const wxRect
& rect
) const;
560 #if WXWIN_COMPATIBILITY_2_6
561 // use Contains() instead
562 wxDEPRECATED( bool Inside(int x
, int y
) const );
563 wxDEPRECATED( bool Inside(const wxPoint
& pt
) const );
564 wxDEPRECATED( bool Inside(const wxRect
& rect
) const );
565 #endif // WXWIN_COMPATIBILITY_2_6
567 // return true if the rectangles have a non empty intersection
568 bool Intersects(const wxRect
& rect
) const;
570 // like Union() but don't ignore empty rectangles
571 wxRect
& operator+=(const wxRect
& rect
);
573 // intersections of two rectrangles not testing for empty rectangles
574 wxRect
& operator*=(const wxRect
& rect
);
576 // centre this rectangle in the given (usually, but not necessarily,
578 wxRect
CentreIn(const wxRect
& r
, int dir
= wxBOTH
) const
580 return wxRect(dir
& wxHORIZONTAL
? r
.x
+ (r
.width
- width
)/2 : x
,
581 dir
& wxVERTICAL
? r
.y
+ (r
.height
- height
)/2 : y
,
585 wxRect
CenterIn(const wxRect
& r
, int dir
= wxBOTH
) const
587 return CentreIn(r
, dir
);
591 int x
, y
, width
, height
;
595 // compare rectangles
596 inline bool operator==(const wxRect
& r1
, const wxRect
& r2
)
598 return (r1
.x
== r2
.x
) && (r1
.y
== r2
.y
) &&
599 (r1
.width
== r2
.width
) && (r1
.height
== r2
.height
);
602 inline bool operator!=(const wxRect
& r1
, const wxRect
& r2
)
607 // like Union() but don't treat empty rectangles specially
608 WXDLLIMPEXP_CORE wxRect
operator+(const wxRect
& r1
, const wxRect
& r2
);
610 // intersections of two rectangles
611 WXDLLIMPEXP_CORE wxRect
operator*(const wxRect
& r1
, const wxRect
& r2
);
616 #if WXWIN_COMPATIBILITY_2_6
617 inline bool wxRect::Inside(int cx
, int cy
) const { return Contains(cx
, cy
); }
618 inline bool wxRect::Inside(const wxPoint
& pt
) const { return Contains(pt
); }
619 inline bool wxRect::Inside(const wxRect
& rect
) const { return Contains(rect
); }
620 #endif // WXWIN_COMPATIBILITY_2_6
623 // ---------------------------------------------------------------------------
624 // Management of pens, brushes and fonts
625 // ---------------------------------------------------------------------------
627 typedef wxInt8 wxDash
;
629 class WXDLLIMPEXP_CORE wxGDIObjListBase
{
638 WX_DECLARE_STRING_HASH_MAP(wxColour
*, wxStringToColourHashMap
);
640 class WXDLLIMPEXP_CORE wxColourDatabase
646 // find colour by name or name for the given colour
647 wxColour
Find(const wxString
& name
) const;
648 wxString
FindName(const wxColour
& colour
) const;
650 // add a new colour to the database
651 void AddColour(const wxString
& name
, const wxColour
& colour
);
653 #if WXWIN_COMPATIBILITY_2_6
654 // deprecated, use Find() instead
655 wxDEPRECATED( wxColour
*FindColour(const wxString
& name
) );
656 #endif // WXWIN_COMPATIBILITY_2_6
660 // PM keeps its own type of colour table
666 // load the database with the built in colour values when called for the
667 // first time, do nothing after this
670 wxStringToColourHashMap
*m_map
;
673 class WXDLLIMPEXP_CORE wxResourceCache
: public wxList
676 wxResourceCache() { }
678 wxResourceCache(const unsigned int keyType
) : wxList(keyType
) { }
680 virtual ~wxResourceCache();
683 // ---------------------------------------------------------------------------
685 // ---------------------------------------------------------------------------
690 wxStockGDI creates the stock GDI objects on demand. Pointers to the
691 created objects are stored in the ms_stockObject array, which is indexed
692 by the Item enum values. Platorm-specific fonts can be created by
693 implementing a derived class with an override for the GetFont function.
694 wxStockGDI operates as a singleton, accessed through the ms_instance
695 pointer. By default this pointer is set to an instance of wxStockGDI.
696 A derived class must arrange to set this pointer to an instance of itself.
698 class WXDLLIMPEXP_CORE wxStockGDI
740 virtual ~wxStockGDI();
741 static void DeleteAll();
743 static wxStockGDI
& instance() { return *ms_instance
; }
745 static const wxBrush
* GetBrush(Item item
);
746 static const wxColour
* GetColour(Item item
);
747 static const wxCursor
* GetCursor(Item item
);
748 // Can be overridden by platform-specific derived classes
749 virtual const wxFont
* GetFont(Item item
);
750 static const wxPen
* GetPen(Item item
);
753 static wxStockGDI
* ms_instance
;
755 static wxObject
* ms_stockObject
[ITEMCOUNT
];
757 DECLARE_NO_COPY_CLASS(wxStockGDI
)
760 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
761 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
762 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
763 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
765 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
766 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
767 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
768 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
769 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
770 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
771 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
772 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
773 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
774 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
776 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
777 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
778 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
779 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
780 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
781 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
782 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
783 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
784 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
785 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
787 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
788 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
789 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
790 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
791 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
792 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
793 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
795 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
796 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
797 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
800 extern WXDLLIMPEXP_DATA_CORE(wxBitmap
) wxNullBitmap
;
801 extern WXDLLIMPEXP_DATA_CORE(wxIcon
) wxNullIcon
;
802 extern WXDLLIMPEXP_DATA_CORE(wxCursor
) wxNullCursor
;
803 extern WXDLLIMPEXP_DATA_CORE(wxPen
) wxNullPen
;
804 extern WXDLLIMPEXP_DATA_CORE(wxBrush
) wxNullBrush
;
805 extern WXDLLIMPEXP_DATA_CORE(wxPalette
) wxNullPalette
;
806 extern WXDLLIMPEXP_DATA_CORE(wxFont
) wxNullFont
;
807 extern WXDLLIMPEXP_DATA_CORE(wxColour
) wxNullColour
;
808 extern WXDLLIMPEXP_DATA_CORE(wxIconBundle
) wxNullIconBundle
;
810 extern WXDLLIMPEXP_DATA_CORE(wxColourDatabase
*) wxTheColourDatabase
;
812 extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr
[];
814 extern WXDLLIMPEXP_DATA_CORE(const wxSize
) wxDefaultSize
;
815 extern WXDLLIMPEXP_DATA_CORE(const wxPoint
) wxDefaultPosition
;
817 // ---------------------------------------------------------------------------
819 // ---------------------------------------------------------------------------
821 // resource management
822 extern void WXDLLIMPEXP_CORE
wxInitializeStockLists();
823 extern void WXDLLIMPEXP_CORE
wxDeleteStockLists();
825 // is the display colour (or monochrome)?
826 extern bool WXDLLIMPEXP_CORE
wxColourDisplay();
828 // Returns depth of screen
829 extern int WXDLLIMPEXP_CORE
wxDisplayDepth();
830 #define wxGetDisplayDepth wxDisplayDepth
832 // get the display size
833 extern void WXDLLIMPEXP_CORE
wxDisplaySize(int *width
, int *height
);
834 extern wxSize WXDLLIMPEXP_CORE
wxGetDisplaySize();
835 extern void WXDLLIMPEXP_CORE
wxDisplaySizeMM(int *width
, int *height
);
836 extern wxSize WXDLLIMPEXP_CORE
wxGetDisplaySizeMM();
837 extern wxSize WXDLLIMPEXP_CORE
wxGetDisplayPPI();
839 // Get position and size of the display workarea
840 extern void WXDLLIMPEXP_CORE
wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
);
841 extern wxRect WXDLLIMPEXP_CORE
wxGetClientDisplayRect();
844 extern void WXDLLIMPEXP_CORE
wxSetCursor(const wxCursor
& cursor
);