diff options
author | scuri <scuri> | 2008-10-17 06:10:33 +0000 |
---|---|---|
committer | scuri <scuri> | 2008-10-17 06:10:33 +0000 |
commit | 7b52cc13af4e85f1ca2deb6b6c77de9c95ea0dcf (patch) | |
tree | d0857278bde2eff784227c57dcaf930346ceb7ac /src/x11/cdximg.c |
First commit - moving from LuaForge to SourceForge
Diffstat (limited to 'src/x11/cdximg.c')
-rw-r--r-- | src/x11/cdximg.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/x11/cdximg.c b/src/x11/cdximg.c new file mode 100644 index 0000000..8131f78 --- /dev/null +++ b/src/x11/cdximg.c @@ -0,0 +1,52 @@ +/** \file + * \brief X-Windows Image Driver + * + * See Copyright Notice in cd.h + */ + +#include <stdlib.h> + +#include "cdx11.h" +#include "cdimage.h" + + +static void cdkillcanvas(cdCtxCanvas* ctxcanvas) +{ + cdxKillCanvas(ctxcanvas); +} + +static void cdcreatecanvas(cdCanvas* canvas, void *data) +{ + cdCtxImage *ctximage = ((cdImage*)data)->ctximage; + cdxCreateCanvas(canvas, ctximage->dpy, ctximage->scr, ctximage->img, ctximage->vis); +} + +static void cdinittable(cdCanvas* canvas) +{ + cdxInitTable(canvas); + + canvas->cxKillCanvas = cdkillcanvas; +} + +static cdContext cdImageContext = +{ + CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_FPRIMTIVES ), + 0, + cdcreatecanvas, + cdinittable, + NULL, + NULL +}; + + +cdContext* cdContextImage(void) +{ + if (cdUseContextPlus(CD_QUERY)) + { + cdContext* ctx = cdGetContextPlus(CD_CTX_IMAGE); + if (ctx != NULL) + return ctx; + } + + return &cdImageContext; +} |