1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Common GDI classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "gdicmn.h"
17 #define XtDisplay XTDISPLAY
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
28 #include "wx/gdicmn.h"
31 #include "wx/bitmap.h"
33 #include "wx/cursor.h"
35 #include "wx/palette.h"
39 #include "wx/settings.h"
40 #include "wx/hashmap.h"
46 #include "wx/msw/wrapwin.h"
51 #pragma message disable nosimpint
55 #pragma message enable nosimpint
64 #include "wx/mac/private.h"
65 #include "wx/mac/uma.h"
68 IMPLEMENT_ABSTRACT_CLASS(wxDCBase
, wxObject
)
70 wxRect::wxRect(const wxPoint
& topLeft
, const wxPoint
& bottomRight
)
74 width
= bottomRight
.x
- topLeft
.x
+ 1;
75 height
= bottomRight
.y
- topLeft
.y
+ 1;
90 wxRect::wxRect(const wxPoint
& point
, const wxSize
& size
)
92 x
= point
.x
; y
= point
.y
;
93 width
= size
.x
; height
= size
.y
;
96 bool wxRect::operator==(const wxRect
& rect
) const
98 return ((x
== rect
.x
) &&
100 (width
== rect
.width
) &&
101 (height
== rect
.height
));
104 wxRect
& wxRect::operator += (const wxRect
& rect
)
106 *this = (*this + rect
);
110 wxRect
wxRect::operator + (const wxRect
& rect
) const
112 int x1
= wxMin(this->x
, rect
.x
);
113 int y1
= wxMin(this->y
, rect
.y
);
114 int y2
= wxMax(y
+height
, rect
.height
+rect
.y
);
115 int x2
= wxMax(x
+width
, rect
.width
+rect
.x
);
116 return wxRect(x1
, y1
, x2
-x1
, y2
-y1
);
119 wxRect
& wxRect::Inflate(wxCoord dx
, wxCoord dy
)
126 // check that we didn't make the rectangle invalid by accident (you almost
127 // never want to have negative coords and never want negative size)
133 // what else can we do?
142 bool wxRect::Inside(int cx
, int cy
) const
144 return ( (cx
>= x
) && (cy
>= y
)
145 && ((cy
- y
) < height
)
146 && ((cx
- x
) < width
)
150 wxRect
& wxRect::Intersect(const wxRect
& rect
)
159 if ( x2
> rect
.GetRight() )
160 x2
= rect
.GetRight();
161 if ( y2
> rect
.GetBottom() )
162 y2
= rect
.GetBottom();
167 if ( width
<= 0 || height
<= 0 )
176 bool wxRect::Intersects(const wxRect
& rect
) const
178 wxRect r
= Intersect(rect
);
180 // if there is no intersection, both width and height are 0
184 WX_DECLARE_STRING_HASH_MAP( wxColour
*, wxStringToColourHashMap
);
186 wxColourDatabase::wxColourDatabase ()
188 m_map
= new wxStringToColourHashMap
;
191 wxColourDatabase::~wxColourDatabase ()
193 WX_CLEAR_HASH_MAP(wxStringToColourHashMap
, *m_map
);
198 delete [] m_palTable
;
202 // Colour database stuff
203 void wxColourDatabase::Initialize ()
205 static const struct wxColourDesc
212 {wxT("AQUAMARINE"),112, 219, 147},
213 {wxT("BLACK"),0, 0, 0},
214 {wxT("BLUE"), 0, 0, 255},
215 {wxT("BLUE VIOLET"), 159, 95, 159},
216 {wxT("BROWN"), 165, 42, 42},
217 {wxT("CADET BLUE"), 95, 159, 159},
218 {wxT("CORAL"), 255, 127, 0},
219 {wxT("CORNFLOWER BLUE"), 66, 66, 111},
220 {wxT("CYAN"), 0, 255, 255},
221 {wxT("DARK GREY"), 47, 47, 47}, // ?
223 {wxT("DARK GREEN"), 47, 79, 47},
224 {wxT("DARK OLIVE GREEN"), 79, 79, 47},
225 {wxT("DARK ORCHID"), 153, 50, 204},
226 {wxT("DARK SLATE BLUE"), 107, 35, 142},
227 {wxT("DARK SLATE GREY"), 47, 79, 79},
228 {wxT("DARK TURQUOISE"), 112, 147, 219},
229 {wxT("DIM GREY"), 84, 84, 84},
230 {wxT("FIREBRICK"), 142, 35, 35},
231 {wxT("FOREST GREEN"), 35, 142, 35},
232 {wxT("GOLD"), 204, 127, 50},
233 {wxT("GOLDENROD"), 219, 219, 112},
234 {wxT("GREY"), 128, 128, 128},
235 {wxT("GREEN"), 0, 255, 0},
236 {wxT("GREEN YELLOW"), 147, 219, 112},
237 {wxT("INDIAN RED"), 79, 47, 47},
238 {wxT("KHAKI"), 159, 159, 95},
239 {wxT("LIGHT BLUE"), 191, 216, 216},
240 {wxT("LIGHT GREY"), 192, 192, 192},
241 {wxT("LIGHT STEEL BLUE"), 143, 143, 188},
242 {wxT("LIME GREEN"), 50, 204, 50},
243 {wxT("LIGHT MAGENTA"), 255, 0, 255},
244 {wxT("MAGENTA"), 255, 0, 255},
245 {wxT("MAROON"), 142, 35, 107},
246 {wxT("MEDIUM AQUAMARINE"), 50, 204, 153},
247 {wxT("MEDIUM GREY"), 100, 100, 100},
248 {wxT("MEDIUM BLUE"), 50, 50, 204},
249 {wxT("MEDIUM FOREST GREEN"), 107, 142, 35},
250 {wxT("MEDIUM GOLDENROD"), 234, 234, 173},
251 {wxT("MEDIUM ORCHID"), 147, 112, 219},
252 {wxT("MEDIUM SEA GREEN"), 66, 111, 66},
253 {wxT("MEDIUM SLATE BLUE"), 127, 0, 255},
254 {wxT("MEDIUM SPRING GREEN"), 127, 255, 0},
255 {wxT("MEDIUM TURQUOISE"), 112, 219, 219},
256 {wxT("MEDIUM VIOLET RED"), 219, 112, 147},
257 {wxT("MIDNIGHT BLUE"), 47, 47, 79},
258 {wxT("NAVY"), 35, 35, 142},
259 {wxT("ORANGE"), 204, 50, 50},
260 {wxT("ORANGE RED"), 255, 0, 127},
261 {wxT("ORCHID"), 219, 112, 219},
262 {wxT("PALE GREEN"), 143, 188, 143},
263 {wxT("PINK"), 188, 143, 234},
264 {wxT("PLUM"), 234, 173, 234},
265 {wxT("PURPLE"), 176, 0, 255},
266 {wxT("RED"), 255, 0, 0},
267 {wxT("SALMON"), 111, 66, 66},
268 {wxT("SEA GREEN"), 35, 142, 107},
269 {wxT("SIENNA"), 142, 107, 35},
270 {wxT("SKY BLUE"), 50, 153, 204},
271 {wxT("SLATE BLUE"), 0, 127, 255},
272 {wxT("SPRING GREEN"), 0, 255, 127},
273 {wxT("STEEL BLUE"), 35, 107, 142},
274 {wxT("TAN"), 219, 147, 112},
275 {wxT("THISTLE"), 216, 191, 216},
276 {wxT("TURQUOISE"), 173, 234, 234},
277 {wxT("VIOLET"), 79, 47, 79},
278 {wxT("VIOLET RED"), 204, 50, 153},
279 {wxT("WHEAT"), 216, 216, 191},
280 {wxT("WHITE"), 255, 255, 255},
281 {wxT("YELLOW"), 255, 255, 0},
282 {wxT("YELLOW GREEN"), 153, 204, 50},
283 {wxT("YELLOW GREEN"), 153, 204, 50}
288 for ( n
= 0; n
< WXSIZEOF(wxColourTable
); n
++ )
290 const wxColourDesc
& cc
= wxColourTable
[n
];
291 AddColour(cc
.name
, new wxColour(cc
.r
,cc
.g
,cc
.b
));
294 m_palTable
= new long[n
];
295 for ( n
= 0; n
< WXSIZEOF(wxColourTable
); n
++ )
297 const wxColourDesc
& cc
= wxColourTable
[n
];
298 m_palTable
[n
] = OS2RGB(cc
.r
,cc
.g
,cc
.b
);
305 * Changed by Ian Brown, July 1994.
307 * When running under X, the Colour Database starts off empty. The X server
308 * is queried for the colour first time after which it is entered into the
309 * database. This allows our client to use the server colour database which
310 * is hopefully gamma corrected for the display being used.
313 wxColour
*wxColourDatabase::FindColour(const wxString
& colour
)
315 return FindColour(colour
, true);
318 wxColour
*wxColourDatabase::FindColourNoAdd(const wxString
& colour
) const
320 return ((wxColourDatabase
*)this)->FindColour(colour
, false);
323 void wxColourDatabase::AddColour (const wxString
& name
, wxColour
* colour
)
325 wxString colName
= name
;
327 wxString colName2
= colName
;
328 if ( !colName2
.Replace(_T("GRAY"), _T("GREY")) )
331 wxStringToColourHashMap::iterator it
= m_map
->find(colName
);
332 if ( it
== m_map
->end() )
333 it
= m_map
->find(colName2
);
334 if ( it
!= m_map
->end() )
340 (*m_map
)[name
] = colour
;
343 wxColour
*wxColourDatabase::FindColour(const wxString
& colour
, bool add
)
345 // VZ: make the comparaison case insensitive and also match both grey and
347 wxString colName
= colour
;
349 wxString colName2
= colName
;
350 if ( !colName2
.Replace(_T("GRAY"), _T("GREY")) )
353 wxStringToColourHashMap::iterator it
= m_map
->find(colName
);
354 if ( it
== m_map
->end() )
355 it
= m_map
->find(colName2
);
356 if ( it
!= m_map
->end() )
372 // TODO for other implementations. This should really go into
373 // platform-specific directories.
385 wxColour
*col
= new wxColour( colour
);
390 return (wxColour
*) NULL
;
392 AddColour(colour
, col
);
400 Display
*display
= XtDisplay((Widget
) wxTheApp
->GetTopLevelWidget()) ;
403 Display
* display
= (Display
*) wxGetDisplay();
405 /* MATTHEW: [4] Use wxGetMainColormap */
406 if (!XParseColor(display
, (Colormap
) wxTheApp
->GetMainColormap((WXDisplay
*) display
), colour
.ToAscii() ,&xcolour
))
410 unsigned char r
= (unsigned char)(xcolour
.red
);
411 unsigned char g
= (unsigned char)(xcolour
.green
);
412 unsigned char b
= (unsigned char)(xcolour
.blue
);
414 unsigned char r
= (unsigned char)(xcolour
.red
>> 8);
415 unsigned char g
= (unsigned char)(xcolour
.green
>> 8);
416 unsigned char b
= (unsigned char)(xcolour
.blue
>> 8);
419 wxColour
*col
= new wxColour(r
, g
, b
);
420 AddColour(colour
, col
);
426 wxString
wxColourDatabase::FindName (const wxColour
& colour
) const
428 unsigned char red
= colour
.Red ();
429 unsigned char green
= colour
.Green ();
430 unsigned char blue
= colour
.Blue ();
432 typedef wxStringToColourHashMap::iterator iterator
;
434 for (iterator it
= m_map
->begin(), en
= m_map
->end(); it
!= en
; ++it
)
436 wxColour
*col
= it
->second
;
438 if (col
->Red () == red
&& col
->Green () == green
&& col
->Blue () == blue
)
442 return wxEmptyString
;
445 void wxInitializeStockLists()
447 wxTheColourDatabase
= new wxColourDatabase
;
448 wxTheColourDatabase
->Initialize();
450 wxTheBrushList
= new wxBrushList
;
451 wxThePenList
= new wxPenList
;
452 wxTheFontList
= new wxFontList
;
453 wxTheBitmapList
= new wxBitmapList
;
456 void wxInitializeStockObjects ()
462 // wxFontPool = new XFontPool;
465 // why under MSW fonts shouldn't have the standard system size?
468 static const int sizeFont = 10;
472 #if defined(__WXMAC__)
479 GetThemeFont(kThemeSystemFont
, GetApplicationScript() , fontName
, &fontSize
, &fontStyle
) ;
480 sizeFont
= fontSize
;
481 wxSWISS_FONT
= new wxFont (fontSize
, wxSWISS
, wxNORMAL
, wxNORMAL
, false , wxMacMakeStringFromPascal(fontName
) );
482 #elif defined(__WXPM__)
483 static const int sizeFont
= 12;
485 wxNORMAL_FONT
= new wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT
));
486 static const int sizeFont
= wxNORMAL_FONT
->GetPointSize();
489 #if defined(__WXPM__)
491 // Basic OS/2 has a fairly limited number of fonts and these are as good
492 // as I can do to get something that looks halfway "wx" normal
494 wxNORMAL_FONT
= new wxFont (sizeFont
, wxMODERN
, wxNORMAL
, wxBOLD
);
495 wxSMALL_FONT
= new wxFont (sizeFont
- 4, wxSWISS
, wxNORMAL
, wxNORMAL
); /* Helv */
496 wxITALIC_FONT
= new wxFont (sizeFont
, wxROMAN
, wxITALIC
, wxNORMAL
);
497 wxSWISS_FONT
= new wxFont (sizeFont
, wxSWISS
, wxNORMAL
, wxNORMAL
); /* Helv */
498 #elif defined(__WXMAC__)
499 wxNORMAL_FONT
= new wxFont (sizeFont
, wxMODERN
, wxNORMAL
, wxNORMAL
);
500 wxITALIC_FONT
= new wxFont (sizeFont
, wxROMAN
, wxITALIC
, wxNORMAL
);
501 GetThemeFont(kThemeSmallSystemFont
, GetApplicationScript() , fontName
, &fontSize
, &fontStyle
) ;
502 wxSMALL_FONT
= new wxFont (fontSize
, wxSWISS
, wxNORMAL
, wxNORMAL
, false , wxMacMakeStringFromPascal( fontName
) );
504 wxSMALL_FONT
= new wxFont (sizeFont
- 2, wxSWISS
, wxNORMAL
, wxNORMAL
);
505 wxITALIC_FONT
= new wxFont (sizeFont
, wxROMAN
, wxITALIC
, wxNORMAL
);
506 wxSWISS_FONT
= new wxFont (sizeFont
, wxSWISS
, wxNORMAL
, wxNORMAL
);
509 wxRED_PEN
= new wxPen (wxT("RED"), 1, wxSOLID
);
510 wxCYAN_PEN
= new wxPen (wxT("CYAN"), 1, wxSOLID
);
511 wxGREEN_PEN
= new wxPen (wxT("GREEN"), 1, wxSOLID
);
512 wxBLACK_PEN
= new wxPen (wxT("BLACK"), 1, wxSOLID
);
513 wxWHITE_PEN
= new wxPen (wxT("WHITE"), 1, wxSOLID
);
514 wxTRANSPARENT_PEN
= new wxPen (wxT("BLACK"), 1, wxTRANSPARENT
);
515 wxBLACK_DASHED_PEN
= new wxPen (wxT("BLACK"), 1, wxSHORT_DASH
);
516 wxGREY_PEN
= new wxPen (wxT("GREY"), 1, wxSOLID
);
517 wxMEDIUM_GREY_PEN
= new wxPen (wxT("MEDIUM GREY"), 1, wxSOLID
);
518 wxLIGHT_GREY_PEN
= new wxPen (wxT("LIGHT GREY"), 1, wxSOLID
);
520 wxBLUE_BRUSH
= new wxBrush (wxT("BLUE"), wxSOLID
);
521 wxGREEN_BRUSH
= new wxBrush (wxT("GREEN"), wxSOLID
);
522 wxWHITE_BRUSH
= new wxBrush (wxT("WHITE"), wxSOLID
);
523 wxBLACK_BRUSH
= new wxBrush (wxT("BLACK"), wxSOLID
);
524 wxTRANSPARENT_BRUSH
= new wxBrush (wxT("BLACK"), wxTRANSPARENT
);
525 wxCYAN_BRUSH
= new wxBrush (wxT("CYAN"), wxSOLID
);
526 wxRED_BRUSH
= new wxBrush (wxT("RED"), wxSOLID
);
527 wxGREY_BRUSH
= new wxBrush (wxT("GREY"), wxSOLID
);
528 wxMEDIUM_GREY_BRUSH
= new wxBrush (wxT("MEDIUM GREY"), wxSOLID
);
529 wxLIGHT_GREY_BRUSH
= new wxBrush (wxT("LIGHT GREY"), wxSOLID
);
531 wxBLACK
= new wxColour (wxT("BLACK"));
532 wxWHITE
= new wxColour (wxT("WHITE"));
533 wxRED
= new wxColour (wxT("RED"));
534 wxBLUE
= new wxColour (wxT("BLUE"));
535 wxGREEN
= new wxColour (wxT("GREEN"));
536 wxCYAN
= new wxColour (wxT("CYAN"));
537 wxLIGHT_GREY
= new wxColour (wxT("LIGHT GREY"));
539 wxSTANDARD_CURSOR
= new wxCursor (wxCURSOR_ARROW
);
540 wxHOURGLASS_CURSOR
= new wxCursor (wxCURSOR_WAIT
);
541 wxCROSS_CURSOR
= new wxCursor (wxCURSOR_CROSS
);
544 void wxDeleteStockObjects ()
546 wxDELETE(wxNORMAL_FONT
);
547 wxDELETE(wxSMALL_FONT
);
548 wxDELETE(wxITALIC_FONT
);
549 wxDELETE(wxSWISS_FONT
);
552 wxDELETE(wxCYAN_PEN
);
553 wxDELETE(wxGREEN_PEN
);
554 wxDELETE(wxBLACK_PEN
);
555 wxDELETE(wxWHITE_PEN
);
556 wxDELETE(wxTRANSPARENT_PEN
);
557 wxDELETE(wxBLACK_DASHED_PEN
);
558 wxDELETE(wxGREY_PEN
);
559 wxDELETE(wxMEDIUM_GREY_PEN
);
560 wxDELETE(wxLIGHT_GREY_PEN
);
562 wxDELETE(wxBLUE_BRUSH
);
563 wxDELETE(wxGREEN_BRUSH
);
564 wxDELETE(wxWHITE_BRUSH
);
565 wxDELETE(wxBLACK_BRUSH
);
566 wxDELETE(wxTRANSPARENT_BRUSH
);
567 wxDELETE(wxCYAN_BRUSH
);
568 wxDELETE(wxRED_BRUSH
);
569 wxDELETE(wxGREY_BRUSH
);
570 wxDELETE(wxMEDIUM_GREY_BRUSH
);
571 wxDELETE(wxLIGHT_GREY_BRUSH
);
579 wxDELETE(wxLIGHT_GREY
);
581 wxDELETE(wxSTANDARD_CURSOR
);
582 wxDELETE(wxHOURGLASS_CURSOR
);
583 wxDELETE(wxCROSS_CURSOR
);
586 void wxDeleteStockLists()
588 wxDELETE(wxTheBrushList
);
589 wxDELETE(wxThePenList
);
590 wxDELETE(wxTheFontList
);
591 wxDELETE(wxTheBitmapList
);
594 // ============================================================================
595 // wxTheXXXList stuff (semi-obsolete)
596 // ============================================================================
598 wxBitmapList::wxBitmapList()
602 wxBitmapList::~wxBitmapList ()
604 wxList::compatibility_iterator node
= GetFirst ();
607 wxBitmap
*bitmap
= (wxBitmap
*) node
->GetData ();
608 wxList::compatibility_iterator next
= node
->GetNext ();
609 if (bitmap
->GetVisible())
615 // Pen and Brush lists
616 wxPenList::~wxPenList ()
618 wxList::compatibility_iterator node
= GetFirst ();
621 wxPen
*pen
= (wxPen
*) node
->GetData ();
622 wxList::compatibility_iterator next
= node
->GetNext ();
623 if (pen
->GetVisible())
629 void wxPenList::AddPen (wxPen
* pen
)
634 void wxPenList::RemovePen (wxPen
* pen
)
639 wxPen
*wxPenList::FindOrCreatePen (const wxColour
& colour
, int width
, int style
)
641 for (wxList::compatibility_iterator node
= GetFirst (); node
; node
= node
->GetNext ())
643 wxPen
*each_pen
= (wxPen
*) node
->GetData ();
645 each_pen
->GetVisible() &&
646 each_pen
->GetWidth () == width
&&
647 each_pen
->GetStyle () == style
&&
648 each_pen
->GetColour ().Red () == colour
.Red () &&
649 each_pen
->GetColour ().Green () == colour
.Green () &&
650 each_pen
->GetColour ().Blue () == colour
.Blue ())
654 wxPen
*pen
= new wxPen (colour
, width
, style
);
657 // don't save the invalid pens in the list
665 // we'll delete it ourselves later
666 pen
->SetVisible(TRUE
);
671 wxBrushList::~wxBrushList ()
673 wxList::compatibility_iterator node
= GetFirst ();
676 wxBrush
*brush
= (wxBrush
*) node
->GetData ();
677 wxList::compatibility_iterator next
= node
->GetNext ();
678 if (brush
&& brush
->GetVisible())
684 void wxBrushList::AddBrush (wxBrush
* brush
)
689 wxBrush
*wxBrushList::FindOrCreateBrush (const wxColour
& colour
, int style
)
691 for (wxList::compatibility_iterator node
= GetFirst (); node
; node
= node
->GetNext ())
693 wxBrush
*each_brush
= (wxBrush
*) node
->GetData ();
695 each_brush
->GetVisible() &&
696 each_brush
->GetStyle () == style
&&
697 each_brush
->GetColour ().Red () == colour
.Red () &&
698 each_brush
->GetColour ().Green () == colour
.Green () &&
699 each_brush
->GetColour ().Blue () == colour
.Blue ())
703 wxBrush
*brush
= new wxBrush (colour
, style
);
707 // don't put the brushes we failed to create into the list
715 // we'll delete it ourselves later
716 brush
->SetVisible(TRUE
);
721 void wxBrushList::RemoveBrush (wxBrush
* brush
)
723 DeleteObject (brush
);
726 wxFontList::~wxFontList ()
728 wxList::compatibility_iterator node
= GetFirst ();
731 // Only delete objects that are 'visible', i.e.
732 // that have been created using FindOrCreate...,
733 // where the pointers are expected to be shared
734 // (and therefore not deleted by any one part of an app).
735 wxFont
*font
= (wxFont
*) node
->GetData ();
736 wxList::compatibility_iterator next
= node
->GetNext ();
737 if (font
->GetVisible())
743 void wxFontList::AddFont (wxFont
* font
)
748 void wxFontList::RemoveFont (wxFont
* font
)
753 wxFont
*wxFontList::FindOrCreateFont(int pointSize
,
758 const wxString
& facename
,
759 wxFontEncoding encoding
)
761 wxFont
*font
= (wxFont
*)NULL
;
762 wxList::compatibility_iterator node
;
763 for ( node
= GetFirst(); node
; node
= node
->GetNext() )
765 font
= (wxFont
*)node
->GetData();
766 if ( font
->GetVisible() &&
768 font
->GetPointSize () == pointSize
&&
769 font
->GetStyle () == style
&&
770 font
->GetWeight () == weight
&&
771 font
->GetUnderlined () == underline
)
773 int fontFamily
= font
->GetFamily();
775 #if defined(__WXGTK__)
776 // under GTK the default family is wxSWISS, so looking for a font
777 // with wxDEFAULT family should return a wxSWISS one instead of
778 // creating a new one
779 bool same
= (fontFamily
== family
) ||
780 (fontFamily
== wxSWISS
&& family
== wxDEFAULT
);
782 // VZ: but why elsewhere do we require an exact match? mystery...
783 bool same
= fontFamily
== family
;
786 // empty facename matches anything at all: this is bad because
787 // depending on which fonts are already created, we might get back
788 // a different font if we create it with empty facename, but it is
789 // still better than never matching anything in the cache at all
791 if ( same
&& !!facename
)
793 const wxString
& fontFace
= font
->GetFaceName();
795 // empty facename matches everything
796 same
= !fontFace
|| fontFace
== facename
;
799 if ( same
&& (encoding
!= wxFONTENCODING_DEFAULT
) )
801 // have to match the encoding too
802 same
= font
->GetEncoding() == encoding
;
814 // font not found, create the new one
815 font
= new wxFont(pointSize
, family
, style
, weight
,
816 underline
, facename
, encoding
);
820 // and mark it as being cacheable
821 font
->SetVisible(TRUE
);
827 void wxBitmapList::AddBitmap(wxBitmap
*bitmap
)
832 void wxBitmapList::RemoveBitmap(wxBitmap
*bitmap
)
834 DeleteObject(bitmap
);
837 wxSize
wxGetDisplaySize()
840 wxDisplaySize(& x
, & y
);
844 wxRect
wxGetClientDisplayRect()
846 int x
, y
, width
, height
;
847 wxClientDisplayRect(&x
, &y
, &width
, &height
); // call plat-specific version
848 return wxRect(x
, y
, width
, height
);
851 wxSize
wxGetDisplaySizeMM()
854 wxDisplaySizeMM(& x
, & y
);
858 wxResourceCache::~wxResourceCache ()
860 wxList::compatibility_iterator node
= GetFirst ();
862 wxObject
*item
= (wxObject
*)node
->GetData();
865 node
= node
->GetNext ();