Commit Graph

153 Commits

Author SHA1 Message Date
Peter Hutterer
cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Peter Hutterer
0b4fef6337 dix: move MAX_VALUATOR_EVENTS into include/input.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-10 12:42:45 +10:00
Peter Hutterer
ee1a6c2841 dix: fix calculation of valuator events.
Follow-up to 4971315296. countValuatorEvents was copied from GKVE where it
was obviously broken but nobody noticed. GPE had the correct version, but that
one got lost during de-duplication. Restoring the correct calculation - if we
have 6 valuators, we want 1 valuator event, not 2.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-08 12:05:52 +10:00
Paulo Cesar Pereira de Andrade
49f77fff14 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 05:43:34 -02:00
Peter Hutterer
e670fd8896 dix: fix GetMaximumEventsNum(), may return a DCCE event too.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-03 16:10:40 +10:00
Peter Hutterer
5d02e580d7 dix: use UpdateFromMaster in GetProximityEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-02 15:50:38 +10:00
Paulo Cesar Pereira de Andrade
d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Peter Hutterer
4971315296 dix: clean up GetPointerEvents and GetKeyboardValuatorEvents.
Split into several functions, remove some stale comments.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-04 16:02:25 +10:30
Daniel Stone
d9ff20e323 DIX: Remove unnecessary prototype
We don't call XkbCopyKeymap from getevents.c anymore, so axe it.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-04 16:01:42 +10:30
Peter Hutterer
5d0a945a03 dix: SwitchCorePointer is long gone, bury it. 2008-10-31 17:09:13 +10:30
Tiago Vignatti
d1bb5e3b47 mi: functions here are carrying 'time' without need. 2008-10-08 03:41:17 -03:00
Peter Hutterer
9c8a2be2c7 dix: fix axis scaling.
For two axes [a, b] and [x, y] (inclusive), the formula to scale point P(ab)
to (x,y) is:
    (P - a)/(b - a) * (y - x) + x

And the whole end result rounded of course to get the integer we need.
2008-10-03 15:27:07 +09:30
Peter Hutterer
93ef72fa26 dix: don't lose subpixel precision when scaling.
Only scale x/y back from screen range if we have crossed screen, otherwise
leave it as it is.
2008-10-03 15:27:07 +09:30
Peter Hutterer
609c04b62b dix: stick a warning in about loss of subpixel precision. 2008-08-15 14:52:13 +09:30
Peter Hutterer
465a9bb96e dix: don't try to create events if we don't have a screen. #16898
A NULL screen may happen during server shutdown, when the output has been shut
down but the devices still generate events.

X.Org Bug 16898 <http://bugs.freedesktop.org/show_bug.cgi?id=16898>
2008-08-08 17:37:06 +09:30
Peter Hutterer
6ca34549b8 dix: remove obsolete FIXME comment.
Thanks to Simon Thum for pointing this out.
2008-08-08 16:19:20 +09:30
Simon Thum
c9eb0e870c Add support for multiple pointer acceleration schemes. #8583
Available acceleration schemes:
 - xorg classic scheme.
 - the new "Predictable" polynomial accel scheme.

X.Org Bug 8583 <http://bugs.freedesktop.org/show_bug.cgi?id=8583>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-13 20:54:33 +09:30
Ander Conselvan de Oliveira
c42427f63f Fix incorrect test regarding keyboard map.
In the map stored in each keyboard device, the first line refers to
minimum keycode, i.e., the 0th line refers to keycode 8. When not
using XKB the wrong test caused some keys to be interpreted as
locks ('m' for instance). The had to be pressed twice to generate
both KeyPress and KeyRelease events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-10 17:27:13 +09:30
Peter Hutterer
3a2beb2f86 dix: InitEventList does not need to be _X_EXPORT. 2008-06-25 20:03:31 +09:30
Keith Packard
8c9234a163 Xi: avoid double button mapping.
Button events were mapped once in GetPointerEvents and then again in
UpdateDeviceState. While it might make sense to just fix up UpdateDeviceState,
it turns out to be better to leave the raw button number in the event because
DGA reports raw device events without button translation, and so when it calls
UpdateDeviceState, the button down counts get scrambled and buttons get stuck
down.

See also:
http://lists.freedesktop.org/archives/xorg/2008-June/036201.html

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-06-15 11:47:24 +09:30
Eamon Walsh
c448460fdc Fix "warning: pointer targets in assignment differ in signedness". 2008-06-13 21:05:26 -04:00
Eamon Walsh
17ed6242e7 Fix "warning: assignment from incompatible pointer type". 2008-06-13 21:03:17 -04:00
Peter Hutterer
a7ae9cbd78 dix: don't read valuators past numAxes. 2008-06-02 10:25:52 +09:30
Peter Hutterer
6cecae0e86 dix: Remove superfluous comment.
This code can handle devices with < 2 valuators now.
2008-05-31 17:42:06 +09:30
Peter Hutterer
5fe57787fa dix: store the absolute values in the motion history.
The core protocol requires absolute values and it's a bit hard to get them if
we only have relative ones in the history. Switch the motion history to
absolute, and if we really need the relative values, we can probably generated
them from the abs. ones in the future.
2008-05-26 17:27:32 +09:30
Peter Hutterer
1883485edd If core motion history is required, scale back to screen coords and INT16. 2008-05-26 17:22:25 +09:30
Peter Hutterer
0b88510069 Ensure the motion history is merged for master devices.
Add each event to the master's MH as well as to the SDs. In the MD, store
min/max and the actual value. When retrieving the MH, rescale all coordinates
to the current coordinate range and only post those valuators that are
currently active on the device.
2008-05-26 15:55:20 +09:30
Peter Hutterer
d22c25bda4 dix: Allocate MD's motion history to be large enough for potential valuators
Since we can't predict how many valuators may be in a future SD attached to an
MD, we need to preallocate a history buffer that is large enough to keep
MAX_VALUATORS coordinates per event.

In addition, the history buffer needs to memorize the coordinate ranges at the
time, thus requiring MDs to store (min_val, max_val, current_val, time)
instead of (current_val, time) for each motion history entry.

This commit only fixes the allocation.
2008-05-26 09:26:18 +09:30
Peter Hutterer
0877de13ac Remove GetMotionProc from ValuatorClassRec.
With the MD/SD device hierarchy we need control over the generation of the
motion history as well as the conversion later before posting it to the
client. So let's not let the drivers change it.

No x.org driver currently uses it anyway, linuxwacom doesn't either so dumping
it seems safe enough.
2008-05-25 22:49:54 +09:30
Peter Hutterer
3ae0f4fc83 dix: update valuators > 2 as well.
master->last.valuator[x] for x > 2 is undefined. For all other devices, it's
the respective device's last valuators.

If the lastSlave did not have a valuator that is to be updated now, it is
reset to 0.
2008-05-23 15:52:40 +09:30
Peter Hutterer
7eec1c23a3 dix: don't allow relative data in deviceValuators.
In GPE, we don't care about the device mode. Let's put the absolute values
into the deviceValuator event and worry about relative valuators on the other
side of the EQ.
2008-05-23 13:23:02 +09:30
Peter Hutterer
fe59b1a62b dix: more device scaling insanity.
Assuming master->last.valuators is in screen coords, SD's are always in device
coordinates.

1. If an event comes in, scale masters->last to the device, drop into device's
last->valuators.
2. Apply motion from the actual event
3. Scale back to screen coords, check if we may need to cross screens
4. Drop screen coords into master->last
5. Rescale to device coords, drop into deviceValuator event and SD->last
6. Drop screen coords into ev->root_x/y

Whoopee...
2008-05-23 12:51:52 +09:30
Peter Hutterer
6c9e9f8a40 input: instead of lastx/y, use a last.valuators[] array on the device.
During GetPointerEvents (and others), we need to access the last coordinates
posted for this device from the driver (not as posted to the client!). Lastx/y
is ok if we only have two axes, but with more complex devices we also need to
transition between all other axes.

ABI break, recompile your input drivers.
2008-05-23 12:01:37 +09:30
Peter Hutterer
fb146cbb0f dix: coreEvents doesn't have meaning here, use master instead.
We mustn't clip x/y if we are attached, otherwise we can't change screens.
2008-05-23 12:01:09 +09:30
Magnus Vigerlöf
fc1cc0adcb dix: Cleanup of GetPointerEvents
Changed all the checks for x&y valuator so the more complex
calculation is only made once.
Added TODOs for valuator/axis 2 and above for future correct
handling of relative reporting of these.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-23 09:33:09 +09:30
Magnus Vigerlöf
a0241d5380 dix: Correct clipAxis so it can handle devices with value ranges properly
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-23 09:30:43 +09:30
Peter Hutterer
7f85acdf70 dix: fill valuators with the correct values depending on the device mode (GPE)
valuators[] is passed from the DDX. Depending on the device mode, update it
with either absolute values or relative values. The deviceValuator event sent
to the client will then contain the respective values.
2008-05-22 23:27:15 +09:30
Magnus Vigerlöf
0f15875a27 Make all conversion handling in GPE.
This isn't quite finished yet, but at least it gives us the ability to use a
tablet as a normal mouse - with all the scaling in place.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-22 19:22:46 +09:30
Peter Hutterer
3344569529 Merge branch 'master' into mpx
Conflicts:

	Xi/exevents.c
	dix/devices.c
2008-05-02 11:00:14 +09:30
Peter Hutterer
8e56fd9728 dix: continue to check for invalid valuator ranges.
In an ideal world, the drivers would init all axes with NO_AXIS_LIMIT. In the
real world, this is an ABI break, so let's just leave the old check in.
2008-05-02 10:22:06 +09:30
Jeremy Huddleston
28d1e21f15 Dix: Cleaned up sanity checking in Get{Pointer,Keyboard}Events
XQuartz was crashing because the Appkit thread was trying to GetXXXEvents while the Xserver thread was exiting.
This adds some more sanity checks and avoids that crash
(cherry picked from commit 34ec4bd6ac)
2008-04-30 17:33:07 -07:00
Peter Hutterer
fea39c94bc dix: fix typo from last commit. 2008-04-30 13:17:14 +09:30
Peter Hutterer
ffaccc2dc9 input: replace -1 as default axis limit with NO_AXIS_LIMIT define.
This allows easier refacturing of the coordinate limit handling. Grepping for
-1 is boring.
2008-04-30 11:49:11 +09:30
Peter Hutterer
00acb40f2b dix: fix typo in clipAxis.
Check needs to be (min_axis < max_axis), not (min_axis < min_axis)
2008-04-30 11:29:03 +09:30
Peter Hutterer
f2a20294fe dix: store all valuators as they come from the device in the valuator events.
The event's sequenceNumber is mis-used to determine whether the values are
relative or absolute.
2008-04-29 11:18:35 +09:30
Peter Hutterer
3b93631e59 dix: remove coreOnly check. Core pointer must generate XI events now.
This flag was only used when an event is generated by Warp[Device]Pointer.
Since the VCP now happily generates core events, this flag is obsolete.
2008-04-18 14:39:45 +09:30
Magnus Vigerlöf
5ffbcfec3d dix: Ensure Proximity events don't kill the server.
Add Prox events to the if-clauses with the other events
that are usually sent from the input devices.
Ensure that the event deliverers won't try to deliver
events of type '0' (some extended events doesn't have
an equivalent core-type)

Small modification by Peter Hutterer.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-04-08 14:43:22 +09:30
Peter Hutterer
fd06e8f8c1 Merge branch 'master' into dcdc_rework
Conflicts:

	Xext/xevie.c
	dix/dispatch.c
2008-04-07 07:56:41 +09:30
Adam Jackson
333e7123dc Fix that last commit.
I can apply patches, really.
2008-03-25 12:48:22 -04:00
Sascha Hlusiak
e7a3644255 Fix getValuatorEvents to compute number of valuators correctly. 2008-03-25 12:32:33 -04:00