diff options
author | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:18:43 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:18:43 -0700 |
commit | 25e85e1b809ec58ecac0f2e8fe48f74836f8e131 (patch) | |
tree | a53caef2257fefdd6610a17427fd14ee656bbc92 /cd/src/x11/cdx11.c | |
parent | 7c0c85a86aa73c0c495523f994f8412e377a8195 (diff) |
Upgrading to CD 5.3
Diffstat (limited to 'cd/src/x11/cdx11.c')
-rwxr-xr-x | cd/src/x11/cdx11.c | 17 |
1 files changed, 13 insertions, 4 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; +} |