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_CORE wxBitmap
;
31 class WXDLLIMPEXP_CORE wxBrush
;
32 class WXDLLIMPEXP_CORE wxColour
;
33 class WXDLLIMPEXP_CORE wxCursor
;
34 class WXDLLIMPEXP_CORE wxFont
;
35 class WXDLLIMPEXP_CORE wxIcon
;
36 class WXDLLIMPEXP_CORE wxPalette
;
37 class WXDLLIMPEXP_CORE wxPen
;
38 class WXDLLIMPEXP_CORE wxRegion
;
39 class WXDLLIMPEXP_BASE wxString
;
41 // ---------------------------------------------------------------------------
43 // ---------------------------------------------------------------------------
48 wxBITMAP_TYPE_INVALID
, // should be == 0 for compatibility!
50 wxBITMAP_TYPE_BMP_RESOURCE
,
51 wxBITMAP_TYPE_RESOURCE
= wxBITMAP_TYPE_BMP_RESOURCE
,
53 wxBITMAP_TYPE_ICO_RESOURCE
,
55 wxBITMAP_TYPE_CUR_RESOURCE
,
57 wxBITMAP_TYPE_XBM_DATA
,
59 wxBITMAP_TYPE_XPM_DATA
,
61 wxBITMAP_TYPE_TIF_RESOURCE
,
63 wxBITMAP_TYPE_GIF_RESOURCE
,
65 wxBITMAP_TYPE_PNG_RESOURCE
,
67 wxBITMAP_TYPE_JPEG_RESOURCE
,
69 wxBITMAP_TYPE_PNM_RESOURCE
,
71 wxBITMAP_TYPE_PCX_RESOURCE
,
73 wxBITMAP_TYPE_PICT_RESOURCE
,
75 wxBITMAP_TYPE_ICON_RESOURCE
,
79 wxBITMAP_TYPE_MACCURSOR
,
80 wxBITMAP_TYPE_MACCURSOR_RESOURCE
,
81 wxBITMAP_TYPE_ANY
= 50
87 wxCURSOR_NONE
, // should be 0
97 wxCURSOR_MIDDLE_BUTTON
,
102 wxCURSOR_POINT_RIGHT
,
103 wxCURSOR_QUESTION_ARROW
,
104 wxCURSOR_RIGHT_BUTTON
,
115 wxCURSOR_DEFAULT
, // standard X11 cursor
118 wxCURSOR_COPY_ARROW
, // MacOS Theme Plus arrow
121 // Not yet implemented for Windows
122 wxCURSOR_CROSS_REVERSE
,
123 wxCURSOR_DOUBLE_ARROW
,
124 wxCURSOR_BASED_ARROW_UP
,
125 wxCURSOR_BASED_ARROW_DOWN
,
134 #define wxCURSOR_DEFAULT wxCURSOR_ARROW
137 // ---------------------------------------------------------------------------
139 // ---------------------------------------------------------------------------
141 /* Useful macro for creating icons portably, for example:
143 wxIcon *icon = new wxICON(mondrian);
147 wxIcon *icon = new wxIcon("mondrian"); // On wxMSW
148 wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK
152 // Load from a resource
153 #define wxICON(X) wxIcon(wxT(#X))
154 #elif defined(__WXPM__)
155 // Load from a resource
156 #define wxICON(X) wxIcon(wxT(#X))
157 #elif defined(__WXMGL__)
158 // Initialize from an included XPM
159 #define wxICON(X) wxIcon( (const char**) X##_xpm )
160 #elif defined(__WXGTK__)
161 // Initialize from an included XPM
162 #define wxICON(X) wxIcon( (const char**) X##_xpm )
163 #elif defined(__WXMAC__)
164 // Initialize from an included XPM
165 #define wxICON(X) wxIcon( (const char**) X##_xpm )
166 #elif defined(__WXMOTIF__)
167 // Initialize from an included XPM
168 #define wxICON(X) wxIcon( X##_xpm )
169 #elif defined(__WXX11__)
170 // Initialize from an included XPM
171 #define wxICON(X) wxIcon( X##_xpm )
173 // This will usually mean something on any platform
174 #define wxICON(X) wxIcon(wxT(#X))
177 /* Another macro: this one is for portable creation of bitmaps. We assume that
178 under Unix bitmaps live in XPMs and under Windows they're in ressources.
181 #if defined(__WXMSW__) || defined(__WXPM__)
182 #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
183 #elif defined(__WXGTK__) || \
184 defined(__WXMOTIF__) || \
185 defined(__WXX11__) || \
186 defined(__WXMAC__) || \
187 defined(__WXMGL__) || \
189 // Initialize from an included XPM
190 #define wxBITMAP(name) wxBitmap( (const char**) name##_xpm )
191 #else // other platforms
192 #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
195 // ===========================================================================
197 // ===========================================================================
199 // ---------------------------------------------------------------------------
201 // ---------------------------------------------------------------------------
203 class WXDLLEXPORT wxSize
206 // members are public for compatibility, don't use them directly.
210 wxSize() : x(0), y(0) { }
211 wxSize(int xx
, int yy
) : x(xx
), y(yy
) { }
213 // no copy ctor or assignment operator - the defaults are ok
215 bool operator==(const wxSize
& sz
) const { return x
== sz
.x
&& y
== sz
.y
; }
216 bool operator!=(const wxSize
& sz
) const { return x
!= sz
.x
|| y
!= sz
.y
; }
218 wxSize
operator+(const wxSize
& sz
) const { return wxSize(x
+ sz
.x
, y
+ sz
.y
); }
219 wxSize
operator-(const wxSize
& sz
) const { return wxSize(x
- sz
.x
, y
- sz
.y
); }
220 wxSize
operator/(int i
) const { return wxSize(x
/ i
, y
/ i
); }
221 wxSize
operator*(int i
) const { return wxSize(x
* i
, y
* i
); }
223 wxSize
& operator+=(const wxSize
& sz
) { x
+= sz
.x
; y
+= sz
.y
; return *this; }
224 wxSize
& operator-=(const wxSize
& sz
) { x
-= sz
.x
; y
-= sz
.y
; return *this; }
225 wxSize
& operator/=(const int i
) { x
/= i
; y
/= i
; return *this; }
226 wxSize
& operator*=(const int i
) { x
*= i
; y
*= i
; return *this; }
228 void IncTo(const wxSize
& sz
)
229 { if ( sz
.x
> x
) x
= sz
.x
; if ( sz
.y
> y
) y
= sz
.y
; }
230 void DecTo(const wxSize
& sz
)
231 { if ( sz
.x
< x
) x
= sz
.x
; if ( sz
.y
< y
) y
= sz
.y
; }
233 void IncBy(int dx
, int dy
) { x
+= dx
; y
+= dy
; }
234 void IncBy(const wxSize
& sz
) { IncBy(sz
.x
, sz
.y
); }
235 void IncBy(int d
) { IncBy(d
, d
); }
237 void DecBy(int dx
, int dy
) { IncBy(-dx
, -dy
); }
238 void DecBy(const wxSize
& sz
) { DecBy(sz
.x
, sz
.y
); }
239 void DecBy(int d
) { DecBy(d
, d
); }
242 wxSize
& Scale(float xscale
, float yscale
)
243 { x
= (int)(x
*xscale
); y
= (int)(y
*yscale
); return *this; }
246 void Set(int xx
, int yy
) { x
= xx
; y
= yy
; }
247 void SetWidth(int w
) { x
= w
; }
248 void SetHeight(int h
) { y
= h
; }
250 int GetWidth() const { return x
; }
251 int GetHeight() const { return y
; }
253 bool IsFullySpecified() const { return x
!= wxDefaultCoord
&& y
!= wxDefaultCoord
; }
255 // combine this size with the other one replacing the default (i.e. equal
256 // to wxDefaultCoord) components of this object with those of the other
257 void SetDefaults(const wxSize
& size
)
259 if ( x
== wxDefaultCoord
)
261 if ( y
== wxDefaultCoord
)
266 int GetX() const { return x
; }
267 int GetY() const { return y
; }
270 // ---------------------------------------------------------------------------
271 // Point classes: with real or integer coordinates
272 // ---------------------------------------------------------------------------
274 class WXDLLEXPORT wxRealPoint
280 wxRealPoint() : x(0.0), y(0.0) { }
281 wxRealPoint(double xx
, double yy
) : x(xx
), y(yy
) { }
283 wxRealPoint
operator+(const wxRealPoint
& pt
) const { return wxRealPoint(x
+ pt
.x
, y
+ pt
.y
); }
284 wxRealPoint
operator-(const wxRealPoint
& pt
) const { return wxRealPoint(x
- pt
.x
, y
- pt
.y
); }
286 bool operator==(const wxRealPoint
& pt
) const
288 return wxIsSameDouble(x
, pt
.x
) && wxIsSameDouble(y
, pt
.y
);
290 bool operator!=(const wxRealPoint
& pt
) const { return !(*this == pt
); }
294 class WXDLLEXPORT wxPoint
299 wxPoint() : x(0), y(0) { }
300 wxPoint(int xx
, int yy
) : x(xx
), y(yy
) { }
302 // no copy ctor or assignment operator - the defaults are ok
305 bool operator==(const wxPoint
& p
) const { return x
== p
.x
&& y
== p
.y
; }
306 bool operator!=(const wxPoint
& p
) const { return !(*this == p
); }
308 // arithmetic operations (component wise)
309 wxPoint
operator+(const wxPoint
& p
) const { return wxPoint(x
+ p
.x
, y
+ p
.y
); }
310 wxPoint
operator-(const wxPoint
& p
) const { return wxPoint(x
- p
.x
, y
- p
.y
); }
312 wxPoint
& operator+=(const wxPoint
& p
) { x
+= p
.x
; y
+= p
.y
; return *this; }
313 wxPoint
& operator-=(const wxPoint
& p
) { x
-= p
.x
; y
-= p
.y
; return *this; }
315 wxPoint
& operator+=(const wxSize
& s
) { x
+= s
.GetWidth(); y
+= s
.GetHeight(); return *this; }
316 wxPoint
& operator-=(const wxSize
& s
) { x
-= s
.GetWidth(); y
-= s
.GetHeight(); return *this; }
318 wxPoint
operator+(const wxSize
& s
) const { return wxPoint(x
+ s
.GetWidth(), y
+ s
.GetHeight()); }
319 wxPoint
operator-(const wxSize
& s
) const { return wxPoint(x
- s
.GetWidth(), y
- s
.GetHeight()); }
321 wxPoint
operator-() const { return wxPoint(-x
, -y
); }
324 // ---------------------------------------------------------------------------
326 // ---------------------------------------------------------------------------
328 class WXDLLEXPORT wxRect
332 : x(0), y(0), width(0), height(0)
334 wxRect(int xx
, int yy
, int ww
, int hh
)
335 : x(xx
), y(yy
), width(ww
), height(hh
)
337 wxRect(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
338 wxRect(const wxPoint
& pt
, const wxSize
& size
)
339 : x(pt
.x
), y(pt
.y
), width(size
.x
), height(size
.y
)
341 wxRect(const wxSize
& size
)
342 : x(0), y(0), width(size
.x
), height(size
.y
)
345 // default copy ctor and assignment operators ok
347 int GetX() const { return x
; }
348 void SetX(int xx
) { x
= xx
; }
350 int GetY() const { return y
; }
351 void SetY(int yy
) { y
= yy
; }
353 int GetWidth() const { return width
; }
354 void SetWidth(int w
) { width
= w
; }
356 int GetHeight() const { return height
; }
357 void SetHeight(int h
) { height
= h
; }
359 wxPoint
GetPosition() const { return wxPoint(x
, y
); }
360 void SetPosition( const wxPoint
&p
) { x
= p
.x
; y
= p
.y
; }
362 wxSize
GetSize() const { return wxSize(width
, height
); }
363 void SetSize( const wxSize
&s
) { width
= s
.GetWidth(); height
= s
.GetHeight(); }
365 bool IsEmpty() const { return (width
<= 0) || (height
<= 0); }
367 int GetLeft() const { return x
; }
368 int GetTop() const { return y
; }
369 int GetBottom() const { return y
+ height
- 1; }
370 int GetRight() const { return x
+ width
- 1; }
372 void SetLeft(int left
) { x
= left
; }
373 void SetRight(int right
) { width
= right
- x
+ 1; }
374 void SetTop(int top
) { y
= top
; }
375 void SetBottom(int bottom
) { height
= bottom
- y
+ 1; }
377 wxPoint
GetTopLeft() const { return GetPosition(); }
378 wxPoint
GetLeftTop() const { return GetTopLeft(); }
379 void SetTopLeft(const wxPoint
&p
) { SetPosition(p
); }
380 void SetLeftTop(const wxPoint
&p
) { SetTopLeft(p
); }
382 wxPoint
GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
383 wxPoint
GetRightBottom() const { return GetBottomRight(); }
384 void SetBottomRight(const wxPoint
&p
) { SetRight(p
.x
); SetBottom(p
.y
); }
385 void SetRightBottom(const wxPoint
&p
) { SetBottomRight(p
); }
387 wxPoint
GetTopRight() const { return wxPoint(GetRight(), GetTop()); }
388 wxPoint
GetRightTop() const { return GetTopRight(); }
389 void SetTopRight(const wxPoint
&p
) { SetRight(p
.x
); SetTop(p
.y
); }
390 void SetRightTop(const wxPoint
&p
) { SetTopLeft(p
); }
392 wxPoint
GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); }
393 wxPoint
GetLeftBottom() const { return GetBottomLeft(); }
394 void SetBottomLeft(const wxPoint
&p
) { SetLeft(p
.x
); SetBottom(p
.y
); }
395 void SetLeftBottom(const wxPoint
&p
) { SetBottomLeft(p
); }
397 // operations with rect
398 wxRect
& Inflate(wxCoord dx
, wxCoord dy
);
399 wxRect
& Inflate(const wxSize
& d
) { return Inflate(d
.x
, d
.y
); }
400 wxRect
& Inflate(wxCoord d
) { return Inflate(d
, d
); }
401 wxRect
Inflate(wxCoord dx
, wxCoord dy
) const
408 wxRect
& Deflate(wxCoord dx
, wxCoord dy
) { return Inflate(-dx
, -dy
); }
409 wxRect
& Deflate(const wxSize
& d
) { return Inflate(-d
.x
, -d
.y
); }
410 wxRect
& Deflate(wxCoord d
) { return Inflate(-d
); }
411 wxRect
Deflate(wxCoord dx
, wxCoord dy
) const
418 void Offset(wxCoord dx
, wxCoord dy
) { x
+= dx
; y
+= dy
; }
419 void Offset(const wxPoint
& pt
) { Offset(pt
.x
, pt
.y
); }
421 wxRect
& Intersect(const wxRect
& rect
);
422 wxRect
Intersect(const wxRect
& rect
) const
429 wxRect
& Union(const wxRect
& rect
);
430 wxRect
Union(const wxRect
& rect
) const
437 // compare rectangles
438 bool operator==(const wxRect
& rect
) const;
439 bool operator!=(const wxRect
& rect
) const { return !(*this == rect
); }
441 // return true if the point is (not strcitly) inside the rect
442 bool Contains(int x
, int y
) const;
443 bool Contains(const wxPoint
& pt
) const { return Contains(pt
.x
, pt
.y
); }
444 // return true if the rectangle is (not strcitly) inside the rect
445 bool Contains(const wxRect
& rect
) const;
447 #if WXWIN_COMPATIBILITY_2_6
448 // use Contains() instead
449 wxDEPRECATED( bool Inside(int x
, int y
) const );
450 wxDEPRECATED( bool Inside(const wxPoint
& pt
) const );
451 wxDEPRECATED( bool Inside(const wxRect
& rect
) const );
452 #endif // WXWIN_COMPATIBILITY_2_6
454 // return true if the rectangles have a non empty intersection
455 bool Intersects(const wxRect
& rect
) const;
458 // these are like Union() but don't ignore empty rectangles
459 wxRect
operator+(const wxRect
& rect
) const;
460 wxRect
& operator+=(const wxRect
& rect
)
462 *this = *this + rect
;
467 // centre this rectangle in the given (usually, but not necessarily,
469 wxRect
CentreIn(const wxRect
& r
, int dir
= wxBOTH
) const
471 return wxRect(dir
& wxHORIZONTAL
? r
.x
+ (r
.width
- width
)/2 : x
,
472 dir
& wxVERTICAL
? r
.y
+ (r
.height
- height
)/2 : y
,
476 wxRect
CenterIn(const wxRect
& r
, int dir
= wxBOTH
) const
478 return CentreIn(r
, dir
);
482 int x
, y
, width
, height
;
485 #if WXWIN_COMPATIBILITY_2_6
486 inline bool wxRect::Inside(int x
, int y
) const { return Contains(x
, y
); }
487 inline bool wxRect::Inside(const wxPoint
& pt
) const { return Contains(pt
); }
488 inline bool wxRect::Inside(const wxRect
& rect
) const { return Contains(rect
); }
489 #endif // WXWIN_COMPATIBILITY_2_6
492 // ---------------------------------------------------------------------------
493 // Management of pens, brushes and fonts
494 // ---------------------------------------------------------------------------
496 typedef wxInt8 wxDash
;
498 class WXDLLIMPEXP_CORE wxGDIObjListBase
{
507 class WXDLLIMPEXP_CORE wxPenList
: public wxGDIObjListBase
510 wxPen
*FindOrCreatePen(const wxColour
& colour
, int width
, int style
);
511 #if WXWIN_COMPATIBILITY_2_6
512 wxDEPRECATED( void AddPen(wxPen
*) );
513 wxDEPRECATED( void RemovePen(wxPen
*) );
517 class WXDLLIMPEXP_CORE wxBrushList
: public wxGDIObjListBase
520 wxBrush
*FindOrCreateBrush(const wxColour
& colour
, int style
= wxSOLID
);
521 #if WXWIN_COMPATIBILITY_2_6
522 wxDEPRECATED( void AddBrush(wxBrush
*) );
523 wxDEPRECATED( void RemoveBrush(wxBrush
*) );
527 class WXDLLIMPEXP_CORE wxFontList
: public wxGDIObjListBase
530 wxFont
*FindOrCreateFont(int pointSize
, int family
, int style
, int weight
,
531 bool underline
= false,
532 const wxString
& face
= wxEmptyString
,
533 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
534 #if WXWIN_COMPATIBILITY_2_6
535 wxDEPRECATED( void AddFont(wxFont
*) );
536 wxDEPRECATED( void RemoveFont(wxFont
*) );
540 WX_DECLARE_STRING_HASH_MAP(wxColour
*, wxStringToColourHashMap
);
542 class WXDLLEXPORT wxColourDatabase
548 // find colour by name or name for the given colour
549 wxColour
Find(const wxString
& name
) const;
550 wxString
FindName(const wxColour
& colour
) const;
552 // add a new colour to the database
553 void AddColour(const wxString
& name
, const wxColour
& colour
);
555 #if WXWIN_COMPATIBILITY_2_6
556 // deprecated, use Find() instead
557 wxDEPRECATED( wxColour
*FindColour(const wxString
& name
) );
558 #endif // WXWIN_COMPATIBILITY_2_6
562 // PM keeps its own type of colour table
568 // load the database with the built in colour values when called for the
569 // first time, do nothing after this
572 wxStringToColourHashMap
*m_map
;
575 class WXDLLEXPORT wxResourceCache
: public wxList
578 wxResourceCache() { }
580 wxResourceCache(const unsigned int keyType
) : wxList(keyType
) { }
582 virtual ~wxResourceCache();
585 // ---------------------------------------------------------------------------
587 // ---------------------------------------------------------------------------
589 // Lists of GDI objects
590 extern WXDLLEXPORT_DATA(wxPenList
*) wxThePenList
;
591 extern WXDLLEXPORT_DATA(wxBrushList
*) wxTheBrushList
;
592 extern WXDLLEXPORT_DATA(wxFontList
*) wxTheFontList
;
596 wxStockGDI creates the stock GDI objects on demand. Pointers to the
597 created objects are stored in the ms_stockObject array, which is indexed
598 by the Item enum values. Platorm-specific fonts can be created by
599 implementing a derived class with an override for the GetFont function.
600 wxStockGDI operates as a singleton, accessed through the ms_instance
601 pointer. By default this pointer is set to an instance of wxStockGDI.
602 A derived class must arrange to set this pointer to an instance of itself.
604 class WXDLLIMPEXP_CORE wxStockGDI
646 virtual ~wxStockGDI();
647 static void DeleteAll();
649 static wxStockGDI
& instance() { return *ms_instance
; }
651 static const wxBrush
* GetBrush(Item item
);
652 static const wxColour
* GetColour(Item item
);
653 static const wxCursor
* GetCursor(Item item
);
654 // Can be overridden by platform-specific derived classes
655 virtual const wxFont
* GetFont(Item item
);
656 static const wxPen
* GetPen(Item item
);
659 static wxStockGDI
* ms_instance
;
661 static wxObject
* ms_stockObject
[ITEMCOUNT
];
663 DECLARE_NO_COPY_CLASS(wxStockGDI
)
666 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
667 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
668 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
669 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
671 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
672 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
673 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
674 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
675 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
676 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
677 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
678 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
679 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
680 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
682 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
683 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
684 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
685 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
686 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
687 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
688 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
689 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
690 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
691 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
693 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
694 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
695 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
696 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
697 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
698 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
699 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
701 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
702 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
703 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
706 extern WXDLLEXPORT_DATA(wxBitmap
) wxNullBitmap
;
707 extern WXDLLEXPORT_DATA(wxIcon
) wxNullIcon
;
708 extern WXDLLEXPORT_DATA(wxCursor
) wxNullCursor
;
709 extern WXDLLEXPORT_DATA(wxPen
) wxNullPen
;
710 extern WXDLLEXPORT_DATA(wxBrush
) wxNullBrush
;
711 extern WXDLLEXPORT_DATA(wxPalette
) wxNullPalette
;
712 extern WXDLLEXPORT_DATA(wxFont
) wxNullFont
;
713 extern WXDLLEXPORT_DATA(wxColour
) wxNullColour
;
715 extern WXDLLEXPORT_DATA(wxColourDatabase
*) wxTheColourDatabase
;
717 extern WXDLLEXPORT_DATA(const wxChar
) wxPanelNameStr
[];
719 extern WXDLLEXPORT_DATA(const wxSize
) wxDefaultSize
;
720 extern WXDLLEXPORT_DATA(const wxPoint
) wxDefaultPosition
;
722 // ---------------------------------------------------------------------------
724 // ---------------------------------------------------------------------------
726 // resource management
727 extern void WXDLLEXPORT
wxInitializeStockLists();
728 extern void WXDLLEXPORT
wxDeleteStockLists();
730 // is the display colour (or monochrome)?
731 extern bool WXDLLEXPORT
wxColourDisplay();
733 // Returns depth of screen
734 extern int WXDLLEXPORT
wxDisplayDepth();
735 #define wxGetDisplayDepth wxDisplayDepth
737 // get the display size
738 extern void WXDLLEXPORT
wxDisplaySize(int *width
, int *height
);
739 extern wxSize WXDLLEXPORT
wxGetDisplaySize();
740 extern void WXDLLEXPORT
wxDisplaySizeMM(int *width
, int *height
);
741 extern wxSize WXDLLEXPORT
wxGetDisplaySizeMM();
743 // Get position and size of the display workarea
744 extern void WXDLLEXPORT
wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
);
745 extern wxRect WXDLLEXPORT
wxGetClientDisplayRect();
748 extern void WXDLLEXPORT
wxSetCursor(const wxCursor
& cursor
);