summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-08-21 10:42:15 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-24 10:07:06 +1000
commitf1c856ef9073d9d02bc84ce1472883c8441a9758 (patch)
treeaeb49df5bd7d85014962c4d5980c5eab58da3d19 /test
parent58fd28f6b6bebab7f31c54e696f96d64ebb50f5a (diff)
test: fake initialization of a sprite trace and window locations
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r--test/xi2/protocol-common.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c
index fc10698c9..330749970 100644
--- a/test/xi2/protocol-common.c
+++ b/test/xi2/protocol-common.c
@@ -39,6 +39,23 @@ void *userdata;
extern int CorePointerProc(DeviceIntPtr pDev, int what);
extern int CoreKeyboardProc(DeviceIntPtr pDev, int what);
+
+static void fake_init_sprite(DeviceIntPtr dev)
+{
+ SpritePtr sprite;
+ sprite = dev->spriteInfo->sprite;
+
+ sprite->spriteTraceSize = 10;
+ sprite->spriteTrace = xcalloc(sprite->spriteTraceSize, sizeof(WindowPtr));
+ sprite->spriteTraceGood = 1;
+ sprite->spriteTrace[0] = &root;
+ sprite->hot.x = 100;
+ sprite->hot.y = 200;
+ sprite->hotPhys.x = 100;
+ sprite->hotPhys.y = 200;
+ sprite->win = &window;
+}
+
/**
* Create and init 2 master devices (VCP + VCK) and two slave devices, one
* default mouse, one default keyboard.
@@ -69,6 +86,9 @@ struct devices init_devices(void)
devices.num_devices = 4;
devices.num_master_devices = 2;
+ fake_init_sprite(devices.mouse);
+ fake_init_sprite(devices.vcp);
+
return devices;
}
@@ -98,6 +118,13 @@ void init_window(WindowPtr window, WindowPtr parent, int id)
memset(window, 0, sizeof(window));
window->drawable.id = id;
+ if (parent)
+ {
+ window->drawable.x = 30;
+ window->drawable.y = 50;
+ window->drawable.width = 100;
+ window->drawable.height = 200;
+ }
window->parent = parent;
window->optional = xcalloc(1, sizeof(WindowOptRec));
g_assert(window->optional);