2003-11-14 16:54:54 +01:00
|
|
|
/************************************************************
|
|
|
|
|
|
|
|
Copyright 1987, 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.
|
|
|
|
|
|
|
|
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
2014-10-31 00:45:12 +01:00
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
2003-11-14 16:54:54 +01:00
|
|
|
provided that the above copyright notice appear in all copies and that
|
2014-10-31 00:45:12 +01:00
|
|
|
both that copyright notice and this permission notice appear in
|
2003-11-14 16:54:54 +01:00
|
|
|
supporting documentation, and that the name of Digital not be
|
|
|
|
used in advertising or publicity pertaining to distribution of the
|
2014-10-31 00:45:12 +01:00
|
|
|
software without specific, written prior permission.
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
|
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
|
|
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
|
|
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
|
|
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
|
|
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
|
|
SOFTWARE.
|
|
|
|
|
|
|
|
********************************************************/
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifndef INPUT_H
|
|
|
|
#define INPUT_H
|
|
|
|
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "screenint.h"
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/Xmd.h>
|
|
|
|
#include <X11/Xproto.h>
|
2009-09-02 15:47:13 +02:00
|
|
|
#include <stdint.h>
|
2012-03-21 20:55:09 +01:00
|
|
|
#include "window.h" /* for WindowPtr */
|
2008-12-26 08:38:25 +01:00
|
|
|
#include "xkbrules.h"
|
2009-07-27 08:54:33 +02:00
|
|
|
#include "events.h"
|
2011-08-04 06:45:46 +02:00
|
|
|
#include "list.h"
|
2015-12-08 20:37:51 +01:00
|
|
|
#include "os.h"
|
2011-10-28 04:55:55 +02:00
|
|
|
#include <X11/extensions/XI2.h>
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2019-10-16 20:41:20 +02:00
|
|
|
#define DEFAULT_KEYBOARD_CLICK 0
|
|
|
|
#define DEFAULT_BELL 50
|
|
|
|
#define DEFAULT_BELL_PITCH 400
|
|
|
|
#define DEFAULT_BELL_DURATION 100
|
|
|
|
#define DEFAULT_AUTOREPEAT TRUE
|
|
|
|
#define DEFAULT_AUTOREPEATS {\
|
|
|
|
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
|
|
|
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
|
|
|
|
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
|
|
|
|
|
|
|
|
#define DEFAULT_LEDS 0x0 /* all off */
|
|
|
|
#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */
|
|
|
|
#define DEFAULT_INT_RESOLUTION 1000
|
|
|
|
#define DEFAULT_INT_MIN_VALUE 0
|
|
|
|
#define DEFAULT_INT_MAX_VALUE 100
|
|
|
|
#define DEFAULT_INT_DISPLAYED 0
|
|
|
|
|
|
|
|
#define DEFAULT_PTR_NUMERATOR 2
|
|
|
|
#define DEFAULT_PTR_DENOMINATOR 1
|
|
|
|
#define DEFAULT_PTR_THRESHOLD 4
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#define DEVICE_INIT 0
|
|
|
|
#define DEVICE_ON 1
|
|
|
|
#define DEVICE_OFF 2
|
|
|
|
#define DEVICE_CLOSE 3
|
2013-01-30 04:20:07 +01:00
|
|
|
#define DEVICE_ABORT 4
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-06-24 03:02:23 +02:00
|
|
|
#define POINTER_RELATIVE (1 << 1)
|
|
|
|
#define POINTER_ABSOLUTE (1 << 2)
|
|
|
|
#define POINTER_ACCELERATE (1 << 3)
|
2012-03-21 20:55:09 +01:00
|
|
|
#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */
|
|
|
|
#define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */
|
|
|
|
#define POINTER_EMULATED (1 << 6) /* Event was emulated from another event */
|
2013-01-26 06:53:08 +01:00
|
|
|
#define POINTER_DESKTOP (1 << 7) /* Data in desktop coordinates */
|
2006-10-23 01:50:53 +02:00
|
|
|
|
2011-12-14 06:00:33 +01:00
|
|
|
/* GetTouchEvent flags */
|
|
|
|
#define TOUCH_ACCEPT (1 << 0)
|
|
|
|
#define TOUCH_REJECT (1 << 1)
|
|
|
|
#define TOUCH_PENDING_END (1 << 2)
|
|
|
|
#define TOUCH_CLIENT_ID (1 << 3) /* touch ID is the client-visible id */
|
|
|
|
#define TOUCH_REPLAYING (1 << 4) /* event is being replayed */
|
|
|
|
#define TOUCH_POINTER_EMULATED (1 << 5) /* touch event may be pointer emulated */
|
|
|
|
#define TOUCH_END (1 << 6) /* really end this touch now */
|
|
|
|
|
2008-07-10 15:03:39 +02:00
|
|
|
/*int constants for pointer acceleration schemes*/
|
|
|
|
#define PtrAccelNoOp 0
|
|
|
|
#define PtrAccelPredictable 1
|
2008-07-23 11:10:22 +02:00
|
|
|
#define PtrAccelLightweight 2
|
2008-07-10 15:03:39 +02:00
|
|
|
#define PtrAccelDefault PtrAccelPredictable
|
|
|
|
|
2008-12-10 02:35:09 +01:00
|
|
|
#define MAX_VALUATORS 36
|
|
|
|
/* Maximum number of valuators, divided by six, rounded up, to get number
|
|
|
|
* of events. */
|
|
|
|
#define MAX_VALUATOR_EVENTS 6
|
2012-03-21 20:55:09 +01:00
|
|
|
#define MAX_BUTTONS 256 /* completely arbitrarily chosen */
|
2008-05-23 04:21:53 +02:00
|
|
|
|
2008-04-30 04:15:19 +02:00
|
|
|
#define NO_AXIS_LIMITS -1
|
|
|
|
|
2014-01-24 09:33:54 +01:00
|
|
|
#define MAP_LENGTH MAX_BUTTONS
|
|
|
|
#define DOWN_LENGTH (MAX_BUTTONS/8) /* 256/8 => number of bytes to hold 256 bits */
|
2003-11-14 16:54:54 +01:00
|
|
|
#define NullGrab ((GrabPtr)NULL)
|
|
|
|
#define PointerRootWin ((WindowPtr)PointerRoot)
|
|
|
|
#define NoneWin ((WindowPtr)None)
|
|
|
|
#define NullDevice ((DevicePtr)NULL)
|
|
|
|
|
|
|
|
#ifndef FollowKeyboard
|
|
|
|
#define FollowKeyboard 3
|
|
|
|
#endif
|
|
|
|
#ifndef FollowKeyboardWin
|
|
|
|
#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
|
|
|
|
#endif
|
|
|
|
#ifndef RevertToFollowKeyboard
|
|
|
|
#define RevertToFollowKeyboard 3
|
|
|
|
#endif
|
|
|
|
|
2011-12-08 05:27:01 +01:00
|
|
|
enum InputLevel {
|
2013-09-04 07:34:27 +02:00
|
|
|
CORE = 1,
|
|
|
|
XI = 2,
|
|
|
|
XI2 = 3,
|
2011-12-08 05:27:01 +01:00
|
|
|
};
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
typedef unsigned long Leds;
|
|
|
|
typedef struct _OtherClients *OtherClientsPtr;
|
|
|
|
typedef struct _InputClients *InputClientsPtr;
|
|
|
|
typedef struct _DeviceIntRec *DeviceIntPtr;
|
2011-04-12 02:17:07 +02:00
|
|
|
typedef struct _ValuatorClassRec *ValuatorClassPtr;
|
2007-11-15 06:13:44 +01:00
|
|
|
typedef struct _ClassesRec *ClassesPtr;
|
2010-12-27 13:48:42 +01:00
|
|
|
typedef struct _SpriteRec *SpritePtr;
|
2011-12-14 03:46:40 +01:00
|
|
|
typedef struct _TouchClassRec *TouchClassPtr;
|
|
|
|
typedef struct _TouchPointInfo *TouchPointInfoPtr;
|
|
|
|
typedef struct _DDXTouchPointInfo *DDXTouchPointInfoPtr;
|
2009-04-12 09:38:28 +02:00
|
|
|
typedef union _GrabMask GrabMask;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-23 02:29:34 +01:00
|
|
|
typedef struct _ValuatorMask ValuatorMask;
|
|
|
|
|
2008-02-03 00:26:19 +01:00
|
|
|
/* The DIX stores incoming input events in this list */
|
2012-03-21 20:55:09 +01:00
|
|
|
extern InternalEvent *InputEventList;
|
2007-05-02 06:20:09 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef int (*DeviceProc) (DeviceIntPtr /*device */ ,
|
|
|
|
int /*what */ );
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef void (*ProcessInputProc) (InternalEvent * /*event */ ,
|
|
|
|
DeviceIntPtr /*device */ );
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef Bool (*DeviceHandleProc) (DeviceIntPtr /*device */ ,
|
|
|
|
void * /*data */
|
2004-07-30 03:21:57 +02:00
|
|
|
);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef void (*DeviceUnwrapProc) (DeviceIntPtr /*device */ ,
|
|
|
|
DeviceHandleProc /*proc */ ,
|
|
|
|
void * /*data */
|
2004-07-30 03:21:57 +02:00
|
|
|
);
|
|
|
|
|
2008-07-10 15:03:39 +02:00
|
|
|
/* pointer acceleration handling */
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef void (*PointerAccelSchemeProc) (DeviceIntPtr /*device */ ,
|
|
|
|
ValuatorMask * /*valuators */ ,
|
|
|
|
CARD32 /*evtime */ );
|
2008-07-10 15:03:39 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef void (*DeviceCallbackProc) (DeviceIntPtr /*pDev */ );
|
2008-07-10 15:03:39 +02:00
|
|
|
|
2010-09-04 16:31:24 +02:00
|
|
|
struct _ValuatorAccelerationRec;
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef Bool (*PointerAccelSchemeInitProc) (DeviceIntPtr /*dev */ ,
|
|
|
|
struct _ValuatorAccelerationRec *
|
|
|
|
/*protoScheme */ );
|
2010-09-04 16:31:24 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
typedef struct _DeviceRec {
|
2013-12-15 10:05:51 +01:00
|
|
|
void *devicePrivate;
|
2012-03-21 20:55:09 +01:00
|
|
|
ProcessInputProc processInputProc; /* current */
|
|
|
|
ProcessInputProc realInputProc; /* deliver */
|
|
|
|
ProcessInputProc enqueueInputProc; /* enqueue */
|
|
|
|
Bool on; /* used by DDX to keep state */
|
2003-11-14 16:54:54 +01:00
|
|
|
} DeviceRec, *DevicePtr;
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
int click, bell, bell_pitch, bell_duration;
|
|
|
|
Bool autoRepeat;
|
|
|
|
unsigned char autoRepeats[32];
|
|
|
|
Leds leds;
|
|
|
|
unsigned char id;
|
2003-11-14 16:54:54 +01:00
|
|
|
} KeybdCtrl;
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
KeySym *map;
|
|
|
|
KeyCode minKeyCode, maxKeyCode;
|
|
|
|
int mapWidth;
|
2003-11-14 16:54:54 +01:00
|
|
|
} KeySymsRec, *KeySymsPtr;
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
int num, den, threshold;
|
2003-11-14 16:54:54 +01:00
|
|
|
unsigned char id;
|
|
|
|
} PtrCtrl;
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
int resolution, min_value, max_value;
|
|
|
|
int integer_displayed;
|
2003-11-14 16:54:54 +01:00
|
|
|
unsigned char id;
|
|
|
|
} IntegerCtrl;
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
int max_symbols, num_symbols_supported;
|
|
|
|
int num_symbols_displayed;
|
|
|
|
KeySym *symbols_supported;
|
|
|
|
KeySym *symbols_displayed;
|
2003-11-14 16:54:54 +01:00
|
|
|
unsigned char id;
|
|
|
|
} StringCtrl;
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
int percent, pitch, duration;
|
2003-11-14 16:54:54 +01:00
|
|
|
unsigned char id;
|
|
|
|
} BellCtrl;
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
Leds led_values;
|
|
|
|
Mask led_mask;
|
2003-11-14 16:54:54 +01:00
|
|
|
unsigned char id;
|
|
|
|
} LedCtrl;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT KeybdCtrl defaultKeyboardControl;
|
|
|
|
extern _X_EXPORT PtrCtrl defaultPointerControl;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-08-04 06:45:46 +02:00
|
|
|
typedef struct _InputOption InputOption;
|
2011-11-03 04:39:59 +01:00
|
|
|
typedef struct _XI2Mask XI2Mask;
|
2006-07-19 16:05:12 +02:00
|
|
|
|
2009-09-02 15:47:13 +02:00
|
|
|
typedef struct _InputAttributes {
|
2014-01-29 23:50:06 +01:00
|
|
|
char *product;
|
|
|
|
char *vendor;
|
|
|
|
char *device;
|
|
|
|
char *pnp_id;
|
|
|
|
char *usb_id;
|
|
|
|
char **tags; /* null-terminated */
|
2012-03-21 20:55:09 +01:00
|
|
|
uint32_t flags;
|
2009-09-02 15:47:13 +02:00
|
|
|
} InputAttributes;
|
|
|
|
|
|
|
|
#define ATTR_KEYBOARD (1<<0)
|
|
|
|
#define ATTR_POINTER (1<<1)
|
|
|
|
#define ATTR_JOYSTICK (1<<2)
|
|
|
|
#define ATTR_TABLET (1<<3)
|
|
|
|
#define ATTR_TOUCHPAD (1<<4)
|
|
|
|
#define ATTR_TOUCHSCREEN (1<<5)
|
config/udev: distinguish between real keyboards and other key devices
This patch introduces a new flag ATTR_KEY for hotplugged input devices,
so we can better distinguish between real keyboards (i.e. devices with
udev property ID_INPUT_KEYBOARD="1") and other key input devices like
lid switches, power buttons, etc.
All supported hotplug backends (udev, hal, and wscons) will set both
flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend
will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input
devices (hal and wscons will set both flags in any case). With this
distinction, kdrive input hotplugging mechanism will be allowed to only
grab real keyboards, as other key input devices are currently not
supported.
In order to don't break current behaviour, this patch will replace all
ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c.
[ajax: Just add ATTR_KEY, don't re-number the other attributes]
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-02-12 17:18:02 +01:00
|
|
|
#define ATTR_KEY (1<<6)
|
2016-04-22 07:04:37 +02:00
|
|
|
#define ATTR_TABLET_PAD (1<<7)
|
2009-09-02 15:47:13 +02:00
|
|
|
|
2010-07-06 01:16:42 +02:00
|
|
|
/* Key/Button has been run through all input processing and events sent to clients. */
|
2008-04-16 18:15:30 +02:00
|
|
|
#define KEY_PROCESSED 1
|
2010-07-06 01:16:42 +02:00
|
|
|
#define BUTTON_PROCESSED 1
|
|
|
|
/* Key/Button has not been fully processed, no events have been sent. */
|
2008-04-16 18:15:30 +02:00
|
|
|
#define KEY_POSTED 2
|
2010-07-06 01:16:42 +02:00
|
|
|
#define BUTTON_POSTED 2
|
2008-04-16 18:15:30 +02:00
|
|
|
|
2013-11-13 08:14:11 +01:00
|
|
|
extern _X_EXPORT void set_key_down(DeviceIntPtr pDev, int key_code, int type);
|
|
|
|
extern _X_EXPORT void set_key_up(DeviceIntPtr pDev, int key_code, int type);
|
|
|
|
extern _X_EXPORT int key_is_down(DeviceIntPtr pDev, int key_code, int type);
|
|
|
|
extern _X_EXPORT void set_button_down(DeviceIntPtr pDev, int button, int type);
|
|
|
|
extern _X_EXPORT void set_button_up(DeviceIntPtr pDev, int button, int type);
|
|
|
|
extern _X_EXPORT int button_is_down(DeviceIntPtr pDev, int button, int type);
|
2008-04-16 18:15:30 +02:00
|
|
|
|
2009-03-19 11:40:43 +01:00
|
|
|
extern void InitCoreDevices(void);
|
2009-08-24 01:38:15 +02:00
|
|
|
extern void InitXTestDevices(void);
|
2006-08-18 16:24:34 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT DeviceIntPtr AddInputDevice(ClientPtr /*client */ ,
|
|
|
|
DeviceProc /*deviceProc */ ,
|
|
|
|
Bool /*autoStart */ );
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT Bool EnableDevice(DeviceIntPtr /*device */ ,
|
|
|
|
BOOL /* sendevent */ );
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT Bool ActivateDevice(DeviceIntPtr /*device */ ,
|
|
|
|
BOOL /* sendevent */ );
|
2006-07-20 22:39:54 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT Bool DisableDevice(DeviceIntPtr /*device */ ,
|
|
|
|
BOOL /* sendevent */ );
|
2012-05-09 01:21:28 +02:00
|
|
|
extern void DisableAllDevices(void);
|
2009-03-19 11:40:43 +01:00
|
|
|
extern int InitAndStartDevices(void);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2009-03-19 11:40:43 +01:00
|
|
|
extern void CloseDownDevices(void);
|
2013-01-30 04:20:07 +01:00
|
|
|
extern void AbortDevices(void);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2009-03-19 11:40:43 +01:00
|
|
|
extern void UndisplayDevices(void);
|
2007-04-09 12:01:59 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT int RemoveDevice(DeviceIntPtr /*dev */ ,
|
|
|
|
BOOL /* sendevent */ );
|
2003-11-14 17:49:22 +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
|
|
|
extern _X_EXPORT int NumMotionEvents(void);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT int dixLookupDevice(DeviceIntPtr * /* dev */ ,
|
|
|
|
int /* id */ ,
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
Mask /* access_mode */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT void QueryMinMaxKeyCodes(KeyCode * /*minCode */ ,
|
|
|
|
KeyCode * /*maxCode */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitButtonClassDeviceStruct(DeviceIntPtr /*device */ ,
|
|
|
|
int /*numButtons */ ,
|
|
|
|
Atom * /* labels */ ,
|
|
|
|
CARD8 * /*map */ );
|
|
|
|
|
|
|
|
extern _X_INTERNAL ValuatorClassPtr AllocValuatorClass(ValuatorClassPtr src,
|
|
|
|
int numAxes);
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitValuatorClassDeviceStruct(DeviceIntPtr /*device */ ,
|
|
|
|
int /*numAxes */ ,
|
|
|
|
Atom * /* labels */ ,
|
|
|
|
int /*numMotionEvents */ ,
|
|
|
|
int /*mode */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitPointerAccelerationScheme(DeviceIntPtr /*dev */ ,
|
|
|
|
int /*scheme */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitFocusClassDeviceStruct(DeviceIntPtr /*device */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitTouchClassDeviceStruct(DeviceIntPtr /*device */ ,
|
|
|
|
unsigned int /*max_touches */ ,
|
|
|
|
unsigned int /*mode */ ,
|
|
|
|
unsigned int /*numAxes */ );
|
|
|
|
|
2014-03-10 23:31:33 +01:00
|
|
|
typedef void (*BellProcPtr) (int percent,
|
|
|
|
DeviceIntPtr device,
|
|
|
|
void *ctrl,
|
|
|
|
int feedbackClass);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
typedef void (*KbdCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
|
|
|
KeybdCtrl * /*ctrl */ );
|
|
|
|
|
|
|
|
typedef void (*PtrCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
|
|
|
PtrCtrl * /*ctrl */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(DeviceIntPtr /*device */
|
|
|
|
,
|
|
|
|
PtrCtrlProcPtr
|
|
|
|
/*controlProc */ );
|
|
|
|
|
|
|
|
typedef void (*StringCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
|
|
|
StringCtrl * /*ctrl */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitStringFeedbackClassDeviceStruct(DeviceIntPtr
|
|
|
|
/*device */ ,
|
|
|
|
StringCtrlProcPtr
|
|
|
|
/*controlProc */ ,
|
|
|
|
int /*max_symbols */ ,
|
|
|
|
int
|
|
|
|
/*num_symbols_supported */
|
|
|
|
,
|
|
|
|
KeySym * /*symbols */
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef void (*BellCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
|
|
|
BellCtrl * /*ctrl */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitBellFeedbackClassDeviceStruct(DeviceIntPtr /*device */
|
|
|
|
,
|
|
|
|
BellProcPtr
|
|
|
|
/*bellProc */ ,
|
|
|
|
BellCtrlProcPtr
|
|
|
|
/*controlProc */ );
|
|
|
|
|
|
|
|
typedef void (*LedCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
|
|
|
LedCtrl * /*ctrl */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitLedFeedbackClassDeviceStruct(DeviceIntPtr /*device */
|
|
|
|
,
|
|
|
|
LedCtrlProcPtr
|
|
|
|
/*controlProc */ );
|
|
|
|
|
|
|
|
typedef void (*IntegerCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
|
|
|
IntegerCtrl * /*ctrl */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct(DeviceIntPtr
|
|
|
|
/*device */ ,
|
|
|
|
IntegerCtrlProcPtr
|
|
|
|
/*controlProc */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitPointerDeviceStruct(DevicePtr /*device */ ,
|
|
|
|
CARD8 * /*map */ ,
|
|
|
|
int /*numButtons */ ,
|
|
|
|
Atom * /* btn_labels */ ,
|
|
|
|
PtrCtrlProcPtr /*controlProc */ ,
|
|
|
|
int /*numMotionEvents */ ,
|
|
|
|
int /*numAxes */ ,
|
|
|
|
Atom * /* axes_labels */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InitKeyboardDeviceStruct(DeviceIntPtr /*device */ ,
|
|
|
|
XkbRMLVOSet * /*rmlvo */ ,
|
|
|
|
BellProcPtr /*bellProc */ ,
|
|
|
|
KbdCtrlProcPtr /*controlProc */
|
|
|
|
);
|
|
|
|
|
2014-03-12 07:31:25 +01:00
|
|
|
extern _X_EXPORT Bool InitKeyboardDeviceStructFromString(DeviceIntPtr dev,
|
|
|
|
const char *keymap,
|
|
|
|
int keymap_length,
|
|
|
|
BellProcPtr bell_func,
|
|
|
|
KbdCtrlProcPtr ctrl_func);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern int ApplyPointerMapping(DeviceIntPtr /* pDev */ ,
|
|
|
|
CARD8 * /* map */ ,
|
|
|
|
int /* len */ ,
|
|
|
|
ClientPtr /* client */ );
|
|
|
|
|
|
|
|
extern Bool BadDeviceMap(BYTE * /*buff */ ,
|
|
|
|
int /*length */ ,
|
|
|
|
unsigned /*low */ ,
|
|
|
|
unsigned /*high */ ,
|
|
|
|
XID * /*errval */ );
|
|
|
|
|
|
|
|
extern void NoteLedState(DeviceIntPtr /*keybd */ ,
|
|
|
|
int /*led */ ,
|
|
|
|
Bool /*on */ );
|
|
|
|
|
|
|
|
extern void MaybeStopHint(DeviceIntPtr /*device */ ,
|
|
|
|
ClientPtr /*client */ );
|
|
|
|
|
|
|
|
extern void ProcessPointerEvent(InternalEvent * /* ev */ ,
|
|
|
|
DeviceIntPtr /*mouse */ );
|
|
|
|
|
|
|
|
extern void ProcessKeyboardEvent(InternalEvent * /*ev */ ,
|
|
|
|
DeviceIntPtr /*keybd */ );
|
|
|
|
|
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
|
|
|
extern _X_EXPORT void ProcessInputEvents(void);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT void InitInput(int /*argc */ ,
|
|
|
|
char ** /*argv */ );
|
2010-01-15 06:22:02 +01:00
|
|
|
extern _X_EXPORT void CloseInput(void);
|
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
|
|
|
extern _X_EXPORT int GetMaximumEventsNum(void);
|
2006-08-10 13:00:14 +02:00
|
|
|
|
2011-04-14 14:05:41 +02:00
|
|
|
extern _X_EXPORT InternalEvent *InitEventList(int num_events);
|
|
|
|
extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events);
|
2007-05-02 06:20:09 +02:00
|
|
|
|
2011-04-14 14:05:41 +02:00
|
|
|
extern void CreateClassesChangedEvent(InternalEvent *event,
|
2007-11-12 02:05:18 +01:00
|
|
|
DeviceIntPtr master,
|
2012-03-21 20:55:09 +01:00
|
|
|
DeviceIntPtr slave, int flags);
|
|
|
|
|
|
|
|
extern InternalEvent *UpdateFromMaster(InternalEvent *events,
|
|
|
|
DeviceIntPtr pDev,
|
|
|
|
int type, int *num_events);
|
|
|
|
|
|
|
|
extern _X_EXPORT int GetPointerEvents(InternalEvent *events,
|
|
|
|
DeviceIntPtr pDev,
|
|
|
|
int type,
|
|
|
|
int buttons,
|
|
|
|
int flags, const ValuatorMask *mask);
|
|
|
|
|
|
|
|
extern _X_EXPORT void QueuePointerEvents(DeviceIntPtr pDev,
|
|
|
|
int type,
|
|
|
|
int buttons,
|
|
|
|
int flags, const ValuatorMask *mask);
|
|
|
|
|
|
|
|
extern _X_EXPORT int GetKeyboardEvents(InternalEvent *events,
|
|
|
|
DeviceIntPtr pDev,
|
|
|
|
int type,
|
2014-12-16 05:43:29 +01:00
|
|
|
int key_code);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev,
|
|
|
|
int type,
|
2014-12-16 05:43:29 +01:00
|
|
|
int key_code);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
extern int GetTouchEvents(InternalEvent *events,
|
|
|
|
DeviceIntPtr pDev,
|
|
|
|
uint32_t ddx_touchid,
|
|
|
|
uint16_t type,
|
|
|
|
uint32_t flags, const ValuatorMask *mask);
|
2011-12-14 05:41:48 +01:00
|
|
|
|
|
|
|
void QueueTouchEvents(DeviceIntPtr device,
|
|
|
|
int type,
|
|
|
|
uint32_t ddx_touchid,
|
2012-03-21 20:55:09 +01:00
|
|
|
int flags, const ValuatorMask *mask);
|
|
|
|
|
|
|
|
extern int GetTouchOwnershipEvents(InternalEvent *events,
|
|
|
|
DeviceIntPtr pDev,
|
|
|
|
TouchPointInfoPtr ti,
|
|
|
|
uint8_t mode, XID resource, uint32_t flags);
|
2012-10-14 05:08:27 +02:00
|
|
|
|
|
|
|
extern void GetDixTouchEnd(InternalEvent *ievent,
|
|
|
|
DeviceIntPtr dev,
|
|
|
|
TouchPointInfoPtr ti,
|
|
|
|
uint32_t flags);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
extern _X_EXPORT int GetProximityEvents(InternalEvent *events,
|
|
|
|
DeviceIntPtr pDev,
|
|
|
|
int type, const ValuatorMask *mask);
|
|
|
|
|
|
|
|
extern _X_EXPORT void QueueProximityEvents(DeviceIntPtr pDev,
|
|
|
|
int type, const ValuatorMask *mask);
|
|
|
|
|
2012-04-25 15:03:31 +02:00
|
|
|
#ifdef PANORAMIX
|
|
|
|
_X_EXPORT
|
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
extern void PostSyntheticMotion(DeviceIntPtr pDev,
|
|
|
|
int x, int y, int screen, unsigned long time);
|
|
|
|
|
|
|
|
extern _X_EXPORT int GetMotionHistorySize(void);
|
|
|
|
|
|
|
|
extern _X_EXPORT void AllocateMotionHistory(DeviceIntPtr pDev);
|
|
|
|
|
|
|
|
extern _X_EXPORT int GetMotionHistory(DeviceIntPtr pDev,
|
|
|
|
xTimecoord ** buff,
|
|
|
|
unsigned long start,
|
|
|
|
unsigned long stop,
|
|
|
|
ScreenPtr pScreen, BOOL core);
|
2006-10-25 00:08:29 +02:00
|
|
|
|
2011-04-15 06:06:20 +02:00
|
|
|
extern void ReleaseButtonsAndKeys(DeviceIntPtr dev);
|
|
|
|
|
2009-03-19 11:40:43 +01:00
|
|
|
extern int AttachDevice(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
DeviceIntPtr slave, DeviceIntPtr master);
|
2007-02-22 10:30:59 +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
|
|
|
extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
|
2015-02-19 13:57:27 +01:00
|
|
|
extern _X_EXPORT DeviceIntPtr GetMaster(DeviceIntPtr dev, int type);
|
2007-03-02 05:51:46 +01:00
|
|
|
|
2010-03-22 14:52:29 +01:00
|
|
|
extern _X_EXPORT int AllocDevicePair(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
const char *name,
|
|
|
|
DeviceIntPtr *ptr,
|
|
|
|
DeviceIntPtr *keybd,
|
|
|
|
DeviceProc ptr_proc,
|
|
|
|
DeviceProc keybd_proc, Bool master);
|
2009-03-19 11:40:43 +01:00
|
|
|
extern void DeepCopyDeviceClasses(DeviceIntPtr from,
|
2012-03-21 20:55:09 +01:00
|
|
|
DeviceIntPtr to, DeviceChangedEvent *dce);
|
2008-04-29 07:45:16 +02:00
|
|
|
|
2008-04-16 18:15:30 +02:00
|
|
|
/* Helper functions. */
|
2010-03-22 14:52:29 +01:00
|
|
|
extern _X_EXPORT int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
|
2012-03-21 20:55:09 +01:00
|
|
|
KeyCode **modkeymap,
|
|
|
|
int *max_keys_per_mod);
|
2008-04-16 18:15:30 +02:00
|
|
|
extern int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *map,
|
|
|
|
int max_keys_per_mod);
|
2012-03-21 20:55:09 +01:00
|
|
|
extern int AllocXTestDevice(ClientPtr client, const char *name,
|
|
|
|
DeviceIntPtr *ptr, DeviceIntPtr *keybd,
|
|
|
|
DeviceIntPtr master_ptr, DeviceIntPtr master_keybd);
|
2009-08-24 01:48:00 +02:00
|
|
|
extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
|
|
|
|
extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
|
2009-09-17 08:01:29 +02:00
|
|
|
extern void SendDevicePresenceEvent(int deviceid, int type);
|
2020-10-10 01:51:33 +02:00
|
|
|
extern void DeliverDeviceClassesChangedEvent(int sourceid, Time time);
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *
|
|
|
|
attrs);
|
|
|
|
extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs);
|
2008-04-16 18:15:30 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
enum TouchListenerState {
|
2020-10-10 01:51:35 +02:00
|
|
|
TOUCH_LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
|
|
|
|
TOUCH_LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */
|
|
|
|
TOUCH_LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already
|
|
|
|
accepted */
|
|
|
|
TOUCH_LISTENER_IS_OWNER, /**< Is the current owner, hasn't
|
|
|
|
accepted */
|
|
|
|
TOUCH_LISTENER_HAS_ACCEPTED, /**< Is the current owner, has accepted */
|
|
|
|
TOUCH_LISTENER_HAS_END, /**< Has already received the end event */
|
2011-12-14 03:46:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum TouchListenerType {
|
2020-10-10 01:51:35 +02:00
|
|
|
TOUCH_LISTENER_GRAB,
|
|
|
|
TOUCH_LISTENER_POINTER_GRAB,
|
|
|
|
TOUCH_LISTENER_REGULAR,
|
|
|
|
TOUCH_LISTENER_POINTER_REGULAR,
|
2011-12-14 03:46:40 +01:00
|
|
|
};
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern void TouchInitDDXTouchPoint(DeviceIntPtr dev,
|
|
|
|
DDXTouchPointInfoPtr ddxtouch);
|
|
|
|
extern DDXTouchPointInfoPtr TouchBeginDDXTouch(DeviceIntPtr dev,
|
|
|
|
uint32_t ddx_id);
|
2011-12-14 05:48:56 +01:00
|
|
|
extern void TouchEndDDXTouch(DeviceIntPtr dev, DDXTouchPointInfoPtr ti);
|
|
|
|
extern DDXTouchPointInfoPtr TouchFindByDDXID(DeviceIntPtr dev,
|
2012-03-21 20:55:09 +01:00
|
|
|
uint32_t ddx_id, Bool create);
|
|
|
|
extern Bool TouchInitTouchPoint(TouchClassPtr touch, ValuatorClassPtr v,
|
|
|
|
int index);
|
2011-12-14 03:46:40 +01:00
|
|
|
extern void TouchFreeTouchPoint(DeviceIntPtr dev, int index);
|
2011-12-14 05:57:46 +01:00
|
|
|
extern TouchPointInfoPtr TouchBeginTouch(DeviceIntPtr dev, int sourceid,
|
2012-03-21 20:55:09 +01:00
|
|
|
uint32_t touchid,
|
|
|
|
Bool emulate_pointer);
|
2011-12-14 05:57:46 +01:00
|
|
|
extern TouchPointInfoPtr TouchFindByClientID(DeviceIntPtr dev,
|
|
|
|
uint32_t client_id);
|
|
|
|
extern void TouchEndTouch(DeviceIntPtr dev, TouchPointInfoPtr ti);
|
2011-12-14 06:56:05 +01:00
|
|
|
extern Bool TouchEventHistoryAllocate(TouchPointInfoPtr ti);
|
|
|
|
extern void TouchEventHistoryFree(TouchPointInfoPtr ti);
|
|
|
|
extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
|
2012-03-21 20:55:09 +01:00
|
|
|
extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev,
|
|
|
|
XID resource);
|
2011-12-14 07:30:05 +01:00
|
|
|
extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
|
2012-10-30 03:44:08 +01:00
|
|
|
extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type,
|
2012-03-21 20:55:09 +01:00
|
|
|
enum InputLevel level, enum TouchListenerType type,
|
2012-11-27 20:21:17 +01:00
|
|
|
enum TouchListenerState state, WindowPtr window, GrabPtr grab);
|
2011-12-14 07:24:17 +01:00
|
|
|
extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
|
2012-03-21 20:55:09 +01:00
|
|
|
extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|
|
|
InternalEvent *ev);
|
2012-04-17 22:56:08 +02:00
|
|
|
extern Bool TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
|
|
|
|
InternalEvent *ev);
|
2011-12-14 07:03:01 +01:00
|
|
|
extern Bool TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite);
|
2011-12-14 08:04:38 +01:00
|
|
|
extern int TouchConvertToPointerEvent(const InternalEvent *ev,
|
2012-03-21 20:55:09 +01:00
|
|
|
InternalEvent *motion,
|
|
|
|
InternalEvent *button);
|
2011-12-14 07:26:04 +01:00
|
|
|
extern int TouchGetPointerEventType(const InternalEvent *ev);
|
2011-12-14 22:48:49 +01:00
|
|
|
extern void TouchRemovePointerGrab(DeviceIntPtr dev);
|
2011-12-14 22:52:28 +01:00
|
|
|
extern void TouchListenerGone(XID resource);
|
2012-04-11 17:12:08 +02:00
|
|
|
extern int TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|
|
|
int listener, int mode);
|
2012-02-04 01:19:08 +01:00
|
|
|
extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
|
2012-02-04 01:19:09 +01:00
|
|
|
uint32_t touchid, Window grab_window, XID *error);
|
2012-06-07 23:12:06 +02:00
|
|
|
extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev);
|
2013-03-01 03:52:35 +01:00
|
|
|
extern void TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource);
|
2013-02-28 02:02:40 +01:00
|
|
|
extern void TouchAcceptAndEnd(DeviceIntPtr dev, int touchid);
|
2011-12-14 07:03:01 +01:00
|
|
|
|
2009-03-11 07:20:22 +01:00
|
|
|
/* misc event helpers */
|
2012-03-21 20:55:09 +01:00
|
|
|
extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients);
|
2009-03-11 07:20:22 +01:00
|
|
|
extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
|
2012-03-21 20:55:09 +01:00
|
|
|
extern Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent *ev);
|
2011-10-28 04:55:55 +02:00
|
|
|
extern int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type);
|
2010-09-20 07:03:04 +02:00
|
|
|
void FixUpEventFromWindow(SpritePtr pSprite,
|
2009-03-11 07:20:22 +01:00
|
|
|
xEvent *xE,
|
2012-03-21 20:55:09 +01:00
|
|
|
WindowPtr pWin, Window child, Bool calcChild);
|
2014-04-01 08:55:25 +02:00
|
|
|
extern Bool PointInBorderSize(WindowPtr pWin, int x, int y);
|
2010-09-20 07:03:05 +02:00
|
|
|
extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y);
|
2011-12-09 09:02:49 +01:00
|
|
|
extern int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win);
|
2011-11-25 22:57:03 +01:00
|
|
|
extern Bool ActivatePassiveGrab(DeviceIntPtr dev, GrabPtr grab,
|
2011-12-14 08:02:30 +01:00
|
|
|
InternalEvent *ev, InternalEvent *real_event);
|
2020-10-10 01:51:37 +02:00
|
|
|
extern void ActivateGrabNoDelivery(DeviceIntPtr dev, GrabPtr grab,
|
|
|
|
InternalEvent *event,
|
|
|
|
InternalEvent *real_event);
|
2010-12-17 18:13:30 +01:00
|
|
|
/**
|
2011-02-15 12:28:00 +01:00
|
|
|
* Masks specifying the type of event to deliver for an InternalEvent; used
|
|
|
|
* by EventIsDeliverable.
|
2010-12-17 18:13:30 +01:00
|
|
|
* @defgroup EventIsDeliverable return flags
|
|
|
|
* @{
|
|
|
|
*/
|
2011-02-15 12:28:00 +01:00
|
|
|
#define EVENT_XI1_MASK (1 << 0) /**< XI1.x event */
|
|
|
|
#define EVENT_CORE_MASK (1 << 1) /**< Core event */
|
|
|
|
#define EVENT_DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set */
|
|
|
|
#define EVENT_XI2_MASK (1 << 3) /**< XI2 mask set on window */
|
2010-12-17 18:13:30 +01:00
|
|
|
/* @} */
|
2009-03-11 07:20:22 +01:00
|
|
|
|
2011-12-06 03:57:38 +01:00
|
|
|
enum EventDeliveryState {
|
|
|
|
EVENT_DELIVERED, /**< Event has been delivered to a client */
|
|
|
|
EVENT_NOT_DELIVERED, /**< Event was not delivered to any client */
|
|
|
|
EVENT_SKIP, /**< Event can be discarded by the caller */
|
|
|
|
EVENT_REJECTED, /**< Event was rejected for delivery to the client */
|
|
|
|
};
|
|
|
|
|
2006-07-19 16:05:12 +02:00
|
|
|
/* Implemented by the DDX. */
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT int NewInputDeviceRequest(InputOption *options,
|
|
|
|
InputAttributes * attrs,
|
|
|
|
DeviceIntPtr *dev);
|
|
|
|
extern _X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr dev);
|
ddx: add new call to purge input devices that weren't added
Special case for the systemd-logind case in xfree86: when we're vt-switched
away and a device is plugged in, we get a paused fd from logind. Since we
can't probe the device or do anything with it, we store that device in the
xfree86 and handle it later when we vt-switch back. The device is not added to
inputInfo.devices until that time.
When the device is removed while still vt-switched away, the the config system
never notifies the DDX. It only runs through inputInfo.devices and our device
was never added to that.
When a device is plugged in, removed, and plugged in again while vt-switched
away, we have two entries in the xfree86-specific list that refer to the same
device node, both pending for addition later. On VT switch back, the first one
(the already removed one) will be added successfully, the second one (the
still plugged-in one) fails. Since the fd is correct, the device works until
it is removed again. The removed devices' config_info (i.e. the syspath)
doesn't match the actual device we addded tough (the input number increases
with each plug), it doesn't get removed, the fd remains open and we lose track
of the fd count. Plugging the device in again leads to a dead device.
Fix this by adding a call to notify the DDX to purge any remainders of devices
with the given config_info, that's the only identifiable bit we have at this
point.
https://bugs.freedesktop.org/show_bug.cgi?id=97928
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-20 22:27:57 +02:00
|
|
|
extern _X_EXPORT void RemoveInputDeviceTraces(const char *config_info);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
extern _X_EXPORT void DDXRingBell(int volume, int pitch, int duration);
|
2006-07-19 16:05:12 +02:00
|
|
|
|
2010-10-22 05:57:27 +02:00
|
|
|
#define VALUATOR_MODE_ALL_AXES -1
|
|
|
|
extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis);
|
|
|
|
extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
|
|
|
|
|
2009-04-23 17:15:01 +02:00
|
|
|
/* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
|
|
|
|
xfixes/cursor.c uses it to determine if the cursor is enabled */
|
|
|
|
extern Bool EnableCursor;
|
|
|
|
|
2012-12-18 05:12:40 +01:00
|
|
|
/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
|
|
|
|
* CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
|
|
|
|
*/
|
|
|
|
extern Bool CursorVisible;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
|
2011-01-06 03:58:00 +01:00
|
|
|
extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
|
2010-10-19 05:37:46 +02:00
|
|
|
extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
|
2012-03-21 20:55:09 +01:00
|
|
|
int first_valuator,
|
|
|
|
int num_valuators,
|
|
|
|
const int *valuators);
|
|
|
|
extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask, int valuator,
|
2010-10-19 05:37:46 +02:00
|
|
|
int data);
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT void valuator_mask_set_double(ValuatorMask *mask, int valuator,
|
2011-02-23 18:28:18 +01:00
|
|
|
double data);
|
2010-10-19 05:37:46 +02:00
|
|
|
extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
|
2010-12-17 18:13:27 +01:00
|
|
|
extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask);
|
|
|
|
extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit);
|
|
|
|
extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit);
|
|
|
|
extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask);
|
|
|
|
extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
|
|
|
|
const ValuatorMask *src);
|
|
|
|
extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
|
2011-02-23 18:28:18 +01:00
|
|
|
extern _X_EXPORT double valuator_mask_get_double(const ValuatorMask *mask,
|
|
|
|
int valnum);
|
2011-09-30 02:59:47 +02:00
|
|
|
extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask,
|
|
|
|
int valnum, int *val);
|
|
|
|
extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask,
|
|
|
|
int valnum, double *val);
|
2015-05-05 06:18:54 +02:00
|
|
|
extern _X_EXPORT Bool valuator_mask_has_unaccelerated(const ValuatorMask *mask);
|
|
|
|
extern _X_EXPORT void valuator_mask_set_unaccelerated(ValuatorMask *mask,
|
|
|
|
int valuator,
|
|
|
|
double accel,
|
|
|
|
double unaccel);
|
2016-09-13 09:16:57 +02:00
|
|
|
extern _X_EXPORT void valuator_mask_set_absolute_unaccelerated(ValuatorMask *mask,
|
|
|
|
int valuator,
|
|
|
|
int absolute,
|
|
|
|
double unaccel);
|
2015-05-05 06:18:54 +02:00
|
|
|
extern _X_EXPORT double valuator_mask_get_accelerated(const ValuatorMask *mask,
|
|
|
|
int valuator);
|
|
|
|
extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask,
|
|
|
|
int valuator);
|
|
|
|
extern _X_EXPORT Bool valuator_mask_fetch_unaccelerated(const ValuatorMask *mask,
|
|
|
|
int valuator,
|
|
|
|
double *accel,
|
|
|
|
double *unaccel);
|
|
|
|
extern _X_HIDDEN void valuator_mask_drop_unaccelerated(ValuatorMask *mask);
|
|
|
|
|
2011-08-04 06:45:46 +02:00
|
|
|
/* InputOption handling interface */
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT InputOption *input_option_new(InputOption *list,
|
|
|
|
const char *key,
|
|
|
|
const char *value);
|
2011-08-04 06:45:46 +02:00
|
|
|
extern _X_EXPORT void input_option_free_list(InputOption **opt);
|
2012-03-21 20:55:09 +01:00
|
|
|
extern _X_EXPORT InputOption *input_option_free_element(InputOption *opt,
|
|
|
|
const char *key);
|
|
|
|
extern _X_EXPORT InputOption *input_option_find(InputOption *list,
|
|
|
|
const char *key);
|
|
|
|
extern _X_EXPORT const char *input_option_get_key(const InputOption *opt);
|
|
|
|
extern _X_EXPORT const char *input_option_get_value(const InputOption *opt);
|
|
|
|
extern _X_EXPORT void input_option_set_key(InputOption *opt, const char *key);
|
|
|
|
extern _X_EXPORT void input_option_set_value(InputOption *opt,
|
|
|
|
const char *value);
|
2011-08-04 06:45:46 +02:00
|
|
|
|
2011-08-30 22:58:04 +02:00
|
|
|
extern _X_HIDDEN Bool point_on_screen(ScreenPtr pScreen, int x, int y);
|
2011-09-07 06:04:10 +02:00
|
|
|
extern _X_HIDDEN void update_desktop_dimensions(void);
|
2011-08-30 22:58:04 +02:00
|
|
|
|
2012-11-25 01:39:47 +01:00
|
|
|
extern _X_HIDDEN void input_constrain_cursor(DeviceIntPtr pDev, ScreenPtr screen,
|
|
|
|
int current_x, int current_y,
|
|
|
|
int dest_x, int dest_y,
|
2012-12-03 01:41:16 +01:00
|
|
|
int *out_x, int *out_y,
|
|
|
|
int *nevents, InternalEvent* events);
|
2012-11-25 01:39:47 +01:00
|
|
|
|
2015-12-08 20:37:51 +01:00
|
|
|
extern _X_EXPORT void input_lock(void);
|
|
|
|
extern _X_EXPORT void input_unlock(void);
|
|
|
|
extern _X_EXPORT void input_force_unlock(void);
|
2017-02-23 01:21:49 +01:00
|
|
|
extern _X_EXPORT int in_input_thread(void);
|
2015-12-08 23:39:46 +01:00
|
|
|
|
2015-12-08 20:37:51 +01:00
|
|
|
extern void InputThreadPreInit(void);
|
|
|
|
extern void InputThreadInit(void);
|
|
|
|
extern void InputThreadFini(void);
|
2015-12-08 23:39:46 +01:00
|
|
|
|
2015-12-08 20:37:51 +01:00
|
|
|
extern int InputThreadRegisterDev(int fd,
|
|
|
|
NotifyFdProcPtr readInputProc,
|
|
|
|
void *readInputArgs);
|
|
|
|
|
|
|
|
extern int InputThreadUnregisterDev(int fd);
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool InputThreadEnable;
|
2015-12-08 23:39:46 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* INPUT_H */
|