Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
41a0ba72
Commit
41a0ba72
authored
Feb 11, 2018
by
Ulrich Sibiller
Committed by
Mihai Moldovan
Feb 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xi: reformat code, ansify
parent
5bfafee5
Show whitespace changes
Inline
Side-by-side
Showing
74 changed files
with
968 additions
and
968 deletions
+968
-968
allowev.c
nx-X11/programs/Xserver/Xi/allowev.c
+6
-6
allowev.h
nx-X11/programs/Xserver/Xi/allowev.h
+0
-0
chgdctl.c
nx-X11/programs/Xserver/Xi/chgdctl.c
+21
-21
chgdctl.h
nx-X11/programs/Xserver/Xi/chgdctl.h
+1
-1
chgfctl.c
nx-X11/programs/Xserver/Xi/chgfctl.c
+59
-59
chgfctl.h
nx-X11/programs/Xserver/Xi/chgfctl.h
+18
-18
chgkbd.c
nx-X11/programs/Xserver/Xi/chgkbd.c
+16
-16
chgkbd.h
nx-X11/programs/Xserver/Xi/chgkbd.h
+1
-1
chgkmap.c
nx-X11/programs/Xserver/Xi/chgkmap.c
+8
-8
chgkmap.h
nx-X11/programs/Xserver/Xi/chgkmap.h
+0
-0
chgprop.c
nx-X11/programs/Xserver/Xi/chgprop.c
+9
-9
chgprop.h
nx-X11/programs/Xserver/Xi/chgprop.h
+0
-0
chgptr.c
nx-X11/programs/Xserver/Xi/chgptr.c
+22
-22
chgptr.h
nx-X11/programs/Xserver/Xi/chgptr.h
+7
-7
closedev.c
nx-X11/programs/Xserver/Xi/closedev.c
+17
-17
closedev.h
nx-X11/programs/Xserver/Xi/closedev.h
+2
-2
devbell.c
nx-X11/programs/Xserver/Xi/devbell.c
+12
-12
devbell.h
nx-X11/programs/Xserver/Xi/devbell.h
+0
-0
exevents.c
nx-X11/programs/Xserver/Xi/exevents.c
+120
-120
exglobals.h
nx-X11/programs/Xserver/Xi/exglobals.h
+0
-0
extinit.c
nx-X11/programs/Xserver/Xi/extinit.c
+178
-178
getbmap.c
nx-X11/programs/Xserver/Xi/getbmap.c
+10
-10
getbmap.h
nx-X11/programs/Xserver/Xi/getbmap.h
+1
-1
getdctl.c
nx-X11/programs/Xserver/Xi/getdctl.c
+26
-26
getdctl.h
nx-X11/programs/Xserver/Xi/getdctl.h
+3
-3
getfctl.c
nx-X11/programs/Xserver/Xi/getfctl.c
+62
-62
getfctl.h
nx-X11/programs/Xserver/Xi/getfctl.h
+7
-7
getfocus.c
nx-X11/programs/Xserver/Xi/getfocus.c
+9
-9
getfocus.h
nx-X11/programs/Xserver/Xi/getfocus.h
+1
-1
getkmap.c
nx-X11/programs/Xserver/Xi/getkmap.c
+10
-10
getkmap.h
nx-X11/programs/Xserver/Xi/getkmap.h
+1
-1
getmmap.c
nx-X11/programs/Xserver/Xi/getmmap.c
+12
-12
getmmap.h
nx-X11/programs/Xserver/Xi/getmmap.h
+1
-1
getprop.c
nx-X11/programs/Xserver/Xi/getprop.c
+22
-22
getprop.h
nx-X11/programs/Xserver/Xi/getprop.h
+4
-4
getselev.c
nx-X11/programs/Xserver/Xi/getselev.c
+21
-21
getselev.h
nx-X11/programs/Xserver/Xi/getselev.h
+1
-1
getvers.c
nx-X11/programs/Xserver/Xi/getvers.c
+8
-8
getvers.h
nx-X11/programs/Xserver/Xi/getvers.h
+1
-1
grabdev.c
nx-X11/programs/Xserver/Xi/grabdev.c
+16
-16
grabdev.h
nx-X11/programs/Xserver/Xi/grabdev.h
+5
-5
grabdevb.c
nx-X11/programs/Xserver/Xi/grabdevb.c
+10
-10
grabdevb.h
nx-X11/programs/Xserver/Xi/grabdevb.h
+0
-0
grabdevk.c
nx-X11/programs/Xserver/Xi/grabdevk.c
+9
-9
grabdevk.h
nx-X11/programs/Xserver/Xi/grabdevk.h
+0
-0
gtmotion.c
nx-X11/programs/Xserver/Xi/gtmotion.c
+8
-8
gtmotion.h
nx-X11/programs/Xserver/Xi/gtmotion.h
+1
-1
listdev.c
nx-X11/programs/Xserver/Xi/listdev.c
+57
-57
listdev.h
nx-X11/programs/Xserver/Xi/listdev.h
+11
-11
opendev.c
nx-X11/programs/Xserver/Xi/opendev.c
+15
-15
opendev.h
nx-X11/programs/Xserver/Xi/opendev.h
+1
-1
queryst.c
nx-X11/programs/Xserver/Xi/queryst.c
+23
-23
queryst.h
nx-X11/programs/Xserver/Xi/queryst.h
+1
-1
selectev.c
nx-X11/programs/Xserver/Xi/selectev.c
+9
-9
selectev.h
nx-X11/programs/Xserver/Xi/selectev.h
+0
-0
sendexev.c
nx-X11/programs/Xserver/Xi/sendexev.c
+14
-14
sendexev.h
nx-X11/programs/Xserver/Xi/sendexev.h
+0
-0
setbmap.c
nx-X11/programs/Xserver/Xi/setbmap.c
+9
-9
setbmap.h
nx-X11/programs/Xserver/Xi/setbmap.h
+1
-1
setdval.c
nx-X11/programs/Xserver/Xi/setdval.c
+11
-11
setdval.h
nx-X11/programs/Xserver/Xi/setdval.h
+1
-1
setfocus.c
nx-X11/programs/Xserver/Xi/setfocus.c
+7
-7
setfocus.h
nx-X11/programs/Xserver/Xi/setfocus.h
+0
-0
setmmap.c
nx-X11/programs/Xserver/Xi/setmmap.c
+12
-12
setmmap.h
nx-X11/programs/Xserver/Xi/setmmap.h
+1
-1
setmode.c
nx-X11/programs/Xserver/Xi/setmode.c
+11
-11
setmode.h
nx-X11/programs/Xserver/Xi/setmode.h
+1
-1
stubs.c
nx-X11/programs/Xserver/Xi/stubs.c
+16
-16
ungrdev.c
nx-X11/programs/Xserver/Xi/ungrdev.c
+7
-7
ungrdev.h
nx-X11/programs/Xserver/Xi/ungrdev.h
+0
-0
ungrdevb.c
nx-X11/programs/Xserver/Xi/ungrdevb.c
+7
-7
ungrdevb.h
nx-X11/programs/Xserver/Xi/ungrdevb.h
+0
-0
ungrdevk.c
nx-X11/programs/Xserver/Xi/ungrdevk.c
+7
-7
ungrdevk.h
nx-X11/programs/Xserver/Xi/ungrdevk.h
+0
-0
No files found.
nx-X11/programs/Xserver/Xi/allowev.c
View file @
41a0ba72
...
...
@@ -77,13 +77,13 @@ SOFTWARE.
int
SProcXAllowDeviceEvents
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xAllowDeviceEventsReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xAllowDeviceEventsReq
);
swapl
(
&
stuff
->
time
);
return
(
ProcXAllowDeviceEvents
(
client
));
}
return
(
ProcXAllowDeviceEvents
(
client
));
}
/***********************************************************************
*
...
...
@@ -94,14 +94,14 @@ SProcXAllowDeviceEvents(client)
int
ProcXAllowDeviceEvents
(
client
)
register
ClientPtr
client
;
{
{
TimeStamp
time
;
DeviceIntPtr
thisdev
;
REQUEST
(
xAllowDeviceEventsReq
);
REQUEST_SIZE_MATCH
(
xAllowDeviceEventsReq
);
thisdev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
thisdev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
thisdev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_AllowDeviceEvents
,
0
,
BadDevice
);
...
...
@@ -136,4 +136,4 @@ ProcXAllowDeviceEvents(client)
return
Success
;
}
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/allowev.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/chgdctl.c
View file @
41a0ba72
...
...
@@ -78,13 +78,13 @@ SOFTWARE.
int
SProcXChangeDeviceControl
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xChangeDeviceControlReq
);
swaps
(
&
stuff
->
length
);
REQUEST_AT_LEAST_EXTRA_SIZE
(
xChangeDeviceControlReq
,
sizeof
(
xDeviceCtl
));
swaps
(
&
stuff
->
control
);
return
(
ProcXChangeDeviceControl
(
client
));
}
return
(
ProcXChangeDeviceControl
(
client
));
}
/***********************************************************************
*
...
...
@@ -95,7 +95,7 @@ SProcXChangeDeviceControl(client)
int
ProcXChangeDeviceControl
(
client
)
ClientPtr
client
;
{
{
unsigned
len
;
int
i
,
status
;
DeviceIntPtr
dev
;
...
...
@@ -107,11 +107,11 @@ ProcXChangeDeviceControl(client)
REQUEST
(
xChangeDeviceControlReq
);
REQUEST_AT_LEAST_EXTRA_SIZE
(
xChangeDeviceControlReq
,
sizeof
(
xDeviceCtl
));
len
=
stuff
->
length
-
(
sizeof
(
xChangeDeviceControlReq
)
>>
2
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
len
=
stuff
->
length
-
(
sizeof
(
xChangeDeviceControlReq
)
>>
2
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
BadDevice
);
return
Success
;
}
...
...
@@ -124,18 +124,18 @@ ProcXChangeDeviceControl(client)
switch
(
stuff
->
control
)
{
case
DEVICE_RESOLUTION
:
r
=
(
xDeviceResolutionCtl
*
)
&
stuff
[
1
];
if
((
len
<
(
sizeof
(
xDeviceResolutionCtl
)
>>
2
))
||
r
=
(
xDeviceResolutionCtl
*
)
&
stuff
[
1
];
if
((
len
<
(
sizeof
(
xDeviceResolutionCtl
)
>>
2
))
||
(
len
!=
(
sizeof
(
xDeviceResolutionCtl
)
>>
2
)
+
r
->
num_valuators
))
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
BadLength
);
return
Success
;
}
if
(
!
dev
->
valuator
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
BadMatch
);
return
Success
;
}
...
...
@@ -149,23 +149,23 @@ ProcXChangeDeviceControl(client)
resolution
=
(
CARD32
*
)
(
r
+
1
);
if
(
r
->
first_valuator
+
r
->
num_valuators
>
dev
->
valuator
->
numAxes
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
BadValue
);
return
Success
;
}
status
=
ChangeDeviceControl
(
client
,
dev
,
(
xDeviceCtl
*
)
r
);
status
=
ChangeDeviceControl
(
client
,
dev
,
(
xDeviceCtl
*
)
r
);
if
(
status
==
Success
)
{
a
=
&
dev
->
valuator
->
axes
[
r
->
first_valuator
];
for
(
i
=
0
;
i
<
r
->
num_valuators
;
i
++
)
if
(
*
(
resolution
+
i
)
<
(
a
+
i
)
->
min_resolution
||
for
(
i
=
0
;
i
<
r
->
num_valuators
;
i
++
)
if
(
*
(
resolution
+
i
)
<
(
a
+
i
)
->
min_resolution
||
*
(
resolution
+
i
)
>
(
a
+
i
)
->
max_resolution
)
{
SendErrorToClient
(
client
,
IReqCode
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
BadValue
);
return
Success
;
}
for
(
i
=
0
;
i
<
r
->
num_valuators
;
i
++
)
for
(
i
=
0
;
i
<
r
->
num_valuators
;
i
++
)
(
a
++
)
->
resolution
=
*
resolution
++
;
}
else
if
(
status
==
DeviceBusy
)
...
...
@@ -177,7 +177,7 @@ ProcXChangeDeviceControl(client)
}
else
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceControl
,
0
,
BadMatch
);
return
Success
;
}
...
...
@@ -189,7 +189,7 @@ ProcXChangeDeviceControl(client)
}
WriteReplyToClient
(
client
,
sizeof
(
xChangeDeviceControlReply
),
&
rep
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -203,9 +203,9 @@ SRepXChangeDeviceControl (client, size, rep)
ClientPtr
client
;
int
size
;
xChangeDeviceControlReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/chgdctl.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXChangeDeviceControl(
void
SRepXChangeDeviceControl
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xChangeDeviceControlReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/chgfctl.c
View file @
41a0ba72
...
...
@@ -79,13 +79,13 @@ SOFTWARE.
int
SProcXChangeFeedbackControl
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xChangeFeedbackControlReq
);
swaps
(
&
stuff
->
length
);
REQUEST_AT_LEAST_SIZE
(
xChangeFeedbackControlReq
);
swapl
(
&
stuff
->
mask
);
return
(
ProcXChangeFeedbackControl
(
client
));
}
return
(
ProcXChangeFeedbackControl
(
client
));
}
/***********************************************************************
*
...
...
@@ -96,7 +96,7 @@ SProcXChangeFeedbackControl(client)
int
ProcXChangeFeedbackControl
(
client
)
ClientPtr
client
;
{
{
unsigned
len
;
DeviceIntPtr
dev
;
KbdFeedbackPtr
k
;
...
...
@@ -109,11 +109,11 @@ ProcXChangeFeedbackControl(client)
REQUEST
(
xChangeFeedbackControlReq
);
REQUEST_AT_LEAST_SIZE
(
xChangeFeedbackControlReq
);
len
=
stuff
->
length
-
(
sizeof
(
xChangeFeedbackControlReq
)
>>
2
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
len
=
stuff
->
length
-
(
sizeof
(
xChangeFeedbackControlReq
)
>>
2
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadDevice
);
return
Success
;
}
...
...
@@ -123,11 +123,11 @@ ProcXChangeFeedbackControl(client)
case
KbdFeedbackClass
:
if
(
len
!=
(
sizeof
(
xKbdFeedbackCtl
)
>>
2
))
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadLength
);
return
Success
;
}
for
(
k
=
dev
->
kbdfeed
;
k
;
k
=
k
->
next
)
for
(
k
=
dev
->
kbdfeed
;
k
;
k
=
k
->
next
)
if
(
k
->
ctrl
.
id
==
((
xKbdFeedbackCtl
*
)
&
stuff
[
1
])
->
id
)
{
ChangeKbdFeedback
(
client
,
dev
,
stuff
->
mask
,
k
,
(
xKbdFeedbackCtl
*
)
&
stuff
[
1
]);
...
...
@@ -137,11 +137,11 @@ ProcXChangeFeedbackControl(client)
case
PtrFeedbackClass
:
if
(
len
!=
(
sizeof
(
xPtrFeedbackCtl
)
>>
2
))
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadLength
);
return
Success
;
}
for
(
p
=
dev
->
ptrfeed
;
p
;
p
=
p
->
next
)
for
(
p
=
dev
->
ptrfeed
;
p
;
p
=
p
->
next
)
if
(
p
->
ctrl
.
id
==
((
xPtrFeedbackCtl
*
)
&
stuff
[
1
])
->
id
)
{
ChangePtrFeedback
(
client
,
dev
,
stuff
->
mask
,
p
,
(
xPtrFeedbackCtl
*
)
&
stuff
[
1
]);
...
...
@@ -150,7 +150,7 @@ ProcXChangeFeedbackControl(client)
break
;
case
StringFeedbackClass
:
{
xStringFeedbackCtl
*
f
=
((
xStringFeedbackCtl
*
)
&
stuff
[
1
]);
xStringFeedbackCtl
*
f
=
((
xStringFeedbackCtl
*
)
&
stuff
[
1
]);
if
(
client
->
swapped
)
{
if
(
len
<
(
sizeof
(
xStringFeedbackCtl
)
+
3
)
>>
2
)
...
...
@@ -159,11 +159,11 @@ ProcXChangeFeedbackControl(client)
}
if
(
len
!=
((
sizeof
(
xStringFeedbackCtl
)
>>
2
)
+
f
->
num_keysyms
))
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadLength
);
return
Success
;
}
for
(
s
=
dev
->
stringfeed
;
s
;
s
=
s
->
next
)
for
(
s
=
dev
->
stringfeed
;
s
;
s
=
s
->
next
)
if
(
s
->
ctrl
.
id
==
((
xStringFeedbackCtl
*
)
&
stuff
[
1
])
->
id
)
{
ChangeStringFeedback
(
client
,
dev
,
stuff
->
mask
,
s
,(
xStringFeedbackCtl
*
)
&
stuff
[
1
]);
...
...
@@ -174,11 +174,11 @@ ProcXChangeFeedbackControl(client)
case
IntegerFeedbackClass
:
if
(
len
!=
(
sizeof
(
xIntegerFeedbackCtl
)
>>
2
))
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadLength
);
return
Success
;
}
for
(
i
=
dev
->
intfeed
;
i
;
i
=
i
->
next
)
for
(
i
=
dev
->
intfeed
;
i
;
i
=
i
->
next
)
if
(
i
->
ctrl
.
id
==
((
xIntegerFeedbackCtl
*
)
&
stuff
[
1
])
->
id
)
{
ChangeIntegerFeedback
(
client
,
dev
,
stuff
->
mask
,
i
,(
xIntegerFeedbackCtl
*
)
&
stuff
[
1
]);
...
...
@@ -188,11 +188,11 @@ ProcXChangeFeedbackControl(client)
case
LedFeedbackClass
:
if
(
len
!=
(
sizeof
(
xLedFeedbackCtl
)
>>
2
))
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadLength
);
return
Success
;
}
for
(
l
=
dev
->
leds
;
l
;
l
=
l
->
next
)
for
(
l
=
dev
->
leds
;
l
;
l
=
l
->
next
)
if
(
l
->
ctrl
.
id
==
((
xLedFeedbackCtl
*
)
&
stuff
[
1
])
->
id
)
{
ChangeLedFeedback
(
client
,
dev
,
stuff
->
mask
,
l
,
(
xLedFeedbackCtl
*
)
&
stuff
[
1
]);
...
...
@@ -202,11 +202,11 @@ ProcXChangeFeedbackControl(client)
case
BellFeedbackClass
:
if
(
len
!=
(
sizeof
(
xBellFeedbackCtl
)
>>
2
))
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadLength
);
return
Success
;
}
for
(
b
=
dev
->
bell
;
b
;
b
=
b
->
next
)
for
(
b
=
dev
->
bell
;
b
;
b
=
b
->
next
)
if
(
b
->
ctrl
.
id
==
((
xBellFeedbackCtl
*
)
&
stuff
[
1
])
->
id
)
{
ChangeBellFeedback
(
client
,
dev
,
stuff
->
mask
,
b
,
(
xBellFeedbackCtl
*
)
&
stuff
[
1
]);
...
...
@@ -217,9 +217,9 @@ ProcXChangeFeedbackControl(client)
break
;
}
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadMatch
);
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadMatch
);
return
Success
;
}
}
/******************************************************************************
*
...
...
@@ -234,7 +234,7 @@ ChangeKbdFeedback (client, dev, mask, k, f)
unsigned
long
mask
;
KbdFeedbackPtr
k
;
xKbdFeedbackCtl
*
f
;
{
{
KeybdCtrl
kctrl
;
int
t
;
int
key
=
DO_ALL
;
...
...
@@ -257,7 +257,7 @@ ChangeKbdFeedback (client, dev, mask, k, f)
else
if
(
t
<
0
||
t
>
100
)
{
client
->
errorValue
=
t
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -272,7 +272,7 @@ ChangeKbdFeedback (client, dev, mask, k, f)
else
if
(
t
<
0
||
t
>
100
)
{
client
->
errorValue
=
t
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -287,7 +287,7 @@ ChangeKbdFeedback (client, dev, mask, k, f)
else
if
(
t
<
0
)
{
client
->
errorValue
=
t
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -302,7 +302,7 @@ ChangeKbdFeedback (client, dev, mask, k, f)
else
if
(
t
<
0
)
{
client
->
errorValue
=
t
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -321,13 +321,13 @@ ChangeKbdFeedback (client, dev, mask, k, f)
if
(
key
<
8
||
key
>
255
)
{
client
->
errorValue
=
key
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
if
(
!
(
mask
&
DvAutoRepeatMode
))
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadMatch
);
return
Success
;
}
...
...
@@ -365,16 +365,16 @@ ChangeKbdFeedback (client, dev, mask, k, f)
else
{
client
->
errorValue
=
t
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
}
k
->
ctrl
=
kctrl
;
(
*
k
->
CtrlProc
)(
dev
,
&
k
->
ctrl
);
(
*
k
->
CtrlProc
)
(
dev
,
&
k
->
ctrl
);
return
Success
;
}
}
/******************************************************************************
*
...
...
@@ -389,7 +389,7 @@ ChangePtrFeedback (client, dev, mask, p, f)
unsigned
long
mask
;
PtrFeedbackPtr
p
;
xPtrFeedbackCtl
*
f
;
{
{
PtrCtrl
pctrl
;
/* might get BadValue part way through */
if
(
client
->
swapped
)
...
...
@@ -411,7 +411,7 @@ ChangePtrFeedback (client, dev, mask, p, f)
else
if
(
accelNum
<
0
)
{
client
->
errorValue
=
accelNum
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -428,7 +428,7 @@ ChangePtrFeedback (client, dev, mask, p, f)
else
if
(
accelDenom
<=
0
)
{
client
->
errorValue
=
accelDenom
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -445,7 +445,7 @@ ChangePtrFeedback (client, dev, mask, p, f)
else
if
(
threshold
<
0
)
{
client
->
errorValue
=
threshold
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -453,9 +453,9 @@ ChangePtrFeedback (client, dev, mask, p, f)
}
p
->
ctrl
=
pctrl
;
(
*
p
->
CtrlProc
)(
dev
,
&
p
->
ctrl
);
(
*
p
->
CtrlProc
)
(
dev
,
&
p
->
ctrl
);
return
Success
;
}
}
/******************************************************************************
*
...
...
@@ -472,15 +472,15 @@ ChangeIntegerFeedback (client, dev, mask, i, f)
xIntegerFeedbackCtl
*
f
;
{
if
(
client
->
swapped
)
{
{
swaps
(
&
f
->
length
);
swapl
(
&
f
->
int_to_display
);
}
i
->
ctrl
.
integer_displayed
=
f
->
int_to_display
;
(
*
i
->
CtrlProc
)(
dev
,
&
i
->
ctrl
);
(
*
i
->
CtrlProc
)
(
dev
,
&
i
->
ctrl
);
return
Success
;
}
}
/******************************************************************************
*
...
...
@@ -495,11 +495,11 @@ ChangeStringFeedback (client, dev, mask, s, f)
unsigned
long
mask
;
StringFeedbackPtr
s
;
xStringFeedbackCtl
*
f
;
{
{
int
i
,
j
;
KeySym
*
syms
,
*
sup_syms
;
syms
=
(
KeySym
*
)
(
f
+
1
);
syms
=
(
KeySym
*
)
(
f
+
1
);
if
(
client
->
swapped
)
{
swaps
(
&
f
->
length
);
/* swapped num_keysyms in calling proc */
...
...
@@ -515,8 +515,8 @@ ChangeStringFeedback (client, dev, mask, s, f)
sup_syms
=
s
->
ctrl
.
symbols_supported
;
for
(
i
=
0
;
i
<
f
->
num_keysyms
;
i
++
)
{
for
(
j
=
0
;
j
<
s
->
ctrl
.
num_symbols_supported
;
j
++
)
if
(
*
(
syms
+
i
)
==
*
(
sup_syms
+
j
))
for
(
j
=
0
;
j
<
s
->
ctrl
.
num_symbols_supported
;
j
++
)
if
(
*
(
syms
+
i
)
==
*
(
sup_syms
+
j
))
break
;
if
(
j
==
s
->
ctrl
.
num_symbols_supported
)
{
...
...
@@ -527,11 +527,11 @@ ChangeStringFeedback (client, dev, mask, s, f)
}
s
->
ctrl
.
num_symbols_displayed
=
f
->
num_keysyms
;
for
(
i
=
0
;
i
<
f
->
num_keysyms
;
i
++
)
*
(
s
->
ctrl
.
symbols_displayed
+
i
)
=
*
(
syms
+
i
);
(
*
s
->
CtrlProc
)(
dev
,
&
s
->
ctrl
);
for
(
i
=
0
;
i
<
f
->
num_keysyms
;
i
++
)
*
(
s
->
ctrl
.
symbols_displayed
+
i
)
=
*
(
syms
+
i
);
(
*
s
->
CtrlProc
)
(
dev
,
&
s
->
ctrl
);
return
Success
;
}
}
/******************************************************************************
*
...
...
@@ -546,7 +546,7 @@ ChangeBellFeedback (client, dev, mask, b, f)
unsigned
long
mask
;
BellFeedbackPtr
b
;
xBellFeedbackCtl
*
f
;
{
{
int
t
;
BellCtrl
bctrl
;
/* might get BadValue part way through */
...
...
@@ -566,7 +566,7 @@ ChangeBellFeedback (client, dev, mask, b, f)
else
if
(
t
<
0
||
t
>
100
)
{
client
->
errorValue
=
t
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -581,7 +581,7 @@ ChangeBellFeedback (client, dev, mask, b, f)
else
if
(
t
<
0
)
{
client
->
errorValue
=
t
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
...
...
@@ -596,16 +596,16 @@ ChangeBellFeedback (client, dev, mask, b, f)
else
if
(
t
<
0
)
{
client
->
errorValue
=
t
;
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeFeedbackControl
,
0
,
BadValue
);
return
Success
;
}
bctrl
.
duration
=
t
;
}
b
->
ctrl
=
bctrl
;
(
*
b
->
CtrlProc
)(
dev
,
&
b
->
ctrl
);
(
*
b
->
CtrlProc
)
(
dev
,
&
b
->
ctrl
);
return
Success
;
}
}
/******************************************************************************
*
...
...
@@ -620,7 +620,7 @@ ChangeLedFeedback (client, dev, mask, l, f)
unsigned
long
mask
;
LedFeedbackPtr
l
;
xLedFeedbackCtl
*
f
;
{
{
LedCtrl
lctrl
;
/* might get BadValue part way through */
if
(
client
->
swapped
)
...
...
@@ -636,10 +636,10 @@ ChangeLedFeedback (client, dev, mask, l, f)
{
lctrl
.
led_mask
=
f
->
led_mask
;
lctrl
.
led_values
=
f
->
led_values
;
(
*
l
->
CtrlProc
)(
dev
,
&
lctrl
);
(
*
l
->
CtrlProc
)
(
dev
,
&
lctrl
);
l
->
ctrl
.
led_values
&=
~
(
f
->
led_mask
);
/* zero changed leds */
l
->
ctrl
.
led_values
|=
(
f
->
led_mask
&
f
->
led_values
);
/* OR in set leds
*/
l
->
ctrl
.
led_values
|=
(
f
->
led_mask
&
f
->
led_values
);
/* OR in set leds
*/
}
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/chgfctl.h
View file @
41a0ba72
...
...
@@ -43,54 +43,54 @@ ProcXChangeFeedbackControl(
int
ChangeKbdFeedback
(
ClientPtr
/* client */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
KbdFeedbackPtr
/* k */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
KbdFeedbackPtr
/* k */
,
xKbdFeedbackCtl
*
/* f */
);
int
ChangePtrFeedback
(
ClientPtr
/* client */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
PtrFeedbackPtr
/* p */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
PtrFeedbackPtr
/* p */
,
xPtrFeedbackCtl
*
/* f */
);
int
ChangeIntegerFeedback
(
ClientPtr
/* client */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
IntegerFeedbackPtr
/* i */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
IntegerFeedbackPtr
/* i */
,
xIntegerFeedbackCtl
*
/* f */
);
int
ChangeStringFeedback
(
ClientPtr
/* client */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
StringFeedbackPtr
/* s */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
StringFeedbackPtr
/* s */
,
xStringFeedbackCtl
*
/* f */
);
int
ChangeBellFeedback
(
ClientPtr
/* client */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
BellFeedbackPtr
/* b */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
BellFeedbackPtr
/* b */
,
xBellFeedbackCtl
*
/* f */
);
int
ChangeLedFeedback
(
ClientPtr
/* client */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
LedFeedbackPtr
/* l */
,
DeviceIntPtr
/* dev */
,
unsigned
long
/* mask */
,
LedFeedbackPtr
/* l */
,
xLedFeedbackCtl
*
/* f */
);
...
...
nx-X11/programs/Xserver/Xi/chgkbd.c
View file @
41a0ba72
...
...
@@ -80,12 +80,12 @@ SOFTWARE.
int
SProcXChangeKeyboardDevice
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xChangeKeyboardDeviceReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xChangeKeyboardDeviceReq
);
return
(
ProcXChangeKeyboardDevice
(
client
));
}
return
(
ProcXChangeKeyboardDevice
(
client
));
}
/***********************************************************************
*
...
...
@@ -97,7 +97,7 @@ SProcXChangeKeyboardDevice(client)
int
ProcXChangeKeyboardDevice
(
client
)
register
ClientPtr
client
;
{
{
int
i
;
DeviceIntPtr
xkbd
=
inputInfo
.
keyboard
;
DeviceIntPtr
dev
;
...
...
@@ -115,7 +115,7 @@ ProcXChangeKeyboardDevice (client)
rep
.
length
=
0
;
rep
.
sequenceNumber
=
client
->
sequence
;
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
rep
.
status
=
-
1
;
...
...
@@ -150,10 +150,10 @@ ProcXChangeKeyboardDevice (client)
return
Success
;
}
if
(
!
dev
->
focus
)
InitFocusClassDeviceStruct
(
dev
);
InitFocusClassDeviceStruct
(
dev
);
if
(
!
dev
->
kbdfeed
)
InitKbdFeedbackClassDeviceStruct
(
dev
,
(
BellProcPtr
)
NoopDDA
,
(
KbdCtrlProcPtr
)
NoopDDA
);
InitKbdFeedbackClassDeviceStruct
(
dev
,
(
BellProcPtr
)
NoopDDA
,
(
KbdCtrlProcPtr
)
NoopDDA
);
df
=
dev
->
focus
;
df
->
win
=
xf
->
win
;
df
->
revert
=
xf
->
revert
;
...
...
@@ -167,18 +167,18 @@ ProcXChangeKeyboardDevice (client)
Must_have_memory
=
FALSE
;
/* XXX */
}
df
->
traceSize
=
xf
->
traceSize
;
for
(
i
=
0
;
i
<
df
->
traceSize
;
i
++
)
for
(
i
=
0
;
i
<
df
->
traceSize
;
i
++
)
df
->
trace
[
i
]
=
xf
->
trace
[
i
];
RegisterOtherDevice
(
xkbd
);
RegisterKeyboardDevice
(
dev
);
RegisterOtherDevice
(
xkbd
);
RegisterKeyboardDevice
(
dev
);
ev
.
type
=
ChangeDeviceNotify
;
ev
.
deviceid
=
stuff
->
deviceid
;
ev
.
time
=
currentTime
.
milliseconds
;
ev
.
request
=
NewKeyboard
;
SendEventToAllWindows
(
dev
,
ChangeDeviceNotifyMask
,
(
xEvent
*
)
&
ev
,
1
);
SendMappingNotify
(
MappingKeyboard
,
k
->
curKeySyms
.
minKeyCode
,
SendEventToAllWindows
(
dev
,
ChangeDeviceNotifyMask
,
(
xEvent
*
)
&
ev
,
1
);
SendMappingNotify
(
MappingKeyboard
,
k
->
curKeySyms
.
minKeyCode
,
k
->
curKeySyms
.
maxKeyCode
-
k
->
curKeySyms
.
minKeyCode
+
1
,
client
);
rep
.
status
=
0
;
...
...
@@ -187,7 +187,7 @@ ProcXChangeKeyboardDevice (client)
WriteReplyToClient
(
client
,
sizeof
(
xChangeKeyboardDeviceReply
),
&
rep
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -201,8 +201,8 @@ SRepXChangeKeyboardDevice (client, size, rep)
ClientPtr
client
;
int
size
;
xChangeKeyboardDeviceReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/chgkbd.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXChangeKeyboardDevice (
void
SRepXChangeKeyboardDevice
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xChangeKeyboardDeviceReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/chgkmap.c
View file @
41a0ba72
...
...
@@ -77,7 +77,7 @@ SOFTWARE.
int
SProcXChangeDeviceKeyMapping
(
client
)
register
ClientPtr
client
;
{
{
unsigned
int
count
;
REQUEST
(
xChangeDeviceKeyMappingReq
);
...
...
@@ -86,8 +86,8 @@ SProcXChangeDeviceKeyMapping(client)
count
=
stuff
->
keyCodes
*
stuff
->
keySymsPerKeyCode
;
REQUEST_FIXED_SIZE
(
xChangeDeviceKeyMappingReq
,
count
*
sizeof
(
CARD32
));
SwapLongs
((
CARD32
*
)
(
&
stuff
[
1
]),
count
);
return
(
ProcXChangeDeviceKeyMapping
(
client
));
}
return
(
ProcXChangeDeviceKeyMapping
(
client
));
}
/***********************************************************************
*
...
...
@@ -98,7 +98,7 @@ SProcXChangeDeviceKeyMapping(client)
int
ProcXChangeDeviceKeyMapping
(
client
)
register
ClientPtr
client
;
{
{
int
ret
;
unsigned
len
;
DeviceIntPtr
dev
;
...
...
@@ -110,16 +110,16 @@ ProcXChangeDeviceKeyMapping(client)
count
=
stuff
->
keyCodes
*
stuff
->
keySymsPerKeyCode
;
REQUEST_FIXED_SIZE
(
xChangeDeviceKeyMappingReq
,
count
*
sizeof
(
CARD32
));
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceKeyMapping
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceKeyMapping
,
0
,
BadDevice
);
return
Success
;
}
len
=
stuff
->
length
-
(
sizeof
(
xChangeDeviceKeyMappingReq
)
>>
2
);
ret
=
ChangeKeyMapping
(
client
,
dev
,
len
,
DeviceMappingNotify
,
ret
=
ChangeKeyMapping
(
client
,
dev
,
len
,
DeviceMappingNotify
,
stuff
->
firstKeyCode
,
stuff
->
keyCodes
,
stuff
->
keySymsPerKeyCode
,
(
KeySym
*
)
&
stuff
[
1
]);
...
...
@@ -127,4 +127,4 @@ ProcXChangeDeviceKeyMapping(client)
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceKeyMapping
,
0
,
ret
);
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/chgkmap.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/chgprop.c
View file @
41a0ba72
...
...
@@ -79,7 +79,7 @@ SOFTWARE.
int
SProcXChangeDeviceDontPropagateList
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xChangeDeviceDontPropagateListReq
);
swaps
(
&
stuff
->
length
);
REQUEST_AT_LEAST_SIZE
(
xChangeDeviceDontPropagateListReq
);
...
...
@@ -88,8 +88,8 @@ SProcXChangeDeviceDontPropagateList(client)
REQUEST_FIXED_SIZE
(
xChangeDeviceDontPropagateListReq
,
stuff
->
count
*
sizeof
(
CARD32
));
SwapLongs
((
CARD32
*
)
(
&
stuff
[
1
]),
stuff
->
count
);
return
(
ProcXChangeDeviceDontPropagateList
(
client
));
}
return
(
ProcXChangeDeviceDontPropagateList
(
client
));
}
/***********************************************************************
*
...
...
@@ -100,7 +100,7 @@ SProcXChangeDeviceDontPropagateList(client)
int
ProcXChangeDeviceDontPropagateList
(
client
)
register
ClientPtr
client
;
{
{
int
i
;
WindowPtr
pWin
;
struct
tmask
tmp
[
EMASKSIZE
];
...
...
@@ -109,15 +109,15 @@ ProcXChangeDeviceDontPropagateList (client)
REQUEST
(
xChangeDeviceDontPropagateListReq
);
REQUEST_AT_LEAST_SIZE
(
xChangeDeviceDontPropagateListReq
);
if
(
stuff
->
length
!=
(
sizeof
(
xChangeDeviceDontPropagateListReq
)
>>
2
)
+
if
(
stuff
->
length
!=
(
sizeof
(
xChangeDeviceDontPropagateListReq
)
>>
2
)
+
stuff
->
count
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceDontPropagateList
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_ChangeDeviceDontPropagateList
,
0
,
BadLength
);
return
Success
;
}
pWin
=
(
WindowPtr
)
LookupWindow
(
stuff
->
window
,
client
);
pWin
=
(
WindowPtr
)
LookupWindow
(
stuff
->
window
,
client
);
if
(
!
pWin
)
{
client
->
errorValue
=
stuff
->
window
;
...
...
@@ -134,7 +134,7 @@ ProcXChangeDeviceDontPropagateList (client)
return
Success
;
}
if
(
CreateMaskFromList
(
client
,
(
XEventClass
*
)
&
stuff
[
1
],
if
(
CreateMaskFromList
(
client
,
(
XEventClass
*
)
&
stuff
[
1
],
stuff
->
count
,
tmp
,
NULL
,
X_ChangeDeviceDontPropagateList
)
!=
Success
)
return
Success
;
...
...
@@ -160,4 +160,4 @@ ProcXChangeDeviceDontPropagateList (client)
}
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/chgprop.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/chgptr.c
View file @
41a0ba72
...
...
@@ -83,12 +83,12 @@ SOFTWARE.
int
SProcXChangePointerDevice
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xChangePointerDeviceReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xChangePointerDeviceReq
);
return
(
ProcXChangePointerDevice
(
client
));
}
return
(
ProcXChangePointerDevice
(
client
));
}
/***********************************************************************
*
...
...
@@ -99,7 +99,7 @@ SProcXChangePointerDevice(client)
int
ProcXChangePointerDevice
(
client
)
register
ClientPtr
client
;
{
{
DeviceIntPtr
xptr
=
inputInfo
.
pointer
;
DeviceIntPtr
dev
;
ValuatorClassPtr
v
;
...
...
@@ -114,7 +114,7 @@ ProcXChangePointerDevice (client)
rep
.
length
=
0
;
rep
.
sequenceNumber
=
client
->
sequence
;
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
rep
.
status
=
-
1
;
...
...
@@ -153,19 +153,19 @@ ProcXChangePointerDevice (client)
if
(
dev
->
focus
)
DeleteFocusClassDeviceStruct
(
dev
);
if
(
!
dev
->
button
)
InitButtonClassDeviceStruct
(
dev
,
0
,
NULL
);
InitButtonClassDeviceStruct
(
dev
,
0
,
NULL
);
if
(
!
dev
->
ptrfeed
)
InitPtrFeedbackClassDeviceStruct
(
dev
,
(
PtrCtrlProcPtr
)
NoopDDA
);
RegisterOtherDevice
(
xptr
);
RegisterPointerDevice
(
dev
);
InitPtrFeedbackClassDeviceStruct
(
dev
,
(
PtrCtrlProcPtr
)
NoopDDA
);
RegisterOtherDevice
(
xptr
);
RegisterPointerDevice
(
dev
);
ev
.
type
=
ChangeDeviceNotify
;
ev
.
deviceid
=
stuff
->
deviceid
;
ev
.
time
=
currentTime
.
milliseconds
;
ev
.
request
=
NewPointer
;
SendEventToAllWindows
(
dev
,
ChangeDeviceNotifyMask
,
(
xEvent
*
)
&
ev
,
1
);
SendMappingNotify
(
MappingPointer
,
0
,
0
,
client
);
SendEventToAllWindows
(
dev
,
ChangeDeviceNotifyMask
,
(
xEvent
*
)
&
ev
,
1
);
SendMappingNotify
(
MappingPointer
,
0
,
0
,
client
);
rep
.
status
=
0
;
}
...
...
@@ -173,16 +173,16 @@ ProcXChangePointerDevice (client)
WriteReplyToClient
(
client
,
sizeof
(
xChangePointerDeviceReply
),
&
rep
);
return
Success
;
}
}
void
DeleteFocusClassDeviceStruct
(
dev
)
DeviceIntPtr
dev
;
{
{
free
(
dev
->
focus
->
trace
);
free
(
dev
->
focus
);
dev
->
focus
=
NULL
;
}
}
/***********************************************************************
*
...
...
@@ -196,7 +196,7 @@ SendEventToAllWindows (dev, mask, ev, count)
Mask
mask
;
xEvent
*
ev
;
int
count
;
{
{
int
i
;
WindowPtr
pWin
,
p1
;
...
...
@@ -205,9 +205,9 @@ SendEventToAllWindows (dev, mask, ev, count)
pWin
=
screenInfo
.
screens
[
i
]
->
root
;
(
void
)
DeliverEventsToWindow
(
pWin
,
ev
,
count
,
mask
,
NullGrab
,
dev
->
id
);
p1
=
pWin
->
firstChild
;
FindInterestedChildren
(
dev
,
p1
,
mask
,
ev
,
count
);
}
FindInterestedChildren
(
dev
,
p1
,
mask
,
ev
,
count
);
}
}
/***********************************************************************
*
...
...
@@ -223,17 +223,17 @@ FindInterestedChildren (dev, p1, mask, ev, count)
Mask
mask
;
xEvent
*
ev
;
int
count
;
{
{
WindowPtr
p2
;
while
(
p1
)
{
p2
=
p1
->
firstChild
;
(
void
)
DeliverEventsToWindow
(
p1
,
ev
,
count
,
mask
,
NullGrab
,
dev
->
id
);
FindInterestedChildren
(
dev
,
p2
,
mask
,
ev
,
count
);
FindInterestedChildren
(
dev
,
p2
,
mask
,
ev
,
count
);
p1
=
p1
->
nextSib
;
}
}
}
/***********************************************************************
*
...
...
@@ -247,8 +247,8 @@ SRepXChangePointerDevice (client, size, rep)
ClientPtr
client
;
int
size
;
xChangePointerDeviceReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/chgptr.h
View file @
41a0ba72
...
...
@@ -48,24 +48,24 @@ DeleteFocusClassDeviceStruct(
void
SendEventToAllWindows
(
DeviceIntPtr
/* dev */
,
Mask
/* mask */
,
xEvent
*
/* ev */
,
Mask
/* mask */
,
xEvent
*
/* ev */
,
int
/* count */
);
void
FindInterestedChildren
(
/* FIXME: could be static? */
DeviceIntPtr
/* dev */
,
WindowPtr
/* p1 */
,
Mask
/* mask */
,
xEvent
*
/* ev */
,
DeviceIntPtr
/* dev */
,
WindowPtr
/* p1 */
,
Mask
/* mask */
,
xEvent
*
/* ev */
,
int
/* count */
);
void
SRepXChangePointerDevice
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xChangePointerDeviceReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/closedev.c
View file @
41a0ba72
...
...
@@ -78,12 +78,12 @@ SOFTWARE.
int
SProcXCloseDevice
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xCloseDeviceReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xCloseDeviceReq
);
return
(
ProcXCloseDevice
(
client
));
}
return
(
ProcXCloseDevice
(
client
));
}
/***********************************************************************
*
...
...
@@ -94,7 +94,7 @@ SProcXCloseDevice(client)
int
ProcXCloseDevice
(
client
)
register
ClientPtr
client
;
{
{
int
i
;
WindowPtr
pWin
,
p1
;
DeviceIntPtr
d
;
...
...
@@ -102,7 +102,7 @@ ProcXCloseDevice(client)
REQUEST
(
xCloseDeviceReq
);
REQUEST_SIZE_MATCH
(
xCloseDeviceReq
);
d
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
d
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
d
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_CloseDevice
,
0
,
BadDevice
);
...
...
@@ -110,7 +110,7 @@ ProcXCloseDevice(client)
}
if
(
d
->
grab
&&
SameClient
(
d
->
grab
,
client
))
(
*
d
->
DeactivateGrab
)
(
d
);
/* release active grab */
(
*
d
->
DeactivateGrab
)
(
d
);
/* release active grab */
/* Remove event selections from all windows for events from this device
and selected by this client.
...
...
@@ -119,14 +119,14 @@ ProcXCloseDevice(client)
for
(
i
=
0
;
i
<
screenInfo
.
numScreens
;
i
++
)
{
pWin
=
screenInfo
.
screens
[
i
]
->
root
;
DeleteDeviceEvents
(
d
,
pWin
,
client
);
DeleteDeviceEvents
(
d
,
pWin
,
client
);
p1
=
pWin
->
firstChild
;
DeleteEventsFromChildren
(
d
,
p1
,
client
);
DeleteEventsFromChildren
(
d
,
p1
,
client
);
}
CloseInputDevice
(
d
,
client
);
CloseInputDevice
(
d
,
client
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -140,17 +140,17 @@ DeleteEventsFromChildren(dev, p1, client)
DeviceIntPtr
dev
;
WindowPtr
p1
;
ClientPtr
client
;
{
{
WindowPtr
p2
;
while
(
p1
)
{
p2
=
p1
->
firstChild
;
DeleteDeviceEvents
(
dev
,
p1
,
client
);
DeleteDeviceEvents
(
dev
,
p1
,
client
);
DeleteEventsFromChildren
(
dev
,
p2
,
client
);
p1
=
p1
->
nextSib
;
}
}
}
/***********************************************************************
*
...
...
@@ -164,7 +164,7 @@ DeleteDeviceEvents (dev, pWin, client)
DeviceIntPtr
dev
;
WindowPtr
pWin
;
ClientPtr
client
;
{
{
InputClientsPtr
others
;
OtherInputMasks
*
pOthers
;
GrabPtr
grab
,
next
;
...
...
@@ -172,7 +172,7 @@ DeleteDeviceEvents (dev, pWin, client)
if
((
pOthers
=
wOtherInputMasks
(
pWin
))
!=
0
)
for
(
others
=
pOthers
->
inputClients
;
others
;
others
=
others
->
next
)
if
(
SameClient
(
others
,
client
))
if
(
SameClient
(
others
,
client
))
others
->
mask
[
dev
->
id
]
=
NoEventMask
;
for
(
grab
=
wPassiveGrabs
(
pWin
);
grab
;
grab
=
next
)
...
...
@@ -180,6 +180,6 @@ DeleteDeviceEvents (dev, pWin, client)
next
=
grab
->
next
;
if
((
grab
->
device
==
dev
)
&&
(
client
->
clientAsMask
==
CLIENT_BITS
(
grab
->
resource
)))
FreeResource
(
grab
->
resource
,
RT_NONE
);
}
FreeResource
(
grab
->
resource
,
RT_NONE
);
}
}
nx-X11/programs/Xserver/Xi/closedev.h
View file @
41a0ba72
...
...
@@ -43,14 +43,14 @@ ProcXCloseDevice(
void
DeleteEventsFromChildren
(
DeviceIntPtr
/* dev */
,
WindowPtr
/* p1 */
,
WindowPtr
/* p1 */
,
ClientPtr
/* client */
);
void
DeleteDeviceEvents
(
DeviceIntPtr
/* dev */
,
WindowPtr
/* pWin */
,
WindowPtr
/* pWin */
,
ClientPtr
/* client */
);
...
...
nx-X11/programs/Xserver/Xi/devbell.c
View file @
41a0ba72
...
...
@@ -76,11 +76,11 @@ SOFTWARE.
int
SProcXDeviceBell
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xDeviceBellReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXDeviceBell
(
client
));
}
return
(
ProcXDeviceBell
(
client
));
}
/***********************************************************************
*
...
...
@@ -91,20 +91,20 @@ SProcXDeviceBell(client)
int
ProcXDeviceBell
(
client
)
register
ClientPtr
client
;
{
{
DeviceIntPtr
dev
;
KbdFeedbackPtr
k
;
BellFeedbackPtr
b
;
int
base
;
int
newpercent
;
CARD8
class
;
void
*
ctrl
;
void
*
ctrl
;
BellProcPtr
proc
;
REQUEST
(
xDeviceBellReq
);
REQUEST_SIZE_MATCH
(
xDeviceBellReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
client
->
errorValue
=
stuff
->
deviceid
;
...
...
@@ -120,7 +120,7 @@ ProcXDeviceBell (client)
}
if
(
stuff
->
feedbackclass
==
KbdFeedbackClass
)
{
for
(
k
=
dev
->
kbdfeed
;
k
;
k
=
k
->
next
)
for
(
k
=
dev
->
kbdfeed
;
k
;
k
=
k
->
next
)
if
(
k
->
ctrl
.
id
==
stuff
->
feedbackid
)
break
;
if
(
!
k
)
...
...
@@ -131,12 +131,12 @@ ProcXDeviceBell (client)
}
base
=
k
->
ctrl
.
bell
;
proc
=
k
->
BellProc
;
ctrl
=
(
void
*
)
&
(
k
->
ctrl
);
ctrl
=
(
void
*
)
&
(
k
->
ctrl
);
class
=
KbdFeedbackClass
;
}
else
if
(
stuff
->
feedbackclass
==
BellFeedbackClass
)
{
for
(
b
=
dev
->
bell
;
b
;
b
=
b
->
next
)
for
(
b
=
dev
->
bell
;
b
;
b
=
b
->
next
)
if
(
b
->
ctrl
.
id
==
stuff
->
feedbackid
)
break
;
if
(
!
b
)
...
...
@@ -147,7 +147,7 @@ ProcXDeviceBell (client)
}
base
=
b
->
ctrl
.
percent
;
proc
=
b
->
BellProc
;
ctrl
=
(
void
*
)
&
(
b
->
ctrl
);
ctrl
=
(
void
*
)
&
(
b
->
ctrl
);
class
=
BellFeedbackClass
;
}
else
...
...
@@ -161,7 +161,7 @@ ProcXDeviceBell (client)
newpercent
=
base
+
newpercent
;
else
newpercent
=
base
-
newpercent
+
stuff
->
percent
;
(
*
proc
)(
newpercent
,
dev
,
ctrl
,
class
);
(
*
proc
)
(
newpercent
,
dev
,
ctrl
,
class
);
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/devbell.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/exevents.c
View file @
41a0ba72
...
...
@@ -99,12 +99,12 @@ static Bool MakeInputMasks (
void
RegisterOtherDevice
(
device
)
DeviceIntPtr
device
;
{
{
device
->
public
.
processInputProc
=
ProcessOtherEvent
;
device
->
public
.
realInputProc
=
ProcessOtherEvent
;
(
device
)
->
ActivateGrab
=
ActivateKeyboardGrab
;
(
device
)
->
DeactivateGrab
=
DeactivateKeyboardGrab
;
}
}
/*ARGSUSED*/
void
...
...
@@ -112,7 +112,7 @@ ProcessOtherEvent (xE, other, count)
xEventPtr
xE
;
register
DeviceIntPtr
other
;
int
count
;
{
{
register
BYTE
*
kptr
;
register
int
i
;
register
CARD16
modifiers
;
...
...
@@ -142,7 +142,7 @@ ProcessOtherEvent (xE, other, count)
eventinfo
.
count
=
count
;
CallCallbacks
(
&
DeviceEventCallback
,
(
void
*
)
&
eventinfo
);
}
for
(
i
=
1
;
i
<
count
;
i
++
)
for
(
i
=
1
;
i
<
count
;
i
++
)
if
((
++
xV
)
->
type
==
DeviceValuator
)
{
int
first
=
xV
->
first_valuator
;
...
...
@@ -160,17 +160,17 @@ ProcessOtherEvent (xE, other, count)
axisvals
=
v
->
axisVal
;
switch
(
xV
->
num_valuators
)
{
case
6
:
*
(
axisvals
+
first
+
5
)
=
xV
->
valuator5
;
*
(
axisvals
+
first
+
5
)
=
xV
->
valuator5
;
case
5
:
*
(
axisvals
+
first
+
4
)
=
xV
->
valuator4
;
*
(
axisvals
+
first
+
4
)
=
xV
->
valuator4
;
case
4
:
*
(
axisvals
+
first
+
3
)
=
xV
->
valuator3
;
*
(
axisvals
+
first
+
3
)
=
xV
->
valuator3
;
case
3
:
*
(
axisvals
+
first
+
2
)
=
xV
->
valuator2
;
*
(
axisvals
+
first
+
2
)
=
xV
->
valuator2
;
case
2
:
*
(
axisvals
+
first
+
1
)
=
xV
->
valuator1
;
*
(
axisvals
+
first
+
1
)
=
xV
->
valuator1
;
case
1
:
*
(
axisvals
+
first
)
=
xV
->
valuator0
;
*
(
axisvals
+
first
)
=
xV
->
valuator0
;
case
0
:
default
:
break
;
...
...
@@ -254,7 +254,7 @@ ProcessOtherEvent (xE, other, count)
return
;
if
(
xE
->
u
.
u
.
detail
<=
5
)
b
->
state
|=
(
Button1Mask
>>
1
)
<<
xE
->
u
.
u
.
detail
;
SetMaskForEvent
(
Motion_Filter
(
b
),
DeviceMotionNotify
);
SetMaskForEvent
(
Motion_Filter
(
b
),
DeviceMotionNotify
);
if
(
!
grab
)
if
(
CheckDeviceGrabs
(
other
,
xE
,
0
,
count
))
return
;
...
...
@@ -273,7 +273,7 @@ ProcessOtherEvent (xE, other, count)
return
;
if
(
xE
->
u
.
u
.
detail
<=
5
)
b
->
state
&=
~
((
Button1Mask
>>
1
)
<<
xE
->
u
.
u
.
detail
);
SetMaskForEvent
(
Motion_Filter
(
b
),
DeviceMotionNotify
);
SetMaskForEvent
(
Motion_Filter
(
b
),
DeviceMotionNotify
);
if
(
!
b
->
state
&&
other
->
fromPassiveGrab
)
deactivateDeviceGrab
=
TRUE
;
}
...
...
@@ -291,15 +291,15 @@ ProcessOtherEvent (xE, other, count)
other
,
count
);
if
(
deactivateDeviceGrab
==
TRUE
)
(
*
other
->
DeactivateGrab
)
(
other
);
}
(
*
other
->
DeactivateGrab
)
(
other
);
}
int
InitProximityClassDeviceStruct
(
DeviceIntPtr
dev
)
InitProximityClassDeviceStruct
(
DeviceIntPtr
dev
)
{
register
ProximityClassPtr
proxc
;
proxc
=
(
ProximityClassPtr
)
malloc
(
sizeof
(
ProximityClassRec
));
proxc
=
(
ProximityClassPtr
)
malloc
(
sizeof
(
ProximityClassRec
));
if
(
!
proxc
)
return
FALSE
;
dev
->
proximity
=
proxc
;
...
...
@@ -344,12 +344,12 @@ FixDeviceStateNotify (
if
(
b
)
{
ev
->
classes_reported
|=
(
1
<<
ButtonClass
);
ev
->
num_buttons
=
b
->
numButtons
;
memmove
((
char
*
)
&
ev
->
buttons
[
0
],
(
char
*
)
b
->
down
,
4
);
memmove
((
char
*
)
&
ev
->
buttons
[
0
],
(
char
*
)
b
->
down
,
4
);
}
else
if
(
k
)
{
ev
->
classes_reported
|=
(
1
<<
KeyClass
);
ev
->
num_keys
=
k
->
curKeySyms
.
maxKeyCode
-
k
->
curKeySyms
.
minKeyCode
;
memmove
((
char
*
)
&
ev
->
keys
[
0
],
(
char
*
)
k
->
down
,
4
);
memmove
((
char
*
)
&
ev
->
keys
[
0
],
(
char
*
)
k
->
down
,
4
);
}
if
(
v
)
{
int
nval
=
v
->
numAxes
-
first
;
...
...
@@ -359,15 +359,15 @@ FixDeviceStateNotify (
switch
(
ev
->
num_valuators
)
{
case
3
:
ev
->
valuator2
=
v
->
axisVal
[
first
+
2
];
ev
->
valuator2
=
v
->
axisVal
[
first
+
2
];
case
2
:
ev
->
valuator1
=
v
->
axisVal
[
first
+
1
];
ev
->
valuator1
=
v
->
axisVal
[
first
+
1
];
case
1
:
ev
->
valuator0
=
v
->
axisVal
[
first
];
break
;
}
}
}
}
static
void
FixDeviceValuator
(
...
...
@@ -384,22 +384,22 @@ FixDeviceValuator (
ev
->
first_valuator
=
first
;
switch
(
ev
->
num_valuators
)
{
case
3
:
ev
->
valuator2
=
v
->
axisVal
[
first
+
2
];
ev
->
valuator2
=
v
->
axisVal
[
first
+
2
];
case
2
:
ev
->
valuator1
=
v
->
axisVal
[
first
+
1
];
ev
->
valuator1
=
v
->
axisVal
[
first
+
1
];
case
1
:
ev
->
valuator0
=
v
->
axisVal
[
first
];
break
;
}
first
+=
ev
->
num_valuators
;
}
}
void
DeviceFocusEvent
(
dev
,
type
,
mode
,
detail
,
pWin
)
DeviceIntPtr
dev
;
int
type
,
mode
,
detail
;
register
WindowPtr
pWin
;
{
{
deviceFocus
event
;
if
(
type
==
FocusIn
)
...
...
@@ -414,7 +414,7 @@ DeviceFocusEvent(dev, type, mode, detail, pWin)
event
.
window
=
pWin
->
drawable
.
id
;
event
.
time
=
currentTime
.
milliseconds
;
(
void
)
DeliverEventsToWindow
(
pWin
,
(
xEvent
*
)
&
event
,
1
,
(
void
)
DeliverEventsToWindow
(
pWin
,
(
xEvent
*
)
&
event
,
1
,
DeviceFocusChangeMask
,
NullGrab
,
dev
->
id
);
if
((
type
==
DeviceFocusIn
)
&&
...
...
@@ -429,14 +429,14 @@ DeviceFocusEvent(dev, type, mode, detail, pWin)
KeyClassPtr
k
;
ButtonClassPtr
b
;
ValuatorClassPtr
v
;
int
nval
=
0
,
nkeys
=
0
,
nbuttons
=
0
,
first
=
0
;
int
nval
=
0
,
nkeys
=
0
,
nbuttons
=
0
,
first
=
0
;
if
((
b
=
dev
->
button
)
!=
NULL
)
{
if
((
b
=
dev
->
button
)
!=
NULL
)
{
nbuttons
=
b
->
numButtons
;
if
(
nbuttons
>
32
)
evcount
++
;
}
if
((
k
=
dev
->
key
)
!=
NULL
)
{
if
((
k
=
dev
->
key
)
!=
NULL
)
{
nkeys
=
k
->
curKeySyms
.
maxKeyCode
-
k
->
curKeySyms
.
minKeyCode
;
if
(
nkeys
>
32
)
evcount
++
;
...
...
@@ -444,7 +444,7 @@ DeviceFocusEvent(dev, type, mode, detail, pWin)
evcount
++
;
}
}
if
((
v
=
dev
->
valuator
)
!=
NULL
)
{
if
((
v
=
dev
->
valuator
)
!=
NULL
)
{
nval
=
v
->
numAxes
;
if
(
nval
>
3
)
...
...
@@ -458,63 +458,63 @@ DeviceFocusEvent(dev, type, mode, detail, pWin)
}
sev
=
ev
=
(
deviceStateNotify
*
)
malloc
(
evcount
*
sizeof
(
xEvent
));
FixDeviceStateNotify
(
dev
,
ev
,
NULL
,
NULL
,
NULL
,
first
);
FixDeviceStateNotify
(
dev
,
ev
,
NULL
,
NULL
,
NULL
,
first
);
if
(
b
!=
NULL
)
{
FixDeviceStateNotify
(
dev
,
ev
++
,
NULL
,
b
,
v
,
first
);
FixDeviceStateNotify
(
dev
,
ev
++
,
NULL
,
b
,
v
,
first
);
first
+=
3
;
nval
-=
3
;
if
(
nbuttons
>
32
)
{
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
bev
=
(
deviceButtonStateNotify
*
)
ev
++
;
bev
->
type
=
DeviceButtonStateNotify
;
bev
->
deviceid
=
dev
->
id
;
memmove
((
char
*
)
&
bev
->
buttons
[
0
],
(
char
*
)
&
b
->
down
[
4
],
28
);
memmove
((
char
*
)
&
bev
->
buttons
[
0
],
(
char
*
)
&
b
->
down
[
4
],
28
);
}
if
(
nval
>
0
)
{
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
FixDeviceValuator
(
dev
,
(
deviceValuator
*
)
ev
++
,
v
,
first
);
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
FixDeviceValuator
(
dev
,
(
deviceValuator
*
)
ev
++
,
v
,
first
);
first
+=
3
;
nval
-=
3
;
}
}
if
(
k
!=
NULL
)
{
FixDeviceStateNotify
(
dev
,
ev
++
,
k
,
NULL
,
v
,
first
);
FixDeviceStateNotify
(
dev
,
ev
++
,
k
,
NULL
,
v
,
first
);
first
+=
3
;
nval
-=
3
;
if
(
nkeys
>
32
)
{
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
kev
=
(
deviceKeyStateNotify
*
)
ev
++
;
kev
->
type
=
DeviceKeyStateNotify
;
kev
->
deviceid
=
dev
->
id
;
memmove
((
char
*
)
&
kev
->
keys
[
0
],
(
char
*
)
&
k
->
down
[
4
],
28
);
memmove
((
char
*
)
&
kev
->
keys
[
0
],
(
char
*
)
&
k
->
down
[
4
],
28
);
}
if
(
nval
>
0
)
{
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
FixDeviceValuator
(
dev
,
(
deviceValuator
*
)
ev
++
,
v
,
first
);
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
FixDeviceValuator
(
dev
,
(
deviceValuator
*
)
ev
++
,
v
,
first
);
first
+=
3
;
nval
-=
3
;
}
}
while
(
nval
>
0
)
{
FixDeviceStateNotify
(
dev
,
ev
++
,
NULL
,
NULL
,
v
,
first
);
FixDeviceStateNotify
(
dev
,
ev
++
,
NULL
,
NULL
,
v
,
first
);
first
+=
3
;
nval
-=
3
;
if
(
nval
>
0
)
{
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
FixDeviceValuator
(
dev
,
(
deviceValuator
*
)
ev
++
,
v
,
first
);
(
ev
-
1
)
->
deviceid
|=
MORE_EVENTS
;
FixDeviceValuator
(
dev
,
(
deviceValuator
*
)
ev
++
,
v
,
first
);
first
+=
3
;
nval
-=
3
;
}
}
(
void
)
DeliverEventsToWindow
(
pWin
,
(
xEvent
*
)
sev
,
evcount
,
(
void
)
DeliverEventsToWindow
(
pWin
,
(
xEvent
*
)
sev
,
evcount
,
DeviceStateNotifyMask
,
NullGrab
,
dev
->
id
);
free
(
sev
);
}
free
(
sev
);
}
}
int
GrabButton
(
...
...
@@ -573,7 +573,7 @@ GrabButton(
cursor
=
NullCursor
;
else
{
cursor
=
(
CursorPtr
)
LookupIDByType
(
rcursor
,
RT_CURSOR
);
cursor
=
(
CursorPtr
)
LookupIDByType
(
rcursor
,
RT_CURSOR
);
if
(
!
cursor
)
{
client
->
errorValue
=
rcursor
;
...
...
@@ -588,7 +588,7 @@ GrabButton(
if
(
!
grab
)
return
BadAlloc
;
return
AddPassiveGrabToList
(
grab
);
}
}
int
GrabKey
(
...
...
@@ -607,7 +607,7 @@ GrabKey(
GrabPtr
grab
;
KeyClassPtr
k
=
dev
->
key
;
if
(
k
==
NULL
)
if
(
k
==
NULL
)
return
BadMatch
;
if
((
other_devices_mode
!=
GrabModeSync
)
&&
(
other_devices_mode
!=
GrabModeAsync
))
...
...
@@ -650,7 +650,7 @@ GrabKey(
if
(
!
grab
)
return
BadAlloc
;
return
AddPassiveGrabToList
(
grab
);
}
}
int
SelectForWindow
(
dev
,
pWin
,
client
,
mask
,
exclusivemasks
,
validmasks
)
...
...
@@ -698,7 +698,7 @@ SelectForWindow(dev, pWin, client, mask, exclusivemasks, validmasks)
others
->
mask
[
mskidx
]
=
mask
;
if
(
mask
==
0
)
{
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
if
(
i
!=
mskidx
&&
others
->
mask
[
i
]
!=
0
)
break
;
if
(
i
==
EMASKSIZE
)
...
...
@@ -714,9 +714,9 @@ SelectForWindow(dev, pWin, client, mask, exclusivemasks, validmasks)
}
}
check
=
0
;
if
((
ret
=
AddExtensionClient
(
pWin
,
client
,
mask
,
mskidx
))
!=
Success
)
if
((
ret
=
AddExtensionClient
(
pWin
,
client
,
mask
,
mskidx
))
!=
Success
)
return
ret
;
maskSet
:
maskSet
:
if
(
dev
->
valuator
)
if
((
dev
->
valuator
->
motionHintWindow
==
pWin
)
&&
(
mask
&
DevicePointerMotionHintMask
)
&&
...
...
@@ -733,17 +733,17 @@ AddExtensionClient (pWin, client, mask, mskidx)
ClientPtr
client
;
Mask
mask
;
int
mskidx
;
{
{
InputClientsPtr
others
;
if
(
!
pWin
->
optional
&&
!
MakeWindowOptional
(
pWin
))
if
(
!
pWin
->
optional
&&
!
MakeWindowOptional
(
pWin
))
return
BadAlloc
;
others
=
(
InputClients
*
)
malloc
(
sizeof
(
InputClients
));
if
(
!
others
)
return
BadAlloc
;
if
(
!
pWin
->
optional
->
inputMasks
&&
!
MakeInputMasks
(
pWin
))
if
(
!
pWin
->
optional
->
inputMasks
&&
!
MakeInputMasks
(
pWin
))
return
BadAlloc
;
bzero
((
char
*
)
&
others
->
mask
[
0
],
sizeof
(
Mask
)
*
EMASKSIZE
);
bzero
((
char
*
)
&
others
->
mask
[
0
],
sizeof
(
Mask
)
*
EMASKSIZE
);
others
->
mask
[
mskidx
]
=
mask
;
others
->
resource
=
FakeClientID
(
client
->
index
);
others
->
next
=
pWin
->
optional
->
inputMasks
->
inputClients
;
...
...
@@ -751,27 +751,27 @@ AddExtensionClient (pWin, client, mask, mskidx)
if
(
!
AddResource
(
others
->
resource
,
RT_INPUTCLIENT
,
(
void
*
)
pWin
))
return
BadAlloc
;
return
Success
;
}
}
static
Bool
MakeInputMasks
(
pWin
)
WindowPtr
pWin
;
{
{
struct
_OtherInputMasks
*
imasks
;
imasks
=
(
struct
_OtherInputMasks
*
)
malloc
(
sizeof
(
struct
_OtherInputMasks
));
malloc
(
sizeof
(
struct
_OtherInputMasks
));
if
(
!
imasks
)
return
FALSE
;
bzero
((
char
*
)
imasks
,
sizeof
(
struct
_OtherInputMasks
));
bzero
((
char
*
)
imasks
,
sizeof
(
struct
_OtherInputMasks
));
pWin
->
optional
->
inputMasks
=
imasks
;
return
TRUE
;
}
}
void
RecalculateDeviceDeliverableEvents
(
pWin
)
WindowPtr
pWin
;
{
{
register
InputClientsPtr
others
;
struct
_OtherInputMasks
*
inputMasks
;
/* default: NULL */
register
WindowPtr
pChild
,
tmp
;
...
...
@@ -785,14 +785,14 @@ RecalculateDeviceDeliverableEvents(pWin)
for
(
others
=
inputMasks
->
inputClients
;
others
;
others
=
others
->
next
)
{
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
inputMasks
->
inputEvents
[
i
]
|=
others
->
mask
[
i
];
}
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
inputMasks
->
deliverableEvents
[
i
]
=
inputMasks
->
inputEvents
[
i
];
for
(
tmp
=
pChild
->
parent
;
tmp
;
tmp
=
tmp
->
parent
)
for
(
tmp
=
pChild
->
parent
;
tmp
;
tmp
=
tmp
->
parent
)
if
(
wOtherInputMasks
(
tmp
))
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
inputMasks
->
deliverableEvents
[
i
]
|=
(
wOtherInputMasks
(
tmp
)
->
deliverableEvents
[
i
]
&
~
inputMasks
->
dontPropagateMask
[
i
]
&
PropagateMask
[
i
]);
...
...
@@ -808,16 +808,16 @@ RecalculateDeviceDeliverableEvents(pWin)
break
;
pChild
=
pChild
->
nextSib
;
}
}
}
int
InputClientGone
(
pWin
,
id
)
register
WindowPtr
pWin
;
XID
id
;
{
{
register
InputClientsPtr
other
,
prev
;
if
(
!
wOtherInputMasks
(
pWin
))
return
(
Success
);
return
(
Success
);
prev
=
0
;
for
(
other
=
wOtherInputMasks
(
pWin
)
->
inputClients
;
other
;
other
=
other
->
next
)
...
...
@@ -836,14 +836,14 @@ InputClientGone(pWin, id)
wOtherInputMasks
(
pWin
)
->
inputClients
=
other
->
next
;
free
(
wOtherInputMasks
(
pWin
));
pWin
->
optional
->
inputMasks
=
(
OtherInputMasks
*
)
NULL
;
CheckWindowOptionalNeed
(
pWin
);
CheckWindowOptionalNeed
(
pWin
);
free
(
other
);
}
else
{
other
->
resource
=
FakeClientID
(
0
);
if
(
!
AddResource
(
other
->
resource
,
RT_INPUTCLIENT
,
(
void
*
)
pWin
))
(
void
*
)
pWin
))
return
BadAlloc
;
}
}
...
...
@@ -853,13 +853,13 @@ InputClientGone(pWin, id)
free
(
other
);
}
RecalculateDeviceDeliverableEvents
(
pWin
);
return
(
Success
);
return
(
Success
);
}
prev
=
other
;
}
FatalError
(
"client not on device event list"
);
/*NOTREACHED*/
}
}
int
SendEvent
(
client
,
d
,
dest
,
propagate
,
ev
,
mask
,
count
)
...
...
@@ -870,10 +870,10 @@ SendEvent (client, d, dest, propagate, ev, mask, count)
xEvent
*
ev
;
Mask
mask
;
int
count
;
{
{
WindowPtr
pWin
;
WindowPtr
effectiveFocus
=
NullWindow
;
/* only set if dest==InputFocus */
WindowPtr
spriteWin
=
GetSpriteWindow
();
WindowPtr
spriteWin
=
GetSpriteWindow
();
if
(
dest
==
PointerWindow
)
pWin
=
spriteWin
;
...
...
@@ -919,7 +919,7 @@ SendEvent (client, d, dest, propagate, ev, mask, count)
{
for
(;
pWin
;
pWin
=
pWin
->
parent
)
{
if
(
DeliverEventsToWindow
(
pWin
,
ev
,
count
,
mask
,
NullGrab
,
d
->
id
))
if
(
DeliverEventsToWindow
(
pWin
,
ev
,
count
,
mask
,
NullGrab
,
d
->
id
))
return
Success
;
if
(
pWin
==
effectiveFocus
)
return
Success
;
...
...
@@ -930,9 +930,9 @@ SendEvent (client, d, dest, propagate, ev, mask, count)
}
}
else
(
void
)(
DeliverEventsToWindow
(
pWin
,
ev
,
count
,
mask
,
NullGrab
,
d
->
id
));
(
void
)(
DeliverEventsToWindow
(
pWin
,
ev
,
count
,
mask
,
NullGrab
,
d
->
id
));
return
Success
;
}
}
int
SetButtonMapping
(
client
,
dev
,
nElts
,
map
)
...
...
@@ -940,7 +940,7 @@ SetButtonMapping (client, dev, nElts, map)
DeviceIntPtr
dev
;
int
nElts
;
BYTE
*
map
;
{
{
register
int
i
;
ButtonClassPtr
b
=
dev
->
button
;
...
...
@@ -954,14 +954,14 @@ SetButtonMapping (client, dev, nElts, map)
}
if
(
BadDeviceMap
(
&
map
[
0
],
nElts
,
1
,
255
,
&
client
->
errorValue
))
return
BadValue
;
for
(
i
=
0
;
i
<
nElts
;
i
++
)
for
(
i
=
0
;
i
<
nElts
;
i
++
)
if
((
b
->
map
[
i
+
1
]
!=
map
[
i
])
&&
BitIsOn
(
b
->
down
,
i
+
1
))
return
MappingBusy
;
for
(
i
=
0
;
i
<
nElts
;
i
++
)
b
->
map
[
i
+
1
]
=
map
[
i
];
return
Success
;
}
}
int
SetModifierMapping
(
client
,
dev
,
len
,
rlen
,
numKeyPerModifier
,
inputMap
,
k
)
...
...
@@ -980,10 +980,10 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k)
*
k
=
dev
->
key
;
if
(
*
k
==
NULL
)
return
BadMatch
;
if
(
len
!=
((
numKeyPerModifier
<<
1
)
+
rlen
))
if
(
len
!=
((
numKeyPerModifier
<<
1
)
+
rlen
))
return
BadLength
;
inputMapLen
=
8
*
numKeyPerModifier
;
inputMapLen
=
8
*
numKeyPerModifier
;
/*
* Now enforce the restriction that "all of the non-zero keycodes must be
...
...
@@ -1005,7 +1005,7 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k)
* modifier keys may be down while we change the mapping, and
* that the DDX layer likes the choice.
*/
if
(
!
AllModifierKeysAreUp
(
dev
,
(
*
k
)
->
modifierKeyMap
,
if
(
!
AllModifierKeysAreUp
(
dev
,
(
*
k
)
->
modifierKeyMap
,
(
int
)(
*
k
)
->
maxKeysPerModifier
,
inputMap
,
(
int
)
numKeyPerModifier
)
||
!
AllModifierKeysAreUp
(
dev
,
inputMap
,
(
int
)
numKeyPerModifier
,
...
...
@@ -1013,7 +1013,7 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k)
return
MappingBusy
;
}
else
{
for
(
i
=
0
;
i
<
inputMapLen
;
i
++
)
{
if
(
inputMap
[
i
]
&&
!
LegalModifier
(
inputMap
[
i
],
(
DevicePtr
)
dev
))
{
if
(
inputMap
[
i
]
&&
!
LegalModifier
(
inputMap
[
i
],
(
DevicePtr
)
dev
))
{
return
MappingFailed
;
}
}
...
...
@@ -1024,7 +1024,7 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k)
* list of keycodes.
*/
if
(
inputMapLen
)
{
map
=
(
KeyCode
*
)
malloc
(
inputMapLen
);
map
=
(
KeyCode
*
)
malloc
(
inputMapLen
);
if
(
!
map
)
return
BadAlloc
;
}
...
...
@@ -1041,11 +1041,11 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k)
(
*
k
)
->
modifierMap
[
i
]
=
0
;
for
(
i
=
0
;
i
<
inputMapLen
;
i
++
)
if
(
inputMap
[
i
])
{
(
*
k
)
->
modifierMap
[
inputMap
[
i
]]
|=
(
1
<<
(
i
/
(
*
k
)
->
maxKeysPerModifier
));
|=
(
1
<<
(
i
/
(
*
k
)
->
maxKeysPerModifier
));
}
return
(
MappingSuccess
);
}
return
(
MappingSuccess
);
}
void
SendDeviceMappingNotify
(
...
...
@@ -1055,7 +1055,7 @@ SendDeviceMappingNotify(
DeviceIntPtr
dev
)
{
xEvent
event
;
deviceMappingNotify
*
ev
=
(
deviceMappingNotify
*
)
&
event
;
deviceMappingNotify
*
ev
=
(
deviceMappingNotify
*
)
&
event
;
ev
->
type
=
DeviceMappingNotify
;
ev
->
request
=
request
;
...
...
@@ -1067,8 +1067,8 @@ SendDeviceMappingNotify(
ev
->
count
=
count
;
}
SendEventToAllWindows
(
dev
,
DeviceMappingNotifyMask
,
(
xEvent
*
)
ev
,
1
);
}
SendEventToAllWindows
(
dev
,
DeviceMappingNotifyMask
,
(
xEvent
*
)
ev
,
1
);
}
int
ChangeKeyMapping
(
...
...
@@ -1110,13 +1110,13 @@ ChangeKeyMapping(
SendDeviceMappingNotify
(
MappingKeyboard
,
firstKeyCode
,
keyCodes
,
dev
);
return
client
->
noClientException
;
}
}
void
DeleteWindowFromAnyExtEvents
(
pWin
,
freeResources
)
WindowPtr
pWin
;
Bool
freeResources
;
{
{
int
i
;
DeviceIntPtr
dev
;
InputClientsPtr
ic
;
...
...
@@ -1130,24 +1130,24 @@ DeleteWindowFromAnyExtEvents(pWin, freeResources)
DeleteDeviceFromAnyExtEvents
(
pWin
,
dev
);
}
for
(
dev
=
inputInfo
.
off_devices
;
dev
;
dev
=
dev
->
next
)
for
(
dev
=
inputInfo
.
off_devices
;
dev
;
dev
=
dev
->
next
)
DeleteDeviceFromAnyExtEvents
(
pWin
,
dev
);
if
(
freeResources
)
while
((
inputMasks
=
wOtherInputMasks
(
pWin
))
!=
0
)
{
ic
=
inputMasks
->
inputClients
;
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
inputMasks
->
dontPropagateMask
[
i
]
=
0
;
FreeResource
(
ic
->
resource
,
RT_NONE
);
}
}
}
void
DeleteDeviceFromAnyExtEvents
(
pWin
,
dev
)
WindowPtr
pWin
;
DeviceIntPtr
dev
;
{
{
WindowPtr
parent
;
/* Deactivate any grabs performed on this window, before making
...
...
@@ -1155,7 +1155,7 @@ DeleteDeviceFromAnyExtEvents(pWin, dev)
Deactivating a device grab should cause focus events. */
if
(
dev
->
grab
&&
(
dev
->
grab
->
window
==
pWin
))
(
*
dev
->
DeactivateGrab
)(
dev
);
(
*
dev
->
DeactivateGrab
)
(
dev
);
/* If the focus window is a root window (ie. has no parent)
then don't delete the focus from it. */
...
...
@@ -1210,16 +1210,16 @@ DeleteDeviceFromAnyExtEvents(pWin, dev)
if
(
dev
->
valuator
)
if
(
dev
->
valuator
->
motionHintWindow
==
pWin
)
dev
->
valuator
->
motionHintWindow
=
NullWindow
;
}
}
int
MaybeSendDeviceMotionNotifyHint
(
pEvents
,
mask
)
deviceKeyButtonPointer
*
pEvents
;
Mask
mask
;
{
{
DeviceIntPtr
dev
;
dev
=
LookupDeviceIntRec
(
pEvents
->
deviceid
&
DEVICE_BITS
);
dev
=
LookupDeviceIntRec
(
pEvents
->
deviceid
&
DEVICE_BITS
);
if
(
pEvents
->
type
==
DeviceMotionNotify
)
{
if
(
mask
&
DevicePointerMotionHintMask
)
...
...
@@ -1236,7 +1236,7 @@ MaybeSendDeviceMotionNotifyHint (pEvents, mask)
}
}
return
(
0
);
}
}
void
CheckDeviceGrabAndHintWindow
(
pWin
,
type
,
xE
,
grab
,
client
,
deliveryMask
)
...
...
@@ -1246,10 +1246,10 @@ CheckDeviceGrabAndHintWindow (pWin, type, xE, grab, client, deliveryMask)
GrabPtr
grab
;
ClientPtr
client
;
Mask
deliveryMask
;
{
{
DeviceIntPtr
dev
;
dev
=
LookupDeviceIntRec
(
xE
->
deviceid
&
DEVICE_BITS
);
dev
=
LookupDeviceIntRec
(
xE
->
deviceid
&
DEVICE_BITS
);
if
(
type
==
DeviceMotionNotify
)
dev
->
valuator
->
motionHintWindow
=
pWin
;
else
if
((
type
==
DeviceButtonPress
)
&&
(
!
grab
)
&&
...
...
@@ -1266,16 +1266,16 @@ CheckDeviceGrabAndHintWindow (pWin, type, xE, grab, client, deliveryMask)
tempGrab
.
pointerMode
=
GrabModeAsync
;
tempGrab
.
confineTo
=
NullWindow
;
tempGrab
.
cursor
=
NullCursor
;
(
*
dev
->
ActivateGrab
)(
dev
,
&
tempGrab
,
currentTime
,
TRUE
);
}
(
*
dev
->
ActivateGrab
)
(
dev
,
&
tempGrab
,
currentTime
,
TRUE
);
}
}
Mask
DeviceEventMaskForClient
(
dev
,
pWin
,
client
)
DeviceIntPtr
dev
;
WindowPtr
pWin
;
ClientPtr
client
;
{
{
register
InputClientsPtr
other
;
if
(
!
wOtherInputMasks
(
pWin
))
...
...
@@ -1287,7 +1287,7 @@ DeviceEventMaskForClient(dev, pWin, client)
return
other
->
mask
[
dev
->
id
];
}
return
0
;
}
}
void
MaybeStopDeviceHint
(
dev
,
client
)
...
...
@@ -1315,8 +1315,8 @@ DeviceEventSuppressForWindow(pWin, client, mask, maskndx)
ClientPtr
client
;
Mask
mask
;
int
maskndx
;
{
struct
_OtherInputMasks
*
inputMasks
=
wOtherInputMasks
(
pWin
);
{
struct
_OtherInputMasks
*
inputMasks
=
wOtherInputMasks
(
pWin
);
if
(
mask
&
~
PropagateMask
[
maskndx
])
{
...
...
@@ -1332,7 +1332,7 @@ DeviceEventSuppressForWindow(pWin, client, mask, maskndx)
else
{
if
(
!
inputMasks
)
AddExtensionClient
(
pWin
,
client
,
0
,
0
);
AddExtensionClient
(
pWin
,
client
,
0
,
0
);
inputMasks
=
wOtherInputMasks
(
pWin
);
inputMasks
->
dontPropagateMask
[
maskndx
]
=
mask
;
}
...
...
@@ -1340,24 +1340,24 @@ DeviceEventSuppressForWindow(pWin, client, mask, maskndx)
if
(
ShouldFreeInputMasks
(
pWin
,
FALSE
))
FreeResource
(
inputMasks
->
inputClients
->
resource
,
RT_NONE
);
return
Success
;
}
}
static
Bool
ShouldFreeInputMasks
(
pWin
,
ignoreSelectedEvents
)
WindowPtr
pWin
;
Bool
ignoreSelectedEvents
;
{
{
int
i
;
Mask
allInputEventMasks
=
0
;
struct
_OtherInputMasks
*
inputMasks
=
wOtherInputMasks
(
pWin
);
struct
_OtherInputMasks
*
inputMasks
=
wOtherInputMasks
(
pWin
);
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
allInputEventMasks
|=
inputMasks
->
dontPropagateMask
[
i
];
if
(
!
ignoreSelectedEvents
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
allInputEventMasks
|=
inputMasks
->
inputEvents
[
i
];
if
(
allInputEventMasks
==
0
)
return
TRUE
;
else
return
FALSE
;
}
}
nx-X11/programs/Xserver/Xi/exglobals.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/extinit.c
View file @
41a0ba72
...
...
@@ -117,7 +117,7 @@ Mask ExtValidMasks[EMASKSIZE];
Mask
ExtExclusiveMasks
[
EMASKSIZE
];
struct
dev_type
{
{
Atom
type
;
char
*
name
;
}
dev_type
[]
=
{{
0
,
XI_KEYBOARD
},
...
...
@@ -139,7 +139,7 @@ struct dev_type
{
0
,
XI_CURSORKEYS
},
{
0
,
XI_FOOTMOUSE
}};
CARD8
event_base
[
numInputClasses
];
CARD8
event_base
[
numInputClasses
];
XExtEventInfo
EventInfo
[
32
];
/*****************************************************************
...
...
@@ -203,7 +203,7 @@ static XExtensionVersion thisversion =
{
XI_Present
,
SERVER_XI_MAJOR_VERSION
,
SERVER_XI_MINOR_VERSION
,
};
};
/**********************************************************************
*
...
...
@@ -226,11 +226,11 @@ XInputExtensionInit()
if
(
extEntry
)
{
IReqCode
=
extEntry
->
base
;
AllExtensionVersions
[
IReqCode
-
128
]
=
thisversion
;
MakeDeviceTypeAtoms
();
RT_INPUTCLIENT
=
CreateNewResourceType
((
DeleteType
)
InputClientGone
);
FixExtensionEvents
(
extEntry
);
ReplySwapVector
[
IReqCode
]
=
(
ReplySwapPtr
)
SReplyIDispatch
;
AllExtensionVersions
[
IReqCode
-
128
]
=
thisversion
;
MakeDeviceTypeAtoms
();
RT_INPUTCLIENT
=
CreateNewResourceType
((
DeleteType
)
InputClientGone
);
FixExtensionEvents
(
extEntry
);
ReplySwapVector
[
IReqCode
]
=
(
ReplySwapPtr
)
SReplyIDispatch
;
EventSwapVector
[
DeviceValuator
]
=
SEventIDispatch
;
EventSwapVector
[
DeviceKeyPress
]
=
SEventIDispatch
;
EventSwapVector
[
DeviceKeyRelease
]
=
SEventIDispatch
;
...
...
@@ -251,7 +251,7 @@ XInputExtensionInit()
{
FatalError
(
"IExtensionInit: AddExtensions failed
\n
"
);
}
}
}
/*************************************************************************
*
...
...
@@ -266,81 +266,81 @@ ProcIDispatch (client)
{
REQUEST
(
xReq
);
if
(
stuff
->
data
==
X_GetExtensionVersion
)
return
(
ProcXGetExtensionVersion
(
client
));
return
(
ProcXGetExtensionVersion
(
client
));
if
(
stuff
->
data
==
X_ListInputDevices
)
return
(
ProcXListInputDevices
(
client
));
return
(
ProcXListInputDevices
(
client
));
else
if
(
stuff
->
data
==
X_OpenDevice
)
return
(
ProcXOpenDevice
(
client
));
return
(
ProcXOpenDevice
(
client
));
else
if
(
stuff
->
data
==
X_CloseDevice
)
return
(
ProcXCloseDevice
(
client
));
return
(
ProcXCloseDevice
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceMode
)
return
(
ProcXSetDeviceMode
(
client
));
return
(
ProcXSetDeviceMode
(
client
));
else
if
(
stuff
->
data
==
X_SelectExtensionEvent
)
return
(
ProcXSelectExtensionEvent
(
client
));
return
(
ProcXSelectExtensionEvent
(
client
));
else
if
(
stuff
->
data
==
X_GetSelectedExtensionEvents
)
return
(
ProcXGetSelectedExtensionEvents
(
client
));
return
(
ProcXGetSelectedExtensionEvents
(
client
));
else
if
(
stuff
->
data
==
X_ChangeDeviceDontPropagateList
)
return
(
ProcXChangeDeviceDontPropagateList
(
client
));
return
(
ProcXChangeDeviceDontPropagateList
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceDontPropagateList
)
return
(
ProcXGetDeviceDontPropagateList
(
client
));
return
(
ProcXGetDeviceDontPropagateList
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceMotionEvents
)
return
(
ProcXGetDeviceMotionEvents
(
client
));
return
(
ProcXGetDeviceMotionEvents
(
client
));
else
if
(
stuff
->
data
==
X_ChangeKeyboardDevice
)
return
(
ProcXChangeKeyboardDevice
(
client
));
return
(
ProcXChangeKeyboardDevice
(
client
));
else
if
(
stuff
->
data
==
X_ChangePointerDevice
)
return
(
ProcXChangePointerDevice
(
client
));
return
(
ProcXChangePointerDevice
(
client
));
else
if
(
stuff
->
data
==
X_GrabDevice
)
return
(
ProcXGrabDevice
(
client
));
return
(
ProcXGrabDevice
(
client
));
else
if
(
stuff
->
data
==
X_UngrabDevice
)
return
(
ProcXUngrabDevice
(
client
));
return
(
ProcXUngrabDevice
(
client
));
else
if
(
stuff
->
data
==
X_GrabDeviceKey
)
return
(
ProcXGrabDeviceKey
(
client
));
return
(
ProcXGrabDeviceKey
(
client
));
else
if
(
stuff
->
data
==
X_UngrabDeviceKey
)
return
(
ProcXUngrabDeviceKey
(
client
));
return
(
ProcXUngrabDeviceKey
(
client
));
else
if
(
stuff
->
data
==
X_GrabDeviceButton
)
return
(
ProcXGrabDeviceButton
(
client
));
return
(
ProcXGrabDeviceButton
(
client
));
else
if
(
stuff
->
data
==
X_UngrabDeviceButton
)
return
(
ProcXUngrabDeviceButton
(
client
));
return
(
ProcXUngrabDeviceButton
(
client
));
else
if
(
stuff
->
data
==
X_AllowDeviceEvents
)
return
(
ProcXAllowDeviceEvents
(
client
));
return
(
ProcXAllowDeviceEvents
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceFocus
)
return
(
ProcXGetDeviceFocus
(
client
));
return
(
ProcXGetDeviceFocus
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceFocus
)
return
(
ProcXSetDeviceFocus
(
client
));
return
(
ProcXSetDeviceFocus
(
client
));
else
if
(
stuff
->
data
==
X_GetFeedbackControl
)
return
(
ProcXGetFeedbackControl
(
client
));
return
(
ProcXGetFeedbackControl
(
client
));
else
if
(
stuff
->
data
==
X_ChangeFeedbackControl
)
return
(
ProcXChangeFeedbackControl
(
client
));
return
(
ProcXChangeFeedbackControl
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceKeyMapping
)
return
(
ProcXGetDeviceKeyMapping
(
client
));
return
(
ProcXGetDeviceKeyMapping
(
client
));
else
if
(
stuff
->
data
==
X_ChangeDeviceKeyMapping
)
return
(
ProcXChangeDeviceKeyMapping
(
client
));
return
(
ProcXChangeDeviceKeyMapping
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceModifierMapping
)
return
(
ProcXGetDeviceModifierMapping
(
client
));
return
(
ProcXGetDeviceModifierMapping
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceModifierMapping
)
return
(
ProcXSetDeviceModifierMapping
(
client
));
return
(
ProcXSetDeviceModifierMapping
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceButtonMapping
)
return
(
ProcXGetDeviceButtonMapping
(
client
));
return
(
ProcXGetDeviceButtonMapping
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceButtonMapping
)
return
(
ProcXSetDeviceButtonMapping
(
client
));
return
(
ProcXSetDeviceButtonMapping
(
client
));
else
if
(
stuff
->
data
==
X_QueryDeviceState
)
return
(
ProcXQueryDeviceState
(
client
));
return
(
ProcXQueryDeviceState
(
client
));
else
if
(
stuff
->
data
==
X_SendExtensionEvent
)
return
(
ProcXSendExtensionEvent
(
client
));
return
(
ProcXSendExtensionEvent
(
client
));
else
if
(
stuff
->
data
==
X_DeviceBell
)
return
(
ProcXDeviceBell
(
client
));
return
(
ProcXDeviceBell
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceValuators
)
return
(
ProcXSetDeviceValuators
(
client
));
return
(
ProcXSetDeviceValuators
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceControl
)
return
(
ProcXGetDeviceControl
(
client
));
return
(
ProcXGetDeviceControl
(
client
));
else
if
(
stuff
->
data
==
X_ChangeDeviceControl
)
return
(
ProcXChangeDeviceControl
(
client
));
return
(
ProcXChangeDeviceControl
(
client
));
else
{
SendErrorToClient
(
client
,
IReqCode
,
stuff
->
data
,
0
,
BadRequest
);
}
return
(
BadRequest
);
}
return
(
BadRequest
);
}
/*******************************************************************************
*
...
...
@@ -357,81 +357,81 @@ SProcIDispatch(client)
{
REQUEST
(
xReq
);
if
(
stuff
->
data
==
X_GetExtensionVersion
)
return
(
SProcXGetExtensionVersion
(
client
));
return
(
SProcXGetExtensionVersion
(
client
));
if
(
stuff
->
data
==
X_ListInputDevices
)
return
(
SProcXListInputDevices
(
client
));
return
(
SProcXListInputDevices
(
client
));
else
if
(
stuff
->
data
==
X_OpenDevice
)
return
(
SProcXOpenDevice
(
client
));
return
(
SProcXOpenDevice
(
client
));
else
if
(
stuff
->
data
==
X_CloseDevice
)
return
(
SProcXCloseDevice
(
client
));
return
(
SProcXCloseDevice
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceMode
)
return
(
SProcXSetDeviceMode
(
client
));
return
(
SProcXSetDeviceMode
(
client
));
else
if
(
stuff
->
data
==
X_SelectExtensionEvent
)
return
(
SProcXSelectExtensionEvent
(
client
));
return
(
SProcXSelectExtensionEvent
(
client
));
else
if
(
stuff
->
data
==
X_GetSelectedExtensionEvents
)
return
(
SProcXGetSelectedExtensionEvents
(
client
));
return
(
SProcXGetSelectedExtensionEvents
(
client
));
else
if
(
stuff
->
data
==
X_ChangeDeviceDontPropagateList
)
return
(
SProcXChangeDeviceDontPropagateList
(
client
));
return
(
SProcXChangeDeviceDontPropagateList
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceDontPropagateList
)
return
(
SProcXGetDeviceDontPropagateList
(
client
));
return
(
SProcXGetDeviceDontPropagateList
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceMotionEvents
)
return
(
SProcXGetDeviceMotionEvents
(
client
));
return
(
SProcXGetDeviceMotionEvents
(
client
));
else
if
(
stuff
->
data
==
X_ChangeKeyboardDevice
)
return
(
SProcXChangeKeyboardDevice
(
client
));
return
(
SProcXChangeKeyboardDevice
(
client
));
else
if
(
stuff
->
data
==
X_ChangePointerDevice
)
return
(
SProcXChangePointerDevice
(
client
));
return
(
SProcXChangePointerDevice
(
client
));
else
if
(
stuff
->
data
==
X_GrabDevice
)
return
(
SProcXGrabDevice
(
client
));
return
(
SProcXGrabDevice
(
client
));
else
if
(
stuff
->
data
==
X_UngrabDevice
)
return
(
SProcXUngrabDevice
(
client
));
return
(
SProcXUngrabDevice
(
client
));
else
if
(
stuff
->
data
==
X_GrabDeviceKey
)
return
(
SProcXGrabDeviceKey
(
client
));
return
(
SProcXGrabDeviceKey
(
client
));
else
if
(
stuff
->
data
==
X_UngrabDeviceKey
)
return
(
SProcXUngrabDeviceKey
(
client
));
return
(
SProcXUngrabDeviceKey
(
client
));
else
if
(
stuff
->
data
==
X_GrabDeviceButton
)
return
(
SProcXGrabDeviceButton
(
client
));
return
(
SProcXGrabDeviceButton
(
client
));
else
if
(
stuff
->
data
==
X_UngrabDeviceButton
)
return
(
SProcXUngrabDeviceButton
(
client
));
return
(
SProcXUngrabDeviceButton
(
client
));
else
if
(
stuff
->
data
==
X_AllowDeviceEvents
)
return
(
SProcXAllowDeviceEvents
(
client
));
return
(
SProcXAllowDeviceEvents
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceFocus
)
return
(
SProcXGetDeviceFocus
(
client
));
return
(
SProcXGetDeviceFocus
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceFocus
)
return
(
SProcXSetDeviceFocus
(
client
));
return
(
SProcXSetDeviceFocus
(
client
));
else
if
(
stuff
->
data
==
X_GetFeedbackControl
)
return
(
SProcXGetFeedbackControl
(
client
));
return
(
SProcXGetFeedbackControl
(
client
));
else
if
(
stuff
->
data
==
X_ChangeFeedbackControl
)
return
(
SProcXChangeFeedbackControl
(
client
));
return
(
SProcXChangeFeedbackControl
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceKeyMapping
)
return
(
SProcXGetDeviceKeyMapping
(
client
));
return
(
SProcXGetDeviceKeyMapping
(
client
));
else
if
(
stuff
->
data
==
X_ChangeDeviceKeyMapping
)
return
(
SProcXChangeDeviceKeyMapping
(
client
));
return
(
SProcXChangeDeviceKeyMapping
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceModifierMapping
)
return
(
SProcXGetDeviceModifierMapping
(
client
));
return
(
SProcXGetDeviceModifierMapping
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceModifierMapping
)
return
(
SProcXSetDeviceModifierMapping
(
client
));
return
(
SProcXSetDeviceModifierMapping
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceButtonMapping
)
return
(
SProcXGetDeviceButtonMapping
(
client
));
return
(
SProcXGetDeviceButtonMapping
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceButtonMapping
)
return
(
SProcXSetDeviceButtonMapping
(
client
));
return
(
SProcXSetDeviceButtonMapping
(
client
));
else
if
(
stuff
->
data
==
X_QueryDeviceState
)
return
(
SProcXQueryDeviceState
(
client
));
return
(
SProcXQueryDeviceState
(
client
));
else
if
(
stuff
->
data
==
X_SendExtensionEvent
)
return
(
SProcXSendExtensionEvent
(
client
));
return
(
SProcXSendExtensionEvent
(
client
));
else
if
(
stuff
->
data
==
X_DeviceBell
)
return
(
SProcXDeviceBell
(
client
));
return
(
SProcXDeviceBell
(
client
));
else
if
(
stuff
->
data
==
X_SetDeviceValuators
)
return
(
SProcXSetDeviceValuators
(
client
));
return
(
SProcXSetDeviceValuators
(
client
));
else
if
(
stuff
->
data
==
X_GetDeviceControl
)
return
(
SProcXGetDeviceControl
(
client
));
return
(
SProcXGetDeviceControl
(
client
));
else
if
(
stuff
->
data
==
X_ChangeDeviceControl
)
return
(
SProcXChangeDeviceControl
(
client
));
return
(
SProcXChangeDeviceControl
(
client
));
else
{
SendErrorToClient
(
client
,
IReqCode
,
stuff
->
data
,
0
,
BadRequest
);
}
return
(
BadRequest
);
}
return
(
BadRequest
);
}
/**********************************************************************
*
...
...
@@ -454,11 +454,11 @@ SReplyIDispatch (client, len, rep)
if
(
rep
->
RepType
==
X_GetExtensionVersion
)
SRepXGetExtensionVersion
(
client
,
len
,
(
xGetExtensionVersionReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_ListInputDevices
)
SRepXListInputDevices
(
client
,
len
,
(
xListInputDevicesReply
*
)
rep
);
SRepXListInputDevices
(
client
,
len
,
(
xListInputDevicesReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_OpenDevice
)
SRepXOpenDevice
(
client
,
len
,
(
xOpenDeviceReply
*
)
rep
);
SRepXOpenDevice
(
client
,
len
,
(
xOpenDeviceReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_SetDeviceMode
)
SRepXSetDeviceMode
(
client
,
len
,
(
xSetDeviceModeReply
*
)
rep
);
SRepXSetDeviceMode
(
client
,
len
,
(
xSetDeviceModeReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_GetSelectedExtensionEvents
)
SRepXGetSelectedExtensionEvents
(
client
,
len
,
(
xGetSelectedExtensionEventsReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_GetDeviceDontPropagateList
)
...
...
@@ -470,11 +470,11 @@ SReplyIDispatch (client, len, rep)
else
if
(
rep
->
RepType
==
X_ChangePointerDevice
)
SRepXChangePointerDevice
(
client
,
len
,
(
xChangePointerDeviceReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_GrabDevice
)
SRepXGrabDevice
(
client
,
len
,
(
xGrabDeviceReply
*
)
rep
);
SRepXGrabDevice
(
client
,
len
,
(
xGrabDeviceReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_GetDeviceFocus
)
SRepXGetDeviceFocus
(
client
,
len
,
(
xGetDeviceFocusReply
*
)
rep
);
SRepXGetDeviceFocus
(
client
,
len
,
(
xGetDeviceFocusReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_GetFeedbackControl
)
SRepXGetFeedbackControl
(
client
,
len
,
(
xGetFeedbackControlReply
*
)
rep
);
SRepXGetFeedbackControl
(
client
,
len
,
(
xGetFeedbackControlReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_GetDeviceKeyMapping
)
SRepXGetDeviceKeyMapping
(
client
,
len
,
(
xGetDeviceKeyMappingReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_GetDeviceModifierMapping
)
...
...
@@ -486,18 +486,18 @@ SReplyIDispatch (client, len, rep)
else
if
(
rep
->
RepType
==
X_SetDeviceButtonMapping
)
SRepXSetDeviceButtonMapping
(
client
,
len
,
(
xSetDeviceButtonMappingReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_QueryDeviceState
)
SRepXQueryDeviceState
(
client
,
len
,
(
xQueryDeviceStateReply
*
)
rep
);
SRepXQueryDeviceState
(
client
,
len
,
(
xQueryDeviceStateReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_SetDeviceValuators
)
SRepXSetDeviceValuators
(
client
,
len
,
(
xSetDeviceValuatorsReply
*
)
rep
);
SRepXSetDeviceValuators
(
client
,
len
,
(
xSetDeviceValuatorsReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_GetDeviceControl
)
SRepXGetDeviceControl
(
client
,
len
,
(
xGetDeviceControlReply
*
)
rep
);
SRepXGetDeviceControl
(
client
,
len
,
(
xGetDeviceControlReply
*
)
rep
);
else
if
(
rep
->
RepType
==
X_ChangeDeviceControl
)
SRepXChangeDeviceControl
(
client
,
len
,
(
xChangeDeviceControlReply
*
)
rep
);
else
{
FatalError
(
"XINPUT confused sending swapped reply"
);
}
}
}
/*****************************************************************************
*
...
...
@@ -518,27 +518,27 @@ SEventIDispatch (from, to)
DO_SWAP
(
SEventDeviceValuator
,
deviceValuator
);
else
if
(
type
==
DeviceKeyPress
)
{
SKeyButtonPtrEvent
(
from
,
to
);
SKeyButtonPtrEvent
(
from
,
to
);
to
->
u
.
keyButtonPointer
.
pad1
=
from
->
u
.
keyButtonPointer
.
pad1
;
}
else
if
(
type
==
DeviceKeyRelease
)
{
SKeyButtonPtrEvent
(
from
,
to
);
SKeyButtonPtrEvent
(
from
,
to
);
to
->
u
.
keyButtonPointer
.
pad1
=
from
->
u
.
keyButtonPointer
.
pad1
;
}
else
if
(
type
==
DeviceButtonPress
)
{
SKeyButtonPtrEvent
(
from
,
to
);
SKeyButtonPtrEvent
(
from
,
to
);
to
->
u
.
keyButtonPointer
.
pad1
=
from
->
u
.
keyButtonPointer
.
pad1
;
}
else
if
(
type
==
DeviceButtonRelease
)
{
SKeyButtonPtrEvent
(
from
,
to
);
SKeyButtonPtrEvent
(
from
,
to
);
to
->
u
.
keyButtonPointer
.
pad1
=
from
->
u
.
keyButtonPointer
.
pad1
;
}
else
if
(
type
==
DeviceMotionNotify
)
{
SKeyButtonPtrEvent
(
from
,
to
);
SKeyButtonPtrEvent
(
from
,
to
);
to
->
u
.
keyButtonPointer
.
pad1
=
from
->
u
.
keyButtonPointer
.
pad1
;
}
else
if
(
type
==
DeviceFocusIn
)
...
...
@@ -547,12 +547,12 @@ SEventIDispatch (from, to)
DO_SWAP
(
SEventFocus
,
deviceFocus
);
else
if
(
type
==
ProximityIn
)
{
SKeyButtonPtrEvent
(
from
,
to
);
SKeyButtonPtrEvent
(
from
,
to
);
to
->
u
.
keyButtonPointer
.
pad1
=
from
->
u
.
keyButtonPointer
.
pad1
;
}
else
if
(
type
==
ProximityOut
)
{
SKeyButtonPtrEvent
(
from
,
to
);
SKeyButtonPtrEvent
(
from
,
to
);
to
->
u
.
keyButtonPointer
.
pad1
=
from
->
u
.
keyButtonPointer
.
pad1
;
}
else
if
(
type
==
DeviceStateNotify
)
...
...
@@ -569,7 +569,7 @@ SEventIDispatch (from, to)
{
FatalError
(
"XInputExtension: Impossible event!
\n
"
);
}
}
}
/************************************************************************
*
...
...
@@ -581,7 +581,7 @@ void
SEventDeviceValuator
(
from
,
to
)
deviceValuator
*
from
;
deviceValuator
*
to
;
{
{
register
int
i
;
INT32
*
ip
B32
;
...
...
@@ -591,9 +591,9 @@ SEventDeviceValuator (from, to)
ip
=
&
to
->
valuator0
;
for
(
i
=
0
;
i
<
6
;
i
++
)
{
swapl
((
ip
+
i
));
/* macro - braces are required */
}
swapl
((
ip
+
i
));
/* macro - braces are required */
}
}
void
SEventFocus
(
from
,
to
)
...
...
@@ -604,7 +604,7 @@ SEventFocus (from, to)
swaps
(
&
to
->
sequenceNumber
);
swapl
(
&
to
->
time
);
swapl
(
&
to
->
window
);
}
}
void
SDeviceStateNotifyEvent
(
from
,
to
)
...
...
@@ -620,9 +620,9 @@ SDeviceStateNotifyEvent (from, to)
ip
=
&
to
->
valuator0
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
swapl
((
ip
+
i
));
/* macro - braces are required */
}
swapl
((
ip
+
i
));
/* macro - braces are required */
}
}
void
SDeviceKeyStateNotifyEvent
(
from
,
to
)
...
...
@@ -631,7 +631,7 @@ SDeviceKeyStateNotifyEvent (from, to)
{
*
to
=
*
from
;
swaps
(
&
to
->
sequenceNumber
);
}
}
void
SDeviceButtonStateNotifyEvent
(
from
,
to
)
...
...
@@ -640,7 +640,7 @@ SDeviceButtonStateNotifyEvent (from, to)
{
*
to
=
*
from
;
swaps
(
&
to
->
sequenceNumber
);
}
}
void
SChangeDeviceNotifyEvent
(
from
,
to
)
...
...
@@ -650,7 +650,7 @@ SChangeDeviceNotifyEvent (from, to)
*
to
=
*
from
;
swaps
(
&
to
->
sequenceNumber
);
swapl
(
&
to
->
time
);
}
}
void
SDeviceMappingNotifyEvent
(
from
,
to
)
...
...
@@ -660,7 +660,7 @@ SDeviceMappingNotifyEvent (from, to)
*
to
=
*
from
;
swaps
(
&
to
->
sequenceNumber
);
swapl
(
&
to
->
time
);
}
}
/************************************************************************
*
...
...
@@ -703,66 +703,66 @@ FixExtensionEvents (extEntry)
DeviceBusy
+=
extEntry
->
errorBase
;
BadClass
+=
extEntry
->
errorBase
;
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceKeyPress
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceKeyPress
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceKeyRelease
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceKeyRelease
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceButtonPress
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceButtonPress
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceButtonRelease
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceButtonRelease
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
ProximityIn
);
SetMaskForExtEvent
(
mask
,
ProximityOut
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
ProximityIn
);
SetMaskForExtEvent
(
mask
,
ProximityOut
);
AllowPropagateSuppress
(
mask
);
mask
=
GetNextExtEventMask
();
mask
=
GetNextExtEventMask
();
DeviceStateNotifyMask
=
mask
;
SetMaskForExtEvent
(
mask
,
DeviceStateNotify
);
SetMaskForExtEvent
(
mask
,
DeviceStateNotify
);
mask
=
GetNextExtEventMask
();
mask
=
GetNextExtEventMask
();
DevicePointerMotionMask
=
mask
;
SetMaskForExtEvent
(
mask
,
DeviceMotionNotify
);
AllowPropagateSuppress
(
mask
);
SetMaskForExtEvent
(
mask
,
DeviceMotionNotify
);
AllowPropagateSuppress
(
mask
);
DevicePointerMotionHintMask
=
GetNextExtEventMask
();
SetEventInfo
(
DevicePointerMotionHintMask
,
_devicePointerMotionHint
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton1Motion
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton2Motion
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton3Motion
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton4Motion
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton5Motion
);
SetEventInfo
(
DevicePointerMotionHintMask
,
_devicePointerMotionHint
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton1Motion
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton2Motion
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton3Motion
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton4Motion
);
SetEventInfo
(
GetNextExtEventMask
(),
_deviceButton5Motion
);
DeviceButtonMotionMask
=
GetNextExtEventMask
();
SetEventInfo
(
DeviceButtonMotionMask
,
_deviceButtonMotion
);
SetEventInfo
(
DeviceButtonMotionMask
,
_deviceButtonMotion
);
DeviceFocusChangeMask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
DeviceFocusChangeMask
,
DeviceFocusIn
);
SetMaskForExtEvent
(
DeviceFocusChangeMask
,
DeviceFocusOut
);
DeviceFocusChangeMask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
DeviceFocusChangeMask
,
DeviceFocusIn
);
SetMaskForExtEvent
(
DeviceFocusChangeMask
,
DeviceFocusOut
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceMappingNotify
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
DeviceMappingNotify
);
DeviceMappingNotifyMask
=
mask
;
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
ChangeDeviceNotify
);
mask
=
GetNextExtEventMask
();
SetMaskForExtEvent
(
mask
,
ChangeDeviceNotify
);
ChangeDeviceNotifyMask
=
mask
;
DeviceButtonGrabMask
=
GetNextExtEventMask
();
SetEventInfo
(
DeviceButtonGrabMask
,
_deviceButtonGrab
);
SetExclusiveAccess
(
DeviceButtonGrabMask
);
SetEventInfo
(
DeviceButtonGrabMask
,
_deviceButtonGrab
);
SetExclusiveAccess
(
DeviceButtonGrabMask
);
DeviceOwnerGrabButtonMask
=
GetNextExtEventMask
();
SetEventInfo
(
DeviceOwnerGrabButtonMask
,
_deviceOwnerGrabButton
);
SetEventInfo
(
0
,
_noExtensionEvent
);
}
SetEventInfo
(
DeviceOwnerGrabButtonMask
,
_deviceOwnerGrabButton
);
SetEventInfo
(
0
,
_noExtensionEvent
);
}
/************************************************************************
*
...
...
@@ -781,7 +781,7 @@ RestoreExtensionEvents ()
for
(
i
=
0
;
i
<
ExtEventIndex
-
1
;
i
++
)
{
if
((
EventInfo
[
i
].
type
>=
LASTEvent
)
&&
(
EventInfo
[
i
].
type
<
128
))
SetMaskForEvent
(
0
,
EventInfo
[
i
].
type
);
SetMaskForEvent
(
0
,
EventInfo
[
i
].
type
);
EventInfo
[
i
].
mask
=
0
;
EventInfo
[
i
].
type
=
0
;
}
...
...
@@ -809,7 +809,7 @@ RestoreExtensionEvents ()
DeviceBusy
=
3
;
BadClass
=
4
;
}
}
/***********************************************************************
*
...
...
@@ -822,7 +822,7 @@ RestoreExtensionEvents ()
void
IResetProc
(
unused
)
ExtensionEntry
*
unused
;
{
{
ReplySwapVector
[
IReqCode
]
=
ReplyNotSwappd
;
EventSwapVector
[
DeviceValuator
]
=
NotImplemented
;
...
...
@@ -840,8 +840,8 @@ IResetProc(unused)
EventSwapVector
[
DeviceButtonStateNotify
]
=
NotImplemented
;
EventSwapVector
[
DeviceMappingNotify
]
=
NotImplemented
;
EventSwapVector
[
ChangeDeviceNotify
]
=
NotImplemented
;
RestoreExtensionEvents
();
}
RestoreExtensionEvents
();
}
/***********************************************************************
*
...
...
@@ -856,9 +856,9 @@ AssignTypeAndName (dev, type, name)
char
*
name
;
{
dev
->
type
=
type
;
dev
->
name
=
(
char
*
)
malloc
(
strlen
(
name
)
+
1
);
strcpy
(
dev
->
name
,
name
);
}
dev
->
name
=
(
char
*
)
malloc
(
strlen
(
name
)
+
1
);
strcpy
(
dev
->
name
,
name
);
}
/***********************************************************************
*
...
...
@@ -868,13 +868,13 @@ AssignTypeAndName (dev, type, name)
void
MakeDeviceTypeAtoms
()
{
{
int
i
;
for
(
i
=
0
;
i
<
NUMTYPES
;
i
++
)
for
(
i
=
0
;
i
<
NUMTYPES
;
i
++
)
dev_type
[
i
].
type
=
MakeAtom
(
dev_type
[
i
].
name
,
strlen
(
dev_type
[
i
].
name
),
1
);
}
MakeAtom
(
dev_type
[
i
].
name
,
strlen
(
dev_type
[
i
].
name
),
1
);
}
/**************************************************************************
*
...
...
@@ -899,7 +899,7 @@ LookupDeviceIntRec (
}
}
return
(
NULL
);
}
}
/**************************************************************************
*
...
...
@@ -912,12 +912,12 @@ LookupDeviceIntRec (
void
SetExclusiveAccess
(
mask
)
Mask
mask
;
{
{
int
i
;
for
(
i
=
0
;
i
<
MAX_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
MAX_DEVICES
;
i
++
)
ExtExclusiveMasks
[
i
]
|=
mask
;
}
}
/**************************************************************************
*
...
...
@@ -929,12 +929,12 @@ SetExclusiveAccess (mask)
void
AllowPropagateSuppress
(
mask
)
Mask
mask
;
{
{
int
i
;
for
(
i
=
0
;
i
<
MAX_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
MAX_DEVICES
;
i
++
)
PropagateMask
[
i
]
|=
mask
;
}
}
/**************************************************************************
*
...
...
@@ -944,7 +944,7 @@ AllowPropagateSuppress (mask)
Mask
GetNextExtEventMask
()
{
{
int
i
;
Mask
mask
=
lastExtEventMask
;
...
...
@@ -954,10 +954,10 @@ GetNextExtEventMask ()
}
lastExtEventMask
<<=
1
;
for
(
i
=
0
;
i
<
MAX_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
MAX_DEVICES
;
i
++
)
ExtValidMasks
[
i
]
|=
mask
;
return
mask
;
}
}
/**************************************************************************
*
...
...
@@ -969,15 +969,15 @@ void
SetMaskForExtEvent
(
mask
,
event
)
Mask
mask
;
int
event
;
{
{
EventInfo
[
ExtEventIndex
].
mask
=
mask
;
EventInfo
[
ExtEventIndex
++
].
type
=
event
;
if
((
event
<
LASTEvent
)
||
(
event
>=
128
))
FatalError
(
"MaskForExtensionEvent: bogus event number"
);
SetMaskForEvent
(
mask
,
event
);
}
SetMaskForEvent
(
mask
,
event
);
}
/**************************************************************************
*
...
...
@@ -996,7 +996,7 @@ void
SetEventInfo
(
mask
,
constant
)
Mask
mask
;
int
constant
;
{
{
EventInfo
[
ExtEventIndex
].
mask
=
mask
;
EventInfo
[
ExtEventIndex
++
].
type
=
constant
;
}
}
nx-X11/programs/Xserver/Xi/getbmap.c
View file @
41a0ba72
...
...
@@ -75,11 +75,11 @@ SOFTWARE.
int
SProcXGetDeviceButtonMapping
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetDeviceButtonMappingReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXGetDeviceButtonMapping
(
client
));
}
return
(
ProcXGetDeviceButtonMapping
(
client
));
}
/***********************************************************************
*
...
...
@@ -90,7 +90,7 @@ SProcXGetDeviceButtonMapping(client)
int
ProcXGetDeviceButtonMapping
(
client
)
register
ClientPtr
client
;
{
{
DeviceIntPtr
dev
;
xGetDeviceButtonMappingReply
rep
;
ButtonClassPtr
b
;
...
...
@@ -104,7 +104,7 @@ ProcXGetDeviceButtonMapping (client)
rep
.
length
=
0
;
rep
.
sequenceNumber
=
client
->
sequence
;
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceButtonMapping
,
0
,
...
...
@@ -120,12 +120,12 @@ ProcXGetDeviceButtonMapping (client)
return
Success
;
}
rep
.
nElts
=
b
->
numButtons
;
rep
.
length
=
(
rep
.
nElts
+
(
4
-
1
))
/
4
;
WriteReplyToClient
(
client
,
sizeof
(
xGetDeviceButtonMappingReply
),
&
rep
);
rep
.
length
=
(
rep
.
nElts
+
(
4
-
1
))
/
4
;
WriteReplyToClient
(
client
,
sizeof
(
xGetDeviceButtonMappingReply
),
&
rep
);
WriteToClient
(
client
,
rep
.
nElts
,
(
char
*
)
&
b
->
map
[
1
]);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -139,8 +139,8 @@ SRepXGetDeviceButtonMapping (client, size, rep)
ClientPtr
client
;
int
size
;
xGetDeviceButtonMappingReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getbmap.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXGetDeviceButtonMapping (
void
SRepXGetDeviceButtonMapping
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetDeviceButtonMappingReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/getdctl.c
View file @
41a0ba72
...
...
@@ -76,13 +76,13 @@ SOFTWARE.
int
SProcXGetDeviceControl
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetDeviceControlReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xGetDeviceControlReq
);
swaps
(
&
stuff
->
control
);
return
(
ProcXGetDeviceControl
(
client
));
}
return
(
ProcXGetDeviceControl
(
client
));
}
/***********************************************************************
*
...
...
@@ -93,7 +93,7 @@ SProcXGetDeviceControl(client)
int
ProcXGetDeviceControl
(
client
)
ClientPtr
client
;
{
{
int
total_length
=
0
;
char
*
buf
,
*
savbuf
;
register
DeviceIntPtr
dev
;
...
...
@@ -102,7 +102,7 @@ ProcXGetDeviceControl(client)
REQUEST
(
xGetDeviceControlReq
);
REQUEST_SIZE_MATCH
(
xGetDeviceControlReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceControl
,
0
,
...
...
@@ -120,11 +120,11 @@ ProcXGetDeviceControl(client)
case
DEVICE_RESOLUTION
:
if
(
!
dev
->
valuator
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceControl
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceControl
,
0
,
BadMatch
);
return
Success
;
}
total_length
=
sizeof
(
xDeviceResolutionState
)
+
total_length
=
sizeof
(
xDeviceResolutionState
)
+
(
3
*
sizeof
(
int
)
*
dev
->
valuator
->
numAxes
);
break
;
default
:
...
...
@@ -133,14 +133,14 @@ ProcXGetDeviceControl(client)
return
Success
;
}
buf
=
(
char
*
)
malloc
(
total_length
);
buf
=
(
char
*
)
malloc
(
total_length
);
if
(
!
buf
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceControl
,
0
,
BadAlloc
);
return
Success
;
}
savbuf
=
buf
;
savbuf
=
buf
;
switch
(
stuff
->
control
)
{
...
...
@@ -152,12 +152,12 @@ ProcXGetDeviceControl(client)
break
;
}
rep
.
length
=
(
total_length
+
3
)
>>
2
;
rep
.
length
=
(
total_length
+
3
)
>>
2
;
WriteReplyToClient
(
client
,
sizeof
(
xGetDeviceControlReply
),
&
rep
);
WriteToClient
(
client
,
total_length
,
savbuf
);
free
(
savbuf
);
free
(
savbuf
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -171,7 +171,7 @@ CopySwapDeviceResolution (client, v, buf, length)
ValuatorClassPtr
v
;
char
*
buf
;
int
length
;
{
{
AxisInfoPtr
a
;
xDeviceResolutionState
*
r
;
int
i
,
*
iptr
;
...
...
@@ -180,26 +180,26 @@ CopySwapDeviceResolution (client, v, buf, length)
r
->
control
=
DEVICE_RESOLUTION
;
r
->
length
=
length
;
r
->
num_valuators
=
v
->
numAxes
;
buf
+=
sizeof
(
xDeviceResolutionState
);
iptr
=
(
int
*
)
buf
;
for
(
i
=
0
,
a
=
v
->
axes
;
i
<
v
->
numAxes
;
i
++
,
a
++
)
buf
+=
sizeof
(
xDeviceResolutionState
);
iptr
=
(
int
*
)
buf
;
for
(
i
=
0
,
a
=
v
->
axes
;
i
<
v
->
numAxes
;
i
++
,
a
++
)
*
iptr
++
=
a
->
resolution
;
for
(
i
=
0
,
a
=
v
->
axes
;
i
<
v
->
numAxes
;
i
++
,
a
++
)
for
(
i
=
0
,
a
=
v
->
axes
;
i
<
v
->
numAxes
;
i
++
,
a
++
)
*
iptr
++
=
a
->
min_resolution
;
for
(
i
=
0
,
a
=
v
->
axes
;
i
<
v
->
numAxes
;
i
++
,
a
++
)
for
(
i
=
0
,
a
=
v
->
axes
;
i
<
v
->
numAxes
;
i
++
,
a
++
)
*
iptr
++
=
a
->
max_resolution
;
if
(
client
->
swapped
)
{
swaps
(
&
r
->
control
);
swaps
(
&
r
->
length
);
swapl
(
&
r
->
num_valuators
);
iptr
=
(
int
*
)
buf
;
swaps
(
&
r
->
control
);
swaps
(
&
r
->
length
);
swapl
(
&
r
->
num_valuators
);
iptr
=
(
int
*
)
buf
;
for
(
i
=
0
;
i
<
(
3
*
v
->
numAxes
);
i
++
,
iptr
++
)
{
swapl
(
iptr
);
}
swapl
(
iptr
);
}
}
}
/***********************************************************************
*
...
...
@@ -213,9 +213,9 @@ SRepXGetDeviceControl (client, size, rep)
ClientPtr
client
;
int
size
;
xGetDeviceControlReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getdctl.h
View file @
41a0ba72
...
...
@@ -43,15 +43,15 @@ ProcXGetDeviceControl (
void
CopySwapDeviceResolution
(
ClientPtr
/* client */
,
ValuatorClassPtr
/* v */
,
char
*
/* buf */
,
ValuatorClassPtr
/* v */
,
char
*
/* buf */
,
int
/* length */
);
void
SRepXGetDeviceControl
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetDeviceControlReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/getfctl.c
View file @
41a0ba72
...
...
@@ -76,11 +76,11 @@ SOFTWARE.
int
SProcXGetFeedbackControl
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetFeedbackControlReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXGetFeedbackControl
(
client
));
}
return
(
ProcXGetFeedbackControl
(
client
));
}
/***********************************************************************
*
...
...
@@ -91,7 +91,7 @@ SProcXGetFeedbackControl(client)
int
ProcXGetFeedbackControl
(
client
)
ClientPtr
client
;
{
{
int
total_length
=
0
;
char
*
buf
,
*
savbuf
;
register
DeviceIntPtr
dev
;
...
...
@@ -106,7 +106,7 @@ ProcXGetFeedbackControl(client)
REQUEST
(
xGetFeedbackControlReq
);
REQUEST_SIZE_MATCH
(
xGetFeedbackControlReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetFeedbackControl
,
0
,
...
...
@@ -134,7 +134,7 @@ ProcXGetFeedbackControl(client)
{
rep
.
num_feedbacks
++
;
total_length
+=
sizeof
(
xStringFeedbackState
)
+
(
s
->
ctrl
.
num_symbols_supported
*
sizeof
(
KeySym
));
(
s
->
ctrl
.
num_symbols_supported
*
sizeof
(
KeySym
));
}
for
(
i
=
dev
->
intfeed
;
i
;
i
=
i
->
next
)
{
...
...
@@ -159,34 +159,34 @@ ProcXGetFeedbackControl(client)
return
Success
;
}
buf
=
(
char
*
)
malloc
(
total_length
);
buf
=
(
char
*
)
malloc
(
total_length
);
if
(
!
buf
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetFeedbackControl
,
0
,
BadAlloc
);
return
Success
;
}
savbuf
=
buf
;
for
(
k
=
dev
->
kbdfeed
;
k
;
k
=
k
->
next
)
CopySwapKbdFeedback
(
client
,
k
,
&
buf
);
for
(
p
=
dev
->
ptrfeed
;
p
;
p
=
p
->
next
)
CopySwapPtrFeedback
(
client
,
p
,
&
buf
);
for
(
s
=
dev
->
stringfeed
;
s
;
s
=
s
->
next
)
CopySwapStringFeedback
(
client
,
s
,
&
buf
);
for
(
i
=
dev
->
intfeed
;
i
;
i
=
i
->
next
)
CopySwapIntegerFeedback
(
client
,
i
,
&
buf
);
for
(
l
=
dev
->
leds
;
l
;
l
=
l
->
next
)
CopySwapLedFeedback
(
client
,
l
,
&
buf
);
for
(
b
=
dev
->
bell
;
b
;
b
=
b
->
next
)
CopySwapBellFeedback
(
client
,
b
,
&
buf
);
rep
.
length
=
(
total_length
+
3
)
>>
2
;
savbuf
=
buf
;
for
(
k
=
dev
->
kbdfeed
;
k
;
k
=
k
->
next
)
CopySwapKbdFeedback
(
client
,
k
,
&
buf
);
for
(
p
=
dev
->
ptrfeed
;
p
;
p
=
p
->
next
)
CopySwapPtrFeedback
(
client
,
p
,
&
buf
);
for
(
s
=
dev
->
stringfeed
;
s
;
s
=
s
->
next
)
CopySwapStringFeedback
(
client
,
s
,
&
buf
);
for
(
i
=
dev
->
intfeed
;
i
;
i
=
i
->
next
)
CopySwapIntegerFeedback
(
client
,
i
,
&
buf
);
for
(
l
=
dev
->
leds
;
l
;
l
=
l
->
next
)
CopySwapLedFeedback
(
client
,
l
,
&
buf
);
for
(
b
=
dev
->
bell
;
b
;
b
=
b
->
next
)
CopySwapBellFeedback
(
client
,
b
,
&
buf
);
rep
.
length
=
(
total_length
+
3
)
>>
2
;
WriteReplyToClient
(
client
,
sizeof
(
xGetFeedbackControlReply
),
&
rep
);
WriteToClient
(
client
,
total_length
,
savbuf
);
free
(
savbuf
);
free
(
savbuf
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -199,13 +199,13 @@ CopySwapKbdFeedback (client, k, buf)
ClientPtr
client
;
KbdFeedbackPtr
k
;
char
**
buf
;
{
{
int
i
;
xKbdFeedbackState
*
k2
;
k2
=
(
xKbdFeedbackState
*
)
*
buf
;
k2
=
(
xKbdFeedbackState
*
)
*
buf
;
k2
->
class
=
KbdFeedbackClass
;
k2
->
length
=
sizeof
(
xKbdFeedbackState
);
k2
->
length
=
sizeof
(
xKbdFeedbackState
);
k2
->
id
=
k
->
ctrl
.
id
;
k2
->
click
=
k
->
ctrl
.
click
;
k2
->
percent
=
k
->
ctrl
.
bell
;
...
...
@@ -213,7 +213,7 @@ CopySwapKbdFeedback (client, k, buf)
k2
->
duration
=
k
->
ctrl
.
bell_duration
;
k2
->
led_mask
=
k
->
ctrl
.
leds
;
k2
->
global_auto_repeat
=
k
->
ctrl
.
autoRepeat
;
for
(
i
=
0
;
i
<
32
;
i
++
)
for
(
i
=
0
;
i
<
32
;
i
++
)
k2
->
auto_repeats
[
i
]
=
k
->
ctrl
.
autoRepeats
[
i
];
if
(
client
->
swapped
)
{
...
...
@@ -223,8 +223,8 @@ CopySwapKbdFeedback (client, k, buf)
swapl
(
&
k2
->
led_mask
);
swapl
(
&
k2
->
led_values
);
}
*
buf
+=
sizeof
(
xKbdFeedbackState
);
}
*
buf
+=
sizeof
(
xKbdFeedbackState
);
}
/***********************************************************************
*
...
...
@@ -237,12 +237,12 @@ CopySwapPtrFeedback (client, p, buf)
ClientPtr
client
;
PtrFeedbackPtr
p
;
char
**
buf
;
{
{
xPtrFeedbackState
*
p2
;
p2
=
(
xPtrFeedbackState
*
)
*
buf
;
p2
=
(
xPtrFeedbackState
*
)
*
buf
;
p2
->
class
=
PtrFeedbackClass
;
p2
->
length
=
sizeof
(
xPtrFeedbackState
);
p2
->
length
=
sizeof
(
xPtrFeedbackState
);
p2
->
id
=
p
->
ctrl
.
id
;
p2
->
accelNum
=
p
->
ctrl
.
num
;
p2
->
accelDenom
=
p
->
ctrl
.
den
;
...
...
@@ -254,8 +254,8 @@ CopySwapPtrFeedback (client, p, buf)
swaps
(
&
p2
->
accelDenom
);
swaps
(
&
p2
->
threshold
);
}
*
buf
+=
sizeof
(
xPtrFeedbackState
);
}
*
buf
+=
sizeof
(
xPtrFeedbackState
);
}
/***********************************************************************
*
...
...
@@ -268,12 +268,12 @@ CopySwapIntegerFeedback (client, i, buf)
ClientPtr
client
;
IntegerFeedbackPtr
i
;
char
**
buf
;
{
{
xIntegerFeedbackState
*
i2
;
i2
=
(
xIntegerFeedbackState
*
)
*
buf
;
i2
=
(
xIntegerFeedbackState
*
)
*
buf
;
i2
->
class
=
IntegerFeedbackClass
;
i2
->
length
=
sizeof
(
xIntegerFeedbackState
);
i2
->
length
=
sizeof
(
xIntegerFeedbackState
);
i2
->
id
=
i
->
ctrl
.
id
;
i2
->
resolution
=
i
->
ctrl
.
resolution
;
i2
->
min_value
=
i
->
ctrl
.
min_value
;
...
...
@@ -285,8 +285,8 @@ CopySwapIntegerFeedback (client, i, buf)
swapl
(
&
i2
->
min_value
);
swapl
(
&
i2
->
max_value
);
}
*
buf
+=
sizeof
(
xIntegerFeedbackState
);
}
*
buf
+=
sizeof
(
xIntegerFeedbackState
);
}
/***********************************************************************
*
...
...
@@ -299,22 +299,22 @@ CopySwapStringFeedback (client, s, buf)
ClientPtr
client
;
StringFeedbackPtr
s
;
char
**
buf
;
{
{
int
i
;
xStringFeedbackState
*
s2
;
KeySym
*
kptr
;
s2
=
(
xStringFeedbackState
*
)
*
buf
;
s2
=
(
xStringFeedbackState
*
)
*
buf
;
s2
->
class
=
StringFeedbackClass
;
s2
->
length
=
sizeof
(
xStringFeedbackState
)
+
s
->
ctrl
.
num_symbols_supported
*
sizeof
(
KeySym
);
s2
->
length
=
sizeof
(
xStringFeedbackState
)
+
s
->
ctrl
.
num_symbols_supported
*
sizeof
(
KeySym
);
s2
->
id
=
s
->
ctrl
.
id
;
s2
->
max_symbols
=
s
->
ctrl
.
max_symbols
;
s2
->
num_syms_supported
=
s
->
ctrl
.
num_symbols_supported
;
*
buf
+=
sizeof
(
xStringFeedbackState
);
*
buf
+=
sizeof
(
xStringFeedbackState
);
kptr
=
(
KeySym
*
)
(
*
buf
);
for
(
i
=
0
;
i
<
s
->
ctrl
.
num_symbols_supported
;
i
++
)
*
kptr
++
=
*
(
s
->
ctrl
.
symbols_supported
+
i
);
for
(
i
=
0
;
i
<
s
->
ctrl
.
num_symbols_supported
;
i
++
)
*
kptr
++
=
*
(
s
->
ctrl
.
symbols_supported
+
i
);
if
(
client
->
swapped
)
{
swaps
(
&
s2
->
length
);
...
...
@@ -326,8 +326,8 @@ CopySwapStringFeedback (client, s, buf)
swapl
(
kptr
);
}
}
*
buf
+=
(
s
->
ctrl
.
num_symbols_supported
*
sizeof
(
KeySym
));
}
*
buf
+=
(
s
->
ctrl
.
num_symbols_supported
*
sizeof
(
KeySym
));
}
/***********************************************************************
*
...
...
@@ -340,12 +340,12 @@ CopySwapLedFeedback (client, l, buf)
ClientPtr
client
;
LedFeedbackPtr
l
;
char
**
buf
;
{
{
xLedFeedbackState
*
l2
;
l2
=
(
xLedFeedbackState
*
)
*
buf
;
l2
=
(
xLedFeedbackState
*
)
*
buf
;
l2
->
class
=
LedFeedbackClass
;
l2
->
length
=
sizeof
(
xLedFeedbackState
);
l2
->
length
=
sizeof
(
xLedFeedbackState
);
l2
->
id
=
l
->
ctrl
.
id
;
l2
->
led_values
=
l
->
ctrl
.
led_values
;
l2
->
led_mask
=
l
->
ctrl
.
led_mask
;
...
...
@@ -355,8 +355,8 @@ CopySwapLedFeedback (client, l, buf)
swapl
(
&
l2
->
led_values
);
swapl
(
&
l2
->
led_mask
);
}
*
buf
+=
sizeof
(
xLedFeedbackState
);
}
*
buf
+=
sizeof
(
xLedFeedbackState
);
}
/***********************************************************************
*
...
...
@@ -369,12 +369,12 @@ CopySwapBellFeedback (client, b, buf)
ClientPtr
client
;
BellFeedbackPtr
b
;
char
**
buf
;
{
{
xBellFeedbackState
*
b2
;
b2
=
(
xBellFeedbackState
*
)
*
buf
;
b2
=
(
xBellFeedbackState
*
)
*
buf
;
b2
->
class
=
BellFeedbackClass
;
b2
->
length
=
sizeof
(
xBellFeedbackState
);
b2
->
length
=
sizeof
(
xBellFeedbackState
);
b2
->
id
=
b
->
ctrl
.
id
;
b2
->
percent
=
b
->
ctrl
.
percent
;
b2
->
pitch
=
b
->
ctrl
.
pitch
;
...
...
@@ -385,8 +385,8 @@ CopySwapBellFeedback (client, b, buf)
swaps
(
&
b2
->
pitch
);
swaps
(
&
b2
->
duration
);
}
*
buf
+=
sizeof
(
xBellFeedbackState
);
}
*
buf
+=
sizeof
(
xBellFeedbackState
);
}
/***********************************************************************
*
...
...
@@ -400,9 +400,9 @@ SRepXGetFeedbackControl (client, size, rep)
ClientPtr
client
;
int
size
;
xGetFeedbackControlReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
swaps
(
&
rep
->
num_feedbacks
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getfctl.h
View file @
41a0ba72
...
...
@@ -43,49 +43,49 @@ ProcXGetFeedbackControl(
void
CopySwapKbdFeedback
(
ClientPtr
/* client */
,
KbdFeedbackPtr
/* k */
,
KbdFeedbackPtr
/* k */
,
char
**
/* buf */
);
void
CopySwapPtrFeedback
(
ClientPtr
/* client */
,
PtrFeedbackPtr
/* p */
,
PtrFeedbackPtr
/* p */
,
char
**
/* buf */
);
void
CopySwapIntegerFeedback
(
ClientPtr
/* client */
,
IntegerFeedbackPtr
/* i */
,
IntegerFeedbackPtr
/* i */
,
char
**
/* buf */
);
void
CopySwapStringFeedback
(
ClientPtr
/* client */
,
StringFeedbackPtr
/* s */
,
StringFeedbackPtr
/* s */
,
char
**
/* buf */
);
void
CopySwapLedFeedback
(
ClientPtr
/* client */
,
LedFeedbackPtr
/* l */
,
LedFeedbackPtr
/* l */
,
char
**
/* buf */
);
void
CopySwapBellFeedback
(
ClientPtr
/* client */
,
BellFeedbackPtr
/* b */
,
BellFeedbackPtr
/* b */
,
char
**
/* buf */
);
void
SRepXGetFeedbackControl
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetFeedbackControlReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/getfocus.c
View file @
41a0ba72
...
...
@@ -76,11 +76,11 @@ SOFTWARE.
int
SProcXGetDeviceFocus
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetDeviceFocusReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXGetDeviceFocus
(
client
));
}
return
(
ProcXGetDeviceFocus
(
client
));
}
/***********************************************************************
*
...
...
@@ -91,7 +91,7 @@ SProcXGetDeviceFocus(client)
int
ProcXGetDeviceFocus
(
client
)
ClientPtr
client
;
{
{
DeviceIntPtr
dev
;
FocusClassPtr
focus
;
xGetDeviceFocusReply
rep
;
...
...
@@ -99,7 +99,7 @@ ProcXGetDeviceFocus(client)
REQUEST
(
xGetDeviceFocusReq
);
REQUEST_SIZE_MATCH
(
xGetDeviceFocusReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
||
!
dev
->
focus
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceFocus
,
0
,
BadDevice
);
...
...
@@ -124,9 +124,9 @@ ProcXGetDeviceFocus(client)
rep
.
time
=
focus
->
time
.
milliseconds
;
rep
.
revertTo
=
focus
->
revert
;
WriteReplyToClient
(
client
,
sizeof
(
xGetDeviceFocusReply
),
&
rep
);
WriteReplyToClient
(
client
,
sizeof
(
xGetDeviceFocusReply
),
&
rep
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -140,10 +140,10 @@ SRepXGetDeviceFocus (client, size, rep)
ClientPtr
client
;
int
size
;
xGetDeviceFocusReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
focus
);
swapl
(
&
rep
->
time
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getfocus.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXGetDeviceFocus(
void
SRepXGetDeviceFocus
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetDeviceFocusReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/getkmap.c
View file @
41a0ba72
...
...
@@ -77,11 +77,11 @@ SOFTWARE.
int
SProcXGetDeviceKeyMapping
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetDeviceKeyMappingReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXGetDeviceKeyMapping
(
client
));
}
return
(
ProcXGetDeviceKeyMapping
(
client
));
}
/***********************************************************************
*
...
...
@@ -92,7 +92,7 @@ SProcXGetDeviceKeyMapping(client)
int
ProcXGetDeviceKeyMapping
(
client
)
register
ClientPtr
client
;
{
{
xGetDeviceKeyMappingReply
rep
;
DeviceIntPtr
dev
;
KeySymsPtr
k
;
...
...
@@ -100,10 +100,10 @@ ProcXGetDeviceKeyMapping(client)
REQUEST
(
xGetDeviceKeyMappingReq
);
REQUEST_SIZE_MATCH
(
xGetDeviceKeyMappingReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceKeyMapping
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceKeyMapping
,
0
,
BadDevice
);
return
Success
;
}
...
...
@@ -140,7 +140,7 @@ ProcXGetDeviceKeyMapping(client)
rep
.
length
=
(
k
->
mapWidth
*
stuff
->
count
);
/* KeySyms are 4 bytes */
WriteReplyToClient
(
client
,
sizeof
(
xGetDeviceKeyMappingReply
),
&
rep
);
client
->
pSwapReplyFunc
=
(
ReplySwapPtr
)
CopySwap32Write
;
client
->
pSwapReplyFunc
=
(
ReplySwapPtr
)
CopySwap32Write
;
WriteSwappedDataToClient
(
client
,
k
->
mapWidth
*
stuff
->
count
*
sizeof
(
KeySym
),
...
...
@@ -148,7 +148,7 @@ ProcXGetDeviceKeyMapping(client)
k
->
mapWidth
]);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -162,9 +162,9 @@ SRepXGetDeviceKeyMapping (client, size, rep)
ClientPtr
client
;
int
size
;
xGetDeviceKeyMappingReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getkmap.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXGetDeviceKeyMapping(
void
SRepXGetDeviceKeyMapping
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetDeviceKeyMappingReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/getmmap.c
View file @
41a0ba72
...
...
@@ -76,11 +76,11 @@ SOFTWARE.
int
SProcXGetDeviceModifierMapping
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetDeviceModifierMappingReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXGetDeviceModifierMapping
(
client
));
}
return
(
ProcXGetDeviceModifierMapping
(
client
));
}
/***********************************************************************
*
...
...
@@ -91,7 +91,7 @@ SProcXGetDeviceModifierMapping(client)
int
ProcXGetDeviceModifierMapping
(
client
)
ClientPtr
client
;
{
{
CARD8
maxkeys
;
DeviceIntPtr
dev
;
xGetDeviceModifierMappingReply
rep
;
...
...
@@ -100,10 +100,10 @@ ProcXGetDeviceModifierMapping(client)
REQUEST
(
xGetDeviceModifierMappingReq
);
REQUEST_SIZE_MATCH
(
xGetDeviceModifierMappingReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceModifierMapping
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceModifierMapping
,
0
,
BadDevice
);
return
Success
;
}
...
...
@@ -111,7 +111,7 @@ ProcXGetDeviceModifierMapping(client)
kp
=
dev
->
key
;
if
(
kp
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceModifierMapping
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceModifierMapping
,
0
,
BadMatch
);
return
Success
;
}
...
...
@@ -122,14 +122,14 @@ ProcXGetDeviceModifierMapping(client)
rep
.
numKeyPerModifier
=
maxkeys
;
rep
.
sequenceNumber
=
client
->
sequence
;
/* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
rep
.
length
=
2
*
maxkeys
;
rep
.
length
=
2
*
maxkeys
;
WriteReplyToClient
(
client
,
sizeof
(
xGetDeviceModifierMappingReply
),
&
rep
);
/* Reply with the (modified by DDX) map that SetModifierMapping passed in */
WriteToClient
(
client
,
8
*
maxkeys
,
kp
->
modifierKeyMap
);
WriteToClient
(
client
,
8
*
maxkeys
,
kp
->
modifierKeyMap
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -143,8 +143,8 @@ SRepXGetDeviceModifierMapping (client, size, rep)
ClientPtr
client
;
int
size
;
xGetDeviceModifierMappingReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getmmap.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXGetDeviceModifierMapping(
void
SRepXGetDeviceModifierMapping
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetDeviceModifierMappingReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/getprop.c
View file @
41a0ba72
...
...
@@ -80,13 +80,13 @@ extern int ExtEventIndex;
int
SProcXGetDeviceDontPropagateList
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetDeviceDontPropagateListReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xGetDeviceDontPropagateListReq
);
swapl
(
&
stuff
->
window
);
return
(
ProcXGetDeviceDontPropagateList
(
client
));
}
return
(
ProcXGetDeviceDontPropagateList
(
client
));
}
/***********************************************************************
*
...
...
@@ -97,7 +97,7 @@ SProcXGetDeviceDontPropagateList(client)
int
ProcXGetDeviceDontPropagateList
(
client
)
register
ClientPtr
client
;
{
{
CARD16
count
=
0
;
int
i
;
XEventClass
*
buf
=
NULL
,
*
tbuf
;
...
...
@@ -114,7 +114,7 @@ ProcXGetDeviceDontPropagateList (client)
rep
.
length
=
0
;
rep
.
count
=
0
;
pWin
=
(
WindowPtr
)
LookupWindow
(
stuff
->
window
,
client
);
pWin
=
(
WindowPtr
)
LookupWindow
(
stuff
->
window
,
client
);
if
(
!
pWin
)
{
client
->
errorValue
=
stuff
->
window
;
...
...
@@ -125,18 +125,18 @@ ProcXGetDeviceDontPropagateList (client)
if
((
others
=
wOtherInputMasks
(
pWin
))
!=
0
)
{
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tbuf
=
ClassFromMask
(
NULL
,
others
->
dontPropagateMask
[
i
],
i
,
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tbuf
=
ClassFromMask
(
NULL
,
others
->
dontPropagateMask
[
i
],
i
,
&
count
,
COUNT
);
if
(
count
)
{
rep
.
count
=
count
;
buf
=
(
XEventClass
*
)
malloc
(
rep
.
count
*
sizeof
(
XEventClass
));
rep
.
length
=
(
rep
.
count
*
sizeof
(
XEventClass
)
+
3
)
>>
2
;
buf
=
(
XEventClass
*
)
malloc
(
rep
.
count
*
sizeof
(
XEventClass
));
rep
.
length
=
(
rep
.
count
*
sizeof
(
XEventClass
)
+
3
)
>>
2
;
tbuf
=
buf
;
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tbuf
=
ClassFromMask
(
tbuf
,
others
->
dontPropagateMask
[
i
],
i
,
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tbuf
=
ClassFromMask
(
tbuf
,
others
->
dontPropagateMask
[
i
],
i
,
NULL
,
CREATE
);
}
}
...
...
@@ -146,12 +146,12 @@ ProcXGetDeviceDontPropagateList (client)
if
(
count
)
{
client
->
pSwapReplyFunc
=
(
ReplySwapPtr
)
Swap32Write
;
WriteSwappedDataToClient
(
client
,
count
*
sizeof
(
XEventClass
),
buf
);
free
(
buf
);
client
->
pSwapReplyFunc
=
(
ReplySwapPtr
)
Swap32Write
;
WriteSwappedDataToClient
(
client
,
count
*
sizeof
(
XEventClass
),
buf
);
free
(
buf
);
}
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -167,15 +167,15 @@ XEventClass
int
maskndx
;
CARD16
*
count
;
int
mode
;
{
int
i
,
j
;
{
int
i
,
j
;
int
id
=
maskndx
;
Mask
tmask
=
0x80000000
;
for
(
i
=
0
;
i
<
32
;
i
++
,
tmask
>>=
1
)
for
(
i
=
0
;
i
<
32
;
i
++
,
tmask
>>=
1
)
if
(
tmask
&
mask
)
{
for
(
j
=
0
;
j
<
ExtEventIndex
;
j
++
)
for
(
j
=
0
;
j
<
ExtEventIndex
;
j
++
)
if
(
EventInfo
[
j
].
mask
==
tmask
)
{
if
(
mode
==
COUNT
)
...
...
@@ -185,7 +185,7 @@ XEventClass
}
}
return
(
buf
);
}
}
/***********************************************************************
*
...
...
@@ -199,9 +199,9 @@ SRepXGetDeviceDontPropagateList (client, size, rep)
ClientPtr
client
;
int
size
;
xGetDeviceDontPropagateListReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
swaps
(
&
rep
->
count
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getprop.h
View file @
41a0ba72
...
...
@@ -43,16 +43,16 @@ ProcXGetDeviceDontPropagateList (
XEventClass
*
ClassFromMask
(
XEventClass
*
/* buf */
,
Mask
/* mask */
,
int
/* maskndx */
,
CARD16
*
/* count */
,
Mask
/* mask */
,
int
/* maskndx */
,
CARD16
*
/* count */
,
int
/* mode */
);
void
SRepXGetDeviceDontPropagateList
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetDeviceDontPropagateListReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/getselev.c
View file @
41a0ba72
...
...
@@ -78,13 +78,13 @@ SOFTWARE.
int
SProcXGetSelectedExtensionEvents
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetSelectedExtensionEventsReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xGetSelectedExtensionEventsReq
);
swapl
(
&
stuff
->
window
);
return
(
ProcXGetSelectedExtensionEvents
(
client
));
}
return
(
ProcXGetSelectedExtensionEvents
(
client
));
}
/***********************************************************************
*
...
...
@@ -96,7 +96,7 @@ SProcXGetSelectedExtensionEvents(client)
int
ProcXGetSelectedExtensionEvents
(
client
)
register
ClientPtr
client
;
{
{
int
i
;
int
total_length
=
0
;
xGetSelectedExtensionEventsReply
rep
;
...
...
@@ -126,46 +126,46 @@ ProcXGetSelectedExtensionEvents(client)
if
((
pOthers
=
wOtherInputMasks
(
pWin
))
!=
0
)
{
for
(
others
=
pOthers
->
inputClients
;
others
;
others
=
others
->
next
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tclient
=
ClassFromMask
(
NULL
,
others
->
mask
[
i
],
i
,
for
(
others
=
pOthers
->
inputClients
;
others
;
others
=
others
->
next
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tclient
=
ClassFromMask
(
NULL
,
others
->
mask
[
i
],
i
,
&
rep
.
all_clients_count
,
COUNT
);
for
(
others
=
pOthers
->
inputClients
;
others
;
others
=
others
->
next
)
for
(
others
=
pOthers
->
inputClients
;
others
;
others
=
others
->
next
)
if
(
SameClient
(
others
,
client
))
{
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tclient
=
ClassFromMask
(
NULL
,
others
->
mask
[
i
],
i
,
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tclient
=
ClassFromMask
(
NULL
,
others
->
mask
[
i
],
i
,
&
rep
.
this_client_count
,
COUNT
);
break
;
}
total_length
=
(
rep
.
all_clients_count
+
rep
.
this_client_count
)
*
sizeof
(
XEventClass
);
sizeof
(
XEventClass
);
rep
.
length
=
(
total_length
+
3
)
>>
2
;
buf
=
(
XEventClass
*
)
malloc
(
total_length
);
buf
=
(
XEventClass
*
)
malloc
(
total_length
);
tclient
=
buf
;
aclient
=
buf
+
rep
.
this_client_count
;
if
(
others
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
tclient
=
ClassFromMask
(
tclient
,
others
->
mask
[
i
],
i
,
NULL
,
CREATE
);
for
(
others
=
pOthers
->
inputClients
;
others
;
others
=
others
->
next
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
others
=
pOthers
->
inputClients
;
others
;
others
=
others
->
next
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
aclient
=
ClassFromMask
(
aclient
,
others
->
mask
[
i
],
i
,
NULL
,
CREATE
);
}
WriteReplyToClient
(
client
,
sizeof
(
xGetSelectedExtensionEventsReply
),
&
rep
);
WriteReplyToClient
(
client
,
sizeof
(
xGetSelectedExtensionEventsReply
),
&
rep
);
if
(
total_length
)
{
client
->
pSwapReplyFunc
=
(
ReplySwapPtr
)
Swap32Write
;
WriteSwappedDataToClient
(
client
,
total_length
,
buf
);
free
(
buf
);
WriteSwappedDataToClient
(
client
,
total_length
,
buf
);
free
(
buf
);
}
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -179,10 +179,10 @@ SRepXGetSelectedExtensionEvents (client, size, rep)
ClientPtr
client
;
int
size
;
xGetSelectedExtensionEventsReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
swaps
(
&
rep
->
this_client_count
);
swaps
(
&
rep
->
all_clients_count
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getselev.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXGetSelectedExtensionEvents(
void
SRepXGetSelectedExtensionEvents
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetSelectedExtensionEventsReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/getvers.c
View file @
41a0ba72
...
...
@@ -77,13 +77,13 @@ XExtensionVersion AllExtensionVersions[128];
int
SProcXGetExtensionVersion
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetExtensionVersionReq
);
swaps
(
&
stuff
->
length
);
REQUEST_AT_LEAST_SIZE
(
xGetExtensionVersionReq
);
swaps
(
&
stuff
->
nbytes
);
return
(
ProcXGetExtensionVersion
(
client
));
}
return
(
ProcXGetExtensionVersion
(
client
));
}
/***********************************************************************
*
...
...
@@ -94,7 +94,7 @@ SProcXGetExtensionVersion(client)
int
ProcXGetExtensionVersion
(
client
)
register
ClientPtr
client
;
{
{
xGetExtensionVersionReply
rep
;
REQUEST
(
xGetExtensionVersionReq
);
...
...
@@ -124,10 +124,10 @@ ProcXGetExtensionVersion (client)
rep
.
minor_version
=
AllExtensionVersions
[
IReqCode
-
128
].
minor_version
;
}
WriteReplyToClient
(
client
,
sizeof
(
xGetExtensionVersionReply
),
&
rep
);
WriteReplyToClient
(
client
,
sizeof
(
xGetExtensionVersionReply
),
&
rep
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -141,10 +141,10 @@ SRepXGetExtensionVersion (client, size, rep)
ClientPtr
client
;
int
size
;
xGetExtensionVersionReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
swaps
(
&
rep
->
major_version
);
swaps
(
&
rep
->
minor_version
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/getvers.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXGetExtensionVersion (
void
SRepXGetExtensionVersion
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetExtensionVersionReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/grabdev.c
View file @
41a0ba72
...
...
@@ -81,7 +81,7 @@ extern int ExtEventIndex;
int
SProcXGrabDevice
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGrabDeviceReq
);
swaps
(
&
stuff
->
length
);
REQUEST_AT_LEAST_SIZE
(
xGrabDeviceReq
);
...
...
@@ -94,8 +94,8 @@ SProcXGrabDevice(client)
SwapLongs
((
CARD32
*
)
(
&
stuff
[
1
]),
stuff
->
event_count
);
return
(
ProcXGrabDevice
(
client
));
}
return
(
ProcXGrabDevice
(
client
));
}
/***********************************************************************
*
...
...
@@ -106,7 +106,7 @@ SProcXGrabDevice(client)
int
ProcXGrabDevice
(
client
)
ClientPtr
client
;
{
{
int
error
;
xGrabDeviceReply
rep
;
DeviceIntPtr
dev
;
...
...
@@ -117,7 +117,7 @@ ProcXGrabDevice(client)
if
(
stuff
->
length
!=
(
sizeof
(
xGrabDeviceReq
)
>>
2
)
+
stuff
->
event_count
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDevice
,
0
,
BadLength
);
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDevice
,
0
,
BadLength
);
return
Success
;
}
...
...
@@ -126,18 +126,18 @@ ProcXGrabDevice(client)
rep
.
sequenceNumber
=
client
->
sequence
;
rep
.
length
=
0
;
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDevice
,
0
,
BadDevice
);
return
Success
;
}
if
(
CreateMaskFromList
(
client
,
(
XEventClass
*
)
&
stuff
[
1
],
if
(
CreateMaskFromList
(
client
,
(
XEventClass
*
)
&
stuff
[
1
],
stuff
->
event_count
,
tmp
,
dev
,
X_GrabDevice
)
!=
Success
)
return
Success
;
error
=
GrabDevice
(
client
,
dev
,
stuff
->
this_device_mode
,
error
=
GrabDevice
(
client
,
dev
,
stuff
->
this_device_mode
,
stuff
->
other_devices_mode
,
stuff
->
grabWindow
,
stuff
->
ownerEvents
,
stuff
->
time
,
tmp
[
stuff
->
deviceid
].
mask
,
&
rep
.
status
);
...
...
@@ -148,7 +148,7 @@ ProcXGrabDevice(client)
}
WriteReplyToClient
(
client
,
sizeof
(
xGrabDeviceReply
),
&
rep
);
return
Success
;
}
}
/***********************************************************************
...
...
@@ -165,8 +165,8 @@ CreateMaskFromList (client, list, count, mask, dev, req)
struct
tmask
mask
[];
DeviceIntPtr
dev
;
int
req
;
{
int
i
,
j
;
{
int
i
,
j
;
int
device
;
DeviceIntPtr
tdev
;
...
...
@@ -184,14 +184,14 @@ CreateMaskFromList (client, list, count, mask, dev, req)
SendErrorToClient
(
client
,
IReqCode
,
req
,
0
,
BadClass
);
return
BadClass
;
}
tdev
=
LookupDeviceIntRec
(
device
);
tdev
=
LookupDeviceIntRec
(
device
);
if
(
tdev
==
NULL
||
(
dev
!=
NULL
&&
tdev
!=
dev
))
{
SendErrorToClient
(
client
,
IReqCode
,
req
,
0
,
BadClass
);
return
BadClass
;
}
for
(
j
=
0
;
j
<
ExtEventIndex
;
j
++
)
for
(
j
=
0
;
j
<
ExtEventIndex
;
j
++
)
if
(
EventInfo
[
j
].
type
==
(
*
list
&
0xff
))
{
mask
[
device
].
mask
|=
EventInfo
[
j
].
mask
;
...
...
@@ -200,7 +200,7 @@ CreateMaskFromList (client, list, count, mask, dev, req)
}
}
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -214,8 +214,8 @@ SRepXGrabDevice (client, size, rep)
ClientPtr
client
;
int
size
;
xGrabDeviceReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/grabdev.h
View file @
41a0ba72
...
...
@@ -43,17 +43,17 @@ ProcXGrabDevice(
int
CreateMaskFromList
(
ClientPtr
/* client */
,
XEventClass
*
/* list */
,
int
/* count */
,
struct
tmask
/* mask */
[],
DeviceIntPtr
/* dev */
,
XEventClass
*
/* list */
,
int
/* count */
,
struct
tmask
/* mask */
[],
DeviceIntPtr
/* dev */
,
int
/* req */
);
void
SRepXGrabDevice
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGrabDeviceReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/grabdevb.c
View file @
41a0ba72
...
...
@@ -78,7 +78,7 @@ SOFTWARE.
int
SProcXGrabDeviceButton
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGrabDeviceButtonReq
);
swaps
(
&
stuff
->
length
);
REQUEST_AT_LEAST_SIZE
(
xGrabDeviceButtonReq
);
...
...
@@ -89,8 +89,8 @@ SProcXGrabDeviceButton(client)
stuff
->
event_count
*
sizeof
(
CARD32
));
SwapLongs
((
CARD32
*
)
(
&
stuff
[
1
]),
stuff
->
event_count
);
return
(
ProcXGrabDeviceButton
(
client
));
}
return
(
ProcXGrabDeviceButton
(
client
));
}
/***********************************************************************
*
...
...
@@ -101,7 +101,7 @@ SProcXGrabDeviceButton(client)
int
ProcXGrabDeviceButton
(
client
)
ClientPtr
client
;
{
{
int
ret
;
DeviceIntPtr
dev
;
DeviceIntPtr
mdev
;
...
...
@@ -113,11 +113,11 @@ ProcXGrabDeviceButton(client)
if
(
stuff
->
length
!=
(
sizeof
(
xGrabDeviceButtonReq
)
>>
2
)
+
stuff
->
event_count
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceButton
,
0
,
BadLength
);
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceButton
,
0
,
BadLength
);
return
Success
;
}
dev
=
LookupDeviceIntRec
(
stuff
->
grabbed_device
);
dev
=
LookupDeviceIntRec
(
stuff
->
grabbed_device
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceButton
,
0
,
...
...
@@ -126,7 +126,7 @@ ProcXGrabDeviceButton(client)
}
if
(
stuff
->
modifier_device
!=
UseXKeyboard
)
{
mdev
=
LookupDeviceIntRec
(
stuff
->
modifier_device
);
mdev
=
LookupDeviceIntRec
(
stuff
->
modifier_device
);
if
(
mdev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceButton
,
0
,
...
...
@@ -145,7 +145,7 @@ ProcXGrabDeviceButton(client)
class
=
(
XEventClass
*
)
(
&
stuff
[
1
]);
/* first word of values */
if
((
ret
=
CreateMaskFromList
(
client
,
class
,
if
((
ret
=
CreateMaskFromList
(
client
,
class
,
stuff
->
event_count
,
tmp
,
dev
,
X_GrabDeviceButton
))
!=
Success
)
return
Success
;
ret
=
GrabButton
(
client
,
dev
,
stuff
->
this_device_mode
,
...
...
@@ -155,5 +155,5 @@ ProcXGrabDeviceButton(client)
if
(
ret
!=
Success
)
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceButton
,
0
,
ret
);
return
(
Success
);
}
return
(
Success
);
}
nx-X11/programs/Xserver/Xi/grabdevb.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/grabdevk.c
View file @
41a0ba72
...
...
@@ -78,7 +78,7 @@ SOFTWARE.
int
SProcXGrabDeviceKey
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGrabDeviceKeyReq
);
swaps
(
&
stuff
->
length
);
REQUEST_AT_LEAST_SIZE
(
xGrabDeviceKeyReq
);
...
...
@@ -87,8 +87,8 @@ SProcXGrabDeviceKey(client)
swaps
(
&
stuff
->
event_count
);
REQUEST_FIXED_SIZE
(
xGrabDeviceKeyReq
,
stuff
->
event_count
*
sizeof
(
CARD32
));
SwapLongs
((
CARD32
*
)
(
&
stuff
[
1
]),
stuff
->
event_count
);
return
(
ProcXGrabDeviceKey
(
client
));
}
return
(
ProcXGrabDeviceKey
(
client
));
}
/***********************************************************************
*
...
...
@@ -99,7 +99,7 @@ SProcXGrabDeviceKey(client)
int
ProcXGrabDeviceKey
(
client
)
ClientPtr
client
;
{
{
int
ret
;
DeviceIntPtr
dev
;
DeviceIntPtr
mdev
;
...
...
@@ -111,11 +111,11 @@ ProcXGrabDeviceKey(client)
if
(
stuff
->
length
!=
(
sizeof
(
xGrabDeviceKeyReq
)
>>
2
)
+
stuff
->
event_count
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceKey
,
0
,
BadLength
);
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceKey
,
0
,
BadLength
);
return
Success
;
}
dev
=
LookupDeviceIntRec
(
stuff
->
grabbed_device
);
dev
=
LookupDeviceIntRec
(
stuff
->
grabbed_device
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceKey
,
0
,
...
...
@@ -125,7 +125,7 @@ ProcXGrabDeviceKey(client)
if
(
stuff
->
modifier_device
!=
UseXKeyboard
)
{
mdev
=
LookupDeviceIntRec
(
stuff
->
modifier_device
);
mdev
=
LookupDeviceIntRec
(
stuff
->
modifier_device
);
if
(
mdev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GrabDeviceKey
,
0
,
...
...
@@ -144,7 +144,7 @@ ProcXGrabDeviceKey(client)
class
=
(
XEventClass
*
)
(
&
stuff
[
1
]);
/* first word of values */
if
((
ret
=
CreateMaskFromList
(
client
,
class
,
if
((
ret
=
CreateMaskFromList
(
client
,
class
,
stuff
->
event_count
,
tmp
,
dev
,
X_GrabDeviceKey
))
!=
Success
)
return
Success
;
...
...
@@ -159,4 +159,4 @@ ProcXGrabDeviceKey(client)
}
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/grabdevk.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/gtmotion.c
View file @
41a0ba72
...
...
@@ -76,14 +76,14 @@ SOFTWARE.
int
SProcXGetDeviceMotionEvents
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xGetDeviceMotionEventsReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xGetDeviceMotionEventsReq
);
swapl
(
&
stuff
->
start
);
swapl
(
&
stuff
->
stop
);
return
(
ProcXGetDeviceMotionEvents
(
client
));
}
return
(
ProcXGetDeviceMotionEvents
(
client
));
}
/****************************************************************************
*
...
...
@@ -108,7 +108,7 @@ ProcXGetDeviceMotionEvents(client)
REQUEST
(
xGetDeviceMotionEventsReq
);
REQUEST_SIZE_MATCH
(
xGetDeviceMotionEventsReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_GetDeviceMotionEvents
,
0
,
...
...
@@ -145,7 +145,7 @@ ProcXGetDeviceMotionEvents(client)
num_events
=
v
->
numMotionEvents
;
if
(
num_events
)
{
size
=
sizeof
(
Time
)
+
(
axes
*
sizeof
(
INT32
));
size
=
sizeof
(
Time
)
+
(
axes
*
sizeof
(
INT32
));
tsize
=
num_events
*
size
;
coords
=
(
INT32
*
)
malloc
(
tsize
);
if
(
!
coords
)
...
...
@@ -160,7 +160,7 @@ ProcXGetDeviceMotionEvents(client)
}
if
(
rep
.
nEvents
>
0
)
{
length
=
(
rep
.
nEvents
*
size
+
3
)
>>
2
;
length
=
(
rep
.
nEvents
*
size
+
3
)
>>
2
;
rep
.
length
=
length
;
}
nEvents
=
rep
.
nEvents
;
...
...
@@ -195,9 +195,9 @@ SRepXGetDeviceMotionEvents (client, size, rep)
ClientPtr
client
;
int
size
;
xGetDeviceMotionEventsReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
swapl
(
&
rep
->
nEvents
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/gtmotion.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXGetDeviceMotionEvents(
void
SRepXGetDeviceMotionEvents
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xGetDeviceMotionEventsReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/listdev.c
View file @
41a0ba72
...
...
@@ -78,11 +78,11 @@ SOFTWARE.
int
SProcXListInputDevices
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xListInputDevicesReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXListInputDevices
(
client
));
}
return
(
ProcXListInputDevices
(
client
));
}
/***********************************************************************
*
...
...
@@ -93,7 +93,7 @@ SProcXListInputDevices(client)
int
ProcXListInputDevices
(
client
)
register
ClientPtr
client
;
{
{
xListInputDevicesReply
rep
;
int
numdevs
;
int
namesize
=
1
;
/* need 1 extra byte for strcpy */
...
...
@@ -114,33 +114,33 @@ ProcXListInputDevices (client)
rep
.
length
=
0
;
rep
.
sequenceNumber
=
client
->
sequence
;
AddOtherInputDevices
();
AddOtherInputDevices
();
numdevs
=
inputInfo
.
numDevices
;
for
(
d
=
inputInfo
.
devices
;
d
;
d
=
d
->
next
)
SizeDeviceInfo
(
d
,
&
namesize
,
&
size
);
for
(
d
=
inputInfo
.
off_devices
;
d
;
d
=
d
->
next
)
SizeDeviceInfo
(
d
,
&
namesize
,
&
size
);
for
(
d
=
inputInfo
.
devices
;
d
;
d
=
d
->
next
)
SizeDeviceInfo
(
d
,
&
namesize
,
&
size
);
for
(
d
=
inputInfo
.
off_devices
;
d
;
d
=
d
->
next
)
SizeDeviceInfo
(
d
,
&
namesize
,
&
size
);
total_length
=
numdevs
*
sizeof
(
xDeviceInfo
)
+
size
+
namesize
;
devbuf
=
(
char
*
)
calloc
(
1
,
total_length
);
classbuf
=
devbuf
+
(
numdevs
*
sizeof
(
xDeviceInfo
));
total_length
=
numdevs
*
sizeof
(
xDeviceInfo
)
+
size
+
namesize
;
devbuf
=
(
char
*
)
calloc
(
1
,
total_length
);
classbuf
=
devbuf
+
(
numdevs
*
sizeof
(
xDeviceInfo
));
namebuf
=
classbuf
+
size
;
savbuf
=
devbuf
;
dev
=
(
xDeviceInfoPtr
)
devbuf
;
for
(
d
=
inputInfo
.
devices
;
d
;
d
=
d
->
next
,
dev
++
)
ListDeviceInfo
(
client
,
d
,
dev
,
&
devbuf
,
&
classbuf
,
&
namebuf
);
for
(
d
=
inputInfo
.
off_devices
;
d
;
d
=
d
->
next
,
dev
++
)
ListDeviceInfo
(
client
,
d
,
dev
,
&
devbuf
,
&
classbuf
,
&
namebuf
);
for
(
d
=
inputInfo
.
devices
;
d
;
d
=
d
->
next
,
dev
++
)
ListDeviceInfo
(
client
,
d
,
dev
,
&
devbuf
,
&
classbuf
,
&
namebuf
);
for
(
d
=
inputInfo
.
off_devices
;
d
;
d
=
d
->
next
,
dev
++
)
ListDeviceInfo
(
client
,
d
,
dev
,
&
devbuf
,
&
classbuf
,
&
namebuf
);
rep
.
ndevices
=
numdevs
;
rep
.
length
=
(
total_length
+
3
)
>>
2
;
WriteReplyToClient
(
client
,
sizeof
(
xListInputDevicesReply
),
&
rep
);
WriteReplyToClient
(
client
,
sizeof
(
xListInputDevicesReply
),
&
rep
);
WriteToClient
(
client
,
total_length
,
savbuf
);
free
(
savbuf
);
free
(
savbuf
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -154,23 +154,23 @@ SizeDeviceInfo (d, namesize, size)
DeviceIntPtr
d
;
int
*
namesize
;
int
*
size
;
{
{
int
chunks
;
*
namesize
+=
1
;
if
(
d
->
name
)
*
namesize
+=
strlen
(
d
->
name
);
*
namesize
+=
strlen
(
d
->
name
);
if
(
d
->
key
!=
NULL
)
*
size
+=
sizeof
(
xKeyInfo
);
*
size
+=
sizeof
(
xKeyInfo
);
if
(
d
->
button
!=
NULL
)
*
size
+=
sizeof
(
xButtonInfo
);
*
size
+=
sizeof
(
xButtonInfo
);
if
(
d
->
valuator
!=
NULL
)
{
chunks
=
((
int
)
d
->
valuator
->
numAxes
+
19
)
/
VPC
;
chunks
=
((
int
)
d
->
valuator
->
numAxes
+
19
)
/
VPC
;
*
size
+=
(
chunks
*
sizeof
(
xValuatorInfo
)
+
d
->
valuator
->
numAxes
*
sizeof
(
xAxisInfo
));
}
}
}
/***********************************************************************
*
...
...
@@ -186,9 +186,9 @@ ListDeviceInfo (client, d, dev, devbuf, classbuf, namebuf)
char
**
devbuf
;
char
**
classbuf
;
char
**
namebuf
;
{
CopyDeviceName
(
namebuf
,
d
->
name
);
CopySwapDevice
(
client
,
d
,
0
,
devbuf
);
{
CopyDeviceName
(
namebuf
,
d
->
name
);
CopySwapDevice
(
client
,
d
,
0
,
devbuf
);
if
(
d
->
key
!=
NULL
)
{
CopySwapKeyClass
(
client
,
d
->
key
,
classbuf
);
...
...
@@ -203,7 +203,7 @@ ListDeviceInfo (client, d, dev, devbuf, classbuf, namebuf)
{
dev
->
num_classes
+=
CopySwapValuatorClass
(
client
,
d
->
valuator
,
classbuf
);
}
}
}
/***********************************************************************
*
...
...
@@ -219,21 +219,21 @@ void
CopyDeviceName
(
namebuf
,
name
)
char
**
namebuf
;
char
*
name
;
{
char
*
nameptr
=
(
char
*
)
*
namebuf
;
{
char
*
nameptr
=
(
char
*
)
*
namebuf
;
if
(
name
)
{
*
nameptr
++
=
strlen
(
name
);
strcpy
(
nameptr
,
name
);
*
namebuf
+=
(
strlen
(
name
)
+
1
);
*
nameptr
++
=
strlen
(
name
);
strcpy
(
nameptr
,
name
);
*
namebuf
+=
(
strlen
(
name
)
+
1
);
}
else
{
*
nameptr
++
=
0
;
*
namebuf
+=
1
;
}
}
}
/***********************************************************************
*
...
...
@@ -247,10 +247,10 @@ CopySwapDevice (client, d, num_classes, buf)
DeviceIntPtr
d
;
int
num_classes
;
char
**
buf
;
{
{
xDeviceInfoPtr
dev
;
dev
=
(
xDeviceInfoPtr
)
*
buf
;
dev
=
(
xDeviceInfoPtr
)
*
buf
;
dev
->
id
=
d
->
id
;
dev
->
type
=
d
->
type
;
...
...
@@ -265,8 +265,8 @@ CopySwapDevice (client, d, num_classes, buf)
{
swapl
(
&
dev
->
type
);
/* macro - braces are required */
}
*
buf
+=
sizeof
(
xDeviceInfo
);
}
*
buf
+=
sizeof
(
xDeviceInfo
);
}
/***********************************************************************
*
...
...
@@ -279,12 +279,12 @@ CopySwapKeyClass (client, k, buf)
register
ClientPtr
client
;
KeyClassPtr
k
;
char
**
buf
;
{
{
xKeyInfoPtr
k2
;
k2
=
(
xKeyInfoPtr
)
*
buf
;
k2
=
(
xKeyInfoPtr
)
*
buf
;
k2
->
class
=
KeyClass
;
k2
->
length
=
sizeof
(
xKeyInfo
);
k2
->
length
=
sizeof
(
xKeyInfo
);
k2
->
min_keycode
=
k
->
curKeySyms
.
minKeyCode
;
k2
->
max_keycode
=
k
->
curKeySyms
.
maxKeyCode
;
k2
->
num_keys
=
k2
->
max_keycode
-
k2
->
min_keycode
+
1
;
...
...
@@ -292,8 +292,8 @@ CopySwapKeyClass (client, k, buf)
{
swaps
(
&
k2
->
num_keys
);
}
*
buf
+=
sizeof
(
xKeyInfo
);
}
*
buf
+=
sizeof
(
xKeyInfo
);
}
/***********************************************************************
*
...
...
@@ -306,19 +306,19 @@ CopySwapButtonClass (client, b, buf)
register
ClientPtr
client
;
ButtonClassPtr
b
;
char
**
buf
;
{
{
xButtonInfoPtr
b2
;
b2
=
(
xButtonInfoPtr
)
*
buf
;
b2
=
(
xButtonInfoPtr
)
*
buf
;
b2
->
class
=
ButtonClass
;
b2
->
length
=
sizeof
(
xButtonInfo
);
b2
->
length
=
sizeof
(
xButtonInfo
);
b2
->
num_buttons
=
b
->
numButtons
;
if
(
client
->
swapped
)
{
swaps
(
&
b2
->
num_buttons
);
/* macro - braces are required */
}
*
buf
+=
sizeof
(
xButtonInfo
);
}
*
buf
+=
sizeof
(
xButtonInfo
);
}
/***********************************************************************
*
...
...
@@ -347,9 +347,9 @@ CopySwapValuatorClass (client, v, buf)
t_axes
=
axes
<
VPC
?
axes
:
VPC
;
if
(
t_axes
<
0
)
t_axes
=
v
->
numAxes
%
VPC
;
v2
=
(
xValuatorInfoPtr
)
*
buf
;
v2
=
(
xValuatorInfoPtr
)
*
buf
;
v2
->
class
=
ValuatorClass
;
v2
->
length
=
sizeof
(
xValuatorInfo
)
+
t_axes
*
sizeof
(
xAxisInfo
);
v2
->
length
=
sizeof
(
xValuatorInfo
)
+
t_axes
*
sizeof
(
xAxisInfo
);
v2
->
num_axes
=
t_axes
;
v2
->
mode
=
v
->
mode
&
DeviceMode
;
v2
->
motion_buffer_size
=
v
->
numMotionEvents
;
...
...
@@ -357,10 +357,10 @@ CopySwapValuatorClass (client, v, buf)
{
swapl
(
&
v2
->
motion_buffer_size
);
}
*
buf
+=
sizeof
(
xValuatorInfo
);
*
buf
+=
sizeof
(
xValuatorInfo
);
a
=
v
->
axes
+
(
VPC
*
i
);
a2
=
(
xAxisInfoPtr
)
*
buf
;
for
(
j
=
0
;
j
<
t_axes
;
j
++
)
{
a2
=
(
xAxisInfoPtr
)
*
buf
;
for
(
j
=
0
;
j
<
t_axes
;
j
++
)
{
a2
->
min_value
=
a
->
min_value
;
a2
->
max_value
=
a
->
max_value
;
a2
->
resolution
=
a
->
resolution
;
...
...
@@ -371,7 +371,7 @@ CopySwapValuatorClass (client, v, buf)
}
a2
++
;
a
++
;
*
buf
+=
sizeof
(
xAxisInfo
);
*
buf
+=
sizeof
(
xAxisInfo
);
}
}
return
(
i
);
...
...
@@ -389,8 +389,8 @@ SRepXListInputDevices (client, size, rep)
ClientPtr
client
;
int
size
;
xListInputDevicesReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/listdev.h
View file @
41a0ba72
...
...
@@ -43,17 +43,17 @@ ProcXListInputDevices (
void
SizeDeviceInfo
(
DeviceIntPtr
/* d */
,
int
*
/* namesize */
,
int
*
/* namesize */
,
int
*
/* size */
);
void
ListDeviceInfo
(
ClientPtr
/* client */
,
DeviceIntPtr
/* d */
,
xDeviceInfoPtr
/* dev */
,
char
**
/* devbuf */
,
char
**
/* classbuf */
,
DeviceIntPtr
/* d */
,
xDeviceInfoPtr
/* dev */
,
char
**
/* devbuf */
,
char
**
/* classbuf */
,
char
**
/* namebuf */
);
...
...
@@ -66,36 +66,36 @@ CopyDeviceName (
void
CopySwapDevice
(
ClientPtr
/* client */
,
DeviceIntPtr
/* d */
,
int
/* num_classes */
,
DeviceIntPtr
/* d */
,
int
/* num_classes */
,
char
**
/* buf */
);
void
CopySwapKeyClass
(
ClientPtr
/* client */
,
KeyClassPtr
/* k */
,
KeyClassPtr
/* k */
,
char
**
/* buf */
);
void
CopySwapButtonClass
(
ClientPtr
/* client */
,
ButtonClassPtr
/* b */
,
ButtonClassPtr
/* b */
,
char
**
/* buf */
);
int
CopySwapValuatorClass
(
ClientPtr
/* client */
,
ValuatorClassPtr
/* v */
,
ValuatorClassPtr
/* v */
,
char
**
/* buf */
);
void
SRepXListInputDevices
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xListInputDevicesReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/opendev.c
View file @
41a0ba72
...
...
@@ -68,7 +68,7 @@ SOFTWARE.
#include "opendev.h"
extern
CARD8
event_base
[];
extern
CARD8
event_base
[];
/***********************************************************************
*
...
...
@@ -80,11 +80,11 @@ extern CARD8 event_base [];
int
SProcXOpenDevice
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xOpenDeviceReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXOpenDevice
(
client
));
}
return
(
ProcXOpenDevice
(
client
));
}
/***********************************************************************
*
...
...
@@ -95,10 +95,10 @@ SProcXOpenDevice(client)
int
ProcXOpenDevice
(
client
)
register
ClientPtr
client
;
{
xInputClassInfo
evbase
[
numInputClasses
];
{
xInputClassInfo
evbase
[
numInputClasses
];
Bool
enableit
=
FALSE
;
int
j
=
0
;
int
j
=
0
;
int
status
=
Success
;
xOpenDeviceReply
rep
;
DeviceIntPtr
dev
;
...
...
@@ -115,7 +115,7 @@ ProcXOpenDevice(client)
if
((
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
))
==
NULL
)
/* not open */
{
for
(
dev
=
inputInfo
.
off_devices
;
dev
;
dev
=
dev
->
next
)
for
(
dev
=
inputInfo
.
off_devices
;
dev
;
dev
=
dev
->
next
)
if
(
dev
->
id
==
stuff
->
deviceid
)
break
;
if
(
dev
==
NULL
)
...
...
@@ -126,7 +126,7 @@ ProcXOpenDevice(client)
enableit
=
TRUE
;
}
OpenInputDevice
(
dev
,
client
,
&
status
);
OpenInputDevice
(
dev
,
client
,
&
status
);
if
(
status
!=
Success
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_OpenDevice
,
0
,
status
);
...
...
@@ -172,12 +172,12 @@ ProcXOpenDevice(client)
}
evbase
[
j
].
class
=
OtherClass
;
evbase
[
j
++
].
event_type_base
=
event_base
[
OtherClass
];
rep
.
length
=
(
j
*
sizeof
(
xInputClassInfo
)
+
3
)
>>
2
;
rep
.
length
=
(
j
*
sizeof
(
xInputClassInfo
)
+
3
)
>>
2
;
rep
.
num_classes
=
j
;
WriteReplyToClient
(
client
,
sizeof
(
xOpenDeviceReply
),
&
rep
);
WriteToClient
(
client
,
j
*
sizeof
(
xInputClassInfo
),
evbase
);
WriteReplyToClient
(
client
,
sizeof
(
xOpenDeviceReply
),
&
rep
);
WriteToClient
(
client
,
j
*
sizeof
(
xInputClassInfo
),
evbase
);
return
(
Success
);
}
}
/***********************************************************************
*
...
...
@@ -191,8 +191,8 @@ SRepXOpenDevice (client, size, rep)
ClientPtr
client
;
int
size
;
xOpenDeviceReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/opendev.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXOpenDevice(
void
SRepXOpenDevice
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xOpenDeviceReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/queryst.c
View file @
41a0ba72
...
...
@@ -58,11 +58,11 @@ from The Open Group.
int
SProcXQueryDeviceState
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xQueryDeviceStateReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXQueryDeviceState
(
client
));
}
return
(
ProcXQueryDeviceState
(
client
));
}
/***********************************************************************
*
...
...
@@ -73,7 +73,7 @@ SProcXQueryDeviceState(client)
int
ProcXQueryDeviceState
(
client
)
register
ClientPtr
client
;
{
{
int
i
;
int
num_classes
=
0
;
int
total_length
=
0
;
...
...
@@ -96,7 +96,7 @@ ProcXQueryDeviceState(client)
rep
.
length
=
0
;
rep
.
sequenceNumber
=
client
->
sequence
;
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_QueryDeviceState
,
0
,
...
...
@@ -111,14 +111,14 @@ ProcXQueryDeviceState(client)
k
=
dev
->
key
;
if
(
k
!=
NULL
)
{
total_length
+=
sizeof
(
xKeyState
);
total_length
+=
sizeof
(
xKeyState
);
num_classes
++
;
}
b
=
dev
->
button
;
if
(
b
!=
NULL
)
{
total_length
+=
sizeof
(
xButtonState
);
total_length
+=
sizeof
(
xButtonState
);
num_classes
++
;
}
...
...
@@ -128,7 +128,7 @@ ProcXQueryDeviceState(client)
(
v
->
numAxes
*
sizeof
(
int
)));
num_classes
++
;
}
buf
=
(
char
*
)
malloc
(
total_length
);
buf
=
(
char
*
)
malloc
(
total_length
);
if
(
!
buf
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_QueryDeviceState
,
0
,
...
...
@@ -141,38 +141,38 @@ ProcXQueryDeviceState(client)
{
tk
=
(
xKeyState
*
)
buf
;
tk
->
class
=
KeyClass
;
tk
->
length
=
sizeof
(
xKeyState
);
tk
->
length
=
sizeof
(
xKeyState
);
tk
->
num_keys
=
k
->
curKeySyms
.
maxKeyCode
-
k
->
curKeySyms
.
minKeyCode
+
1
;
for
(
i
=
0
;
i
<
32
;
i
++
)
for
(
i
=
0
;
i
<
32
;
i
++
)
tk
->
keys
[
i
]
=
k
->
down
[
i
];
buf
+=
sizeof
(
xKeyState
);
buf
+=
sizeof
(
xKeyState
);
}
if
(
b
!=
NULL
)
{
tb
=
(
xButtonState
*
)
buf
;
tb
->
class
=
ButtonClass
;
tb
->
length
=
sizeof
(
xButtonState
);
tb
->
length
=
sizeof
(
xButtonState
);
tb
->
num_buttons
=
b
->
numButtons
;
for
(
i
=
0
;
i
<
32
;
i
++
)
for
(
i
=
0
;
i
<
32
;
i
++
)
tb
->
buttons
[
i
]
=
b
->
down
[
i
];
buf
+=
sizeof
(
xButtonState
);
buf
+=
sizeof
(
xButtonState
);
}
if
(
v
!=
NULL
)
{
tv
=
(
xValuatorState
*
)
buf
;
tv
->
class
=
ValuatorClass
;
tv
->
length
=
sizeof
(
xValuatorState
);
tv
->
length
=
sizeof
(
xValuatorState
);
tv
->
num_valuators
=
v
->
numAxes
;
tv
->
mode
=
v
->
mode
;
buf
+=
sizeof
(
xValuatorState
);
for
(
i
=
0
,
values
=
v
->
axisVal
;
i
<
v
->
numAxes
;
i
++
)
{
*
((
int
*
)
buf
)
=
*
values
++
;
*
((
int
*
)
buf
)
=
*
values
++
;
if
(
client
->
swapped
)
{
swapl
((
int
*
)
buf
);
/* macro - braces needed */
swapl
((
int
*
)
buf
);
/* macro - braces needed */
}
buf
+=
sizeof
(
int
);
}
...
...
@@ -180,12 +180,12 @@ ProcXQueryDeviceState(client)
rep
.
num_classes
=
num_classes
;
rep
.
length
=
(
total_length
+
3
)
>>
2
;
WriteReplyToClient
(
client
,
sizeof
(
xQueryDeviceStateReply
),
&
rep
);
WriteReplyToClient
(
client
,
sizeof
(
xQueryDeviceStateReply
),
&
rep
);
if
(
total_length
>
0
)
WriteToClient
(
client
,
total_length
,
savbuf
);
free
(
savbuf
);
WriteToClient
(
client
,
total_length
,
savbuf
);
free
(
savbuf
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -199,8 +199,8 @@ SRepXQueryDeviceState (client, size, rep)
ClientPtr
client
;
int
size
;
xQueryDeviceStateReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/queryst.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXQueryDeviceState(
void
SRepXQueryDeviceState
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xQueryDeviceStateReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/selectev.c
View file @
41a0ba72
...
...
@@ -81,7 +81,7 @@ extern Mask ExtValidMasks[];
int
SProcXSelectExtensionEvent
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xSelectExtensionEventReq
);
swaps
(
&
stuff
->
length
);
REQUEST_AT_LEAST_SIZE
(
xSelectExtensionEventReq
);
...
...
@@ -91,8 +91,8 @@ register ClientPtr client;
stuff
->
count
*
sizeof
(
CARD32
));
SwapLongs
((
CARD32
*
)
(
&
stuff
[
1
]),
stuff
->
count
);
return
(
ProcXSelectExtensionEvent
(
client
));
}
return
(
ProcXSelectExtensionEvent
(
client
));
}
/***********************************************************************
*
...
...
@@ -103,7 +103,7 @@ register ClientPtr client;
int
ProcXSelectExtensionEvent
(
client
)
register
ClientPtr
client
;
{
{
int
ret
;
int
i
;
WindowPtr
pWin
;
...
...
@@ -114,12 +114,12 @@ ProcXSelectExtensionEvent (client)
if
(
stuff
->
length
!=
(
sizeof
(
xSelectExtensionEventReq
)
>>
2
)
+
stuff
->
count
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_SelectExtensionEvent
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_SelectExtensionEvent
,
0
,
BadLength
);
return
Success
;
}
pWin
=
(
WindowPtr
)
LookupWindow
(
stuff
->
window
,
client
);
pWin
=
(
WindowPtr
)
LookupWindow
(
stuff
->
window
,
client
);
if
(
!
pWin
)
{
client
->
errorValue
=
stuff
->
window
;
...
...
@@ -128,11 +128,11 @@ ProcXSelectExtensionEvent (client)
return
Success
;
}
if
((
ret
=
CreateMaskFromList
(
client
,
(
XEventClass
*
)
&
stuff
[
1
],
if
((
ret
=
CreateMaskFromList
(
client
,
(
XEventClass
*
)
&
stuff
[
1
],
stuff
->
count
,
tmp
,
NULL
,
X_SelectExtensionEvent
))
!=
Success
)
return
Success
;
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
for
(
i
=
0
;
i
<
EMASKSIZE
;
i
++
)
if
(
tmp
[
i
].
dev
!=
NULL
)
{
if
((
ret
=
SelectForWindow
((
DeviceIntPtr
)
tmp
[
i
].
dev
,
pWin
,
client
,
tmp
[
i
].
mask
,
...
...
@@ -145,4 +145,4 @@ ProcXSelectExtensionEvent (client)
}
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/selectev.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/sendexev.c
View file @
41a0ba72
...
...
@@ -81,7 +81,7 @@ extern int lastEvent; /* Defined in extension.c */
int
SProcXSendExtensionEvent
(
client
)
register
ClientPtr
client
;
{
{
CARD32
*
p
;
register
int
i
;
xEvent
eventT
;
...
...
@@ -98,20 +98,20 @@ SProcXSendExtensionEvent(client)
(
stuff
->
num_events
*
(
sizeof
(
xEvent
)
>>
2
)))
return
BadLength
;
eventP
=
(
xEvent
*
)
&
stuff
[
1
];
eventP
=
(
xEvent
*
)
&
stuff
[
1
];
for
(
i
=
0
;
i
<
stuff
->
num_events
;
i
++
,
eventP
++
)
{
proc
=
EventSwapVector
[
eventP
->
u
.
u
.
type
&
0177
];
if
(
proc
==
NotImplemented
)
/* no swapping proc; invalid event type? */
return
(
BadValue
);
(
*
proc
)(
eventP
,
&
eventT
);
(
*
proc
)
(
eventP
,
&
eventT
);
*
eventP
=
eventT
;
}
p
=
(
CARD32
*
)(((
xEvent
*
)
&
stuff
[
1
])
+
stuff
->
num_events
);
p
=
(
CARD32
*
)
(((
xEvent
*
)
&
stuff
[
1
])
+
stuff
->
num_events
);
SwapLongs
(
p
,
stuff
->
count
);
return
(
ProcXSendExtensionEvent
(
client
));
}
return
(
ProcXSendExtensionEvent
(
client
));
}
/***********************************************************************
*
...
...
@@ -123,7 +123,7 @@ SProcXSendExtensionEvent(client)
int
ProcXSendExtensionEvent
(
client
)
register
ClientPtr
client
;
{
{
int
ret
;
DeviceIntPtr
dev
;
xEvent
*
first
;
...
...
@@ -133,7 +133,7 @@ ProcXSendExtensionEvent (client)
REQUEST
(
xSendExtensionEventReq
);
REQUEST_AT_LEAST_SIZE
(
xSendExtensionEventReq
);
if
(
stuff
->
length
!=
(
sizeof
(
xSendExtensionEventReq
)
>>
2
)
+
stuff
->
count
+
if
(
stuff
->
length
!=
(
sizeof
(
xSendExtensionEventReq
)
>>
2
)
+
stuff
->
count
+
(
stuff
->
num_events
*
(
sizeof
(
xEvent
)
>>
2
)))
{
SendErrorToClient
(
client
,
IReqCode
,
X_SendExtensionEvent
,
0
,
...
...
@@ -141,7 +141,7 @@ ProcXSendExtensionEvent (client)
return
Success
;
}
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_SendExtensionEvent
,
0
,
...
...
@@ -160,8 +160,8 @@ ProcXSendExtensionEvent (client)
/* The client's event type must be one defined by an extension. */
first
=
((
xEvent
*
)
&
stuff
[
1
]);
if
(
!
((
EXTENSION_EVENT_BASE
<=
first
->
u
.
u
.
type
)
&&
first
=
((
xEvent
*
)
&
stuff
[
1
]);
if
(
!
((
EXTENSION_EVENT_BASE
<=
first
->
u
.
u
.
type
)
&&
(
first
->
u
.
u
.
type
<
lastEvent
))
)
{
client
->
errorValue
=
first
->
u
.
u
.
type
;
...
...
@@ -171,11 +171,11 @@ ProcXSendExtensionEvent (client)
}
list
=
(
XEventClass
*
)
(
first
+
stuff
->
num_events
);
if
((
ret
=
CreateMaskFromList
(
client
,
list
,
stuff
->
count
,
tmp
,
dev
,
if
((
ret
=
CreateMaskFromList
(
client
,
list
,
stuff
->
count
,
tmp
,
dev
,
X_SendExtensionEvent
))
!=
Success
)
return
Success
;
ret
=
(
SendEvent
(
client
,
dev
,
stuff
->
destination
,
ret
=
(
SendEvent
(
client
,
dev
,
stuff
->
destination
,
stuff
->
propagate
,
(
xEvent
*
)
&
stuff
[
1
],
tmp
[
stuff
->
deviceid
].
mask
,
stuff
->
num_events
));
...
...
@@ -183,4 +183,4 @@ ProcXSendExtensionEvent (client)
SendErrorToClient
(
client
,
IReqCode
,
X_SendExtensionEvent
,
0
,
ret
);
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/sendexev.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/setbmap.c
View file @
41a0ba72
...
...
@@ -79,11 +79,11 @@ SOFTWARE.
int
SProcXSetDeviceButtonMapping
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xSetDeviceButtonMappingReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXSetDeviceButtonMapping
(
client
));
}
return
(
ProcXSetDeviceButtonMapping
(
client
));
}
/***********************************************************************
*
...
...
@@ -94,7 +94,7 @@ SProcXSetDeviceButtonMapping(client)
int
ProcXSetDeviceButtonMapping
(
client
)
register
ClientPtr
client
;
{
{
int
ret
;
xSetDeviceButtonMappingReply
rep
;
DeviceIntPtr
dev
;
...
...
@@ -116,7 +116,7 @@ ProcXSetDeviceButtonMapping (client)
rep
.
sequenceNumber
=
client
->
sequence
;
rep
.
status
=
MappingSuccess
;
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceButtonMapping
,
0
,
...
...
@@ -124,7 +124,7 @@ ProcXSetDeviceButtonMapping (client)
return
Success
;
}
ret
=
SetButtonMapping
(
client
,
dev
,
stuff
->
map_length
,
(
BYTE
*
)
&
stuff
[
1
]);
ret
=
SetButtonMapping
(
client
,
dev
,
stuff
->
map_length
,
(
BYTE
*
)
&
stuff
[
1
]);
if
(
ret
==
BadValue
||
ret
==
BadMatch
)
{
...
...
@@ -141,7 +141,7 @@ ProcXSetDeviceButtonMapping (client)
if
(
ret
!=
MappingBusy
)
SendDeviceMappingNotify
(
MappingPointer
,
0
,
0
,
dev
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -155,8 +155,8 @@ SRepXSetDeviceButtonMapping (client, size, rep)
ClientPtr
client
;
int
size
;
xSetDeviceButtonMappingReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/setbmap.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXSetDeviceButtonMapping(
void
SRepXSetDeviceButtonMapping
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xSetDeviceButtonMappingReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/setdval.c
View file @
41a0ba72
...
...
@@ -76,11 +76,11 @@ SOFTWARE.
int
SProcXSetDeviceValuators
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xSetDeviceValuatorsReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXSetDeviceValuators
(
client
));
}
return
(
ProcXSetDeviceValuators
(
client
));
}
/***********************************************************************
*
...
...
@@ -91,7 +91,7 @@ SProcXSetDeviceValuators(client)
int
ProcXSetDeviceValuators
(
client
)
register
ClientPtr
client
;
{
{
DeviceIntPtr
dev
;
xSetDeviceValuatorsReply
rep
;
...
...
@@ -104,14 +104,14 @@ ProcXSetDeviceValuators(client)
rep
.
status
=
Success
;
rep
.
sequenceNumber
=
client
->
sequence
;
if
(
stuff
->
length
!=
(
sizeof
(
xSetDeviceValuatorsReq
)
>>
2
)
+
if
(
stuff
->
length
!=
(
sizeof
(
xSetDeviceValuatorsReq
)
>>
2
)
+
stuff
->
num_valuators
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceValuators
,
0
,
BadLength
);
return
Success
;
}
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceValuators
,
0
,
...
...
@@ -135,17 +135,17 @@ ProcXSetDeviceValuators(client)
if
((
dev
->
grab
)
&&
!
SameClient
(
dev
->
grab
,
client
))
rep
.
status
=
AlreadyGrabbed
;
else
rep
.
status
=
SetDeviceValuators
(
client
,
dev
,
(
int
*
)
&
stuff
[
1
],
rep
.
status
=
SetDeviceValuators
(
client
,
dev
,
(
int
*
)
&
stuff
[
1
],
stuff
->
first_valuator
,
stuff
->
num_valuators
);
if
(
rep
.
status
!=
Success
&&
rep
.
status
!=
AlreadyGrabbed
)
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceValuators
,
0
,
rep
.
status
);
else
WriteReplyToClient
(
client
,
sizeof
(
xSetDeviceValuatorsReply
),
&
rep
);
WriteReplyToClient
(
client
,
sizeof
(
xSetDeviceValuatorsReply
),
&
rep
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -159,8 +159,8 @@ SRepXSetDeviceValuators (client, size, rep)
ClientPtr
client
;
int
size
;
xSetDeviceValuatorsReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/setdval.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXSetDeviceValuators(
void
SRepXSetDeviceValuators
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xSetDeviceValuatorsReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/setfocus.c
View file @
41a0ba72
...
...
@@ -79,14 +79,14 @@ SOFTWARE.
int
SProcXSetDeviceFocus
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xSetDeviceFocusReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xSetDeviceFocusReq
);
swapl
(
&
stuff
->
focus
);
swapl
(
&
stuff
->
time
);
return
(
ProcXSetDeviceFocus
(
client
));
}
return
(
ProcXSetDeviceFocus
(
client
));
}
/***********************************************************************
*
...
...
@@ -97,24 +97,24 @@ SProcXSetDeviceFocus(client)
int
ProcXSetDeviceFocus
(
client
)
register
ClientPtr
client
;
{
{
int
ret
;
register
DeviceIntPtr
dev
;
REQUEST
(
xSetDeviceFocusReq
);
REQUEST_SIZE_MATCH
(
xSetDeviceFocusReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
device
);
dev
=
LookupDeviceIntRec
(
stuff
->
device
);
if
(
dev
==
NULL
||
!
dev
->
focus
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceFocus
,
0
,
BadDevice
);
return
Success
;
}
ret
=
SetInputFocus
(
client
,
dev
,
stuff
->
focus
,
stuff
->
revertTo
,
ret
=
SetInputFocus
(
client
,
dev
,
stuff
->
focus
,
stuff
->
revertTo
,
stuff
->
time
,
TRUE
);
if
(
ret
!=
Success
)
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceFocus
,
0
,
ret
);
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/setfocus.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/setmmap.c
View file @
41a0ba72
...
...
@@ -77,11 +77,11 @@ SOFTWARE.
int
SProcXSetDeviceModifierMapping
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xSetDeviceModifierMappingReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXSetDeviceModifierMapping
(
client
));
}
return
(
ProcXSetDeviceModifierMapping
(
client
));
}
/***********************************************************************
*
...
...
@@ -92,7 +92,7 @@ SProcXSetDeviceModifierMapping(client)
int
ProcXSetDeviceModifierMapping
(
client
)
ClientPtr
client
;
{
{
int
ret
;
xSetDeviceModifierMappingReply
rep
;
DeviceIntPtr
dev
;
...
...
@@ -101,10 +101,10 @@ ProcXSetDeviceModifierMapping(client)
REQUEST
(
xSetDeviceModifierMappingReq
);
REQUEST_AT_LEAST_SIZE
(
xSetDeviceModifierMappingReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceModifierMapping
,
0
,
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceModifierMapping
,
0
,
BadDevice
);
return
Success
;
}
...
...
@@ -127,14 +127,14 @@ ProcXSetDeviceModifierMapping(client)
}
else
{
if
(
ret
==
-
1
)
ret
=
BadValue
;
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceModifierMapping
,
0
,
ret
);
if
(
ret
==
-
1
)
ret
=
BadValue
;
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceModifierMapping
,
0
,
ret
);
}
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -148,9 +148,9 @@ SRepXSetDeviceModifierMapping (client, size, rep)
ClientPtr
client
;
int
size
;
xSetDeviceModifierMappingReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/setmmap.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXSetDeviceModifierMapping(
void
SRepXSetDeviceModifierMapping
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xSetDeviceModifierMappingReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/setmode.c
View file @
41a0ba72
...
...
@@ -76,11 +76,11 @@ SOFTWARE.
int
SProcXSetDeviceMode
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xSetDeviceModeReq
);
swaps
(
&
stuff
->
length
);
return
(
ProcXSetDeviceMode
(
client
));
}
return
(
ProcXSetDeviceMode
(
client
));
}
/***********************************************************************
*
...
...
@@ -91,7 +91,7 @@ SProcXSetDeviceMode(client)
int
ProcXSetDeviceMode
(
client
)
register
ClientPtr
client
;
{
{
DeviceIntPtr
dev
;
xSetDeviceModeReply
rep
;
...
...
@@ -103,10 +103,10 @@ ProcXSetDeviceMode(client)
rep
.
length
=
0
;
rep
.
sequenceNumber
=
client
->
sequence
;
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceMode
,
0
,
BadDevice
);
SendErrorToClient
(
client
,
IReqCode
,
X_SetDeviceMode
,
0
,
BadDevice
);
return
Success
;
}
if
(
dev
->
valuator
==
NULL
)
...
...
@@ -117,7 +117,7 @@ ProcXSetDeviceMode(client)
if
((
dev
->
grab
)
&&
!
SameClient
(
dev
->
grab
,
client
))
rep
.
status
=
AlreadyGrabbed
;
else
rep
.
status
=
SetDeviceMode
(
client
,
dev
,
stuff
->
mode
);
rep
.
status
=
SetDeviceMode
(
client
,
dev
,
stuff
->
mode
);
if
(
rep
.
status
==
Success
)
dev
->
valuator
->
mode
=
stuff
->
mode
;
...
...
@@ -127,9 +127,9 @@ ProcXSetDeviceMode(client)
return
Success
;
}
WriteReplyToClient
(
client
,
sizeof
(
xSetDeviceModeReply
),
&
rep
);
WriteReplyToClient
(
client
,
sizeof
(
xSetDeviceModeReply
),
&
rep
);
return
Success
;
}
}
/***********************************************************************
*
...
...
@@ -143,8 +143,8 @@ SRepXSetDeviceMode (client, size, rep)
ClientPtr
client
;
int
size
;
xSetDeviceModeReply
*
rep
;
{
{
swaps
(
&
rep
->
sequenceNumber
);
swapl
(
&
rep
->
length
);
WriteToClient
(
client
,
size
,
rep
);
}
}
nx-X11/programs/Xserver/Xi/setmode.h
View file @
41a0ba72
...
...
@@ -43,7 +43,7 @@ ProcXSetDeviceMode(
void
SRepXSetDeviceMode
(
ClientPtr
/* client */
,
int
/* size */
,
int
/* size */
,
xSetDeviceModeReply
*
/* rep */
);
...
...
nx-X11/programs/Xserver/Xi/stubs.c
View file @
41a0ba72
...
...
@@ -94,12 +94,12 @@ int
ChangeKeyboardDevice
(
old_dev
,
new_dev
)
DeviceIntPtr
old_dev
;
DeviceIntPtr
new_dev
;
{
{
/***********************************************************************
DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
**********************************************************************/
return
BadMatch
;
}
}
/***********************************************************************
...
...
@@ -138,7 +138,7 @@ ChangePointerDevice (
DeviceIntPtr
new_dev
,
unsigned
char
x
,
unsigned
char
y
)
{
{
/***********************************************************************
InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr*
...
...
@@ -150,7 +150,7 @@ ChangePointerDevice (
axes_changed = FALSE;
*************************************************************************/
return
BadMatch
;
}
}
/***********************************************************************
*
...
...
@@ -169,8 +169,8 @@ void
CloseInputDevice
(
d
,
client
)
DeviceIntPtr
d
;
ClientPtr
client
;
{
}
{
}
/***********************************************************************
*
...
...
@@ -200,7 +200,7 @@ CloseInputDevice (d, client)
void
AddOtherInputDevices
()
{
{
/**********************************************************************
for each uninitialized device, do something like:
...
...
@@ -214,7 +214,7 @@ AddOtherInputDevices ()
dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
************************************************************************/
}
}
/***********************************************************************
*
...
...
@@ -243,8 +243,8 @@ OpenInputDevice (dev, client, status)
DeviceIntPtr
dev
;
ClientPtr
client
;
int
*
status
;
{
}
{
}
/****************************************************************************
*
...
...
@@ -263,9 +263,9 @@ SetDeviceMode (client, dev, mode)
register
ClientPtr
client
;
DeviceIntPtr
dev
;
int
mode
;
{
{
return
BadMatch
;
}
}
/****************************************************************************
*
...
...
@@ -286,9 +286,9 @@ SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators)
int
*
valuators
;
int
first_valuator
;
int
num_valuators
;
{
{
return
BadMatch
;
}
}
/****************************************************************************
*
...
...
@@ -305,10 +305,10 @@ ChangeDeviceControl (client, dev, control)
xDeviceCtl
*
control
;
{
switch
(
control
->
control
)
{
{
case
DEVICE_RESOLUTION
:
return
(
BadMatch
);
default
:
return
(
BadMatch
);
}
}
}
nx-X11/programs/Xserver/Xi/ungrdev.c
View file @
41a0ba72
...
...
@@ -75,13 +75,13 @@ SOFTWARE.
int
SProcXUngrabDevice
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xUngrabDeviceReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xUngrabDeviceReq
);
swapl
(
&
stuff
->
time
);
return
(
ProcXUngrabDevice
(
client
));
}
return
(
ProcXUngrabDevice
(
client
));
}
/***********************************************************************
*
...
...
@@ -92,7 +92,7 @@ register ClientPtr client;
int
ProcXUngrabDevice
(
client
)
register
ClientPtr
client
;
{
{
DeviceIntPtr
dev
;
GrabPtr
grab
;
TimeStamp
time
;
...
...
@@ -100,7 +100,7 @@ register ClientPtr client;
REQUEST
(
xUngrabDeviceReq
);
REQUEST_SIZE_MATCH
(
xUngrabDeviceReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
dev
=
LookupDeviceIntRec
(
stuff
->
deviceid
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_UngrabDevice
,
0
,
BadDevice
);
...
...
@@ -112,6 +112,6 @@ register ClientPtr client;
if
((
CompareTimeStamps
(
time
,
currentTime
)
!=
LATER
)
&&
(
CompareTimeStamps
(
time
,
dev
->
grabTime
)
!=
EARLIER
)
&&
(
grab
)
&&
SameClient
(
grab
,
client
))
(
*
dev
->
DeactivateGrab
)(
dev
);
(
*
dev
->
DeactivateGrab
)
(
dev
);
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/ungrdev.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/ungrdevb.c
View file @
41a0ba72
...
...
@@ -81,14 +81,14 @@ SOFTWARE.
int
SProcXUngrabDeviceButton
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xUngrabDeviceButtonReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xUngrabDeviceButtonReq
);
swapl
(
&
stuff
->
grabWindow
);
swaps
(
&
stuff
->
modifiers
);
return
(
ProcXUngrabDeviceButton
(
client
));
}
return
(
ProcXUngrabDeviceButton
(
client
));
}
/***********************************************************************
*
...
...
@@ -99,7 +99,7 @@ SProcXUngrabDeviceButton(client)
int
ProcXUngrabDeviceButton
(
client
)
ClientPtr
client
;
{
{
DeviceIntPtr
dev
;
DeviceIntPtr
mdev
;
WindowPtr
pWin
;
...
...
@@ -108,7 +108,7 @@ ProcXUngrabDeviceButton(client)
REQUEST
(
xUngrabDeviceButtonReq
);
REQUEST_SIZE_MATCH
(
xUngrabDeviceButtonReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
grabbed_device
);
dev
=
LookupDeviceIntRec
(
stuff
->
grabbed_device
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_UngrabDeviceButton
,
0
,
...
...
@@ -124,7 +124,7 @@ ProcXUngrabDeviceButton(client)
if
(
stuff
->
modifier_device
!=
UseXKeyboard
)
{
mdev
=
LookupDeviceIntRec
(
stuff
->
modifier_device
);
mdev
=
LookupDeviceIntRec
(
stuff
->
modifier_device
);
if
(
mdev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_UngrabDeviceButton
,
0
,
...
...
@@ -169,4 +169,4 @@ ProcXUngrabDeviceButton(client)
DeletePassiveGrabFromList
(
&
temporaryGrab
);
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/ungrdevb.h
View file @
41a0ba72
nx-X11/programs/Xserver/Xi/ungrdevk.c
View file @
41a0ba72
...
...
@@ -81,14 +81,14 @@ SOFTWARE.
int
SProcXUngrabDeviceKey
(
client
)
register
ClientPtr
client
;
{
{
REQUEST
(
xUngrabDeviceKeyReq
);
swaps
(
&
stuff
->
length
);
REQUEST_SIZE_MATCH
(
xUngrabDeviceKeyReq
);
swapl
(
&
stuff
->
grabWindow
);
swaps
(
&
stuff
->
modifiers
);
return
(
ProcXUngrabDeviceKey
(
client
));
}
return
(
ProcXUngrabDeviceKey
(
client
));
}
/***********************************************************************
*
...
...
@@ -99,7 +99,7 @@ SProcXUngrabDeviceKey(client)
int
ProcXUngrabDeviceKey
(
client
)
ClientPtr
client
;
{
{
DeviceIntPtr
dev
;
DeviceIntPtr
mdev
;
WindowPtr
pWin
;
...
...
@@ -108,7 +108,7 @@ ProcXUngrabDeviceKey(client)
REQUEST
(
xUngrabDeviceKeyReq
);
REQUEST_SIZE_MATCH
(
xUngrabDeviceKeyReq
);
dev
=
LookupDeviceIntRec
(
stuff
->
grabbed_device
);
dev
=
LookupDeviceIntRec
(
stuff
->
grabbed_device
);
if
(
dev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_UngrabDeviceKey
,
0
,
...
...
@@ -123,7 +123,7 @@ ProcXUngrabDeviceKey(client)
if
(
stuff
->
modifier_device
!=
UseXKeyboard
)
{
mdev
=
LookupDeviceIntRec
(
stuff
->
modifier_device
);
mdev
=
LookupDeviceIntRec
(
stuff
->
modifier_device
);
if
(
mdev
==
NULL
)
{
SendErrorToClient
(
client
,
IReqCode
,
X_UngrabDeviceKey
,
0
,
...
...
@@ -175,4 +175,4 @@ ProcXUngrabDeviceKey(client)
DeletePassiveGrabFromList
(
&
temporaryGrab
);
return
Success
;
}
}
nx-X11/programs/Xserver/Xi/ungrdevk.h
View file @
41a0ba72
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment