IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
-#ifndef IS_HATCH
- // IS_HATCH exists for WXWIN_COMPATIBILITY_2_4 only
- // but wxMotif needs it for its internals here
- #define IS_HATCH(s) ((s)>=wxFIRST_HATCH && (s)<=wxLAST_HATCH)
-#endif
+#define IS_HATCH(s) ((s)>=wxFIRST_HATCH && (s)<=wxLAST_HATCH)
// FIXME: left over after removal of wxDC::GetOptimization()
#define GET_OPTIMIZATION false
gcvalues.graphics_exposures = False;
gcvalues.subwindow_mode = IncludeInferiors;
gcvalues.line_width = 1;
+#if !wxMOTIF_NEW_FONT_HANDLING
+ WXFontStructPtr pFontStruct = m_font.GetFontStruct(m_userScaleY*m_logicalScaleY, m_display);
+ gcvalues.font = ((XFontStruct*)pFontStruct)->fid;
+#endif
m_gc = (WXGC) XCreateGC (display, RootWindow (display, DefaultScreen (display)),
- GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
+ GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode
+#if !wxMOTIF_NEW_FONT_HANDLING
+ | GCFont
+#endif
+ ,
&gcvalues);
if (m_window->GetBackingPixmap())
#if wxMOTIF_NEW_FONT_HANDLING
XmbDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), fset, (GC) m_gcBacking,
XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
- wxConstCast(text.c_str(), char), slen);
+ text.mb_str(), slen);
#else
XDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
- wxConstCast(text.c_str(), char), slen);
+ text.mb_str(), slen);
#endif
}
void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading,
- wxFont *font ) const
+ const wxFont *font ) const
{
wxCHECK_RET( Ok(), "invalid dc" );
if (m_window && m_window->GetBackingPixmap())
XSetStipple ((Display*) m_display,(GC) m_gcBacking, myStipple);
}
- else if (m_currentStipple.Ok()
- && ((m_currentStipple != oldStipple) || !GET_OPTIMIZATION))
+ else if (m_currentStyle == wxSTIPPLE && m_currentStipple.Ok()
+ && ((!m_currentStipple.IsSameAs(oldStipple)) || !GET_OPTIMIZATION))
{
XSetStipple ((Display*) m_display, (GC) m_gc, (Pixmap) m_currentStipple.GetDrawable());
{
wxDC::DoSetClippingRegion( x, y, width, height );
- wxRegion temp(x, y, width, height);
+ wxRegion temp(XLOG2DEV(x), YLOG2DEV(y),
+ XLOG2DEVREL(width), YLOG2DEVREL(height));
SetDCClipping(temp.GetX11Region());
void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion& region )
{
- wxRect box = region.GetBox();
-
- wxDC::DoSetClippingRegion( box.x, box.y, box.width, box.height );
-
SetDCClipping(region.GetX11Region());
// Needs to work differently for Pixmap: without this,
// there's a nasty (Display*) m_display bug. 8/12/94
if (m_window && m_window->GetBackingPixmap())
{
+ wxRect box = region.GetBox();
+
XRectangle rects[1];
rects[0].x = (short)XLOG2DEV_2(box.x);
rects[0].y = (short)YLOG2DEV_2(box.y);
XPutImage(dest_display, dest, destgc, destimage, 0, 0, destx, desty, w, h);
XDestroyImage(destimage);
- if (more)
+ if (more && cache)
*cache = image;
else
XDestroyImage(image);