4 // This is the data structure that is passed back and forth with user-land
6 #define V3_VM_FB_INPUT 256+1
8 enum { V3_FB_KEY, V3_FB_MOUSE, V3_FB_BOTH} data_type;
10 uint8_t sx; // sign bit for deltax
12 uint8_t sy; // sign bit for deltay
14 uint8_t buttons; // button state
17 #define V3_VM_FB_QUERY 256+2
19 struct v3_fb_query_response {
20 enum e { V3_FB_DATA_ALL, V3_FB_DATA_BOX, V3_FB_UPDATE, V3_FB_SPEC } request_type;
21 struct v3_frame_buffer_spec spec; // in: desired spec; out: actual spec
22 uint32_t x, y, w, h; // region to copy (0s = all) in/out args
23 int updated; // whether this region has been updated or not
24 void __user *data; // user space pointer to copy data to
27 int v3_send_key(int fd, uint8_t scan_code)
31 e.data_type=V3_FB_KEY;
32 e.scan_code=scan_code;
34 if (ioctl(fd,V3_VM_FB_INPUT,&e)<0) {
35 perror("v3_send_key");
43 int v3_send_mouse(int fd, uint8_t sx, uint8_t dx, uint8_t sy, uint8_t dy, uint8_t buttons)
47 e.data_type=V3_FB_MOUSE;
54 if (ioctl(fd,V3_VM_FB_INPUT,&e)<0) {
55 perror("v3_send_mouse");
62 int v3_get_fb_spec(int fd, struct v3_frame_buffer_spec *spec)
64 struct v3_fb_query_response q;
66 q.request_type=V3_FB_SPEC;
68 if (ioctl(fd,V3_VM_FB_QUERY,&q)<0) {
69 perror("v3_get_fb_spec");
79 int v3_get_fb_data(int fd, struct v3_frame_buffer_spec *spec, void *data)
81 struct v3_fb_query_response q;
83 q.request_type=V3_FB_DATA_ALL;
87 if (ioctl(fd,V3_VM_FB_QUERY,&q)<0) {
88 perror("v3_get_fb_data");
98 int v3_have_update(int fd)
100 struct v3_fb_query_response q;
103 q.request_type=V3_FB_UPDATE;
109 if (ioctl(fd,V3_VM_FB_QUERY,&q)<0) {
110 perror("v3_get_fb_data");