1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/gdicmn.cpp
3 // Purpose: Common GDI classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
19 #include "wx/gdicmn.h"
20 #include "wx/gdiobj.h"
26 #include "wx/palette.h"
28 #include "wx/iconbndl.h"
29 #include "wx/cursor.h"
30 #include "wx/settings.h"
31 #include "wx/bitmap.h"
32 #include "wx/colour.h"
37 IMPLEMENT_DYNAMIC_CLASS(wxGDIObject
, wxObject
)
40 WXDLLIMPEXP_DATA_CORE(wxBrushList
*) wxTheBrushList
;
41 WXDLLIMPEXP_DATA_CORE(wxFontList
*) wxTheFontList
;
42 WXDLLIMPEXP_DATA_CORE(wxPenList
*) wxThePenList
;
44 WXDLLIMPEXP_DATA_CORE(wxColourDatabase
*) wxTheColourDatabase
;
46 WXDLLIMPEXP_DATA_CORE(wxBitmap
) wxNullBitmap
;
47 WXDLLIMPEXP_DATA_CORE(wxBrush
) wxNullBrush
;
48 WXDLLIMPEXP_DATA_CORE(wxColour
) wxNullColour
;
49 WXDLLIMPEXP_DATA_CORE(wxCursor
) wxNullCursor
;
50 WXDLLIMPEXP_DATA_CORE(wxFont
) wxNullFont
;
51 WXDLLIMPEXP_DATA_CORE(wxIcon
) wxNullIcon
;
52 WXDLLIMPEXP_DATA_CORE(wxPen
) wxNullPen
;
54 WXDLLIMPEXP_DATA_CORE(wxPalette
) wxNullPalette
;
56 WXDLLIMPEXP_DATA_CORE(wxIconBundle
) wxNullIconBundle
;
58 const wxSize
wxDefaultSize(wxDefaultCoord
, wxDefaultCoord
);
59 const wxPoint
wxDefaultPosition(wxDefaultCoord
, wxDefaultCoord
);
61 #if wxUSE_EXTENDED_RTTI
65 template<> void wxStringReadValue(const wxString
&s
, wxPoint
&data
)
67 wxSscanf(s
, wxT("%d,%d"), &data
.x
, &data
.y
) ;
70 template<> void wxStringWriteValue(wxString
&s
, const wxPoint
&data
)
72 s
= wxString::Format(wxT("%d,%d"), data
.x
, data
.y
) ;
75 wxCUSTOM_TYPE_INFO(wxPoint
, wxToStringConverter
<wxPoint
> , wxFromStringConverter
<wxPoint
>)
77 template<> void wxStringReadValue(const wxString
&s
, wxSize
&data
)
79 wxSscanf(s
, wxT("%d,%d"), &data
.x
, &data
.y
) ;
82 template<> void wxStringWriteValue(wxString
&s
, const wxSize
&data
)
84 s
= wxString::Format(wxT("%d,%d"), data
.x
, data
.y
) ;
87 wxCUSTOM_TYPE_INFO(wxSize
, wxToStringConverter
<wxSize
> , wxFromStringConverter
<wxSize
>)
91 wxRect::wxRect(const wxPoint
& point1
, const wxPoint
& point2
)
95 width
= point2
.x
- point1
.x
;
96 height
= point2
.y
- point1
.y
;
113 wxRect
& wxRect::Union(const wxRect
& rect
)
115 // ignore empty rectangles: union with an empty rectangle shouldn't extend
116 // this one to (0, 0)
117 if ( !width
|| !height
)
121 else if ( rect
.width
&& rect
.height
)
123 int x1
= wxMin(x
, rect
.x
);
124 int y1
= wxMin(y
, rect
.y
);
125 int y2
= wxMax(y
+ height
, rect
.height
+ rect
.y
);
126 int x2
= wxMax(x
+ width
, rect
.width
+ rect
.x
);
133 //else: we're not empty and rect is empty
138 wxRect
& wxRect::Inflate(wxCoord dx
, wxCoord dy
)
142 // Don't allow deflate to eat more width than we have,
143 // a well-defined rectangle cannot have negative width.
149 // The inflate is valid.
156 // Don't allow deflate to eat more height than we have,
157 // a well-defined rectangle cannot have negative height.
163 // The inflate is valid.
171 bool wxRect::Contains(int cx
, int cy
) const
173 return ( (cx
>= x
) && (cy
>= y
)
174 && ((cy
- y
) < height
)
175 && ((cx
- x
) < width
)
179 bool wxRect::Contains(const wxRect
& rect
) const
181 return Contains(rect
.GetTopLeft()) && Contains(rect
.GetBottomRight());
184 wxRect
& wxRect::Intersect(const wxRect
& rect
)
193 if ( x2
> rect
.GetRight() )
194 x2
= rect
.GetRight();
195 if ( y2
> rect
.GetBottom() )
196 y2
= rect
.GetBottom();
201 if ( width
<= 0 || height
<= 0 )
210 bool wxRect::Intersects(const wxRect
& rect
) const
212 wxRect r
= Intersect(rect
);
214 // if there is no intersection, both width and height are 0
218 wxRect
& wxRect::operator+=(const wxRect
& rect
)
220 *this = *this + rect
;
225 wxRect
& wxRect::operator*=(const wxRect
& rect
)
227 *this = *this * rect
;
232 wxRect
operator+(const wxRect
& r1
, const wxRect
& r2
)
234 int x1
= wxMin(r1
.x
, r2
.x
);
235 int y1
= wxMin(r1
.y
, r2
.y
);
236 int y2
= wxMax(r1
.y
+r1
.height
, r2
.height
+r2
.y
);
237 int x2
= wxMax(r1
.x
+r1
.width
, r2
.width
+r2
.x
);
238 return wxRect(x1
, y1
, x2
-x1
, y2
-y1
);
241 wxRect
operator*(const wxRect
& r1
, const wxRect
& r2
)
243 int x1
= wxMax(r1
.x
, r2
.x
);
244 int y1
= wxMax(r1
.y
, r2
.y
);
245 int y2
= wxMin(r1
.y
+r1
.height
, r2
.height
+r2
.y
);
246 int x2
= wxMin(r1
.x
+r1
.width
, r2
.width
+r2
.x
);
247 return wxRect(x1
, y1
, x2
-x1
, y2
-y1
);
250 // ============================================================================
252 // ============================================================================
254 // ----------------------------------------------------------------------------
255 // wxColourDatabase ctor/dtor
256 // ----------------------------------------------------------------------------
258 wxColourDatabase::wxColourDatabase ()
260 // will be created on demand in Initialize()
264 wxColourDatabase::~wxColourDatabase ()
268 WX_CLEAR_HASH_MAP(wxStringToColourHashMap
, *m_map
);
274 delete [] m_palTable
;
278 // Colour database stuff
279 void wxColourDatabase::Initialize()
283 // already initialized
287 m_map
= new wxStringToColourHashMap
;
289 static const struct wxColourDesc
296 {wxT("AQUAMARINE"),112, 219, 147},
297 {wxT("BLACK"),0, 0, 0},
298 {wxT("BLUE"), 0, 0, 255},
299 {wxT("BLUE VIOLET"), 159, 95, 159},
300 {wxT("BROWN"), 165, 42, 42},
301 {wxT("CADET BLUE"), 95, 159, 159},
302 {wxT("CORAL"), 255, 127, 0},
303 {wxT("CORNFLOWER BLUE"), 66, 66, 111},
304 {wxT("CYAN"), 0, 255, 255},
305 {wxT("DARK GREY"), 47, 47, 47}, // ?
307 {wxT("DARK GREEN"), 47, 79, 47},
308 {wxT("DARK OLIVE GREEN"), 79, 79, 47},
309 {wxT("DARK ORCHID"), 153, 50, 204},
310 {wxT("DARK SLATE BLUE"), 107, 35, 142},
311 {wxT("DARK SLATE GREY"), 47, 79, 79},
312 {wxT("DARK TURQUOISE"), 112, 147, 219},
313 {wxT("DIM GREY"), 84, 84, 84},
314 {wxT("FIREBRICK"), 142, 35, 35},
315 {wxT("FOREST GREEN"), 35, 142, 35},
316 {wxT("GOLD"), 204, 127, 50},
317 {wxT("GOLDENROD"), 219, 219, 112},
318 {wxT("GREY"), 128, 128, 128},
319 {wxT("GREEN"), 0, 255, 0},
320 {wxT("GREEN YELLOW"), 147, 219, 112},
321 {wxT("INDIAN RED"), 79, 47, 47},
322 {wxT("KHAKI"), 159, 159, 95},
323 {wxT("LIGHT BLUE"), 191, 216, 216},
324 {wxT("LIGHT GREY"), 192, 192, 192},
325 {wxT("LIGHT STEEL BLUE"), 143, 143, 188},
326 {wxT("LIME GREEN"), 50, 204, 50},
327 {wxT("LIGHT MAGENTA"), 255, 0, 255},
328 {wxT("MAGENTA"), 255, 0, 255},
329 {wxT("MAROON"), 142, 35, 107},
330 {wxT("MEDIUM AQUAMARINE"), 50, 204, 153},
331 {wxT("MEDIUM GREY"), 100, 100, 100},
332 {wxT("MEDIUM BLUE"), 50, 50, 204},
333 {wxT("MEDIUM FOREST GREEN"), 107, 142, 35},
334 {wxT("MEDIUM GOLDENROD"), 234, 234, 173},
335 {wxT("MEDIUM ORCHID"), 147, 112, 219},
336 {wxT("MEDIUM SEA GREEN"), 66, 111, 66},
337 {wxT("MEDIUM SLATE BLUE"), 127, 0, 255},
338 {wxT("MEDIUM SPRING GREEN"), 127, 255, 0},
339 {wxT("MEDIUM TURQUOISE"), 112, 219, 219},
340 {wxT("MEDIUM VIOLET RED"), 219, 112, 147},
341 {wxT("MIDNIGHT BLUE"), 47, 47, 79},
342 {wxT("NAVY"), 35, 35, 142},
343 {wxT("ORANGE"), 204, 50, 50},
344 {wxT("ORANGE RED"), 255, 0, 127},
345 {wxT("ORCHID"), 219, 112, 219},
346 {wxT("PALE GREEN"), 143, 188, 143},
347 {wxT("PINK"), 255, 192, 203},
348 {wxT("PLUM"), 234, 173, 234},
349 {wxT("PURPLE"), 176, 0, 255},
350 {wxT("RED"), 255, 0, 0},
351 {wxT("SALMON"), 111, 66, 66},
352 {wxT("SEA GREEN"), 35, 142, 107},
353 {wxT("SIENNA"), 142, 107, 35},
354 {wxT("SKY BLUE"), 50, 153, 204},
355 {wxT("SLATE BLUE"), 0, 127, 255},
356 {wxT("SPRING GREEN"), 0, 255, 127},
357 {wxT("STEEL BLUE"), 35, 107, 142},
358 {wxT("TAN"), 219, 147, 112},
359 {wxT("THISTLE"), 216, 191, 216},
360 {wxT("TURQUOISE"), 173, 234, 234},
361 {wxT("VIOLET"), 79, 47, 79},
362 {wxT("VIOLET RED"), 204, 50, 153},
363 {wxT("WHEAT"), 216, 216, 191},
364 {wxT("WHITE"), 255, 255, 255},
365 {wxT("YELLOW"), 255, 255, 0},
366 {wxT("YELLOW GREEN"), 153, 204, 50}
371 for ( n
= 0; n
< WXSIZEOF(wxColourTable
); n
++ )
373 const wxColourDesc
& cc
= wxColourTable
[n
];
374 (*m_map
)[cc
.name
] = new wxColour(cc
.r
, cc
.g
, cc
.b
);
378 m_palTable
= new long[n
];
379 for ( n
= 0; n
< WXSIZEOF(wxColourTable
); n
++ )
381 const wxColourDesc
& cc
= wxColourTable
[n
];
382 m_palTable
[n
] = OS2RGB(cc
.r
,cc
.g
,cc
.b
);
388 // ----------------------------------------------------------------------------
389 // wxColourDatabase operations
390 // ----------------------------------------------------------------------------
392 void wxColourDatabase::AddColour(const wxString
& name
, const wxColour
& colour
)
396 // canonicalize the colour names before using them as keys: they should be
398 wxString colName
= name
;
401 // ... and we also allow both grey/gray
402 wxString colNameAlt
= colName
;
403 if ( !colNameAlt
.Replace(_T("GRAY"), _T("GREY")) )
405 // but in this case it is not necessary so avoid extra search below
409 wxStringToColourHashMap::iterator it
= m_map
->find(colName
);
410 if ( it
== m_map
->end() && !colNameAlt
.empty() )
411 it
= m_map
->find(colNameAlt
);
412 if ( it
!= m_map
->end() )
414 *(it
->second
) = colour
;
418 (*m_map
)[colName
] = new wxColour(colour
);
422 wxColour
wxColourDatabase::Find(const wxString
& colour
) const
424 wxColourDatabase
* const self
= wxConstCast(this, wxColourDatabase
);
427 // make the comparaison case insensitive and also match both grey and gray
428 wxString colName
= colour
;
430 wxString colNameAlt
= colName
;
431 if ( !colNameAlt
.Replace(_T("GRAY"), _T("GREY")) )
434 wxStringToColourHashMap::iterator it
= m_map
->find(colName
);
435 if ( it
== m_map
->end() && !colNameAlt
.empty() )
436 it
= m_map
->find(colNameAlt
);
437 if ( it
!= m_map
->end() )
438 return *(it
->second
);
440 // we did not find any result in existing colours:
441 // we won't use wxString -> wxColour conversion because the
442 // wxColour::Set(const wxString &) function which does that conversion
443 // internally uses this function (wxColourDatabase::Find) and we want
444 // to avoid infinite recursion !
448 wxString
wxColourDatabase::FindName(const wxColour
& colour
) const
450 wxColourDatabase
* const self
= wxConstCast(this, wxColourDatabase
);
453 typedef wxStringToColourHashMap::iterator iterator
;
455 for ( iterator it
= m_map
->begin(), en
= m_map
->end(); it
!= en
; ++it
)
457 if ( *(it
->second
) == colour
)
461 return wxEmptyString
;
464 // ----------------------------------------------------------------------------
465 // deprecated wxColourDatabase methods
466 // ----------------------------------------------------------------------------
468 #if WXWIN_COMPATIBILITY_2_6
469 wxColour
*wxColourDatabase::FindColour(const wxString
& name
)
471 // This function is deprecated, use Find() instead.
472 // Formerly this function sometimes would return a deletable pointer and
473 // sometimes a non-deletable one (when returning a colour from the database).
474 // Trying to delete the latter anyway results in problems, so probably
475 // nobody ever freed the pointers. Currently it always returns a new
476 // instance, which means there will be memory leaks.
477 wxLogDebug(wxT("wxColourDataBase::FindColour():")
478 wxT(" Please use wxColourDataBase::Find() instead"));
480 // using a static variable here is not the most elegant solution but unless
481 // we want to make wxStringToColourHashMap public (i.e. move it to the
482 // header) so that we could have a member function returning
483 // wxStringToColourHashMap::iterator, there is really no good way to do it
486 // and knowing that this function is going to disappear in the next release
487 // anyhow I don't want to waste time on this
489 static wxColour s_col
;
495 return new wxColour(s_col
);
497 #endif // WXWIN_COMPATIBILITY_2_6
499 // ============================================================================
501 // ============================================================================
503 static wxStockGDI gs_wxStockGDI_instance
;
504 wxStockGDI
* wxStockGDI::ms_instance
= &gs_wxStockGDI_instance
;
505 wxObject
* wxStockGDI::ms_stockObject
[ITEMCOUNT
];
507 wxStockGDI::wxStockGDI()
511 wxStockGDI::~wxStockGDI()
515 void wxStockGDI::DeleteAll()
517 for (unsigned i
= 0; i
< ITEMCOUNT
; i
++)
519 delete ms_stockObject
[i
];
520 ms_stockObject
[i
] = NULL
;
524 const wxBrush
* wxStockGDI::GetBrush(Item item
)
526 wxBrush
* brush
= wx_static_cast(wxBrush
*, ms_stockObject
[item
]);
532 brush
= new wxBrush(*GetColour(COLOUR_BLACK
), wxSOLID
);
535 brush
= new wxBrush(*GetColour(COLOUR_BLUE
), wxSOLID
);
538 brush
= new wxBrush(*GetColour(COLOUR_CYAN
), wxSOLID
);
541 brush
= new wxBrush(*GetColour(COLOUR_GREEN
), wxSOLID
);
544 brush
= new wxBrush(wxColour(wxT("GREY")), wxSOLID
);
546 case BRUSH_LIGHTGREY
:
547 brush
= new wxBrush(*GetColour(COLOUR_LIGHTGREY
), wxSOLID
);
549 case BRUSH_MEDIUMGREY
:
550 brush
= new wxBrush(wxColour(wxT("MEDIUM GREY")), wxSOLID
);
553 brush
= new wxBrush(*GetColour(COLOUR_RED
), wxSOLID
);
555 case BRUSH_TRANSPARENT
:
556 brush
= new wxBrush(*GetColour(COLOUR_BLACK
), wxTRANSPARENT
);
559 brush
= new wxBrush(*GetColour(COLOUR_WHITE
), wxSOLID
);
564 ms_stockObject
[item
] = brush
;
569 const wxColour
* wxStockGDI::GetColour(Item item
)
571 wxColour
* colour
= wx_static_cast(wxColour
*, ms_stockObject
[item
]);
577 colour
= new wxColour(0, 0, 0);
580 colour
= new wxColour(0, 0, 255);
583 colour
= new wxColour(wxT("CYAN"));
586 colour
= new wxColour(0, 255, 0);
588 case COLOUR_LIGHTGREY
:
589 colour
= new wxColour(wxT("LIGHT GREY"));
592 colour
= new wxColour(255, 0, 0);
595 colour
= new wxColour(255, 255, 255);
600 ms_stockObject
[item
] = colour
;
605 const wxCursor
* wxStockGDI::GetCursor(Item item
)
607 wxCursor
* cursor
= wx_static_cast(wxCursor
*, ms_stockObject
[item
]);
613 cursor
= new wxCursor(wxCURSOR_CROSS
);
615 case CURSOR_HOURGLASS
:
616 cursor
= new wxCursor(wxCURSOR_WAIT
);
618 case CURSOR_STANDARD
:
619 cursor
= new wxCursor(wxCURSOR_ARROW
);
624 ms_stockObject
[item
] = cursor
;
629 const wxFont
* wxStockGDI::GetFont(Item item
)
631 wxFont
* font
= wx_static_cast(wxFont
*, ms_stockObject
[item
]);
637 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize(), wxROMAN
, wxITALIC
, wxNORMAL
);
640 font
= new wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT
));
643 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize() - 2, wxSWISS
, wxNORMAL
, wxNORMAL
);
646 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize(), wxSWISS
, wxNORMAL
, wxNORMAL
);
651 ms_stockObject
[item
] = font
;
656 const wxPen
* wxStockGDI::GetPen(Item item
)
658 wxPen
* pen
= wx_static_cast(wxPen
*, ms_stockObject
[item
]);
664 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxSOLID
);
666 case PEN_BLACKDASHED
:
667 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxSHORT_DASH
);
670 pen
= new wxPen(*GetColour(COLOUR_CYAN
), 1, wxSOLID
);
673 pen
= new wxPen(*GetColour(COLOUR_GREEN
), 1, wxSOLID
);
676 pen
= new wxPen(wxColour(wxT("GREY")), 1, wxSOLID
);
679 pen
= new wxPen(*GetColour(COLOUR_LIGHTGREY
), 1, wxSOLID
);
682 pen
= new wxPen(wxColour(wxT("MEDIUM GREY")), 1, wxSOLID
);
685 pen
= new wxPen(*GetColour(COLOUR_RED
), 1, wxSOLID
);
687 case PEN_TRANSPARENT
:
688 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxTRANSPARENT
);
691 pen
= new wxPen(*GetColour(COLOUR_WHITE
), 1, wxSOLID
);
696 ms_stockObject
[item
] = pen
;
701 void wxInitializeStockLists()
703 wxTheColourDatabase
= new wxColourDatabase
;
705 wxTheBrushList
= new wxBrushList
;
706 wxThePenList
= new wxPenList
;
707 wxTheFontList
= new wxFontList
;
710 void wxDeleteStockLists()
712 wxDELETE(wxTheBrushList
);
713 wxDELETE(wxThePenList
);
714 wxDELETE(wxTheFontList
);
717 // ============================================================================
718 // wxTheXXXList stuff (semi-obsolete)
719 // ============================================================================
721 wxGDIObjListBase::wxGDIObjListBase()
725 wxGDIObjListBase::~wxGDIObjListBase()
727 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
729 delete wx_static_cast(wxObject
*, node
->GetData());
733 wxPen
*wxPenList::FindOrCreatePen (const wxColour
& colour
, int width
, int style
)
735 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
737 wxPen
*each_pen
= (wxPen
*) node
->GetData ();
739 each_pen
->GetWidth () == width
&&
740 each_pen
->GetStyle () == style
&&
741 each_pen
->GetColour ().Red () == colour
.Red () &&
742 each_pen
->GetColour ().Green () == colour
.Green () &&
743 each_pen
->GetColour ().Blue () == colour
.Blue ())
748 wxPen
penTmp(colour
, width
, style
);
751 pen
= new wxPen(penTmp
);
758 wxBrush
*wxBrushList::FindOrCreateBrush (const wxColour
& colour
, int style
)
760 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
762 wxBrush
*each_brush
= (wxBrush
*) node
->GetData ();
764 each_brush
->GetStyle () == style
&&
765 each_brush
->GetColour ().Red () == colour
.Red () &&
766 each_brush
->GetColour ().Green () == colour
.Green () &&
767 each_brush
->GetColour ().Blue () == colour
.Blue ())
771 wxBrush
* brush
= NULL
;
772 wxBrush
brushTmp(colour
, style
);
775 brush
= new wxBrush(brushTmp
);
782 wxFont
*wxFontList::FindOrCreateFont(int pointSize
,
787 const wxString
& facename
,
788 wxFontEncoding encoding
)
791 wxList::compatibility_iterator node
;
792 for (node
= list
.GetFirst(); node
; node
= node
->GetNext())
794 font
= (wxFont
*)node
->GetData();
796 font
->GetPointSize () == pointSize
&&
797 font
->GetStyle () == style
&&
798 font
->GetWeight () == weight
&&
799 font
->GetUnderlined () == underline
)
801 int fontFamily
= font
->GetFamily();
803 #if defined(__WXGTK__)
804 // under GTK the default family is wxSWISS, so looking for a font
805 // with wxDEFAULT family should return a wxSWISS one instead of
806 // creating a new one
807 bool same
= (fontFamily
== family
) ||
808 (fontFamily
== wxSWISS
&& family
== wxDEFAULT
);
810 // VZ: but why elsewhere do we require an exact match? mystery...
811 bool same
= fontFamily
== family
;
814 // empty facename matches anything at all: this is bad because
815 // depending on which fonts are already created, we might get back
816 // a different font if we create it with empty facename, but it is
817 // still better than never matching anything in the cache at all
819 if ( same
&& !facename
.empty() )
821 const wxString
& fontFace
= font
->GetFaceName();
823 // empty facename matches everything
824 same
= !fontFace
|| fontFace
== facename
;
827 if ( same
&& (encoding
!= wxFONTENCODING_DEFAULT
) )
829 // have to match the encoding too
830 same
= font
->GetEncoding() == encoding
;
840 // font not found, create the new one
842 wxFont
fontTmp(pointSize
, family
, style
, weight
, underline
, facename
, encoding
);
845 font
= new wxFont(fontTmp
);
852 #if WXWIN_COMPATIBILITY_2_6
853 void wxBrushList::AddBrush(wxBrush
*) { }
854 void wxBrushList::RemoveBrush(wxBrush
*) { }
855 void wxFontList::AddFont(wxFont
*) { }
856 void wxFontList::RemoveFont(wxFont
*) { }
857 void wxPenList::AddPen(wxPen
*) { }
858 void wxPenList::RemovePen(wxPen
*) { }
861 wxSize
wxGetDisplaySize()
864 wxDisplaySize(& x
, & y
);
868 wxRect
wxGetClientDisplayRect()
870 int x
, y
, width
, height
;
871 wxClientDisplayRect(&x
, &y
, &width
, &height
); // call plat-specific version
872 return wxRect(x
, y
, width
, height
);
875 wxSize
wxGetDisplaySizeMM()
878 wxDisplaySizeMM(& x
, & y
);
882 wxResourceCache::~wxResourceCache ()
884 wxList::compatibility_iterator node
= GetFirst ();
886 wxObject
*item
= (wxObject
*)node
->GetData();
889 node
= node
->GetNext ();