1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/windows/touchinjection_sdk80.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,107 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef touchinjection_sdk80_h 1.9 +#define touchinjection_sdk80_h 1.10 + 1.11 +// Note, this isn't inclusive of all touch injection header info. 1.12 +// You may need to add more to expand on current apis. 1.13 + 1.14 +#ifndef TOUCH_FEEDBACK_DEFAULT 1.15 + 1.16 +#define TOUCH_FEEDBACK_DEFAULT 0x1 1.17 +#define TOUCH_FEEDBACK_INDIRECT 0x2 1.18 +#define TOUCH_FEEDBACK_NONE 0x3 1.19 + 1.20 +enum { 1.21 + PT_POINTER = 0x00000001, // Generic pointer 1.22 + PT_TOUCH = 0x00000002, // Touch 1.23 + PT_PEN = 0x00000003, // Pen 1.24 + PT_MOUSE = 0x00000004, // Mouse 1.25 +}; 1.26 + 1.27 +typedef DWORD POINTER_INPUT_TYPE; 1.28 +typedef UINT32 POINTER_FLAGS; 1.29 + 1.30 +typedef enum { 1.31 + POINTER_CHANGE_NONE, 1.32 + POINTER_CHANGE_FIRSTBUTTON_DOWN, 1.33 + POINTER_CHANGE_FIRSTBUTTON_UP, 1.34 + POINTER_CHANGE_SECONDBUTTON_DOWN, 1.35 + POINTER_CHANGE_SECONDBUTTON_UP, 1.36 + POINTER_CHANGE_THIRDBUTTON_DOWN, 1.37 + POINTER_CHANGE_THIRDBUTTON_UP, 1.38 + POINTER_CHANGE_FOURTHBUTTON_DOWN, 1.39 + POINTER_CHANGE_FOURTHBUTTON_UP, 1.40 + POINTER_CHANGE_FIFTHBUTTON_DOWN, 1.41 + POINTER_CHANGE_FIFTHBUTTON_UP, 1.42 +} POINTER_BUTTON_CHANGE_TYPE; 1.43 + 1.44 +typedef struct { 1.45 + POINTER_INPUT_TYPE pointerType; 1.46 + UINT32 pointerId; 1.47 + UINT32 frameId; 1.48 + POINTER_FLAGS pointerFlags; 1.49 + HANDLE sourceDevice; 1.50 + HWND hwndTarget; 1.51 + POINT ptPixelLocation; 1.52 + POINT ptHimetricLocation; 1.53 + POINT ptPixelLocationRaw; 1.54 + POINT ptHimetricLocationRaw; 1.55 + DWORD dwTime; 1.56 + UINT32 historyCount; 1.57 + INT32 InputData; 1.58 + DWORD dwKeyStates; 1.59 + UINT64 PerformanceCount; 1.60 + POINTER_BUTTON_CHANGE_TYPE ButtonChangeType; 1.61 +} POINTER_INFO; 1.62 + 1.63 +typedef UINT32 TOUCH_FLAGS; 1.64 +typedef UINT32 TOUCH_MASK; 1.65 + 1.66 +typedef struct { 1.67 + POINTER_INFO pointerInfo; 1.68 + TOUCH_FLAGS touchFlags; 1.69 + TOUCH_MASK touchMask; 1.70 + RECT rcContact; 1.71 + RECT rcContactRaw; 1.72 + UINT32 orientation; 1.73 + UINT32 pressure; 1.74 +} POINTER_TOUCH_INFO; 1.75 + 1.76 +#define TOUCH_FLAG_NONE 0x00000000 // Default 1.77 + 1.78 +#define TOUCH_MASK_NONE 0x00000000 // Default - none of the optional fields are valid 1.79 +#define TOUCH_MASK_CONTACTAREA 0x00000001 // The rcContact field is valid 1.80 +#define TOUCH_MASK_ORIENTATION 0x00000002 // The orientation field is valid 1.81 +#define TOUCH_MASK_PRESSURE 0x00000004 // The pressure field is valid 1.82 + 1.83 +#define POINTER_FLAG_NONE 0x00000000 // Default 1.84 +#define POINTER_FLAG_NEW 0x00000001 // New pointer 1.85 +#define POINTER_FLAG_INRANGE 0x00000002 // Pointer has not departed 1.86 +#define POINTER_FLAG_INCONTACT 0x00000004 // Pointer is in contact 1.87 +#define POINTER_FLAG_FIRSTBUTTON 0x00000010 // Primary action 1.88 +#define POINTER_FLAG_SECONDBUTTON 0x00000020 // Secondary action 1.89 +#define POINTER_FLAG_THIRDBUTTON 0x00000040 // Third button 1.90 +#define POINTER_FLAG_FOURTHBUTTON 0x00000080 // Fourth button 1.91 +#define POINTER_FLAG_FIFTHBUTTON 0x00000100 // Fifth button 1.92 +#define POINTER_FLAG_PRIMARY 0x00002000 // Pointer is primary 1.93 +#define POINTER_FLAG_CONFIDENCE 0x00004000 // Pointer is considered unlikely to be accidental 1.94 +#define POINTER_FLAG_CANCELED 0x00008000 // Pointer is departing in an abnormal manner 1.95 +#define POINTER_FLAG_DOWN 0x00010000 // Pointer transitioned to down state (made contact) 1.96 +#define POINTER_FLAG_UPDATE 0x00020000 // Pointer update 1.97 +#define POINTER_FLAG_UP 0x00040000 // Pointer transitioned from down state (broke contact) 1.98 +#define POINTER_FLAG_WHEEL 0x00080000 // Vertical wheel 1.99 +#define POINTER_FLAG_HWHEEL 0x00100000 // Horizontal wheel 1.100 +#define POINTER_FLAG_CAPTURECHANGED 0x00200000 // Lost capture 1.101 + 1.102 +#endif // TOUCH_FEEDBACK_DEFAULT 1.103 + 1.104 +#define TOUCH_FLAGS_CONTACTUPDATE (POINTER_FLAG_UPDATE|POINTER_FLAG_INRANGE|POINTER_FLAG_INCONTACT) 1.105 +#define TOUCH_FLAGS_CONTACTDOWN (POINTER_FLAG_DOWN|POINTER_FLAG_INRANGE|POINTER_FLAG_INCONTACT) 1.106 + 1.107 +typedef BOOL (WINAPI* InitializeTouchInjectionPtr)(UINT32 maxCount, DWORD dwMode); 1.108 +typedef BOOL (WINAPI* InjectTouchInputPtr)(UINT32 count, CONST POINTER_TOUCH_INFO *info); 1.109 + 1.110 +#endif // touchinjection_sdk80_h 1.111 \ No newline at end of file