input.h revision a5e7ae69e440f6816420fc99599f044e79e716b6
/************************************************************
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
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 Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
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.
********************************************************/
#ifndef INPUT_H
#define INPUT_H
#include "misc.h"
#include "screenint.h"
#include <stdint.h>
#include "window.h" /* for WindowPtr */
#include "xkbrules.h"
#include "events.h"
#include "list.h"
#define DEVICE_INIT 0
#define DEVICE_ON 1
#define DEVICE_OFF 2
#define DEVICE_CLOSE 3
#define DEVICE_ABORT 4
/* GetTouchEvent flags */
#define TOUCH_ACCEPT (1 << 0)
/*int constants for pointer acceleration schemes*/
#define PtrAccelNoOp 0
#define PtrAccelPredictable 1
#define PtrAccelLightweight 2
#define PtrAccelDefault PtrAccelPredictable
#define MAX_VALUATORS 36
/* Maximum number of valuators, divided by six, rounded up, to get number
* of events. */
#define MAX_VALUATOR_EVENTS 6
#define NO_AXIS_LIMITS -1
#define MAP_LENGTH MAX_BUTTONS
#ifndef FollowKeyboard
#define FollowKeyboard 3
#endif
#ifndef FollowKeyboardWin
#endif
#ifndef RevertToFollowKeyboard
#define RevertToFollowKeyboard 3
#endif
enum InputLevel {
CORE = 1,
XI = 2,
XI2 = 3,
};
typedef unsigned long Leds;
typedef struct _OtherClients *OtherClientsPtr;
typedef struct _InputClients *InputClientsPtr;
typedef struct _DeviceIntRec *DeviceIntPtr;
typedef struct _ValuatorClassRec *ValuatorClassPtr;
typedef struct _ClassesRec *ClassesPtr;
typedef struct _SpriteRec *SpritePtr;
typedef struct _TouchClassRec *TouchClassPtr;
typedef struct _TouchPointInfo *TouchPointInfoPtr;
typedef struct _DDXTouchPointInfo *DDXTouchPointInfoPtr;
typedef struct _ValuatorMask ValuatorMask;
/* The DIX stores incoming input events in this list */
extern InternalEvent *InputEventList;
int /*what */ );
DeviceIntPtr /*device */ );
void * /*data */
);
DeviceHandleProc /*proc */ ,
void * /*data */
);
/* pointer acceleration handling */
ValuatorMask * /*valuators */ ,
CARD32 /*evtime */ );
struct _ValuatorAccelerationRec;
struct _ValuatorAccelerationRec *
/*protoScheme */ );
typedef struct _DeviceRec {
void *devicePrivate;
typedef struct {
unsigned char autoRepeats[32];
unsigned char id;
} KeybdCtrl;
typedef struct {
int mapWidth;
} KeySymsRec, *KeySymsPtr;
typedef struct {
unsigned char id;
} PtrCtrl;
typedef struct {
int integer_displayed;
unsigned char id;
} IntegerCtrl;
typedef struct {
unsigned char id;
} StringCtrl;
typedef struct {
unsigned char id;
} BellCtrl;
typedef struct {
unsigned char id;
} LedCtrl;
typedef struct _InputOption InputOption;
typedef struct _InputAttributes {
char *product;
char *vendor;
char *device;
char *pnp_id;
char *usb_id;
char **tags; /* null-terminated */
#define ATTR_KEYBOARD (1<<0)
#define KEY_PROCESSED 1
#define BUTTON_PROCESSED 1
#define KEY_POSTED 2
#define BUTTON_POSTED 2
extern void InitCoreDevices(void);
extern void InitXTestDevices(void);
DeviceProc /*deviceProc */ ,
Bool /*autoStart */ );
BOOL /* sendevent */ );
BOOL /* sendevent */ );
BOOL /* sendevent */ );
extern void DisableAllDevices(void);
extern int InitAndStartDevices(void);
extern void CloseDownDevices(void);
extern void AbortDevices(void);
extern void UndisplayDevices(void);
BOOL /* sendevent */ );
extern _X_EXPORT int NumMotionEvents(void);
int /* id */ ,
ClientPtr /* client */ ,
Mask /* access_mode */ );
KeyCode * /*maxCode */ );
int /*numButtons */ ,
Atom * /* labels */ ,
CARD8 * /*map */ );
int numAxes);
int /*numAxes */ ,
Atom * /* labels */ ,
int /*numMotionEvents */ ,
int /*mode */ );
int /*scheme */ );
unsigned int /*max_touches */ ,
unsigned int /*mode */ ,
unsigned int /*numAxes */ );
typedef void (*BellProcPtr) (int percent,
void *ctrl,
int feedbackClass);
KeybdCtrl * /*ctrl */ );
PtrCtrl * /*ctrl */ );
,
/*controlProc */ );
StringCtrl * /*ctrl */ );
/*device */ ,
/*controlProc */ ,
int /*max_symbols */ ,
int
/*num_symbols_supported */
,
KeySym * /*symbols */
);
BellCtrl * /*ctrl */ );
,
/*bellProc */ ,
/*controlProc */ );
LedCtrl * /*ctrl */ );
,
/*controlProc */ );
IntegerCtrl * /*ctrl */ );
/*device */ ,
/*controlProc */ );
CARD8 * /*map */ ,
int /*numButtons */ ,
Atom * /* btn_labels */ ,
PtrCtrlProcPtr /*controlProc */ ,
int /*numMotionEvents */ ,
int /*numAxes */ ,
Atom * /* axes_labels */ );
XkbRMLVOSet * /*rmlvo */ ,
BellProcPtr /*bellProc */ ,
KbdCtrlProcPtr /*controlProc */
);
const char *keymap,
int keymap_length,
CARD8 * /* map */ ,
int /* len */ ,
ClientPtr /* client */ );
int /*length */ ,
unsigned /*low */ ,
unsigned /*high */ ,
XID * /*errval */ );
int /*led */ ,
Bool /*on */ );
ClientPtr /*client */ );
DeviceIntPtr /*mouse */ );
DeviceIntPtr /*keybd */ );
DeviceIntPtr /*pDev */ );
extern _X_EXPORT void ProcessInputEvents(void);
char ** /*argv */ );
extern _X_EXPORT void CloseInput(void);
extern _X_EXPORT int GetMaximumEventsNum(void);
int type, int *num_events);
int type,
int buttons,
int type,
int buttons,
int type,
int type,
int key_code,
const ValuatorMask *mask);
int type,
#ifdef PANORAMIX
#endif
extern _X_EXPORT int GetMotionHistorySize(void);
xTimecoord ** buff,
unsigned long start,
unsigned long stop,
const char *name,
/* Helper functions. */
int *max_keys_per_mod);
int max_keys_per_mod);
attrs);
enum TouchListenerState {
LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */
LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already
accepted */
LISTENER_IS_OWNER, /**< Is the current owner, hasn't accepted */
LISTENER_HAS_ACCEPTED, /**< Is the current owner, has accepted */
LISTENER_HAS_END, /**< Has already received the end event */
};
enum TouchListenerType {
};
int index);
InternalEvent *ev);
InternalEvent *ev);
/* misc event helpers */
/**
* Masks specifying the type of event to deliver for an InternalEvent; used
* by EventIsDeliverable.
* @defgroup EventIsDeliverable return flags
* @{
*/
/* @} */
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 */
};
/* Implemented by the DDX. */
DeviceIntPtr *dev);
#define VALUATOR_MODE_ALL_AXES -1
extern Bool EnableCursor;
/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
*/
extern Bool CursorVisible;
int first_valuator,
int num_valuators,
const int *valuators);
int data);
double data);
const ValuatorMask *src);
int valnum);
/* InputOption handling interface */
const char *key,
const char *value);
const char *key);
const char *key);
const char *value);
extern _X_HIDDEN void update_desktop_dimensions(void);
#endif /* INPUT_H */