diff options
author | Keith Packard <keithp@keithp.com> | 2011-12-14 11:40:10 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-12-14 11:40:10 -0800 |
commit | 7da7aa96a0acb895e1fe57a9d3f2d093479cf2a2 (patch) | |
tree | fc9aa833defaa1b8f95a56755be52afff281ca03 /include | |
parent | b79de3f42ff8412dcabf2f2a805cbcbd1c6907c3 (diff) | |
parent | 7528a6b88eb32098af4369a8bd9d70a808fa6f1c (diff) |
Merge remote-tracking branch 'whot/for-keith'
Diffstat (limited to 'include')
-rw-r--r-- | include/dix.h | 5 | ||||
-rw-r--r-- | include/dixgrabs.h | 4 | ||||
-rw-r--r-- | include/eventconvert.h | 7 | ||||
-rw-r--r-- | include/exevents.h | 6 | ||||
-rw-r--r-- | include/input.h | 20 | ||||
-rw-r--r-- | include/inputstr.h | 10 | ||||
-rw-r--r-- | include/inpututils.h | 6 | ||||
-rw-r--r-- | include/misc.h | 2 |
8 files changed, 43 insertions, 17 deletions
diff --git a/include/dix.h b/include/dix.h index 2d8d315c5..272fd4161 100644 --- a/include/dix.h +++ b/include/dix.h @@ -400,6 +400,11 @@ extern int DeliverDeviceEvents( WindowPtr /* stopAt */, DeviceIntPtr /* dev */); +extern int DeliverOneGrabbedEvent( + InternalEvent* /* event*/, + DeviceIntPtr /* dev */, + enum InputLevel /* level */); + extern void InitializeSprite( DeviceIntPtr /* pDev */, WindowPtr /* pWin */); diff --git a/include/dixgrabs.h b/include/dixgrabs.h index 65ff45d1d..4dd5eae6d 100644 --- a/include/dixgrabs.h +++ b/include/dixgrabs.h @@ -40,7 +40,7 @@ extern GrabPtr CreateGrab( DeviceIntPtr /* device */, DeviceIntPtr /* modDevice */, WindowPtr /* window */, - GrabType /* grabtype */, + enum InputLevel /* grabtype */, GrabMask * /* mask */, struct _GrabParameters * /* param */, int /* type */, @@ -64,4 +64,6 @@ extern _X_EXPORT int AddPassiveGrabToList( extern _X_EXPORT Bool DeletePassiveGrabFromList( GrabPtr /* pMinuendGrab */); +extern Bool GrabIsPointerGrab(GrabPtr grab); +extern Bool GrabIsKeyboardGrab(GrabPtr grab); #endif /* DIXGRABS_H */ diff --git a/include/eventconvert.h b/include/eventconvert.h index b000abc4b..571a51109 100644 --- a/include/eventconvert.h +++ b/include/eventconvert.h @@ -27,14 +27,15 @@ #include <X11/extensions/XIproto.h> #include "input.h" #include "events.h" +#include "eventstr.h" #define FP1616(integral, frac) ((integral) * (1 << 16) + (frac) * (1 << 16)) _X_EXPORT int EventToCore(InternalEvent *event, xEvent **core, int *count); _X_EXPORT int EventToXI(InternalEvent *ev, xEvent **xi, int *count); _X_EXPORT int EventToXI2(InternalEvent *ev, xEvent **xi); -_X_INTERNAL int GetCoreType(InternalEvent* ev); -_X_INTERNAL int GetXIType(InternalEvent* ev); -_X_INTERNAL int GetXI2Type(InternalEvent* ev); +_X_INTERNAL int GetCoreType(enum EventType type); +_X_INTERNAL int GetXIType(enum EventType type); +_X_INTERNAL int GetXI2Type(enum EventType type); #endif /* _EVENTCONVERT_H_ */ diff --git a/include/exevents.h b/include/exevents.h index 12ea37885..0ab04f525 100644 --- a/include/exevents.h +++ b/include/exevents.h @@ -159,7 +159,7 @@ typedef struct _XIClientRec { typedef struct _GrabParameters { - int grabtype; /* GRABTYPE_CORE, etc. */ + int grabtype; /* CORE, etc. */ unsigned int ownerEvents; unsigned int this_device_mode; unsigned int other_devices_mode; @@ -200,7 +200,7 @@ GrabButton( DeviceIntPtr /* modifier_device */, int /* button */, GrabParameters* /* param */, - GrabType /* grabtype */, + enum InputLevel /* grabtype */, GrabMask* /* eventMask */); extern int @@ -210,7 +210,7 @@ GrabKey( DeviceIntPtr /* modifier_device */, int /* key */, GrabParameters* /* param */, - GrabType /* grabtype */, + enum InputLevel /* grabtype */, GrabMask* /* eventMask */); extern int diff --git a/include/input.h b/include/input.h index 8b0c18e70..bd12f6829 100644 --- a/include/input.h +++ b/include/input.h @@ -57,6 +57,7 @@ SOFTWARE. #include "xkbrules.h" #include "events.h" #include "list.h" +#include <X11/extensions/XI2.h> #define DEVICE_INIT 0 #define DEVICE_ON 1 @@ -101,6 +102,12 @@ SOFTWARE. #define RevertToFollowKeyboard 3 #endif +enum InputLevel { + CORE, + XI, + XI2, +}; + typedef unsigned long Leds; typedef struct _OtherClients *OtherClientsPtr; typedef struct _InputClients *InputClientsPtr; @@ -537,14 +544,16 @@ extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs); extern Mask GetEventMask(DeviceIntPtr dev, xEvent* ev, InputClientsPtr clients); extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event); extern Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent* ev); +extern int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type); void FixUpEventFromWindow(SpritePtr pSprite, xEvent *xE, WindowPtr pWin, Window child, Bool calcChild); extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y); -extern int EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, - WindowPtr win); +extern int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win); +extern Bool ActivatePassiveGrab(DeviceIntPtr dev, GrabPtr grab, + InternalEvent *ev); /** * Masks specifying the type of event to deliver for an InternalEvent; used * by EventIsDeliverable. @@ -557,6 +566,13 @@ extern int EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, #define EVENT_XI2_MASK (1 << 3) /**< XI2 mask set on window */ /* @} */ +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. */ extern _X_EXPORT int NewInputDeviceRequest( InputOption *options, diff --git a/include/inputstr.h b/include/inputstr.h index 5634f3cfc..5aae1b512 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -57,7 +57,7 @@ SOFTWARE. #include "geext.h" #include "privates.h" -#define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) +#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) #define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) #define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7))) extern _X_EXPORT int CountBits(const uint8_t *mask, int len); @@ -167,12 +167,6 @@ typedef struct _DetailRec { /* Grab details may be bit masks */ Mask *pMask; } DetailRec; -typedef enum { - GRABTYPE_CORE, - GRABTYPE_XI, - GRABTYPE_XI2 -} GrabType; - union _GrabMask { Mask core; Mask xi; @@ -200,7 +194,7 @@ typedef struct _GrabRec { unsigned ownerEvents:1; unsigned keyboardMode:1; unsigned pointerMode:1; - GrabType grabtype; + enum InputLevel grabtype; CARD8 type; /* event type */ DetailRec modifiersDetail; DeviceIntPtr modifierDevice; diff --git a/include/inpututils.h b/include/inpututils.h index 5f9dfecc3..9e22c5a28 100644 --- a/include/inpututils.h +++ b/include/inpututils.h @@ -32,6 +32,8 @@ #include "input.h" #include <X11/extensions/XI2proto.h> +extern Mask event_filters[MAXDEVICES][MAXEVENTS]; + struct _ValuatorMask { int8_t last_bit; /* highest bit set in mask */ uint8_t mask[(MAX_VALUATORS + 7)/8]; @@ -40,6 +42,10 @@ struct _ValuatorMask { extern void verify_internal_event(const InternalEvent *ev); extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms); +extern int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd); +extern void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event); +extern Mask event_get_filter_from_type(DeviceIntPtr dev, int evtype); +extern Mask event_get_filter_from_xi2type(int evtype); FP3232 double_to_fp3232(double in); FP1616 double_to_fp1616(double in); diff --git a/include/misc.h b/include/misc.h index d9811ca60..09f928a50 100644 --- a/include/misc.h +++ b/include/misc.h @@ -89,6 +89,8 @@ OF THIS SOFTWARE. #define MAXFORMATS 8 #define MAXDEVICES 40 /* input devices */ +/* 128 event opcodes for core + extension events, excluding GE */ +#define MAXEVENTS 128 #define EXTENSION_EVENT_BASE 64 #define EXTENSION_BASE 128 |