2006-11-26 11:13:41 -07: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-12-13 14:06:02 -07:00
|
|
|
#include <X11/extensions/XIproto.h>
|
2010-07-27 13:02:24 -06:00
|
|
|
#include "inputstr.h"
|
|
|
|
|
|
|
|
/***************************************************************
|
|
|
|
* Interface available to drivers *
|
|
|
|
***************************************************************/
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
/**
|
|
|
|
* Scroll flags for ::SetScrollValuator.
|
|
|
|
*/
|
|
|
|
enum ScrollFlags {
|
|
|
|
SCROLL_FLAG_NONE = 0,
|
|
|
|
/**
|
|
|
|
* Do not emulate legacy button events for valuator events on this axis.
|
|
|
|
*/
|
|
|
|
SCROLL_FLAG_DONT_EMULATE = (1 << 1),
|
|
|
|
/**
|
|
|
|
* This axis is the preferred axis for valuator emulation for this axis'
|
|
|
|
* scroll type.
|
|
|
|
*/
|
|
|
|
SCROLL_FLAG_PREFERRED = (1 << 2)
|
|
|
|
};
|
|
|
|
|
|
|
|
extern _X_EXPORT int InitProximityClassDeviceStruct(DeviceIntPtr /* dev */ );
|
|
|
|
|
|
|
|
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 */ );
|
|
|
|
|
|
|
|
extern _X_EXPORT Bool SetScrollValuator(DeviceIntPtr /* dev */ ,
|
|
|
|
int /* axnum */ ,
|
|
|
|
enum ScrollType /* type */ ,
|
|
|
|
double /* increment */ ,
|
|
|
|
int /* flags */ );
|
2010-07-27 13:02:24 -06:00
|
|
|
|
|
|
|
/* Input device properties */
|
2012-06-10 07:21:05 -06:00
|
|
|
extern _X_EXPORT void XIDeleteAllDeviceProperties(DeviceIntPtr /* device */
|
|
|
|
);
|
|
|
|
|
|
|
|
extern _X_EXPORT int XIDeleteDeviceProperty(DeviceIntPtr /* device */ ,
|
|
|
|
Atom /* property */ ,
|
|
|
|
Bool /* fromClient */
|
|
|
|
);
|
|
|
|
|
|
|
|
extern _X_EXPORT int XIChangeDeviceProperty(DeviceIntPtr /* dev */ ,
|
|
|
|
Atom /* property */ ,
|
|
|
|
Atom /* type */ ,
|
|
|
|
int /* format */ ,
|
|
|
|
int /* mode */ ,
|
|
|
|
unsigned long /* len */ ,
|
|
|
|
const void * /* value */ ,
|
|
|
|
Bool /* sendevent */
|
|
|
|
);
|
|
|
|
|
|
|
|
extern _X_EXPORT int XIGetDeviceProperty(DeviceIntPtr /* dev */ ,
|
|
|
|
Atom /* property */ ,
|
|
|
|
XIPropertyValuePtr * /* value */
|
|
|
|
);
|
|
|
|
|
|
|
|
extern _X_EXPORT int XISetDevicePropertyDeletable(DeviceIntPtr /* dev */ ,
|
|
|
|
Atom /* property */ ,
|
|
|
|
Bool /* deletable */
|
|
|
|
);
|
|
|
|
|
|
|
|
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)
|
|
|
|
);
|
|
|
|
|
|
|
|
extern _X_EXPORT void XIUnregisterPropertyHandler(DeviceIntPtr dev, long id);
|
|
|
|
|
|
|
|
extern _X_EXPORT Atom XIGetKnownProperty(const char *name);
|
2010-07-27 13:02:24 -06:00
|
|
|
|
|
|
|
extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
extern _X_EXPORT int XIPropToInt(XIPropertyValuePtr val,
|
|
|
|
int *nelem_return, int **buf_return);
|
2010-07-27 13:02:24 -06:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
extern _X_EXPORT int XIPropToFloat(XIPropertyValuePtr val,
|
|
|
|
int *nelem_return, float **buf_return);
|
2010-07-27 13:02:24 -06:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* End of driver interface *
|
|
|
|
****************************************************************************/
|
|
|
|
|
2009-09-06 13:44:18 -06:00
|
|
|
/**
|
|
|
|
* Attached to the devPrivates of each client. Specifies the version number as
|
|
|
|
* supported by the client.
|
|
|
|
*/
|
|
|
|
typedef struct _XIClientRec {
|
2012-06-10 07:21:05 -06:00
|
|
|
int major_version;
|
|
|
|
int minor_version;
|
2009-09-06 13:44:18 -06:00
|
|
|
} XIClientRec, *XIClientPtr;
|
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
typedef struct _GrabParameters {
|
2012-06-10 07:21:05 -06: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;
|
2010-07-27 13:02:24 -06:00
|
|
|
} GrabParameters;
|
|
|
|
|
2009-09-06 13:44:18 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
UpdateDeviceState(DeviceIntPtr /* device */ ,
|
|
|
|
DeviceEvent * /* xE */ );
|
2009-09-06 13:44:18 -06:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern void
|
2012-06-10 07:21:05 -06:00
|
|
|
ProcessOtherEvent(InternalEvent * /* ev */ ,
|
|
|
|
DeviceIntPtr /* other */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
extern int
|
|
|
|
CheckGrabValues(ClientPtr /* client */ ,
|
|
|
|
GrabParameters * /* param */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
GrabButton(ClientPtr /* client */ ,
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
DeviceIntPtr /* modifier_device */ ,
|
|
|
|
int /* button */ ,
|
|
|
|
GrabParameters * /* param */ ,
|
|
|
|
enum InputLevel /* grabtype */ ,
|
|
|
|
GrabMask * /* eventMask */ );
|
2010-07-27 13:02:24 -06:00
|
|
|
|
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
GrabKey(ClientPtr /* client */ ,
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
DeviceIntPtr /* modifier_device */ ,
|
|
|
|
int /* key */ ,
|
|
|
|
GrabParameters * /* param */ ,
|
|
|
|
enum InputLevel /* grabtype */ ,
|
|
|
|
GrabMask * /* eventMask */ );
|
2010-07-27 13:02:24 -06:00
|
|
|
|
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
GrabWindow(ClientPtr /* client */ ,
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
int /* type */ ,
|
|
|
|
GrabParameters * /* param */ ,
|
|
|
|
GrabMask * /* eventMask */ );
|
2010-07-27 13:02:24 -06:00
|
|
|
|
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
GrabTouch(ClientPtr /* client */ ,
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
DeviceIntPtr /* mod_dev */ ,
|
|
|
|
GrabParameters * /* param */ ,
|
|
|
|
GrabMask * /* eventMask */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
SelectForWindow(DeviceIntPtr /* dev */ ,
|
|
|
|
WindowPtr /* pWin */ ,
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
Mask /* mask */ ,
|
|
|
|
Mask /* exclusivemasks */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
AddExtensionClient(WindowPtr /* pWin */ ,
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
Mask /* mask */ ,
|
|
|
|
int /* mskidx */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern void
|
2012-06-10 07:21:05 -06:00
|
|
|
RecalculateDeviceDeliverableEvents(WindowPtr /* pWin */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
InputClientGone(WindowPtr /* pWin */ ,
|
|
|
|
XID /* id */ );
|
|
|
|
|
|
|
|
extern void
|
|
|
|
WindowGone(WindowPtr /* win */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
SendEvent(ClientPtr /* client */ ,
|
|
|
|
DeviceIntPtr /* d */ ,
|
|
|
|
Window /* dest */ ,
|
|
|
|
Bool /* propagate */ ,
|
|
|
|
xEvent * /* ev */ ,
|
|
|
|
Mask /* mask */ ,
|
|
|
|
int /* count */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
SetButtonMapping(ClientPtr /* client */ ,
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
int /* nElts */ ,
|
|
|
|
BYTE * /* map */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
ChangeKeyMapping(ClientPtr /* client */ ,
|
|
|
|
DeviceIntPtr /* dev */ ,
|
|
|
|
unsigned /* len */ ,
|
|
|
|
int /* type */ ,
|
|
|
|
KeyCode /* firstKeyCode */ ,
|
|
|
|
CARD8 /* keyCodes */ ,
|
|
|
|
CARD8 /* keySymsPerKeyCode */ ,
|
|
|
|
KeySym * /* map */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern void
|
2012-06-10 07:21:05 -06:00
|
|
|
DeleteWindowFromAnyExtEvents(WindowPtr /* pWin */ ,
|
|
|
|
Bool /* freeResources */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * /* pEvents */ ,
|
|
|
|
Mask /* mask */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern void
|
2012-06-10 07:21:05 -06:00
|
|
|
CheckDeviceGrabAndHintWindow(WindowPtr /* pWin */ ,
|
|
|
|
int /* type */ ,
|
|
|
|
deviceKeyButtonPointer * /* xE */ ,
|
|
|
|
GrabPtr /* grab */ ,
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
Mask /* deliveryMask */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern void
|
2012-06-10 07:21:05 -06:00
|
|
|
MaybeStopDeviceHint(DeviceIntPtr /* dev */ ,
|
|
|
|
ClientPtr /* client */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
DeviceEventSuppressForWindow(WindowPtr /* pWin */ ,
|
|
|
|
ClientPtr /* client */ ,
|
|
|
|
Mask /* mask */ ,
|
|
|
|
int /* maskndx */ );
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern void
|
2012-06-10 07:21:05 -06:00
|
|
|
SendEventToAllWindows(DeviceIntPtr /* dev */ ,
|
|
|
|
Mask /* mask */ ,
|
|
|
|
xEvent * /* ev */ ,
|
|
|
|
int /* count */ );
|
2007-11-24 10:55:21 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
extern void
|
|
|
|
TouchRejected(DeviceIntPtr /* sourcedev */ ,
|
|
|
|
TouchPointInfoPtr /* ti */ ,
|
|
|
|
XID /* resource */ ,
|
|
|
|
TouchOwnershipEvent * /* ev */ );
|
|
|
|
|
|
|
|
extern _X_HIDDEN void XI2EventSwap(xGenericEvent * /* from */ ,
|
|
|
|
xGenericEvent * /* to */ );
|
2009-09-06 13:44:18 -06:00
|
|
|
|
2010-07-27 13:02:24 -06: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? */
|
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
|
2009-09-06 13:44:18 -06:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern void
|
2012-06-10 07:21:05 -06:00
|
|
|
XISendDeviceChangedEvent(DeviceIntPtr device, DeviceChangedEvent *dce);
|
2009-09-06 13:44:18 -06:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
|
2012-06-10 07:21:05 -06:00
|
|
|
unsigned int len, unsigned char *mask);
|
2009-09-06 13:44:18 -06:00
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
extern int
|
2012-06-10 07:21:05 -06:00
|
|
|
XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
|
2009-09-06 13:44:18 -06:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
#endif /* EXEVENTS_H */
|