summaryrefslogtreecommitdiff
path: root/console.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-05-21 11:54:32 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-05-24 15:18:23 -0500
commit254e59506e34efcc92384ef30af3c266e4633c66 (patch)
tree03ccc5674e239b2fbe93c1d24736a7fcd5382bd0 /console.h
parent019e78ba6ec6f402dffc6bc9683f461a11a52c28 (diff)
downloadqemu-254e59506e34efcc92384ef30af3c266e4633c66.tar.gz
qemu-254e59506e34efcc92384ef30af3c266e4633c66.tar.bz2
qemu-254e59506e34efcc92384ef30af3c266e4633c66.zip
cursor: add cursor functions.
Add a new cursor type to console.h and a bunch of functions to deal with cursors the (new) cursor.c file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'console.h')
-rw-r--r--console.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/console.h b/console.h
index 3a75bcc4d0..cac959f642 100644
--- a/console.h
+++ b/console.h
@@ -126,6 +126,27 @@ struct DisplaySurface {
struct PixelFormat pf;
};
+/* cursor data format is 32bit RGBA */
+typedef struct QEMUCursor {
+ int width, height;
+ int hot_x, hot_y;
+ int refcount;
+ uint32_t data[];
+} QEMUCursor;
+
+QEMUCursor *cursor_alloc(int width, int height);
+void cursor_get(QEMUCursor *c);
+void cursor_put(QEMUCursor *c);
+QEMUCursor *cursor_builtin_hidden(void);
+QEMUCursor *cursor_builtin_left_ptr(void);
+void cursor_print_ascii_art(QEMUCursor *c, const char *prefix);
+int cursor_get_mono_bpl(QEMUCursor *c);
+void cursor_set_mono(QEMUCursor *c,
+ uint32_t foreground, uint32_t background, uint8_t *image,
+ int transparent, uint8_t *mask);
+void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *mask);
+void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask);
+
struct DisplayChangeListener {
int idle;
uint64_t gui_timer_interval;
@@ -158,8 +179,7 @@ struct DisplayState {
struct DisplayChangeListener* listeners;
void (*mouse_set)(int x, int y, int on);
- void (*cursor_define)(int width, int height, int bpp, int hot_x, int hot_y,
- uint8_t *image, uint8_t *mask);
+ void (*cursor_define)(QEMUCursor *cursor);
struct DisplayState *next;
};