X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/46ccb5107ff22cb5cc1b36ef2a28ea1e31b0fc91..f5419957e5794f2d10f4e125f77b2c2e2cd222d6:/src/common/gdicmn.cpp diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 69cc0cac80..642c03c3ea 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -256,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(); @@ -290,6 +294,11 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) #ifdef __WXMOTIF__ Display *display = XtDisplay((Widget) wxTheApp->GetTopLevelWidget()) ; #endif +#ifdef __XVIEW__ + Xv_Screen screen = xv_get(xview_server, SERVER_NTH_SCREEN, 0); + Xv_opaque root_window = xv_get(screen, XV_ROOT); + Display *display = (Display *)xv_get(root_window, XV_DISPLAY); +#endif /* MATTHEW: [4] Use wxGetMainColormap */ if (!XParseColor(display, (Colormap) wxTheApp->GetMainColormap((WXDisplay*) display), colour,&xcolour)) @@ -319,7 +328,7 @@ wxString wxColourDatabase::FindName (const wxColour& colour) const if (col->Red () == red && col->Green () == green && col->Blue () == blue) { - char *found = node->key.string; + const char *found = node->GetKeyString(); if (found) return wxString(found); } @@ -440,8 +449,7 @@ wxBitmapList::wxBitmapList () wxBitmapList::~wxBitmapList () { -#ifdef __WXMSW__ - +#if defined(__WXMSW__) || defined(__WXMOTIF__) wxNode *node = First (); while (node) { @@ -457,7 +465,7 @@ wxBitmapList::~wxBitmapList () // Pen and Brush lists wxPenList::~wxPenList () { -#ifdef __WXMSW__ +#if defined(__WXMSW__) || defined(__WXMOTIF__) wxNode *node = First (); while (node) { @@ -503,18 +511,9 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style) return pen; } -wxPen *wxPenList::FindOrCreatePen (const wxString& colour, int width, int style) -{ - wxColour *the_colour = wxTheColourDatabase->FindColour (colour); - if (the_colour) - return FindOrCreatePen (*the_colour, width, style); - else - return (wxPen *) NULL; -} - wxBrushList::~wxBrushList () { -#ifdef __WXMSW__ +#if defined(__WXMSW__) || defined(__WXMOTIF__) wxNode *node = First (); while (node) { @@ -553,15 +552,6 @@ wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, int style) return brush; } -wxBrush *wxBrushList::FindOrCreateBrush (const wxString& colour, int style) -{ - wxColour *the_colour = wxTheColourDatabase->FindColour (colour); - if (the_colour) - return FindOrCreateBrush (*the_colour, style); - else - return (wxBrush *) NULL; -} - void wxBrushList::RemoveBrush (wxBrush * brush) { DeleteObject (brush); @@ -630,12 +620,6 @@ wxSize wxGetDisplaySize() return wxSize(x, y); } -wxResourceCache::wxResourceCache () : wxList() { -} - -wxResourceCache::wxResourceCache (const unsigned int the_key_type) : wxList(the_key_type) { -} - wxResourceCache::~wxResourceCache () { wxNode *node = First (); while (node) {