summaryrefslogtreecommitdiff
path: root/src/surface/ram.c
blob: 0948a5d27a4828b25278230e42e89def7c7df69b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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)