diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-03 13:39:59 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-09 14:56:23 +1000 |
commit | b8b90cd1610331ff12fa3f70bf372670af7795ec (patch) | |
tree | 6a17496ecde536666f4ce92cc55d8a000a04ccdb /include | |
parent | 4bc2761ad5ec2d0668aec639780ffb136605fbc8 (diff) |
Add a new XI2Mask struct and a few helper functions.
The current XI2 mask handling is handy for copying (fixed size arrays) but a
pain to deal with otherwise. Add a struct for XI2 masks and the required
accessors.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/input.h | 1 | ||||
-rw-r--r-- | include/inputstr.h | 6 | ||||
-rw-r--r-- | include/inpututils.h | 12 |
3 files changed, 19 insertions, 0 deletions
diff --git a/include/input.h b/include/input.h index 8e7b47a4c..8b0c18e70 100644 --- a/include/input.h +++ b/include/input.h @@ -205,6 +205,7 @@ extern _X_EXPORT KeybdCtrl defaultKeyboardControl; extern _X_EXPORT PtrCtrl defaultPointerControl; typedef struct _InputOption InputOption; +typedef struct _XI2Mask XI2Mask; typedef struct _InputAttributes { char *product; diff --git a/include/inputstr.h b/include/inputstr.h index f9cb8fe0f..a73ace830 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -622,4 +622,10 @@ static inline WindowPtr DeepestSpriteWin(SpritePtr sprite) return sprite->spriteTrace[sprite->spriteTraceGood - 1]; } +struct _XI2Mask { + unsigned char **masks; /* event mask in masks[deviceid][event type byte] */ + size_t nmasks; /* number of masks */ + size_t mask_size; /* size of each mask in bytes */ +}; + #endif /* INPUTSTRUCT_H */ diff --git a/include/inpututils.h b/include/inpututils.h index 2832ed5b1..5f9dfecc3 100644 --- a/include/inpututils.h +++ b/include/inpututils.h @@ -46,4 +46,16 @@ FP1616 double_to_fp1616(double in); double fp1616_to_double(FP1616 in); double fp3232_to_double(FP3232 in); + +XI2Mask* xi2mask_new(void); +XI2Mask* xi2mask_new_with_size(size_t, size_t); /* don't use it */ +void xi2mask_free(XI2Mask** mask); +Bool xi2mask_isset(XI2Mask* mask, const DeviceIntPtr dev, int event_type); +void xi2mask_set(XI2Mask *mask, int deviceid, int event_type); +void xi2mask_zero(XI2Mask *mask, int deviceid); +void xi2mask_merge(XI2Mask *dest, const XI2Mask *source); +size_t xi2mask_num_masks(const XI2Mask *mask); +size_t xi2mask_mask_size(const XI2Mask *mask); +void xi2mask_set_one_mask(XI2Mask *xi2mask, int deviceid, const unsigned char *mask, size_t mask_size); +const unsigned char* xi2mask_get_one_mask(const XI2Mask *xi2mask, int deviceid); #endif |