|
1 /* |
|
2 * GUI target side interface |
|
3 * |
|
4 * Copyright (c) 2009 CodeSourcery |
|
5 * |
|
6 * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
7 * of this software and associated documentation files (the "Software"), to deal |
|
8 * in the Software without restriction, including without limitation the rights |
|
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 * copies of the Software, and to permit persons to whom the Software is |
|
11 * furnished to do so, subject to the following conditions: |
|
12 * |
|
13 * The above copyright notice and this permission notice shall be included in |
|
14 * all copies or substantial portions of the Software. |
|
15 * |
|
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
22 * THE SOFTWARE. |
|
23 */ |
|
24 |
|
25 #ifndef GUI_H |
|
26 #define GUI_H |
|
27 |
|
28 #include "display_state.h" |
|
29 |
|
30 /* keyboard/mouse support */ |
|
31 |
|
32 #define MOUSE_EVENT_LBUTTON 0x01 |
|
33 #define MOUSE_EVENT_RBUTTON 0x02 |
|
34 #define MOUSE_EVENT_MBUTTON 0x04 |
|
35 |
|
36 typedef void (*KeyCallback)(void *opaque, int key); |
|
37 typedef void (*vga_hw_update_ptr)(void *); |
|
38 typedef void (*vga_hw_invalidate_ptr)(void *); |
|
39 typedef void (*vga_hw_screen_dump_ptr)(void *, const char *); |
|
40 typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state); |
|
41 |
|
42 struct QEMUPutMouseEntry; |
|
43 typedef struct QEMUPutMouseEntry QEMUPutMouseEntry; |
|
44 |
|
45 QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func, |
|
46 void *opaque, int absolute, |
|
47 const char *name); |
|
48 void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry); |
|
49 |
|
50 struct mouse_transform_info_s { |
|
51 /* Touchscreen resolution */ |
|
52 int x; |
|
53 int y; |
|
54 /* Calibration values as used/generated by tslib */ |
|
55 int a[7]; |
|
56 }; |
|
57 |
|
58 DisplayState *gui_get_graphic_console(const char *devname, |
|
59 vga_hw_update_ptr update, |
|
60 vga_hw_invalidate_ptr invalidate, |
|
61 vga_hw_screen_dump_ptr screen_dump, |
|
62 void *opaque); |
|
63 |
|
64 void gui_register_dev_key_callback(KeyCallback cb, void *opaque); |
|
65 void gui_register_vt_key_callback(DisplayState *ds, KeyCallback cb, void *opaque); |
|
66 |
|
67 int gui_register_mouse_event_handler(QEMUPutMouseEvent *func, |
|
68 void *opaque, int absolute, |
|
69 const char *devname); |
|
70 |
|
71 /* only for skinless vts. 1 OK, 0 error (i.e. skinned vt) */ |
|
72 int gui_resize_vt(DisplayState *ds, int width, int height); |
|
73 |
|
74 void dpy_update(DisplayState *s, int x, int y, int w, int h); |
|
75 void dpy_cursor(DisplayState *s, int x, int y); |
|
76 |
|
77 #endif |
|
78 |