Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef touchinjection_sdk80_h |
michael@0 | 6 | #define touchinjection_sdk80_h |
michael@0 | 7 | |
michael@0 | 8 | // Note, this isn't inclusive of all touch injection header info. |
michael@0 | 9 | // You may need to add more to expand on current apis. |
michael@0 | 10 | |
michael@0 | 11 | #ifndef TOUCH_FEEDBACK_DEFAULT |
michael@0 | 12 | |
michael@0 | 13 | #define TOUCH_FEEDBACK_DEFAULT 0x1 |
michael@0 | 14 | #define TOUCH_FEEDBACK_INDIRECT 0x2 |
michael@0 | 15 | #define TOUCH_FEEDBACK_NONE 0x3 |
michael@0 | 16 | |
michael@0 | 17 | enum { |
michael@0 | 18 | PT_POINTER = 0x00000001, // Generic pointer |
michael@0 | 19 | PT_TOUCH = 0x00000002, // Touch |
michael@0 | 20 | PT_PEN = 0x00000003, // Pen |
michael@0 | 21 | PT_MOUSE = 0x00000004, // Mouse |
michael@0 | 22 | }; |
michael@0 | 23 | |
michael@0 | 24 | typedef DWORD POINTER_INPUT_TYPE; |
michael@0 | 25 | typedef UINT32 POINTER_FLAGS; |
michael@0 | 26 | |
michael@0 | 27 | typedef enum { |
michael@0 | 28 | POINTER_CHANGE_NONE, |
michael@0 | 29 | POINTER_CHANGE_FIRSTBUTTON_DOWN, |
michael@0 | 30 | POINTER_CHANGE_FIRSTBUTTON_UP, |
michael@0 | 31 | POINTER_CHANGE_SECONDBUTTON_DOWN, |
michael@0 | 32 | POINTER_CHANGE_SECONDBUTTON_UP, |
michael@0 | 33 | POINTER_CHANGE_THIRDBUTTON_DOWN, |
michael@0 | 34 | POINTER_CHANGE_THIRDBUTTON_UP, |
michael@0 | 35 | POINTER_CHANGE_FOURTHBUTTON_DOWN, |
michael@0 | 36 | POINTER_CHANGE_FOURTHBUTTON_UP, |
michael@0 | 37 | POINTER_CHANGE_FIFTHBUTTON_DOWN, |
michael@0 | 38 | POINTER_CHANGE_FIFTHBUTTON_UP, |
michael@0 | 39 | } POINTER_BUTTON_CHANGE_TYPE; |
michael@0 | 40 | |
michael@0 | 41 | typedef struct { |
michael@0 | 42 | POINTER_INPUT_TYPE pointerType; |
michael@0 | 43 | UINT32 pointerId; |
michael@0 | 44 | UINT32 frameId; |
michael@0 | 45 | POINTER_FLAGS pointerFlags; |
michael@0 | 46 | HANDLE sourceDevice; |
michael@0 | 47 | HWND hwndTarget; |
michael@0 | 48 | POINT ptPixelLocation; |
michael@0 | 49 | POINT ptHimetricLocation; |
michael@0 | 50 | POINT ptPixelLocationRaw; |
michael@0 | 51 | POINT ptHimetricLocationRaw; |
michael@0 | 52 | DWORD dwTime; |
michael@0 | 53 | UINT32 historyCount; |
michael@0 | 54 | INT32 InputData; |
michael@0 | 55 | DWORD dwKeyStates; |
michael@0 | 56 | UINT64 PerformanceCount; |
michael@0 | 57 | POINTER_BUTTON_CHANGE_TYPE ButtonChangeType; |
michael@0 | 58 | } POINTER_INFO; |
michael@0 | 59 | |
michael@0 | 60 | typedef UINT32 TOUCH_FLAGS; |
michael@0 | 61 | typedef UINT32 TOUCH_MASK; |
michael@0 | 62 | |
michael@0 | 63 | typedef struct { |
michael@0 | 64 | POINTER_INFO pointerInfo; |
michael@0 | 65 | TOUCH_FLAGS touchFlags; |
michael@0 | 66 | TOUCH_MASK touchMask; |
michael@0 | 67 | RECT rcContact; |
michael@0 | 68 | RECT rcContactRaw; |
michael@0 | 69 | UINT32 orientation; |
michael@0 | 70 | UINT32 pressure; |
michael@0 | 71 | } POINTER_TOUCH_INFO; |
michael@0 | 72 | |
michael@0 | 73 | #define TOUCH_FLAG_NONE 0x00000000 // Default |
michael@0 | 74 | |
michael@0 | 75 | #define TOUCH_MASK_NONE 0x00000000 // Default - none of the optional fields are valid |
michael@0 | 76 | #define TOUCH_MASK_CONTACTAREA 0x00000001 // The rcContact field is valid |
michael@0 | 77 | #define TOUCH_MASK_ORIENTATION 0x00000002 // The orientation field is valid |
michael@0 | 78 | #define TOUCH_MASK_PRESSURE 0x00000004 // The pressure field is valid |
michael@0 | 79 | |
michael@0 | 80 | #define POINTER_FLAG_NONE 0x00000000 // Default |
michael@0 | 81 | #define POINTER_FLAG_NEW 0x00000001 // New pointer |
michael@0 | 82 | #define POINTER_FLAG_INRANGE 0x00000002 // Pointer has not departed |
michael@0 | 83 | #define POINTER_FLAG_INCONTACT 0x00000004 // Pointer is in contact |
michael@0 | 84 | #define POINTER_FLAG_FIRSTBUTTON 0x00000010 // Primary action |
michael@0 | 85 | #define POINTER_FLAG_SECONDBUTTON 0x00000020 // Secondary action |
michael@0 | 86 | #define POINTER_FLAG_THIRDBUTTON 0x00000040 // Third button |
michael@0 | 87 | #define POINTER_FLAG_FOURTHBUTTON 0x00000080 // Fourth button |
michael@0 | 88 | #define POINTER_FLAG_FIFTHBUTTON 0x00000100 // Fifth button |
michael@0 | 89 | #define POINTER_FLAG_PRIMARY 0x00002000 // Pointer is primary |
michael@0 | 90 | #define POINTER_FLAG_CONFIDENCE 0x00004000 // Pointer is considered unlikely to be accidental |
michael@0 | 91 | #define POINTER_FLAG_CANCELED 0x00008000 // Pointer is departing in an abnormal manner |
michael@0 | 92 | #define POINTER_FLAG_DOWN 0x00010000 // Pointer transitioned to down state (made contact) |
michael@0 | 93 | #define POINTER_FLAG_UPDATE 0x00020000 // Pointer update |
michael@0 | 94 | #define POINTER_FLAG_UP 0x00040000 // Pointer transitioned from down state (broke contact) |
michael@0 | 95 | #define POINTER_FLAG_WHEEL 0x00080000 // Vertical wheel |
michael@0 | 96 | #define POINTER_FLAG_HWHEEL 0x00100000 // Horizontal wheel |
michael@0 | 97 | #define POINTER_FLAG_CAPTURECHANGED 0x00200000 // Lost capture |
michael@0 | 98 | |
michael@0 | 99 | #endif // TOUCH_FEEDBACK_DEFAULT |
michael@0 | 100 | |
michael@0 | 101 | #define TOUCH_FLAGS_CONTACTUPDATE (POINTER_FLAG_UPDATE|POINTER_FLAG_INRANGE|POINTER_FLAG_INCONTACT) |
michael@0 | 102 | #define TOUCH_FLAGS_CONTACTDOWN (POINTER_FLAG_DOWN|POINTER_FLAG_INRANGE|POINTER_FLAG_INCONTACT) |
michael@0 | 103 | |
michael@0 | 104 | typedef BOOL (WINAPI* InitializeTouchInjectionPtr)(UINT32 maxCount, DWORD dwMode); |
michael@0 | 105 | typedef BOOL (WINAPI* InjectTouchInputPtr)(UINT32 count, CONST POINTER_TOUCH_INFO *info); |
michael@0 | 106 | |
michael@0 | 107 | #endif // touchinjection_sdk80_h |