diff options
Diffstat (limited to 'cd/src/x11')
-rwxr-xr-x | cd/src/x11/cdx11.c | 17 | ||||
-rwxr-xr-x | cd/src/x11/xvertex.c | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/cd/src/x11/cdx11.c b/cd/src/x11/cdx11.c index 4f427e3..94aae39 100755 --- a/cd/src/x11/cdx11.c +++ b/cd/src/x11/cdx11.c @@ -56,10 +56,10 @@ static int cdxErrorHandler(Display* dpy, XErrorEvent *err) if (err->request_code==X_FreeColors && err->error_code==BadAccess) return 0; - XGetErrorText(dpy, err->error_code, msg, 80 ); - fprintf(stderr,"CanvasDraw: Xlib request %d: %s\n", err->request_code, msg); + XGetErrorText(dpy, err->error_code, msg, 80); + fprintf(stderr,"X Error of failed request %d: %s\n", err->request_code, msg); - return 0; + return 0; /* ignore always */ } static void update_colors(cdCtxCanvas *ctxcanvas) @@ -1107,13 +1107,17 @@ static void cdxCheckSolidStyle(cdCtxCanvas *ctxcanvas, int set) cdinteriorstyle(ctxcanvas, ctxcanvas->canvas->interior_style); } +static int cdwritemode(cdCtxCanvas *ctxcanvas, int write_mode); + static void cdclear(cdCtxCanvas* ctxcanvas) { + if (ctxcanvas->canvas->write_mode!= CD_REPLACE) cdwritemode(ctxcanvas, CD_REPLACE); cdxCheckSolidStyle(ctxcanvas, 1); XSetForeground(ctxcanvas->dpy, ctxcanvas->gc, cdxGetPixel(ctxcanvas, ctxcanvas->canvas->background)); XFillRectangle(ctxcanvas->dpy, ctxcanvas->wnd, ctxcanvas->gc, 0, 0, ctxcanvas->canvas->w, ctxcanvas->canvas->h); XSetForeground(ctxcanvas->dpy, ctxcanvas->gc, cdxGetPixel(ctxcanvas, ctxcanvas->canvas->foreground)); cdxCheckSolidStyle(ctxcanvas, 0); + if (ctxcanvas->canvas->write_mode!= CD_REPLACE) cdwritemode(ctxcanvas, ctxcanvas->canvas->write_mode); } static void cdline(cdCtxCanvas *ctxcanvas, int x1, int y1, int x2, int y2) @@ -2379,7 +2383,7 @@ cdCtxCanvas *cdxCreateCanvas(cdCanvas* canvas, Display *dpy, int scr, Drawable w if (first) { - if(!getenv("CD_XERROR")) + if (!getenv("CD_XERROR")) XSetErrorHandler(cdxErrorHandler); } @@ -2444,3 +2448,8 @@ void cdxInitTable(cdCanvas* canvas) if (canvas->bpp > 8) canvas->cxPutImageRectRGBA = cdputimagerectrgba; } + +int cdBaseDriver(void) +{ + return CD_BASE_X; +} diff --git a/cd/src/x11/xvertex.c b/cd/src/x11/xvertex.c index e1ca7ee..0fbea1f 100755 --- a/cd/src/x11/xvertex.c +++ b/cd/src/x11/xvertex.c @@ -47,7 +47,7 @@ /* Debugging macros */ -#ifdef DEBUG +#ifdef CDXVERTEX_DEBUG #define DEBUG_PRINT1(a) printf (a) #define DEBUG_PRINT2(a, b) printf (a, b) #define DEBUG_PRINT3(a, b, c) printf (a, b, c) |