winrt-Windows.Devices.Custom 2.0.0b1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.1
2
+ Name: winrt-Windows.Devices.Custom
3
+ Version: 2.0.0b1
4
+ Summary: Python projection of Windows Runtime (WinRT) APIs
5
+ License: MIT
6
+ Project-URL: Repository, https://github.com/pywrint/pywrinrt
7
+ Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: Implementation :: CPython
11
+ Classifier: Intended Audience :: Developers
12
+ Requires-Python: <3.13,>=3.9
13
+ Description-Content-Type: text/markdown
14
+ Provides-Extra: all
15
+
16
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
17
+
18
+ # winrt-Windows.Devices.Custom
19
+
20
+ Windows Runtime (WinRT) APIs for for the `Windows.Devices.Custom` namespace.
21
+
22
+ This package provides the `winrt.windows.devices.custom` module.
@@ -0,0 +1,7 @@
1
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
2
+
3
+ # winrt-Windows.Devices.Custom
4
+
5
+ Windows Runtime (WinRT) APIs for for the `Windows.Devices.Custom` namespace.
6
+
7
+ This package provides the `winrt.windows.devices.custom` module.
@@ -0,0 +1,4 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ winrt-Windows.Foundation[all]==2.0.0-beta.1
4
+ winrt-Windows.Storage.Streams[all]==2.0.0-beta.1
@@ -0,0 +1,800 @@
1
+ // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ #include "py.Windows.Devices.Custom.h"
4
+
5
+
6
+ namespace py::cpp::Windows::Devices::Custom
7
+ {
8
+ // ----- CustomDevice class --------------------
9
+
10
+ static PyObject* _new_CustomDevice(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
11
+ {
12
+ static_assert(py::py_type<winrt::Windows::Devices::Custom::CustomDevice>::type_name);
13
+ py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Custom::CustomDevice>::type_name);
14
+ return nullptr;
15
+ }
16
+
17
+ static void _dealloc_CustomDevice(py::wrapper::Windows::Devices::Custom::CustomDevice* self) noexcept
18
+ {
19
+ auto tp = Py_TYPE(self);
20
+ std::destroy_at(&self->obj);
21
+ tp->tp_free(self);
22
+ Py_DECREF(tp);
23
+ }
24
+
25
+ static PyObject* CustomDevice_FromIdAsync(PyObject* /*unused*/, PyObject* args) noexcept
26
+ {
27
+ auto arg_count = PyTuple_Size(args);
28
+
29
+ if (arg_count == 3)
30
+ {
31
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"FromIdAsync", 3))
32
+ {
33
+ py::set_arg_count_version_error(3);
34
+ return nullptr;
35
+ }
36
+
37
+ try
38
+ {
39
+ auto param0 = py::convert_to<winrt::hstring>(args, 0);
40
+ auto param1 = py::convert_to<winrt::Windows::Devices::Custom::DeviceAccessMode>(args, 1);
41
+ auto param2 = py::convert_to<winrt::Windows::Devices::Custom::DeviceSharingMode>(args, 2);
42
+
43
+ return py::convert(winrt::Windows::Devices::Custom::CustomDevice::FromIdAsync(param0, param1, param2));
44
+ }
45
+ catch (...)
46
+ {
47
+ py::to_PyErr();
48
+ return nullptr;
49
+ }
50
+ }
51
+ else
52
+ {
53
+ py::set_invalid_arg_count_error(arg_count);
54
+ return nullptr;
55
+ }
56
+ }
57
+
58
+ static PyObject* CustomDevice_GetDeviceSelector(PyObject* /*unused*/, PyObject* args) noexcept
59
+ {
60
+ auto arg_count = PyTuple_Size(args);
61
+
62
+ if (arg_count == 1)
63
+ {
64
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"GetDeviceSelector", 1))
65
+ {
66
+ py::set_arg_count_version_error(1);
67
+ return nullptr;
68
+ }
69
+
70
+ try
71
+ {
72
+ auto param0 = py::convert_to<winrt::guid>(args, 0);
73
+
74
+ return py::convert(winrt::Windows::Devices::Custom::CustomDevice::GetDeviceSelector(param0));
75
+ }
76
+ catch (...)
77
+ {
78
+ py::to_PyErr();
79
+ return nullptr;
80
+ }
81
+ }
82
+ else
83
+ {
84
+ py::set_invalid_arg_count_error(arg_count);
85
+ return nullptr;
86
+ }
87
+ }
88
+
89
+ static PyObject* CustomDevice_SendIOControlAsync(py::wrapper::Windows::Devices::Custom::CustomDevice* self, PyObject* args) noexcept
90
+ {
91
+ auto arg_count = PyTuple_Size(args);
92
+
93
+ if (arg_count == 3)
94
+ {
95
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"SendIOControlAsync", 3))
96
+ {
97
+ py::set_arg_count_version_error(3);
98
+ return nullptr;
99
+ }
100
+
101
+ try
102
+ {
103
+ auto param0 = py::convert_to<winrt::Windows::Devices::Custom::IIOControlCode>(args, 0);
104
+ auto param1 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 1);
105
+ auto param2 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 2);
106
+
107
+ return py::convert(self->obj.SendIOControlAsync(param0, param1, param2));
108
+ }
109
+ catch (...)
110
+ {
111
+ py::to_PyErr();
112
+ return nullptr;
113
+ }
114
+ }
115
+ else
116
+ {
117
+ py::set_invalid_arg_count_error(arg_count);
118
+ return nullptr;
119
+ }
120
+ }
121
+
122
+ static PyObject* CustomDevice_TrySendIOControlAsync(py::wrapper::Windows::Devices::Custom::CustomDevice* self, PyObject* args) noexcept
123
+ {
124
+ auto arg_count = PyTuple_Size(args);
125
+
126
+ if (arg_count == 3)
127
+ {
128
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.Custom.CustomDevice", L"TrySendIOControlAsync", 3))
129
+ {
130
+ py::set_arg_count_version_error(3);
131
+ return nullptr;
132
+ }
133
+
134
+ try
135
+ {
136
+ auto param0 = py::convert_to<winrt::Windows::Devices::Custom::IIOControlCode>(args, 0);
137
+ auto param1 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 1);
138
+ auto param2 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 2);
139
+
140
+ return py::convert(self->obj.TrySendIOControlAsync(param0, param1, param2));
141
+ }
142
+ catch (...)
143
+ {
144
+ py::to_PyErr();
145
+ return nullptr;
146
+ }
147
+ }
148
+ else
149
+ {
150
+ py::set_invalid_arg_count_error(arg_count);
151
+ return nullptr;
152
+ }
153
+ }
154
+
155
+ static PyObject* CustomDevice_get_InputStream(py::wrapper::Windows::Devices::Custom::CustomDevice* self, void* /*unused*/) noexcept
156
+ {
157
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.CustomDevice", L"InputStream"))
158
+ {
159
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
160
+ return nullptr;
161
+ }
162
+
163
+ try
164
+ {
165
+ return py::convert(self->obj.InputStream());
166
+ }
167
+ catch (...)
168
+ {
169
+ py::to_PyErr();
170
+ return nullptr;
171
+ }
172
+ }
173
+
174
+ static PyObject* CustomDevice_get_OutputStream(py::wrapper::Windows::Devices::Custom::CustomDevice* self, void* /*unused*/) noexcept
175
+ {
176
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.CustomDevice", L"OutputStream"))
177
+ {
178
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
179
+ return nullptr;
180
+ }
181
+
182
+ try
183
+ {
184
+ return py::convert(self->obj.OutputStream());
185
+ }
186
+ catch (...)
187
+ {
188
+ py::to_PyErr();
189
+ return nullptr;
190
+ }
191
+ }
192
+
193
+ static PyObject* _assign_array_CustomDevice(PyObject* /*unused*/, PyObject* arg) noexcept
194
+ {
195
+ auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Custom::CustomDevice>>();
196
+ if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
197
+ {
198
+ return nullptr;
199
+ }
200
+ Py_RETURN_NONE;
201
+ }
202
+
203
+ static PyObject* _from_CustomDevice(PyObject* /*unused*/, PyObject* arg) noexcept
204
+ {
205
+ try
206
+ {
207
+ auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
208
+ return py::convert(return_value.as<winrt::Windows::Devices::Custom::CustomDevice>());
209
+ }
210
+ catch (...)
211
+ {
212
+ py::to_PyErr();
213
+ return nullptr;
214
+ }
215
+ }
216
+
217
+ static PyMethodDef _methods_CustomDevice[] = {
218
+ { "send_i_o_control_async", reinterpret_cast<PyCFunction>(CustomDevice_SendIOControlAsync), METH_VARARGS, nullptr },
219
+ { "try_send_i_o_control_async", reinterpret_cast<PyCFunction>(CustomDevice_TrySendIOControlAsync), METH_VARARGS, nullptr },
220
+ { "_assign_array_", _assign_array_CustomDevice, METH_O | METH_STATIC, nullptr },
221
+ { "_from", reinterpret_cast<PyCFunction>(_from_CustomDevice), METH_O | METH_STATIC, nullptr },
222
+ { }
223
+ };
224
+
225
+ static PyGetSetDef _getset_CustomDevice[] = {
226
+ { "input_stream", reinterpret_cast<getter>(CustomDevice_get_InputStream), nullptr, nullptr, nullptr },
227
+ { "output_stream", reinterpret_cast<getter>(CustomDevice_get_OutputStream), nullptr, nullptr, nullptr },
228
+ { }
229
+ };
230
+
231
+ static PyType_Slot _type_slots_CustomDevice[] =
232
+ {
233
+ { Py_tp_new, reinterpret_cast<void*>(_new_CustomDevice) },
234
+ { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_CustomDevice) },
235
+ { Py_tp_methods, reinterpret_cast<void*>(_methods_CustomDevice) },
236
+ { Py_tp_getset, reinterpret_cast<void*>(_getset_CustomDevice) },
237
+ { },
238
+ };
239
+
240
+ static PyType_Spec type_spec_CustomDevice =
241
+ {
242
+ "winrt._winrt_windows_devices_custom.CustomDevice",
243
+ sizeof(py::wrapper::Windows::Devices::Custom::CustomDevice),
244
+ 0,
245
+ Py_TPFLAGS_DEFAULT,
246
+ _type_slots_CustomDevice
247
+ };
248
+
249
+ static PyGetSetDef getset_CustomDevice_Static[] = {
250
+ { }
251
+ };
252
+
253
+ static PyMethodDef methods_CustomDevice_Static[] = {
254
+ { "from_id_async", reinterpret_cast<PyCFunction>(CustomDevice_FromIdAsync), METH_VARARGS, nullptr },
255
+ { "get_device_selector", reinterpret_cast<PyCFunction>(CustomDevice_GetDeviceSelector), METH_VARARGS, nullptr },
256
+ { }
257
+ };
258
+
259
+ static PyType_Slot type_slots_CustomDevice_Static[] =
260
+ {
261
+ { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
262
+ { Py_tp_getset, reinterpret_cast<void*>(getset_CustomDevice_Static) },
263
+ { Py_tp_methods, reinterpret_cast<void*>(methods_CustomDevice_Static) },
264
+ { }
265
+ };
266
+
267
+ static PyType_Spec type_spec_CustomDevice_Static =
268
+ {
269
+ "winrt._winrt_windows_devices_custom.CustomDevice_Static",
270
+ static_cast<int>(PyType_Type.tp_basicsize),
271
+ static_cast<int>(PyType_Type.tp_itemsize),
272
+ Py_TPFLAGS_DEFAULT,
273
+ type_slots_CustomDevice_Static
274
+ };
275
+
276
+ // ----- IOControlCode class --------------------
277
+
278
+ static PyObject* _new_IOControlCode(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
279
+ {
280
+ if (kwds != nullptr)
281
+ {
282
+ py::set_invalid_kwd_args_error();
283
+ return nullptr;
284
+ }
285
+
286
+ auto arg_count = PyTuple_Size(args);
287
+ if (arg_count == 4)
288
+ {
289
+ try
290
+ {
291
+ auto param0 = py::convert_to<uint16_t>(args, 0);
292
+ auto param1 = py::convert_to<uint16_t>(args, 1);
293
+ auto param2 = py::convert_to<winrt::Windows::Devices::Custom::IOControlAccessMode>(args, 2);
294
+ auto param3 = py::convert_to<winrt::Windows::Devices::Custom::IOControlBufferingMethod>(args, 3);
295
+
296
+ winrt::Windows::Devices::Custom::IOControlCode instance{ param0, param1, param2, param3 };
297
+ return py::wrap(instance, type);
298
+ }
299
+ catch (...)
300
+ {
301
+ py::to_PyErr();
302
+ return nullptr;
303
+ }
304
+ }
305
+ else
306
+ {
307
+ py::set_invalid_arg_count_error(arg_count);
308
+ return nullptr;
309
+ }
310
+ }
311
+
312
+ static void _dealloc_IOControlCode(py::wrapper::Windows::Devices::Custom::IOControlCode* self) noexcept
313
+ {
314
+ auto tp = Py_TYPE(self);
315
+ std::destroy_at(&self->obj);
316
+ tp->tp_free(self);
317
+ Py_DECREF(tp);
318
+ }
319
+
320
+ static PyObject* IOControlCode_get_AccessMode(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
321
+ {
322
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"AccessMode"))
323
+ {
324
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
325
+ return nullptr;
326
+ }
327
+
328
+ try
329
+ {
330
+ return py::convert(self->obj.AccessMode());
331
+ }
332
+ catch (...)
333
+ {
334
+ py::to_PyErr();
335
+ return nullptr;
336
+ }
337
+ }
338
+
339
+ static PyObject* IOControlCode_get_BufferingMethod(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
340
+ {
341
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"BufferingMethod"))
342
+ {
343
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
344
+ return nullptr;
345
+ }
346
+
347
+ try
348
+ {
349
+ return py::convert(self->obj.BufferingMethod());
350
+ }
351
+ catch (...)
352
+ {
353
+ py::to_PyErr();
354
+ return nullptr;
355
+ }
356
+ }
357
+
358
+ static PyObject* IOControlCode_get_ControlCode(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
359
+ {
360
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"ControlCode"))
361
+ {
362
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
363
+ return nullptr;
364
+ }
365
+
366
+ try
367
+ {
368
+ return py::convert(self->obj.ControlCode());
369
+ }
370
+ catch (...)
371
+ {
372
+ py::to_PyErr();
373
+ return nullptr;
374
+ }
375
+ }
376
+
377
+ static PyObject* IOControlCode_get_DeviceType(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
378
+ {
379
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"DeviceType"))
380
+ {
381
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
382
+ return nullptr;
383
+ }
384
+
385
+ try
386
+ {
387
+ return py::convert(self->obj.DeviceType());
388
+ }
389
+ catch (...)
390
+ {
391
+ py::to_PyErr();
392
+ return nullptr;
393
+ }
394
+ }
395
+
396
+ static PyObject* IOControlCode_get_Function(py::wrapper::Windows::Devices::Custom::IOControlCode* self, void* /*unused*/) noexcept
397
+ {
398
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IOControlCode", L"Function"))
399
+ {
400
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
401
+ return nullptr;
402
+ }
403
+
404
+ try
405
+ {
406
+ return py::convert(self->obj.Function());
407
+ }
408
+ catch (...)
409
+ {
410
+ py::to_PyErr();
411
+ return nullptr;
412
+ }
413
+ }
414
+
415
+ static PyObject* _assign_array_IOControlCode(PyObject* /*unused*/, PyObject* arg) noexcept
416
+ {
417
+ auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Custom::IOControlCode>>();
418
+ if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
419
+ {
420
+ return nullptr;
421
+ }
422
+ Py_RETURN_NONE;
423
+ }
424
+
425
+ static PyObject* _from_IOControlCode(PyObject* /*unused*/, PyObject* arg) noexcept
426
+ {
427
+ try
428
+ {
429
+ auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
430
+ return py::convert(return_value.as<winrt::Windows::Devices::Custom::IOControlCode>());
431
+ }
432
+ catch (...)
433
+ {
434
+ py::to_PyErr();
435
+ return nullptr;
436
+ }
437
+ }
438
+
439
+ static PyMethodDef _methods_IOControlCode[] = {
440
+ { "_assign_array_", _assign_array_IOControlCode, METH_O | METH_STATIC, nullptr },
441
+ { "_from", reinterpret_cast<PyCFunction>(_from_IOControlCode), METH_O | METH_STATIC, nullptr },
442
+ { }
443
+ };
444
+
445
+ static PyGetSetDef _getset_IOControlCode[] = {
446
+ { "access_mode", reinterpret_cast<getter>(IOControlCode_get_AccessMode), nullptr, nullptr, nullptr },
447
+ { "buffering_method", reinterpret_cast<getter>(IOControlCode_get_BufferingMethod), nullptr, nullptr, nullptr },
448
+ { "control_code", reinterpret_cast<getter>(IOControlCode_get_ControlCode), nullptr, nullptr, nullptr },
449
+ { "device_type", reinterpret_cast<getter>(IOControlCode_get_DeviceType), nullptr, nullptr, nullptr },
450
+ { "function", reinterpret_cast<getter>(IOControlCode_get_Function), nullptr, nullptr, nullptr },
451
+ { }
452
+ };
453
+
454
+ static PyType_Slot _type_slots_IOControlCode[] =
455
+ {
456
+ { Py_tp_new, reinterpret_cast<void*>(_new_IOControlCode) },
457
+ { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IOControlCode) },
458
+ { Py_tp_methods, reinterpret_cast<void*>(_methods_IOControlCode) },
459
+ { Py_tp_getset, reinterpret_cast<void*>(_getset_IOControlCode) },
460
+ { },
461
+ };
462
+
463
+ static PyType_Spec type_spec_IOControlCode =
464
+ {
465
+ "winrt._winrt_windows_devices_custom.IOControlCode",
466
+ sizeof(py::wrapper::Windows::Devices::Custom::IOControlCode),
467
+ 0,
468
+ Py_TPFLAGS_DEFAULT,
469
+ _type_slots_IOControlCode
470
+ };
471
+
472
+ // ----- KnownDeviceTypes class --------------------
473
+
474
+ static PyObject* _new_KnownDeviceTypes(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
475
+ {
476
+ static_assert(py::py_type<winrt::Windows::Devices::Custom::KnownDeviceTypes>::type_name);
477
+ py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Custom::KnownDeviceTypes>::type_name);
478
+ return nullptr;
479
+ }
480
+
481
+ static PyObject* KnownDeviceTypes_get_Unknown(PyObject* /*unused*/, void* /*unused*/) noexcept
482
+ {
483
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.KnownDeviceTypes", L"Unknown"))
484
+ {
485
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
486
+ return nullptr;
487
+ }
488
+
489
+ try
490
+ {
491
+ return py::convert(winrt::Windows::Devices::Custom::KnownDeviceTypes::Unknown());
492
+ }
493
+ catch (...)
494
+ {
495
+ py::to_PyErr();
496
+ return nullptr;
497
+ }
498
+ }
499
+
500
+ static PyMethodDef _methods_KnownDeviceTypes[] = {
501
+ { }
502
+ };
503
+
504
+ static PyGetSetDef _getset_KnownDeviceTypes[] = {
505
+ { }
506
+ };
507
+
508
+ static PyType_Slot _type_slots_KnownDeviceTypes[] =
509
+ {
510
+ { Py_tp_new, reinterpret_cast<void*>(_new_KnownDeviceTypes) },
511
+ { Py_tp_methods, reinterpret_cast<void*>(_methods_KnownDeviceTypes) },
512
+ { Py_tp_getset, reinterpret_cast<void*>(_getset_KnownDeviceTypes) },
513
+ { },
514
+ };
515
+
516
+ static PyType_Spec type_spec_KnownDeviceTypes =
517
+ {
518
+ "winrt._winrt_windows_devices_custom.KnownDeviceTypes",
519
+ 0,
520
+ 0,
521
+ Py_TPFLAGS_DEFAULT,
522
+ _type_slots_KnownDeviceTypes
523
+ };
524
+
525
+ static PyGetSetDef getset_KnownDeviceTypes_Static[] = {
526
+ { "unknown", reinterpret_cast<getter>(KnownDeviceTypes_get_Unknown), nullptr, nullptr, nullptr },
527
+ { }
528
+ };
529
+
530
+ static PyMethodDef methods_KnownDeviceTypes_Static[] = {
531
+ { }
532
+ };
533
+
534
+ static PyType_Slot type_slots_KnownDeviceTypes_Static[] =
535
+ {
536
+ { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
537
+ { Py_tp_getset, reinterpret_cast<void*>(getset_KnownDeviceTypes_Static) },
538
+ { Py_tp_methods, reinterpret_cast<void*>(methods_KnownDeviceTypes_Static) },
539
+ { }
540
+ };
541
+
542
+ static PyType_Spec type_spec_KnownDeviceTypes_Static =
543
+ {
544
+ "winrt._winrt_windows_devices_custom.KnownDeviceTypes_Static",
545
+ static_cast<int>(PyType_Type.tp_basicsize),
546
+ static_cast<int>(PyType_Type.tp_itemsize),
547
+ Py_TPFLAGS_DEFAULT,
548
+ type_slots_KnownDeviceTypes_Static
549
+ };
550
+
551
+ // ----- IIOControlCode interface --------------------
552
+
553
+ static PyObject* _new_IIOControlCode(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
554
+ {
555
+ static_assert(py::py_type<winrt::Windows::Devices::Custom::IIOControlCode>::type_name);
556
+ py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Custom::IIOControlCode>::type_name);
557
+ return nullptr;
558
+ }
559
+
560
+ static void _dealloc_IIOControlCode(py::wrapper::Windows::Devices::Custom::IIOControlCode* self) noexcept
561
+ {
562
+ auto tp = Py_TYPE(self);
563
+ std::destroy_at(&self->obj);
564
+ tp->tp_free(self);
565
+ Py_DECREF(tp);
566
+ }
567
+
568
+ static PyObject* IIOControlCode_get_AccessMode(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
569
+ {
570
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"AccessMode"))
571
+ {
572
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
573
+ return nullptr;
574
+ }
575
+
576
+ try
577
+ {
578
+ return py::convert(self->obj.AccessMode());
579
+ }
580
+ catch (...)
581
+ {
582
+ py::to_PyErr();
583
+ return nullptr;
584
+ }
585
+ }
586
+
587
+ static PyObject* IIOControlCode_get_BufferingMethod(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
588
+ {
589
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"BufferingMethod"))
590
+ {
591
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
592
+ return nullptr;
593
+ }
594
+
595
+ try
596
+ {
597
+ return py::convert(self->obj.BufferingMethod());
598
+ }
599
+ catch (...)
600
+ {
601
+ py::to_PyErr();
602
+ return nullptr;
603
+ }
604
+ }
605
+
606
+ static PyObject* IIOControlCode_get_ControlCode(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
607
+ {
608
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"ControlCode"))
609
+ {
610
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
611
+ return nullptr;
612
+ }
613
+
614
+ try
615
+ {
616
+ return py::convert(self->obj.ControlCode());
617
+ }
618
+ catch (...)
619
+ {
620
+ py::to_PyErr();
621
+ return nullptr;
622
+ }
623
+ }
624
+
625
+ static PyObject* IIOControlCode_get_DeviceType(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
626
+ {
627
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"DeviceType"))
628
+ {
629
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
630
+ return nullptr;
631
+ }
632
+
633
+ try
634
+ {
635
+ return py::convert(self->obj.DeviceType());
636
+ }
637
+ catch (...)
638
+ {
639
+ py::to_PyErr();
640
+ return nullptr;
641
+ }
642
+ }
643
+
644
+ static PyObject* IIOControlCode_get_Function(py::wrapper::Windows::Devices::Custom::IIOControlCode* self, void* /*unused*/) noexcept
645
+ {
646
+ if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.Custom.IIOControlCode", L"Function"))
647
+ {
648
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
649
+ return nullptr;
650
+ }
651
+
652
+ try
653
+ {
654
+ return py::convert(self->obj.Function());
655
+ }
656
+ catch (...)
657
+ {
658
+ py::to_PyErr();
659
+ return nullptr;
660
+ }
661
+ }
662
+
663
+ static PyObject* _assign_array_IIOControlCode(PyObject* /*unused*/, PyObject* arg) noexcept
664
+ {
665
+ auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Custom::IIOControlCode>>();
666
+ if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
667
+ {
668
+ return nullptr;
669
+ }
670
+ Py_RETURN_NONE;
671
+ }
672
+
673
+ static PyObject* _from_IIOControlCode(PyObject* /*unused*/, PyObject* arg) noexcept
674
+ {
675
+ try
676
+ {
677
+ auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
678
+ return py::convert(return_value.as<winrt::Windows::Devices::Custom::IIOControlCode>());
679
+ }
680
+ catch (...)
681
+ {
682
+ py::to_PyErr();
683
+ return nullptr;
684
+ }
685
+ }
686
+
687
+ static PyMethodDef _methods_IIOControlCode[] = {
688
+ { "_assign_array_", _assign_array_IIOControlCode, METH_O | METH_STATIC, nullptr },
689
+ { "_from", reinterpret_cast<PyCFunction>(_from_IIOControlCode), METH_O | METH_STATIC, nullptr },
690
+ { }
691
+ };
692
+
693
+ static PyGetSetDef _getset_IIOControlCode[] = {
694
+ { "access_mode", reinterpret_cast<getter>(IIOControlCode_get_AccessMode), nullptr, nullptr, nullptr },
695
+ { "buffering_method", reinterpret_cast<getter>(IIOControlCode_get_BufferingMethod), nullptr, nullptr, nullptr },
696
+ { "control_code", reinterpret_cast<getter>(IIOControlCode_get_ControlCode), nullptr, nullptr, nullptr },
697
+ { "device_type", reinterpret_cast<getter>(IIOControlCode_get_DeviceType), nullptr, nullptr, nullptr },
698
+ { "function", reinterpret_cast<getter>(IIOControlCode_get_Function), nullptr, nullptr, nullptr },
699
+ { }
700
+ };
701
+
702
+ static PyType_Slot _type_slots_IIOControlCode[] =
703
+ {
704
+ { Py_tp_new, reinterpret_cast<void*>(_new_IIOControlCode) },
705
+ { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IIOControlCode) },
706
+ { Py_tp_methods, reinterpret_cast<void*>(_methods_IIOControlCode) },
707
+ { Py_tp_getset, reinterpret_cast<void*>(_getset_IIOControlCode) },
708
+ { },
709
+ };
710
+
711
+ static PyType_Spec type_spec_IIOControlCode =
712
+ {
713
+ "winrt._winrt_windows_devices_custom.IIOControlCode",
714
+ sizeof(py::wrapper::Windows::Devices::Custom::IIOControlCode),
715
+ 0,
716
+ Py_TPFLAGS_DEFAULT,
717
+ _type_slots_IIOControlCode
718
+ };
719
+
720
+ // ----- Windows.Devices.Custom Initialization --------------------
721
+ PyDoc_STRVAR(module_doc, "Windows::Devices::Custom");
722
+
723
+
724
+ static PyModuleDef module_def
725
+ = {PyModuleDef_HEAD_INIT,
726
+ "_winrt_windows_devices_custom",
727
+ module_doc,
728
+ 0,
729
+ nullptr,
730
+ nullptr,
731
+ nullptr,
732
+ nullptr,
733
+ nullptr};
734
+
735
+ } // py::cpp::Windows::Devices::Custom
736
+
737
+ PyMODINIT_FUNC PyInit__winrt_windows_devices_custom(void) noexcept
738
+ {
739
+ using namespace py::cpp::Windows::Devices::Custom;
740
+
741
+ if (py::import_winrt_runtime() == -1)
742
+ {
743
+ return nullptr;
744
+ }
745
+
746
+ py::pyobj_handle module{PyModule_Create(&module_def)};
747
+
748
+ if (!module)
749
+ {
750
+ return nullptr;
751
+ }
752
+
753
+ auto object_type = py::get_object_type();
754
+ if (!object_type)
755
+ {
756
+ return nullptr;
757
+ }
758
+
759
+ py::pyobj_handle object_bases{PyTuple_Pack(1, object_type)};
760
+
761
+ if (!object_bases)
762
+ {
763
+ return nullptr;
764
+ }
765
+
766
+ py::pyobj_handle type_CustomDevice_Static{PyType_FromSpec(&type_spec_CustomDevice_Static)};
767
+ if (!type_CustomDevice_Static)
768
+ {
769
+ return nullptr;
770
+ }
771
+
772
+ if (py::register_python_type(module.get(), &type_spec_CustomDevice, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_CustomDevice_Static.get())) == -1)
773
+ {
774
+ return nullptr;
775
+ }
776
+
777
+ if (py::register_python_type(module.get(), &type_spec_IOControlCode, object_bases.get(), nullptr) == -1)
778
+ {
779
+ return nullptr;
780
+ }
781
+
782
+ py::pyobj_handle type_KnownDeviceTypes_Static{PyType_FromSpec(&type_spec_KnownDeviceTypes_Static)};
783
+ if (!type_KnownDeviceTypes_Static)
784
+ {
785
+ return nullptr;
786
+ }
787
+
788
+ if (py::register_python_type(module.get(), &type_spec_KnownDeviceTypes, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_KnownDeviceTypes_Static.get())) == -1)
789
+ {
790
+ return nullptr;
791
+ }
792
+
793
+ if (py::register_python_type(module.get(), &type_spec_IIOControlCode, object_bases.get(), nullptr) == -1)
794
+ {
795
+ return nullptr;
796
+ }
797
+
798
+
799
+ return module.detach();
800
+ }
@@ -0,0 +1,43 @@
1
+ # WARNING: Please don't edit this file. It was automatically generated.
2
+
3
+ [build-system]
4
+ requires = ["setuptools", "setuptools-scm", "winrt-sdk"]
5
+ build-backend = "setuptools.build_meta"
6
+
7
+ [project]
8
+ name = "winrt-Windows.Devices.Custom"
9
+ description = "Python projection of Windows Runtime (WinRT) APIs"
10
+ readme = "README.md"
11
+ license = { text = "MIT" }
12
+ classifiers = [
13
+ "Operating System :: Microsoft :: Windows",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: Implementation :: CPython",
16
+ "Intended Audience :: Developers",
17
+ ]
18
+ dynamic = ["version", "dependencies", "optional-dependencies"]
19
+ requires-python = ">=3.9,<3.13"
20
+
21
+ [project.urls]
22
+ # Homepage = "https://github.com/pywrint/pywrinrt"
23
+ # Documentation = "https://readthedocs.org"
24
+ Repository = "https://github.com/pywrint/pywrinrt"
25
+ Changelog = "https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md"
26
+
27
+ [tool.setuptools.dynamic]
28
+ version = { file = "pywinrt-version.txt" }
29
+ dependencies = { file = "requirements.txt" }
30
+ optional-dependencies.all = { file = "all-requirements.txt" }
31
+
32
+ [tool.cibuildwheel]
33
+ # use local winrt-sdk build dependency
34
+ environment = { PYTHONPATH="../winrt-sdk/src" }
35
+ # don't install winrt-sdk from PyPI
36
+ build-frontend = { name = "build", args = ["--skip-dependency-check", "--no-isolation"] }
37
+ # don't build for PyPy
38
+ skip = "pp*"
39
+ # suppress warnings about ARM64 testing
40
+ test-skip = "*-win_arm64"
41
+
42
+ [tool.cibuildwheel.windows]
43
+ archs = ["x86", "AMD64", "ARM64"]
@@ -0,0 +1 @@
1
+ 2.0.0-beta.1
@@ -0,0 +1,3 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ winrt-runtime==2.0.0-beta.1
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,17 @@
1
+ # WARNING: Please don't edit this file. It was automatically generated.
2
+
3
+ from setuptools import Extension, setup
4
+ from winrt_sdk import get_include_dirs
5
+
6
+ setup(
7
+ ext_modules=[
8
+ Extension(
9
+ "winrt._winrt_windows_devices_custom",
10
+ sources=["py.Windows.Devices.Custom.cpp"],
11
+ include_dirs=get_include_dirs(),
12
+ extra_compile_args=["/std:c++20", "/permissive-"],
13
+ libraries=["windowsapp"],
14
+ )
15
+ ],
16
+ package_data={"winrt": ["*.pyi"]},
17
+ )
@@ -0,0 +1,69 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ import datetime
4
+ import sys
5
+ import types
6
+ import typing
7
+ import uuid as _uuid
8
+ from builtins import property as _property
9
+
10
+ import winrt._winrt
11
+ import winrt.system
12
+ import winrt.windows.foundation
13
+ import winrt.windows.storage.streams
14
+
15
+ from winrt.windows.devices.custom import DeviceAccessMode, DeviceSharingMode, IOControlAccessMode, IOControlBufferingMethod
16
+
17
+ Self = typing.TypeVar('Self')
18
+
19
+ class CustomDevice_Static(type):
20
+ def from_id_async(cls, device_id: str, desired_access: DeviceAccessMode, sharing_mode: DeviceSharingMode, /) -> winrt.windows.foundation.IAsyncOperation[CustomDevice]: ...
21
+ def get_device_selector(cls, class_guid: _uuid.UUID, /) -> str: ...
22
+
23
+ class CustomDevice(winrt.system.Object, metaclass=CustomDevice_Static):
24
+ @staticmethod
25
+ def _from(obj: winrt.system.Object, /) -> CustomDevice: ...
26
+ def send_i_o_control_async(self, io_control_code: typing.Optional[IIOControlCode], input_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], output_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], /) -> winrt.windows.foundation.IAsyncOperation[winrt.system.UInt32]: ...
27
+ def try_send_i_o_control_async(self, io_control_code: typing.Optional[IIOControlCode], input_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], output_buffer: typing.Optional[winrt.windows.storage.streams.IBuffer], /) -> winrt.windows.foundation.IAsyncOperation[bool]: ...
28
+ @_property
29
+ def input_stream(self) -> typing.Optional[winrt.windows.storage.streams.IInputStream]: ...
30
+ @_property
31
+ def output_stream(self) -> typing.Optional[winrt.windows.storage.streams.IOutputStream]: ...
32
+
33
+ class IOControlCode(winrt.system.Object):
34
+ @staticmethod
35
+ def _from(obj: winrt.system.Object, /) -> IOControlCode: ...
36
+ def __new__(cls: typing.Type[IOControlCode], device_type: winrt.system.UInt16, function: winrt.system.UInt16, access_mode: IOControlAccessMode, buffering_method: IOControlBufferingMethod) -> IOControlCode:...
37
+ @_property
38
+ def access_mode(self) -> IOControlAccessMode: ...
39
+ @_property
40
+ def buffering_method(self) -> IOControlBufferingMethod: ...
41
+ @_property
42
+ def control_code(self) -> winrt.system.UInt32: ...
43
+ @_property
44
+ def device_type(self) -> winrt.system.UInt16: ...
45
+ @_property
46
+ def function(self) -> winrt.system.UInt16: ...
47
+
48
+ class KnownDeviceTypes_Static(type):
49
+ @_property
50
+ def unknown(cls) -> winrt.system.UInt16: ...
51
+
52
+ class KnownDeviceTypes(winrt.system.Object, metaclass=KnownDeviceTypes_Static):
53
+ @staticmethod
54
+ def _from(obj: winrt.system.Object, /) -> KnownDeviceTypes: ...
55
+
56
+ class IIOControlCode(winrt.system.Object):
57
+ @staticmethod
58
+ def _from(obj: winrt.system.Object, /) -> IIOControlCode: ...
59
+ @_property
60
+ def access_mode(self) -> IOControlAccessMode: ...
61
+ @_property
62
+ def buffering_method(self) -> IOControlBufferingMethod: ...
63
+ @_property
64
+ def control_code(self) -> winrt.system.UInt32: ...
65
+ @_property
66
+ def device_type(self) -> winrt.system.UInt16: ...
67
+ @_property
68
+ def function(self) -> winrt.system.UInt16: ...
69
+
@@ -0,0 +1,43 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.0-beta.1
2
+
3
+ import enum
4
+
5
+ import winrt.system
6
+ from winrt import _winrt_windows_devices_custom
7
+
8
+ __all__ = [
9
+ "DeviceAccessMode",
10
+ "DeviceSharingMode",
11
+ "IOControlAccessMode",
12
+ "IOControlBufferingMethod",
13
+ "CustomDevice",
14
+ "IOControlCode",
15
+ "KnownDeviceTypes",
16
+ "IIOControlCode",
17
+ ]
18
+
19
+ class DeviceAccessMode(enum.IntEnum):
20
+ READ = 0
21
+ WRITE = 1
22
+ READ_WRITE = 2
23
+
24
+ class DeviceSharingMode(enum.IntEnum):
25
+ SHARED = 0
26
+ EXCLUSIVE = 1
27
+
28
+ class IOControlAccessMode(enum.IntEnum):
29
+ ANY = 0
30
+ READ = 1
31
+ WRITE = 2
32
+ READ_WRITE = 3
33
+
34
+ class IOControlBufferingMethod(enum.IntEnum):
35
+ BUFFERED = 0
36
+ DIRECT_INPUT = 1
37
+ DIRECT_OUTPUT = 2
38
+ NEITHER = 3
39
+
40
+ CustomDevice = _winrt_windows_devices_custom.CustomDevice
41
+ IOControlCode = _winrt_windows_devices_custom.IOControlCode
42
+ KnownDeviceTypes = _winrt_windows_devices_custom.KnownDeviceTypes
43
+ IIOControlCode = _winrt_windows_devices_custom.IIOControlCode
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.1
2
+ Name: winrt-Windows.Devices.Custom
3
+ Version: 2.0.0b1
4
+ Summary: Python projection of Windows Runtime (WinRT) APIs
5
+ License: MIT
6
+ Project-URL: Repository, https://github.com/pywrint/pywrinrt
7
+ Project-URL: Changelog, https://github.com/pywinrt/pywinrt/blob/main/CHANGELOG.md
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: Implementation :: CPython
11
+ Classifier: Intended Audience :: Developers
12
+ Requires-Python: <3.13,>=3.9
13
+ Description-Content-Type: text/markdown
14
+ Provides-Extra: all
15
+
16
+ <!-- warning: Please don't edit this file. It was automatically generated. -->
17
+
18
+ # winrt-Windows.Devices.Custom
19
+
20
+ Windows Runtime (WinRT) APIs for for the `Windows.Devices.Custom` namespace.
21
+
22
+ This package provides the `winrt.windows.devices.custom` module.
@@ -0,0 +1,14 @@
1
+ README.md
2
+ all-requirements.txt
3
+ py.Windows.Devices.Custom.cpp
4
+ pyproject.toml
5
+ pywinrt-version.txt
6
+ requirements.txt
7
+ setup.py
8
+ winrt/_winrt_windows_devices_custom.pyi
9
+ winrt/windows/devices/custom/__init__.py
10
+ winrt_Windows.Devices.Custom.egg-info/PKG-INFO
11
+ winrt_Windows.Devices.Custom.egg-info/SOURCES.txt
12
+ winrt_Windows.Devices.Custom.egg-info/dependency_links.txt
13
+ winrt_Windows.Devices.Custom.egg-info/requires.txt
14
+ winrt_Windows.Devices.Custom.egg-info/top_level.txt
@@ -0,0 +1,5 @@
1
+ winrt-runtime==2.0.0-beta.1
2
+
3
+ [all]
4
+ winrt-Windows.Foundation[all]==2.0.0-beta.1
5
+ winrt-Windows.Storage.Streams[all]==2.0.0-beta.1