Some drivers, most notably the mouse driver need this and reimplementing on
the driver side doesn't make sense.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The XI2 protocol supports per-axis modes, but the server so far does
not. This change adds support in the server.
A complication is the fact that XI1 does not support per-axis modes.
The solution provided here is to set a per-device mode that defines the
mode of at least the first two valuators (X and Y). Note that initializing
the first two axes to a different mode than the device mode will fail.
For XI1 events, any axes following the first two that have the same mode
will be sent to clients, up to the first axis that has a different mode.
Thus, if a device has relative, then absolute, then relative mode axes,
only the first block of relative axes will be sent over XI1.
Since the XI2 protocol supports per-axis modes, all axes are sent to the
client.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
This commit introduces an abstraction API for handling masked valuators. The
intent is that drivers just allocate a mask, set the data and pass the mask
to the server. The actual storage type of the mask is hidden from the
drivers.
The new calls for drivers are:
valuator_mask_new() /* to allocate a valuator mask */
valuator_mask_zero() /* to reset a mask to zero */
valuator_mask_set() /* to set a valuator value */
The new interface to the server is
xf86PostMotionEventM()
xf86PostButtonEventM()
xf86PostKeyboardEventM()
xf86PostProximityEventM()
all taking a mask instead of the valuator array.
The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to
memory allocation restrictions in SIGIO handlers.
For easier review, a lot of the code still uses separate valuator arrays.
This will be fixed in a later patch.
This patch was initially written by Chase Douglas.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Maybe it's just me but every time I look at it I get confused again and need
to work it out from scratch. Rename the parameters to something
self-explanatory, to/from and min/max.
No functional change.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
There are no references to it other than the commit that added them. But
since we're re-doing the API anyway, now is a good time to break things.
commit 9398d62f27
Author: Daniel Stone <daniel@fooishbar.org>
Date: Wed Mar 21 00:18:24 2007 +0200
XFree86 input: Add backwards compatibility for motion history
Add the old motion history API back, as a shim around the new mi
API.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
The input drivers that use it only do so with ABI 0 and we're long past this
one now. Input driver don't have a say in whether they send core events now
anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Use xf86FirstLocalDevice() instead (but don't get me started on the naming
of that one...)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
This struct is superfluous, maintaining the same info as the InputInfoRec
(with the exception of the driver name).
This is a rather large commit with the majority of changes being a rename
from the fields of the IDevRec (idev, commonOptions) to the InputInfoRec
(pInfo, options).
The actual changes affect the initialization process of the input device:
In NewInputDeviceRequest, the InputInfoRec is now always allocated and just
added to the internal list in xf86NewInputDevice() if the init process
succeeded.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
And unexport it, drivers don't need to call this in the new init process.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
None of them are called by the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
This field was only used in one location where we can use a local variable.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Two names pointing to the same struct for over 7 years now. Remove the
define, if drivers don't want to change they can always do the typedef
themselves.
Rename all "LocalDevicePtr local" to "InputInfoPtr pInfo".
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Input driver messages are only standardised by convention, with the drivers
prefixing the device name to most messages. This makes it rather hard to
grep on "evdev" for example when looking for the evdev ouput.
This patch adds three new logging functions, modeled after xf86DrvMsg(), the
logging function for output drivers. New functions are
xf86IDrvMsg() - input driver log message in default verbosity.
xf86IDrvMsgVerb() - input driver log message in specified verbosity.
xf86VIDrvMsgVerb() - same as xf86IDrvMsgVerb() but takes a varargs
argument.
Default log format is <driver name>: <device name>: <message>.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Make xf86AllocateInput static in the process, this function is only called
from one location.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
From the documentation:
"This is mainly to allow a touch screen to be used with netscape and other
browsers which do strange things if the mouse moves between button down and
button up."
CLOSED - NOTOURBUG
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
PreInit returns a status code. Let's use that instead of having it report
Success in some cases but not set the XI86_CONFIGURED flag and thus signal
an init failure.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
These defines have been write-only for a while now.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
No-one but the joystick driver uses it and that one should be using NIDR
instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
The main change introduced in this patch is the removal of the
back-and-forth between DDX and the driver.
The DDX now allocates the InputInfoRec and fills it with default values. The
DDX processes common options (and module-specific default options, if
appropriate) before passing the initialised struct to the driver.
The driver may do module-specific initializations and return Success or an
error code in the case of a failure.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
InputAttributes largely decide which configuration values get merged from
the xorg.conf.d snippets. While they are available in the config backend,
they are not available for any other callers of NewInputDeviceRequest().
Drivers implementing driver-side hotplugging do not have access to these
attributes and cannot have xorg.conf.d snippets specific to dependent
devices. For example, the following case cannot work right now:
Section "InputClass"
MatchProduct "Wacom"
Option "PressCurve" "0 0 100 100"
...
EndSection
Section "InputClass"
MatchProduct "Wacom"
MatchProduct "eraser"
Option "PressCurve" "10 10 50 50"
...
EndSection
The second section is not triggered, as the wacom driver cannot supply the
InputAttributes to NewInputDeviceRequest().
Add the attributes to the IDevRec and merge them into the InputInfoRec to
make them accessible in the driver. This changes the ABI for input drivers.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This function was used as the default motion event queue API until
including XINPUT_ABI 2 (server 1.5).
This API was broken with 1883485 in May 2008 (wrong casting of parameters)
and isn't in use by input drivers past ABI 3.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
xf86PostKeyboardEvent also makes use of xf86PostKeyEventP to avoid code
duplication, and the valuator verification has been split into the
XI_VERIFY_VALUATORS macro.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
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).
Just ignore devices after MAXDEVICES has been reached, but warn the user that
the devices are ignored.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
These symbols were removed from the X Server, or never declared.
One symbol that may need special attention is XkbBuildCoreState(),
that doesn't have a prototype anywhere, but is called from
xkb/xkbEvents.c:XkbFilterEvents(), and also used by the macros
XkbStateFieldFromRec() and XkbGrabStateFromRec() defined in
include/xkbstr.h.
fb/wfbrename.h also may need some cleanup, as it makes several
"renames" of non existing symbols.
The xfree86 server previously hat NewInputDeviceRequest and InitInput, and
both basically did the same thing. Reduce NIDR to parameter checking and use
xf86NewInputDevice from both InitInput and NIDR to actually create the device.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>