summaryrefslogtreecommitdiff
path: root/src/buffer.h
blob: dcdbce6f0b5abe7ac714fa5bb391b40f7d811334 (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
/**
 * @file
 * @section DESCRIPTION
 * This provides the external interface for buffer.c.
 */

#ifndef _NITPICKER_BUFFER_H_
#define _NITPICKER_BUFFER_H_

#include <directfb.h>

#include "sys-queue.h"
#include "view.h"

#define BUFFER_FLAG_DESKTOP_BG 0x1   /* buffer is the desktop background */
#define BUFFER_FLAG_SERVER_BG  0x2   /* buffer is the server background */

struct buffer {
	int id;                 /* buffer id */
	int state;		/* buffer state */
	unsigned int flags;     /* properties of the buffer */
	struct view_tailq views; /* list of views into this buffer */
	struct view *bg_view;    /* view of entire buffer */
	struct client *client;  /* client owner */
	LIST_ENTRY(buffer) client_next; /* next buffer of the same client */
	LIST_ENTRY(buffer) display_next; /* next buffer of the same display */
	DFBSurfaceDescription desc;  /* surface parameters */
	int xoff, yoff;              /* buffer screen offset */
	IDirectFBSurface *bsurface;  /* buffer surface */
	void *private;          /* display subsystem private data */
};

LIST_HEAD(buf_list, buffer);
TAILQ_HEAD(buf_tailq, buffer);
CIRCLEQ_HEAD(buf_cirq, buffer);


struct buffer *
buffer_lookup(int domid, int buf_id);

struct buffer *
buffer_new(struct client *client, const DFBSurfaceDescription *desc, unsigned int flags);

void
buffer_remove(struct buffer *b);

void
buffer_refresh(struct buffer *b, int x, int y, int w, int h);

int
buffer_resize(struct buffer *b,  const DFBSurfaceDescription *desc);

#endif /* _NITPICKER_BUFFER_H_ */