xserver: Branch 'mpx' - 68 commits
Peter Hutterer
whot at kemper.freedesktop.org
Tue Apr 3 12:37:44 EEST 2007
GL/glx/Makefile.am | 1
GL/mesa/X/Makefile.am | 6
GL/mesa/X/xf86glx.c | 32
GL/mesa/X/xf86glx_util.c | 2
GL/mesa/X/xf86glxint.h | 45 -
GL/mesa/main/Makefile.am | 1
GL/mesa/shader/Makefile.am | 13
GL/mesa/shader/slang/Makefile.am | 22
GL/mesa/swrast/Makefile.am | 3
GL/mesa/tnl/Makefile.am | 1
Xext/appgroup.c | 52 -
Xext/appgroup.h | 22
Xext/panoramiX.c | 48 -
Xext/panoramiX.h | 12
Xext/panoramiXh.h | 5
Xext/panoramiXsrv.h | 3
Xext/saver.c | 4
Xext/security.c | 2
Xext/securitysrv.h | 9
Xext/xace.c | 4
Xext/xace.h | 10
Xext/xevie.c | 4
Xi/allowev.c | 6
Xi/chdevcur.c | 6
Xi/chgdctl.c | 6
Xi/chgfctl.c | 279 +++----
Xi/chgfctl.h | 42 -
Xi/chgkbd.c | 6
Xi/chgkmap.c | 10
Xi/chgprop.c | 10
Xi/chgptr.c | 6
Xi/chgptr.h | 8
Xi/chpkpair.c | 6
Xi/closedev.c | 96 +-
Xi/closedev.h | 10
Xi/devbell.c | 6
Xi/exevents.c | 80 +-
Xi/exglobals.h | 2
Xi/extinit.c | 445 ++++++------
Xi/getbmap.c | 8
Xi/getdctl.c | 229 +++---
Xi/getdctl.h | 24
Xi/getfctl.c | 216 ++---
Xi/getfctl.h | 30
Xi/getfocus.c | 6
Xi/getkmap.c | 8
Xi/getmmap.c | 6
Xi/getprop.c | 8
Xi/getselev.c | 8
Xi/getvers.c | 8
Xi/grabacc.c | 2
Xi/grabdev.c | 12
Xi/grabdevb.c | 8
Xi/grabdevk.c | 8
Xi/gtmotion.c | 8
Xi/listdev.c | 260 +++----
Xi/listdev.h | 38 -
Xi/opendev.c | 8
Xi/querydp.c | 8
Xi/queryst.c | 10
Xi/selectev.c | 10
Xi/sendexev.c | 10
Xi/setbmap.c | 8
Xi/setdval.c | 8
Xi/setfocus.c | 8
Xi/setmmap.c | 6
Xi/setmode.c | 8
Xi/stubs.c | 6
Xi/ungrdev.c | 6
Xi/ungrdevb.c | 4
Xi/ungrdevk.c | 4
Xi/warpdevp.c | 6
afb/afb.h | 124 ---
afb/afbbitblt.c | 146 ----
afb/afbcmap.c | 18
afb/afbgc.c | 266 +++----
afb/afbimage.c | 31
afb/afbpixmap.c | 10
afb/afbscrinit.c | 50 -
afb/afbsetsp.c | 18
composite/compalloc.c | 2
composite/compext.c | 40 -
composite/compinit.c | 2
composite/compint.h | 15
configure.ac | 6
damageext/damageext.c | 18
damageext/damageextint.h | 14
dbe/dbe.c | 31
dbe/dbestruct.h | 5
dbe/midbe.c | 25
dix/devices.c | 11
dix/dispatch.c | 64 -
dix/dixutils.c | 6
dix/events.c | 130 ++-
dix/extension.c | 81 --
dix/gc.c | 13
dix/getevents.c | 4
dix/resource.c | 2
dix/swaprep.c | 109 +-
dix/window.c | 175 +---
exa/exa.c | 4
hw/dmx/Makefile.am | 10
hw/dmx/dmxclient.h | 4
hw/dmx/dmxcursor.c | 133 ++-
hw/dmx/dmxinput.c | 3
hw/dmx/dmxinput.h | 2
hw/dmx/input/dmxbackend.c | 18
hw/dmx/input/dmxevents.c | 267 +++++++
hw/dmx/input/dmxinputinit.c | 113 ++-
hw/dmx/input/dmxxinput.c | 6
hw/dmx/input/lnx-keyboard.c | 12
hw/kdrive/ati/ati_dma.c | 2
hw/kdrive/ephyr/ephyrinit.c | 2
hw/kdrive/src/kinput.c | 2
hw/xfree86/common/xf86Bus.c | 31
hw/xfree86/common/xf86Bus.h | 3
hw/xfree86/common/xf86Config.c | 30
hw/xfree86/common/xf86Config.h | 1
hw/xfree86/common/xf86Configure.c | 2
hw/xfree86/common/xf86DGA.c | 180 +++-
hw/xfree86/common/xf86Events.c | 4
hw/xfree86/common/xf86Globals.c | 1
hw/xfree86/common/xf86Helper.c | 13
hw/xfree86/common/xf86Module.h | 2
hw/xfree86/common/xf86Priv.h | 2
hw/xfree86/common/xf86XKB.c | 2
hw/xfree86/common/xf86Xinput.c | 53 +
hw/xfree86/common/xf86Xinput.h | 8
hw/xfree86/common/xf86xv.c | 2
hw/xfree86/ddc/edid_modes.c | 13
hw/xfree86/ddc/xf86DDC.c | 53 -
hw/xfree86/dixmods/extmod/dgaproc.h | 5
hw/xfree86/dixmods/glxmodule.c | 4
hw/xfree86/dixmods/xkbKillSrv.c | 2
hw/xfree86/dixmods/xkbPrivate.c | 2
hw/xfree86/dixmods/xkbVT.c | 2
hw/xfree86/doc/man/xorg.conf.man.pre | 79 ++
hw/xfree86/i2c/xf86i2cmodule.c | 36
hw/xfree86/loader/dixsym.c | 2
hw/xfree86/loader/loader.c | 116 ---
hw/xfree86/loader/loaderProcs.h | 4
hw/xfree86/loader/loadmod.c | 102 --
hw/xfree86/loader/misym.c | 3
hw/xfree86/loader/xf86sym.c | 1
hw/xfree86/modes/xf86Crtc.c | 49 +
hw/xfree86/modes/xf86Crtc.h | 8
hw/xfree86/modes/xf86EdidModes.c | 13
hw/xfree86/modes/xf86RandR12.c | 140 +++
hw/xfree86/modes/xf86Rotate.c | 68 +
hw/xfree86/os-support/shared/libc_wrapper.c | 2
hw/xfree86/parser/DRI.c | 31
hw/xfree86/parser/Flags.c | 9
hw/xfree86/parser/Layout.c | 38 -
hw/xfree86/parser/Module.c | 2
hw/xfree86/parser/Monitor.c | 32
hw/xfree86/parser/Screen.c | 2
hw/xfree86/parser/Vendor.c | 15
hw/xfree86/parser/Video.c | 34
hw/xfree86/parser/configProcs.h | 16
hw/xfree86/parser/read.c | 38 -
hw/xfree86/parser/scan.c | 16
hw/xfree86/parser/xf86Parser.h | 1
hw/xfree86/ramdac/xf86RamDacMod.c | 46 -
hw/xfree86/xaa/Makefile.am | 1
hw/xfree86/xaa/xaaDashLine.c | 2
hw/xfree86/xaa/xaaGC.c | 2
hw/xfree86/xaa/xaaGCmisc.c | 2
hw/xfree86/xaa/xaaInit.c | 19
hw/xfree86/xaa/xaaLineMisc.c | 2
hw/xfree86/xaa/xaaWrapper.c | 2
hw/xfree86/xaa/xaalocal.h | 3
hw/xfree86/xf4bpp/Makefile.am | 1
hw/xfree86/xf4bpp/offscreen.c | 19
hw/xfree86/xf4bpp/ppcGC.c | 9
hw/xfree86/xf4bpp/ppcPolyRec.c | 130 ---
hw/xfree86/xf4bpp/xf4bpp.h | 8
hw/xgl/egl/kinput.c | 2
hw/xgl/glx/xglx.c | 2
hw/xnest/Display.c | 2
hw/xnest/Keyboard.c | 2
hw/xnest/Screen.c | 2
hw/xwin/InitOutput.c | 2
hw/xwin/winconfig.c | 2
hw/xwin/winkeybd.c | 2
include/dix.h | 78 --
include/exevents.h | 16
include/extinit.h | 137 ---
include/extnsionst.h | 35
include/gc.h | 5
include/globals.h | 4
include/inputstr.h | 2
include/os.h | 14
include/swaprep.h | 18
include/window.h | 19
include/windowstr.h | 6
include/xkbsrv.h | 1022 ++++++++++++++++++++++++++++
mi/mi.h | 54 -
mi/miarc.c | 15
mi/mibitblt.c | 10
mi/midash.c | 193 -----
mi/mieq.c | 24
mi/mifillarc.c | 18
mi/mifillarc.h | 24
mi/mioverlay.c | 4
mi/mipointer.c | 53 -
mi/mipointer.h | 15
mi/mipoly.h | 8
mi/mipolytext.c | 51 -
mi/mipolyutil.c | 10
mi/miregion.c | 33
mi/miscrinit.c | 10
mi/mispans.c | 30
mi/mispans.h | 16
mi/miwideline.c | 51 -
mi/miwideline.h | 42 -
mi/mizerarc.c | 6
mi/mizerarc.h | 6
miext/cw/cw.c | 24
miext/cw/cw.h | 4
miext/damage/damage.c | 28
miext/damage/damagestr.h | 6
os/WaitFor.c | 9
os/access.c | 6
os/auth.c | 20
os/connection.c | 10
os/io.c | 23
os/osdep.h | 14
os/utils.c | 13
os/xdmcp.c | 72 -
randr/mirandr.c | 28
randr/randr.c | 2
randr/randrstr.h | 66 +
randr/rrcrtc.c | 196 +++--
randr/rrinfo.c | 17
randr/rrmode.c | 217 +++++
randr/rroutput.c | 150 +++-
randr/rrproperty.c | 184 +++--
randr/rrscreen.c | 16
record/set.c | 8
render/animcur.c | 4
render/glyph.c | 6
render/glyphstr.h | 2
render/picture.c | 2
xfixes/xfixes.c | 8
xfixes/xfixesint.h | 3
xkb/Makefile.am | 3
xkb/XKBAlloc.c | 157 ----
xkb/XKBGAlloc.c | 2
xkb/XKBMAlloc.c | 82 --
xkb/XKBMisc.c | 183 -----
xkb/ddxBeep.c | 2
xkb/ddxCtrls.c | 2
xkb/ddxDevBtn.c | 2
xkb/ddxFakeBtn.c | 2
xkb/ddxFakeMtn.c | 2
xkb/ddxInit.c | 2
xkb/ddxKeyClick.c | 2
xkb/ddxKillSrv.c | 2
xkb/ddxLEDs.c | 4
xkb/ddxList.c | 2
xkb/ddxLoad.c | 8
xkb/ddxPrivate.c | 2
xkb/ddxVT.c | 2
xkb/maprules.c | 2
xkb/xkb.c | 63 -
xkb/xkb.h | 42 -
xkb/xkbAccessX.c | 8
xkb/xkbActions.c | 8
xkb/xkbDflts.h | 37 -
xkb/xkbEvents.c | 46 -
xkb/xkbInit.c | 26
xkb/xkbLEDs.c | 453 ++++--------
xkb/xkbPrKeyEv.c | 2
xkb/xkbSwap.c | 2
xkb/xkbUtils.c | 64 -
xkb/xkberrs.c | 31
xkb/xkbfmisc.c | 109 --
xkb/xkbout.c | 126 ---
xkb/xkbtext.c | 96 --
xkb/xkmread.c | 14
280 files changed, 4727 insertions(+), 5880 deletions(-)
New commits:
diff-tree 207f710d16337839c2427aa16fad70a49834153e (from 5f382c9c7fbda6eccf8e76c28a90b55ff2f0aef3)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Tue Apr 3 19:02:14 2007 +0930
Delete all grabs from all devices when deleting a window.
diff --git a/dix/events.c b/dix/events.c
index 03d82e9..94e60dc 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4637,7 +4637,7 @@ DeleteWindowFromAnyEvents(WindowPtr pWin
WindowPtr parent;
DeviceIntPtr mouse = inputInfo.pointer;
DeviceIntPtr keybd = inputInfo.keyboard;
- FocusClassPtr focus = keybd->focus;
+ FocusClassPtr focus;
OtherClientsPtr oc;
GrabPtr passive;
GrabPtr grab;
@@ -4650,62 +4650,82 @@ DeleteWindowFromAnyEvents(WindowPtr pWin
((grab->window == pWin) || (grab->confineTo == pWin)))
(*mouse->coreGrab.DeactivateGrab)(mouse);
- /* Deactivating a keyboard grab should cause focus events. */
+ /* Deactivating a keyboard grab should cause focus events. */
grab = keybd->coreGrab.grab;
if (grab && (grab->window == pWin))
(*keybd->coreGrab.DeactivateGrab)(keybd);
- /* If the focus window is a root window (ie. has no parent) then don't
- delete the focus from it. */
-
- if ((pWin == focus->win) && (pWin->parent != NullWindow))
+ /* And now the real devices */
+ for (mouse = inputInfo.devices; mouse; mouse = mouse->next)
{
- int focusEventMode = NotifyNormal;
+ grab = mouse->coreGrab.grab;
+ if (grab && ((grab->window == pWin) || (grab->confineTo == pWin)))
+ (*mouse->coreGrab.DeactivateGrab)(mouse);
+ }
- /* If a grab is in progress, then alter the mode of focus events. */
- if (keybd->coreGrab.grab)
- focusEventMode = NotifyWhileGrabbed;
+ for (keybd = inputInfo.devices; keybd; keybd = keybd->next)
+ {
+ if (IsKeyboardDevice(keybd))
+ {
+ focus = keybd->focus;
- switch (focus->revert)
- {
- case RevertToNone:
- DoFocusEvents(keybd, pWin, NoneWin, focusEventMode);
- focus->win = NoneWin;
- focus->traceGood = 0;
- break;
- case RevertToParent:
- parent = pWin;
- do
- {
- parent = parent->parent;
- focus->traceGood--;
- } while (!parent->realized
-/* This would be a good protocol change -- windows being reparented
- during SaveSet processing would cause the focus to revert to the
- nearest enclosing window which will survive the death of the exiting
- client, instead of ending up reverting to a dying window and thence
- to None
- */
+ /* If the focus window is a root window (ie. has no parent) then don't
+ delete the focus from it. */
+
+ if ((pWin == focus->win) && (pWin->parent != NullWindow))
+ {
+ int focusEventMode = NotifyNormal;
+
+ /* If a grab is in progress, then alter the mode of focus events. */
+
+ if (keybd->coreGrab.grab)
+ focusEventMode = NotifyWhileGrabbed;
+
+ switch (focus->revert)
+ {
+ case RevertToNone:
+ DoFocusEvents(keybd, pWin, NoneWin, focusEventMode);
+ focus->win = NoneWin;
+ focus->traceGood = 0;
+ break;
+ case RevertToParent:
+ parent = pWin;
+ do
+ {
+ parent = parent->parent;
+ focus->traceGood--;
+ } while (!parent->realized
+ /* This would be a good protocol change -- windows being reparented
+ during SaveSet processing would cause the focus to revert to the
+ nearest enclosing window which will survive the death of the exiting
+ client, instead of ending up reverting to a dying window and thence
+ to None
+ */
#ifdef NOTDEF
- || clients[CLIENT_ID(parent->drawable.id)]->clientGone
+ || clients[CLIENT_ID(parent->drawable.id)]->clientGone
#endif
- );
- DoFocusEvents(keybd, pWin, parent, focusEventMode);
- focus->win = parent;
- focus->revert = RevertToNone;
- break;
- case RevertToPointerRoot:
- DoFocusEvents(keybd, pWin, PointerRootWin, focusEventMode);
- focus->win = PointerRootWin;
- focus->traceGood = 0;
- break;
- }
- }
+ );
+ DoFocusEvents(keybd, pWin, parent, focusEventMode);
+ focus->win = parent;
+ focus->revert = RevertToNone;
+ break;
+ case RevertToPointerRoot:
+ DoFocusEvents(keybd, pWin, PointerRootWin, focusEventMode);
+ focus->win = PointerRootWin;
+ focus->traceGood = 0;
+ break;
+ }
+ }
+ }
- if (mouse->valuator->motionHintWindow == pWin)
- mouse->valuator->motionHintWindow = NullWindow;
+ if (IsPointerDevice(keybd))
+ {
+ if (keybd->valuator->motionHintWindow == pWin)
+ keybd->valuator->motionHintWindow = NullWindow;
+ }
+ }
if (freeResources)
{
diff-tree 5f382c9c7fbda6eccf8e76c28a90b55ff2f0aef3 (from parents)
Merge: 9b0b3406682b5a3161e6c3895771523214c37207 f09ee168e234d0a9416e15f2916726b975cad293
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Tue Apr 3 15:07:18 2007 +0930
Merge branch 'master' into mpx
diff-tree f09ee168e234d0a9416e15f2916726b975cad293 (from 96ce17aa94413c4b8bcb61cae71167050130a307)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Tue Apr 3 15:07:00 2007 +0930
Revert "o fix minor error in comment for GetPointerEvents()"
This reverts commit 96ce17aa94413c4b8bcb61cae71167050130a307.
diff --git a/dix/getevents.c b/dix/getevents.c
index 219d1a1..3f636bc 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -470,7 +470,7 @@ GetKeyboardValuatorEvents(xEvent *events
/**
- * Generate a series of xEvents (returned in events) representing pointer
+ * Generate a series of xEvents (returned in xE) representing pointer
* motion, or button presses. Xi and XKB-aware.
*
* events is not NULL-terminated; the return value is the number of events.
diff-tree 9b0b3406682b5a3161e6c3895771523214c37207 (from e8777a91f37d828b9df839bf3d9cf2f954bdddb0)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Tue Apr 3 15:06:26 2007 +0930
Make GrabDevice differ between core grabs and device grabs.
diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index e2809ef..143b98c 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -141,7 +141,7 @@ ProcXGrabDevice(ClientPtr client)
error = GrabDevice(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->grabWindow,
stuff->ownerEvents, stuff->time,
- tmp[stuff->deviceid].mask, &rep.status);
+ tmp[stuff->deviceid].mask, &rep.status, FALSE);
if (error != Success) {
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, error);
diff --git a/dix/events.c b/dix/events.c
index de8ff9b..03d82e9 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4110,12 +4110,14 @@ ProcUngrabPointer(ClientPtr client)
int
GrabDevice(ClientPtr client, DeviceIntPtr dev,
unsigned this_mode, unsigned other_mode, Window grabWindow,
- unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status)
+ unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status,
+ Bool coreGrab)
{
WindowPtr pWin;
GrabPtr grab;
TimeStamp time;
int rc;
+ GrabInfoPtr grabInfo = (coreGrab) ? &dev->coreGrab : &dev->deviceGrab;
UpdateCurrentTime();
if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync))
@@ -4137,16 +4139,16 @@ GrabDevice(ClientPtr client, DeviceIntPt
if (rc != Success)
return rc;
time = ClientTimeToServerTime(ctime);
- grab = dev->coreGrab.grab;
+ grab = grabInfo->grab;
if (grab && !SameClient(grab, client))
*status = AlreadyGrabbed;
else if (!pWin->realized)
*status = GrabNotViewable;
else if ((CompareTimeStamps(time, currentTime) == LATER) ||
- (CompareTimeStamps(time, dev->coreGrab.grabTime) == EARLIER))
+ (CompareTimeStamps(time, grabInfo->grabTime) == EARLIER))
*status = GrabInvalidTime;
- else if (dev->coreGrab.sync.frozen &&
- dev->coreGrab.sync.other && !SameClient(dev->coreGrab.sync.other, client))
+ else if (grabInfo->sync.frozen &&
+ grabInfo->sync.other && !SameClient(grabInfo->sync.other, client))
*status = GrabFrozen;
else
{
@@ -4164,7 +4166,7 @@ GrabDevice(ClientPtr client, DeviceIntPt
tempGrab.device = dev;
tempGrab.cursor = NULL;
- (*dev->coreGrab.ActivateGrab)(dev, &tempGrab, time, FALSE);
+ (*grabInfo->ActivateGrab)(dev, &tempGrab, time, FALSE);
*status = GrabSuccess;
}
return Success;
@@ -4184,7 +4186,7 @@ ProcGrabKeyboard(ClientPtr client)
result = GrabDevice(client, keyboard, stuff->keyboardMode,
stuff->pointerMode, stuff->grabWindow,
stuff->ownerEvents, stuff->time,
- KeyPressMask | KeyReleaseMask, &rep.status);
+ KeyPressMask | KeyReleaseMask, &rep.status, TRUE);
else {
result = Success;
rep.status = AlreadyGrabbed;
diff --git a/include/dix.h b/include/dix.h
index 2ad6c77..1b112a1 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -485,7 +485,8 @@ extern int GrabDevice(
unsigned /* ownerEvents */,
Time /* ctime */,
Mask /* mask */,
- CARD8 * /* status */);
+ CARD8 * /* status */,
+ Bool /* coreGrab */);
extern void InitEvents(void);
extern void InitSprite(
diff-tree e8777a91f37d828b9df839bf3d9cf2f954bdddb0 (from parents)
Merge: a12054757d21edacc1c24c3077b9214726652829 96ce17aa94413c4b8bcb61cae71167050130a307
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Mon Apr 2 15:36:26 2007 +0930
Merge branch 'master' into mpx
Conflicts:
Xi/closedev.c
Xi/exevents.c
Xi/extinit.c
Xi/listdev.c
dix/window.c
hw/xfree86/common/xf86Xinput.c
include/extinit.h
mi/mipointer.c
diff --cc Xi/chdevcur.c
index fc4b0e0,0000000..e69a266
mode 100644,000000..100644
@@@ -1,123 -1,0 +1,123 @@@
+/*
+
+Copyright 2006 Peter Hutterer <peter at cs.unisa.edu.au>
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the author shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the author.
+
+*/
+
+/***********************************************************************
+ *
+ * Request to change a given device pointer's cursor.
+ *
+ */
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h> /* for inputstr.h */
+#include <X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include "scrnintstr.h" /* screen structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "extnsionst.h"
+#include "extinit.h" /* LookupDeviceIntRec */
+#include "exevents.h"
+#include "exglobals.h"
+
+#include "chdevcur.h"
+
+/***********************************************************************
+ *
+ * This procedure allows a client to set one pointer's cursor.
+ *
+ */
+
+int
- SProcXChangeDeviceCursor(register ClientPtr client)
++SProcXChangeDeviceCursor(ClientPtr client)
+{
- register char n;
++ char n;
+
+ REQUEST(xChangeDeviceCursorReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
+ return (ProcXChangeDeviceCursor(client));
+}
+
- int ProcXChangeDeviceCursor(register ClientPtr client)
++int ProcXChangeDeviceCursor(ClientPtr client)
+{
+ int err;
+ WindowPtr pWin = NULL;
+ DeviceIntPtr pDev = NULL;
+ CursorPtr pCursor = NULL;
+
+ REQUEST(xChangeDeviceCursorReq);
+ REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
+
+ pDev = LookupDeviceIntRec(stuff->deviceid);
+ if (pDev == NULL) {
+ SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor, 0,
+ BadDevice);
+ return Success;
+ }
+
+ if (stuff->win != None)
+ {
+ err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess);
+ if (err != Success)
+ {
+ SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
+ stuff->win, err);
+ return Success;
+ }
+ }
+
+ if (stuff->cursor == None)
+ {
+ if (pWin == WindowTable[pWin->drawable.pScreen->myNum])
+ pCursor = rootCursor;
+ else
+ pCursor = (CursorPtr)None;
+ }
+ else
+ {
+ pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
+ RT_CURSOR, DixReadAccess);
+ if (!pCursor)
+ {
+ SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
+ stuff->cursor, BadCursor);
+ return Success;
+ }
+ }
+
+ ChangeWindowDeviceCursor(pWin, pDev, pCursor);
+
+ return Success;
+}
+
diff --cc Xi/chpkpair.c
index 8e79a75,0000000..fcbdcdf
mode 100644,000000..100644
@@@ -1,110 -1,0 +1,110 @@@
+/*
+
+Copyright 2006 Peter Hutterer <peter at cs.unisa.edu.au>
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the author shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the author.
+
+*/
+
+/***********************************************************************
+ *
+ * Request change pairing between pointer and keyboard device.
+ *
+ */
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h> /* for inputstr.h */
+#include <X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include "scrnintstr.h" /* screen structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "extnsionst.h"
+#include "extinit.h" /* LookupDeviceIntRec */
+#include "exevents.h"
+#include "exglobals.h"
+
+
+#include "chpkpair.h"
+
+/***********************************************************************
+ *
+ * This procedure allows a client to change the pairing of a pointer with a
+ * a keyboard.
+ *
+ */
+
- int SProcXChangePointerKeyboardPairing(register ClientPtr client)
++int SProcXChangePointerKeyboardPairing(ClientPtr client)
+{
- register char n;
++ char n;
+
+ REQUEST(xChangePointerKeyboardPairingReq);
+ swaps(&stuff->length, n);
+ return (ProcXChangePointerKeyboardPairing(client));
+}
+
+int
- ProcXChangePointerKeyboardPairing(register ClientPtr client)
++ProcXChangePointerKeyboardPairing(ClientPtr client)
+{
+ DeviceIntPtr pPointer, pKeyboard;
+ int ret;
+
+ REQUEST(xChangePointerKeyboardPairingReq);
+ REQUEST_SIZE_MATCH(xChangePointerKeyboardPairingReq);
+
+ /* check if client is registered */
+
+ pPointer = LookupDeviceIntRec(stuff->pointer);
+ if (pPointer == NULL)
+ {
+ SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
+ stuff->pointer, BadDevice);
+ return Success;
+ }
+
+ pKeyboard = LookupDeviceIntRec(stuff->keyboard);
+ if (pKeyboard == NULL)
+ {
+ SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
+ stuff->keyboard, BadDevice);
+ return Success;
+ }
+
+ ret = PairDevices(client, pPointer, pKeyboard);
+ if (ret != Success)
+ {
+ SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
+ 0, ret);
+ return Success;
+ }
+
+
+ /* TODO: generate event here... */
+ return Success;
+}
diff --cc Xi/closedev.c
index 7bdd373,8d38ec8..8aebe10
@@@ -154,22 -140,36 +140,36 @@@
*
*/
- void
- DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
+ int
+ ProcXCloseDevice(ClientPtr client)
{
- InputClientsPtr others;
- OtherInputMasks *pOthers;
- GrabPtr grab, next;
+ int i;
+ WindowPtr pWin, p1;
+ DeviceIntPtr d;
- if ((pOthers = wOtherInputMasks(pWin)) != 0)
- for (others = pOthers->inputClients; others; others = others->next)
- if (SameClient(others, client))
- others->mask[dev->id] = NoEventMask;
+ REQUEST(xCloseDeviceReq);
+ REQUEST_SIZE_MATCH(xCloseDeviceReq);
- for (grab = wPassiveGrabs(pWin); grab; grab = next) {
- next = grab->next;
- if ((grab->device == dev) &&
- (client->clientAsMask == CLIENT_BITS(grab->resource)))
- FreeResource(grab->resource, RT_NONE);
+ d = LookupDeviceIntRec(stuff->deviceid);
+ if (d == NULL) {
+ SendErrorToClient(client, IReqCode, X_CloseDevice, 0, BadDevice);
+ return Success;
}
+
- if (d->grab && SameClient(d->grab, client))
- (*d->DeactivateGrab) (d); /* release active grab */
++ if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
++ (*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
+
+ /* Remove event selections from all windows for events from this device
+ * and selected by this client.
+ * Delete passive grabs from all windows for this device. */
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ pWin = WindowTable[i];
+ DeleteDeviceEvents(d, pWin, client);
+ p1 = pWin->firstChild;
+ DeleteEventsFromChildren(d, p1, client);
+ }
+
+ CloseInputDevice(d, client);
+ return Success;
}
diff --cc Xi/exevents.c
index 3e3f15a,9e71a9e..26f3640
@@@ -1185,10 -1154,10 +1185,10 @@@
}
void
- MaybeStopDeviceHint(register DeviceIntPtr dev, ClientPtr client)
+ MaybeStopDeviceHint(DeviceIntPtr dev, ClientPtr client)
{
WindowPtr pWin;
- GrabPtr grab = dev->grab;
+ GrabPtr grab = dev->deviceGrab.grab;
pWin = dev->valuator->motionHintWindow;
diff --cc Xi/extinit.c
index 971617e,b1ec321..9d921fa
@@@ -741,41 -555,99 +632,137 @@@
swaps(&to->control, n);
}
- void SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
++static void
++SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
+{
- register char n;
++ char n;
+
+ *to = *from;
+ swaps(&to->sequenceNumber,n);
+ swapl(&to->time, n);
+}
+
- void SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
++static void
++SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
+{
- register char n;
++ char n;
+
+ *to = *from;
+ swaps(&to->sequenceNumber,n);
+ swapl(&to->time, n);
+ swapl(&to->root, n);
+ swapl(&to->event, n);
+ swapl(&to->child, n);
+ swaps(&to->rootX, n);
+ swaps(&to->rootY, n);
+ swaps(&to->eventX, n);
+ swaps(&to->eventY, n);
+}
+
- void SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
++static void
++SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
+ pairingChangedNotify *to)
+{
- register char n;
++ char n;
+
+ *to = *from;
+ swaps(&to->sequenceNumber, n);
+ swapl(&to->time, n);
+}
+
+ /**************************************************************************
+ *
+ * Allow the specified event to have its propagation suppressed.
+ * The default is to not allow suppression of propagation.
+ *
+ */
+
+ static void
+ AllowPropagateSuppress(Mask mask)
+ {
+ int i;
+
+ for (i = 0; i < MAX_DEVICES; i++)
+ PropagateMask[i] |= mask;
+ }
+
+ /**************************************************************************
+ *
+ * Return the next available extension event mask.
+ *
+ */
+
+ static Mask
+ GetNextExtEventMask(void)
+ {
+ int i;
+ Mask mask = lastExtEventMask;
+
+ if (lastExtEventMask == 0) {
+ FatalError("GetNextExtEventMask: no more events are available.");
+ }
+ lastExtEventMask <<= 1;
+
+ for (i = 0; i < MAX_DEVICES; i++)
+ ExtValidMasks[i] |= mask;
+ return mask;
+ }
+
+ /**************************************************************************
+ *
+ * Record an event mask where there is no unique corresponding event type.
+ * We can't call SetMaskForEvent, since that would clobber the existing
+ * mask for that event. MotionHint and ButtonMotion are examples.
+ *
+ * Since extension event types will never be less than 64, we can use
+ * 0-63 in the EventInfo array as the "type" to be used to look up this
+ * mask. This means that the corresponding macros such as
+ * DevicePointerMotionHint must have access to the same constants.
+ *
+ */
+
+ static void
+ SetEventInfo(Mask mask, int constant)
+ {
+ EventInfo[ExtEventIndex].mask = mask;
+ EventInfo[ExtEventIndex++].type = constant;
+ }
+
+ /**************************************************************************
+ *
+ * Allow the specified event to be restricted to being selected by one
+ * client at a time.
+ * The default is to allow more than one client to select the event.
+ *
+ */
+
+ static void
+ SetExclusiveAccess(Mask mask)
+ {
+ int i;
+
+ for (i = 0; i < MAX_DEVICES; i++)
+ ExtExclusiveMasks[i] |= mask;
+ }
+
+ /**************************************************************************
+ *
+ * Assign the specified mask to the specified event.
+ *
+ */
+
+ static void
+ SetMaskForExtEvent(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);
+ }
+
/************************************************************************
*
* This function sets up extension event types and masks.
@@@ -983,22 -832,6 +970,22 @@@
RestoreExtensionEvents();
}
+/*****************************************************************
+ *
+ * Returns TRUE if the device has some sort of pointer type.
+ *
+ */
+
- Bool
++_X_EXPORT Bool
+DeviceIsPointerType(DeviceIntPtr dev)
+{
+ if (dev_type[1].type == dev->type)
+ return TRUE;
+
+ return FALSE;
+}
+
+
/***********************************************************************
*
* Assign an id and type to an input device.
@@@ -1052,95 -885,102 +1039,113 @@@
return NULL;
}
- /**************************************************************************
- *
- * Allow the specified event to be restricted to being selected by one
- * client at a time.
- * The default is to allow more than one client to select the event.
- *
- */
-
- void
- SetExclusiveAccess(Mask mask)
- {
- int i;
-
- for (i = 0; i < MAX_DEVICES; i++)
- ExtExclusiveMasks[i] |= mask;
- }
-
- /**************************************************************************
- *
- * Allow the specified event to have its propagation suppressed.
- * The default is to not allow suppression of propagation.
- *
- */
-
- void
- AllowPropagateSuppress(Mask mask)
- {
- int i;
-
- for (i = 0; i < MAX_DEVICES; i++)
- PropagateMask[i] |= mask;
- }
-
- /**************************************************************************
+ /*****************************************************************************
*
- * Return the next available extension event mask.
+ * SEventIDispatch
*
+ * Swap any events defined in this extension.
*/
+ #define DO_SWAP(func,type) func ((type *)from, (type *)to)
- Mask
- GetNextExtEventMask(void)
+ static void
+ SEventIDispatch(xEvent * from, xEvent * to)
{
- int i;
- Mask mask = lastExtEventMask;
+ int type = from->u.u.type & 0177;
- if (lastExtEventMask == 0) {
- FatalError("GetNextExtEventMask: no more events are available.");
+ if (type == DeviceValuator)
+ DO_SWAP(SEventDeviceValuator, deviceValuator);
+ else if (type == DeviceKeyPress) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceKeyRelease) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceButtonPress) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceButtonRelease) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceMotionNotify) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceFocusIn)
+ DO_SWAP(SEventFocus, deviceFocus);
+ else if (type == DeviceFocusOut)
+ DO_SWAP(SEventFocus, deviceFocus);
+ else if (type == ProximityIn) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == ProximityOut) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceStateNotify)
+ DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify);
+ else if (type == DeviceKeyStateNotify)
+ DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify);
+ else if (type == DeviceButtonStateNotify)
+ DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify);
+ else if (type == DeviceMappingNotify)
+ DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
+ else if (type == ChangeDeviceNotify)
+ DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
++ else if (type == DevicePresenceNotify)
++ DO_SWAP(SDevicePresenceNotifyEvent, devicePresenceNotify);
++ else if (type == DeviceEnterNotify)
++ DO_SWAP(SDeviceEnterNotifyEvent, deviceEnterNotify);
++ else if (type == DeviceLeaveNotify)
++ DO_SWAP(SDeviceLeaveNotifyEvent, deviceLeaveNotify);
++ else if (type == PointerKeyboardPairingChangedNotify)
++ DO_SWAP(SPointerKeyboardPairingChangedNotifyEvent, pairingChangedNotify);
+ else {
+ FatalError("XInputExtension: Impossible event!\n");
}
- lastExtEventMask <<= 1;
-
- for (i = 0; i < MAX_DEVICES; i++)
- ExtValidMasks[i] |= mask;
- return mask;
}
- /**************************************************************************
- *
- * Assign the specified mask to the specified event.
+ /**********************************************************************
*
- */
-
- void
- SetMaskForExtEvent(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);
- }
-
- /**************************************************************************
+ * IExtensionInit - initialize the input extension.
*
- * Record an event mask where there is no unique corresponding event type.
- * We can't call SetMaskForEvent, since that would clobber the existing
- * mask for that event. MotionHint and ButtonMotion are examples.
+ * Called from InitExtensions in main() or from QueryExtension() if the
+ * extension is dynamically loaded.
*
- * Since extension event types will never be less than 64, we can use
- * 0-63 in the EventInfo array as the "type" to be used to look up this
- * mask. This means that the corresponding macros such as
- * DevicePointerMotionHint must have access to the same constants.
+ * This extension has several events and errors.
*
*/
void
- SetEventInfo(Mask mask, int constant)
+ XInputExtensionInit(void)
{
- EventInfo[ExtEventIndex].mask = mask;
- EventInfo[ExtEventIndex++].type = constant;
+ ExtensionEntry *extEntry;
+
+ extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
+ SProcIDispatch, IResetProc, StandardMinorOpcode);
+ if (extEntry) {
+ IReqCode = extEntry->base;
+ 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;
+ EventSwapVector[DeviceButtonPress] = SEventIDispatch;
+ EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
+ EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
+ EventSwapVector[DeviceFocusIn] = SEventIDispatch;
+ EventSwapVector[DeviceFocusOut] = SEventIDispatch;
+ EventSwapVector[ProximityIn] = SEventIDispatch;
+ EventSwapVector[ProximityOut] = SEventIDispatch;
+ EventSwapVector[DeviceStateNotify] = SEventIDispatch;
+ EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
+ EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
+ EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
+ EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
++ EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
++ EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
++ EventSwapVector[PointerKeyboardPairingChangedNotify] = SEventIDispatch;
+ } else {
+ FatalError("IExtensionInit: AddExtensions failed\n");
+ }
}
diff --cc Xi/grabacc.c
index db9c9f2,0000000..59888ee
mode 100644,000000..100644
@@@ -1,102 -1,0 +1,102 @@@
+/*
+
+Copyright 2007 Peter Hutterer <peter at cs.unisa.edu.au>
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the author shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the author.
+
+*/
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h> /* for inputstr.h */
+#include <X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include "scrnintstr.h" /* screen structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "extnsionst.h"
+#include "extinit.h" /* LookupDeviceIntRec */
+#include "exevents.h"
+#include "exglobals.h"
+
+#include "grabacc.h"
+
+/***********************************************************************
+ *
+ * This procedure allows a client to register as the global client to control
+ * any window access.
+ *
+ */
+int
+SProcXGrabAccessControl(ClientPtr client)
+{
+ char n;
+ REQUEST(xGrabAccessControlReq);
+
+ swaps(&stuff->length, n);
+ return ProcXGrabAccessControl(client);
+}
+
+int
+ProcXGrabAccessControl(ClientPtr client)
+{
+ xGrabAccessControlReply rep;
+ REQUEST(xGrabAccessControlReq);
+ REQUEST_SIZE_MATCH(xGrabAccessControlReq);
+
+ if (stuff->ungrab)
+ ACUnregisterClient(client);
+
+ rep.repType = X_Reply;
+ rep.RepType = X_GrabAccessControl;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.success = stuff->ungrab || ACRegisterClient(client);
+
+ WriteReplyToClient(client, sizeof(xGrabAccessControlReply), &rep);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XGrabAccessControl function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXGrabAccessControl(ClientPtr client, int size,
+ xGrabAccessControlReply* rep)
+{
- register char n;
++ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ WriteToClient(client, size, (char *)rep);
+}
+
diff --cc Xi/listdev.c
index 33266ae,160ad02..a9fd401
@@@ -368,6 -274,91 +274,100 @@@
/***********************************************************************
*
+ * This procedure lists information to be returned for an input device.
+ *
+ */
+
+ static void
+ ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
+ char **devbuf, char **classbuf, char **namebuf)
+ {
+ CopyDeviceName(namebuf, d->name);
+ CopySwapDevice(client, d, 0, devbuf);
+ if (d->key != NULL) {
+ CopySwapKeyClass(client, d->key, classbuf);
+ dev->num_classes++;
+ }
+ if (d->button != NULL) {
+ CopySwapButtonClass(client, d->button, classbuf);
+ dev->num_classes++;
+ }
+ if (d->valuator != NULL) {
+ dev->num_classes +=
+ CopySwapValuatorClass(client, d->valuator, classbuf);
+ }
+ }
+
+ /***********************************************************************
+ *
+ * This procedure lists the input devices available to the server.
+ *
+ */
+
+ int
+ ProcXListInputDevices(ClientPtr client)
+ {
+ xListInputDevicesReply rep;
+ int numdevs = 0;
+ int namesize = 1; /* need 1 extra byte for strcpy */
+ int size = 0;
+ int total_length;
+ char *devbuf;
+ char *classbuf;
+ char *namebuf;
+ char *savbuf;
+ xDeviceInfo *dev;
+ DeviceIntPtr d;
+
+ REQUEST_SIZE_MATCH(xListInputDevicesReq);
+
+ rep.repType = X_Reply;
+ rep.RepType = X_ListInputDevices;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ AddOtherInputDevices();
+
++ SizeDeviceInfo(inputInfo.keyboard, &namesize, &size);
++ SizeDeviceInfo(inputInfo.pointer, &namesize, &size);
++ numdevs = 2;
++
+ for (d = inputInfo.devices; d; d = d->next) {
+ SizeDeviceInfo(d, &namesize, &size);
+ numdevs++;
+ }
+ for (d = inputInfo.off_devices; d; d = d->next) {
+ SizeDeviceInfo(d, &namesize, &size);
+ numdevs++;
+ }
+
+ total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
+ devbuf = (char *)xalloc(total_length);
+ classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
+ namebuf = classbuf + size;
+ savbuf = devbuf;
+
+ dev = (xDeviceInfoPtr) devbuf;
++ ListDeviceInfo(client, inputInfo.keyboard, dev++,
++ &devbuf, &classbuf, &namebuf);
++ ListDeviceInfo(client, inputInfo.pointer, 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);
+ WriteToClient(client, total_length, savbuf);
+ xfree(savbuf);
+ return Success;
+ }
+
+ /***********************************************************************
+ *
* This procedure writes the reply for the XListInputDevices function,
* if the client and server have a different byte ordering.
*
diff --cc Xi/querydp.c
index af93fed,0000000..d2ed0b8
mode 100644,000000..100644
@@@ -1,167 -1,0 +1,167 @@@
+/*
+
+Copyright 2006 Peter Hutterer <peter at cs.unisa.edu.au>
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the author shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the author.
+
+*/
+
+/***********************************************************************
+ *
+ * Request to query the pointer location of an extension input device.
+ *
+ */
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h> /* for inputstr.h */
+#include <X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "extnsionst.h"
+#include "extinit.h" /* LookupDeviceIntRec */
+#include "exevents.h"
+#include "exglobals.h"
+
+#ifdef PANORAMIX
+#include "panoramiXsrv.h"
+#endif
+
+#include "querydp.h"
+
+/***********************************************************************
+ *
+ * This procedure allows a client to query the pointer of a device.
+ *
+ */
+
+int
- SProcXQueryDevicePointer(register ClientPtr client)
++SProcXQueryDevicePointer(ClientPtr client)
+{
- register char n;
++ char n;
+
+ REQUEST(xQueryDevicePointerReq);
+ swaps(&stuff->length, n);
+ return (ProcXQueryDevicePointer(client));
+}
+
+int
- ProcXQueryDevicePointer(register ClientPtr client)
++ProcXQueryDevicePointer(ClientPtr client)
+{
+ int rc;
+ xQueryDevicePointerReply rep;
+ DeviceIntPtr pDev;
+ WindowPtr pWin, t;
+ SpritePtr pSprite;
+
+ REQUEST(xQueryDevicePointerReq);
+ REQUEST_SIZE_MATCH(xQueryDevicePointerReq);
+
+ pDev = LookupDeviceIntRec(stuff->deviceid);
+ if (pDev == NULL || pDev->valuator == NULL) {
+ SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
+ stuff->deviceid, BadDevice);
+ return Success;
+ }
+
+ rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
+ if (rc != Success)
+ {
+ SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
+ stuff->win, rc);
+ return Success;
+ }
+
+ if (pDev->valuator->motionHintWindow)
+ MaybeStopHint(pDev, client);
+
+ pSprite = pDev->spriteInfo->sprite;
+ rep.repType = X_Reply;
+ rep.RepType = X_QueryDevicePointer;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.mask = pDev->button->state | inputInfo.keyboard->key->state;
+ rep.root = (GetCurrentRootWindow())->drawable.id;
+ rep.rootX = pSprite->hot.x;
+ rep.rootY = pSprite->hot.y;
+ rep.child = None;
+ rep.shared = (pDev->spriteInfo->spriteOwner) ? xFalse : xTrue;
+
+ if (pSprite->hot.pScreen == pWin->drawable.pScreen)
+ {
+ rep.sameScreen = xTrue;
+ rep.winX = pSprite->hot.x - pWin->drawable.x;
+ rep.winY = pSprite->hot.y - pWin->drawable.y;
+ for (t = pSprite->win; t; t = t->parent)
+ if (t->parent == pWin)
+ {
+ rep.child = t->drawable.id;
+ break;
+ }
+ } else
+ {
+ rep.sameScreen = xFalse;
+ rep.winX = 0;
+ rep.winY = 0;
+ }
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ rep.rootX += panoramiXdataPtr[0].x;
+ rep.rootY += panoramiXdataPtr[0].y;
+ if (stuff->win == rep.root)
+ {
+ rep.winX += panoramiXdataPtr[0].x;
+ rep.winY += panoramiXdataPtr[0].y;
+ }
+ }
+#endif
+
+ WriteReplyToClient(client, sizeof(xQueryDevicePointerReply), &rep);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XQueryDevicePointer function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXQueryDevicePointer(ClientPtr client, int size,
+ xQueryDevicePointerReply * rep)
+{
- register char n;
++ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ WriteToClient(client, size, (char *)rep);
+}
+
diff --cc Xi/warpdevp.c
index 8df7e14,0000000..82d71d5
mode 100644,000000..100644
@@@ -1,187 -1,0 +1,187 @@@
+/*
+
+Copyright 2006 Peter Hutterer <peter at cs.unisa.edu.au>
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the author shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the author.
+
+*/
+
+/***********************************************************************
+ *
+ * Request to Warp the pointer location of an extension input device.
+ *
+ */
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h> /* for inputstr.h */
+#include <X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include "scrnintstr.h" /* screen structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "extnsionst.h"
+#include "extinit.h" /* LookupDeviceIntRec */
+#include "exevents.h"
+#include "exglobals.h"
+
+
+#include "warpdevp.h"
+/***********************************************************************
+ *
+ * This procedure allows a client to warp the pointer of a device.
+ *
+ */
+
+int
- SProcXWarpDevicePointer(register ClientPtr client)
++SProcXWarpDevicePointer(ClientPtr client)
+{
- register char n;
++ char n;
+
+ REQUEST(xWarpDevicePointerReq);
+ swaps(&stuff->length, n);
+ return (ProcXWarpDevicePointer(client));
+}
+
+int
- ProcXWarpDevicePointer(register ClientPtr client)
++ProcXWarpDevicePointer(ClientPtr client)
+{
+ int err;
+ int x, y;
+ WindowPtr dest = NULL;
+ DeviceIntPtr pDev;
+ SpritePtr pSprite;
+ ScreenPtr newScreen;
+
+ REQUEST(xWarpDevicePointerReq);
+ REQUEST_SIZE_MATCH(xWarpDevicePointerReq);
+
+ /* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
+
+ pDev = LookupDeviceIntRec(stuff->deviceid);
+ if (pDev == NULL) {
+ SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
+ stuff->deviceid,
+ BadDevice);
+ return Success;
+ }
+
+ if (stuff->dst_win != None)
+ {
+ err = dixLookupWindow(&dest, stuff->dst_win, client, DixReadAccess);
+ if (err != Success)
+ {
+ SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
+ stuff->dst_win, err);
+ return Success;
+ }
+ }
+
+ pSprite = pDev->spriteInfo->sprite;
+ x = pSprite->hotPhys.x;
+ y = pSprite->hotPhys.y;
+
+ if (stuff->src_win != None)
+ {
+ int winX, winY;
+ WindowPtr src;
+
+ err = dixLookupWindow(&src, stuff->src_win, client, DixReadAccess);
+ if (err != Success)
+ {
+ SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
+ stuff->src_win, err);
+ return Success;
+ }
+
+ winX = src->drawable.x;
+ winY = src->drawable.y;
+ if (src->drawable.pScreen != pSprite->hotPhys.pScreen ||
+ x < winX + stuff->src_x ||
+ y < winY + stuff->src_y ||
+ (stuff->src_width != 0 &&
+ winX + stuff->src_x + (int)stuff->src_width < 0) ||
+ (stuff->src_height != 0 &&
+ winY + stuff->src_y + (int)stuff->src_height < y) ||
+ !PointInWindowIsVisible(src, x, y))
+ return Success;
+ }
+
+ if (dest)
+ {
+ x = dest->drawable.x;
+ y = dest->drawable.y;
+ newScreen = dest->drawable.pScreen;
+ } else
+ newScreen = pSprite->hotPhys.pScreen;
+
+ x += stuff->dst_x;
+ y += stuff->dst_y;
+
+ if (x < 0)
+ x = 0;
+ else if (x > newScreen->width)
+ x = newScreen->width - 1;
+
+ if (y < 0)
+ y = 0;
+ else if (y > newScreen->height)
+ y = newScreen->height - 1;
+
+ if (newScreen == pSprite->hotPhys.pScreen)
+ {
+ if (x < pSprite->physLimits.x1)
+ x = pSprite->physLimits.x1;
+ else if (x >= pSprite->physLimits.x2)
+ x = pSprite->physLimits.x2 - 1;
+
+ if (y < pSprite->physLimits.y1)
+ y = pSprite->physLimits.y1;
+ else if (y >= pSprite->physLimits.y2)
+ y = pSprite->physLimits.y2 - 1;
+
+#if defined(SHAPE)
+ if (pSprite->hotShape)
+ ConfineToShape(pDev, pSprite->hotShape, &x, &y);
+#endif
+ (*newScreen->SetCursorPosition)(pDev, newScreen, x, y, TRUE);
+ } else if (!PointerConfinedToScreen(pDev))
+ {
+ NewCurrentScreen(pDev, newScreen, x, y);
+ }
+
+ /* if we don't update the device, we get a jump next time it moves */
+ pDev->valuator->lastx = x;
+ pDev->valuator->lasty = x;
+ miPointerUpdateSprite(pDev);
+
+ /* FIXME: XWarpPointer is supposed to generate an event. It doesn't do it
+ here though. */
+ return Success;
+}
+
diff --cc dix/devices.c
index 724ef98,f622be7..411188d
@@@ -79,11 -79,9 +79,12 @@@
#include "exglobals.h"
#include "exevents.h"
- int CoreDevicePrivatesIndex = 0, CoreDevicePrivatesGeneration = -1;
+ int CoreDevicePrivatesIndex = 0;
+ static int CoreDevicePrivatesGeneration = -1;
+/* The client that is allowed to change pointer-keyboard pairings. */
+static ClientPtr pairingClient = NULL;
+
DeviceIntPtr
AddInputDevice(DeviceProc deviceProc, Bool autoStart)
{
diff --cc dix/window.c
index f0d4cf8,96002eb..4e55319
@@@ -854,6 -832,26 +850,46 @@@
}
static void
+ DisposeWindowOptional (WindowPtr pWin)
+ {
+ if (!pWin->optional)
+ return;
+ /*
+ * everything is peachy. Delete the optional record
+ * and clean up
+ */
+ if (pWin->optional->cursor)
+ {
+ FreeCursor (pWin->optional->cursor, (Cursor)0);
+ pWin->cursorIsNone = FALSE;
+ }
+ else
+ pWin->cursorIsNone = TRUE;
++
++ if (pWin->optional->deviceCursors)
++ {
++ DevCursorList pList;
++ DevCursorList pPrev;
++ pList = pWin->optional->deviceCursors;
++ while(pList)
++ {
++ if (pList->cursor)
++ FreeCursor(pList->cursor, (XID)0);
++ pPrev = pList;
++ pList = pList->next;
++ xfree(pPrev);
++ }
++ pWin->optional->deviceCursors = NULL;
++ }
++
++ xfree(pWin->optional->access.perm);
++ xfree(pWin->optional->access.deny);
++
+ xfree (pWin->optional);
+ pWin->optional = NULL;
+ }
+
+ static void
FreeWindowResources(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
@@@ -3738,270 -3701,6 +3759,216 @@@
return TRUE;
}
- void
- DisposeWindowOptional (WindowPtr pWin)
- {
- if (!pWin->optional)
- return;
- /*
- * everything is peachy. Delete the optional record
- * and clean up
- */
- /*
- * TOG changed this code to:
- *
- * if (pWin->cursorIsNone == FALSE)
- * FreeCursor (pWin->optional->cursor, (Cursor)0);
- * pWin->cursorIsNone = TRUE;
- *
- * This is blatently wrong; windows without optionals can have
- * two different cursor values, either None or sharing their
- * parents cursor. This difference is controlled by the
- * cursorIsNone value; when TRUE, the window has no cursor,
- * when false, it shares its cursor with its parent; TOG
- * made it impossible for a window to have a cursor without
- * an optional record.
- */
- if (pWin->optional->cursor)
- {
- FreeCursor (pWin->optional->cursor, (Cursor)0);
- pWin->cursorIsNone = FALSE;
- }
- else
- pWin->cursorIsNone = TRUE;
-
- if (pWin->optional->deviceCursors)
- {
- DevCursorList pList;
- DevCursorList pPrev;
- pList = pWin->optional->deviceCursors;
- while(pList)
- {
- if (pList->cursor)
- FreeCursor(pList->cursor, (XID)0);
- pPrev = pList;
- pList = pList->next;
- xfree(pPrev);
- }
- pWin->optional->deviceCursors = NULL;
- }
-
- xfree(pWin->optional->access.perm);
- xfree(pWin->optional->access.deny);
-
- xfree (pWin->optional);
- pWin->optional = NULL;
- }
-
+/*
+ * Changes the cursor struct for the given device and the given window.
+ * A cursor that does not have a device cursor set will use whatever the
+ * standard cursor is for the window. If all devices have a cursor set,
+ * changing the window cursor (e.g. using XDefineCursor()) will not have any
+ * visible effect. Only when one of the device cursors is set to None again,
+ * this device's cursor will display the changed standard cursor.
+ *
+ * CursorIsNone of the window struct is NOT modified if you set a device
+ * cursor.
+ *
+ * Assumption: If there is a node for a device in the list, the device has a
+ * cursor. If the cursor is set to None, it is inherited by the parent.
+ */
- int ChangeWindowDeviceCursor(register WindowPtr pWin,
- DeviceIntPtr pDev,
- CursorPtr pCursor)
++_X_EXPORT int
++ChangeWindowDeviceCursor(WindowPtr pWin,
++ DeviceIntPtr pDev,
++ CursorPtr pCursor)
+{
+ DevCursNodePtr pNode, pPrev;
+ CursorPtr pOldCursor = NULL;
+ ScreenPtr pScreen;
+ WindowPtr pChild;
+
+ if (!pWin->optional && !MakeWindowOptional(pWin))
+ return BadAlloc;
+
+ /* 1) Check if window has device cursor set
+ * Yes: 1.1) swap cursor with given cursor if parent does not have same
+ * cursor, free old cursor
+ * 1.2) free old cursor, use parent cursor
+ * No: 1.1) add node to beginning of list.
+ * 1.2) add cursor to node if parent does not have same cursor
+ * 1.3) use parent cursor if parent does not have same cursor
+ * 2) Patch up children if child has a devcursor
+ * 2.1) if child has cursor None, it inherited from parent, set to old
+ * cursor
+ * 2.2) if child has same cursor as new cursor, remove and set to None
+ */
+
+ pScreen = pWin->drawable.pScreen;
+
+ if (WindowSeekDeviceCursor(pWin, pDev, &pNode, &pPrev))
+ {
+ /* has device cursor */
+
+ if (pNode->cursor == pCursor)
+ return Success;
+
+ pOldCursor = pNode->cursor;
+
+ if (!pCursor) /* remove from list */
+ {
+ pPrev->next = pNode->next;
+ xfree(pNode);
+ }
+
+ } else
+ {
+ /* no device cursor yet */
+ DevCursNodePtr pNewNode;
+
+ if (!pCursor)
+ return Success;
+
+ pNewNode = (DevCursNodePtr)xalloc(sizeof(DevCursNodeRec));
+ pNewNode->dev = pDev;
+ pNewNode->next = pWin->optional->deviceCursors;
+ pWin->optional->deviceCursors = pNewNode;
+ pNode = pNewNode;
+
+ }
+
+ if (pCursor && WindowParentHasDeviceCursor(pWin, pDev, pCursor))
+ pNode->cursor = None;
+ else
+ {
+ pNode->cursor = pCursor;
+ pCursor->refcnt++;
+ }
+
+ pNode = pPrev = NULL;
+ /* fix up children */
+ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
+ {
+ if (WindowSeekDeviceCursor(pChild, pDev, &pNode, &pPrev))
+ {
+ if (pNode->cursor == None) /* inherited from parent */
+ {
+ pNode->cursor = pOldCursor;
+ pOldCursor->refcnt++;
+ } else if (pNode->cursor == pCursor)
+ {
+ pNode->cursor = None;
+ FreeCursor(pCursor, (Cursor)0); /* fix up refcnt */
+ }
+ }
+ }
+
+ if (pWin->realized)
+ WindowHasNewCursor(pWin);
+
+ if (pOldCursor)
+ FreeCursor(pOldCursor, (Cursor)0);
+
+ /* FIXME: We SHOULD check for an error value here XXX
+ (comment taken from ChangeWindowAttributes) */
+ (*pScreen->ChangeWindowAttributes)(pWin, CWCursor);
+
+ return Success;
+}
+
+/* Get device cursor for given device or None if none is set */
- CursorPtr WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev)
++_X_EXPORT CursorPtr
++WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev)
+{
+ DevCursorList pList;
+
+ if (!pWin->optional || !pWin->optional->deviceCursors)
+ return NULL;
+
+ pList = pWin->optional->deviceCursors;
+
+ while(pList)
+ {
+ if (pList->dev == pDev)
+ {
+ if (pList->cursor == None) /* inherited from parent */
+ return WindowGetDeviceCursor(pWin->parent, pDev);
+ else
+ return pList->cursor;
+ }
+ pList = pList->next;
+ }
+ return NULL;
+}
+
+/* Searches for a DevCursorNode for the given window and device. If one is
+ * found, return True and set pNode and pPrev to the node and to the node
+ * before the node respectively. Otherwise return False.
+ * If the device is the first in list, pPrev is set to NULL.
+ */
+static Bool
+WindowSeekDeviceCursor(WindowPtr pWin,
+ DeviceIntPtr pDev,
+ DevCursNodePtr* pNode,
+ DevCursNodePtr* pPrev)
+{
+ DevCursorList pList;
+
+ if (!pWin->optional)
+ return FALSE;
+
+ pList = pWin->optional->deviceCursors;
+
+ if (pList && pList->dev == pDev)
+ {
+ *pNode = pList;
+ *pPrev = NULL;
+ return TRUE;
+ }
+
+ while(pList)
+ {
+ if (pList->next)
+ {
+ if (pList->next->dev == pDev)
+ {
+ *pNode = pList->next;
+ *pPrev = pList;
+ return TRUE;
+ }
+ }
+ pList = pList->next;
+ }
+ return FALSE;
+}
+
+/* Return True if a parent has the same device cursor set or False if
+ * otherwise
+ */
+static Bool
+WindowParentHasDeviceCursor(WindowPtr pWin,
+ DeviceIntPtr pDev,
+ CursorPtr pCursor)
+{
+ WindowPtr pParent;
+ DevCursNodePtr pParentNode, pParentPrev;
+
+ pParent = pWin->parent;
+ while(pParent)
+ {
+ if (WindowSeekDeviceCursor(pParent, pDev,
+ &pParentNode, &pParentPrev))
+ {
+ /* if there is a node in the list, the win has a dev cursor */
+ if (!pParentNode->cursor) /* inherited. loop needs to cont. */
+ {
+ } else if (pParentNode->cursor == pCursor) /* inherit */
+ return TRUE;
+ else /* different cursor */
+ return FALSE;
+ }
+ else
+ /* parent does not have a device cursor for our device */
+ return FALSE;
+ }
+ return FALSE;
+}
+
-
#ifndef NOLOGOHACK
static void
DrawLogo(WindowPtr pWin)
diff --cc hw/xfree86/common/xf86Xinput.c
index 2c74001,17ffed8..cc98a0c
@@@ -521,13 -504,16 +549,15 @@@
va_list var;
int *valuators = NULL;
int i = 0, nevents = 0;
- int flags = 0;
-
- if (is_absolute)
- flags = POINTER_ABSOLUTE;
- else
- flags = POINTER_RELATIVE;
+ int index;
+ #if XFreeXDGA
+ if (miPointerGetScreen(inputInfo.pointer)) {
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (DGAStealButtonEvent(index, button, is_down))
+ return;
+ }
+ #endif
-
valuators = xcalloc(sizeof(int), num_valuators);
va_start(var, num_valuators);
@@@ -542,7 -528,8 +572,7 @@@
nevents = GetPointerEvents(xf86Events, device,
is_down ? ButtonPress : ButtonRelease, button,
- flags,
- is_absolute ? POINTER_ABSOLUTE :
- POINTER_RELATIVE,
++ (is_absolute) ? POINTER_ABSOLUTE : POINTER_RELATIVE,
first_valuator, num_valuators, valuators);
for (i = 0; i < nevents; i++)
diff --cc include/extinit.h
index 7a12b1b,e616b6d..d008651
@@@ -37,116 -37,6 +37,11 @@@
void
);
-
- int
- ProcIDispatch (
- ClientPtr /* client */
- );
-
- int
- SProcIDispatch(
- ClientPtr /* client */
- );
-
- void
- SReplyIDispatch (
- ClientPtr /* client */,
- int /* len */,
- xGrabDeviceReply * /* rep */
- );
-
- void
- SEventIDispatch (
- xEvent * /* from */,
- xEvent * /* to */
- );
-
- void
- SEventDeviceValuator (
- deviceValuator * /* from */,
- deviceValuator * /* to */
- );
-
- void
- SEventFocus (
- deviceFocus * /* from */,
- deviceFocus * /* to */
- );
-
- void
- SDeviceStateNotifyEvent (
- deviceStateNotify * /* from */,
- deviceStateNotify * /* to */
- );
-
- void
- SDeviceKeyStateNotifyEvent (
- deviceKeyStateNotify * /* from */,
- deviceKeyStateNotify * /* to */
- );
-
- void
- SDeviceButtonStateNotifyEvent (
- deviceButtonStateNotify * /* from */,
- deviceButtonStateNotify * /* to */
- );
-
- void
- SChangeDeviceNotifyEvent (
- changeDeviceNotify * /* from */,
- changeDeviceNotify * /* to */
- );
-
- void
- SDeviceMappingNotifyEvent (
- deviceMappingNotify * /* from */,
- deviceMappingNotify * /* to */
- );
-
- void
- SDevicePresenceNotifyEvent (
- devicePresenceNotify * /* from */,
- devicePresenceNotify * /* to */
- );
-
- void
- SDeviceEnterNotifyEvent (
- deviceEnterNotify * /* from */,
- deviceEnterNotify * /* to */
- );
-
- void
- SDeviceLeaveNotifyEvent (
- deviceLeaveNotify * /* from */,
- deviceLeaveNotify * /* to */
- );
-
- void
- SPointerKeyboardPairingChangedNotifyEvent (
- pairingChangedNotify * /* from */,
- pairingChangedNotify * /* to */
- );
-
- void
- FixExtensionEvents (
- ExtensionEntry * /* extEntry */
- );
-
- void
- RestoreExtensionEvents (
- void
- );
-
- void
- IResetProc(
- ExtensionEntry * /* unused */
- );
-
+Bool
+DeviceIsPointerType(
+ DeviceIntPtr dev
+ );
+
void
AssignTypeAndName (
DeviceIntPtr /* dev */,
diff --cc mi/mipointer.c
index 3c09064,b86a26a..863a405
@@@ -467,6 -404,27 +462,30 @@@
miPointerSetPosition(inputInfo.pointer, &x, &y, time);
}
+ /* Move the pointer on the current screen, and update the sprite. */
+ static void
+ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
+ unsigned long time)
+ {
++ int valuators[2];
++ miPointerPtr pPointer = MIPOINTER(pDev);
+ SetupScreen(pScreen);
+
- if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer) &&
- !pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
++
++ if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer)
++ && !pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen)
+ {
- miPointer.devx = x;
- miPointer.devy = y;
- if(!miPointer.pCursor->bits->emptyMask)
- (*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
++ pPointer->devx = x;
++ pPointer->devy = y;
++ if(!pPointer->pCursor->bits->emptyMask)
++ (*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
+ }
+
- miPointer.x = x;
- miPointer.y = y;
- miPointer.pScreen = pScreen;
++ pPointer->x = x;
++ pPointer->y = y;
++ pPointer->pScreen = pScreen;
+ }
+
_X_EXPORT void
miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time)
{
diff-tree 96ce17aa94413c4b8bcb61cae71167050130a307 (from f2808005f4ee72c5fd7f5f3dcca181306485113e)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Wed Nov 15 17:50:02 2006 +1030
o fix minor error in comment for GetPointerEvents()
diff --git a/dix/getevents.c b/dix/getevents.c
index 3f636bc..219d1a1 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -470,7 +470,7 @@ GetKeyboardValuatorEvents(xEvent *events
/**
- * Generate a series of xEvents (returned in xE) representing pointer
+ * Generate a series of xEvents (returned in events) representing pointer
* motion, or button presses. Xi and XKB-aware.
*
* events is not NULL-terminated; the return value is the number of events.
diff-tree f2808005f4ee72c5fd7f5f3dcca181306485113e (from 5257b32e492bd2082bef6a4cd0fea03ce093c0f8)
Author: Alberto Mardegan <mardy at users.sourceforge.net>
Date: Sat Mar 31 16:51:24 2007 +0200
Bug #6620: Fixed a missing 'else' in ATIPseudoDMAInit().
Before this, we'd write some registers twice on R200 hardware and also
possibly end up with a bad value in atis->cce_pri_size.
diff --git a/hw/kdrive/ati/ati_dma.c b/hw/kdrive/ati/ati_dma.c
index f75ff12..70b86d3 100644
--- a/hw/kdrive/ati/ati_dma.c
+++ b/hw/kdrive/ati/ati_dma.c
@@ -788,7 +788,7 @@ ATIPseudoDMAInit(ScreenPtr pScreen)
atis->cce_pri_size = MMIO_IN32(mmio, RADEON_REG_CP_CSQ_CNTL) &
R200_CSQ_CNT_PRIMARY_MASK;
MMIO_OUT32(mmio, RADEON_REG_ME_CNTL, RADEON_ME_MODE_FREE_RUN);
- } if (atic->is_radeon) {
+ } else if (atic->is_radeon) {
MMIO_OUT32(mmio, RADEON_REG_CP_CSQ_CNTL,
RADEON_CSQ_PRIPIO_INDDIS);
atis->cce_pri_size = MMIO_IN32(mmio, RADEON_REG_CP_CSQ_CNTL) &
diff-tree 5257b32e492bd2082bef6a4cd0fea03ce093c0f8 (from 73fdc16bc4f4e21ff604b3f9ded23b40398fb1b6)
Author: Aaron Plattner <aplattner at nvidia.com>
Date: Wed Mar 28 15:51:24 2007 -0700
Bump video driver ABI to 2.0 for cw change (commit 6ed08949af4f7ac09170d3d9581e4092b24a84ee).
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 2811839..8e644c4 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -84,7 +84,7 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(1, 2)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5)
diff-tree 73fdc16bc4f4e21ff604b3f9ded23b40398fb1b6 (from ebdc8ce5c108dc3b6b0004e7c7939d1a5bef8676)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 16:07:26 2007 -0600
formatting fixes
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index d76dd9b..cf68051 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -472,8 +472,10 @@ static int dmxDeviceOnOff(DeviceIntPtr p
memset(&info, 0, sizeof(info));
switch (what) {
case DEVICE_INIT:
- if (dmxLocal->init) dmxLocal->init(pDev);
- if (dmxLocal->get_info) dmxLocal->get_info(pDev, &info);
+ if (dmxLocal->init)
+ dmxLocal->init(pDev);
+ if (dmxLocal->get_info)
+ dmxLocal->get_info(pDev, &info);
if (info.keyboard) { /* XKEYBOARD makes this a special case */
dmxKeyboardOn(pDevice, &info);
break;
@@ -594,7 +596,8 @@ static void dmxProcessInputEvents(DMXInp
#if 00 /*BP*/
miPointerUpdate();
#endif
- if (dmxInput->detached) return;
+ if (dmxInput->detached)
+ return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->process_input) {
#if 11 /*BP*/
@@ -633,7 +636,8 @@ static void dmxUpdateWindowInformation(D
}
#endif
- if (dmxInput->detached) return;
+ if (dmxInput->detached)
+ return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->update_info)
dmxInput->devs[i]->update_info(dmxInput->devs[i]->private,
@@ -644,7 +648,8 @@ static void dmxCollectAll(DMXInputInfo *
{
int i;
- if (dmxInput->detached) return;
+ if (dmxInput->detached)
+ return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->collect_events)
dmxInput->devs[i]->collect_events(&dmxInput->devs[i]
@@ -741,7 +746,8 @@ static DeviceIntPtr dmxAddDevice(DMXLoca
char *devname;
DMXInputInfo *dmxInput;
- if (!dmxLocal) return NULL;
+ if (!dmxLocal)
+ return NULL;
dmxInput = &dmxInputs[dmxLocal->inputIdx];
if (dmxLocal->sendsCore) {
diff-tree ebdc8ce5c108dc3b6b0004e7c7939d1a5bef8676 (from 3c7413e0c2f87e154aa8aa4a83bd585a6d1091e8)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 16:05:46 2007 -0600
Checkpoint DMX updates: things are working much better now, but still not 100% right.
Use new dmxCoreMotion2() function which enqueues motion events with
GetPointerEvents()/mieqEnqueue().
The clipAxis() code in GetPointerEvents() is causing some grief. The
limits seem to have always been (0,0) according to the original calls
to InitValuatorAxisStruct() in dmxinputinit.c.
Terrible hack for now: Call InitValuatorAxisStruct() with hard-coded max
values of 1280 (my screen width).
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index 11c89d8..a7d9378 100644
--- a/hw/dmx/dmxcursor.c
+++ b/hw/dmx/dmxcursor.c
@@ -889,7 +889,7 @@ static void dmxSetCursor(ScreenPtr pScre
gx = start->rootXOrigin + x;
gy = start->rootYOrigin + y;
if (x && y && (GX != gx || GY != gy))
- dmxCoreMotion(gx, gy, 0, DMX_NO_BLOCK);
+ dmxCoreMotion(NULL, gx, gy, 0, DMX_NO_BLOCK);
if (!start->over || !dmxCursorDoMultiCursors || start->cursorNotShared) {
_dmxSetCursor(pScreen, pCursor, x, y);
diff --git a/hw/dmx/dmxinput.h b/hw/dmx/dmxinput.h
index 59fa823..3fb5870 100644
--- a/hw/dmx/dmxinput.h
+++ b/hw/dmx/dmxinput.h
@@ -154,7 +154,7 @@ typedef enum {
extern void dmxGetGlobalPosition(int *x, int *y);
extern DMXScreenInfo *dmxFindFirstScreen(int x, int y);
-extern void dmxCoreMotion(int x, int y, int delta,
+extern void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta,
DMXBlockType block);
/* Support for dynamic addition of inputs. This functions is defined in
diff --git a/hw/dmx/input/dmxbackend.c b/hw/dmx/input/dmxbackend.c
index 61d1bfe..7efb2ee 100644
--- a/hw/dmx/input/dmxbackend.c
+++ b/hw/dmx/input/dmxbackend.c
@@ -395,7 +395,7 @@ void dmxBackendCollectEvents(DevicePtr p
}
break;
case MotionNotify:
-#if 00 /*BP*/
+#if 001 /*BP*/
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
dmxScreen->index, priv->myScreen,
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index 0cc3054..fae2049 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -191,7 +191,42 @@ DMXScreenInfo *dmxFindFirstScreen(int x,
return NULL;
}
-void dmxCoreMotion(int x, int y, int delta, DMXBlockType block)
+
+#if 11/*BP*/
+
+static void enqueueMotion(DevicePtr pDev, int x, int y)
+{
+ GETDMXINPUTFROMPDEV;
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ int detail = 0;
+
+ valuators[0] = x;
+ valuators[1] = y;
+ valuators[2] = detail;
+ nevents = GetPointerEvents(events,
+ /*pDev*/p,
+ MotionNotify,
+ detail,
+ POINTER_ABSOLUTE,
+ 0, 2, valuators);
+ ErrorF("MOTION2 %d, %d n = %d\n", valuators[0], valuators[1], nevents);
+ /*
+ ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
+ detail, e->xmotion.state,
+ valuators[0], valuators[1], valuators[2],
+ nevents);
+ */
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, events + i);
+ xfree(events);
+ return;
+}
+
+
+static void
+dmxCoreMotion2(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
{
DMXScreenInfo *dmxScreen;
DMXInputInfo *dmxInput;
@@ -214,6 +249,106 @@ void dmxCoreMotion(int x, int y, int del
if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
+ ErrorF("Global Pos: %d, %d\n", dmxGlobalX, dmxGlobalY);
+
+ if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
+ localX = dmxGlobalX - dmxScreen->rootXOrigin;
+ localY = dmxGlobalY - dmxScreen->rootYOrigin;
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))
+ && pScreen->myNum == dmxScreen->index) {
+ /* Screen is old screen */
+ if (block)
+ dmxSigioBlock();
+#if 000
+ miPointerSetPosition(inputInfo.pointer, &localX, &localY,
+ GetTimeInMillis());
+#else
+ if (pDev)
+ enqueueMotion(pDev, localX, localY);
+#endif
+ if (block)
+ dmxSigioUnblock();
+ } else {
+ /* Screen is new */
+ DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n",
+ pScreen->myNum, dmxScreen->index, localX, localY);
+ if (block)
+ dmxSigioBlock();
+ dmxeqProcessInputEvents();
+ miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
+ localX, localY);
+#if 000
+ miPointerSetPosition(inputInfo.pointer, &localX, &localY,
+ GetTimeInMillis());
+#else
+ if (pDev)
+ enqueueMotion(pDev, localX, localY);
+#endif
+ if (block)
+ dmxSigioUnblock();
+ }
+#if 00
+ miPointerGetPosition(inputInfo.pointer, &localX, &localY);
+
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))) {
+ dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
+ dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
+ ErrorF("Global is now %d, %d %d, %d\n", dmxGlobalX, dmxGlobalY,
+ localX, localY);
+ DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
+ " on screen index=%d/%d localX=%d localY=%d\n",
+ dmxGlobalX, dmxGlobalY,
+ dmxScreen ? dmxScreen->index : -1, pScreen->myNum,
+ localX, localY);
+ }
+#endif
+ }
+ /* Send updates down to all core input
+ * drivers */
+ for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
+ int j;
+
+ for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding)
+ if (!dmxInput->detached
+ && dmxInput->devs[j]->sendsCore
+ && dmxInput->devs[j]->update_position)
+ dmxInput->devs[j]->update_position(dmxInput->devs[j]->private,
+ dmxGlobalX, dmxGlobalY);
+ }
+ if (!dmxScreen) ProcessInputEvents();
+}
+#endif
+
+void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
+{
+ DMXScreenInfo *dmxScreen;
+ DMXInputInfo *dmxInput;
+ ScreenPtr pScreen;
+ int localX;
+ int localY;
+ int i;
+
+#if 11/*BP*/
+ dmxCoreMotion2(pDev, x, y, delta, block);
+ return;
+#endif
+
+ if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) return;
+
+ DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
+ x, y, delta, dmxGlobalX, dmxGlobalY);
+
+ dmxGlobalInvalid = 0;
+ dmxGlobalX = x;
+ dmxGlobalY = y;
+
+ if (dmxGlobalX < 0) dmxGlobalX = 0;
+ if (dmxGlobalY < 0) dmxGlobalY = 0;
+ if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
+ if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
+
+ ErrorF("Global Pos: %d, %d\n", dmxGlobalX, dmxGlobalY);
+
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
localX = dmxGlobalX - dmxScreen->rootXOrigin;
localY = dmxGlobalY - dmxScreen->rootYOrigin;
@@ -285,6 +420,8 @@ void dmxCoreMotion(int x, int y, int del
if (!dmxScreen) ProcessInputEvents();
}
+
+
#ifdef XINPUT
#define DMX_MAX_AXES 32 /* Max axes reported by this routine */
static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
@@ -534,12 +671,18 @@ void dmxMotion(DevicePtr pDev, int *v, i
return;
}
#endif
- if (axesCount == 2) switch (type) {
- case DMX_RELATIVE: dmxCoreMotion(dmxGlobalX - v[0],
- dmxGlobalY - v[1],
- 0, block); break;
- case DMX_ABSOLUTE: dmxCoreMotion(v[0], v[1], 0, block); break;
- case DMX_ABSOLUTE_CONFINED: dmxCoreMotion(v[0], v[1], -1, block); break;
+ if (axesCount == 2) {
+ switch (type) {
+ case DMX_RELATIVE:
+ dmxCoreMotion(pDev, dmxGlobalX - v[0], dmxGlobalY - v[1], 0, block);
+ break;
+ case DMX_ABSOLUTE:
+ dmxCoreMotion(pDev, v[0], v[1], 0, block);
+ break;
+ case DMX_ABSOLUTE_CONFINED:
+ dmxCoreMotion(pDev, v[0], v[1], -1, block);
+ break;
+ }
}
}
@@ -669,7 +812,7 @@ void dmxEnqueue(DevicePtr pDev, int type
/*KeyPress*/type,
detail,
POINTER_ABSOLUTE,
- 0, 3, valuators);
+ 0, 2/*3*/, valuators);
ErrorF("BUTTON %d, %d %d n=%d\n",
valuators[0], valuators[1], valuators[2], nevents);
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 1465ade..d76dd9b 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -507,7 +507,7 @@ static int dmxDeviceOnOff(DeviceIntPtr p
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
- info.maxval[0], info.res[0],
+ 1280/*info.maxval[0]*/, info.res[0],
info.minres[0], info.maxres[0]);
#endif
} else if (info.numRelAxes) {
@@ -518,7 +518,7 @@ static int dmxDeviceOnOff(DeviceIntPtr p
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
- info.maxval[0], info.res[0],
+ 1280/*info.maxval[0]*/, info.res[0],
info.minres[0], info.maxres[0]);
#endif
} else if (info.numAbsAxes) {
@@ -529,7 +529,7 @@ static int dmxDeviceOnOff(DeviceIntPtr p
#ifdef XINPUT
for (i = 0; i < info.numAbsAxes; i++)
InitValuatorAxisStruct(pDevice, i+info.numRelAxes,
- info.minval[i+1], info.maxval[i+1],
+ info.minval[i+1], 1280/*info.maxval[i+1]*/,
info.res[i+1], info.minres[i+1],
info.maxres[i+1]);
#endif
diff-tree 3c7413e0c2f87e154aa8aa4a83bd585a6d1091e8 (from 7989dacdcb1449b10d7733dda11cd96e260e9fae)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 14:07:04 2007 -0600
Tweak some parameters, etc. Things seem a little better now, but still a ways to go.
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index 3027457..0cc3054 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -262,6 +262,7 @@ void dmxCoreMotion(int x, int y, int del
#endif
dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
+ ErrorF("Global is now %d, %d\n", dmxGlobalX, dmxGlobalY);
DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
" on screen index=%d/%d localX=%d localY=%d\n",
dmxGlobalX, dmxGlobalY,
@@ -655,19 +656,20 @@ void dmxEnqueue(DevicePtr pDev, int type
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
- /*
+
valuators[0] = e->xbutton.x;
valuators[1] = e->xbutton.y;
- */
+ /*
valuators[0] = dmxGlobalX;
valuators[1] = dmxGlobalY;
+ */
valuators[2] = e->xbutton.button;
nevents = GetPointerEvents(events,
/*pDev*/p,
/*KeyPress*/type,
detail,
POINTER_ABSOLUTE,
- 0, 1, valuators);
+ 0, 3, valuators);
ErrorF("BUTTON %d, %d %d n=%d\n",
valuators[0], valuators[1], valuators[2], nevents);
@@ -698,7 +700,7 @@ void dmxEnqueue(DevicePtr pDev, int type
/*KeyPress*/type,
detail,
POINTER_ABSOLUTE,
- 0, 1, valuators);
+ 0, 3, valuators);
ErrorF("MOTION %d, %d n = %d\n", valuators[0], valuators[1], nevents);
/*
ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index c098c46..1465ade 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -507,7 +507,7 @@ static int dmxDeviceOnOff(DeviceIntPtr p
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
- /*1280*/info.maxval[0], info.res[0],
+ info.maxval[0], info.res[0],
info.minres[0], info.maxres[0]);
#endif
} else if (info.numRelAxes) {
@@ -518,7 +518,7 @@ static int dmxDeviceOnOff(DeviceIntPtr p
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
- /*1280*/info.maxval[0], info.res[0],
+ info.maxval[0], info.res[0],
info.minres[0], info.maxres[0]);
#endif
} else if (info.numAbsAxes) {
@@ -529,7 +529,7 @@ static int dmxDeviceOnOff(DeviceIntPtr p
#ifdef XINPUT
for (i = 0; i < info.numAbsAxes; i++)
InitValuatorAxisStruct(pDevice, i+info.numRelAxes,
- info.minval[i+1], /*1280*/info.maxval[i+1],
+ info.minval[i+1], info.maxval[i+1],
info.res[i+1], info.minres[i+1],
info.maxres[i+1]);
#endif
diff-tree 7989dacdcb1449b10d7733dda11cd96e260e9fae (from 1ea842960fddbc6363cc6e7f914d70ba45525a6b)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 13:44:24 2007 -0600
num_valuators=1 for GetPointerEvents(), hack ButtonPress/Release position
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index 9a31ba6..3027457 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -655,19 +655,19 @@ void dmxEnqueue(DevicePtr pDev, int type
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ /*
valuators[0] = e->xbutton.x;
valuators[1] = e->xbutton.y;
- /*
+ */
valuators[0] = dmxGlobalX;
valuators[1] = dmxGlobalY;
- */
valuators[2] = e->xbutton.button;
nevents = GetPointerEvents(events,
/*pDev*/p,
/*KeyPress*/type,
detail,
POINTER_ABSOLUTE,
- 0, 0, valuators);
+ 0, 1, valuators);
ErrorF("BUTTON %d, %d %d n=%d\n",
valuators[0], valuators[1], valuators[2], nevents);
@@ -698,7 +698,7 @@ void dmxEnqueue(DevicePtr pDev, int type
/*KeyPress*/type,
detail,
POINTER_ABSOLUTE,
- 0, 0, valuators);
+ 0, 1, valuators);
ErrorF("MOTION %d, %d n = %d\n", valuators[0], valuators[1], nevents);
/*
ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
diff-tree 1ea842960fddbc6363cc6e7f914d70ba45525a6b (from 92e8cdbd32b0d86cabd4ad88e3240bf90c018b9a)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 13:43:15 2007 -0600
more debug
diff --git a/hw/dmx/input/dmxbackend.c b/hw/dmx/input/dmxbackend.c
index 48de4c9..61d1bfe 100644
--- a/hw/dmx/input/dmxbackend.c
+++ b/hw/dmx/input/dmxbackend.c
@@ -464,9 +464,8 @@ void dmxBackendCollectEvents(DevicePtr p
#if 11/*BP*/
case ButtonPress:
case ButtonRelease:
- /*
ErrorF("press/release at %d, %d\n", X.xbutton.x, X.xbutton.y);
- */
+ /* fall-through */
#endif
default:
/* Pass the whole event here, because
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index 90b45a9..9a31ba6 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -638,9 +638,7 @@ void dmxEnqueue(DevicePtr pDev, int type
/*pDev*/p,
/*KeyPress*/type,
/*n*/detail);
- /*
- ErrorF("NEW KEY EVENT %d n=%d\n", detail, nevents);
- */
+ ErrorF("KEY %d n=%d\n", detail, nevents);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, events + i);
xfree(events);
@@ -659,6 +657,10 @@ void dmxEnqueue(DevicePtr pDev, int type
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
valuators[0] = e->xbutton.x;
valuators[1] = e->xbutton.y;
+ /*
+ valuators[0] = dmxGlobalX;
+ valuators[1] = dmxGlobalY;
+ */
valuators[2] = e->xbutton.button;
nevents = GetPointerEvents(events,
/*pDev*/p,
@@ -666,11 +668,10 @@ void dmxEnqueue(DevicePtr pDev, int type
detail,
POINTER_ABSOLUTE,
0, 0, valuators);
- /*
- ErrorF("NEW PTR EVENT %d (%d,%d,%d) n=%d\n",
- detail, valuators[0], valuators[1], valuators[2],
- nevents);
- */
+
+ ErrorF("BUTTON %d, %d %d n=%d\n",
+ valuators[0], valuators[1], valuators[2], nevents);
+
for (i = 0; i < nevents; i++)
mieqEnqueue(p, events + i);
xfree(events);
@@ -698,6 +699,7 @@ void dmxEnqueue(DevicePtr pDev, int type
detail,
POINTER_ABSOLUTE,
0, 0, valuators);
+ ErrorF("MOTION %d, %d n = %d\n", valuators[0], valuators[1], nevents);
/*
ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
detail, e->xmotion.state,
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 7c0ae58..c098c46 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -503,10 +503,11 @@ static int dmxDeviceOnOff(DeviceIntPtr p
GetMaximumEventsNum(),
#endif
Relative);
+ ErrorF("MOTION BUFFER SIZE %d\n", GetMaximumEventsNum());
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
- info.maxval[0], info.res[0],
+ /*1280*/info.maxval[0], info.res[0],
info.minres[0], info.maxres[0]);
#endif
} else if (info.numRelAxes) {
@@ -517,7 +518,7 @@ static int dmxDeviceOnOff(DeviceIntPtr p
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
- info.maxval[0], info.res[0],
+ /*1280*/info.maxval[0], info.res[0],
info.minres[0], info.maxres[0]);
#endif
} else if (info.numAbsAxes) {
@@ -528,7 +529,7 @@ static int dmxDeviceOnOff(DeviceIntPtr p
#ifdef XINPUT
for (i = 0; i < info.numAbsAxes; i++)
InitValuatorAxisStruct(pDevice, i+info.numRelAxes,
- info.minval[i+1], info.maxval[i+1],
+ info.minval[i+1], /*1280*/info.maxval[i+1],
info.res[i+1], info.minres[i+1],
info.maxres[i+1]);
#endif
diff-tree 92e8cdbd32b0d86cabd4ad88e3240bf90c018b9a (from d92da3d5f309392ac398c0975ef17bb04312d5e2)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 13:19:33 2007 -0600
Checkpoint fixes to DMX for X input changes.
Xdmx builds and runs now.
Keyboard seems OK, and mouse pointer moves, but everything else is flakey.
Something is still seriously wrong.
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index 09b50b8..11c89d8 100644
--- a/hw/dmx/dmxcursor.c
+++ b/hw/dmx/dmxcursor.c
@@ -182,7 +182,12 @@ static void dmxCrossScreen(ScreenPtr pSc
static void dmxWarpCursor(ScreenPtr pScreen, int x, int y)
{
DMXDBG3("dmxWarpCursor(%d,%d,%d)\n", pScreen->myNum, x, y);
+#if 11 /*BP*/
+ /* This call is depracated. Replace with???? */
miPointerWarpCursor(pScreen, x, y);
+#else
+ pScreen->SetCursorPosition(pScreen, x, y, FALSE);
+#endif
}
miPointerScreenFuncRec dmxPointerCursorFuncs =
@@ -190,7 +195,7 @@ miPointerScreenFuncRec dmxPointerCursorF
dmxCursorOffScreen,
dmxCrossScreen,
dmxWarpCursor,
- dmxeqEnqueue,
+ dmxeqEnqueue, /*XXX incompatible type/function! */
dmxeqSwitchScreen
};
@@ -939,8 +944,13 @@ void dmxCheckCursor(void)
pScreen = screenInfo.screens[dmxScreen->index];
if (!dmxOnScreen(x, y, dmxScreen)) {
+#if 00
if (firstScreen && i == miPointerCurrentScreen()->myNum)
miPointerSetNewScreen(firstScreen->index, x, y);
+#else
+ if (firstScreen && i == miPointerGetScreen(inputInfo.pointer)->myNum)
+ miPointerSetScreen(inputInfo.pointer, firstScreen->index, x, y);
+#endif
_dmxSetCursor(pScreen, NULL,
x - dmxScreen->rootXOrigin,
y - dmxScreen->rootYOrigin);
diff --git a/hw/dmx/dmxinput.c b/hw/dmx/dmxinput.c
index 37f4583..f47899c 100644
--- a/hw/dmx/dmxinput.c
+++ b/hw/dmx/dmxinput.c
@@ -49,6 +49,7 @@
#include "inputstr.h"
#include "input.h"
+#include "mi.h"
/** Returns TRUE if the key is a valid modifier. For PC-class
* keyboards, all keys can be used as modifiers, so return TRUE
@@ -75,6 +76,8 @@ void InitInput(int argc, char **argv)
dmxLog(dmxWarning, "Use keyboard/mouse pair with the first -input\n");
dmxLog(dmxFatal, "At least one core keyboard/mouse pair required\n");
}
+
+ mieqInit();
}
/** Called from dix/dispatch.c in Dispatch() whenever input events
diff --git a/hw/dmx/input/dmxbackend.c b/hw/dmx/input/dmxbackend.c
index 8985a1b..48de4c9 100644
--- a/hw/dmx/input/dmxbackend.c
+++ b/hw/dmx/input/dmxbackend.c
@@ -242,7 +242,11 @@ static int dmxBackendOffscreen(int scree
void dmxBackendUpdatePosition(pointer private, int x, int y)
{
GETPRIVFROMPRIVATE;
+#if 00 /*BP*/
int screen = miPointerCurrentScreen()->myNum;
+#else
+ int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
+#endif
DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
int oldRelative = priv->relative;
int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
@@ -391,6 +395,7 @@ void dmxBackendCollectEvents(DevicePtr p
}
break;
case MotionNotify:
+#if 00 /*BP*/
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
dmxScreen->index, priv->myScreen,
@@ -443,12 +448,26 @@ void dmxBackendCollectEvents(DevicePtr p
(dmxScreen->rootYOrigin + X.xmotion.y
- dmxScreen->rootY));
}
+#else
+ /*
+ ErrorF("motion %d, %d, %d\n",
+ X.xmotion.x, X.xmotion.y, X.xmotion.state);
+ */
+ enqueue(priv->mou, X.type, 0/*X.xbutton.button*/, 0, &X, block);
+#endif
break;
case KeyPress:
case KeyRelease:
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
break;
+#if 11/*BP*/
+ case ButtonPress:
+ case ButtonRelease:
+ /*
+ ErrorF("press/release at %d, %d\n", X.xbutton.x, X.xbutton.y);
+ */
+#endif
default:
/* Pass the whole event here, because
* this may be an extension event. */
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index 5316f0f..90b45a9 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -56,6 +56,7 @@
#include "opaque.h"
#include "inputstr.h"
#include "mipointer.h"
+#include "mi.h"
#ifdef XINPUT
#include "XIstubs.h"
@@ -216,11 +217,20 @@ void dmxCoreMotion(int x, int y, int del
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
localX = dmxGlobalX - dmxScreen->rootXOrigin;
localY = dmxGlobalY - dmxScreen->rootYOrigin;
+#if 00 /*BP*/
if ((pScreen = miPointerCurrentScreen())
+#else
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))
+#endif
&& pScreen->myNum == dmxScreen->index) {
/* Screen is old screen */
if (block) dmxSigioBlock();
+#if 00 /*BP*/
miPointerAbsoluteCursor(localX, localY, GetTimeInMillis());
+#else
+ miPointerSetPosition(inputInfo.pointer, &localX, &localY,
+ GetTimeInMillis());
+#endif
if (block) dmxSigioUnblock();
} else {
/* Screen is new */
@@ -228,13 +238,28 @@ void dmxCoreMotion(int x, int y, int del
pScreen->myNum, dmxScreen->index, localX, localY);
if (block) dmxSigioBlock();
dmxeqProcessInputEvents();
+#if 00 /*BP*/
miPointerSetNewScreen(dmxScreen->index, localX, localY);
miPointerAbsoluteCursor(localX, localY, GetTimeInMillis());
+#else
+ miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
+ localX, localY);
+ miPointerSetPosition(inputInfo.pointer, &localX, &localY,
+ GetTimeInMillis());
+#endif
if (block) dmxSigioUnblock();
}
+#if 00 /*BP*/
miPointerPosition(&localX, &localY);
+#else
+ miPointerGetPosition(inputInfo.pointer, &localX, &localY);
+#endif
+#if 00 /*BP*/
if ((pScreen = miPointerCurrentScreen())) {
+#else
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))) {
+#endif
dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
@@ -604,16 +629,87 @@ void dmxEnqueue(DevicePtr pDev, int type
return;
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
+#if 11/*BP*/
+ {
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents;
+ xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ nevents = GetKeyboardEvents(events,
+ /*pDev*/p,
+ /*KeyPress*/type,
+ /*n*/detail);
+ /*
+ ErrorF("NEW KEY EVENT %d n=%d\n", detail, nevents);
+ */
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, events + i);
+ xfree(events);
+ return;
+ }
+#endif
break;
case ButtonPress:
case ButtonRelease:
+#if 00 /*BP*/
detail = dmxGetButtonMapping(dmxLocal, detail);
+#else
+ {
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ valuators[0] = e->xbutton.x;
+ valuators[1] = e->xbutton.y;
+ valuators[2] = e->xbutton.button;
+ nevents = GetPointerEvents(events,
+ /*pDev*/p,
+ /*KeyPress*/type,
+ detail,
+ POINTER_ABSOLUTE,
+ 0, 0, valuators);
+ /*
+ ErrorF("NEW PTR EVENT %d (%d,%d,%d) n=%d\n",
+ detail, valuators[0], valuators[1], valuators[2],
+ nevents);
+ */
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, events + i);
+ xfree(events);
+ return;
+ }
+#endif
break;
case MotionNotify:
/* All MotionNotify events should be sent via dmxCoreMotion and
* dmxExtMotion -- no input driver should build motion events by
* hand. */
+#if 00 /*BP*/
dmxLog(dmxError, "dmxEnqueueXEvent: MotionNotify not allowed here\n");
+#else
+ {
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ valuators[0] = e->xmotion.x;
+ valuators[1] = e->xmotion.y;
+ valuators[2] = e->xmotion.state;
+ nevents = GetPointerEvents(events,
+ /*pDev*/p,
+ /*KeyPress*/type,
+ detail,
+ POINTER_ABSOLUTE,
+ 0, 0, valuators);
+ /*
+ ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
+ detail, e->xmotion.state,
+ valuators[0], valuators[1], valuators[2],
+ nevents);
+ */
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, events + i);
+ xfree(events);
+ return;
+ }
+#endif
break;
/* Always ignore these events */
case EnterNotify:
@@ -623,6 +719,7 @@ void dmxEnqueue(DevicePtr pDev, int type
* modifier map on the backend/console
* input device so that we have complete
* control of the input device LEDs. */
+ ErrorF("Enter/Leave/Keymap/Mapping\n");
return;
default:
#ifdef XINPUT
@@ -652,7 +749,16 @@ void dmxEnqueue(DevicePtr pDev, int type
if (!dmxLocal->sendsCore) dmxEnqueueExtEvent(dmxLocal, &xE, block);
else
#endif
+#if 00 /*BP*/
dmxeqEnqueue(&xE);
+#else
+ /* never get here! */
+ if (0) {
+ DeviceIntPtr p = dmxLocal->pDevice;
+ ErrorF("enque %d\n", type);
+ mieqEnqueue(p, &xE);
+ }
+#endif
}
/** A pointer to this routine is passed to low-level input drivers so
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 0519d2b..7c0ae58 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -72,6 +72,7 @@
#include "input.h"
#include "mipointer.h"
#include "windowstr.h"
+#include "mi.h"
#ifdef XINPUT
#include <X11/extensions/XI.h>
@@ -222,6 +223,57 @@ static DMXLocalInputInfoRec DMXLocalDevi
{ NULL } /* Must be last */
};
+
+#if 11 /*BP*/
+void
+DDXRingBell(int volume, int pitch, int duration)
+{
+ /* NO-OP */
+}
+
+/* taken from kdrive/src/kinput.c: */
+static void
+dmxKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl)
+{
+#if 0
+ KdKeyboardInfo *ki;
+
+ for (ki = kdKeyboards; ki; ki = ki->next) {
+ if (ki->dixdev && ki->dixdev->id == pDevice->id)
+ break;
+ }
+
+ if (!ki || !ki->dixdev || ki->dixdev->id != pDevice->id || !ki->driver)
+ return;
+
+ KdSetLeds(ki, ctrl->leds);
+ ki->bellPitch = ctrl->bell_pitch;
+ ki->bellDuration = ctrl->bell_duration;
+#endif
+}
+
+/* taken from kdrive/src/kinput.c: */
+static void
+dmxBell(int volume, DeviceIntPtr pDev, pointer arg, int something)
+{
+#if 0
+ KeybdCtrl *ctrl = arg;
+ KdKeyboardInfo *ki = NULL;
+
+ for (ki = kdKeyboards; ki; ki = ki->next) {
+ if (ki->dixdev && ki->dixdev->id == pDev->id)
+ break;
+ }
+
+ if (!ki || !ki->dixdev || ki->dixdev->id != pDev->id || !ki->driver)
+ return;
+
+ KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration);
+#endif
+}
+
+#endif /*BP*/
+
static void _dmxChangePointerControl(DMXLocalInputInfoPtr dmxLocal,
PtrCtrl *ctrl)
{
@@ -427,7 +479,15 @@ static int dmxDeviceOnOff(DeviceIntPtr p
break;
}
if (info.keyClass) {
+#if 00 /*BP*/
InitKeyClassDeviceStruct(pDevice, &info.keySyms, info.modMap);
+#else
+ DevicePtr pDev = (DevicePtr) pDevice;
+ InitKeyboardDeviceStruct(pDev,
+ &info.keySyms,
+ info.modMap,
+ dmxBell, dmxKbdCtrl);
+#endif
}
if (info.buttonClass) {
InitButtonClassDeviceStruct(pDevice, info.numButtons, info.map);
@@ -435,8 +495,13 @@ static int dmxDeviceOnOff(DeviceIntPtr p
if (info.valuatorClass) {
if (info.numRelAxes && dmxLocal->sendsCore) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
+#if 00 /*BP*/
miPointerGetMotionEvents,
miPointerGetMotionBufferSize(),
+#else
+ GetMotionHistory,
+ GetMaximumEventsNum(),
+#endif
Relative);
#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
@@ -520,12 +585,26 @@ static void dmxProcessInputEvents(DMXInp
{
int i;
+ /*
+ ErrorF("%s\n", __FUNCTION__);
+ */
+
dmxeqProcessInputEvents();
+#if 00 /*BP*/
miPointerUpdate();
+#endif
if (dmxInput->detached) return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
- if (dmxInput->devs[i]->process_input)
+ if (dmxInput->devs[i]->process_input) {
+#if 11 /*BP*/
+ miPointerUpdateSprite(dmxInput->devs[i]->pDevice);
+#endif
dmxInput->devs[i]->process_input(dmxInput->devs[i]->private);
+ }
+
+#if 11 /*BP*/
+ mieqProcessInputEvents();
+#endif
}
static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
@@ -710,8 +789,13 @@ static DeviceIntPtr dmxAddDevice(DMXLoca
registerProcPtr(pDevice);
- if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE)
+ if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE) {
+#if 00 /*BP*/
miRegisterPointerDevice(screenInfo.screens[0], pDevice);
+#else
+ /* Nothing? dmxDeviceOnOff() should get called to init, right? */
+#endif
+ }
if (dmxLocal->create_private)
dmxLocal->private = dmxLocal->create_private(pDevice);
diff --git a/hw/dmx/input/dmxxinput.c b/hw/dmx/input/dmxxinput.c
index 81d1cfb..ad2a77c 100644
--- a/hw/dmx/input/dmxxinput.c
+++ b/hw/dmx/input/dmxxinput.c
@@ -99,9 +99,13 @@ int ChangePointerDevice(DeviceIntPtr old
}
dmxLocalNew->savedMotionProc = new_dev->valuator->GetMotionProc;
dmxLocalNew->savedMotionEvents = new_dev->valuator->numMotionEvents;
+#if 00 /*BP*/
new_dev->valuator->GetMotionProc = miPointerGetMotionEvents;
new_dev->valuator->numMotionEvents = miPointerGetMotionBufferSize();
-
+#else
+ new_dev->valuator->GetMotionProc = GetMotionHistory;
+ new_dev->valuator->numMotionEvents = GetMaximumEventsNum();
+#endif
/* Switch our notion of core pointer */
dmxLocalOld->isCore = 0;
dmxLocalOld->sendsCore = dmxLocalOld->savedSendsCore;
diff --git a/hw/dmx/input/lnx-keyboard.c b/hw/dmx/input/lnx-keyboard.c
index 97cc307..b09492b 100644
--- a/hw/dmx/input/lnx-keyboard.c
+++ b/hw/dmx/input/lnx-keyboard.c
@@ -164,7 +164,9 @@
#include <sys/kd.h>
#include <termios.h>
#include "atKeynames.h"
+#if 00
#include "xf86Keymap.h"
+#endif
#include <linux/keyboard.h>
#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
@@ -800,7 +802,12 @@ static void kbdLinuxReadKernelMapping(in
tbl[2] = 8; /* alt */
tbl[3] = tbl[2] | 1;
+#if 00/*BP*/
k = map+GLYPHS_PER_KEY;
+#else
+ ErrorF("kbdLinuxReadKernelMapping() is broken/no-op'd\n");
+ return;
+#endif
maxkey = NUM_AT2LNX;
for (i = 0; i < maxkey; ++i) {
@@ -927,8 +934,13 @@ static void kbdLinuxGetMap(DevicePtr pDe
char type;
int i;
+#if 00/*BP*/
mapCopy = xalloc(sizeof(map));
memcpy(mapCopy, map, sizeof(map));
+#else
+ ErrorF("kbdLinuxGetMap() is broken/no-op'd\n");
+ return;
+#endif
kbdLinuxReadKernelMapping(priv->fd, pKeySyms);
diff-tree d92da3d5f309392ac398c0975ef17bb04312d5e2 (from 44acb2517d9fb07790d9d799aa9cc727d1b7d35c)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 12:56:34 2007 -0600
more formatting fixes
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index ef49652..09b50b8 100644
--- a/hw/dmx/dmxcursor.c
+++ b/hw/dmx/dmxcursor.c
@@ -130,14 +130,16 @@ static Bool dmxCursorOffScreen(ScreenPtr
int globalX;
int globalY;
- if (screenInfo.numScreens == 1) return FALSE;
+ if (screenInfo.numScreens == 1)
+ return FALSE;
/* On current screen? */
dmxScreen = &dmxScreens[(*ppScreen)->myNum];
if (localX >= 0
&& localX < dmxScreen->rootWidth
&& localY >= 0
- && localY < dmxScreen->rootHeight) return FALSE;
+ && localY < dmxScreen->rootHeight)
+ return FALSE;
/* Convert to global coordinate space */
globalX = dmxScreen->rootXOrigin + localX;
@@ -162,7 +164,8 @@ static Bool dmxCursorOffScreen(ScreenPtr
&& globalX < dmxScreen->rootXOrigin + dmxScreen->rootWidth
&& globalY >= dmxScreen->rootYOrigin
&& globalY < dmxScreen->rootYOrigin + dmxScreen->rootHeight) {
- if (dmxScreen->index == (*ppScreen)->myNum) return FALSE;
+ if (dmxScreen->index == (*ppScreen)->myNum)
+ return FALSE;
*ppScreen = screenInfo.screens[dmxScreen->index];
*x = globalX - dmxScreen->rootXOrigin;
*y = globalY - dmxScreen->rootYOrigin;
diff-tree 44acb2517d9fb07790d9d799aa9cc727d1b7d35c (from 9f24798af50896cc3262c1201f75c10a688f2a83)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 12:54:22 2007 -0600
Fix some bad formatting.
Doing this:
if (something) stmt;
is evil if you're debugging and want to break on stmt!
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index e74a052..ef49652 100644
--- a/hw/dmx/dmxcursor.c
+++ b/hw/dmx/dmxcursor.c
@@ -198,7 +198,8 @@ static int *dmxSLCreate(void)
int *list = malloc(dmxNumScreens * sizeof(*list));
int i;
- for (i = 0; i < dmxNumScreens; i++) list[i] = 1;
+ for (i = 0; i < dmxNumScreens; i++)
+ list[i] = 1;
return list;
}
@@ -212,7 +213,9 @@ static void dmxSLFree(int *list)
static int dmxSLFindNext(int *list)
{
int i;
- for (i = 0; i < dmxNumScreens; i++) if (list[i]) return i;
+ for (i = 0; i < dmxNumScreens; i++)
+ if (list[i])
+ return i;
return -1;
}
@@ -225,7 +228,8 @@ static int dmxTryComputeScreenOrigins(in
int changed = 0;
for (i = 0; i < dmxNumScreens; i++) {
- if (!screensLeft[i]) continue;
+ if (!screensLeft[i])
+ continue;
screen = &dmxScreens[i];
switch (screen->where) {
case PosAbsolute:
@@ -235,14 +239,16 @@ static int dmxTryComputeScreenOrigins(in
break;
case PosRelative:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
dixScreenOrigins[i].x = dixScreenOrigins[ref].x + screen->whereX;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y + screen->whereY;
++changed, screensLeft[i] = 0;
break;
case PosRightOf:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
pScreen = screenInfo.screens[ref];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x + pScreen->width;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
@@ -250,7 +256,8 @@ static int dmxTryComputeScreenOrigins(in
break;
case PosLeftOf:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
pScreen = screenInfo.screens[i];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x - pScreen->width;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y;
@@ -258,7 +265,8 @@ static int dmxTryComputeScreenOrigins(in
break;
case PosBelow:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
pScreen = screenInfo.screens[ref];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y + pScreen->height;
@@ -266,7 +274,8 @@ static int dmxTryComputeScreenOrigins(in
break;
case PosAbove:
ref = screen->whereRefScreen;
- if (screensLeft[ref]) break;
+ if (screensLeft[ref])
+ break;
pScreen = screenInfo.screens[i];
dixScreenOrigins[i].x = dixScreenOrigins[ref].x;
dixScreenOrigins[i].y = dixScreenOrigins[ref].y - pScreen->height;
@@ -308,8 +317,10 @@ static void dmxComputeScreenOrigins(void
minX = dixScreenOrigins[0].x;
minY = dixScreenOrigins[0].y;
for (i = 1; i < dmxNumScreens; i++) { /* Compute minX, minY */
- if (dixScreenOrigins[i].x < minX) minX = dixScreenOrigins[i].x;
- if (dixScreenOrigins[i].y < minY) minY = dixScreenOrigins[i].y;
+ if (dixScreenOrigins[i].x < minX)
+ minX = dixScreenOrigins[i].x;
+ if (dixScreenOrigins[i].y < minY)
+ minY = dixScreenOrigins[i].y;
}
if (minX || minY) {
for (i = 0; i < dmxNumScreens; i++) {
@@ -411,28 +422,36 @@ int dmxOnScreen(int x, int y, DMXScreenI
static int dmxDoesOverlap(DMXScreenInfo *a, DMXScreenInfo *b)
{
if (dmxOnScreen(a->rootXOrigin,
- a->rootYOrigin, b)) return 1;
+ a->rootYOrigin, b))
+ return 1;
if (dmxOnScreen(a->rootXOrigin,
- a->rootYOrigin + a->scrnWidth, b)) return 1;
+ a->rootYOrigin + a->scrnWidth, b))
+ return 1;
if (dmxOnScreen(a->rootXOrigin + a->scrnHeight,
- a->rootYOrigin, b)) return 1;
+ a->rootYOrigin, b))
+ return 1;
if (dmxOnScreen(a->rootXOrigin + a->scrnHeight,
- a->rootYOrigin + a->scrnWidth, b)) return 1;
+ a->rootYOrigin + a->scrnWidth, b))
+ return 1;
if (dmxOnScreen(b->rootXOrigin,
- b->rootYOrigin, a)) return 1;
+ b->rootYOrigin, a))
+ return 1;
if (dmxOnScreen(b->rootXOrigin,
- b->rootYOrigin + b->scrnWidth, a)) return 1;
+ b->rootYOrigin + b->scrnWidth, a))
+ return 1;
if (dmxOnScreen(b->rootXOrigin + b->scrnHeight,
- b->rootYOrigin, a)) return 1;
+ b->rootYOrigin, a))
+ return 1;
if (dmxOnScreen(b->rootXOrigin + b->scrnHeight,
- b->rootYOrigin + b->scrnWidth, a)) return 1;
+ b->rootYOrigin + b->scrnWidth, a))
+ return 1;
return 0;
}
@@ -476,7 +495,8 @@ static void *dmxTestSameDisplay(DMXScree
{
DMXScreenInfo *b = closure;
- if (a == b) return a;
+ if (a == b)
+ return a;
return NULL;
}
@@ -489,14 +509,16 @@ void dmxInitOverlap(void)
int i, j;
DMXScreenInfo *a, *b, *pt;
- for (i = 0; i < dmxNumScreens; i++) dmxScreens[i].over = NULL;
+ for (i = 0; i < dmxNumScreens; i++)
+ dmxScreens[i].over = NULL;
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
for (j = i+1; j < dmxNumScreens; j++) {
b = &dmxScreens[j];
- if (b->over) continue;
+ if (b->over)
+ continue;
if (dmxDoesOverlap(a, b)) {
DMXDBG6("%d overlaps %d: a=%p %p b=%p %p\n",
@@ -510,7 +532,8 @@ void dmxInitOverlap(void)
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
- if (!a->over) continue;
+ if (!a->over)
+ continue;
/* Flag all pairs that are on same display */
for (pt = a->over; pt != a; pt = pt->over) {
@@ -521,7 +544,8 @@ void dmxInitOverlap(void)
* screens that mutually overlap on the backend display,
* so we call dmxDoesOverlap, which is stricter than the
* ->over set. */
- if (!dmxDoesOverlap(a, pt)) continue;
+ if (!dmxDoesOverlap(a, pt))
+ continue;
a->cursorNotShared = 1;
pt->cursorNotShared = 1;
dmxLog(dmxInfo,
@@ -731,9 +755,11 @@ static Bool dmxRealizeCursor(ScreenPtr p
return _dmxRealizeCursor(pScreen, pCursor);
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursorNotShared) continue;
+ if (pt->cursorNotShared)
+ continue;
_dmxRealizeCursor(screenInfo.screens[pt->index], pCursor);
- if (pt == start) break;
+ if (pt == start)
+ break;
}
return TRUE;
}
@@ -747,9 +773,11 @@ static Bool dmxUnrealizeCursor(ScreenPtr
return _dmxUnrealizeCursor(pScreen, pCursor);
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursorNotShared) continue;
+ if (pt->cursorNotShared)
+ continue;
_dmxUnrealizeCursor(screenInfo.screens[pt->index], pCursor);
- if (pt == start) break;
+ if (pt == start)
+ break;
}
return TRUE;
}
@@ -758,10 +786,13 @@ static CursorPtr dmxFindCursor(DMXScreen
{
DMXScreenInfo *pt;
- if (!start || !start->over) return GetSpriteCursor();
+ if (!start || !start->over)
+ return GetSpriteCursor();
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursor) return pt->cursor;
- if (pt == start) break;
+ if (pt->cursor)
+ return pt->cursor;
+ if (pt == start)
+ break;
}
return GetSpriteCursor();
}
@@ -769,7 +800,12 @@ static CursorPtr dmxFindCursor(DMXScreen
/** Move the cursor to coordinates (\a x, \a y)on \a pScreen. This
* function is usually called via #dmxPointerSpriteFuncs, except during
* reconfiguration when the cursor is repositioned to force an update on
- * newley overlapping screens and on screens that no longer overlap. */
+ * newley overlapping screens and on screens that no longer overlap.
+ *
+ * The coords (x,y) are in global coord space. We'll loop over the
+ * back-end screens and see if they contain the global coord. If so, call
+ * _dmxMoveCursor() (XWarpPointer) to position the pointer on that screen.
+ */
void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
{
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
@@ -783,7 +819,8 @@ void dmxMoveCursor(ScreenPtr pScreen, in
}
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursorNotShared) continue;
+ if (pt->cursorNotShared)
+ continue;
if (dmxOnScreen(x + start->rootXOrigin, y + start->rootYOrigin, pt)) {
if (/* pt != start && */ !pt->cursorVisible) {
if (!pt->cursor) {
@@ -811,7 +848,8 @@ void dmxMoveCursor(ScreenPtr pScreen, in
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
}
- if (pt == start) break;
+ if (pt == start)
+ break;
}
}
@@ -851,7 +889,8 @@ static void dmxSetCursor(ScreenPtr pScre
}
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
- if (pt->cursorNotShared) continue;
+ if (pt->cursorNotShared)
+ continue;
if (dmxOnScreen(x + start->rootXOrigin, y + start->rootYOrigin, pt)) {
_dmxSetCursor(screenInfo.screens[pt->index], pCursor,
x + start->rootXOrigin - pt->rootXOrigin,
@@ -861,7 +900,8 @@ static void dmxSetCursor(ScreenPtr pScre
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
}
- if (pt == start) break;
+ if (pt == start)
+ break;
}
}
diff-tree 9f24798af50896cc3262c1201f75c10a688f2a83 (from 76756f27561c6386cba0d338441e8ec7b98500ce)
Author: Brian <brian at yutani.localnet.net>
Date: Fri Mar 30 12:49:34 2007 -0600
ompile fbcmap.c w/ -DXFree86Server instead of linking libfbcmap.a.
The former works, the later doesn't (DMX blows up on visuals/pixel formats).
This undos Daniel's patch, which undid my prev patch. Revisit someday.
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index 17d27ed..41dc5d2 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -2,7 +2,6 @@ DIST_SUBDIRS = input config glxProxy exa
SUBDIRS = input config examples
bin_PROGRAMS = Xdmx
-noinst_LIBRARIES = libfbcmap.a
if XINERAMA
PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c
@@ -17,6 +16,9 @@ GLX_INCS = -I$(top_srcdir)/hw/xfree86/di
GLX_DEFS = @GL_CFLAGS@
endif
+# It's essential that fbcmap.c be compiled with this flag for DMX to work!!
+DMX_CFLAGS = -DXFree86Server=1
+
if BUILDDOCS
SUBDIRS += doc
endif
@@ -26,11 +28,9 @@ AM_CFLAGS = \
$(DIX_CFLAGS) \
$(GLX_INCS) \
$(GLX_DEFS) \
+ $(DMX_CFLAGS) \
@DMXMODULES_CFLAGS@
-libfbcmap_a_SOURCES = libfbcmap.a
-libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
-
Xdmx_SOURCES = dmx.c \
dmxcb.c \
dmxcb.h \
@@ -76,6 +76,7 @@ Xdmx_SOURCES = dmx.c \
dmxwindow.c \
dmxwindow.h \
$(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/fb/fbcmap.c \
$(GLX_SRCS)
@@ -89,7 +90,6 @@ Xdmx_LDADD = $(XORG_CORE_LIBS) \
$(GLX_LIBS) \
input/libdmxinput.a \
config/libdmxconfig.a \
- libfbcmap.a \
@DMXMODULES_LIBS@
# Man page
diff-tree 76756f27561c6386cba0d338441e8ec7b98500ce (from 307d2b57bbfcc281656011533627bea6ab98189e)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date: Thu Nov 30 04:20:32 2006 +0200
Make xf86glx.c unaware of Mesa internals
Use newly added XMesaCopyContext() and drop the GlxSetRenderTables() call
for Xgl, as this is now done inside XMesaForceCurrent(). This leaves xmesaP.h
but only for the declarations of the three XMesa/XFree86 functions. Also,
GlxSetRenderTables() stays but is only used in hw/xgl/glxext/ .
Also drop xf86glxint.h, no longer used.
Depends on mesa commit 7439a36785b6a2783e80a40a96c09db8f56dc2bc of 2007-03-30.
diff --git a/GL/glx/Makefile.am b/GL/glx/Makefile.am
index 8184f60..cd1130d 100644
--- a/GL/glx/Makefile.am
+++ b/GL/glx/Makefile.am
@@ -14,7 +14,6 @@ AM_CFLAGS = \
-I at MESA_SOURCE@/src/mesa/glapi \
-I at MESA_SOURCE@/src/mesa/main \
-DXFree86Server \
- -DNO_LIBCWRAPPER \
@GLX_DEFINES@
# none yet
diff --git a/GL/mesa/X/Makefile.am b/GL/mesa/X/Makefile.am
index 45345a7..056d31a 100644
--- a/GL/mesa/X/Makefile.am
+++ b/GL/mesa/X/Makefile.am
@@ -20,13 +20,11 @@ INCLUDES = -I at MESA_SOURCE@/include \
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
- @GLX_DEFINES@ \
- -DXFree86Server
+ @GLX_DEFINES@
libX_la_SOURCES = xf86glx.c \
xf86glx_util.c \
- xf86glx_util.h \
- xf86glxint.h
+ xf86glx_util.h
nodist_libX_la_SOURCES = \
xm_api.c \
diff --git a/GL/mesa/X/xf86glx.c b/GL/mesa/X/xf86glx.c
index 47c87f6..6fffdeb 100644
--- a/GL/mesa/X/xf86glx.c
+++ b/GL/mesa/X/xf86glx.c
@@ -37,40 +37,19 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
#endif
#include <string.h>
-#include <regionstr.h>
-#include <resource.h>
-#include <GL/gl.h>
-#include <GL/glxint.h>
-#include <GL/glxtokens.h>
-#include <scrnintstr.h>
-#include <windowstr.h>
-#include <config.h>
+
+#include <GL/xmesa.h>
+#include <GL/internal/glcore.h>
#include <glxserver.h>
#include <glxscreens.h>
#include <glxdrawable.h>
#include <glxcontext.h>
-#include <glxext.h>
#include <glxutil.h>
-#include "context.h"
#include "xmesaP.h"
-#include "context.h"
#include "glcontextmodes.h"
#include "os.h"
-/*
- * This define is for the glcore.h header file.
- * If you add it here, then make sure you also add it in
- * ../../../glx/Imakefile.
- */
-#if 0
-#define DEBUG
-#include <GL/internal/glcore.h>
-#undef DEBUG
-#else
-#include <GL/internal/glcore.h>
-#endif
-
typedef struct __GLXMESAscreen __GLXMESAscreen;
typedef struct __GLXMESAcontext __GLXMESAcontext;
typedef struct __GLXMESAdrawable __GLXMESAdrawable;
@@ -218,8 +197,7 @@ __glXMesaContextCopy(__GLXcontext *baseD
__GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst;
__GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc;
- _mesa_copy_context(&src->xmesa->mesa, &dst->xmesa->mesa, mask);
- return GL_TRUE;
+ return XMesaCopyContext(src->xmesa, dst->xmesa, mask);
}
static int
@@ -227,7 +205,7 @@ __glXMesaContextForceCurrent(__GLXcontex
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
- GlxSetRenderTables (context->xmesa->mesa.CurrentDispatch);
+ /* GlxSetRenderTables() call for XGL moved in XMesaForceCurrent() */
return XMesaForceCurrent(context->xmesa);
}
diff --git a/GL/mesa/X/xf86glx_util.c b/GL/mesa/X/xf86glx_util.c
index ffb5280..6af773f 100644
--- a/GL/mesa/X/xf86glx_util.c
+++ b/GL/mesa/X/xf86glx_util.c
@@ -37,8 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
#include <stdlib.h>
-#include <gcstruct.h>
-#include "pixmapstr.h"
#include "xf86glx_util.h"
#include <X11/Xmd.h>
diff --git a/GL/mesa/X/xf86glxint.h b/GL/mesa/X/xf86glxint.h
deleted file mode 100644
index 8c7e913..0000000
--- a/GL/mesa/X/xf86glxint.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <kevin at precisioninsight.com>
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef _XF86GLXINT_H_
-#define _XF86GLXINT_H_
-
-#include <miscstruct.h>
-#include <GL/gl.h>
-#include <GL/xmesa.h>
-
-#endif /* _XF86GLXINT_H_ */
diff-tree 307d2b57bbfcc281656011533627bea6ab98189e (from 82a8b99a6c46018885600011913267d8af9dfe13)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Thu Mar 29 15:23:41 2007 +0930
Xi: remove 'register' keywords.
diff --git a/Xi/allowev.c b/Xi/allowev.c
index ea9c5de..85b6eaf 100644
--- a/Xi/allowev.c
+++ b/Xi/allowev.c
@@ -76,9 +76,9 @@ SOFTWARE.
*/
int
-SProcXAllowDeviceEvents(register ClientPtr client)
+SProcXAllowDeviceEvents(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xAllowDeviceEventsReq);
swaps(&stuff->length, n);
@@ -94,7 +94,7 @@ SProcXAllowDeviceEvents(register ClientP
*/
int
-ProcXAllowDeviceEvents(register ClientPtr client)
+ProcXAllowDeviceEvents(ClientPtr client)
{
TimeStamp time;
DeviceIntPtr thisdev;
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index badd938..9676fb7 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -78,9 +78,9 @@ SOFTWARE.
*/
int
-SProcXChangeDeviceControl(register ClientPtr client)
+SProcXChangeDeviceControl(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xChangeDeviceControlReq);
swaps(&stuff->length, n);
@@ -287,7 +287,7 @@ void
SRepXChangeDeviceControl(ClientPtr client, int size,
xChangeDeviceControlReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
index 82616c6..2e0e13c 100644
--- a/Xi/chgfctl.c
+++ b/Xi/chgfctl.c
@@ -78,9 +78,9 @@ SOFTWARE.
*/
int
-SProcXChangeFeedbackControl(register ClientPtr client)
+SProcXChangeFeedbackControl(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xChangeFeedbackControlReq);
swaps(&stuff->length, n);
@@ -99,7 +99,7 @@ static int
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
KbdFeedbackPtr k, xKbdFeedbackCtl * f)
{
- register char n;
+ char n;
KeybdCtrl kctrl;
int t;
int key = DO_ALL;
@@ -231,7 +231,7 @@ static int
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
PtrFeedbackPtr p, xPtrFeedbackCtl * f)
{
- register char n;
+ char n;
PtrCtrl pctrl; /* might get BadValue part way through */
if (client->swapped) {
@@ -303,7 +303,7 @@ ChangeIntegerFeedback(ClientPtr client,
long unsigned int mask, IntegerFeedbackPtr i,
xIntegerFeedbackCtl * f)
{
- register char n;
+ char n;
if (client->swapped) {
swaps(&f->length, n);
@@ -326,8 +326,8 @@ ChangeStringFeedback(ClientPtr client, D
long unsigned int mask, StringFeedbackPtr s,
xStringFeedbackCtl * f)
{
- register char n;
- register long *p;
+ char n;
+ long *p;
int i, j;
KeySym *syms, *sup_syms;
@@ -376,7 +376,7 @@ ChangeBellFeedback(ClientPtr client, Dev
long unsigned int mask, BellFeedbackPtr b,
xBellFeedbackCtl * f)
{
- register char n;
+ char n;
int t;
BellCtrl bctrl; /* might get BadValue part way through */
@@ -440,7 +440,7 @@ static int
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
LedFeedbackPtr l, xLedFeedbackCtl * f)
{
- register char n;
+ char n;
LedCtrl lctrl; /* might get BadValue part way through */
if (client->swapped) {
@@ -520,7 +520,7 @@ ProcXChangeFeedbackControl(ClientPtr cli
break;
case StringFeedbackClass:
{
- register char n;
+ char n;
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
if (client->swapped) {
diff --git a/Xi/chgkbd.c b/Xi/chgkbd.c
index 8134b40..2cf8225 100644
--- a/Xi/chgkbd.c
+++ b/Xi/chgkbd.c
@@ -78,9 +78,9 @@ SOFTWARE.
*/
int
-SProcXChangeKeyboardDevice(register ClientPtr client)
+SProcXChangeKeyboardDevice(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xChangeKeyboardDeviceReq);
swaps(&stuff->length, n);
@@ -96,7 +96,7 @@ SProcXChangeKeyboardDevice(register Clie
*/
int
-ProcXChangeKeyboardDevice(register ClientPtr client)
+ProcXChangeKeyboardDevice(ClientPtr client)
{
REQUEST(xChangeKeyboardDeviceReq);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c
index 047b899..eac520f 100644
--- a/Xi/chgkmap.c
+++ b/Xi/chgkmap.c
@@ -76,11 +76,11 @@ SOFTWARE.
*/
int
-SProcXChangeDeviceKeyMapping(register ClientPtr client)
+SProcXChangeDeviceKeyMapping(ClientPtr client)
{
- register char n;
- register long *p;
- register int i, count;
+ char n;
+ long *p;
+ int i, count;
REQUEST(xChangeDeviceKeyMappingReq);
swaps(&stuff->length, n);
@@ -101,7 +101,7 @@ SProcXChangeDeviceKeyMapping(register Cl
*/
int
-ProcXChangeDeviceKeyMapping(register ClientPtr client)
+ProcXChangeDeviceKeyMapping(ClientPtr client)
{
int ret;
unsigned len;
diff --git a/Xi/chgprop.c b/Xi/chgprop.c
index bab4597..59a93c6 100644
--- a/Xi/chgprop.c
+++ b/Xi/chgprop.c
@@ -78,11 +78,11 @@ SOFTWARE.
*/
int
-SProcXChangeDeviceDontPropagateList(register ClientPtr client)
+SProcXChangeDeviceDontPropagateList(ClientPtr client)
{
- register char n;
- register long *p;
- register int i;
+ char n;
+ long *p;
+ int i;
REQUEST(xChangeDeviceDontPropagateListReq);
swaps(&stuff->length, n);
@@ -104,7 +104,7 @@ SProcXChangeDeviceDontPropagateList(regi
*/
int
-ProcXChangeDeviceDontPropagateList(register ClientPtr client)
+ProcXChangeDeviceDontPropagateList(ClientPtr client)
{
int i, rc;
WindowPtr pWin;
diff --git a/Xi/chgptr.c b/Xi/chgptr.c
index 22c8a5f..a949068 100644
--- a/Xi/chgptr.c
+++ b/Xi/chgptr.c
@@ -82,9 +82,9 @@ SOFTWARE.
*/
int
-SProcXChangePointerDevice(register ClientPtr client)
+SProcXChangePointerDevice(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xChangePointerDeviceReq);
swaps(&stuff->length, n);
@@ -99,7 +99,7 @@ SProcXChangePointerDevice(register Clien
*/
int
-ProcXChangePointerDevice(register ClientPtr client)
+ProcXChangePointerDevice(ClientPtr client)
{
REQUEST(xChangePointerDeviceReq);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
diff --git a/Xi/closedev.c b/Xi/closedev.c
index 3d47b5f..8d38ec8 100644
--- a/Xi/closedev.c
+++ b/Xi/closedev.c
@@ -77,9 +77,9 @@ SOFTWARE.
*/
int
-SProcXCloseDevice(register ClientPtr client)
+SProcXCloseDevice(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xCloseDeviceReq);
swaps(&stuff->length, n);
@@ -141,7 +141,7 @@ DeleteEventsFromChildren(DeviceIntPtr de
*/
int
-ProcXCloseDevice(register ClientPtr client)
+ProcXCloseDevice(ClientPtr client)
{
int i;
WindowPtr pWin, p1;
diff --git a/Xi/devbell.c b/Xi/devbell.c
index b112386..ba873c7 100644
--- a/Xi/devbell.c
+++ b/Xi/devbell.c
@@ -75,9 +75,9 @@ SOFTWARE.
*/
int
-SProcXDeviceBell(register ClientPtr client)
+SProcXDeviceBell(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xDeviceBellReq);
swaps(&stuff->length, n);
@@ -91,7 +91,7 @@ SProcXDeviceBell(register ClientPtr clie
*/
int
-ProcXDeviceBell(register ClientPtr client)
+ProcXDeviceBell(ClientPtr client)
{
DeviceIntPtr dev;
KbdFeedbackPtr k;
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 164fce3..9e71a9e 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -104,12 +104,12 @@ RegisterOtherDevice(DeviceIntPtr device)
}
/*ARGSUSED*/ void
-ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count)
+ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
{
- register BYTE *kptr;
- register int i;
- register CARD16 modifiers;
- register CARD16 mask;
+ BYTE *kptr;
+ int i;
+ CARD16 modifiers;
+ CARD16 mask;
GrabPtr grab = other->grab;
Bool deactivateDeviceGrab = FALSE;
int key = 0, bit = 0, rootX, rootY;
@@ -288,7 +288,7 @@ ProcessOtherEvent(xEventPtr xE, register
_X_EXPORT int
InitProximityClassDeviceStruct(DeviceIntPtr dev)
{
- register ProximityClassPtr proxc;
+ ProximityClassPtr proxc;
proxc = (ProximityClassPtr) xalloc(sizeof(ProximityClassRec));
if (!proxc)
@@ -301,7 +301,7 @@ _X_EXPORT void
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
int resolution, int min_res, int max_res)
{
- register AxisInfoPtr ax;
+ AxisInfoPtr ax;
if (!dev || !dev->valuator)
return;
@@ -378,7 +378,7 @@ FixDeviceValuator(DeviceIntPtr dev, devi
void
DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
- register WindowPtr pWin)
+ WindowPtr pWin)
{
deviceFocus event;
@@ -703,9 +703,9 @@ MakeInputMasks(WindowPtr pWin)
void
RecalculateDeviceDeliverableEvents(WindowPtr pWin)
{
- register InputClientsPtr others;
+ InputClientsPtr others;
struct _OtherInputMasks *inputMasks; /* default: NULL */
- register WindowPtr pChild, tmp;
+ WindowPtr pChild, tmp;
int i;
pChild = pWin;
@@ -739,9 +739,9 @@ RecalculateDeviceDeliverableEvents(Windo
}
int
-InputClientGone(register WindowPtr pWin, XID id)
+InputClientGone(WindowPtr pWin, XID id)
{
- register InputClientsPtr other, prev;
+ InputClientsPtr other, prev;
if (!wOtherInputMasks(pWin))
return (Success);
@@ -839,7 +839,7 @@ SendEvent(ClientPtr client, DeviceIntPtr
int
SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map)
{
- register int i;
+ int i;
ButtonClassPtr b = dev->button;
if (b == NULL)
@@ -865,7 +865,7 @@ SetModifierMapping(ClientPtr client, Dev
{
KeyCode *map = NULL;
int inputMapLen;
- register int i;
+ int i;
*k = dev->key;
if (*k == NULL)
@@ -1141,7 +1141,7 @@ CheckDeviceGrabAndHintWindow(WindowPtr p
static Mask
DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
{
- register InputClientsPtr other;
+ InputClientsPtr other;
if (!wOtherInputMasks(pWin))
return 0;
@@ -1154,7 +1154,7 @@ DeviceEventMaskForClient(DeviceIntPtr de
}
void
-MaybeStopDeviceHint(register DeviceIntPtr dev, ClientPtr client)
+MaybeStopDeviceHint(DeviceIntPtr dev, ClientPtr client)
{
WindowPtr pWin;
GrabPtr grab = dev->grab;
diff --git a/Xi/extinit.c b/Xi/extinit.c
index fed54ab..b1ec321 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -216,7 +216,7 @@ static XExtensionVersion thisversion = {
*/
static int
-ProcIDispatch(register ClientPtr client)
+ProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data == X_GetExtensionVersion)
@@ -305,7 +305,7 @@ ProcIDispatch(register ClientPtr client)
*/
static int
-SProcIDispatch(register ClientPtr client)
+SProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data == X_GetExtensionVersion)
@@ -464,8 +464,8 @@ SReplyIDispatch(ClientPtr client, int le
static void
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
{
- register char n;
- register int i;
+ char n;
+ int i;
INT32 *ip B32;
*to = *from;
@@ -480,7 +480,7 @@ SEventDeviceValuator(deviceValuator * fr
static void
SEventFocus(deviceFocus * from, deviceFocus * to)
{
- register char n;
+ char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@@ -491,8 +491,8 @@ SEventFocus(deviceFocus * from, deviceFo
static void
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
{
- register int i;
- register char n;
+ int i;
+ char n;
INT32 *ip B32;
*to = *from;
@@ -508,7 +508,7 @@ static void
SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
deviceKeyStateNotify * to)
{
- register char n;
+ char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@@ -518,7 +518,7 @@ static void
SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
deviceButtonStateNotify * to)
{
- register char n;
+ char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@@ -527,7 +527,7 @@ SDeviceButtonStateNotifyEvent(deviceButt
static void
SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
{
- register char n;
+ char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@@ -537,7 +537,7 @@ SChangeDeviceNotifyEvent(changeDeviceNot
static void
SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
{
- register char n;
+ char n;
*to = *from;
swaps(&to->sequenceNumber, n);
@@ -547,7 +547,7 @@ SDeviceMappingNotifyEvent(deviceMappingN
static void
SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
{
- register char n;
+ char n;
*to = *from;
swaps(&to->sequenceNumber,n);
diff --git a/Xi/getbmap.c b/Xi/getbmap.c
index 3287476..5e8cf07 100644
--- a/Xi/getbmap.c
+++ b/Xi/getbmap.c
@@ -74,9 +74,9 @@ SOFTWARE.
*/
int
-SProcXGetDeviceButtonMapping(register ClientPtr client)
+SProcXGetDeviceButtonMapping(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetDeviceButtonMappingReq);
swaps(&stuff->length, n);
@@ -90,7 +90,7 @@ SProcXGetDeviceButtonMapping(register Cl
*/
int
-ProcXGetDeviceButtonMapping(register ClientPtr client)
+ProcXGetDeviceButtonMapping(ClientPtr client)
{
DeviceIntPtr dev;
xGetDeviceButtonMappingReply rep;
@@ -136,7 +136,7 @@ void
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
xGetDeviceButtonMappingReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/getdctl.c b/Xi/getdctl.c
index c264d4f..88f061e 100644
--- a/Xi/getdctl.c
+++ b/Xi/getdctl.c
@@ -75,9 +75,9 @@ SOFTWARE.
*/
int
-SProcXGetDeviceControl(register ClientPtr client)
+SProcXGetDeviceControl(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetDeviceControlReq);
swaps(&stuff->length, n);
@@ -96,7 +96,7 @@ static void
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
int length)
{
- register char n;
+ char n;
AxisInfoPtr a;
xDeviceResolutionState *r;
int i, *iptr;
@@ -127,7 +127,7 @@ CopySwapDeviceResolution(ClientPtr clien
static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
- register char n;
+ char n;
xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf;
calib->control = DEVICE_ABS_CALIB;
@@ -158,7 +158,7 @@ static void CopySwapDeviceAbsCalib (Clie
static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
- register char n;
+ char n;
xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf;
area->control = DEVICE_ABS_AREA;
@@ -184,7 +184,7 @@ static void CopySwapDeviceAbsArea (Clien
static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
{
- register char n;
+ char n;
xDeviceCoreState *c = (xDeviceCoreState *) buf;
c->control = DEVICE_CORE;
@@ -201,7 +201,7 @@ static void CopySwapDeviceCore (ClientPt
static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
{
- register char n;
+ char n;
xDeviceEnableState *e = (xDeviceEnableState *) buf;
e->control = DEVICE_ENABLE;
@@ -225,7 +225,7 @@ static void CopySwapDeviceEnable (Client
void
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
@@ -243,7 +243,7 @@ ProcXGetDeviceControl(ClientPtr client)
{
int total_length = 0;
char *buf, *savbuf;
- register DeviceIntPtr dev;
+ DeviceIntPtr dev;
xGetDeviceControlReply rep;
REQUEST(xGetDeviceControlReq);
diff --git a/Xi/getfctl.c b/Xi/getfctl.c
index 28360ee..5ca90db 100644
--- a/Xi/getfctl.c
+++ b/Xi/getfctl.c
@@ -75,9 +75,9 @@ SOFTWARE.
*/
int
-SProcXGetFeedbackControl(register ClientPtr client)
+SProcXGetFeedbackControl(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetFeedbackControlReq);
swaps(&stuff->length, n);
@@ -94,7 +94,7 @@ static void
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
{
int i;
- register char n;
+ char n;
xKbdFeedbackState *k2;
k2 = (xKbdFeedbackState *) * buf;
@@ -128,7 +128,7 @@ CopySwapKbdFeedback(ClientPtr client, Kb
static void
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
{
- register char n;
+ char n;
xPtrFeedbackState *p2;
p2 = (xPtrFeedbackState *) * buf;
@@ -156,7 +156,7 @@ CopySwapPtrFeedback(ClientPtr client, Pt
static void
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
{
- register char n;
+ char n;
xIntegerFeedbackState *i2;
i2 = (xIntegerFeedbackState *) * buf;
@@ -185,7 +185,7 @@ static void
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
{
int i;
- register char n;
+ char n;
xStringFeedbackState *s2;
KeySym *kptr;
@@ -221,7 +221,7 @@ CopySwapStringFeedback(ClientPtr client,
static void
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
{
- register char n;
+ char n;
xLedFeedbackState *l2;
l2 = (xLedFeedbackState *) * buf;
@@ -247,7 +247,7 @@ CopySwapLedFeedback(ClientPtr client, Le
static void
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
{
- register char n;
+ char n;
xBellFeedbackState *b2;
b2 = (xBellFeedbackState *) * buf;
@@ -276,7 +276,7 @@ void
SRepXGetFeedbackControl(ClientPtr client, int size,
xGetFeedbackControlReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
@@ -295,7 +295,7 @@ ProcXGetFeedbackControl(ClientPtr client
{
int total_length = 0;
char *buf, *savbuf;
- register DeviceIntPtr dev;
+ DeviceIntPtr dev;
KbdFeedbackPtr k;
PtrFeedbackPtr p;
IntegerFeedbackPtr i;
diff --git a/Xi/getfocus.c b/Xi/getfocus.c
index 1bcb673..245b5f1 100644
--- a/Xi/getfocus.c
+++ b/Xi/getfocus.c
@@ -75,9 +75,9 @@ SOFTWARE.
*/
int
-SProcXGetDeviceFocus(register ClientPtr client)
+SProcXGetDeviceFocus(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetDeviceFocusReq);
swaps(&stuff->length, n);
@@ -138,7 +138,7 @@ ProcXGetDeviceFocus(ClientPtr client)
void
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/getkmap.c b/Xi/getkmap.c
index 041e2c6..989f3d5 100644
--- a/Xi/getkmap.c
+++ b/Xi/getkmap.c
@@ -76,9 +76,9 @@ SOFTWARE.
*/
int
-SProcXGetDeviceKeyMapping(register ClientPtr client)
+SProcXGetDeviceKeyMapping(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetDeviceKeyMappingReq);
swaps(&stuff->length, n);
@@ -92,7 +92,7 @@ SProcXGetDeviceKeyMapping(register Clien
*/
int
-ProcXGetDeviceKeyMapping(register ClientPtr client)
+ProcXGetDeviceKeyMapping(ClientPtr client)
{
xGetDeviceKeyMappingReply rep;
DeviceIntPtr dev;
@@ -154,7 +154,7 @@ void
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
xGetDeviceKeyMappingReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/getmmap.c b/Xi/getmmap.c
index e664dc9..038937e 100644
--- a/Xi/getmmap.c
+++ b/Xi/getmmap.c
@@ -75,9 +75,9 @@ SOFTWARE.
*/
int
-SProcXGetDeviceModifierMapping(register ClientPtr client)
+SProcXGetDeviceModifierMapping(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetDeviceModifierMappingReq);
swaps(&stuff->length, n);
@@ -141,7 +141,7 @@ void
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
xGetDeviceModifierMappingReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/getprop.c b/Xi/getprop.c
index 058c595..6fa1986 100644
--- a/Xi/getprop.c
+++ b/Xi/getprop.c
@@ -79,9 +79,9 @@ extern int ExtEventIndex;
*/
int
-SProcXGetDeviceDontPropagateList(register ClientPtr client)
+SProcXGetDeviceDontPropagateList(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetDeviceDontPropagateListReq);
swaps(&stuff->length, n);
@@ -97,7 +97,7 @@ SProcXGetDeviceDontPropagateList(registe
*/
int
-ProcXGetDeviceDontPropagateList(register ClientPtr client)
+ProcXGetDeviceDontPropagateList(ClientPtr client)
{
CARD16 count = 0;
int i, rc;
@@ -187,7 +187,7 @@ void
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
xGetDeviceDontPropagateListReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/getselev.c b/Xi/getselev.c
index 533c66c..9c5f219 100644
--- a/Xi/getselev.c
+++ b/Xi/getselev.c
@@ -77,9 +77,9 @@ SOFTWARE.
*/
int
-SProcXGetSelectedExtensionEvents(register ClientPtr client)
+SProcXGetSelectedExtensionEvents(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetSelectedExtensionEventsReq);
swaps(&stuff->length, n);
@@ -96,7 +96,7 @@ SProcXGetSelectedExtensionEvents(registe
*/
int
-ProcXGetSelectedExtensionEvents(register ClientPtr client)
+ProcXGetSelectedExtensionEvents(ClientPtr client)
{
int i, rc, total_length = 0;
xGetSelectedExtensionEventsReply rep;
@@ -177,7 +177,7 @@ void
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
xGetSelectedExtensionEventsReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/getvers.c b/Xi/getvers.c
index c5f1750..b3f4c1c 100644
--- a/Xi/getvers.c
+++ b/Xi/getvers.c
@@ -76,9 +76,9 @@ XExtensionVersion AllExtensionVersions[1
*/
int
-SProcXGetExtensionVersion(register ClientPtr client)
+SProcXGetExtensionVersion(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetExtensionVersionReq);
swaps(&stuff->length, n);
@@ -94,7 +94,7 @@ SProcXGetExtensionVersion(register Clien
*/
int
-ProcXGetExtensionVersion(register ClientPtr client)
+ProcXGetExtensionVersion(ClientPtr client)
{
xGetExtensionVersionReply rep;
@@ -136,7 +136,7 @@ void
SRepXGetExtensionVersion(ClientPtr client, int size,
xGetExtensionVersionReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index 3af2346..e2809ef 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -79,11 +79,11 @@ extern int ExtEventIndex;
*/
int
-SProcXGrabDevice(register ClientPtr client)
+SProcXGrabDevice(ClientPtr client)
{
- register char n;
- register long *p;
- register int i;
+ char n;
+ long *p;
+ int i;
REQUEST(xGrabDeviceReq);
swaps(&stuff->length, n);
@@ -202,7 +202,7 @@ CreateMaskFromList(ClientPtr client, XEv
void
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c
index 4333550..df62d0c 100644
--- a/Xi/grabdevb.c
+++ b/Xi/grabdevb.c
@@ -77,11 +77,11 @@ SOFTWARE.
*/
int
-SProcXGrabDeviceButton(register ClientPtr client)
+SProcXGrabDeviceButton(ClientPtr client)
{
- register char n;
- register long *p;
- register int i;
+ char n;
+ long *p;
+ int i;
REQUEST(xGrabDeviceButtonReq);
swaps(&stuff->length, n);
diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c
index 71e72d5..b74592f 100644
--- a/Xi/grabdevk.c
+++ b/Xi/grabdevk.c
@@ -77,11 +77,11 @@ SOFTWARE.
*/
int
-SProcXGrabDeviceKey(register ClientPtr client)
+SProcXGrabDeviceKey(ClientPtr client)
{
- register char n;
- register long *p;
- register int i;
+ char n;
+ long *p;
+ int i;
REQUEST(xGrabDeviceKeyReq);
swaps(&stuff->length, n);
diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c
index 435ab0b..cfc7f89 100644
--- a/Xi/gtmotion.c
+++ b/Xi/gtmotion.c
@@ -75,9 +75,9 @@ SOFTWARE.
*/
int
-SProcXGetDeviceMotionEvents(register ClientPtr client)
+SProcXGetDeviceMotionEvents(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xGetDeviceMotionEventsReq);
swaps(&stuff->length, n);
@@ -162,7 +162,7 @@ ProcXGetDeviceMotionEvents(ClientPtr cli
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
if (nEvents) {
if (client->swapped) {
- register char n;
+ char n;
bufptr = coords;
for (i = 0; i < nEvents * (axes + 1); i++) {
@@ -188,7 +188,7 @@ void
SRepXGetDeviceMotionEvents(ClientPtr client, int size,
xGetDeviceMotionEventsReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/listdev.c b/Xi/listdev.c
index 257ee59..160ad02 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -77,9 +77,9 @@ SOFTWARE.
*/
int
-SProcXListInputDevices(register ClientPtr client)
+SProcXListInputDevices(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xListInputDevicesReq);
swaps(&stuff->length, n);
@@ -144,9 +144,9 @@ CopyDeviceName(char **namebuf, char *nam
*/
static void
-CopySwapButtonClass(register ClientPtr client, ButtonClassPtr b, char **buf)
+CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
{
- register char n;
+ char n;
xButtonInfoPtr b2;
b2 = (xButtonInfoPtr) * buf;
@@ -166,10 +166,10 @@ CopySwapButtonClass(register ClientPtr c
*/
static void
-CopySwapDevice(register ClientPtr client, DeviceIntPtr d, int num_classes,
+CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
char **buf)
{
- register char n;
+ char n;
xDeviceInfoPtr dev;
dev = (xDeviceInfoPtr) * buf;
@@ -200,9 +200,9 @@ CopySwapDevice(register ClientPtr client
*/
static void
-CopySwapKeyClass(register ClientPtr client, KeyClassPtr k, char **buf)
+CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
{
- register char n;
+ char n;
xKeyInfoPtr k2;
k2 = (xKeyInfoPtr) * buf;
@@ -230,10 +230,10 @@ CopySwapKeyClass(register ClientPtr clie
*/
static int
-CopySwapValuatorClass(register ClientPtr client, ValuatorClassPtr v, char **buf)
+CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf)
{
int i, j, axes, t_axes;
- register char n;
+ char n;
xValuatorInfoPtr v2;
AxisInfo *a;
xAxisInfoPtr a2;
@@ -305,7 +305,7 @@ ListDeviceInfo(ClientPtr client, DeviceI
*/
int
-ProcXListInputDevices(register ClientPtr client)
+ProcXListInputDevices(ClientPtr client)
{
xListInputDevicesReply rep;
int numdevs = 0;
@@ -367,7 +367,7 @@ ProcXListInputDevices(register ClientPtr
void
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/opendev.c b/Xi/opendev.c
index 6361068..4b7b6a6 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -79,9 +79,9 @@ extern CARD8 event_base[];
*/
int
-SProcXOpenDevice(register ClientPtr client)
+SProcXOpenDevice(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xOpenDeviceReq);
swaps(&stuff->length, n);
@@ -95,7 +95,7 @@ SProcXOpenDevice(register ClientPtr clie
*/
int
-ProcXOpenDevice(register ClientPtr client)
+ProcXOpenDevice(ClientPtr client)
{
xInputClassInfo evbase[numInputClasses];
Bool enableit = FALSE;
@@ -179,7 +179,7 @@ ProcXOpenDevice(register ClientPtr clien
void
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/queryst.c b/Xi/queryst.c
index c4cc5a2..972cd2c 100644
--- a/Xi/queryst.c
+++ b/Xi/queryst.c
@@ -58,9 +58,9 @@ from The Open Group.
*/
int
-SProcXQueryDeviceState(register ClientPtr client)
+SProcXQueryDeviceState(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xQueryDeviceStateReq);
swaps(&stuff->length, n);
@@ -74,9 +74,9 @@ SProcXQueryDeviceState(register ClientPt
*/
int
-ProcXQueryDeviceState(register ClientPtr client)
+ProcXQueryDeviceState(ClientPtr client)
{
- register char n;
+ char n;
int i;
int num_classes = 0;
int total_length = 0;
@@ -187,7 +187,7 @@ ProcXQueryDeviceState(register ClientPtr
void
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/selectev.c b/Xi/selectev.c
index 8c893ca..d52db1b 100644
--- a/Xi/selectev.c
+++ b/Xi/selectev.c
@@ -128,11 +128,11 @@ HandleDevicePresenceMask(ClientPtr clien
*/
int
-SProcXSelectExtensionEvent(register ClientPtr client)
+SProcXSelectExtensionEvent(ClientPtr client)
{
- register char n;
- register long *p;
- register int i;
+ char n;
+ long *p;
+ int i;
REQUEST(xSelectExtensionEventReq);
swaps(&stuff->length, n);
@@ -154,7 +154,7 @@ SProcXSelectExtensionEvent(register Clie
*/
int
-ProcXSelectExtensionEvent(register ClientPtr client)
+ProcXSelectExtensionEvent(ClientPtr client)
{
int ret;
int i;
diff --git a/Xi/sendexev.c b/Xi/sendexev.c
index c2763bb..eac9abe 100644
--- a/Xi/sendexev.c
+++ b/Xi/sendexev.c
@@ -80,11 +80,11 @@ extern int lastEvent; /* Defined in exte
*/
int
-SProcXSendExtensionEvent(register ClientPtr client)
+SProcXSendExtensionEvent(ClientPtr client)
{
- register char n;
- register long *p;
- register int i;
+ char n;
+ long *p;
+ int i;
xEvent eventT;
xEvent *eventP;
EventSwapPtr proc;
@@ -119,7 +119,7 @@ SProcXSendExtensionEvent(register Client
*/
int
-ProcXSendExtensionEvent(register ClientPtr client)
+ProcXSendExtensionEvent(ClientPtr client)
{
int ret;
DeviceIntPtr dev;
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
index 14b1689..bdfa513 100644
--- a/Xi/setbmap.c
+++ b/Xi/setbmap.c
@@ -78,9 +78,9 @@ SOFTWARE.
*/
int
-SProcXSetDeviceButtonMapping(register ClientPtr client)
+SProcXSetDeviceButtonMapping(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xSetDeviceButtonMappingReq);
swaps(&stuff->length, n);
@@ -94,7 +94,7 @@ SProcXSetDeviceButtonMapping(register Cl
*/
int
-ProcXSetDeviceButtonMapping(register ClientPtr client)
+ProcXSetDeviceButtonMapping(ClientPtr client)
{
int ret;
xSetDeviceButtonMappingReply rep;
@@ -149,7 +149,7 @@ void
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
xSetDeviceButtonMappingReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/setdval.c b/Xi/setdval.c
index 958b2ac..e947a74 100644
--- a/Xi/setdval.c
+++ b/Xi/setdval.c
@@ -75,9 +75,9 @@ SOFTWARE.
*/
int
-SProcXSetDeviceValuators(register ClientPtr client)
+SProcXSetDeviceValuators(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xSetDeviceValuatorsReq);
swaps(&stuff->length, n);
@@ -91,7 +91,7 @@ SProcXSetDeviceValuators(register Client
*/
int
-ProcXSetDeviceValuators(register ClientPtr client)
+ProcXSetDeviceValuators(ClientPtr client)
{
DeviceIntPtr dev;
xSetDeviceValuatorsReply rep;
@@ -152,7 +152,7 @@ void
SRepXSetDeviceValuators(ClientPtr client, int size,
xSetDeviceValuatorsReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/setfocus.c b/Xi/setfocus.c
index 59fe076..aaf88ce 100644
--- a/Xi/setfocus.c
+++ b/Xi/setfocus.c
@@ -78,9 +78,9 @@ SOFTWARE.
*/
int
-SProcXSetDeviceFocus(register ClientPtr client)
+SProcXSetDeviceFocus(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xSetDeviceFocusReq);
swaps(&stuff->length, n);
@@ -97,10 +97,10 @@ SProcXSetDeviceFocus(register ClientPtr
*/
int
-ProcXSetDeviceFocus(register ClientPtr client)
+ProcXSetDeviceFocus(ClientPtr client)
{
int ret;
- register DeviceIntPtr dev;
+ DeviceIntPtr dev;
REQUEST(xSetDeviceFocusReq);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
index 645f246..0078499 100644
--- a/Xi/setmmap.c
+++ b/Xi/setmmap.c
@@ -76,9 +76,9 @@ SOFTWARE.
*/
int
-SProcXSetDeviceModifierMapping(register ClientPtr client)
+SProcXSetDeviceModifierMapping(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xSetDeviceModifierMappingReq);
swaps(&stuff->length, n);
@@ -145,7 +145,7 @@ void
SRepXSetDeviceModifierMapping(ClientPtr client, int size,
xSetDeviceModifierMappingReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/setmode.c b/Xi/setmode.c
index 11feb6d..688f2a2 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -75,9 +75,9 @@ SOFTWARE.
*/
int
-SProcXSetDeviceMode(register ClientPtr client)
+SProcXSetDeviceMode(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xSetDeviceModeReq);
swaps(&stuff->length, n);
@@ -91,7 +91,7 @@ SProcXSetDeviceMode(register ClientPtr c
*/
int
-ProcXSetDeviceMode(register ClientPtr client)
+ProcXSetDeviceMode(ClientPtr client)
{
DeviceIntPtr dev;
xSetDeviceModeReply rep;
@@ -139,7 +139,7 @@ ProcXSetDeviceMode(register ClientPtr cl
void
SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
diff --git a/Xi/stubs.c b/Xi/stubs.c
index e2ed1ce..ed041b8 100644
--- a/Xi/stubs.c
+++ b/Xi/stubs.c
@@ -168,7 +168,7 @@ OpenInputDevice(DeviceIntPtr dev, Client
*/
int
-SetDeviceMode(register ClientPtr client, DeviceIntPtr dev, int mode)
+SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
{
return BadMatch;
}
@@ -186,7 +186,7 @@ SetDeviceMode(register ClientPtr client,
*/
int
-SetDeviceValuators(register ClientPtr client, DeviceIntPtr dev,
+SetDeviceValuators(ClientPtr client, DeviceIntPtr dev,
int *valuators, int first_valuator, int num_valuators)
{
return BadMatch;
@@ -201,7 +201,7 @@ SetDeviceValuators(register ClientPtr cl
*/
int
-ChangeDeviceControl(register ClientPtr client, DeviceIntPtr dev,
+ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
xDeviceCtl * control)
{
switch (control->control) {
diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c
index 980fa93..0abbd2e 100644
--- a/Xi/ungrdev.c
+++ b/Xi/ungrdev.c
@@ -74,9 +74,9 @@ SOFTWARE.
*/
int
-SProcXUngrabDevice(register ClientPtr client)
+SProcXUngrabDevice(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xUngrabDeviceReq);
swaps(&stuff->length, n);
@@ -92,7 +92,7 @@ SProcXUngrabDevice(register ClientPtr cl
*/
int
-ProcXUngrabDevice(register ClientPtr client)
+ProcXUngrabDevice(ClientPtr client)
{
DeviceIntPtr dev;
GrabPtr grab;
diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c
index 8db9307..b9f236b 100644
--- a/Xi/ungrdevb.c
+++ b/Xi/ungrdevb.c
@@ -80,9 +80,9 @@ SOFTWARE.
*/
int
-SProcXUngrabDeviceButton(register ClientPtr client)
+SProcXUngrabDeviceButton(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xUngrabDeviceButtonReq);
swaps(&stuff->length, n);
diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c
index ebb83bc..d316990 100644
--- a/Xi/ungrdevk.c
+++ b/Xi/ungrdevk.c
@@ -80,9 +80,9 @@ SOFTWARE.
*/
int
-SProcXUngrabDeviceKey(register ClientPtr client)
+SProcXUngrabDeviceKey(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xUngrabDeviceKeyReq);
swaps(&stuff->length, n);
diff-tree 82a8b99a6c46018885600011913267d8af9dfe13 (from 8c7f56d92d8471ee059c14d322af5f7f555dd5c6)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Wed Mar 28 15:17:02 2007 -0400
Move the XAA private indices to be static.
Technically this is an ABI break, if you aren't smart enough to be using the
getter functions. Cope.
diff --git a/hw/xfree86/xaa/xaaDashLine.c b/hw/xfree86/xaa/xaaDashLine.c
index 2a94a9e..1a4732b 100644
--- a/hw/xfree86/xaa/xaaDashLine.c
+++ b/hw/xfree86/xaa/xaaDashLine.c
@@ -35,7 +35,7 @@ XAAPolyLinesDashed(
#endif
){
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c
index e220811..f3434c9 100644
--- a/hw/xfree86/xaa/xaaGC.c
+++ b/hw/xfree86/xaa/xaaGC.c
@@ -38,7 +38,7 @@ Bool
XAACreateGC(GCPtr pGC)
{
ScreenPtr pScreen = pGC->pScreen;
- XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);
Bool ret;
XAA_SCREEN_PROLOGUE(pScreen,CreateGC);
diff --git a/hw/xfree86/xaa/xaaGCmisc.c b/hw/xfree86/xaa/xaaGCmisc.c
index f7bd576..a7a3f40 100644
--- a/hw/xfree86/xaa/xaaGCmisc.c
+++ b/hw/xfree86/xaa/xaaGCmisc.c
@@ -305,7 +305,7 @@ XAAValidatePolylines(
DrawablePtr pDraw )
{
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
if(pGC->lineStyle == LineSolid) changes &= ~GCDashList;
if(!changes) return;
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 79a0e4c..529dbd1 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -42,14 +42,9 @@ static int XAASetDGAMode(int index, int
static void XAAEnableDisableFBAccess (int index, Bool enable);
static Bool XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask);
-/*
- * XXX These three should be static, but that breaks ABI compat with XF4.4
- * and Xorg 6.7.0 modules. DO NOT use them in new code, you should never
- * be setting them, and you've got Get functions below.
- */
-int XAAScreenIndex = -1;
-int XAAGCIndex = -1;
-int XAAPixmapIndex = -1;
+static int XAAScreenIndex = -1;
+static int XAAGCIndex = -1;
+static int XAAPixmapIndex = -1;
static unsigned long XAAGeneration = 0;
diff --git a/hw/xfree86/xaa/xaaLineMisc.c b/hw/xfree86/xaa/xaaLineMisc.c
index d786737..537b08b 100644
--- a/hw/xfree86/xaa/xaaLineMisc.c
+++ b/hw/xfree86/xaa/xaaLineMisc.c
@@ -64,7 +64,7 @@ void
XAAComputeDash(GCPtr pGC)
{
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;
Bool EvenDash = (pGC->numInDashList & 0x01) ? FALSE : TRUE;
int PatternLength = 0;
unsigned char* DashPtr = (unsigned char*)pGC->dash;
diff --git a/hw/xfree86/xaa/xaaWrapper.c b/hw/xfree86/xaa/xaaWrapper.c
index 5b52568..6d8107b 100644
--- a/hw/xfree86/xaa/xaaWrapper.c
+++ b/hw/xfree86/xaa/xaaWrapper.c
@@ -522,7 +522,7 @@ void
XAASync(ScreenPtr pScreen)
{
XAAScreenPtr pScreenPriv =
- (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
+ (XAAScreenPtr) pScreen->devPrivates[XAAGetScreenIndex()].ptr;
XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec;
if(infoRec->NeedToSync) {
diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h
index 7210d84..c365a7d 100644
--- a/hw/xfree86/xaa/xaalocal.h
+++ b/hw/xfree86/xaa/xaalocal.h
@@ -1640,9 +1640,6 @@ XAAGetPixelFromRGBA (
extern GCOps XAAFallbackOps;
extern GCOps *XAAGetFallbackOps(void);
extern GCFuncs XAAGCFuncs;
-extern int XAAScreenIndex; /* XXX DONTUSE */
-extern int XAAGCIndex; /* XXX DONTUSE */
-extern int XAAPixmapIndex; /* XXX DONTUSE */
extern int XAAGetScreenIndex(void);
extern int XAAGetGCIndex(void);
extern int XAAGetPixmapIndex(void);
diff-tree 8c7f56d92d8471ee059c14d322af5f7f555dd5c6 (from 5ba4d9eedf1b4ce4795bf910cd184872e2d9b3fc)
Author: Tomas Janousek <tomi at nomi.cz>
Date: Wed Mar 28 14:46:30 2007 -0400
Bug #10296: Fix timer rescheduling.
diff --git a/os/WaitFor.c b/os/WaitFor.c
index d39964f..4a606ac 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -125,7 +125,7 @@ struct _OsTimerRec {
};
static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev);
-static void CheckAllTimers(CARD32 now);
+static void CheckAllTimers(void);
static OsTimerPtr timers = NULL;
/*****************
@@ -204,7 +204,7 @@ WaitForSomething(int *pClientsReady)
timeout = timers->expires - now;
if (timeout > 0 && timeout > timers->delta + 250) {
/* time has rewound. reset the timers. */
- CheckAllTimers(now);
+ CheckAllTimers();
}
if (timers) {
@@ -436,11 +436,14 @@ ANYSET(FdMask *src)
/* If time has rewound, re-run every affected timer.
* Timers might drop out of the list, so we have to restart every time. */
static void
-CheckAllTimers(CARD32 now)
+CheckAllTimers(void)
{
OsTimerPtr timer;
+ CARD32 now;
start:
+ now = GetTimeInMillis();
+
for (timer = timers; timer; timer = timer->next) {
if (timer->expires - now > timer->delta + 250) {
TimerForce(timer);
diff-tree 5ba4d9eedf1b4ce4795bf910cd184872e2d9b3fc (from 85220446359a75ea2c359b418b4051c04eea739c)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Wed Mar 28 12:03:19 2007 -0400
Refuse to create tiny modes from EDID detailed timing.
diff --git a/hw/xfree86/ddc/edid_modes.c b/hw/xfree86/ddc/edid_modes.c
index cfc8ddc..926bc89 100644
--- a/hw/xfree86/ddc/edid_modes.c
+++ b/hw/xfree86/ddc/edid_modes.c
@@ -107,6 +107,19 @@ DDCModeFromDetailedTiming(int scrnIndex,
{
DisplayModePtr Mode;
+ /*
+ * Refuse to create modes that are insufficiently large. 64 is a random
+ * number, maybe the spec says something about what the minimum is. In
+ * particular I see this frequently with _old_ EDID, 1.0 or so, so maybe
+ * our parser is just being too aggresive there.
+ */
+ if (timing->h_active < 64 || timing->v_active < 64) {
+ xf86DrvMsg(scrnIndex, X_INFO,
+ "%s: Ignoring tiny %dx%d mode\n", __func__,
+ timing->h_active, timing->v_active);
+ return NULL;
+ }
+
/* We don't do stereo */
if (timing->stereo) {
xf86DrvMsg(scrnIndex, X_INFO,
diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index c4cf687..7a8ec19 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -197,6 +197,19 @@ DDCModeFromDetailedTiming(int scrnIndex,
{
DisplayModePtr Mode;
+ /*
+ * Refuse to create modes that are insufficiently large. 64 is a random
+ * number, maybe the spec says something about what the minimum is. In
+ * particular I see this frequently with _old_ EDID, 1.0 or so, so maybe
+ * our parser is just being too aggresive there.
+ */
+ if (timing->h_active < 64 || timing->v_active < 64) {
+ xf86DrvMsg(scrnIndex, X_INFO,
+ "%s: Ignoring tiny %dx%d mode\n", __func__,
+ timing->h_active, timing->v_active);
+ return NULL;
+ }
+
/* We don't do stereo */
if (timing->stereo) {
xf86DrvMsg(scrnIndex, X_INFO,
diff-tree 85220446359a75ea2c359b418b4051c04eea739c (from 1af2ef0b25fd8017a3271e624a5f1548f02b09f9)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Mar 28 13:03:32 2007 +0300
GL: Update for Mesa changes
Added s_fragprog.c to fix the build.
diff --git a/GL/mesa/swrast/Makefile.am b/GL/mesa/swrast/Makefile.am
index 9a6aa92..bffb1e7 100644
--- a/GL/mesa/swrast/Makefile.am
+++ b/GL/mesa/swrast/Makefile.am
@@ -34,6 +34,7 @@ nodist_libswrast_la_SOURCES = s_aaline.c
s_drawpix.c \
s_feedback.c \
s_fog.c \
+ s_fragprog.c \
s_imaging.c \
s_lines.c \
s_logic.c \
diff-tree 1af2ef0b25fd8017a3271e624a5f1548f02b09f9 (from 0bfc3cc22db94ec6867596606fe93228e315c847)
Author: Eric Anholt <eric at anholt.net>
Date: Tue Mar 27 13:13:45 2007 -0700
Enable Composite by default now that it disables itself in the known bad cases.
diff --git a/os/utils.c b/os/utils.c
index 2fc5cbb..e605a6c 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -136,10 +136,7 @@ _X_EXPORT Bool noTestExtensions;
_X_EXPORT Bool noBigReqExtension = FALSE;
#endif
#ifdef COMPOSITE
- /* COMPOSITE is disabled by default for now until the
- * interface is stable */
- #define COMPOSITE_DEFAULT FALSE
-_X_EXPORT Bool noCompositeExtension = !COMPOSITE_DEFAULT;
+_X_EXPORT Bool noCompositeExtension = FALSE;
#endif
#ifdef DAMAGE
diff-tree 0bfc3cc22db94ec6867596606fe93228e315c847 (from 5e7936371c9e1ac48e19bf1e9e3f71f037fd9b5d)
Author: Eric Anholt <eric at anholt.net>
Date: Tue Mar 27 13:12:21 2007 -0700
Disable composite when Xinerama is active.
It will likely take a decent bit of work to make that work right.
diff --git a/composite/compext.c b/composite/compext.c
index af05b4a..ba37e7d 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -696,6 +696,11 @@ CompositeExtensionInit (void)
if (GetPictureScreenIfSet(pScreen) == NULL)
return;
}
+ /* Xinerama's rewriting of window drawing before Composite gets to it
+ * breaks Composite.
+ */
+ if (!noPanoramiXExtension)
+ return;
CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
if (!CompositeClientWindowType)
diff-tree 5e7936371c9e1ac48e19bf1e9e3f71f037fd9b5d (from 8afc7e2eb3ebec48d3879bf269143259c8bc18c8)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Mar 26 20:18:18 2007 -0700
Disable Composite when the screen's visual is pseudocolor.
Rendering fails badly in this case, and I don't care enough to fix it.
diff --git a/composite/compext.c b/composite/compext.c
index 3a9f896..af05b4a 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -678,9 +678,22 @@ CompositeExtensionInit (void)
ExtensionEntry *extEntry;
int s;
- /* Ensure that Render is initialized on all screens. */
for (s = 0; s < screenInfo.numScreens; s++) {
- if (GetPictureScreenIfSet(screenInfo.screens[s]) == NULL)
+ ScreenPtr pScreen = screenInfo.screens[s];
+ VisualPtr vis;
+
+ /* Composite on 8bpp pseudocolor root windows appears to fail, so
+ * just disable it on anything pseudocolor for safety.
+ */
+ for (vis = pScreen->visuals; vis->vid != pScreen->rootVisual; vis++)
+ ;
+ if ((vis->class | DynamicClass) == PseudoColor)
+ return;
+
+ /* Ensure that Render is initialized, which is required for automatic
+ * compositing.
+ */
+ if (GetPictureScreenIfSet(pScreen) == NULL)
return;
}
diff-tree 8afc7e2eb3ebec48d3879bf269143259c8bc18c8 (from 6ed08949af4f7ac09170d3d9581e4092b24a84ee)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Mar 26 15:55:38 2007 -0700
Refuse to initialize Composite if Render is not present.
Composite relies on the presence of Render, in particular for the automatic
compositing.
diff --git a/composite/compext.c b/composite/compext.c
index 4c25cc7..3a9f896 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -678,6 +678,12 @@ CompositeExtensionInit (void)
ExtensionEntry *extEntry;
int s;
+ /* Ensure that Render is initialized on all screens. */
+ for (s = 0; s < screenInfo.numScreens; s++) {
+ if (GetPictureScreenIfSet(screenInfo.screens[s]) == NULL)
+ return;
+ }
+
CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
if (!CompositeClientWindowType)
return;
diff-tree 6ed08949af4f7ac09170d3d9581e4092b24a84ee (from e76b6349516d5d1c8f7167d6f5419e0d06a546c3)
Author: Eric Anholt <eric at anholt.net>
Date: Tue Mar 27 17:31:28 2007 -0700
Move libcw setup to the only renderer requiring it (XAA).
Additionally, protect libcw setup behind checks for Render, to avoid
segfaulting if Render isn't available (xnest).
The previous setup was an ABI-preserving dance, which is better nuked now.
Now, anything that needs libcw must explicitly initialize it, and
miDisableCompositeWrapper (previously only called by EXA and presumably binary
drivers) is gone.
diff --git a/configure.ac b/configure.ac
index 14c4ccb..fde6a89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -853,10 +853,6 @@ AC_DEFINE(DAMAGE,1,[Support Damage exten
DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
DAMAGE_INC='-I$(top_srcdir)/damageext'
MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
-dnl damage (may) need the composite wrapper when composite is enabled
-if test "$COMPOSITE" = yes; then
- MIEXT_DAMAGE_LIB="$MIEXT_DAMAGE_LIB "'$(top_builddir)/miext/cw/libcw.la'
-fi
MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
AC_DEFINE(XINPUT, 1, [Support X Input extension])
diff --git a/exa/exa.c b/exa/exa.c
index e9f42df..dd27d5e 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -668,10 +668,6 @@ exaDriverInit (ScreenPtr pScreen,
}
#endif
-#ifdef COMPOSITE
- miDisableCompositeWrapper(pScreen);
-#endif
-
#ifdef MITSHM
/* Re-register with the MI funcs, which don't allow shared pixmaps.
* Shared pixmaps are almost always a performance loss for us, but this
diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c
index 46d6a02..78ae10e 100644
--- a/hw/xfree86/loader/misym.c
+++ b/hw/xfree86/loader/misym.c
@@ -208,9 +208,6 @@ _X_HIDDEN void *miLookupTab[] = {
#ifdef RENDER
SYMFUNC(miGlyphExtents)
#endif
-#ifdef COMPOSITE
- SYMFUNC(miDisableCompositeWrapper)
-#endif
#ifdef DAMAGE
SYMFUNC(DamageDamageRegion)
#endif
diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am
index 5d529b1..6ed8303 100644
--- a/hw/xfree86/xaa/Makefile.am
+++ b/hw/xfree86/xaa/Makefile.am
@@ -9,6 +9,7 @@ MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaSti
POLYSEG = s-xaaLine.c s-xaaDashLine.c
libxaa_la_LDFLAGS = -avoid-version
+libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la
module_LTLIBRARIES = libxaa.la
libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 1542fc2..79a0e4c 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -227,6 +227,14 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr
if(infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS)
miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4);
+#ifdef COMPOSITE
+ /* Initialize the composite wrapper. This needs to happen after the
+ * wrapping above (so it comes before us), but before all other extensions,
+ * so it doesn't confuse them. (particularly damage).
+ */
+ miInitializeCompositeWrapper(pScreen);
+#endif
+
return TRUE;
}
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index f60f8cf..6950271 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -50,7 +50,6 @@ int cwWindowIndex;
#ifdef RENDER
int cwPictureIndex;
#endif
-static Bool cwDisabled[MAXSCREENS];
static unsigned long cwGeneration = 0;
extern GCOps cwGCOps;
@@ -619,9 +618,9 @@ void
miInitializeCompositeWrapper(ScreenPtr pScreen)
{
cwScreenPtr pScreenPriv;
-
- if (cwDisabled[pScreen->myNum])
- return;
+#ifdef RENDER
+ Bool has_render = GetPictureScreenIfSet(pScreen) != NULL;
+#endif
if (cwGeneration != serverGeneration)
{
@@ -631,7 +630,8 @@ miInitializeCompositeWrapper(ScreenPtr p
cwGCIndex = AllocateGCPrivateIndex();
cwWindowIndex = AllocateWindowPrivateIndex();
#ifdef RENDER
- cwPictureIndex = AllocatePicturePrivateIndex();
+ if (has_render)
+ cwPictureIndex = AllocatePicturePrivateIndex();
#endif
cwGeneration = serverGeneration;
}
@@ -640,8 +640,10 @@ miInitializeCompositeWrapper(ScreenPtr p
if (!AllocateWindowPrivate(pScreen, cwWindowIndex, 0))
return;
#ifdef RENDER
- if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0))
- return;
+ if (has_render) {
+ if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0))
+ return;
+ }
#endif
pScreenPriv = (cwScreenPtr)xalloc(sizeof(cwScreenRec));
if (!pScreenPriv)
@@ -661,17 +663,11 @@ miInitializeCompositeWrapper(ScreenPtr p
SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);
#ifdef RENDER
- if (GetPictureScreen (pScreen))
+ if (has_render)
cwInitializeRender(pScreen);
#endif
}
-_X_EXPORT void
-miDisableCompositeWrapper(ScreenPtr pScreen)
-{
- cwDisabled[pScreen->myNum] = TRUE;
-}
-
static Bool
cwCloseScreen (int i, ScreenPtr pScreen)
{
diff --git a/miext/cw/cw.h b/miext/cw/cw.h
index 09cfc78..69abbbf 100644
--- a/miext/cw/cw.h
+++ b/miext/cw/cw.h
@@ -169,7 +169,3 @@ cwFiniRender (ScreenPtr pScreen);
void
miInitializeCompositeWrapper(ScreenPtr pScreen);
-
-/* Must be called before miInitializeCompositeWrapper */
-void
-miDisableCompositeWrapper(ScreenPtr pScreen);
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 6f1ee28..d930747 100755
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1831,16 +1831,6 @@ DamageSetup (ScreenPtr pScreen)
if (!pScrPriv)
return FALSE;
-#ifdef COMPOSITE
- /* This is a kludge to ensure wrapping order with the composite wrapper.
- * If it's done from compinit.c, then DamageSetup may be called before the
- * extension init phase, so that cw will be higher in the wrapping chain and
- * rewrite drawables before damage gets to it, causing confusion.
- */
- if (!noCompositeExtension)
- miInitializeCompositeWrapper (pScreen);
-#endif
-
pScrPriv->internalLevel = 0;
pScrPriv->pScreenDamage = 0;
diff-tree e76b6349516d5d1c8f7167d6f5419e0d06a546c3 (from 6a0bed16e80a91891cee6c7033c90875bc2af193)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Mar 26 16:04:50 2007 -0700
Fix indentation of fakexa help text.
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index a77b87e..45e2d30 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -81,7 +81,7 @@ ddxUseMsg (void)
ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
- ErrorF("-fakexa Simulate acceleration using software rendering\n");
+ ErrorF("-fakexa Simulate acceleration using software rendering\n");
ErrorF("\n");
exit(1);
diff-tree 6a0bed16e80a91891cee6c7033c90875bc2af193 (from b8f846a9dfc6697d59ad5482ba7c9d738875318e)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date: Tue Mar 27 16:51:12 2007 +0200
Fix typo in GL/mesa/shader/slang/Makefile.am.
diff --git a/GL/mesa/shader/slang/Makefile.am b/GL/mesa/shader/slang/Makefile.am
index 4bd48e9..7f0cd64 100644
--- a/GL/mesa/shader/slang/Makefile.am
+++ b/GL/mesa/shader/slang/Makefile.am
@@ -37,4 +37,4 @@ nodist_libslang_la_SOURCES = slang_built
slang_storage.c \
slang_typeinfo.c \
slang_utility.c \
- slang_variable.c
+ slang_vartable.c
diff-tree b8f846a9dfc6697d59ad5482ba7c9d738875318e (from a63ee90bc2d490f6c5c1802c164391963cf6c1d9)
Author: Dave Airlie <airlied at linux.ie>
Date: Tue Mar 27 14:17:40 2007 +1000
gl: oops dodgy s appeared pointed out by jcristau on irc..
diff --git a/GL/mesa/shader/slang/Makefile.am b/GL/mesa/shader/slang/Makefile.am
index 479de63..4bd48e9 100644
--- a/GL/mesa/shader/slang/Makefile.am
+++ b/GL/mesa/shader/slang/Makefile.am
@@ -18,8 +18,7 @@ INCLUDES = -I at MESA_SOURCE@/include \
-I../.. \
-I$(top_srcdir)/hw/xfree86/os-support
-nodist_libslang_la_SOURCES = s
- slang_builtin.c \
+nodist_libslang_la_SOURCES = slang_builtin.c \
slang_codegen.c \
slang_compile.c \
slang_compile_function.c \
diff-tree a63ee90bc2d490f6c5c1802c164391963cf6c1d9 (from d387a3ddf76716791e5e8b8f0954ca0df3c579d6)
Author: Dave Airlie <airlied at pegasus.(none)>
Date: Tue Mar 27 11:05:52 2007 +1000
gl: update for latest mesa glsl-compiler merge
diff --git a/GL/mesa/main/Makefile.am b/GL/mesa/main/Makefile.am
index 20b7935..2b838e9 100644
--- a/GL/mesa/main/Makefile.am
+++ b/GL/mesa/main/Makefile.am
@@ -68,6 +68,7 @@ nodist_libmain_la_SOURCES = accum.c \
rastpos.c \
rbadaptors.c \
renderbuffer.c \
+ shaders.c \
state.c \
stencil.c \
texcompress.c \
diff --git a/GL/mesa/shader/Makefile.am b/GL/mesa/shader/Makefile.am
index 3519545..abde275 100644
--- a/GL/mesa/shader/Makefile.am
+++ b/GL/mesa/shader/Makefile.am
@@ -27,8 +27,13 @@ nodist_libshader_la_SOURCES = \
atifragshader.c \
nvfragparse.c \
nvprogram.c \
- nvvertexec.c \
- nvvertparse.c \
+ nvvertparse.c \
+ prog_debug.c \
+ prog_execute.c \
+ prog_instruction.c \
+ prog_parameter.c \
+ prog_print.c \
program.c \
- shaderobjects.c \
- shaderobjects_3dlabs.c
+ programopt.c \
+ prog_statevars.c \
+ shader_api.c
diff --git a/GL/mesa/shader/slang/Makefile.am b/GL/mesa/shader/slang/Makefile.am
index 04001c4..479de63 100644
--- a/GL/mesa/shader/slang/Makefile.am
+++ b/GL/mesa/shader/slang/Makefile.am
@@ -18,23 +18,24 @@ INCLUDES = -I at MESA_SOURCE@/include \
-I../.. \
-I$(top_srcdir)/hw/xfree86/os-support
-nodist_libslang_la_SOURCES = slang_analyse.c \
- slang_assemble_assignment.c \
- slang_assemble.c \
- slang_assemble_conditional.c \
- slang_assemble_constructor.c \
- slang_assemble_typeinfo.c \
+nodist_libslang_la_SOURCES = s
+ slang_builtin.c \
+ slang_codegen.c \
slang_compile.c \
slang_compile_function.c \
slang_compile_operation.c \
slang_compile_struct.c \
slang_compile_variable.c \
- slang_execute.c \
- slang_execute_x86.c \
- slang_export.c \
- slang_library_texsample.c \
+ slang_emit.c \
+ slang_ir.c \
+ slang_label.c \
slang_library_noise.c \
slang_link.c \
+ slang_log.c \
slang_preprocess.c \
+ slang_print.c \
+ slang_simplify.c \
slang_storage.c \
- slang_utility.c
+ slang_typeinfo.c \
+ slang_utility.c \
+ slang_variable.c
diff --git a/GL/mesa/swrast/Makefile.am b/GL/mesa/swrast/Makefile.am
index 5ed6576..9a6aa92 100644
--- a/GL/mesa/swrast/Makefile.am
+++ b/GL/mesa/swrast/Makefile.am
@@ -23,7 +23,6 @@ nodist_libswrast_la_SOURCES = s_aaline.c
s_aatriangle.c \
s_accum.c \
s_alpha.c \
- s_arbshader.c \
s_atifragshader.c \
s_bitmap.c \
s_blend.c \
@@ -39,7 +38,6 @@ nodist_libswrast_la_SOURCES = s_aaline.c
s_lines.c \
s_logic.c \
s_masking.c \
- s_nvfragprog.c \
s_points.c \
s_readpix.c \
s_span.c \
diff --git a/GL/mesa/tnl/Makefile.am b/GL/mesa/tnl/Makefile.am
index 5d9bdb1..84301d3 100644
--- a/GL/mesa/tnl/Makefile.am
+++ b/GL/mesa/tnl/Makefile.am
@@ -23,7 +23,6 @@ nodist_libtnl_la_SOURCES = t_context.c \
t_pipeline.c \
t_vb_arbprogram.c \
t_vb_arbprogram_sse.c \
- t_vb_arbshader.c \
t_vb_cull.c \
t_vb_fog.c \
t_vb_light.c \
diff-tree d387a3ddf76716791e5e8b8f0954ca0df3c579d6 (from 92ba435bd9aa7b6eca9aef8e5193576ef62fc9db)
Author: Dave Airlie <airlied at pegasus.(none)>
Date: Tue Mar 27 11:00:13 2007 +1000
fix loading of GLcore after recent loading changes
diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c
index 401707a..5384f43 100644
--- a/hw/xfree86/dixmods/glxmodule.c
+++ b/hw/xfree86/dixmods/glxmodule.c
@@ -95,8 +95,8 @@ __glXMesaProxyScreenProbe(ScreenPtr pScr
static __GLXprovider *provider;
if (provider == NULL) {
- GLcore = LoadSubModuleLocal(glxModule, "GLcore", NULL, NULL, NULL, NULL,
- NULL, NULL);
+ GLcore = LoadSubModule(glxModule, "GLcore", NULL, NULL, NULL, NULL,
+ NULL, NULL);
if (GLcore == NULL)
return NULL;
diff-tree 92ba435bd9aa7b6eca9aef8e5193576ef62fc9db (from f7c5aa0dc0fa3569a2ee412c4f996960f936b6ed)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Mar 26 12:44:58 2007 -0700
Update xorg.conf manpage for new RandR 1.2 monitor options.
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index bbba211..cc60d07 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -1004,12 +1004,22 @@ The
.B Identifier
entry specifies the unique name for this monitor. The
.B Monitor
-section provides information about the specifications of the monitor,
-monitor-specific
+section may be used to provide information about the specifications of the
+monitor, monitor-specific
.BR Options ,
-and information about the video modes to use with the monitor. Specifying
-video modes is optional because the server now has a built-in list of
-VESA standard modes. When modes are specified explicitly in the
+and information about the video modes to use with the monitor.
+.PP
+With RandR 1.2-enabled drivers, monitor sections are tied to specific outputs
+of the video card. Each output has a name, and the server will look for a
+Monitor named
+.B \*qMonitor-outputname\*q
+for configuration of that output (for example,
+.B \*qMonitor-VGA\*q
+for a VGA output)
+.PP
+Specifying video modes is optional because the server will use the DDC or other
+information provided by the monitor to automatically configure the list of
+modes available. When modes are specified explicitly in the
.B Monitor
section (with the
.BR Modes ,
@@ -1017,7 +1027,8 @@ section (with the
or
.B UseModes
keywords), built-in modes with the same names are not included. Built-in
-modes with different names are, however, still implicitly included.
+modes with different names are, however, still implicitly included, when they
+meet the requirements of the monitor.
.PP
The entries that may be used in
.B Monitor
@@ -1214,6 +1225,62 @@ monitors do not require it. The default
This optional entry specifies the vertical refresh rate that the server
should aim for when selecting video modes. Without this option, the
default is to prefer modes with higher refresh rates.
+.TP 7
+.BI "Option " "\*qPreferredMode\*q " \*qstring\*q
+This optional entry specifies a mode to be marked as the preferred initial mode
+of the monitor.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qPosition\*q " "\*qx y\*q"
+This optional entry specifies the position of the monitor within the X
+screen.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qLeftOf\*q " \*qmonitor\*q
+This optional entry specifies that the monitor should be positioned to the
+left of the monitor of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qRightOf\*q " \*qmonitor\*q
+This optional entry specifies that the monitor should be positioned to the
+right of the monitor of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qAbove\*q " \*qmonitor\*q
+This optional entry specifies that the monitor should be positioned above the
+monitor of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qBelow\*q " \*qmonitor\*q
+This optional entry specifies that the monitor should be positioned below the
+monitor of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qEnable\*q " \*qbool\*q
+This optional entry specifies whether the monitor should be turned on
+at startup. By default, the server will attempt to enable all connected
+monitors.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qMinClock\*q " \*qfrequency\*q
+This optional entry specifies the minimum dot clock, in kHz, that is supported
+by the monitor.
+.TP 7
+.BI "Option " "\*qMaxClock\*q " \*qfrequency\*q
+This optional entry specifies the maximum dot clock, in kHz, that is supported
+by the monitor.
+.TP 7
+.BI "Option " "\*qIgnore\*q " \*qbool\*q
+This optional entry specifies that the monitor should be ignored entirely,
+and not reported through RandR. This is useful if the hardware reports the
+presence of outputs that don't exist.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qRotate\*q " \*qrotation\*q
+This optional entry specifies the initial rotation of the given monitor.
+Valid values for rotation are \*qnormal\*q, \*qleft\*q, \*qright\*q, and
+\*qinverted\*q.
+(RandR 1.2-supporting drivers only)
.SH MODES SECTION
The config file may have multiple
diff-tree f7c5aa0dc0fa3569a2ee412c4f996960f936b6ed (from 2e3cc861f90415f200826bc71dab6298d759c42b)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date: Mon Mar 26 10:21:44 2007 -0400
Remove dead NEED_DBE_BUF_BITS code.
diff --git a/dbe/dbe.c b/dbe/dbe.c
index 862393b..d63620d 100644
--- a/dbe/dbe.c
+++ b/dbe/dbe.c
@@ -82,36 +82,6 @@ static Bool firstRegistrationPass = TRUE
/******************************************************************************
*
- * DBE DIX Procedure: DbeValidateBuffer
- *
- * Description:
- *
- * This function is called from VALIDATE_DRAWABLE_AND_GC and from
- * various places in dispatch.c if the server has been compiled with
- * the flags -DNEED_DBE_BUF_BITS and -DNEED_DBE_BUF_VALIDATE.
- * When pWin->dstBuffer changes, this function will be called with pWin
- * as the first argument, the drawable ID that was specified as the
- * second argument (could be a back buffer id), and True for the third
- * argument.
- * When pWin->srcBuffer changes, the third argument will be False, and
- * the first two arguments are as described for dstBuffer.
- *
- * This function should prepare the hardware to access the specified
- * buffer for reads (if dstbuf is False) or writes (if dstbuf is True).
- *
- *****************************************************************************/
-
-void
-DbeValidateBuffer(WindowPtr pWin, XID drawID, Bool dstbuf)
-{
- DbeScreenPrivPtr pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
- if (pDbeScreenPriv->ValidateBuffer)
- (*pDbeScreenPriv->ValidateBuffer)(pWin, drawID, dstbuf);
-}
-
-
-/******************************************************************************
- *
* DBE DIX Procedure: DbeRegisterFunction
*
* Description:
@@ -317,7 +287,6 @@ DbeStubScreen(DbeScreenPrivPtr pDbeScree
pDbeScreenPriv->EndIdiom = NULL;
pDbeScreenPriv->WinPrivDelete = NULL;
pDbeScreenPriv->ResetProc = NULL;
- pDbeScreenPriv->ValidateBuffer = NULL;
(*nStubbedScreens)++;
diff --git a/dbe/dbestruct.h b/dbe/dbestruct.h
index 460cc75..835074c 100644
--- a/dbe/dbestruct.h
+++ b/dbe/dbestruct.h
@@ -221,11 +221,6 @@ typedef struct _DbeScreenPrivRec
void (*ResetProc)(
ScreenPtr /*pScreen*/
);
- void (*ValidateBuffer)(
- WindowPtr /*pWin*/,
- XID /*bufId*/,
- Bool /*dstbuffer*/
-);
/* Device-specific private information.
*/
diff --git a/dbe/midbe.c b/dbe/midbe.c
index 76f0577..014e365 100644
--- a/dbe/midbe.c
+++ b/dbe/midbe.c
@@ -759,11 +759,6 @@ miDbeResetProc(ScreenPtr pScreen)
} /* miDbeResetProc() */
-static void
-miDbeNopValidateBuffer(WindowPtr pWin, XID bufId, Bool dstbuffer)
-{
-}
-
/******************************************************************************
*
@@ -821,9 +816,6 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPr
pDbeScreenPriv->ResetProc = miDbeResetProc;
pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
- /* The mi implementation doesn't need buffer validation. */
- pDbeScreenPriv->ValidateBuffer = miDbeNopValidateBuffer;
-
return(TRUE);
} /* miDbeInit() */
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 3d8e71f..490b29c 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1803,8 +1803,6 @@ ProcCopyArea(ClientPtr client)
else
pSrc = pDst;
- SET_DBE_SRCBUF(pSrc, stuff->srcDrawable);
-
pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC, stuff->srcX, stuff->srcY,
stuff->width, stuff->height,
stuff->dstX, stuff->dstY);
@@ -1847,8 +1845,6 @@ ProcCopyPlane(ClientPtr client)
else
psrcDraw = pdstDraw;
- SET_DBE_SRCBUF(psrcDraw, stuff->srcDrawable);
-
/* Check to see if stuff->bitPlane has exactly ONE good bit set */
if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
(stuff->bitPlane > (1L << (psrcDraw->depth - 1))))
@@ -2208,8 +2204,6 @@ DoGetImage(ClientPtr client, int format,
xgi.visual = None;
}
- SET_DBE_SRCBUF(pDraw, drawable);
-
xgi.type = X_Reply;
xgi.sequenceNumber = client->sequence;
xgi.depth = pDraw->depth;
diff --git a/dix/window.c b/dix/window.c
index 7d99477..96002eb 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -297,10 +297,6 @@ SetWindowToDefaults(WindowPtr pWin)
pWin->deliverableEvents = 0;
pWin->dontPropagate = 0;
pWin->forcedBS = FALSE;
-#ifdef NEED_DBE_BUF_BITS
- pWin->srcBuffer = DBE_FRONT_BUFFER;
- pWin->dstBuffer = DBE_FRONT_BUFFER;
-#endif
#ifdef COMPOSITE
pWin->redirectDraw = 0;
#endif
diff --git a/include/dix.h b/include/dix.h
index b412683..2d452d1 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -81,59 +81,6 @@ SOFTWARE.
return(BadIDChoice);\
}
-/*
- * We think that most hardware implementations of DBE will want
- * LookupID*(dbe_back_buffer_id) to return the window structure that the
- * id is a back buffer for. Since both front and back buffers will
- * return the same structure, you need to be able to distinguish
- * somewhere what kind of buffer (front/back) was being asked for, so
- * that ddx can render to the right place. That's the problem that the
- * following code solves. Note: we couldn't embed this in the LookupID*
- * functions because the VALIDATE_DRAWABLE_AND_GC macro often circumvents
- * those functions by checking a one-element cache. That's why we're
- * mucking with VALIDATE_DRAWABLE_AND_GC.
- *
- * If you put -DNEED_DBE_BUF_BITS into PervasiveDBEDefines, the window
- * structure will have two additional bits defined, srcBuffer and
- * dstBuffer, and their values will be maintained via the macros
- * SET_DBE_DSTBUF and SET_DBE_SRCBUF (below). If you also
- * put -DNEED_DBE_BUF_VALIDATE into PervasiveDBEDefines, the function
- * DbeValidateBuffer will be called any time the bits change to give you
- * a chance to do some setup. See the DBE code for more details on this
- * function. We put in these levels of conditionality so that you can do
- * just what you need to do, and no more. If neither of these defines
- * are used, the bits won't be there, and VALIDATE_DRAWABLE_AND_GC will
- * be unchanged. dpw
- */
-
-#if defined(NEED_DBE_BUF_BITS)
-#define SET_DBE_DSTBUF(_pDraw, _drawID) \
- SET_DBE_BUF(_pDraw, _drawID, dstBuffer, TRUE)
-#define SET_DBE_SRCBUF(_pDraw, _drawID) \
- SET_DBE_BUF(_pDraw, _drawID, srcBuffer, FALSE)
-#if defined (NEED_DBE_BUF_VALIDATE)
-#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
- if (_pDraw->type == DRAWABLE_WINDOW)\
- {\
- int thisbuf = (_pDraw->id == _drawID);\
- if (thisbuf != ((WindowPtr)_pDraw)->_whichBuffer)\
- {\
- ((WindowPtr)_pDraw)->_whichBuffer = thisbuf;\
- DbeValidateBuffer((WindowPtr)_pDraw, _drawID, _dstbuf);\
- }\
- }
-#else /* want buffer bits, but don't need to call DbeValidateBuffer */
-#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
- if (_pDraw->type == DRAWABLE_WINDOW)\
- {\
- ((WindowPtr)_pDraw)->_whichBuffer = (_pDraw->id == _drawID);\
- }
-#endif /* NEED_DBE_BUF_VALIDATE */
-#else /* don't want buffer bits in window */
-#define SET_DBE_DSTBUF(_pDraw, _drawID) /**/
-#define SET_DBE_SRCBUF(_pDraw, _drawID) /**/
-#endif /* NEED_DBE_BUF_BITS */
-
#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\
if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\
(client->lastDrawableID != drawID))\
@@ -158,7 +105,6 @@ SOFTWARE.
pGC = client->lastGC;\
pDraw = client->lastDrawable;\
}\
- SET_DBE_DSTBUF(pDraw, drawID);\
if (pGC->serialNumber != pDraw->serialNumber)\
ValidateGC(pDraw, pGC);
diff --git a/include/windowstr.h b/include/windowstr.h
index a37dc6b..9fd6d76 100644
--- a/include/windowstr.h
+++ b/include/windowstr.h
@@ -129,12 +129,6 @@ typedef struct _Window {
unsigned viewable:1; /* realized && InputOutput */
unsigned dontPropagate:3;/* index into DontPropagateMasks */
unsigned forcedBS:1; /* system-supplied backingStore */
-#ifdef NEED_DBE_BUF_BITS
-#define DBE_FRONT_BUFFER 1
-#define DBE_BACK_BUFFER 0
- unsigned dstBuffer:1; /* destination buffer for rendering */
- unsigned srcBuffer:1; /* source buffer for rendering */
-#endif
#ifdef COMPOSITE
unsigned redirectDraw:1; /* rendering is redirected from here */
#endif
diff-tree 2e3cc861f90415f200826bc71dab6298d759c42b (from e88fa75c9b468b88bb7b87b1da235c6eb2fe8164)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 22:01:34 2007 -0400
Since ddc, i2c, and ramdac are in core now, remove their ModuleData stubs.
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 8080c8d..21984bc 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -15,52 +15,6 @@
static const OptionInfoRec *DDCAvailableOptions(void *unused);
-#if DDC_MODULE
-
-static MODULESETUPPROTO(ddcSetup);
-
-static XF86ModuleVersionInfo ddcVersRec =
-{
- "ddc",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData ddcModuleData = { &ddcVersRec, ddcSetup, NULL };
-
-ModuleInfoRec DDC = {
- 1,
- "DDC",
- NULL,
- 0,
- DDCAvailableOptions,
-};
-
-static pointer
-ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- if (!setupDone) {
- setupDone = TRUE;
- xf86AddModuleInfo(&DDC, module);
- }
- /*
- * The return value must be non-NULL on success even though there
- * is no TearDownProc.
- */
- return (pointer)1;
-}
-
-#endif
-
#define RETRIES 4
static unsigned char *EDIDRead_DDC1(
diff --git a/hw/xfree86/i2c/xf86i2cmodule.c b/hw/xfree86/i2c/xf86i2cmodule.c
deleted file mode 100644
index 3c6d313..0000000
--- a/hw/xfree86/i2c/xf86i2cmodule.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* (c) Itai Nahshon
- *
- * This code is derived from and inspired by the I2C driver
- * from the Linux kernel.
- * (c) 1998 Gerd Knorr <kraxel at cs.tu-berlin.de>
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(i2cSetup);
-
-static XF86ModuleVersionInfo i2cVersRec =
-{
- "i2c",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 2, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData i2cModuleData = { &i2cVersRec, i2cSetup, NULL };
-
-static pointer
-i2cSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
-/* ErrorF("i2cSetup\n"); */
- return (pointer)1;
-}
diff --git a/hw/xfree86/ramdac/xf86RamDacMod.c b/hw/xfree86/ramdac/xf86RamDacMod.c
deleted file mode 100644
index b4187a9..0000000
--- a/hw/xfree86/ramdac/xf86RamDacMod.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 1998 by Alan Hourihane, Wigan, England.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Alan Hourihane, <alanh at fairlite.demon.co.uk>
- *
- * Generic RAMDAC module.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static XF86ModuleVersionInfo VersRec = {
- "ramdac",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 0, 1, 0,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0, 0, 0, 0}
-};
-
-_X_EXPORT XF86ModuleData ramdacModuleData = { &VersRec, NULL, NULL };
diff-tree e88fa75c9b468b88bb7b87b1da235c6eb2fe8164 (from 4b5802ddbd45271be3cadeae0a83a6742df2515b)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 18 17:39:08 2007 -0400
Static cleanup on Xi/
diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
index d0acc59..82616c6 100644
--- a/Xi/chgfctl.c
+++ b/Xi/chgfctl.c
@@ -89,137 +89,13 @@ SProcXChangeFeedbackControl(register Cli
return (ProcXChangeFeedbackControl(client));
}
-/***********************************************************************
- *
- * Change the control attributes.
- *
- */
-
-int
-ProcXChangeFeedbackControl(ClientPtr client)
-{
- unsigned len;
- DeviceIntPtr dev;
- KbdFeedbackPtr k;
- PtrFeedbackPtr p;
- IntegerFeedbackPtr i;
- StringFeedbackPtr s;
- BellFeedbackPtr b;
- LedFeedbackPtr l;
-
- REQUEST(xChangeFeedbackControlReq);
- REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
-
- len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
- dev = LookupDeviceIntRec(stuff->deviceid);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
- BadDevice);
- return Success;
- }
-
- switch (stuff->feedbackid) {
- case KbdFeedbackClass:
- if (len != (sizeof(xKbdFeedbackCtl) >> 2)) {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- 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]);
- return Success;
- }
- break;
- case PtrFeedbackClass:
- if (len != (sizeof(xPtrFeedbackCtl) >> 2)) {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- 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]);
- return Success;
- }
- break;
- case StringFeedbackClass:
- {
- register char n;
- xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
-
- if (client->swapped) {
- swaps(&f->num_keysyms, n);
- }
- if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms)) {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- 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]);
- return Success;
- }
- break;
- }
- case IntegerFeedbackClass:
- if (len != (sizeof(xIntegerFeedbackCtl) >> 2)) {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- 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]);
- return Success;
- }
- break;
- case LedFeedbackClass:
- if (len != (sizeof(xLedFeedbackCtl) >> 2)) {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- 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]);
- return Success;
- }
- break;
- case BellFeedbackClass:
- if (len != (sizeof(xBellFeedbackCtl) >> 2)) {
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
- 0, BadLength);
- return Success;
- }
- 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]);
- return Success;
- }
- break;
- default:
- break;
- }
-
- SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
- return Success;
-}
-
/******************************************************************************
*
* This procedure changes KbdFeedbackClass data.
*
*/
-int
+static int
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
KbdFeedbackPtr k, xKbdFeedbackCtl * f)
{
@@ -351,7 +227,7 @@ ChangeKbdFeedback(ClientPtr client, Devi
*
*/
-int
+static int
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
PtrFeedbackPtr p, xPtrFeedbackCtl * f)
{
@@ -422,7 +298,7 @@ ChangePtrFeedback(ClientPtr client, Devi
*
*/
-int
+static int
ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, IntegerFeedbackPtr i,
xIntegerFeedbackCtl * f)
@@ -445,7 +321,7 @@ ChangeIntegerFeedback(ClientPtr client,
*
*/
-int
+static int
ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, StringFeedbackPtr s,
xStringFeedbackCtl * f)
@@ -495,7 +371,7 @@ ChangeStringFeedback(ClientPtr client, D
*
*/
-int
+static int
ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, BellFeedbackPtr b,
xBellFeedbackCtl * f)
@@ -560,7 +436,7 @@ ChangeBellFeedback(ClientPtr client, Dev
*
*/
-int
+static int
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
LedFeedbackPtr l, xLedFeedbackCtl * f)
{
@@ -585,3 +461,128 @@ ChangeLedFeedback(ClientPtr client, Devi
return Success;
}
+
+/***********************************************************************
+ *
+ * Change the control attributes.
+ *
+ */
+
+int
+ProcXChangeFeedbackControl(ClientPtr client)
+{
+ unsigned len;
+ DeviceIntPtr dev;
+ KbdFeedbackPtr k;
+ PtrFeedbackPtr p;
+ IntegerFeedbackPtr i;
+ StringFeedbackPtr s;
+ BellFeedbackPtr b;
+ LedFeedbackPtr l;
+
+ REQUEST(xChangeFeedbackControlReq);
+ REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
+
+ len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
+ dev = LookupDeviceIntRec(stuff->deviceid);
+ if (dev == NULL) {
+ SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
+ BadDevice);
+ return Success;
+ }
+
+ switch (stuff->feedbackid) {
+ case KbdFeedbackClass:
+ if (len != (sizeof(xKbdFeedbackCtl) >> 2)) {
+ SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
+ 0, BadLength);
+ return Success;
+ }
+ 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]);
+ return Success;
+ }
+ break;
+ case PtrFeedbackClass:
+ if (len != (sizeof(xPtrFeedbackCtl) >> 2)) {
+ SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
+ 0, BadLength);
+ return Success;
+ }
+ 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]);
+ return Success;
+ }
+ break;
+ case StringFeedbackClass:
+ {
+ register char n;
+ xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
+
+ if (client->swapped) {
+ swaps(&f->num_keysyms, n);
+ }
+ if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms)) {
+ SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
+ 0, BadLength);
+ return Success;
+ }
+ 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]);
+ return Success;
+ }
+ break;
+ }
+ case IntegerFeedbackClass:
+ if (len != (sizeof(xIntegerFeedbackCtl) >> 2)) {
+ SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
+ 0, BadLength);
+ return Success;
+ }
+ 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]);
+ return Success;
+ }
+ break;
+ case LedFeedbackClass:
+ if (len != (sizeof(xLedFeedbackCtl) >> 2)) {
+ SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
+ 0, BadLength);
+ return Success;
+ }
+ 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]);
+ return Success;
+ }
+ break;
+ case BellFeedbackClass:
+ if (len != (sizeof(xBellFeedbackCtl) >> 2)) {
+ SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
+ 0, BadLength);
+ return Success;
+ }
+ 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]);
+ return Success;
+ }
+ break;
+ default:
+ break;
+ }
+
+ SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
+ return Success;
+}
+
diff --git a/Xi/chgfctl.h b/Xi/chgfctl.h
index 81e1153..cfa9fc6 100644
--- a/Xi/chgfctl.h
+++ b/Xi/chgfctl.h
@@ -36,46 +36,4 @@ int SProcXChangeFeedbackControl(ClientPt
int ProcXChangeFeedbackControl(ClientPtr /* client */
);
-int ChangeKbdFeedback(ClientPtr /* client */ ,
- DeviceIntPtr /* dev */ ,
- unsigned long /* mask */ ,
- KbdFeedbackPtr /* k */ ,
- xKbdFeedbackCtl * /* f */
- );
-
-int ChangePtrFeedback(ClientPtr /* client */ ,
- DeviceIntPtr /* dev */ ,
- unsigned long /* mask */ ,
- PtrFeedbackPtr /* p */ ,
- xPtrFeedbackCtl * /* f */
- );
-
-int ChangeIntegerFeedback(ClientPtr /* client */ ,
- DeviceIntPtr /* dev */ ,
- unsigned long /* mask */ ,
- IntegerFeedbackPtr /* i */ ,
- xIntegerFeedbackCtl * /* f */
- );
-
-int ChangeStringFeedback(ClientPtr /* client */ ,
- DeviceIntPtr /* dev */ ,
- unsigned long /* mask */ ,
- StringFeedbackPtr /* s */ ,
- xStringFeedbackCtl * /* f */
- );
-
-int ChangeBellFeedback(ClientPtr /* client */ ,
- DeviceIntPtr /* dev */ ,
- unsigned long /* mask */ ,
- BellFeedbackPtr /* b */ ,
- xBellFeedbackCtl * /* f */
- );
-
-int ChangeLedFeedback(ClientPtr /* client */ ,
- DeviceIntPtr /* dev */ ,
- unsigned long /* mask */ ,
- LedFeedbackPtr /* l */ ,
- xLedFeedbackCtl * /* f */
- );
-
#endif /* CHGFCTL_H */
diff --git a/Xi/chgptr.h b/Xi/chgptr.h
index fb3b5cc..2d8ab66 100644
--- a/Xi/chgptr.h
+++ b/Xi/chgptr.h
@@ -45,12 +45,4 @@ void SendEventToAllWindows(DeviceIntPtr
int /* count */
);
-void FindInterestedChildren( /* FIXME: could be static? */
- DeviceIntPtr /* dev */ ,
- WindowPtr /* p1 */ ,
- Mask /* mask */ ,
- xEvent * /* ev */ ,
- int /* count */
- );
-
#endif /* CHGPTR_H */
diff --git a/Xi/closedev.c b/Xi/closedev.c
index cc83e6a..3d47b5f 100644
--- a/Xi/closedev.c
+++ b/Xi/closedev.c
@@ -89,42 +89,29 @@ SProcXCloseDevice(register ClientPtr cli
/***********************************************************************
*
- * This procedure closes an input device.
+ * Clear out event selections and passive grabs from a window for the
+ * specified device.
*
*/
-int
-ProcXCloseDevice(register ClientPtr client)
+static void
+DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
{
- int i;
- WindowPtr pWin, p1;
- DeviceIntPtr d;
-
- REQUEST(xCloseDeviceReq);
- REQUEST_SIZE_MATCH(xCloseDeviceReq);
-
- d = LookupDeviceIntRec(stuff->deviceid);
- if (d == NULL) {
- SendErrorToClient(client, IReqCode, X_CloseDevice, 0, BadDevice);
- return Success;
- }
-
- if (d->grab && SameClient(d->grab, client))
- (*d->DeactivateGrab) (d); /* release active grab */
+ InputClientsPtr others;
+ OtherInputMasks *pOthers;
+ GrabPtr grab, next;
- /* Remove event selections from all windows for events from this device
- * and selected by this client.
- * Delete passive grabs from all windows for this device. */
+ if ((pOthers = wOtherInputMasks(pWin)) != 0)
+ for (others = pOthers->inputClients; others; others = others->next)
+ if (SameClient(others, client))
+ others->mask[dev->id] = NoEventMask;
- for (i = 0; i < screenInfo.numScreens; i++) {
- pWin = WindowTable[i];
- DeleteDeviceEvents(d, pWin, client);
- p1 = pWin->firstChild;
- DeleteEventsFromChildren(d, p1, client);
+ for (grab = wPassiveGrabs(pWin); grab; grab = next) {
+ next = grab->next;
+ if ((grab->device == dev) &&
+ (client->clientAsMask == CLIENT_BITS(grab->resource)))
+ FreeResource(grab->resource, RT_NONE);
}
-
- CloseInputDevice(d, client);
- return Success;
}
/***********************************************************************
@@ -134,7 +121,7 @@ ProcXCloseDevice(register ClientPtr clie
*
*/
-void
+static void
DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
{
WindowPtr p2;
@@ -149,27 +136,40 @@ DeleteEventsFromChildren(DeviceIntPtr de
/***********************************************************************
*
- * Clear out event selections and passive grabs from a window for the
- * specified device.
+ * This procedure closes an input device.
*
*/
-void
-DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
+int
+ProcXCloseDevice(register ClientPtr client)
{
- InputClientsPtr others;
- OtherInputMasks *pOthers;
- GrabPtr grab, next;
+ int i;
+ WindowPtr pWin, p1;
+ DeviceIntPtr d;
- if ((pOthers = wOtherInputMasks(pWin)) != 0)
- for (others = pOthers->inputClients; others; others = others->next)
- if (SameClient(others, client))
- others->mask[dev->id] = NoEventMask;
+ REQUEST(xCloseDeviceReq);
+ REQUEST_SIZE_MATCH(xCloseDeviceReq);
- for (grab = wPassiveGrabs(pWin); grab; grab = next) {
- next = grab->next;
- if ((grab->device == dev) &&
- (client->clientAsMask == CLIENT_BITS(grab->resource)))
- FreeResource(grab->resource, RT_NONE);
+ d = LookupDeviceIntRec(stuff->deviceid);
+ if (d == NULL) {
+ SendErrorToClient(client, IReqCode, X_CloseDevice, 0, BadDevice);
+ return Success;
+ }
+
+ if (d->grab && SameClient(d->grab, client))
+ (*d->DeactivateGrab) (d); /* release active grab */
+
+ /* Remove event selections from all windows for events from this device
+ * and selected by this client.
+ * Delete passive grabs from all windows for this device. */
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ pWin = WindowTable[i];
+ DeleteDeviceEvents(d, pWin, client);
+ p1 = pWin->firstChild;
+ DeleteEventsFromChildren(d, p1, client);
}
+
+ CloseInputDevice(d, client);
+ return Success;
}
diff --git a/Xi/closedev.h b/Xi/closedev.h
index 6853d50..400aaa6 100644
--- a/Xi/closedev.h
+++ b/Xi/closedev.h
@@ -36,14 +36,4 @@ int SProcXCloseDevice(ClientPtr /* clien
int ProcXCloseDevice(ClientPtr /* client */
);
-void DeleteEventsFromChildren(DeviceIntPtr /* dev */ ,
- WindowPtr /* p1 */ ,
- ClientPtr /* client */
- );
-
-void DeleteDeviceEvents(DeviceIntPtr /* dev */ ,
- WindowPtr /* pWin */ ,
- ClientPtr /* client */
- );
-
#endif /* CLOSEDEV_H */
diff --git a/Xi/exevents.c b/Xi/exevents.c
index b7645f4..164fce3 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -994,33 +994,7 @@ ChangeKeyMapping(ClientPtr client,
return client->noClientException;
}
-void
-DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
-{
- int i;
- DeviceIntPtr dev;
- InputClientsPtr ic;
- struct _OtherInputMasks *inputMasks;
-
- for (dev = inputInfo.devices; dev; dev = dev->next) {
- if (dev == inputInfo.pointer || dev == inputInfo.keyboard)
- continue;
- DeleteDeviceFromAnyExtEvents(pWin, dev);
- }
-
- 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++)
- inputMasks->dontPropagateMask[i] = 0;
- FreeResource(ic->resource, RT_NONE);
- }
-}
-
-void
+static void
DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev)
{
WindowPtr parent;
@@ -1085,6 +1059,32 @@ DeleteDeviceFromAnyExtEvents(WindowPtr p
dev->valuator->motionHintWindow = NullWindow;
}
+void
+DeleteWindowFromAnyExtEvents(WindowPtr pWin, Bool freeResources)
+{
+ int i;
+ DeviceIntPtr dev;
+ InputClientsPtr ic;
+ struct _OtherInputMasks *inputMasks;
+
+ for (dev = inputInfo.devices; dev; dev = dev->next) {
+ if (dev == inputInfo.pointer || dev == inputInfo.keyboard)
+ continue;
+ DeleteDeviceFromAnyExtEvents(pWin, dev);
+ }
+
+ 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++)
+ inputMasks->dontPropagateMask[i] = 0;
+ FreeResource(ic->resource, RT_NONE);
+ }
+}
+
int
MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask)
{
@@ -1138,7 +1138,7 @@ CheckDeviceGrabAndHintWindow(WindowPtr p
}
}
-Mask
+static Mask
DeviceEventMaskForClient(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
{
register InputClientsPtr other;
@@ -1223,7 +1223,7 @@ ShouldFreeInputMasks(WindowPtr pWin, Boo
*
*/
-void
+static void
FindInterestedChildren(DeviceIntPtr dev, WindowPtr p1, Mask mask,
xEvent * ev, int count)
{
diff --git a/Xi/exglobals.h b/Xi/exglobals.h
index 61ebca8..50bb33f 100644
--- a/Xi/exglobals.h
+++ b/Xi/exglobals.h
@@ -45,7 +45,6 @@ extern Mask DevicePointerMotionMask;
extern Mask DevicePointerMotionHintMask;
extern Mask DeviceFocusChangeMask;
extern Mask DeviceStateNotifyMask;
-extern Mask ChangeDeviceNotifyMask;
extern Mask DeviceMappingNotifyMask;
extern Mask DeviceOwnerGrabButtonMask;
extern Mask DeviceButtonGrabMask;
diff --git a/Xi/extinit.c b/Xi/extinit.c
index d14e133..fed54ab 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -161,7 +161,7 @@ Mask DevicePointerMotionMask;
Mask DevicePointerMotionHintMask;
Mask DeviceFocusChangeMask;
Mask DeviceStateNotifyMask;
-Mask ChangeDeviceNotifyMask;
+static Mask ChangeDeviceNotifyMask;
Mask DeviceMappingNotifyMask;
Mask DeviceOwnerGrabButtonMask;
Mask DeviceButtonGrabMask;
@@ -208,51 +208,6 @@ static XExtensionVersion thisversion = {
XI_Add_DevicePresenceNotify_Minor
};
-/**********************************************************************
- *
- * IExtensionInit - initialize the input extension.
- *
- * Called from InitExtensions in main() or from QueryExtension() if the
- * extension is dynamically loaded.
- *
- * This extension has several events and errors.
- *
- */
-
-void
-XInputExtensionInit(void)
-{
- ExtensionEntry *extEntry;
-
- extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
- SProcIDispatch, IResetProc, StandardMinorOpcode);
- if (extEntry) {
- IReqCode = extEntry->base;
- 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;
- EventSwapVector[DeviceButtonPress] = SEventIDispatch;
- EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
- EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
- EventSwapVector[DeviceFocusIn] = SEventIDispatch;
- EventSwapVector[DeviceFocusOut] = SEventIDispatch;
- EventSwapVector[ProximityIn] = SEventIDispatch;
- EventSwapVector[ProximityOut] = SEventIDispatch;
- EventSwapVector[DeviceStateNotify] = SEventIDispatch;
- EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
- EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
- EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
- EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
- } else {
- FatalError("IExtensionInit: AddExtensions failed\n");
- }
-}
-
/*************************************************************************
*
* ProcIDispatch - main dispatch routine for requests to this extension.
@@ -260,7 +215,7 @@ XInputExtensionInit(void)
*
*/
-int
+static int
ProcIDispatch(register ClientPtr client)
{
REQUEST(xReq);
@@ -349,7 +304,7 @@ ProcIDispatch(register ClientPtr client)
*
*/
-int
+static int
SProcIDispatch(register ClientPtr client)
{
REQUEST(xReq);
@@ -441,7 +396,7 @@ SProcIDispatch(register ClientPtr client
if (rep->RepType == X_##code) \
SRepX##code (client, len, (x##code##Reply *) rep)
-void
+static void
SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
/* All we look at is the type field */
{ /* This is common to all replies */
@@ -500,68 +455,13 @@ SReplyIDispatch(ClientPtr client, int le
}
}
-/*****************************************************************************
- *
- * SEventIDispatch
- *
- * Swap any events defined in this extension.
- */
-#define DO_SWAP(func,type) func ((type *)from, (type *)to)
-
-void
-SEventIDispatch(xEvent * from, xEvent * to)
-{
- int type = from->u.u.type & 0177;
-
- if (type == DeviceValuator)
- DO_SWAP(SEventDeviceValuator, deviceValuator);
- else if (type == DeviceKeyPress) {
- SKeyButtonPtrEvent(from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- } else if (type == DeviceKeyRelease) {
- SKeyButtonPtrEvent(from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- } else if (type == DeviceButtonPress) {
- SKeyButtonPtrEvent(from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- } else if (type == DeviceButtonRelease) {
- SKeyButtonPtrEvent(from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- } else if (type == DeviceMotionNotify) {
- SKeyButtonPtrEvent(from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- } else if (type == DeviceFocusIn)
- DO_SWAP(SEventFocus, deviceFocus);
- else if (type == DeviceFocusOut)
- DO_SWAP(SEventFocus, deviceFocus);
- else if (type == ProximityIn) {
- SKeyButtonPtrEvent(from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- } else if (type == ProximityOut) {
- SKeyButtonPtrEvent(from, to);
- to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
- } else if (type == DeviceStateNotify)
- DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify);
- else if (type == DeviceKeyStateNotify)
- DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify);
- else if (type == DeviceButtonStateNotify)
- DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify);
- else if (type == DeviceMappingNotify)
- DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
- else if (type == ChangeDeviceNotify)
- DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
- else {
- FatalError("XInputExtension: Impossible event!\n");
- }
-}
-
/************************************************************************
*
* This function swaps the DeviceValuator event.
*
*/
-void
+static void
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
{
register char n;
@@ -577,7 +477,7 @@ SEventDeviceValuator(deviceValuator * fr
}
}
-void
+static void
SEventFocus(deviceFocus * from, deviceFocus * to)
{
register char n;
@@ -588,7 +488,7 @@ SEventFocus(deviceFocus * from, deviceFo
swapl(&to->window, n);
}
-void
+static void
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
{
register int i;
@@ -604,7 +504,7 @@ SDeviceStateNotifyEvent(deviceStateNotif
}
}
-void
+static void
SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
deviceKeyStateNotify * to)
{
@@ -614,7 +514,7 @@ SDeviceKeyStateNotifyEvent(deviceKeyStat
swaps(&to->sequenceNumber, n);
}
-void
+static void
SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
deviceButtonStateNotify * to)
{
@@ -624,7 +524,7 @@ SDeviceButtonStateNotifyEvent(deviceButt
swaps(&to->sequenceNumber, n);
}
-void
+static void
SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
{
register char n;
@@ -634,7 +534,7 @@ SChangeDeviceNotifyEvent(changeDeviceNot
swapl(&to->time, n);
}
-void
+static void
SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
{
register char n;
@@ -644,7 +544,7 @@ SDeviceMappingNotifyEvent(deviceMappingN
swapl(&to->time, n);
}
-void
+static void
SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
{
register char n;
@@ -655,13 +555,106 @@ SDevicePresenceNotifyEvent (devicePresen
swaps(&to->control, n);
}
+/**************************************************************************
+ *
+ * Allow the specified event to have its propagation suppressed.
+ * The default is to not allow suppression of propagation.
+ *
+ */
+
+static void
+AllowPropagateSuppress(Mask mask)
+{
+ int i;
+
+ for (i = 0; i < MAX_DEVICES; i++)
+ PropagateMask[i] |= mask;
+}
+
+/**************************************************************************
+ *
+ * Return the next available extension event mask.
+ *
+ */
+
+static Mask
+GetNextExtEventMask(void)
+{
+ int i;
+ Mask mask = lastExtEventMask;
+
+ if (lastExtEventMask == 0) {
+ FatalError("GetNextExtEventMask: no more events are available.");
+ }
+ lastExtEventMask <<= 1;
+
+ for (i = 0; i < MAX_DEVICES; i++)
+ ExtValidMasks[i] |= mask;
+ return mask;
+}
+
+/**************************************************************************
+ *
+ * Record an event mask where there is no unique corresponding event type.
+ * We can't call SetMaskForEvent, since that would clobber the existing
+ * mask for that event. MotionHint and ButtonMotion are examples.
+ *
+ * Since extension event types will never be less than 64, we can use
+ * 0-63 in the EventInfo array as the "type" to be used to look up this
+ * mask. This means that the corresponding macros such as
+ * DevicePointerMotionHint must have access to the same constants.
+ *
+ */
+
+static void
+SetEventInfo(Mask mask, int constant)
+{
+ EventInfo[ExtEventIndex].mask = mask;
+ EventInfo[ExtEventIndex++].type = constant;
+}
+
+/**************************************************************************
+ *
+ * Allow the specified event to be restricted to being selected by one
+ * client at a time.
+ * The default is to allow more than one client to select the event.
+ *
+ */
+
+static void
+SetExclusiveAccess(Mask mask)
+{
+ int i;
+
+ for (i = 0; i < MAX_DEVICES; i++)
+ ExtExclusiveMasks[i] |= mask;
+}
+
+/**************************************************************************
+ *
+ * Assign the specified mask to the specified event.
+ *
+ */
+
+static void
+SetMaskForExtEvent(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);
+}
+
/************************************************************************
*
* This function sets up extension event types and masks.
*
*/
-void
+static void
FixExtensionEvents(ExtensionEntry * extEntry)
{
Mask mask;
@@ -767,7 +760,7 @@ FixExtensionEvents(ExtensionEntry * extE
*
*/
-void
+static void
RestoreExtensionEvents(void)
{
int i;
@@ -815,7 +808,7 @@ RestoreExtensionEvents(void)
*
*/
-void
+static void
IResetProc(ExtensionEntry * unused)
{
@@ -859,7 +852,7 @@ AssignTypeAndName(DeviceIntPtr dev, Atom
*
*/
-void
+static void
MakeDeviceTypeAtoms(void)
{
int i;
@@ -892,95 +885,102 @@ LookupDeviceIntRec(CARD8 id)
return NULL;
}
-/**************************************************************************
- *
- * Allow the specified event to be restricted to being selected by one
- * client at a time.
- * The default is to allow more than one client to select the event.
- *
- */
-
-void
-SetExclusiveAccess(Mask mask)
-{
- int i;
-
- for (i = 0; i < MAX_DEVICES; i++)
- ExtExclusiveMasks[i] |= mask;
-}
-
-/**************************************************************************
- *
- * Allow the specified event to have its propagation suppressed.
- * The default is to not allow suppression of propagation.
- *
- */
-
-void
-AllowPropagateSuppress(Mask mask)
-{
- int i;
-
- for (i = 0; i < MAX_DEVICES; i++)
- PropagateMask[i] |= mask;
-}
-
-/**************************************************************************
+/*****************************************************************************
*
- * Return the next available extension event mask.
+ * SEventIDispatch
*
+ * Swap any events defined in this extension.
*/
+#define DO_SWAP(func,type) func ((type *)from, (type *)to)
-Mask
-GetNextExtEventMask(void)
+static void
+SEventIDispatch(xEvent * from, xEvent * to)
{
- int i;
- Mask mask = lastExtEventMask;
+ int type = from->u.u.type & 0177;
- if (lastExtEventMask == 0) {
- FatalError("GetNextExtEventMask: no more events are available.");
+ if (type == DeviceValuator)
+ DO_SWAP(SEventDeviceValuator, deviceValuator);
+ else if (type == DeviceKeyPress) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceKeyRelease) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceButtonPress) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceButtonRelease) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceMotionNotify) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceFocusIn)
+ DO_SWAP(SEventFocus, deviceFocus);
+ else if (type == DeviceFocusOut)
+ DO_SWAP(SEventFocus, deviceFocus);
+ else if (type == ProximityIn) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == ProximityOut) {
+ SKeyButtonPtrEvent(from, to);
+ to->u.keyButtonPointer.pad1 = from->u.keyButtonPointer.pad1;
+ } else if (type == DeviceStateNotify)
+ DO_SWAP(SDeviceStateNotifyEvent, deviceStateNotify);
+ else if (type == DeviceKeyStateNotify)
+ DO_SWAP(SDeviceKeyStateNotifyEvent, deviceKeyStateNotify);
+ else if (type == DeviceButtonStateNotify)
+ DO_SWAP(SDeviceButtonStateNotifyEvent, deviceButtonStateNotify);
+ else if (type == DeviceMappingNotify)
+ DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
+ else if (type == ChangeDeviceNotify)
+ DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
+ else {
+ FatalError("XInputExtension: Impossible event!\n");
}
- lastExtEventMask <<= 1;
-
- for (i = 0; i < MAX_DEVICES; i++)
- ExtValidMasks[i] |= mask;
- return mask;
}
-/**************************************************************************
- *
- * Assign the specified mask to the specified event.
+/**********************************************************************
*
- */
-
-void
-SetMaskForExtEvent(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);
-}
-
-/**************************************************************************
+ * IExtensionInit - initialize the input extension.
*
- * Record an event mask where there is no unique corresponding event type.
- * We can't call SetMaskForEvent, since that would clobber the existing
- * mask for that event. MotionHint and ButtonMotion are examples.
+ * Called from InitExtensions in main() or from QueryExtension() if the
+ * extension is dynamically loaded.
*
- * Since extension event types will never be less than 64, we can use
- * 0-63 in the EventInfo array as the "type" to be used to look up this
- * mask. This means that the corresponding macros such as
- * DevicePointerMotionHint must have access to the same constants.
+ * This extension has several events and errors.
*
*/
void
-SetEventInfo(Mask mask, int constant)
+XInputExtensionInit(void)
{
- EventInfo[ExtEventIndex].mask = mask;
- EventInfo[ExtEventIndex++].type = constant;
+ ExtensionEntry *extEntry;
+
+ extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
+ SProcIDispatch, IResetProc, StandardMinorOpcode);
+ if (extEntry) {
+ IReqCode = extEntry->base;
+ 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;
+ EventSwapVector[DeviceButtonPress] = SEventIDispatch;
+ EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
+ EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
+ EventSwapVector[DeviceFocusIn] = SEventIDispatch;
+ EventSwapVector[DeviceFocusOut] = SEventIDispatch;
+ EventSwapVector[ProximityIn] = SEventIDispatch;
+ EventSwapVector[ProximityOut] = SEventIDispatch;
+ EventSwapVector[DeviceStateNotify] = SEventIDispatch;
+ EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
+ EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
+ EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
+ EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
+ } else {
+ FatalError("IExtensionInit: AddExtensions failed\n");
+ }
}
diff --git a/Xi/getdctl.c b/Xi/getdctl.c
index d738ef8..c264d4f 100644
--- a/Xi/getdctl.c
+++ b/Xi/getdctl.c
@@ -88,112 +88,11 @@ SProcXGetDeviceControl(register ClientPt
/***********************************************************************
*
- * Get the state of the specified device control.
- *
- */
-
-int
-ProcXGetDeviceControl(ClientPtr client)
-{
- int total_length = 0;
- char *buf, *savbuf;
- register DeviceIntPtr dev;
- xGetDeviceControlReply rep;
-
- REQUEST(xGetDeviceControlReq);
- REQUEST_SIZE_MATCH(xGetDeviceControlReq);
-
- dev = LookupDeviceIntRec(stuff->deviceid);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadDevice);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceControl;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- switch (stuff->control) {
- case DEVICE_RESOLUTION:
- if (!dev->valuator) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
- BadMatch);
- return Success;
- }
- total_length = sizeof(xDeviceResolutionState) +
- (3 * sizeof(int) * dev->valuator->numAxes);
- break;
- case DEVICE_ABS_CALIB:
- if (!dev->absolute) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
- BadMatch);
- return Success;
- }
-
- total_length = sizeof(xDeviceAbsCalibCtl);
- break;
- case DEVICE_ABS_AREA:
- if (!dev->absolute) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
- BadMatch);
- return Success;
- }
-
- total_length = sizeof(xDeviceAbsAreaCtl);
- break;
- case DEVICE_CORE:
- total_length = sizeof(xDeviceCoreCtl);
- break;
- case DEVICE_ENABLE:
- total_length = sizeof(xDeviceEnableCtl);
- break;
- default:
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadValue);
- return Success;
- }
-
- buf = (char *)xalloc(total_length);
- if (!buf) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadAlloc);
- return Success;
- }
- savbuf = buf;
-
- switch (stuff->control) {
- case DEVICE_RESOLUTION:
- CopySwapDeviceResolution(client, dev->valuator, buf, total_length);
- break;
- case DEVICE_ABS_CALIB:
- CopySwapDeviceAbsCalib(client, dev->absolute, buf);
- break;
- case DEVICE_ABS_AREA:
- CopySwapDeviceAbsArea(client, dev->absolute, buf);
- break;
- case DEVICE_CORE:
- CopySwapDeviceCore(client, dev, buf);
- break;
- case DEVICE_ENABLE:
- CopySwapDeviceEnable(client, dev, buf);
- break;
- default:
- break;
- }
-
- rep.length = (total_length + 3) >> 2;
- WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
- WriteToClient(client, total_length, savbuf);
- xfree(savbuf);
- return Success;
-}
-
-/***********************************************************************
- *
* This procedure copies DeviceResolution data, swapping if necessary.
*
*/
-void
+static void
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
int length)
{
@@ -225,7 +124,7 @@ CopySwapDeviceResolution(ClientPtr clien
}
}
-void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
+static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
register char n;
@@ -256,7 +155,7 @@ void CopySwapDeviceAbsCalib (ClientPtr c
}
}
-void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
+static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts,
char *buf)
{
register char n;
@@ -283,7 +182,7 @@ void CopySwapDeviceAbsArea (ClientPtr cl
}
}
-void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
+static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
{
register char n;
xDeviceCoreState *c = (xDeviceCoreState *) buf;
@@ -300,7 +199,7 @@ void CopySwapDeviceCore (ClientPtr clien
}
}
-void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
+static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
{
register char n;
xDeviceEnableState *e = (xDeviceEnableState *) buf;
@@ -316,7 +215,6 @@ void CopySwapDeviceEnable (ClientPtr cli
}
}
-
/***********************************************************************
*
* This procedure writes the reply for the xGetDeviceControl function,
@@ -333,3 +231,104 @@ SRepXGetDeviceControl(ClientPtr client,
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep);
}
+
+/***********************************************************************
+ *
+ * Get the state of the specified device control.
+ *
+ */
+
+int
+ProcXGetDeviceControl(ClientPtr client)
+{
+ int total_length = 0;
+ char *buf, *savbuf;
+ register DeviceIntPtr dev;
+ xGetDeviceControlReply rep;
+
+ REQUEST(xGetDeviceControlReq);
+ REQUEST_SIZE_MATCH(xGetDeviceControlReq);
+
+ dev = LookupDeviceIntRec(stuff->deviceid);
+ if (dev == NULL) {
+ SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadDevice);
+ return Success;
+ }
+
+ rep.repType = X_Reply;
+ rep.RepType = X_GetDeviceControl;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ switch (stuff->control) {
+ case DEVICE_RESOLUTION:
+ if (!dev->valuator) {
+ SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
+ BadMatch);
+ return Success;
+ }
+ total_length = sizeof(xDeviceResolutionState) +
+ (3 * sizeof(int) * dev->valuator->numAxes);
+ break;
+ case DEVICE_ABS_CALIB:
+ if (!dev->absolute) {
+ SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
+ BadMatch);
+ return Success;
+ }
+
+ total_length = sizeof(xDeviceAbsCalibCtl);
+ break;
+ case DEVICE_ABS_AREA:
+ if (!dev->absolute) {
+ SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
+ BadMatch);
+ return Success;
+ }
+
+ total_length = sizeof(xDeviceAbsAreaCtl);
+ break;
+ case DEVICE_CORE:
+ total_length = sizeof(xDeviceCoreCtl);
+ break;
+ case DEVICE_ENABLE:
+ total_length = sizeof(xDeviceEnableCtl);
+ break;
+ default:
+ SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadValue);
+ return Success;
+ }
+
+ buf = (char *)xalloc(total_length);
+ if (!buf) {
+ SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadAlloc);
+ return Success;
+ }
+ savbuf = buf;
+
+ switch (stuff->control) {
+ case DEVICE_RESOLUTION:
+ CopySwapDeviceResolution(client, dev->valuator, buf, total_length);
+ break;
+ case DEVICE_ABS_CALIB:
+ CopySwapDeviceAbsCalib(client, dev->absolute, buf);
+ break;
+ case DEVICE_ABS_AREA:
+ CopySwapDeviceAbsArea(client, dev->absolute, buf);
+ break;
+ case DEVICE_CORE:
+ CopySwapDeviceCore(client, dev, buf);
+ break;
+ case DEVICE_ENABLE:
+ CopySwapDeviceEnable(client, dev, buf);
+ break;
+ default:
+ break;
+ }
+
+ rep.length = (total_length + 3) >> 2;
+ WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
+ WriteToClient(client, total_length, savbuf);
+ xfree(savbuf);
+ return Success;
+}
diff --git a/Xi/getdctl.h b/Xi/getdctl.h
index 36868d8..19c189f 100644
--- a/Xi/getdctl.h
+++ b/Xi/getdctl.h
@@ -36,30 +36,6 @@ int SProcXGetDeviceControl(ClientPtr /*
int ProcXGetDeviceControl(ClientPtr /* client */
);
-void CopySwapDeviceResolution(ClientPtr /* client */ ,
- ValuatorClassPtr /* v */ ,
- char * /* buf */ ,
- int /* length */
- );
-
-void CopySwapDeviceAbsCalib (ClientPtr client,
- AbsoluteClassPtr dts,
- char *buf);
-
-void CopySwapDeviceAbsArea (ClientPtr client,
- AbsoluteClassPtr dts,
- char *buf);
-
-void CopySwapDeviceCore(ClientPtr /* client */ ,
- DeviceIntPtr /* dev */ ,
- char * /* buf */
- );
-
-void CopySwapDeviceEnable(ClientPtr /* client */ ,
- DeviceIntPtr /* dev */ ,
- char * /* buf */
- );
-
void SRepXGetDeviceControl(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceControlReply * /* rep */
diff --git a/Xi/getfctl.c b/Xi/getfctl.c
index 870348f..28360ee 100644
--- a/Xi/getfctl.c
+++ b/Xi/getfctl.c
@@ -86,104 +86,11 @@ SProcXGetFeedbackControl(register Client
/***********************************************************************
*
- * Get the feedback control state.
- *
- */
-
-int
-ProcXGetFeedbackControl(ClientPtr client)
-{
- int total_length = 0;
- char *buf, *savbuf;
- register DeviceIntPtr dev;
- KbdFeedbackPtr k;
- PtrFeedbackPtr p;
- IntegerFeedbackPtr i;
- StringFeedbackPtr s;
- BellFeedbackPtr b;
- LedFeedbackPtr l;
- xGetFeedbackControlReply rep;
-
- REQUEST(xGetFeedbackControlReq);
- REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
-
- dev = LookupDeviceIntRec(stuff->deviceid);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadDevice);
- return Success;
- }
-
- rep.repType = X_Reply;
- rep.RepType = X_GetFeedbackControl;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.num_feedbacks = 0;
-
- for (k = dev->kbdfeed; k; k = k->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xKbdFeedbackState);
- }
- for (p = dev->ptrfeed; p; p = p->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xPtrFeedbackState);
- }
- for (s = dev->stringfeed; s; s = s->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xStringFeedbackState) +
- (s->ctrl.num_symbols_supported * sizeof(KeySym));
- }
- for (i = dev->intfeed; i; i = i->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xIntegerFeedbackState);
- }
- for (l = dev->leds; l; l = l->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xLedFeedbackState);
- }
- for (b = dev->bell; b; b = b->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xBellFeedbackState);
- }
-
- if (total_length == 0) {
- SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadMatch);
- return Success;
- }
-
- buf = (char *)xalloc(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;
- WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
- WriteToClient(client, total_length, savbuf);
- xfree(savbuf);
- return Success;
-}
-
-/***********************************************************************
- *
* This procedure copies KbdFeedbackClass data, swapping if necessary.
*
*/
-void
+static void
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
{
int i;
@@ -218,7 +125,7 @@ CopySwapKbdFeedback(ClientPtr client, Kb
*
*/
-void
+static void
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
{
register char n;
@@ -246,7 +153,7 @@ CopySwapPtrFeedback(ClientPtr client, Pt
*
*/
-void
+static void
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
{
register char n;
@@ -274,7 +181,7 @@ CopySwapIntegerFeedback(ClientPtr client
*
*/
-void
+static void
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
{
int i;
@@ -311,7 +218,7 @@ CopySwapStringFeedback(ClientPtr client,
*
*/
-void
+static void
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
{
register char n;
@@ -337,7 +244,7 @@ CopySwapLedFeedback(ClientPtr client, Le
*
*/
-void
+static void
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
{
register char n;
@@ -376,3 +283,96 @@ SRepXGetFeedbackControl(ClientPtr client
swaps(&rep->num_feedbacks, n);
WriteToClient(client, size, (char *)rep);
}
+
+/***********************************************************************
+ *
+ * Get the feedback control state.
+ *
+ */
+
+int
+ProcXGetFeedbackControl(ClientPtr client)
+{
+ int total_length = 0;
+ char *buf, *savbuf;
+ register DeviceIntPtr dev;
+ KbdFeedbackPtr k;
+ PtrFeedbackPtr p;
+ IntegerFeedbackPtr i;
+ StringFeedbackPtr s;
+ BellFeedbackPtr b;
+ LedFeedbackPtr l;
+ xGetFeedbackControlReply rep;
+
+ REQUEST(xGetFeedbackControlReq);
+ REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
+
+ dev = LookupDeviceIntRec(stuff->deviceid);
+ if (dev == NULL) {
+ SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadDevice);
+ return Success;
+ }
+
+ rep.repType = X_Reply;
+ rep.RepType = X_GetFeedbackControl;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.num_feedbacks = 0;
+
+ for (k = dev->kbdfeed; k; k = k->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xKbdFeedbackState);
+ }
+ for (p = dev->ptrfeed; p; p = p->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xPtrFeedbackState);
+ }
+ for (s = dev->stringfeed; s; s = s->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xStringFeedbackState) +
+ (s->ctrl.num_symbols_supported * sizeof(KeySym));
+ }
+ for (i = dev->intfeed; i; i = i->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xIntegerFeedbackState);
+ }
+ for (l = dev->leds; l; l = l->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xLedFeedbackState);
+ }
+ for (b = dev->bell; b; b = b->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xBellFeedbackState);
+ }
+
+ if (total_length == 0) {
+ SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadMatch);
+ return Success;
+ }
+
+ buf = (char *)xalloc(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;
+ WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
+ WriteToClient(client, total_length, savbuf);
+ xfree(savbuf);
+ return Success;
+}
diff --git a/Xi/getfctl.h b/Xi/getfctl.h
index 7d2d17a..0ad58aa 100644
--- a/Xi/getfctl.h
+++ b/Xi/getfctl.h
@@ -36,36 +36,6 @@ int SProcXGetFeedbackControl(ClientPtr /
int ProcXGetFeedbackControl(ClientPtr /* client */
);
-void CopySwapKbdFeedback(ClientPtr /* client */ ,
- KbdFeedbackPtr /* k */ ,
- char ** /* buf */
- );
-
-void CopySwapPtrFeedback(ClientPtr /* client */ ,
- PtrFeedbackPtr /* p */ ,
- char ** /* buf */
- );
-
-void CopySwapIntegerFeedback(ClientPtr /* client */ ,
- IntegerFeedbackPtr /* i */ ,
- char ** /* buf */
- );
-
-void CopySwapStringFeedback(ClientPtr /* client */ ,
- StringFeedbackPtr /* s */ ,
- char ** /* buf */
- );
-
-void CopySwapLedFeedback(ClientPtr /* client */ ,
- LedFeedbackPtr /* l */ ,
- char ** /* buf */
- );
-
-void CopySwapBellFeedback(ClientPtr /* client */ ,
- BellFeedbackPtr /* b */ ,
- char ** /* buf */
- );
-
void SRepXGetFeedbackControl(ClientPtr /* client */ ,
int /* size */ ,
xGetFeedbackControlReply * /* rep */
diff --git a/Xi/listdev.c b/Xi/listdev.c
index 02d55ad..257ee59 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -88,71 +88,12 @@ SProcXListInputDevices(register ClientPt
/***********************************************************************
*
- * This procedure lists the input devices available to the server.
- *
- */
-
-int
-ProcXListInputDevices(register ClientPtr client)
-{
- xListInputDevicesReply rep;
- int numdevs = 0;
- int namesize = 1; /* need 1 extra byte for strcpy */
- int size = 0;
- int total_length;
- char *devbuf;
- char *classbuf;
- char *namebuf;
- char *savbuf;
- xDeviceInfo *dev;
- DeviceIntPtr d;
-
- REQUEST_SIZE_MATCH(xListInputDevicesReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_ListInputDevices;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- AddOtherInputDevices();
-
- for (d = inputInfo.devices; d; d = d->next) {
- SizeDeviceInfo(d, &namesize, &size);
- numdevs++;
- }
- for (d = inputInfo.off_devices; d; d = d->next) {
- SizeDeviceInfo(d, &namesize, &size);
- numdevs++;
- }
-
- total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
- devbuf = (char *)xalloc(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);
-
- rep.ndevices = numdevs;
- rep.length = (total_length + 3) >> 2;
- WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep);
- WriteToClient(client, total_length, savbuf);
- xfree(savbuf);
- return Success;
-}
-
-/***********************************************************************
- *
* This procedure calculates the size of the information to be returned
* for an input device.
*
*/
-void
+static void
SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
{
int chunks;
@@ -173,32 +114,6 @@ SizeDeviceInfo(DeviceIntPtr d, int *name
/***********************************************************************
*
- * This procedure lists information to be returned for an input device.
- *
- */
-
-void
-ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
- char **devbuf, char **classbuf, char **namebuf)
-{
- CopyDeviceName(namebuf, d->name);
- CopySwapDevice(client, d, 0, devbuf);
- if (d->key != NULL) {
- CopySwapKeyClass(client, d->key, classbuf);
- dev->num_classes++;
- }
- if (d->button != NULL) {
- CopySwapButtonClass(client, d->button, classbuf);
- dev->num_classes++;
- }
- if (d->valuator != NULL) {
- dev->num_classes +=
- CopySwapValuatorClass(client, d->valuator, classbuf);
- }
-}
-
-/***********************************************************************
- *
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
*
* We need the extra byte in the allocated buffer, because the trailing null
@@ -207,7 +122,7 @@ ListDeviceInfo(ClientPtr client, DeviceI
*
*/
-void
+static void
CopyDeviceName(char **namebuf, char *name)
{
char *nameptr = (char *)*namebuf;
@@ -224,11 +139,33 @@ CopyDeviceName(char **namebuf, char *nam
/***********************************************************************
*
+ * This procedure copies ButtonClass information, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapButtonClass(register ClientPtr client, ButtonClassPtr b, char **buf)
+{
+ register char n;
+ xButtonInfoPtr b2;
+
+ b2 = (xButtonInfoPtr) * buf;
+ b2->class = ButtonClass;
+ b2->length = sizeof(xButtonInfo);
+ b2->num_buttons = b->numButtons;
+ if (client->swapped) {
+ swaps(&b2->num_buttons, n); /* macro - braces are required */
+ }
+ *buf += sizeof(xButtonInfo);
+}
+
+/***********************************************************************
+ *
* This procedure copies data to the DeviceInfo struct, swapping if necessary.
*
*/
-void
+static void
CopySwapDevice(register ClientPtr client, DeviceIntPtr d, int num_classes,
char **buf)
{
@@ -262,7 +199,7 @@ CopySwapDevice(register ClientPtr client
*
*/
-void
+static void
CopySwapKeyClass(register ClientPtr client, KeyClassPtr k, char **buf)
{
register char n;
@@ -282,28 +219,6 @@ CopySwapKeyClass(register ClientPtr clie
/***********************************************************************
*
- * This procedure copies ButtonClass information, swapping if necessary.
- *
- */
-
-void
-CopySwapButtonClass(register ClientPtr client, ButtonClassPtr b, char **buf)
-{
- register char n;
- xButtonInfoPtr b2;
-
- b2 = (xButtonInfoPtr) * buf;
- b2->class = ButtonClass;
- b2->length = sizeof(xButtonInfo);
- b2->num_buttons = b->numButtons;
- if (client->swapped) {
- swaps(&b2->num_buttons, n); /* macro - braces are required */
- }
- *buf += sizeof(xButtonInfo);
-}
-
-/***********************************************************************
- *
* This procedure copies ValuatorClass information, swapping if necessary.
*
* Devices may have up to 255 valuators. The length of a ValuatorClass is
@@ -314,7 +229,7 @@ CopySwapButtonClass(register ClientPtr c
*
*/
-int
+static int
CopySwapValuatorClass(register ClientPtr client, ValuatorClassPtr v, char **buf)
{
int i, j, axes, t_axes;
@@ -359,6 +274,91 @@ CopySwapValuatorClass(register ClientPtr
/***********************************************************************
*
+ * This procedure lists information to be returned for an input device.
+ *
+ */
+
+static void
+ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
+ char **devbuf, char **classbuf, char **namebuf)
+{
+ CopyDeviceName(namebuf, d->name);
+ CopySwapDevice(client, d, 0, devbuf);
+ if (d->key != NULL) {
+ CopySwapKeyClass(client, d->key, classbuf);
+ dev->num_classes++;
+ }
+ if (d->button != NULL) {
+ CopySwapButtonClass(client, d->button, classbuf);
+ dev->num_classes++;
+ }
+ if (d->valuator != NULL) {
+ dev->num_classes +=
+ CopySwapValuatorClass(client, d->valuator, classbuf);
+ }
+}
+
+/***********************************************************************
+ *
+ * This procedure lists the input devices available to the server.
+ *
+ */
+
+int
+ProcXListInputDevices(register ClientPtr client)
+{
+ xListInputDevicesReply rep;
+ int numdevs = 0;
+ int namesize = 1; /* need 1 extra byte for strcpy */
+ int size = 0;
+ int total_length;
+ char *devbuf;
+ char *classbuf;
+ char *namebuf;
+ char *savbuf;
+ xDeviceInfo *dev;
+ DeviceIntPtr d;
+
+ REQUEST_SIZE_MATCH(xListInputDevicesReq);
+
+ rep.repType = X_Reply;
+ rep.RepType = X_ListInputDevices;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ AddOtherInputDevices();
+
+ for (d = inputInfo.devices; d; d = d->next) {
+ SizeDeviceInfo(d, &namesize, &size);
+ numdevs++;
+ }
+ for (d = inputInfo.off_devices; d; d = d->next) {
+ SizeDeviceInfo(d, &namesize, &size);
+ numdevs++;
+ }
+
+ total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
+ devbuf = (char *)xalloc(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);
+
+ rep.ndevices = numdevs;
+ rep.length = (total_length + 3) >> 2;
+ WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep);
+ WriteToClient(client, total_length, savbuf);
+ xfree(savbuf);
+ return Success;
+}
+
+/***********************************************************************
+ *
* This procedure writes the reply for the XListInputDevices function,
* if the client and server have a different byte ordering.
*
diff --git a/Xi/listdev.h b/Xi/listdev.h
index bdd67ce..db376de 100644
--- a/Xi/listdev.h
+++ b/Xi/listdev.h
@@ -36,44 +36,6 @@ int SProcXListInputDevices(ClientPtr /*
int ProcXListInputDevices(ClientPtr /* client */
);
-void SizeDeviceInfo(DeviceIntPtr /* d */ ,
- int * /* namesize */ ,
- int * /* size */
- );
-
-void ListDeviceInfo(ClientPtr /* client */ ,
- DeviceIntPtr /* d */ ,
- xDeviceInfoPtr /* dev */ ,
- char ** /* devbuf */ ,
- char ** /* classbuf */ ,
- char ** /* namebuf */
- );
-
-void CopyDeviceName(char ** /* namebuf */ ,
- char * /* name */
- );
-
-void CopySwapDevice(ClientPtr /* client */ ,
- DeviceIntPtr /* d */ ,
- int /* num_classes */ ,
- char ** /* buf */
- );
-
-void CopySwapKeyClass(ClientPtr /* client */ ,
- KeyClassPtr /* k */ ,
- char ** /* buf */
- );
-
-void CopySwapButtonClass(ClientPtr /* client */ ,
- ButtonClassPtr /* b */ ,
- char ** /* buf */
- );
-
-int CopySwapValuatorClass(ClientPtr /* client */ ,
- ValuatorClassPtr /* v */ ,
- char ** /* buf */
- );
-
void SRepXListInputDevices(ClientPtr /* client */ ,
int /* size */ ,
xListInputDevicesReply * /* rep */
diff --git a/include/exevents.h b/include/exevents.h
index 7fbaddb..69d4abc 100644
--- a/include/exevents.h
+++ b/include/exevents.h
@@ -148,10 +148,6 @@ extern void DeleteWindowFromAnyExtEvents
WindowPtr /* pWin */,
Bool /* freeResources */);
-extern void DeleteDeviceFromAnyExtEvents(
- WindowPtr /* pWin */,
- DeviceIntPtr /* dev */);
-
extern int MaybeSendDeviceMotionNotifyHint (
deviceKeyButtonPointer * /* pEvents */,
Mask /* mask */);
@@ -164,11 +160,6 @@ extern void CheckDeviceGrabAndHintWindow
ClientPtr /* client */,
Mask /* deliveryMask */);
-extern Mask DeviceEventMaskForClient(
- DeviceIntPtr /* dev */,
- WindowPtr /* pWin */,
- ClientPtr /* client */);
-
extern void MaybeStopDeviceHint(
DeviceIntPtr /* dev */,
ClientPtr /* client */);
@@ -179,13 +170,6 @@ extern int DeviceEventSuppressForWindow(
Mask /* mask */,
int /* maskndx */);
-void FindInterestedChildren(
- DeviceIntPtr /* dev */,
- WindowPtr /* p1 */,
- Mask /* mask */,
- xEvent * /* ev */,
- int /* count */);
-
void SendEventToAllWindows(
DeviceIntPtr /* dev */,
Mask /* mask */,
diff --git a/include/extinit.h b/include/extinit.h
index 2087d74..e616b6d 100644
--- a/include/extinit.h
+++ b/include/extinit.h
@@ -37,93 +37,6 @@ XInputExtensionInit(
void
);
-
-int
-ProcIDispatch (
- ClientPtr /* client */
- );
-
-int
-SProcIDispatch(
- ClientPtr /* client */
- );
-
-void
-SReplyIDispatch (
- ClientPtr /* client */,
- int /* len */,
- xGrabDeviceReply * /* rep */
- );
-
-void
-SEventIDispatch (
- xEvent * /* from */,
- xEvent * /* to */
- );
-
-void
-SEventDeviceValuator (
- deviceValuator * /* from */,
- deviceValuator * /* to */
- );
-
-void
-SEventFocus (
- deviceFocus * /* from */,
- deviceFocus * /* to */
- );
-
-void
-SDeviceStateNotifyEvent (
- deviceStateNotify * /* from */,
- deviceStateNotify * /* to */
- );
-
-void
-SDeviceKeyStateNotifyEvent (
- deviceKeyStateNotify * /* from */,
- deviceKeyStateNotify * /* to */
- );
-
-void
-SDeviceButtonStateNotifyEvent (
- deviceButtonStateNotify * /* from */,
- deviceButtonStateNotify * /* to */
- );
-
-void
-SChangeDeviceNotifyEvent (
- changeDeviceNotify * /* from */,
- changeDeviceNotify * /* to */
- );
-
-void
-SDeviceMappingNotifyEvent (
- deviceMappingNotify * /* from */,
- deviceMappingNotify * /* to */
- );
-
-void
-SDevicePresenceNotifyEvent (
- devicePresenceNotify * /* from */,
- devicePresenceNotify * /* to */
- );
-
-void
-FixExtensionEvents (
- ExtensionEntry * /* extEntry */
- );
-
-void
-RestoreExtensionEvents (
- void
- );
-
-void
-IResetProc(
- ExtensionEntry * /* unused */
- );
-
void
AssignTypeAndName (
DeviceIntPtr /* dev */,
@@ -131,41 +44,9 @@ AssignTypeAndName (
char * /* name */
);
-void
-MakeDeviceTypeAtoms (
- void
-);
-
DeviceIntPtr
LookupDeviceIntRec (
CARD8 /* id */
);
-void
-SetExclusiveAccess (
- Mask /* mask */
- );
-
-void
-AllowPropagateSuppress (
- Mask /* mask */
- );
-
-Mask
-GetNextExtEventMask (
- void
-);
-
-void
-SetMaskForExtEvent(
- Mask /* mask */,
- int /* event */
- );
-
-void
-SetEventInfo(
- Mask /* mask */,
- int /* constant */
- );
-
#endif /* EXTINIT_H */
diff-tree 4b5802ddbd45271be3cadeae0a83a6742df2515b (from 04b87d6dfae02e4ecdb5216d12c6cdafd1e8c2b4)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 17:57:54 2007 -0400
General DIX static and dead code cleanup.
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 02665ed..3d8e71f 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -299,7 +299,6 @@ long SmartScheduleMaxSlice = SMART_S
long SmartScheduleTime;
static ClientPtr SmartLastClient;
static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
-int SmartScheduleClient(int *clientReady, int nready);
#ifdef SMART_DEBUG
long SmartLastPrint;
@@ -308,7 +307,7 @@ long SmartLastPrint;
void Dispatch(void);
void InitProcVectors(void);
-int
+static int
SmartScheduleClient (int *clientReady, int nready)
{
ClientPtr pClient;
@@ -834,7 +833,7 @@ ProcCirculateWindow(ClientPtr client)
return(client->noClientException);
}
-int
+static int
GetGeometry(ClientPtr client, xGetGeometryReply *rep)
{
DrawablePtr pDraw;
@@ -2157,8 +2156,7 @@ ProcPutImage(ClientPtr client)
return (client->noClientException);
}
-
-int
+static int
DoGetImage(ClientPtr client, int format, Drawable drawable,
int x, int y, int width, int height,
Mask planemask, xGetImageReply **im_return)
@@ -3383,6 +3381,28 @@ ProcChangeAccessControl(ClientPtr client
return (result);
}
+/*********************
+ * CloseDownRetainedResources
+ *
+ * Find all clients that are gone and have terminated in RetainTemporary
+ * and destroy their resources.
+ *********************/
+
+static void
+CloseDownRetainedResources(void)
+{
+ int i;
+ ClientPtr client;
+
+ for (i=1; i<currentMaxClients; i++)
+ {
+ client = clients[i];
+ if (client && (client->closeDownMode == RetainTemporary)
+ && (client->clientGone))
+ CloseDownClient(client);
+ }
+}
+
int
ProcKillClient(ClientPtr client)
{
@@ -3651,28 +3671,6 @@ KillAllClients()
}
}
-/*********************
- * CloseDownRetainedResources
- *
- * Find all clients that are gone and have terminated in RetainTemporary
- * and destroy their resources.
- *********************/
-
-void
-CloseDownRetainedResources()
-{
- int i;
- ClientPtr client;
-
- for (i=1; i<currentMaxClients; i++)
- {
- client = clients[i];
- if (client && (client->closeDownMode == RetainTemporary)
- && (client->clientGone))
- CloseDownClient(client);
- }
-}
-
extern int clientPrivateLen;
extern unsigned *clientPrivateSizes;
extern unsigned totalClientSize;
diff --git a/dix/dixutils.c b/dix/dixutils.c
index c0728da..44d82c9 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -882,9 +882,7 @@ static CallbackFuncsRec default_cbfuncs
_DeleteCallbackList
};
-/* ===== Public Procedures ===== */
-
-Bool
+static Bool
CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs)
{
CallbackListPtr cbl;
@@ -916,6 +914,8 @@ CreateCallbackList(CallbackListPtr *pcbl
return TRUE;
}
+/* ===== Public Procedures ===== */
+
_X_EXPORT Bool
AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data)
{
diff --git a/dix/extension.c b/dix/extension.c
index fb4ee6b..88dff15 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -66,8 +66,6 @@ SOFTWARE.
#define LAST_EVENT 128
#define LAST_ERROR 255
-static ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS];
-
static ExtensionEntry **extensions = (ExtensionEntry **)NULL;
int lastEvent = EXTENSION_EVENT_BASE;
@@ -298,21 +296,8 @@ CloseDownExtensions()
extensions = (ExtensionEntry **)NULL;
lastEvent = EXTENSION_EVENT_BASE;
lastError = FirstExtensionError;
- for (i=0; i<MAXSCREENS; i++)
- {
- ScreenProcEntry *spentry = &AuxillaryScreenProcs[i];
-
- while (spentry->num)
- {
- spentry->num--;
- xfree(spentry->procList[spentry->num].name);
- }
- xfree(spentry->procList);
- spentry->procList = (ProcEntryPtr)NULL;
- }
}
-
int
ProcQueryExtension(ClientPtr client)
{
@@ -406,72 +391,6 @@ ProcListExtensions(ClientPtr client)
return(client->noClientException);
}
-
-ExtensionLookupProc
-LookupProc(char *name, GCPtr pGC)
-{
- int i;
- ScreenProcEntry *spentry;
- spentry = &AuxillaryScreenProcs[pGC->pScreen->myNum];
- if (spentry->num)
- {
- for (i = 0; i < spentry->num; i++)
- if (strcmp(name, spentry->procList[i].name) == 0)
- return(spentry->procList[i].proc);
- }
- return (ExtensionLookupProc)NULL;
-}
-
-Bool
-RegisterProc(char *name, GC *pGC, ExtensionLookupProc proc)
-{
- return RegisterScreenProc(name, pGC->pScreen, proc);
-}
-
-Bool
-RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc)
-{
- ScreenProcEntry *spentry;
- ProcEntryPtr procEntry = (ProcEntryPtr)NULL;
- char *newname;
- int i;
-
- spentry = &AuxillaryScreenProcs[pScreen->myNum];
- /* first replace duplicates */
- if (spentry->num)
- {
- for (i = 0; i < spentry->num; i++)
- if (strcmp(name, spentry->procList[i].name) == 0)
- {
- procEntry = &spentry->procList[i];
- break;
- }
- }
- if (procEntry)
- procEntry->proc = proc;
- else
- {
- newname = (char *)xalloc(strlen(name)+1);
- if (!newname)
- return FALSE;
- procEntry = (ProcEntryPtr)
- xrealloc(spentry->procList,
- sizeof(ProcEntryRec) * (spentry->num+1));
- if (!procEntry)
- {
- xfree(newname);
- return FALSE;
- }
- spentry->procList = procEntry;
- procEntry += spentry->num;
- procEntry->name = newname;
- strcpy(newname, name);
- procEntry->proc = proc;
- spentry->num++;
- }
- return TRUE;
-}
-
#ifdef XSERVER_DTRACE
void LoadExtensionNames(char **RequestNames) {
int i;
diff --git a/dix/gc.c b/dix/gc.c
index 7b7953d..7a76dd9 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -907,17 +907,6 @@ FreeGC(pointer value, XID gid)
return(Success);
}
-void
-SetGCMask(GCPtr pGC, Mask selectMask, Mask newDataMask)
-{
- pGC->stateChanges = (~selectMask & pGC->stateChanges) |
- (selectMask & newDataMask);
- if (selectMask & newDataMask)
- pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
-}
-
-
-
/* CreateScratchGC(pScreen, depth)
like CreateGC, but doesn't do the default tile or stipple,
since we can't create them without already having a GC. any code
diff --git a/dix/swaprep.c b/dix/swaprep.c
index 6f4b277..7d3251a 100644
--- a/dix/swaprep.c
+++ b/dix/swaprep.c
@@ -317,7 +317,7 @@ SQueryPointerReply(ClientPtr pClient, in
(void)WriteToClient(pClient, size, (char *) pRep);
}
-void
+static void
SwapTimecoord(xTimecoord* pCoord)
{
char n;
@@ -584,7 +584,7 @@ SAllocColorPlanesReply(ClientPtr pClient
(void)WriteToClient(pClient, size, (char *) pRep);
}
-void
+static void
SwapRGB(xrgb *prgb)
{
char n;
@@ -1159,6 +1159,58 @@ SKeymapNotifyEvent(xEvent *from, xEvent
*to = *from;
}
+static void
+SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT)
+{
+ cpswapl(pConnSetup->release, pConnSetupT->release);
+ cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
+ cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
+ cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
+ cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
+ cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
+ pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
+ pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
+ pConnSetupT->numRoots = pConnSetup->numRoots;
+ pConnSetupT->numFormats = pConnSetup->numFormats;
+ pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
+ pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
+ pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
+ pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
+}
+
+static void
+SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT)
+{
+ cpswapl(pRoot->windowId, pRootT->windowId);
+ cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
+ cpswapl(pRoot->whitePixel, pRootT->whitePixel);
+ cpswapl(pRoot->blackPixel, pRootT->blackPixel);
+ cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
+ cpswaps(pRoot->pixWidth, pRootT->pixWidth);
+ cpswaps(pRoot->pixHeight, pRootT->pixHeight);
+ cpswaps(pRoot->mmWidth, pRootT->mmWidth);
+ cpswaps(pRoot->mmHeight, pRootT->mmHeight);
+ cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
+ cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
+ cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
+ pRootT->backingStore = pRoot->backingStore;
+ pRootT->saveUnders = pRoot->saveUnders;
+ pRootT->rootDepth = pRoot->rootDepth;
+ pRootT->nDepths = pRoot->nDepths;
+}
+
+static void
+SwapVisual(xVisualType *pVis, xVisualType *pVisT)
+{
+ cpswapl(pVis->visualID, pVisT->visualID);
+ pVisT->class = pVis->class;
+ pVisT->bitsPerRGB = pVis->bitsPerRGB;
+ cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
+ cpswapl(pVis->redMask, pVisT->redMask);
+ cpswapl(pVis->greenMask, pVisT->greenMask);
+ cpswapl(pVis->blueMask, pVisT->blueMask);
+}
+
_X_EXPORT void
SwapConnSetupInfo(
char *pInfo,
@@ -1210,7 +1262,6 @@ SwapConnSetupInfo(
}
}
-
void
WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
{
@@ -1227,58 +1278,6 @@ WriteSConnectionInfo(ClientPtr pClient,
DEALLOCATE_LOCAL(pInfoTBase);
}
-void
-SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT)
-{
- cpswapl(pConnSetup->release, pConnSetupT->release);
- cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
- cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
- cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
- cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
- cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
- pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
- pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
- pConnSetupT->numRoots = pConnSetup->numRoots;
- pConnSetupT->numFormats = pConnSetup->numFormats;
- pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
- pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
- pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
- pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
-}
-
-void
-SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT)
-{
- cpswapl(pRoot->windowId, pRootT->windowId);
- cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
- cpswapl(pRoot->whitePixel, pRootT->whitePixel);
- cpswapl(pRoot->blackPixel, pRootT->blackPixel);
- cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
- cpswaps(pRoot->pixWidth, pRootT->pixWidth);
- cpswaps(pRoot->pixHeight, pRootT->pixHeight);
- cpswaps(pRoot->mmWidth, pRootT->mmWidth);
- cpswaps(pRoot->mmHeight, pRootT->mmHeight);
- cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
- cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
- cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
- pRootT->backingStore = pRoot->backingStore;
- pRootT->saveUnders = pRoot->saveUnders;
- pRootT->rootDepth = pRoot->rootDepth;
- pRootT->nDepths = pRoot->nDepths;
-}
-
-void
-SwapVisual(xVisualType *pVis, xVisualType *pVisT)
-{
- cpswapl(pVis->visualID, pVisT->visualID);
- pVisT->class = pVis->class;
- pVisT->bitsPerRGB = pVis->bitsPerRGB;
- cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
- cpswapl(pVis->redMask, pVisT->redMask);
- cpswapl(pVis->greenMask, pVisT->greenMask);
- cpswapl(pVis->blueMask, pVisT->blueMask);
-}
-
_X_EXPORT void
SwapConnSetupPrefix(xConnSetupPrefix *pcspFrom, xConnSetupPrefix *pcspTo)
{
diff --git a/dix/window.c b/dix/window.c
index 2a82f2e..7d99477 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -539,7 +539,7 @@ InitRootWindow(WindowPtr pWin)
* window from which the region came.
*/
-void
+static void
ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn,
int x, int y,
int w, int h)
@@ -836,6 +836,26 @@ CreateWindow(Window wid, WindowPtr pPare
}
static void
+DisposeWindowOptional (WindowPtr pWin)
+{
+ if (!pWin->optional)
+ return;
+ /*
+ * everything is peachy. Delete the optional record
+ * and clean up
+ */
+ if (pWin->optional->cursor)
+ {
+ FreeCursor (pWin->optional->cursor, (Cursor)0);
+ pWin->cursorIsNone = FALSE;
+ }
+ else
+ pWin->cursorIsNone = TRUE;
+ xfree (pWin->optional);
+ pWin->optional = NULL;
+}
+
+static void
FreeWindowResources(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -2703,6 +2723,30 @@ RealizeTree(WindowPtr pWin)
}
}
+static WindowPtr windowDisableMapUnmapEvents;
+
+void
+DisableMapUnmapEvents(WindowPtr pWin)
+{
+ assert (windowDisableMapUnmapEvents == NULL);
+
+ windowDisableMapUnmapEvents = pWin;
+}
+
+void
+EnableMapUnmapEvents(WindowPtr pWin)
+{
+ assert (windowDisableMapUnmapEvents != NULL);
+
+ windowDisableMapUnmapEvents = NULL;
+}
+
+static Bool
+MapUnmapEventsEnabled(WindowPtr pWin)
+{
+ return pWin != windowDisableMapUnmapEvents;
+}
+
/*****
* MapWindow
* If some other client has selected SubStructureReDirect on the parent
@@ -3203,21 +3247,6 @@ HandleSaveSet(ClientPtr client)
/**
*
- * \param x,y in root
- * \param box "return" value
- */
-Bool
-VisibleBoundingBoxFromPoint(WindowPtr pWin, int x, int y, BoxPtr box)
-{
- if (!pWin->realized)
- return (FALSE);
- if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box))
- return(TRUE);
- return(FALSE);
-}
-
-/**
- *
* \param x,y in root
*/
Bool
@@ -3324,30 +3353,6 @@ SendVisibilityNotify(WindowPtr pWin)
DeliverEvents(pWin, &event, 1, NullWindow);
}
-static WindowPtr windowDisableMapUnmapEvents;
-
-void
-DisableMapUnmapEvents(WindowPtr pWin)
-{
- assert (windowDisableMapUnmapEvents == NULL);
-
- windowDisableMapUnmapEvents = pWin;
-}
-
-void
-EnableMapUnmapEvents(WindowPtr pWin)
-{
- assert (windowDisableMapUnmapEvents != NULL);
-
- windowDisableMapUnmapEvents = NULL;
-}
-
-Bool
-MapUnmapEventsEnabled(WindowPtr pWin)
-{
- return pWin != windowDisableMapUnmapEvents;
-}
-
#define RANDOM_WIDTH 32
#ifndef NOLOGOHACK
@@ -3700,41 +3705,6 @@ MakeWindowOptional (WindowPtr pWin)
return TRUE;
}
-void
-DisposeWindowOptional (WindowPtr pWin)
-{
- if (!pWin->optional)
- return;
- /*
- * everything is peachy. Delete the optional record
- * and clean up
- */
- /*
- * TOG changed this code to:
- *
- * if (pWin->cursorIsNone == FALSE)
- * FreeCursor (pWin->optional->cursor, (Cursor)0);
- * pWin->cursorIsNone = TRUE;
- *
- * This is blatently wrong; windows without optionals can have
- * two different cursor values, either None or sharing their
- * parents cursor. This difference is controlled by the
- * cursorIsNone value; when TRUE, the window has no cursor,
- * when false, it shares its cursor with its parent; TOG
- * made it impossible for a window to have a cursor without
- * an optional record.
- */
- if (pWin->optional->cursor)
- {
- FreeCursor (pWin->optional->cursor, (Cursor)0);
- pWin->cursorIsNone = FALSE;
- }
- else
- pWin->cursorIsNone = TRUE;
- xfree (pWin->optional);
- pWin->optional = NULL;
-}
-
#ifndef NOLOGOHACK
static void
DrawLogo(WindowPtr pWin)
diff --git a/include/dix.h b/include/dix.h
index 5c2c5b8..b412683 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -220,8 +220,6 @@ extern int dixDestroyPixmap(
pointer /*value*/,
XID /*pid*/);
-extern void CloseDownRetainedResources(void);
-
extern void InitClient(
ClientPtr /*client*/,
int /*i*/,
@@ -243,25 +241,10 @@ extern void DeleteWindowFromAnySelection
extern void MarkClientException(
ClientPtr /*client*/);
-extern int GetGeometry(
- ClientPtr /*client*/,
- xGetGeometryReply* /* wa */);
-
extern int SendConnSetup(
ClientPtr /*client*/,
char* /*reason*/);
-extern int DoGetImage(
- ClientPtr /*client*/,
- int /*format*/,
- Drawable /*drawable*/,
- int /*x*/,
- int /*y*/,
- int /*width*/,
- int /*height*/,
- Mask /*planemask*/,
- xGetImageReply ** /*im_return*/);
-
#if defined(DDXBEFORERESET)
extern void ddxBeforeReset (void);
#endif
@@ -632,10 +615,6 @@ typedef struct _CallbackProcs {
DeleteCallbackListProcPtr DeleteCallbackList;
} CallbackFuncsRec, *CallbackFuncsPtr;
-extern Bool CreateCallbackList(
- CallbackListPtr * /*pcbl*/,
- CallbackFuncsPtr /*cbfuncs*/);
-
extern Bool AddCallback(
CallbackListPtr * /*pcbl*/,
CallbackProcPtr /*callback*/,
diff --git a/include/extnsionst.h b/include/extnsionst.h
index 38d4bd7..28ae1d5 100644
--- a/include/extnsionst.h
+++ b/include/extnsionst.h
@@ -85,32 +85,11 @@ extern void NotImplemented ( /* FIXME: t
xEvent *,
xEvent *);
-typedef void (* ExtensionLookupProc)(
-#ifdef EXTENSION_PROC_ARGS
- EXTENSION_PROC_ARGS
-#else
- /* args no longer indeterminate */
- char *name,
- GCPtr pGC
-#endif
-);
-
-typedef struct _ProcEntry {
- char *name;
- ExtensionLookupProc proc;
-} ProcEntryRec, *ProcEntryPtr;
-
-typedef struct _ScreenProcEntry {
- int num;
- ProcEntryPtr procList;
-} ScreenProcEntry;
-
#define SetGCVector(pGC, VectorElement, NewRoutineAddress, Atom) \
pGC->VectorElement = NewRoutineAddress;
#define GetGCValue(pGC, GCElement) (pGC->GCElement)
-
extern ExtensionEntry *AddExtension(
char* /*name*/,
int /*NumEvents*/,
@@ -128,20 +107,6 @@ extern Bool AddExtensionAlias(
extern ExtensionEntry *CheckExtension(const char *extname);
extern ExtensionEntry *GetExtensionEntry(int major);
-extern ExtensionLookupProc LookupProc(
- char* /*name*/,
- GCPtr /*pGC*/);
-
-extern Bool RegisterProc(
- char* /*name*/,
- GCPtr /*pGC*/,
- ExtensionLookupProc /*proc*/);
-
-extern Bool RegisterScreenProc(
- char* /*name*/,
- ScreenPtr /*pScreen*/,
- ExtensionLookupProc /*proc*/);
-
extern void DeclareExtensionSecurity(
char * /*extname*/,
Bool /*secure*/);
diff --git a/include/gc.h b/include/gc.h
index 6c7add6..3b7e38e 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -126,11 +126,6 @@ extern int FreeGC(
pointer /*pGC*/,
XID /*gid*/);
-extern void SetGCMask(
- GCPtr /*pGC*/,
- Mask /*selectMask*/,
- Mask /*newDataMask*/);
-
extern GCPtr CreateScratchGC(
ScreenPtr /*pScreen*/,
unsigned /*depth*/);
diff --git a/include/os.h b/include/os.h
index d4eed22..7399436 100644
--- a/include/os.h
+++ b/include/os.h
@@ -348,12 +348,6 @@ extern void InitAuthorization(char * /*f
extern void RegisterAuthorizations(void);
-extern XID AuthorizationToID (
- unsigned short name_length,
- char *name,
- unsigned short data_length,
- char *data);
-
extern int AuthorizationFromID (
XID id,
unsigned short *name_lenp,
@@ -402,14 +396,6 @@ extern int ddxProcessArgument(int /*argc
extern void ddxUseMsg(void);
-/*
- * idiom processing stuff
- */
-
-extern xReqPtr PeekNextRequest(xReqPtr req, ClientPtr client, Bool readmore);
-
-extern void SkipRequests(xReqPtr req, ClientPtr client, int numskipped);
-
/* int ReqLen(xReq *req, ClientPtr client)
* Given a pointer to a *complete* request, return its length in bytes.
* Note that if the request is a big request (as defined in the Big
diff --git a/include/swaprep.h b/include/swaprep.h
index 8a9dcf0..bebd3a8 100644
--- a/include/swaprep.h
+++ b/include/swaprep.h
@@ -91,9 +91,6 @@ extern void SQueryPointerReply(
int /* size */,
xQueryPointerReply * /* pRep */);
-extern void SwapTimecoord(
- xTimecoord * /* pCoord */);
-
extern void SwapTimeCoordWrite(
ClientPtr /* pClient */,
int /* size */,
@@ -174,9 +171,6 @@ extern void SAllocColorPlanesReply(
int /* size */,
xAllocColorPlanesReply * /* pRep */);
-extern void SwapRGB(
- xrgb * /* prgb */);
-
extern void SQColorsExtend(
ClientPtr /* pClient */,
int /* size */,
@@ -255,18 +249,6 @@ extern void WriteSConnectionInfo(
unsigned long /* size */,
char * /* pInfo */);
-extern void SwapConnSetup(
- xConnSetup * /* pConnSetup */,
- xConnSetup * /* pConnSetupT */);
-
-extern void SwapWinRoot(
- xWindowRoot * /* pRoot */,
- xWindowRoot * /* pRootT */);
-
-extern void SwapVisual(
- xVisualType * /* pVis */,
- xVisualType * /* pVisT */);
-
extern void SwapConnSetupPrefix(
xConnSetupPrefix * /* pcspFrom */,
xConnSetupPrefix * /* pcspTo */);
diff --git a/include/window.h b/include/window.h
index bddeb25..cd8c5b2 100644
--- a/include/window.h
+++ b/include/window.h
@@ -93,14 +93,6 @@ extern Bool CreateRootWindow(
extern void InitRootWindow(
WindowPtr /*pWin*/);
-extern void ClippedRegionFromBox(
- WindowPtr /*pWin*/,
- RegionPtr /*Rgn*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/);
-
typedef WindowPtr (* RealChildHeadProc) (WindowPtr pWin);
void RegisterRealChildHeadProc (RealChildHeadProc proc);
@@ -205,12 +197,6 @@ extern void UnmapSubwindows(
extern void HandleSaveSet(
ClientPtr /*client*/);
-extern Bool VisibleBoundingBoxFromPoint(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- BoxPtr /*box*/);
-
extern Bool PointInWindowIsVisible(
WindowPtr /*pWin*/,
int /*x*/,
@@ -235,9 +221,6 @@ extern void CheckWindowOptionalNeed(
extern Bool MakeWindowOptional(
WindowPtr /*pWin*/);
-extern void DisposeWindowOptional(
- WindowPtr /*pWin*/);
-
extern WindowPtr MoveWindowInStack(
WindowPtr /*pWin*/,
WindowPtr /*pNextSib*/);
@@ -271,7 +254,5 @@ extern void DisableMapUnmapEvents(
WindowPtr /* pWin */ );
extern void EnableMapUnmapEvents(
WindowPtr /* pWin */ );
-extern Bool MapUnmapEventsEnabled(
- WindowPtr /* pWin */ );
#endif /* WINDOW_H */
diff --git a/os/access.c b/os/access.c
index db5ca31..221b8cb 100644
--- a/os/access.c
+++ b/os/access.c
@@ -234,8 +234,8 @@ static Bool NewHost(int /*family*/,
int /*len*/,
int /* addingLocalHosts */);
-int LocalClientCredAndGroups(ClientPtr client, int *pUid, int *pGid,
- int **pSuppGids, int *nSuppGids);
+static int LocalClientCredAndGroups(ClientPtr client, int *pUid, int *pGid,
+ int **pSuppGids, int *nSuppGids);
/* XFree86 bug #156: To keep track of which hosts were explicitly requested in
@@ -1431,7 +1431,7 @@ LocalClientCred(ClientPtr client, int *p
*
* Used by localuser & localgroup ServerInterpreted access control forms below
*/
-int
+static int
LocalClientCredAndGroups(ClientPtr client, int *pUid, int *pGid,
int **pSuppGids, int *nSuppGids)
{
diff --git a/os/auth.c b/os/auth.c
index bf33b7e..b06333e 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -255,26 +255,6 @@ ResetAuthorization (void)
ShouldLoadAuth = TRUE;
}
-XID
-AuthorizationToID (
- unsigned short name_length,
- char *name,
- unsigned short data_length,
- char *data)
-{
- int i;
-
- for (i = 0; i < NUM_AUTHORIZATION; i++) {
- if (protocols[i].name_length == name_length &&
- memcmp (protocols[i].name, name, (int) name_length) == 0 &&
- protocols[i].ToID)
- {
- return (*protocols[i].ToID) (data_length, data);
- }
- }
- return (XID) ~0L;
-}
-
int
AuthorizationFromID (
XID id,
diff --git a/os/io.c b/os/io.c
index 80a151f..4e83e68 100644
--- a/os/io.c
+++ b/os/io.c
@@ -90,6 +90,11 @@ SOFTWARE.
_X_EXPORT CallbackListPtr ReplyCallback;
_X_EXPORT CallbackListPtr FlushCallback;
+static ConnectionInputPtr AllocateInputBuffer(void);
+static ConnectionOutputPtr AllocateOutputBuffer(void);
+static xReqPtr PeekNextRequest(xReqPtr req, ClientPtr client, Bool readmore);
+static void SkipRequests(xReqPtr req, ClientPtr client, int numskipped);
+
/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
* systems are broken and return EWOULDBLOCK when they should return EAGAIN
*/
@@ -635,7 +640,7 @@ ResetCurrentRequest(ClientPtr client)
*
**********************/
-xReqPtr
+static xReqPtr
PeekNextRequest(
xReqPtr req, /* request we're starting from */
ClientPtr client, /* client whose requests we're skipping */
@@ -697,7 +702,7 @@ PeekNextRequest(
_X_EXPORT CallbackListPtr SkippedRequestsCallback = NULL;
-void
+static void
SkipRequests(
xReqPtr req, /* last request being skipped */
ClientPtr client, /* client whose requests we're skipping */
@@ -1165,7 +1170,7 @@ FlushClient(ClientPtr who, OsCommPtr oc,
return extraCount; /* return only the amount explicitly requested */
}
-ConnectionInputPtr
+static ConnectionInputPtr
AllocateInputBuffer(void)
{
ConnectionInputPtr oci;
@@ -1186,7 +1191,7 @@ AllocateInputBuffer(void)
return oci;
}
-ConnectionOutputPtr
+static ConnectionOutputPtr
AllocateOutputBuffer(void)
{
ConnectionOutputPtr oco;
diff --git a/os/osdep.h b/os/osdep.h
index 3d303f9..0984d51 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -210,10 +210,6 @@ extern void FreeOsBuffers(
#include "dix.h"
-extern ConnectionInputPtr AllocateInputBuffer(void);
-
-extern ConnectionOutputPtr AllocateOutputBuffer(void);
-
extern fd_set AllSockets;
extern fd_set AllClients;
extern fd_set LastSelectMask;
@@ -293,14 +289,12 @@ extern XID AuthSecurityCheck (AuthCheckA
/* in xdmcp.c */
extern void XdmcpUseMsg (void);
extern int XdmcpOptions(int argc, char **argv, int i);
-extern void XdmcpSetAuthentication (ARRAY8Ptr name);
extern void XdmcpRegisterConnection (
int type,
char *address,
int addrlen);
extern void XdmcpRegisterAuthorizations (void);
extern void XdmcpRegisterAuthorization (char *name, int namelen);
-extern void XdmcpRegisterDisplayClass (char *name, int length);
extern void XdmcpInit (void);
extern void XdmcpReset (void);
extern void XdmcpOpenDisplay(int sock);
@@ -313,8 +307,6 @@ extern void XdmcpRegisterAuthentication
ValidatorFunc Validator,
GeneratorFunc Generator,
AddAuthorFunc AddAuth);
-extern int XdmcpCheckAuthentication (ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type);
-extern int XdmcpAddAuthorization (ARRAY8Ptr name, ARRAY8Ptr data);
struct sockaddr_in;
extern void XdmcpRegisterBroadcastAddress (struct sockaddr_in *addr);
diff --git a/os/xdmcp.c b/os/xdmcp.c
index cfc1005..310f33b 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -197,8 +197,6 @@ static void receive_packet(int /*socketf
static void send_packet(void);
-extern void XdmcpDeadSession(char * /*reason*/);
-
static void timeout(void);
static void restart(void);
@@ -213,10 +211,23 @@ static void XdmcpWakeupHandler(
int /*i*/,
pointer /*LastSelectMask*/);
-void XdmcpRegisterManufacturerDisplayID(
- char * /*name*/,
- int /*length*/);
+/*
+ * Register the Manufacturer display ID
+ */
+
+static ARRAY8 ManufacturerDisplayID;
+
+static void
+XdmcpRegisterManufacturerDisplayID (char *name, int length)
+{
+ int i;
+ XdmcpDisposeARRAY8 (&ManufacturerDisplayID);
+ if (!XdmcpAllocARRAY8 (&ManufacturerDisplayID, length))
+ return;
+ for (i = 0; i < length; i++)
+ ManufacturerDisplayID.data[i] = (CARD8) name[i];
+}
static unsigned short xdm_udp_port = XDM_UDP_PORT;
static Bool OneSession = FALSE;
@@ -417,7 +428,7 @@ static ARRAY8Ptr AuthenticationName = &n
static ARRAY8Ptr AuthenticationData = &noAuthenticationData;
static AuthenticationFuncsPtr AuthenticationFuncs;
-void
+static void
XdmcpSetAuthentication (ARRAY8Ptr name)
{
int i;
@@ -549,7 +560,7 @@ XdmcpRegisterAuthorization (char *name,
static ARRAY8 DisplayClass;
-void
+static void
XdmcpRegisterDisplayClass (char *name, int length)
{
int i;
@@ -561,24 +572,6 @@ XdmcpRegisterDisplayClass (char *name, i
DisplayClass.data[i] = (CARD8) name[i];
}
-/*
- * Register the Manufacturer display ID
- */
-
-static ARRAY8 ManufacturerDisplayID;
-
-void
-XdmcpRegisterManufacturerDisplayID (char *name, int length)
-{
- int i;
-
- XdmcpDisposeARRAY8 (&ManufacturerDisplayID);
- if (!XdmcpAllocARRAY8 (&ManufacturerDisplayID, length))
- return;
- for (i = 0; i < length; i++)
- ManufacturerDisplayID.data[i] = (CARD8) name[i];
-}
-
/*
* initialize XDMCP; create the socket, compute the display
* number, set up the state machine
@@ -867,7 +860,7 @@ send_packet(void)
* timeouts, or Keepalive failure.
*/
-void
+static void
XdmcpDeadSession (char *reason)
{
ErrorF ("XDM: %s, declaring session dead\n", reason);
@@ -960,21 +953,16 @@ restart(void)
send_packet();
}
-int
-XdmcpCheckAuthentication (
- ARRAY8Ptr Name,
- ARRAY8Ptr Data,
- int packet_type)
+static int
+XdmcpCheckAuthentication (ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type)
{
return (XdmcpARRAY8Equal (Name, AuthenticationName) &&
(AuthenticationName->length == 0 ||
(*AuthenticationFuncs->Validator) (AuthenticationData, Data, packet_type)));
}
-int
-XdmcpAddAuthorization (
- ARRAY8Ptr name,
- ARRAY8Ptr data)
+static int
+XdmcpAddAuthorization (ARRAY8Ptr name, ARRAY8Ptr data)
{
AddAuthorFunc AddAuth;
diff --git a/record/set.c b/record/set.c
index 0ebb088..07a3a63 100644
--- a/record/set.c
+++ b/record/set.c
@@ -164,10 +164,10 @@ BitVectorIterateSet(RecordSetPtr pSet, R
return (RecordSetIteratePtr)(long)(pInterval->last + 1);
}
-RecordSetOperations BitVectorSetOperations = {
+static RecordSetOperations BitVectorSetOperations = {
BitVectorDestroySet, BitVectorIsMemberOfSet, BitVectorIterateSet };
-RecordSetOperations BitVectorNoFreeOperations = {
+static RecordSetOperations BitVectorNoFreeOperations = {
NoopDestroySet, BitVectorIsMemberOfSet, BitVectorIterateSet };
static int
@@ -277,10 +277,10 @@ IntervalListIterateSet(RecordSetPtr pSet
return (RecordSetIteratePtr)NULL;
}
-RecordSetOperations IntervalListSetOperations = {
+static RecordSetOperations IntervalListSetOperations = {
IntervalListDestroySet, IntervalListIsMemberOfSet, IntervalListIterateSet };
-RecordSetOperations IntervalListNoFreeOperations = {
+static RecordSetOperations IntervalListNoFreeOperations = {
NoopDestroySet, IntervalListIsMemberOfSet, IntervalListIterateSet };
static int
diff-tree 04b87d6dfae02e4ecdb5216d12c6cdafd1e8c2b4 (from af769892a91c9af59de53ca3bcd77fc4967daffb)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 17:57:22 2007 -0400
Static and dead code cleaup for Xext/
diff --git a/Xext/appgroup.c b/Xext/appgroup.c
index bb7a73c..7bd2055 100644
--- a/Xext/appgroup.c
+++ b/Xext/appgroup.c
@@ -116,8 +116,7 @@ int XagAppGroupFree(
return Success;
}
-/* static */
-void XagClientStateChange(
+static void XagClientStateChange(
CallbackListPtr* pcbl,
pointer nulldata,
pointer calldata)
@@ -172,21 +171,6 @@ void XagClientStateChange(
}
}
-void
-XagExtensionInit(INITARGS)
-{
- if (AddExtension (XAGNAME,
- 0,
- XagNumberErrors,
- ProcXagDispatch,
- SProcXagDispatch,
- XagResetProc,
- StandardMinorOpcode)) {
- RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
- XaceRegisterCallback(XACE_AUTH_AVAIL, XagCallClientStateChange, NULL);
- }
-}
-
/*ARGSUSED*/
static
void XagResetProc(
@@ -393,8 +377,7 @@ int AttrValidate(
return client->noClientException;
}
-/* static */
-int ProcXagCreate (
+static int ProcXagCreate (
register ClientPtr client)
{
REQUEST (xXagCreateReq);
@@ -425,8 +408,7 @@ int ProcXagCreate (
return client->noClientException;
}
-/* static */
-int ProcXagDestroy(
+static int ProcXagDestroy(
register ClientPtr client)
{
AppGroupPtr pAppGrp;
@@ -743,18 +725,7 @@ XID XagId(
return (client->appgroup ? client->appgroup->appgroupId : 0);
}
-void XagGetDeltaInfo(
- ClientPtr client,
- CARD32* buf)
-{
- *buf++ = (CARD32) client->appgroup->default_root;
- *buf++ = (CARD32) client->appgroup->root_visual;
- *buf++ = (CARD32) client->appgroup->default_colormap;
- *buf++ = (CARD32) client->appgroup->black_pixel;
- *buf = (CARD32) client->appgroup->white_pixel;
-}
-
-void XagCallClientStateChange(
+static void XagCallClientStateChange(
CallbackListPtr *pcbl,
pointer nulldata,
pointer calldata)
@@ -785,3 +756,18 @@ void XagCallClientStateChange(
XagClientStateChange (NULL, NULL, (pointer)&clientinfo);
}
}
+
+void
+XagExtensionInit(INITARGS)
+{
+ if (AddExtension (XAGNAME,
+ 0,
+ XagNumberErrors,
+ ProcXagDispatch,
+ SProcXagDispatch,
+ XagResetProc,
+ StandardMinorOpcode)) {
+ RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
+ XaceRegisterCallback(XACE_AUTH_AVAIL, XagCallClientStateChange, NULL);
+ }
+}
diff --git a/Xext/appgroup.h b/Xext/appgroup.h
index a875068..778da5d 100644
--- a/Xext/appgroup.h
+++ b/Xext/appgroup.h
@@ -50,12 +50,6 @@ extern ClientPtr XagLeader(
ClientPtr /* client */
);
-extern void XagCallClientStateChange(
- CallbackListPtr * /* pcbl */,
- pointer /* nulldata */,
- pointer /* calldata */
-);
-
extern Bool XagIsControlledRoot (
ClientPtr /* client */,
WindowPtr /* pParent */
@@ -65,22 +59,6 @@ extern XID XagId (
ClientPtr /* client */
);
-extern void XagGetDeltaInfo (
- ClientPtr /* client */,
- CARD32* /* buf */
-);
-
-extern void XagClientStateChange(
- CallbackListPtr* pcbl,
- pointer nulldata,
- pointer calldata);
-
-extern int ProcXagCreate (
- register ClientPtr client);
-
-extern int ProcXagDestroy(
- register ClientPtr client);
-
_XFUNCPROTOEND
#endif /* _APPGROUP_SRV_H_ */
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 85f5913..95df043 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -77,7 +77,7 @@ int PanoramiXPixHeight = 0;
_X_EXPORT int PanoramiXNumScreens = 0;
_X_EXPORT PanoramiXData *panoramiXdataPtr = NULL;
-RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
+static RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
static int PanoramiXNumDepths;
static DepthPtr PanoramiXDepths;
@@ -109,7 +109,6 @@ static void PanoramiXResetProc(Extension
#include "panoramiXh.h"
int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
-ScreenInfo *GlobalScrInfo = NULL;
static int PanoramiXGCIndex = -1;
static int PanoramiXScreenIndex = -1;
@@ -135,7 +134,7 @@ static void XineramaChangeClip(GCPtr, in
static void XineramaDestroyClip(GCPtr);
static void XineramaCopyClip(GCPtr, GCPtr);
-GCFuncs XineramaGCFuncs = {
+static GCFuncs XineramaGCFuncs = {
XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC,
XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip
};
@@ -168,7 +167,7 @@ XineramaCloseScreen (int i, ScreenPtr pS
return (*pScreen->CloseScreen) (i, pScreen);
}
-Bool
+static Bool
XineramaCreateGC(GCPtr pGC)
{
ScreenPtr pScreen = pGC->pScreen;
@@ -330,8 +329,6 @@ XineramaDestroyClip(GCPtr pGC)
Xinerama_GC_FUNC_EPILOGUE (pGC);
}
-
-
_X_EXPORT int
XineramaDeleteResource(pointer data, XID id)
{
@@ -339,32 +336,11 @@ XineramaDeleteResource(pointer data, XID
return 1;
}
-
-static Bool
-XineramaFindIDOnAnyScreen(pointer resource, XID id, pointer privdata)
-{
- PanoramiXRes *res = (PanoramiXRes*)resource;
- int j;
-
- FOR_NSCREENS(j)
- if(res->info[j].id == *((XID*)privdata)) return TRUE;
-
- return FALSE;
-}
-
-PanoramiXRes *
-PanoramiXFindIDOnAnyScreen(RESTYPE type, XID id)
-{
- return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
- XineramaFindIDOnAnyScreen, &id);
-}
-
typedef struct {
int screen;
int id;
} PanoramiXSearchData;
-
static Bool
XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata)
{
@@ -389,23 +365,6 @@ PanoramiXFindIDByScrnum(RESTYPE type, XI
XineramaFindIDByScrnum, &data);
}
-WindowPtr
-PanoramiXChangeWindow(int ScrnNum, WindowPtr pWin)
-{
- int num = pWin->drawable.pScreen->myNum;
-
- if(num != ScrnNum) {
- PanoramiXRes *win;
-
- win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, num);
-
- if (win)
- pWin = (WindowPtr) LookupIDByType(win->info[ScrnNum].id, RT_WINDOW);
- }
-
- return pWin;
-}
-
typedef struct _connect_callback_list {
void (*func)(void);
struct _connect_callback_list *next;
@@ -496,7 +455,6 @@ void PanoramiXExtensionInit(int argc, ch
if (noPanoramiXExtension)
return;
- GlobalScrInfo = &screenInfo; /* For debug visibility */
PanoramiXNumScreens = screenInfo.numScreens;
if (PanoramiXNumScreens == 1) { /* Only 1 screen */
noPanoramiXExtension = TRUE;
diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index 7b33392..3ad90fa 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -94,18 +94,6 @@ typedef struct {
(a).root = WindowTable[0]->drawable.id; \
}
-#define FORCE_WIN(a) { \
- if ((win = PanoramiXFindIDOnAnyScreen(XRT_WINDOW, a))) { \
- (a) = win->info[0].id; /* Real ID */ \
- } \
-}
-
-#define FORCE_CMAP(a) { \
- if ((win = PanoramiXFindIDOnAnyScreen(XRT_COLORMAP, a))) { \
- (a) = win->info[0].id; /* Real ID */ \
- } \
-}
-
#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
#define SKIP_FAKE_WINDOW(a) if(!LookupIDByType(a, XRT_WINDOW)) return
diff --git a/Xext/panoramiXh.h b/Xext/panoramiXh.h
index 6cee650..1a76a45 100644
--- a/Xext/panoramiXh.h
+++ b/Xext/panoramiXh.h
@@ -19,10 +19,10 @@ extern int PanoramiXGetGeometry(ClientPt
extern int PanoramiXTranslateCoords(ClientPtr client);
extern int PanoramiXCreatePixmap(ClientPtr client);
extern int PanoramiXFreePixmap(ClientPtr client);
-extern int PanoramiXCreateGC(ClientPtr client);
extern int PanoramiXChangeGC(ClientPtr client);
extern int PanoramiXCopyGC(ClientPtr client);
extern int PanoramiXCopyColormapAndFree(ClientPtr client);
+extern int PanoramiXCreateGC(ClientPtr client);
extern int PanoramiXSetDashes(ClientPtr client);
extern int PanoramiXSetClipRectangles(ClientPtr client);
extern int PanoramiXFreeGC(ClientPtr client);
@@ -64,7 +64,6 @@ PROC_EXTERN(ProcPanoramiXGetScreenSize);
PROC_EXTERN(ProcXineramaQueryScreens);
PROC_EXTERN(ProcXineramaIsActive);
-extern Bool XineramaCreateGC(GCPtr pGC);
extern int SProcPanoramiXDispatch(ClientPtr client);
@@ -72,6 +71,4 @@ extern char *ConnectionInfo;
extern int connBlockScreenStart;
extern xConnSetupPrefix connSetupPrefix;
-extern ScreenInfo *GlobalScrInfo;
extern int (* SavedProcVector[256]) (ClientPtr client);
-
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index bb032cf..ae90244 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -12,14 +12,11 @@ extern int PanoramiXNumScreens;
extern PanoramiXData *panoramiXdataPtr;
extern int PanoramiXPixWidth;
extern int PanoramiXPixHeight;
-extern RegionRec PanoramiXScreenRegion;
extern XID *PanoramiXVisualTable;
extern void PanoramiXConsolidate(void);
extern Bool PanoramiXCreateConnectionBlock(void);
extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
-extern PanoramiXRes * PanoramiXFindIDOnAnyScreen(RESTYPE, XID);
-extern WindowPtr PanoramiXChangeWindow(int, WindowPtr);
extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
extern int XineramaDeleteResource(pointer, XID);
diff --git a/Xext/saver.c b/Xext/saver.c
index 7e3ebf4..a9f1dd3 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -66,7 +66,7 @@ static unsigned char ScreenSaverReqCode
#endif
static int ScreenSaverEventBase = 0;
-extern DISPATCH_PROC(ProcScreenSaverQueryInfo);
+static DISPATCH_PROC(ProcScreenSaverQueryInfo);
static DISPATCH_PROC(ProcScreenSaverDispatch);
static DISPATCH_PROC(ProcScreenSaverQueryVersion);
static DISPATCH_PROC(ProcScreenSaverSelectInput);
@@ -774,7 +774,7 @@ ProcScreenSaverQueryVersion (client)
return (client->noClientException);
}
-int
+static int
ProcScreenSaverQueryInfo (client)
register ClientPtr client;
{
diff --git a/Xext/security.c b/Xext/security.c
index 7202d39..c17a438 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -77,7 +77,7 @@ typedef struct {
#define AUTHID(client) \
(((SecurityClientStateRec*)STATEPTR(client))->authId)
-CallbackListPtr SecurityValidateGroupCallback = NULL; /* see security.h */
+static CallbackListPtr SecurityValidateGroupCallback = NULL;
RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */
diff --git a/Xext/securitysrv.h b/Xext/securitysrv.h
index 7c6f432..67d864e 100644
--- a/Xext/securitysrv.h
+++ b/Xext/securitysrv.h
@@ -72,15 +72,6 @@ typedef struct {
struct _OtherClients *eventClients; /* clients wanting events */
} SecurityAuthorizationRec, *SecurityAuthorizationPtr;
-/* The following callback is called when a GenerateAuthorization request
- * is processed to sanity check the group argument. The call data will
- * be a pointer to a SecurityValidateGroupInfoRec (below).
- * Functions registered on this callback are expected to examine the
- * group and set the valid field to TRUE if they recognize the group as a
- * legitimate group. If they don't recognize it, they should not change the
- * valid field.
- */
-extern CallbackListPtr SecurityValidateGroupCallback;
typedef struct {
XID group; /* the group that was sent in GenerateAuthorization */
Bool valid; /* did anyone recognize it? if so, set to TRUE */
diff --git a/Xext/xace.c b/Xext/xace.c
index 6fc5c12..6385631 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -37,10 +37,10 @@ CallbackListPtr XaceHooks[XACE_NUM_HOOKS
* from guessing extension major opcodes and using the extension even though
* the extension can't be listed or queried.
*/
-int (*UntrustedProcVector[256])(
+static int (*UntrustedProcVector[256])(
ClientPtr /*client*/
);
-int (*SwappedUntrustedProcVector[256])(
+static int (*SwappedUntrustedProcVector[256])(
ClientPtr /*client*/
);
diff --git a/Xext/xace.h b/Xext/xace.h
index 7231b04..4143cd4 100644
--- a/Xext/xace.h
+++ b/Xext/xace.h
@@ -82,16 +82,6 @@ extern int XaceHook(
/* From the original Security extension...
*/
-/* Proc vectors for untrusted clients, swapped and unswapped versions.
- * These are the same as the normal proc vectors except that extensions
- * that haven't declared themselves secure will have ProcBadRequest plugged
- * in for their major opcode dispatcher. This prevents untrusted clients
- * from guessing extension major opcodes and using the extension even though
- * the extension can't be listed or queried.
- */
-extern int (*UntrustedProcVector[256])(ClientPtr client);
-extern int (*SwappedUntrustedProcVector[256])(ClientPtr client);
-
extern void XaceCensorImage(
ClientPtr client,
RegionPtr pVisibleRegion,
diff --git a/Xext/xevie.c b/Xext/xevie.c
index 2fd68f8..7922913 100644
--- a/Xext/xevie.c
+++ b/Xext/xevie.c
@@ -105,7 +105,7 @@ typedef struct {
} xevieKeycQueueRec, *xevieKeycQueuePtr;
#define KEYC_QUEUE_SIZE 100
-xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {{0, NULL}};
+static xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {{0, NULL}};
static int keycqHead = 0, keycqTail = 0;
static int ProcDispatch (ClientPtr), SProcDispatch (ClientPtr);
diff-tree af769892a91c9af59de53ca3bcd77fc4967daffb (from 62224e39727fd6f1cf11a461983662f615a9fea1)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 17:56:32 2007 -0400
Static and dead code cleanup from mi/
diff --git a/mi/mi.h b/mi/mi.h
index 53b5c44..c71c9b7 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -85,18 +85,6 @@ extern RegionPtr miCopyArea(
int /*yOut*/
);
-extern void miOpqStipDrawable(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- RegionPtr /*prgnSrc*/,
- MiBits * /*pbits*/,
- int /*srcx*/,
- int /*w*/,
- int /*h*/,
- int /*dstx*/,
- int /*dsty*/
-);
-
extern RegionPtr miCopyPlane(
DrawablePtr /*pSrcDrawable*/,
DrawablePtr /*pDstDrawable*/,
@@ -144,15 +132,6 @@ extern void miRecolorCursor(
/* midash.c */
-extern miDashPtr miDashLine(
- int /*npt*/,
- DDXPointPtr /*ppt*/,
- unsigned int /*nDash*/,
- unsigned char * /*pDash*/,
- unsigned int /*offset*/,
- int * /*pnseg*/
-);
-
extern void miStepDash(
int /*dist*/,
int * /*pDashIndex*/,
@@ -326,16 +305,6 @@ extern void miPolySegment(
/* mipolytext.c */
-extern int miPolyText(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- char * /*chars*/,
- FontEncoding /*fontEncoding*/
-);
-
extern int miPolyText8(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
@@ -354,16 +323,6 @@ extern int miPolyText16(
unsigned short * /*chars*/
);
-extern int miImageText(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- int /*x*/,
- int /*y*/,
- int /*count*/,
- char * /*chars*/,
- FontEncoding /*fontEncoding*/
-);
-
extern void miImageText8(
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/,
@@ -403,10 +362,6 @@ extern Bool miRectAlloc(
int /*n*/
);
-extern void miSetExtents(
- RegionPtr /*pReg*/
-);
-
extern int miFindMaxBand(
RegionPtr /*prgn*/
);
@@ -417,7 +372,6 @@ extern Bool miValidRegion(
);
#endif
-extern Bool miRegionDataCopy(RegionPtr dst, RegionPtr src);
extern Bool miRegionBroken(RegionPtr pReg);
/* miscrinit.c */
@@ -432,11 +386,6 @@ extern Bool miModifyPixmapHeader(
pointer /*pPixData*/
);
-extern Bool miCloseScreen(
- int /*index*/,
- ScreenPtr /*pScreen*/
-);
-
extern Bool miCreateScreenResources(
ScreenPtr /*pScreen*/
);
diff --git a/mi/miarc.c b/mi/miarc.c
index 8b6d8c0..2bbbb0e 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -425,15 +425,8 @@ static unsigned long lrustamp;
static arcCacheRec *lastCacheHit = &arcCache[0];
static RESTYPE cacheType;
-/*
- * External so it can be called when low on memory.
- * Call with a zero ID in that case.
- */
-/*ARGSUSED*/
-int
-miFreeArcCache (data, id)
- pointer data;
- XID id;
+static int
+miFreeArcCache (pointer data, XID id)
{
int k;
arcCacheRec *cent;
@@ -3136,8 +3129,8 @@ struct finalSpanChunk {
static struct finalSpanChunk *chunks;
-struct finalSpan *
-realAllocSpan ()
+static struct finalSpan *
+realAllocSpan (void)
{
struct finalSpanChunk *newChunk;
struct finalSpan *span;
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index e4b1407..e61855a 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -400,13 +400,9 @@ miGetPlane(
* Note how the clipped out bits of the bitmap are always the background
* color so that the stipple never causes FillRect to draw them.
*/
-void
-miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty)
- DrawablePtr pDraw;
- GCPtr pGC;
- RegionPtr prgnSrc;
- MiBits *pbits;
- int srcx, w, h, dstx, dsty;
+static void
+miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
+ MiBits *pbits, int srcx, int w, int h, int dstx, int dsty)
{
int oldfill, i;
unsigned long oldfg;
diff --git a/mi/midash.c b/mi/midash.c
index 6dd161a..912fb03 100644
--- a/mi/midash.c
+++ b/mi/midash.c
@@ -54,196 +54,6 @@ SOFTWARE.
static miDashPtr CheckDashStorage(miDashPtr *ppseg, int nseg, int *pnsegMax);
-/* return a list of DashRec. there will be an extra
-entry at the end holding the last point of the polyline.
- this means that the code that actually draws dashes can
-get a pair of points for every dash. only the point in the last
-dash record is useful; the other fields are not used.
- nseg is the number of segments, not the number of points.
-
-example:
-
- dash1.start
- dash2.start
- dash3.start
- last-point
-
-defines a list of segments
- (dash1.pt, dash2.pt)
- (dash2.pt, dash3.pt)
- (dash3.pt, last-point)
-and nseg == 3.
-
-NOTE:
- EVEN_DASH == ~ODD_DASH
-
-NOTE ALSO:
- miDashLines may return 0 segments, going from pt[0] to pt[0] with one dash.
-*/
-
-miDashPtr
-miDashLine(npt, ppt, nDash, pDash, offset, pnseg)
-int npt;
-DDXPointPtr ppt;
-unsigned int nDash;
-unsigned char *pDash;
-unsigned int offset;
-int *pnseg;
-{
- DDXPointRec pt1, pt2;
- int lenCur; /* npt used from this dash */
- int lenMax; /* npt in this dash */
- int iDash = 0; /* index of current dash */
- int which; /* EVEN_DASH or ODD_DASH */
- miDashPtr pseg; /* list of dash segments */
- miDashPtr psegBase; /* start of list */
- int nseg = 0; /* number of dashes so far */
- int nsegMax = 0; /* num segs we can fit in this list */
-
- int x, y, len;
- int adx, ady, signdx, signdy;
- int du, dv, e1, e2, e, base_e = 0;
-
- lenCur = offset;
- which = EVEN_DASH;
- while(lenCur >= pDash[iDash])
- {
- lenCur -= pDash[iDash];
- iDash++;
- if (iDash >= nDash)
- iDash = 0;
- which = ~which;
- }
- lenMax = pDash[iDash];
-
- psegBase = (miDashPtr)NULL;
- pt2 = ppt[0]; /* just in case there is only one point */
-
- while(--npt)
- {
- if (PtEqual(ppt[0], ppt[1]))
- {
- ppt++;
- continue; /* no duplicated points in polyline */
- }
- pt1 = *ppt++;
- pt2 = *ppt;
-
- adx = pt2.x - pt1.x;
- ady = pt2.y - pt1.y;
- signdx = sign(adx);
- signdy = sign(ady);
- adx = abs(adx);
- ady = abs(ady);
-
- if (adx > ady)
- {
- du = adx;
- dv = ady;
- len = adx;
- }
- else
- {
- du = ady;
- dv = adx;
- len = ady;
- }
-
- e1 = dv * 2;
- e2 = e1 - 2*du;
- e = e1 - du;
- x = pt1.x;
- y = pt1.y;
-
- nseg++;
- pseg = CheckDashStorage(&psegBase, nseg, &nsegMax);
- if (!pseg)
- return (miDashPtr)NULL;
- pseg->pt = pt1;
- pseg->e1 = e1;
- pseg->e2 = e2;
- base_e = pseg->e = e;
- pseg->which = which;
- pseg->newLine = 1;
-
- while (len--)
- {
- if (adx > ady)
- {
- /* X_AXIS */
- if (((signdx > 0) && (e < 0)) ||
- ((signdx <=0) && (e <=0))
- )
- {
- e += e1;
- }
- else
- {
- y += signdy;
- e += e2;
- }
- x += signdx;
- }
- else
- {
- /* Y_AXIS */
- if (((signdx > 0) && (e < 0)) ||
- ((signdx <=0) && (e <=0))
- )
- {
- e +=e1;
- }
- else
- {
- x += signdx;
- e += e2;
- }
- y += signdy;
- }
-
- lenCur++;
- if (lenCur >= lenMax && (len || npt <= 1))
- {
- nseg++;
- pseg = CheckDashStorage(&psegBase, nseg, &nsegMax);
- if (!pseg)
- return (miDashPtr)NULL;
- pseg->pt.x = x;
- pseg->pt.y = y;
- pseg->e1 = e1;
- pseg->e2 = e2;
- pseg->e = e;
- which = ~which;
- pseg->which = which;
- pseg->newLine = 0;
-
- /* move on to next dash */
- iDash++;
- if (iDash >= nDash)
- iDash = 0;
- lenMax = pDash[iDash];
- lenCur = 0;
- }
- } /* while len-- */
- } /* while --npt */
-
- if (lenCur == 0 && nseg != 0)
- {
- nseg--;
- which = ~which;
- }
- *pnseg = nseg;
- pseg = CheckDashStorage(&psegBase, nseg+1, &nsegMax);
- if (!pseg)
- return (miDashPtr)NULL;
- pseg->pt = pt2;
- pseg->e = base_e;
- pseg->which = which;
- pseg->newLine = 0;
- return psegBase;
-}
-
-
#define NSEGDELTA 16
/* returns a pointer to the pseg[nseg-1], growing the storage as
@@ -251,8 +61,7 @@ necessary. this interface seems unneces
*/
-static
-miDashPtr
+static miDashPtr
CheckDashStorage(
miDashPtr *ppseg, /* base pointer */
int nseg, /* number of segment we want to write to */
diff --git a/mi/mifillarc.c b/mi/mifillarc.c
index 46c0738..c561b1f 100644
--- a/mi/mifillarc.c
+++ b/mi/mifillarc.c
@@ -107,10 +107,8 @@ miFillArcSetup(arc, info)
}
}
-void
-miFillArcDSetup(arc, info)
- xArc *arc;
- miFillArcDRec *info;
+static void
+miFillArcDSetup(xArc *arc, miFillArcDRec *info)
{
/* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */
/* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */
@@ -188,15 +186,9 @@ miGetArcEdge(
}
}
-void
-miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp)
- int angle;
- int width;
- int height;
- int *dxp;
- int *dyp;
- double *d_dxp;
- double *d_dyp;
+static void
+miEllipseAngleToSlope (int angle, int width, int height, int *dxp, int *dyp,
+ double *d_dxp, double *d_dyp)
{
int dx, dy;
double d_dx, d_dy, scale;
diff --git a/mi/mifillarc.h b/mi/mifillarc.h
index 53f6f23..3e3bb98 100644
--- a/mi/mifillarc.h
+++ b/mi/mifillarc.h
@@ -176,35 +176,11 @@ typedef struct _miArcSlice {
#define miFillInArcLower(slw) (((iny + dy) != 0) && \
((slw > 1) || (ine != inxk)))
-extern int miFreeArcCache(
- pointer /*data*/,
- XID /*id*/
-);
-
-extern struct finalSpan *realAllocSpan(
- void
-);
-
extern void miFillArcSetup(
xArc * /*arc*/,
miFillArcRec * /*info*/
);
-extern void miFillArcDSetup(
- xArc * /*arc*/,
- miFillArcDRec * /*info*/
-);
-
-extern void miEllipseAngleToSlope(
- int /*angle*/,
- int /*width*/,
- int /*height*/,
- int * /*dxp*/,
- int * /*dyp*/,
- double * /*d_dxp*/,
- double * /*d_dyp*/
-);
-
extern void miFillArcSliceSetup(
xArc * /*arc*/,
miArcSliceRec * /*slice*/,
diff --git a/mi/mipointer.c b/mi/mipointer.c
index b94feaa..b86a26a 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -1,9 +1,4 @@
/*
- * mipointer.c
- */
-
-
-/*
Copyright 1989, 1998 The Open Group
@@ -409,6 +404,27 @@ miPointerAbsoluteCursor (int x, int y, u
miPointerSetPosition(inputInfo.pointer, &x, &y, time);
}
+/* Move the pointer on the current screen, and update the sprite. */
+static void
+miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
+ unsigned long time)
+{
+ SetupScreen(pScreen);
+
+ if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer) &&
+ !pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
+ {
+ miPointer.devx = x;
+ miPointer.devy = y;
+ if(!miPointer.pCursor->bits->emptyMask)
+ (*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
+ }
+
+ miPointer.x = x;
+ miPointer.y = y;
+ miPointer.pScreen = pScreen;
+}
+
_X_EXPORT void
miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time)
{
@@ -499,24 +515,3 @@ miPointerMove (ScreenPtr pScreen, int x,
for (i = 0; i < nevents; i++)
mieqEnqueue(inputInfo.pointer, &events[i]);
}
-
-/* Move the pointer on the current screen, and update the sprite. */
-void
-miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
- unsigned long time)
-{
- SetupScreen(pScreen);
-
- if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer) &&
- !pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
- {
- miPointer.devx = x;
- miPointer.devy = y;
- if(!miPointer.pCursor->bits->emptyMask)
- (*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
- }
-
- miPointer.x = x;
- miPointer.y = y;
- miPointer.pScreen = pScreen;
-}
diff --git a/mi/mipointer.h b/mi/mipointer.h
index 30e8944..1bce42c 100644
--- a/mi/mipointer.h
+++ b/mi/mipointer.h
@@ -1,10 +1,4 @@
/*
- * mipointer.h
- *
- */
-
-
-/*
Copyright 1989, 1998 The Open Group
@@ -172,15 +166,6 @@ extern void miPointerSetPosition(
extern void miPointerUpdateSprite(
DeviceIntPtr pDev);
-/* Moves the sprite to x, y on the current screen, and updates the event
- * history. */
-extern void miPointerMoved(
- DeviceIntPtr pDev,
- ScreenPtr pScreen,
- int x,
- int y,
- unsigned long time);
-
extern int miPointerScreenIndex;
#endif /* MIPOINTER_H */
diff --git a/mi/mipoly.h b/mi/mipoly.h
index 8e04f67..c1bab49 100644
--- a/mi/mipoly.h
+++ b/mi/mipoly.h
@@ -180,14 +180,6 @@ typedef struct _ScanLineListBlock {
/* mipolyutil.c */
-extern Bool miInsertEdgeInET(
- EdgeTable * /*ET*/,
- EdgeTableEntry * /*ETE*/,
- int /*scanline*/,
- ScanLineListBlock ** /*SLLBlock*/,
- int * /*iSLLBlock*/
-);
-
extern Bool miCreateETandAET(
int /*count*/,
DDXPointPtr /*pts*/,
diff --git a/mi/mipolytext.c b/mi/mipolytext.c
index 6af02e0..82b16f7 100644
--- a/mi/mipolytext.c
+++ b/mi/mipolytext.c
@@ -66,30 +66,6 @@ SOFTWARE.
#include "dixfontstr.h"
#include "mi.h"
-int
-miPolyText(pDraw, pGC, x, y, count, chars, fontEncoding)
- DrawablePtr pDraw;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
- FontEncoding fontEncoding;
-{
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
-
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
- fontEncoding, &n, charinfo);
- w = 0;
- for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
- if (n != 0)
- (*pGC->ops->PolyGlyphBlt)(
- pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
- return x+w;
-}
-
-
_X_EXPORT int
miPolyText8(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
@@ -112,7 +88,6 @@ miPolyText8(pDraw, pGC, x, y, count, cha
return x+w;
}
-
_X_EXPORT int
miPolyText16(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
@@ -136,31 +111,6 @@ miPolyText16(pDraw, pGC, x, y, count, ch
return x+w;
}
-
-int
-miImageText(pDraw, pGC, x, y, count, chars, fontEncoding)
- DrawablePtr pDraw;
- GCPtr pGC;
- int x, y;
- int count;
- char *chars;
- FontEncoding fontEncoding;
-{
- unsigned long n, i;
- FontPtr font = pGC->font;
- int w;
- CharInfoPtr charinfo[255];
-
- GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
- fontEncoding, &n, charinfo);
- w = 0;
- for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
- if (n !=0 )
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
- return x+w;
-}
-
-
_X_EXPORT void
miImageText8(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
@@ -179,7 +129,6 @@ miImageText8(pDraw, pGC, x, y, count, ch
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
}
-
_X_EXPORT void
miImageText16(pDraw, pGC, x, y, count, chars)
DrawablePtr pDraw;
diff --git a/mi/mipolyutil.c b/mi/mipolyutil.c
index fe72e55..6ec860a 100644
--- a/mi/mipolyutil.c
+++ b/mi/mipolyutil.c
@@ -73,13 +73,9 @@ SOFTWARE.
* bucket. Finally, we can insert it.
*
*/
-Bool
-miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
- EdgeTable *ET;
- EdgeTableEntry *ETE;
- int scanline;
- ScanLineListBlock **SLLBlock;
- int *iSLLBlock;
+static Bool
+miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
+ ScanLineListBlock **SLLBlock, int *iSLLBlock)
{
EdgeTableEntry *start, *prev;
ScanLineList *pSLL, *pPrevSLL;
diff --git a/mi/miregion.c b/mi/miregion.c
index 5422099..e980ad1 100644
--- a/mi/miregion.c
+++ b/mi/miregion.c
@@ -221,7 +221,7 @@ _X_EXPORT BoxRec miEmptyBox = {0, 0, 0,
_X_EXPORT RegDataRec miEmptyData = {0, 0};
RegDataRec miBrokenData = {0, 0};
-RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData };
+static RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData };
_X_EXPORT void
miPrintRegion(rgn)
@@ -913,7 +913,7 @@ miRegionOp(
*
*-----------------------------------------------------------------------
*/
-void
+static void
miSetExtents (pReg)
RegionPtr pReg;
{
@@ -2182,35 +2182,6 @@ miTranslateRegion(pReg, x, y)
}
}
-Bool
-miRegionDataCopy(
- RegionPtr dst,
- RegionPtr src)
-{
- good(dst);
- good(src);
- if (dst->data)
- return TRUE;
- if (dst == src)
- return TRUE;
- if (!src->data || !src->data->size)
- {
- xfreeData(dst);
- dst->data = (RegDataPtr)NULL;
- return TRUE;
- }
- if (!dst->data || (dst->data->size < src->data->numRects))
- {
- xfreeData(dst);
- dst->data = xallocData(src->data->numRects);
- if (!dst->data)
- return miRegionBreak (dst);
- }
- dst->data->size = src->data->size;
- dst->data->numRects = src->data->numRects;
- return TRUE;
-}
-
_X_EXPORT void
miRegionReset(pReg, pBox)
RegionPtr pReg;
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 08cc3f6..cc40cbe 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -126,12 +126,8 @@ miModifyPixmapHeader(pPixmap, width, hei
return TRUE;
}
-
-/*ARGSUSED*/
-Bool
-miCloseScreen (iScreen, pScreen)
- int iScreen;
- ScreenPtr pScreen;
+static Bool
+miCloseScreen (int iScreen, ScreenPtr pScreen)
{
return ((*pScreen->DestroyPixmap)((PixmapPtr)pScreen->devPrivate));
}
diff --git a/mi/mispans.c b/mi/mispans.c
index 61d72e4..530d9df 100644
--- a/mi/mispans.c
+++ b/mi/mispans.c
@@ -78,9 +78,7 @@ void miInitSpanGroup(spanGroup)
#define YMIN(spans) (spans->points[0].y)
#define YMAX(spans) (spans->points[spans->count-1].y)
-void miSubtractSpans (spanGroup, sub)
- SpanGroup *spanGroup;
- Spans *sub;
+static void miSubtractSpans (SpanGroup *spanGroup, Spans *sub)
{
int i, subCount, spansCount;
int ymin, ymax, xmin, xmax;
@@ -364,9 +362,8 @@ static int UniquifySpansX(
return (newWidths - startNewWidths) + 1;
} /* UniquifySpansX */
-void
-miDisposeSpanGroup (spanGroup)
- SpanGroup *spanGroup;
+static void
+miDisposeSpanGroup (SpanGroup *spanGroup)
{
int i;
Spans *spans;
@@ -538,24 +535,3 @@ void miFillUniqueSpanGroup(pDraw, pGC, s
spanGroup->ymin = MAXSHORT;
spanGroup->ymax = MINSHORT;
}
-
-
-void miFillSpanGroup(pDraw, pGC, spanGroup)
- DrawablePtr pDraw;
- GCPtr pGC;
- SpanGroup *spanGroup;
-{
- int i;
- Spans *spans;
-
- for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) {
- (*pGC->ops->FillSpans)
- (pDraw, pGC, spans->count, spans->points, spans->widths, TRUE);
- xfree(spans->points);
- xfree(spans->widths);
- }
-
- spanGroup->count = 0;
- spanGroup->ymin = MAXSHORT;
- spanGroup->ymax = MINSHORT;
-} /* FillSpanGroup */
diff --git a/mi/mispans.h b/mi/mispans.h
index 5b141af..258b292 100644
--- a/mi/mispans.h
+++ b/mi/mispans.h
@@ -71,13 +71,6 @@ extern void miAppendSpans(
Spans * /*spans*/
);
-/* Paint a span group, possibly with some overlap */
-extern void miFillSpanGroup(
- DrawablePtr /*pDraw*/,
- GCPtr /*pGC*/,
- SpanGroup * /*spanGroup*/
-);
-
/* Paint a span group, insuring that each pixel is painted at most once */
extern void miFillUniqueSpanGroup(
DrawablePtr /*pDraw*/,
@@ -90,15 +83,6 @@ extern void miFreeSpanGroup(
SpanGroup * /*spanGroup*/
);
-extern void miSubtractSpans(
- SpanGroup * /*spanGroup*/,
- Spans * /*sub*/
-);
-
-extern void miDisposeSpanGroup(
- SpanGroup * /*spanGroup*/
-);
-
extern int miClipSpans(
RegionPtr /*prgnDst*/,
DDXPointPtr /*ppt*/,
diff --git a/mi/miwideline.c b/mi/miwideline.c
index 7f99aca..08e4aa3 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -67,17 +67,11 @@ static void miLineArc(DrawablePtr pDraw,
* spans-based polygon filler
*/
-void
-miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height,
- left, right, left_count, right_count)
- DrawablePtr pDrawable;
- GCPtr pGC;
- unsigned long pixel;
- SpanDataPtr spanData;
- int y; /* start y coordinate */
- int overall_height; /* height of entire segment */
- PolyEdgePtr left, right;
- int left_count, right_count;
+static void
+miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
+ SpanDataPtr spanData, int y, int overall_height,
+ PolyEdgePtr left, PolyEdgePtr right,
+ int left_count, int right_count)
{
int left_x = 0, left_e = 0;
int left_stepx = 0;
@@ -873,11 +867,8 @@ miLineArcD (
return (pts - points);
}
-int
-miRoundJoinFace (face, edge, leftEdge)
- LineFacePtr face;
- PolyEdgePtr edge;
- Bool *leftEdge;
+static int
+miRoundJoinFace (LineFacePtr face, PolyEdgePtr edge, Bool *leftEdge)
{
int y;
int dx, dy;
@@ -1114,16 +1105,10 @@ miLineArc (
}
}
-void
-miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg, isInt)
- DrawablePtr pDrawable;
- GCPtr pGC;
- unsigned long pixel;
- SpanDataPtr spanData;
- LineFacePtr face;
- Bool isLeft;
- double xorg, yorg;
- Bool isInt;
+static void
+miLineProjectingCap (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
+ SpanDataPtr spanData, LineFacePtr face, Bool isLeft,
+ double xorg, double yorg, Bool isInt)
{
int xorgi = 0, yorgi = 0;
int lw;
@@ -1506,11 +1491,8 @@ miWideSegment (
}
}
-SpanDataPtr
-miSetupSpanData (pGC, spanData, npt)
- GCPtr pGC;
- SpanDataPtr spanData;
- int npt;
+static SpanDataPtr
+miSetupSpanData (GCPtr pGC, SpanDataPtr spanData, int npt)
{
if ((npt < 3 && pGC->capStyle != CapRound) || miSpansEasyRop(pGC->alu))
return (SpanDataPtr) NULL;
@@ -1520,11 +1502,8 @@ miSetupSpanData (pGC, spanData, npt)
return spanData;
}
-void
-miCleanupSpanData (pDrawable, pGC, spanData)
- DrawablePtr pDrawable;
- GCPtr pGC;
- SpanDataPtr spanData;
+static void
+miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
{
if (pGC->lineStyle == LineDoubleDash)
{
diff --git a/mi/miwideline.h b/mi/miwideline.h
index 8cfa630..9d1aa03 100644
--- a/mi/miwideline.h
+++ b/mi/miwideline.h
@@ -153,24 +153,6 @@ typedef struct _LineFace {
} \
}
-extern void miFillPolyHelper(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- unsigned long /*pixel*/,
- SpanDataPtr /*spanData*/,
- int /*y*/,
- int /*overall_height*/,
- PolyEdgePtr /*left*/,
- PolyEdgePtr /*right*/,
- int /*left_count*/,
- int /*right_count*/
-);
-extern int miRoundJoinFace(
- LineFacePtr /*face*/,
- PolyEdgePtr /*edge*/,
- Bool * /*leftEdge*/
-);
-
extern void miRoundJoinClip(
LineFacePtr /*pLeft*/,
LineFacePtr /*pRight*/,
@@ -189,30 +171,6 @@ extern int miRoundCapClip(
Bool * /*leftEdge*/
);
-extern void miLineProjectingCap(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- unsigned long /*pixel*/,
- SpanDataPtr /*spanData*/,
- LineFacePtr /*face*/,
- Bool /*isLeft*/,
- double /*xorg*/,
- double /*yorg*/,
- Bool /*isInt*/
-);
-
-extern SpanDataPtr miSetupSpanData(
- GCPtr /*pGC*/,
- SpanDataPtr /*spanData*/,
- int /*npt*/
-);
-
-extern void miCleanupSpanData(
- DrawablePtr /*pDrawable*/,
- GCPtr /*pGC*/,
- SpanDataPtr /*spanData*/
-);
-
extern int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy,
int xi, int yi, int left, PolyEdgePtr edge);
extern int miPolyBuildPoly(PolyVertexPtr vertices, PolySlopePtr slopes,
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index f1adc9e..9d4715a 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -401,10 +401,8 @@ miZeroArcSetup(arc, info, ok360)
#define DoPix(idx,xval,yval) if (mask & (1 << idx)) Pixelate(xval, yval);
-DDXPointPtr
-miZeroArcPts(arc, pts)
- xArc *arc;
- DDXPointPtr pts;
+static DDXPointPtr
+miZeroArcPts(xArc *arc, DDXPointPtr pts)
{
miZeroArcRec info;
int x, y, a, b, d, mask;
diff --git a/mi/mizerarc.h b/mi/mizerarc.h
index 8119d88..28ebbe0 100644
--- a/mi/mizerarc.h
+++ b/mi/mizerarc.h
@@ -124,9 +124,3 @@ extern Bool miZeroArcSetup(
miZeroArcRec * /*info*/,
Bool /*ok360*/
);
-
-extern DDXPointPtr miZeroArcPts(
- xArc * /*arc*/,
- DDXPointPtr /*pts*/
-);
-
diff-tree 62224e39727fd6f1cf11a461983662f615a9fea1 (from e8bc1988d9ff10b65717574175f70df3c4d6334d)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 17:55:15 2007 -0400
Static cleanup for xf86 ddx.
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index e1cbdbb..9740b07 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1791,6 +1791,15 @@ convertRange2Host(int entityIndex, resRa
}
}
+static void
+xf86ConvertListToHost(int entityIndex, resPtr list)
+{
+ while (list) {
+ convertRange2Host(entityIndex, &list->val);
+ list = list->next;
+ }
+}
+
/*
* xf86RegisterResources() -- attempts to register listed resources.
* If list is NULL it tries to obtain resources implicitly. Function
@@ -2836,17 +2845,6 @@ xf86IsSubsetOf(resRange range, resPtr li
return ret;
}
-Bool
-xf86IsListSubsetOf(resPtr list, resPtr BaseList)
-{
- while (list) {
- if (! xf86IsSubsetOf(list->val,BaseList))
- return FALSE;
- list = list->next;
- }
- return TRUE;
-}
-
static resPtr
findIntersect(resRange Range, resPtr list)
{
@@ -3071,15 +3069,6 @@ xf86NoSharedResources(int screenIndex,re
return TRUE;
}
-void
-xf86ConvertListToHost(int entityIndex, resPtr list)
-{
- while (list) {
- convertRange2Host(entityIndex, &list->val);
- list = list->next;
- }
-}
-
_X_EXPORT void
xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg)
{
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index 225a5c7..8d71959 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -141,11 +141,9 @@ int xf86AllocateEntity(void);
BusType StringToBusType(const char* busID, const char **retID);
memType ChkConflict(resRange *rgp, resPtr res, xf86State state);
Bool xf86IsSubsetOf(resRange range, resPtr list);
-Bool xf86IsListSubsetOf(resPtr list, resPtr BaseList);
resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
resPtr xf86FindIntersect(resRange Range, resPtr list);
void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment,
Bool useEstimated);
-void xf86ConvertListToHost(int entityIndex, resPtr list);
#endif /* _XF86_BUS_H */
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 1bd3c62..4db844e 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -538,25 +538,6 @@ xf86DriverlistFromCompile(void)
return driverlist;
}
-
-char **
-xf86InputDriverlistFromCompile(void)
-{
- static char **driverlist = NULL;
- static Bool generated = FALSE;
-
- /* This string is modified in-place */
- static char drivernames[] = IDRIVERS;
-
- if (!generated) {
- generated = TRUE;
- driverlist = GenerateDriverlist("input", drivernames);
- }
-
- return driverlist;
-}
-
-
/*
* xf86ConfigError --
* Print a READABLE ErrorMessage!!! All information that is
@@ -2504,17 +2485,8 @@ xf86HandleConfigFile(Bool autoconfig)
return CONFIG_OK;
}
-
-/* These make the equivalent parser functions visible to the common layer. */
-Bool
-xf86PathIsAbsolute(const char *path)
-{
- return (xf86pathIsAbsolute(path) != 0);
-}
-
Bool
xf86PathIsSafe(const char *path)
{
return (xf86pathIsSafe(path) != 0);
}
-
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
index 0786ec6..3787ba2 100644
--- a/hw/xfree86/common/xf86Config.h
+++ b/hw/xfree86/common/xf86Config.h
@@ -53,7 +53,6 @@ char ** xf86ModulelistFromConfig(pointer
char ** xf86DriverlistFromConfig(void);
char ** xf86DriverlistFromCompile(void);
char ** xf86InputDriverlistFromConfig(void);
-char ** xf86InputDriverlistFromCompile(void);
Bool xf86BuiltinInputDriver(const char *);
ConfigStatus xf86HandleConfigFile(Bool);
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 9b23710..b41fe6e 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -146,7 +146,6 @@ _X_EXPORT confDRIRec xf86ConfigDRI = {0,
XF86ConfigPtr xf86configptr = NULL;
Bool xf86Resetting = FALSE;
Bool xf86Initialising = FALSE;
-Bool xf86ProbeFailed = FALSE;
Bool xf86DoProbe = FALSE;
Bool xf86DoConfigure = FALSE;
DriverPtr *xf86DriverList = NULL;
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 9279dbd..59ce8da 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -100,7 +100,6 @@ extern int xf86NumModuleInfos;
extern int xf86NumDrivers;
extern Bool xf86Resetting;
extern Bool xf86Initialising;
-extern Bool xf86ProbeFailed;
extern int xf86NumScreens;
extern pciVideoPtr *xf86PciVideoInfo;
extern xf86CurrentAccessRec xf86CurrentAccess;
@@ -155,7 +154,6 @@ extern int pciTestMultiDeviceCard(int bu
/* xf86Config.c */
-Bool xf86PathIsAbsolute(const char *path);
Bool xf86PathIsSafe(const char *path);
/* xf86DefaultModes */
diff --git a/hw/xfree86/os-support/shared/libc_wrapper.c b/hw/xfree86/os-support/shared/libc_wrapper.c
index 4c4af4c..a459d5d 100644
--- a/hw/xfree86/os-support/shared/libc_wrapper.c
+++ b/hw/xfree86/os-support/shared/libc_wrapper.c
@@ -628,7 +628,7 @@ typedef struct _xf86_file_ {
char* fname;
} XF86FILE_priv;
-XF86FILE_priv stdhnd[3] = {
+static XF86FILE_priv stdhnd[3] = {
{ 0, XF86FILE_magic, NULL, "$stdinp$" },
{ 0, XF86FILE_magic, NULL, "$stdout$" },
{ 0, XF86FILE_magic, NULL, "$stderr$" }
diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c
index b7a64b0..79e1d24 100644
--- a/hw/xfree86/parser/Screen.c
+++ b/hw/xfree86/parser/Screen.c
@@ -83,7 +83,7 @@ static xf86ConfigSymTabRec DisplayTab[]
#define CLEANUP xf86freeDisplayList
-XF86ConfDisplayPtr
+static XF86ConfDisplayPtr
xf86parseDisplaySubSection (void)
{
int token;
diff --git a/hw/xfree86/parser/Vendor.c b/hw/xfree86/parser/Vendor.c
index 3e9358b..d1e6080 100644
--- a/hw/xfree86/parser/Vendor.c
+++ b/hw/xfree86/parser/Vendor.c
@@ -75,7 +75,7 @@ static xf86ConfigSymTabRec VendorSubTab[
#define CLEANUP xf86freeVendorSubList
-XF86ConfVendSubPtr
+static XF86ConfVendSubPtr
xf86parseVendorSubSection (void)
{
int has_ident = FALSE;
@@ -242,16 +242,3 @@ xf86freeVendorSubList (XF86ConfVendSubPt
xf86conffree (prev);
}
}
-
-XF86ConfVendorPtr
-xf86findVendor (const char *name, XF86ConfVendorPtr list)
-{
- while (list)
- {
- if (xf86nameCompare (list->vnd_identifier, name) == 0)
- return (list);
- list = list->list.next;
- }
- return (NULL);
-}
-
diff --git a/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c
index fa0ff78..a8912cf 100644
--- a/hw/xfree86/parser/Video.c
+++ b/hw/xfree86/parser/Video.c
@@ -74,7 +74,23 @@ static xf86ConfigSymTabRec VideoPortTab[
#define CLEANUP xf86freeVideoPortList
-XF86ConfVideoPortPtr
+static void
+xf86freeVideoPortList (XF86ConfVideoPortPtr ptr)
+{
+ XF86ConfVideoPortPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->vp_identifier);
+ TestFree (ptr->vp_comment);
+ xf86optionListFree (ptr->vp_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+static XF86ConfVideoPortPtr
xf86parseVideoPortSubSection (void)
{
int has_ident = FALSE;
@@ -266,22 +282,6 @@ xf86freeVideoAdaptorList (XF86ConfVideoA
}
}
-void
-xf86freeVideoPortList (XF86ConfVideoPortPtr ptr)
-{
- XF86ConfVideoPortPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->vp_identifier);
- TestFree (ptr->vp_comment);
- xf86optionListFree (ptr->vp_option_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
XF86ConfVideoAdaptorPtr
xf86findVideoAdaptor (const char *ident, XF86ConfVideoAdaptorPtr p)
{
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
index e3961a9..3c9ce7a 100644
--- a/hw/xfree86/parser/configProcs.h
+++ b/hw/xfree86/parser/configProcs.h
@@ -66,7 +66,6 @@ int xf86validateMonitor(XF86ConfigPtr p,
/* Pointer.c */
XF86ConfInputPtr xf86parsePointerSection(void);
/* Screen.c */
-XF86ConfDisplayPtr xf86parseDisplaySubSection(void);
XF86ConfScreenPtr xf86parseScreenSection(void);
void xf86printScreenSection(FILE *cf, XF86ConfScreenPtr ptr);
void xf86freeScreenList(XF86ConfScreenPtr ptr);
@@ -76,16 +75,13 @@ void xf86freeModeList(XF86ModePtr ptr);
int xf86validateScreen(XF86ConfigPtr p);
/* Vendor.c */
XF86ConfVendorPtr xf86parseVendorSection(void);
-XF86ConfVendSubPtr xf86parseVendorSubSection (void);
void xf86freeVendorList(XF86ConfVendorPtr p);
void xf86printVendorSection(FILE * cf, XF86ConfVendorPtr ptr);
void xf86freeVendorSubList (XF86ConfVendSubPtr ptr);
/* Video.c */
-XF86ConfVideoPortPtr xf86parseVideoPortSubSection(void);
XF86ConfVideoAdaptorPtr xf86parseVideoAdaptorSection(void);
void xf86printVideoAdaptorSection(FILE *cf, XF86ConfVideoAdaptorPtr ptr);
void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr);
-void xf86freeVideoPortList(XF86ConfVideoPortPtr ptr);
/* scan.c */
int xf86getToken(xf86ConfigSymTabRec *tab);
int xf86getSubToken(char **comment);
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index a682927..89de97b 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -469,7 +469,6 @@ XF86ConfModeLinePtr xf86findModeLine(con
XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p);
XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p);
XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p);
-XF86ConfVendorPtr xf86findVendor(const char *name, XF86ConfVendorPtr list);
XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
XF86ConfVideoAdaptorPtr p);
diff-tree e8bc1988d9ff10b65717574175f70df3c4d6334d (from 70e493d223b1e943e652191150bd0b7e1a6ebcfb)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 15:13:05 2007 -0400
Un-staticise VTSwitchEnabled, since kbd wants it apparently.
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index eae6cb1..3610c17 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -128,7 +128,7 @@ extern Bool noXkbExtension;
#ifdef USE_VT_SYSREQ
static Bool VTSysreqToggle = FALSE;
#endif /* !USE_VT_SYSREQ */
-static Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
+_X_EXPORT Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
*BSD and for avoiding VT
switches when using the DRI
automatic full screen mode.*/
diff-tree 70e493d223b1e943e652191150bd0b7e1a6ebcfb (from f36bf1a3e4ce9465ea4a6159c209924a3cafbe58)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 14:55:28 2007 -0400
Static and dead code cleanup over afb/
diff --git a/afb/afb.h b/afb/afb.h
index c05cc55..5aa2b0c 100644
--- a/afb/afb.h
+++ b/afb/afb.h
@@ -78,27 +78,6 @@ extern void afbDoBitblt(
unsigned long /*planemask*/
);
-extern RegionPtr afbBitBlt(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- GCPtr /*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- void (*doBitBlt)(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
- ),
- unsigned long /*planemask*/
-);
-
extern RegionPtr afbCopyArea(
DrawablePtr /*pSrcDrawable*/,
DrawablePtr /*pDstDrawable*/,
@@ -111,27 +90,6 @@ extern RegionPtr afbCopyArea(
int /*dsty*/
);
-extern RegionPtr afbCopyPlane(
- DrawablePtr /*pSrcDrawable*/,
- DrawablePtr /*pDstDrawable*/,
- GCPtr/*pGC*/,
- int /*srcx*/,
- int /*srcy*/,
- int /*width*/,
- int /*height*/,
- int /*dstx*/,
- int /*dsty*/,
- unsigned long /*plane*/
-);
-
-extern void afbCopy1ToN(
- DrawablePtr /*pSrc*/,
- DrawablePtr /*pDst*/,
- int /*alu*/,
- RegionPtr /*prgnDst*/,
- DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/
-);
/* afbbltC.c */
extern void afbDoBitbltCopy(
@@ -273,23 +231,6 @@ extern Bool afbInitializeColormap(
ColormapPtr /*pmap*/
);
-extern int afbExpandDirectColors(
- ColormapPtr /*pmap*/,
- int /*ndefs*/,
- xColorItem * /*indefs*/,
- xColorItem * /*outdefs*/
-);
-
-extern Bool afbCreateDefColormap(
- ScreenPtr /*pScreen*/
-);
-
-extern Bool afbSetVisualTypes(
- int /*depth*/,
- int /*visuals*/,
- int /*bitsPerRGB*/
-);
-
extern Bool afbInitVisuals(
VisualPtr * /*visualp*/,
DepthPtr * /*depthp*/,
@@ -410,16 +351,6 @@ extern Bool afbCreateGC(
GCPtr /*pGC*/
);
-extern void afbValidateGC(
- GCPtr /*pGC*/,
- unsigned long /*changes*/,
- DrawablePtr /*pDrawable*/
-);
-
-extern void afbDestroyGC(
- GCPtr /*pGC*/
-);
-
extern void afbReduceRop(
int /*alu*/,
Pixel /*src*/,
@@ -428,19 +359,6 @@ extern void afbReduceRop(
unsigned char * /*rrops*/
);
-extern void afbReduceOpaqueStipple (
- Pixel /*fg*/,
- Pixel /*bg*/,
- unsigned long /*planemask*/,
- int /*depth*/,
- unsigned char * /*rrops*/
-);
-
-extern void afbComputeCompositeClip(
- GCPtr /*pGC*/,
- DrawablePtr /*pDrawable*/
-);
-
/* afbgetsp.c */
extern void afbGetSpans(
@@ -588,14 +506,6 @@ extern Bool afbDestroyPixmap(
PixmapPtr /*pPixmap*/
);
-extern PixmapPtr afbCopyPixmap(
- PixmapPtr /*pSrc*/
-);
-
-extern void afbPadPixmap(
- PixmapPtr /*pPixmap*/
-);
-
extern void afbXRotatePixmap(
PixmapPtr /*pPix*/,
int /*rw*/
@@ -637,20 +547,9 @@ extern void afbPushPixels(
int /*xOrg*/,
int /*yOrg*/
);
-/* afbscrclse.c */
-extern Bool afbCloseScreen(
- int /*index*/,
- ScreenPtr /*pScreen*/
-);
/* afbscrinit.c */
-extern Bool afbAllocatePrivates(
- ScreenPtr /*pScreen*/,
- int * /*pWinIndex*/,
- int * /*pGCIndex*/
-);
-
extern Bool afbScreenInit(
ScreenPtr /*pScreen*/,
pointer /*pbits*/,
@@ -661,15 +560,6 @@ extern Bool afbScreenInit(
int /*width*/
);
-extern PixmapPtr afbGetWindowPixmap(
- WindowPtr /*pWin*/
-);
-
-extern void afbSetWindowPixmap(
- WindowPtr /*pWin*/,
- PixmapPtr /*pPix*/
-);
-
/* afbseg.c */
extern void afbSegmentSS(
@@ -687,20 +577,6 @@ extern void afbSegmentSD(
);
/* afbsetsp.c */
-extern void afbSetScanline(
- int /*y*/,
- int /*xOrigin*/,
- int /*xStart*/,
- int /*xEnd*/,
- PixelType * /*psrc*/,
- int /*alu*/,
- PixelType * /*pdstBase*/,
- int /*widthDst*/,
- int /*sizeDst*/,
- int /*depthDst*/,
- int /*sizeSrc*/
-);
-
extern void afbSetSpans(
DrawablePtr /*pDrawable*/,
GCPtr /*pGC*/,
diff --git a/afb/afbbitblt.c b/afb/afbbitblt.c
index 594e987..2e416e3 100644
--- a/afb/afbbitblt.c
+++ b/afb/afbbitblt.c
@@ -67,9 +67,6 @@ SOFTWARE.
#include "afb.h"
#include "maskbits.h"
-
-static unsigned char afbRropsOS[AFB_MAX_DEPTH];
-
/* CopyArea and CopyPlane for a monchrome frame buffer
@@ -126,34 +123,7 @@ afbDoBitblt(DrawablePtr pSrc, DrawablePt
typedef void (*afb_blit_func)
(DrawablePtr, DrawablePtr, int, RegionPtr, DDXPointPtr, unsigned long);
-RegionPtr
-afbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
-{
- afb_blit_func doBitBlt;
-
- switch (pGC->alu) {
- case GXcopy:
- doBitBlt = afbDoBitbltCopy;
- break;
- case GXxor:
- doBitBlt = afbDoBitbltXor;
- break;
- case GXcopyInverted:
- doBitBlt = afbDoBitbltCopyInverted;
- break;
- case GXor:
- doBitBlt = afbDoBitbltOr;
- break;
- default:
- doBitBlt = afbDoBitbltGeneral;
- break;
- }
-
- return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
- width, height, dstx, dsty, doBitBlt, pGC->planemask));
-}
-
-RegionPtr
+static RegionPtr
afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, afb_blit_func doBitBlt, long unsigned int planemask)
{
RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
@@ -346,102 +316,28 @@ afbBitBlt(register DrawablePtr pSrcDrawa
}
RegionPtr
-afbCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, long unsigned int plane)
+afbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
{
- int alu;
- RegionPtr prgnExposed = NULL;
- unsigned long old_planemask;
-
- if (pDstDrawable->depth == 1) {
- old_planemask = pGC->planemask;
- pGC->planemask = plane;
- if ((pGC->fgPixel & 1) == 1 && (pGC->bgPixel & 1) == 0) {
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty);
- } else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) {
- unsigned char rop;
-
- afbReduceRop(pGC->alu, pGC->fgPixel, 1, 1, &rop);
- alu = pGC->alu;
- pGC->alu = rop;
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height, dstx,
- dsty);
- pGC->alu = alu;
- } else { /* need to invert the src */
- alu = pGC->alu;
- pGC->alu = afbInverseAlu[alu];
- prgnExposed = (*pGC->ops->CopyArea)(pSrcDrawable, pDstDrawable, pGC,
- srcx, srcy, width, height, dstx,
- dsty);
- pGC->alu = alu;
- }
- pGC->planemask = old_planemask;
- } else {
- int free_pixmap = FALSE;
- PixmapPtr pBitmap = (PixmapPtr)pSrcDrawable;
- ScreenPtr pScreen = pSrcDrawable->pScreen;
- GCPtr pGC1 = NULL;
-
- if (pSrcDrawable == pDstDrawable ||
- pSrcDrawable->type == DRAWABLE_WINDOW || pSrcDrawable->depth != 1) {
- /* Copy a plane from source drawable to a tmp 1-bit deep pixmap */
- /* XXX: Range check width and height */
- pBitmap = (*pScreen->CreatePixmap)(pScreen, width, height, 1);
-
- if (!pBitmap)
- return(NULL);
- pGC1 = GetScratchGC(1, pScreen);
- if (!pGC1) {
- (*pScreen->DestroyPixmap)(pBitmap);
- return(NULL);
- }
- ValidateGC((DrawablePtr)pBitmap, pGC1);
- (void)afbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy,
- width, height, 0, 0, afbDoBitbltCopy, plane);
- free_pixmap = TRUE;
- }
-#if 0
- else {
- /* XXX: could cope with N-deep pixmap source case without using tmp
- * src bitmap by setting up a scratch pixmap header and fiddle
- * around with the pbits pointer.
- */
- }
-#endif
- afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
- pGC->depth, afbRropsOS);
- (void)afbBitBlt((DrawablePtr)pBitmap, pDstDrawable, pGC, 0, 0, width,
- height, dstx, dsty, afbCopy1ToN, pGC->planemask);
- if (free_pixmap) {
- (*pScreen->DestroyPixmap)(pBitmap);
- FreeScratchGC(pGC1);
- }
+ afb_blit_func doBitBlt;
- if (pGC->fExpose)
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx,
- srcy, width, height, dstx, dsty,
- plane);
+ switch (pGC->alu) {
+ case GXcopy:
+ doBitBlt = afbDoBitbltCopy;
+ break;
+ case GXxor:
+ doBitBlt = afbDoBitbltXor;
+ break;
+ case GXcopyInverted:
+ doBitBlt = afbDoBitbltCopyInverted;
+ break;
+ case GXor:
+ doBitBlt = afbDoBitbltOr;
+ break;
+ default:
+ doBitBlt = afbDoBitbltGeneral;
+ break;
}
- return prgnExposed;
-}
-void
-afbCopy1ToN(DrawablePtr pSrc, DrawablePtr pDst, int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, long unsigned int planemask)
-{
- int numRects = REGION_NUM_RECTS(prgnDst);
- BoxPtr pbox = REGION_RECTS(prgnDst);
- int r;
-
- for (r = 0; r < numRects; r++, pbox++, pptSrc++) {
- int dx = pptSrc->x;
- int dy = pptSrc->y;
-
- if (alu == GXcopy)
- afbOpaqueStippleAreaCopy(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx, dy,
- afbRropsOS, planemask);
- else
- afbOpaqueStippleAreaGeneral(pDst, 1, pbox, alu, (PixmapPtr)pSrc, dx,
- dy, afbRropsOS, planemask);
- }
+ return(afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
+ width, height, dstx, dsty, doBitBlt, pGC->planemask));
}
diff --git a/afb/afbcmap.c b/afb/afbcmap.c
index e3b95fb..9608a36 100644
--- a/afb/afbcmap.c
+++ b/afb/afbcmap.c
@@ -70,24 +70,6 @@ afbInitializeColormap(register ColormapP
return miInitializeColormap(pmap);
}
-int
-afbExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs, xColorItem *outdefs)
-{
- return miExpandDirectColors(pmap, ndef, indefs, outdefs);
-}
-
-Bool
-afbCreateDefColormap(ScreenPtr pScreen)
-{
- return miCreateDefColormap(pScreen);
-}
-
-Bool
-afbSetVisualTypes(int depth, int visuals, int bitsPerRGB)
-{
- return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
-}
-
/*
* Given a list of formats for a screen, create a list
* of visuals and depths for the screen which correspond to
diff --git a/afb/afbgc.c b/afb/afbgc.c
index 03475dd..59c09e0 100644
--- a/afb/afbgc.c
+++ b/afb/afbgc.c
@@ -69,6 +69,9 @@ SOFTWARE.
#include "maskbits.h"
+static void afbDestroyGC(GCPtr);
+static void afbValidateGC(GCPtr, unsigned long, DrawablePtr);
+
static GCFuncs afbFuncs = {
afbValidateGC,
miChangeGC,
@@ -102,6 +105,33 @@ static GCOps afbGCOps = {
afbPushPixels
};
+static void
+afbReduceOpaqueStipple(PixelType fg, PixelType bg, unsigned long planemask,
+ int depth, unsigned char *rop)
+{
+ register int d;
+ register Pixel mask = 1;
+
+ bg ^= fg;
+
+ for (d = 0; d < depth; d++, mask <<= 1) {
+ if (!(planemask & mask))
+ rop[d] = RROP_NOP;
+ else if (!(bg & mask)) {
+ /* Both fg and bg have a 0 or 1 in this plane */
+ if (fg & mask)
+ rop[d] = RROP_WHITE;
+ else
+ rop[d] = RROP_BLACK;
+ } else {
+ /* Both fg and bg have different bits on this plane */
+ if (fg & mask)
+ rop[d] = RROP_COPY;
+ else
+ rop[d] = RROP_INVERT;
+ }
+ }
+}
Bool
afbCreateGC(pGC)
@@ -136,6 +166,95 @@ afbCreateGC(pGC)
return TRUE;
}
+static void
+afbComputeCompositeClip(GCPtr pGC, DrawablePtr pDrawable)
+{
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ WindowPtr pWin = (WindowPtr) pDrawable;
+ RegionPtr pregWin;
+ Bool freeTmpClip, freeCompClip;
+
+ if (pGC->subWindowMode == IncludeInferiors) {
+ pregWin = NotClippedByChildren(pWin);
+ freeTmpClip = TRUE;
+ } else {
+ pregWin = &pWin->clipList;
+ freeTmpClip = FALSE;
+ }
+ freeCompClip = pGC->freeCompClip;
+
+ /*
+ * if there is no client clip, we can get by with just keeping the
+ * pointer we got, and remembering whether or not should destroy (or
+ * maybe re-use) it later. this way, we avoid unnecessary copying of
+ * regions. (this wins especially if many clients clip by children
+ * and have no client clip.)
+ */
+ if (pGC->clientClipType == CT_NONE) {
+ if (freeCompClip)
+ REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
+ pGC->pCompositeClip = pregWin;
+ pGC->freeCompClip = freeTmpClip;
+ } else {
+ /*
+ * we need one 'real' region to put into the composite clip. if
+ * pregWin the current composite clip are real, we can get rid of
+ * one. if pregWin is real and the current composite clip isn't,
+ * use pregWin for the composite clip. if the current composite
+ * clip is real and pregWin isn't, use the current composite
+ * clip. if neither is real, create a new region.
+ */
+
+ REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
+ pDrawable->x + pGC->clipOrg.x,
+ pDrawable->y + pGC->clipOrg.y);
+
+ if (freeCompClip) {
+ REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
+ pGC->clientClip);
+ if (freeTmpClip)
+ REGION_DESTROY(pGC->pScreen, pregWin);
+ } else if (freeTmpClip) {
+ REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip);
+ pGC->pCompositeClip = pregWin;
+ } else {
+ pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
+ REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
+ pregWin, pGC->clientClip);
+ }
+ pGC->freeCompClip = TRUE;
+ REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
+ -(pDrawable->x + pGC->clipOrg.x),
+ -(pDrawable->y + pGC->clipOrg.y));
+ }
+ } /* end of composite clip for a window */
+ else {
+ BoxRec pixbounds;
+
+ /* XXX should we translate by drawable.x/y here ? */
+ pixbounds.x1 = 0;
+ pixbounds.y1 = 0;
+ pixbounds.x2 = pDrawable->width;
+ pixbounds.y2 = pDrawable->height;
+
+ if (pGC->freeCompClip) {
+ REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
+ } else {
+ pGC->freeCompClip = TRUE;
+ pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
+ }
+
+ if (pGC->clientClipType == CT_REGION) {
+ REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
+ -pGC->clipOrg.y);
+ REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
+ pGC->pCompositeClip, pGC->clientClip);
+ REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
+ pGC->clipOrg.y);
+ }
+ } /* end of composite clip for pixmap */
+} /* end afbComputeCompositeClip */
+
/* Clipping conventions
if the drawable is a window
CT_REGION ==> pCompositeClip really is the composite
@@ -147,7 +266,7 @@ afbCreateGC(pGC)
*/
/*ARGSUSED*/
-void
+static void
afbValidateGC(pGC, changes, pDrawable)
register GCPtr pGC;
unsigned long changes;
@@ -434,7 +553,7 @@ afbValidateGC(pGC, changes, pDrawable)
} /* end of new_fill */
}
-void
+static void
afbDestroyGC(pGC)
GCPtr pGC;
{
@@ -445,58 +564,6 @@ afbDestroyGC(pGC)
miDestroyGCOps(pGC->ops);
}
-/* table to map alu(src, dst) to alu(~src, dst) */
-int afbInverseAlu[16] = {
- GXclear,
- GXandInverted,
- GXnor,
- GXcopyInverted,
- GXand,
- GXnoop,
- GXequiv,
- GXorInverted,
- GXandReverse,
- GXxor,
- GXinvert,
- GXnand,
- GXcopy,
- GXor,
- GXorReverse,
- GXset
-};
-
-void
-afbReduceOpaqueStipple(fg, bg, planemask, depth, rop)
-register PixelType fg;
-register PixelType bg;
-register unsigned long planemask;
-int depth;
-register unsigned char *rop;
-{
- register int d;
- register Pixel mask = 1;
-
- bg ^= fg;
-
- for (d = 0; d < depth; d++, mask <<= 1) {
- if (!(planemask & mask))
- rop[d] = RROP_NOP;
- else if (!(bg & mask)) {
- /* Both fg and bg have a 0 or 1 in this plane */
- if (fg & mask)
- rop[d] = RROP_WHITE;
- else
- rop[d] = RROP_BLACK;
- } else {
- /* Both fg and bg have different bits on this plane */
- if (fg & mask)
- rop[d] = RROP_COPY;
- else
- rop[d] = RROP_INVERT;
- }
- }
-}
-
void
afbReduceRop(alu, src, planemask, depth, rop)
register int alu;
@@ -615,94 +682,3 @@ afbReduceRop(alu, src, planemask, depth,
}
}
}
-
-void
-afbComputeCompositeClip(pGC, pDrawable)
- GCPtr pGC;
- DrawablePtr pDrawable;
-{
- if (pDrawable->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr) pDrawable;
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if (pGC->subWindowMode == IncludeInferiors) {
- pregWin = NotClippedByChildren(pWin);
- freeTmpClip = TRUE;
- } else {
- pregWin = &pWin->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pGC->freeCompClip;
-
- /*
- * if there is no client clip, we can get by with just keeping the
- * pointer we got, and remembering whether or not should destroy (or
- * maybe re-use) it later. this way, we avoid unnecessary copying of
- * regions. (this wins especially if many clients clip by children
- * and have no client clip.)
- */
- if (pGC->clientClipType == CT_NONE) {
- if (freeCompClip)
- REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
- pGC->pCompositeClip = pregWin;
- pGC->freeCompClip = freeTmpClip;
- } else {
- /*
- * we need one 'real' region to put into the composite clip. if
- * pregWin the current composite clip are real, we can get rid of
- * one. if pregWin is real and the current composite clip isn't,
- * use pregWin for the composite clip. if the current composite
- * clip is real and pregWin isn't, use the current composite
- * clip. if neither is real, create a new region.
- */
-
- REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
- pDrawable->x + pGC->clipOrg.x,
- pDrawable->y + pGC->clipOrg.y);
-
- if (freeCompClip) {
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, pregWin,
- pGC->clientClip);
- if (freeTmpClip)
- REGION_DESTROY(pGC->pScreen, pregWin);
- } else if (freeTmpClip) {
- REGION_INTERSECT(pGC->pScreen, pregWin, pregWin, pGC->clientClip);
- pGC->pCompositeClip = pregWin;
- } else {
- pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pregWin, pGC->clientClip);
- }
- pGC->freeCompClip = TRUE;
- REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
- -(pDrawable->x + pGC->clipOrg.x),
- -(pDrawable->y + pGC->clipOrg.y));
- }
- } /* end of composite clip for a window */
- else {
- BoxRec pixbounds;
-
- /* XXX should we translate by drawable.x/y here ? */
- pixbounds.x1 = 0;
- pixbounds.y1 = 0;
- pixbounds.x2 = pDrawable->width;
- pixbounds.y2 = pDrawable->height;
-
- if (pGC->freeCompClip) {
- REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
- } else {
- pGC->freeCompClip = TRUE;
- pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
- }
-
- if (pGC->clientClipType == CT_REGION) {
- REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, -pGC->clipOrg.x,
- -pGC->clipOrg.y);
- REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
- pGC->pCompositeClip, pGC->clientClip);
- REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip, pGC->clipOrg.x,
- pGC->clipOrg.y);
- }
- } /* end of composite clip for pixmap */
-} /* end afbComputeCompositeClip */
diff --git a/afb/afbimage.c b/afb/afbimage.c
index c82bb36..81f4973 100644
--- a/afb/afbimage.c
+++ b/afb/afbimage.c
@@ -42,39 +42,8 @@ afbPutImage(pDraw, pGC, depth, x, y, wid
(void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
0, width, height, x, y, 1);
else {
-#if 0
- /* XXX: bit plane order wronge ! */
- pPixmap->drawable.depth = 1;
- pPixmap->drawable.bitsPerPixel = 1;
-
- switch (pGC->alu) {
- case GXcopy:
- doBitBlt = afbDoBitbltCopy;
- break;
- case GXxor:
- doBitBlt = afbDoBitbltXor;
- break;
- case GXcopyInverted:
- doBitBlt = afbDoBitbltCopyInverted;
- break;
- case GXor:
- doBitBlt = afbDoBitbltOr;
- break;
- default:
- doBitBlt = afbDoBitbltGeneral;
- break;
- }
-
- for (plane = (1L << (pPixmap->drawable.depth - 1)); plane;
- plane >>= 1) {
- (void)afbBitBlt((DrawablePtr)pPixmap, pDraw, pGC, leftPad, 0,
- width, height, x, y, doBitBlt, plane);
- /* pDraw->devKind += sizeDst; */
- }
-#else
(void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDraw, pGC, leftPad,
0, width, height, x, y);
-#endif
}
pGC->fExpose = TRUE;
diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c
index 6a3a485..77ba535 100644
--- a/afb/afbpixmap.c
+++ b/afb/afbpixmap.c
@@ -118,9 +118,8 @@ afbDestroyPixmap(pPixmap)
}
-PixmapPtr
-afbCopyPixmap(pSrc)
- register PixmapPtr pSrc;
+static PixmapPtr
+afbCopyPixmap(PixmapPtr pSrc)
{
register PixmapPtr pDst;
int size;
@@ -148,9 +147,8 @@ afbCopyPixmap(pSrc)
zero out area to be filled with replicate
left shift and or in original as many times as needed
*/
-void
-afbPadPixmap(pPixmap)
- PixmapPtr pPixmap;
+static void
+afbPadPixmap(PixmapPtr pPixmap)
{
register int width = pPixmap->drawable.width;
register int h;
diff --git a/afb/afbscrinit.c b/afb/afbscrinit.c
index 2b0867f..7cb7423 100644
--- a/afb/afbscrinit.c
+++ b/afb/afbscrinit.c
@@ -77,7 +77,7 @@ int afbScreenPrivateIndex;
static unsigned long afbGeneration = 0;
-BSFuncRec afbBSFuncRec = {
+static BSFuncRec afbBSFuncRec = {
afbSaveAreas,
afbRestoreAreas,
(BackingStoreSetClipmaskRgnProcPtr) 0,
@@ -85,7 +85,7 @@ BSFuncRec afbBSFuncRec = {
(BackingStoreGetSpansPixmapProcPtr) 0,
};
-Bool
+static Bool
afbCloseScreen(int index, ScreenPtr pScreen)
{
int d;
@@ -119,7 +119,29 @@ afbCreateScreenResources(ScreenPtr pScre
return(retval);
}
-Bool
+static PixmapPtr
+afbGetWindowPixmap(WindowPtr pWin)
+{
+#ifdef PIXMAP_PER_WINDOW
+ return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
+#else
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ return (* pScreen->GetScreenPixmap)(pScreen);
+#endif
+}
+
+static void
+afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
+{
+#ifdef PIXMAP_PER_WINDOW
+ pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
+#else
+ (* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
+#endif
+}
+
+static Bool
afbAllocatePrivates(ScreenPtr pScreen, int *pWinIndex, int *pGCIndex)
{
if (afbGeneration != serverGeneration) {
@@ -216,25 +238,3 @@ afbScreenInit(register ScreenPtr pScreen
return TRUE;
}
-
-PixmapPtr
-afbGetWindowPixmap(WindowPtr pWin)
-{
-#ifdef PIXMAP_PER_WINDOW
- return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
-#else
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- return (* pScreen->GetScreenPixmap)(pScreen);
-#endif
-}
-
-void
-afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
-{
-#ifdef PIXMAP_PER_WINDOW
- pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
-#else
- (* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
-#endif
-}
diff --git a/afb/afbsetsp.c b/afb/afbsetsp.c
index adc7266..cb36dba 100644
--- a/afb/afbsetsp.c
+++ b/afb/afbsetsp.c
@@ -73,20 +73,10 @@ SOFTWARE.
* boxes, we may not want to start grabbing bits at psrc but at some offset
* further on.)
*/
-void
-afbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst,
- sizeDst, depthDst, sizeSrc)
- int y;
- int xOrigin; /* where this scanline starts */
- int xStart; /* first bit to use from scanline */
- int xEnd; /* last bit to use from scanline + 1 */
- register PixelType *psrc;
- register int alu; /* raster op */
- PixelType *pdstBase; /* start of the drawable */
- int widthDst; /* width of drawable in words */
- int sizeDst;
- int depthDst;
- int sizeSrc;
+static void
+afbSetScanline(int y, int xOrigin, int xStart, int xEnd, PixelType *psrc,
+ int alu, PixelType *pdstBase, int widthDst, int sizeDst,
+ int depthDst, int sizeSrc)
{
int w; /* width of scanline in bits */
register PixelType *pdst; /* where to put the bits */
diff-tree f36bf1a3e4ce9465ea4a6159c209924a3cafbe58 (from 9a0f25de7ca3c68af867b38936103d17daa92ac6)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 12:28:13 2007 -0400
Delete a dead file.
diff --git a/hw/xfree86/xf4bpp/ppcPolyRec.c b/hw/xfree86/xf4bpp/ppcPolyRec.c
deleted file mode 100644
index d7f8662..0000000
--- a/hw/xfree86/xf4bpp/ppcPolyRec.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright IBM Corporation 1987,1988,1989
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of IBM not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- *
- * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
-*/
-/***********************************************************
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XConsortium: ppcPolyRec.c /main/4 1996/02/21 17:58:11 kaleb $ */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf4bpp.h"
-
-void
-xf4bppPolyRectangle(pDraw, pGC, nrects, pRects)
- DrawablePtr pDraw;
- GCPtr pGC;
- int nrects;
- xRectangle *pRects;
-{
- int i;
- xRectangle *pR = pRects;
- xRectangle *tmprects, *tmprectsinit;
- int lw, fs, ss;
-
- if ( ! ( tmprectsinit = tmprects = (xRectangle *)ALLOCATE_LOCAL( ( sizeof ( xRectangle ) * nrects ) << 2 ) ) )
- return;
-
- lw = pGC->lineWidth;
- ss = lw >> 1; /* skinny side of line */
- fs = ( lw + 1 ) >> 1; /* fat side of line */
-
- for (i=0; i<nrects; i++)
- {
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y - ss;
- tmprects->width = pR->width + lw;
- tmprects->height = lw;
- tmprects++;
-
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y + fs;
- tmprects->width = lw;
- tmprects->height = pR->height - lw;
- tmprects++;
-
- tmprects->x = pR->x + pR->width - ss;
- tmprects->y = pR->y + fs;
- tmprects->width = lw;
- tmprects->height = pR->height - lw;
- tmprects++;
-
- tmprects->x = pR->x - ss;
- tmprects->y = pR->y + pR->height - ss;
- tmprects->width = pR->width + lw;
- tmprects->height = lw;
- tmprects++;
-
- pR++;
- }
-
- (* pGC->ops->PolyFillRect)( pDraw, pGC, nrects << 2, tmprectsinit );
-
- DEALLOCATE_LOCAL( tmprectsinit );
- return ;
-}
diff-tree 9a0f25de7ca3c68af867b38936103d17daa92ac6 (from ac2356843e38b3400142bc54b65393c12976fc07)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 25 12:27:01 2007 -0400
Static cleanups, dead code deletion.
diff --git a/Xi/exglobals.h b/Xi/exglobals.h
index 3afd1bb..61ebca8 100644
--- a/Xi/exglobals.h
+++ b/Xi/exglobals.h
@@ -37,7 +37,6 @@ OR IN CONNECTION WITH THE USE OR PERFORM
extern int IReqCode;
extern int BadDevice;
-extern int BadEvent;
extern int BadMode;
extern int DeviceBusy;
extern int BadClass;
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 4548837..d14e133 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -116,7 +116,7 @@ int ExtEventIndex;
Mask ExtValidMasks[EMASKSIZE];
Mask ExtExclusiveMasks[EMASKSIZE];
-struct dev_type
+static struct dev_type
{
Atom type;
char *name;
@@ -152,7 +152,7 @@ XExtEventInfo EventInfo[32];
int IReqCode = 0;
int BadDevice = 0;
-int BadEvent = 1;
+static int BadEvent = 1;
int BadMode = 2;
int DeviceBusy = 3;
int BadClass = 4;
diff --git a/composite/compalloc.c b/composite/compalloc.c
index 5bbf0a2..ce1ef7d 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -48,7 +48,7 @@
#include "compint.h"
-void
+static void
compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
{
WindowPtr pWin = (WindowPtr) closure;
diff --git a/composite/compext.c b/composite/compext.c
index 13936fa..4c25cc7 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -50,10 +50,10 @@
#include "compint.h"
static CARD8 CompositeReqCode;
-int CompositeClientPrivateIndex;
+static int CompositeClientPrivateIndex;
RESTYPE CompositeClientWindowType;
RESTYPE CompositeClientSubwindowsType;
-RESTYPE CompositeClientOverlayType;
+static RESTYPE CompositeClientOverlayType;
static void deleteCompOverlayClient (CompOverlayClientPtr pOcToDel,
ScreenPtr pScreen);
@@ -423,7 +423,7 @@ createOverlayWindow (ScreenPtr pScreen)
return pWin;
}
-int
+static int
ProcCompositeGetOverlayWindow (ClientPtr client)
{
REQUEST(xCompositeGetOverlayWindowReq);
@@ -477,7 +477,7 @@ ProcCompositeGetOverlayWindow (ClientPtr
return client->noClientException;
}
-int
+static int
ProcCompositeReleaseOverlayWindow (ClientPtr client)
{
REQUEST(xCompositeReleaseOverlayWindowReq);
@@ -515,7 +515,7 @@ ProcCompositeReleaseOverlayWindow (Clien
return client->noClientException;
}
-int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
+static int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
ProcCompositeQueryVersion,
ProcCompositeRedirectWindow,
ProcCompositeRedirectSubwindows,
@@ -625,7 +625,7 @@ SProcCompositeNameWindowPixmap (ClientPt
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
-int
+static int
SProcCompositeGetOverlayWindow (ClientPtr client)
{
int n;
@@ -637,7 +637,7 @@ SProcCompositeGetOverlayWindow (ClientPt
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
-int
+static int
SProcCompositeReleaseOverlayWindow (ClientPtr client)
{
int n;
@@ -649,7 +649,7 @@ SProcCompositeReleaseOverlayWindow (Clie
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
-int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
+static int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
SProcCompositeQueryVersion,
SProcCompositeRedirectWindow,
SProcCompositeRedirectSubwindows,
diff --git a/composite/compinit.c b/composite/compinit.c
index 1d5cc7b..27261dc 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -51,7 +51,7 @@
int CompScreenPrivateIndex;
int CompWindowPrivateIndex;
int CompSubwindowsPrivateIndex;
-int CompGeneration;
+static int CompGeneration;
static Bool
diff --git a/composite/compint.h b/composite/compint.h
index 3958b3b..0bd55a9 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -171,9 +171,6 @@ extern RESTYPE CompositeClientSubwindow
* compalloc.c
*/
-void
-compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure);
-
Bool
compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
@@ -292,18 +289,6 @@ compWindowUpdate (WindowPtr pWin);
void
deleteCompOverlayClientsForScreen (ScreenPtr pScreen);
-int
-ProcCompositeGetOverlayWindow (ClientPtr client);
-
-int
-ProcCompositeReleaseOverlayWindow (ClientPtr client);
-
-int
-SProcCompositeGetOverlayWindow (ClientPtr client);
-
-int
-SProcCompositeReleaseOverlayWindow (ClientPtr client);
-
WindowPtr
CompositeRealChildHead (WindowPtr pWin);
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 739d20f..57a7bce 100755
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -28,12 +28,12 @@
#include "damageextint.h"
-unsigned char DamageReqCode;
-int DamageEventBase;
-int DamageErrorBase;
-int DamageClientPrivateIndex;
-RESTYPE DamageExtType;
-RESTYPE DamageExtWinType;
+static unsigned char DamageReqCode;
+static int DamageEventBase;
+static int DamageErrorBase;
+static int DamageClientPrivateIndex;
+static RESTYPE DamageExtType;
+static RESTYPE DamageExtWinType;
/* Version of the damage extension supported by the server, as opposed to the
* DAMAGE_* defines from damageproto for what version the proto header
@@ -319,7 +319,7 @@ static const int version_requests[] = {
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
-int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
+static int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/
ProcDamageQueryVersion,
ProcDamageCreate,
@@ -408,7 +408,7 @@ SProcDamageAdd (ClientPtr client)
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
-int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
+static int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/
SProcDamageQueryVersion,
SProcDamageCreate,
@@ -478,7 +478,7 @@ FreeDamageExtWin (pointer value, XID wid
return Success;
}
-void
+static void
SDamageNotifyEvent (xDamageNotifyEvent *from,
xDamageNotifyEvent *to)
{
diff --git a/damageext/damageextint.h b/damageext/damageextint.h
index 6f14e4e..1ed07de 100644
--- a/damageext/damageextint.h
+++ b/damageext/damageextint.h
@@ -44,13 +44,6 @@
#include "damage.h"
#include "xfixes.h"
-extern unsigned char DamageReqCode;
-extern int DamageEventBase;
-extern int DamageErrorBase;
-extern int DamageClientPrivateIndex;
-extern RESTYPE DamageExtType;
-extern RESTYPE DamageExtWinType;
-
typedef struct _DamageClient {
CARD32 major_version;
CARD32 minor_version;
@@ -67,9 +60,6 @@ typedef struct _DamageExt {
XID id;
} DamageExtRec, *DamageExtPtr;
-extern int (*ProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
-extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
-
#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \
if (!pDamageExt) { \
@@ -79,10 +69,6 @@ extern int (*SProcDamageVector[/*XDamage
}
void
-SDamageNotifyEvent (xDamageNotifyEvent *from,
- xDamageNotifyEvent *to);
-
-void
DamageExtSetCritical (ClientPtr pClient, Bool critical);
#endif /* _DAMAGEEXTINT_H_ */
diff --git a/dbe/midbe.c b/dbe/midbe.c
index e687b98..76f0577 100644
--- a/dbe/midbe.c
+++ b/dbe/midbe.c
@@ -59,21 +59,12 @@
#include <stdio.h>
-/* DEFINES */
-
-
-/* TYPEDEFS */
-
-
-/* GLOBALS */
-
static int miDbePrivPrivGeneration = 0;
static int miDbeWindowPrivPrivIndex = -1;
-RESTYPE dbeDrawableResType;
-RESTYPE dbeWindowPrivResType;
-int dbeScreenPrivIndex = -1;
-int dbeWindowPrivIndex = -1;
-
+static RESTYPE dbeDrawableResType;
+static RESTYPE dbeWindowPrivResType;
+static int dbeScreenPrivIndex = -1;
+static int dbeWindowPrivIndex = -1;
/******************************************************************************
diff --git a/dix/devices.c b/dix/devices.c
index 5996b75..f622be7 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -79,7 +79,8 @@ SOFTWARE.
#include "exglobals.h"
#include "exevents.h"
-int CoreDevicePrivatesIndex = 0, CoreDevicePrivatesGeneration = -1;
+int CoreDevicePrivatesIndex = 0;
+static int CoreDevicePrivatesGeneration = -1;
DeviceIntPtr
AddInputDevice(DeviceProc deviceProc, Bool autoStart)
@@ -926,16 +927,16 @@ InitPtrFeedbackClassDeviceStruct(DeviceI
}
-LedCtrl defaultLedControl = {
+static LedCtrl defaultLedControl = {
DEFAULT_LEDS, DEFAULT_LEDS_MASK, 0};
-BellCtrl defaultBellControl = {
+static BellCtrl defaultBellControl = {
DEFAULT_BELL,
DEFAULT_BELL_PITCH,
DEFAULT_BELL_DURATION,
0};
-IntegerCtrl defaultIntegerControl = {
+static IntegerCtrl defaultIntegerControl = {
DEFAULT_INT_RESOLUTION,
DEFAULT_INT_MIN_VALUE,
DEFAULT_INT_MAX_VALUE,
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 32f6788..02665ed 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -297,8 +297,8 @@ long SmartScheduleSlice = SMART_SCHE
long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE;
long SmartScheduleTime;
-ClientPtr SmartLastClient;
-int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
+static ClientPtr SmartLastClient;
+static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
int SmartScheduleClient(int *clientReady, int nready);
#ifdef SMART_DEBUG
diff --git a/dix/events.c b/dix/events.c
index 02598a3..e008e36 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -156,7 +156,7 @@ extern Mask xevieFilters[128];
extern int xevieEventSent;
extern int xevieKBEventSent;
int xeviegrabState = 0;
-xEvent *xeviexE;
+static xEvent *xeviexE;
#endif
#include <X11/extensions/XIproto.h>
diff --git a/dix/extension.c b/dix/extension.c
index dc1a76f..fb4ee6b 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -66,7 +66,7 @@ SOFTWARE.
#define LAST_EVENT 128
#define LAST_ERROR 255
-ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS];
+static ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS];
static ExtensionEntry **extensions = (ExtensionEntry **)NULL;
diff --git a/dix/gc.c b/dix/gc.c
index 89b246d..7b7953d 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -69,7 +69,7 @@ extern FontPtr defaultFont;
static Bool CreateDefaultTile(GCPtr pGC);
-unsigned char DefaultDash[2] = {4, 4};
+static unsigned char DefaultDash[2] = {4, 4};
_X_EXPORT void
ValidateGC(DrawablePtr pDraw, GC *pGC)
diff --git a/dix/resource.c b/dix/resource.c
index 7092b2f..a5a7eed 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -246,7 +246,7 @@ CreateNewResourceClass()
return next;
}
-ClientResourceRec clientTable[MAXCLIENTS];
+static ClientResourceRec clientTable[MAXCLIENTS];
/*****************
* InitClientResources
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 7617bf7..e1cbdbb 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -2847,7 +2847,7 @@ xf86IsListSubsetOf(resPtr list, resPtr B
return TRUE;
}
-resPtr
+static resPtr
findIntersect(resRange Range, resPtr list)
{
resRange range;
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index b638e90..225a5c7 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -143,7 +143,6 @@ memType ChkConflict(resRange *rgp, resPt
Bool xf86IsSubsetOf(resRange range, resPtr list);
Bool xf86IsListSubsetOf(resPtr list, resPtr BaseList);
resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
-resPtr findIntersect(resRange Range, resPtr list);
resPtr xf86FindIntersect(resRange Range, resPtr list);
void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment,
Bool useEstimated);
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index f71486c..4b482df 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -68,7 +68,7 @@ static int nDevToConfig = 0, CurrentDriv
_X_EXPORT xf86MonPtr ConfiguredMonitor;
Bool xf86DoConfigurePass1 = TRUE;
-Bool foundMouse = FALSE;
+static Bool foundMouse = FALSE;
#if defined(__UNIXOS2__)
#define DFLT_MOUSE_DEV "mouse$"
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 05e62f1..eae6cb1 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -126,9 +126,9 @@ extern Bool noXkbExtension;
*/
#ifdef USE_VT_SYSREQ
-Bool VTSysreqToggle = FALSE;
+static Bool VTSysreqToggle = FALSE;
#endif /* !USE_VT_SYSREQ */
-Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
+static Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
*BSD and for avoiding VT
switches when using the DRI
automatic full screen mode.*/
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 3e908b8..2b097d2 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -110,7 +110,7 @@ static void xf86XVAdjustFrame(int index,
static Bool xf86XVInitAdaptors(ScreenPtr, XF86VideoAdaptorPtr*, int);
-int XF86XVWindowIndex = -1;
+static int XF86XVWindowIndex = -1;
int XF86XvScreenIndex = -1;
static unsigned long XF86XVGeneration = 0;
static unsigned long PortResource = 0;
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index ddd624c..774a4c4 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -189,101 +189,6 @@ _LoaderListPop(int handle)
return 0;
}
-/*
- * _LoaderHandleToName() will return the name of the first module with a
- * given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderHandleToName(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr aritem = NULL;
- loaderPtr lastitem = NULL;
-
- if (handle < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->handle == handle) {
- if (strchr(item->name, ':') == NULL)
- aritem = item;
- else
- lastitem = item;
- }
- item = item->next;
- }
-
- if (aritem)
- return aritem->name;
-
- if (lastitem)
- return lastitem->name;
-
- return 0;
-}
-
-/*
- * _LoaderHandleToCanonicalName() will return the cname of the first module
- * with a given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderHandleToCanonicalName(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr lastitem = NULL;
-
- if (handle < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->handle == handle) {
- lastitem = item;
- }
- item = item->next;
- }
-
- if (lastitem)
- return lastitem->cname;
-
- return NULL;
-}
-
-/*
- * _LoaderModuleToName() will return the name of the first module with a
- * given handle. This requires getting the last module on the LIFO with
- * the given handle.
- */
-char *
-_LoaderModuleToName(int module)
-{
- loaderPtr item = listHead;
- loaderPtr aritem = NULL;
- loaderPtr lastitem = NULL;
-
- if (module < 0) {
- return "(built-in)";
- }
- while (item) {
- if (item->module == module) {
- if (strchr(item->name, ':') == NULL)
- aritem = item;
- else
- lastitem = item;
- }
- item = item->next;
- }
-
- if (aritem)
- return aritem->name;
-
- if (lastitem)
- return lastitem->name;
-
- return 0;
-}
-
/* These four are just ABI stubs */
_X_EXPORT void
LoaderRefSymbols(const char *sym0, ...)
@@ -450,35 +355,14 @@ LoaderUnload(int handle)
return 0;
}
-void
-LoaderDuplicateSymbol(const char *symbol, const int handle)
-{
- ErrorF("Duplicate symbol %s in %s\n", symbol,
- listHead ? listHead->name : "(built-in)");
- ErrorF("Also defined in %s\n", _LoaderHandleToName(handle));
- FatalError("Module load failure\n");
-}
-
unsigned long LoaderOptions = 0;
void
-LoaderResetOptions(void)
-{
- LoaderOptions = 0;
-}
-
-void
LoaderSetOptions(unsigned long opts)
{
LoaderOptions |= opts;
}
-void
-LoaderClearOptions(unsigned long opts)
-{
- LoaderOptions &= ~opts;
-}
-
_X_EXPORT int
LoaderGetABIVersion(const char *abiclass)
{
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index ecbd676..b71ad45 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -97,9 +97,6 @@ void LoadFont(FontModule *);
void UnloadModule(ModuleDescPtr);
void UnloadSubModule(ModuleDescPtr);
void UnloadDriver(ModuleDescPtr);
-void FreeModuleDesc(ModuleDescPtr mod);
-ModuleDescPtr NewModuleDesc(const char *);
-ModuleDescPtr AddSibling(ModuleDescPtr head, ModuleDescPtr new);
void LoaderSetPath(const char *path);
void LoaderSortExtensions(void);
@@ -108,7 +105,6 @@ unsigned long LoaderGetModuleVersion(Mod
void LoaderResetOptions(void);
void LoaderSetOptions(unsigned long);
-void LoaderClearOptions(unsigned long);
/* Options for LoaderSetOptions */
#define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index a83b889..db12da4 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -745,6 +745,13 @@ CheckVersion(const char *module, XF86Mod
return TRUE;
}
+static ModuleDescPtr
+AddSibling(ModuleDescPtr head, ModuleDescPtr new)
+{
+ new->sib = head;
+ return (new);
+}
+
_X_EXPORT ModuleDescPtr
LoadSubModule(ModuleDescPtr parent, const char *module,
const char **subdirlist, const char **patternlist,
@@ -775,35 +782,28 @@ LoadSubModule(ModuleDescPtr parent, cons
return submod;
}
-ModuleDescPtr
-LoadSubModuleLocal(ModuleDescPtr parent, const char *module,
- const char **subdirlist, const char **patternlist,
- pointer options, const XF86ModReqInfo * modreq,
- int *errmaj, int *errmin)
+static ModuleDescPtr
+NewModuleDesc(const char *name)
{
- ModuleDescPtr submod;
-
- xf86MsgVerb(X_INFO, 3, "Loading local sub module \"%s\"\n", module);
+ ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc));
- if (PathIsAbsolute(module))
- {
- xf86Msg(X_ERROR,
- "LoadSubModule: Absolute module path not permitted: \"%s\"\n",
- module);
- if (errmaj)
- *errmaj = LDR_BADUSAGE;
- if (errmin)
- *errmin = 0;
- return NULL;
+ if (mdp) {
+ mdp->child = NULL;
+ mdp->sib = NULL;
+ mdp->parent = NULL;
+ mdp->demand_next = NULL;
+ mdp->name = xstrdup(name);
+ mdp->filename = NULL;
+ mdp->identifier = NULL;
+ mdp->client_id = 0;
+ mdp->in_use = 0;
+ mdp->handle = -1;
+ mdp->SetupProc = NULL;
+ mdp->TearDownProc = NULL;
+ mdp->TearDownData = NULL;
}
- submod = doLoadModule(module, NULL, subdirlist, patternlist, options,
- modreq, errmaj, errmin, 0);
- if (submod && submod != (ModuleDescPtr) 1) {
- parent->child = AddSibling(parent->child, submod);
- submod->parent = parent;
- }
- return submod;
+ return (mdp);
}
_X_EXPORT ModuleDescPtr
@@ -1099,26 +1099,12 @@ LoadModule(const char *module, const cha
modreq, errmaj, errmin, LD_FLAG_GLOBAL);
}
-ModuleDescPtr
-LoadDriver(const char *module, const char *path, int handle, pointer options,
- int *errmaj, int *errmin)
-{
- return LoadModule(module, path, NULL, NULL, options, NULL, errmaj,
- errmin);
-}
-
void
UnloadModule(ModuleDescPtr mod)
{
UnloadModuleOrDriver(mod);
}
-void
-UnloadDriver(ModuleDescPtr mod)
-{
- UnloadModuleOrDriver(mod);
-}
-
static void
UnloadModuleOrDriver(ModuleDescPtr mod)
{
@@ -1168,7 +1154,7 @@ UnloadSubModule(ModuleDescPtr mod)
xfree(mod);
}
-void
+static void
FreeModuleDesc(ModuleDescPtr head)
{
ModuleDescPtr sibs, prev;
@@ -1177,7 +1163,7 @@ FreeModuleDesc(ModuleDescPtr head)
return;
/*
* only free it if it's not marked as in use. In use means that it may
- * be unloaded someday, and UnloadModule or UnloadDriver will free it
+ * be unloaded someday, and UnloadModule will free it
*/
if (head->in_use)
return;
@@ -1192,38 +1178,6 @@ FreeModuleDesc(ModuleDescPtr head)
}
}
-ModuleDescPtr
-NewModuleDesc(const char *name)
-{
- ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc));
-
- if (mdp) {
- mdp->child = NULL;
- mdp->sib = NULL;
- mdp->parent = NULL;
- mdp->demand_next = NULL;
- mdp->name = xstrdup(name);
- mdp->filename = NULL;
- mdp->identifier = NULL;
- mdp->client_id = 0;
- mdp->in_use = 0;
- mdp->handle = -1;
- mdp->SetupProc = NULL;
- mdp->TearDownProc = NULL;
- mdp->TearDownData = NULL;
- }
-
- return (mdp);
-}
-
-ModuleDescPtr
-AddSibling(ModuleDescPtr head, ModuleDescPtr new)
-{
- new->sib = head;
- return (new);
-
-}
-
static void
RemoveChild(ModuleDescPtr child)
{
diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c
index dc75cd2..18644bc 100644
--- a/hw/xfree86/parser/DRI.c
+++ b/hw/xfree86/parser/DRI.c
@@ -48,7 +48,21 @@ static xf86ConfigSymTabRec DRITab[] =
#define CLEANUP xf86freeBuffersList
-XF86ConfBuffersPtr
+static void
+xf86freeBuffersList (XF86ConfBuffersPtr ptr)
+{
+ XF86ConfBuffersPtr prev;
+
+ while (ptr) {
+ TestFree (ptr->buf_flags);
+ TestFree (ptr->buf_comment);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+static XF86ConfBuffersPtr
xf86parseBuffers (void)
{
int token;
@@ -169,18 +183,3 @@ xf86freeDRI (XF86ConfDRIPtr ptr)
TestFree (ptr->dri_comment);
xf86conffree (ptr);
}
-
-void
-xf86freeBuffersList (XF86ConfBuffersPtr ptr)
-{
- XF86ConfBuffersPtr prev;
-
- while (ptr) {
- TestFree (ptr->buf_flags);
- TestFree (ptr->buf_comment);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c
index 7ab70d1..4adea1a 100644
--- a/hw/xfree86/parser/Flags.c
+++ b/hw/xfree86/parser/Flags.c
@@ -441,15 +441,6 @@ xf86uLongToString(unsigned long i)
return s;
}
-void
-xf86debugListOptions(XF86OptionPtr Options)
-{
- while (Options) {
- ErrorF("Option: %s Value: %s\n",Options->opt_name,Options->opt_val);
- Options = Options->list.next;
- }
-}
-
XF86OptionPtr
xf86parseOption(XF86OptionPtr head)
{
diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c
index b9f4e9e..5d1348a 100644
--- a/hw/xfree86/parser/Layout.c
+++ b/hw/xfree86/parser/Layout.c
@@ -382,24 +382,7 @@ xf86printLayoutSection (FILE * cf, XF86C
}
}
-void
-xf86freeLayoutList (XF86ConfLayoutPtr ptr)
-{
- XF86ConfLayoutPtr prev;
-
- while (ptr)
- {
- TestFree (ptr->lay_identifier);
- TestFree (ptr->lay_comment);
- xf86freeAdjacencyList (ptr->lay_adjacency_lst);
- xf86freeInputrefList (ptr->lay_input_lst);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
-void
+static void
xf86freeAdjacencyList (XF86ConfAdjacencyPtr ptr)
{
XF86ConfAdjacencyPtr prev;
@@ -419,7 +402,7 @@ xf86freeAdjacencyList (XF86ConfAdjacency
}
-void
+static void
xf86freeInputrefList (XF86ConfInputrefPtr ptr)
{
XF86ConfInputrefPtr prev;
@@ -435,6 +418,23 @@ xf86freeInputrefList (XF86ConfInputrefPt
}
+void
+xf86freeLayoutList (XF86ConfLayoutPtr ptr)
+{
+ XF86ConfLayoutPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->lay_identifier);
+ TestFree (ptr->lay_comment);
+ xf86freeAdjacencyList (ptr->lay_adjacency_lst);
+ xf86freeInputrefList (ptr->lay_input_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
#define CheckScreen(str, ptr)\
if (str[0] != '\0') \
{ \
diff --git a/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c
index f3ed9d1..81eff18 100644
--- a/hw/xfree86/parser/Module.c
+++ b/hw/xfree86/parser/Module.c
@@ -83,7 +83,7 @@ static xf86ConfigSymTabRec ModuleTab[] =
#define CLEANUP xf86freeModules
-XF86LoadPtr
+static XF86LoadPtr
xf86parseModuleSubSection (XF86LoadPtr head, char *name)
{
int token;
diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c
index 9dd0b1b..4bff4b2 100644
--- a/hw/xfree86/parser/Monitor.c
+++ b/hw/xfree86/parser/Monitor.c
@@ -124,7 +124,21 @@ static xf86ConfigSymTabRec ModeTab[] =
#define CLEANUP xf86freeModeLineList
-XF86ConfModeLinePtr
+static void
+xf86freeModeLineList (XF86ConfModeLinePtr ptr)
+{
+ XF86ConfModeLinePtr prev;
+ while (ptr)
+ {
+ TestFree (ptr->ml_identifier);
+ TestFree (ptr->ml_comment);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+static XF86ConfModeLinePtr
xf86parseModeLine (void)
{
int token;
@@ -253,7 +267,7 @@ xf86parseModeLine (void)
return (ptr);
}
-XF86ConfModeLinePtr
+static XF86ConfModeLinePtr
xf86parseVerboseMode (void)
{
int token, token2;
@@ -830,20 +844,6 @@ xf86freeModesList (XF86ConfModesPtr ptr)
}
}
-void
-xf86freeModeLineList (XF86ConfModeLinePtr ptr)
-{
- XF86ConfModeLinePtr prev;
- while (ptr)
- {
- TestFree (ptr->ml_identifier);
- TestFree (ptr->ml_comment);
- prev = ptr;
- ptr = ptr->list.next;
- xf86conffree (prev);
- }
-}
-
XF86ConfMonitorPtr
xf86findMonitor (const char *ident, XF86ConfMonitorPtr p)
{
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
index 0b98905..e3961a9 100644
--- a/hw/xfree86/parser/configProcs.h
+++ b/hw/xfree86/parser/configProcs.h
@@ -49,25 +49,19 @@ int xf86validateInput (XF86ConfigPtr p);
XF86ConfLayoutPtr xf86parseLayoutSection(void);
void xf86printLayoutSection(FILE *cf, XF86ConfLayoutPtr ptr);
void xf86freeLayoutList(XF86ConfLayoutPtr ptr);
-void xf86freeAdjacencyList(XF86ConfAdjacencyPtr ptr);
-void xf86freeInputrefList(XF86ConfInputrefPtr ptr);
int xf86validateLayout(XF86ConfigPtr p);
/* Module.c */
-XF86LoadPtr xf86parseModuleSubSection(XF86LoadPtr head, char *name);
XF86ConfModulePtr xf86parseModuleSection(void);
void xf86printModuleSection(FILE *cf, XF86ConfModulePtr ptr);
XF86LoadPtr xf86addNewLoadDirective(XF86LoadPtr head, char *name, int type, XF86OptionPtr opts);
void xf86freeModules(XF86ConfModulePtr ptr);
/* Monitor.c */
-XF86ConfModeLinePtr xf86parseModeLine(void);
-XF86ConfModeLinePtr xf86parseVerboseMode(void);
XF86ConfMonitorPtr xf86parseMonitorSection(void);
XF86ConfModesPtr xf86parseModesSection(void);
void xf86printMonitorSection(FILE *cf, XF86ConfMonitorPtr ptr);
void xf86printModesSection(FILE *cf, XF86ConfModesPtr ptr);
void xf86freeMonitorList(XF86ConfMonitorPtr ptr);
void xf86freeModesList(XF86ConfModesPtr ptr);
-void xf86freeModeLineList(XF86ConfModeLinePtr ptr);
int xf86validateMonitor(XF86ConfigPtr p, XF86ConfScreenPtr screen);
/* Pointer.c */
XF86ConfInputPtr xf86parsePointerSection(void);
@@ -92,24 +86,18 @@ XF86ConfVideoAdaptorPtr xf86parseVideoAd
void xf86printVideoAdaptorSection(FILE *cf, XF86ConfVideoAdaptorPtr ptr);
void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr);
void xf86freeVideoPortList(XF86ConfVideoPortPtr ptr);
-/* read.c */
-int xf86validateConfig(XF86ConfigPtr p);
/* scan.c */
-unsigned int xf86strToUL(char *str);
int xf86getToken(xf86ConfigSymTabRec *tab);
int xf86getSubToken(char **comment);
int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec *tab);
void xf86unGetToken(int token);
char *xf86tokenString(void);
void xf86parseError(char *format, ...);
-void xf86parseWarning(char *format, ...);
void xf86validationError(char *format, ...);
void xf86setSection(char *section);
int xf86getStringToken(xf86ConfigSymTabRec *tab);
/* write.c */
/* DRI.c */
-XF86ConfBuffersPtr xf86parseBuffers (void);
-void xf86freeBuffersList (XF86ConfBuffersPtr ptr);
XF86ConfDRIPtr xf86parseDRISection (void);
void xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr);
void xf86freeDRI (XF86ConfDRIPtr ptr);
diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
index b6b3bc3..9f79696 100644
--- a/hw/xfree86/parser/read.c
+++ b/hw/xfree86/parser/read.c
@@ -73,6 +73,25 @@ static xf86ConfigSymTabRec TopLevelTab[]
#define CLEANUP xf86freeConfig
+/*
+ * This function resolves name references and reports errors if the named
+ * objects cannot be found.
+ */
+static int
+xf86validateConfig (XF86ConfigPtr p)
+{
+ if (!xf86validateDevice (p))
+ return FALSE;
+ if (!xf86validateScreen (p))
+ return FALSE;
+ if (!xf86validateInput (p))
+ return FALSE;
+ if (!xf86validateLayout (p))
+ return FALSE;
+
+ return (TRUE);
+}
+
XF86ConfigPtr
xf86readConfigFile (void)
{
@@ -219,25 +238,6 @@ xf86readConfigFile (void)
#undef CLEANUP
/*
- * This function resolves name references and reports errors if the named
- * objects cannot be found.
- */
-int
-xf86validateConfig (XF86ConfigPtr p)
-{
- if (!xf86validateDevice (p))
- return FALSE;
- if (!xf86validateScreen (p))
- return FALSE;
- if (!xf86validateInput (p))
- return FALSE;
- if (!xf86validateLayout (p))
- return FALSE;
-
- return (TRUE);
-}
-
-/*
* adds an item to the end of the linked list. Any record whose first field
* is a GenericListRec can be cast to this type and used with this function.
* A pointer to the head of the list is returned to handle the addition of
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index f81c45a..68e7ec6 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -116,7 +116,7 @@ extern char *__XOS2RedirRoot(char *path)
* A portable, but restricted, version of strtoul(). It only understands
* hex, octal, and decimal. But it's good enough for our needs.
*/
-unsigned int
+static unsigned int
xf86strToUL (char *str)
{
int base = 10;
@@ -922,20 +922,6 @@ xf86parseError (char *format,...)
}
void
-xf86parseWarning (char *format,...)
-{
- va_list ap;
-
- ErrorF ("Parse warning on line %d of section %s in file %s\n\t",
- configLineNo, configSection, configPath);
- va_start (ap, format);
- VErrorF (format, ap);
- va_end (ap);
-
- ErrorF ("\n");
-}
-
-void
xf86validationError (char *format,...)
{
va_list ap;
diff --git a/hw/xfree86/xf4bpp/Makefile.am b/hw/xfree86/xf4bpp/Makefile.am
index 8fddb6b..5eab92f 100644
--- a/hw/xfree86/xf4bpp/Makefile.am
+++ b/hw/xfree86/xf4bpp/Makefile.am
@@ -20,7 +20,6 @@ libxf4bpp_la_SOURCES = \
ppcPixmap.c \
ppcPntWin.c \
ppcPolyPnt.c \
- ppcPolyRec.c \
ppcQuery.c \
ppcRslvC.c \
ppcSetSp.c \
diff --git a/hw/xfree86/xf4bpp/offscreen.c b/hw/xfree86/xf4bpp/offscreen.c
index f35bde7..654be82 100644
--- a/hw/xfree86/xf4bpp/offscreen.c
+++ b/hw/xfree86/xf4bpp/offscreen.c
@@ -301,25 +301,6 @@ DoMono
}
void
-xf4bppOffDrawMonoImage( pWin, data, x, y, w, h, fg, alu, planes )
-WindowPtr pWin; /* GJA */
-unsigned char *data;
-int x, y, w, h ;
-unsigned long int fg ;
-int alu ;
-unsigned long int planes;
-{
-
- if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
- return ;
-
- DoMono( pWin, w, x, y, (const unsigned char *) data, h,
- w, ( ( w + 31 ) & ~31 ) >> 3, h, 0, 0, alu,
- (int)planes, (int)fg) ;
-
-}
-
-void
xf4bppOffFillStipple( pWin, pStipple, fg, alu, planes, x, y, w, h, xSrc, ySrc )
WindowPtr pWin; /* GJA */
register PixmapPtr const pStipple ;
diff --git a/hw/xfree86/xf4bpp/ppcGC.c b/hw/xfree86/xf4bpp/ppcGC.c
index 8153051..81441ef 100644
--- a/hw/xfree86/xf4bpp/ppcGC.c
+++ b/hw/xfree86/xf4bpp/ppcGC.c
@@ -90,10 +90,9 @@ SOFTWARE.
| GCFunction | GCPlaneMask | GCFillStyle | GC_CALL_VALIDATE_BIT \
| GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode )
+static void xf4bppValidateGC(GCPtr, unsigned long, DrawablePtr);
+static void xf4bppDestroyGC(GC *);
-/* GJA -- we modified the following function to get rid of
- * the records in file vgaData.c
- */
static GCFuncs vgaGCFuncs = {
xf4bppValidateGC,
(void (*)(GCPtr, unsigned long))NoopDDA,
@@ -196,7 +195,7 @@ register GCPtr pGC ;
return TRUE ;
}
-void
+static void
xf4bppDestroyGC( pGC )
register GC *pGC ;
@@ -292,7 +291,7 @@ return 0 ;
CT_other ==> pCompositeClip is the pixmap bounding box
*/
-void
+static void
xf4bppValidateGC( pGC, changes, pDrawable )
GCPtr pGC;
unsigned long changes;
diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h
index 8d2da35..01512a8 100644
--- a/hw/xfree86/xf4bpp/xf4bpp.h
+++ b/hw/xfree86/xf4bpp/xf4bpp.h
@@ -149,14 +149,6 @@ void xf4bppTilePixmapFS(
Bool xf4bppCreateGC(
GCPtr
);
-void xf4bppDestroyGC(
- GC *
-);
-void xf4bppValidateGC(
- GCPtr,
- unsigned long,
- DrawablePtr
-);
/* ppcGetSp.c */
void xf4bppGetSpans(
diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c
index 57f3a68..1ec0609 100644
--- a/hw/xnest/Display.c
+++ b/hw/xnest/Display.c
@@ -39,7 +39,7 @@ XVisualInfo *xnestVisuals;
int xnestNumVisuals;
int xnestDefaultVisualIndex;
Colormap *xnestDefaultColormaps;
-int xnestNumDefaultColormaps;
+static int xnestNumDefaultColormaps;
int *xnestDepths;
int xnestNumDepths;
XPixmapFormatValues *xnestPixmapFormats;
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index e6870e7..e66b4f7 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -49,7 +49,7 @@ Window xnestScreenSaverWindows[MAXSCREEN
extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
#endif
-int xnestScreenGeneration = -1;
+static int xnestScreenGeneration = -1;
ScreenPtr
xnestScreen(Window window)
diff --git a/include/globals.h b/include/globals.h
index 821b12b..e23ce77 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -44,10 +44,6 @@ extern Bool DPMSCapableFlag;
#endif
#ifdef PANORAMIX
-extern Bool PanoramiXMapped;
-extern Bool PanoramiXVisibilityNotifySent;
-extern Bool PanoramiXWindowExposureSent;
-extern Bool PanoramiXOneExposeRequest;
extern Bool PanoramiXExtensionDisabledHack;
#endif
diff --git a/include/inputstr.h b/include/inputstr.h
index ada94e6..8f4e9b9 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -62,7 +62,7 @@ SOFTWARE.
#define EMASKSIZE MAX_DEVICES
-extern int CoreDevicePrivatesIndex, CoreDevicePrivatesGeneration;
+extern int CoreDevicePrivatesIndex;
/* Kludge: OtherClients and InputClients must be compatible, see code */
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 5724a6f..9701001 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -54,8 +54,8 @@ typedef struct {
} miOverlayScreenRec, *miOverlayScreenPtr;
static unsigned long miOverlayGeneration = 0;
-int miOverlayWindowIndex = -1;
-int miOverlayScreenIndex = -1;
+static int miOverlayWindowIndex = -1;
+static int miOverlayScreenIndex = -1;
static void RebuildTree(WindowPtr);
static Bool HasUnderlayChildren(WindowPtr);
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 7922cb6..08cc3f6 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -312,7 +312,7 @@ miAllocateGCPrivateIndex()
}
_X_EXPORT int miZeroLineScreenIndex;
-unsigned int miZeroLineGeneration = 0;
+static unsigned int miZeroLineGeneration = 0;
_X_EXPORT void
miSetZeroLineBias(pScreen, bias)
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index cd66b54..6f1ee28 100755
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -72,6 +72,12 @@
#define pixmapDamage(pPixmap) damagePixPriv(pPixmap)
+static int damageScrPrivateIndex;
+static int damagePixPrivateIndex;
+static int damageGCPrivateIndex;
+static int damageWinPrivateIndex;
+static int damageGeneration;
+
static DamagePtr *
getDrawableDamageRef (DrawablePtr pDrawable)
{
@@ -368,12 +374,12 @@ static void damageChangeClip(GCPtr, int,
static void damageDestroyClip(GCPtr);
static void damageCopyClip(GCPtr, GCPtr);
-GCFuncs damageGCFuncs = {
+static GCFuncs damageGCFuncs = {
damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC,
damageChangeClip, damageDestroyClip, damageCopyClip
};
-extern GCOps damageGCOps;
+static GCOps damageGCOps;
static Bool
damageCreateGC(GCPtr pGC)
@@ -1686,7 +1692,7 @@ damageCopyWindow(WindowPtr pWindow,
wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow);
}
-GCOps damageGCOps = {
+static GCOps damageGCOps = {
damageFillSpans, damageSetSpans,
damagePutImage, damageCopyArea,
damageCopyPlane, damagePolyPoint,
@@ -1787,12 +1793,6 @@ damageCloseScreen (int i, ScreenPtr pScr
return (*pScreen->CloseScreen) (i, pScreen);
}
-int damageScrPrivateIndex;
-int damagePixPrivateIndex;
-int damageGCPrivateIndex;
-int damageWinPrivateIndex;
-int damageGeneration;
-
Bool
DamageSetup (ScreenPtr pScreen)
{
diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h
index 93e213f..83a202b 100755
--- a/miext/damage/damagestr.h
+++ b/miext/damage/damagestr.h
@@ -82,11 +82,7 @@ typedef struct _damageGCPriv {
GCFuncs *funcs;
} DamageGCPrivRec, *DamageGCPrivPtr;
-extern int damageScrPrivateIndex;
-extern int damagePixPrivateIndex;
-extern int damageGCPrivateIndex;
-extern int damageWinPrivateIndex;
-
+/* XXX should move these into damage.c, damageScrPrivateIndex is static */
#define damageGetScrPriv(pScr) \
((DamageScrPrivPtr) (pScr)->devPrivates[damageScrPrivateIndex].ptr)
diff --git a/os/connection.c b/os/connection.c
index d0ffb81..cb3443c 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -175,7 +175,7 @@ typedef const char *string;
# include <ucred.h>
#endif
-int lastfdesc; /* maximum file descriptor */
+static int lastfdesc; /* maximum file descriptor */
fd_set WellKnownConnections; /* Listener mask */
fd_set EnabledDevices; /* mask for input devices that are on */
@@ -189,7 +189,7 @@ int MaxClients = 0;
Bool NewOutputPending; /* not yet attempted to write some new output */
Bool AnyClientsWriteBlocked; /* true if some client blocked on write */
-Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
+static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
Bool PartialNetwork; /* continue even if unable to bind all addrs */
static Pid_t ParentProcess;
#ifdef __UNIXOS2__
@@ -298,9 +298,9 @@ void ClearConnectionTranslation(void)
}
#endif
-XtransConnInfo *ListenTransConns = NULL;
-int *ListenTransFds = NULL;
-int ListenTransCount;
+static XtransConnInfo *ListenTransConns = NULL;
+static int *ListenTransFds = NULL;
+static int ListenTransCount;
static void ErrorConnMax(XtransConnInfo /* trans_conn */);
diff --git a/os/io.c b/os/io.c
index f6c666c..80a151f 100644
--- a/os/io.c
+++ b/os/io.c
@@ -111,11 +111,11 @@ _X_EXPORT CallbackListPtr FlushCal
#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK || err == ENOSPC)
#endif
-Bool CriticalOutputPending;
-int timesThisConnection = 0;
-ConnectionInputPtr FreeInputs = (ConnectionInputPtr)NULL;
-ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr)NULL;
-OsCommPtr AvailableInput = (OsCommPtr)NULL;
+static Bool CriticalOutputPending;
+static int timesThisConnection = 0;
+static ConnectionInputPtr FreeInputs = (ConnectionInputPtr)NULL;
+static ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr)NULL;
+static OsCommPtr AvailableInput = (OsCommPtr)NULL;
#define get_req_len(req,cli) ((cli)->swapped ? \
lswaps((req)->length) : (req)->length)
diff --git a/os/osdep.h b/os/osdep.h
index 5fa1e39..3d303f9 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -234,12 +234,6 @@ extern void ClearConnectionTranslation()
extern Bool NewOutputPending;
extern Bool AnyClientsWriteBlocked;
-extern Bool CriticalOutputPending;
-
-extern int timesThisConnection;
-extern ConnectionInputPtr FreeInputs;
-extern ConnectionOutputPtr FreeOutputs;
-extern OsCommPtr AvailableInput;
extern WorkQueuePtr workQueue;
diff --git a/os/utils.c b/os/utils.c
index 06c9b88..2fc5cbb 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -245,10 +245,6 @@ _X_EXPORT Bool noXvExtension = FALSE;
Bool CoreDump;
#ifdef PANORAMIX
-Bool PanoramiXVisibilityNotifySent = FALSE;
-Bool PanoramiXMapped = FALSE;
-Bool PanoramiXWindowExposureSent = FALSE;
-Bool PanoramiXOneExposeRequest = FALSE;
Bool PanoramiXExtensionDisabledHack = FALSE;
#endif
@@ -271,7 +267,7 @@ long Memory_fail = 0;
#include <stdlib.h> /* for random() */
#endif
-char *dev_tty_from_init = NULL; /* since we need to parse it anyway */
+static char *dev_tty_from_init = NULL; /* since we need to parse it anyway */
OsSigHandlerPtr
OsSignal(sig, handler)
diff --git a/os/xdmcp.c b/os/xdmcp.c
index fd4be5e..cfc1005 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -411,11 +411,11 @@ XdmcpRegisterAuthentication (
* set by the manager of the host to be connected to.
*/
-ARRAY8 noAuthenticationName = {(CARD16) 0, (CARD8Ptr) 0};
-ARRAY8 noAuthenticationData = {(CARD16) 0, (CARD8Ptr) 0};
-ARRAY8Ptr AuthenticationName = &noAuthenticationName;
-ARRAY8Ptr AuthenticationData = &noAuthenticationData;
-AuthenticationFuncsPtr AuthenticationFuncs;
+static ARRAY8 noAuthenticationName = {(CARD16) 0, (CARD8Ptr) 0};
+static ARRAY8 noAuthenticationData = {(CARD16) 0, (CARD8Ptr) 0};
+static ARRAY8Ptr AuthenticationName = &noAuthenticationName;
+static ARRAY8Ptr AuthenticationData = &noAuthenticationData;
+static AuthenticationFuncsPtr AuthenticationFuncs;
void
XdmcpSetAuthentication (ARRAY8Ptr name)
@@ -547,7 +547,7 @@ XdmcpRegisterAuthorization (char *name,
* Register the DisplayClass string
*/
-ARRAY8 DisplayClass;
+static ARRAY8 DisplayClass;
void
XdmcpRegisterDisplayClass (char *name, int length)
@@ -565,7 +565,7 @@ XdmcpRegisterDisplayClass (char *name, i
* Register the Manufacturer display ID
*/
-ARRAY8 ManufacturerDisplayID;
+static ARRAY8 ManufacturerDisplayID;
void
XdmcpRegisterManufacturerDisplayID (char *name, int length)
@@ -776,7 +776,7 @@ XdmcpAddHost(
* do the appropriate thing
*/
-ARRAY8 UnwillingMessage = { (CARD8) 14, (CARD8 *) "Host unwilling" };
+static ARRAY8 UnwillingMessage = { (CARD8) 14, (CARD8 *) "Host unwilling" };
static void
receive_packet(int socketfd)
diff --git a/render/animcur.c b/render/animcur.c
index 8e4f59d..1f25e79 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -87,8 +87,8 @@ static CursorBits animCursorBits = {
empty, empty, 2, 1, 1, 0, 0, 1
};
-int AnimCurScreenPrivateIndex = -1;
-int AnimCurGeneration;
+static int AnimCurScreenPrivateIndex = -1;
+static int AnimCurGeneration;
#define IsAnimCur(c) ((c)->bits == &animCursorBits)
#define GetAnimCur(c) ((AnimCurPtr) ((c) + 1))
diff --git a/render/glyph.c b/render/glyph.c
index 6d09a0e..5987cbc 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -77,11 +77,11 @@ static GlyphHashSetRec glyphHashSets[] =
#define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0]))
-const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
+static const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
-GlyphHashRec globalGlyphs[GlyphFormatNum];
+static GlyphHashRec globalGlyphs[GlyphFormatNum];
-int globalTotalGlyphPrivateSize = 0;
+static int globalTotalGlyphPrivateSize = 0;
static int glyphPrivateCount = 0;
diff --git a/render/glyphstr.h b/render/glyphstr.h
index 64cedfa..22150de 100644
--- a/render/glyphstr.h
+++ b/render/glyphstr.h
@@ -91,8 +91,6 @@ typedef struct _GlyphList {
PictFormatPtr format;
} GlyphListRec, *GlyphListPtr;
-extern GlyphHashRec globalGlyphs[GlyphFormatNum];
-
GlyphHashSetPtr
FindGlyphHashSet (CARD32 filled);
diff --git a/render/picture.c b/render/picture.c
index e7901e8..c30649c 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -43,7 +43,7 @@
_X_EXPORT int PictureScreenPrivateIndex = -1;
int PictureWindowPrivateIndex;
-int PictureGeneration;
+static int PictureGeneration;
RESTYPE PictureType;
RESTYPE PictFormatType;
RESTYPE GlyphSetType;
diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
index cee9e09..32dee8a 100755
--- a/xfixes/xfixes.c
+++ b/xfixes/xfixes.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2006 Sun Microsystems
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -55,10 +53,10 @@
#define SERVER_XFIXES_MAJOR 4
#define SERVER_XFIXES_MINOR 0
-unsigned char XFixesReqCode;
+static unsigned char XFixesReqCode;
int XFixesEventBase;
int XFixesErrorBase;
-int XFixesClientPrivateIndex;
+static int XFixesClientPrivateIndex;
static int
ProcXFixesQueryVersion(ClientPtr client)
@@ -169,7 +167,7 @@ SProcXFixesQueryVersion(ClientPtr client
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
-int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr) = {
+static int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/
SProcXFixesQueryVersion,
SProcXFixesChangeSaveSet,
diff --git a/xfixes/xfixesint.h b/xfixes/xfixesint.h
index 5f08807..7f3b119 100755
--- a/xfixes/xfixesint.h
+++ b/xfixes/xfixesint.h
@@ -61,9 +61,7 @@
#include "selection.h"
#include "xfixes.h"
-extern unsigned char XFixesReqCode;
extern int XFixesEventBase;
-extern int XFixesClientPrivateIndex;
typedef struct _XFixesClient {
CARD32 major_version;
@@ -73,7 +71,6 @@ typedef struct _XFixesClient {
#define GetXFixesClient(pClient) ((XFixesClientPtr) (pClient)->devPrivates[XFixesClientPrivateIndex].ptr)
extern int (*ProcXFixesVector[XFixesNumberRequests])(ClientPtr);
-extern int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr);
/* Initialize extension at server startup time */
diff-tree ac2356843e38b3400142bc54b65393c12976fc07 (from 1072b88a8f352484e70bc749e300c936e5600480)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date: Sun Mar 25 09:41:33 2007 +0930
dix: Increase allocation size for core keyboard keymap to avoid buffer overrun when copying keymap from extension devices.
diff --git a/dix/devices.c b/dix/devices.c
index f738419..5996b75 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -238,7 +238,7 @@ CoreKeyboardProc(DeviceIntPtr pDev, int
keySyms.mapWidth = 4;
keySyms.map = (KeySym *)xcalloc(sizeof(KeySym),
(keySyms.maxKeyCode -
- keySyms.minKeyCode) *
+ keySyms.minKeyCode + 1) *
keySyms.mapWidth);
if (!keySyms.map) {
ErrorF("Couldn't allocate core keymap\n");
diff-tree 1072b88a8f352484e70bc749e300c936e5600480 (from 804080a7096347d48c686f2c8fbfd06326bce400)
Author: Dave Airlie <airlied at linux.ie>
Date: Sun Mar 25 10:06:00 2007 +1000
loader: fix already built-in message
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index c220d8a..a83b889 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -869,7 +869,7 @@ doLoadModule(const char *module, const c
for (cim = compiled_in_modules; *cim; cim++)
if (!strcmp (module, *cim))
{
- xf86MsgVerb(X_INFO, 3, "Module alread ybuilt-in");
+ xf86MsgVerb(X_INFO, 3, "Module already built-in\n");
return (ModuleDescPtr) 1;
}
diff-tree 804080a7096347d48c686f2c8fbfd06326bce400 (from 1f77120775dc05fc84a00dd55190af2fa50ae509)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Fri Mar 23 23:41:36 2007 -0700
Make pending properties force mode set. And, remove AttachScreen calls.
Yes, two changes in one commit. Sorry 'bout that.
The first change ensures that when pending property values have been
changed, a mode set to the current mode will actually do something, rather
than being identified as a no-op. In addition, the driver no longer needs to
manage the migration of pending to current values, that is handled both
within the xf86 mode setting code (to deal with non-RandR changes) as well
as within the RandR extension itself.
The second change eliminates the two-call Create/AttachScreen stuff that was
done in a failed attempt to create RandR resources before the screen
structures were allocated. Merging these back into the Create function is
cleaner.
(cherry picked from commit 57e87e0d006cbf1f5b175fe02eeb981f741d92f0)
Conflicts:
randr/randrstr.h
randr/rrcrtc.c
I think master and server-1.3-branch are more in sync now.
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index b9895d9..7d86b66 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -312,7 +312,13 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, Displ
{
xf86OutputPtr output = xf86_config->output[i];
if (output->crtc == crtc)
+ {
output->funcs->commit(output);
+#ifdef RANDR_12_INTERFACE
+ if (output->randr_output)
+ RRPostPendingProperties (output->randr_output);
+#endif
+ }
}
/* XXX free adjustedmode */
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 4213fea..6f52ee2 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -1011,8 +1011,7 @@ xf86RandR12CreateObjects12 (ScreenPtr pS
{
xf86CrtcPtr crtc = config->crtc[c];
- crtc->randr_crtc = RRCrtcCreate (crtc);
- RRCrtcAttachScreen (crtc->randr_crtc, pScreen);
+ crtc->randr_crtc = RRCrtcCreate (pScreen, crtc);
RRCrtcGammaSetSize (crtc->randr_crtc, 256);
}
/*
@@ -1022,13 +1021,13 @@ xf86RandR12CreateObjects12 (ScreenPtr pS
{
xf86OutputPtr output = config->output[o];
- output->randr_output = RROutputCreate (output->name,
+ output->randr_output = RROutputCreate (pScreen, output->name,
strlen (output->name),
output);
- RROutputAttachScreen (output->randr_output, pScreen);
if (output->funcs->create_resources != NULL)
output->funcs->create_resources(output);
+ RRPostPendingProperties (output->randr_output);
}
return TRUE;
}
diff --git a/randr/mirandr.c b/randr/mirandr.c
index 47136fb..3c4991e 100644
--- a/randr/mirandr.c
+++ b/randr/mirandr.c
@@ -133,20 +133,13 @@ miRandRInit (ScreenPtr pScreen)
if (!mode)
return FALSE;
- crtc = RRCrtcCreate (NULL);
+ crtc = RRCrtcCreate (pScreen, NULL);
if (!crtc)
return FALSE;
- if (!RRCrtcAttachScreen (crtc, pScreen))
- {
- RRCrtcDestroy (crtc);
- return FALSE;
- }
- output = RROutputCreate ("screen", 6, NULL);
+ output = RROutputCreate (pScreen, "screen", 6, NULL);
if (!output)
return FALSE;
- if (!RROutputAttachScreen (output, pScreen))
- return FALSE;
if (!RROutputSetClones (output, NULL, 0))
return FALSE;
if (!RROutputSetModes (output, &mode, 1, 0))
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 9f039f7..4cc3a46 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -138,6 +138,7 @@ struct _rrOutput {
RRModePtr *userModes;
Bool changed;
RRPropertyPtr properties;
+ Bool pendingProperties;
void *devPrivate;
};
@@ -496,16 +497,14 @@ RRCrtcChanged (RRCrtcPtr crtc, Bool layo
* Create a CRTC
*/
RRCrtcPtr
-RRCrtcCreate (void *devPrivate);
+RRCrtcCreate (ScreenPtr pScreen, void *devPrivate);
/*
- * Attach a CRTC to a screen. Once done, this cannot be
- * undone without destroying the CRTC; it is separate from Create
- * only to allow an xf86-based driver to create objects in preinit
+ * Set the allowed rotations on a CRTC
*/
-Bool
-RRCrtcAttachScreen (RRCrtcPtr crtc, ScreenPtr pScreen);
-
+void
+RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations);
+
/*
* Notify the extension that the Crtc has been reconfigured,
* the driver calls this whenever it has updated the mode
@@ -562,13 +561,6 @@ RRCrtcGammaSetSize (RRCrtcPtr crtc,
int size);
/*
- * Set the allowable rotations of the CRTC.
- */
-Bool
-RRCrtcSetRotations (RRCrtcPtr crtc,
- Rotation rotations);
-
-/*
* Return the area of the frame buffer scanned out by the crtc,
* taking into account the current mode and rotation
*/
@@ -670,19 +662,12 @@ RROutputChanged (RROutputPtr output, Boo
*/
RROutputPtr
-RROutputCreate (const char *name,
+RROutputCreate (ScreenPtr pScreen,
+ const char *name,
int nameLength,
void *devPrivate);
/*
- * Attach an output to a screen, again split from creation so
- * xf86 DDXen can create randr resources before the ScreenRec
- * exists
- */
-Bool
-RROutputAttachScreen (RROutputPtr output, ScreenPtr pScreen);
-
-/*
* Notify extension that output parameters have been changed
*/
Bool
@@ -762,7 +747,7 @@ void
RRDeleteOutputProperty (RROutputPtr output, Atom property);
Bool
-RRPostPendingProperty (RROutputPtr output, Atom property);
+RRPostPendingProperties (RROutputPtr output);
int
RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 7131dfb..1dfc3bb 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -51,17 +51,32 @@ RRCrtcChanged (RRCrtcPtr crtc, Bool layo
* Create a CRTC
*/
RRCrtcPtr
-RRCrtcCreate (void *devPrivate)
+RRCrtcCreate (ScreenPtr pScreen, void *devPrivate)
{
- RRCrtcPtr crtc;
-
+ RRCrtcPtr crtc;
+ RRCrtcPtr *crtcs;
+ rrScrPrivPtr pScrPriv;
+
if (!RRInit())
return NULL;
+
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ /* make space for the crtc pointer */
+ if (pScrPriv->numCrtcs)
+ crtcs = xrealloc (pScrPriv->crtcs,
+ (pScrPriv->numCrtcs + 1) * sizeof (RRCrtcPtr));
+ else
+ crtcs = xalloc (sizeof (RRCrtcPtr));
+ if (!crtcs)
+ return FALSE;
+ pScrPriv->crtcs = crtcs;
+
crtc = xalloc (sizeof (RRCrtcRec));
if (!crtc)
return NULL;
crtc->id = FakeClientID (0);
- crtc->pScreen = NULL;
+ crtc->pScreen = pScreen;
crtc->mode = NULL;
crtc->x = 0;
crtc->y = 0;
@@ -77,37 +92,20 @@ RRCrtcCreate (void *devPrivate)
if (!AddResource (crtc->id, RRCrtcType, (pointer) crtc))
return NULL;
+ /* attach the screen and crtc together */
+ crtc->pScreen = pScreen;
+ pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc;
+
return crtc;
}
/*
- * Attach a Crtc to a screen. This is done as a separate step
- * so that an xf86-based driver can create CRTCs in PreInit
- * before the Screen has been created
+ * Set the allowed rotations on a CRTC
*/
-
-Bool
-RRCrtcAttachScreen (RRCrtcPtr crtc, ScreenPtr pScreen)
+void
+RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations)
{
- rrScrPriv (pScreen);
- RRCrtcPtr *crtcs;
-
- /* make space for the crtc pointer */
- if (pScrPriv->numCrtcs)
- crtcs = xrealloc (pScrPriv->crtcs,
- (pScrPriv->numCrtcs + 1) * sizeof (RRCrtcPtr));
- else
- crtcs = xalloc (sizeof (RRCrtcPtr));
- if (!crtcs)
- return FALSE;
-
- /* attach the screen and crtc together */
- crtc->pScreen = pScreen;
- pScrPriv->crtcs = crtcs;
- pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc;
-
- RRCrtcChanged (crtc, TRUE);
- return TRUE;
+ crtc->rotations = rotations;
}
/*
@@ -249,6 +247,22 @@ RRDeliverCrtcEvent (ClientPtr client, Wi
WriteEventsToClient (client, 1, (xEvent *) &ce);
}
+static Bool
+RRCrtcPendingProperties (RRCrtcPtr crtc)
+{
+ ScreenPtr pScreen = crtc->pScreen;
+ rrScrPriv(pScreen);
+ int o;
+
+ for (o = 0; o < pScrPriv->numOutputs; o++)
+ {
+ RROutputPtr output = pScrPriv->outputs[o];
+ if (output->crtc == crtc && output->pendingProperties)
+ return TRUE;
+ }
+ return FALSE;
+}
+
/*
* Request that the Crtc be reconfigured
*/
@@ -271,7 +285,8 @@ RRCrtcSet (RRCrtcPtr crtc,
crtc->y == y &&
crtc->rotation == rotation &&
crtc->numOutputs == numOutputs &&
- !memcmp (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)))
+ !memcmp (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)) &&
+ !RRCrtcPendingProperties (crtc))
{
ret = TRUE;
}
@@ -328,7 +343,13 @@ RRCrtcSet (RRCrtcPtr crtc,
#endif
}
if (ret)
+ {
+ int o;
RRTellChanged (pScreen);
+
+ for (o = 0; o < numOutputs; o++)
+ RRPostPendingProperties (outputs[o]);
+ }
}
return ret;
}
@@ -469,17 +490,6 @@ RRCrtcGammaSetSize (RRCrtcPtr crtc,
}
/*
- * Set the allowable rotations of the CRTC.
- */
-Bool
-RRCrtcSetRotations (RRCrtcPtr crtc,
- Rotation rotations)
-{
- crtc->rotations = rotations;
- return TRUE;
-}
-
-/*
* Initialize crtc type
*/
Bool
diff --git a/randr/rrinfo.c b/randr/rrinfo.c
index 549d501..5ef1a6b 100644
--- a/randr/rrinfo.c
+++ b/randr/rrinfo.c
@@ -91,19 +91,12 @@ RRScanOldConfig (ScreenPtr pScreen, Rota
if (pScrPriv->numOutputs == 0 &&
pScrPriv->numCrtcs == 0)
{
- crtc = RRCrtcCreate (NULL);
+ crtc = RRCrtcCreate (pScreen, NULL);
if (!crtc)
return;
- if (!RRCrtcAttachScreen (crtc, pScreen))
- {
- RRCrtcDestroy (crtc);
- return;
- }
- output = RROutputCreate ("default", 7, NULL);
+ output = RROutputCreate (pScreen, "default", 7, NULL);
if (!output)
return;
- if (!RROutputAttachScreen (output, pScreen))
- return;
RROutputSetCrtcs (output, &crtc, 1);
RROutputSetCrtc (output, crtc);
RROutputSetConnection (output, RR_Connected);
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 160071b..e001162 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -47,19 +47,35 @@ RROutputChanged (RROutputPtr output, Boo
*/
RROutputPtr
-RROutputCreate (const char *name,
+RROutputCreate (ScreenPtr pScreen,
+ const char *name,
int nameLength,
void *devPrivate)
{
- RROutputPtr output;
+ RROutputPtr output;
+ RROutputPtr *outputs;
+ rrScrPrivPtr pScrPriv;
if (!RRInit())
return NULL;
+
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ if (pScrPriv->numOutputs)
+ outputs = xrealloc (pScrPriv->outputs,
+ (pScrPriv->numOutputs + 1) * sizeof (RROutputPtr));
+ else
+ outputs = xalloc (sizeof (RROutputPtr));
+ if (!outputs)
+ return FALSE;
+
+ pScrPriv->outputs = outputs;
+
output = xalloc (sizeof (RROutputRec) + nameLength + 1);
if (!output)
return NULL;
output->id = FakeClientID (0);
- output->pScreen = NULL;
+ output->pScreen = pScreen;
output->name = (char *) (output + 1);
output->nameLength = nameLength;
memcpy (output->name, name, nameLength);
@@ -85,36 +101,11 @@ RROutputCreate (const char *name,
if (!AddResource (output->id, RROutputType, (pointer) output))
return NULL;
+ pScrPriv->outputs[pScrPriv->numOutputs++] = output;
return output;
}
/*
- * Attach an Output to a screen. This is done as a separate step
- * so that an xf86-based driver can create Outputs in PreInit
- * before the Screen has been created
- */
-
-Bool
-RROutputAttachScreen (RROutputPtr output, ScreenPtr pScreen)
-{
- rrScrPriv (pScreen);
- RROutputPtr *outputs;
-
- if (pScrPriv->numOutputs)
- outputs = xrealloc (pScrPriv->outputs,
- (pScrPriv->numOutputs + 1) * sizeof (RROutputPtr));
- else
- outputs = xalloc (sizeof (RROutputPtr));
- if (!outputs)
- return FALSE;
- output->pScreen = pScreen;
- pScrPriv->outputs = outputs;
- pScrPriv->outputs[pScrPriv->numOutputs++] = output;
- RROutputChanged (output, FALSE);
- return TRUE;
-}
-
-/*
* Notify extension that output parameters have been changed
*/
Bool
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 148e4a2..5ac073f 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -27,7 +27,7 @@
static void
RRDeliverEvent (ScreenPtr pScreen, xEvent *event, CARD32 mask)
{
-
+
}
void
@@ -50,7 +50,7 @@ RRDeleteAllOutputProperties (RROutputPtr
xfree(prop->current.data);
if (prop->pending.data)
xfree(prop->pending.data);
- xfree(prop);
+ xfree(prop);
}
}
@@ -67,7 +67,7 @@ static RRPropertyPtr
RRCreateOutputProperty (Atom property)
{
RRPropertyPtr prop;
-
+
prop = (RRPropertyPtr)xalloc(sizeof(RRPropertyRec));
if (!prop)
return NULL;
@@ -139,7 +139,7 @@ RRChangeOutputProperty (RROutputPtr outp
prop = RRQueryOutputProperty (output, property);
if (!prop) /* just add to list */
{
- prop = RRCreateOutputProperty (property);
+ prop = RRCreateOutputProperty (property);
if (!prop)
return(BadAlloc);
add = TRUE;
@@ -149,11 +149,11 @@ RRChangeOutputProperty (RROutputPtr outp
prop_value = &prop->pending;
else
prop_value = &prop->current;
-
+
/* To append or prepend to a property the request format and type
- must match those of the already defined property. The
- existing format and type are irrelevant when using the mode
- "PropModeReplace" since they will be written over. */
+ must match those of the already defined property. The
+ existing format and type are irrelevant when using the mode
+ "PropModeReplace" since they will be written over. */
if ((format != prop_value->format) && (mode != PropModeReplace))
return(BadMatch);
@@ -167,8 +167,8 @@ RRChangeOutputProperty (RROutputPtr outp
if (mode == PropModeReplace || len > 0)
{
- pointer new_data, old_data;
-
+ pointer new_data = NULL, old_data = NULL;
+
total_size = total_len * size_in_bytes;
new_value.data = (pointer)xalloc (total_size);
if (!new_value.data && total_size)
@@ -197,11 +197,12 @@ RRChangeOutputProperty (RROutputPtr outp
(prop_value->size * size_in_bytes));
break;
}
- memcpy ((char *) new_data, (char *) value, len * size_in_bytes);
+ if (new_data)
+ memcpy ((char *) new_data, (char *) value, len * size_in_bytes);
if (old_data)
memcpy ((char *) old_data, (char *) prop_value->data,
prop_value->size * size_in_bytes);
-
+
if (pending && pScrPriv->rrOutputSetProperty &&
!pScrPriv->rrOutputSetProperty(output->pScreen, output,
prop->propertyName, &new_value))
@@ -214,18 +215,21 @@ RRChangeOutputProperty (RROutputPtr outp
xfree (prop_value->data);
*prop_value = new_value;
}
-
+
else if (len == 0)
{
/* do nothing */
}
-
+
if (add)
{
prop->next = output->properties;
output->properties = prop;
}
+ if (pending && prop->is_pending)
+ output->pendingProperties = TRUE;
+
if (sendevent)
{
event.type = RREventBase + RRNotify;
@@ -240,30 +244,45 @@ RRChangeOutputProperty (RROutputPtr outp
}
Bool
-RRPostPendingProperty (RROutputPtr output, Atom property)
+RRPostPendingProperties (RROutputPtr output)
{
- RRPropertyPtr prop = RRQueryOutputProperty (output, property);
- RRPropertyValuePtr pending_value;
- RRPropertyValuePtr current_value;
-
- if (!prop)
- return FALSE;
- if (!prop->is_pending)
- return FALSE;
- pending_value = &prop->pending;
- current_value = &prop->current;
-
- if (pending_value->type == current_value->type &&
- pending_value->format == current_value->format &&
- pending_value->size == current_value->size &&
- !memcmp (pending_value->data, current_value->data, pending_value->size))
+ RRPropertyValuePtr pending_value;
+ RRPropertyValuePtr current_value;
+ RRPropertyPtr property;
+ Bool ret = TRUE;
+
+ if (!output->pendingProperties)
return TRUE;
- if (RRChangeOutputProperty (output, property,
- pending_value->type, pending_value->format, PropModeReplace,
- pending_value->size, pending_value->data, TRUE, FALSE) != Success)
- return FALSE;
- return TRUE;
+ output->pendingProperties = FALSE;
+ for (property = output->properties; property; property = property->next)
+ {
+ /* Skip non-pending properties */
+ if (!property->is_pending)
+ continue;
+
+ pending_value = &property->pending;
+ current_value = &property->current;
+
+ /*
+ * If the pending and current values are equal, don't mark it
+ * as changed (which would deliver an event)
+ */
+ if (pending_value->type == current_value->type &&
+ pending_value->format == current_value->format &&
+ pending_value->size == current_value->size &&
+ !memcmp (pending_value->data, current_value->data,
+ pending_value->size))
+ continue;
+
+ if (RRChangeOutputProperty (output, property->propertyName,
+ pending_value->type, pending_value->format,
+ PropModeReplace, pending_value->size,
+ pending_value->data, TRUE,
+ FALSE) != Success)
+ ret = FALSE;
+ }
+ return ret;
}
RRPropertyPtr
diff-tree 1f77120775dc05fc84a00dd55190af2fa50ae509 (from 476f2b5aefa518262b69e487555e6094818d857a)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Fri Mar 23 14:39:10 2007 -0700
Ensure that crtc desired values track most recent mode.
desiredX and desiredY were not recorded during xf86InitialConfiguration.
desiredX, desiredY and desiredRotation were not recorded during
xf86SetSingleMode.
(cherry picked from commit 36e5227215e0912ddf8a010db042467f00efe0fc)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 2341715..b9895d9 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1589,6 +1589,8 @@ xf86InitialConfiguration (ScrnInfoPtr sc
{
crtc->desiredMode = *mode;
crtc->desiredRotation = output->initial_rotation;
+ crtc->desiredX = output->initial_x;
+ crtc->desiredY = output->initial_y;
crtc->enabled = TRUE;
crtc->x = output->initial_x;
crtc->y = output->initial_y;
@@ -1813,7 +1815,12 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, Di
if (!xf86CrtcSetMode (crtc, crtc_mode, rotation, 0, 0))
ok = FALSE;
else
+ {
crtc->desiredMode = *crtc_mode;
+ crtc->desiredRotation = rotation;
+ crtc->desiredX = 0;
+ crtc->desiredY = 0;
+ }
}
xf86DisableUnusedFunctions(pScrn);
return ok;
diff-tree 476f2b5aefa518262b69e487555e6094818d857a (from 7093367c3976bef5b9d219d9f2a7dc7dd3eeb091)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Fri Mar 23 01:17:14 2007 -0700
Incorrect extra memory copy in RRChangeOutputProperty.
Left over from previous version of the code, this memmove will break when
the mode is not Replace.
(cherry picked from commit 945aa0aa556429b50dea8e8ebc0008304b093eb7)
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index b0182da..148e4a2 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -177,8 +177,6 @@ RRChangeOutputProperty (RROutputPtr outp
RRDestroyOutputProperty (prop);
return BadAlloc;
}
- if (len)
- memmove((char *)new_value.data, (char *)value, total_size);
new_value.size = len;
new_value.type = type;
new_value.format = format;
diff-tree 7093367c3976bef5b9d219d9f2a7dc7dd3eeb091 (from 86d76390eb182f271f5fa5dc19205e97a867f7e7)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Fri Mar 23 01:05:55 2007 -0700
Fix Pending property API, adding RRPostPendingProperty.
Pending Properties take effect when the driver says they do, so provide an
API to tell DIX when a property effect is made. Also, allow driver
to reject property values in RRChangeOutputProperty.
(cherry picked from commit 8eb288fbd69e2ffd02521d2c6a964c8180d08ec8)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index fad0752..2341715 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1923,7 +1923,7 @@ xf86OutputSetEDIDProperty (xf86OutputPtr
if (data_len != 0) {
RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8,
- PropModeReplace, data_len, data, FALSE);
+ PropModeReplace, data_len, data, FALSE, TRUE);
} else {
RRDeleteOutputProperty(output->randr_output, edid_atom);
}
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 0dee999..9f039f7 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -761,10 +761,13 @@ RRQueryOutputProperty (RROutputPtr outpu
void
RRDeleteOutputProperty (RROutputPtr output, Atom property);
+Bool
+RRPostPendingProperty (RROutputPtr output, Atom property);
+
int
RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
int format, int mode, unsigned long len,
- pointer value, Bool sendevent);
+ pointer value, Bool sendevent, Bool pending);
int
RRConfigureOutputProperty (RROutputPtr output, Atom property,
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index edfed1f..b0182da 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -121,19 +121,19 @@ RRDeleteOutputProperty (RROutputPtr outp
int
RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
int format, int mode, unsigned long len,
- pointer value, Bool sendevent)
+ pointer value, Bool sendevent, Bool pending)
{
RRPropertyPtr prop;
xRROutputPropertyNotifyEvent event;
rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen);
- int sizeInBytes;
- int totalSize;
- pointer data;
+ int size_in_bytes;
+ int total_size;
+ unsigned long total_len;
RRPropertyValuePtr prop_value;
+ RRPropertyValueRec new_value;
Bool add = FALSE;
- sizeInBytes = format >> 3;
- totalSize = len * sizeInBytes;
+ size_in_bytes = format >> 3;
/* first see if property already exists */
prop = RRQueryOutputProperty (output, property);
@@ -145,7 +145,7 @@ RRChangeOutputProperty (RROutputPtr outp
add = TRUE;
mode = PropModeReplace;
}
- if (prop->is_pending)
+ if (pending && prop->is_pending)
prop_value = &prop->pending;
else
prop_value = &prop->current;
@@ -159,68 +159,75 @@ RRChangeOutputProperty (RROutputPtr outp
return(BadMatch);
if ((prop_value->type != type) && (mode != PropModeReplace))
return(BadMatch);
+ new_value = *prop_value;
if (mode == PropModeReplace)
+ total_len = len;
+ else
+ total_len = prop_value->size + len;
+
+ if (mode == PropModeReplace || len > 0)
{
- if (totalSize != prop_value->size * (prop_value->format >> 3))
+ pointer new_data, old_data;
+
+ total_size = total_len * size_in_bytes;
+ new_value.data = (pointer)xalloc (total_size);
+ if (!new_value.data && total_size)
{
- if (prop_value->data)
- data = (pointer)xrealloc(prop_value->data, totalSize);
- else
- data = (pointer)xalloc (totalSize);
- if (!data && len)
- {
- if (add)
- RRDestroyOutputProperty (prop);
- return(BadAlloc);
- }
- prop_value->data = data;
+ if (add)
+ RRDestroyOutputProperty (prop);
+ return BadAlloc;
}
if (len)
- memmove((char *)prop_value->data, (char *)value, totalSize);
- prop_value->size = len;
- prop_value->type = type;
- prop_value->format = format;
+ memmove((char *)new_value.data, (char *)value, total_size);
+ new_value.size = len;
+ new_value.type = type;
+ new_value.format = format;
+
+ switch (mode) {
+ case PropModeReplace:
+ new_data = new_value.data;
+ old_data = NULL;
+ break;
+ case PropModeAppend:
+ new_data = (pointer) (((char *) new_value.data) +
+ (prop_value->size * size_in_bytes));
+ old_data = new_value.data;
+ break;
+ case PropModePrepend:
+ new_data = new_value.data;
+ old_data = (pointer) (((char *) new_value.data) +
+ (prop_value->size * size_in_bytes));
+ break;
+ }
+ memcpy ((char *) new_data, (char *) value, len * size_in_bytes);
+ if (old_data)
+ memcpy ((char *) old_data, (char *) prop_value->data,
+ prop_value->size * size_in_bytes);
+
+ if (pending && pScrPriv->rrOutputSetProperty &&
+ !pScrPriv->rrOutputSetProperty(output->pScreen, output,
+ prop->propertyName, &new_value))
+ {
+ if (new_value.data)
+ xfree (new_value.data);
+ return (BadValue);
+ }
+ if (prop_value->data)
+ xfree (prop_value->data);
+ *prop_value = new_value;
}
+
else if (len == 0)
{
/* do nothing */
}
- else if (mode == PropModeAppend)
- {
- data = (pointer)xrealloc(prop_value->data,
- sizeInBytes * (len + prop_value->size));
- if (!data)
- return(BadAlloc);
- prop_value->data = data;
- memmove(&((char *)data)[prop_value->size * sizeInBytes],
- (char *)value,
- totalSize);
- prop_value->size += len;
- }
- else if (mode == PropModePrepend)
- {
- data = (pointer)xalloc(sizeInBytes * (len + prop_value->size));
- if (!data)
- return(BadAlloc);
- memmove(&((char *)data)[totalSize], (char *)prop_value->data,
- (int)(prop_value->size * sizeInBytes));
- memmove((char *)data, (char *)value, totalSize);
- xfree(prop_value->data);
- prop_value->data = data;
- prop_value->size += len;
- }
+
if (add)
{
prop->next = output->properties;
output->properties = prop;
}
- if (!prop->is_pending) {
- /* What should we do in case of failure? */
- pScrPriv->rrOutputSetProperty(output->pScreen, output,
- prop->propertyName, prop_value);
- }
-
if (sendevent)
{
event.type = RREventBase + RRNotify;
@@ -234,6 +241,33 @@ RRChangeOutputProperty (RROutputPtr outp
return(Success);
}
+Bool
+RRPostPendingProperty (RROutputPtr output, Atom property)
+{
+ RRPropertyPtr prop = RRQueryOutputProperty (output, property);
+ RRPropertyValuePtr pending_value;
+ RRPropertyValuePtr current_value;
+
+ if (!prop)
+ return FALSE;
+ if (!prop->is_pending)
+ return FALSE;
+ pending_value = &prop->pending;
+ current_value = &prop->current;
+
+ if (pending_value->type == current_value->type &&
+ pending_value->format == current_value->format &&
+ pending_value->size == current_value->size &&
+ !memcmp (pending_value->data, current_value->data, pending_value->size))
+ return TRUE;
+
+ if (RRChangeOutputProperty (output, property,
+ pending_value->type, pending_value->format, PropModeReplace,
+ pending_value->size, pending_value->data, TRUE, FALSE) != Success)
+ return FALSE;
+ return TRUE;
+}
+
RRPropertyPtr
RRQueryOutputProperty (RROutputPtr output, Atom property)
{
@@ -474,7 +508,7 @@ ProcRRChangeOutputProperty (ClientPtr cl
err = RRChangeOutputProperty(output, stuff->property,
stuff->type, (int)format,
- (int)mode, len, (pointer)&stuff[1], TRUE);
+ (int)mode, len, (pointer)&stuff[1], TRUE, TRUE);
if (err != Success)
return err;
else
@@ -508,8 +542,8 @@ int
ProcRRGetOutputProperty (ClientPtr client)
{
REQUEST(xRRGetOutputPropertyReq);
- RRPropertyPtr prop, *prev;
- RRPropertyValuePtr prop_value;
+ RRPropertyPtr prop, *prev;
+ RRPropertyValuePtr prop_value;
unsigned long n, len, ind;
RROutputPtr output;
xRRGetOutputPropertyReply reply;
@@ -600,7 +634,10 @@ ProcRRGetOutputProperty (ClientPtr clien
reply.bytesAfter = n - (ind + len);
reply.format = prop_value->format;
reply.length = (len + 3) >> 2;
- reply.nItems = len / (prop_value->format / 8 );
+ if (prop_value->format)
+ reply.nItems = len / (prop_value->format / 8);
+ else
+ reply.nItems = 0;
reply.propertyType = prop_value->type;
if (stuff->delete && (reply.bytesAfter == 0))
diff-tree 86d76390eb182f271f5fa5dc19205e97a867f7e7 (from 510eaa346e68fd82c852c7b41fb0e2c5be12da78)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Fri Mar 23 01:03:40 2007 -0700
Make sure RandR events are delivered from RRCrtcSet.
Some paths were skipping the event delivery stage.
(cherry picked from commit 9ca7ba5d6012295a77ed773c656e786440da973d)
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index ecf5bb2..7131dfb 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -262,6 +262,8 @@ RRCrtcSet (RRCrtcPtr crtc,
RROutputPtr *outputs)
{
ScreenPtr pScreen = crtc->pScreen;
+ Bool ret = FALSE;
+ rrScrPriv(pScreen);
/* See if nothing changed */
if (crtc->mode == mode &&
@@ -271,61 +273,64 @@ RRCrtcSet (RRCrtcPtr crtc,
crtc->numOutputs == numOutputs &&
!memcmp (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)))
{
- return TRUE;
+ ret = TRUE;
}
- if (pScreen)
+ else
{
#if RANDR_12_INTERFACE
- rrScrPriv(pScreen);
if (pScrPriv->rrCrtcSet)
{
- return (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y,
- rotation, numOutputs, outputs);
+ ret = (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y,
+ rotation, numOutputs, outputs);
}
+ else
#endif
-#if RANDR_10_INTERFACE
- if (pScrPriv->rrSetConfig)
{
- RRScreenSize size;
- RRScreenRate rate;
- Bool ret;
-
- if (!mode)
+#if RANDR_10_INTERFACE
+ if (pScrPriv->rrSetConfig)
{
- RRCrtcNotify (crtc, NULL, x, y, rotation, 0, NULL);
- return TRUE;
- }
+ RRScreenSize size;
+ RRScreenRate rate;
- size.width = mode->mode.width;
- size.height = mode->mode.height;
- if (outputs[0]->mmWidth && outputs[0]->mmHeight)
- {
- size.mmWidth = outputs[0]->mmWidth;
- size.mmHeight = outputs[0]->mmHeight;
+ if (!mode)
+ {
+ RRCrtcNotify (crtc, NULL, x, y, rotation, 0, NULL);
+ ret = TRUE;
+ }
+ else
+ {
+ size.width = mode->mode.width;
+ size.height = mode->mode.height;
+ if (outputs[0]->mmWidth && outputs[0]->mmHeight)
+ {
+ size.mmWidth = outputs[0]->mmWidth;
+ size.mmHeight = outputs[0]->mmHeight;
+ }
+ else
+ {
+ size.mmWidth = pScreen->mmWidth;
+ size.mmHeight = pScreen->mmHeight;
+ }
+ size.nRates = 1;
+ rate.rate = RRVerticalRefresh (&mode->mode);
+ size.pRates = &rate;
+ ret = (*pScrPriv->rrSetConfig) (pScreen, rotation, rate.rate, &size);
+ /*
+ * Old 1.0 interface tied screen size to mode size
+ */
+ if (ret)
+ {
+ RRCrtcNotify (crtc, mode, x, y, rotation, 1, outputs);
+ RRScreenSizeNotify (pScreen);
+ }
+ }
}
- else
- {
- size.mmWidth = pScreen->mmWidth;
- size.mmHeight = pScreen->mmHeight;
- }
- size.nRates = 1;
- rate.rate = RRVerticalRefresh (&mode->mode);
- size.pRates = &rate;
- ret = (*pScrPriv->rrSetConfig) (pScreen, rotation, rate.rate, &size);
- /*
- * Old 1.0 interface tied screen size to mode size
- */
- if (ret)
- {
- RRCrtcNotify (crtc, mode, x, y, rotation, 1, outputs);
- RRScreenSizeNotify (pScreen);
- }
- return ret;
- }
#endif
- RRTellChanged (pScreen);
+ }
+ if (ret)
+ RRTellChanged (pScreen);
}
- return FALSE;
+ return ret;
}
/*
@@ -718,6 +723,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
goto sendReply;
}
+#if 0
/*
* if the client's config timestamp is not the same as the last config
* timestamp, then the config information isn't up-to-date and
@@ -728,6 +734,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
rep.status = RRSetConfigInvalidConfigTime;
goto sendReply;
}
+#endif
/*
* Validate requested rotation
diff-tree 510eaa346e68fd82c852c7b41fb0e2c5be12da78 (from 479b2be4badab0a67b1f091feb83c1364e27d783)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Fri Mar 23 00:59:11 2007 -0700
Clean up xf86CrtcRec and xf86OutputRec objects at CloseScreen.
Erase pointers to structures which are freed at server reset time.
(cherry picked from commit 492c768065f49306a2194a88edf96b85de0ff4ff)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index a875cdf..fad0752 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -573,11 +573,25 @@ xf86CrtcCloseScreen (int index, ScreenPt
{
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o, c;
screen->CloseScreen = config->CloseScreen;
xf86RotateCloseScreen (screen);
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ output->crtc = NULL;
+ output->randr_output = NULL;
+ }
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+
+ crtc->randr_crtc = NULL;
+ }
return screen->CloseScreen (index, screen);
}
diff-tree 479b2be4badab0a67b1f091feb83c1364e27d783 (from b63e0d2545bb75e14d9de019a88f31e20a2f7377)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Fri Mar 23 00:57:18 2007 -0700
Clear allocated RandR screen private structure.
Use xcalloc instead of xalloc when allocating this structure to ensure
consistent contents at startup.
(cherry picked from commit 16f4c0c1750824f2e5a001cef82a4122a7a2beb0)
diff --git a/randr/randr.c b/randr/randr.c
index 5fa9baf..4dd0ee5 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -230,7 +230,7 @@ Bool RRScreenInit(ScreenPtr pScreen)
RRScreenGeneration = serverGeneration;
}
- pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec));
+ pScrPriv = (rrScrPrivPtr) xcalloc (1, sizeof (rrScrPrivRec));
if (!pScrPriv)
return FALSE;
diff-tree b63e0d2545bb75e14d9de019a88f31e20a2f7377 (from 3e9f7a5504ab41d845e88f293d8498c963d8a7d8)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Tue Mar 20 07:17:27 2007 -0700
Clean up Rotate state on server reset.
The rotation state is stored in the xf86_config structure which is not
re-initialized at server reset time. Clean it up at CloseScreen time.
(cherry picked from commit f8db7665dcd7af78ca4db2461e0bf787ec662cb1)
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index bc7c814..5175f01 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -1170,6 +1170,7 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMVAR(pciNumBuses)
/* modes */
+ SYMVAR(xf86CrtcConfigPrivateIndex)
SYMFUNC(xf86CrtcConfigInit)
SYMFUNC(xf86CrtcConfigPrivateIndex)
SYMFUNC(xf86CrtcCreate)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 1a42920..a875cdf 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -566,6 +566,22 @@ xf86CrtcCreateScreenResources (ScreenPtr
}
/*
+ * Clean up config on server reset
+ */
+static Bool
+xf86CrtcCloseScreen (int index, ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ screen->CloseScreen = config->CloseScreen;
+
+ xf86RotateCloseScreen (screen);
+
+ return screen->CloseScreen (index, screen);
+}
+
+/*
* Called at ScreenInit time to set up
*/
Bool
@@ -596,6 +612,10 @@ xf86CrtcScreenInit (ScreenPtr screen)
/* Wrap CreateScreenResources so we can initialize the RandR code */
config->CreateScreenResources = screen->CreateScreenResources;
screen->CreateScreenResources = xf86CrtcCreateScreenResources;
+
+ config->CloseScreen = screen->CloseScreen;
+ screen->CloseScreen = xf86CrtcCloseScreen;
+
return TRUE;
}
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index b751592..42daf60 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -544,6 +544,8 @@ typedef struct _xf86CrtcConfig {
CreateScreenResourcesProcPtr CreateScreenResources;
+ CloseScreenProcPtr CloseScreen;
+
/* Cursor information */
xf86CursorInfoPtr cursor_info;
CursorPtr cursor;
@@ -593,6 +595,12 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, Displ
Bool
xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation);
+/*
+ * Clean up rotation during CloseScreen
+ */
+void
+xf86RotateCloseScreen (ScreenPtr pScreen);
+
/**
* Return whether any output is assigned to the crtc
*/
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index e82b69e..e8fafd0 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -321,36 +321,68 @@ xf86RotateWakeupHandler(pointer data, in
{
}
-Bool
-xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
+static void
+xf86RotateDestroy (xf86CrtcPtr crtc)
{
ScrnInfoPtr pScrn = crtc->scrn;
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
ScreenPtr pScreen = pScrn->pScreen;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int c;
- if (rotation == RR_Rotate_0)
+ /* Free memory from rotation */
+ if (crtc->rotatedPixmap || crtc->rotatedData)
{
- /* Free memory from rotation */
+ crtc->funcs->shadow_destroy (crtc, crtc->rotatedPixmap, crtc->rotatedData);
+ crtc->rotatedPixmap = NULL;
+ crtc->rotatedData = NULL;
+ }
+
+ for (c = 0; c < xf86_config->num_crtc; c++)
if (crtc->rotatedPixmap || crtc->rotatedData)
- {
- crtc->funcs->shadow_destroy (crtc, crtc->rotatedPixmap, crtc->rotatedData);
- crtc->rotatedPixmap = NULL;
- crtc->rotatedData = NULL;
- }
+ return;
- if (xf86_config->rotation_damage)
+ /*
+ * Clean up damage structures when no crtcs are rotated
+ */
+ if (xf86_config->rotation_damage)
+ {
+ /* Free damage structure */
+ if (xf86_config->rotation_damage_registered)
{
- /* Free damage structure */
DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = FALSE;
- DamageDestroy (xf86_config->rotation_damage);
- xf86_config->rotation_damage = NULL;
- /* Free block/wakeup handler */
- RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
- xf86RotateWakeupHandler,
- (pointer) pScreen);
}
+ DamageDestroy (xf86_config->rotation_damage);
+ xf86_config->rotation_damage = NULL;
+ /* Free block/wakeup handler */
+ RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
+ xf86RotateWakeupHandler,
+ (pointer) pScreen);
+ }
+}
+
+void
+xf86RotateCloseScreen (ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c;
+
+ for (c = 0; c < xf86_config->num_crtc; c++)
+ xf86RotateDestroy (xf86_config->crtc[c]);
+}
+
+Bool
+xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
+{
+ ScrnInfoPtr pScrn = crtc->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ ScreenPtr pScreen = pScrn->pScreen;
+
+ if (rotation == RR_Rotate_0)
+ {
+ xf86RotateDestroy (crtc);
}
else
{
diff-tree 3e9f7a5504ab41d845e88f293d8498c963d8a7d8 (from f292de2ef13dc994a38029cee9e2642576893332)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Mar 21 02:35:31 2007 +0200
XFree86 DGA: Guard against NULL pointer dereferences.
Ass, u, me ...
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index c9c8059..17ffed8 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -423,17 +423,19 @@ xf86PostMotionEvent(DeviceIntPtr device,
#if XFreeXDGA
if (first_valuator == 0 && num_valuators >= 2) {
- index = miPointerGetScreen(inputInfo.pointer)->myNum;
- if (is_absolute) {
- dx = valuators[0] - device->valuator->lastx;
- dy = valuators[1] - device->valuator->lasty;
- }
- else {
- dx = valuators[0];
- dy = valuators[1];
+ if (miPointerGetScreen(inputInfo.pointer)) {
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (is_absolute) {
+ dx = valuators[0] - device->valuator->lastx;
+ dy = valuators[1] - device->valuator->lasty;
+ }
+ else {
+ dx = valuators[0];
+ dy = valuators[1];
+ }
+ if (DGAStealMotionEvent(index, dx, dy))
+ goto out;
}
- if (DGAStealMotionEvent(index, dx, dy))
- goto out;
}
#endif
@@ -505,9 +507,11 @@ xf86PostButtonEvent(DeviceIntPtr device,
int index;
#if XFreeXDGA
- index = miPointerGetScreen(inputInfo.pointer)->myNum;
- if (DGAStealButtonEvent(index, button, is_down))
- return;
+ if (miPointerGetScreen(inputInfo.pointer)) {
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (DGAStealButtonEvent(index, button, is_down))
+ return;
+ }
#endif
valuators = xcalloc(sizeof(int), num_valuators);
@@ -588,9 +592,11 @@ xf86PostKeyboardEvent(DeviceIntPtr
int index;
#if XFreeXDGA
- index = miPointerGetScreen(inputInfo.pointer)->myNum;
- if (DGAStealKeyEvent(index, key_code, is_down))
- return;
+ if (miPointerGetScreen(inputInfo.pointer)) {
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (DGAStealKeyEvent(index, key_code, is_down))
+ return;
+ }
#endif
if (!xf86Events)
diff-tree f292de2ef13dc994a38029cee9e2642576893332 (from f34b9a20b0181d3c2641c305e91180711afbd4b9)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Mar 21 02:04:12 2007 +0200
XKB: Fix size_syms calculation bug
Apparently it needed to be nSyms*15/10, not *12/10; make it match the
other allocation code.
diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c
index 4b7428b..9feaf8e 100644
--- a/xkb/XKBMAlloc.c
+++ b/xkb/XKBMAlloc.c
@@ -399,7 +399,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nM
}
if (nResize>0) {
int nextMatch;
- xkb->map->size_syms= (nTotal*12)/10;
+ xkb->map->size_syms= (nTotal*15)/10;
newSyms = _XkbTypedCalloc(xkb->map->size_syms,KeySym);
if (newSyms==NULL)
return BadAlloc;
diff-tree f34b9a20b0181d3c2641c305e91180711afbd4b9 (from 021fc5cb2cb4a7972b4a6fcb570c1da92787d68d)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Mar 21 02:03:37 2007 +0200
XKB: Be a tiny bit more conservative with type allocation
Make sure size_types will _always_ be 0 if we don't have any types.
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 1d23667..bb6d8a0 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -1140,6 +1140,9 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr
dtype->preserve = NULL;
}
}
+
+ dst->map->size_types = src->map->num_types;
+ dst->map->num_types = src->map->num_types;
}
else {
if (dst->map->types) {
@@ -1155,9 +1158,9 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr
xfree(dst->map->types);
dst->map->types = NULL;
}
+ dst->map->num_types = 0;
+ dst->map->size_types = 0;
}
- dst->map->size_types = src->map->num_types;
- dst->map->num_types = src->map->num_types;
if (src->map->modmap) {
if (src->max_key_code != dst->max_key_code) {
diff-tree 021fc5cb2cb4a7972b4a6fcb570c1da92787d68d (from 9398d62f27ee1b287e4458fd8b011c10f7b59efd)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date: Sun Mar 18 16:31:19 2007 -0400
Static markup and dead code cull over xkb/.
The former <X11/extensions/XKBsrv.h> has been pulled into the server now as
include/xkbsrv.h, and the world updated to look for it in the new place,
since it made no sense to define server API in an extension header. Any
further work along this line will need to do similar things with XKBgeom.h
and friends.
diff --git a/Xext/xevie.c b/Xext/xevie.c
index e979e7e..2fd68f8 100644
--- a/Xext/xevie.c
+++ b/Xext/xevie.c
@@ -52,7 +52,7 @@ of the copyright holder.
#include "inputstr.h"
#include "windowstr.h"
#include "cursorstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include "../os/osdep.h"
diff --git a/dix/devices.c b/dix/devices.c
index 8eb54f7..f738419 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -67,7 +67,7 @@ SOFTWARE.
#define XKB_IN_SERVER
#endif
#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#include "xace.h"
diff --git a/dix/dispatch.c b/dix/dispatch.c
index b258aa6..32f6788 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -143,7 +143,7 @@ int ProcInitialConnection();
#define XKB_IN_SERVER
#endif
#include "inputstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#ifdef XSERVER_DTRACE
diff --git a/dix/events.c b/dix/events.c
index c0b62b8..02598a3 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -133,7 +133,7 @@ of the copyright holder.
#ifdef XKB
#include <X11/extensions/XKBproto.h>
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
#endif
diff --git a/dix/getevents.c b/dix/getevents.c
index 935112d..3f636bc 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -44,7 +44,7 @@
#ifdef XKB
#include <X11/extensions/XKBproto.h>
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies);
#endif
diff --git a/hw/dmx/dmxclient.h b/hw/dmx/dmxclient.h
index 586b829..657a127 100644
--- a/hw/dmx/dmxclient.h
+++ b/hw/dmx/dmxclient.h
@@ -126,7 +126,7 @@ typedef XID KeySym64;
#undef KeySym
#endif
-/* These are in exglobals.h, but that conflicts with X11/extensions/XKBsrv.h */
+/* These are in exglobals.h, but that conflicts with xkbsrv.h */
extern int ProximityIn;
extern int ProximityOut;
extern int DeviceValuator;
@@ -144,7 +144,7 @@ extern int ChangeDeviceNotify;
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#undef XPointer
#endif
#include <X11/extensions/XIproto.h>
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 3bf6bad..857f04f 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -42,7 +42,7 @@
#endif
#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#include <X11/extensions/XI.h>
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index c0e21dd..1bd3c62 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -75,7 +75,7 @@ extern DeviceAssocRec mouse_assoc;
#ifdef XKB
#undef XKB_IN_SERVER
#define XKB_IN_SERVER
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#ifdef RENDER
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 28058b5..43db1ee 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -43,7 +43,7 @@
#include "servermd.h"
#include "micmap.h"
#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#include "xf86Xinput.h"
diff --git a/hw/xfree86/common/xf86XKB.c b/hw/xfree86/common/xf86XKB.c
index 399eb02..b805885 100644
--- a/hw/xfree86/common/xf86XKB.c
+++ b/hw/xfree86/common/xf86XKB.c
@@ -73,7 +73,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XF86_OS_PRIVS
#include "xf86_OSlib.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
void
xf86InitXkb(void)
diff --git a/hw/xfree86/dixmods/xkbKillSrv.c b/hw/xfree86/dixmods/xkbKillSrv.c
index 415873a..b3399db 100644
--- a/hw/xfree86/dixmods/xkbKillSrv.c
+++ b/hw/xfree86/dixmods/xkbKillSrv.c
@@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
#include "xf86.h"
diff --git a/hw/xfree86/dixmods/xkbPrivate.c b/hw/xfree86/dixmods/xkbPrivate.c
index e6d4f0f..e0cd217 100644
--- a/hw/xfree86/dixmods/xkbPrivate.c
+++ b/hw/xfree86/dixmods/xkbPrivate.c
@@ -12,7 +12,7 @@
#include <X11/X.h>
#include "windowstr.h"
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include "xf86.h"
diff --git a/hw/xfree86/dixmods/xkbVT.c b/hw/xfree86/dixmods/xkbVT.c
index a1cdc70..e6d69e2 100644
--- a/hw/xfree86/dixmods/xkbVT.c
+++ b/hw/xfree86/dixmods/xkbVT.c
@@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
#include "xf86.h"
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index 594bf43..5d06b05 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -86,7 +86,7 @@
#endif
#include "selection.h"
#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
extern int XkbDfltRepeatDelay, XkbDfltRepeatInterval;
#endif
diff --git a/hw/xgl/egl/kinput.c b/hw/xgl/egl/kinput.c
index b374bf5..5fd23f5 100644
--- a/hw/xgl/egl/kinput.c
+++ b/hw/xgl/egl/kinput.c
@@ -41,7 +41,7 @@
#ifdef XKB
#define XKB_IN_SERVER
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
static DeviceIntPtr pKdKeyboard, pKdPointer;
diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c
index 57cb847..92974f0 100644
--- a/hw/xgl/glx/xglx.c
+++ b/hw/xgl/glx/xglx.c
@@ -50,7 +50,7 @@
#ifdef XKB
#include <X11/extensions/XKB.h>
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBconfig.h>
extern Bool
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index 0dacae7..bb3cb13 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -36,7 +36,7 @@ is" without express or implied warranty.
#ifdef XKB
#include <X11/extensions/XKB.h>
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBconfig.h>
extern Bool
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 39a5eda..9457c9c 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -44,7 +44,7 @@ from The Open Group.
#include <mntent.h>
#endif
#if defined(XKB) && defined(WIN32)
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#ifdef RELOCATE_PROJECTROOT
#include <shlobj.h>
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index e3d1808..2c18771 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -40,7 +40,7 @@
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#ifdef XWIN_XF86CONFIG
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 164e391..d574f20 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -44,7 +44,7 @@
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
#endif
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
static Bool g_winKeyState[NUM_KEYCODES];
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
new file mode 100644
index 0000000..5edee53
--- /dev/null
+++ b/include/xkbsrv.h
@@ -0,0 +1,1022 @@
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+#ifndef _XKBSRV_H_
+#define _XKBSRV_H_
+
+#ifdef XKB_IN_SERVER
+#define XkbAllocClientMap SrvXkbAllocClientMap
+#define XkbAllocServerMap SrvXkbAllocServerMap
+#define XkbChangeTypesOfKey SrvXkbChangeTypesOfKey
+#define XkbCopyKeyTypes SrvXkbCopyKeyTypes
+#define XkbFreeClientMap SrvXkbFreeClientMap
+#define XkbFreeServerMap SrvXkbFreeServerMap
+#define XkbKeyTypesForCoreSymbols SrvXkbKeyTypesForCoreSymbols
+#define XkbApplyCompatMapToKey SrvXkbApplyCompatMapToKey
+#define XkbResizeKeyActions SrvXkbResizeKeyActions
+#define XkbResizeKeySyms SrvXkbResizeKeySyms
+#define XkbResizeKeyType SrvXkbResizeKeyType
+#define XkbAllocCompatMap SrvXkbAllocCompatMap
+#define XkbAllocControls SrvXkbAllocControls
+#define XkbAllocIndicatorMaps SrvXkbAllocIndicatorMaps
+#define XkbAllocKeyboard SrvXkbAllocKeyboard
+#define XkbAllocNames SrvXkbAllocNames
+#define XkbFreeCompatMap SrvXkbFreeCompatMap
+#define XkbFreeKeyboard SrvXkbFreeKeyboard
+#define XkbFreeNames SrvXkbFreeNames
+#define XkbLatchModifiers SrvXkbLatchModifiers
+#define XkbLatchGroup SrvXkbLatchGroup
+#define XkbVirtualModsToReal SrvXkbVirtualModsToReal
+#define XkbChangeKeycodeRange SrvXkbChangeKeycodeRange
+#define XkbApplyVirtualModChanges SrvXkbApplyVirtualModChanges
+#endif
+
+#include <X11/extensions/XKBstr.h>
+#include <X11/extensions/XKBproto.h>
+#include "inputstr.h"
+
+typedef struct _XkbInterest {
+ DeviceIntPtr dev;
+ ClientPtr client;
+ XID resource;
+ struct _XkbInterest * next;
+ CARD16 extDevNotifyMask;
+ CARD16 stateNotifyMask;
+ CARD16 namesNotifyMask;
+ CARD32 ctrlsNotifyMask;
+ CARD8 compatNotifyMask;
+ BOOL bellNotifyMask;
+ BOOL actionMessageMask;
+ CARD16 accessXNotifyMask;
+ CARD32 iStateNotifyMask;
+ CARD32 iMapNotifyMask;
+ CARD16 altSymsNotifyMask;
+ CARD32 autoCtrls;
+ CARD32 autoCtrlValues;
+} XkbInterestRec,*XkbInterestPtr;
+
+typedef struct _XkbRadioGroup {
+ CARD8 flags;
+ CARD8 nMembers;
+ CARD8 dfltDown;
+ CARD8 currentDown;
+ CARD8 members[XkbRGMaxMembers];
+} XkbRadioGroupRec, *XkbRadioGroupPtr;
+
+typedef struct _XkbEventCause {
+ CARD8 kc;
+ CARD8 event;
+ CARD8 mjr;
+ CARD8 mnr;
+ ClientPtr client;
+} XkbEventCauseRec,*XkbEventCausePtr;
+#define XkbSetCauseKey(c,k,e) { (c)->kc= (k),(c)->event= (e),\
+ (c)->mjr= (c)->mnr= 0; \
+ (c)->client= NULL; }
+#define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\
+ (c)->mjr= (j),(c)->mnr= (n);\
+ (c)->client= (cl); }
+#define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl)
+#define XkbSetCauseXkbReq(c,e,cl) XkbSetCauseReq(c,XkbReqCode,e,cl)
+#define XkbSetCauseUnknown(c) XkbSetCauseKey(c,0,0)
+
+#define _OFF_TIMER 0
+#define _KRG_WARN_TIMER 1
+#define _KRG_TIMER 2
+#define _SK_TIMEOUT_TIMER 3
+#define _ALL_TIMEOUT_TIMER 4
+
+#define _BEEP_NONE 0
+#define _BEEP_FEATURE_ON 1
+#define _BEEP_FEATURE_OFF 2
+#define _BEEP_FEATURE_CHANGE 3
+#define _BEEP_SLOW_WARN 4
+#define _BEEP_SLOW_PRESS 5
+#define _BEEP_SLOW_ACCEPT 6
+#define _BEEP_SLOW_REJECT 7
+#define _BEEP_SLOW_RELEASE 8
+#define _BEEP_STICKY_LATCH 9
+#define _BEEP_STICKY_LOCK 10
+#define _BEEP_STICKY_UNLOCK 11
+#define _BEEP_LED_ON 12
+#define _BEEP_LED_OFF 13
+#define _BEEP_LED_CHANGE 14
+#define _BEEP_BOUNCE_REJECT 15
+
+typedef struct _XkbSrvInfo {
+ XkbStateRec prev_state;
+ XkbStateRec state;
+ XkbDescPtr desc;
+
+ DeviceIntPtr device;
+ KbdCtrlProcPtr kbdProc;
+
+ XkbRadioGroupPtr radioGroups;
+ CARD8 nRadioGroups;
+ CARD8 clearMods;
+ CARD8 setMods;
+ INT16 groupChange;
+
+ CARD16 dfltPtrDelta;
+
+ double mouseKeysCurve;
+ double mouseKeysCurveFactor;
+ INT16 mouseKeysDX;
+ INT16 mouseKeysDY;
+ CARD8 mouseKeysFlags;
+ Bool mouseKeysAccel;
+ CARD8 mouseKeysCounter;
+
+ CARD8 lockedPtrButtons;
+ CARD8 shiftKeyCount;
+ KeyCode mouseKey;
+ KeyCode inactiveKey;
+ KeyCode slowKey;
+ KeyCode repeatKey;
+ CARD8 krgTimerActive;
+ CARD8 beepType;
+ CARD8 beepCount;
+
+ CARD32 flags;
+ CARD32 lastPtrEventTime;
+ CARD32 lastShiftEventTime;
+ OsTimerPtr beepTimer;
+ OsTimerPtr mouseKeyTimer;
+ OsTimerPtr slowKeysTimer;
+ OsTimerPtr bounceKeysTimer;
+ OsTimerPtr repeatKeyTimer;
+ OsTimerPtr krgTimer;
+} XkbSrvInfoRec, *XkbSrvInfoPtr;
+
+#define XkbSLI_IsDefault (1L<<0)
+#define XkbSLI_HasOwnState (1L<<1)
+
+typedef struct _XkbSrvLedInfo {
+ CARD16 flags;
+ CARD16 class;
+ CARD16 id;
+ union {
+ KbdFeedbackPtr kf;
+ LedFeedbackPtr lf;
+ } fb;
+
+ CARD32 physIndicators;
+ CARD32 autoState;
+ CARD32 explicitState;
+ CARD32 effectiveState;
+
+ CARD32 mapsPresent;
+ CARD32 namesPresent;
+ XkbIndicatorMapPtr maps;
+ Atom * names;
+
+ CARD32 usesBase;
+ CARD32 usesLatched;
+ CARD32 usesLocked;
+ CARD32 usesEffective;
+ CARD32 usesCompat;
+ CARD32 usesControls;
+
+ CARD32 usedComponents;
+} XkbSrvLedInfoRec, *XkbSrvLedInfoPtr;
+
+/*
+ * Settings for xkbClientFlags field (used by DIX)
+ * These flags _must_ not overlap with XkbPCF_*
+ */
+#define _XkbClientInitialized (1<<15)
+
+#define _XkbWantsDetectableAutoRepeat(c)\
+ ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask)
+
+/*
+ * Settings for flags field
+ */
+#define _XkbStateNotifyInProgress (1<<0)
+
+typedef struct
+{
+ ProcessInputProc processInputProc;
+ ProcessInputProc realInputProc;
+ DeviceUnwrapProc unwrapProc;
+} xkbDeviceInfoRec, *xkbDeviceInfoPtr;
+
+#define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
+ device->public.processInputProc = proc; \
+ oldprocs->processInputProc = \
+ oldprocs->realInputProc = device->public.realInputProc; \
+ device->public.realInputProc = proc; \
+ oldprocs->unwrapProc = device->unwrapProc; \
+ device->unwrapProc = unwrapproc;
+
+#define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
+ if (device->public.processInputProc == device->public.realInputProc)\
+ device->public.processInputProc = proc; \
+ oldprocs->processInputProc = \
+ oldprocs->realInputProc = device->public.realInputProc; \
+ device->public.realInputProc = proc; \
+ oldprocs->unwrapProc = device->unwrapProc; \
+ device->unwrapProc = unwrapproc;
+
+#define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \
+ device->public.processInputProc = oldprocs->processInputProc; \
+ device->public.realInputProc = oldprocs->realInputProc; \
+ device->unwrapProc = oldprocs->unwrapProc;
+
+#define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr)
+
+/***====================================================================***/
+
+
+/***====================================================================***/
+
+#define XkbAX_KRGMask (XkbSlowKeysMask|XkbBounceKeysMask)
+#define XkbAllFilteredEventsMask \
+ (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask)
+
+/***====================================================================***/
+
+extern int XkbReqCode;
+extern int XkbEventBase;
+extern int XkbDisableLockActions;
+extern char * XkbBaseDirectory;
+extern char * XkbBinDirectory;
+extern char * XkbInitialMap;
+extern unsigned int XkbXIUnsupported;
+
+extern Bool noXkbExtension;
+
+extern pointer XkbLastRepeatEvent;
+
+extern CARD32 xkbDebugFlags;
+
+#define _XkbAlloc(s) xalloc((s))
+#define _XkbCalloc(n,s) Xcalloc((n)*(s))
+#define _XkbRealloc(o,s) Xrealloc((o),(s))
+#define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t)))
+#define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t)))
+#define _XkbTypedRealloc(o,n,t) \
+ ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
+#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
+#define _XkbFree(p) Xfree(p)
+
+#define _XkbLibError(c,l,d) \
+ { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
+#define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
+#define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
+#define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d)))
+
+extern int DeviceKeyPress,DeviceKeyRelease;
+extern int DeviceButtonPress,DeviceButtonRelease;
+
+#ifdef XINPUT
+#define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress))
+#define _XkbIsReleaseEvent(t) (((t)==KeyRelease)||((t)==DeviceKeyRelease))
+#else
+#define _XkbIsPressEvent(t) ((t)==KeyPress)
+#define _XkbIsReleaseEvent(t) ((t)==KeyRelease)
+#endif
+
+#define _XkbCoreKeycodeInRange(c,k) (((k)>=(c)->curKeySyms.minKeyCode)&&\
+ ((k)<=(c)->curKeySyms.maxKeyCode))
+#define _XkbCoreNumKeys(c) ((c)->curKeySyms.maxKeyCode-\
+ (c)->curKeySyms.minKeyCode+1)
+
+#define XConvertCase(s,l,u) XkbConvertCase(s,l,u)
+#undef IsKeypadKey
+#define IsKeypadKey(s) XkbKSIsKeypad(s)
+
+#define Status int
+#define XPointer pointer
+#define Display struct _XDisplay
+
+#ifndef True
+#define True 1
+#define False 0
+#endif
+
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif
+#endif
+
+_XFUNCPROTOBEGIN
+
+extern void XkbUseMsg(
+ void
+);
+
+extern int XkbProcessArguments(
+ int /* argc */,
+ char ** /* argv */,
+ int /* i */
+);
+
+extern void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc);
+
+extern void XkbFreeCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern DeviceIntPtr _XkbLookupAnyDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupKeyboard(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupBellDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupLedDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern DeviceIntPtr _XkbLookupButtonDevice(
+ int /* id */,
+ int * /* why_rtrn */
+);
+
+extern XkbDescPtr XkbAllocKeyboard(
+ void
+);
+
+extern Status XkbAllocClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nTypes */
+);
+
+extern Status XkbAllocServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nNewActions */
+);
+
+extern void XkbFreeClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern Status XkbAllocIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbAllocCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nInterpret */
+);
+
+extern Status XkbAllocNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* nTotalRG */,
+ int /* nTotalAliases */
+);
+
+extern Status XkbAllocControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which*/
+);
+
+extern Status XkbCopyKeyTypes(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */,
+ int /* num_types */
+);
+
+extern Status XkbResizeKeyType(
+ XkbDescPtr /* xkb */,
+ int /* type_ndx */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* new_num_lvls */
+);
+
+extern void XkbFreeKeyboard(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeDesc */
+);
+
+extern void XkbSetActionKeyMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* mods */
+);
+
+extern Bool XkbCheckActionVMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* changed */
+);
+
+extern unsigned int XkbMaskForVMask(
+ XkbDescPtr /* xkb */,
+ unsigned int /* vmask */
+);
+
+extern Bool XkbVirtualModsToReal(
+ XkbDescPtr /* xkb */,
+ unsigned int /* virtua_mask */,
+ unsigned int * /* mask_rtrn */
+);
+
+extern unsigned int XkbAdjustGroup(
+ int /* group */,
+ XkbControlsPtr /* ctrls */
+);
+
+extern KeySym *XkbResizeKeySyms(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* needed */
+);
+
+extern XkbAction *XkbResizeKeyActions(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* needed */
+);
+
+extern void XkbUpdateKeyTypesFromCore(
+ DeviceIntPtr /* pXDev */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* pChanges */
+);
+
+extern void XkbUpdateDescActions(
+ XkbDescPtr /* xkb */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* changes */
+);
+
+extern void XkbUpdateActions(
+ DeviceIntPtr /* pXDev */,
+ KeyCode /* first */,
+ CARD8 /* num */,
+ XkbChangesPtr /* pChanges */,
+ unsigned int * /* needChecksRtrn */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateCoreDescription(
+ DeviceIntPtr /* keybd */,
+ Bool /* resize */
+);
+
+extern void XkbApplyMappingChange(
+ DeviceIntPtr /* pXDev */,
+ CARD8 /* request */,
+ KeyCode /* firstKey */,
+ CARD8 /* num */,
+ ClientPtr /* client */
+);
+
+extern void XkbSetIndicators(
+ DeviceIntPtr /* pXDev */,
+ CARD32 /* affect */,
+ CARD32 /* values */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbUpdateIndicators(
+ DeviceIntPtr /* keybd */,
+ CARD32 /* changed */,
+ Bool /* check_edevs */,
+ XkbChangesPtr /* pChanges */,
+ XkbEventCausePtr /* cause */
+);
+
+extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo(
+ DeviceIntPtr /* dev */,
+ KbdFeedbackPtr /* kf */,
+ LedFeedbackPtr /* lf */,
+ unsigned int /* needed_parts */
+);
+
+extern XkbSrvLedInfoPtr XkbFindSrvLedInfo(
+ DeviceIntPtr /* dev */,
+ unsigned int /* class */,
+ unsigned int /* id */,
+ unsigned int /* needed_parts */
+);
+
+extern void XkbApplyLedNameChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_names */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbApplyLedMapChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_maps */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbApplyLedStateChanges(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* changed_leds */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbFlushLedEvents(
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* kbd */,
+ XkbSrvLedInfoPtr /* sli */,
+ xkbExtensionDeviceNotify * /* ed */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern unsigned int XkbIndicatorsToUpdate(
+ DeviceIntPtr /* dev */,
+ unsigned long /* state_changes */,
+ Bool /* enabled_ctrl_changes */
+);
+
+extern void XkbComputeDerivedState(
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern void XkbCheckSecondaryEffects(
+ XkbSrvInfoPtr /* xkbi */,
+ unsigned int /* which */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbCheckIndicatorMaps(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ unsigned int /* which */
+);
+
+extern unsigned int XkbStateChangedFlags(
+ XkbStatePtr /* old */,
+ XkbStatePtr /* new */
+);
+
+extern void XkbSendStateNotify(
+ DeviceIntPtr /* kbd */,
+ xkbStateNotify * /* pSN */
+);
+
+extern void XkbSendMapNotify(
+ DeviceIntPtr /* kbd */,
+ xkbMapNotify * /* ev */
+);
+
+extern int XkbComputeControlsNotify(
+ DeviceIntPtr /* kbd */,
+ XkbControlsPtr /* old */,
+ XkbControlsPtr /* new */,
+ xkbControlsNotify * /* pCN */,
+ Bool /* forceCtrlProc */
+);
+
+extern void XkbSendControlsNotify(
+ DeviceIntPtr /* kbd */,
+ xkbControlsNotify * /* ev */
+);
+
+extern void XkbSendCompatMapNotify(
+ DeviceIntPtr /* kbd */,
+ xkbCompatMapNotify * /* ev */
+);
+
+extern void XkbHandleBell(
+ BOOL /* force */,
+ BOOL /* eventOnly */,
+ DeviceIntPtr /* kbd */,
+ CARD8 /* percent */,
+ pointer /* ctrl */,
+ CARD8 /* class */,
+ Atom /* name */,
+ WindowPtr /* pWin */,
+ ClientPtr /* pClient */
+);
+
+extern void XkbSendAccessXNotify(
+ DeviceIntPtr /* kbd */,
+ xkbAccessXNotify * /* pEv */
+);
+
+extern void XkbSendNamesNotify(
+ DeviceIntPtr /* kbd */,
+ xkbNamesNotify * /* ev */
+);
+
+extern void XkbSendCompatNotify(
+ DeviceIntPtr /* kbd */,
+ xkbCompatMapNotify * /* ev */
+);
+
+extern void XkbSendActionMessage(
+ DeviceIntPtr /* kbd */,
+ xkbActionMessage * /* ev */
+);
+
+extern void XkbSendExtensionDeviceNotify(
+ DeviceIntPtr /* kbd */,
+ ClientPtr /* client */,
+ xkbExtensionDeviceNotify * /* ev */
+);
+
+extern void XkbSendNotification(
+ DeviceIntPtr /* kbd */,
+ XkbChangesPtr /* pChanges */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbProcessKeyboardEvent(
+ struct _xEvent * /* xE */,
+ DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern void XkbHandleActions(
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* kbd */,
+ struct _xEvent * /* xE */,
+ int /* count */
+);
+
+extern Bool XkbEnableDisableControls(
+ XkbSrvInfoPtr /* xkbi */,
+ unsigned long /* change */,
+ unsigned long /* newValues */,
+ XkbChangesPtr /* changes */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void AccessXInit(
+ DeviceIntPtr /* dev */
+);
+
+extern Bool AccessXFilterPressEvent(
+ register struct _xEvent * /* xE */,
+ register DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern Bool AccessXFilterReleaseEvent(
+ register struct _xEvent * /* xE */,
+ register DeviceIntPtr /* keybd */,
+ int /* count */
+);
+
+extern void AccessXCancelRepeatKey(
+ XkbSrvInfoPtr /* xkbi */,
+ KeyCode /* key */
+);
+
+extern void AccessXComputeCurveFactor(
+ XkbSrvInfoPtr /* xkbi */,
+ XkbControlsPtr /* ctrls */
+);
+
+extern XkbInterestPtr XkbFindClientResource(
+ DevicePtr /* inDev */,
+ ClientPtr /* client */
+);
+
+extern XkbInterestPtr XkbAddClientResource(
+ DevicePtr /* inDev */,
+ ClientPtr /* client */,
+ XID /* id */
+);
+
+extern int XkbRemoveResourceClient(
+ DevicePtr /* inDev */,
+ XID /* id */
+);
+
+extern int XkbDDXInitDevice(
+ DeviceIntPtr /* dev */
+);
+
+extern int XkbDDXAccessXBeep(
+ DeviceIntPtr /* dev */,
+ unsigned int /* what */,
+ unsigned int /* which */
+);
+
+extern void XkbDDXKeyClick(
+ DeviceIntPtr /* dev */,
+ int /* keycode */,
+ int /* synthetic */
+);
+
+extern int XkbDDXUsesSoftRepeat(
+ DeviceIntPtr /* dev */
+);
+
+extern void XkbDDXKeybdCtrlProc(
+ DeviceIntPtr /* dev */,
+ KeybdCtrl * /* ctrl */
+);
+
+extern void XkbDDXChangeControls(
+ DeviceIntPtr /* dev */,
+ XkbControlsPtr /* old */,
+ XkbControlsPtr /* new */
+);
+
+extern void XkbDDXUpdateDeviceIndicators(
+ DeviceIntPtr /* dev */,
+ XkbSrvLedInfoPtr /* sli */,
+ CARD32 /* newState */
+);
+
+extern void XkbDDXFakePointerButton(
+ int /* event */,
+ int /* button */
+);
+
+extern void XkbDDXFakePointerMotion(
+ unsigned int /* flags */,
+ int /* x */,
+ int /* y */
+);
+
+extern void XkbDDXFakeDeviceButton(
+ DeviceIntPtr /* dev */,
+ Bool /* press */,
+ int /* button */
+);
+
+extern int XkbDDXTerminateServer(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern int XkbDDXSwitchScreen(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern int XkbDDXPrivate(
+ DeviceIntPtr /* dev */,
+ KeyCode /* key */,
+ XkbAction * /* act */
+);
+
+extern void XkbDisableComputedAutoRepeats(
+ DeviceIntPtr /* pXDev */,
+ unsigned int /* key */
+);
+
+extern void XkbSetRepeatKeys(
+ DeviceIntPtr /* pXDev */,
+ int /* key */,
+ int /* onoff */
+);
+
+extern int XkbLatchModifiers(
+ DeviceIntPtr /* pXDev */,
+ CARD8 /* mask */,
+ CARD8 /* latches */
+);
+
+extern int XkbLatchGroup(
+ DeviceIntPtr /* pXDev */,
+ int /* group */
+);
+
+extern void XkbClearAllLatchesAndLocks(
+ DeviceIntPtr /* dev */,
+ XkbSrvInfoPtr /* xkbi */,
+ Bool /* genEv */,
+ XkbEventCausePtr /* cause */
+);
+
+extern void XkbSetRulesDflts(
+ char * /* rulesFile */,
+ char * /* model */,
+ char * /* layout */,
+ char * /* variant */,
+ char * /* options */
+);
+
+extern void XkbInitDevice(
+ DeviceIntPtr /* pXDev */
+);
+
+extern Bool XkbInitKeyboardDeviceStruct(
+ DeviceIntPtr /* pXDev */,
+ XkbComponentNamesPtr /* pNames */,
+ KeySymsPtr /* pSyms */,
+ CARD8 /* pMods */[],
+ BellProcPtr /* bellProc */,
+ KbdCtrlProcPtr /* ctrlProc */
+);
+
+extern int SProcXkbDispatch(
+ ClientPtr /* client */
+);
+
+extern XkbGeometryPtr XkbLookupNamedGeometry(
+ DeviceIntPtr /* dev */,
+ Atom /* name */,
+ Bool * /* shouldFree */
+);
+
+extern char * _XkbDupString(
+ char * /* str */
+);
+
+extern void XkbConvertCase(
+ KeySym /* sym */,
+ KeySym * /* lower */,
+ KeySym * /* upper */
+);
+
+extern Status XkbChangeKeycodeRange(
+ XkbDescPtr /* xkb */,
+ int /* minKC */,
+ int /* maxKC */,
+ XkbChangesPtr /* changes */
+);
+
+extern int XkbFinishDeviceInit(
+ DeviceIntPtr /* pXDev */
+);
+
+extern void XkbFreeSrvLedInfo(
+ XkbSrvLedInfoPtr /* sli */
+);
+
+extern void XkbFreeInfo(
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern Status XkbChangeTypesOfKey(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* nGroups */,
+ unsigned int /* groups */,
+ int * /* newTypesIn */,
+ XkbMapChangesPtr /* changes */
+);
+
+extern int XkbKeyTypesForCoreSymbols(
+ XkbDescPtr /* xkb */,
+ int /* map_width */,
+ KeySym * /* core_syms */,
+ unsigned int /* protected */,
+ int * /* types_inout */,
+ KeySym * /* xkb_syms_rtrn */
+);
+
+extern Bool XkbApplyCompatMapToKey(
+ XkbDescPtr /* xkb */,
+ KeyCode /* key */,
+ XkbChangesPtr /* changes */
+);
+
+extern Bool XkbApplyVirtualModChanges(
+ XkbDescPtr /* xkb */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+extern void XkbSendNewKeyboardNotify(
+ DeviceIntPtr /* kbd */,
+ xkbNewKeyboardNotify * /* pNKN */
+);
+
+#ifdef XKBSRV_NEED_FILE_FUNCS
+
+#include <X11/extensions/XKMformat.h>
+#include <X11/extensions/XKBfile.h>
+#include <X11/extensions/XKBrules.h>
+
+#define _XkbListKeymaps 0
+#define _XkbListKeycodes 1
+#define _XkbListTypes 2
+#define _XkbListCompat 3
+#define _XkbListSymbols 4
+#define _XkbListGeometry 5
+#define _XkbListNumComponents 6
+
+typedef struct _XkbSrvListInfo {
+ int szPool;
+ int nPool;
+ char * pool;
+
+ int maxRtrn;
+ int nTotal;
+
+ char * pattern[_XkbListNumComponents];
+ int nFound[_XkbListNumComponents];
+} XkbSrvListInfoRec,*XkbSrvListInfoPtr;
+
+extern Status XkbDDXList(
+ DeviceIntPtr /* dev */,
+ XkbSrvListInfoPtr /* listing */,
+ ClientPtr /* client */
+);
+
+extern unsigned int XkbDDXLoadKeymapByNames(
+ DeviceIntPtr /* keybd */,
+ XkbComponentNamesPtr /* names */,
+ unsigned int /* want */,
+ unsigned int /* need */,
+ XkbFileInfoPtr /* finfoRtrn */,
+ char * /* keymapNameRtrn */,
+ int /* keymapNameRtrnLen */
+);
+
+extern Bool XkbDDXNamesFromRules(
+ DeviceIntPtr /* keybd */,
+ char * /* rules */,
+ XkbRF_VarDefsPtr /* defs */,
+ XkbComponentNamesPtr /* names */
+);
+
+extern Bool XkbDDXApplyConfig(
+ XPointer /* cfg_in */,
+ XkbSrvInfoPtr /* xkbi */
+);
+
+extern XPointer XkbDDXPreloadConfig(
+ char ** /* rulesFileRtrn */,
+ XkbRF_VarDefsPtr /* defs */,
+ XkbComponentNamesPtr /* names */,
+ DeviceIntPtr /* dev */
+);
+
+extern int _XkbStrCaseCmp(
+ char * /* str1 */,
+ char * /* str2 */
+);
+
+#endif /* XKBSRV_NEED_FILE_FUNCS */
+
+_XFUNCPROTOEND
+
+#define XkbAtomGetString(d,s) NameForAtom(s)
+
+#endif /* _XKBSRV_H_ */
diff --git a/os/utils.c b/os/utils.c
index 612c264..06c9b88 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -117,7 +117,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#endif
#ifdef XKB
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#endif
#ifdef XCSECURITY
#include "securitysrv.h"
diff --git a/xkb/Makefile.am b/xkb/Makefile.am
index 996d527..78cdf71 100644
--- a/xkb/Makefile.am
+++ b/xkb/Makefile.am
@@ -41,7 +41,8 @@ X11_SRCS = \
XKBGAlloc.c \
XKBMAlloc.c
-XI_SRCS = xkbPrOtherEv.c
+# ends up unused...
+# XI_SRCS = xkbPrOtherEv.c
libxkb_la_SOURCES = $(DDX_SRCS) $(DIX_SRCS) $(XI_SRCS) $(XKBFILE_SRCS) \
$(X11_SRCS)
diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c
index c474733..f0a1f89 100644
--- a/xkb/XKBAlloc.c
+++ b/xkb/XKBAlloc.c
@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xproto.h>
#include "misc.h"
#include "inputstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBgeom.h>
/***===================================================================***/
@@ -259,7 +259,7 @@ XkbAllocControls(XkbDescPtr xkb,unsigned
}
/*ARGSUSED*/
-void
+static void
XkbFreeControls(XkbDescPtr xkb,unsigned which,Bool freeMap)
{
if (freeMap && (xkb!=NULL) && (xkb->ctrls!=NULL)) {
@@ -284,7 +284,7 @@ XkbAllocIndicatorMaps(XkbDescPtr xkb)
return Success;
}
-void
+static void
XkbFreeIndicatorMaps(XkbDescPtr xkb)
{
if ((xkb!=NULL)&&(xkb->indicators!=NULL)) {
@@ -335,154 +335,3 @@ XkbFreeKeyboard(XkbDescPtr xkb,unsigned
_XkbFree(xkb);
return;
}
-
-/***====================================================================***/
-
-XkbDeviceLedInfoPtr
-XkbAddDeviceLedInfo(XkbDeviceInfoPtr devi,unsigned ledClass,unsigned ledId)
-{
-XkbDeviceLedInfoPtr devli;
-register int i;
-
- if ((!devi)||(!XkbSingleXIClass(ledClass))||(!XkbSingleXIId(ledId)))
- return NULL;
- for (i=0,devli=devi->leds;i<devi->num_leds;i++,devli++) {
- if ((devli->led_class==ledClass)&&(devli->led_id==ledId))
- return devli;
- }
- if (devi->num_leds>=devi->sz_leds) {
- XkbDeviceLedInfoRec *prev_leds = devi->leds;
-
- if (devi->sz_leds>0) devi->sz_leds*= 2;
- else devi->sz_leds= 1;
- devi->leds= _XkbTypedRealloc(devi->leds,devi->sz_leds,
- XkbDeviceLedInfoRec);
- if (!devi->leds) {
- _XkbFree(prev_leds);
- devi->sz_leds= devi->num_leds= 0;
- return NULL;
- }
- i= devi->num_leds;
- for (devli=&devi->leds[i];i<devi->sz_leds;i++,devli++) {
- bzero(devli,sizeof(XkbDeviceLedInfoRec));
- devli->led_class= XkbXINone;
- devli->led_id= XkbXINone;
- }
- }
- devli= &devi->leds[devi->num_leds++];
- bzero(devli,sizeof(XkbDeviceLedInfoRec));
- devli->led_class= ledClass;
- devli->led_id= ledId;
- return devli;
-}
-
-Status
-XkbResizeDeviceButtonActions(XkbDeviceInfoPtr devi,unsigned newTotal)
-{
- XkbAction *prev_btn_acts;
-
- if ((!devi)||(newTotal>255))
- return BadValue;
- if ((devi->btn_acts!=NULL)&&(newTotal==devi->num_btns))
- return Success;
- if (newTotal==0) {
- if (devi->btn_acts!=NULL) {
- _XkbFree(devi->btn_acts);
- devi->btn_acts= NULL;
- }
- devi->num_btns= 0;
- return Success;
- }
- prev_btn_acts = devi->btn_acts;
- devi->btn_acts= _XkbTypedRealloc(devi->btn_acts,newTotal,XkbAction);
- if (devi->btn_acts==NULL) {
- _XkbFree(prev_btn_acts);
- devi->num_btns= 0;
- return BadAlloc;
- }
- if (newTotal>devi->num_btns) {
- XkbAction *act;
- act= &devi->btn_acts[devi->num_btns];
- bzero((char *)act,(newTotal-devi->num_btns)*sizeof(XkbAction));
- }
- devi->num_btns= newTotal;
- return Success;
-}
-
-/*ARGSUSED*/
-XkbDeviceInfoPtr
-XkbAllocDeviceInfo(unsigned deviceSpec,unsigned nButtons,unsigned szLeds)
-{
-XkbDeviceInfoPtr devi;
-
- devi= _XkbTypedCalloc(1,XkbDeviceInfoRec);
- if (devi!=NULL) {
- devi->device_spec= deviceSpec;
- devi->has_own_state= False;
- devi->num_btns= 0;
- devi->btn_acts= NULL;
- if (nButtons>0) {
- devi->num_btns= nButtons;
- devi->btn_acts= _XkbTypedCalloc(nButtons,XkbAction);
- if (!devi->btn_acts) {
- _XkbFree(devi);
- return NULL;
- }
- }
- devi->dflt_kbd_fb= XkbXINone;
- devi->dflt_led_fb= XkbXINone;
- devi->num_leds= 0;
- devi->sz_leds= 0;
- devi->leds= NULL;
- if (szLeds>0) {
- devi->sz_leds= szLeds;
- devi->leds= _XkbTypedCalloc(szLeds,XkbDeviceLedInfoRec);
- if (!devi->leds) {
- if (devi->btn_acts)
- _XkbFree(devi->btn_acts);
- _XkbFree(devi);
- return NULL;
- }
- }
- }
- return devi;
-}
-
-
-void
-XkbFreeDeviceInfo(XkbDeviceInfoPtr devi,unsigned which,Bool freeDevI)
-{
- if (devi) {
- if (freeDevI) {
- which= XkbXI_AllDeviceFeaturesMask;
- if (devi->name) {
- _XkbFree(devi->name);
- devi->name= NULL;
- }
- }
- if ((which&XkbXI_ButtonActionsMask)&&(devi->btn_acts)) {
- _XkbFree(devi->btn_acts);
- devi->num_btns= 0;
- devi->btn_acts= NULL;
- }
- if ((which&XkbXI_IndicatorsMask)&&(devi->leds)) {
- register int i;
- if ((which&XkbXI_IndicatorsMask)==XkbXI_IndicatorsMask) {
- _XkbFree(devi->leds);
- devi->sz_leds= devi->num_leds= 0;
- devi->leds= NULL;
- }
- else {
- XkbDeviceLedInfoPtr devli;
- for (i=0,devli=devi->leds;i<devi->num_leds;i++,devli++) {
- if (which&XkbXI_IndicatorMapsMask)
- bzero((char *)&devli->maps[0],sizeof(devli->maps));
- else bzero((char *)&devli->names[0],sizeof(devli->names));
- }
- }
- }
- if (freeDevI)
- _XkbFree(devi);
- }
- return;
-}
diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c
index edaed10..815cc95 100644
--- a/xkb/XKBGAlloc.c
+++ b/xkb/XKBGAlloc.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xproto.h>
#include "misc.h"
#include "inputstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBgeom.h>
#ifdef X_NOT_POSIX
diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c
index ef4097d..4b7428b 100644
--- a/xkb/XKBMAlloc.c
+++ b/xkb/XKBMAlloc.c
@@ -39,7 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include <X11/keysym.h>
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
/***====================================================================***/
@@ -220,7 +220,7 @@ XkbServerMapPtr map;
/***====================================================================***/
-Status
+static Status
XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into)
{
if ((!from)||(!into))
@@ -275,82 +275,6 @@ register int i,rtrn;
return Success;
}
-XkbKeyTypePtr
-XkbAddKeyType( XkbDescPtr xkb,
- Atom name,
- int map_count,
- Bool want_preserve,
- int num_lvls)
-{
-register int i;
-unsigned tmp;
-XkbKeyTypePtr type;
-XkbClientMapPtr map;
-
- if ((!xkb)||(num_lvls<1))
- return NULL;
- map= xkb->map;
- if ((map)&&(map->types)) {
- for (i=0;i<map->num_types;i++) {
- if (map->types[i].name==name) {
- Status status;
- status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls);
- return (status==Success?&map->types[i]:NULL);
- }
- }
- }
- if ((!map)||(!map->types)||(!map->num_types<XkbNumRequiredTypes)) {
- tmp= XkbNumRequiredTypes+1;
- if (XkbAllocClientMap(xkb,XkbKeyTypesMask,tmp)!=Success)
- return NULL;
- map = xkb->map;
- tmp= 0;
- if (map->num_types<=XkbKeypadIndex)
- tmp|= XkbKeypadMask;
- if (map->num_types<=XkbAlphabeticIndex)
- tmp|= XkbAlphabeticMask;
- if (map->num_types<=XkbTwoLevelIndex)
- tmp|= XkbTwoLevelMask;
- if (map->num_types<=XkbOneLevelIndex)
- tmp|= XkbOneLevelMask;
- if (XkbInitCanonicalKeyTypes(xkb,tmp,XkbNoModifier)==Success) {
- for (i=0;i<map->num_types;i++) {
- Status status;
- if (map->types[i].name!=name)
- continue;
- status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls);
- return (status==Success?&map->types[i]:NULL);
- }
- }
- }
- if ((map->num_types<=map->size_types)&&
- (XkbAllocClientMap(xkb,XkbKeyTypesMask,map->num_types+1)!=Success)) {
- return NULL;
- }
- type= &map->types[map->num_types];
- map->num_types++;
- bzero((char *)type,sizeof(XkbKeyTypeRec));
- type->num_levels= num_lvls;
- type->map_count= map_count;
- type->name= name;
- if (map_count>0) {
- type->map= _XkbTypedCalloc(map_count,XkbKTMapEntryRec);
- if (!type->map) {
- map->num_types--;
- return NULL;
- }
- if (want_preserve) {
- type->preserve= _XkbTypedCalloc(map_count,XkbModsRec);
- if (!type->preserve) {
- _XkbFree(type->map);
- map->num_types--;
- return NULL;
- }
- }
- }
- return type;
-}
-
Status
XkbResizeKeyType( XkbDescPtr xkb,
int type_ndx,
diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c
index 7ed4769..0404108 100644
--- a/xkb/XKBMisc.c
+++ b/xkb/XKBMisc.c
@@ -39,102 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include <X11/keysym.h>
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
-
-/***====================================================================***/
-
-#define mapSize(m) (sizeof(m)/sizeof(XkbKTMapEntryRec))
-static XkbKTMapEntryRec map2Level[]= {
- { True, ShiftMask, {1, ShiftMask, 0} }
-};
-
-static XkbKTMapEntryRec mapAlpha[]= {
- { True, ShiftMask, { 1, ShiftMask, 0 } },
- { True, LockMask, { 0, LockMask, 0 } }
-};
-
-static XkbModsRec preAlpha[]= {
- { 0, 0, 0 },
- { LockMask, LockMask, 0 }
-};
-
-#define NL_VMOD_MASK 0
-static XkbKTMapEntryRec mapKeypad[]= {
- { True, ShiftMask, { 1, ShiftMask, 0 } },
- { False, 0, { 1, 0, NL_VMOD_MASK } }
-};
-
-static XkbKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = {
- { { 0, 0, 0 },
- 1, /* num_levels */
- 0, /* map_count */
- NULL, NULL,
- None, NULL
- },
- { { ShiftMask, ShiftMask, 0 },
- 2, /* num_levels */
- mapSize(map2Level), /* map_count */
- map2Level, NULL,
- None, NULL
- },
- { { ShiftMask|LockMask, ShiftMask|LockMask, 0 },
- 2, /* num_levels */
- mapSize(mapAlpha), /* map_count */
- mapAlpha, preAlpha,
- None, NULL
- },
- { { ShiftMask, ShiftMask, NL_VMOD_MASK },
- 2, /* num_levels */
- mapSize(mapKeypad), /* map_count */
- mapKeypad, NULL,
- None, NULL
- }
-};
-
-Status
-XkbInitCanonicalKeyTypes(XkbDescPtr xkb,unsigned which,int keypadVMod)
-{
-XkbClientMapPtr map;
-XkbKeyTypePtr from,to;
-Status rtrn;
-
- if (!xkb)
- return BadMatch;
- rtrn= XkbAllocClientMap(xkb,XkbKeyTypesMask,XkbNumRequiredTypes);
- if (rtrn!=Success)
- return rtrn;
- map= xkb->map;
- if ((which&XkbAllRequiredTypes)==0)
- return Success;
- rtrn= Success;
- from= canonicalTypes;
- to= map->types;
- if (which&XkbOneLevelMask)
- rtrn= XkbCopyKeyType(&from[XkbOneLevelIndex],&to[XkbOneLevelIndex]);
- if ((which&XkbTwoLevelMask)&&(rtrn==Success))
- rtrn= XkbCopyKeyType(&from[XkbTwoLevelIndex],&to[XkbTwoLevelIndex]);
- if ((which&XkbAlphabeticMask)&&(rtrn==Success))
- rtrn= XkbCopyKeyType(&from[XkbAlphabeticIndex],&to[XkbAlphabeticIndex]);
- if ((which&XkbKeypadMask)&&(rtrn==Success)) {
- XkbKeyTypePtr type;
- rtrn= XkbCopyKeyType(&from[XkbKeypadIndex],&to[XkbKeypadIndex]);
- type= &to[XkbKeypadIndex];
- if ((keypadVMod>=0)&&(keypadVMod<XkbNumVirtualMods)&&(rtrn==Success)) {
- type->mods.vmods= (1<<keypadVMod);
- type->map[0].active= True;
- type->map[0].mods.mask= ShiftMask;
- type->map[0].mods.real_mods= ShiftMask;
- type->map[0].mods.vmods= 0;
- type->map[0].level= 1;
- type->map[1].active= False;
- type->map[1].mods.mask= 0;
- type->map[1].mods.real_mods= 0;
- type->map[1].mods.vmods= (1<<keypadVMod);
- type->map[1].level= 1;
- }
- }
- return Success;
-}
+#include <xkbsrv.h>
/***====================================================================***/
@@ -558,88 +463,6 @@ unsigned changed,tmp;
return True;
}
-Bool
-XkbUpdateMapFromCore( XkbDescPtr xkb,
- KeyCode first_key,
- int num_keys,
- int map_width,
- KeySym * core_keysyms,
- XkbChangesPtr changes)
-{
-register int key,last_key;
-KeySym * syms;
-
- syms= &core_keysyms[(first_key-xkb->min_key_code)*map_width];
- if (changes) {
- if (changes->map.changed&XkbKeySymsMask) {
- _XkbAddKeyChange(&changes->map.first_key_sym,
- &changes->map.num_key_syms,first_key);
- if (num_keys>1) {
- _XkbAddKeyChange(&changes->map.first_key_sym,
- &changes->map.num_key_syms,
- first_key+num_keys-1);
- }
- }
- else {
- changes->map.changed|= XkbKeySymsMask;
- changes->map.first_key_sym= first_key;
- changes->map.num_key_syms= num_keys;
- }
- }
- last_key= first_key+num_keys-1;
- for (key=first_key;key<=last_key;key++,syms+= map_width) {
- XkbMapChangesPtr mc;
- unsigned explicit;
- KeySym tsyms[XkbMaxSymsPerKey];
- int types[XkbNumKbdGroups];
- int nG;
-
- explicit= xkb->server->explicit[key]&XkbExplicitKeyTypesMask;
- types[XkbGroup1Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup1Index);
- types[XkbGroup2Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup2Index);
- types[XkbGroup3Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup3Index);
- types[XkbGroup4Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup4Index);
- nG= XkbKeyTypesForCoreSymbols(xkb,map_width,syms,explicit,types,tsyms);
- if (changes)
- mc= &changes->map;
- else mc= NULL;
- XkbChangeTypesOfKey(xkb,key,nG,XkbAllGroupsMask,types,mc);
- memcpy((char *)XkbKeySymsPtr(xkb,key),(char *)tsyms,
- XkbKeyNumSyms(xkb,key)*sizeof(KeySym));
- XkbApplyCompatMapToKey(xkb,key,changes);
- }
-
- if ((xkb->server->vmods!=NULL)&&(xkb->map->modmap!=NULL)&&(changes)&&
- (changes->map.changed&(XkbVirtualModMapMask|XkbModifierMapMask))) {
- unsigned char newVMods[XkbNumVirtualMods];
- register unsigned bit,i;
- unsigned present;
-
- bzero(newVMods,XkbNumVirtualMods);
- present= 0;
- for (key=xkb->min_key_code;key<=xkb->max_key_code;key++) {
- if (xkb->server->vmodmap[key]==0)
- continue;
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if (bit&xkb->server->vmodmap[key]) {
- present|= bit;
- newVMods[i]|= xkb->map->modmap[key];
- }
- }
- }
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if ((bit&present)&&(newVMods[i]!=xkb->server->vmods[i])) {
- changes->map.changed|= XkbVirtualModsMask;
- changes->map.vmods|= bit;
- xkb->server->vmods[i]= newVMods[i];
- }
- }
- }
- if (changes && (changes->map.changed&XkbVirtualModsMask))
- XkbApplyVirtualModChanges(xkb,changes->map.vmods,changes);
- return True;
-}
-
Status
XkbChangeTypesOfKey( XkbDescPtr xkb,
int key,
@@ -788,7 +611,7 @@ register unsigned mask;
/***====================================================================***/
-Bool
+static Bool
XkbUpdateActionVirtualMods(XkbDescPtr xkb,XkbAction *act,unsigned changed)
{
unsigned int tmp;
@@ -814,7 +637,7 @@ unsigned int tmp;
return False;
}
-void
+static void
XkbUpdateKeyTypeVirtualMods( XkbDescPtr xkb,
XkbKeyTypePtr type,
unsigned int changed,
diff --git a/xkb/ddxBeep.c b/xkb/ddxBeep.c
index 53f3a6f..331357d 100644
--- a/xkb/ddxBeep.c
+++ b/xkb/ddxBeep.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
/*#define FALLING_TONE 1*/
diff --git a/xkb/ddxCtrls.c b/xkb/ddxCtrls.c
index 5a9ad40..0f7f918 100644
--- a/xkb/ddxCtrls.c
+++ b/xkb/ddxCtrls.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
void
diff --git a/xkb/ddxDevBtn.c b/xkb/ddxDevBtn.c
index 3de8f87..7e27c51 100644
--- a/xkb/ddxDevBtn.c
+++ b/xkb/ddxDevBtn.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
diff --git a/xkb/ddxFakeBtn.c b/xkb/ddxFakeBtn.c
index f7b746b..7722223 100644
--- a/xkb/ddxFakeBtn.c
+++ b/xkb/ddxFakeBtn.c
@@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
void
diff --git a/xkb/ddxFakeMtn.c b/xkb/ddxFakeMtn.c
index a19819f..1060afe 100644
--- a/xkb/ddxFakeMtn.c
+++ b/xkb/ddxFakeMtn.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
#ifdef PANORAMIX
diff --git a/xkb/ddxInit.c b/xkb/ddxInit.c
index 88c488c..3bcf9d6 100644
--- a/xkb/ddxInit.c
+++ b/xkb/ddxInit.c
@@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
int
diff --git a/xkb/ddxKeyClick.c b/xkb/ddxKeyClick.c
index 528b202..685ae1b 100644
--- a/xkb/ddxKeyClick.c
+++ b/xkb/ddxKeyClick.c
@@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
void
diff --git a/xkb/ddxKillSrv.c b/xkb/ddxKillSrv.c
index 95d7589..a573ecb 100644
--- a/xkb/ddxKillSrv.c
+++ b/xkb/ddxKillSrv.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
int
XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act)
diff --git a/xkb/ddxLEDs.c b/xkb/ddxLEDs.c
index fd01958..22899d7 100644
--- a/xkb/ddxLEDs.c
+++ b/xkb/ddxLEDs.c
@@ -37,10 +37,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
-void
+static void
XkbDDXUpdateIndicators(DeviceIntPtr dev,CARD32 new)
{
dev->kbdfeed->ctrl.leds= new;
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index 034f694..a91a9ba 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -40,7 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "scrnintstr.h"
#include "windowstr.h"
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
#ifndef PATH_MAX
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index 6e8f892..c24c56c 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -44,7 +44,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "scrnintstr.h"
#include "windowstr.h"
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XI.h>
#include "xkb.h"
@@ -211,7 +211,7 @@ OutputDirectory(
}
}
-Bool
+static Bool
XkbDDXCompileNamedKeymap( XkbDescPtr xkb,
XkbComponentNamesPtr names,
char * nameRtrn,
@@ -298,7 +298,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_out
return False;
}
-Bool
+static Bool
XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
XkbComponentNamesPtr names,
unsigned want,
@@ -432,7 +432,7 @@ char tmpname[PATH_MAX];
return False;
}
-FILE *
+static FILE *
XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen)
{
char buf[PATH_MAX],xkm_output_dir[PATH_MAX];
diff --git a/xkb/ddxPrivate.c b/xkb/ddxPrivate.c
index 7450b47..f67e20c 100644
--- a/xkb/ddxPrivate.c
+++ b/xkb/ddxPrivate.c
@@ -6,7 +6,7 @@
#define NEED_EVENTS
#include <X11/X.h>
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
int
XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
diff --git a/xkb/ddxVT.c b/xkb/ddxVT.c
index f56f079..55c82a8 100644
--- a/xkb/ddxVT.c
+++ b/xkb/ddxVT.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
int
XkbDDXSwitchScreen(DeviceIntPtr dev,KeyCode key,XkbAction *act)
diff --git a/xkb/maprules.c b/xkb/maprules.c
index b0a2225..0fa356e 100644
--- a/xkb/maprules.c
+++ b/xkb/maprules.c
@@ -48,7 +48,7 @@
#include "dix.h"
#include <X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#ifdef DEBUG
#define PR_DEBUG(s) fprintf(stderr,s)
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 2c97e05..cf42430 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -36,23 +36,20 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "misc.h"
#include "inputstr.h"
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include "extnsionst.h"
#include "xkb.h"
#include <X11/extensions/XI.h>
int XkbEventBase;
- int XkbErrorBase;
+static int XkbErrorBase;
int XkbReqCode;
- int XkbKeyboardErrorCode;
-Atom xkbONE_LEVEL;
-Atom xkbTWO_LEVEL;
-Atom xkbKEYPAD;
+static int XkbKeyboardErrorCode;
CARD32 xkbDebugFlags = 0;
-CARD32 xkbDebugCtrls = 0;
+static CARD32 xkbDebugCtrls = 0;
-RESTYPE RT_XKBCLIENT;
+static RESTYPE RT_XKBCLIENT;
/***====================================================================***/
@@ -895,52 +892,6 @@ ProcXkbSetControls(ClientPtr client)
return client->noClientException;
}
-/* FIXME: Needs to set rate on all core-sending devices. */
-int
-XkbSetRepeatRate(DeviceIntPtr dev,int timeout,int interval,int major,int minor)
-{
-int changed= 0;
-XkbControlsRec old,*xkb;
-
- if ((!dev)||(!dev->key)||(!dev->key->xkbInfo))
- return 0;
- xkb= dev->key->xkbInfo->desc->ctrls;
- old= *xkb;
- if ((timeout!=0) && (xkb->repeat_delay!=timeout)) {
- xkb->repeat_delay= timeout;
- changed++;
- }
- if ((interval!=0) && (xkb->repeat_interval!=interval)) {
- xkb->repeat_interval= interval;
- changed++;
- }
- if (changed) {
- xkbControlsNotify cn;
- XkbDDXChangeControls(dev,&old,xkb);
- if (XkbComputeControlsNotify(dev,&old,xkb,&cn,False)) {
- cn.keycode= 0;
- cn.eventType = 0;
- cn.requestMajor = major;
- cn.requestMinor = minor;
- XkbSendControlsNotify(dev,&cn);
- }
- }
- return 1;
-}
-
-int
-XkbGetRepeatRate(DeviceIntPtr dev,int *timeout,int *interval)
-{
-XkbControlsPtr xkb;
-
- if ((!dev)||(!dev->key)||(!dev->key->xkbInfo))
- return 0;
- xkb= dev->key->xkbInfo->desc->ctrls;
- if (timeout) *timeout= xkb->repeat_delay;
- if (interval) *interval= xkb->repeat_interval;
- return 1;
-}
-
/***====================================================================***/
static int
@@ -2820,7 +2771,7 @@ ProcXkbGetIndicatorState(ClientPtr clien
/***====================================================================***/
-Status
+static Status
XkbComputeGetIndicatorMapReplySize(
XkbIndicatorPtr indicators,
xkbGetIndicatorMapReply *rep)
@@ -2837,7 +2788,7 @@ int nIndicators;
return Success;
}
-int
+static int
XkbSendIndicatorMap( ClientPtr client,
XkbIndicatorPtr indicators,
xkbGetIndicatorMapReply * rep)
diff --git a/xkb/xkb.h b/xkb/xkb.h
index 2be4258..99b60bf 100644
--- a/xkb/xkb.h
+++ b/xkb/xkb.h
@@ -1,5 +1,3 @@
-/* $XFree86$ */
-
/* #include "XKBfile.h" */
extern int ProcXkbUseExtension(ClientPtr client);
@@ -29,50 +27,10 @@ extern int ProcXkbGetDeviceInfo(ClientPt
extern int ProcXkbSetDeviceInfo(ClientPtr client);
extern int ProcXkbSetDebuggingFlags(ClientPtr client);
-extern int XkbSetRepeatRate(DeviceIntPtr dev, int timeout, int interval, int major, int minor);
-extern int XkbGetRepeatRate(DeviceIntPtr dev, int *timeout, int *interval);
-
extern void XkbExtensionInit(void);
-extern Status XkbComputeGetIndicatorMapReplySize(
- XkbIndicatorPtr indicators,
- xkbGetIndicatorMapReply *rep);
-extern int XkbSendIndicatorMap(
- ClientPtr client,
- XkbIndicatorPtr indicators,
- xkbGetIndicatorMapReply *rep);
-
-extern void XkbComputeCompatState(XkbSrvInfoPtr xkbi);
-extern void XkbSetPhysicalLockingKey(DeviceIntPtr dev, unsigned key);
-
extern Bool XkbFilterEvents(ClientPtr pClient, int nEvents, xEvent *xE);
-extern Bool XkbApplyLEDChangeToKeyboard(
- XkbSrvInfoPtr xkbi,
- XkbIndicatorMapPtr map,
- Bool on,
- XkbChangesPtr change);
-
-extern Bool XkbWriteRulesProp(ClientPtr client, pointer closure);
-
-extern XkbAction XkbGetButtonAction(DeviceIntPtr kbd, DeviceIntPtr dev, int button);
-
-/* extern Status XkbMergeFile(XkbDescPtr xkb, XkbFileInfo finfo); */
-
-extern Bool XkbDDXCompileNamedKeymap(
- XkbDescPtr xkb,
- XkbComponentNamesPtr names,
- char * nameRtrn,
- int nameRtrnLen);
-
-extern Bool XkbDDXCompileKeymapByNames(
- XkbDescPtr xkb,
- XkbComponentNamesPtr names,
- unsigned want,
- unsigned need,
- char * nameRtrn,
- int nameRtrnLen);
-
extern Bool XkbCopyKeymap(
XkbDescPtr src,
XkbDescPtr dst,
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 0ab3dad..2954a0c 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xproto.h>
#include <X11/keysym.h>
#include "inputstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#if !defined(WIN32) && !defined(Lynx)
#include <sys/time.h>
#endif
@@ -52,9 +52,9 @@ pointer XkbLastRepeatEvent= NULL;
unsigned short XkbDfltAccessXTimeout= 120;
unsigned int XkbDfltAccessXTimeoutMask= DFLT_TIMEOUT_CTRLS;
-unsigned int XkbDfltAccessXTimeoutValues= 0;
-unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS;
-unsigned int XkbDfltAccessXTimeoutOptionsValues= 0;
+static unsigned int XkbDfltAccessXTimeoutValues= 0;
+static unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS;
+static unsigned int XkbDfltAccessXTimeoutOptionsValues= 0;
unsigned int XkbDfltAccessXFeedback= XkbAccessXFeedbackMask;
unsigned short XkbDfltAccessXOptions= XkbAX_AllOptionsMask & ~(XkbAX_IndicatorFBMask|XkbAX_SKReleaseFBMask|XkbAX_SKRejectFBMask);
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index e0bf89c..2e0c89f 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -36,14 +36,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/keysym.h>
#include "misc.h"
#include "inputstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include "xkb.h"
#include <ctype.h>
static unsigned int _xkbServerGeneration;
-int xkbDevicePrivateIndex = -1;
+static int xkbDevicePrivateIndex = -1;
-void
+static void
xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc,
pointer data)
{
@@ -216,7 +216,7 @@ static XkbAction fake;
return fake;
}
-XkbAction
+static XkbAction
XkbGetButtonAction(DeviceIntPtr kbd,DeviceIntPtr dev,int button)
{
XkbAction fake;
diff --git a/xkb/xkbDflts.h b/xkb/xkbDflts.h
index e31568a..5d86906 100644
--- a/xkb/xkbDflts.h
+++ b/xkb/xkbDflts.h
@@ -456,43 +456,6 @@ static XkbCompatMapRec compatMap= {
num_dfltSI, num_dfltSI
};
-static XkbIndicatorRec indicators= {
- 0x0,
- {
- { 0x80, 0, 0x00, XkbIM_UseEffective, { LockMask, LockMask, 0 }, 0 },
- { 0x80, 0, 0x00, XkbIM_UseEffective, { 0, 0, vmod_NumLockMask }, 0 },
- { 0x80, 0, 0x00, XkbIM_UseLocked, { ShiftMask, ShiftMask, 0 }, 0 },
- { 0x80, 0, 0x00, 0, { 0, 0, 0 }, XkbMouseKeysMask },
- { 0x80, 0, 0x00, XkbIM_UseLocked, { 0, 0, vmod_ScrollLockMask }, 0 },
- { 0x80, XkbIM_UseEffective, 0xfe, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 },
- { 0x00, 0, 0x00, 0, { 0, 0, 0 }, 0 }
- }
-};
static void
initIndicatorNames(DPYTYPE dpy,XkbDescPtr xkb)
{
diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
index 139221f..11dc17a 100644
--- a/xkb/xkbEvents.c
+++ b/xkb/xkbEvents.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/XI.h>
#include "inputstr.h"
#include "windowstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include "xkb.h"
/***====================================================================***/
@@ -331,7 +331,7 @@ Time time = 0;
return;
}
-void
+static void
XkbSendIndicatorNotify(DeviceIntPtr kbd,int xkbType,xkbIndicatorNotify *pEv)
{
int initialized;
@@ -972,48 +972,6 @@ XkbInterestPtr interest;
}
int
-XkbRemoveClient(DevicePtr inDev,ClientPtr client)
-{
-XkbSrvInfoPtr xkbi;
-DeviceIntPtr dev = (DeviceIntPtr)inDev;
-XkbInterestPtr interest;
-unsigned long autoCtrls,autoValues;
-Bool found;
-
- found= False;
- autoCtrls= autoValues= 0;
- if ( dev->xkb_interest ) {
- interest = dev->xkb_interest;
- if (interest && (interest->client==client)){
- dev->xkb_interest = interest->next;
- autoCtrls= interest->autoCtrls;
- autoValues= interest->autoCtrlValues;
- _XkbFree(interest);
- found= True;
- }
- while ((!found)&&(interest->next)) {
- if (interest->next->client==client) {
- XkbInterestPtr victim = interest->next;
- interest->next = victim->next;
- autoCtrls= victim->autoCtrls;
- autoValues= victim->autoCtrlValues;
- _XkbFree(victim);
- found= True;
- }
- interest = interest->next;
- }
- }
- if (found && autoCtrls && dev->key && dev->key->xkbInfo ) {
- XkbEventCauseRec cause;
-
- xkbi= dev->key->xkbInfo;
- XkbSetCauseXkbReq(&cause,X_kbPerClientFlags,client);
- XkbEnableDisableControls(xkbi,autoCtrls,autoValues,NULL,&cause);
- }
- return found;
-}
-
-int
XkbRemoveResourceClient(DevicePtr inDev,XID id)
{
XkbSrvInfoPtr xkbi;
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 5aa121d..716bc26 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -47,7 +47,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "opaque.h"
#include "property.h"
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBgeom.h>
#include <X11/extensions/XKMformat.h>
#include <X11/extensions/XKBfile.h>
@@ -124,7 +124,7 @@ typedef struct _SrvXkmInfo {
char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
char * XkbBinDirectory= XKB_BIN_DIRECTORY;
-int XkbWantAccessX= 0;
+static int XkbWantAccessX= 0;
static XkbFileInfo * _XkbInitFileInfo= NULL;
static Bool rulesDefined= False;
@@ -134,20 +134,17 @@ static char * XkbLayoutDflt= NULL;
static char * XkbVariantDflt= NULL;
static char * XkbOptionsDflt= NULL;
-char * XkbModelUsed= NULL;
-char * XkbLayoutUsed= NULL;
-char * XkbVariantUsed= NULL;
-char * XkbOptionsUsed= NULL;
-
-int _XkbClientMajor= XkbMajorVersion;
-int _XkbClientMinor= XkbMinorVersion;
+static char * XkbModelUsed= NULL;
+static char * XkbLayoutUsed= NULL;
+static char * XkbVariantUsed= NULL;
+static char * XkbOptionsUsed= NULL;
_X_EXPORT Bool noXkbExtension= XKB_DFLT_DISABLED;
-Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP;
+static Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP;
/***====================================================================***/
-char *
+static char *
XkbGetRulesDflts(XkbRF_VarDefsPtr defs)
{
if (XkbModelDflt) defs->model= XkbModelDflt;
@@ -161,7 +158,7 @@ XkbGetRulesDflts(XkbRF_VarDefsPtr defs)
return (rulesDefined?XkbRulesFile:XKB_DFLT_RULES_FILE);
}
-Bool
+static Bool
XkbWriteRulesProp(ClientPtr client, pointer closure)
{
int len,out;
@@ -230,7 +227,7 @@ char * pval;
return True;
}
-void
+static void
XkbSetRulesUsed(XkbRF_VarDefsPtr defs)
{
if (XkbModelUsed)
@@ -289,9 +286,6 @@ XkbSetRulesDflts(char *rulesFile,char *m
#include "xkbDflts.h"
-/* A dummy to keep the compiler quiet */
-pointer xkbBogus = &indicators;
-
static Bool
XkbInitKeyTypes(XkbDescPtr xkb,SrvXkmInfo *file)
{
diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c
index e94e0bf..d607d90 100644
--- a/xkb/xkbLEDs.c
+++ b/xkb/xkbLEDs.c
@@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include <X11/extensions/XI.h>
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include "xkb.h"
/***====================================================================***/
@@ -82,7 +82,7 @@ XkbSrvLedInfoPtr sli;
/*
* Bool
- * XkbApplyLEDChangeToKeyboard(xkbi,map,on,change)
+ *XkbApplyLEDChangeToKeyboard(xkbi,map,on,change)
*
* Some indicators "drive" the keyboard when their state is explicitly
* changed, as described in section 9.2.1 of the XKB protocol spec.
@@ -91,7 +91,7 @@ XkbSrvLedInfoPtr sli;
* when the indicator described by 'map' is turned on or off. The
* extent of the changes is reported in change, which must be defined.
*/
-Bool
+static Bool
XkbApplyLEDChangeToKeyboard( XkbSrvInfoPtr xkbi,
XkbIndicatorMapPtr map,
Bool on,
@@ -166,6 +166,164 @@ XkbStatePtr state;
}
return (stateChange || ctrlChange);
}
+
+ /*
+ * Bool
+ * ComputeAutoState(map,state,ctrls)
+ *
+ * This function reports the effect of applying the specified
+ * indicator map given the specified state and controls, as
+ * described in section 9.2 of the XKB protocol specification.
+ */
+
+static Bool
+ComputeAutoState( XkbIndicatorMapPtr map,
+ XkbStatePtr state,
+ XkbControlsPtr ctrls)
+{
+Bool on;
+CARD8 mods,group;
+
+ on= False;
+ mods= group= 0;
+ if (map->which_mods&XkbIM_UseAnyMods) {
+ if (map->which_mods&XkbIM_UseBase)
+ mods|= state->base_mods;
+ if (map->which_mods&XkbIM_UseLatched)
+ mods|= state->latched_mods;
+ if (map->which_mods&XkbIM_UseLocked)
+ mods|= state->locked_mods;
+ if (map->which_mods&XkbIM_UseEffective)
+ mods|= state->mods;
+ if (map->which_mods&XkbIM_UseCompat)
+ mods|= state->compat_state;
+ on = ((map->mods.mask&mods)!=0);
+ on = on||((mods==0)&&(map->mods.mask==0)&&(map->mods.vmods==0));
+ }
+ if (map->which_groups&XkbIM_UseAnyGroup) {
+ if (map->which_groups&XkbIM_UseBase)
+ group|= (1L << state->base_group);
+ if (map->which_groups&XkbIM_UseLatched)
+ group|= (1L << state->latched_group);
+ if (map->which_groups&XkbIM_UseLocked)
+ group|= (1L << state->locked_group);
+ if (map->which_groups&XkbIM_UseEffective)
+ group|= (1L << state->group);
+ on = on||(((map->groups&group)!=0)||(map->groups==0));
+ }
+ if (map->ctrls)
+ on = on||(ctrls->enabled_ctrls&map->ctrls);
+ return on;
+}
+
+
+static void
+XkbUpdateLedAutoState( DeviceIntPtr dev,
+ XkbSrvLedInfoPtr sli,
+ unsigned maps_to_check,
+ xkbExtensionDeviceNotify * ed,
+ XkbChangesPtr changes,
+ XkbEventCausePtr cause)
+{
+DeviceIntPtr kbd;
+XkbStatePtr state;
+XkbControlsPtr ctrls;
+XkbChangesRec my_changes;
+xkbExtensionDeviceNotify my_ed;
+register unsigned i,bit,affected;
+register XkbIndicatorMapPtr map;
+unsigned oldState;
+
+ if ((maps_to_check==0)||(sli->maps==NULL)||(sli->mapsPresent==0))
+ return;
+
+ if (dev->key && dev->key->xkbInfo)
+ kbd= dev;
+ else kbd= (DeviceIntPtr)LookupKeyboardDevice();
+
+ state= &kbd->key->xkbInfo->state;
+ ctrls= kbd->key->xkbInfo->desc->ctrls;
+ affected= maps_to_check;
+ oldState= sli->effectiveState;
+ sli->autoState&= ~affected;
+ for (i=0,bit=1;(i<XkbNumIndicators)&&(affected);i++,bit<<=1) {
+ if ((affected&bit)==0)
+ continue;
+ affected&= ~bit;
+ map= &sli->maps[i];
+ if((!(map->flags&XkbIM_NoAutomatic))&&ComputeAutoState(map,state,ctrls))
+ sli->autoState|= bit;
+ }
+ sli->effectiveState= (sli->autoState|sli->explicitState);
+ affected= sli->effectiveState^oldState;
+ if (affected==0)
+ return;
+
+ if (ed==NULL) {
+ ed= &my_ed;
+ bzero((char *)ed,sizeof(xkbExtensionDeviceNotify));
+ }
+ else if ((ed->reason&XkbXI_IndicatorsMask)&&
+ ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) {
+ XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
+ }
+
+ if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) {
+ if (changes==NULL) {
+ changes= &my_changes;
+ bzero((char *)changes,sizeof(XkbChangesRec));
+ }
+ changes->indicators.state_changes|= affected;
+ }
+
+ ed->reason|= XkbXI_IndicatorStateMask;
+ ed->ledClass= sli->class;
+ ed->ledID= sli->id;
+ ed->ledsDefined= sli->namesPresent|sli->mapsPresent;
+ ed->ledState= sli->effectiveState;
+ ed->unsupported|= XkbXI_IndicatorStateMask;
+ ed->supported= XkbXI_AllFeaturesMask;
+
+ if (changes!=&my_changes) changes= NULL;
+ if (ed!=&my_ed) ed= NULL;
+ if (changes || ed)
+ XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
+ return;
+}
+
+static void
+XkbUpdateAllDeviceIndicators(XkbChangesPtr changes,XkbEventCausePtr cause)
+{
+DeviceIntPtr edev;
+XkbSrvLedInfoPtr sli;
+
+ for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) {
+ if (edev->kbdfeed) {
+ KbdFeedbackPtr kf;
+ for (kf=edev->kbdfeed;kf!=NULL;kf=kf->next) {
+ if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL))
+ continue;
+ sli= kf->xkb_sli;
+ XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
+ changes,cause);
+
+ }
+ }
+ if (edev->leds) {
+ LedFeedbackPtr lf;
+ for (lf=edev->leds;lf!=NULL;lf=lf->next) {
+ if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL))
+ continue;
+ sli= lf->xkb_sli;
+ XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
+ changes,cause);
+
+ }
+ }
+ }
+ return;
+}
+
/***====================================================================***/
@@ -228,55 +386,6 @@ unsigned side_affected;
/***====================================================================***/
- /*
- * Bool
- * ComputeAutoState(map,state,ctrls)
- *
- * This function reports the effect of applying the specified
- * indicator map given the specified state and controls, as
- * described in section 9.2 of the XKB protocol specification.
- */
-
-static Bool
-ComputeAutoState( XkbIndicatorMapPtr map,
- XkbStatePtr state,
- XkbControlsPtr ctrls)
-{
-Bool on;
-CARD8 mods,group;
-
- on= False;
- mods= group= 0;
- if (map->which_mods&XkbIM_UseAnyMods) {
- if (map->which_mods&XkbIM_UseBase)
- mods|= state->base_mods;
- if (map->which_mods&XkbIM_UseLatched)
- mods|= state->latched_mods;
- if (map->which_mods&XkbIM_UseLocked)
- mods|= state->locked_mods;
- if (map->which_mods&XkbIM_UseEffective)
- mods|= state->mods;
- if (map->which_mods&XkbIM_UseCompat)
- mods|= state->compat_state;
- on = ((map->mods.mask&mods)!=0);
- on = on||((mods==0)&&(map->mods.mask==0)&&(map->mods.vmods==0));
- }
- if (map->which_groups&XkbIM_UseAnyGroup) {
- if (map->which_groups&XkbIM_UseBase)
- group|= (1L << state->base_group);
- if (map->which_groups&XkbIM_UseLatched)
- group|= (1L << state->latched_group);
- if (map->which_groups&XkbIM_UseLocked)
- group|= (1L << state->locked_group);
- if (map->which_groups&XkbIM_UseEffective)
- group|= (1L << state->group);
- on = on||(((map->groups&group)!=0)||(map->groups==0));
- }
- if (map->ctrls)
- on = on||(ctrls->enabled_ctrls&map->ctrls);
- return on;
-}
-
/***====================================================================***/
/*
@@ -314,39 +423,6 @@ XkbSrvLedInfoPtr sli;
/***====================================================================***/
-void
-XkbUpdateAllDeviceIndicators(XkbChangesPtr changes,XkbEventCausePtr cause)
-{
-DeviceIntPtr edev;
-XkbSrvLedInfoPtr sli;
-
- for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) {
- if (edev->kbdfeed) {
- KbdFeedbackPtr kf;
- for (kf=edev->kbdfeed;kf!=NULL;kf=kf->next) {
- if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL))
- continue;
- sli= kf->xkb_sli;
- XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
- changes,cause);
-
- }
- }
- if (edev->leds) {
- LedFeedbackPtr lf;
- for (lf=edev->leds;lf!=NULL;lf=lf->next) {
- if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL))
- continue;
- sli= lf->xkb_sli;
- XkbUpdateLedAutoState(edev,sli,sli->mapsPresent,NULL,
- changes,cause);
-
- }
- }
- }
- return;
-}
-
/***====================================================================***/
/*
@@ -856,210 +932,3 @@ Bool kb_changed;
XkbUpdateAllDeviceIndicators(NULL,cause);
return;
}
-
-/***====================================================================***/
-
-void
-XkbUpdateLedAutoState( DeviceIntPtr dev,
- XkbSrvLedInfoPtr sli,
- unsigned maps_to_check,
- xkbExtensionDeviceNotify * ed,
- XkbChangesPtr changes,
- XkbEventCausePtr cause)
-{
-DeviceIntPtr kbd;
-XkbStatePtr state;
-XkbControlsPtr ctrls;
-XkbChangesRec my_changes;
-xkbExtensionDeviceNotify my_ed;
-register unsigned i,bit,affected;
-register XkbIndicatorMapPtr map;
-unsigned oldState;
-
- if ((maps_to_check==0)||(sli->maps==NULL)||(sli->mapsPresent==0))
- return;
-
- if (dev->key && dev->key->xkbInfo)
- kbd= dev;
- else kbd= (DeviceIntPtr)LookupKeyboardDevice();
-
- state= &kbd->key->xkbInfo->state;
- ctrls= kbd->key->xkbInfo->desc->ctrls;
- affected= maps_to_check;
- oldState= sli->effectiveState;
- sli->autoState&= ~affected;
- for (i=0,bit=1;(i<XkbNumIndicators)&&(affected);i++,bit<<=1) {
- if ((affected&bit)==0)
- continue;
- affected&= ~bit;
- map= &sli->maps[i];
- if((!(map->flags&XkbIM_NoAutomatic))&&ComputeAutoState(map,state,ctrls))
- sli->autoState|= bit;
- }
- sli->effectiveState= (sli->autoState|sli->explicitState);
- affected= sli->effectiveState^oldState;
- if (affected==0)
- return;
-
- if (ed==NULL) {
- ed= &my_ed;
- bzero((char *)ed,sizeof(xkbExtensionDeviceNotify));
- }
- else if ((ed->reason&XkbXI_IndicatorsMask)&&
- ((ed->ledClass!=sli->class)||(ed->ledID!=sli->id))) {
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- }
-
- if ((kbd==dev)&&(sli->flags&XkbSLI_IsDefault)) {
- if (changes==NULL) {
- changes= &my_changes;
- bzero((char *)changes,sizeof(XkbChangesRec));
- }
- changes->indicators.state_changes|= affected;
- }
-
- ed->reason|= XkbXI_IndicatorStateMask;
- ed->ledClass= sli->class;
- ed->ledID= sli->id;
- ed->ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed->ledState= sli->effectiveState;
- ed->unsupported|= XkbXI_IndicatorStateMask;
- ed->supported= XkbXI_AllFeaturesMask;
-
- if (changes!=&my_changes) changes= NULL;
- if (ed!=&my_ed) ed= NULL;
- if (changes || ed)
- XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause);
- return;
-}
-
-/***====================================================================***/
-
-static void
-_UpdateButtonVMods( XkbDescPtr xkb,
- unsigned num_btns,
- XkbAction * acts,
- unsigned changed,
- xkbExtensionDeviceNotify * ed_inout)
-{
-register int i;
-
- for (i=0;i<num_btns;i++,acts++) {
- if ((acts->any.type!=XkbSA_NoAction)&&
- XkbUpdateActionVirtualMods(xkb,acts,changed)) {
- if ((ed_inout->reason&XkbXI_ButtonActionsMask)==0) {
- ed_inout->reason|= XkbXI_ButtonActionsMask;
- ed_inout->firstBtn= i;
- ed_inout->nBtns= 1;
- }
- else {
- ed_inout->nBtns= (i-ed_inout->firstBtn)+1;
- }
- }
- }
- return;
-}
-
-static void
-_UpdateMapVMods( XkbDescPtr xkb,
- register XkbIndicatorMapPtr map,
- unsigned changed_vmods,
- unsigned * changed_maps_rtrn)
-{
-register int i;
-
- *changed_maps_rtrn= 0;
- for (i=0;i<XkbNumIndicators;i++,map++) {
- if (map->mods.vmods&changed_vmods) {
- map->mods.mask= map->mods.real_mods;
- map->mods.mask|= XkbMaskForVMask(xkb,map->mods.vmods);
- *changed_maps_rtrn|= (1L<<i);
- }
- }
- return;
-}
-
-static void
-_UpdateDeviceVMods( DeviceIntPtr dev,
- XkbDescPtr xkb,
- unsigned changed,
- XkbEventCausePtr cause)
-{
-xkbExtensionDeviceNotify ed;
-XkbSrvLedInfoPtr sli;
-unsigned changed_maps;
-
- bzero((char *)&ed,sizeof(xkbExtensionDeviceNotify));
- ed.deviceID= dev->id;
- if ((dev->button)&&(dev->button->xkb_acts)) {
- _UpdateButtonVMods(xkb,dev->button->numButtons,
- dev->button->xkb_acts,changed,&ed);
- }
- if (dev->kbdfeed) {
- KbdFeedbackPtr kf;
- for (kf=dev->kbdfeed;kf!=NULL;kf=kf->next) {
- if ((kf->xkb_sli==NULL)||(kf->xkb_sli->maps==NULL))
- continue;
- sli= kf->xkb_sli;
- _UpdateMapVMods(xkb,sli->maps,changed,&changed_maps);
- if (changed_maps) {
- if (ed.reason&XkbXI_IndicatorsMask) {
- XkbSendExtensionDeviceNotify(dev,NULL,&ed);
- ed.reason= 0;
- ed.firstBtn= ed.nBtns;
- }
- ed.ledClass= sli->class;
- ed.ledID= sli->id;
- ed.ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed.reason|= XkbXI_IndicatorMapsMask;
- XkbUpdateLedAutoState(dev,sli,changed_maps,&ed,NULL,cause);
- }
- }
- }
- if (dev->leds) {
- LedFeedbackPtr lf;
- for (lf=dev->leds;lf!=NULL;lf=lf->next) {
- if ((lf->xkb_sli==NULL)||(lf->xkb_sli->maps==NULL))
- continue;
- sli= lf->xkb_sli;
- _UpdateMapVMods(xkb,sli->maps,changed,&changed_maps);
- if (changed_maps) {
- if (ed.reason&XkbXI_IndicatorsMask) {
- XkbSendExtensionDeviceNotify(dev,NULL,&ed);
- ed.reason= 0;
- ed.firstBtn= ed.nBtns;
- }
- ed.ledClass= sli->class;
- ed.ledID= sli->id;
- ed.ledsDefined= sli->namesPresent|sli->mapsPresent;
- ed.reason|= XkbXI_IndicatorMapsMask;
- XkbUpdateLedAutoState(dev,sli,changed_maps,&ed,NULL,cause);
- }
- }
- }
- if (ed.reason!=0)
- XkbSendExtensionDeviceNotify(dev,NULL,&ed);
- return;
-}
-
-void
-XkbApplyVModChangesToAllDevices( DeviceIntPtr dev,
- XkbDescPtr xkb,
- unsigned changed,
- XkbEventCausePtr cause)
-{
-DeviceIntPtr edev;
- if (dev!=(DeviceIntPtr)LookupKeyboardDevice())
- return;
- for (edev=inputInfo.devices;edev!=NULL;edev=edev->next) {
- if (edev->key)
- continue;
- _UpdateDeviceVMods(edev,xkb,changed,cause);
- }
- for (edev=inputInfo.off_devices;edev!=NULL;edev=edev->next) {
- if (edev->key)
- continue;
- _UpdateDeviceVMods(edev,xkb,changed,cause);
- }
- return;
-}
diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c
index 9944c88..81124bc 100644
--- a/xkb/xkbPrKeyEv.c
+++ b/xkb/xkbPrKeyEv.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/keysym.h>
#include "misc.h"
#include "inputstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <ctype.h>
diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c
index 9a04b77..da4c905 100644
--- a/xkb/xkbSwap.c
+++ b/xkb/xkbSwap.c
@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xproto.h>
#include "misc.h"
#include "inputstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBstr.h>
#include "extnsionst.h"
#include "xkb.h"
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 062159e..1d23667 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -41,7 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBgeom.h>
#include "xkb.h"
@@ -172,44 +172,6 @@ register unsigned mask;
return mask;
}
-
-Bool
-XkbApplyVModChanges( XkbSrvInfoPtr xkbi,
- unsigned changed,
- XkbChangesPtr changes,
- unsigned * needChecksRtrn,
- XkbEventCausePtr cause)
-{
-XkbDescPtr xkb;
-Bool check;
-
- xkb= xkbi->desc;
-#ifdef DEBUG
-{
-register unsigned i,bit;
- for (i=0,bit=1;i<XkbNumVirtualMods;i++,bit<<=1) {
- if ((changed&bit)==0)
- continue;
- if (xkbDebugFlags)
- ErrorF("Should be applying: change vmod %d to 0x%x\n",i,
- xkb->server->vmods[i]);
- }
-}
-#endif
- check= XkbApplyVirtualModChanges(xkb,changed,changes);
- XkbApplyVModChangesToAllDevices(xkbi->device,xkb,changed,cause);
-
- if (needChecksRtrn!=NULL) {
- if (check)
- *needChecksRtrn= XkbStateNotifyMask|XkbIndicatorStateNotifyMask;
- else *needChecksRtrn= 0;
- }
- else if (check) {
- /* 7/12/95 (ef) -- XXX check compatibility and/or indicator state */
- }
- return 1;
-}
-
/***====================================================================***/
void
@@ -658,7 +620,7 @@ int changed;
return changed;
}
-void
+static void
XkbComputeCompatState(XkbSrvInfoPtr xkbi)
{
CARD16 grp_mask;
@@ -772,21 +734,6 @@ XkbCheckSecondaryEffects( XkbSrvInfoPtr
/***====================================================================***/
-void
-XkbSetPhysicalLockingKey(DeviceIntPtr dev,unsigned key)
-{
-XkbDescPtr xkb;
-
- xkb= dev->key->xkbInfo->desc;
- if ((key>=xkb->min_key_code) && (key<=xkb->max_key_code)) {
- xkb->server->behaviors[key].type= XkbKB_Lock|XkbKB_Permanent;
- }
- else ErrorF("Internal Error! Bad XKB info in SetPhysicalLockingKey\n");
- return;
-}
-
-/***====================================================================***/
-
Bool
XkbEnableDisableControls( XkbSrvInfoPtr xkbi,
unsigned long change,
diff --git a/xkb/xkberrs.c b/xkb/xkberrs.c
index 095d573..3534356 100644
--- a/xkb/xkberrs.c
+++ b/xkb/xkberrs.c
@@ -32,37 +32,6 @@
#include <ctype.h>
#include <stdlib.h>
-char * _XkbErrMessages[] = {
- "success", /* _XkbSuccess */
- "key names not defined", /* _XkbErrMissingNames */
- "key types not defined", /* _XkbErrMissingTypes */
- "required key types not present", /* _XkbErrMissingReqTypes */
- "symbols not defined", /* _XkbErrMissingSymbols */
- "virtual modifier bindings not defined",/* _XkbErrMissingVMods */
- "indicators not defined", /* _XkbErrMissingIndicators */
- "compatibility map not defined", /* _XkbErrMissingCompatMap */
- "symbol interpretations not defined", /* _XkbErrMissingSymInterps */
- "geometry not defined", /* _XkbErrMissingGeometry */
- "illegal doodad type", /* _XkbErrIllegalDoodad */
- "illegal TOC type", /* _XkbErrIllegalTOCType */
- "illegal contents", /* _XkbErrIllegalContents */
- "empty file", /* _XkbErrEmptyFile */
- "file not found", /* _XkbErrFileNotFound */
- "cannot open", /* _XkbErrFileCannotOpen */
- "bad value", /* _XkbErrBadValue */
- "bad match", /* _XkbErrBadMatch */
- "illegal name for type", /* _XkbErrBadTypeName */
- "illegal width for type", /* _XkbErrBadTypeWidth */
- "bad file type", /* _XkbErrBadFileType */
- "bad file version", /* _XkbErrBadFileVersion */
- "error in Xkm file", /* _XkbErrBadFileFormat */
- "allocation failed", /* _XkbErrBadAlloc */
- "bad length", /* _XkbErrBadLength */
- "X request failed", /* _XkbErrXReqFailure */
- "not implemented" /* _XkbErrBadImplementation */
-};
-
unsigned _XkbErrCode;
char * _XkbErrLocation= NULL;
unsigned _XkbErrData;
-
diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c
index 4130bd9..05344b4 100644
--- a/xkb/xkbfmisc.c
+++ b/xkb/xkbfmisc.c
@@ -44,7 +44,7 @@
#include "dix.h"
#include <X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS 1
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBgeom.h>
#include "xkb.h"
@@ -133,76 +133,6 @@ unsigned set,rtrn;
/***===================================================================***/
-Bool
-XkbLookupGroupAndLevel( XkbDescPtr xkb,
- int key,
- int * mods_inout,
- int * grp_inout,
- int * lvl_rtrn)
-{
-int nG,eG;
-
- if ((!xkb)||(!XkbKeycodeInRange(xkb,key))||(!grp_inout))
- return False;
-
- nG= XkbKeyNumGroups(xkb,key);
- eG= *grp_inout;
-
- if ( nG==0 ) {
- *grp_inout= 0;
- if (lvl_rtrn!=NULL)
- *lvl_rtrn= 0;
- return False;
- }
- else if ( nG==1 ) {
- eG= 0;
- }
- else if ( eG>=nG ) {
- unsigned gI= XkbKeyGroupInfo(xkb,key);
- switch (XkbOutOfRangeGroupAction(gI)) {
- default:
- eG %= nG;
- break;
- case XkbClampIntoRange:
- eG = nG-1;
- break;
- case XkbRedirectIntoRange:
- eG = XkbOutOfRangeGroupNumber(gI);
- if (eG>=nG)
- eG= 0;
- break;
- }
- }
- *grp_inout= eG;
- if (mods_inout!=NULL) {
- XkbKeyTypePtr type;
- int preserve;
-
- type = XkbKeyKeyType(xkb,key,eG);
- if (lvl_rtrn!=NULL)
- *lvl_rtrn= 0;
- preserve= 0;
- if (type->map) { /* find the shift level */
- register int i;
- register XkbKTMapEntryPtr entry;
- for (i=0,entry=type->map;i<type->map_count;i++,entry++) {
- if ((entry->active)&&
- (((*mods_inout)&type->mods.mask)==entry->mods.mask)){
- if (lvl_rtrn!=NULL)
- *lvl_rtrn= entry->level;
- if (type->preserve)
- preserve= type->preserve[i].mask;
- break;
- }
- }
- }
- (*mods_inout)&= ~(type->mods.mask&(~preserve));
- }
- return True;
-}
-
-/***===================================================================***/
-
static Bool
XkbWriteSectionFromName(FILE *file,char *sectionName,char *name)
{
@@ -416,15 +346,6 @@ XkbFileInfo finfo;
/***====================================================================***/
-/*ARGSUSED*/
-Status
-XkbMergeFile(XkbDescPtr xkb,XkbFileInfo finfo)
-{
- return BadImplementation;
-}
-
-/***====================================================================***/
-
int
XkbFindKeycodeByName(XkbDescPtr xkb,char *name,Bool use_aliases)
{
@@ -484,34 +405,6 @@ unsigned rtrn;
return rtrn;
}
-unsigned
-XkbConvertXkbComponents(Bool toXkm,unsigned orig)
-{
-unsigned rtrn;
-
- rtrn= 0;
- if (toXkm) {
- if (orig&XkbClientMapMask) rtrn|= XkmTypesMask|XkmSymbolsMask;
- if (orig&XkbServerMapMask) rtrn|= XkmTypesMask|XkmSymbolsMask;
- if (orig&XkbCompatMapMask) rtrn|= XkmCompatMapMask;
- if (orig&XkbIndicatorMapMask) rtrn|= XkmIndicatorsMask;
- if (orig&XkbNamesMask) rtrn|= XkmKeyNamesMask;
- if (orig&XkbGeometryMask) rtrn|= XkmGeometryMask;
- }
- else {
- if (orig!=0) rtrn|= XkbNamesMask;
- if (orig&XkmTypesMask) rtrn|= XkbClientMapMask;
- if (orig&XkmCompatMapMask)
- rtrn|= XkbCompatMapMask|XkbIndicatorMapMask;
- if (orig&XkmSymbolsMask) rtrn|=XkbClientMapMask|XkbServerMapMask;
- if (orig&XkmIndicatorsMask) rtrn|= XkbIndicatorMapMask;
- if (orig&XkmKeyNamesMask)
- rtrn|= XkbNamesMask|XkbIndicatorMapMask;
- if (orig&XkmGeometryMask) rtrn|= XkbGeometryMask;
- }
- return rtrn;
-}
-
Bool
XkbDetermineFileType(XkbFileInfoPtr finfo,int format,int *opts_missing)
{
diff --git a/xkb/xkbout.c b/xkb/xkbout.c
index 31cd4fa..bdec8e7 100644
--- a/xkb/xkbout.c
+++ b/xkb/xkbout.c
@@ -44,7 +44,7 @@
#include "dix.h"
#include <X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS 1
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBgeom.h>
#include <X11/extensions/XKBfile.h>
@@ -925,127 +925,3 @@ XkbGeometryPtr geom;
fprintf(file,"};\n\n");
return True;
}
-
-/*ARGSUSED*/
-Bool
-XkbWriteXKBSemantics( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Bool ok;
-
- fprintf(file,"xkb_semantics {\n");
- ok= XkbWriteXKBKeyTypes(file,result,False,False,addOn,priv);
- ok= ok&&XkbWriteXKBCompatMap(file,result,False,False,addOn,priv);
- fprintf(file,"};\n");
- return ok;
-}
-
-/*ARGSUSED*/
-Bool
-XkbWriteXKBLayout( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Bool ok;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- fprintf(file,"xkb_layout {\n");
- ok= XkbWriteXKBKeycodes(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBKeyTypes(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBSymbols(file,result,False,showImplicit,addOn,priv);
- if (xkb->geom)
- ok= ok&&XkbWriteXKBGeometry(file,result,False,showImplicit,addOn,priv);
- fprintf(file,"};\n");
- return ok;
-}
-
-/*ARGSUSED*/
-Bool
-XkbWriteXKBKeymap( FILE * file,
- XkbFileInfo * result,
- Bool topLevel,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Bool ok;
-XkbDescPtr xkb;
-
- xkb= result->xkb;
- fprintf(file,"xkb_keymap {\n");
- ok= XkbWriteXKBKeycodes(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBKeyTypes(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBCompatMap(file,result,False,showImplicit,addOn,priv);
- ok= ok&&XkbWriteXKBSymbols(file,result,False,showImplicit,addOn,priv);
- if (xkb->geom)
- ok= ok&&XkbWriteXKBGeometry(file,result,False,showImplicit,addOn,priv);
- fprintf(file,"};\n");
- return ok;
-}
-
-Bool
-XkbWriteXKBFile( FILE * out,
- XkbFileInfo * result,
- Bool showImplicit,
- XkbFileAddOnFunc addOn,
- void * priv)
-{
-Bool ok = False;
-Bool (*func)(
- FILE * /* file */,
- XkbFileInfo * /* result */,
- Bool /* topLevel */,
- Bool /* showImplicit */,
- XkbFileAddOnFunc /* addOn */,
- void * /* priv */
-) = NULL;
-
- switch (result->type) {
- case XkmSemanticsFile:
- func= XkbWriteXKBSemantics;
- break;
- case XkmLayoutFile:
- func= XkbWriteXKBLayout;
- break;
- case XkmKeymapFile:
- func= XkbWriteXKBKeymap;
- break;
- case XkmTypesIndex:
- func= XkbWriteXKBKeyTypes;
- break;
- case XkmCompatMapIndex:
- func= XkbWriteXKBCompatMap;
- break;
- case XkmSymbolsIndex:
- func= XkbWriteXKBSymbols;
- break;
- case XkmKeyNamesIndex:
- func= XkbWriteXKBKeycodes;
- break;
- case XkmGeometryFile:
- case XkmGeometryIndex:
- func= XkbWriteXKBGeometry;
- break;
- case XkmVirtualModsIndex:
- case XkmIndicatorsIndex:
- _XkbLibError(_XkbErrBadImplementation,
- XkbConfigText(result->type,XkbMessage),0);
- return False;
- }
- if (out==NULL) {
- _XkbLibError(_XkbErrFileCannotOpen,"XkbWriteXkbFile",0);
- ok= False;
- }
- else if (func) {
- ok= (*func)(out,result,True,showImplicit,addOn,priv);
- }
- return ok;
-}
diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
index defd45a..3a50371 100644
--- a/xkb/xkbtext.c
+++ b/xkb/xkbtext.c
@@ -44,7 +44,7 @@
#include "dix.h"
#include <X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS 1
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBgeom.h>
/***====================================================================***/
@@ -448,100 +448,6 @@ char * buf;
return buf;
}
-char *
-XkbAccessXDetailText(unsigned state,unsigned format)
-{
-char *buf,*prefix;
-
- buf= tbGetBuffer(32);
- if (format==XkbMessage) prefix= "";
- else prefix= "XkbAXN_";
- switch (state){
- case XkbAXN_SKPress: sprintf(buf,"%sSKPress",prefix); break;
- case XkbAXN_SKAccept: sprintf(buf,"%sSKAccept",prefix); break;
- case XkbAXN_SKRelease: sprintf(buf,"%sSKRelease",prefix); break;
- case XkbAXN_SKReject: sprintf(buf,"%sSKReject",prefix); break;
- case XkbAXN_BKAccept: sprintf(buf,"%sBKAccept",prefix); break;
- case XkbAXN_BKReject: sprintf(buf,"%sBKReject",prefix); break;
- case XkbAXN_AXKWarning: sprintf(buf,"%sAXKWarning",prefix); break;
- default: sprintf(buf,"ILLEGAL"); break;
- }
- return buf;
-}
-
-static char *nknNames[] = {
- "keycodes", "geometry", "deviceID"
-};
-#define NUM_NKN (sizeof(nknNames)/sizeof(char *))
-
-char *
-XkbNKNDetailMaskText(unsigned detail,unsigned format)
-{
-char *buf,*prefix,*suffix;
-register int i;
-register unsigned bit;
-int len,plen,slen;
-
-
- if ((detail&XkbAllNewKeyboardEventsMask)==0) {
- char *tmp = "";
- if (format==XkbCFile) tmp= "0";
- else if (format==XkbMessage) tmp= "none";
- buf= tbGetBuffer(strlen(tmp)+1);
- strcpy(buf,tmp);
- return buf;
- }
- else if ((detail&XkbAllNewKeyboardEventsMask)==XkbAllNewKeyboardEventsMask){
- char * tmp;
- if (format==XkbCFile) tmp= "XkbAllNewKeyboardEventsMask";
- else tmp= "all";
- buf= tbGetBuffer(strlen(tmp)+1);
- strcpy(buf,tmp);
- return buf;
- }
- if (format==XkbMessage) {
- prefix= "";
- suffix= "";
- slen= plen= 0;
- }
- else {
- prefix= "XkbNKN_";
- plen= 7;
- if (format==XkbCFile)
- suffix= "Mask";
- else suffix= "";
- slen= strlen(suffix);
- }
- for (len=0,i=0,bit=1;i<NUM_NKN;i++,bit<<=1) {
- if (detail&bit) {
- if (len!=0) len+= 1; /* room for '+' or '|' */
- len+= plen+slen+strlen(nknNames[i]);
- }
- }
- buf= tbGetBuffer(len+1);
- buf[0]= '\0';
- for (len=0,i=0,bit=1;i<NUM_NKN;i++,bit<<=1) {
- if (detail&bit) {
- if (len!=0) {
- if (format==XkbCFile) buf[len++]= '|';
- else buf[len++]= '+';
- }
- if (plen) {
- strcpy(&buf[len],prefix);
- len+= plen;
- }
- strcpy(&buf[len],nknNames[i]);
- len+= strlen(nknNames[i]);
- if (slen) {
- strcpy(&buf[len],suffix);
- len+= slen;
- }
- }
- }
- buf[len++]= '\0';
- return buf;
-}
-
static char *ctrlNames[] = {
"repeatKeys",
"slowKeys",
diff --git a/xkb/xkmread.c b/xkb/xkmread.c
index fec8687..c6c1842 100644
--- a/xkb/xkmread.c
+++ b/xkb/xkmread.c
@@ -41,7 +41,7 @@
#include "inputstr.h"
#include <X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#include <X11/extensions/XKBgeom.h>
Atom
@@ -1098,18 +1098,6 @@ unsigned i,size_toc;
return 1;
}
-xkmSectionInfo *
-XkmFindTOCEntry(xkmFileInfo *finfo,xkmSectionInfo *toc,unsigned type)
-{
-register int i;
-
- for (i=0;i<finfo->num_toc;i++) {
- if (toc[i].type==type)
- return &toc[i];
- }
- return NULL;
-}
-
Bool
XkmReadFileSection( FILE * file,
xkmSectionInfo * toc,
diff-tree 9398d62f27ee1b287e4458fd8b011c10f7b59efd (from 0f75c47e0c5f4b2778930a6fabf894fc1dffd9d3)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Mar 21 00:18:24 2007 +0200
XFree86 input: Add backwards compatibility for motion history
Add the old motion history API back, as a shim around the new mi API.
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 93c89fd..913735b 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -2981,3 +2981,16 @@ xf86IsUnblank(int mode)
return TRUE;
}
}
+
+_X_EXPORT void
+xf86MotionHistoryAllocate(LocalDevicePtr local)
+{
+ AllocateMotionHistory(local->dev);
+}
+
+_X_EXPORT int
+xf86GetMotionEvents(DeviceIntPtr pDev, xTimecoord *buff, unsigned long start,
+ unsigned long stop, ScreenPtr pScreen)
+{
+ return GetMotionHistory(pDev, buff, start, stop, pScreen);
+}
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index b8f4b69..c9c8059 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -132,6 +132,9 @@ xf86ProcessCommonOptions(LocalDevicePtr
} else {
xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name);
}
+
+ /* Backwards compatibility. */
+ local->history_size = GetMotionHistorySize();
}
/***********************************************************************
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 47dbc70..b2bc8de 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -86,6 +86,9 @@
#define XI_PRIVATE(dev) \
(((LocalDevicePtr)((dev)->public.devicePrivate))->private)
+/* Stupid API backwards-compatibility. */
+#define TS_Raw 60
+#define TS_Scaled 61
#ifdef XINPUT
/* This holds the input driver entry and module information. */
@@ -144,6 +147,7 @@ typedef struct _LocalDeviceRec {
InputDriverPtr drv;
pointer module;
pointer options;
+ unsigned int history_size;
} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
typedef struct _DeviceAssocRec
diff-tree 0f75c47e0c5f4b2778930a6fabf894fc1dffd9d3 (from 80d29475b9a2ebbb303a8e324e09a15c528d5556)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Mar 21 00:12:02 2007 +0200
xfree86 input: Re-enable DGA support
Re-enable DGA support for relative mouse motion.
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 204457f..28058b5 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -51,11 +51,14 @@
static unsigned long DGAGeneration = 0;
static int DGAScreenIndex = -1;
+static int mieq_installed = 0;
static Bool DGACloseScreen(int i, ScreenPtr pScreen);
static void DGADestroyColormap(ColormapPtr pmap);
static void DGAInstallColormap(ColormapPtr pmap);
static void DGAUninstallColormap(ColormapPtr pmap);
+static void DGAHandleEvent(int screen_num, xEvent *event,
+ DeviceIntPtr device, int nevents);
static void
DGACopyModeInfo(
@@ -96,7 +99,6 @@ typedef struct {
Bool grabKeyboard;
} DGAScreenRec, *DGAScreenPtr;
-
_X_EXPORT Bool
DGAInit(
ScreenPtr pScreen,
@@ -146,7 +148,6 @@ DGAInit(
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
#endif
-
pScreen->devPrivates[DGAScreenIndex].ptr = (pointer)pScreenPriv;
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = DGACloseScreen;
@@ -157,11 +158,6 @@ DGAInit(
pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
pScreen->UninstallColormap = DGAUninstallColormap;
- /*
- * This is now set in InitOutput().
- *
- pScrn->SetDGAMode = xf86SetDGAMode;
- */
return TRUE;
}
@@ -247,12 +243,22 @@ FreeMarkedVisuals(ScreenPtr pScreen)
}
}
-
static Bool
DGACloseScreen(int i, ScreenPtr pScreen)
{
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+ if (XDGAEventBase) {
+ OsBlockSignals();
+ ProcessInputEvents();
+ mieqSetHandler(*XDGAEventBase + MotionNotify, NULL);
+ mieqSetHandler(*XDGAEventBase + ButtonPress, NULL);
+ mieqSetHandler(*XDGAEventBase + ButtonRelease, NULL);
+ mieqSetHandler(*XDGAEventBase + KeyPress, NULL);
+ mieqSetHandler(*XDGAEventBase + KeyRelease, NULL);
+ OsReleaseSignals();
+ }
+
FreeMarkedVisuals(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
@@ -462,6 +468,15 @@ DGASetInputMode(int index, Bool keyboard
{
pScreenPriv->grabMouse = mouse;
pScreenPriv->grabKeyboard = keyboard;
+
+ if (!mieq_installed) {
+ mieqSetHandler(*XDGAEventBase + MotionNotify, DGAHandleEvent);
+ mieqSetHandler(*XDGAEventBase + ButtonPress, DGAHandleEvent);
+ mieqSetHandler(*XDGAEventBase + ButtonRelease, DGAHandleEvent);
+ mieqSetHandler(*XDGAEventBase + KeyPress, DGAHandleEvent);
+ mieqSetHandler(*XDGAEventBase + KeyRelease, DGAHandleEvent);
+ mieq_installed = 1;
+ }
}
}
@@ -903,21 +918,93 @@ DGAVTSwitch(void)
return TRUE;
}
+Bool
+DGAStealKeyEvent(int index, int key_code, int is_down)
+{
+ DGAScreenPtr pScreenPriv;
+ dgaEvent de;
+
+ if(DGAScreenIndex < 0) /* no DGA */
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
-/* We have the power to steal or modify events that are about to get queued */
+ if(!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */
+ return FALSE;
+
+ de.u.u.type = *XDGAEventBase + (is_down ? KeyPress : KeyRelease);
+ de.u.u.detail = key_code;
+ de.u.event.time = GetTimeInMillis();
+ mieqEnqueue (inputInfo.keyboard, (xEvent *) &de);
+
+ return TRUE;
+}
+
+static int DGAMouseX, DGAMouseY;
Bool
-DGAStealKeyEvent(int index, xEvent *e)
+DGAStealMotionEvent(int index, int dx, int dy)
{
-}
+ DGAScreenPtr pScreenPriv;
+ dgaEvent de;
-static int DGAMouseX, DGAMouseY;
+ if(DGAScreenIndex < 0) /* no DGA */
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if(!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */
+ return FALSE;
+
+ DGAMouseX += dx;
+ if (DGAMouseX < 0)
+ DGAMouseX = 0;
+ else if (DGAMouseX > screenInfo.screens[index]->width)
+ DGAMouseX = screenInfo.screens[index]->width;
+ DGAMouseY += dy;
+ if (DGAMouseY < 0)
+ DGAMouseY = 0;
+ else if (DGAMouseY > screenInfo.screens[index]->height)
+ DGAMouseY = screenInfo.screens[index]->height;
+ de.u.u.type = *XDGAEventBase + MotionNotify;
+ de.u.u.detail = 0;
+ de.u.event.time = GetTimeInMillis();
+ de.u.event.dx = dx;
+ de.u.event.dy = dy;
+ de.u.event.pad1 = DGAMouseX;
+ de.u.event.pad2 = DGAMouseY;
+ mieqEnqueue (inputInfo.pointer, (xEvent *) &de);
+ return TRUE;
+}
Bool
-DGAStealMouseEvent(int index, xEvent *e, int dx, int dy)
+DGAStealButtonEvent(int index, int button, int is_down)
{
+ DGAScreenPtr pScreenPriv;
+ dgaEvent de;
+
+ if (DGAScreenIndex < 0)
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if (!pScreenPriv || !pScreenPriv->grabMouse)
+ return FALSE;
+
+ de.u.u.type = *XDGAEventBase + (is_down ? ButtonPress : ButtonRelease);
+ de.u.u.detail = button;
+ de.u.event.time = GetTimeInMillis();
+ de.u.event.dx = 0;
+ de.u.event.dy = 0;
+ de.u.event.pad1 = DGAMouseX;
+ de.u.event.pad2 = DGAMouseY;
+ mieqEnqueue (inputInfo.pointer, (xEvent *) &de);
+
+ return TRUE;
}
+/* We have the power to steal or modify events that are about to get queued */
+
Bool
DGAIsDgaEvent (xEvent *e)
{
@@ -1124,39 +1211,6 @@ DGAProcessPointerEvent (ScreenPtr pScree
}
}
-Bool
-DGADeliverEvent (ScreenPtr pScreen, xEvent *e)
-{
- dgaEvent *de = (dgaEvent *) e;
- DGAScreenPtr pScreenPriv;
- int coreEquiv;
-
- /* no DGA */
- if (DGAScreenIndex < 0 || XDGAEventBase == 0)
- return FALSE;
- pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
-
- /* DGA not initialized on this screen */
- if (!pScreenPriv)
- return FALSE;
-
- coreEquiv = de->u.u.type - *XDGAEventBase;
- /* Not a DGA event */
- if (coreEquiv < KeyPress || coreEquiv > MotionNotify)
- return FALSE;
-
- switch (coreEquiv) {
- case KeyPress:
- case KeyRelease:
- DGAProcessKeyboardEvent (pScreen, de, inputInfo.keyboard);
- break;
- default:
- DGAProcessPointerEvent (pScreen, de, inputInfo.pointer);
- break;
- }
- return TRUE;
-}
-
_X_EXPORT Bool
DGAOpenFramebuffer(
int index,
@@ -1215,3 +1269,35 @@ DGAGetOldDGAMode(int index)
return 0;
}
+static void
+DGAHandleEvent(int screen_num, xEvent *event, DeviceIntPtr device, int nevents)
+{
+ dgaEvent *de = (dgaEvent *) event;
+ ScreenPtr pScreen = screenInfo.screens[screen_num];
+ DGAScreenPtr pScreenPriv;
+ int coreEquiv;
+
+ /* no DGA */
+ if (DGAScreenIndex < 0 || XDGAEventBase == 0)
+ return;
+ pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ /* DGA not initialized on this screen */
+ if (!pScreenPriv)
+ return;
+
+ coreEquiv = de->u.u.type - *XDGAEventBase;
+ /* Not a DGA event; shouldn't happen, but you never know. */
+ if (coreEquiv < KeyPress || coreEquiv > MotionNotify)
+ return;
+
+ switch (coreEquiv) {
+ case KeyPress:
+ case KeyRelease:
+ DGAProcessKeyboardEvent (pScreen, de, inputInfo.keyboard);
+ break;
+ default:
+ DGAProcessPointerEvent (pScreen, de, inputInfo.pointer);
+ break;
+ }
+}
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 16e330d..b8f4b69 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -90,6 +90,10 @@
#include "mi.h"
+#ifdef XFreeXDGA
+#include "dgaproc.h"
+#endif
+
xEvent *xf86Events = NULL;
static Bool
@@ -395,10 +399,12 @@ xf86PostMotionEvent(DeviceIntPtr device,
{
va_list var;
int i = 0, nevents = 0;
+ int dx, dy;
Bool drag = xf86SendDragEvents(device);
int *valuators = NULL;
int flags = 0;
xEvent *xE = NULL;
+ int index;
if (is_absolute)
flags = POINTER_ABSOLUTE;
@@ -412,6 +418,22 @@ xf86PostMotionEvent(DeviceIntPtr device,
valuators[i] = va_arg(var, int);
va_end(var);
+#if XFreeXDGA
+ if (first_valuator == 0 && num_valuators >= 2) {
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (is_absolute) {
+ dx = valuators[0] - device->valuator->lastx;
+ dy = valuators[1] - device->valuator->lasty;
+ }
+ else {
+ dx = valuators[0];
+ dy = valuators[1];
+ }
+ if (DGAStealMotionEvent(index, dx, dy))
+ goto out;
+ }
+#endif
+
if (!xf86Events)
xf86Events = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum());
if (!xf86Events)
@@ -430,6 +452,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
}
}
+out:
xfree(valuators);
}
@@ -476,6 +499,13 @@ xf86PostButtonEvent(DeviceIntPtr device,
va_list var;
int *valuators = NULL;
int i = 0, nevents = 0;
+ int index;
+
+#if XFreeXDGA
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (DGAStealButtonEvent(index, button, is_down))
+ return;
+#endif
valuators = xcalloc(sizeof(int), num_valuators);
@@ -552,6 +582,13 @@ xf86PostKeyboardEvent(DeviceIntPtr
int is_down)
{
int nevents = 0, i = 0;
+ int index;
+
+#if XFreeXDGA
+ index = miPointerGetScreen(inputInfo.pointer)->myNum;
+ if (DGAStealKeyEvent(index, key_code, is_down))
+ return;
+#endif
if (!xf86Events)
xf86Events = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum());
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index fe65643..47dbc70 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -191,6 +191,10 @@ InputInfoPtr xf86AllocateInput(InputDriv
InputDriverPtr xf86LookupInputDriver(const char *name);
InputInfoPtr xf86LookupInput(const char *name);
void xf86DeleteInput(InputInfoPtr pInp, int flags);
+void xf86MotionHistoryAllocate(LocalDevicePtr local);
+int xf86GetMotionEvents(DeviceIntPtr dev, xTimecoord *buff,
+ unsigned long start, unsigned long stop,
+ ScreenPtr pScreen);
/* xf86Option.c */
void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h
index 5e424af..aaea4e2 100644
--- a/hw/xfree86/dixmods/extmod/dgaproc.h
+++ b/hw/xfree86/dixmods/extmod/dgaproc.h
@@ -120,8 +120,9 @@ int DGAGetOldDGAMode(int Index);
int DGAGetModeInfo(int Index, XDGAModePtr mode, int num);
Bool DGAVTSwitch(void);
-Bool DGAStealMouseEvent(int Index, xEvent *e, int dx, int dy);
-Bool DGAStealKeyEvent(int Index, xEvent *e);
+Bool DGAStealButtonEvent(int Index, int button, int is_down);
+Bool DGAStealMotionEvent(int Index, int dx, int dy);
+Bool DGAStealKeyEvent(int Index, int key_code, int is_down);
Bool DGAIsDgaEvent (xEvent *e);
Bool DGADeliverEvent (ScreenPtr pScreen, xEvent *e);
diff-tree 80d29475b9a2ebbb303a8e324e09a15c528d5556 (from b8df961843a95b29258ae9c5d46ccfc620d8de1c)
Author: Daniel Stone <daniel at fooishbar.org>
Date: Wed Mar 21 00:10:38 2007 +0200
mieq: Allow event handlers for arbitrary events to be set
Allow arbitrary events to use mieq by letting custom handlers be set.
diff --git a/mi/mi.h b/mi/mi.h
index 8d9d120..53b5c44 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -186,6 +186,9 @@ extern void mieqProcessInputEvents(
void
);
+typedef void (*mieqHandler)(int, xEventPtr, DeviceIntPtr, int);
+void mieqSetHandler(int event, mieqHandler handler);
+
/* miexpose.c */
extern RegionPtr miHandleExposures(
diff --git a/mi/mieq.c b/mi/mieq.c
index 507cdd3..5bd87eb 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -74,6 +74,7 @@ typedef struct _EventQueue {
EventRec events[QUEUE_SIZE]; /* static allocation for signals */
ScreenPtr pEnqueueScreen; /* screen events are being delivered to */
ScreenPtr pDequeueScreen; /* screen events are being dispatched to */
+ mieqHandler handlers[128]; /* custom event handler */
} EventQueueRec, *EventQueuePtr;
static EventQueueRec miEventQueue;
@@ -81,11 +82,15 @@ static EventQueueRec miEventQueue;
Bool
mieqInit()
{
+ int i;
+
miEventQueue.head = miEventQueue.tail = 0;
miEventQueue.lastEventTime = GetTimeInMillis ();
miEventQueue.lastMotion = FALSE;
miEventQueue.pEnqueueScreen = screenInfo.screens[0];
miEventQueue.pDequeueScreen = miEventQueue.pEnqueueScreen;
+ for (i = 0; i < 128; i++)
+ miEventQueue.handlers[i] = NULL;
SetInputCheck(&miEventQueue.head, &miEventQueue.tail);
return TRUE;
}
@@ -178,6 +183,16 @@ mieqSwitchScreen(ScreenPtr pScreen, Bool
miEventQueue.pDequeueScreen = pScreen;
}
+void
+mieqSetHandler(int event, mieqHandler handler)
+{
+ if (handler && miEventQueue.handlers[event])
+ ErrorF("mieq: warning: overriding existing handler %p with %p for "
+ "event %d\n", miEventQueue.handlers[event], handler, event);
+
+ miEventQueue.handlers[event] = handler;
+}
+
/* Call this from ProcessInputEvents(). */
void
mieqProcessInputEvents()
@@ -215,6 +230,15 @@ mieqProcessInputEvents()
else
++miEventQueue.head;
+ /* If someone's registered a custom event handler, let them
+ * steal it. */
+ if (miEventQueue.handlers[e->event->u.u.type]) {
+ miEventQueue.handlers[e->event->u.u.type](miEventQueue.pDequeueScreen->myNum,
+ e->event, dev,
+ e->nevents);
+ return;
+ }
+
/* If this is a core event, make sure our keymap, et al, is
* changed to suit. */
if (e->event[0].u.u.type == KeyPress ||
diff-tree b8df961843a95b29258ae9c5d46ccfc620d8de1c (from 720f302d241e88e6e9f2962207da1aa9a79728b7)
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date: Mon Mar 19 18:03:26 2007 -0700
Define XF86PM on Solaris x86 builds now that we have sun_apm.c
diff --git a/configure.ac b/configure.ac
index fe77709..14c4ccb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1413,6 +1413,8 @@ return 0;}
fi
if test "${OS_MINOR}" -lt 8 ; then
solaris_usl_console="yes"
+ else
+ XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
fi
;;
*)
diff-tree 720f302d241e88e6e9f2962207da1aa9a79728b7 (from b5a8a71e64c76b8dd42962cbd7984215c6ce4aa8)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Sat Mar 17 20:14:05 2007 -0700
Slow down DDC I2C bus using a RiseFallTime of 20us for old monitors.
This time value makes the bus run slowly enough for even the least reliable
of monitors. Thanks to Pavel Troller for finding the necessary change.
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 0f24c52..8080c8d 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -337,6 +337,12 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pB
unsigned char *R_Buffer;
int i;
+ /*
+ * Slow down the bus so that older monitors don't
+ * miss things.
+ */
+ pBus->RiseFallTime = 20;
+
if (!(dev = xf86I2CFindDev(pBus, 0x00A0))) {
dev = xf86CreateI2CDevRec();
dev->DevName = "ddc2";
diff-tree b5a8a71e64c76b8dd42962cbd7984215c6ce4aa8 (from 2489dae9f7def788910eee5733931392df83a0d6)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Sat Mar 17 17:26:11 2007 -0700
Remove extra (and wrong) I2C ByteTimeout setting in DDC code.
The DDC code sets the I2C timeouts to VESA standards, except that it had an
extra setting of the ByteTimeout value which was wrong (off by a factor of
50). Removing this should help DDC work on many more monitors. Note that the
Intel driver duplicated these settings, along with the error. Yay for cult
and paste coding.
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 4ce585c..0f24c52 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -344,7 +344,6 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pB
dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
dev->StartTimeout = 550;
dev->BitTimeout = 40;
- dev->ByteTimeout = 40;
dev->AcknTimeout = 40;
dev->pI2CBus = pBus;
diff-tree 2489dae9f7def788910eee5733931392df83a0d6 (from 9d0c3b52f25df89738fb1a62ccffda8c8cbb4689)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Thu Mar 15 20:26:07 2007 -0700
Correct ref counting of RRMode structures
RRModes are referenced by the resource db, RROutput and RRCrtc structures.
Ensure that the mode reference count is decremented each time a reference is
lost from one of these sources. The missing destroys were in
RRCrtcDestroyResource and RROutputDestroyResource, which only happen at
server reset time, so modes would be unavailable in subsequent server
generations.
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 315dd6c..ecf5bb2 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -361,6 +361,8 @@ RRCrtcDestroyResource (pointer value, XI
}
if (crtc->gammaRed)
xfree (crtc->gammaRed);
+ if (crtc->mode)
+ RRModeDestroy (crtc->mode);
xfree (crtc);
return 1;
}
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 6e95c95..160071b 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -406,9 +406,12 @@ RROutputDestroyResource (pointer value,
}
}
}
- /* XXX destroy all modes? */
if (output->modes)
+ {
+ for (m = 0; m < output->numModes; m++)
+ RRModeDestroy (output->modes[m]);
xfree (output->modes);
+ }
for (m = 0; m < output->numUserModes; m++)
RRModeDestroy (output->userModes[m]);
diff-tree 9d0c3b52f25df89738fb1a62ccffda8c8cbb4689 (from 2c93083edd29a65e73bb2e8eff9d353e92845c9b)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Tue Feb 20 23:04:26 2007 -0800
Eliminate RRModeRec devPrivate field.
The xf86 mode setting code was mis-using this field to try and store a
pointer to a DisplayModeRec, however, each output has its own copy of every
DisplayModeRec leaving the one in in the RRModeRec devPrivate field pointing
at a random DisplayModeRec.
Instead of attempting to rectify this, eliminating the devPrivate entirely
turned out to be very easy; the DDX code now accepts an arbitrary RRModeRec
structure and set that to the hardware, converting it on the fly to a
DisplayModeRec as needed.
(cherry picked from commit 3506b9376c2b0db09bfff58d64e07af88a6e8195)
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 73647a6..4213fea 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -556,6 +556,56 @@ xf86RandR12GetOriginalVirtualSize(ScrnIn
}
#if RANDR_12_INTERFACE
+
+#define FLAG_BITS (RR_HSyncPositive | \
+ RR_HSyncNegative | \
+ RR_VSyncPositive | \
+ RR_VSyncNegative | \
+ RR_Interlace | \
+ RR_DoubleScan | \
+ RR_CSync | \
+ RR_CSyncPositive | \
+ RR_CSyncNegative | \
+ RR_HSkewPresent | \
+ RR_BCast | \
+ RR_PixelMultiplex | \
+ RR_DoubleClock | \
+ RR_ClockDivideBy2)
+
+static Bool
+xf86RandRModeMatches (RRModePtr randr_mode,
+ DisplayModePtr mode)
+{
+#if 0
+ if (match_name)
+ {
+ /* check for same name */
+ int len = strlen (mode->name);
+ if (randr_mode->mode.nameLength != len) return FALSE;
+ if (memcmp (randr_mode->name, mode->name, len) != 0) return FALSE;
+ }
+#endif
+
+ /* check for same timings */
+ if (randr_mode->mode.dotClock / 1000 != mode->Clock) return FALSE;
+ if (randr_mode->mode.width != mode->HDisplay) return FALSE;
+ if (randr_mode->mode.hSyncStart != mode->HSyncStart) return FALSE;
+ if (randr_mode->mode.hSyncEnd != mode->HSyncEnd) return FALSE;
+ if (randr_mode->mode.hTotal != mode->HTotal) return FALSE;
+ if (randr_mode->mode.hSkew != mode->HSkew) return FALSE;
+ if (randr_mode->mode.height != mode->VDisplay) return FALSE;
+ if (randr_mode->mode.vSyncStart != mode->VSyncStart) return FALSE;
+ if (randr_mode->mode.vSyncEnd != mode->VSyncEnd) return FALSE;
+ if (randr_mode->mode.vTotal != mode->VTotal) return FALSE;
+
+ /* check for same flags (using only the XF86 valid flag bits) */
+ if ((randr_mode->mode.modeFlags & FLAG_BITS) != (mode->Flags & FLAG_BITS))
+ return FALSE;
+
+ /* everything matches */
+ return TRUE;
+}
+
static Bool
xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc)
{
@@ -594,12 +644,15 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_c
* We make copies of modes, so pointer equality
* isn't sufficient
*/
- for (j = 0; j < randr_output->numModes; j++)
+ for (j = 0; j < randr_output->numModes + randr_output->numUserModes; j++)
{
- DisplayModePtr outMode = randr_output->modes[j]->devPrivate;
- if (xf86ModesEqual(mode, outMode))
+ RRModePtr m = (j < randr_output->numModes ?
+ randr_output->modes[j] :
+ randr_output->userModes[j-randr_output->numModes]);
+
+ if (xf86RandRModeMatches (m, mode))
{
- randr_mode = randr_output->modes[j];
+ randr_mode = m;
break;
}
}
@@ -611,6 +664,39 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_c
return ret;
}
+/*
+ * Convert a RandR mode to a DisplayMode
+ */
+static void
+xf86RandRModeConvert (ScrnInfoPtr scrn,
+ RRModePtr randr_mode,
+ DisplayModePtr mode)
+{
+ mode->prev = NULL;
+ mode->next = NULL;
+ mode->name = NULL;
+ mode->status = MODE_OK;
+ mode->type = 0;
+
+ mode->Clock = randr_mode->mode.dotClock / 1000;
+
+ mode->HDisplay = randr_mode->mode.width;
+ mode->HSyncStart = randr_mode->mode.hSyncStart;
+ mode->HSyncEnd = randr_mode->mode.hSyncEnd;
+ mode->HTotal = randr_mode->mode.hTotal;
+ mode->HSkew = randr_mode->mode.hSkew;
+
+ mode->VDisplay = randr_mode->mode.height;
+ mode->VSyncStart = randr_mode->mode.vSyncStart;
+ mode->VSyncEnd = randr_mode->mode.vSyncEnd;
+ mode->VTotal = randr_mode->mode.vTotal;
+ mode->VScan = 0;
+
+ mode->Flags = randr_mode->mode.modeFlags & FLAG_BITS;
+
+ xf86SetModeCrtc (mode, scrn->adjustFlags);
+}
+
static Bool
xf86RandR12CrtcSet (ScreenPtr pScreen,
RRCrtcPtr randr_crtc,
@@ -624,16 +710,15 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86CrtcPtr crtc = randr_crtc->devPrivate;
- DisplayModePtr mode = randr_mode ? randr_mode->devPrivate : NULL;
Bool changed = FALSE;
int o, ro;
xf86CrtcPtr *save_crtcs;
Bool save_enabled = crtc->enabled;
save_crtcs = ALLOCATE_LOCAL(config->num_crtc * sizeof (xf86CrtcPtr));
- if ((mode != NULL) != crtc->enabled)
+ if ((randr_mode != NULL) != crtc->enabled)
changed = TRUE;
- else if (mode && !xf86ModesEqual (&crtc->mode, mode))
+ else if (randr_mode && !xf86RandRModeMatches (randr_mode, &crtc->mode))
changed = TRUE;
if (rotation != crtc->rotation)
@@ -667,11 +752,14 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
/* XXX need device-independent mode setting code through an API */
if (changed)
{
- crtc->enabled = mode != NULL;
+ crtc->enabled = randr_mode != NULL;
- if (mode)
+ if (randr_mode)
{
- if (!xf86CrtcSetMode (crtc, mode, rotation, x, y))
+ DisplayModeRec mode;
+
+ xf86RandRModeConvert (pScrn, randr_mode, &mode);
+ if (!xf86CrtcSetMode (crtc, &mode, rotation, x, y))
{
crtc->enabled = save_enabled;
for (o = 0; o < config->num_output; o++)
@@ -685,7 +773,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
/*
* Save the last successful setting for EnterVT
*/
- crtc->desiredMode = *mode;
+ crtc->desiredMode = mode;
crtc->desiredRotation = rotation;
crtc->desiredX = x;
crtc->desiredY = y;
@@ -733,33 +821,12 @@ xf86RandR12OutputValidateMode (ScreenPtr
RROutputPtr randr_output,
RRModePtr randr_mode)
{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
xf86OutputPtr output = randr_output->devPrivate;
- DisplayModePtr mode = randr_mode->devPrivate;
+ DisplayModeRec mode;
- if (!mode)
- {
- mode = xalloc (sizeof (DisplayModeRec) + randr_mode->mode.nameLength + 1);
- if (!mode)
- return FALSE;
- mode->name = (char *) mode + 1;
- memcpy (mode->name, randr_mode->name, randr_mode->mode.nameLength);
- mode->name[randr_mode->mode.nameLength] = '\0';
- mode->Clock = randr_mode->mode.dotClock / 1000;
- mode->HDisplay = randr_mode->mode.width;
- mode->HSyncStart = randr_mode->mode.hSyncStart;
- mode->HSyncEnd = randr_mode->mode.hSyncEnd;
- mode->HTotal = randr_mode->mode.hTotal;
- mode->HSkew = randr_mode->mode.hSkew;
-
- mode->VDisplay = randr_mode->mode.height;
- mode->VSyncStart = randr_mode->mode.vSyncStart;
- mode->VSyncEnd = randr_mode->mode.vSyncEnd;
- mode->VTotal = randr_mode->mode.vTotal;
-
- mode->Flags = randr_mode->mode.modeFlags;
- randr_mode->devPrivate = mode;
- }
- if (!output->funcs->mode_valid (output, mode))
+ xf86RandRModeConvert (pScrn, randr_mode, &mode);
+ if (output->funcs->mode_valid (output, &mode) != MODE_OK)
return FALSE;
return TRUE;
}
@@ -767,13 +834,6 @@ xf86RandR12OutputValidateMode (ScreenPtr
static void
xf86RandR12ModeDestroy (ScreenPtr pScreen, RRModePtr randr_mode)
{
- DisplayModePtr mode = randr_mode->devPrivate;
-
- if (mode)
- {
- xfree (mode);
- randr_mode->devPrivate = NULL;
- }
}
/**
@@ -822,7 +882,6 @@ xf86RROutputSetModes (RROutputPtr randr_
rrmode = RRModeGet (&modeInfo, mode->name);
if (rrmode) {
- rrmode->devPrivate = mode;
rrmodes[nmode++] = rrmode;
npreferred += pref;
}
diff --git a/randr/randrstr.h b/randr/randrstr.h
index f6d35cf..0dee999 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -79,7 +79,6 @@ struct _rrMode {
int refcnt;
xRRModeInfo mode;
char *name;
- void *devPrivate;
ScreenPtr userScreen;
};
diff-tree 2c93083edd29a65e73bb2e8eff9d353e92845c9b (from 3bffb281260476d2f74f0bf451d85d2f7cacd6c4)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Sun Feb 18 23:49:38 2007 -0800
Add support for user-defined modelines in RandR.
The RandR protocol spec has several requests in support of user-defined
modes, but the implementation was stubbed out inside the X server. Fill out
the DIX portion and start on the xf86 DDX portion. It might be necessary to
add more code to the DDX to insert the user-defined modes into the output
mode list.
(cherry picked from commit 63cc2a51ef87130c632a874672a8c9167f14314e)
Conflicts:
randr/randrstr.h
Updated code to work in master with recent security API changes.
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index ce780b6..73647a6 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -728,6 +728,54 @@ xf86RandR12OutputSetProperty (ScreenPtr
return output->funcs->set_property(output, property, value);
}
+static Bool
+xf86RandR12OutputValidateMode (ScreenPtr pScreen,
+ RROutputPtr randr_output,
+ RRModePtr randr_mode)
+{
+ xf86OutputPtr output = randr_output->devPrivate;
+ DisplayModePtr mode = randr_mode->devPrivate;
+
+ if (!mode)
+ {
+ mode = xalloc (sizeof (DisplayModeRec) + randr_mode->mode.nameLength + 1);
+ if (!mode)
+ return FALSE;
+ mode->name = (char *) mode + 1;
+ memcpy (mode->name, randr_mode->name, randr_mode->mode.nameLength);
+ mode->name[randr_mode->mode.nameLength] = '\0';
+ mode->Clock = randr_mode->mode.dotClock / 1000;
+ mode->HDisplay = randr_mode->mode.width;
+ mode->HSyncStart = randr_mode->mode.hSyncStart;
+ mode->HSyncEnd = randr_mode->mode.hSyncEnd;
+ mode->HTotal = randr_mode->mode.hTotal;
+ mode->HSkew = randr_mode->mode.hSkew;
+
+ mode->VDisplay = randr_mode->mode.height;
+ mode->VSyncStart = randr_mode->mode.vSyncStart;
+ mode->VSyncEnd = randr_mode->mode.vSyncEnd;
+ mode->VTotal = randr_mode->mode.vTotal;
+
+ mode->Flags = randr_mode->mode.modeFlags;
+ randr_mode->devPrivate = mode;
+ }
+ if (!output->funcs->mode_valid (output, mode))
+ return FALSE;
+ return TRUE;
+}
+
+static void
+xf86RandR12ModeDestroy (ScreenPtr pScreen, RRModePtr randr_mode)
+{
+ DisplayModePtr mode = randr_mode->devPrivate;
+
+ if (mode)
+ {
+ xfree (mode);
+ randr_mode->devPrivate = NULL;
+ }
+}
+
/**
* Given a list of xf86 modes and a RandR Output object, construct
* RandR modes and assign them to the output
@@ -958,6 +1006,8 @@ xf86RandR12Init12 (ScreenPtr pScreen)
rp->rrCrtcSet = xf86RandR12CrtcSet;
rp->rrCrtcSetGamma = xf86RandR12CrtcSetGamma;
rp->rrOutputSetProperty = xf86RandR12OutputSetProperty;
+ rp->rrOutputValidateMode = xf86RandR12OutputValidateMode;
+ rp->rrModeDestroy = xf86RandR12ModeDestroy;
rp->rrSetConfig = NULL;
pScrn->PointerMoved = xf86RandR12PointerMoved;
if (!xf86RandR12CreateObjects12 (pScreen))
diff --git a/randr/mirandr.c b/randr/mirandr.c
index 0b763e1..47136fb 100644
--- a/randr/mirandr.c
+++ b/randr/mirandr.c
@@ -73,6 +73,20 @@ miRROutputSetProperty (ScreenPtr pSc
return TRUE;
}
+Bool
+miRROutputValidateMode (ScreenPtr pScreen,
+ RROutputPtr output,
+ RRModePtr mode)
+{
+ return FALSE;
+}
+
+void
+miRRModeDestroy (ScreenPtr pScreen,
+ RRModePtr mode)
+{
+}
+
/*
* This function assumes that only a single depth can be
* displayed at a time, but that all visuals of that depth
@@ -102,7 +116,8 @@ miRandRInit (ScreenPtr pScreen)
pScrPriv->rrCrtcSet = miRRCrtcSet;
pScrPriv->rrCrtcSetGamma = miRRCrtcSetGamma;
pScrPriv->rrOutputSetProperty = miRROutputSetProperty;
-
+ pScrPriv->rrOutputValidateMode = miRROutputValidateMode;
+ pScrPriv->rrModeDestroy = miRRModeDestroy;
RRScreenSetSizeRange (pScreen,
pScreen->width, pScreen->height,
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 5058212..f6d35cf 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -80,7 +80,7 @@ struct _rrMode {
xRRModeInfo mode;
char *name;
void *devPrivate;
- Bool userDefined;
+ ScreenPtr userScreen;
};
struct _rrPropertyValue {
@@ -135,6 +135,8 @@ struct _rrOutput {
int numModes;
int numPreferred;
RRModePtr *modes;
+ int numUserModes;
+ RRModePtr *userModes;
Bool changed;
RRPropertyPtr properties;
void *devPrivate;
@@ -164,6 +166,13 @@ typedef Bool (*RROutputSetPropertyProcPt
Atom property,
RRPropertyValuePtr value);
+typedef Bool (*RROutputValidateModeProcPtr) (ScreenPtr pScreen,
+ RROutputPtr output,
+ RRModePtr mode);
+
+typedef void (*RRModeDestroyProcPtr) (ScreenPtr pScreen,
+ RRModePtr mode);
+
#endif
typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations);
@@ -208,6 +217,8 @@ typedef struct _rrScrPriv {
RRCrtcSetProcPtr rrCrtcSet;
RRCrtcSetGammaProcPtr rrCrtcSetGamma;
RROutputSetPropertyProcPtr rrOutputSetProperty;
+ RROutputValidateModeProcPtr rrOutputValidateMode;
+ RRModeDestroyProcPtr rrModeDestroy;
#endif
/*
@@ -394,6 +405,15 @@ miRROutputSetProperty (ScreenPtr pSc
Atom property,
RRPropertyValuePtr value);
+Bool
+miRROutputValidateMode (ScreenPtr pScreen,
+ RROutputPtr output,
+ RRModePtr mode);
+
+void
+miRRModeDestroy (ScreenPtr pScreen,
+ RRModePtr mode);
+
/* randr.c */
/*
* Send all pending events
@@ -549,6 +569,11 @@ Bool
RRCrtcSetRotations (RRCrtcPtr crtc,
Rotation rotations);
+/*
+ * Return the area of the frame buffer scanned out by the crtc,
+ * taking into account the current mode and rotation
+ */
+
void
RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
@@ -672,6 +697,14 @@ RROutputSetModes (RROutputPtr output,
int numModes,
int numPreferred);
+int
+RROutputAddUserMode (RROutputPtr output,
+ RRModePtr mode);
+
+int
+RROutputDeleteUserMode (RROutputPtr output,
+ RRModePtr mode);
+
Bool
RROutputSetCrtcs (RROutputPtr output,
RRCrtcPtr *crtcs,
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index db506f4..315dd6c 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -666,10 +666,15 @@ ProcRRSetCrtcConfig (ClientPtr client)
return BadMatch;
}
/* validate mode for this output */
- for (j = 0; j < outputs[i]->numModes; j++)
- if (outputs[i]->modes[j] == mode)
+ for (j = 0; j < outputs[i]->numModes + outputs[i]->numUserModes; j++)
+ {
+ RRModePtr m = (j < outputs[i]->numModes ?
+ outputs[i]->modes[j] :
+ outputs[i]->userModes[j - outputs[i]->numModes]);
+ if (m == mode)
break;
- if (j == outputs[i]->numModes)
+ }
+ if (j == outputs[i]->numModes + outputs[i]->numUserModes)
{
if (outputs)
xfree (outputs);
diff --git a/randr/rrinfo.c b/randr/rrinfo.c
index 797cdb1..549d501 100644
--- a/randr/rrinfo.c
+++ b/randr/rrinfo.c
@@ -157,9 +157,11 @@ RRScanOldConfig (ScreenPtr pScreen, Rota
pScrPriv->nSizes = 0;
/* find size bounds */
- for (i = 0; i < output->numModes; i++)
+ for (i = 0; i < output->numModes + output->numUserModes; i++)
{
- RRModePtr mode = output->modes[i];
+ RRModePtr mode = (i < output->numModes ?
+ output->modes[i] :
+ output->userModes[i-output->numModes]);
CARD16 width = mode->mode.width;
CARD16 height = mode->mode.height;
diff --git a/randr/rrmode.c b/randr/rrmode.c
index 261e1b7..1117581 100644
--- a/randr/rrmode.c
+++ b/randr/rrmode.c
@@ -48,25 +48,13 @@ RRModeEqual (xRRModeInfo *a, xRRModeInfo
static int num_modes;
static RRModePtr *modes;
-RRModePtr
-RRModeGet (xRRModeInfo *modeInfo,
- const char *name)
+static RRModePtr
+RRModeCreate (xRRModeInfo *modeInfo,
+ const char *name,
+ ScreenPtr userScreen)
{
- int i;
- RRModePtr mode;
- RRModePtr *newModes;
-
- for (i = 0; i < num_modes; i++)
- {
- mode = modes[i];
- if (RRModeEqual (&mode->mode, modeInfo) &&
- !memcmp (name, mode->name, modeInfo->nameLength))
- {
- ++mode->refcnt;
- return mode;
- }
- }
-
+ RRModePtr mode, *newModes;
+
if (!RRInit ())
return NULL;
@@ -78,7 +66,7 @@ RRModeGet (xRRModeInfo *modeInfo,
mode->name = (char *) (mode + 1);
memcpy (mode->name, name, modeInfo->nameLength);
mode->name[modeInfo->nameLength] = '\0';
- mode->userDefined = FALSE;
+ mode->userScreen = userScreen;
if (num_modes)
newModes = xrealloc (modes, (num_modes + 1) * sizeof (RRModePtr));
@@ -104,11 +92,75 @@ RRModeGet (xRRModeInfo *modeInfo,
return mode;
}
+static RRModePtr
+RRModeFindByName (const char *name,
+ CARD16 nameLength)
+{
+ int i;
+ RRModePtr mode;
+
+ for (i = 0; i < num_modes; i++)
+ {
+ mode = modes[i];
+ if (mode->mode.nameLength == nameLength &&
+ !memcmp (name, mode->name, nameLength))
+ {
+ return mode;
+ }
+ }
+ return NULL;
+}
+
+RRModePtr
+RRModeGet (xRRModeInfo *modeInfo,
+ const char *name)
+{
+ int i;
+
+ for (i = 0; i < num_modes; i++)
+ {
+ RRModePtr mode = modes[i];
+ if (RRModeEqual (&mode->mode, modeInfo) &&
+ !memcmp (name, mode->name, modeInfo->nameLength))
+ {
+ ++mode->refcnt;
+ return mode;
+ }
+ }
+
+ return RRModeCreate (modeInfo, name, NULL);
+}
+
+static RRModePtr
+RRModeCreateUser (ScreenPtr pScreen,
+ xRRModeInfo *modeInfo,
+ const char *name,
+ int *error)
+{
+ RRModePtr mode;
+
+ mode = RRModeFindByName (name, modeInfo->nameLength);
+ if (mode)
+ {
+ *error = BadName;
+ return NULL;
+ }
+
+ mode = RRModeCreate (modeInfo, name, pScreen);
+ if (!mode)
+ {
+ *error = BadAlloc;
+ return NULL;
+ }
+ *error = Success;
+ return mode;
+}
+
RRModePtr *
RRModesForScreen (ScreenPtr pScreen, int *num_ret)
{
rrScrPriv(pScreen);
- int o, c;
+ int o, c, m;
RRModePtr *screen_modes;
int num_screen_modes = 0;
@@ -122,9 +174,11 @@ RRModesForScreen (ScreenPtr pScreen, int
RROutputPtr output = pScrPriv->outputs[o];
int m, n;
- for (m = 0; m < output->numModes; m++)
+ for (m = 0; m < output->numModes + output->numUserModes; m++)
{
- RRModePtr mode = output->modes[m];
+ RRModePtr mode = (m < output->numModes ?
+ output->modes[m] :
+ output->userModes[m-output->numModes]);
for (n = 0; n < num_screen_modes; n++)
if (screen_modes[n] == mode)
break;
@@ -150,6 +204,23 @@ RRModesForScreen (ScreenPtr pScreen, int
if (n == num_screen_modes)
screen_modes[num_screen_modes++] = mode;
}
+ /*
+ * Add all user modes for this screen
+ */
+ for (m = 0; m < num_modes; m++)
+ {
+ RRModePtr mode = modes[m];
+ int n;
+
+ if (mode->userScreen != pScreen)
+ continue;
+ for (n = 0; n < num_screen_modes; n++)
+ if (screen_modes[n] == mode)
+ break;
+ if (n == num_screen_modes)
+ screen_modes[num_screen_modes++] = mode;
+ }
+
*num_ret = num_screen_modes;
return screen_modes;
}
@@ -205,38 +276,122 @@ int
ProcRRCreateMode (ClientPtr client)
{
REQUEST(xRRCreateModeReq);
+ xRRCreateModeReply rep;
+ WindowPtr pWin;
+ ScreenPtr pScreen;
+ rrScrPrivPtr pScrPriv;
+ xRRModeInfo *modeInfo;
+ long units_after;
+ char *name;
+ int error, rc;
+ RRModePtr mode;
+
+ REQUEST_AT_LEAST_SIZE (xRRCreateModeReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ pScreen = pWin->drawable.pScreen;
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ modeInfo = &stuff->modeInfo;
+ name = (char *) (stuff + 1);
+ units_after = (stuff->length - (sizeof (xRRCreateModeReq) >> 2));
+
+ /* check to make sure requested name fits within the data provided */
+ if ((int) (modeInfo->nameLength + 3) >> 2 > units_after)
+ return BadLength;
+
+ mode = RRModeCreateUser (pScreen, modeInfo, name, &error);
+ if (!mode)
+ return error;
+
+ rep.type = X_Reply;
+ rep.pad0 = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.mode = mode->mode.id;
+ if (client->swapped)
+ {
+ int n;
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.mode, n);
+ }
+ WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
- REQUEST_SIZE_MATCH(xRRCreateModeReq);
- (void) stuff;
- return BadImplementation;
+ return client->noClientException;
}
int
ProcRRDestroyMode (ClientPtr client)
{
REQUEST(xRRDestroyModeReq);
+ RRModePtr mode;
REQUEST_SIZE_MATCH(xRRDestroyModeReq);
- (void) stuff;
- return BadImplementation;
+ mode = LookupIDByType (stuff->mode, RRModeType);
+ if (!mode)
+ {
+ client->errorValue = stuff->mode;
+ return RRErrorBase + BadRRMode;
+ }
+ if (!mode->userScreen)
+ return BadMatch;
+ if (mode->refcnt > 1)
+ return BadAccess;
+ FreeResource (stuff->mode, 0);
+ return Success;
}
int
ProcRRAddOutputMode (ClientPtr client)
{
REQUEST(xRRAddOutputModeReq);
+ RRModePtr mode;
+ RROutputPtr output;
REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
- (void) stuff;
- return BadImplementation;
+ output = LookupOutput(client, stuff->output, DixReadAccess);
+
+ if (!output)
+ {
+ client->errorValue = stuff->output;
+ return RRErrorBase + BadRROutput;
+ }
+
+ mode = LookupIDByType (stuff->mode, RRModeType);
+ if (!mode)
+ {
+ client->errorValue = stuff->mode;
+ return RRErrorBase + BadRRMode;
+ }
+
+ return RROutputAddUserMode (output, mode);
}
int
ProcRRDeleteOutputMode (ClientPtr client)
{
REQUEST(xRRDeleteOutputModeReq);
+ RRModePtr mode;
+ RROutputPtr output;
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
- (void) stuff;
- return BadImplementation;
+ output = LookupOutput(client, stuff->output, DixReadAccess);
+
+ if (!output)
+ {
+ client->errorValue = stuff->output;
+ return RRErrorBase + BadRROutput;
+ }
+
+ mode = LookupIDByType (stuff->mode, RRModeType);
+ if (!mode)
+ {
+ client->errorValue = stuff->mode;
+ return RRErrorBase + BadRRMode;
+ }
+
+ return RROutputDeleteUserMode (output, mode);
}
diff --git a/randr/rroutput.c b/randr/rroutput.c
index df1741f..6e95c95 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -76,6 +76,8 @@ RROutputCreate (const char *name,
output->numModes = 0;
output->numPreferred = 0;
output->modes = NULL;
+ output->numUserModes = 0;
+ output->userModes = NULL;
output->properties = NULL;
output->changed = FALSE;
output->devPrivate = devPrivate;
@@ -192,6 +194,74 @@ RROutputSetModes (RROutputPtr output,
return TRUE;
}
+int
+RROutputAddUserMode (RROutputPtr output,
+ RRModePtr mode)
+{
+ int m;
+ ScreenPtr pScreen = output->pScreen;
+ rrScrPriv(pScreen);
+ RRModePtr *newModes;
+
+ /* Check to see if this mode is already listed for this output */
+ for (m = 0; m < output->numModes + output->numUserModes; m++)
+ {
+ RRModePtr e = (m < output->numModes ?
+ output->modes[m] :
+ output->userModes[m - output->numModes]);
+ if (mode == e)
+ return Success;
+ }
+
+ /* Check with the DDX to see if this mode is OK */
+ if (pScrPriv->rrOutputValidateMode)
+ if (!pScrPriv->rrOutputValidateMode (pScreen, output, mode))
+ return BadMatch;
+
+ if (output->userModes)
+ newModes = xrealloc (output->userModes,
+ (output->numUserModes + 1) * sizeof (RRModePtr));
+ else
+ newModes = xalloc (sizeof (RRModePtr));
+ if (!newModes)
+ return BadAlloc;
+
+ output->userModes = newModes;
+ output->userModes[output->numUserModes++] = mode;
+ ++mode->refcnt;
+ RROutputChanged (output, TRUE);
+ RRTellChanged (pScreen);
+ return Success;
+}
+
+int
+RROutputDeleteUserMode (RROutputPtr output,
+ RRModePtr mode)
+{
+ int m;
+
+ /* Find this mode in the user mode list */
+ for (m = 0; m < output->numUserModes; m++)
+ {
+ RRModePtr e = output->userModes[m];
+
+ if (mode == e)
+ break;
+ }
+ /* Not there, access error */
+ if (m == output->numUserModes)
+ return BadAccess;
+
+ /* make sure the mode isn't active for this output */
+ if (output->crtc && output->crtc->mode == mode)
+ return BadMatch;
+
+ memmove (output->userModes + m, output->userModes + m + 1,
+ (output->numUserModes - m - 1) * sizeof (RRModePtr));
+ RRModeDestroy (mode);
+ return Success;
+}
+
Bool
RROutputSetCrtcs (RROutputPtr output,
RRCrtcPtr *crtcs,
@@ -308,9 +378,9 @@ RRDeliverOutputEvent(ClientPtr client, W
* Destroy a Output at shutdown
*/
void
-RROutputDestroy (RROutputPtr crtc)
+RROutputDestroy (RROutputPtr output)
{
- FreeResource (crtc->id, 0);
+ FreeResource (output->id, 0);
}
static int
@@ -318,6 +388,7 @@ RROutputDestroyResource (pointer value,
{
RROutputPtr output = (RROutputPtr) value;
ScreenPtr pScreen = output->pScreen;
+ int m;
if (pScreen)
{
@@ -335,8 +406,15 @@ RROutputDestroyResource (pointer value,
}
}
}
+ /* XXX destroy all modes? */
if (output->modes)
xfree (output->modes);
+
+ for (m = 0; m < output->numUserModes; m++)
+ RRModeDestroy (output->userModes[m]);
+ if (output->userModes)
+ xfree (output->userModes);
+
if (output->crtcs)
xfree (output->crtcs);
if (output->clones)
@@ -383,7 +461,10 @@ ProcRRGetOutputInfo (ClientPtr client)
output = LookupOutput(client, stuff->output, DixReadAccess);
if (!output)
+ {
+ client->errorValue = stuff->output;
return RRErrorBase + BadRROutput;
+ }
pScreen = output->pScreen;
pScrPriv = rrGetScrPriv(pScreen);
@@ -398,13 +479,13 @@ ProcRRGetOutputInfo (ClientPtr client)
rep.connection = output->connection;
rep.subpixelOrder = output->subpixelOrder;
rep.nCrtcs = output->numCrtcs;
- rep.nModes = output->numModes;
+ rep.nModes = output->numModes + output->numUserModes;
rep.nPreferred = output->numPreferred;
rep.nClones = output->numClones;
rep.nameLength = output->nameLength;
extraLen = ((output->numCrtcs +
- output->numModes +
+ output->numModes + output->numUserModes +
output->numClones +
((rep.nameLength + 3) >> 2)) << 2);
@@ -420,7 +501,7 @@ ProcRRGetOutputInfo (ClientPtr client)
crtcs = (RRCrtc *) extra;
modes = (RRMode *) (crtcs + output->numCrtcs);
- clones = (RROutput *) (modes + output->numModes);
+ clones = (RROutput *) (modes + output->numModes + output->numUserModes);
name = (char *) (clones + output->numClones);
for (i = 0; i < output->numCrtcs; i++)
@@ -429,9 +510,12 @@ ProcRRGetOutputInfo (ClientPtr client)
if (client->swapped)
swapl (&crtcs[i], n);
}
- for (i = 0; i < output->numModes; i++)
+ for (i = 0; i < output->numModes + output->numUserModes; i++)
{
- modes[i] = output->modes[i]->mode.id;
+ if (i < output->numModes)
+ modes[i] = output->modes[i]->mode.id;
+ else
+ modes[i] = output->userModes[i - output->numModes]->mode.id;
if (client->swapped)
swapl (&modes[i], n);
}
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 1680003..ad74ac3 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -473,7 +473,7 @@ RR10GetData (ScreenPtr pScreen, RROutput
{
RR10DataPtr data;
RRScreenSizePtr size;
- int nmode = output->numModes;
+ int nmode = output->numModes + output->numUserModes;
int o, os, l, r;
RRScreenRatePtr refresh;
CARD16 vRefresh;
@@ -500,11 +500,14 @@ RR10GetData (ScreenPtr pScreen, RROutput
/*
* find modes not yet listed
*/
- for (o = 0; o < output->numModes; o++)
+ for (o = 0; o < output->numModes + output->numUserModes; o++)
{
if (used[o]) continue;
- mode = output->modes[o];
+ if (o < output->numModes)
+ mode = output->modes[o];
+ else
+ mode = output->userModes[o - output->numModes];
l = data->nsize;
size[l].id = data->nsize;
@@ -524,9 +527,12 @@ RR10GetData (ScreenPtr pScreen, RROutput
/*
* Find all modes with matching size
*/
- for (os = o; os < output->numModes; os++)
+ for (os = o; os < output->numModes + output->numUserModes; os++)
{
- mode = output->modes[os];
+ if (os < output->numModes)
+ mode = output->modes[os];
+ else
+ mode = output->userModes[os - output->numModes];
if (mode->mode.width == size[l].width &&
mode->mode.height == size[l].height)
{
More information about the xorg-commit
mailing list