X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68874acfedbd7dbe1aa9d17a5ccc389c7a721131..b0230a69bcf6db9a18bbdefb0c3027c6a438ed55:/src/motif/dcclient.cpp diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index a488d9466a..ba5e1cdf3c 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -82,11 +82,9 @@ static Pixmap bdiag, cdiag, fdiag, cross, horiz, verti; // macros // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC) IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC) IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) -#endif // ---------------------------------------------------------------------------- // prototypes @@ -181,16 +179,17 @@ wxWindowDC::wxWindowDC( wxWindow *window ) gcvalues.foreground = BlackPixel (display, DefaultScreen (display)); gcvalues.background = WhitePixel (display, DefaultScreen (display)); gcvalues.graphics_exposures = False; + gcvalues.subwindow_mode = IncludeInferiors; gcvalues.line_width = 1; m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), - GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, + GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode, &gcvalues); if (m_window->GetBackingPixmap()) { m_gcBacking = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)), - GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth, + GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode, &gcvalues); } @@ -237,11 +236,18 @@ void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxFAIL_MSG("not implemented"); } -bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const +bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const { - wxFAIL_MSG("not implemented"); - - return FALSE; + // Generic (and therefore rather inefficient) method. + // Could be improved. + wxMemoryDC memdc; + wxBitmap bitmap(1, 1); + memdc.SelectObject(bitmap); + memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1); + memdc.SelectObject(wxNullBitmap); + wxImage image(bitmap); + col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0)); + return TRUE; } void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ) @@ -1268,7 +1274,7 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, // draw black pixels, ignore white ones (i.e. transparent b/g) if (image.GetRed(sx, sy) == 0) { - DrawPoint(x1 + maxx - rx, cy + y1 - ry); + DrawPoint((wxCoord) (x1 + maxx - rx), (wxCoord) (cy + y1 - ry)); } else {