create stock GDI objects on demand; use const with GDI objects appropriately (patch...
[wxWidgets.git] / include / wx / gdicmn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gdicmn.h
3 // Purpose: Common GDI classes, types and declarations
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GDICMNH__
13 #define _WX_GDICMNH__
14
15 // ---------------------------------------------------------------------------
16 // headers
17 // ---------------------------------------------------------------------------
18
19 #include "wx/defs.h"
20 #include "wx/list.h"
21 #include "wx/string.h"
22 #include "wx/fontenc.h"
23 #include "wx/hashmap.h"
24 #include "wx/math.h"
25
26 // ---------------------------------------------------------------------------
27 // forward declarations
28 // ---------------------------------------------------------------------------
29
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;
40
41 // ---------------------------------------------------------------------------
42 // constants
43 // ---------------------------------------------------------------------------
44
45 // Bitmap flags
46 enum wxBitmapType
47 {
48 wxBITMAP_TYPE_INVALID, // should be == 0 for compatibility!
49 wxBITMAP_TYPE_BMP,
50 wxBITMAP_TYPE_BMP_RESOURCE,
51 wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE,
52 wxBITMAP_TYPE_ICO,
53 wxBITMAP_TYPE_ICO_RESOURCE,
54 wxBITMAP_TYPE_CUR,
55 wxBITMAP_TYPE_CUR_RESOURCE,
56 wxBITMAP_TYPE_XBM,
57 wxBITMAP_TYPE_XBM_DATA,
58 wxBITMAP_TYPE_XPM,
59 wxBITMAP_TYPE_XPM_DATA,
60 wxBITMAP_TYPE_TIF,
61 wxBITMAP_TYPE_TIF_RESOURCE,
62 wxBITMAP_TYPE_GIF,
63 wxBITMAP_TYPE_GIF_RESOURCE,
64 wxBITMAP_TYPE_PNG,
65 wxBITMAP_TYPE_PNG_RESOURCE,
66 wxBITMAP_TYPE_JPEG,
67 wxBITMAP_TYPE_JPEG_RESOURCE,
68 wxBITMAP_TYPE_PNM,
69 wxBITMAP_TYPE_PNM_RESOURCE,
70 wxBITMAP_TYPE_PCX,
71 wxBITMAP_TYPE_PCX_RESOURCE,
72 wxBITMAP_TYPE_PICT,
73 wxBITMAP_TYPE_PICT_RESOURCE,
74 wxBITMAP_TYPE_ICON,
75 wxBITMAP_TYPE_ICON_RESOURCE,
76 wxBITMAP_TYPE_ANI,
77 wxBITMAP_TYPE_IFF,
78 wxBITMAP_TYPE_MACCURSOR,
79 wxBITMAP_TYPE_MACCURSOR_RESOURCE,
80 wxBITMAP_TYPE_ANY = 50
81 };
82
83 // Standard cursors
84 enum wxStockCursor
85 {
86 wxCURSOR_NONE, // should be 0
87 wxCURSOR_ARROW,
88 wxCURSOR_RIGHT_ARROW,
89 wxCURSOR_BULLSEYE,
90 wxCURSOR_CHAR,
91 wxCURSOR_CROSS,
92 wxCURSOR_HAND,
93 wxCURSOR_IBEAM,
94 wxCURSOR_LEFT_BUTTON,
95 wxCURSOR_MAGNIFIER,
96 wxCURSOR_MIDDLE_BUTTON,
97 wxCURSOR_NO_ENTRY,
98 wxCURSOR_PAINT_BRUSH,
99 wxCURSOR_PENCIL,
100 wxCURSOR_POINT_LEFT,
101 wxCURSOR_POINT_RIGHT,
102 wxCURSOR_QUESTION_ARROW,
103 wxCURSOR_RIGHT_BUTTON,
104 wxCURSOR_SIZENESW,
105 wxCURSOR_SIZENS,
106 wxCURSOR_SIZENWSE,
107 wxCURSOR_SIZEWE,
108 wxCURSOR_SIZING,
109 wxCURSOR_SPRAYCAN,
110 wxCURSOR_WAIT,
111 wxCURSOR_WATCH,
112 wxCURSOR_BLANK,
113 #ifdef __WXGTK__
114 wxCURSOR_DEFAULT, // standard X11 cursor
115 #endif
116 #ifdef __WXMAC__
117 wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow
118 #endif
119 #ifdef __X__
120 // Not yet implemented for Windows
121 wxCURSOR_CROSS_REVERSE,
122 wxCURSOR_DOUBLE_ARROW,
123 wxCURSOR_BASED_ARROW_UP,
124 wxCURSOR_BASED_ARROW_DOWN,
125 #endif // X11
126
127 wxCURSOR_ARROWWAIT,
128
129 wxCURSOR_MAX
130 };
131
132 #ifndef __WXGTK__
133 #define wxCURSOR_DEFAULT wxCURSOR_ARROW
134 #endif
135
136 // ---------------------------------------------------------------------------
137 // macros
138 // ---------------------------------------------------------------------------
139
140 /* Useful macro for creating icons portably, for example:
141
142 wxIcon *icon = new wxICON(mondrian);
143
144 expands into:
145
146 wxIcon *icon = new wxIcon("mondrian"); // On wxMSW
147 wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK
148 */
149
150 #ifdef __WXMSW__
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 )
171 #else
172 // This will usually mean something on any platform
173 #define wxICON(X) wxIcon(wxT(#X))
174 #endif // platform
175
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.
178 */
179
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__) || \
187 defined(__WXCOCOA__)
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)
192 #endif // platform
193
194 // ===========================================================================
195 // classes
196 // ===========================================================================
197
198 // ---------------------------------------------------------------------------
199 // wxSize
200 // ---------------------------------------------------------------------------
201
202 class WXDLLEXPORT wxSize
203 {
204 public:
205 // members are public for compatibility, don't use them directly.
206 int x, y;
207
208 // constructors
209 wxSize() : x(0), y(0) { }
210 wxSize(int xx, int yy) : x(xx), y(yy) { }
211
212 // no copy ctor or assignment operator - the defaults are ok
213
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; }
216
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); }
221
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; }
226
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; }
231
232 // accessors
233 void Set(int xx, int yy) { x = xx; y = yy; }
234 void SetWidth(int w) { x = w; }
235 void SetHeight(int h) { y = h; }
236
237 int GetWidth() const { return x; }
238 int GetHeight() const { return y; }
239
240 bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; }
241
242 // combine this size with the other one replacing the default (i.e. equal
243 // to wxDefaultCoord) components of this object with those of the other
244 void SetDefaults(const wxSize& size)
245 {
246 if ( x == wxDefaultCoord )
247 x = size.x;
248 if ( y == wxDefaultCoord )
249 y = size.y;
250 }
251
252 // compatibility
253 int GetX() const { return x; }
254 int GetY() const { return y; }
255 };
256
257 // ---------------------------------------------------------------------------
258 // Point classes: with real or integer coordinates
259 // ---------------------------------------------------------------------------
260
261 class WXDLLEXPORT wxRealPoint
262 {
263 public:
264 double x;
265 double y;
266
267 wxRealPoint() : x(0.0), y(0.0) { }
268 wxRealPoint(double xx, double yy) : x(xx), y(yy) { }
269
270 wxRealPoint operator+(const wxRealPoint& pt) const { return wxRealPoint(x + pt.x, y + pt.y); }
271 wxRealPoint operator-(const wxRealPoint& pt) const { return wxRealPoint(x - pt.x, y - pt.y); }
272
273 bool operator==(const wxRealPoint& pt) const
274 {
275 return wxIsSameDouble(x, pt.x) && wxIsSameDouble(y, pt.y);
276 }
277 bool operator!=(const wxRealPoint& pt) const { return !(*this == pt); }
278 };
279
280
281 class WXDLLEXPORT wxPoint
282 {
283 public:
284 int x, y;
285
286 wxPoint() : x(0), y(0) { }
287 wxPoint(int xx, int yy) : x(xx), y(yy) { }
288
289 // no copy ctor or assignment operator - the defaults are ok
290
291 // comparison
292 bool operator==(const wxPoint& p) const { return x == p.x && y == p.y; }
293 bool operator!=(const wxPoint& p) const { return !(*this == p); }
294
295 // arithmetic operations (component wise)
296 wxPoint operator+(const wxPoint& p) const { return wxPoint(x + p.x, y + p.y); }
297 wxPoint operator-(const wxPoint& p) const { return wxPoint(x - p.x, y - p.y); }
298
299 wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; }
300 wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; }
301
302 wxPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; }
303 wxPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; }
304
305 wxPoint operator+(const wxSize& s) const { return wxPoint(x + s.GetWidth(), y + s.GetHeight()); }
306 wxPoint operator-(const wxSize& s) const { return wxPoint(x - s.GetWidth(), y - s.GetHeight()); }
307 };
308
309 // ---------------------------------------------------------------------------
310 // wxRect
311 // ---------------------------------------------------------------------------
312
313 class WXDLLEXPORT wxRect
314 {
315 public:
316 wxRect()
317 : x(0), y(0), width(0), height(0)
318 { }
319 wxRect(int xx, int yy, int ww, int hh)
320 : x(xx), y(yy), width(ww), height(hh)
321 { }
322 wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
323 wxRect(const wxPoint& pt, const wxSize& size)
324 : x(pt.x), y(pt.y), width(size.x), height(size.y)
325 { }
326 wxRect(const wxSize& size)
327 : x(0), y(0), width(size.x), height(size.y)
328 { }
329
330 // default copy ctor and assignment operators ok
331
332 int GetX() const { return x; }
333 void SetX(int xx) { x = xx; }
334
335 int GetY() const { return y; }
336 void SetY(int yy) { y = yy; }
337
338 int GetWidth() const { return width; }
339 void SetWidth(int w) { width = w; }
340
341 int GetHeight() const { return height; }
342 void SetHeight(int h) { height = h; }
343
344 wxPoint GetPosition() const { return wxPoint(x, y); }
345 void SetPosition( const wxPoint &p ) { x = p.x; y = p.y; }
346
347 wxSize GetSize() const { return wxSize(width, height); }
348 void SetSize( const wxSize &s ) { width = s.GetWidth(); height = s.GetHeight(); }
349
350 bool IsEmpty() const { return (width <= 0) || (height <= 0); }
351
352 wxPoint GetTopLeft() const { return GetPosition(); }
353 wxPoint GetLeftTop() const { return GetTopLeft(); }
354 void SetTopLeft(const wxPoint &p) { SetPosition(p); }
355 void SetLeftTop(const wxPoint &p) { SetTopLeft(p); }
356
357 wxPoint GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
358 wxPoint GetRightBottom() const { return GetBottomRight(); }
359 void SetBottomRight(const wxPoint &p) { SetRight(p.x); SetBottom(p.y); }
360 void SetRightBottom(const wxPoint &p) { SetBottomRight(p); }
361
362 int GetLeft() const { return x; }
363 int GetTop() const { return y; }
364 int GetBottom() const { return y + height - 1; }
365 int GetRight() const { return x + width - 1; }
366
367 void SetLeft(int left) { x = left; }
368 void SetRight(int right) { width = right - x + 1; }
369 void SetTop(int top) { y = top; }
370 void SetBottom(int bottom) { height = bottom - y + 1; }
371
372 // operations with rect
373 wxRect& Inflate(wxCoord dx, wxCoord dy);
374 wxRect& Inflate(wxCoord d) { return Inflate(d, d); }
375 wxRect Inflate(wxCoord dx, wxCoord dy) const
376 {
377 wxRect r = *this;
378 r.Inflate(dx, dy);
379 return r;
380 }
381
382 wxRect& Deflate(wxCoord dx, wxCoord dy) { return Inflate(-dx, -dy); }
383 wxRect& Deflate(wxCoord d) { return Inflate(-d); }
384 wxRect Deflate(wxCoord dx, wxCoord dy) const
385 {
386 wxRect r = *this;
387 r.Deflate(dx, dy);
388 return r;
389 }
390
391 void Offset(wxCoord dx, wxCoord dy) { x += dx; y += dy; }
392 void Offset(const wxPoint& pt) { Offset(pt.x, pt.y); }
393
394 wxRect& Intersect(const wxRect& rect);
395 wxRect Intersect(const wxRect& rect) const
396 {
397 wxRect r = *this;
398 r.Intersect(rect);
399 return r;
400 }
401
402 wxRect& Union(const wxRect& rect);
403 wxRect Union(const wxRect& rect) const
404 {
405 wxRect r = *this;
406 r.Union(rect);
407 return r;
408 }
409
410 // compare rectangles
411 bool operator==(const wxRect& rect) const;
412 bool operator!=(const wxRect& rect) const { return !(*this == rect); }
413
414 // return true if the point is (not strcitly) inside the rect
415 bool Inside(int x, int y) const;
416 bool Inside(const wxPoint& pt) const { return Inside(pt.x, pt.y); }
417
418 // return true if the rectangles have a non empty intersection
419 bool Intersects(const wxRect& rect) const;
420
421
422 // these are like Union() but don't ignore empty rectangles
423 wxRect operator+(const wxRect& rect) const;
424 wxRect& operator+=(const wxRect& rect)
425 {
426 *this = *this + rect;
427 return *this;
428 }
429
430
431 // centre this rectangle in the given (usually, but not necessarily,
432 // larger) one
433 wxRect CentreIn(const wxRect& r, int dir = wxBOTH) const
434 {
435 return wxRect(dir & wxHORIZONTAL ? r.x + (r.width - width)/2 : x,
436 dir & wxVERTICAL ? r.y + (r.height - height)/2 : y,
437 width, height);
438 }
439
440 wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const
441 {
442 return CentreIn(r, dir);
443 }
444
445 public:
446 int x, y, width, height;
447 };
448
449 // ---------------------------------------------------------------------------
450 // Management of pens, brushes and fonts
451 // ---------------------------------------------------------------------------
452
453 typedef wxInt8 wxDash;
454
455 class WXDLLEXPORT wxPenList : public wxList
456 {
457 public:
458 wxPenList() { }
459 ~wxPenList();
460
461 void AddPen(wxPen *pen);
462 void RemovePen(wxPen *pen);
463 wxPen *FindOrCreatePen(const wxColour& colour, int width, int style);
464 };
465
466 class WXDLLEXPORT wxBrushList : public wxList
467 {
468 public:
469 wxBrushList() { }
470 ~wxBrushList();
471
472 void AddBrush(wxBrush *brush);
473 void RemoveBrush(wxBrush *brush);
474 wxBrush *FindOrCreateBrush(const wxColour& colour, int style = wxSOLID);
475 };
476
477 class WXDLLEXPORT wxFontList : public wxList
478 {
479 public:
480 wxFontList() { }
481 ~wxFontList();
482
483 void AddFont(wxFont *font);
484 void RemoveFont(wxFont *font);
485 wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight,
486 bool underline = false,
487 const wxString& face = wxEmptyString,
488 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
489 };
490
491 WX_DECLARE_STRING_HASH_MAP( wxColour *, wxStringToColourHashMap );
492
493 class WXDLLEXPORT wxColourDatabase
494 {
495 public:
496 wxColourDatabase();
497 ~wxColourDatabase();
498
499 // find colour by name or name for the given colour
500 wxColour Find(const wxString& name) const;
501 wxString FindName(const wxColour& colour) const;
502
503 // add a new colour to the database
504 void AddColour(const wxString& name, const wxColour& colour);
505
506 #if WXWIN_COMPATIBILITY_2_6
507 // deprecated, use Find() instead
508 wxDEPRECATED( wxColour *FindColour(const wxString& name) );
509 #endif // WXWIN_COMPATIBILITY_2_6
510
511
512 #ifdef __WXPM__
513 // PM keeps its own type of colour table
514 long* m_palTable;
515 size_t m_nSize;
516 #endif
517
518 private:
519 // load the database with the built in colour values when called for the
520 // first time, do nothing after this
521 void Initialize();
522
523 wxStringToColourHashMap *m_map;
524 };
525
526 class WXDLLEXPORT wxBitmapList : public wxList
527 {
528 public:
529 wxBitmapList(){}
530 ~wxBitmapList();
531
532 void AddBitmap(wxBitmap *bitmap);
533 void RemoveBitmap(wxBitmap *bitmap);
534 };
535
536 class WXDLLEXPORT wxResourceCache: public wxList
537 {
538 public:
539 wxResourceCache() { }
540 #if !wxUSE_STL
541 wxResourceCache(const unsigned int keyType) : wxList(keyType) { }
542 #endif
543 ~wxResourceCache();
544 };
545
546 // ---------------------------------------------------------------------------
547 // global variables
548 // ---------------------------------------------------------------------------
549
550 // Lists of GDI objects
551 extern WXDLLEXPORT_DATA(wxPenList*) wxThePenList;
552 extern WXDLLEXPORT_DATA(wxBrushList*) wxTheBrushList;
553 extern WXDLLEXPORT_DATA(wxFontList*) wxTheFontList;
554 extern WXDLLEXPORT_DATA(wxBitmapList*) wxTheBitmapList;
555
556 /* Stock objects
557
558 wxStockGDI creates the stock GDI objects on demand. Pointers to the
559 created objects are stored in the ms_stockObject array, which is indexed
560 by the Item enum values. Platorm-specific fonts can be created by
561 implementing a derived class with an override for the GetFont function.
562 wxStockGDI operates as a singleton, accessed through the ms_instance
563 pointer. By default this pointer is set to an instance of wxStockGDI.
564 A derived class must arrange to set this pointer to an instance of itself.
565 */
566 class WXDLLIMPEXP_CORE wxStockGDI
567 {
568 public:
569 enum Item {
570 BRUSH_BLACK,
571 BRUSH_BLUE,
572 BRUSH_CYAN,
573 BRUSH_GREEN,
574 BRUSH_GREY,
575 BRUSH_LIGHTGREY,
576 BRUSH_MEDIUMGREY,
577 BRUSH_RED,
578 BRUSH_TRANSPARENT,
579 BRUSH_WHITE,
580 COLOUR_BLACK,
581 COLOUR_BLUE,
582 COLOUR_CYAN,
583 COLOUR_GREEN,
584 COLOUR_LIGHTGREY,
585 COLOUR_RED,
586 COLOUR_WHITE,
587 CURSOR_CROSS,
588 CURSOR_HOURGLASS,
589 CURSOR_STANDARD,
590 FONT_ITALIC,
591 FONT_NORMAL,
592 FONT_SMALL,
593 FONT_SWISS,
594 PEN_BLACK,
595 PEN_BLACKDASHED,
596 PEN_CYAN,
597 PEN_GREEN,
598 PEN_GREY,
599 PEN_LIGHTGREY,
600 PEN_MEDIUMGREY,
601 PEN_RED,
602 PEN_TRANSPARENT,
603 PEN_WHITE,
604 ITEMCOUNT
605 };
606
607 wxStockGDI();
608 virtual ~wxStockGDI();
609 static void DeleteAll();
610
611 static wxStockGDI& instance() { return *ms_instance; }
612
613 static const wxBrush* GetBrush(Item item);
614 static const wxColour* GetColour(Item item);
615 static const wxCursor* GetCursor(Item item);
616 // Can be overridden by platform-specific derived classes
617 virtual const wxFont* GetFont(Item item);
618 static const wxPen* GetPen(Item item);
619
620 protected:
621 static wxStockGDI* ms_instance;
622
623 static wxObject* ms_stockObject[ITEMCOUNT];
624
625 DECLARE_NO_COPY_CLASS(wxStockGDI)
626 };
627
628 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
629 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
630 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
631 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
632
633 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
634 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
635 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
636 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
637 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
638 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
639 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
640 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
641 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
642 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
643
644 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
645 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
646 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
647 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
648 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
649 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
650 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
651 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
652 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
653 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
654
655 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
656 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
657 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
658 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
659 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
660 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
661 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
662
663 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
664 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
665 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
666
667 // 'Null' objects
668 extern WXDLLEXPORT_DATA(wxBitmap) wxNullBitmap;
669 extern WXDLLEXPORT_DATA(wxIcon) wxNullIcon;
670 extern WXDLLEXPORT_DATA(wxCursor) wxNullCursor;
671 extern WXDLLEXPORT_DATA(wxPen) wxNullPen;
672 extern WXDLLEXPORT_DATA(wxBrush) wxNullBrush;
673 extern WXDLLEXPORT_DATA(wxPalette) wxNullPalette;
674 extern WXDLLEXPORT_DATA(wxFont) wxNullFont;
675 extern WXDLLEXPORT_DATA(wxColour) wxNullColour;
676
677 extern WXDLLEXPORT_DATA(wxColourDatabase*) wxTheColourDatabase;
678
679 extern WXDLLEXPORT_DATA(const wxChar) wxPanelNameStr[];
680
681 extern WXDLLEXPORT_DATA(const wxSize) wxDefaultSize;
682 extern WXDLLEXPORT_DATA(const wxPoint) wxDefaultPosition;
683
684 // The list of objects which should be deleted
685 extern WXDLLEXPORT_DATA(wxList) wxPendingDelete;
686
687 // ---------------------------------------------------------------------------
688 // global functions
689 // ---------------------------------------------------------------------------
690
691 // resource management
692 extern void WXDLLEXPORT wxInitializeStockLists();
693 extern void WXDLLEXPORT wxDeleteStockLists();
694
695 // is the display colour (or monochrome)?
696 extern bool WXDLLEXPORT wxColourDisplay();
697
698 // Returns depth of screen
699 extern int WXDLLEXPORT wxDisplayDepth();
700 #define wxGetDisplayDepth wxDisplayDepth
701
702 // get the display size
703 extern void WXDLLEXPORT wxDisplaySize(int *width, int *height);
704 extern wxSize WXDLLEXPORT wxGetDisplaySize();
705 extern void WXDLLEXPORT wxDisplaySizeMM(int *width, int *height);
706 extern wxSize WXDLLEXPORT wxGetDisplaySizeMM();
707
708 // Get position and size of the display workarea
709 extern void WXDLLEXPORT wxClientDisplayRect(int *x, int *y, int *width, int *height);
710 extern wxRect WXDLLEXPORT wxGetClientDisplayRect();
711
712 // set global cursor
713 extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor);
714
715 #endif
716 // _WX_GDICMNH__