X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/59d77e838192d612729e6c8ed2216604b9912077..2e7b0a1617dbdada26531371627a1cd8a72e9149:/src/common/gdicmn.cpp diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 31e336762b..48cd85ace6 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -55,6 +55,10 @@ #endif #endif +#ifdef __WXX11__ +#include "X11/Xlib.h" +#endif + IMPLEMENT_CLASS(wxColourDatabase, wxList) IMPLEMENT_DYNAMIC_CLASS(wxFontList, wxList) IMPLEMENT_DYNAMIC_CLASS(wxPenList, wxList) @@ -370,20 +374,23 @@ 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); +#ifdef __WXX11__ + Display* display = (Display*) wxGetDisplay(); #endif - /* MATTHEW: [4] Use wxGetMainColormap */ if (!XParseColor(display, (Colormap) wxTheApp->GetMainColormap((WXDisplay*) display), colour,&xcolour)) return NULL; +#if wxUSE_NANOX + unsigned char r = (unsigned char)(xcolour.red); + unsigned char g = (unsigned char)(xcolour.green); + unsigned char b = (unsigned char)(xcolour.blue); +#else unsigned char r = (unsigned char)(xcolour.red >> 8); unsigned char g = (unsigned char)(xcolour.green >> 8); unsigned char b = (unsigned char)(xcolour.blue >> 8); - +#endif + wxColour *col = new wxColour(r, g, b); Append(colour, col);