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
132 // Not yet implemented for Windows
133 wxCURSOR_CROSS_REVERSE
,
134 wxCURSOR_DOUBLE_ARROW
,
135 wxCURSOR_BASED_ARROW_UP
,
136 wxCURSOR_BASED_ARROW_DOWN
,
141 wxCURSOR_CLOSED_HAND
,
148 #define wxCURSOR_DEFAULT wxCURSOR_ARROW
152 // TODO CS supply openhand and closedhand cursors
153 #define wxCURSOR_OPEN_HAND wxCURSOR_HAND
154 #define wxCURSOR_CLOSED_HAND wxCURSOR_HAND
157 // ---------------------------------------------------------------------------
159 // ---------------------------------------------------------------------------
161 /* Useful macro for creating icons portably, for example:
163 wxIcon *icon = new wxICON(mondrian);
167 wxIcon *icon = new wxIcon("mondrian"); // On wxMSW
168 wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK
172 // Load from a resource
173 #define wxICON(X) wxIcon(wxT(#X))
174 #elif defined(__WXPM__)
175 // Load from a resource
176 #define wxICON(X) wxIcon(wxT(#X))
177 #elif defined(__WXMGL__)
178 // Initialize from an included XPM
179 #define wxICON(X) wxIcon( X##_xpm )
180 #elif defined(__WXDFB__)
181 // Initialize from an included XPM
182 #define wxICON(X) wxIcon( X##_xpm )
183 #elif defined(__WXGTK__)
184 // Initialize from an included XPM
185 #define wxICON(X) wxIcon( X##_xpm )
186 #elif defined(__WXMAC__)
187 // Initialize from an included XPM
188 #define wxICON(X) wxIcon( X##_xpm )
189 #elif defined(__WXMOTIF__)
190 // Initialize from an included XPM
191 #define wxICON(X) wxIcon( X##_xpm )
192 #elif defined(__WXX11__)
193 // Initialize from an included XPM
194 #define wxICON(X) wxIcon( X##_xpm )
196 // This will usually mean something on any platform
197 #define wxICON(X) wxIcon(wxT(#X))
200 /* Another macro: this one is for portable creation of bitmaps. We assume that
201 under Unix bitmaps live in XPMs and under Windows they're in ressources.
204 #if defined(__WXMSW__) || defined(__WXPM__)
205 #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
206 #elif defined(__WXGTK__) || \
207 defined(__WXMOTIF__) || \
208 defined(__WXX11__) || \
209 defined(__WXMAC__) || \
210 defined(__WXMGL__) || \
211 defined(__WXDFB__) || \
213 // Initialize from an included XPM
214 #define wxBITMAP(name) wxBitmap(name##_xpm)
215 #else // other platforms
216 #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
219 // ===========================================================================
221 // ===========================================================================
223 // ---------------------------------------------------------------------------
225 // ---------------------------------------------------------------------------
227 class WXDLLIMPEXP_CORE wxSize
230 // members are public for compatibility, don't use them directly.
234 wxSize() : x(0), y(0) { }
235 wxSize(int xx
, int yy
) : x(xx
), y(yy
) { }
237 // no copy ctor or assignment operator - the defaults are ok
239 wxSize
& operator+=(const wxSize
& sz
) { x
+= sz
.x
; y
+= sz
.y
; return *this; }
240 wxSize
& operator-=(const wxSize
& sz
) { x
-= sz
.x
; y
-= sz
.y
; return *this; }
241 wxSize
& operator/=(int i
) { x
/= i
; y
/= i
; return *this; }
242 wxSize
& operator*=(int i
) { x
*= i
; y
*= i
; return *this; }
244 void IncTo(const wxSize
& sz
)
245 { if ( sz
.x
> x
) x
= sz
.x
; if ( sz
.y
> y
) y
= sz
.y
; }
246 void DecTo(const wxSize
& sz
)
247 { if ( sz
.x
< x
) x
= sz
.x
; if ( sz
.y
< y
) y
= sz
.y
; }
249 void IncBy(int dx
, int dy
) { x
+= dx
; y
+= dy
; }
250 void IncBy(const wxSize
& sz
) { IncBy(sz
.x
, sz
.y
); }
251 void IncBy(int d
) { IncBy(d
, d
); }
253 void DecBy(int dx
, int dy
) { IncBy(-dx
, -dy
); }
254 void DecBy(const wxSize
& sz
) { DecBy(sz
.x
, sz
.y
); }
255 void DecBy(int d
) { DecBy(d
, d
); }
258 wxSize
& Scale(float xscale
, float yscale
)
259 { x
= (int)(x
*xscale
); y
= (int)(y
*yscale
); return *this; }
262 void Set(int xx
, int yy
) { x
= xx
; y
= yy
; }
263 void SetWidth(int w
) { x
= w
; }
264 void SetHeight(int h
) { y
= h
; }
266 int GetWidth() const { return x
; }
267 int GetHeight() const { return y
; }
269 bool IsFullySpecified() const { return x
!= wxDefaultCoord
&& y
!= wxDefaultCoord
; }
271 // combine this size with the other one replacing the default (i.e. equal
272 // to wxDefaultCoord) components of this object with those of the other
273 void SetDefaults(const wxSize
& size
)
275 if ( x
== wxDefaultCoord
)
277 if ( y
== wxDefaultCoord
)
282 int GetX() const { return x
; }
283 int GetY() const { return y
; }
287 inline bool operator==(const wxSize
& s1
, const wxSize
& s2
)
289 return s1
.x
== s2
.x
&& s1
.y
== s2
.y
;
292 inline bool operator!=(const wxSize
& s1
, const wxSize
& s2
)
294 return s1
.x
!= s2
.x
|| s1
.y
!= s2
.y
;
298 inline wxSize
operator+(const wxSize
& s1
, const wxSize
& s2
)
300 return wxSize(s1
.x
+ s2
.x
, s1
.y
+ s2
.y
);
304 inline wxSize
operator-(const wxSize
& s1
, const wxSize
& s2
)
306 return wxSize(s1
.x
- s2
.x
, s1
.y
- s2
.y
);
310 inline wxSize
operator/(const wxSize
& s
, int i
)
312 return wxSize(s
.x
/ i
, s
.y
/ i
);
316 inline wxSize
operator*(const wxSize
& s
, int i
)
318 return wxSize(s
.x
* i
, s
.y
* i
);
322 inline wxSize
operator*(int i
, const wxSize
& s
)
324 return wxSize(s
.x
* i
, s
.y
* i
);
330 // ---------------------------------------------------------------------------
331 // Point classes: with real or integer coordinates
332 // ---------------------------------------------------------------------------
334 class WXDLLIMPEXP_CORE wxRealPoint
340 wxRealPoint() : x(0.0), y(0.0) { }
341 wxRealPoint(double xx
, double yy
) : x(xx
), y(yy
) { }
345 inline bool operator==(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
347 return wxIsSameDouble(p1
.x
, p2
.x
) && wxIsSameDouble(p1
.y
, p2
.y
);
351 inline bool operator!=(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
357 inline wxRealPoint
operator+(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
359 return wxRealPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
363 inline wxRealPoint
operator-(const wxRealPoint
& p1
, const wxRealPoint
& p2
)
365 return wxRealPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
369 // ----------------------------------------------------------------------------
370 // wxPoint: 2D point with integer coordinates
371 // ----------------------------------------------------------------------------
373 class WXDLLIMPEXP_CORE wxPoint
378 wxPoint() : x(0), y(0) { }
379 wxPoint(int xx
, int yy
) : x(xx
), y(yy
) { }
381 // no copy ctor or assignment operator - the defaults are ok
383 //assignment operators
384 wxPoint
& operator+=(const wxPoint
& p
) { x
+= p
.x
; y
+= p
.y
; return *this; }
385 wxPoint
& operator-=(const wxPoint
& p
) { x
-= p
.x
; y
-= p
.y
; return *this; }
387 wxPoint
& operator+=(const wxSize
& s
) { x
+= s
.GetWidth(); y
+= s
.GetHeight(); return *this; }
388 wxPoint
& operator-=(const wxSize
& s
) { x
-= s
.GetWidth(); y
-= s
.GetHeight(); return *this; }
393 inline bool operator==(const wxPoint
& p1
, const wxPoint
& p2
)
395 return p1
.x
== p2
.x
&& p1
.y
== p2
.y
;
398 inline bool operator!=(const wxPoint
& p1
, const wxPoint
& p2
)
404 // arithmetic operations (component wise)
405 inline wxPoint
operator+(const wxPoint
& p1
, const wxPoint
& p2
)
407 return wxPoint(p1
.x
+ p2
.x
, p1
.y
+ p2
.y
);
410 inline wxPoint
operator-(const wxPoint
& p1
, const wxPoint
& p2
)
412 return wxPoint(p1
.x
- p2
.x
, p1
.y
- p2
.y
);
415 inline wxPoint
operator+(const wxPoint
& p
, const wxSize
& s
)
417 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
420 inline wxPoint
operator-(const wxPoint
& p
, const wxSize
& s
)
422 return wxPoint(p
.x
- s
.x
, p
.y
- s
.y
);
425 inline wxPoint
operator+(const wxSize
& s
, const wxPoint
& p
)
427 return wxPoint(p
.x
+ s
.x
, p
.y
+ s
.y
);
430 inline wxPoint
operator-(const wxSize
& s
, const wxPoint
& p
)
432 return wxPoint(s
.x
- p
.x
, s
.y
- p
.y
);
435 inline wxPoint
operator-(const wxPoint
& p
)
437 return wxPoint(-p
.x
, -p
.y
);
440 WX_DECLARE_LIST_WITH_DECL(wxPoint
, wxPointList
, class WXDLLIMPEXP_CORE
);
442 // ---------------------------------------------------------------------------
444 // ---------------------------------------------------------------------------
446 class WXDLLIMPEXP_CORE wxRect
450 : x(0), y(0), width(0), height(0)
452 wxRect(int xx
, int yy
, int ww
, int hh
)
453 : x(xx
), y(yy
), width(ww
), height(hh
)
455 wxRect(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
456 wxRect(const wxPoint
& pt
, const wxSize
& size
)
457 : x(pt
.x
), y(pt
.y
), width(size
.x
), height(size
.y
)
459 wxRect(const wxSize
& size
)
460 : x(0), y(0), width(size
.x
), height(size
.y
)
463 // default copy ctor and assignment operators ok
465 int GetX() const { return x
; }
466 void SetX(int xx
) { x
= xx
; }
468 int GetY() const { return y
; }
469 void SetY(int yy
) { y
= yy
; }
471 int GetWidth() const { return width
; }
472 void SetWidth(int w
) { width
= w
; }
474 int GetHeight() const { return height
; }
475 void SetHeight(int h
) { height
= h
; }
477 wxPoint
GetPosition() const { return wxPoint(x
, y
); }
478 void SetPosition( const wxPoint
&p
) { x
= p
.x
; y
= p
.y
; }
480 wxSize
GetSize() const { return wxSize(width
, height
); }
481 void SetSize( const wxSize
&s
) { width
= s
.GetWidth(); height
= s
.GetHeight(); }
483 bool IsEmpty() const { return (width
<= 0) || (height
<= 0); }
485 int GetLeft() const { return x
; }
486 int GetTop() const { return y
; }
487 int GetBottom() const { return y
+ height
- 1; }
488 int GetRight() const { return x
+ width
- 1; }
490 void SetLeft(int left
) { x
= left
; }
491 void SetRight(int right
) { width
= right
- x
+ 1; }
492 void SetTop(int top
) { y
= top
; }
493 void SetBottom(int bottom
) { height
= bottom
- y
+ 1; }
495 wxPoint
GetTopLeft() const { return GetPosition(); }
496 wxPoint
GetLeftTop() const { return GetTopLeft(); }
497 void SetTopLeft(const wxPoint
&p
) { SetPosition(p
); }
498 void SetLeftTop(const wxPoint
&p
) { SetTopLeft(p
); }
500 wxPoint
GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
501 wxPoint
GetRightBottom() const { return GetBottomRight(); }
502 void SetBottomRight(const wxPoint
&p
) { SetRight(p
.x
); SetBottom(p
.y
); }
503 void SetRightBottom(const wxPoint
&p
) { SetBottomRight(p
); }
505 wxPoint
GetTopRight() const { return wxPoint(GetRight(), GetTop()); }
506 wxPoint
GetRightTop() const { return GetTopRight(); }
507 void SetTopRight(const wxPoint
&p
) { SetRight(p
.x
); SetTop(p
.y
); }
508 void SetRightTop(const wxPoint
&p
) { SetTopLeft(p
); }
510 wxPoint
GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); }
511 wxPoint
GetLeftBottom() const { return GetBottomLeft(); }
512 void SetBottomLeft(const wxPoint
&p
) { SetLeft(p
.x
); SetBottom(p
.y
); }
513 void SetLeftBottom(const wxPoint
&p
) { SetBottomLeft(p
); }
515 // operations with rect
516 wxRect
& Inflate(wxCoord dx
, wxCoord dy
);
517 wxRect
& Inflate(const wxSize
& d
) { return Inflate(d
.x
, d
.y
); }
518 wxRect
& Inflate(wxCoord d
) { return Inflate(d
, d
); }
519 wxRect
Inflate(wxCoord dx
, wxCoord dy
) const
526 wxRect
& Deflate(wxCoord dx
, wxCoord dy
) { return Inflate(-dx
, -dy
); }
527 wxRect
& Deflate(const wxSize
& d
) { return Inflate(-d
.x
, -d
.y
); }
528 wxRect
& Deflate(wxCoord d
) { return Inflate(-d
); }
529 wxRect
Deflate(wxCoord dx
, wxCoord dy
) const
536 void Offset(wxCoord dx
, wxCoord dy
) { x
+= dx
; y
+= dy
; }
537 void Offset(const wxPoint
& pt
) { Offset(pt
.x
, pt
.y
); }
539 wxRect
& Intersect(const wxRect
& rect
);
540 wxRect
Intersect(const wxRect
& rect
) const
547 wxRect
& Union(const wxRect
& rect
);
548 wxRect
Union(const wxRect
& rect
) const
555 // return true if the point is (not strcitly) inside the rect
556 bool Contains(int x
, int y
) const;
557 bool Contains(const wxPoint
& pt
) const { return Contains(pt
.x
, pt
.y
); }
558 // return true if the rectangle 'rect' is (not strictly) inside this rect
559 bool Contains(const wxRect
& rect
) const;
561 #if WXWIN_COMPATIBILITY_2_6
562 // use Contains() instead
563 wxDEPRECATED( bool Inside(int x
, int y
) const );
564 wxDEPRECATED( bool Inside(const wxPoint
& pt
) const );
565 wxDEPRECATED( bool Inside(const wxRect
& rect
) const );
566 #endif // WXWIN_COMPATIBILITY_2_6
568 // return true if the rectangles have a non empty intersection
569 bool Intersects(const wxRect
& rect
) const;
571 // like Union() but don't ignore empty rectangles
572 wxRect
& operator+=(const wxRect
& rect
);
574 // intersections of two rectrangles not testing for empty rectangles
575 wxRect
& operator*=(const wxRect
& rect
);
577 // centre this rectangle in the given (usually, but not necessarily,
579 wxRect
CentreIn(const wxRect
& r
, int dir
= wxBOTH
) const
581 return wxRect(dir
& wxHORIZONTAL
? r
.x
+ (r
.width
- width
)/2 : x
,
582 dir
& wxVERTICAL
? r
.y
+ (r
.height
- height
)/2 : y
,
586 wxRect
CenterIn(const wxRect
& r
, int dir
= wxBOTH
) const
588 return CentreIn(r
, dir
);
592 int x
, y
, width
, height
;
596 // compare rectangles
597 inline bool operator==(const wxRect
& r1
, const wxRect
& r2
)
599 return (r1
.x
== r2
.x
) && (r1
.y
== r2
.y
) &&
600 (r1
.width
== r2
.width
) && (r1
.height
== r2
.height
);
603 inline bool operator!=(const wxRect
& r1
, const wxRect
& r2
)
608 // like Union() but don't treat empty rectangles specially
609 WXDLLIMPEXP_CORE wxRect
operator+(const wxRect
& r1
, const wxRect
& r2
);
611 // intersections of two rectangles
612 WXDLLIMPEXP_CORE wxRect
operator*(const wxRect
& r1
, const wxRect
& r2
);
617 #if WXWIN_COMPATIBILITY_2_6
618 inline bool wxRect::Inside(int cx
, int cy
) const { return Contains(cx
, cy
); }
619 inline bool wxRect::Inside(const wxPoint
& pt
) const { return Contains(pt
); }
620 inline bool wxRect::Inside(const wxRect
& rect
) const { return Contains(rect
); }
621 #endif // WXWIN_COMPATIBILITY_2_6
624 // ---------------------------------------------------------------------------
625 // Management of pens, brushes and fonts
626 // ---------------------------------------------------------------------------
628 typedef wxInt8 wxDash
;
630 class WXDLLIMPEXP_CORE wxGDIObjListBase
{
639 WX_DECLARE_STRING_HASH_MAP(wxColour
*, wxStringToColourHashMap
);
641 class WXDLLIMPEXP_CORE wxColourDatabase
647 // find colour by name or name for the given colour
648 wxColour
Find(const wxString
& name
) const;
649 wxString
FindName(const wxColour
& colour
) const;
651 // add a new colour to the database
652 void AddColour(const wxString
& name
, const wxColour
& colour
);
654 #if WXWIN_COMPATIBILITY_2_6
655 // deprecated, use Find() instead
656 wxDEPRECATED( wxColour
*FindColour(const wxString
& name
) );
657 #endif // WXWIN_COMPATIBILITY_2_6
661 // PM keeps its own type of colour table
667 // load the database with the built in colour values when called for the
668 // first time, do nothing after this
671 wxStringToColourHashMap
*m_map
;
674 class WXDLLIMPEXP_CORE wxResourceCache
: public wxList
677 wxResourceCache() { }
679 wxResourceCache(const unsigned int keyType
) : wxList(keyType
) { }
681 virtual ~wxResourceCache();
684 // ---------------------------------------------------------------------------
686 // ---------------------------------------------------------------------------
691 wxStockGDI creates the stock GDI objects on demand. Pointers to the
692 created objects are stored in the ms_stockObject array, which is indexed
693 by the Item enum values. Platorm-specific fonts can be created by
694 implementing a derived class with an override for the GetFont function.
695 wxStockGDI operates as a singleton, accessed through the ms_instance
696 pointer. By default this pointer is set to an instance of wxStockGDI.
697 A derived class must arrange to set this pointer to an instance of itself.
699 class WXDLLIMPEXP_CORE wxStockGDI
741 virtual ~wxStockGDI();
742 static void DeleteAll();
744 static wxStockGDI
& instance() { return *ms_instance
; }
746 static const wxBrush
* GetBrush(Item item
);
747 static const wxColour
* GetColour(Item item
);
748 static const wxCursor
* GetCursor(Item item
);
749 // Can be overridden by platform-specific derived classes
750 virtual const wxFont
* GetFont(Item item
);
751 static const wxPen
* GetPen(Item item
);
754 static wxStockGDI
* ms_instance
;
756 static wxObject
* ms_stockObject
[ITEMCOUNT
];
758 DECLARE_NO_COPY_CLASS(wxStockGDI
)
761 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
762 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
763 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
764 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
766 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
767 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
768 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
769 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
770 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
771 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
772 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
773 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
774 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
775 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
777 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
778 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
779 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
780 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
781 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
782 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
783 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
784 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
785 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
786 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
788 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
789 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
790 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
791 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
792 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
793 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
794 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
796 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
797 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
798 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
801 extern WXDLLIMPEXP_DATA_CORE(wxBitmap
) wxNullBitmap
;
802 extern WXDLLIMPEXP_DATA_CORE(wxIcon
) wxNullIcon
;
803 extern WXDLLIMPEXP_DATA_CORE(wxCursor
) wxNullCursor
;
804 extern WXDLLIMPEXP_DATA_CORE(wxPen
) wxNullPen
;
805 extern WXDLLIMPEXP_DATA_CORE(wxBrush
) wxNullBrush
;
806 extern WXDLLIMPEXP_DATA_CORE(wxPalette
) wxNullPalette
;
807 extern WXDLLIMPEXP_DATA_CORE(wxFont
) wxNullFont
;
808 extern WXDLLIMPEXP_DATA_CORE(wxColour
) wxNullColour
;
809 extern WXDLLIMPEXP_DATA_CORE(wxIconBundle
) wxNullIconBundle
;
811 extern WXDLLIMPEXP_DATA_CORE(wxColourDatabase
*) wxTheColourDatabase
;
813 extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr
[];
815 extern WXDLLIMPEXP_DATA_CORE(const wxSize
) wxDefaultSize
;
816 extern WXDLLIMPEXP_DATA_CORE(const wxPoint
) wxDefaultPosition
;
818 // ---------------------------------------------------------------------------
820 // ---------------------------------------------------------------------------
822 // resource management
823 extern void WXDLLIMPEXP_CORE
wxInitializeStockLists();
824 extern void WXDLLIMPEXP_CORE
wxDeleteStockLists();
826 // is the display colour (or monochrome)?
827 extern bool WXDLLIMPEXP_CORE
wxColourDisplay();
829 // Returns depth of screen
830 extern int WXDLLIMPEXP_CORE
wxDisplayDepth();
831 #define wxGetDisplayDepth wxDisplayDepth
833 // get the display size
834 extern void WXDLLIMPEXP_CORE
wxDisplaySize(int *width
, int *height
);
835 extern wxSize WXDLLIMPEXP_CORE
wxGetDisplaySize();
836 extern void WXDLLIMPEXP_CORE
wxDisplaySizeMM(int *width
, int *height
);
837 extern wxSize WXDLLIMPEXP_CORE
wxGetDisplaySizeMM();
838 extern wxSize WXDLLIMPEXP_CORE
wxGetDisplayPPI();
840 // Get position and size of the display workarea
841 extern void WXDLLIMPEXP_CORE
wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
);
842 extern wxRect WXDLLIMPEXP_CORE
wxGetClientDisplayRect();
845 extern void WXDLLIMPEXP_CORE
wxSetCursor(const wxCursor
& cursor
);