#ifdef __VMS__
#pragma message disable nosimpint
#endif
+#include "X11/Xlib.h"
+#include "X11/Xutil.h"
#ifdef __VMS__
#pragma message enable nosimpint
#endif
m_currentPenWidth = 1;
m_currentPenJoin = -1;
m_currentPenDashCount = -1;
- m_currentPenDash = (wxMOTIFDash*) NULL;
+ m_currentPenDash = (wxX11Dash*) NULL;
m_currentStyle = -1;
m_currentFill = -1;
// m_currentBkMode = wxTRANSPARENT;
m_currentPenWidth = 1;
m_currentPenJoin = -1;
m_currentPenDashCount = -1;
- m_currentPenDash = (wxMOTIFDash*) NULL;
+ m_currentPenDash = (wxX11Dash*) NULL;
m_currentStyle = -1;
m_currentFill = -1;
// m_currentBkMode = wxTRANSPARENT;
GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
&gcvalues);
- if (m_window->GetBackingPixmap())
- {
- m_gcBacking = (WXGC) XCreateGC (display, RootWindow (display,
- DefaultScreen (display)),
- GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
- &gcvalues);
- }
-
m_backgroundPixel = (int) gcvalues.background;
// Get the current Font so we can set it back later
if (m_gc && (m_oldFont != (WXFont) 0) && ((long) m_oldFont != -1))
{
XSetFont ((Display*) m_display, (GC) m_gc, (Font) m_oldFont);
-
- if (m_window && m_window->GetBackingPixmap())
- XSetFont ((Display*) m_display,(GC) m_gcBacking, (Font) m_oldFont);
}
if (m_gc)
XDrawLine ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, x1d, y1d, x2d, y2d);
- if (m_window && m_window->GetBackingPixmap())
- XDrawLine ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- XLOG2DEV_2(x1), YLOG2DEV_2(y1),
- XLOG2DEV_2(x2), YLOG2DEV_2(y2));
-
CalcBoundingBox(x1, y1);
CalcBoundingBox(x2, y2);
}
ww, yy);
XDrawLine ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xx, 0,
xx, hh);
-
- if (m_window && m_window->GetBackingPixmap())
- {
- xx = XLOG2DEV_2 (x);
- yy = YLOG2DEV_2 (y);
- XDrawLine ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- 0, yy,
- ww, yy);
- XDrawLine ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- xx, 0,
- xx, hh);
- }
}
void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc )
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) (GC) m_gc,
xxc - r, yyc - r, 2 * r, 2 * r, alpha1, alpha2);
- if (m_window && m_window->GetBackingPixmap())
- XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- xxc_2 - r, yyc_2 - r, 2 * r, 2 * r, alpha1, alpha2);
-
}
if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT)
SetPen (m_pen);
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc,
xxc - r, yyc - r, 2 * r, 2 * r, alpha1, alpha2);
-
- if (m_window && m_window->GetBackingPixmap())
- XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- xxc_2 - r, yyc_2 - r, 2 * r, 2 * r, alpha1, alpha2);
}
CalcBoundingBox (x1, y1);
CalcBoundingBox (x2, y2);
SetBrush (m_brush);
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd, wd, hd, start, end);
-
- if (m_window && m_window->GetBackingPixmap())
- XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y),wd,hd,start,end);
}
if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT)
if (m_autoSetting)
SetPen (m_pen);
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd, wd, hd, start,end);
- if (m_window && m_window->GetBackingPixmap())
- XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y),wd,hd,start,end);
}
+
CalcBoundingBox (x, y);
CalcBoundingBox (x + width, y + height);
}
SetPen (m_pen);
XDrawPoint ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, XLOG2DEV (x), YLOG2DEV (y));
- if (m_window && m_window->GetBackingPixmap())
- XDrawPoint ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, XLOG2DEV_2 (x), YLOG2DEV_2 (y));
-
+
CalcBoundingBox (x, y);
}
}
XDrawLines ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xpoints, n, 0);
- if (m_window && m_window->GetBackingPixmap())
- {
- for (i = 0; i < n; i++)
- {
- xpoints[i].x = XLOG2DEV_2 (points[i].x + xoffset);
- xpoints[i].y = YLOG2DEV_2 (points[i].y + yoffset);
- }
- XDrawLines ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, xpoints, n, 0);
- }
delete[]xpoints;
}
}
XSetFillRule ((Display*) m_display, (GC) m_gc, fillStyle == wxODDEVEN_RULE ? EvenOddRule : WindingRule);
XFillPolygon ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xpoints1, n, Complex, 0);
XSetFillRule ((Display*) m_display, (GC) m_gc, EvenOddRule); // default mode
- if (m_window && m_window->GetBackingPixmap())
- {
- XSetFillRule ((Display*) m_display,(GC) m_gcBacking,
- fillStyle == wxODDEVEN_RULE ? EvenOddRule : WindingRule);
- XFillPolygon ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, xpoints2, n, Complex, 0);
- XSetFillRule ((Display*) m_display,(GC) m_gcBacking, EvenOddRule); // default mode
- }
}
if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT)
if (m_autoSetting)
SetPen (m_pen);
XDrawLines ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xpoints1, n + 1, 0);
-
- if (m_window && m_window->GetBackingPixmap())
- XDrawLines ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, xpoints2, n + 1, 0);
}
delete[]xpoints1;
{
SetBrush (m_brush);
XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd, wfd, hfd);
-
- if (m_window && m_window->GetBackingPixmap())
- XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y),
- wfd, hfd);
}
if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT)
if (m_autoSetting)
SetPen (m_pen);
XDrawRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd, wd, hd);
-
- if (m_window && m_window->GetBackingPixmap())
- XDrawRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y),
- wd, hd);
}
+
CalcBoundingBox (x, y);
CalcBoundingBox (x + width, y + height);
}
// Bottom-left
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd + hd - rh_d,
rw_d, rh_d, 180 * 64, 90 * 64);
-
- if (m_window && m_window->GetBackingPixmap())
- {
- XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2 + rd2, yd2, wd2 - rw_d2, hd2);
- XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2, yd2 + rd2, wd2, hd2 - rh_d2);
-
- XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2, yd2, rw_d2, rh_d2, 90 * 64, 90 * 64);
- XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2 + wd2 - rw_d2, yd2,
- // rw_d2, rh_d2, 0, 90 * 64);
- rw_d2, rh_d2, 0, 91 * 64);
- XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2 + wd2 - rw_d2,
- yd2 + hd2 - rh_d2,
- // rw_d2, rh_d2, 270 * 64, 90 * 64);
- rw_d2, rh_d2, 269 * 64, 92 * 64);
- XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2, yd2 + hd2 - rh_d2,
- rw_d2, rh_d2, 180 * 64, 90 * 64);
- }
}
if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT)
rw_d, rh_d, 269 * 64, 92 * 64);
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd + hd - rh_d,
rw_d, rh_d, 180 * 64, 90 * 64);
-
- if (m_window && m_window->GetBackingPixmap())
- {
- XDrawLine ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2 + rd2, yd2,
- xd2 + wd2 - rd2 + 1, yd2);
- XDrawLine ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2 + rd2, yd2 + hd2,
- xd2 + wd2 - rd2, yd2 + hd2);
-
- XDrawLine ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2, yd2 + rd2,
- xd2, yd2 + hd2 - rd2);
- XDrawLine ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2 + wd2, yd2 + rd2,
- xd2 + wd2, yd2 + hd2 - rd2 + 1);
- XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2, yd2,
- rw_d2, rh_d2, 90 * 64, 90 * 64);
- XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2 + wd2 - rw_d2, yd2,
- // rw_d2, rh_d2, 0, 90 * 64);
- rw_d2, rh_d2, 0, 91 * 64);
- XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2 + wd2 - rw_d2,
- yd2 + hd2 - rh_d2,
- rw_d2, rh_d2, 269 * 64, 92 * 64);
- XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- xd2, yd2 + hd2 - rh_d2,
- rw_d2, rh_d2, 180 * 64, 90 * 64);
- }
}
CalcBoundingBox (x, y);
CalcBoundingBox (x + width, y + height);
{
SetBrush (m_brush);
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd, wd, hd, 0, angle);
- if (m_window && m_window->GetBackingPixmap())
- XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y),
- XLOG2DEVREL (width) - WX_GC_CF,
- YLOG2DEVREL (height) - WX_GC_CF, 0, angle);
}
if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT)
if (m_autoSetting)
SetPen (m_pen);
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd, wd, hd, 0, angle);
- if (m_window && m_window->GetBackingPixmap())
- XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y),
- XLOG2DEVREL (width) - WX_GC_CF,
- YLOG2DEVREL (height) - WX_GC_CF, 0, angle);
}
CalcBoundingBox (x, y);
CalcBoundingBox (x + width, y + height);
0, 0, width, height,
(int) XLOG2DEV (x), (int) YLOG2DEV (y));
}
-
-
- if (m_window && m_window->GetBackingPixmap())
- {
- if (icon.GetDepth() <= 1)
- {
- XCopyPlane ((Display*) m_display, iconPixmap, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- 0, 0, width, height, (int) XLOG2DEV_2 (x), (int) YLOG2DEV_2 (y), 1);
- }
- else
- {
- XCopyArea ((Display*) m_display, iconPixmap, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- 0, 0, width, height,
- (int) XLOG2DEV_2 (x), (int) YLOG2DEV_2 (y));
- }
}
} else { /* Remote copy (different (Display*) m_displays) */
XImage *cache = NULL;
{
XImage *cache = NULL;
+#if 0
if (m_window && m_window->GetBackingPixmap())
XCopyRemote((Display*) sourceDC->m_display, (Display*) m_display,
(Pixmap) sourcePixmap, (Pixmap) m_window->GetBackingPixmap(),
source->LogicalToDeviceYRel(height),
XLOG2DEV_2 (xdest), YLOG2DEV_2 (ydest),
TRUE, &cache);
+#endif
if ( useMask && source->IsKindOf(CLASSINFO(wxMemoryDC)) )
{
} else
{
- if (m_window && m_window->GetBackingPixmap())
- {
- // +++ MARKUS (mho@comnets.rwth-aachen): error on blitting bitmaps with depth 1
- if (source->IsKindOf(CLASSINFO(wxMemoryDC)) && ((wxMemoryDC*) source)->GetBitmap().GetDepth() == 1)
- {
- XCopyPlane ((Display*) m_display, (Pixmap) sourcePixmap, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- source->LogicalToDeviceX (xsrc),
- source->LogicalToDeviceY (ysrc),
- source->LogicalToDeviceXRel(width),
- source->LogicalToDeviceYRel(height),
- XLOG2DEV_2 (xdest), YLOG2DEV_2 (ydest), 1);
- }
- else
- {
- XCopyArea ((Display*) m_display, (Pixmap) sourcePixmap, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- source->LogicalToDeviceX (xsrc),
- source->LogicalToDeviceY (ysrc),
- source->LogicalToDeviceXRel(width),
- source->LogicalToDeviceYRel(height),
- XLOG2DEV_2 (xdest), YLOG2DEV_2 (ydest));
- }
- }
if ( useMask && source->IsKindOf(CLASSINFO(wxMemoryDC)) )
{
wxMemoryDC *memDC = (wxMemoryDC *)source;
if (pixel > -1)
{
XSetForeground ((Display*) m_display, (GC) m_gc, pixel);
- if (m_window && m_window->GetBackingPixmap())
- XSetForeground ((Display*) m_display,(GC) m_gcBacking, pixel);
}
}
else
m_textBackgroundColour = oldPenColour ;
XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, XLOG2DEV (x), YLOG2DEV (y), cx, cy);
- if (m_window && m_window->GetBackingPixmap())
- XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y), cx, cy);
}
// Now set the text foreground and draw the text
if (pixel > -1)
{
XSetForeground ((Display*) m_display, (GC) m_gc, pixel);
- if (m_window && m_window->GetBackingPixmap())
- XSetForeground ((Display*) m_display,(GC) m_gcBacking, pixel);
}
}
else
#endif // 0
XDrawString((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, XLOG2DEV (x), YLOG2DEV (y) + ascent, text, slen);
- if (m_window && m_window->GetBackingPixmap()) {
-#if 0
- if (use16)
- XDrawString16((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
- (XChar2b *)(char*) (const char*) text, slen);
- else
-#endif // 0
- XDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent, (char*) (const char*) text, slen);
- }
-
wxCoord w, h;
GetTextExtent (text, &w, &h);
CalcBoundingBox (x + w, y + h);
if (pixel > -1)
{
XSetForeground ((Display*) m_display, (GC) m_gc, pixel);
- if (m_window && m_window->GetBackingPixmap())
- XSetForeground ((Display*) m_display,(GC) m_gcBacking, pixel);
}
}
else
m_textBackgroundColour = oldPenColour ;
XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, XLOG2DEV (x), YLOG2DEV (y), cx, cy);
- if (m_window && m_window->GetBackingPixmap())
- XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
- XLOG2DEV_2 (x), YLOG2DEV_2 (y), cx, cy);
}
#endif
if (m_window)
{
m_window->GetSize(&w, &h);
-
- if (m_window && m_window->GetBackingPixmap())
- {
- w = m_window->GetPixmapWidth();
- h = m_window->GetPixmapHeight();
- }
}
else
{
XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, 0, 0, w, h);
- if (m_window && m_window->GetBackingPixmap())
- XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, 0, 0, w, h);
-
m_brush = saveBrush;
}
XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, x, y, w, h);
- if (m_window && m_window->GetBackingPixmap())
- XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, x, y, w, h);
-
m_brush = saveBrush;
}
if ((m_oldFont != (WXFont) 0) && ((wxCoord) m_oldFont != -1))
{
XSetFont ((Display*) m_display, (GC) m_gc, (Font) m_oldFont);
-
- if (m_window && m_window->GetBackingPixmap())
- XSetFont ((Display*) m_display,(GC) m_gcBacking, (Font) m_oldFont);
}
return;
}
Font fontId = ((XFontStruct*)pFontStruct)->fid;
XSetFont ((Display*) m_display, (GC) m_gc, fontId);
-
- if (m_window && m_window->GetBackingPixmap())
- XSetFont ((Display*) m_display,(GC) m_gcBacking, fontId);
}
void wxWindowDC::SetPen( const wxPen &pen )
int old_pen_join = m_currentPenJoin;
int old_pen_cap = m_currentPenCap;
int old_pen_nb_dash = m_currentPenDashCount;
- wxMOTIFDash *old_pen_dash = m_currentPenDash;
+ wxX11Dash *old_pen_dash = m_currentPenDash;
wxColour oldPenColour = m_currentColour;
m_currentColour = m_pen.GetColour ();
m_currentPenJoin = m_pen.GetJoin ();
m_currentPenCap = m_pen.GetCap ();
m_currentPenDashCount = m_pen.GetDashCount();
- m_currentPenDash = (wxMOTIFDash*)m_pen.GetDash();
+ m_currentPenDash = (wxX11Dash*)m_pen.GetDash();
+#if 0
+ // TODO
if (m_currentStyle == wxSTIPPLE)
m_currentStipple = * m_pen.GetStipple ();
+#endif
bool sameStyle = (oldStyle == m_currentStyle &&
oldFill == m_currentFill &&
int style;
int join;
int cap;
- static const wxMOTIFDash dotted[] = {2, 5};
- static const wxMOTIFDash short_dashed[] = {4, 4};
- static const wxMOTIFDash long_dashed[] = {4, 8};
- static const wxMOTIFDash dotted_dashed[] = {6, 6, 2, 6};
+ static const wxX11Dash dotted[] = {2, 5};
+ static const wxX11Dash short_dashed[] = {4, 4};
+ static const wxX11Dash long_dashed[] = {4, 8};
+ static const wxX11Dash dotted_dashed[] = {6, 6, 2, 6};
// We express dash pattern in pen width unit, so we are
// independent of zoom factor and so on...
int req_nb_dash;
- const wxMOTIFDash *req_dash;
+ const wxX11Dash *req_dash;
switch (m_pen.GetStyle ())
{
case wxTRANSPARENT:
default:
style = LineSolid;
- req_dash = (wxMOTIFDash*)NULL;
+ req_dash = (wxX11Dash*)NULL;
req_nb_dash = 0;
}
if (req_dash && req_nb_dash)
{
- wxMOTIFDash *real_req_dash = new wxMOTIFDash[req_nb_dash];
+ wxX11Dash *real_req_dash = new wxX11Dash[req_nb_dash];
if (real_req_dash)
{
int factor = scaled_width == 0 ? 1 : scaled_width;
for (int i = 0; i < req_nb_dash; i++)
real_req_dash[i] = req_dash[i] * factor;
XSetDashes ((Display*) m_display, (GC) m_gc, 0, real_req_dash, req_nb_dash);
-
- if (m_window && m_window->GetBackingPixmap())
- XSetDashes ((Display*) m_display,(GC) m_gcBacking, 0, real_req_dash, req_nb_dash);
delete[]real_req_dash;
}
else
{
// No Memory. We use non-scaled dash pattern...
XSetDashes ((Display*) m_display, (GC) m_gc, 0, req_dash, req_nb_dash);
-
- if (m_window && m_window->GetBackingPixmap())
- XSetDashes ((Display*) m_display,(GC) m_gcBacking, 0, req_dash, req_nb_dash);
}
}
}
XSetLineAttributes ((Display*) m_display, (GC) m_gc, scaled_width, style, cap, join);
-
- if (m_window && m_window->GetBackingPixmap())
- XSetLineAttributes ((Display*) m_display,(GC) m_gcBacking, scaled_width, style, cap, join);
}
if (IS_HATCH(m_currentFill) && ((m_currentFill != oldFill) || !GetOptimization()))
break;
}
XSetStipple ((Display*) m_display, (GC) m_gc, myStipple);
-
- if (m_window && m_window->GetBackingPixmap())
- XSetStipple ((Display*) m_display,(GC) m_gcBacking, myStipple);
}
else if (m_currentStipple.Ok()
&& ((m_currentStipple != oldStipple) || !GetOptimization()))
{
XSetStipple ((Display*) m_display, (GC) m_gc, (Pixmap) m_currentStipple.GetPixmap());
-
- if (m_window && m_window->GetBackingPixmap())
- XSetStipple ((Display*) m_display,(GC) m_gcBacking, (Pixmap) m_currentStipple.GetPixmap());
}
if ((m_currentFill != oldFill) || !GetOptimization())
else
fill_style = FillSolid;
XSetFillStyle ((Display*) m_display, (GC) m_gc, fill_style);
- if (m_window && m_window->GetBackingPixmap())
- XSetFillStyle ((Display*) m_display,(GC) m_gcBacking, fill_style);
}
// must test m_logicalFunction, because it involves background!
XGCValues values;
XGetGCValues ((Display*) m_display, (GC) m_gc, GCBackground, &values);
XSetForeground ((Display*) m_display, (GC) m_gc, pixel ^ values.background);
- if (m_window && m_window->GetBackingPixmap())
- XSetForeground ((Display*) m_display,(GC) m_gcBacking, pixel ^ values.background);
}
else
{
XSetForeground ((Display*) m_display, (GC) m_gc, pixel);
- if (m_window && m_window->GetBackingPixmap())
- XSetForeground ((Display*) m_display,(GC) m_gcBacking, pixel);
}
}
}
// fill style should be solid or transparent
int style = (m_backgroundMode == wxSOLID ? FillOpaqueStippled : FillStippled);
XSetFillStyle ((Display*) m_display, (GC) m_gc, style);
- if (m_window && m_window->GetBackingPixmap())
- XSetFillStyle ((Display*) m_display,(GC) m_gcBacking, style);
}
break;
case wxSOLID:
default:
XSetFillStyle ((Display*) m_display, (GC) m_gc, FillSolid);
- if (m_window && m_window->GetBackingPixmap())
- XSetFillStyle ((Display*) m_display,(GC) m_gcBacking, FillSolid);
}
}
break;
}
XSetStipple ((Display*) m_display, (GC) m_gc, myStipple);
-
- if (m_window && m_window->GetBackingPixmap())
- XSetStipple ((Display*) m_display,(GC) m_gcBacking, myStipple);
}
// X can forget the stipple value when resizing a window (apparently)
// so always set the stipple.
else if (m_currentStipple.Ok()) // && m_currentStipple != oldStipple)
{
XSetStipple ((Display*) m_display, (GC) m_gc, (Pixmap) m_currentStipple.GetPixmap());
- if (m_window && m_window->GetBackingPixmap())
- XSetStipple ((Display*) m_display,(GC) m_gcBacking, (Pixmap) m_currentStipple.GetPixmap());
}
// must test m_logicalFunction, because it involves background!
XGCValues values;
XGetGCValues ((Display*) m_display, (GC) m_gc, GCBackground, &values);
XSetForeground ((Display*) m_display, (GC) m_gc, pixel ^ values.background);
- if (m_window && m_window->GetBackingPixmap())
- XSetForeground ((Display*) m_display,(GC) m_gcBacking, pixel ^ values.background);
}
else
{
XSetForeground ((Display*) m_display, (GC) m_gc, pixel);
- if (m_window && m_window->GetBackingPixmap())
- XSetForeground ((Display*) m_display,(GC) m_gcBacking, pixel);
}
}
}
// Necessary for ::DrawIcon, which use fg/bg pixel or the GC.
// And Blit,... (Any fct that use XCopyPlane, in fact.)
XSetBackground ((Display*) m_display, (GC) m_gc, pixel);
- if (m_window && m_window->GetBackingPixmap())
- XSetBackground ((Display*) m_display,(GC) m_gcBacking, pixel);
}
void wxWindowDC::SetLogicalFunction( int function )
}
XSetFunction((Display*) m_display, (GC) m_gc, x_function);
- if (m_window && m_window->GetBackingPixmap())
- XSetFunction((Display*) m_display, (GC) m_gcBacking, x_function);
if ((m_logicalFunction == wxXOR) != (function == wxXOR))
/* MATTHEW: [9] Need to redo pen simply */
m_currentRegion = (WXRegion) NULL;
if ((m_window && m_window->GetUpdateRegion().Ok()) && m_userRegion)
- XIntersectRegion ((Region) m_window->GetUpdateRegion().GetXRegion(), (Region) m_userRegion, (Region) m_currentRegion);
+ XIntersectRegion ((Region) m_window->GetUpdateRegion().GetX11Region(), (Region) m_userRegion, (Region) m_currentRegion);
else if (m_userRegion)
XIntersectRegion ((Region) m_userRegion, (Region) m_userRegion, (Region) m_currentRegion);
else if (m_window && m_window->GetUpdateRegion().Ok())
- XIntersectRegion ((Region) m_window->GetUpdateRegion().GetXRegion(), (Region) m_window->GetUpdateRegion().GetXRegion(),
+ XIntersectRegion ((Region) m_window->GetUpdateRegion().GetX11Region(), (Region) m_window->GetUpdateRegion().GetX11Region(),
(Region) m_currentRegion);
if (m_currentRegion)
XUnionRectWithRegion (&r, (Region) m_userRegion, (Region) m_userRegion);
SetDCClipping ();
-
- // 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())
- {
- XRectangle rects[1];
- rects[0].x = XLOG2DEV_2(x);
- rects[0].y = YLOG2DEV_2(y);
- rects[0].width = XLOG2DEVREL(width);
- rects[0].height = YLOG2DEVREL(height);
- XSetClipRectangles((Display*) m_display, (GC) m_gcBacking, 0, 0, rects, 1, Unsorted);
- }
}
void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion& region )
XDestroyRegion ((Region) m_userRegion);
m_userRegion = (WXRegion) XCreateRegion ();
- XUnionRegion((Region) m_userRegion, (Region) region.GetXRegion(), (Region) m_userRegion);
+ XUnionRegion((Region) m_userRegion, (Region) region.GetX11Region(), (Region) m_userRegion);
SetDCClipping ();
-
- // 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())
- {
- XRectangle rects[1];
- rects[0].x = XLOG2DEV_2(box.x);
- rects[0].y = YLOG2DEV_2(box.y);
- rects[0].width = XLOG2DEVREL(box.width);
- rects[0].height = YLOG2DEVREL(box.height);
- XSetClipRectangles((Display*) m_display, (GC) m_gcBacking, 0, 0, rects, 1, Unsorted);
- }
}
XGCValues gc_val;
gc_val.clip_mask = None;
- if (m_window && m_window->GetBackingPixmap())
- XChangeGC((Display*) m_display, (GC) m_gcBacking, GCClipMask, &gc_val);
}
// Resolution in pixels per logical inch
// wxPaintDC
// ----------------------------------------------------------------------------
-wxPaintDC::wxPaintDC(wxWindow* win) : wxWindowDC(win)
+wxPaintDC::wxPaintDC(wxWindow* win)
+ : wxWindowDC(win)
{
- wxRegion* region = NULL;
-
- // Combine all the update rects into a region
- const wxRectList& updateRects(win->GetUpdateRects());
- if ( updateRects.GetCount() != 0 )
- {
- for ( wxRectList::Node *node = updateRects.GetFirst();
- node;
- node = node->GetNext() )
- {
- wxRect* rect = node->GetData();
-
- if (!region)
- region = new wxRegion(*rect);
- else
- // TODO: is this correct? In SetDCClipping above,
- // XIntersectRegion is used to combine paint and user
- // regions. XIntersectRegion appears to work in that case...
- region->Union(*rect);
- }
- }
- else
- {
- int cw, ch;
- win->GetClientSize(&cw, &ch);
- region = new wxRegion(wxRect(0, 0, cw, ch));
- }
-
- win->SetUpdateRegion(*region);
-
- wxRegion& theRegion(win->GetUpdateRegion());
- theRegion.SetRects(updateRects); // We also store in terms of rects, for iteration to work.
-
- // Set the clipping region. Any user-defined region will be combined with this
- // one in SetDCClipping.
- XSetRegion ((Display*) m_display, (GC) m_gc, (Region) region->GetXRegion());
-
- delete region;
+ // TODO clone GTK logic here
}
wxPaintDC::~wxPaintDC()
{
- XSetClipMask ((Display*) m_display, (GC) m_gc, None);
- if (m_window)
- m_window->ClearUpdateRegion();
}
// ----------------------------------------------------------------------------