summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-04-19 22:12:11 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-04-19 22:28:12 +1000
commit54716fd3dbc251db9d251d1d0435942efaa63259 (patch)
treed065ba481e24c35a5479b7a1a9ea69599e30e8eb /Xi
parent129ac9a9145323e3f126590b491e718f976f80ce (diff)
Convert to using int32_t fixed point values on the wire.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c4
-rw-r--r--Xi/extinit.c24
-rw-r--r--Xi/querydp.c21
3 files changed, 21 insertions, 28 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 6d85b1be2..af144313b 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1220,8 +1220,8 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
xi2event->deviceid = dev->id;
xi2event->sourceid = 0; /*XXX */
xi2event->mode = mode;
- xi2event->root_x.integral = mouse->spriteInfo->sprite->hot.x;
- xi2event->root_y.integral = mouse->spriteInfo->sprite->hot.y;
+ xi2event->root_x = FP1616(mouse->spriteInfo->sprite->hot.x, 0);
+ xi2event->root_y = FP1616(mouse->spriteInfo->sprite->hot.y, 0);
for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
if (BitIsOn(mouse->button->down, i))
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 9628dffb8..fa7031e6c 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -628,14 +628,10 @@ SDeviceLeaveNotifyEvent (xXILeaveEvent *from, xXILeaveEvent *to)
swapl(&to->root, n);
swapl(&to->event, n);
swapl(&to->child, n);
- swaps(&to->root_x.integral, n);
- swaps(&to->root_x.frac, n);
- swaps(&to->root_y.integral, n);
- swaps(&to->root_y.frac, n);
- swaps(&to->event_x.integral, n);
- swaps(&to->event_x.frac, n);
- swaps(&to->event_y.integral, n);
- swaps(&to->event_y.frac, n);
+ swapl(&to->root_x, n);
+ swapl(&to->root_y, n);
+ swapl(&to->event_x, n);
+ swapl(&to->event_y, n);
swaps(&to->sourceid, n);
swaps(&to->buttons_len, n);
swapl(&to->mods.base_mods, n);
@@ -721,14 +717,10 @@ static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
swapl(&to->root, n);
swapl(&to->event, n);
swapl(&to->child, n);
- swapl(&to->root_x.integral, n);
- swapl(&to->root_x.frac, n);
- swapl(&to->root_y.integral, n);
- swapl(&to->root_y.frac, n);
- swapl(&to->event_x.integral, n);
- swapl(&to->event_x.frac, n);
- swapl(&to->event_y.integral, n);
- swapl(&to->event_y.frac, n);
+ swapl(&to->root_x, n);
+ swapl(&to->root_y, n);
+ swapl(&to->event_x, n);
+ swapl(&to->event_y, n);
swaps(&to->buttons_len, n);
swaps(&to->valuators_len, n);
swaps(&to->sourceid, n);
diff --git a/Xi/querydp.c b/Xi/querydp.c
index 5be0cea17..1b45ae2b2 100644
--- a/Xi/querydp.c
+++ b/Xi/querydp.c
@@ -42,6 +42,7 @@
#include "extnsionst.h"
#include "exevents.h"
#include "exglobals.h"
+#include "eventconvert.h"
#include "xkbsrv.h"
#ifdef PANORAMIX
@@ -110,16 +111,16 @@ ProcXIQueryDevicePointer(ClientPtr client)
if (kbd && kbd->key)
rep.mask |= XkbStateFieldFromRec(&kbd->key->xkbInfo->state);
rep.root = (GetCurrentRootWindow(pDev))->drawable.id;
- rep.root_x.integral = pSprite->hot.x;
- rep.root_y.integral = pSprite->hot.y;
+ rep.root_x = FP1616(pSprite->hot.x, 0);
+ rep.root_y = FP1616(pSprite->hot.y, 0);
rep.child = None;
rep.deviceid = pDev->id;
if (pSprite->hot.pScreen == pWin->drawable.pScreen)
{
rep.same_screen = xTrue;
- rep.win_x.integral = pSprite->hot.x - pWin->drawable.x;
- rep.win_y.integral = pSprite->hot.y - pWin->drawable.y;
+ rep.win_x = FP1616(pSprite->hot.x - pWin->drawable.x, 0);
+ rep.win_y = FP1616(pSprite->hot.y - pWin->drawable.y, 0);
for (t = pSprite->win; t; t = t->parent)
if (t->parent == pWin)
{
@@ -129,18 +130,18 @@ ProcXIQueryDevicePointer(ClientPtr client)
} else
{
rep.same_screen = xFalse;
- rep.win_x.integral = 0;
- rep.win_y.integral = 0;
+ rep.win_x = 0;
+ rep.win_y = 0;
}
#ifdef PANORAMIX
if(!noPanoramiXExtension) {
- rep.root_x.integral += panoramiXdataPtr[0].x;
- rep.root_y.integral += panoramiXdataPtr[0].y;
+ rep.root_x += FP1616(panoramiXdataPtr[0].x, 0);
+ rep.root_y += FP1616(panoramiXdataPtr[0].y, 0);
if (stuff->win == rep.root)
{
- rep.win_x.integral += panoramiXdataPtr[0].x;
- rep.win_y.integral += panoramiXdataPtr[0].y;
+ rep.win_x += FP1616(panoramiXdataPtr[0].x, 0);
+ rep.win_y += FP1616(panoramiXdataPtr[0].y, 0);
}
}
#endif