summaryrefslogtreecommitdiff
path: root/cd/src/gdk/cdgdkimg.c
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2010-06-15 00:18:43 -0700
committerPixel <pixel@nobis-crew.org>2010-06-15 00:18:43 -0700
commit25e85e1b809ec58ecac0f2e8fe48f74836f8e131 (patch)
treea53caef2257fefdd6610a17427fd14ee656bbc92 /cd/src/gdk/cdgdkimg.c
parent7c0c85a86aa73c0c495523f994f8412e377a8195 (diff)
Upgrading to CD 5.3
Diffstat (limited to 'cd/src/gdk/cdgdkimg.c')
-rw-r--r--cd/src/gdk/cdgdkimg.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/cd/src/gdk/cdgdkimg.c b/cd/src/gdk/cdgdkimg.c
new file mode 100644
index 0000000..0c5e5dd
--- /dev/null
+++ b/cd/src/gdk/cdgdkimg.c
@@ -0,0 +1,52 @@
+/** \file
+ * \brief Gdk Image Driver
+ *
+ * See Copyright Notice in cd.h
+ */
+
+#include <stdlib.h>
+
+#include "cdgdk.h"
+#include "cdimage.h"
+
+
+static void cdkillcanvas(cdCtxCanvas* ctxcanvas)
+{
+ cdgdkKillCanvas(ctxcanvas);
+}
+
+static void cdcreatecanvas(cdCanvas* canvas, void *data)
+{
+ cdCtxImage *ctximage = ((cdImage*)data)->ctximage;
+ cdgdkCreateCanvas(canvas, (GdkDrawable*)ctximage->img, ctximage->scr, ctximage->vis);
+}
+
+static void cdinittable(cdCanvas* canvas)
+{
+ cdgdkInitTable(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;
+}