summaryrefslogtreecommitdiff
path: root/cd/src/cairo/cdcairoimg.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 01:48:52 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 01:50:25 +0200
commite9a184546b18cf3b796bd560561f312934004c54 (patch)
treeaa785af9a8d03f8ce276c9e9ecec78397005ec22 /cd/src/cairo/cdcairoimg.c
parent92efe73791d0998536042bfab5a1babc67d168c7 (diff)
Upgrading to CD 5.4 - and cleaning up.
Diffstat (limited to 'cd/src/cairo/cdcairoimg.c')
-rw-r--r--cd/src/cairo/cdcairoimg.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/cd/src/cairo/cdcairoimg.c b/cd/src/cairo/cdcairoimg.c
new file mode 100644
index 0000000..bc39129
--- /dev/null
+++ b/cd/src/cairo/cdcairoimg.c
@@ -0,0 +1,51 @@
+/** \file
+ * \brief Cairo Image Driver
+ *
+ * See Copyright Notice in cd.h
+ */
+
+#include <stdlib.h>
+
+#include "cdcairoctx.h"
+#include "cdimage.h"
+
+
+static void cdkillcanvas(cdCtxCanvas* ctxcanvas)
+{
+ cdcairoKillCanvas(ctxcanvas);
+}
+
+static void cdcreatecanvas(cdCanvas* canvas, void *data)
+{
+ cdCtxImage *ctximage = ((cdImage*)data)->ctximage;
+ cdcairoCreateCanvas(canvas, (cairo_t*)ctximage->cr);
+ canvas->w = ctximage->w;
+ canvas->h = ctximage->h;
+ canvas->w_mm = ctximage->w_mm;
+ canvas->h_mm = ctximage->h_mm;
+ canvas->bpp = ctximage->bpp;
+ canvas->xres = ctximage->xres;
+ canvas->yres = ctximage->yres;
+}
+
+static void cdinittable(cdCanvas* canvas)
+{
+ cdcairoInitTable(canvas);
+
+ canvas->cxKillCanvas = cdkillcanvas;
+}
+
+static cdContext cdImageContext =
+{
+ CD_CAP_ALL & ~(CD_CAP_PLAY | CD_CAP_YAXIS | CD_CAP_REGION | CD_CAP_WRITEMODE | CD_CAP_PALETTE ),
+ 0,
+ cdcreatecanvas,
+ cdinittable,
+ NULL,
+ NULL
+};
+
+cdContext* cdContextCairoImage(void)
+{
+ return &cdImageContext;
+}