2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright 1989, 1998 The Open Group
|
|
|
|
|
|
|
|
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
|
|
|
|
OPEN GROUP 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 Open Group 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 Open Group.
|
|
|
|
*/
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* This file contains functions to move the pointer on the screen and/or
|
|
|
|
* restrict its movement. These functions are divided into two sets:
|
|
|
|
* Screen-specific functions that are used as function pointers from other
|
|
|
|
* parts of the server (and end up heavily wrapped by e.g. animcur and
|
|
|
|
* xfixes):
|
|
|
|
* miPointerConstrainCursor
|
|
|
|
* miPointerCursorLimits
|
|
|
|
* miPointerDisplayCursor
|
|
|
|
* miPointerRealizeCursor
|
|
|
|
* miPointerUnrealizeCursor
|
|
|
|
* miPointerSetCursorPosition
|
|
|
|
* miRecolorCursor
|
|
|
|
* miPointerDeviceInitialize
|
|
|
|
* miPointerDeviceCleanup
|
|
|
|
* If wrapped, these are the last element in the wrapping chain. They may
|
|
|
|
* call into sprite-specific code through further function pointers though.
|
|
|
|
*
|
|
|
|
* The second type of functions are those that are directly called by the
|
|
|
|
* DIX, DDX and some drivers.
|
|
|
|
*/
|
|
|
|
|
2005-08-21 21:29:55 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xmd.h>
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include "misc.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "pixmapstr.h"
|
|
|
|
#include "mi.h"
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "mipointrst.h"
|
|
|
|
#include "cursorstr.h"
|
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "inputstr.h"
|
|
|
|
#include "inpututils.h"
|
|
|
|
#include "eventstr.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
DevPrivateKeyRec miPointerScreenKeyRec;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
#define GetScreenPrivate(s) ((miPointerScreenPtr) \
|
|
|
|
dixLookupPrivate(&(s)->devPrivates, miPointerScreenKey))
|
2003-11-14 16:54:54 +01:00
|
|
|
#define SetupScreen(s) miPointerScreenPtr pScreenPriv = GetScreenPrivate(s)
|
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
DevPrivateKeyRec miPointerPrivKeyRec;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2006-12-14 01:20:18 +01:00
|
|
|
#define MIPOINTER(dev) \
|
2011-02-11 03:47:37 +01:00
|
|
|
(IsFloating(dev) ? \
|
2008-01-03 07:34:54 +01:00
|
|
|
(miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \
|
2009-05-21 04:07:03 +02:00
|
|
|
(miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey))
|
2006-11-17 05:40:37 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2006-11-23 07:45:14 +01:00
|
|
|
CursorPtr pCursor);
|
2012-03-21 20:55:09 +01:00
|
|
|
static Bool miPointerUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2006-11-23 07:45:14 +01:00
|
|
|
CursorPtr pCursor);
|
2012-03-21 20:55:09 +01:00
|
|
|
static Bool miPointerDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2006-11-23 07:45:14 +01:00
|
|
|
CursorPtr pCursor);
|
2006-11-21 05:16:00 +01:00
|
|
|
static void miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2012-03-21 20:55:09 +01:00
|
|
|
BoxPtr pBox);
|
2006-11-23 07:45:14 +01:00
|
|
|
static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2012-03-21 20:55:09 +01:00
|
|
|
CursorPtr pCursor, BoxPtr pHotBox,
|
2006-11-23 07:45:14 +01:00
|
|
|
BoxPtr pTopLeftBox);
|
2012-03-21 20:55:09 +01:00
|
|
|
static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
|
|
|
|
int x, int y, Bool generateEvent);
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
static Bool miPointerCloseScreen(ScreenPtr pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
static void miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
|
2007-04-09 12:01:59 +02:00
|
|
|
static Bool miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
|
|
|
|
static void miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x,
|
|
|
|
int y);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-12-07 00:26:13 +01:00
|
|
|
static InternalEvent *mipointermove_events; /* for WarpPointer MotionNotifies */
|
2007-02-16 00:27:57 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerInitialize(ScreenPtr pScreen,
|
|
|
|
miPointerSpriteFuncPtr spriteFuncs,
|
|
|
|
miPointerScreenFuncPtr screenFuncs, Bool waitForUpdate)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerScreenPtr pScreenPriv;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
if (!dixRegisterPrivateKey(&miPointerScreenKeyRec, PRIVATE_SCREEN, 0))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2010-04-27 02:22:21 +02:00
|
|
|
|
|
|
|
if (!dixRegisterPrivateKey(&miPointerPrivKeyRec, PRIVATE_DEVICE, 0))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2010-04-27 02:22:21 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreenPriv = malloc(sizeof(miPointerScreenRec));
|
2003-11-14 16:54:54 +01:00
|
|
|
if (!pScreenPriv)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreenPriv->spriteFuncs = spriteFuncs;
|
|
|
|
pScreenPriv->screenFuncs = screenFuncs;
|
|
|
|
pScreenPriv->waitForUpdate = waitForUpdate;
|
2003-11-14 17:49:22 +01:00
|
|
|
pScreenPriv->showTransparent = FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
|
|
|
pScreen->CloseScreen = miPointerCloseScreen;
|
2007-08-28 15:28:25 +02:00
|
|
|
dixSetPrivate(&pScreen->devPrivates, miPointerScreenKey, pScreenPriv);
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* set up screen cursor method table
|
|
|
|
*/
|
|
|
|
pScreen->ConstrainCursor = miPointerConstrainCursor;
|
|
|
|
pScreen->CursorLimits = miPointerCursorLimits;
|
|
|
|
pScreen->DisplayCursor = miPointerDisplayCursor;
|
|
|
|
pScreen->RealizeCursor = miPointerRealizeCursor;
|
|
|
|
pScreen->UnrealizeCursor = miPointerUnrealizeCursor;
|
|
|
|
pScreen->SetCursorPosition = miPointerSetCursorPosition;
|
|
|
|
pScreen->RecolorCursor = miRecolorCursor;
|
2007-04-09 12:01:59 +02:00
|
|
|
pScreen->DeviceCursorInitialize = miPointerDeviceInitialize;
|
|
|
|
pScreen->DeviceCursorCleanup = miPointerDeviceCleanup;
|
2006-12-14 01:20:18 +01:00
|
|
|
|
2012-12-07 00:26:13 +01:00
|
|
|
mipointermove_events = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Destroy screen-specific information.
|
|
|
|
*
|
|
|
|
* @param index Screen index of the screen in screenInfo.screens[]
|
|
|
|
* @param pScreen The actual screen pointer
|
|
|
|
*/
|
2003-11-14 16:54:54 +01:00
|
|
|
static Bool
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
miPointerCloseScreen(ScreenPtr pScreen)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2006-12-14 01:20:18 +01:00
|
|
|
SetupScreen(pScreen);
|
2006-11-27 06:24:33 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
2013-12-15 10:05:51 +01:00
|
|
|
free((void *) pScreenPriv);
|
2012-12-07 00:26:13 +01:00
|
|
|
FreeEventList(mipointermove_events, GetMaximumEventsNum());
|
|
|
|
mipointermove_events = NULL;
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
return (*pScreen->CloseScreen) (pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* DIX/DDX interface routines
|
|
|
|
*/
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
SetupScreen(pScreen);
|
2006-11-17 05:40:37 +01:00
|
|
|
return (*pScreenPriv->spriteFuncs->RealizeCursor) (pDev, pScreen, pCursor);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerUnrealizeCursor(DeviceIntPtr pDev,
|
|
|
|
ScreenPtr pScreen, CursorPtr pCursor)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
SetupScreen(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
return (*pScreenPriv->spriteFuncs->UnrealizeCursor) (pDev, pScreen,
|
|
|
|
pCursor);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-10-17 02:22:30 +02:00
|
|
|
miPointerPtr pPointer;
|
2008-05-28 04:57:07 +02:00
|
|
|
|
2008-05-12 12:35:43 +02:00
|
|
|
/* return for keyboards */
|
2011-02-11 02:41:47 +01:00
|
|
|
if (!IsPointerDevice(pDev))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2008-05-12 12:35:43 +02:00
|
|
|
|
2007-10-17 02:22:30 +02:00
|
|
|
pPointer = MIPOINTER(pDev);
|
2006-12-14 01:20:18 +01:00
|
|
|
|
2006-11-27 06:24:33 +01:00
|
|
|
pPointer->pCursor = pCursor;
|
|
|
|
pPointer->pScreen = pScreen;
|
|
|
|
miPointerUpdateSprite(pDev);
|
2003-11-14 16:54:54 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Set up the constraints for the given device. This function does not
|
|
|
|
* actually constrain the cursor but merely copies the given box to the
|
|
|
|
* internal constraint storage.
|
|
|
|
*
|
|
|
|
* @param pDev The device to constrain to the box
|
|
|
|
* @param pBox The rectangle to constrain the cursor to
|
|
|
|
* @param pScreen Used for copying screen confinement
|
|
|
|
*/
|
2003-11-14 16:54:54 +01:00
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-10-17 02:22:30 +02:00
|
|
|
miPointerPtr pPointer;
|
|
|
|
|
|
|
|
pPointer = MIPOINTER(pDev);
|
2006-12-14 01:20:18 +01:00
|
|
|
|
2006-11-21 08:45:04 +01:00
|
|
|
pPointer->limits = *pBox;
|
|
|
|
pPointer->confined = PointerConfinedToScreen(pDev);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Should calculate the box for the given cursor, based on screen and the
|
|
|
|
* confinement given. But we assume that whatever box is passed in is valid
|
|
|
|
* anyway.
|
|
|
|
*
|
|
|
|
* @param pDev The device to calculate the cursor limits for
|
|
|
|
* @param pScreen The screen the confinement happens on
|
|
|
|
* @param pCursor The screen the confinement happens on
|
|
|
|
* @param pHotBox The confinement box for the cursor
|
|
|
|
* @param[out] pTopLeftBox The new confinement box, always *pHotBox.
|
|
|
|
*/
|
2003-11-14 16:54:54 +01:00
|
|
|
static void
|
2008-05-28 04:57:07 +02:00
|
|
|
miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
|
|
|
|
BoxPtr pHotBox, BoxPtr pTopLeftBox)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
*pTopLeftBox = *pHotBox;
|
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Set the device's cursor position to the x/y position on the given screen.
|
|
|
|
* Generates and event if required.
|
|
|
|
*
|
|
|
|
* This function is called from:
|
|
|
|
* - sprite init code to place onto initial position
|
|
|
|
* - the various WarpPointer implementations (core, XI, Xinerama, dmx,…)
|
|
|
|
* - during the cursor update path in CheckMotion
|
|
|
|
* - in the Xinerama part of NewCurrentScreen
|
|
|
|
* - when a RandR/RandR1.2 mode was applied (it may have moved the pointer, so
|
|
|
|
* it's set back to the original pos)
|
|
|
|
*
|
|
|
|
* @param pDev The device to move
|
|
|
|
* @param pScreen The screen the device is on
|
|
|
|
* @param x The x coordinate in per-screen coordinates
|
|
|
|
* @param y The y coordinate in per-screen coordinates
|
|
|
|
* @param generateEvent True if the pointer movement should generate an
|
|
|
|
* event.
|
|
|
|
*
|
|
|
|
* @return TRUE in all cases
|
|
|
|
*/
|
2003-11-14 16:54:54 +01:00
|
|
|
static Bool
|
2008-05-28 04:57:07 +02:00
|
|
|
miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
|
|
|
|
int x, int y, Bool generateEvent)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
SetupScreen(pScreen);
|
2011-02-11 02:01:19 +01:00
|
|
|
miPointerPtr pPointer = MIPOINTER(pDev);
|
|
|
|
|
|
|
|
pPointer->generateEvent = generateEvent;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-09 23:32:16 +01:00
|
|
|
if (pScreen->ConstrainCursorHarder)
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y);
|
2011-02-09 23:32:16 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/* device dependent - must pend signal and call miPointerWarpCursor */
|
2006-11-23 07:45:14 +01:00
|
|
|
(*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
|
2003-11-14 16:54:54 +01:00
|
|
|
if (!generateEvent)
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerUpdateSprite(pDev);
|
2003-11-14 16:54:54 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Set up sprite information for the device.
|
|
|
|
* This function will be called once for each device after it is initialized
|
|
|
|
* in the DIX.
|
|
|
|
*
|
|
|
|
* @param pDev The newly created device
|
|
|
|
* @param pScreen The initial sprite scree.
|
2008-05-28 04:57:07 +02:00
|
|
|
*/
|
2007-04-09 12:01:59 +02:00
|
|
|
static Bool
|
2008-05-28 04:57:07 +02:00
|
|
|
miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
|
2007-04-09 12:01:59 +02:00
|
|
|
{
|
|
|
|
miPointerPtr pPointer;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
SetupScreen(pScreen);
|
2007-04-09 12:01:59 +02:00
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
pPointer = malloc(sizeof(miPointerRec));
|
2007-04-09 12:01:59 +02:00
|
|
|
if (!pPointer)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
pPointer->pScreen = NULL;
|
|
|
|
pPointer->pSpriteScreen = NULL;
|
|
|
|
pPointer->pCursor = NULL;
|
|
|
|
pPointer->pSpriteCursor = NULL;
|
|
|
|
pPointer->limits.x1 = 0;
|
|
|
|
pPointer->limits.x2 = 32767;
|
|
|
|
pPointer->limits.y1 = 0;
|
|
|
|
pPointer->limits.y2 = 32767;
|
|
|
|
pPointer->confined = FALSE;
|
|
|
|
pPointer->x = 0;
|
|
|
|
pPointer->y = 0;
|
2011-02-11 02:01:19 +01:00
|
|
|
pPointer->generateEvent = FALSE;
|
2007-04-09 12:01:59 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!((*pScreenPriv->spriteFuncs->DeviceCursorInitialize) (pDev, pScreen))) {
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pPointer);
|
2007-04-09 12:01:59 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2008-01-03 07:34:54 +01:00
|
|
|
dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, pPointer);
|
2007-04-09 12:01:59 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Clean up after device.
|
|
|
|
* This function will be called once before the device is freed in the DIX
|
|
|
|
*
|
|
|
|
* @param pDev The device to be removed from the server
|
|
|
|
* @param pScreen Current screen of the device
|
2007-04-09 12:01:59 +02:00
|
|
|
*/
|
|
|
|
static void
|
2008-05-28 04:57:07 +02:00
|
|
|
miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
2007-04-09 12:01:59 +02:00
|
|
|
{
|
2009-01-11 08:42:57 +01:00
|
|
|
SetupScreen(pScreen);
|
|
|
|
|
2011-02-11 03:47:37 +01:00
|
|
|
if (!IsMaster(pDev) && !IsFloating(pDev))
|
2008-05-22 15:54:29 +02:00
|
|
|
return;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
(*pScreenPriv->spriteFuncs->DeviceCursorCleanup) (pDev, pScreen);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey));
|
2008-05-22 15:54:29 +02:00
|
|
|
dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, NULL);
|
2007-04-09 12:01:59 +02:00
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Warp the pointer to the given position on the given screen. May generate
|
|
|
|
* an event, depending on whether we're coming from miPointerSetPosition.
|
|
|
|
*
|
|
|
|
* Once signals are ignored, the WarpCursor function can call this
|
|
|
|
*
|
|
|
|
* @param pDev The device to warp
|
|
|
|
* @param pScreen Screen to warp on
|
|
|
|
* @param x The x coordinate in per-screen coordinates
|
|
|
|
* @param y The y coordinate in per-screen coordinates
|
|
|
|
*/
|
2003-11-14 16:54:54 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-10-17 02:22:30 +02:00
|
|
|
miPointerPtr pPointer;
|
2007-11-24 06:46:48 +01:00
|
|
|
BOOL changedScreen = FALSE;
|
2008-03-04 08:41:10 +01:00
|
|
|
|
2009-01-11 08:42:57 +01:00
|
|
|
pPointer = MIPOINTER(pDev);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pPointer->pScreen != pScreen) {
|
2012-10-16 20:56:15 +02:00
|
|
|
mieqSwitchScreen(pDev, pScreen, TRUE);
|
2007-11-24 06:46:48 +01:00
|
|
|
changedScreen = TRUE;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-11 02:01:19 +01:00
|
|
|
if (pPointer->generateEvent)
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerMove(pDev, pScreen, x, y);
|
2003-11-14 16:54:54 +01:00
|
|
|
else
|
2010-07-02 07:25:14 +02:00
|
|
|
miPointerMoveNoEvent(pDev, pScreen, x, y);
|
2008-02-05 09:04:31 +01:00
|
|
|
|
2009-02-02 01:20:13 +01:00
|
|
|
/* Don't call USFS if we use Xinerama, otherwise the root window is
|
|
|
|
* updated to the second screen, and we never receive any events.
|
|
|
|
* (FDO bug #18668) */
|
|
|
|
if (changedScreen
|
|
|
|
#ifdef PANORAMIX
|
2012-03-21 20:55:09 +01:00
|
|
|
&& noPanoramiXExtension
|
2009-02-02 01:20:13 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
)
|
|
|
|
UpdateSpriteForScreen(pDev, pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Syncronize the sprite with the cursor.
|
2003-11-14 16:54:54 +01:00
|
|
|
*
|
2011-02-11 02:22:45 +01:00
|
|
|
* @param pDev The device to sync
|
2003-11-14 16:54:54 +01:00
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerUpdateSprite(DeviceIntPtr pDev)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen;
|
|
|
|
miPointerScreenPtr pScreenPriv;
|
|
|
|
CursorPtr pCursor;
|
|
|
|
int x, y, devx, devy;
|
|
|
|
miPointerPtr pPointer;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2008-05-22 15:54:29 +02:00
|
|
|
if (!pDev || !pDev->coreEvents)
|
2006-10-08 19:34:32 +02:00
|
|
|
return;
|
|
|
|
|
2006-12-14 01:20:18 +01:00
|
|
|
pPointer = MIPOINTER(pDev);
|
2006-11-17 08:33:43 +01:00
|
|
|
|
2009-04-30 06:58:00 +02:00
|
|
|
if (!pPointer)
|
|
|
|
return;
|
|
|
|
|
2006-11-21 08:45:04 +01:00
|
|
|
pScreen = pPointer->pScreen;
|
2006-10-08 19:34:32 +02:00
|
|
|
if (!pScreen)
|
2012-03-21 20:55:09 +01:00
|
|
|
return;
|
2006-10-08 19:34:32 +02:00
|
|
|
|
2006-11-21 08:45:04 +01:00
|
|
|
x = pPointer->x;
|
|
|
|
y = pPointer->y;
|
|
|
|
devx = pPointer->devx;
|
|
|
|
devy = pPointer->devy;
|
2006-10-08 19:34:32 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreenPriv = GetScreenPrivate(pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* if the cursor has switched screens, disable the sprite
|
|
|
|
* on the old screen
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pScreen != pPointer->pSpriteScreen) {
|
|
|
|
if (pPointer->pSpriteScreen) {
|
|
|
|
miPointerScreenPtr pOldPriv;
|
|
|
|
|
|
|
|
pOldPriv = GetScreenPrivate(pPointer->pSpriteScreen);
|
|
|
|
if (pPointer->pCursor) {
|
|
|
|
(*pOldPriv->spriteFuncs->SetCursor)
|
|
|
|
(pDev, pPointer->pSpriteScreen, NullCursor, 0, 0);
|
|
|
|
}
|
|
|
|
(*pOldPriv->screenFuncs->CrossScreen) (pPointer->pSpriteScreen,
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
(*pScreenPriv->screenFuncs->CrossScreen) (pScreen, TRUE);
|
|
|
|
(*pScreenPriv->spriteFuncs->SetCursor)
|
|
|
|
(pDev, pScreen, pPointer->pCursor, x, y);
|
|
|
|
pPointer->devx = x;
|
|
|
|
pPointer->devy = y;
|
|
|
|
pPointer->pSpriteCursor = pPointer->pCursor;
|
|
|
|
pPointer->pSpriteScreen = pScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* if the cursor has changed, display the new one
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
else if (pPointer->pCursor != pPointer->pSpriteCursor) {
|
|
|
|
pCursor = pPointer->pCursor;
|
|
|
|
if (!pCursor ||
|
|
|
|
(pCursor->bits->emptyMask && !pScreenPriv->showTransparent))
|
|
|
|
pCursor = NullCursor;
|
|
|
|
(*pScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pCursor, x, y);
|
|
|
|
|
|
|
|
pPointer->devx = x;
|
|
|
|
pPointer->devy = y;
|
|
|
|
pPointer->pSpriteCursor = pPointer->pCursor;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else if (x != devx || y != devy) {
|
|
|
|
pPointer->devx = x;
|
|
|
|
pPointer->devy = y;
|
|
|
|
if (pPointer->pCursor && !pPointer->pCursor->bits->emptyMask)
|
|
|
|
(*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Set the device to the coordinates on the given screen.
|
|
|
|
*
|
|
|
|
* @param pDev The device to move
|
|
|
|
* @param screen_no Index of the screen to move to
|
|
|
|
* @param x The x coordinate in per-screen coordinates
|
|
|
|
* @param y The y coordinate in per-screen coordinates
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2006-10-08 19:34:32 +02:00
|
|
|
miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen;
|
|
|
|
miPointerPtr pPointer;
|
2007-10-17 02:22:30 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPointer = MIPOINTER(pDev);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreen = screenInfo.screens[screen_no];
|
2012-10-16 20:56:15 +02:00
|
|
|
mieqSwitchScreen(pDev, pScreen, FALSE);
|
2012-03-21 20:55:09 +01:00
|
|
|
NewCurrentScreen(pDev, pScreen, x, y);
|
2006-12-14 01:20:18 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPointer->limits.x2 = pScreen->width;
|
|
|
|
pPointer->limits.y2 = pScreen->height;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* @return The current screen of the given device or NULL.
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
ScreenPtr
|
2006-10-08 19:34:32 +02:00
|
|
|
miPointerGetScreen(DeviceIntPtr pDev)
|
|
|
|
{
|
2008-05-22 15:54:29 +02:00
|
|
|
miPointerPtr pPointer = MIPOINTER(pDev);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2008-05-22 15:54:29 +02:00
|
|
|
return (pPointer) ? pPointer->pScreen : NULL;
|
2006-10-08 19:34:32 +02:00
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2010-06-04 04:00:53 +02:00
|
|
|
/* Controls whether the cursor image should be updated immediately when
|
|
|
|
moved (FALSE) or if something else will be responsible for updating
|
|
|
|
it later (TRUE). Returns current setting.
|
|
|
|
Caller is responsible for calling OsBlockSignal first.
|
|
|
|
*/
|
|
|
|
Bool
|
|
|
|
miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait)
|
|
|
|
{
|
|
|
|
SetupScreen(pScreen);
|
|
|
|
Bool prevWait = pScreenPriv->waitForUpdate;
|
|
|
|
|
|
|
|
pScreenPriv->waitForUpdate = wait;
|
|
|
|
return prevWait;
|
|
|
|
}
|
|
|
|
|
2007-03-25 23:56:32 +02:00
|
|
|
/* Move the pointer on the current screen, and update the sprite. */
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
2007-03-25 23:56:32 +02:00
|
|
|
{
|
2007-10-17 02:22:30 +02:00
|
|
|
miPointerPtr pPointer;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2007-03-25 23:56:32 +02:00
|
|
|
SetupScreen(pScreen);
|
|
|
|
|
2007-10-17 02:22:30 +02:00
|
|
|
pPointer = MIPOINTER(pDev);
|
2007-04-02 08:06:26 +02:00
|
|
|
|
2008-05-16 13:26:04 +02:00
|
|
|
/* Hack: We mustn't call into ->MoveCursor for anything but the
|
|
|
|
* VCP, as this may cause a non-HW rendered cursor to be rendered during
|
|
|
|
* SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT.
|
|
|
|
*/
|
2011-02-18 03:04:46 +01:00
|
|
|
if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer
|
2012-03-21 20:55:09 +01:00
|
|
|
&&!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) {
|
|
|
|
pPointer->devx = x;
|
|
|
|
pPointer->devy = y;
|
|
|
|
if (pPointer->pCursor && !pPointer->pCursor->bits->emptyMask)
|
|
|
|
(*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
|
2007-03-25 23:56:32 +02:00
|
|
|
}
|
|
|
|
|
2007-04-02 08:06:26 +02:00
|
|
|
pPointer->x = x;
|
|
|
|
pPointer->y = y;
|
|
|
|
pPointer->pScreen = pScreen;
|
2007-03-25 23:56:32 +02:00
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Set the devices' cursor position to the given x/y position.
|
|
|
|
*
|
|
|
|
* This function is called during the pointer update path in
|
|
|
|
* GetPointerEvents and friends (and the same in the xwin DDX).
|
|
|
|
*
|
2011-02-18 05:19:18 +01:00
|
|
|
* The coordinates provided are always absolute. The parameter mode whether
|
|
|
|
* it was relative or absolute movement that landed us at those coordinates.
|
|
|
|
*
|
2011-02-11 02:22:45 +01:00
|
|
|
* @param pDev The device to move
|
2011-02-18 05:19:18 +01:00
|
|
|
* @param mode Movement mode (Absolute or Relative)
|
2011-10-04 03:41:17 +02:00
|
|
|
* @param[in,out] screenx The x coordinate in desktop coordinates
|
|
|
|
* @param[in,out] screeny The y coordinate in desktop coordinates
|
2011-02-11 02:22:45 +01:00
|
|
|
*/
|
2011-10-03 04:49:49 +02:00
|
|
|
ScreenPtr
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,
|
2012-12-03 01:41:16 +01:00
|
|
|
double *screeny,
|
|
|
|
int *nevents, InternalEvent* events)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerScreenPtr pScreenPriv;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
ScreenPtr newScreen;
|
|
|
|
int x, y;
|
|
|
|
Bool switch_screen = FALSE;
|
2012-12-06 03:58:55 +01:00
|
|
|
Bool should_constrain_barriers = FALSE;
|
|
|
|
int i;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerPtr pPointer;
|
2006-11-17 08:33:43 +01:00
|
|
|
|
2007-10-17 02:22:30 +02:00
|
|
|
pPointer = MIPOINTER(pDev);
|
2006-11-21 08:45:04 +01:00
|
|
|
pScreen = pPointer->pScreen;
|
2006-10-08 16:44:37 +02:00
|
|
|
|
2011-10-03 05:10:53 +02:00
|
|
|
x = trunc(*screenx);
|
|
|
|
y = trunc(*screeny);
|
|
|
|
|
2011-10-04 03:41:17 +02:00
|
|
|
switch_screen = !point_on_screen(pScreen, x, y);
|
|
|
|
|
|
|
|
/* Switch to per-screen coordinates for CursorOffScreen and
|
|
|
|
* Pointer->limits */
|
|
|
|
x -= pScreen->x;
|
|
|
|
y -= pScreen->y;
|
|
|
|
|
2012-12-06 03:58:55 +01:00
|
|
|
should_constrain_barriers = (mode == Relative);
|
|
|
|
|
|
|
|
if (should_constrain_barriers) {
|
2012-11-25 01:39:47 +01:00
|
|
|
/* coordinates after clamped to a barrier */
|
|
|
|
int constrained_x, constrained_y;
|
|
|
|
int current_x, current_y; /* current position in per-screen coord */
|
|
|
|
|
|
|
|
current_x = MIPOINTER(pDev)->x - pScreen->y;
|
|
|
|
current_y = MIPOINTER(pDev)->y - pScreen->x;
|
|
|
|
|
|
|
|
input_constrain_cursor(pDev, pScreen,
|
|
|
|
current_x, current_y, x, y,
|
2012-12-03 01:41:16 +01:00
|
|
|
&constrained_x, &constrained_y,
|
|
|
|
nevents, events);
|
2012-11-25 01:39:47 +01:00
|
|
|
|
|
|
|
x = constrained_x;
|
|
|
|
y = constrained_y;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (switch_screen) {
|
|
|
|
pScreenPriv = GetScreenPrivate(pScreen);
|
|
|
|
if (!pPointer->confined) {
|
|
|
|
newScreen = pScreen;
|
|
|
|
(*pScreenPriv->screenFuncs->CursorOffScreen) (&newScreen, &x, &y);
|
|
|
|
if (newScreen != pScreen) {
|
|
|
|
pScreen = newScreen;
|
2012-10-16 20:56:15 +02:00
|
|
|
mieqSwitchScreen(pDev, pScreen, FALSE);
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Smash the confine to the new screen */
|
2006-11-21 08:45:04 +01:00
|
|
|
pPointer->limits.x2 = pScreen->width;
|
|
|
|
pPointer->limits.y2 = pScreen->height;
|
2012-03-21 20:55:09 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2006-10-08 19:34:32 +02:00
|
|
|
/* Constrain the sprite to the current limits. */
|
2011-10-03 05:10:53 +02:00
|
|
|
if (x < pPointer->limits.x1)
|
2012-03-21 20:55:09 +01:00
|
|
|
x = pPointer->limits.x1;
|
2011-10-03 05:10:53 +02:00
|
|
|
if (x >= pPointer->limits.x2)
|
2012-03-21 20:55:09 +01:00
|
|
|
x = pPointer->limits.x2 - 1;
|
2011-10-03 05:10:53 +02:00
|
|
|
if (y < pPointer->limits.y1)
|
2012-03-21 20:55:09 +01:00
|
|
|
y = pPointer->limits.y1;
|
2011-10-03 05:10:53 +02:00
|
|
|
if (y >= pPointer->limits.y2)
|
2012-03-21 20:55:09 +01:00
|
|
|
y = pPointer->limits.y2 - 1;
|
2006-11-21 08:45:04 +01:00
|
|
|
|
2011-02-09 23:32:16 +01:00
|
|
|
if (pScreen->ConstrainCursorHarder)
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreen->ConstrainCursorHarder(pDev, pScreen, mode, &x, &y);
|
2011-02-09 23:32:16 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pPointer->x != x || pPointer->y != y || pPointer->pScreen != pScreen)
|
2011-10-03 05:10:53 +02:00
|
|
|
miPointerMoveNoEvent(pDev, pScreen, x, y);
|
|
|
|
|
2012-12-06 03:58:55 +01:00
|
|
|
/* check if we generated any barrier events and if so, update root x/y
|
|
|
|
* to the fully constrained coords */
|
|
|
|
if (should_constrain_barriers) {
|
|
|
|
for (i = 0; i < *nevents; i++) {
|
|
|
|
if (events[i].any.type == ET_BarrierHit ||
|
|
|
|
events[i].any.type == ET_BarrierLeave) {
|
|
|
|
events[i].barrier_event.root_x = x;
|
|
|
|
events[i].barrier_event.root_y = y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-04 03:41:17 +02:00
|
|
|
/* Convert to desktop coordinates again */
|
|
|
|
x += pScreen->x;
|
|
|
|
y += pScreen->y;
|
|
|
|
|
2011-10-03 05:10:53 +02:00
|
|
|
/* In the event we actually change screen or we get confined, we just
|
|
|
|
* drop the float component on the floor
|
|
|
|
* FIXME: only drop remainder for ConstrainCursorHarder, not for screen
|
|
|
|
* crossings */
|
|
|
|
if (x != trunc(*screenx))
|
|
|
|
*screenx = x;
|
|
|
|
if (y != trunc(*screeny))
|
|
|
|
*screeny = y;
|
2006-10-08 19:34:32 +02:00
|
|
|
|
2011-10-03 04:49:49 +02:00
|
|
|
return pScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Get the current position of the device in desktop coordinates.
|
|
|
|
*
|
|
|
|
* @param x Return value for the current x coordinate in desktop coordiates.
|
|
|
|
* @param y Return value for the current y coordinate in desktop coordiates.
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2006-10-08 16:44:37 +02:00
|
|
|
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-10-17 02:22:30 +02:00
|
|
|
*x = MIPOINTER(pDev)->x;
|
|
|
|
*y = MIPOINTER(pDev)->y;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2009-01-11 10:56:45 +01:00
|
|
|
#ifdef XQUARTZ
|
|
|
|
#include <pthread.h>
|
|
|
|
void darwinEvents_lock(void);
|
|
|
|
void darwinEvents_unlock(void);
|
|
|
|
#endif
|
|
|
|
|
2011-02-11 02:22:45 +01:00
|
|
|
/**
|
|
|
|
* Move the device's pointer to the x/y coordinates on the given screen.
|
|
|
|
* This function generates and enqueues pointer events.
|
|
|
|
*
|
|
|
|
* @param pDev The device to move
|
|
|
|
* @param pScreen The screen the device is on
|
|
|
|
* @param x The x coordinate in per-screen coordinates
|
|
|
|
* @param y The y coordinate in per-screen coordinates
|
|
|
|
*/
|
2006-10-08 19:34:32 +02:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
2006-10-08 19:34:32 +02:00
|
|
|
{
|
2007-02-16 00:27:57 +01:00
|
|
|
int i, nevents;
|
|
|
|
int valuators[2];
|
2010-10-19 05:37:46 +02:00
|
|
|
ValuatorMask mask;
|
2007-02-16 00:27:57 +01:00
|
|
|
|
2010-07-02 07:25:14 +02:00
|
|
|
miPointerMoveNoEvent(pDev, pScreen, x, y);
|
2007-02-16 00:27:57 +01:00
|
|
|
|
|
|
|
/* generate motion notify */
|
|
|
|
valuators[0] = x;
|
|
|
|
valuators[1] = y;
|
|
|
|
|
2012-12-07 00:26:13 +01:00
|
|
|
if (!mipointermove_events) {
|
|
|
|
mipointermove_events = InitEventList(GetMaximumEventsNum());
|
2007-02-16 00:27:57 +01:00
|
|
|
|
2012-12-07 00:26:13 +01:00
|
|
|
if (!mipointermove_events) {
|
2007-02-16 00:27:57 +01:00
|
|
|
FatalError("Could not allocate event store.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-19 05:37:46 +02:00
|
|
|
valuator_mask_set_range(&mask, 0, 2, valuators);
|
2012-12-07 00:26:13 +01:00
|
|
|
nevents = GetPointerEvents(mipointermove_events, pDev, MotionNotify, 0,
|
2012-03-21 20:55:09 +01:00
|
|
|
POINTER_SCREEN | POINTER_ABSOLUTE |
|
|
|
|
POINTER_NORAW, &mask);
|
2007-02-16 00:27:57 +01:00
|
|
|
|
2007-05-02 06:20:09 +02:00
|
|
|
OsBlockSignals();
|
2009-01-11 10:56:45 +01:00
|
|
|
#ifdef XQUARTZ
|
|
|
|
darwinEvents_lock();
|
|
|
|
#endif
|
2007-02-16 00:27:57 +01:00
|
|
|
for (i = 0; i < nevents; i++)
|
2012-12-07 00:26:13 +01:00
|
|
|
mieqEnqueue(pDev, &mipointermove_events[i]);
|
2009-01-11 10:56:45 +01:00
|
|
|
#ifdef XQUARTZ
|
|
|
|
darwinEvents_unlock();
|
|
|
|
#endif
|
2007-05-02 06:20:09 +02:00
|
|
|
OsReleaseSignals();
|
2006-10-08 19:34:32 +02:00
|
|
|
}
|