summaryrefslogtreecommitdiff
path: root/src/buffer.h
blob: 24a4604eb1f7d316d718f6459de2a20b98890f62 (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
60
61
62
63
/**
 * @file
 * @section AUTHORS
 *
 *  Authors:
 *       Eamon Walsh <ewalsh@tycho.nsa.gov>
 *
 * @section LICENSE
 *
 *  This file is in the public domain.
 *
 * @section DESCRIPTION
 *
 * This is the implementation of buffer objects, which represent regions of
 * memory, provided by clients, that contain graphical content.
 */

#ifndef _LINPICKER_BUFFER_H_
#define _LINPICKER_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 */
	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 /* _LINPICKER_BUFFER_H_ */