]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gdicmn.h
reverted the change to not use wxList until dynarray.h is fixed to provide operator...
[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 void Scale(float xscale, float yscale)
233 { x = (int)(x*xscale); y = (int)(y*yscale); }
234
235 // accessors
236 void Set(int xx, int yy) { x = xx; y = yy; }
237 void SetWidth(int w) { x = w; }
238 void SetHeight(int h) { y = h; }
239
240 int GetWidth() const { return x; }
241 int GetHeight() const { return y; }
242
243 bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; }
244
245 // combine this size with the other one replacing the default (i.e. equal
246 // to wxDefaultCoord) components of this object with those of the other
247 void SetDefaults(const wxSize& size)
248 {
249 if ( x == wxDefaultCoord )
250 x = size.x;
251 if ( y == wxDefaultCoord )
252 y = size.y;
253 }
254
255 // compatibility
256 int GetX() const { return x; }
257 int GetY() const { return y; }
258 };
259
260 // ---------------------------------------------------------------------------
261 // Point classes: with real or integer coordinates
262 // ---------------------------------------------------------------------------
263
264 class WXDLLEXPORT wxRealPoint
265 {
266 public:
267 double x;
268 double y;
269
270 wxRealPoint() : x(0.0), y(0.0) { }
271 wxRealPoint(double xx, double yy) : x(xx), y(yy) { }
272
273 wxRealPoint operator+(const wxRealPoint& pt) const { return wxRealPoint(x + pt.x, y + pt.y); }
274 wxRealPoint operator-(const wxRealPoint& pt) const { return wxRealPoint(x - pt.x, y - pt.y); }
275
276 bool operator==(const wxRealPoint& pt) const
277 {
278 return wxIsSameDouble(x, pt.x) && wxIsSameDouble(y, pt.y);
279 }
280 bool operator!=(const wxRealPoint& pt) const { return !(*this == pt); }
281 };
282
283
284 class WXDLLEXPORT wxPoint
285 {
286 public:
287 int x, y;
288
289 wxPoint() : x(0), y(0) { }
290 wxPoint(int xx, int yy) : x(xx), y(yy) { }
291
292 // no copy ctor or assignment operator - the defaults are ok
293
294 // comparison
295 bool operator==(const wxPoint& p) const { return x == p.x && y == p.y; }
296 bool operator!=(const wxPoint& p) const { return !(*this == p); }
297
298 // arithmetic operations (component wise)
299 wxPoint operator+(const wxPoint& p) const { return wxPoint(x + p.x, y + p.y); }
300 wxPoint operator-(const wxPoint& p) const { return wxPoint(x - p.x, y - p.y); }
301
302 wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; }
303 wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; }
304
305 wxPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; }
306 wxPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; }
307
308 wxPoint operator+(const wxSize& s) const { return wxPoint(x + s.GetWidth(), y + s.GetHeight()); }
309 wxPoint operator-(const wxSize& s) const { return wxPoint(x - s.GetWidth(), y - s.GetHeight()); }
310 };
311
312 // ---------------------------------------------------------------------------
313 // wxRect
314 // ---------------------------------------------------------------------------
315
316 class WXDLLEXPORT wxRect
317 {
318 public:
319 wxRect()
320 : x(0), y(0), width(0), height(0)
321 { }
322 wxRect(int xx, int yy, int ww, int hh)
323 : x(xx), y(yy), width(ww), height(hh)
324 { }
325 wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
326 wxRect(const wxPoint& pt, const wxSize& size)
327 : x(pt.x), y(pt.y), width(size.x), height(size.y)
328 { }
329 wxRect(const wxSize& size)
330 : x(0), y(0), width(size.x), height(size.y)
331 { }
332
333 // default copy ctor and assignment operators ok
334
335 int GetX() const { return x; }
336 void SetX(int xx) { x = xx; }
337
338 int GetY() const { return y; }
339 void SetY(int yy) { y = yy; }
340
341 int GetWidth() const { return width; }
342 void SetWidth(int w) { width = w; }
343
344 int GetHeight() const { return height; }
345 void SetHeight(int h) { height = h; }
346
347 wxPoint GetPosition() const { return wxPoint(x, y); }
348 void SetPosition( const wxPoint &p ) { x = p.x; y = p.y; }
349
350 wxSize GetSize() const { return wxSize(width, height); }
351 void SetSize( const wxSize &s ) { width = s.GetWidth(); height = s.GetHeight(); }
352
353 bool IsEmpty() const { return (width <= 0) || (height <= 0); }
354
355 wxPoint GetTopLeft() const { return GetPosition(); }
356 wxPoint GetLeftTop() const { return GetTopLeft(); }
357 void SetTopLeft(const wxPoint &p) { SetPosition(p); }
358 void SetLeftTop(const wxPoint &p) { SetTopLeft(p); }
359
360 wxPoint GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
361 wxPoint GetRightBottom() const { return GetBottomRight(); }
362 void SetBottomRight(const wxPoint &p) { SetRight(p.x); SetBottom(p.y); }
363 void SetRightBottom(const wxPoint &p) { SetBottomRight(p); }
364
365 int GetLeft() const { return x; }
366 int GetTop() const { return y; }
367 int GetBottom() const { return y + height - 1; }
368 int GetRight() const { return x + width - 1; }
369
370 void SetLeft(int left) { x = left; }
371 void SetRight(int right) { width = right - x + 1; }
372 void SetTop(int top) { y = top; }
373 void SetBottom(int bottom) { height = bottom - y + 1; }
374
375 // operations with rect
376 wxRect& Inflate(wxCoord dx, wxCoord dy);
377 wxRect& Inflate(wxCoord d) { return Inflate(d, d); }
378 wxRect Inflate(wxCoord dx, wxCoord dy) const
379 {
380 wxRect r = *this;
381 r.Inflate(dx, dy);
382 return r;
383 }
384
385 wxRect& Deflate(wxCoord dx, wxCoord dy) { return Inflate(-dx, -dy); }
386 wxRect& Deflate(wxCoord d) { return Inflate(-d); }
387 wxRect Deflate(wxCoord dx, wxCoord dy) const
388 {
389 wxRect r = *this;
390 r.Deflate(dx, dy);
391 return r;
392 }
393
394 void Offset(wxCoord dx, wxCoord dy) { x += dx; y += dy; }
395 void Offset(const wxPoint& pt) { Offset(pt.x, pt.y); }
396
397 wxRect& Intersect(const wxRect& rect);
398 wxRect Intersect(const wxRect& rect) const
399 {
400 wxRect r = *this;
401 r.Intersect(rect);
402 return r;
403 }
404
405 wxRect& Union(const wxRect& rect);
406 wxRect Union(const wxRect& rect) const
407 {
408 wxRect r = *this;
409 r.Union(rect);
410 return r;
411 }
412
413 // compare rectangles
414 bool operator==(const wxRect& rect) const;
415 bool operator!=(const wxRect& rect) const { return !(*this == rect); }
416
417 // return true if the point is (not strcitly) inside the rect
418 bool Inside(int x, int y) const;
419 bool Inside(const wxPoint& pt) const { return Inside(pt.x, pt.y); }
420
421 // return true if the rectangles have a non empty intersection
422 bool Intersects(const wxRect& rect) const;
423
424
425 // these are like Union() but don't ignore empty rectangles
426 wxRect operator+(const wxRect& rect) const;
427 wxRect& operator+=(const wxRect& rect)
428 {
429 *this = *this + rect;
430 return *this;
431 }
432
433
434 // centre this rectangle in the given (usually, but not necessarily,
435 // larger) one
436 wxRect CentreIn(const wxRect& r, int dir = wxBOTH) const
437 {
438 return wxRect(dir & wxHORIZONTAL ? r.x + (r.width - width)/2 : x,
439 dir & wxVERTICAL ? r.y + (r.height - height)/2 : y,
440 width, height);
441 }
442
443 wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const
444 {
445 return CentreIn(r, dir);
446 }
447
448 public:
449 int x, y, width, height;
450 };
451
452 // ---------------------------------------------------------------------------
453 // Management of pens, brushes and fonts
454 // ---------------------------------------------------------------------------
455
456 typedef wxInt8 wxDash;
457
458 class WXDLLIMPEXP_CORE wxGDIObjListBase {
459 public:
460 wxGDIObjListBase();
461 ~wxGDIObjListBase();
462
463 protected:
464 wxList list;
465 };
466
467 class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase
468 {
469 public:
470 wxPen *FindOrCreatePen(const wxColour& colour, int width, int style);
471 #if WXWIN_COMPATIBILITY_2_6
472 wxDEPRECATED( void AddPen(wxPen*) );
473 wxDEPRECATED( void RemovePen(wxPen*) );
474 #endif
475 };
476
477 class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase
478 {
479 public:
480 wxBrush *FindOrCreateBrush(const wxColour& colour, int style = wxSOLID);
481 #if WXWIN_COMPATIBILITY_2_6
482 wxDEPRECATED( void AddBrush(wxBrush*) );
483 wxDEPRECATED( void RemoveBrush(wxBrush*) );
484 #endif
485 };
486
487 class WXDLLIMPEXP_CORE wxFontList: public wxGDIObjListBase
488 {
489 public:
490 wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight,
491 bool underline = false,
492 const wxString& face = wxEmptyString,
493 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
494 #if WXWIN_COMPATIBILITY_2_6
495 wxDEPRECATED( void AddFont(wxFont*) );
496 wxDEPRECATED( void RemoveFont(wxFont*) );
497 #endif
498 };
499
500 WX_DECLARE_STRING_HASH_MAP(wxColour*, wxStringToColourHashMap);
501
502 class WXDLLEXPORT wxColourDatabase
503 {
504 public:
505 wxColourDatabase();
506 ~wxColourDatabase();
507
508 // find colour by name or name for the given colour
509 wxColour Find(const wxString& name) const;
510 wxString FindName(const wxColour& colour) const;
511
512 // add a new colour to the database
513 void AddColour(const wxString& name, const wxColour& colour);
514
515 #if WXWIN_COMPATIBILITY_2_6
516 // deprecated, use Find() instead
517 wxDEPRECATED( wxColour *FindColour(const wxString& name) );
518 #endif // WXWIN_COMPATIBILITY_2_6
519
520
521 #ifdef __WXPM__
522 // PM keeps its own type of colour table
523 long* m_palTable;
524 size_t m_nSize;
525 #endif
526
527 private:
528 // load the database with the built in colour values when called for the
529 // first time, do nothing after this
530 void Initialize();
531
532 wxStringToColourHashMap *m_map;
533 };
534
535 class WXDLLEXPORT wxResourceCache: public wxList
536 {
537 public:
538 wxResourceCache() { }
539 #if !wxUSE_STL
540 wxResourceCache(const unsigned int keyType) : wxList(keyType) { }
541 #endif
542 ~wxResourceCache();
543 };
544
545 // ---------------------------------------------------------------------------
546 // global variables
547 // ---------------------------------------------------------------------------
548
549 // Lists of GDI objects
550 extern WXDLLEXPORT_DATA(wxPenList*) wxThePenList;
551 extern WXDLLEXPORT_DATA(wxBrushList*) wxTheBrushList;
552 extern WXDLLEXPORT_DATA(wxFontList*) wxTheFontList;
553
554 /* Stock objects
555
556 wxStockGDI creates the stock GDI objects on demand. Pointers to the
557 created objects are stored in the ms_stockObject array, which is indexed
558 by the Item enum values. Platorm-specific fonts can be created by
559 implementing a derived class with an override for the GetFont function.
560 wxStockGDI operates as a singleton, accessed through the ms_instance
561 pointer. By default this pointer is set to an instance of wxStockGDI.
562 A derived class must arrange to set this pointer to an instance of itself.
563 */
564 class WXDLLIMPEXP_CORE wxStockGDI
565 {
566 public:
567 enum Item {
568 BRUSH_BLACK,
569 BRUSH_BLUE,
570 BRUSH_CYAN,
571 BRUSH_GREEN,
572 BRUSH_GREY,
573 BRUSH_LIGHTGREY,
574 BRUSH_MEDIUMGREY,
575 BRUSH_RED,
576 BRUSH_TRANSPARENT,
577 BRUSH_WHITE,
578 COLOUR_BLACK,
579 COLOUR_BLUE,
580 COLOUR_CYAN,
581 COLOUR_GREEN,
582 COLOUR_LIGHTGREY,
583 COLOUR_RED,
584 COLOUR_WHITE,
585 CURSOR_CROSS,
586 CURSOR_HOURGLASS,
587 CURSOR_STANDARD,
588 FONT_ITALIC,
589 FONT_NORMAL,
590 FONT_SMALL,
591 FONT_SWISS,
592 PEN_BLACK,
593 PEN_BLACKDASHED,
594 PEN_CYAN,
595 PEN_GREEN,
596 PEN_GREY,
597 PEN_LIGHTGREY,
598 PEN_MEDIUMGREY,
599 PEN_RED,
600 PEN_TRANSPARENT,
601 PEN_WHITE,
602 ITEMCOUNT
603 };
604
605 wxStockGDI();
606 virtual ~wxStockGDI();
607 static void DeleteAll();
608
609 static wxStockGDI& instance() { return *ms_instance; }
610
611 static const wxBrush* GetBrush(Item item);
612 static const wxColour* GetColour(Item item);
613 static const wxCursor* GetCursor(Item item);
614 // Can be overridden by platform-specific derived classes
615 virtual const wxFont* GetFont(Item item);
616 static const wxPen* GetPen(Item item);
617
618 protected:
619 static wxStockGDI* ms_instance;
620
621 static wxObject* ms_stockObject[ITEMCOUNT];
622
623 DECLARE_NO_COPY_CLASS(wxStockGDI)
624 };
625
626 #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
627 #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL)
628 #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL)
629 #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS)
630
631 #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
632 #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
633 #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
634 #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
635 #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
636 #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
637 #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
638 #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED)
639 #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT)
640 #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE)
641
642 #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK)
643 #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
644 #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
645 #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
646 #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
647 #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
648 #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
649 #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED)
650 #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT)
651 #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE)
652
653 #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
654 #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
655 #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
656 #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
657 #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
658 #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
659 #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
660
661 #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS)
662 #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS)
663 #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
664
665 // 'Null' objects
666 extern WXDLLEXPORT_DATA(wxBitmap) wxNullBitmap;
667 extern WXDLLEXPORT_DATA(wxIcon) wxNullIcon;
668 extern WXDLLEXPORT_DATA(wxCursor) wxNullCursor;
669 extern WXDLLEXPORT_DATA(wxPen) wxNullPen;
670 extern WXDLLEXPORT_DATA(wxBrush) wxNullBrush;
671 extern WXDLLEXPORT_DATA(wxPalette) wxNullPalette;
672 extern WXDLLEXPORT_DATA(wxFont) wxNullFont;
673 extern WXDLLEXPORT_DATA(wxColour) wxNullColour;
674
675 extern WXDLLEXPORT_DATA(wxColourDatabase*) wxTheColourDatabase;
676
677 extern WXDLLEXPORT_DATA(const wxChar) wxPanelNameStr[];
678
679 extern WXDLLEXPORT_DATA(const wxSize) wxDefaultSize;
680 extern WXDLLEXPORT_DATA(const wxPoint) wxDefaultPosition;
681
682 // ---------------------------------------------------------------------------
683 // global functions
684 // ---------------------------------------------------------------------------
685
686 // resource management
687 extern void WXDLLEXPORT wxInitializeStockLists();
688 extern void WXDLLEXPORT wxDeleteStockLists();
689
690 // is the display colour (or monochrome)?
691 extern bool WXDLLEXPORT wxColourDisplay();
692
693 // Returns depth of screen
694 extern int WXDLLEXPORT wxDisplayDepth();
695 #define wxGetDisplayDepth wxDisplayDepth
696
697 // get the display size
698 extern void WXDLLEXPORT wxDisplaySize(int *width, int *height);
699 extern wxSize WXDLLEXPORT wxGetDisplaySize();
700 extern void WXDLLEXPORT wxDisplaySizeMM(int *width, int *height);
701 extern wxSize WXDLLEXPORT wxGetDisplaySizeMM();
702
703 // Get position and size of the display workarea
704 extern void WXDLLEXPORT wxClientDisplayRect(int *x, int *y, int *width, int *height);
705 extern wxRect WXDLLEXPORT wxGetClientDisplayRect();
706
707 // set global cursor
708 extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor);
709
710 #endif
711 // _WX_GDICMNH__