xserver-multidpi/include
Peter Korsgaard 6cccf0131c dix: add 3x3 transformation matrix xinput property for multi-head handling
For absolute input devices (E.G. touchscreens) in multi-head setups,
we need a way to bind the device to an randr output. This adds the
infrastructure to the server to allow us to do so.

positionSprite() scales input coordinates to the dimensions of the shared
(total) screen frame buffer, so to restrict motion to an output we need to
scale/rotate/translate device coordinates to a subset of the frame buffer
before passing them on to positionSprite.

This is done here using a 3x3 transformation matrix, which is applied to
the device coordinates using homogeneous coordinates, E.G.:

[ c0 c1 c2 ]   [ x ]
[ c3 c4 c5 ] * [ y ]
[ c6 c7 c8 ]   [ 1 ]

Notice: As input devices have varying input ranges, the coordinates are
first scaled to the [0..1] range for generality, and afterwards scaled
back up.

E.G. for a dual head setup (using same resolution) next to each other, you
would want to scale the X coordinates of the touchscreen connected to the
both heads by 50%, and translate (offset) the coordinates of the rightmost
head by 50%, or in matrix form:

   left:            right:
[ 0.5 0 0 ]     [ 0.5 0 0.5 ]
[ 0   1 0 ]     [ 0   1 0   ]
[ 0   0 1 ]     [ 0   0 0   ]

Which can be done using xinput:

xinput set-prop <left> --type=float "Coordinate Transformation Matrix" \
       0.5 0 0 0 1 0 0 0 1

xinput set-prop <right> --type=float "Coordinate Transformation Matrix" \
       0.5 0 0.5 0 1 0 0 0 1

Likewise more complication setups involving more heads, rotation or
different resolution can be handled.

Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-28 16:49:30 +10:00
..
.gitignore .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
bstore.h Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
bstorestr.h Implement core protocol backing store exclusively in terms of Composite. 2007-08-25 15:08:20 -04:00
callback.h Move callback definitions to their own file 2010-04-30 13:04:44 -07:00
closestr.h Remove #define NEED_EVENTS and NEED_REPLIES 2008-12-12 11:43:32 +10:00
closure.h Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
colormap.h Quit using clientErrorValue in dix/colormap.c. 2010-05-13 17:14:07 -07:00
colormapst.h devPrivates rework: since API is already broken, switch everything 2007-08-28 09:28:25 -04:00
cursor.h unifdef -B -DRENDER to always include RENDER code 2010-04-19 09:26:10 -07:00
cursorstr.h Remove XEvIE 2008-11-04 16:01:07 +10:30
dix-config-apple-verbatim.h Move the apple fat binary hacks back to a header file, and make it apple-only. 2009-01-30 16:36:45 -08:00
dix-config.h.in configure: remove unused builtin font macro from autoconf file 2010-04-21 18:06:52 +03:00
dix.h Declare functions that unconditionally call FatalError as _X_NORETURN. 2010-05-22 01:00:04 -07:00
dixaccess.h dix: add a new DixAccess bit, "DixPostAccess". 2009-06-26 17:05:52 -04:00
dixevents.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
dixfont.h SetFontPath: set client->errorValue on failure. 2010-05-12 12:08:38 -07:00
dixfontstr.h Remove #define NEED_EVENTS and NEED_REPLIES 2008-12-12 11:43:32 +10:00
dixgrabs.h input: reshuffle CreateGrab and friends to take a GrabParameters param. 2009-05-01 09:07:37 +10:00
dixstruct.h Declare functions that unconditionally call FatalError as _X_NORETURN. 2010-05-22 01:00:04 -07:00
eventconvert.h Re-enable RECORD extension. 2010-02-22 12:04:28 +10:00
events.h XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 23:31:07 -07:00
eventstr.h dix: make DeviceEvent coordinates signed for Xinerama. #24986 2010-05-07 12:17:22 -07:00
exevents.h Xi: if XISetEventMask fails, return this to the client. 2009-09-03 08:39:27 +10:00
extension.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
extinit.h include: XInputExtensionInit doesn't need to be exported. 2009-08-17 10:14:20 +10:00
extnsionst.h Declare functions that unconditionally call FatalError as _X_NORETURN. 2010-05-22 01:00:04 -07:00
gc.h Replace dixChangeGC with calls directly to the right variant. 2010-05-13 17:14:07 -07:00
gcstruct.h Replace screen->rgf scratch GC flags with a bit in each GC. 2010-05-20 14:36:29 -07:00
globals.h Merge remote branch 'vignatti/for-keith' 2010-04-21 16:07:38 -07:00
hotplug.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
input.h Revert "Add a "flags" field to DeleteInputDeviceRequest." 2010-05-26 07:54:35 -07:00
inputstr.h dix: add 3x3 transformation matrix xinput property for multi-head handling 2010-05-28 16:49:30 +10:00
kdrive-config.h.in kdrive: Add option to compile out input drivers 2010-01-06 19:47:53 +06:00
list.h list.h: Add list_for_each_entry_safe() 2010-05-11 11:01:35 -04:00
Makefile.am Move callback definitions to their own file 2010-04-30 13:04:44 -07:00
misc.h Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN 2010-05-13 10:03:23 -07:00
miscstruct.h Merge branch 'master' into XACE-SELINUX 2007-08-28 07:25:21 -04:00
opaque.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
os.h Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN 2010-05-13 10:03:23 -07:00
pixmap.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
pixmapstr.h pixmap: Add some notes to devKind and devPrivate. 2008-10-10 16:14:23 +02:00
privates.h Remove devPrivates init and delete callback lists. 2010-05-13 14:16:32 -07:00
property.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
propertyst.h dix: devPrivates support for PropertyRec. 2007-03-22 10:59:21 -04:00
protocol-versions.h DRI2: advertise lowest supported DRI2 protocol version 2010-03-29 10:02:37 -07:00
ptrveloc.h Replace some input devPrivates with regular struct fields 2010-04-30 13:05:11 -07:00
region.h Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
regionstr.h Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
registry.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
resource.h Add typed resource-lookup errors for non-core resource types. 2010-05-19 12:32:48 -07:00
rgb.h Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
screenint.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
scrnintstr.h Replace screen->rgf scratch GC flags with a bit in each GC. 2010-05-20 14:36:29 -07:00
selection.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
servermd.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
site.h Update COMPILEDDEFAULTFONTPATH to match the new default font path 2009-11-25 13:34:23 -08:00
swaprep.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
swapreq.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
validate.h Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
version-config.h.in Move VENDOR_* defines from AC_SUBST to a header to avoid angering shave. 2009-04-14 10:35:44 -04:00
window.h Remove CreateUnclippedWinSize from window.h 2009-01-20 22:07:07 -05:00
windowstr.h input: move inputstr.h to where its needed. 2009-06-10 11:15:24 +10:00
XIstubs.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
xkb-config.h.in XKB: Allow build-time configuration of XKB defaults 2009-01-20 15:32:18 +11:00
xkbfile.h XKB: Remove support for setting combined keymaps 2009-01-22 15:08:56 +11:00
xkbrules.h XKB: Remove descriptions from maprules 2009-01-22 15:08:56 +11:00
xkbsrv.h Export XkbCopyDeviceKeymap from Xorg, it is needed by VNC. 2010-05-07 12:17:45 -07:00
xkbstr.h Revert "XKB: Sanitise * actions" commits (#19602) 2009-07-10 11:23:52 +10:00
xorg-config.h.in xfree86: Use xorg.conf.d directory for multiple config files 2009-12-22 23:20:45 -08:00
xorg-server.h.in Remove support for Solaris x86 releases older than Solaris 8 2009-08-13 21:56:05 -07:00
xserver-properties.h dix: add 3x3 transformation matrix xinput property for multi-head handling 2010-05-28 16:49:30 +10:00
xsha1.h Move SHA1 computation from render/glyph.c to os/ 2009-10-15 01:17:44 +02:00
xwin-config.h.in Cygwin/X: Allow the default log location to be configurable 2010-03-16 14:02:17 +00:00