diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-17 19:03:47 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-17 19:03:47 +0000 |
commit | c57959ad6a4c0f5329762f401fd7871ffb2ee90c (patch) | |
tree | f223828f827382311611edf114ddd0c42cb3b23f /Xi | |
parent | 9508a382f8a9f241dab097d921b6d290c1c3a776 (diff) |
merge XFree86 4.3.0.1 to -CURRENT
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/allowev.c | 12 | ||||
-rw-r--r-- | Xi/chgdctl.c | 18 | ||||
-rw-r--r-- | Xi/chgfctl.c | 48 | ||||
-rw-r--r-- | Xi/chgkbd.c | 24 | ||||
-rw-r--r-- | Xi/chgkmap.c | 13 | ||||
-rw-r--r-- | Xi/chgprop.c | 13 | ||||
-rw-r--r-- | Xi/chgptr.c | 30 | ||||
-rw-r--r-- | Xi/closedev.c | 16 | ||||
-rw-r--r-- | Xi/devbell.c | 12 | ||||
-rw-r--r-- | Xi/exevents.c | 253 | ||||
-rw-r--r-- | Xi/extinit.c | 189 | ||||
-rw-r--r-- | Xi/getbmap.c | 11 | ||||
-rw-r--r-- | Xi/getdctl.c | 16 | ||||
-rw-r--r-- | Xi/getfctl.c | 21 | ||||
-rw-r--r-- | Xi/getfocus.c | 10 | ||||
-rw-r--r-- | Xi/getkmap.c | 15 | ||||
-rw-r--r-- | Xi/getmmap.c | 11 | ||||
-rw-r--r-- | Xi/getprop.c | 26 | ||||
-rw-r--r-- | Xi/getselev.c | 23 | ||||
-rw-r--r-- | Xi/getvers.c | 11 | ||||
-rw-r--r-- | Xi/grabdev.c | 15 | ||||
-rw-r--r-- | Xi/grabdevb.c | 13 | ||||
-rw-r--r-- | Xi/grabdevk.c | 13 | ||||
-rw-r--r-- | Xi/gtmotion.c | 15 | ||||
-rw-r--r-- | Xi/listdev.c | 28 | ||||
-rw-r--r-- | Xi/opendev.c | 16 | ||||
-rw-r--r-- | Xi/queryst.c | 15 | ||||
-rw-r--r-- | Xi/selectev.c | 13 | ||||
-rw-r--r-- | Xi/sendexev.c | 20 | ||||
-rw-r--r-- | Xi/setbmap.c | 15 | ||||
-rw-r--r-- | Xi/setdval.c | 13 | ||||
-rw-r--r-- | Xi/setfocus.c | 13 | ||||
-rw-r--r-- | Xi/setmmap.c | 15 | ||||
-rw-r--r-- | Xi/setmode.c | 13 | ||||
-rw-r--r-- | Xi/stubs.c | 18 | ||||
-rw-r--r-- | Xi/ungrdev.c | 9 | ||||
-rw-r--r-- | Xi/ungrdevb.c | 12 | ||||
-rw-r--r-- | Xi/ungrdevk.c | 12 |
38 files changed, 628 insertions, 412 deletions
diff --git a/Xi/allowev.c b/Xi/allowev.c index db98d8c93..2eb463d41 100644 --- a/Xi/allowev.c +++ b/Xi/allowev.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/allowev.c,v 3.4 2001/12/14 19:58:54 dawes Exp $ */ /*********************************************************************** * @@ -60,10 +61,12 @@ SOFTWARE. #include "XI.h" #include "XIproto.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" + +#include "allowev.h" +#include "dixevents.h" /*********************************************************************** * @@ -96,7 +99,6 @@ ProcXAllowDeviceEvents(client) { TimeStamp time; DeviceIntPtr thisdev; - void AllowSome (); REQUEST(xAllowDeviceEventsReq); REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index e5dab66c1..f5988d76b 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/chgdctl.c,v 3.4 2001/12/14 19:58:54 dawes Exp $ */ /******************************************************************** * @@ -59,11 +60,13 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" /* control constants */ +#include "XIstubs.h" -extern int IReqCode; -extern int BadDevice, DeviceBusy; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" + +#include "chgdctl.h" /*********************************************************************** * @@ -91,10 +94,12 @@ SProcXChangeDeviceControl(client) * */ +int ProcXChangeDeviceControl(client) ClientPtr client; { - int i, len, status; + unsigned len; + int i, status; DeviceIntPtr dev; xDeviceResolutionCtl *r; xChangeDeviceControlReply rep; @@ -150,7 +155,7 @@ ProcXChangeDeviceControl(client) BadValue); return Success; } - status = ChangeDeviceControl(client, dev, r); + status = ChangeDeviceControl(client, dev, (xDeviceCtl*) r); if (status == Success) { a = &dev->valuator->axes[r->first_valuator]; @@ -195,6 +200,7 @@ ProcXChangeDeviceControl(client) * */ +void SRepXChangeDeviceControl (client, size, rep) ClientPtr client; int size; diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c index 0b945de23..213fc7bf5 100644 --- a/Xi/chgfctl.c +++ b/Xi/chgfctl.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/chgfctl.c,v 3.4 2001/12/14 19:58:54 dawes Exp $ */ /******************************************************************** * @@ -60,11 +61,13 @@ SOFTWARE. #include "XI.h" #include "XIproto.h" /* control constants */ -#define DO_ALL (-1) +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" + +#include "chgfctl.h" -extern int IReqCode; -extern int BadDevice; -DeviceIntPtr LookupDeviceIntRec(); +#define DO_ALL (-1) /*********************************************************************** * @@ -92,10 +95,11 @@ SProcXChangeFeedbackControl(client) * */ +int ProcXChangeFeedbackControl(client) ClientPtr client; { - int len; + unsigned len; DeviceIntPtr dev; KbdFeedbackPtr k; PtrFeedbackPtr p; @@ -128,7 +132,7 @@ ProcXChangeFeedbackControl(client) for (k=dev->kbdfeed; k; k=k->next) if (k->ctrl.id == ((xKbdFeedbackCtl *) &stuff[1])->id) { - ChangeKbdFeedback (client, dev, stuff->mask, k, &stuff[1]); + ChangeKbdFeedback (client, dev, stuff->mask, k, (xKbdFeedbackCtl *)&stuff[1]); return Success; } break; @@ -142,7 +146,7 @@ ProcXChangeFeedbackControl(client) for (p=dev->ptrfeed; p; p=p->next) if (p->ctrl.id == ((xPtrFeedbackCtl *) &stuff[1])->id) { - ChangePtrFeedback (client, dev, stuff->mask, p, &stuff[1]); + ChangePtrFeedback (client, dev, stuff->mask, p, (xPtrFeedbackCtl *)&stuff[1]); return Success; } break; @@ -163,7 +167,7 @@ ProcXChangeFeedbackControl(client) for (s=dev->stringfeed; s; s=s->next) if (s->ctrl.id == ((xStringFeedbackCtl *) &stuff[1])->id) { - ChangeStringFeedback (client, dev, stuff->mask,s,&stuff[1]); + ChangeStringFeedback (client, dev, stuff->mask,s,(xStringFeedbackCtl *)&stuff[1]); return Success; } break; @@ -178,7 +182,7 @@ ProcXChangeFeedbackControl(client) for (i=dev->intfeed; i; i=i->next) if (i->ctrl.id == ((xIntegerFeedbackCtl *) &stuff[1])->id) { - ChangeIntegerFeedback (client, dev,stuff->mask,i,&stuff[1]); + ChangeIntegerFeedback (client, dev,stuff->mask,i,(xIntegerFeedbackCtl *)&stuff[1]); return Success; } break; @@ -192,7 +196,7 @@ ProcXChangeFeedbackControl(client) for (l=dev->leds; l; l=l->next) if (l->ctrl.id == ((xLedFeedbackCtl *) &stuff[1])->id) { - ChangeLedFeedback (client, dev, stuff->mask, l, &stuff[1]); + ChangeLedFeedback (client, dev, stuff->mask, l, (xLedFeedbackCtl *)&stuff[1]); return Success; } break; @@ -206,7 +210,7 @@ ProcXChangeFeedbackControl(client) for (b=dev->bell; b; b=b->next) if (b->ctrl.id == ((xBellFeedbackCtl *) &stuff[1])->id) { - ChangeBellFeedback (client, dev, stuff->mask, b, &stuff[1]); + ChangeBellFeedback (client, dev, stuff->mask, b, (xBellFeedbackCtl *)&stuff[1]); return Success; } break; @@ -224,6 +228,7 @@ ProcXChangeFeedbackControl(client) * */ +int ChangeKbdFeedback (client, dev, mask, k, f) ClientPtr client; DeviceIntPtr dev; @@ -332,7 +337,7 @@ ChangeKbdFeedback (client, dev, mask, k, f) if (mask & DvAutoRepeatMode) { - int index = (key >> 3); + int inx = (key >> 3); int kmask = (1 << (key & 7)); t = (CARD8) f->auto_repeat_mode; if (t == AutoRepeatModeOff) @@ -340,24 +345,24 @@ ChangeKbdFeedback (client, dev, mask, k, f) if (key == DO_ALL) kctrl.autoRepeat = FALSE; else - kctrl.autoRepeats[index] &= ~kmask; + kctrl.autoRepeats[inx] &= ~kmask; } else if (t == AutoRepeatModeOn) { if (key == DO_ALL) kctrl.autoRepeat = TRUE; else - kctrl.autoRepeats[index] |= kmask; + kctrl.autoRepeats[inx] |= kmask; } else if (t == AutoRepeatModeDefault) { if (key == DO_ALL) kctrl.autoRepeat = defaultKeyboardControl.autoRepeat; else - kctrl.autoRepeats[index] &= ~kmask; - kctrl.autoRepeats[index] = - (kctrl.autoRepeats[index] & ~kmask) | - (defaultKeyboardControl.autoRepeats[index] & kmask); + kctrl.autoRepeats[inx] &= ~kmask; + kctrl.autoRepeats[inx] = + (kctrl.autoRepeats[inx] & ~kmask) | + (defaultKeyboardControl.autoRepeats[inx] & kmask); } else { @@ -379,6 +384,7 @@ ChangeKbdFeedback (client, dev, mask, k, f) * */ +int ChangePtrFeedback (client, dev, mask, p, f) ClientPtr client; DeviceIntPtr dev; @@ -460,6 +466,7 @@ ChangePtrFeedback (client, dev, mask, p, f) * */ +int ChangeIntegerFeedback (client, dev, mask, i, f) ClientPtr client; DeviceIntPtr dev; @@ -486,6 +493,7 @@ ChangeIntegerFeedback (client, dev, mask, i, f) * */ +int ChangeStringFeedback (client, dev, mask, s, f) ClientPtr client; DeviceIntPtr dev; @@ -495,7 +503,7 @@ ChangeStringFeedback (client, dev, mask, s, f) { register char n; register long *p; - int i, j, len; + int i, j; KeySym *syms, *sup_syms; syms = (KeySym *) (f+1); @@ -543,6 +551,7 @@ ChangeStringFeedback (client, dev, mask, s, f) * */ +int ChangeBellFeedback (client, dev, mask, b, f) ClientPtr client; DeviceIntPtr dev; @@ -617,6 +626,7 @@ ChangeBellFeedback (client, dev, mask, b, f) * */ +int ChangeLedFeedback (client, dev, mask, l, f) ClientPtr client; DeviceIntPtr dev; diff --git a/Xi/chgkbd.c b/Xi/chgkbd.c index f48b4682b..b0b82ee6d 100644 --- a/Xi/chgkbd.c +++ b/Xi/chgkbd.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/chgkbd.c,v 3.6 2001/12/14 19:58:54 dawes Exp $ */ /*********************************************************************** * @@ -59,14 +60,16 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "XIstubs.h" +#include "globals.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ -extern int IReqCode; -extern int BadDevice; -extern int ChangeDeviceNotify; -extern Mask ChangeDeviceNotifyMask; -extern InputInfo inputInfo; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "exevents.h" +#include "exglobals.h" + +#include "chgkbd.h" +#include "chgptr.h" /*********************************************************************** * @@ -93,6 +96,7 @@ SProcXChangeKeyboardDevice(client) * */ +int ProcXChangeKeyboardDevice (client) register ClientPtr client; { @@ -104,7 +108,6 @@ ProcXChangeKeyboardDevice (client) KeyClassPtr k; xChangeKeyboardDeviceReply rep; changeDeviceNotify ev; - extern Bool Must_have_memory; REQUEST(xChangeKeyboardDeviceReq); REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq); @@ -169,14 +172,14 @@ ProcXChangeKeyboardDevice (client) for (i=0; i<df->traceSize; i++) df->trace[i] = xf->trace[i]; RegisterOtherDevice (xkbd); - RegisterKeyboardDevice ((DevicePtr)dev); + RegisterKeyboardDevice (dev); ev.type = ChangeDeviceNotify; ev.deviceid = stuff->deviceid; ev.time = currentTime.milliseconds; ev.request = NewKeyboard; - SendEventToAllWindows (dev, ChangeDeviceNotifyMask, &ev, 1); + SendEventToAllWindows (dev, ChangeDeviceNotifyMask, (xEvent *)&ev, 1); SendMappingNotify (MappingKeyboard, k->curKeySyms.minKeyCode, k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode + 1,client); @@ -195,6 +198,7 @@ ProcXChangeKeyboardDevice (client) * */ +void SRepXChangeKeyboardDevice (client, size, rep) ClientPtr client; int size; diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c index 3e70f2dcf..2b638252f 100644 --- a/Xi/chgkmap.c +++ b/Xi/chgkmap.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/chgkmap.c,v 3.3 2001/12/14 19:58:55 dawes Exp $ */ /******************************************************************** * @@ -59,11 +60,12 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exevents.h" +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern int DeviceMappingNotify; -DeviceIntPtr LookupDeviceIntRec(); +#include "chgkmap.h" /*********************************************************************** * @@ -99,6 +101,7 @@ SProcXChangeDeviceKeyMapping(client) * */ +int ProcXChangeDeviceKeyMapping(client) register ClientPtr client; { @@ -120,7 +123,7 @@ ProcXChangeDeviceKeyMapping(client) ret = ChangeKeyMapping (client, dev, len, DeviceMappingNotify, stuff->firstKeyCode, stuff->keyCodes, stuff->keySymsPerKeyCode, - &stuff[1]); + (KeySym *)&stuff[1]); if (ret != Success) SendErrorToClient (client, IReqCode, X_ChangeDeviceKeyMapping, 0, diff --git a/Xi/chgprop.c b/Xi/chgprop.c index 769bcbbb9..96ce0bebe 100644 --- a/Xi/chgprop.c +++ b/Xi/chgprop.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/chgprop.c,v 3.3 2001/12/14 19:58:55 dawes Exp $ */ /*********************************************************************** * @@ -60,11 +61,14 @@ SOFTWARE. #include "windowstr.h" #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ -extern int BadMode; -extern int BadClass; -extern int IReqCode; -DeviceIntPtr LookupDeviceIntRec(); +#include "exevents.h" +#include "exglobals.h" + +#include "chgprop.h" +#include "grabdev.h" /*********************************************************************** * @@ -100,6 +104,7 @@ SProcXChangeDeviceDontPropagateList(client) * */ +int ProcXChangeDeviceDontPropagateList (client) register ClientPtr client; { diff --git a/Xi/chgptr.c b/Xi/chgptr.c index 8c65c6ec2..c6ece1d65 100644 --- a/Xi/chgptr.c +++ b/Xi/chgptr.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/chgptr.c,v 3.7 2001/12/14 19:58:55 dawes Exp $ */ /*********************************************************************** * @@ -56,21 +57,21 @@ SOFTWARE. #define NEED_REPLIES #include "X.h" /* for inputstr.h */ #include "Xproto.h" /* Request macro */ +#include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" -#include "inputstr.h" /* DeviceIntPtr */ +#include "XIstubs.h" #include "windowstr.h" /* window structure */ #include "scrnintstr.h" /* screen structure */ -extern int IReqCode; -extern int BadDevice; -extern int ChangeDeviceNotify; -extern Mask ChangeDeviceNotifyMask; -extern InputInfo inputInfo; -extern ScreenInfo screenInfo; -extern WindowPtr *WindowTable; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ + +#include "dixevents.h" +#include "exevents.h" +#include "exglobals.h" + +#include "chgptr.h" /*********************************************************************** * @@ -97,6 +98,7 @@ SProcXChangePointerDevice(client) * */ +int ProcXChangePointerDevice (client) register ClientPtr client; { @@ -157,14 +159,14 @@ ProcXChangePointerDevice (client) if (!dev->ptrfeed) InitPtrFeedbackClassDeviceStruct(dev, (PtrCtrlProcPtr)NoopDDA); RegisterOtherDevice (xptr); - RegisterPointerDevice ((DevicePtr)dev); + RegisterPointerDevice (dev); ev.type = ChangeDeviceNotify; ev.deviceid = stuff->deviceid; ev.time = currentTime.milliseconds; ev.request = NewPointer; - SendEventToAllWindows (dev, ChangeDeviceNotifyMask, &ev, 1); + SendEventToAllWindows (dev, ChangeDeviceNotifyMask, (xEvent *)&ev, 1); SendMappingNotify (MappingPointer, 0, 0, client); rep.status = 0; @@ -175,6 +177,7 @@ ProcXChangePointerDevice (client) return Success; } +void DeleteFocusClassDeviceStruct(dev) DeviceIntPtr dev; { @@ -189,6 +192,7 @@ DeleteFocusClassDeviceStruct(dev) * */ +void SendEventToAllWindows (dev, mask, ev, count) DeviceIntPtr dev; Mask mask; @@ -214,6 +218,7 @@ SendEventToAllWindows (dev, mask, ev, count) * */ +void FindInterestedChildren (dev, p1, mask, ev, count) DeviceIntPtr dev; WindowPtr p1; @@ -239,6 +244,7 @@ FindInterestedChildren (dev, p1, mask, ev, count) * */ +void SRepXChangePointerDevice (client, size, rep) ClientPtr client; int size; diff --git a/Xi/closedev.c b/Xi/closedev.c index 66fb185cb..1f7e7dbd2 100644 --- a/Xi/closedev.c +++ b/Xi/closedev.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/closedev.c,v 3.4 2001/12/14 19:58:55 dawes Exp $ */ /*********************************************************************** * @@ -61,13 +62,12 @@ SOFTWARE. #include "scrnintstr.h" /* screen structure */ #include "XI.h" #include "XIproto.h" +#include "XIstubs.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern ScreenInfo screenInfo; -extern WindowPtr *WindowTable; -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "closedev.h" /*********************************************************************** * @@ -137,6 +137,7 @@ ProcXCloseDevice(client) * */ +void DeleteEventsFromChildren(dev, p1, client) DeviceIntPtr dev; WindowPtr p1; @@ -160,6 +161,7 @@ DeleteEventsFromChildren(dev, p1, client) * */ +void DeleteDeviceEvents (dev, pWin, client) DeviceIntPtr dev; WindowPtr pWin; @@ -169,7 +171,7 @@ DeleteDeviceEvents (dev, pWin, client) OtherInputMasks *pOthers; GrabPtr grab, next; - if (pOthers=wOtherInputMasks(pWin)) + if ((pOthers = wOtherInputMasks(pWin)) != 0) for (others=pOthers->inputClients; others; others = others->next) if (SameClient(others,client)) diff --git a/Xi/devbell.c b/Xi/devbell.c index 60e58e147..98520ec1c 100644 --- a/Xi/devbell.c +++ b/Xi/devbell.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/devbell.c,v 3.3 2001/12/14 19:58:55 dawes Exp $ */ /*********************************************************************** * @@ -59,11 +60,11 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "devbell.h" /*********************************************************************** * @@ -89,6 +90,7 @@ SProcXDeviceBell(client) * */ +int ProcXDeviceBell (client) register ClientPtr client; { @@ -99,7 +101,7 @@ ProcXDeviceBell (client) int newpercent; CARD8 class; pointer ctrl; - void (*proc)(); + BellProcPtr proc; REQUEST(xDeviceBellReq); REQUEST_SIZE_MATCH(xDeviceBellReq); diff --git a/Xi/exevents.c b/Xi/exevents.c index 7131b3c7a..76a693e6c 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -44,6 +44,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/exevents.c,v 3.10 2001/12/14 19:58:55 dawes Exp $ */ /******************************************************************** * @@ -62,6 +63,14 @@ SOFTWARE. #include "windowstr.h" #include "miscstruct.h" #include "region.h" +#include "exevents.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" +#include "dixevents.h" /* DeliverFocusedEvent */ +#include "dixgrabs.h" /* CreateGrab() */ + +#include "chgptr.h" #define WID(w) ((w) ? ((w)->drawable.id) : 0) #define AllModifiersMask ( \ @@ -72,24 +81,17 @@ SOFTWARE. #define Motion_Filter(class) (DevicePointerMotionMask | \ (class)->state | (class)->motionMask) -void ActivateKeyboardGrab(); -void DeactivateKeyboardGrab(); -void ProcessOtherEvent(); -void RecalculateDeviceDeliverableEvents(); -static Bool ShouldFreeInputMasks(); -static Bool MakeInputMasks (); -extern int DeviceKeyPress; -extern int DeviceButtonPress; -extern int DeviceValuator; -extern Mask DevicePointerMotionMask; -extern Mask DeviceMappingNotifyMask; -extern Mask DeviceButtonMotionMask; -extern Mask DeviceButtonGrabMask; -extern Mask DeviceOwnerGrabButtonMask; -extern Mask PropagateMask[]; -extern WindowPtr GetSpriteWindow(); -extern InputInfo inputInfo; -extern int RT_INPUTCLIENT; +static Bool ShouldFreeInputMasks( +#if NeedFunctionPrototypes + WindowPtr /* pWin */, + Bool /* ignoreSelectedEvents */ +#endif + ); +static Bool MakeInputMasks ( +#if NeedFunctionPrototypes + WindowPtr /* pWin */ +#endif + ); /************************************************************************** * @@ -99,47 +101,40 @@ extern int RT_INPUTCLIENT; void RegisterOtherDevice (device) - DevicePtr device; + DeviceIntPtr device; { - device->processInputProc = ProcessOtherEvent; - device->realInputProc = ProcessOtherEvent; - ((DeviceIntPtr)device)->ActivateGrab = ActivateKeyboardGrab; - ((DeviceIntPtr)device)->DeactivateGrab = DeactivateKeyboardGrab; + device->public.processInputProc = ProcessOtherEvent; + device->public.realInputProc = ProcessOtherEvent; + (device)->ActivateGrab = ActivateKeyboardGrab; + (device)->DeactivateGrab = DeactivateKeyboardGrab; } -extern int DeviceMotionNotify; - /*ARGSUSED*/ void ProcessOtherEvent (xE, other, count) - deviceKeyButtonPointer *xE; + xEventPtr xE; register DeviceIntPtr other; int count; { - extern int DeviceKeyRelease; - extern int DeviceButtonRelease; - extern int ProximityIn; - extern int ProximityOut; register BYTE *kptr; register int i; register CARD16 modifiers; register CARD16 mask; GrabPtr grab = other->grab; Bool deactivateDeviceGrab = FALSE; - int key, bit, rootX, rootY; + int key = 0, bit = 0, rootX, rootY; ButtonClassPtr b = other->button; KeyClassPtr k = other->key; ValuatorClassPtr v = other->valuator; - void NoticeEventTime(); deviceValuator *xV = (deviceValuator *) xE; - if (xE->type != DeviceValuator) { + if (xE->u.u.type != DeviceValuator) { GetSpritePosition(&rootX, &rootY); - xE->root_x = rootX; - xE->root_y = rootY; - key = xE->detail; + xE->u.keyButtonPointer.rootX = rootX; + xE->u.keyButtonPointer.rootY = rootY; + key = xE->u.u.detail; NoticeEventTime(xE); - xE->state = inputInfo.keyboard->key->state | + xE->u.keyButtonPointer.state = inputInfo.keyboard->key->state | inputInfo.pointer->button->state; bit = 1 << (key & 7); } @@ -186,7 +181,7 @@ ProcessOtherEvent (xE, other, count) } } - if (xE->type == DeviceKeyPress) + if (xE->u.u.type == DeviceKeyPress) { modifiers = k->modifierMap[key]; kptr = &k->down[key >> 3]; @@ -194,9 +189,9 @@ ProcessOtherEvent (xE, other, count) { if (!modifiers) { - xE->type = DeviceKeyRelease; + xE->u.u.type = DeviceKeyRelease; ProcessOtherEvent(xE, other, count); - xE->type = DeviceKeyPress; + xE->u.u.type = DeviceKeyPress; /* release can have side effects, don't fall through */ ProcessOtherEvent(xE, other, count); } @@ -222,7 +217,7 @@ ProcessOtherEvent (xE, other, count) return; } } - else if (xE->type == DeviceKeyRelease) + else if (xE->u.u.type == DeviceKeyRelease) { kptr = &k->down[key >> 3]; if (!(*kptr & bit)) /* guard against duplicates */ @@ -249,7 +244,7 @@ ProcessOtherEvent (xE, other, count) if (other->fromPassiveGrab && (key == other->activatingKey)) deactivateDeviceGrab = TRUE; } - else if (xE->type == DeviceButtonPress) + else if (xE->u.u.type == DeviceButtonPress) { kptr = &b->down[key >> 3]; *kptr |= bit; @@ -257,18 +252,18 @@ ProcessOtherEvent (xE, other, count) other->valuator->motionHintWindow = NullWindow; b->buttonsDown++; b->motionMask = DeviceButtonMotionMask; - xE->detail = b->map[key]; - if (xE->detail == 0) + xE->u.u.detail = b->map[key]; + if (xE->u.u.detail == 0) return; - if (xE->detail <= 5) - b->state |= (Button1Mask >> 1) << xE->detail; + if (xE->u.u.detail <= 5) + b->state |= (Button1Mask >> 1) << xE->u.u.detail; SetMaskForEvent(Motion_Filter(b),DeviceMotionNotify); if (!grab) if (CheckDeviceGrabs(other, xE, 0, count)) return; } - else if (xE->type == DeviceButtonRelease) + else if (xE->u.u.type == DeviceButtonRelease) { kptr = &b->down[key >> 3]; *kptr &= ~bit; @@ -276,18 +271,18 @@ ProcessOtherEvent (xE, other, count) other->valuator->motionHintWindow = NullWindow; if (!--b->buttonsDown) b->motionMask = 0; - xE->detail = b->map[key]; - if (xE->detail == 0) + xE->u.u.detail = b->map[key]; + if (xE->u.u.detail == 0) return; - if (xE->detail <= 5) - b->state &= ~((Button1Mask >> 1) << xE->detail); + if (xE->u.u.detail <= 5) + b->state &= ~((Button1Mask >> 1) << xE->u.u.detail); SetMaskForEvent(Motion_Filter(b),DeviceMotionNotify); if (!b->state && other->fromPassiveGrab) deactivateDeviceGrab = TRUE; } - else if (xE->type == ProximityIn) + else if (xE->u.u.type == ProximityIn) other->valuator->mode &= ~OutOfProximity; - else if (xE->type == ProximityOut) + else if (xE->u.u.type == ProximityOut) other->valuator->mode |= OutOfProximity; if (grab) @@ -302,9 +297,9 @@ ProcessOtherEvent (xE, other, count) (*other->DeactivateGrab)(other); } -InitProximityClassDeviceStruct(dev) - DeviceIntPtr dev; - { +int +InitProximityClassDeviceStruct( DeviceIntPtr dev) +{ register ProximityClassPtr proxc; proxc = (ProximityClassPtr)xalloc(sizeof(ProximityClassRec)); @@ -312,15 +307,17 @@ InitProximityClassDeviceStruct(dev) return FALSE; dev->proximity = proxc; return TRUE; - } +} -InitValuatorAxisStruct(dev, axnum, minval, maxval, resolution, min_res, max_res) - DeviceIntPtr dev; - int axnum; - int minval; - int maxval; - int resolution; - { +void +InitValuatorAxisStruct( DeviceIntPtr dev, + int axnum, + int minval, + int maxval, + int resolution, + int min_res, + int max_res ) +{ register AxisInfoPtr ax = dev->valuator->axes + axnum; ax->min_value = minval; @@ -328,18 +325,27 @@ InitValuatorAxisStruct(dev, axnum, minval, maxval, resolution, min_res, max_res) ax->resolution = resolution; ax->min_resolution = min_res; ax->max_resolution = max_res; - } +} -static void FixDeviceStateNotify (dev, ev, k, b, v, first) +static void +#if NeedFunctionPrototypes +FixDeviceStateNotify ( + DeviceIntPtr dev, + deviceStateNotify *ev, + KeyClassPtr k, + ButtonClassPtr b, + ValuatorClassPtr v, + int first) +#else +FixDeviceStateNotify (dev, ev, k, b, v, first) DeviceIntPtr dev; deviceStateNotify *ev; KeyClassPtr k; ButtonClassPtr b; ValuatorClassPtr v; int first; - { - extern int DeviceStateNotify; - +#endif +{ ev->type = DeviceStateNotify; ev->deviceid = dev->id; ev->time = currentTime.milliseconds; @@ -376,12 +382,21 @@ static void FixDeviceStateNotify (dev, ev, k, b, v, first) } } -static void FixDeviceValuator (dev, ev, v, first) +static void +#if NeedFunctionPrototypes +FixDeviceValuator ( + DeviceIntPtr dev, + deviceValuator *ev, + ValuatorClassPtr v, + int first) +#else +FixDeviceValuator (dev, ev, v, first) DeviceIntPtr dev; deviceValuator *ev; ValuatorClassPtr v; int first; - { +#endif +{ int nval = v->numAxes - first; ev->type = DeviceValuator; @@ -400,18 +415,12 @@ static void FixDeviceValuator (dev, ev, v, first) first += ev->num_valuators; } +void DeviceFocusEvent(dev, type, mode, detail, pWin) DeviceIntPtr dev; int type, mode, detail; register WindowPtr pWin; { - extern int DeviceFocusIn; - extern int DeviceFocusOut; - extern int DeviceKeyStateNotify; - extern int DeviceButtonStateNotify; - extern int DeviceValuatorStateNotify; - extern Mask DeviceStateNotifyMask; - extern Mask DeviceFocusChangeMask; deviceFocus event; if (type == FocusIn) @@ -426,15 +435,13 @@ DeviceFocusEvent(dev, type, mode, detail, pWin) event.window = pWin->drawable.id; event.time = currentTime.milliseconds; - (void) - DeliverEventsToWindow(pWin, &event, 1, DeviceFocusChangeMask, NullGrab, - dev->id); + (void) DeliverEventsToWindow(pWin, (xEvent *)&event, 1, + DeviceFocusChangeMask, NullGrab, dev->id); if ((type == DeviceFocusIn) && (wOtherInputMasks(pWin)) && (wOtherInputMasks(pWin)->inputEvents[dev->id] & DeviceStateNotifyMask)) { - int i,j; int evcount = 1; deviceStateNotify *ev, *sev; deviceKeyStateNotify *kev; @@ -518,19 +525,34 @@ DeviceFocusEvent(dev, type, mode, detail, pWin) nval -= 3; if (nval > 0) { (ev-1)->deviceid |= MORE_EVENTS; - FixDeviceValuator (dev, ev++, v, first); + FixDeviceValuator (dev, (deviceValuator *) ev++, v, first); first += 3; nval -= 3; } } - (void) DeliverEventsToWindow(pWin, sev, evcount, DeviceStateNotifyMask, - NullGrab, dev->id); + (void) DeliverEventsToWindow(pWin, (xEvent *)sev, evcount, + DeviceStateNotifyMask, NullGrab, dev->id); xfree (sev); } } int +#if NeedFunctionPrototypes +GrabButton( + ClientPtr client, + DeviceIntPtr dev, + BYTE this_device_mode, + BYTE other_devices_mode, + CARD16 modifiers, + DeviceIntPtr modifier_device, + CARD8 button, + Window grabWindow, + BOOL ownerEvents, + Cursor rcursor, + Window rconfineTo, + Mask eventMask) +#else GrabButton(client, dev, this_device_mode, other_devices_mode, modifiers, modifier_device, button, grabWindow, ownerEvents, rcursor, rconfineTo, eventMask) @@ -546,11 +568,10 @@ GrabButton(client, dev, this_device_mode, other_devices_mode, modifiers, Cursor rcursor; Window rconfineTo; Mask eventMask; - +#endif { WindowPtr pWin, confineTo; CursorPtr cursor; - GrabPtr CreateGrab(); GrabPtr grab; if ((this_device_mode != GrabModeSync) && @@ -609,6 +630,19 @@ GrabButton(client, dev, this_device_mode, other_devices_mode, modifiers, } int +#if NeedFunctionPrototypes +GrabKey( + ClientPtr client, + DeviceIntPtr dev, + BYTE this_device_mode, + BYTE other_devices_mode, + CARD16 modifiers, + DeviceIntPtr modifier_device, + CARD8 key, + Window grabWindow, + BOOL ownerEvents, + Mask mask) +#else GrabKey(client, dev, this_device_mode, other_devices_mode, modifiers, modifier_device, key, grabWindow, ownerEvents, mask) ClientPtr client; @@ -621,10 +655,9 @@ GrabKey(client, dev, this_device_mode, other_devices_mode, modifiers, Window grabWindow; BOOL ownerEvents; Mask mask; - +#endif { WindowPtr pWin; - GrabPtr CreateGrab(); GrabPtr grab; KeyClassPtr k = dev->key; @@ -673,8 +706,6 @@ GrabKey(client, dev, this_device_mode, other_devices_mode, modifiers, return AddPassiveGrabToList(grab); } -extern Mask DevicePointerMotionHintMask; - int SelectForWindow(dev, pWin, client, mask, exclusivemasks, validmasks) DeviceIntPtr dev; @@ -803,7 +834,7 @@ RecalculateDeviceDeliverableEvents(pWin) pChild = pWin; while (1) { - if (inputMasks = wOtherInputMasks(pChild)) + if ((inputMasks = wOtherInputMasks(pChild)) != 0) { for (others = inputMasks->inputClients; others; others = others->next) @@ -892,10 +923,10 @@ SendEvent (client, d, dest, propagate, ev, mask, count) Bool propagate; xEvent *ev; Mask mask; + int count; { WindowPtr pWin; WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ - WindowPtr GetCurrentRootWindow(); WindowPtr spriteWin=GetSpriteWindow(); if (dest == PointerWindow) @@ -996,7 +1027,7 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k) KeyCode *inputMap; KeyClassPtr *k; { - KeyCode *map; + KeyCode *map = NULL; int inputMapLen; register int i; @@ -1070,15 +1101,22 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k) return(MappingSuccess); } -int +void +#if NeedFunctionPrototypes +SendDeviceMappingNotify( + CARD8 request, + KeyCode firstKeyCode, + CARD8 count, + DeviceIntPtr dev) +#else SendDeviceMappingNotify(request, firstKeyCode, count, dev) CARD8 request, count; KeyCode firstKeyCode; DeviceIntPtr dev; - { +#endif +{ xEvent event; deviceMappingNotify *ev = (deviceMappingNotify *) &event; - extern int DeviceMappingNotify; ev->type = DeviceMappingNotify; ev->request = request; @@ -1090,10 +1128,21 @@ SendDeviceMappingNotify(request, firstKeyCode, count, dev) ev->count = count; } - SendEventToAllWindows (dev, DeviceMappingNotifyMask, ev, 1); + SendEventToAllWindows (dev, DeviceMappingNotifyMask, (xEvent *)ev, 1); } int +#if NeedFunctionPrototypes +ChangeKeyMapping( + ClientPtr client, + DeviceIntPtr dev, + unsigned len, + int type, + KeyCode firstKeyCode, + CARD8 keyCodes, + CARD8 keySymsPerKeyCode, + KeySym *map) +#else ChangeKeyMapping(client, dev, len, type, firstKeyCode, keyCodes, keySymsPerKeyCode, map) ClientPtr client; @@ -1104,6 +1153,7 @@ ChangeKeyMapping(client, dev, len, type, firstKeyCode, keyCodes, CARD8 keyCodes; CARD8 keySymsPerKeyCode; KeySym *map; +#endif { KeySymsRec keysyms; KeyClassPtr k = dev->key; @@ -1158,7 +1208,7 @@ DeleteWindowFromAnyExtEvents(pWin, freeResources) DeleteDeviceFromAnyExtEvents(pWin, dev); if (freeResources) - while (inputMasks = wOtherInputMasks(pWin)) + while ((inputMasks = wOtherInputMasks(pWin)) != 0) { ic = inputMasks->inputClients; for (i=0; i<EMASKSIZE; i++) @@ -1167,6 +1217,7 @@ DeleteWindowFromAnyExtEvents(pWin, freeResources) } } +void DeleteDeviceFromAnyExtEvents(pWin, dev) WindowPtr pWin; DeviceIntPtr dev; @@ -1241,7 +1292,6 @@ MaybeSendDeviceMotionNotifyHint (pEvents, mask) Mask mask; { DeviceIntPtr dev; - DeviceIntPtr LookupDeviceIntRec (); dev = LookupDeviceIntRec (pEvents->deviceid & DEVICE_BITS); if (pEvents->type == DeviceMotionNotify) @@ -1262,7 +1312,7 @@ MaybeSendDeviceMotionNotifyHint (pEvents, mask) return (0); } -int +void CheckDeviceGrabAndHintWindow (pWin, type, xE, grab, client, deliveryMask) WindowPtr pWin; int type; @@ -1272,7 +1322,6 @@ CheckDeviceGrabAndHintWindow (pWin, type, xE, grab, client, deliveryMask) Mask deliveryMask; { DeviceIntPtr dev; - DeviceIntPtr LookupDeviceIntRec (); dev = LookupDeviceIntRec (xE->deviceid & DEVICE_BITS); if (type == DeviceMotionNotify) diff --git a/Xi/extinit.c b/Xi/extinit.c index 37148ebd2..ce5d96c8a 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/extinit.c,v 3.6 2001/12/14 19:58:55 dawes Exp $ */ /******************************************************************** * @@ -55,6 +56,7 @@ SOFTWARE. #define NUMTYPES 15 #define NEED_EVENTS +#define NEED_REPLIES #include "X.h" #include "Xproto.h" #include "inputstr.h" @@ -63,6 +65,51 @@ SOFTWARE. #include "XI.h" #include "XIproto.h" +#include "dixevents.h" +#include "exevents.h" +#include "extinit.h" +#include "exglobals.h" +#include "swaprep.h" + +/* modules local to Xi */ +#include "allowev.h" +#include "chgdctl.h" +#include "chgfctl.h" +#include "chgkbd.h" +#include "chgprop.h" +#include "chgptr.h" +#include "closedev.h" +#include "devbell.h" +#include "getbmap.h" +#include "getbmap.h" +#include "getdctl.h" +#include "getfctl.h" +#include "getfocus.h" +#include "getkmap.h" +#include "getmmap.h" +#include "getprop.h" +#include "getselev.h" +#include "getvers.h" +#include "getvers.h" +#include "grabdev.h" +#include "grabdevb.h" +#include "grabdevk.h" +#include "gtmotion.h" +#include "listdev.h" +#include "opendev.h" +#include "queryst.h" +#include "selectev.h" +#include "sendexev.h" +#include "chgkmap.h" +#include "setbmap.h" +#include "setdval.h" +#include "setfocus.h" +#include "setmmap.h" +#include "setmode.h" +#include "ungrdev.h" +#include "ungrdevb.h" +#include "ungrdevk.h" + static Mask lastExtEventMask = 1; int ExtEventIndex; Mask ExtValidMasks[EMASKSIZE]; @@ -141,10 +188,8 @@ int RT_INPUTCLIENT; * */ -extern void (* ReplySwapVector[256]) (); -extern void (* EventSwapVector[128]) (); extern XExtensionVersion AllExtensionVersions[]; -extern InputInfo inputInfo; + Mask PropagateMask[MAX_DEVICES]; /***************************************************************** @@ -153,12 +198,6 @@ Mask PropagateMask[MAX_DEVICES]; * */ -int ProcIDispatch(); -int SProcIDispatch(); -void SReplyIDispatch(); -void IResetProc(); -void SEventIDispatch(); -void NotImplemented(); static XExtensionVersion thisversion = {XI_Present, XI_Add_XChangeDeviceControl_Major, @@ -177,10 +216,8 @@ static XExtensionVersion thisversion = void XInputExtensionInit() - { - ExtensionEntry *extEntry, *AddExtension(); - int XShutDownDevice(); - int InputClientGone(); +{ + ExtensionEntry *extEntry; extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch, SProcIDispatch, IResetProc, StandardMinorOpcode); @@ -189,9 +226,9 @@ XInputExtensionInit() IReqCode = extEntry->base; AllExtensionVersions[IReqCode-128] = thisversion; MakeDeviceTypeAtoms (); - RT_INPUTCLIENT = CreateNewResourceType(InputClientGone); + RT_INPUTCLIENT = CreateNewResourceType((DeleteType)InputClientGone); FixExtensionEvents (extEntry); - ReplySwapVector[IReqCode] = SReplyIDispatch; + ReplySwapVector[IReqCode] = (ReplySwapPtr)SReplyIDispatch; EventSwapVector[DeviceValuator] = SEventIDispatch; EventSwapVector[DeviceKeyPress] = SEventIDispatch; EventSwapVector[DeviceKeyRelease] = SEventIDispatch; @@ -224,7 +261,7 @@ XInputExtensionInit() int ProcIDispatch (client) register ClientPtr client; - { +{ REQUEST(xReq); if (stuff->data == X_GetExtensionVersion) return(ProcXGetExtensionVersion(client)); @@ -315,7 +352,7 @@ ProcIDispatch (client) int SProcIDispatch(client) register ClientPtr client; - { +{ REQUEST(xReq); if (stuff->data == X_GetExtensionVersion) return(SProcXGetExtensionVersion(client)); @@ -401,54 +438,59 @@ SProcIDispatch(client) * */ +/* FIXME: this would be more concise and readable in ANSI C */ +#define DISPATCH(code) \ + if (rep->RepType == X_##code) \ + SRepX##code (client, len, (x##code##Reply *) rep) + void SReplyIDispatch (client, len, rep) ClientPtr client; int len; xGrabDeviceReply *rep; /* All we look at is the type field */ - { /* This is common to all replies */ +{ /* This is common to all replies */ if (rep->RepType == X_GetExtensionVersion) - SRepXGetExtensionVersion (client, len, rep); + SRepXGetExtensionVersion (client, len, (xGetExtensionVersionReply *)rep); else if (rep->RepType == X_ListInputDevices) - SRepXListInputDevices (client, len, rep); + SRepXListInputDevices (client, len, (xListInputDevicesReply *)rep); else if (rep->RepType == X_OpenDevice) - SRepXOpenDevice (client, len, rep); + SRepXOpenDevice (client, len, (xOpenDeviceReply *)rep); else if (rep->RepType == X_SetDeviceMode) - SRepXSetDeviceMode (client, len, rep); + SRepXSetDeviceMode (client, len, (xSetDeviceModeReply *) rep); else if (rep->RepType == X_GetSelectedExtensionEvents) - SRepXGetSelectedExtensionEvents (client, len, rep); + SRepXGetSelectedExtensionEvents (client, len, (xGetSelectedExtensionEventsReply *) rep); else if (rep->RepType == X_GetDeviceDontPropagateList) - SRepXGetDeviceDontPropagateList (client, len, rep); + SRepXGetDeviceDontPropagateList (client, len, (xGetDeviceDontPropagateListReply *)rep); else if (rep->RepType == X_GetDeviceMotionEvents) - SRepXGetDeviceMotionEvents (client, len, rep); + SRepXGetDeviceMotionEvents (client, len, (xGetDeviceMotionEventsReply *) rep); else if (rep->RepType == X_ChangeKeyboardDevice) - SRepXChangeKeyboardDevice (client, len, rep); + SRepXChangeKeyboardDevice (client, len, (xChangeKeyboardDeviceReply *) rep); else if (rep->RepType == X_ChangePointerDevice) - SRepXChangePointerDevice (client, len, rep); + SRepXChangePointerDevice (client, len, (xChangePointerDeviceReply *)rep); else if (rep->RepType == X_GrabDevice) - SRepXGrabDevice (client, len, rep); + SRepXGrabDevice (client, len, (xGrabDeviceReply *)rep); else if (rep->RepType == X_GetDeviceFocus) - SRepXGetDeviceFocus (client, len, rep); + SRepXGetDeviceFocus (client, len, (xGetDeviceFocusReply *)rep); else if (rep->RepType == X_GetFeedbackControl) - SRepXGetFeedbackControl (client, len, rep); + SRepXGetFeedbackControl (client, len, (xGetFeedbackControlReply *)rep); else if (rep->RepType == X_GetDeviceKeyMapping) - SRepXGetDeviceKeyMapping (client, len, rep); + SRepXGetDeviceKeyMapping (client, len, (xGetDeviceKeyMappingReply *)rep); else if (rep->RepType == X_GetDeviceModifierMapping) - SRepXGetDeviceModifierMapping (client, len, rep); + SRepXGetDeviceModifierMapping (client, len, (xGetDeviceModifierMappingReply *)rep); else if (rep->RepType == X_SetDeviceModifierMapping) - SRepXSetDeviceModifierMapping (client, len, rep); + SRepXSetDeviceModifierMapping (client, len, (xSetDeviceModifierMappingReply *)rep); else if (rep->RepType == X_GetDeviceButtonMapping) - SRepXGetDeviceButtonMapping (client, len, rep); + SRepXGetDeviceButtonMapping (client, len, (xGetDeviceButtonMappingReply *)rep); else if (rep->RepType == X_SetDeviceButtonMapping) - SRepXSetDeviceButtonMapping (client, len, rep); + SRepXSetDeviceButtonMapping (client, len, (xSetDeviceButtonMappingReply *)rep); else if (rep->RepType == X_QueryDeviceState) - SRepXQueryDeviceState (client, len, rep); + SRepXQueryDeviceState (client, len, (xQueryDeviceStateReply *)rep); else if (rep->RepType == X_SetDeviceValuators) - SRepXSetDeviceValuators (client, len, rep); + SRepXSetDeviceValuators (client, len, (xSetDeviceValuatorsReply *)rep); else if (rep->RepType == X_GetDeviceControl) - SRepXGetDeviceControl (client, len, rep); + SRepXGetDeviceControl (client, len, (xGetDeviceControlReply *)rep); else if (rep->RepType == X_ChangeDeviceControl) - SRepXChangeDeviceControl (client, len, rep); + SRepXChangeDeviceControl (client, len, (xChangeDeviceControlReply *)rep); else { FatalError("XINPUT confused sending swapped reply"); @@ -461,15 +503,17 @@ SReplyIDispatch (client, len, rep) * * Swap any events defined in this extension. */ +#define DO_SWAP(func,type) func ((type *)from, (type *)to) + void SEventIDispatch (from, to) xEvent *from; xEvent *to; - { +{ int type = from->u.u.type & 0177; if (type == DeviceValuator) - SEventDeviceValuator (from, to); + DO_SWAP(SEventDeviceValuator, deviceValuator); else if (type == DeviceKeyPress) { SKeyButtonPtrEvent (from, to); @@ -496,9 +540,9 @@ SEventIDispatch (from, to) to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == DeviceFocusIn) - SEventFocus (from, to); + DO_SWAP(SEventFocus, deviceFocus); else if (type == DeviceFocusOut) - SEventFocus (from, to); + DO_SWAP(SEventFocus, deviceFocus); else if (type == ProximityIn) { SKeyButtonPtrEvent (from, to); @@ -510,15 +554,15 @@ SEventIDispatch (from, to) to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1; } else if (type == DeviceStateNotify) - SDeviceStateNotifyEvent (from, to); + DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify); else if (type == DeviceKeyStateNotify) - SDeviceKeyStateNotifyEvent (from, to); + DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify); else if (type == DeviceButtonStateNotify) - SDeviceButtonStateNotifyEvent (from, to); + DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify); else if (type == DeviceMappingNotify) - SDeviceMappingNotifyEvent (from, to); + DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify); else if (type == ChangeDeviceNotify) - SChangeDeviceNotifyEvent (from, to); + DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify); else { FatalError("XInputExtension: Impossible event!\n"); @@ -531,6 +575,7 @@ SEventIDispatch (from, to) * */ +void SEventDeviceValuator (from, to) deviceValuator *from; deviceValuator *to; @@ -549,10 +594,11 @@ SEventDeviceValuator (from, to) } } +void SEventFocus (from, to) deviceFocus *from; deviceFocus *to; - { +{ register char n; *to = *from; @@ -561,10 +607,11 @@ SEventFocus (from, to) swapl(&to->window, n); } +void SDeviceStateNotifyEvent (from, to) deviceStateNotify *from; deviceStateNotify *to; - { +{ register int i; register char n; INT32 *ip B32; @@ -579,30 +626,33 @@ SDeviceStateNotifyEvent (from, to) } } +void SDeviceKeyStateNotifyEvent (from, to) deviceKeyStateNotify *from; deviceKeyStateNotify *to; - { +{ register char n; *to = *from; swaps(&to->sequenceNumber,n); } +void SDeviceButtonStateNotifyEvent (from, to) deviceButtonStateNotify *from; deviceButtonStateNotify *to; - { +{ register char n; *to = *from; swaps(&to->sequenceNumber,n); } +void SChangeDeviceNotifyEvent (from, to) changeDeviceNotify *from; changeDeviceNotify *to; - { +{ register char n; *to = *from; @@ -610,10 +660,11 @@ SChangeDeviceNotifyEvent (from, to) swapl(&to->time, n); } +void SDeviceMappingNotifyEvent (from, to) deviceMappingNotify *from; deviceMappingNotify *to; - { +{ register char n; *to = *from; @@ -627,14 +678,11 @@ SDeviceMappingNotifyEvent (from, to) * */ +void FixExtensionEvents (extEntry) ExtensionEntry *extEntry; - { - Mask mask, GetNextExtEventMask(); - void SetMaskForExtEvent(); - void SetEventInfo(); - void AllowPropagateSuppress(); - void SetExclusiveAccess(); +{ + Mask mask; DeviceValuator = extEntry->eventBase; DeviceKeyPress = DeviceValuator + 1; @@ -733,8 +781,9 @@ FixExtensionEvents (extEntry) * */ +void RestoreExtensionEvents () - { +{ int i; IReqCode = 0; @@ -781,10 +830,11 @@ RestoreExtensionEvents () */ void -IResetProc() +IResetProc(unused) + ExtensionEntry *unused; { - ReplySwapVector[IReqCode] = NotImplemented; + ReplySwapVector[IReqCode] = ReplyNotSwappd; EventSwapVector[DeviceValuator] = NotImplemented; EventSwapVector[DeviceKeyPress] = NotImplemented; EventSwapVector[DeviceKeyRelease] = NotImplemented; @@ -809,12 +859,12 @@ IResetProc() * */ -int +void AssignTypeAndName (dev, type, name) DeviceIntPtr dev; Atom type; char *name; - { +{ dev->type = type; dev->name = (char *) xalloc(strlen(name)+1); strcpy (dev->name, name); @@ -826,7 +876,7 @@ AssignTypeAndName (dev, type, name) * */ -int +void MakeDeviceTypeAtoms () { int i; @@ -844,9 +894,14 @@ MakeDeviceTypeAtoms () */ DeviceIntPtr +#if NeedFunctionPrototypes +LookupDeviceIntRec ( + CARD8 id) +#else LookupDeviceIntRec (id) CARD8 id; - { +#endif +{ DeviceIntPtr dev; for (dev=inputInfo.devices; dev; dev=dev->next) diff --git a/Xi/getbmap.c b/Xi/getbmap.c index 35c2d5c7d..fb22a1422 100644 --- a/Xi/getbmap.c +++ b/Xi/getbmap.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/getbmap.c,v 3.3 2001/12/14 19:58:56 dawes Exp $ */ /*********************************************************************** * @@ -59,11 +60,11 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "getbmap.h" /*********************************************************************** * @@ -88,6 +89,7 @@ SProcXGetDeviceButtonMapping(client) * */ +int ProcXGetDeviceButtonMapping (client) register ClientPtr client; { @@ -134,6 +136,7 @@ ProcXGetDeviceButtonMapping (client) * */ +void SRepXGetDeviceButtonMapping (client, size, rep) ClientPtr client; int size; diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 684160706..5b24bffbe 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/getdctl.c,v 3.4 2001/12/14 19:58:56 dawes Exp $ */ /******************************************************************** * @@ -59,12 +60,11 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); -void CopySwapDeviceResolution(); +#include "getdctl.h" /*********************************************************************** * @@ -92,6 +92,7 @@ SProcXGetDeviceControl(client) * */ +int ProcXGetDeviceControl(client) ClientPtr client; { @@ -134,7 +135,7 @@ ProcXGetDeviceControl(client) return Success; } - buf = (char *) Xalloc (total_length); + buf = (char *) xalloc (total_length); if (!buf) { SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, @@ -156,7 +157,7 @@ ProcXGetDeviceControl(client) rep.length = (total_length+3) >> 2; WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep); WriteToClient(client, total_length, savbuf); - Xfree (savbuf); + xfree (savbuf); return Success; } @@ -210,6 +211,7 @@ CopySwapDeviceResolution (client, v, buf, length) * */ +void SRepXGetDeviceControl (client, size, rep) ClientPtr client; int size; diff --git a/Xi/getfctl.c b/Xi/getfctl.c index e06470fbc..59c2c122b 100644 --- a/Xi/getfctl.c +++ b/Xi/getfctl.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/getfctl.c,v 3.4 2001/12/14 19:58:56 dawes Exp $ */ /******************************************************************** * @@ -59,17 +60,11 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); -void CopySwapKbdFeedback(); -void CopySwapPtrFeedback(); -void CopySwapIntegerFeedback(); -void CopySwapStringFeedback(); -void CopySwapLedFeedback(); -void CopySwapBellFeedback(); +#include "getfctl.h" /*********************************************************************** * @@ -95,6 +90,7 @@ SProcXGetFeedbackControl(client) * */ +int ProcXGetFeedbackControl(client) ClientPtr client; { @@ -165,7 +161,7 @@ ProcXGetFeedbackControl(client) return Success; } - buf = (char *) Xalloc (total_length); + buf = (char *) xalloc (total_length); if (!buf) { SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, @@ -190,7 +186,7 @@ ProcXGetFeedbackControl(client) rep.length = (total_length+3) >> 2; WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep); WriteToClient(client, total_length, savbuf); - Xfree (savbuf); + xfree (savbuf); return Success; } @@ -407,6 +403,7 @@ CopySwapBellFeedback (client, b, buf) * */ +void SRepXGetFeedbackControl (client, size, rep) ClientPtr client; int size; diff --git a/Xi/getfocus.c b/Xi/getfocus.c index 1e34df413..2b916da11 100644 --- a/Xi/getfocus.c +++ b/Xi/getfocus.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/getfocus.c,v 3.3 2001/12/14 19:58:56 dawes Exp $ */ /*********************************************************************** * @@ -60,11 +61,11 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "getfocus.h" /*********************************************************************** * @@ -136,6 +137,7 @@ ProcXGetDeviceFocus(client) * */ +void SRepXGetDeviceFocus (client, size, rep) ClientPtr client; int size; diff --git a/Xi/getkmap.c b/Xi/getkmap.c index 783dc5506..4a7a7e296 100644 --- a/Xi/getkmap.c +++ b/Xi/getkmap.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/getkmap.c,v 3.4 2001/12/14 19:58:56 dawes Exp $ */ /******************************************************************** * @@ -59,11 +60,12 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" +#include "swaprep.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "getkmap.h" /*********************************************************************** * @@ -89,10 +91,10 @@ SProcXGetDeviceKeyMapping(client) * */ +int ProcXGetDeviceKeyMapping(client) register ClientPtr client; { - extern void CopySwap32Write(); xGetDeviceKeyMappingReply rep; DeviceIntPtr dev; KeySymsPtr k; @@ -140,7 +142,7 @@ ProcXGetDeviceKeyMapping(client) rep.length = (k->mapWidth * stuff->count); /* KeySyms are 4 bytes */ WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep); - client->pSwapReplyFunc = CopySwap32Write; + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; WriteSwappedDataToClient( client, k->mapWidth * stuff->count * sizeof(KeySym), @@ -157,6 +159,7 @@ ProcXGetDeviceKeyMapping(client) * */ +void SRepXGetDeviceKeyMapping (client, size, rep) ClientPtr client; int size; diff --git a/Xi/getmmap.c b/Xi/getmmap.c index 93b5748c0..67e36b442 100644 --- a/Xi/getmmap.c +++ b/Xi/getmmap.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/getmmap.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */ /******************************************************************** * @@ -59,11 +60,11 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" /* Request macro */ +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "getmmap.h" /*********************************************************************** * @@ -89,6 +90,7 @@ SProcXGetDeviceModifierMapping(client) * */ +int ProcXGetDeviceModifierMapping(client) ClientPtr client; { @@ -138,6 +140,7 @@ ProcXGetDeviceModifierMapping(client) * */ +void SRepXGetDeviceModifierMapping (client, size, rep) ClientPtr client; int size; diff --git a/Xi/getprop.c b/Xi/getprop.c index ee53b87cb..a3f3226ea 100644 --- a/Xi/getprop.c +++ b/Xi/getprop.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/getprop.c,v 3.6 2001/12/14 19:58:57 dawes Exp $ */ /*********************************************************************** * @@ -60,11 +61,15 @@ SOFTWARE. #include "windowstr.h" /* window structs */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" +#include "swaprep.h" + +#include "getprop.h" -extern int IReqCode; -extern void (* ReplySwapVector[256]) (); extern XExtEventInfo EventInfo[]; -DeviceIntPtr LookupDeviceIntRec(); +extern int ExtEventIndex; /*********************************************************************** * @@ -91,16 +96,15 @@ SProcXGetDeviceDontPropagateList(client) * */ +int ProcXGetDeviceDontPropagateList (client) register ClientPtr client; { CARD16 count = 0; int i; - XEventClass *buf, *tbuf; + XEventClass *buf = NULL, *tbuf; WindowPtr pWin; xGetDeviceDontPropagateListReply rep; - XEventClass *ClassFromMask (); - void Swap32Write(); OtherInputMasks *others; REQUEST(xGetDeviceDontPropagateListReq); @@ -121,7 +125,7 @@ ProcXGetDeviceDontPropagateList (client) return Success; } - if (others = wOtherInputMasks(pWin)) + if ((others = wOtherInputMasks(pWin)) != 0) { for (i=0; i<EMASKSIZE; i++) tbuf = ClassFromMask (NULL, others->dontPropagateMask[i], i, @@ -129,7 +133,7 @@ ProcXGetDeviceDontPropagateList (client) if (count) { rep.count = count; - buf = (XEventClass *) Xalloc (rep.count * sizeof(XEventClass)); + buf = (XEventClass *) xalloc (rep.count * sizeof(XEventClass)); rep.length = (rep.count * sizeof (XEventClass) + 3) >> 2; tbuf = buf; @@ -144,9 +148,9 @@ ProcXGetDeviceDontPropagateList (client) if (count) { - client->pSwapReplyFunc = Swap32Write; + client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient( client, count * sizeof(XEventClass), buf); - Xfree (buf); + xfree (buf); } return Success; } @@ -169,7 +173,6 @@ XEventClass int i,j; int id = maskndx; Mask tmask = 0x80000000; - extern int ExtEventIndex; for (i=0; i<32; i++,tmask>>=1) if (tmask & mask) @@ -193,6 +196,7 @@ XEventClass * */ +void SRepXGetDeviceDontPropagateList (client, size, rep) ClientPtr client; int size; diff --git a/Xi/getselev.c b/Xi/getselev.c index 8ac16d1d0..75b9137a6 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/Xi/getselev.c,v 3.6 2001/12/14 19:58:57 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -60,10 +61,13 @@ SOFTWARE. #include "XIproto.h" #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window struct */ +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" +#include "swaprep.h" -extern int IReqCode; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "getprop.h" +#include "getselev.h" /*********************************************************************** * @@ -99,11 +103,9 @@ ProcXGetSelectedExtensionEvents(client) int total_length = 0; xGetSelectedExtensionEventsReply rep; WindowPtr pWin; - XEventClass *buf; + XEventClass *buf = NULL; XEventClass *tclient; XEventClass *aclient; - XEventClass *ClassFromMask (); - void Swap32Write(); OtherInputMasks *pOthers; InputClientsPtr others; @@ -124,7 +126,7 @@ ProcXGetSelectedExtensionEvents(client) return Success; } - if (pOthers=wOtherInputMasks(pWin)) + if ((pOthers = wOtherInputMasks(pWin)) != 0) { for (others = pOthers->inputClients; others; others=others->next) for (i=0; i<EMASKSIZE; i++) @@ -143,7 +145,7 @@ ProcXGetSelectedExtensionEvents(client) total_length = (rep.all_clients_count + rep.this_client_count) * sizeof (XEventClass); rep.length = (total_length + 3) >> 2; - buf = (XEventClass *) Xalloc (total_length); + buf = (XEventClass *) xalloc (total_length); tclient = buf; aclient = buf + rep.this_client_count; @@ -160,9 +162,9 @@ ProcXGetSelectedExtensionEvents(client) if (total_length) { - client->pSwapReplyFunc = Swap32Write; + client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient( client, total_length, buf); - Xfree (buf); + xfree (buf); } return Success; } @@ -174,6 +176,7 @@ ProcXGetSelectedExtensionEvents(client) * */ +void SRepXGetSelectedExtensionEvents (client, size, rep) ClientPtr client; int size; diff --git a/Xi/getvers.c b/Xi/getvers.c index 8628a2851..c220b5a81 100644 --- a/Xi/getvers.c +++ b/Xi/getvers.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/getvers.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */ /*********************************************************************** * @@ -59,10 +60,12 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" + +#include "getvers.h" -extern int IReqCode; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); XExtensionVersion AllExtensionVersions[128]; /*********************************************************************** @@ -90,6 +93,7 @@ SProcXGetExtensionVersion(client) * */ +int ProcXGetExtensionVersion (client) register ClientPtr client; { @@ -133,6 +137,7 @@ ProcXGetExtensionVersion (client) * */ +void SRepXGetExtensionVersion (client, size, rep) ClientPtr client; int size; diff --git a/Xi/grabdev.c b/Xi/grabdev.c index cb2370adf..80f948de5 100644 --- a/Xi/grabdev.c +++ b/Xi/grabdev.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/grabdev.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */ /*********************************************************************** * @@ -61,13 +62,15 @@ SOFTWARE. #include "windowstr.h" /* window structure */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" +#include "dixevents.h" /* GrabDevice */ + +#include "grabdev.h" -extern int IReqCode; -extern int BadDevice; -extern int BadClass; extern XExtEventInfo EventInfo[]; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +extern int ExtEventIndex; /*********************************************************************** * @@ -171,7 +174,6 @@ CreateMaskFromList (client, list, count, mask, dev, req) int i,j; int device; DeviceIntPtr tdev; - extern int ExtEventIndex; for (i=0; i<EMASKSIZE; i++) { @@ -212,6 +214,7 @@ CreateMaskFromList (client, list, count, mask, dev, req) * */ +void SRepXGrabDevice (client, size, rep) ClientPtr client; int size; diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c index ddc44c12d..cbc4fd8bd 100644 --- a/Xi/grabdevb.c +++ b/Xi/grabdevb.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/grabdevb.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */ /*********************************************************************** * @@ -60,11 +61,13 @@ SOFTWARE. #include "windowstr.h" /* window structure */ #include "XI.h" #include "XIproto.h" +#include "exevents.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "grabdev.h" +#include "grabdevb.h" /*********************************************************************** * @@ -154,7 +157,7 @@ ProcXGrabDeviceButton(client) return Success; ret = GrabButton(client, dev, stuff->this_device_mode, stuff->other_devices_mode, stuff->modifiers, mdev, stuff->button, - stuff->grabWindow, stuff->ownerEvents, NullCursor, NullWindow, + stuff->grabWindow, stuff->ownerEvents, (Cursor)0, (Window)0, tmp[stuff->grabbed_device].mask); if (ret != Success) diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c index 6db6b8d09..d7481801b 100644 --- a/Xi/grabdevk.c +++ b/Xi/grabdevk.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/grabdevk.c,v 3.3 2001/12/14 19:58:57 dawes Exp $ */ /*********************************************************************** * @@ -60,13 +61,13 @@ SOFTWARE. #include "windowstr.h" /* window structure */ #include "XI.h" #include "XIproto.h" +#include "exevents.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadClass; -extern int BadDevice; -extern InputInfo inputInfo; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "grabdev.h" +#include "grabdevk.h" /*********************************************************************** * diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 65a4e0a19..1ddcca3ae 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/gtmotion.c,v 3.7 2001/12/14 19:58:57 dawes Exp $ */ /*********************************************************************** * @@ -59,11 +60,12 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exevents.h" +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "gtmotion.h" /*********************************************************************** * @@ -97,11 +99,11 @@ ProcXGetDeviceMotionEvents(client) { INT32 *coords = NULL, *bufptr; xGetDeviceMotionEventsReply rep; - int i, j, num_events, axes, size, tsize; + unsigned long i; + int num_events, axes, size = 0, tsize; unsigned long nEvents; DeviceIntPtr dev; TimeStamp start, stop; - void XSwapTimeCoordWrite(); int length = 0; ValuatorClassPtr v; @@ -192,6 +194,7 @@ ProcXGetDeviceMotionEvents(client) * */ +void SRepXGetDeviceMotionEvents (client, size, rep) ClientPtr client; int size; diff --git a/Xi/listdev.c b/Xi/listdev.c index ff6155f19..ac4c875a1 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/listdev.c,v 3.4 2001/12/14 19:58:58 dawes Exp $ */ /*********************************************************************** * @@ -59,22 +60,14 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "XIstubs.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" /* FIXME */ + +#include "listdev.h" #define VPC 20 /* Max # valuators per chunk */ -extern InputInfo inputInfo; -extern int IReqCode; -extern int BadDevice; -extern void (*ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); - -void CopySwapKeyClass (); -void CopySwapButtonClass (); -int CopySwapValuatorClass (); -void SizeDeviceInfo (); -void ListDeviceInfo (); -void AddOtherInputDevices (); -void CopyDeviceName (); -void CopySwapDevice (); /*********************************************************************** * @@ -99,6 +92,7 @@ SProcXListInputDevices(client) * */ +int ProcXListInputDevices (client) register ClientPtr client; { @@ -114,7 +108,6 @@ ProcXListInputDevices (client) xDeviceInfo *dev; DeviceIntPtr d; - REQUEST(xListInputDevicesReq); REQUEST_SIZE_MATCH(xListInputDevicesReq); rep.repType = X_Reply; @@ -131,7 +124,7 @@ ProcXListInputDevices (client) SizeDeviceInfo (d, &namesize, &size); total_length = numdevs * sizeof (xDeviceInfo) + size + namesize; - devbuf = (char *) Xalloc (total_length); + devbuf = (char *) xalloc (total_length); classbuf = devbuf + (numdevs * sizeof (xDeviceInfo)); namebuf = classbuf + size; savbuf = devbuf; @@ -146,7 +139,7 @@ ProcXListInputDevices (client) rep.length = (total_length + 3) >> 2; WriteReplyToClient (client, sizeof (xListInputDevicesReply), &rep); WriteToClient(client, total_length, savbuf); - Xfree (savbuf); + xfree (savbuf); return Success; } @@ -396,6 +389,7 @@ CopySwapValuatorClass (client, v, buf) * */ +void SRepXListInputDevices (client, size, rep) ClientPtr client; int size; diff --git a/Xi/opendev.c b/Xi/opendev.c index 30d6293f0..26210fa86 100644 --- a/Xi/opendev.c +++ b/Xi/opendev.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/opendev.c,v 3.3 2001/12/14 19:58:58 dawes Exp $ */ /*********************************************************************** * @@ -56,17 +57,18 @@ SOFTWARE. #define NEED_REPLIES #include "X.h" /* for inputstr.h */ #include "Xproto.h" /* Request macro */ +#include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" -#include "inputstr.h" /* DeviceIntPtr */ +#include "XIstubs.h" #include "windowstr.h" /* window structure */ +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" + +#include "opendev.h" -extern int IReqCode; -extern int BadDevice; extern CARD8 event_base []; -extern InputInfo inputInfo; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); /*********************************************************************** * @@ -102,7 +104,6 @@ ProcXOpenDevice(client) int status = Success; xOpenDeviceReply rep; DeviceIntPtr dev; - void OpenInputDevice(); REQUEST(xOpenDeviceReq); REQUEST_SIZE_MATCH(xOpenDeviceReq); @@ -186,6 +187,7 @@ ProcXOpenDevice(client) * */ +void SRepXOpenDevice (client, size, rep) ClientPtr client; int size; diff --git a/Xi/queryst.c b/Xi/queryst.c index 66319b2f3..598ab85ae 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/Xserver/Xi/queryst.c,v 3.5 2001/12/14 19:58:58 dawes Exp $ */ /*********************************************************************** * @@ -41,11 +42,12 @@ from The Open Group. #include "windowstr.h" /* window structure */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exevents.h" +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "queryst.h" /*********************************************************************** * @@ -129,7 +131,7 @@ ProcXQueryDeviceState(client) (v->numAxes * sizeof(int))); num_classes++; } - buf = (char *) Xalloc (total_length); + buf = (char *) xalloc (total_length); if (!buf) { SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, @@ -184,7 +186,7 @@ ProcXQueryDeviceState(client) WriteReplyToClient (client, sizeof(xQueryDeviceStateReply), &rep); if (total_length > 0) WriteToClient (client, total_length, savbuf); - Xfree (savbuf); + xfree (savbuf); return Success; } @@ -195,6 +197,7 @@ ProcXQueryDeviceState(client) * */ +void SRepXQueryDeviceState (client, size, rep) ClientPtr client; int size; diff --git a/Xi/selectev.c b/Xi/selectev.c index 510062993..a46a02928 100644 --- a/Xi/selectev.c +++ b/Xi/selectev.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/selectev.c,v 3.3 2001/12/14 19:58:58 dawes Exp $ */ /*********************************************************************** * @@ -61,12 +62,16 @@ SOFTWARE. #include "windowstr.h" /* window structure */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exevents.h" +#include "exglobals.h" + +#include "grabdev.h" +#include "selectev.h" -extern int IReqCode; extern Mask ExtExclusiveMasks[]; extern Mask ExtValidMasks[]; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); /*********************************************************************** * @@ -137,7 +142,7 @@ ProcXSelectExtensionEvent (client) for (i=0; i<EMASKSIZE; i++) if (tmp[i].dev != NULL) { - if ((ret = SelectForWindow(tmp[i].dev, pWin, client, tmp[i].mask, + if ((ret = SelectForWindow((DeviceIntPtr)tmp[i].dev, pWin, client, tmp[i].mask, ExtExclusiveMasks[i], ExtValidMasks[i])) != Success) { SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0, diff --git a/Xi/sendexev.c b/Xi/sendexev.c index 36a1ad326..ae6f8cdc6 100644 --- a/Xi/sendexev.c +++ b/Xi/sendexev.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/sendexev.c,v 3.3 2001/12/14 19:58:58 dawes Exp $ */ /*********************************************************************** * @@ -61,12 +62,15 @@ SOFTWARE. #include "windowstr.h" /* Window */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exevents.h" +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -extern void (* EventSwapVector[128]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "grabdev.h" +#include "sendexev.h" + +extern int lastEvent; /* Defined in extension.c */ /*********************************************************************** * @@ -83,7 +87,7 @@ SProcXSendExtensionEvent(client) register int i; xEvent eventT; xEvent *eventP; - void (*proc)(), NotImplemented(); + EventSwapPtr proc; REQUEST(xSendExtensionEventReq); swaps(&stuff->length, n); @@ -116,11 +120,11 @@ SProcXSendExtensionEvent(client) * */ +int ProcXSendExtensionEvent (client) register ClientPtr client; { int ret; - extern int lastEvent; /* Defined in extension.c */ DeviceIntPtr dev; xEvent *first; XEventClass *list; @@ -163,7 +167,7 @@ ProcXSendExtensionEvent (client) return Success; ret = (SendEvent (client, dev, stuff->destination, - stuff->propagate, &stuff[1], tmp[stuff->deviceid].mask, + stuff->propagate, (xEvent *)&stuff[1], tmp[stuff->deviceid].mask, stuff->num_events)); if (ret != Success) diff --git a/Xi/setbmap.c b/Xi/setbmap.c index b5335de05..52553948d 100644 --- a/Xi/setbmap.c +++ b/Xi/setbmap.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/setbmap.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */ /*********************************************************************** * @@ -62,12 +63,12 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "exevents.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern int DeviceMappingNotify; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "setbmap.h" /*********************************************************************** * @@ -92,6 +93,7 @@ SProcXSetDeviceButtonMapping(client) * */ +int ProcXSetDeviceButtonMapping (client) register ClientPtr client; { @@ -124,7 +126,7 @@ ProcXSetDeviceButtonMapping (client) return Success; } - ret = SetButtonMapping (client, dev, stuff->map_length, &stuff[1]); + ret = SetButtonMapping (client, dev, stuff->map_length, (BYTE *)&stuff[1]); if (ret == BadValue || ret == BadMatch) { @@ -150,6 +152,7 @@ ProcXSetDeviceButtonMapping (client) * */ +void SRepXSetDeviceButtonMapping (client, size, rep) ClientPtr client; int size; diff --git a/Xi/setdval.c b/Xi/setdval.c index 533b1ef5b..fe2e13853 100644 --- a/Xi/setdval.c +++ b/Xi/setdval.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/setdval.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */ /*********************************************************************** * @@ -56,14 +57,15 @@ SOFTWARE. #define NEED_REPLIES #include "X.h" /* for inputstr.h */ #include "Xproto.h" /* Request macro */ +#include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" -#include "inputstr.h" /* DeviceIntPtr */ +#include "XIstubs.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "setdval.h" /*********************************************************************** * @@ -154,6 +156,7 @@ ProcXSetDeviceValuators(client) * */ +void SRepXSetDeviceValuators (client, size, rep) ClientPtr client; int size; diff --git a/Xi/setfocus.c b/Xi/setfocus.c index afa5de15b..599934549 100644 --- a/Xi/setfocus.c +++ b/Xi/setfocus.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/setfocus.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */ /*********************************************************************** * @@ -61,11 +62,13 @@ SOFTWARE. #include "XI.h" #include "XIproto.h" -extern int IReqCode; -extern int BadDevice; -extern InputInfo inputInfo; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "dixevents.h" + +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" + +#include "setfocus.h" /*********************************************************************** * diff --git a/Xi/setmmap.c b/Xi/setmmap.c index 16f3373a8..4c4d19c8b 100644 --- a/Xi/setmmap.c +++ b/Xi/setmmap.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/setmmap.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */ /******************************************************************** * @@ -59,12 +60,12 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" +#include "exevents.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern int DeviceMappingNotify; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "setmmap.h" /*********************************************************************** * @@ -90,6 +91,7 @@ SProcXSetDeviceModifierMapping(client) * */ +int ProcXSetDeviceModifierMapping(client) ClientPtr client; { @@ -116,7 +118,7 @@ ProcXSetDeviceModifierMapping(client) ret = SetModifierMapping(client, dev, stuff->length, (sizeof (xSetDeviceModifierMappingReq)>>2), stuff->numKeyPerModifier, - &stuff[1], &kp); + (BYTE *)&stuff[1], &kp); if (ret==MappingSuccess || ret==MappingBusy || ret==MappingFailed) { @@ -143,6 +145,7 @@ ProcXSetDeviceModifierMapping(client) * */ +void SRepXSetDeviceModifierMapping (client, size, rep) ClientPtr client; int size; diff --git a/Xi/setmode.c b/Xi/setmode.c index f2458f4e6..9c3feb4db 100644 --- a/Xi/setmode.c +++ b/Xi/setmode.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/setmode.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */ /*********************************************************************** * @@ -56,14 +57,15 @@ SOFTWARE. #define NEED_REPLIES #include "X.h" /* for inputstr.h */ #include "Xproto.h" /* Request macro */ +#include "inputstr.h" /* DeviceIntPtr */ #include "XI.h" #include "XIproto.h" -#include "inputstr.h" /* DeviceIntPtr */ +#include "XIstubs.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "setmode.h" /*********************************************************************** * @@ -138,6 +140,7 @@ ProcXSetDeviceMode(client) * */ +void SRepXSetDeviceMode (client, size, rep) ClientPtr client; int size; diff --git a/Xi/stubs.c b/Xi/stubs.c index 9c9269719..991f8b433 100644 --- a/Xi/stubs.c +++ b/Xi/stubs.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/stubs.c,v 3.4 2001/12/14 19:58:59 dawes Exp $ */ /* * stubs.c -- stub routines for the X server side of the XINPUT @@ -62,6 +63,7 @@ SOFTWARE. #include "inputstr.h" #include "XI.h" #include "XIproto.h" +#include "XIstubs.h" /*********************************************************************** * @@ -95,6 +97,7 @@ ChangeKeyboardDevice (old_dev, new_dev) /*********************************************************************** DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c * **********************************************************************/ + return BadMatch; } @@ -129,9 +132,17 @@ ChangeKeyboardDevice (old_dev, new_dev) */ int +#if NeedFunctionPrototypes +ChangePointerDevice ( + DeviceIntPtr old_dev, + DeviceIntPtr new_dev, + unsigned char x, + unsigned char y) +#else ChangePointerDevice (old_dev, new_dev, x, y) DeviceIntPtr old_dev, new_dev; unsigned char x, y; +#endif { /*********************************************************************** InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr* @@ -143,6 +154,7 @@ ChangePointerDevice (old_dev, new_dev, x, y) else axes_changed = FALSE; *************************************************************************/ + return BadMatch; } /*********************************************************************** @@ -194,13 +206,13 @@ CloseInputDevice (d, client) void AddOtherInputDevices () { + /********************************************************************** + for each uninitialized device, do something like: + DeviceIntPtr dev; DeviceProc deviceProc; pointer private; - /********************************************************************** - for each uninitialized device, do something like: - dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE); dev->public.devicePrivate = private; RegisterOtherDevice(dev); diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c index 90a01a4bc..a1ab911fe 100644 --- a/Xi/ungrdev.c +++ b/Xi/ungrdev.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/ungrdev.c,v 3.3 2001/12/14 19:58:59 dawes Exp $ */ /*********************************************************************** * @@ -59,11 +60,11 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); +#include "ungrdev.h" /*********************************************************************** * diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c index 917efda9c..66ccc72af 100644 --- a/Xi/ungrdevb.c +++ b/Xi/ungrdevb.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.c,v 3.4 2001/12/14 19:59:00 dawes Exp $ */ /*********************************************************************** * @@ -60,15 +61,16 @@ SOFTWARE. #include "windowstr.h" /* window structure */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" +#include "dixgrabs.h" + +#include "ungrdevb.h" #define AllModifiersMask ( \ ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ Mod3Mask | Mod4Mask | Mod5Mask ) -extern int IReqCode; -extern int BadDevice; -extern int DeviceButtonPress; -extern void (* ReplySwapVector[256]) (); -DeviceIntPtr LookupDeviceIntRec(); /*********************************************************************** * diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c index 26c75f365..d7632db2a 100644 --- a/Xi/ungrdevk.c +++ b/Xi/ungrdevk.c @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.c,v 3.4 2001/12/14 19:59:00 dawes Exp $ */ /*********************************************************************** * @@ -60,15 +61,16 @@ SOFTWARE. #include "windowstr.h" /* window structure */ #include "XI.h" #include "XIproto.h" +#include "extnsionst.h" +#include "extinit.h" /* LookupDeviceIntRec */ +#include "exglobals.h" +#include "dixgrabs.h" + +#include "ungrdevk.h" #define AllModifiersMask ( \ ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \ Mod3Mask | Mod4Mask | Mod5Mask ) -extern int IReqCode; -extern int BadDevice; -extern void (* ReplySwapVector[256]) (); -extern int DeviceKeyPress; -DeviceIntPtr LookupDeviceIntRec(); /*********************************************************************** * |