59
56
#include <dix-config.h>
62
#include <X11/X.h> /* for inputstr.h */
63
#include <X11/Xproto.h> /* Request macro */
64
#include "inputstr.h" /* DeviceIntPtr */
65
#include "windowstr.h" /* window structs */
59
#include <X11/X.h> /* for inputstr.h */
60
#include <X11/Xproto.h> /* Request macro */
61
#include "inputstr.h" /* DeviceIntPtr */
62
#include "windowstr.h" /* window structs */
66
63
#include <X11/extensions/XI.h>
67
64
#include <X11/extensions/XIproto.h>
68
65
#include "extnsionst.h"
69
#include "extinit.h" /* LookupDeviceIntRec */
66
#include "extinit.h" /* LookupDeviceIntRec */
70
67
#include "exglobals.h"
71
68
#include "swaprep.h"
73
70
#include "getprop.h"
75
extern XExtEventInfo EventInfo[];
76
extern int ExtEventIndex;
72
extern XExtEventInfo EventInfo[];
73
extern int ExtEventIndex;
78
75
/***********************************************************************
85
SProcXGetDeviceDontPropagateList(client)
86
register ClientPtr client;
82
SProcXGetDeviceDontPropagateList(register ClientPtr client)
90
86
REQUEST(xGetDeviceDontPropagateListReq);
91
87
swaps(&stuff->length, n);
92
88
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
93
89
swapl(&stuff->window, n);
94
return(ProcXGetDeviceDontPropagateList(client));
90
return (ProcXGetDeviceDontPropagateList(client));
97
93
/***********************************************************************
104
ProcXGetDeviceDontPropagateList (client)
105
register ClientPtr client;
109
XEventClass *buf = NULL, *tbuf;
111
xGetDeviceDontPropagateListReply rep;
112
OtherInputMasks *others;
100
ProcXGetDeviceDontPropagateList(register ClientPtr client)
104
XEventClass *buf = NULL, *tbuf;
106
xGetDeviceDontPropagateListReply rep;
107
OtherInputMasks *others;
114
109
REQUEST(xGetDeviceDontPropagateListReq);
115
110
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
123
pWin = (WindowPtr) LookupWindow (stuff->window, client);
118
pWin = (WindowPtr) LookupWindow(stuff->window, client);
126
120
client->errorValue = stuff->window;
127
SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0,
121
SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0,
132
if ((others = wOtherInputMasks(pWin)) != 0)
134
for (i=0; i<EMASKSIZE; i++)
135
tbuf = ClassFromMask (NULL, others->dontPropagateMask[i], i,
126
if ((others = wOtherInputMasks(pWin)) != 0) {
127
for (i = 0; i < EMASKSIZE; i++)
128
tbuf = ClassFromMask(NULL, others->dontPropagateMask[i], i,
139
131
rep.count = count;
140
buf = (XEventClass *) xalloc (rep.count * sizeof(XEventClass));
141
rep.length = (rep.count * sizeof (XEventClass) + 3) >> 2;
132
buf = (XEventClass *) xalloc(rep.count * sizeof(XEventClass));
133
rep.length = (rep.count * sizeof(XEventClass) + 3) >> 2;
144
for (i=0; i<EMASKSIZE; i++)
145
tbuf = ClassFromMask (tbuf, others->dontPropagateMask[i], i,
150
WriteReplyToClient (client, sizeof (xGetDeviceDontPropagateListReply),
155
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
156
WriteSwappedDataToClient( client, count * sizeof(XEventClass), buf);
136
for (i = 0; i < EMASKSIZE; i++)
137
tbuf = ClassFromMask(tbuf, others->dontPropagateMask[i], i,
142
WriteReplyToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep);
145
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
146
WriteSwappedDataToClient(client, count * sizeof(XEventClass), buf);
162
152
/***********************************************************************
170
*ClassFromMask (buf, mask, maskndx, count, mode)
179
Mask tmask = 0x80000000;
160
* ClassFromMask(XEventClass * buf, Mask mask, int maskndx, CARD16 * count,
165
Mask tmask = 0x80000000;
181
for (i=0; i<32; i++,tmask>>=1)
184
for (j=0; j<ExtEventIndex; j++)
185
if (EventInfo[j].mask == tmask)
167
for (i = 0; i < 32; i++, tmask >>= 1)
169
for (j = 0; j < ExtEventIndex; j++)
170
if (EventInfo[j].mask == tmask) {
187
171
if (mode == COUNT)
190
*buf++ = (id << 8) | EventInfo[j].type;
174
*buf++ = (id << 8) | EventInfo[j].type;
196
180
/***********************************************************************
204
SRepXGetDeviceDontPropagateList (client, size, rep)
207
xGetDeviceDontPropagateListReply *rep;
188
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
189
xGetDeviceDontPropagateListReply * rep)
211
193
swaps(&rep->sequenceNumber, n);
212
194
swapl(&rep->length, n);
213
195
swaps(&rep->count, n);
214
196
WriteToClient(client, size, (char *)rep);