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
,
78 wxBITMAP_TYPE_MACCURSOR
,
79 wxBITMAP_TYPE_MACCURSOR_RESOURCE
,
80 wxBITMAP_TYPE_ANY
= 50
86 wxCURSOR_NONE
, // should be 0
96 wxCURSOR_MIDDLE_BUTTON
,
101 wxCURSOR_POINT_RIGHT
,
102 wxCURSOR_QUESTION_ARROW
,
103 wxCURSOR_RIGHT_BUTTON
,
114 wxCURSOR_DEFAULT
, // standard X11 cursor
117 wxCURSOR_COPY_ARROW
, // MacOS Theme Plus arrow
120 // Not yet implemented for Windows
121 wxCURSOR_CROSS_REVERSE
,
122 wxCURSOR_DOUBLE_ARROW
,
123 wxCURSOR_BASED_ARROW_UP
,
124 wxCURSOR_BASED_ARROW_DOWN
,
133 #define wxCURSOR_DEFAULT wxCURSOR_ARROW
136 // ---------------------------------------------------------------------------
138 // ---------------------------------------------------------------------------
140 /* Useful macro for creating icons portably, for example:
142 wxIcon *icon = new wxICON(mondrian);
146 wxIcon *icon = new wxIcon("mondrian"); // On wxMSW
147 wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK
151 // Load from a resource
152 #define wxICON(X) wxIcon(wxT(#X))
153 #elif defined(__WXPM__)
154 // Load from a resource
155 #define wxICON(X) wxIcon(wxT(#X))
156 #elif defined(__WXMGL__)
157 // Initialize from an included XPM
158 #define wxICON(X) wxIcon( (const char**) X##_xpm )
159 #elif defined(__WXGTK__)
160 // Initialize from an included XPM
161 #define wxICON(X) wxIcon( (const char**) X##_xpm )
162 #elif defined(__WXMAC__)
163 // Initialize from an included XPM
164 #define wxICON(X) wxIcon( (const char**) X##_xpm )
165 #elif defined(__WXMOTIF__)
166 // Initialize from an included XPM
167 #define wxICON(X) wxIcon( X##_xpm )
168 #elif defined(__WXX11__)
169 // Initialize from an included XPM
170 #define wxICON(X) wxIcon( X##_xpm )
172 // This will usually mean something on any platform
173 #define wxICON(X) wxIcon(wxT(#X))
176 /* Another macro: this one is for portable creation of bitmaps. We assume that
177 under Unix bitmaps live in XPMs and under Windows they're in ressources.
180 #if defined(__WXMSW__) || defined(__WXPM__)
181 #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
182 #elif defined(__WXGTK__) || \
183 defined(__WXMOTIF__) || \
184 defined(__WXX11__) || \
185 defined(__WXMAC__) || \
186 defined(__WXMGL__) || \
188 // Initialize from an included XPM
189 #define wxBITMAP(name) wxBitmap( (const char**) name##_xpm )
190 #else // other platforms
191 #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
194 // ===========================================================================
196 // ===========================================================================
198 // ---------------------------------------------------------------------------
200 // ---------------------------------------------------------------------------
202 class WXDLLEXPORT wxSize
205 // members are public for compatibility, don't use them directly.
209 wxSize() : x(0), y(0) { }
210 wxSize(int xx
, int yy
) : x(xx
), y(yy
) { }
212 // no copy ctor or assignment operator - the defaults are ok
214 bool operator==(const wxSize
& sz
) const { return x
== sz
.x
&& y
== sz
.y
; }
215 bool operator!=(const wxSize
& sz
) const { return x
!= sz
.x
|| y
!= sz
.y
; }
217 wxSize
operator+(const wxSize
& sz
) const { return wxSize(x
+ sz
.x
, y
+ sz
.y
); }
218 wxSize
operator-(const wxSize
& sz
) const { return wxSize(x
- sz
.x
, y
- sz
.y
); }
219 wxSize
operator/(int i
) const { return wxSize(x
/ i
, y
/ i
); }
220 wxSize
operator*(int i
) const { return wxSize(x
* i
, y
* i
); }
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/=(const int i
) { x
/= i
; y
/= i
; return *this; }
225 wxSize
& operator*=(const 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 void Scale(float xscale
, float yscale
)
242 { x
= (int)(x
*xscale
); y
= (int)(y
*yscale
); }
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
; }
269 // ---------------------------------------------------------------------------
270 // Point classes: with real or integer coordinates
271 // ---------------------------------------------------------------------------
273 class WXDLLEXPORT wxRealPoint
279 wxRealPoint() : x(0.0), y(0.0) { }
280 wxRealPoint(double xx
, double yy
) : x(xx
), y(yy
) { }
282 wxRealPoint
operator+(const wxRealPoint
& pt
) const { return wxRealPoint(x
+ pt
.x
, y
+ pt
.y
); }
283 wxRealPoint
operator-(const wxRealPoint
& pt
) const { return wxRealPoint(x
- pt
.x
, y
- pt
.y
); }
285 bool operator==(const wxRealPoint
& pt
) const
287 return wxIsSameDouble(x
, pt
.x
) && wxIsSameDouble(y
, pt
.y
);
289 bool operator!=(const wxRealPoint
& pt
) const { return !(*this == pt
); }
293 class WXDLLEXPORT wxPoint
298 wxPoint() : x(0), y(0) { }
299 wxPoint(int xx
, int yy
) : x(xx
), y(yy
) { }
301 // no copy ctor or assignment operator - the defaults are ok
304 bool operator==(const wxPoint
& p
) const { return x
== p
.x
&& y
== p
.y
; }
305 bool operator!=(const wxPoint
& p
) const { return !(*this == p
); }
307 // arithmetic operations (component wise)
308 wxPoint
operator+(const wxPoint
& p
) const { return wxPoint(x
+ p
.x
, y
+ p
.y
); }
309 wxPoint
operator-(const wxPoint
& p
) const { return wxPoint(x
- p
.x
, y
- p
.y
); }
311 wxPoint
& operator+=(const wxPoint
& p
) { x
+= p
.x
; y
+= p
.y
; return *this; }
312 wxPoint
& operator-=(const wxPoint
& p
) { x
-= p
.x
; y
-= p
.y
; return *this; }
314 wxPoint
& operator+=(const wxSize
& s
) { x
+= s
.GetWidth(); y
+= s
.GetHeight(); return *this; }
315 wxPoint
& operator-=(const wxSize
& s
) { x
-= s
.GetWidth(); y
-= s
.GetHeight(); return *this; }
317 wxPoint
operator+(const wxSize
& s
) const { return wxPoint(x
+ s
.GetWidth(), y
+ s
.GetHeight()); }
318 wxPoint
operator-(const wxSize
& s
) const { return wxPoint(x
- s
.GetWidth(), y
- s
.GetHeight()); }
320 wxPoint
operator-() const { return wxPoint(-x
, -y
); }
323 // ---------------------------------------------------------------------------
325 // ---------------------------------------------------------------------------
327 class WXDLLEXPORT wxRect
331 : x(0), y(0), width(0), height(0)
333 wxRect(int xx
, int yy
, int ww
, int hh
)
334 : x(xx
), y(yy
), width(ww
), height(hh
)
336 wxRect(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
337 wxRect(const wxPoint
& pt
, const wxSize
& size
)
338 : x(pt
.x
), y(pt
.y
), width(size
.x
), height(size
.y
)
340 wxRect(const wxSize
& size
)
341 : x(0), y(0), width(size
.x
), height(size
.y
)
344 // default copy ctor and assignment operators ok
346 int GetX() const { return x
; }
347 void SetX(int xx
) { x
= xx
; }
349 int GetY() const { return y
; }
350 void SetY(int yy
) { y
= yy
; }
352 int GetWidth() const { return width
; }
353 void SetWidth(int w
) { width
= w
; }
355 int GetHeight() const { return height
; }
356 void SetHeight(int h
) { height
= h
; }
358 wxPoint
GetPosition() const { return wxPoint(x
, y
); }
359 void SetPosition( const wxPoint
&p
) { x
= p
.x
; y
= p
.y
; }
361 wxSize
GetSize() const { return wxSize(width
, height
); }
362 void SetSize( const wxSize
&s
) { width
= s
.GetWidth(); height
= s
.GetHeight(); }
364 bool IsEmpty() const { return (width
<= 0) || (height
<= 0); }
366 int GetLeft() const { return x
; }
367 int GetTop() const { return y
; }
368 int GetBottom() const { return y
+ height
- 1; }
369 int GetRight() const { return x
+ width
- 1; }
371 void SetLeft(int left
) { x
= left
; }
372 void SetRight(int right
) { width
= right
- x
+ 1; }
373 void SetTop(int top
) { y
= top
; }
374 void SetBottom(int bottom
) { height
= bottom
- y
+ 1; }
376 wxPoint
GetTopLeft() const { return GetPosition(); }
377 wxPoint
GetLeftTop() const { return GetTopLeft(); }
378 void SetTopLeft(const wxPoint
&p
) { SetPosition(p
); }
379 void SetLeftTop(const wxPoint
&p
) { SetTopLeft(p
); }
381 wxPoint
GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
382 wxPoint
GetRightBottom() const { return GetBottomRight(); }
383 void SetBottomRight(const wxPoint
&p
) { SetRight(p
.x
); SetBottom(p
.y
); }
384 void SetRightBottom(const wxPoint
&p
) { SetBottomRight(p
); }
386 wxPoint
GetTopRight() const { return wxPoint(GetRight(), GetTop()); }
387 wxPoint
GetRightTop() const { return GetTopRight(); }
388 void SetTopRight(const wxPoint
&p
) { SetRight(p
.x
); SetTop(p
.y
); }
389 void SetRightTop(const wxPoint
&p
) { SetTopLeft(p
); }
391 wxPoint
GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); }
392 wxPoint
GetLeftBottom() const { return GetBottomLeft(); }
393 void SetBottomLeft(const wxPoint
&p
) { SetLeft(p
.x
); SetBottom(p
.y
); }
394 void SetLeftBottom(const wxPoint
&p
) { SetBottomLeft(p
); }
396 // operations with rect
397 wxRect
& Inflate(wxCoord dx
, wxCoord dy
);
398 wxRect
& Inflate(const wxSize
& d
) { return Inflate(d
.x
, d
.y
); }
399 wxRect
& Inflate(wxCoord d
) { return Inflate(d
, d
); }
400 wxRect
Inflate(wxCoord dx
, wxCoord dy
) const
407 wxRect
& Deflate(wxCoord dx
, wxCoord dy
) { return Inflate(-dx
, -dy
); }
408 wxRect
& Deflate(const wxSize
& d
) { return Inflate(-d
.x
, -d
.y
); }
409 wxRect
& Deflate(wxCoord d
) { return Inflate(-d
); }
410 wxRect
Deflate(wxCoord dx
, wxCoord dy
) const
417 void Offset(wxCoord dx
, wxCoord dy
) { x
+= dx
; y
+= dy
; }
418 void Offset(const wxPoint
& pt
) { Offset(pt
.x
, pt
.y
); }
420 wxRect
& Intersect(const wxRect
& rect
);
421 wxRect
Intersect(const wxRect
& rect
) const
428 wxRect
& Union(const wxRect
& rect
);
429 wxRect
Union(const wxRect
& rect
) const
436 // compare rectangles
437 bool operator==(const wxRect
& rect
) const;
438 bool operator!=(const wxRect
& rect
) const { return !(*this == rect
); }
440 // return true if the point is (not strcitly) inside the rect
441 bool Contains(int x
, int y
) const;
442 bool Contains(const wxPoint
& pt
) const { return Contains(pt
.x
, pt
.y
); }
443 // return true if the rectangle is (not strcitly) inside the rect
444 bool Contains(const wxRect
& rect
) const;
446 #if WXWIN_COMPATIBILITY_2_6
447 // use Contains() instead
448 wxDEPRECATED( bool Inside(int x
, int y
) const );
449 wxDEPRECATED( bool Inside(const wxPoint
& pt
) const );
450 wxDEPRECATED( bool Inside(const wxRect
& rect
) const );
451 #endif // WXWIN_COMPATIBILITY_2_6
453 // return true if the rectangles have a non empty intersection
454 bool Intersects(const wxRect
& rect
) const;
457 // these are like Union() but don't ignore empty rectangles
458 wxRect
operator+(const wxRect
& rect
) const;
459 wxRect
& operator+=(const wxRect
& rect
)
461 *this = *this + rect
;
466 // centre this rectangle in the given (usually, but not necessarily,
468 wxRect
CentreIn(const wxRect
& r
, int dir
= wxBOTH
) const
470 return wxRect(dir
& wxHORIZONTAL
? r
.x
+ (r
.width
- width
)/2 : x
,
471 dir
& wxVERTICAL
? r
.y
+ (r
.height
- height
)/2 : y
,
475 wxRect
CenterIn(const wxRect
& r
, int dir
= wxBOTH
) const
477 return CentreIn(r
, dir
);
481 int x
, y
, width
, height
;
484 #if WXWIN_COMPATIBILITY_2_6
485 inline bool wxRect::Inside(int x
, int y
) const { return Contains(x
, y
); }
486 inline bool wxRect::Inside(const wxPoint
& pt
) const { return Contains(pt
); }
487 inline bool wxRect::Inside(const wxRect
& rect
) const { return Contains(rect
); }
488 #endif // WXWIN_COMPATIBILITY_2_6
491 // ---------------------------------------------------------------------------
492 // Management of pens, brushes and fonts
493 // ---------------------------------------------------------------------------
495 typedef wxInt8 wxDash
;
497 class WXDLLIMPEXP_CORE wxGDIObjListBase
{
506 class WXDLLIMPEXP_CORE wxPenList
: public wxGDIObjListBase
509 wxPen
*FindOrCreatePen(const wxColour
& colour
, int width
, int style
);
510 #if WXWIN_COMPATIBILITY_2_6
511 wxDEPRECATED( void AddPen(wxPen
*) );
512 wxDEPRECATED( void RemovePen(wxPen
*) );
516 class WXDLLIMPEXP_CORE wxBrushList
: public wxGDIObjListBase
519 wxBrush
*FindOrCreateBrush(const wxColour
& colour
, int style
= wxSOLID
);
520 #if WXWIN_COMPATIBILITY_2_6
521 wxDEPRECATED( void AddBrush(wxBrush
*) );
522 wxDEPRECATED( void RemoveBrush(wxBrush
*) );
526 class WXDLLIMPEXP_CORE wxFontList
: public wxGDIObjListBase
529 wxFont
*FindOrCreateFont(int pointSize
, int family
, int style
, int weight
,
530 bool underline
= false,
531 const wxString
& face
= wxEmptyString
,
532 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
533 #if WXWIN_COMPATIBILITY_2_6
534 wxDEPRECATED( void AddFont(wxFont
*) );
535 wxDEPRECATED( void RemoveFont(wxFont
*) );
539 WX_DECLARE_STRING_HASH_MAP(wxColour
*, wxStringToColourHashMap
);
541 class WXDLLEXPORT wxColourDatabase
547 // find colour by name or name for the given colour
548 wxColour
Find(const wxString
& name
) const;
549 wxString
FindName(const wxColour
& colour
) const;
551 // add a new colour to the database
552 void AddColour(const wxString
& name
, const wxColour
& colour
);
554 #if WXWIN_COMPATIBILITY_2_6
555 // deprecated, use Find() instead
556 wxDEPRECATED( wxColour
*FindColour(const wxString
& name
) );
557 #endif // WXWIN_COMPATIBILITY_2_6
561 // PM keeps its own type of colour table
567 // load the database with the built in colour values when called for the
568 // first time, do nothing after this
571 wxStringToColourHashMap
*m_map
;
574 class WXDLLEXPORT wxResourceCache
: public wxList
577 wxResourceCache() { }
579 wxResourceCache(const unsigned int keyType
) : wxList(keyType
) { }
581 virtual ~wxResourceCache();
584 // ---------------------------------------------------------------------------
586 // ---------------------------------------------------------------------------
588 // Lists of GDI objects
589 extern WXDLLEXPORT_DATA(wxPenList
*) wxThePenList
;
590 extern WXDLLEXPORT_DATA(wxBrushList
*) wxTheBrushList
;
591 extern WXDLLEXPORT_DATA(wxFontList
*) wxTheFontList
;
595 wxStockGDI creates the stock GDI objects on demand. Pointers to the
596 created objects are stored in the ms_stockObject array, which is indexed
597 by the Item enum values. Platorm-specific fonts can be created by
598 implementing a derived class with an override for the GetFont function.
599 wxStockGDI operates as a singleton, accessed through the ms_instance
600 pointer. By default this pointer is set to an instance of wxStockGDI.
601 A derived class must arrange to set this pointer to an instance of itself.
603 class WXDLLIMPEXP_CORE wxStockGDI
645 virtual ~wxStockGDI();
646 static void DeleteAll();
648 static wxStockGDI
& instance() { return *ms_instance
; }
650 static const wxBrush
* GetBrush(Item item
);
651 static const wxColour
* GetColour(Item item
);
652 static const wxCursor
* GetCursor(Item item
);
653 // Can be overridden by platform-specific derived classes
654 virtual const wxFont
* GetFont(Item item
);
655 static const wxPen
* GetPen(Item item
);
658 static wxStockGDI
* ms_instance
;
660 static wxObject
* ms_stockObject
[ITEMCOUNT
];
662 DECLARE_NO_COPY_CLASS(wxStockGDI
)
665 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
666 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
667 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
668 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
670 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
671 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
672 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
673 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
674 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
675 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
676 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
677 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
678 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
679 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
681 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
682 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
683 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
684 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
685 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
686 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
687 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
688 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
689 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
690 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
692 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
693 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
694 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
695 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
696 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
697 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
698 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
700 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
701 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
702 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
705 extern WXDLLEXPORT_DATA(wxBitmap
) wxNullBitmap
;
706 extern WXDLLEXPORT_DATA(wxIcon
) wxNullIcon
;
707 extern WXDLLEXPORT_DATA(wxCursor
) wxNullCursor
;
708 extern WXDLLEXPORT_DATA(wxPen
) wxNullPen
;
709 extern WXDLLEXPORT_DATA(wxBrush
) wxNullBrush
;
710 extern WXDLLEXPORT_DATA(wxPalette
) wxNullPalette
;
711 extern WXDLLEXPORT_DATA(wxFont
) wxNullFont
;
712 extern WXDLLEXPORT_DATA(wxColour
) wxNullColour
;
714 extern WXDLLEXPORT_DATA(wxColourDatabase
*) wxTheColourDatabase
;
716 extern WXDLLEXPORT_DATA(const wxChar
) wxPanelNameStr
[];
718 extern WXDLLEXPORT_DATA(const wxSize
) wxDefaultSize
;
719 extern WXDLLEXPORT_DATA(const wxPoint
) wxDefaultPosition
;
721 // ---------------------------------------------------------------------------
723 // ---------------------------------------------------------------------------
725 // resource management
726 extern void WXDLLEXPORT
wxInitializeStockLists();
727 extern void WXDLLEXPORT
wxDeleteStockLists();
729 // is the display colour (or monochrome)?
730 extern bool WXDLLEXPORT
wxColourDisplay();
732 // Returns depth of screen
733 extern int WXDLLEXPORT
wxDisplayDepth();
734 #define wxGetDisplayDepth wxDisplayDepth
736 // get the display size
737 extern void WXDLLEXPORT
wxDisplaySize(int *width
, int *height
);
738 extern wxSize WXDLLEXPORT
wxGetDisplaySize();
739 extern void WXDLLEXPORT
wxDisplaySizeMM(int *width
, int *height
);
740 extern wxSize WXDLLEXPORT
wxGetDisplaySizeMM();
742 // Get position and size of the display workarea
743 extern void WXDLLEXPORT
wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
);
744 extern wxRect WXDLLEXPORT
wxGetClientDisplayRect();
747 extern void WXDLLEXPORT
wxSetCursor(const wxCursor
& cursor
);