summaryrefslogtreecommitdiff
path: root/ui/spice-display.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-11-13 14:51:41 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-03-18 10:21:58 +0100
commit7c20b4a374d0016e3fce005690fb428354a56621 (patch)
treee2cd1af910a6e226a1cc8d4d3f6d933a02e58c58 /ui/spice-display.c
parent225dc991b03f0f034aa348f5cf499de9d0979107 (diff)
downloadqemu-7c20b4a374d0016e3fce005690fb428354a56621.tar.gz
console: fix displaychangelisteners interface
Split callbacks into separate Ops struct. Pass DisplayChangeListener pointer as first argument to all callbacks. Uninline a bunch of display functions and move them from console.h to console.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/spice-display.c')
-rw-r--r--ui/spice-display.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c
index dc7e58d0ed..b6528fae78 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -583,25 +583,30 @@ static const QXLInterface dpy_interface = {
static SimpleSpiceDisplay sdpy;
-static void display_update(struct DisplayState *ds, int x, int y, int w, int h)
+static void display_update(DisplayChangeListener *dcl,
+ struct DisplayState *ds,
+ int x, int y, int w, int h)
{
qemu_spice_display_update(&sdpy, x, y, w, h);
}
-static void display_resize(struct DisplayState *ds)
+static void display_resize(DisplayChangeListener *dcl,
+ struct DisplayState *ds)
{
qemu_spice_display_resize(&sdpy);
}
-static void display_refresh(struct DisplayState *ds)
+static void display_refresh(DisplayChangeListener *dcl,
+ struct DisplayState *ds)
{
qemu_spice_display_refresh(&sdpy);
}
-static DisplayChangeListener display_listener = {
+static const DisplayChangeListenerOps display_listener_ops = {
+ .dpy_name = "spice",
.dpy_gfx_update = display_update,
.dpy_gfx_resize = display_resize,
- .dpy_refresh = display_refresh,
+ .dpy_refresh = display_refresh,
};
void qemu_spice_display_init(DisplayState *ds)
@@ -615,5 +620,7 @@ void qemu_spice_display_init(DisplayState *ds)
qemu_spice_create_host_memslot(&sdpy);
qemu_spice_create_host_primary(&sdpy);
- register_displaychangelistener(ds, &display_listener);
+
+ sdpy.dcl.ops = &display_listener_ops;
+ register_displaychangelistener(ds, &sdpy.dcl);
}