summaryrefslogtreecommitdiffstatsci
path: root/src/cairo-image.cpp
blob: e875795a2bb4b5f348b2bc9ec96f968f2ebdb758 (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
#include <config.h>

#include <err.h>
#include <stdlib.h>
#include <cairo.h>

#include "image.h"
#include "device_config.h"

static image_state_t *state;

cairo_surface_t *
create_cairo_surface_image (const device_config_t& config)
{
    cairo_surface_t *cairo_surface;

    state = (image_state_t*) malloc (sizeof (image_state_t));
    if (!state) {
        warnx ("Out of memory\n");
        return NULL;
    }

    /*
      state->dpy = XOpenDisplay (NULL);
      if (state->dpy == NULL) {
      warnx ("Failed to open display: %s\n", XDisplayName (0));
      return NULL;
      }
    */

    cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
                                                config.width,
                                                config.height);

    return cairo_surface;
}

void
destroy_cairo_image(void)
{
    cleanup_state_image(state);
}

void
update_cairo_image(void)
{
}