-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbackend.h
37 lines (32 loc) · 891 Bytes
/
backend.h
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
#include <sys/types.h>
#include <stdint.h>
#include <linux/fb.h>
/* this is a lot like a very-stripped-down version of
* fb_var_screeninfo that omits everything we don't care about
*/
struct fb_info {
int fd;
size_t offset;
size_t len;
uint32_t xres, yres;
uint32_t bits_per_pixel;
uint32_t line_width;
/* as in fb_var_screeninfo */
struct fb_bitfield red;
struct fb_bitfield green;
struct fb_bitfield blue;
};
struct update { int x1; int y1; int x2; int y2; };
struct backend {
char *name;
void *(*initialize)(void);
struct fb_info (*get_info)(void *);
int (*notification_fd)(void *);
struct update (*read_update)(void *, int);
};
void register_backend(struct backend *);
struct backend **get_backends(void);
#define DECLARE_BACKEND(b) \
__attribute__((constructor)) static void register_backend_() { \
register_backend(&b); \
}