From 2b23052622dc6d4effbeee4f079561343347ebf7 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 15 Apr 2009 11:33:03 +0000 Subject: add event interface svn path=/trunk/libnsfb/; revision=7088 --- src/frontend_ram.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/frontend_ram.c (limited to 'src/frontend_ram.c') diff --git a/src/frontend_ram.c b/src/frontend_ram.c new file mode 100644 index 0000000..82cb29b --- /dev/null +++ b/src/frontend_ram.c @@ -0,0 +1,58 @@ +/* + * Copyright 2009 Vincent Sanders + * + * 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 +#include + +#include "libnsfb.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) -- cgit v1.2.3