2003-11-14 16:48:57 +00:00
|
|
|
/************************************************************
|
|
|
|
|
|
|
|
|
|
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
|
|
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
|
|
|
|
provided that the above copyright notice appear in all copies and that
|
|
|
|
|
both that copyright notice and this permission notice appear in
|
|
|
|
|
supporting documentation, and that the name of the above listed
|
|
|
|
|
copyright holder(s) not be used in advertising or publicity pertaining
|
|
|
|
|
to distribution of the software without specific, written prior
|
|
|
|
|
permission.
|
|
|
|
|
|
|
|
|
|
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
|
|
|
|
|
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
|
|
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
|
|
|
|
|
|
|
|
|
|
********************************************************/
|
|
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
|
* Interface of 'exevents.c'
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef EXEVENTS_H
|
|
|
|
|
#define EXEVENTS_H
|
|
|
|
|
|
2007-10-27 21:34:22 +03:00
|
|
|
#include <X11/extensions/XIproto.h>
|
2008-04-16 19:15:30 +03:00
|
|
|
#include "inputstr.h"
|
2007-10-27 21:34:22 +03:00
|
|
|
|
2009-08-14 13:49:58 +10:00
|
|
|
/***************************************************************
|
|
|
|
|
* Interface available to drivers *
|
|
|
|
|
***************************************************************/
|
2003-11-14 16:48:57 +00:00
|
|
|
|
2011-02-15 18:49:58 +00:00
|
|
|
/**
|
|
|
|
|
* Scroll flags for ::SetScrollValuator.
|
|
|
|
|
*/
|
|
|
|
|
enum ScrollFlags {
|
2012-03-21 12:55:09 -07:00
|
|
|
SCROLL_FLAG_NONE = 0,
|
2011-02-15 18:49:58 +00:00
|
|
|
/**
|
|
|
|
|
* Do not emulate legacy button events for valuator events on this axis.
|
|
|
|
|
*/
|
2012-03-21 12:55:09 -07:00
|
|
|
SCROLL_FLAG_DONT_EMULATE = (1 << 1),
|
2011-02-15 18:49:58 +00:00
|
|
|
/**
|
|
|
|
|
* This axis is the preferred axis for valuator emulation for this axis'
|
|
|
|
|
* scroll type.
|
|
|
|
|
*/
|
2012-03-21 12:55:09 -07:00
|
|
|
SCROLL_FLAG_PREFERRED = (1 << 2)
|
2011-02-15 18:49:58 +00:00
|
|
|
};
|
|
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT int InitProximityClassDeviceStruct(DeviceIntPtr /* dev */ );
|
2003-11-14 16:48:57 +00:00
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT Bool InitValuatorAxisStruct(DeviceIntPtr /* dev */ ,
|
|
|
|
|
int /* axnum */ ,
|
|
|
|
|
Atom /* label */ ,
|
|
|
|
|
int /* minval */ ,
|
|
|
|
|
int /* maxval */ ,
|
|
|
|
|
int /* resolution */ ,
|
|
|
|
|
int /* min_res */ ,
|
|
|
|
|
int /* max_res */ ,
|
|
|
|
|
int /* mode */ );
|
2003-11-14 16:48:57 +00:00
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT Bool SetScrollValuator(DeviceIntPtr /* dev */ ,
|
|
|
|
|
int /* axnum */ ,
|
|
|
|
|
enum ScrollType /* type */ ,
|
|
|
|
|
double /* increment */ ,
|
|
|
|
|
int /* flags */ );
|
2011-02-15 18:49:58 +00:00
|
|
|
|
2008-07-07 22:10:17 +09:30
|
|
|
/* Input device properties */
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT void XIDeleteAllDeviceProperties(DeviceIntPtr /* device */
|
|
|
|
|
);
|
2008-07-07 22:10:17 +09:30
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT int XIDeleteDeviceProperty(DeviceIntPtr /* device */ ,
|
|
|
|
|
Atom /* property */ ,
|
|
|
|
|
Bool /* fromClient */
|
|
|
|
|
);
|
2008-07-07 22:10:17 +09:30
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT int XIChangeDeviceProperty(DeviceIntPtr /* dev */ ,
|
|
|
|
|
Atom /* property */ ,
|
|
|
|
|
Atom /* type */ ,
|
|
|
|
|
int /* format */ ,
|
|
|
|
|
int /* mode */ ,
|
|
|
|
|
unsigned long /* len */ ,
|
|
|
|
|
const void * /* value */ ,
|
|
|
|
|
Bool /* sendevent */
|
|
|
|
|
);
|
2008-07-07 22:10:17 +09:30
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT int XIGetDeviceProperty(DeviceIntPtr /* dev */ ,
|
|
|
|
|
Atom /* property */ ,
|
|
|
|
|
XIPropertyValuePtr * /* value */
|
|
|
|
|
);
|
2008-07-07 22:10:17 +09:30
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT int XISetDevicePropertyDeletable(DeviceIntPtr /* dev */ ,
|
|
|
|
|
Atom /* property */ ,
|
|
|
|
|
Bool /* deletable */
|
|
|
|
|
);
|
2008-09-18 18:21:03 +09:30
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT long XIRegisterPropertyHandler(DeviceIntPtr dev,
|
|
|
|
|
int (*SetProperty) (DeviceIntPtr
|
|
|
|
|
dev,
|
|
|
|
|
Atom
|
|
|
|
|
property,
|
|
|
|
|
XIPropertyValuePtr
|
|
|
|
|
prop,
|
|
|
|
|
BOOL
|
|
|
|
|
checkonly),
|
|
|
|
|
int (*GetProperty) (DeviceIntPtr
|
|
|
|
|
dev,
|
|
|
|
|
Atom
|
|
|
|
|
property),
|
|
|
|
|
int (*DeleteProperty)
|
|
|
|
|
(DeviceIntPtr dev,
|
|
|
|
|
Atom property)
|
|
|
|
|
);
|
2008-07-10 11:03:31 +09:30
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT void XIUnregisterPropertyHandler(DeviceIntPtr dev, long id);
|
2008-07-10 11:03:31 +09:30
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT Atom XIGetKnownProperty(const char *name);
|
2008-07-13 18:40:53 +09:30
|
|
|
|
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
|
|
|
extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
|
2008-11-03 11:30:48 +10:30
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT int XIPropToInt(XIPropertyValuePtr val,
|
|
|
|
|
int *nelem_return, int **buf_return);
|
2008-11-19 15:50:57 +10:00
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_EXPORT int XIPropToFloat(XIPropertyValuePtr val,
|
|
|
|
|
int *nelem_return, float **buf_return);
|
2008-12-05 16:24:57 +10:00
|
|
|
|
2009-08-14 13:49:58 +10:00
|
|
|
/****************************************************************************
|
|
|
|
|
* End of driver interface *
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Attached to the devPrivates of each client. Specifies the version number as
|
|
|
|
|
* supported by the client.
|
|
|
|
|
*/
|
|
|
|
|
typedef struct _XIClientRec {
|
2012-03-21 12:55:09 -07:00
|
|
|
int major_version;
|
|
|
|
|
int minor_version;
|
2009-08-14 13:49:58 +10:00
|
|
|
} XIClientRec, *XIClientPtr;
|
|
|
|
|
|
|
|
|
|
typedef struct _GrabParameters {
|
2012-03-21 12:55:09 -07:00
|
|
|
int grabtype; /* CORE, etc. */
|
|
|
|
|
unsigned int ownerEvents;
|
|
|
|
|
unsigned int this_device_mode;
|
|
|
|
|
unsigned int other_devices_mode;
|
|
|
|
|
Window grabWindow;
|
|
|
|
|
Window confineTo;
|
|
|
|
|
Cursor cursor;
|
|
|
|
|
unsigned int modifiers;
|
2009-08-14 13:49:58 +10:00
|
|
|
} GrabParameters;
|
|
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
UpdateDeviceState(DeviceIntPtr /* device */ ,
|
|
|
|
|
DeviceEvent * /* xE */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
ProcessOtherEvent(InternalEvent * /* ev */ ,
|
|
|
|
|
DeviceIntPtr /* other */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
CheckGrabValues(ClientPtr /* client */ ,
|
|
|
|
|
GrabParameters * /* param */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
GrabButton(ClientPtr /* client */ ,
|
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
|
DeviceIntPtr /* modifier_device */ ,
|
|
|
|
|
int /* button */ ,
|
|
|
|
|
GrabParameters * /* param */ ,
|
|
|
|
|
enum InputLevel /* grabtype */ ,
|
|
|
|
|
GrabMask * /* eventMask */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
GrabKey(ClientPtr /* client */ ,
|
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
|
DeviceIntPtr /* modifier_device */ ,
|
|
|
|
|
int /* key */ ,
|
|
|
|
|
GrabParameters * /* param */ ,
|
|
|
|
|
enum InputLevel /* grabtype */ ,
|
|
|
|
|
GrabMask * /* eventMask */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
GrabWindow(ClientPtr /* client */ ,
|
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
|
int /* type */ ,
|
|
|
|
|
GrabParameters * /* param */ ,
|
|
|
|
|
GrabMask * /* eventMask */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
2011-12-15 07:42:12 +10:00
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
GrabTouch(ClientPtr /* client */ ,
|
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
|
DeviceIntPtr /* mod_dev */ ,
|
|
|
|
|
GrabParameters * /* param */ ,
|
|
|
|
|
GrabMask * /* eventMask */ );
|
2011-12-15 07:42:12 +10:00
|
|
|
|
2009-08-14 13:49:58 +10:00
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
SelectForWindow(DeviceIntPtr /* dev */ ,
|
|
|
|
|
WindowPtr /* pWin */ ,
|
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
|
Mask /* mask */ ,
|
|
|
|
|
Mask /* exclusivemasks */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
AddExtensionClient(WindowPtr /* pWin */ ,
|
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
|
Mask /* mask */ ,
|
|
|
|
|
int /* mskidx */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
RecalculateDeviceDeliverableEvents(WindowPtr /* pWin */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
InputClientGone(WindowPtr /* pWin */ ,
|
|
|
|
|
XID /* id */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
2011-12-14 16:53:04 +10:00
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
WindowGone(WindowPtr /* win */ );
|
2011-12-14 16:53:04 +10:00
|
|
|
|
2009-08-14 13:49:58 +10:00
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
SendEvent(ClientPtr /* client */ ,
|
|
|
|
|
DeviceIntPtr /* d */ ,
|
|
|
|
|
Window /* dest */ ,
|
|
|
|
|
Bool /* propagate */ ,
|
|
|
|
|
xEvent * /* ev */ ,
|
|
|
|
|
Mask /* mask */ ,
|
|
|
|
|
int /* count */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
SetButtonMapping(ClientPtr /* client */ ,
|
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
|
int /* nElts */ ,
|
|
|
|
|
BYTE * /* map */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
ChangeKeyMapping(ClientPtr /* client */ ,
|
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
|
unsigned /* len */ ,
|
|
|
|
|
int /* type */ ,
|
|
|
|
|
KeyCode /* firstKeyCode */ ,
|
|
|
|
|
CARD8 /* keyCodes */ ,
|
|
|
|
|
CARD8 /* keySymsPerKeyCode */ ,
|
|
|
|
|
KeySym * /* map */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
DeleteWindowFromAnyExtEvents(WindowPtr /* pWin */ ,
|
|
|
|
|
Bool /* freeResources */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * /* pEvents */ ,
|
|
|
|
|
Mask /* mask */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
CheckDeviceGrabAndHintWindow(WindowPtr /* pWin */ ,
|
|
|
|
|
int /* type */ ,
|
|
|
|
|
deviceKeyButtonPointer * /* xE */ ,
|
|
|
|
|
GrabPtr /* grab */ ,
|
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
|
Mask /* deliveryMask */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
MaybeStopDeviceHint(DeviceIntPtr /* dev */ ,
|
|
|
|
|
ClientPtr /* client */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
DeviceEventSuppressForWindow(WindowPtr /* pWin */ ,
|
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
|
Mask /* mask */ ,
|
|
|
|
|
int /* maskndx */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
|
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
SendEventToAllWindows(DeviceIntPtr /* dev */ ,
|
|
|
|
|
Mask /* mask */ ,
|
|
|
|
|
xEvent * /* ev */ ,
|
|
|
|
|
int /* count */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
2012-02-03 16:19:07 -08:00
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
TouchRejected(DeviceIntPtr /* sourcedev */ ,
|
|
|
|
|
TouchPointInfoPtr /* ti */ ,
|
|
|
|
|
XID /* resource */ ,
|
|
|
|
|
TouchOwnershipEvent * /* ev */ );
|
2012-02-03 16:19:07 -08:00
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
extern _X_HIDDEN void XI2EventSwap(xGenericEvent * /* from */ ,
|
|
|
|
|
xGenericEvent * /* to */ );
|
2009-08-14 13:49:58 +10:00
|
|
|
|
2008-10-28 16:27:37 +11:00
|
|
|
/* For an event such as MappingNotify which affects client interpretation
|
|
|
|
|
* of input events sent by device dev, should we notify the client, or
|
|
|
|
|
* would it merely be irrelevant and confusing? */
|
2009-08-14 13:49:58 +10:00
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
|
2008-10-28 16:27:37 +11:00
|
|
|
|
2009-02-20 16:07:33 +10:00
|
|
|
extern void
|
2012-03-21 12:55:09 -07:00
|
|
|
XISendDeviceChangedEvent(DeviceIntPtr device, DeviceChangedEvent *dce);
|
2009-02-20 16:07:33 +10:00
|
|
|
|
2009-09-02 11:16:15 +10:00
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2009-08-14 13:49:58 +10:00
|
|
|
XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
|
2012-03-21 12:55:09 -07:00
|
|
|
unsigned int len, unsigned char *mask);
|
2009-02-23 15:58:07 +10:00
|
|
|
|
2009-09-01 16:33:56 +10:00
|
|
|
extern int
|
2012-03-21 12:55:09 -07:00
|
|
|
XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
|
2009-09-01 16:33:56 +10:00
|
|
|
|
2012-03-21 12:55:09 -07:00
|
|
|
#endif /* EXEVENTS_H */
|