summaryrefslogtreecommitdiff
path: root/src/surface/ram.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2010-04-26 00:32:55 +0000
committerVincent Sanders <vince@netsurf-browser.org>2010-04-26 00:32:55 +0000
commit1eb4603b71ae21f45e9449efcd20a5086051489d (patch)
treef74b30e1a3a8477807d66ae446c7aecad0966560 /src/surface/ram.c
parent1a0cc609b9fccd3b183257a007c08e5295e782e8 (diff)
downloadlibnsfb-1eb4603b71ae21f45e9449efcd20a5086051489d.tar.gz
libnsfb-1eb4603b71ae21f45e9449efcd20a5086051489d.tar.bz2
start improvements in surface handling
add X surface handler (need to address the speed issues) svn path=/trunk/libnsfb/; revision=10485
Diffstat (limited to 'src/surface/ram.c')
-rw-r--r--src/surface/ram.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/surface/ram.c b/src/surface/ram.c
new file mode 100644
index 0000000..0948a5d
--- /dev/null
+++ b/src/surface/ram.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009 Vincent Sanders <vince@simtec.co.uk>
+ *
+ * This file is part of libnsfb, http://www.netsurf-browser.org/
+ * Licenced under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+#include <stdbool.h>
+#include <stdio.h>
+
+#include "libnsfb.h"
+#include "libnsfb_plot.h"
+#include "libnsfb_event.h"
+#include "nsfb.h"
+#include "frontend.h"
+
+#define UNUSED(x) ((x) = (x))
+
+static int ram_set_geometry(nsfb_t *nsfb, int width, int height, int bpp)
+{
+ if (nsfb->frontend_priv != NULL)
+ return -1; /* if were already initialised fail */
+
+ nsfb->width = width;
+ nsfb->height = height;
+ nsfb->bpp = bpp;
+
+ return 0;
+}
+
+static int ram_initialise(nsfb_t *nsfb)
+{
+ UNUSED(nsfb);
+ return 0;
+}
+
+static int ram_finalise(nsfb_t *nsfb)
+{
+ UNUSED(nsfb);
+ return 0;
+}
+
+static bool ram_input(nsfb_t *nsfb, nsfb_event_t *event, int timeout)
+{
+ UNUSED(nsfb);
+ UNUSED(event);
+ UNUSED(timeout);
+ return false;
+}
+
+const nsfb_frontend_rtns_t ram_rtns = {
+ .initialise = ram_initialise,
+ .finalise = ram_finalise,
+ .input = ram_input,
+ .geometry = ram_set_geometry,
+};
+
+NSFB_FRONTEND_DEF(ram, NSFB_FRONTEND_RAM, &ram_rtns)