X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c444f19cf1bdb3cb26bb3c123434fe23c808093..4c7e33c5ea8f4e68a1468333e26251d0271613b0:/src/common/gdicmn.cpp?ds=inline diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 1e98af34ef..d97f067d22 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -29,6 +29,7 @@ #include "wx/cursor.h" #include "wx/font.h" #include "wx/palette.h" +#include "wx/app.h" #include "wx/log.h" #include @@ -37,6 +38,10 @@ #include #endif +#ifdef __WXMOTIF__ +#include +#endif + #if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxColourDatabase, wxList) IMPLEMENT_DYNAMIC_CLASS(wxFontList, wxList) @@ -251,7 +256,11 @@ void wxColourDatabase::Initialize () wxColour *wxColourDatabase::FindColour(const wxString& colour) { - wxNode *node = Find((char *) (const char *)colour); + // VZ: make the comparaison case insensitive + wxString str = colour; + str.MakeUpper(); + + wxNode *node = Find(str); if (node) return (wxColour *)node->Data(); @@ -271,7 +280,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) if (!(col->Ok())) { delete col; - return NULL; + return (wxColour *) NULL; } Append( colour, col ); return col; @@ -283,7 +292,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) XColor xcolour; #ifdef __WXMOTIF__ - Display *display = XtDisplay(wxTheApp->topLevel) ; + Display *display = XtDisplay((Widget) wxTheApp->GetTopLevelWidget()) ; #endif #ifdef __XVIEW__ Xv_Screen screen = xv_get(xview_server, SERVER_NTH_SCREEN, 0); @@ -292,7 +301,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) #endif /* MATTHEW: [4] Use wxGetMainColormap */ - if (!XParseColor(display, wxGetMainColormap(display), colour,&xcolour)) + if (!XParseColor(display, (Colormap) wxTheApp->GetMainColormap((WXDisplay*) display), colour,&xcolour)) return NULL; unsigned char r = (unsigned char)(xcolour.red >> 8); @@ -340,7 +349,8 @@ void wxInitializeStockObjects () #ifdef __WXMOTIF__ #endif #ifdef __X__ - wxFontPool = new XFontPool; + // TODO + // wxFontPool = new XFontPool; #endif wxNORMAL_FONT = new wxFont (12, wxMODERN, wxNORMAL, wxNORMAL); @@ -439,7 +449,6 @@ wxBitmapList::wxBitmapList () wxBitmapList::~wxBitmapList () { - wxLogDebug("~wxBitmapList: count = %d", Number()); #ifdef __WXMSW__ wxNode *node = First (); @@ -509,7 +518,7 @@ wxPen *wxPenList::FindOrCreatePen (const wxString& colour, int width, int style) if (the_colour) return FindOrCreatePen (*the_colour, width, style); else - return NULL; + return (wxPen *) NULL; } wxBrushList::~wxBrushList () @@ -559,7 +568,7 @@ wxBrush *wxBrushList::FindOrCreateBrush (const wxString& colour, int style) if (the_colour) return FindOrCreateBrush (*the_colour, style); else - return NULL; + return (wxBrush *) NULL; } void wxBrushList::RemoveBrush (wxBrush * brush) @@ -569,7 +578,6 @@ void wxBrushList::RemoveBrush (wxBrush * brush) wxFontList::~wxFontList () { -#ifdef __WXMSW__ wxNode *node = First (); while (node) { @@ -583,7 +591,6 @@ wxFontList::~wxFontList () delete font; node = next; } -#endif } void wxFontList::AddFont (wxFont * font) @@ -607,12 +614,12 @@ wxFont *wxFontList:: each_font->GetStyle () == Style && each_font->GetWeight () == Weight && each_font->GetUnderlined () == underline && -#if defined(__X__) || (defined(__WXMSW__) && USE_PORTABLE_FONTS_IN_MSW) - each_font->GetFontId () == FamilyOrFontId) /* New font system */ -#else + //#if defined(__X__) + // each_font->GetFontId () == FamilyOrFontId) /* New font system */ + //#else each_font->GetFamily () == FamilyOrFontId && (!each_font->GetFaceName() || each_font->GetFaceName() == Face)) -#endif + //#endif return each_font; } wxFont *font = new wxFont (PointSize, FamilyOrFontId, Style, Weight, underline, Face);