| 1 |
/* |
| 2 |
* Copyright (C) 2024 Zhiyi Zhang for CodeWeavers |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU Lesser General Public |
| 6 |
* License as published by the Free Software Foundation; either |
| 7 |
* version 2.1 of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Lesser General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Lesser General Public |
| 15 |
* License along with this library; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifdef __WIDL__ |
| 20 |
#pragma winrt ns_prefix |
| 21 |
#endif |
| 22 |
|
| 23 |
import "inspectable.idl"; |
| 24 |
import "asyncinfo.idl"; |
| 25 |
import "eventtoken.idl"; |
| 26 |
import "windowscontracts.idl"; |
| 27 |
import "windows.foundation.idl"; |
| 28 |
|
| 29 |
namespace Windows.Devices.Input { |
| 30 |
typedef enum PointerDeviceType PointerDeviceType; |
| 31 |
typedef struct PointerDeviceUsage PointerDeviceUsage; |
| 32 |
|
| 33 |
interface IPointerDevice; |
| 34 |
interface IPointerDevice2; |
| 35 |
interface IPointerDeviceStatics; |
| 36 |
|
| 37 |
runtimeclass PointerDevice; |
| 38 |
|
| 39 |
declare { |
| 40 |
interface Windows.Foundation.Collections.IVectorView<Windows.Devices.Input.PointerDevice *>; |
| 41 |
interface Windows.Foundation.Collections.IVectorView<Windows.Devices.Input.PointerDeviceUsage>; |
| 42 |
} |
| 43 |
|
| 44 |
[ |
| 45 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 46 |
] |
| 47 |
enum PointerDeviceType |
| 48 |
{ |
| 49 |
Touch = 0, |
| 50 |
Pen = 1, |
| 51 |
Mouse = 2 |
| 52 |
}; |
| 53 |
|
| 54 |
[ |
| 55 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 56 |
] |
| 57 |
struct PointerDeviceUsage |
| 58 |
{ |
| 59 |
UINT32 UsagePage; |
| 60 |
UINT32 Usage; |
| 61 |
INT32 MinLogical; |
| 62 |
INT32 MaxLogical; |
| 63 |
INT32 MinPhysical; |
| 64 |
INT32 MaxPhysical; |
| 65 |
UINT32 Unit; |
| 66 |
FLOAT PhysicalMultiplier; |
| 67 |
}; |
| 68 |
|
| 69 |
[ |
| 70 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 71 |
exclusiveto(Windows.Devices.Input.PointerDevice), |
| 72 |
uuid(93c9bafc-ebcb-467e-82c6-276feae36b5a) |
| 73 |
] |
| 74 |
interface IPointerDevice : IInspectable |
| 75 |
{ |
| 76 |
[propget] HRESULT PointerDeviceType([out, retval] Windows.Devices.Input.PointerDeviceType *value); |
| 77 |
[propget] HRESULT IsIntegrated([out, retval] boolean *value); |
| 78 |
[propget] HRESULT MaxContacts([out, retval] UINT32 *value); |
| 79 |
[propget] HRESULT PhysicalDeviceRect([out, retval] Windows.Foundation.Rect *value); |
| 80 |
[propget] HRESULT ScreenRect([out, retval] Windows.Foundation.Rect *value); |
| 81 |
[propget] HRESULT SupportedUsages([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Devices.Input.PointerDeviceUsage> **value); |
| 82 |
} |
| 83 |
|
| 84 |
[ |
| 85 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 86 |
exclusiveto(Windows.Devices.Input.PointerDevice), |
| 87 |
uuid(f8a6d2a0-c484-489f-ae3e-30d2ee1ffd3e) |
| 88 |
] |
| 89 |
interface IPointerDevice2 : IInspectable |
| 90 |
{ |
| 91 |
[propget] HRESULT MaxPointersWithZDistance([out, retval] UINT32 *value); |
| 92 |
} |
| 93 |
|
| 94 |
[ |
| 95 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 96 |
exclusiveto(Windows.Devices.Input.PointerDevice), |
| 97 |
uuid(d8b89aa1-d1c6-416e-bd8d-5790914dc563) |
| 98 |
] |
| 99 |
interface IPointerDeviceStatics : IInspectable |
| 100 |
{ |
| 101 |
HRESULT GetPointerDevice([in] UINT32 pointer_id, [out, retval] Windows.Devices.Input.PointerDevice **pointer_device); |
| 102 |
HRESULT GetPointerDevices([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Devices.Input.PointerDevice *> **pointer_devices); |
| 103 |
} |
| 104 |
|
| 105 |
[ |
| 106 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 107 |
marshaling_behavior(none), |
| 108 |
static(Windows.Devices.Input.IPointerDeviceStatics, Windows.Foundation.UniversalApiContract, 1.0) |
| 109 |
] |
| 110 |
runtimeclass PointerDevice |
| 111 |
{ |
| 112 |
[default] interface Windows.Devices.Input.IPointerDevice; |
| 113 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Devices.Input.IPointerDevice2; |
| 114 |
} |
| 115 |
} |