From d19a3889b57367836749139f7ba7220bc80dad34 Mon Sep 17 00:00:00 2001 From: Halil Durmus Date: Tue, 31 Oct 2023 14:05:51 +0300 Subject: [PATCH] refactor!: Rename named parameters of WinRT generic interfaces --- .../src/machinelearning/ilearningmodel.dart | 4 +- .../ilearningmodelsession.dart | 4 +- .../ilearningmodelstatics.dart | 8 +- .../lib/src/machinelearning/itensor.dart | 2 +- .../src/machinelearning/itensordouble.dart | 2 +- .../itensorfeaturedescriptor.dart | 2 +- .../lib/src/machinelearning/itensorfloat.dart | 2 +- .../machinelearning/itensorfloat16bit.dart | 2 +- .../src/machinelearning/itensorint16bit.dart | 2 +- .../src/machinelearning/itensorint32bit.dart | 2 +- .../src/machinelearning/itensorint64bit.dart | 2 +- .../src/machinelearning/itensorint8bit.dart | 2 +- .../src/machinelearning/itensoruint16bit.dart | 2 +- .../src/machinelearning/itensoruint32bit.dart | 2 +- .../src/machinelearning/itensoruint64bit.dart | 2 +- .../src/machinelearning/itensoruint8bit.dart | 2 +- .../windows_ai/test/collections_test.dart | 2 +- .../lib/src/ipackage.dart | 2 +- .../lib/src/ipackage3.dart | 6 +- .../lib/src/ipackage5.dart | 20 +- .../lib/src/ipackage6.dart | 2 +- .../lib/src/ipackage8.dart | 2 +- .../lib/src/ipackage9.dart | 2 +- .../windows_data/lib/src/json/jsonarray.dart | 4 +- .../windows_data/lib/src/json/jsonobject.dart | 4 +- .../lib/src/pdf/ipdfdocumentstatics.dart | 8 +- .../lib/src/xml/dom/ixmldocumentstatics.dart | 8 +- .../lib/src/xml/dom/ixmlnamednodemap.dart | 4 +- .../lib/src/xml/dom/ixmlnodelist.dart | 4 +- .../lib/src/xml/dom/xmlnamednodemap.dart | 4 +- .../lib/src/xml/dom/xmlnodelist.dart | 4 +- .../src/display/idisplaymonitorstatics.dart | 4 +- .../deviceinformationcollection.dart | 4 +- .../src/enumeration/ideviceinformation.dart | 4 +- .../ideviceinformationcustompairing.dart | 6 +- .../ideviceinformationpairing.dart | 4 +- .../ideviceinformationpairing2.dart | 4 +- .../ideviceinformationstatics.dart | 12 +- .../ideviceinformationstatics2.dart | 4 +- .../lib/src/enumeration/idevicepicker.dart | 4 +- .../src/enumeration/idevicepickerfilter.dart | 2 +- .../lib/src/geolocation/igeolocator.dart | 4 +- .../src/geolocation/igeolocatorstatics.dart | 14 +- .../lib/src/power/ibatterystatics.dart | 4 +- .../lib/src/collections/iiterable.dart | 70 +++--- .../lib/src/collections/iiterator.dart | 66 +++--- .../lib/src/collections/iiterator_part.dart | 42 ++-- .../lib/src/collections/ikeyvaluepair.dart | 118 ++++++---- .../src/collections/ikeyvaluepair_part.dart | 96 ++++---- .../lib/src/collections/imap.dart | 182 +++++++++------ .../lib/src/collections/imap_part.dart | 126 +++++----- .../lib/src/collections/imapview.dart | 219 +++++++++++------- .../lib/src/collections/imapview_part.dart | 126 +++++----- .../lib/src/collections/ivector.dart | 120 +++++----- .../lib/src/collections/ivector_part.dart | 52 +++-- .../lib/src/collections/ivectorview.dart | 106 ++++----- .../lib/src/collections/ivectorview_part.dart | 48 ++-- .../lib/src/iasyncoperation.dart | 103 +++++--- .../lib/src/iasyncoperation_part.dart | 38 +-- .../lib/src/ireference.dart | 14 +- .../lib/src/ireference_part.dart | 12 +- .../src/iwwwformurldecoderruntimeclass.dart | 4 +- .../lib/src/wwwformurldecoder.dart | 4 +- .../lib/src/input/igamepadstatics.dart | 2 +- .../lib/src/collation/charactergroupings.dart | 4 +- .../src/collation/icharactergroupings.dart | 4 +- .../src/ijapanesephoneticanalyzerstatics.dart | 4 +- .../lib/src/imaging/bitmappropertyset.dart | 4 +- .../lib/src/imaging/ibitmapdecoder.dart | 4 +- .../src/imaging/ibitmapdecoderstatics.dart | 6 +- .../lib/src/imaging/ibitmapframe.dart | 6 +- .../ibitmapframewithsoftwarebitmap.dart | 6 +- .../src/imaging/ibitmappropertiesview.dart | 2 +- .../src/imaging/isoftwarebitmapstatics.dart | 4 +- .../iprinting3dmultiplepropertymaterial.dart | 2 +- .../src/capture/frames/imediaframereader.dart | 2 +- .../src/capture/frames/imediaframesource.dart | 2 +- .../frames/imediaframesourcecontroller.dart | 4 +- .../frames/imediaframesourcecontroller2.dart | 4 +- .../frames/imediaframesourcegroup.dart | 2 +- .../frames/imediaframesourcegroupstatics.dart | 8 +- .../frames/imediaframesourceinfo2.dart | 2 +- .../frames/imultisourcemediaframereader.dart | 2 +- .../src/capture/iadvancedphotocapture.dart | 4 +- .../capture/icapturedframecontrolvalues.dart | 2 +- .../capture/icapturedframecontrolvalues2.dart | 2 +- .../src/capture/ilowlagmediarecording3.dart | 4 +- .../lib/src/capture/ilowlagphotocapture.dart | 2 +- .../lib/src/capture/imediacapture2.dart | 12 +- .../lib/src/capture/imediacapture3.dart | 2 +- .../lib/src/capture/imediacapture4.dart | 10 +- .../lib/src/capture/imediacapture5.dart | 12 +- .../lib/src/capture/imediacapture6.dart | 2 +- .../lib/src/capture/imediacapturestatics.dart | 6 +- .../capture/imediacapturevideoprofile.dart | 8 +- .../capture/imediacapturevideoprofile2.dart | 2 +- .../ivariablephotosequencecontroller.dart | 2 +- .../src/devices/iadvancedphotocontrol.dart | 2 +- .../src/devices/idigitalwindowcontrol.dart | 2 +- .../lib/src/devices/ifocuscontrol.dart | 2 +- .../lib/src/devices/ifocuscontrol2.dart | 6 +- .../lib/src/devices/ifocussettings.dart | 2 +- .../lib/src/devices/ihdrvideocontrol.dart | 2 +- .../src/devices/iinfraredtorchcontrol.dart | 2 +- .../lib/src/devices/iisospeedcontrol.dart | 2 +- .../src/devices/imediadevicecontroller.dart | 2 +- .../iopticalimagestabilizationcontrol.dart | 2 +- .../lib/src/devices/iscenemodecontrol.dart | 2 +- .../ivideotemporaldenoisingcontrol.dart | 2 +- .../lib/src/devices/izoomcontrol2.dart | 2 +- .../imediaencodingprofile2.dart | 4 +- .../imediaencodingprofile3.dart | 2 +- .../imediaencodingprofilestatics.dart | 4 +- .../windows_media/lib/src/ocr/iocrengine.dart | 4 +- .../lib/src/ocr/iocrenginestatics.dart | 2 +- .../windows_media/lib/src/ocr/iocrline.dart | 2 +- .../windows_media/lib/src/ocr/iocrresult.dart | 2 +- .../src/connectivity/iconnectionprofile2.dart | 12 +- .../src/connectivity/iconnectionprofile3.dart | 6 +- .../src/connectivity/iconnectionprofile4.dart | 6 +- .../src/connectivity/iconnectionprofile5.dart | 2 +- .../src/connectivity/ilanidentifierdata.dart | 2 +- .../lib/src/connectivity/inetworkadapter.dart | 2 +- .../inetworkinformationstatics.dart | 10 +- .../inetworkinformationstatics2.dart | 6 +- .../inetworkoperatortetheringclient.dart | 2 +- ...networkoperatortetheringclientmanager.dart | 2 +- .../inetworkoperatortetheringmanager.dart | 6 +- .../test/collections_test.dart | 7 +- .../web/core/ifindallaccountsresult.dart | 2 +- .../iwebauthenticationcoremanagerstatics.dart | 14 +- ...iwebauthenticationcoremanagerstatics2.dart | 2 +- ...iwebauthenticationcoremanagerstatics4.dart | 10 +- .../web/core/iwebtokenrequestresult.dart | 2 +- .../lib/src/credentials/iwebaccount2.dart | 2 +- .../lib/src/winrt_com_interop_helpers.dart | 10 +- .../istorageitemcontentproperties.dart | 8 +- .../istorageitemextraproperties.dart | 2 +- .../lib/src/iapplicationdatacontainer.dart | 2 +- .../lib/src/iapplicationdatastatics2.dart | 2 +- .../lib/src/idownloadsfolderstatics.dart | 8 +- .../lib/src/idownloadsfolderstatics2.dart | 8 +- .../lib/src/ifileiostatics.dart | 8 +- .../lib/src/iknownfoldersstatics3.dart | 2 +- .../lib/src/iknownfoldersstatics4.dart | 6 +- .../windows_storage/lib/src/istoragefile.dart | 10 +- .../lib/src/istoragefile2.dart | 4 +- .../lib/src/istoragefilestatics.dart | 12 +- .../lib/src/istoragefilestatics2.dart | 2 +- .../lib/src/istoragefolder.dart | 32 +-- .../lib/src/istoragefolder2.dart | 2 +- .../lib/src/istoragefolderstatics.dart | 2 +- .../lib/src/istoragefolderstatics2.dart | 2 +- .../windows_storage/lib/src/istorageitem.dart | 2 +- .../lib/src/istorageitem2.dart | 2 +- .../lib/src/istorageitemproperties.dart | 6 +- .../lib/src/istorageitemproperties2.dart | 6 +- .../lib/src/istoragelibrarychange.dart | 2 +- .../lib/src/istoragelibrarychangereader.dart | 6 +- .../lib/src/pickers/ifileopenpicker.dart | 8 +- .../lib/src/pickers/ifilesavepicker.dart | 4 +- .../lib/src/pickers/ifolderpicker.dart | 2 +- .../src/search/istoragefilequeryresult.dart | 12 +- .../src/search/istoragefilequeryresult2.dart | 2 +- .../search/istoragefolderqueryoperations.dart | 32 +-- .../src/search/istoragefolderqueryresult.dart | 12 +- .../src/search/istorageitemqueryresult.dart | 12 +- .../src/search/istoragequeryresultbase.dart | 4 +- .../src/streams/datareaderloadoperation.dart | 2 +- .../src/streams/datawriterstoreoperation.dart | 2 +- .../lib/src/streams/idatareader.dart | 2 +- .../lib/src/streams/idatawriter.dart | 2 +- .../ifilerandomaccessstreamstatics.dart | 16 +- .../src/streams/iinputstreamreference.dart | 2 +- .../streams/irandomaccessstreamreference.dart | 2 +- .../lib/src/ifolderlauncheroptions.dart | 2 +- .../lib/src/ilauncherstatics2.dart | 30 +-- .../lib/src/ilauncherstatics4.dart | 20 +- packages/windows_system/lib/src/iuser.dart | 4 +- packages/windows_system/lib/src/iuser2.dart | 2 +- .../windows_system/lib/src/iuserstatics.dart | 18 +- .../itoastcollectionmanager.dart | 8 +- .../itoastnotificationhistory2.dart | 4 +- .../itoastnotificationmanagerforuser2.dart | 4 +- .../lib/src/notifications/itoastnotifier.dart | 2 +- .../lib/src/popups/imessagedialog.dart | 4 +- .../core/iremoteautomationclientsession.dart | 2 +- .../iwindowingenvironment.dart | 2 +- .../iwindowingenvironmentstatics.dart | 4 +- .../lib/src/extensions/type_identifier.dart | 95 +++++--- .../src/projections/generic_interface.dart | 74 +++--- .../src/projections/method_forwarders.dart | 92 +++----- .../lib/src/projections/types/array.dart | 6 +- .../lib/src/projections/types/async.dart | 46 ++-- .../lib/src/projections/types/generic.dart | 24 +- .../lib/src/projections/types/ireference.dart | 25 +- .../lib/src/projections/types/map.dart | 56 ++--- .../lib/src/projections/types/vector.dart | 44 ++-- .../test/extensions/type_identifier_test.dart | 18 +- .../winrtgen/test/goldens/imap_part.golden | 126 +++++----- .../test/goldens/ireference_part.golden | 12 +- .../winrtgen/test/goldens/ivector_part.golden | 52 +++-- .../projections/generic_interface_test.dart | 12 +- .../test/projections/getter_test.dart | 20 +- .../projections/method_forwarders_test.dart | 18 +- .../test/projections/method_test.dart | 30 +-- .../test/projections/parameter_test.dart | 10 +- pubspec.yaml | 2 +- 208 files changed, 1673 insertions(+), 1480 deletions(-) diff --git a/packages/windows_ai/lib/src/machinelearning/ilearningmodel.dart b/packages/windows_ai/lib/src/machinelearning/ilearningmodel.dart index d97efc46..f9900f1b 100644 --- a/packages/windows_ai/lib/src/machinelearning/ilearningmodel.dart +++ b/packages/windows_ai/lib/src/machinelearning/ilearningmodel.dart @@ -151,7 +151,7 @@ class ILearningModel extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{0fa50877-6792-56b7-af46-430a8901894a}', - creator: ILearningModelFeatureDescriptor.fromPtr) + tObjectCreator: ILearningModelFeatureDescriptor.fromPtr) .toList(); } @@ -174,7 +174,7 @@ class ILearningModel extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{0fa50877-6792-56b7-af46-430a8901894a}', - creator: ILearningModelFeatureDescriptor.fromPtr) + tObjectCreator: ILearningModelFeatureDescriptor.fromPtr) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/ilearningmodelsession.dart b/packages/windows_ai/lib/src/machinelearning/ilearningmodelsession.dart index 877f6e4e..bc8167cb 100644 --- a/packages/windows_ai/lib/src/machinelearning/ilearningmodelsession.dart +++ b/packages/windows_ai/lib/src/machinelearning/ilearningmodelsession.dart @@ -109,7 +109,7 @@ class ILearningModelSession extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LearningModelEvaluationResult.fromPtr); + tResultObjectCreator: LearningModelEvaluationResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -129,7 +129,7 @@ class ILearningModelSession extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LearningModelEvaluationResult.fromPtr); + tResultObjectCreator: LearningModelEvaluationResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_ai/lib/src/machinelearning/ilearningmodelstatics.dart b/packages/windows_ai/lib/src/machinelearning/ilearningmodelstatics.dart index b0429aae..4ce501de 100644 --- a/packages/windows_ai/lib/src/machinelearning/ilearningmodelstatics.dart +++ b/packages/windows_ai/lib/src/machinelearning/ilearningmodelstatics.dart @@ -46,7 +46,7 @@ class ILearningModelStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LearningModel.fromPtr); + tResultObjectCreator: LearningModel.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -65,7 +65,7 @@ class ILearningModelStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LearningModel.fromPtr); + tResultObjectCreator: LearningModel.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -128,7 +128,7 @@ class ILearningModelStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LearningModel.fromPtr); + tResultObjectCreator: LearningModel.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -151,7 +151,7 @@ class ILearningModelStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LearningModel.fromPtr); + tResultObjectCreator: LearningModel.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_ai/lib/src/machinelearning/itensor.dart b/packages/windows_ai/lib/src/machinelearning/itensor.dart index e3dc7675..0fd7c395 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensor.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensor.dart @@ -67,7 +67,7 @@ class ITensor extends IInspectable implements ILearningModelFeatureValue { return IVectorView.fromPtr(value, iterableIid: '{7784427e-f9cc-518d-964b-e50d5ce727f1}', - intType: IntType.int64) + tIntType: IntType.int64) .toList(); } diff --git a/packages/windows_ai/lib/src/machinelearning/itensordouble.dart b/packages/windows_ai/lib/src/machinelearning/itensordouble.dart index 92a38922..4e8f1059 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensordouble.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensordouble.dart @@ -42,7 +42,7 @@ class ITensorDouble extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{c738964e-9c64-5bce-b5ce-61e9a282ec4a}', - doubleType: DoubleType.double) + tDoubleType: DoubleType.double) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensorfeaturedescriptor.dart b/packages/windows_ai/lib/src/machinelearning/itensorfeaturedescriptor.dart index 85d30309..813004c5 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensorfeaturedescriptor.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensorfeaturedescriptor.dart @@ -65,7 +65,7 @@ class ITensorFeatureDescriptor extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{7784427e-f9cc-518d-964b-e50d5ce727f1}', - intType: IntType.int64) + tIntType: IntType.int64) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensorfloat.dart b/packages/windows_ai/lib/src/machinelearning/itensorfloat.dart index ff5ebd63..8149b56e 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensorfloat.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensorfloat.dart @@ -42,7 +42,7 @@ class ITensorFloat extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{b01bee51-063a-5fda-bd72-d76637bb8cb8}', - doubleType: DoubleType.float) + tDoubleType: DoubleType.float) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensorfloat16bit.dart b/packages/windows_ai/lib/src/machinelearning/itensorfloat16bit.dart index ed2a6994..2aecbe43 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensorfloat16bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensorfloat16bit.dart @@ -42,7 +42,7 @@ class ITensorFloat16Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{b01bee51-063a-5fda-bd72-d76637bb8cb8}', - doubleType: DoubleType.float) + tDoubleType: DoubleType.float) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensorint16bit.dart b/packages/windows_ai/lib/src/machinelearning/itensorint16bit.dart index ffe662db..39ea12c5 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensorint16bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensorint16bit.dart @@ -42,7 +42,7 @@ class ITensorInt16Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{72ff2923-4b4e-53bb-8feb-41ec5f2bb734}', - intType: IntType.int16) + tIntType: IntType.int16) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensorint32bit.dart b/packages/windows_ai/lib/src/machinelearning/itensorint32bit.dart index 35830752..a40d0876 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensorint32bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensorint32bit.dart @@ -42,7 +42,7 @@ class ITensorInt32Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{81a643fb-f51c-5565-83c4-f96425777b66}', - intType: IntType.int32) + tIntType: IntType.int32) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensorint64bit.dart b/packages/windows_ai/lib/src/machinelearning/itensorint64bit.dart index 610c62f2..2388f4e2 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensorint64bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensorint64bit.dart @@ -42,7 +42,7 @@ class ITensorInt64Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{7784427e-f9cc-518d-964b-e50d5ce727f1}', - intType: IntType.int64) + tIntType: IntType.int64) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensorint8bit.dart b/packages/windows_ai/lib/src/machinelearning/itensorint8bit.dart index 8500faaa..78295e6c 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensorint8bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensorint8bit.dart @@ -42,7 +42,7 @@ class ITensorInt8Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{88318266-f3fd-50fc-8f08-b823a41b60c1}', - intType: IntType.uint8) + tIntType: IntType.uint8) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensoruint16bit.dart b/packages/windows_ai/lib/src/machinelearning/itensoruint16bit.dart index 0c5799db..9d0730f4 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensoruint16bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensoruint16bit.dart @@ -42,7 +42,7 @@ class ITensorUInt16Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{ecfa9a6f-fa2e-5345-b297-efb4e8c6be87}', - intType: IntType.uint16) + tIntType: IntType.uint16) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensoruint32bit.dart b/packages/windows_ai/lib/src/machinelearning/itensoruint32bit.dart index 91355ae6..f854832c 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensoruint32bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensoruint32bit.dart @@ -42,7 +42,7 @@ class ITensorUInt32Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{421d4b91-b13b-5f37-ae54-b5249bd80539}', - intType: IntType.uint32) + tIntType: IntType.uint32) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensoruint64bit.dart b/packages/windows_ai/lib/src/machinelearning/itensoruint64bit.dart index 1623b840..ca34c9f9 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensoruint64bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensoruint64bit.dart @@ -42,7 +42,7 @@ class ITensorUInt64Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{4b3a3229-7995-5f3c-b248-6c1f7e664f01}', - intType: IntType.uint64) + tIntType: IntType.uint64) .toList(); } } diff --git a/packages/windows_ai/lib/src/machinelearning/itensoruint8bit.dart b/packages/windows_ai/lib/src/machinelearning/itensoruint8bit.dart index 1ecfef46..20fb37f5 100644 --- a/packages/windows_ai/lib/src/machinelearning/itensoruint8bit.dart +++ b/packages/windows_ai/lib/src/machinelearning/itensoruint8bit.dart @@ -42,7 +42,7 @@ class ITensorUInt8Bit extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{88318266-f3fd-50fc-8f08-b823a41b60c1}', - intType: IntType.uint8) + tIntType: IntType.uint8) .toList(); } } diff --git a/packages/windows_ai/test/collections_test.dart b/packages/windows_ai/test/collections_test.dart index c1a3741c..65ef2d46 100644 --- a/packages/windows_ai/test/collections_test.dart +++ b/packages/windows_ai/test/collections_test.dart @@ -39,7 +39,7 @@ void main() { return IVectorView.fromPtr(retValuePtr, iterableIid: '{b01bee51-063a-5fda-bd72-d76637bb8cb8}', - doubleType: DoubleType.float); + tDoubleType: DoubleType.float); } IVectorView getVectorView() { diff --git a/packages/windows_applicationmodel/lib/src/ipackage.dart b/packages/windows_applicationmodel/lib/src/ipackage.dart index 2cdd6d31..aa2c9ae9 100644 --- a/packages/windows_applicationmodel/lib/src/ipackage.dart +++ b/packages/windows_applicationmodel/lib/src/ipackage.dart @@ -107,7 +107,7 @@ class IPackage extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{69ad6aa7-0c49-5f27-a5eb-ef4d59467b6d}', - creator: Package.fromPtr) + tObjectCreator: Package.fromPtr) .toList(); } } diff --git a/packages/windows_applicationmodel/lib/src/ipackage3.dart b/packages/windows_applicationmodel/lib/src/ipackage3.dart index a57c89eb..1cdb1535 100644 --- a/packages/windows_applicationmodel/lib/src/ipackage3.dart +++ b/packages/windows_applicationmodel/lib/src/ipackage3.dart @@ -81,9 +81,9 @@ class IPackage3 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: AppListEntry.fromPtr, - iterableIid: '{86f4d4ef-d8fd-5fb5-807c-72da8fc9e544}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{86f4d4ef-d8fd-5fb5-807c-72da8fc9e544}', + tObjectCreator: AppListEntry.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } } diff --git a/packages/windows_applicationmodel/lib/src/ipackage5.dart b/packages/windows_applicationmodel/lib/src/ipackage5.dart index 6f69a7d8..cbaadd63 100644 --- a/packages/windows_applicationmodel/lib/src/ipackage5.dart +++ b/packages/windows_applicationmodel/lib/src/ipackage5.dart @@ -44,9 +44,9 @@ class IPackage5 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(operation, - creator: (ptr) => IVector.fromPtr(ptr, - creator: PackageContentGroup.fromPtr, - iterableIid: '{d7dd1456-4805-5768-a25d-99641b096491}')); + tResultObjectCreator: (ptr) => IVector.fromPtr(ptr, + iterableIid: '{d7dd1456-4805-5768-a25d-99641b096491}', + tObjectCreator: PackageContentGroup.fromPtr)); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -65,7 +65,7 @@ class IPackage5 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: PackageContentGroup.fromPtr); + tResultObjectCreator: PackageContentGroup.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -84,9 +84,9 @@ class IPackage5 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(operation, - creator: (ptr) => IVector.fromPtr(ptr, - creator: PackageContentGroup.fromPtr, - iterableIid: '{d7dd1456-4805-5768-a25d-99641b096491}')); + tResultObjectCreator: (ptr) => IVector.fromPtr(ptr, + iterableIid: '{d7dd1456-4805-5768-a25d-99641b096491}', + tObjectCreator: PackageContentGroup.fromPtr)); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -106,9 +106,9 @@ class IPackage5 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(operation, - creator: (ptr) => IVector.fromPtr(ptr, - creator: PackageContentGroup.fromPtr, - iterableIid: '{d7dd1456-4805-5768-a25d-99641b096491}')); + tResultObjectCreator: (ptr) => IVector.fromPtr(ptr, + iterableIid: '{d7dd1456-4805-5768-a25d-99641b096491}', + tObjectCreator: PackageContentGroup.fromPtr)); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_applicationmodel/lib/src/ipackage6.dart b/packages/windows_applicationmodel/lib/src/ipackage6.dart index 57179af1..da1dc20b 100644 --- a/packages/windows_applicationmodel/lib/src/ipackage6.dart +++ b/packages/windows_applicationmodel/lib/src/ipackage6.dart @@ -65,7 +65,7 @@ class IPackage6 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: PackageUpdateAvailabilityResult.fromPtr); + tResultObjectCreator: PackageUpdateAvailabilityResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_applicationmodel/lib/src/ipackage8.dart b/packages/windows_applicationmodel/lib/src/ipackage8.dart index fe0851f1..8fcfeac5 100644 --- a/packages/windows_applicationmodel/lib/src/ipackage8.dart +++ b/packages/windows_applicationmodel/lib/src/ipackage8.dart @@ -225,7 +225,7 @@ class IPackage8 extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{86f4d4ef-d8fd-5fb5-807c-72da8fc9e544}', - creator: AppListEntry.fromPtr) + tObjectCreator: AppListEntry.fromPtr) .toList(); } diff --git a/packages/windows_applicationmodel/lib/src/ipackage9.dart b/packages/windows_applicationmodel/lib/src/ipackage9.dart index 01b0fcdb..ec3670d6 100644 --- a/packages/windows_applicationmodel/lib/src/ipackage9.dart +++ b/packages/windows_applicationmodel/lib/src/ipackage9.dart @@ -45,7 +45,7 @@ class IPackage9 extends IInspectable { return IVector.fromPtr(result, iterableIid: '{69ad6aa7-0c49-5f27-a5eb-ef4d59467b6d}', - creator: Package.fromPtr); + tObjectCreator: Package.fromPtr); } String get sourceUriSchemeName { diff --git a/packages/windows_data/lib/src/json/jsonarray.dart b/packages/windows_data/lib/src/json/jsonarray.dart index d6020169..748b6e81 100644 --- a/packages/windows_data/lib/src/json/jsonarray.dart +++ b/packages/windows_data/lib/src/json/jsonarray.dart @@ -86,8 +86,8 @@ class JsonArray extends IInspectable late final _iVector = IVector.fromPtr( toInterface('{d44662bc-dce3-59a8-9272-4b210f33908b}'), - creator: IJsonValue.fromPtr, - iterableIid: '{cb0492b6-4113-55cf-b2c5-99eb428ba493}'); + iterableIid: '{cb0492b6-4113-55cf-b2c5-99eb428ba493}', + tObjectCreator: IJsonValue.fromPtr); @override IJsonValue? getAt(int index) => _iVector.getAt(index); diff --git a/packages/windows_data/lib/src/json/jsonobject.dart b/packages/windows_data/lib/src/json/jsonobject.dart index 6b6e4228..3ed61ca4 100644 --- a/packages/windows_data/lib/src/json/jsonobject.dart +++ b/packages/windows_data/lib/src/json/jsonobject.dart @@ -97,8 +97,8 @@ class JsonObject extends IInspectable late final _iMap = IMap.fromPtr( toInterface('{c9d9a725-786b-5113-b4b7-9b61764c220b}'), - creator: IJsonValue.fromPtr, - iterableIid: '{dfabb6e1-0411-5a8f-aa87-354e7110f099}'); + iterableIid: '{dfabb6e1-0411-5a8f-aa87-354e7110f099}', + vObjectCreator: IJsonValue.fromPtr); @override IJsonValue? lookup(String key) => _iMap.lookup(key); diff --git a/packages/windows_data/lib/src/pdf/ipdfdocumentstatics.dart b/packages/windows_data/lib/src/pdf/ipdfdocumentstatics.dart index 42d9d05e..0bb6608f 100644 --- a/packages/windows_data/lib/src/pdf/ipdfdocumentstatics.dart +++ b/packages/windows_data/lib/src/pdf/ipdfdocumentstatics.dart @@ -44,7 +44,7 @@ class IPdfDocumentStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: PdfDocument.fromPtr); + tResultObjectCreator: PdfDocument.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -63,7 +63,7 @@ class IPdfDocumentStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: PdfDocument.fromPtr); + tResultObjectCreator: PdfDocument.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -81,7 +81,7 @@ class IPdfDocumentStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: PdfDocument.fromPtr); + tResultObjectCreator: PdfDocument.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -100,7 +100,7 @@ class IPdfDocumentStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: PdfDocument.fromPtr); + tResultObjectCreator: PdfDocument.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_data/lib/src/xml/dom/ixmldocumentstatics.dart b/packages/windows_data/lib/src/xml/dom/ixmldocumentstatics.dart index b5f3496e..4835a077 100644 --- a/packages/windows_data/lib/src/xml/dom/ixmldocumentstatics.dart +++ b/packages/windows_data/lib/src/xml/dom/ixmldocumentstatics.dart @@ -46,7 +46,7 @@ class IXmlDocumentStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: XmlDocument.fromPtr); + tResultObjectCreator: XmlDocument.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -68,7 +68,7 @@ class IXmlDocumentStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: XmlDocument.fromPtr); + tResultObjectCreator: XmlDocument.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -85,7 +85,7 @@ class IXmlDocumentStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: XmlDocument.fromPtr); + tResultObjectCreator: XmlDocument.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -104,7 +104,7 @@ class IXmlDocumentStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: XmlDocument.fromPtr); + tResultObjectCreator: XmlDocument.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_data/lib/src/xml/dom/ixmlnamednodemap.dart b/packages/windows_data/lib/src/xml/dom/ixmlnamednodemap.dart index e1256921..fdad135a 100644 --- a/packages/windows_data/lib/src/xml/dom/ixmlnamednodemap.dart +++ b/packages/windows_data/lib/src/xml/dom/ixmlnamednodemap.dart @@ -197,8 +197,8 @@ class IXmlNamedNodeMap extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{139d959e-e7b5-5cb6-a596-4b544478da9b}'), - creator: IXmlNode.fromPtr, - iterableIid: '{f1146ffc-8c92-56e8-93f1-711f86722633}'); + iterableIid: '{f1146ffc-8c92-56e8-93f1-711f86722633}', + tObjectCreator: IXmlNode.fromPtr); @override IXmlNode? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_data/lib/src/xml/dom/ixmlnodelist.dart b/packages/windows_data/lib/src/xml/dom/ixmlnodelist.dart index 79ca750c..4a51263d 100644 --- a/packages/windows_data/lib/src/xml/dom/ixmlnodelist.dart +++ b/packages/windows_data/lib/src/xml/dom/ixmlnodelist.dart @@ -69,8 +69,8 @@ class IXmlNodeList extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{139d959e-e7b5-5cb6-a596-4b544478da9b}'), - creator: IXmlNode.fromPtr, - iterableIid: '{f1146ffc-8c92-56e8-93f1-711f86722633}'); + iterableIid: '{f1146ffc-8c92-56e8-93f1-711f86722633}', + tObjectCreator: IXmlNode.fromPtr); @override IXmlNode? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_data/lib/src/xml/dom/xmlnamednodemap.dart b/packages/windows_data/lib/src/xml/dom/xmlnamednodemap.dart index ab1b4d92..036761de 100644 --- a/packages/windows_data/lib/src/xml/dom/xmlnamednodemap.dart +++ b/packages/windows_data/lib/src/xml/dom/xmlnamednodemap.dart @@ -57,8 +57,8 @@ class XmlNamedNodeMap extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{139d959e-e7b5-5cb6-a596-4b544478da9b}'), - creator: IXmlNode.fromPtr, - iterableIid: '{f1146ffc-8c92-56e8-93f1-711f86722633}'); + iterableIid: '{f1146ffc-8c92-56e8-93f1-711f86722633}', + tObjectCreator: IXmlNode.fromPtr); @override IXmlNode? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_data/lib/src/xml/dom/xmlnodelist.dart b/packages/windows_data/lib/src/xml/dom/xmlnodelist.dart index e1bbb292..c7c4825c 100644 --- a/packages/windows_data/lib/src/xml/dom/xmlnodelist.dart +++ b/packages/windows_data/lib/src/xml/dom/xmlnodelist.dart @@ -34,8 +34,8 @@ class XmlNodeList extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{139d959e-e7b5-5cb6-a596-4b544478da9b}'), - creator: IXmlNode.fromPtr, - iterableIid: '{f1146ffc-8c92-56e8-93f1-711f86722633}'); + iterableIid: '{f1146ffc-8c92-56e8-93f1-711f86722633}', + tObjectCreator: IXmlNode.fromPtr); @override IXmlNode? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_devices/lib/src/display/idisplaymonitorstatics.dart b/packages/windows_devices/lib/src/display/idisplaymonitorstatics.dart index 0aca8731..00afe085 100644 --- a/packages/windows_devices/lib/src/display/idisplaymonitorstatics.dart +++ b/packages/windows_devices/lib/src/display/idisplaymonitorstatics.dart @@ -60,7 +60,7 @@ class IDisplayMonitorStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: DisplayMonitor.fromPtr); + tResultObjectCreator: DisplayMonitor.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -78,7 +78,7 @@ class IDisplayMonitorStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: DisplayMonitor.fromPtr); + tResultObjectCreator: DisplayMonitor.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_devices/lib/src/enumeration/deviceinformationcollection.dart b/packages/windows_devices/lib/src/enumeration/deviceinformationcollection.dart index a483cc2c..b3e1e2d9 100644 --- a/packages/windows_devices/lib/src/enumeration/deviceinformationcollection.dart +++ b/packages/windows_devices/lib/src/enumeration/deviceinformationcollection.dart @@ -25,8 +25,8 @@ class DeviceInformationCollection extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{e170688f-3495-5bf6-aab5-9cac17e0f10f}'), - creator: DeviceInformation.fromPtr, - iterableIid: '{dd9f8a5d-ec98-5f4b-a3ea-9c8b5ad53c4b}'); + iterableIid: '{dd9f8a5d-ec98-5f4b-a3ea-9c8b5ad53c4b}', + tObjectCreator: DeviceInformation.fromPtr); @override DeviceInformation? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_devices/lib/src/enumeration/ideviceinformation.dart b/packages/windows_devices/lib/src/enumeration/ideviceinformation.dart index 4ef73fcd..fd6b7ebb 100644 --- a/packages/windows_devices/lib/src/enumeration/ideviceinformation.dart +++ b/packages/windows_devices/lib/src/enumeration/ideviceinformation.dart @@ -159,7 +159,7 @@ class IDeviceInformation extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncOp, - creator: DeviceThumbnail.fromPtr); + tResultObjectCreator: DeviceThumbnail.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -176,7 +176,7 @@ class IDeviceInformation extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncOp, - creator: DeviceThumbnail.fromPtr); + tResultObjectCreator: DeviceThumbnail.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_devices/lib/src/enumeration/ideviceinformationcustompairing.dart b/packages/windows_devices/lib/src/enumeration/ideviceinformationcustompairing.dart index 14549103..2539f7c7 100644 --- a/packages/windows_devices/lib/src/enumeration/ideviceinformationcustompairing.dart +++ b/packages/windows_devices/lib/src/enumeration/ideviceinformationcustompairing.dart @@ -52,7 +52,7 @@ class IDeviceInformationCustomPairing extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(result, - creator: DevicePairingResult.fromPtr); + tResultObjectCreator: DevicePairingResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -72,7 +72,7 @@ class IDeviceInformationCustomPairing extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(result, - creator: DevicePairingResult.fromPtr); + tResultObjectCreator: DevicePairingResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -101,7 +101,7 @@ class IDeviceInformationCustomPairing extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(result, - creator: DevicePairingResult.fromPtr); + tResultObjectCreator: DevicePairingResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_devices/lib/src/enumeration/ideviceinformationpairing.dart b/packages/windows_devices/lib/src/enumeration/ideviceinformationpairing.dart index f355eafa..f6903e7d 100644 --- a/packages/windows_devices/lib/src/enumeration/ideviceinformationpairing.dart +++ b/packages/windows_devices/lib/src/enumeration/ideviceinformationpairing.dart @@ -76,7 +76,7 @@ class IDeviceInformationPairing extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(result, - creator: DevicePairingResult.fromPtr); + tResultObjectCreator: DevicePairingResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -95,7 +95,7 @@ class IDeviceInformationPairing extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(result, - creator: DevicePairingResult.fromPtr); + tResultObjectCreator: DevicePairingResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_devices/lib/src/enumeration/ideviceinformationpairing2.dart b/packages/windows_devices/lib/src/enumeration/ideviceinformationpairing2.dart index 2a35fa2c..dc845d9a 100644 --- a/packages/windows_devices/lib/src/enumeration/ideviceinformationpairing2.dart +++ b/packages/windows_devices/lib/src/enumeration/ideviceinformationpairing2.dart @@ -89,7 +89,7 @@ class IDeviceInformationPairing2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(result, - creator: DevicePairingResult.fromPtr); + tResultObjectCreator: DevicePairingResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -107,7 +107,7 @@ class IDeviceInformationPairing2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( result, - creator: DeviceUnpairingResult.fromPtr); + tResultObjectCreator: DeviceUnpairingResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_devices/lib/src/enumeration/ideviceinformationstatics.dart b/packages/windows_devices/lib/src/enumeration/ideviceinformationstatics.dart index b8f10f52..ddc27012 100644 --- a/packages/windows_devices/lib/src/enumeration/ideviceinformationstatics.dart +++ b/packages/windows_devices/lib/src/enumeration/ideviceinformationstatics.dart @@ -47,7 +47,7 @@ class IDeviceInformationStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncOp, - creator: DeviceInformation.fromPtr); + tResultObjectCreator: DeviceInformation.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -69,7 +69,7 @@ class IDeviceInformationStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncOp, - creator: DeviceInformation.fromPtr); + tResultObjectCreator: DeviceInformation.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -87,7 +87,7 @@ class IDeviceInformationStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncOp, - creator: DeviceInformationCollection.fromPtr); + tResultObjectCreator: DeviceInformationCollection.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -106,7 +106,7 @@ class IDeviceInformationStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncOp, - creator: DeviceInformationCollection.fromPtr); + tResultObjectCreator: DeviceInformationCollection.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -125,7 +125,7 @@ class IDeviceInformationStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncOp, - creator: DeviceInformationCollection.fromPtr); + tResultObjectCreator: DeviceInformationCollection.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -149,7 +149,7 @@ class IDeviceInformationStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncOp, - creator: DeviceInformationCollection.fromPtr); + tResultObjectCreator: DeviceInformationCollection.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_devices/lib/src/enumeration/ideviceinformationstatics2.dart b/packages/windows_devices/lib/src/enumeration/ideviceinformationstatics2.dart index 05200599..fe72ae63 100644 --- a/packages/windows_devices/lib/src/enumeration/ideviceinformationstatics2.dart +++ b/packages/windows_devices/lib/src/enumeration/ideviceinformationstatics2.dart @@ -73,7 +73,7 @@ class IDeviceInformationStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncOp, - creator: DeviceInformation.fromPtr); + tResultObjectCreator: DeviceInformation.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -103,7 +103,7 @@ class IDeviceInformationStatics2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncOp, - creator: DeviceInformationCollection.fromPtr); + tResultObjectCreator: DeviceInformationCollection.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_devices/lib/src/enumeration/idevicepicker.dart b/packages/windows_devices/lib/src/enumeration/idevicepicker.dart index 1566f08c..7d3f2795 100644 --- a/packages/windows_devices/lib/src/enumeration/idevicepicker.dart +++ b/packages/windows_devices/lib/src/enumeration/idevicepicker.dart @@ -211,7 +211,7 @@ class IDevicePicker extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: DeviceInformation.fromPtr); + tResultObjectCreator: DeviceInformation.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -234,7 +234,7 @@ class IDevicePicker extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: DeviceInformation.fromPtr); + tResultObjectCreator: DeviceInformation.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_devices/lib/src/enumeration/idevicepickerfilter.dart b/packages/windows_devices/lib/src/enumeration/idevicepickerfilter.dart index 59d57fe2..8e6dc01c 100644 --- a/packages/windows_devices/lib/src/enumeration/idevicepickerfilter.dart +++ b/packages/windows_devices/lib/src/enumeration/idevicepickerfilter.dart @@ -49,7 +49,7 @@ class IDevicePickerFilter extends IInspectable { return IVector.fromPtr(value, iterableIid: '{47d4be05-58f1-522e-81c6-975eb4131bb9}', - enumCreator: DeviceClass.from); + tEnumCreator: DeviceClass.from); } IVector? get supportedDeviceSelectors { diff --git a/packages/windows_devices/lib/src/geolocation/igeolocator.dart b/packages/windows_devices/lib/src/geolocation/igeolocator.dart index f87f1f53..204d68e2 100644 --- a/packages/windows_devices/lib/src/geolocation/igeolocator.dart +++ b/packages/windows_devices/lib/src/geolocation/igeolocator.dart @@ -134,7 +134,7 @@ class IGeolocator extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: Geoposition.fromPtr); + tResultObjectCreator: Geoposition.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -153,7 +153,7 @@ class IGeolocator extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: Geoposition.fromPtr); + tResultObjectCreator: Geoposition.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_devices/lib/src/geolocation/igeolocatorstatics.dart b/packages/windows_devices/lib/src/geolocation/igeolocatorstatics.dart index 7fc670c3..9c230ae9 100644 --- a/packages/windows_devices/lib/src/geolocation/igeolocatorstatics.dart +++ b/packages/windows_devices/lib/src/geolocation/igeolocatorstatics.dart @@ -45,7 +45,7 @@ class IGeolocatorStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( result, - enumCreator: GeolocationAccessStatus.from); + tResultEnumCreator: GeolocationAccessStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -64,9 +64,9 @@ class IGeolocatorStatics extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( result, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: Geoposition.fromPtr, - iterableIid: '{135ed72d-75b1-5881-be41-6ffeaa202044}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{135ed72d-75b1-5881-be41-6ffeaa202044}', + tObjectCreator: Geoposition.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -86,9 +86,9 @@ class IGeolocatorStatics extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( result, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: Geoposition.fromPtr, - iterableIid: '{135ed72d-75b1-5881-be41-6ffeaa202044}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{135ed72d-75b1-5881-be41-6ffeaa202044}', + tObjectCreator: Geoposition.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } } diff --git a/packages/windows_devices/lib/src/power/ibatterystatics.dart b/packages/windows_devices/lib/src/power/ibatterystatics.dart index e39ec1b3..0fd534b8 100644 --- a/packages/windows_devices/lib/src/power/ibatterystatics.dart +++ b/packages/windows_devices/lib/src/power/ibatterystatics.dart @@ -62,8 +62,8 @@ class IBatteryStatics extends IInspectable { throwWindowsException(hr); } - final asyncOperation = - IAsyncOperation.fromPtr(result, creator: Battery.fromPtr); + final asyncOperation = IAsyncOperation.fromPtr(result, + tResultObjectCreator: Battery.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_foundation/lib/src/collections/iiterable.dart b/packages/windows_foundation/lib/src/collections/iiterable.dart index 7a576144..dcb49efb 100644 --- a/packages/windows_foundation/lib/src/collections/iiterable.dart +++ b/packages/windows_foundation/lib/src/collections/iiterable.dart @@ -15,11 +15,6 @@ import 'iiterator.dart'; /// Exposes an iterator that supports simple iteration over a collection of a /// specified type. interface class IIterable extends IInspectable { - final COMObjectCreator? _creator; - final EnumCreator? _enumCreator; - final DoubleType? _doubleType; - final IntType? _intType; - /// Creates an instance of [IIterable] from the given [ptr]. /// /// [T] must be of type `bool`, `DateTime`, `double`, `Duration`, `Guid`, @@ -27,55 +22,60 @@ interface class IIterable extends IInspectable { /// `StorageFile?`), `WinRTEnum` (e.g., `DeviceClass`), or `WinRTStruct` /// (e.g., `BasicGeoposition`). /// - /// [doubleType] must be specified if [T] is `double`. + /// [tDoubleType] must be specified if [T] is `double`. /// ```dart /// final iterable = - /// IIterable.fromPtr(ptr, doubleType: DoubleType.float); + /// IIterable.fromPtr(ptr, tDoubleType: DoubleType.float); /// ``` /// - /// [intType] must be specified if [T] is `int`. + /// [tIntType] must be specified if [T] is `int`. /// ```dart - /// final iterable = IIterable.fromPtr(ptr, intType: IntType.uint64); + /// final iterable = IIterable.fromPtr(ptr, tIntType: IntType.uint64); /// ``` /// - /// [creator] must be specified if [T] is `IInspectable?`. + /// [tObjectCreator] must be specified if [T] is `IInspectable?`. /// ```dart /// final iterable = IIterable.fromPtr(ptr, - /// creator: StorageFile.fromPtr); + /// tObjectCreator: StorageFile.fromPtr); /// ``` /// - /// [enumCreator] must be specified if [T] is `WinRTEnum`. + /// [tEnumCreator] must be specified if [T] is `WinRTEnum`. /// ```dart /// final iterable = IIterable.fromPtr(ptr, - /// enumCreator: DeviceClass.from); + /// tEnumCreator: DeviceClass.from); /// ``` IIterable.fromPtr( super.ptr, { - COMObjectCreator? creator, - EnumCreator? enumCreator, - DoubleType? doubleType, - IntType? intType, - }) : _creator = creator, - _enumCreator = enumCreator, - _doubleType = doubleType, - _intType = intType { - if (doubleType == null && this is IIterable) { - throw ArgumentError.notNull('doubleType'); + EnumCreator? tEnumCreator, + COMObjectCreator? tObjectCreator, + DoubleType? tDoubleType, + IntType? tIntType, + }) : _tEnumCreator = tEnumCreator, + _tObjectCreator = tObjectCreator, + _tDoubleType = tDoubleType, + _tIntType = tIntType { + if (tDoubleType == null && this is IIterable) { + throw ArgumentError.notNull('tDoubleType'); } - if (intType == null && this is IIterable) { - throw ArgumentError.notNull('intType'); + if (tIntType == null && this is IIterable) { + throw ArgumentError.notNull('tIntType'); } - if (creator == null && this is IIterable) { - throw ArgumentError.notNull('creator'); + if (tObjectCreator == null && this is IIterable) { + throw ArgumentError.notNull('tObjectCreator'); } - if (enumCreator == null && this is IIterable) { - throw ArgumentError.notNull('enumCreator'); + if (tEnumCreator == null && this is IIterable) { + throw ArgumentError.notNull('tEnumCreator'); } } + final EnumCreator? _tEnumCreator; + final COMObjectCreator? _tObjectCreator; + final DoubleType? _tDoubleType; + final IntType? _tIntType; + late final _IIterableVtbl __vtable = ptr.ref.vtable.cast<_IIterableVtbl>().ref; @@ -92,11 +92,13 @@ interface class IIterable extends IInspectable { throwWindowsException(hr); } - return IIterator.fromPtr(retValuePtr, - creator: _creator, - enumCreator: _enumCreator, - doubleType: _doubleType, - intType: _intType); + return IIterator.fromPtr( + retValuePtr, + tEnumCreator: _tEnumCreator, + tObjectCreator: _tObjectCreator, + tDoubleType: _tDoubleType, + tIntType: _tIntType, + ); } } diff --git a/packages/windows_foundation/lib/src/collections/iiterator.dart b/packages/windows_foundation/lib/src/collections/iiterator.dart index a06ce27a..176c6a95 100644 --- a/packages/windows_foundation/lib/src/collections/iiterator.dart +++ b/packages/windows_foundation/lib/src/collections/iiterator.dart @@ -25,7 +25,7 @@ part 'iiterator_part.dart'; /// Supports simple iteration over a collection. abstract interface class IIterator extends IInspectable { - IIterator(super.ptr); + IIterator(super.ptr, {DoubleType? tDoubleType, IntType? tIntType}); /// Creates an instance of [IIterator] from the given [ptr]. /// @@ -34,34 +34,34 @@ abstract interface class IIterator extends IInspectable { /// `StorageFile?`), `WinRTEnum` (e.g., `DeviceClass`), or `WinRTStruct` /// (e.g., `BasicGeoposition`). /// - /// [doubleType] must be specified if [T] is `double`. + /// [tDoubleType] must be specified if [T] is `double`. /// ```dart /// final iterator = - /// IIterator.fromPtr(ptr, doubleType: DoubleType.float); + /// IIterator.fromPtr(ptr, tDoubleType: DoubleType.float); /// ``` /// - /// [intType] must be specified if [T] is `int`. + /// [tIntType] must be specified if [T] is `int`. /// ```dart - /// final iterator = IIterator.fromPtr(ptr, intType: IntType.uint64); + /// final iterator = IIterator.fromPtr(ptr, tIntType: IntType.uint64); /// ``` /// - /// [creator] must be specified if [T] is `IInspectable?`. + /// [tObjectCreator] must be specified if [T] is `IInspectable?`. /// ```dart /// final iterator = IIterator.fromPtr(ptr, - /// creator: StorageFile.fromPtr); + /// tObjectCreator: StorageFile.fromPtr); /// ``` /// - /// [enumCreator] must be specified if [T] is `WinRTEnum`. + /// [tEnumCreator] must be specified if [T] is `WinRTEnum`. /// ```dart /// final iterator = IIterator.fromPtr(ptr, - /// enumCreator: DeviceClass.from); + /// tEnumCreator: DeviceClass.from); /// ``` factory IIterator.fromPtr( Pointer ptr, { - COMObjectCreator? creator, - EnumCreator? enumCreator, - DoubleType? doubleType, - IntType? intType, + EnumCreator? tEnumCreator, + COMObjectCreator? tObjectCreator, + DoubleType? tDoubleType, + IntType? tIntType, }) { if (T == bool) return _IIteratorBool.fromPtr(ptr) as IIterator; if (T == DateTime) return _IIteratorDateTime.fromPtr(ptr) as IIterator; @@ -69,44 +69,46 @@ abstract interface class IIterator extends IInspectable { if (T == Guid) return _IIteratorGuid.fromPtr(ptr) as IIterator; if (T == double) { - if (doubleType == null) throw ArgumentError.notNull('doubleType'); - final iterator = switch (doubleType) { - DoubleType.double => _IIteratorDouble.fromPtr(ptr), - DoubleType.float => _IIteratorFloat.fromPtr(ptr), + if (tDoubleType == null) throw ArgumentError.notNull('tDoubleType'); + final iterator = switch (tDoubleType) { + DoubleType.double => + _IIteratorDouble.fromPtr(ptr, tDoubleType: tDoubleType), + DoubleType.float => + _IIteratorFloat.fromPtr(ptr, tDoubleType: tDoubleType), }; return iterator as IIterator; } if (T == int) { - if (intType == null) throw ArgumentError.notNull('intType'); - final iterator = switch (intType) { - IntType.int16 => _IIteratorInt16.fromPtr(ptr), - IntType.int32 => _IIteratorInt32.fromPtr(ptr), - IntType.int64 => _IIteratorInt64.fromPtr(ptr), - IntType.uint8 => _IIteratorUint8.fromPtr(ptr), - IntType.uint16 => _IIteratorUint16.fromPtr(ptr), - IntType.uint32 => _IIteratorUint32.fromPtr(ptr), - IntType.uint64 => _IIteratorUint64.fromPtr(ptr) + if (tIntType == null) throw ArgumentError.notNull('tIntType'); + final iterator = switch (tIntType) { + IntType.int16 => _IIteratorInt16.fromPtr(ptr, tIntType: tIntType), + IntType.int32 => _IIteratorInt32.fromPtr(ptr, tIntType: tIntType), + IntType.int64 => _IIteratorInt64.fromPtr(ptr, tIntType: tIntType), + IntType.uint8 => _IIteratorUint8.fromPtr(ptr, tIntType: tIntType), + IntType.uint16 => _IIteratorUint16.fromPtr(ptr, tIntType: tIntType), + IntType.uint32 => _IIteratorUint32.fromPtr(ptr, tIntType: tIntType), + IntType.uint64 => _IIteratorUint64.fromPtr(ptr, tIntType: tIntType) }; return iterator as IIterator; } if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - return _IIteratorInspectable.fromPtr(ptr, creator: creator); + if (tObjectCreator == null) throw ArgumentError.notNull('tObjectCreator'); + return _IIteratorInspectable.fromPtr(ptr, tObjectCreator: tObjectCreator); } if (T == String) return _IIteratorString.fromPtr(ptr) as IIterator; if (isSubtype()) return _IIteratorUri.fromPtr(ptr) as IIterator; if (isSubtypeOfWinRTFlagsEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); - return _IIteratorWinRTFlagsEnum.fromPtr(ptr, enumCreator: enumCreator); + if (tEnumCreator == null) throw ArgumentError.notNull('tEnumCreator'); + return _IIteratorWinRTFlagsEnum.fromPtr(ptr, tEnumCreator: tEnumCreator); } if (isSubtypeOfWinRTEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); - return _IIteratorWinRTEnum.fromPtr(ptr, enumCreator: enumCreator); + if (tEnumCreator == null) throw ArgumentError.notNull('tEnumCreator'); + return _IIteratorWinRTEnum.fromPtr(ptr, tEnumCreator: tEnumCreator); } if (isNullableObjectType()) { diff --git a/packages/windows_foundation/lib/src/collections/iiterator_part.dart b/packages/windows_foundation/lib/src/collections/iiterator_part.dart index dca6903b..52b308be 100644 --- a/packages/windows_foundation/lib/src/collections/iiterator_part.dart +++ b/packages/windows_foundation/lib/src/collections/iiterator_part.dart @@ -439,7 +439,7 @@ final class __IIteratorDateTimeVtbl extends Struct { } final class _IIteratorDouble extends IIterator { - _IIteratorDouble.fromPtr(super.ptr); + _IIteratorDouble.fromPtr(super.ptr, {super.tDoubleType}); late final __IIteratorDoubleVtbl _vtable = ptr.ref.vtable.cast<__IIteratorDoubleVtbl>().ref; @@ -573,7 +573,7 @@ final class __IIteratorDurationVtbl extends Struct { } final class _IIteratorFloat extends IIterator { - _IIteratorFloat.fromPtr(super.ptr); + _IIteratorFloat.fromPtr(super.ptr, {super.tDoubleType}); late final __IIteratorFloatVtbl _vtable = ptr.ref.vtable.cast<__IIteratorFloatVtbl>().ref; @@ -781,7 +781,7 @@ final class __IIteratorGuidVtbl extends Struct { } final class _IIteratorInt16 extends IIterator { - _IIteratorInt16.fromPtr(super.ptr); + _IIteratorInt16.fromPtr(super.ptr, {super.tIntType}); late final __IIteratorInt16Vtbl _vtable = ptr.ref.vtable.cast<__IIteratorInt16Vtbl>().ref; @@ -848,7 +848,7 @@ final class __IIteratorInt16Vtbl extends Struct { } final class _IIteratorInt32 extends IIterator { - _IIteratorInt32.fromPtr(super.ptr); + _IIteratorInt32.fromPtr(super.ptr, {super.tIntType}); late final __IIteratorInt32Vtbl _vtable = ptr.ref.vtable.cast<__IIteratorInt32Vtbl>().ref; @@ -915,7 +915,7 @@ final class __IIteratorInt32Vtbl extends Struct { } final class _IIteratorInt64 extends IIterator { - _IIteratorInt64.fromPtr(super.ptr); + _IIteratorInt64.fromPtr(super.ptr, {super.tIntType}); late final __IIteratorInt64Vtbl _vtable = ptr.ref.vtable.cast<__IIteratorInt64Vtbl>().ref; @@ -1203,11 +1203,11 @@ final class __IIteratorNitRangeVtbl extends Struct { } final class _IIteratorInspectable extends IIterator { - _IIteratorInspectable.fromPtr(super.ptr, {required this.creator}); + _IIteratorInspectable.fromPtr(super.ptr, {required this.tObjectCreator}); late final __IIteratorInspectableVtbl _vtable = ptr.ref.vtable.cast<__IIteratorInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator tObjectCreator; @override T get current { @@ -1227,7 +1227,7 @@ final class _IIteratorInspectable extends IIterator { return null as T; } - return creator(retValuePtr); + return tObjectCreator(retValuePtr); } @override @@ -1245,7 +1245,7 @@ final class _IIteratorInspectable extends IIterator { return ( retValuePtr.value, - items: items.toList(creator, length: retValuePtr.value) + items: items.toList(tObjectCreator, length: retValuePtr.value) ); } finally { free(items); @@ -2213,7 +2213,7 @@ final class __IIteratorTextSegmentVtbl extends Struct { } final class _IIteratorUint8 extends IIterator { - _IIteratorUint8.fromPtr(super.ptr); + _IIteratorUint8.fromPtr(super.ptr, {super.tIntType}); late final __IIteratorUint8Vtbl _vtable = ptr.ref.vtable.cast<__IIteratorUint8Vtbl>().ref; @@ -2280,7 +2280,7 @@ final class __IIteratorUint8Vtbl extends Struct { } final class _IIteratorUint16 extends IIterator { - _IIteratorUint16.fromPtr(super.ptr); + _IIteratorUint16.fromPtr(super.ptr, {super.tIntType}); late final __IIteratorUint16Vtbl _vtable = ptr.ref.vtable.cast<__IIteratorUint16Vtbl>().ref; @@ -2347,7 +2347,7 @@ final class __IIteratorUint16Vtbl extends Struct { } final class _IIteratorUint32 extends IIterator { - _IIteratorUint32.fromPtr(super.ptr); + _IIteratorUint32.fromPtr(super.ptr, {super.tIntType}); late final __IIteratorUint32Vtbl _vtable = ptr.ref.vtable.cast<__IIteratorUint32Vtbl>().ref; @@ -2414,7 +2414,7 @@ final class __IIteratorUint32Vtbl extends Struct { } final class _IIteratorUint64 extends IIterator { - _IIteratorUint64.fromPtr(super.ptr); + _IIteratorUint64.fromPtr(super.ptr, {super.tIntType}); late final __IIteratorUint64Vtbl _vtable = ptr.ref.vtable.cast<__IIteratorUint64Vtbl>().ref; @@ -2555,11 +2555,11 @@ final class __IIteratorWindowIdVtbl extends Struct { } final class _IIteratorWinRTEnum extends IIterator { - _IIteratorWinRTEnum.fromPtr(super.ptr, {required this.enumCreator}); + _IIteratorWinRTEnum.fromPtr(super.ptr, {required this.tEnumCreator}); late final __IIteratorWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IIteratorWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T get current { @@ -2572,7 +2572,7 @@ final class _IIteratorWinRTEnum extends IIterator { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -2593,7 +2593,7 @@ final class _IIteratorWinRTEnum extends IIterator { return ( retValuePtr.value, - items: items.toEnumList(enumCreator, length: retValuePtr.value) + items: items.toEnumList(tEnumCreator, length: retValuePtr.value) ); } finally { free(items); @@ -2623,11 +2623,11 @@ final class __IIteratorWinRTEnumVtbl extends Struct { } final class _IIteratorWinRTFlagsEnum extends IIterator { - _IIteratorWinRTFlagsEnum.fromPtr(super.ptr, {required this.enumCreator}); + _IIteratorWinRTFlagsEnum.fromPtr(super.ptr, {required this.tEnumCreator}); late final __IIteratorWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IIteratorWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T get current { @@ -2640,7 +2640,7 @@ final class _IIteratorWinRTFlagsEnum extends IIterator { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -2661,7 +2661,7 @@ final class _IIteratorWinRTFlagsEnum extends IIterator { return ( retValuePtr.value, - items: items.toEnumList(enumCreator, length: retValuePtr.value) + items: items.toEnumList(tEnumCreator, length: retValuePtr.value) ); } finally { free(items); diff --git a/packages/windows_foundation/lib/src/collections/ikeyvaluepair.dart b/packages/windows_foundation/lib/src/collections/ikeyvaluepair.dart index f0f73654..4213861a 100644 --- a/packages/windows_foundation/lib/src/collections/ikeyvaluepair.dart +++ b/packages/windows_foundation/lib/src/collections/ikeyvaluepair.dart @@ -18,7 +18,13 @@ part 'ikeyvaluepair_part.dart'; /// two type parameters into one to satisfy the constraints of another generic /// interface. abstract interface class IKeyValuePair extends IInspectable { - IKeyValuePair(super.ptr); + IKeyValuePair( + super.ptr, { + DoubleType? kDoubleType, + IntType? kIntType, + DoubleType? vDoubleType, + IntType? vIntType, + }); /// Creates an instance of [IKeyValuePair] from the given [ptr]. /// @@ -28,37 +34,42 @@ abstract interface class IKeyValuePair extends IInspectable { /// [V] must be of type `Object?`, `String`, `IInspectable?` (e.g., /// `IJsonValue?`), or `WinRTEnum` (e.g., `ChatMessageStatus`). /// - /// [creator] must be specified if [V] is `IInspectable?`. - /// ```dart - /// final keyValuePair = IKeyValuePair.fromPtr - /// (ptr, creator: IJsonValue.fromPtr); - /// ``` - /// - /// [enumKeyCreator] must be specified if [K] is `WinRTEnum`. + /// [kEnumCreator] must be specified if [K] is `WinRTEnum`. /// ```dart /// final keyValuePair = /// IKeyValuePair.fromPtr - /// (ptr, enumKeyCreator: PedometerStepKind.from, - /// creator: PedometerReading.fromPtr); + /// (ptr, kEnumCreator: PedometerStepKind.from, + /// vObjectCreator: PedometerReading.fromPtr); /// ``` /// - /// [enumCreator] must be specified if [V] is `WinRTEnum`. + /// [vEnumCreator] must be specified if [V] is `WinRTEnum`. /// ```dart /// final keyValuePair = IKeyValuePair.fromPtr(ptr, - /// enumCreator: ChatMessageStatus.from); + /// vEnumCreator: ChatMessageStatus.from); + /// ``` + /// + /// [vObjectCreator] must be specified if [V] is `IInspectable?`. + /// ```dart + /// final keyValuePair = IKeyValuePair.fromPtr(ptr, + /// vObjectCreator: IJsonValue.fromPtr); /// ``` factory IKeyValuePair.fromPtr( Pointer ptr, { - COMObjectCreator? creator, - EnumCreator? enumKeyCreator, - EnumCreator? enumCreator, - IntType? intType, + EnumCreator? kEnumCreator, + IntType? kIntType, + EnumCreator? vEnumCreator, + COMObjectCreator? vObjectCreator, }) { if (K == Guid) { if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - return _IKeyValuePairGuidInspectable.fromPtr(ptr, creator: creator) - as IKeyValuePair; + if (vObjectCreator == null) { + throw ArgumentError.notNull('vObjectCreator'); + } + + return _IKeyValuePairGuidInspectable.fromPtr( + ptr, + vObjectCreator: vObjectCreator, + ) as IKeyValuePair; } if (isNullableObjectType()) { @@ -67,23 +78,23 @@ abstract interface class IKeyValuePair extends IInspectable { } if (K == int && isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - if (intType == null) throw ArgumentError.notNull('intType'); - final keyValuePair = switch (intType) { - IntType.int16 => - _IKeyValuePairInt16Inspectable.fromPtr(ptr, creator: creator), - IntType.int32 => - _IKeyValuePairInt32Inspectable.fromPtr(ptr, creator: creator), - IntType.int64 => - _IKeyValuePairInt64Inspectable.fromPtr(ptr, creator: creator), - IntType.uint8 => - _IKeyValuePairUint8Inspectable.fromPtr(ptr, creator: creator), - IntType.uint16 => - _IKeyValuePairUint16Inspectable.fromPtr(ptr, creator: creator), - IntType.uint32 => - _IKeyValuePairUint32Inspectable.fromPtr(ptr, creator: creator), - IntType.uint64 => - _IKeyValuePairUint64Inspectable.fromPtr(ptr, creator: creator) + if (vObjectCreator == null) throw ArgumentError.notNull('vObjectCreator'); + if (kIntType == null) throw ArgumentError.notNull('kIntType'); + final keyValuePair = switch (kIntType) { + IntType.int16 => _IKeyValuePairInt16Inspectable.fromPtr(ptr, + kIntType: kIntType, vObjectCreator: vObjectCreator), + IntType.int32 => _IKeyValuePairInt32Inspectable.fromPtr(ptr, + kIntType: kIntType, vObjectCreator: vObjectCreator), + IntType.int64 => _IKeyValuePairInt64Inspectable.fromPtr(ptr, + kIntType: kIntType, vObjectCreator: vObjectCreator), + IntType.uint8 => _IKeyValuePairUint8Inspectable.fromPtr(ptr, + kIntType: kIntType, vObjectCreator: vObjectCreator), + IntType.uint16 => _IKeyValuePairUint16Inspectable.fromPtr(ptr, + kIntType: kIntType, vObjectCreator: vObjectCreator), + IntType.uint32 => _IKeyValuePairUint32Inspectable.fromPtr(ptr, + kIntType: kIntType, vObjectCreator: vObjectCreator), + IntType.uint64 => _IKeyValuePairUint64Inspectable.fromPtr(ptr, + kIntType: kIntType, vObjectCreator: vObjectCreator) }; return keyValuePair as IKeyValuePair; } @@ -94,21 +105,24 @@ abstract interface class IKeyValuePair extends IInspectable { } if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - return _IKeyValuePairStringInspectable.fromPtr(ptr, creator: creator) - as IKeyValuePair; + if (vObjectCreator == null) { + throw ArgumentError.notNull('vObjectCreator'); + } + + return _IKeyValuePairStringInspectable.fromPtr(ptr, + vObjectCreator: vObjectCreator) as IKeyValuePair; } if (isSubtypeOfWinRTFlagsEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); + if (vEnumCreator == null) throw ArgumentError.notNull('vEnumCreator'); return _IKeyValuePairStringWinRTFlagsEnum.fromPtr(ptr, - enumCreator: enumCreator) as IKeyValuePair; + vEnumCreator: vEnumCreator) as IKeyValuePair; } if (isSubtypeOfWinRTEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); + if (vEnumCreator == null) throw ArgumentError.notNull('vEnumCreator'); return _IKeyValuePairStringWinRTEnum.fromPtr(ptr, - enumCreator: enumCreator) as IKeyValuePair; + vEnumCreator: vEnumCreator) as IKeyValuePair; } if (isNullableObjectType()) { @@ -117,16 +131,22 @@ abstract interface class IKeyValuePair extends IInspectable { } if (isSubtypeOfWinRTEnum() && isSubtypeOfInspectable()) { - if (enumKeyCreator == null) throw ArgumentError.notNull('enumKeyCreator'); - if (creator == null) throw ArgumentError.notNull('creator'); + if (kEnumCreator == null) throw ArgumentError.notNull('kEnumCreator'); + if (vObjectCreator == null) throw ArgumentError.notNull('vObjectCreator'); if (isSubtypeOfWinRTFlagsEnum()) { - return _IKeyValuePairWinRTFlagsEnumInspectable.fromPtr(ptr, - creator: creator, enumKeyCreator: enumKeyCreator); + return _IKeyValuePairWinRTFlagsEnumInspectable.fromPtr( + ptr, + kEnumCreator: kEnumCreator, + vObjectCreator: vObjectCreator, + ); } - return _IKeyValuePairWinRTEnumInspectable.fromPtr(ptr, - creator: creator, enumKeyCreator: enumKeyCreator); + return _IKeyValuePairWinRTEnumInspectable.fromPtr( + ptr, + kEnumCreator: kEnumCreator, + vObjectCreator: vObjectCreator, + ); } if (K == Uri && V == String) { diff --git a/packages/windows_foundation/lib/src/collections/ikeyvaluepair_part.dart b/packages/windows_foundation/lib/src/collections/ikeyvaluepair_part.dart index 40ae605a..61f277b6 100644 --- a/packages/windows_foundation/lib/src/collections/ikeyvaluepair_part.dart +++ b/packages/windows_foundation/lib/src/collections/ikeyvaluepair_part.dart @@ -10,11 +10,12 @@ part of 'ikeyvaluepair.dart'; final class _IKeyValuePairGuidInspectable extends IKeyValuePair { - _IKeyValuePairGuidInspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairGuidInspectable.fromPtr(super.ptr, + {required this.vObjectCreator}); late final __IKeyValuePairGuidInspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairGuidInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override Guid get key { @@ -51,7 +52,7 @@ final class _IKeyValuePairGuidInspectable extends IKeyValuePair { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -125,11 +126,12 @@ final class __IKeyValuePairGuidObjectVtbl extends Struct { } final class _IKeyValuePairInt16Inspectable extends IKeyValuePair { - _IKeyValuePairInt16Inspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairInt16Inspectable.fromPtr(super.ptr, + {super.kIntType, required this.vObjectCreator}); late final __IKeyValuePairInt16InspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairInt16InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override int get key { @@ -166,7 +168,7 @@ final class _IKeyValuePairInt16Inspectable extends IKeyValuePair { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -183,11 +185,12 @@ final class __IKeyValuePairInt16InspectableVtbl extends Struct { } final class _IKeyValuePairInt32Inspectable extends IKeyValuePair { - _IKeyValuePairInt32Inspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairInt32Inspectable.fromPtr(super.ptr, + {super.kIntType, required this.vObjectCreator}); late final __IKeyValuePairInt32InspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairInt32InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override int get key { @@ -224,7 +227,7 @@ final class _IKeyValuePairInt32Inspectable extends IKeyValuePair { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -241,11 +244,12 @@ final class __IKeyValuePairInt32InspectableVtbl extends Struct { } final class _IKeyValuePairInt64Inspectable extends IKeyValuePair { - _IKeyValuePairInt64Inspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairInt64Inspectable.fromPtr(super.ptr, + {super.kIntType, required this.vObjectCreator}); late final __IKeyValuePairInt64InspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairInt64InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override int get key { @@ -282,7 +286,7 @@ final class _IKeyValuePairInt64Inspectable extends IKeyValuePair { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -356,11 +360,12 @@ final class __IKeyValuePairObjectObjectVtbl extends Struct { final class _IKeyValuePairStringInspectable extends IKeyValuePair { - _IKeyValuePairStringInspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairStringInspectable.fromPtr(super.ptr, + {required this.vObjectCreator}); late final __IKeyValuePairStringInspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairStringInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override String get key { @@ -397,7 +402,7 @@ final class _IKeyValuePairStringInspectable return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -524,11 +529,12 @@ final class __IKeyValuePairStringStringVtbl extends Struct { } final class _IKeyValuePairStringWinRTEnum extends IKeyValuePair { - _IKeyValuePairStringWinRTEnum.fromPtr(super.ptr, {required this.enumCreator}); + _IKeyValuePairStringWinRTEnum.fromPtr(super.ptr, + {required this.vEnumCreator}); late final __IKeyValuePairStringWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairStringWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator vEnumCreator; @override String get key { @@ -558,7 +564,7 @@ final class _IKeyValuePairStringWinRTEnum extends IKeyValuePair { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return vEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -580,11 +586,11 @@ final class __IKeyValuePairStringWinRTEnumVtbl extends Struct { final class _IKeyValuePairStringWinRTFlagsEnum extends IKeyValuePair { _IKeyValuePairStringWinRTFlagsEnum.fromPtr(super.ptr, - {required this.enumCreator}); + {required this.vEnumCreator}); late final __IKeyValuePairStringWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairStringWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator vEnumCreator; @override String get key { @@ -614,7 +620,7 @@ final class _IKeyValuePairStringWinRTFlagsEnum if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return vEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -634,11 +640,12 @@ final class __IKeyValuePairStringWinRTFlagsEnumVtbl extends Struct { } final class _IKeyValuePairUint8Inspectable extends IKeyValuePair { - _IKeyValuePairUint8Inspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairUint8Inspectable.fromPtr(super.ptr, + {super.kIntType, required this.vObjectCreator}); late final __IKeyValuePairUint8InspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairUint8InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override int get key { @@ -675,7 +682,7 @@ final class _IKeyValuePairUint8Inspectable extends IKeyValuePair { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -692,11 +699,12 @@ final class __IKeyValuePairUint8InspectableVtbl extends Struct { } final class _IKeyValuePairUint16Inspectable extends IKeyValuePair { - _IKeyValuePairUint16Inspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairUint16Inspectable.fromPtr(super.ptr, + {super.kIntType, required this.vObjectCreator}); late final __IKeyValuePairUint16InspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairUint16InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override int get key { @@ -733,7 +741,7 @@ final class _IKeyValuePairUint16Inspectable extends IKeyValuePair { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -750,11 +758,12 @@ final class __IKeyValuePairUint16InspectableVtbl extends Struct { } final class _IKeyValuePairUint32Inspectable extends IKeyValuePair { - _IKeyValuePairUint32Inspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairUint32Inspectable.fromPtr(super.ptr, + {super.kIntType, required this.vObjectCreator}); late final __IKeyValuePairUint32InspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairUint32InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override int get key { @@ -791,7 +800,7 @@ final class _IKeyValuePairUint32Inspectable extends IKeyValuePair { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -808,11 +817,12 @@ final class __IKeyValuePairUint32InspectableVtbl extends Struct { } final class _IKeyValuePairUint64Inspectable extends IKeyValuePair { - _IKeyValuePairUint64Inspectable.fromPtr(super.ptr, {required this.creator}); + _IKeyValuePairUint64Inspectable.fromPtr(super.ptr, + {super.kIntType, required this.vObjectCreator}); late final __IKeyValuePairUint64InspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairUint64InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override int get key { @@ -849,7 +859,7 @@ final class _IKeyValuePairUint64Inspectable extends IKeyValuePair { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -920,12 +930,12 @@ final class __IKeyValuePairUriStringVtbl extends Struct { final class _IKeyValuePairWinRTEnumInspectable extends IKeyValuePair { _IKeyValuePairWinRTEnumInspectable.fromPtr(super.ptr, - {required this.enumKeyCreator, required this.creator}); + {required this.kEnumCreator, required this.vObjectCreator}); late final __IKeyValuePairWinRTEnumInspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairWinRTEnumInspectableVtbl>().ref; - final EnumCreator enumKeyCreator; - final COMObjectCreator creator; + final EnumCreator kEnumCreator; + final COMObjectCreator vObjectCreator; @override K get key { @@ -938,7 +948,7 @@ final class _IKeyValuePairWinRTEnumInspectable if (FAILED(hr)) throwWindowsException(hr); - return enumKeyCreator(retValuePtr.value); + return kEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -962,7 +972,7 @@ final class _IKeyValuePairWinRTEnumInspectable return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } @@ -981,12 +991,12 @@ final class __IKeyValuePairWinRTEnumInspectableVtbl extends Struct { final class _IKeyValuePairWinRTFlagsEnumInspectable extends IKeyValuePair { _IKeyValuePairWinRTFlagsEnumInspectable.fromPtr(super.ptr, - {required this.enumKeyCreator, required this.creator}); + {required this.kEnumCreator, required this.vObjectCreator}); late final __IKeyValuePairWinRTFlagsEnumInspectableVtbl _vtable = ptr.ref.vtable.cast<__IKeyValuePairWinRTFlagsEnumInspectableVtbl>().ref; - final EnumCreator enumKeyCreator; - final COMObjectCreator creator; + final EnumCreator kEnumCreator; + final COMObjectCreator vObjectCreator; @override K get key { @@ -999,7 +1009,7 @@ final class _IKeyValuePairWinRTFlagsEnumInspectable if (FAILED(hr)) throwWindowsException(hr); - return enumKeyCreator(retValuePtr.value); + return kEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -1023,7 +1033,7 @@ final class _IKeyValuePairWinRTFlagsEnumInspectable return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } } diff --git a/packages/windows_foundation/lib/src/collections/imap.dart b/packages/windows_foundation/lib/src/collections/imap.dart index 1e8a7d20..baed23d3 100644 --- a/packages/windows_foundation/lib/src/collections/imap.dart +++ b/packages/windows_foundation/lib/src/collections/imap.dart @@ -26,28 +26,30 @@ abstract interface class IMap extends IInspectable IMap( super.ptr, { required String iterableIid, - COMObjectCreator? creator, - EnumCreator? enumKeyCreator, - EnumCreator? enumCreator, - IntType? intType, - }) : _creator = creator, - _enumKeyCreator = enumKeyCreator, - _enumCreator = enumCreator, - _iterableIid = iterableIid, - _intType = intType { - _iterableCreator = (ptr) => IKeyValuePair.fromPtr(ptr, - creator: creator, - enumKeyCreator: enumKeyCreator, - enumCreator: enumCreator, - intType: intType); + EnumCreator? kEnumCreator, + IntType? kIntType, + EnumCreator? vEnumCreator, + COMObjectCreator? vObjectCreator, + }) : _iterableIid = iterableIid, + _kEnumCreator = kEnumCreator, + _kIntType = kIntType, + _vEnumCreator = vEnumCreator, + _vObjectCreator = vObjectCreator { + _iterableCreator = (ptr) => IKeyValuePair.fromPtr( + ptr, + kEnumCreator: kEnumCreator, + kIntType: kIntType, + vEnumCreator: vEnumCreator, + vObjectCreator: vObjectCreator, + ); } final String _iterableIid; - final COMObjectCreator? _creator; - final EnumCreator? _enumCreator; - final EnumCreator? _enumKeyCreator; + final EnumCreator? _kEnumCreator; + final EnumCreator? _vEnumCreator; + final IntType? _kIntType; + final COMObjectCreator? _vObjectCreator; late final COMObjectCreator>? _iterableCreator; - final IntType? _intType; /// Creates an empty [IMap]. /// @@ -98,32 +100,38 @@ abstract interface class IMap extends IInspectable /// [V] must be of type `Object?`, `String`, `IInspectable?` (e.g., /// `IJsonValue?`), or `WinRTEnum` (e.g., `ChatMessageStatus`). /// - /// [creator] must be specified if [V] is a `IInspectable?`. + /// [vObjectCreator] must be specified if [V] is a `IInspectable?`. /// ```dart /// final map = IMap.fromPtr(ptr, - /// creator: IJsonValue.fromPtr, - /// iterableIid: '{dfabb6e1-0411-5a8f-aa87-354e7110f099}'); + /// iterableIid: '{dfabb6e1-0411-5a8f-aa87-354e7110f099}', + /// vObjectCreator: IJsonValue.fromPtr); /// ``` /// - /// [enumCreator] must be specified if [V] is `WinRTEnum`. + /// [vEnumCreator] must be specified if [V] is `WinRTEnum`. /// ```dart /// final map = IMap.fromPtr(ptr, - /// enumCreator: ChatMessageStatus.from, - /// iterableIid: '{57d87c13-48e9-546f-9b4e-a3906e1e7c24}'); + /// iterableIid: '{57d87c13-48e9-546f-9b4e-a3906e1e7c24}', + /// vEnumCreator: ChatMessageStatus.from); /// ``` factory IMap.fromPtr( Pointer ptr, { required String iterableIid, - COMObjectCreator? creator, - EnumCreator? enumKeyCreator, - EnumCreator? enumCreator, - IntType? intType, + EnumCreator? kEnumCreator, + IntType? kIntType, + EnumCreator? vEnumCreator, + COMObjectCreator? vObjectCreator, }) { if (K == Guid) { if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - return _IMapGuidInspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid) as IMap; + if (vObjectCreator == null) { + throw ArgumentError.notNull('vObjectCreator'); + } + + return _IMapGuidInspectable.fromPtr( + ptr, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ) as IMap; } if (isNullableObjectType()) { @@ -133,23 +141,51 @@ abstract interface class IMap extends IInspectable } if (K == int && isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - if (intType == null) throw ArgumentError.notNull('intType'); - final map = switch (intType) { - IntType.int16 => _IMapInt16Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.int32 => _IMapInt32Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.int64 => _IMapInt64Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.uint8 => _IMapUint8Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.uint16 => _IMapUint16Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.uint32 => _IMapUint32Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.uint64 => _IMapUint64Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid) + if (vObjectCreator == null) throw ArgumentError.notNull('vObjectCreator'); + if (kIntType == null) throw ArgumentError.notNull('kIntType'); + final map = switch (kIntType) { + IntType.int16 => _IMapInt16Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.int32 => _IMapInt32Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.int64 => _IMapInt64Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.uint8 => _IMapUint8Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.uint16 => _IMapUint16Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.uint32 => _IMapUint32Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.uint64 => _IMapUint64Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ) }; return map as IMap; } @@ -161,21 +197,25 @@ abstract interface class IMap extends IInspectable } if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); + if (vObjectCreator == null) { + throw ArgumentError.notNull('vObjectCreator'); + } + return _IMapStringInspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid) as IMap; + vObjectCreator: vObjectCreator, + iterableIid: iterableIid) as IMap; } if (isSubtypeOfWinRTFlagsEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); + if (vEnumCreator == null) throw ArgumentError.notNull('VEnumCreator'); return _IMapStringWinRTFlagsEnum.fromPtr(ptr, - enumCreator: enumCreator, iterableIid: iterableIid) as IMap; + vEnumCreator: vEnumCreator, iterableIid: iterableIid) as IMap; } if (isSubtypeOfWinRTEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); + if (vEnumCreator == null) throw ArgumentError.notNull('vEnumCreator'); return _IMapStringWinRTEnum.fromPtr(ptr, - enumCreator: enumCreator, iterableIid: iterableIid) as IMap; + vEnumCreator: vEnumCreator, iterableIid: iterableIid) as IMap; } if (isNullableObjectType()) { @@ -185,20 +225,24 @@ abstract interface class IMap extends IInspectable } if (isSubtypeOfWinRTEnum() && isSubtypeOfInspectable()) { - if (enumKeyCreator == null) throw ArgumentError.notNull('enumKeyCreator'); - if (creator == null) throw ArgumentError.notNull('creator'); + if (kEnumCreator == null) throw ArgumentError.notNull('kEnumCreator'); + if (vObjectCreator == null) throw ArgumentError.notNull('vObjectCreator'); if (isSubtypeOfWinRTFlagsEnum()) { - return _IMapWinRTFlagsEnumInspectable.fromPtr(ptr, - creator: creator, - enumKeyCreator: enumKeyCreator, - iterableIid: iterableIid); + return _IMapWinRTFlagsEnumInspectable.fromPtr( + ptr, + kEnumCreator: kEnumCreator, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ); } - return _IMapWinRTEnumInspectable.fromPtr(ptr, - creator: creator, - enumKeyCreator: enumKeyCreator, - iterableIid: iterableIid); + return _IMapWinRTEnumInspectable.fromPtr( + ptr, + kEnumCreator: kEnumCreator, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ); } if (K == Uri && V == String) { @@ -253,10 +297,10 @@ abstract interface class IMap extends IInspectable } final mapView = IMapView.fromPtr(retValuePtr, - creator: _creator, - enumKeyCreator: _enumKeyCreator, - enumCreator: _enumCreator, - intType: _intType, + vObjectCreator: _vObjectCreator, + kEnumCreator: _kEnumCreator, + vEnumCreator: _vEnumCreator, + kIntType: _kIntType, iterableIid: _iterableIid); return mapView.toMap(); } @@ -277,7 +321,7 @@ abstract interface class IMap extends IInspectable late final _iIterable = IIterable>.fromPtr( toInterface(_iterableIid), - creator: _iterableCreator); + tObjectCreator: _iterableCreator); @override IIterator> first() => _iIterable.first(); diff --git a/packages/windows_foundation/lib/src/collections/imap_part.dart b/packages/windows_foundation/lib/src/collections/imap_part.dart index 2e0da70d..f22d62ae 100644 --- a/packages/windows_foundation/lib/src/collections/imap_part.dart +++ b/packages/windows_foundation/lib/src/collections/imap_part.dart @@ -11,12 +11,12 @@ part of 'imap.dart'; final class _IMapGuidInspectable extends IMap { _IMapGuidInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapGuidInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapGuidInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(Guid key) { @@ -40,7 +40,7 @@ final class _IMapGuidInspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -250,12 +250,14 @@ final class __IMapGuidObjectVtbl extends Struct { final class _IMapInt16Inspectable extends IMap { _IMapInt16Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapInt16InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapInt16InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -275,7 +277,7 @@ final class _IMapInt16Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -353,12 +355,14 @@ final class __IMapInt16InspectableVtbl extends Struct { final class _IMapInt32Inspectable extends IMap { _IMapInt32Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapInt32InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapInt32InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -378,7 +382,7 @@ final class _IMapInt32Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -456,12 +460,14 @@ final class __IMapInt32InspectableVtbl extends Struct { final class _IMapInt64Inspectable extends IMap { _IMapInt64Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapInt64InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapInt64InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -481,7 +487,7 @@ final class _IMapInt64Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -665,12 +671,12 @@ final class __IMapObjectObjectVtbl extends Struct { final class _IMapStringInspectable extends IMap { _IMapStringInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapStringInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapStringInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(String key) { @@ -691,7 +697,7 @@ final class _IMapStringInspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -973,12 +979,12 @@ final class __IMapStringStringVtbl extends Struct { final class _IMapStringWinRTEnum extends IMap { _IMapStringWinRTEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.vEnumCreator}) + : super(vEnumCreator: vEnumCreator); late final __IMapStringWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IMapStringWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator vEnumCreator; @override V lookup(String key) { @@ -992,7 +998,7 @@ final class _IMapStringWinRTEnum extends IMap { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return vEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -1075,12 +1081,12 @@ final class __IMapStringWinRTEnumVtbl extends Struct { final class _IMapStringWinRTFlagsEnum extends IMap { _IMapStringWinRTFlagsEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.vEnumCreator}) + : super(vEnumCreator: vEnumCreator); late final __IMapStringWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IMapStringWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator vEnumCreator; @override V lookup(String key) { @@ -1094,7 +1100,7 @@ final class _IMapStringWinRTFlagsEnum extends IMap { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return vEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -1177,12 +1183,14 @@ final class __IMapStringWinRTFlagsEnumVtbl extends Struct { final class _IMapUint8Inspectable extends IMap { _IMapUint8Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapUint8InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapUint8InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1202,7 +1210,7 @@ final class _IMapUint8Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1280,12 +1288,14 @@ final class __IMapUint8InspectableVtbl extends Struct { final class _IMapUint16Inspectable extends IMap { _IMapUint16Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapUint16InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapUint16InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1305,7 +1315,7 @@ final class _IMapUint16Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1384,12 +1394,14 @@ final class __IMapUint16InspectableVtbl extends Struct { final class _IMapUint32Inspectable extends IMap { _IMapUint32Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapUint32InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapUint32InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1409,7 +1421,7 @@ final class _IMapUint32Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1488,12 +1500,14 @@ final class __IMapUint32InspectableVtbl extends Struct { final class _IMapUint64Inspectable extends IMap { _IMapUint64Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapUint64InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapUint64InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1513,7 +1527,7 @@ final class _IMapUint64Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1692,14 +1706,14 @@ final class __IMapUriStringVtbl extends Struct { final class _IMapWinRTEnumInspectable extends IMap { _IMapWinRTEnumInspectable.fromPtr(super.ptr, {required super.iterableIid, - required this.enumKeyCreator, - required this.creator}) - : super(enumKeyCreator: enumKeyCreator, creator: creator); + required this.kEnumCreator, + required this.vObjectCreator}) + : super(kEnumCreator: kEnumCreator, vObjectCreator: vObjectCreator); late final __IMapWinRTEnumInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapWinRTEnumInspectableVtbl>().ref; - final EnumCreator enumKeyCreator; - final COMObjectCreator creator; + final EnumCreator kEnumCreator; + final COMObjectCreator vObjectCreator; @override V lookup(K key) { @@ -1720,7 +1734,7 @@ final class _IMapWinRTEnumInspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1804,14 +1818,14 @@ final class __IMapWinRTEnumInspectableVtbl extends Struct { final class _IMapWinRTFlagsEnumInspectable extends IMap { _IMapWinRTFlagsEnumInspectable.fromPtr(super.ptr, {required super.iterableIid, - required this.enumKeyCreator, - required this.creator}) - : super(enumKeyCreator: enumKeyCreator, creator: creator); + required this.kEnumCreator, + required this.vObjectCreator}) + : super(kEnumCreator: kEnumCreator, vObjectCreator: vObjectCreator); late final __IMapWinRTFlagsEnumInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapWinRTFlagsEnumInspectableVtbl>().ref; - final EnumCreator enumKeyCreator; - final COMObjectCreator creator; + final EnumCreator kEnumCreator; + final COMObjectCreator vObjectCreator; @override V lookup(K key) { @@ -1832,7 +1846,7 @@ final class _IMapWinRTFlagsEnumInspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override diff --git a/packages/windows_foundation/lib/src/collections/imapview.dart b/packages/windows_foundation/lib/src/collections/imapview.dart index d859ad76..5d82fd6f 100644 --- a/packages/windows_foundation/lib/src/collections/imapview.dart +++ b/packages/windows_foundation/lib/src/collections/imapview.dart @@ -22,27 +22,29 @@ abstract interface class IMapView extends IInspectable IMapView( super.ptr, { required String iterableIid, - COMObjectCreator? creator, - EnumCreator? enumKeyCreator, - EnumCreator? enumCreator, - IntType? intType, + EnumCreator? kEnumCreator, + IntType? kIntType, + EnumCreator? vEnumCreator, + COMObjectCreator? vObjectCreator, }) : _iterableIid = iterableIid, - _creator = creator, - _enumKeyCreator = enumKeyCreator, - _enumCreator = enumCreator, - _intType = intType { - _iterableCreator = (ptr) => IKeyValuePair.fromPtr(ptr, - creator: creator, - enumKeyCreator: enumKeyCreator, - enumCreator: enumCreator, - intType: intType); + _kEnumCreator = kEnumCreator, + _kIntType = kIntType, + _vEnumCreator = vEnumCreator, + _vObjectCreator = vObjectCreator { + _iterableCreator = (ptr) => IKeyValuePair.fromPtr( + ptr, + kEnumCreator: kEnumCreator, + kIntType: kIntType, + vEnumCreator: vEnumCreator, + vObjectCreator: vObjectCreator, + ); } final String _iterableIid; - final COMObjectCreator? _creator; - final EnumCreator? _enumKeyCreator; - final EnumCreator? _enumCreator; - final IntType? _intType; + final EnumCreator? _kEnumCreator; + final IntType? _kIntType; + final EnumCreator? _vEnumCreator; + final COMObjectCreator? _vObjectCreator; late final COMObjectCreator>? _iterableCreator; /// Creates an instance of [IMapView] from the given [ptr] and [iterableIid]. @@ -56,32 +58,38 @@ abstract interface class IMapView extends IInspectable /// [V] must be of type `Object?`, `String`, `IInspectable?` (e.g., /// `IJsonValue?`), or `WinRTEnum` (e.g., `ChatMessageStatus`). /// - /// [creator] must be specified if [V] is `IInspectable?`. + /// [vObjectCreator] must be specified if [V] is `IInspectable?`. /// ```dart /// final mapView = IMapView.fromPtr(ptr, - /// creator: IJsonValue.fromPtr, - /// iterableIid: '{dfabb6e1-0411-5a8f-aa87-354e7110f099}'); + /// iterableIid: '{dfabb6e1-0411-5a8f-aa87-354e7110f099}', + /// vObjectCreator: IJsonValue.fromPtr); /// ``` /// - /// [enumCreator] must be specified if [V] is `WinRTEnum`. + /// [vEnumCreator] must be specified if [V] is `WinRTEnum`. /// ```dart /// final mapView = IMapView.fromPtr(ptr, - /// enumCreator: ChatMessageStatus.from, - /// iterableIid: '{57d87c13-48e9-546f-9b4e-a3906e1e7c24}'); + /// iterableIid: '{57d87c13-48e9-546f-9b4e-a3906e1e7c24}', + /// vEnumCreator: ChatMessageStatus.from); /// ``` factory IMapView.fromPtr( Pointer ptr, { required String iterableIid, - COMObjectCreator? creator, - EnumCreator? enumKeyCreator, - EnumCreator? enumCreator, - IntType? intType, + EnumCreator? kEnumCreator, + IntType? kIntType, + EnumCreator? vEnumCreator, + COMObjectCreator? vObjectCreator, }) { if (K == Guid) { if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - return _IMapViewGuidInspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid) as IMapView; + if (vObjectCreator == null) { + throw ArgumentError.notNull('vObjectCreator'); + } + + return _IMapViewGuidInspectable.fromPtr( + ptr, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ) as IMapView; } if (isNullableObjectType()) { @@ -91,23 +99,51 @@ abstract interface class IMapView extends IInspectable } if (K == int && isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - if (intType == null) throw ArgumentError.notNull('intType'); - final mapView = switch (intType) { - IntType.int16 => _IMapViewInt16Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.int32 => _IMapViewInt32Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.int64 => _IMapViewInt64Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.uint8 => _IMapViewUint8Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.uint16 => _IMapViewUint16Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.uint32 => _IMapViewUint32Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid), - IntType.uint64 => _IMapViewUint64Inspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid) + if (vObjectCreator == null) throw ArgumentError.notNull('vObjectCreator'); + if (kIntType == null) throw ArgumentError.notNull('kIntType'); + final mapView = switch (kIntType) { + IntType.int16 => _IMapViewInt16Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.int32 => _IMapViewInt32Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.int64 => _IMapViewInt64Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.uint8 => _IMapViewUint8Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.uint16 => _IMapViewUint16Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.uint32 => _IMapViewUint32Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ), + IntType.uint64 => _IMapViewUint64Inspectable.fromPtr( + ptr, + kIntType: kIntType, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ) }; return mapView as IMapView; } @@ -119,23 +155,33 @@ abstract interface class IMapView extends IInspectable } if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - return _IMapViewStringInspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid) as IMapView; + if (vObjectCreator == null) { + throw ArgumentError.notNull('vObjectCreator'); + } + + return _IMapViewStringInspectable.fromPtr( + ptr, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ) as IMapView; } if (isSubtypeOfWinRTFlagsEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); - return _IMapViewStringWinRTFlagsEnum.fromPtr(ptr, - enumCreator: enumCreator, - iterableIid: iterableIid) as IMapView; + if (vEnumCreator == null) throw ArgumentError.notNull('vEnumCreator'); + return _IMapViewStringWinRTFlagsEnum.fromPtr( + ptr, + vEnumCreator: vEnumCreator, + iterableIid: iterableIid, + ) as IMapView; } if (isSubtypeOfWinRTEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); - return _IMapViewStringWinRTEnum.fromPtr(ptr, - enumCreator: enumCreator, - iterableIid: iterableIid) as IMapView; + if (vEnumCreator == null) throw ArgumentError.notNull('vEnumCreator'); + return _IMapViewStringWinRTEnum.fromPtr( + ptr, + vEnumCreator: vEnumCreator, + iterableIid: iterableIid, + ) as IMapView; } if (isNullableObjectType()) { @@ -145,20 +191,24 @@ abstract interface class IMapView extends IInspectable } if (isSubtypeOfWinRTEnum() && isSubtypeOfInspectable()) { - if (enumKeyCreator == null) throw ArgumentError.notNull('enumKeyCreator'); - if (creator == null) throw ArgumentError.notNull('creator'); + if (kEnumCreator == null) throw ArgumentError.notNull('kEnumCreator'); + if (vObjectCreator == null) throw ArgumentError.notNull('vObjectCreator'); if (isSubtypeOfWinRTFlagsEnum()) { - return _IMapViewWinRTFlagsEnumInspectable.fromPtr(ptr, - creator: creator, - enumKeyCreator: enumKeyCreator, - iterableIid: iterableIid); + return _IMapViewWinRTFlagsEnumInspectable.fromPtr( + ptr, + kEnumCreator: kEnumCreator, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ); } - return _IMapViewWinRTEnumInspectable.fromPtr(ptr, - creator: creator, - enumKeyCreator: enumKeyCreator, - iterableIid: iterableIid); + return _IMapViewWinRTEnumInspectable.fromPtr( + ptr, + kEnumCreator: kEnumCreator, + vObjectCreator: vObjectCreator, + iterableIid: iterableIid, + ); } if (K == Uri && V == String) { @@ -228,26 +278,31 @@ abstract interface class IMapView extends IInspectable return ( first: firstIsNull ? null - : IMapView.fromPtr(first, - creator: _creator, - enumKeyCreator: _enumKeyCreator, - enumCreator: _enumCreator, - intType: _intType, - iterableIid: _iterableIid), + : IMapView.fromPtr( + first, + iterableIid: _iterableIid, + kEnumCreator: _kEnumCreator, + kIntType: _kIntType, + vEnumCreator: _vEnumCreator, + vObjectCreator: _vObjectCreator, + ), second: secondIsNull ? null - : IMapView.fromPtr(second, - creator: _creator, - enumKeyCreator: _enumKeyCreator, - enumCreator: _enumCreator, - intType: _intType, - iterableIid: _iterableIid) + : IMapView.fromPtr( + second, + iterableIid: _iterableIid, + kEnumCreator: _kEnumCreator, + kIntType: _kIntType, + vEnumCreator: _vEnumCreator, + vObjectCreator: _vObjectCreator, + ) ); } late final _iIterable = IIterable>.fromPtr( - toInterface(_iterableIid), - creator: _iterableCreator); + toInterface(_iterableIid), + tObjectCreator: _iterableCreator, + ); @override IIterator> first() => _iIterable.first(); diff --git a/packages/windows_foundation/lib/src/collections/imapview_part.dart b/packages/windows_foundation/lib/src/collections/imapview_part.dart index 53ad9fff..2d5f0721 100644 --- a/packages/windows_foundation/lib/src/collections/imapview_part.dart +++ b/packages/windows_foundation/lib/src/collections/imapview_part.dart @@ -11,12 +11,12 @@ part of 'imapview.dart'; final class _IMapViewGuidInspectable extends IMapView { _IMapViewGuidInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewGuidInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewGuidInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(Guid key) { @@ -40,7 +40,7 @@ final class _IMapViewGuidInspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -164,12 +164,14 @@ final class __IMapViewGuidObjectVtbl extends Struct { final class _IMapViewInt16Inspectable extends IMapView { _IMapViewInt16Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewInt16InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewInt16InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -189,7 +191,7 @@ final class _IMapViewInt16Inspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -233,12 +235,14 @@ final class __IMapViewInt16InspectableVtbl extends Struct { final class _IMapViewInt32Inspectable extends IMapView { _IMapViewInt32Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewInt32InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewInt32InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -258,7 +262,7 @@ final class _IMapViewInt32Inspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -302,12 +306,14 @@ final class __IMapViewInt32InspectableVtbl extends Struct { final class _IMapViewInt64Inspectable extends IMapView { _IMapViewInt64Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewInt64InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewInt64InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -327,7 +333,7 @@ final class _IMapViewInt64Inspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -438,12 +444,12 @@ final class __IMapViewObjectObjectVtbl extends Struct { final class _IMapViewStringInspectable extends IMapView { _IMapViewStringInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewStringInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewStringInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(String key) { @@ -464,7 +470,7 @@ final class _IMapViewStringInspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -641,12 +647,12 @@ final class __IMapViewStringStringVtbl extends Struct { final class _IMapViewStringWinRTEnum extends IMapView { _IMapViewStringWinRTEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.vEnumCreator}) + : super(vEnumCreator: vEnumCreator); late final __IMapViewStringWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IMapViewStringWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator vEnumCreator; @override V lookup(String key) { @@ -660,7 +666,7 @@ final class _IMapViewStringWinRTEnum extends IMapView { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return vEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -708,12 +714,12 @@ final class __IMapViewStringWinRTEnumVtbl extends Struct { final class _IMapViewStringWinRTFlagsEnum extends IMapView { _IMapViewStringWinRTFlagsEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.vEnumCreator}) + : super(vEnumCreator: vEnumCreator); late final __IMapViewStringWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IMapViewStringWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator vEnumCreator; @override V lookup(String key) { @@ -727,7 +733,7 @@ final class _IMapViewStringWinRTFlagsEnum extends IMapView { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return vEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -775,12 +781,14 @@ final class __IMapViewStringWinRTFlagsEnumVtbl extends Struct { final class _IMapViewUint8Inspectable extends IMapView { _IMapViewUint8Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewUint8InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewUint8InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -800,7 +808,7 @@ final class _IMapViewUint8Inspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -844,12 +852,14 @@ final class __IMapViewUint8InspectableVtbl extends Struct { final class _IMapViewUint16Inspectable extends IMapView { _IMapViewUint16Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewUint16InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewUint16InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -869,7 +879,7 @@ final class _IMapViewUint16Inspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -913,12 +923,14 @@ final class __IMapViewUint16InspectableVtbl extends Struct { final class _IMapViewUint32Inspectable extends IMapView { _IMapViewUint32Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewUint32InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewUint32InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -938,7 +950,7 @@ final class _IMapViewUint32Inspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -982,12 +994,14 @@ final class __IMapViewUint32InspectableVtbl extends Struct { final class _IMapViewUint64Inspectable extends IMapView { _IMapViewUint64Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapViewUint64InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewUint64InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1007,7 +1021,7 @@ final class _IMapViewUint64Inspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1115,14 +1129,14 @@ final class __IMapViewUriStringVtbl extends Struct { final class _IMapViewWinRTEnumInspectable extends IMapView { _IMapViewWinRTEnumInspectable.fromPtr(super.ptr, {required super.iterableIid, - required this.enumKeyCreator, - required this.creator}) - : super(enumKeyCreator: enumKeyCreator, creator: creator); + required this.kEnumCreator, + required this.vObjectCreator}) + : super(kEnumCreator: kEnumCreator, vObjectCreator: vObjectCreator); late final __IMapViewWinRTEnumInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewWinRTEnumInspectableVtbl>().ref; - final EnumCreator enumKeyCreator; - final COMObjectCreator creator; + final EnumCreator kEnumCreator; + final COMObjectCreator vObjectCreator; @override V lookup(K key) { @@ -1143,7 +1157,7 @@ final class _IMapViewWinRTEnumInspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1189,14 +1203,14 @@ final class __IMapViewWinRTEnumInspectableVtbl extends Struct { final class _IMapViewWinRTFlagsEnumInspectable extends IMapView { _IMapViewWinRTFlagsEnumInspectable.fromPtr(super.ptr, {required super.iterableIid, - required this.enumKeyCreator, - required this.creator}) - : super(enumKeyCreator: enumKeyCreator, creator: creator); + required this.kEnumCreator, + required this.vObjectCreator}) + : super(kEnumCreator: kEnumCreator, vObjectCreator: vObjectCreator); late final __IMapViewWinRTFlagsEnumInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapViewWinRTFlagsEnumInspectableVtbl>().ref; - final EnumCreator enumKeyCreator; - final COMObjectCreator creator; + final EnumCreator kEnumCreator; + final COMObjectCreator vObjectCreator; @override V lookup(K key) { @@ -1217,7 +1231,7 @@ final class _IMapViewWinRTFlagsEnumInspectable extends IMapView { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override diff --git a/packages/windows_foundation/lib/src/collections/ivector.dart b/packages/windows_foundation/lib/src/collections/ivector.dart index 63062b7d..6ffb59ee 100644 --- a/packages/windows_foundation/lib/src/collections/ivector.dart +++ b/packages/windows_foundation/lib/src/collections/ivector.dart @@ -33,20 +33,20 @@ abstract interface class IVector extends IInspectable IVector( super.ptr, { required String iterableIid, - COMObjectCreator? creator, - EnumCreator? enumCreator, - DoubleType? doubleType, - IntType? intType, - }) : _creator = creator, - _enumCreator = enumCreator, - _doubleType = doubleType, - _intType = intType, + EnumCreator? tEnumCreator, + COMObjectCreator? tObjectCreator, + DoubleType? tDoubleType, + IntType? tIntType, + }) : _tEnumCreator = tEnumCreator, + _tObjectCreator = tObjectCreator, + _tDoubleType = tDoubleType, + _tIntType = tIntType, _iterableIid = iterableIid; - final COMObjectCreator? _creator; - final EnumCreator? _enumCreator; - final DoubleType? _doubleType; - final IntType? _intType; + final EnumCreator? _tEnumCreator; + final COMObjectCreator? _tObjectCreator; + final DoubleType? _tDoubleType; + final IntType? _tIntType; final String _iterableIid; /// Creates an instance of [IVector] from the given [ptr] and [iterableIid]. @@ -59,40 +59,40 @@ abstract interface class IVector extends IInspectable /// `StorageFile?`), `WinRTEnum` (e.g., `DeviceClass`), or `WinRTStruct` /// (e.g., `BasicGeoposition`). /// - /// [doubleType] must be specified if [T] is `double`. + /// [tDoubleType] must be specified if [T] is `double`. /// ```dart /// final vector = IVector.fromPtr(ptr, - /// doubleType: DoubleType.float, - /// iterableIid: '{b01bee51-063a-5fda-bd72-d76637bb8cb8}'); + /// iterableIid: '{b01bee51-063a-5fda-bd72-d76637bb8cb8}', + /// tDoubleType: DoubleType.float); /// ``` /// - /// [intType] must be specified if [T] is `int`. + /// [tIntType] must be specified if [T] is `int`. /// ```dart /// final vector = IVector.fromPtr(ptr, - /// intType: IntType.uint64, - /// iterableIid: '{4b3a3229-7995-5f3c-b248-6c1f7e664f01}'); + /// iterableIid: '{4b3a3229-7995-5f3c-b248-6c1f7e664f01}', + /// tIntType: IntType.uint64); /// ``` /// - /// [creator] must be specified if [T] is `IInspectable?`. + /// [tObjectCreator] must be specified if [T] is `IInspectable?`. /// ```dart /// final vector = IVector.fromPtr(ptr, - /// creator: StorageFile.fromPtr, - /// iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}'); + /// iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', + /// tObjectCreator: StorageFile.fromPtr); /// ``` /// - /// [enumCreator] must be specified if [T] is `WinRTEnum`. + /// [tEnumCreator] must be specified if [T] is `WinRTEnum`. /// ```dart /// final vector = IVector.fromPtr(ptr, - /// enumCreator: DeviceClass.from, - /// iterableIid: '{47d4be05-58f1-522e-81c6-975eb4131bb9}'); + /// iterableIid: '{47d4be05-58f1-522e-81c6-975eb4131bb9}', + /// tEnumCreator: DeviceClass.from); /// ``` factory IVector.fromPtr( Pointer ptr, { required String iterableIid, - COMObjectCreator? creator, - EnumCreator? enumCreator, - DoubleType? doubleType, - IntType? intType, + EnumCreator? tEnumCreator, + COMObjectCreator? tObjectCreator, + DoubleType? tDoubleType, + IntType? tIntType, }) { if (T == bool) { return _IVectorBool.fromPtr(ptr, iterableIid: iterableIid) as IVector; @@ -113,39 +113,39 @@ abstract interface class IVector extends IInspectable } if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); + if (tObjectCreator == null) throw ArgumentError.notNull('tObjectCreator'); return _IVectorInspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid); + tObjectCreator: tObjectCreator, iterableIid: iterableIid); } if (T == double) { - if (doubleType == null) throw ArgumentError.notNull('doubleType'); - final vector = switch (doubleType) { + if (tDoubleType == null) throw ArgumentError.notNull('tDoubleType'); + final vector = switch (tDoubleType) { DoubleType.double => _IVectorDouble.fromPtr(ptr, - doubleType: doubleType, iterableIid: iterableIid), + tDoubleType: tDoubleType, iterableIid: iterableIid), DoubleType.float => _IVectorFloat.fromPtr(ptr, - doubleType: doubleType, iterableIid: iterableIid), + tDoubleType: tDoubleType, iterableIid: iterableIid), }; return vector as IVector; } if (T == int) { - if (intType == null) throw ArgumentError.notNull('intType'); - final vector = switch (intType) { + if (tIntType == null) throw ArgumentError.notNull('tIntType'); + final vector = switch (tIntType) { IntType.int16 => _IVectorInt16.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.int32 => _IVectorInt32.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.int64 => _IVectorInt64.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.uint8 => _IVectorUint8.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.uint16 => _IVectorUint16.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.uint32 => _IVectorUint32.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.uint64 => _IVectorUint64.fromPtr(ptr, - intType: intType, iterableIid: iterableIid) + tIntType: tIntType, iterableIid: iterableIid) }; return vector as IVector; } @@ -160,15 +160,15 @@ abstract interface class IVector extends IInspectable } if (isSubtypeOfWinRTFlagsEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); + if (tEnumCreator == null) throw ArgumentError.notNull('tEnumCreator'); return _IVectorWinRTFlagsEnum.fromPtr(ptr, - enumCreator: enumCreator, iterableIid: iterableIid); + tEnumCreator: tEnumCreator, iterableIid: iterableIid); } if (isSubtypeOfWinRTEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); + if (tEnumCreator == null) throw ArgumentError.notNull('tEnumCreator'); return _IVectorWinRTEnum.fromPtr(ptr, - enumCreator: enumCreator, iterableIid: iterableIid); + tEnumCreator: tEnumCreator, iterableIid: iterableIid); } if (isNullableObjectType()) { @@ -294,12 +294,14 @@ abstract interface class IVector extends IInspectable throwWindowsException(hr); } - final vectorView = IVectorView.fromPtr(retValuePtr, - creator: _creator, - enumCreator: _enumCreator, - doubleType: _doubleType, - intType: _intType, - iterableIid: _iterableIid); + final vectorView = IVectorView.fromPtr( + retValuePtr, + iterableIid: _iterableIid, + tEnumCreator: _tEnumCreator, + tObjectCreator: _tObjectCreator, + tDoubleType: _tDoubleType, + tIntType: _tIntType, + ); return vectorView.toList(); } @@ -349,11 +351,13 @@ abstract interface class IVector extends IInspectable /// Replaces all the items in the vector with the specified items. void replaceAll(List value); - late final _iIterable = IIterable.fromPtr(toInterface(_iterableIid), - creator: _creator, - enumCreator: _enumCreator, - doubleType: _doubleType, - intType: _intType); + late final _iIterable = IIterable.fromPtr( + toInterface(_iterableIid), + tEnumCreator: _tEnumCreator, + tObjectCreator: _tObjectCreator, + tDoubleType: _tDoubleType, + tIntType: _tIntType, + ); @override IIterator first() => _iIterable.first(); diff --git a/packages/windows_foundation/lib/src/collections/ivector_part.dart b/packages/windows_foundation/lib/src/collections/ivector_part.dart index e8b09021..c94da951 100644 --- a/packages/windows_foundation/lib/src/collections/ivector_part.dart +++ b/packages/windows_foundation/lib/src/collections/ivector_part.dart @@ -1049,7 +1049,7 @@ final class __IVectorDateTimeVtbl extends Struct { final class _IVectorDouble extends IVector { _IVectorDouble.fromPtr(super.ptr, - {required super.iterableIid, super.doubleType}); + {required super.iterableIid, super.tDoubleType}); late final __IVectorDoubleVtbl _vtable = ptr.ref.vtable.cast<__IVectorDoubleVtbl>().ref; @@ -1365,7 +1365,7 @@ final class __IVectorDurationVtbl extends Struct { final class _IVectorFloat extends IVector { _IVectorFloat.fromPtr(super.ptr, - {required super.iterableIid, super.doubleType}); + {required super.iterableIid, super.tDoubleType}); late final __IVectorFloatVtbl _vtable = ptr.ref.vtable.cast<__IVectorFloatVtbl>().ref; @@ -1877,7 +1877,8 @@ final class __IVectorGuidVtbl extends Struct { } final class _IVectorInt16 extends IVector { - _IVectorInt16.fromPtr(super.ptr, {required super.iterableIid, super.intType}); + _IVectorInt16.fromPtr(super.ptr, + {required super.iterableIid, super.tIntType}); late final __IVectorInt16Vtbl _vtable = ptr.ref.vtable.cast<__IVectorInt16Vtbl>().ref; @@ -2032,7 +2033,8 @@ final class __IVectorInt16Vtbl extends Struct { } final class _IVectorInt32 extends IVector { - _IVectorInt32.fromPtr(super.ptr, {required super.iterableIid, super.intType}); + _IVectorInt32.fromPtr(super.ptr, + {required super.iterableIid, super.tIntType}); late final __IVectorInt32Vtbl _vtable = ptr.ref.vtable.cast<__IVectorInt32Vtbl>().ref; @@ -2187,7 +2189,8 @@ final class __IVectorInt32Vtbl extends Struct { } final class _IVectorInt64 extends IVector { - _IVectorInt64.fromPtr(super.ptr, {required super.iterableIid, super.intType}); + _IVectorInt64.fromPtr(super.ptr, + {required super.iterableIid, super.tIntType}); late final __IVectorInt64Vtbl _vtable = ptr.ref.vtable.cast<__IVectorInt64Vtbl>().ref; @@ -2883,12 +2886,12 @@ final class __IVectorNitRangeVtbl extends Struct { final class _IVectorInspectable extends IVector { _IVectorInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.tObjectCreator}) + : super(tObjectCreator: tObjectCreator); late final __IVectorInspectableVtbl _vtable = ptr.ref.vtable.cast<__IVectorInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator tObjectCreator; @override T getAt(int index) { @@ -2908,7 +2911,7 @@ final class _IVectorInspectable extends IVector { return null as T; } - return creator(retValuePtr); + return tObjectCreator(retValuePtr); } @override @@ -2975,7 +2978,7 @@ final class _IVectorInspectable extends IVector { return ( retValuePtr.value, - items: items.toList(creator, length: retValuePtr.value) + items: items.toList(tObjectCreator, length: retValuePtr.value) ); } finally { free(items); @@ -5332,7 +5335,8 @@ final class __IVectorTextSegmentVtbl extends Struct { } final class _IVectorUint8 extends IVector { - _IVectorUint8.fromPtr(super.ptr, {required super.iterableIid, super.intType}); + _IVectorUint8.fromPtr(super.ptr, + {required super.iterableIid, super.tIntType}); late final __IVectorUint8Vtbl _vtable = ptr.ref.vtable.cast<__IVectorUint8Vtbl>().ref; @@ -5488,7 +5492,7 @@ final class __IVectorUint8Vtbl extends Struct { final class _IVectorUint16 extends IVector { _IVectorUint16.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorUint16Vtbl _vtable = ptr.ref.vtable.cast<__IVectorUint16Vtbl>().ref; @@ -5644,7 +5648,7 @@ final class __IVectorUint16Vtbl extends Struct { final class _IVectorUint32 extends IVector { _IVectorUint32.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorUint32Vtbl _vtable = ptr.ref.vtable.cast<__IVectorUint32Vtbl>().ref; @@ -5800,7 +5804,7 @@ final class __IVectorUint32Vtbl extends Struct { final class _IVectorUint64 extends IVector { _IVectorUint64.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorUint64Vtbl _vtable = ptr.ref.vtable.cast<__IVectorUint64Vtbl>().ref; @@ -6134,12 +6138,12 @@ final class __IVectorWindowIdVtbl extends Struct { final class _IVectorWinRTEnum extends IVector { _IVectorWinRTEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.tEnumCreator}) + : super(tEnumCreator: tEnumCreator); late final __IVectorWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IVectorWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T getAt(int index) { @@ -6152,7 +6156,7 @@ final class _IVectorWinRTEnum extends IVector { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -6220,7 +6224,7 @@ final class _IVectorWinRTEnum extends IVector { return ( retValuePtr.value, - items: items.toEnumList(enumCreator, length: retValuePtr.value) + items: items.toEnumList(tEnumCreator, length: retValuePtr.value) ); } finally { free(items); @@ -6294,12 +6298,12 @@ final class __IVectorWinRTEnumVtbl extends Struct { final class _IVectorWinRTFlagsEnum extends IVector { _IVectorWinRTFlagsEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.tEnumCreator}) + : super(tEnumCreator: tEnumCreator); late final __IVectorWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IVectorWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T getAt(int index) { @@ -6312,7 +6316,7 @@ final class _IVectorWinRTFlagsEnum extends IVector { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -6380,7 +6384,7 @@ final class _IVectorWinRTFlagsEnum extends IVector { return ( retValuePtr.value, - items: items.toEnumList(enumCreator, length: retValuePtr.value) + items: items.toEnumList(tEnumCreator, length: retValuePtr.value) ); } finally { free(items); diff --git a/packages/windows_foundation/lib/src/collections/ivectorview.dart b/packages/windows_foundation/lib/src/collections/ivectorview.dart index 8a7e20fc..f8744706 100644 --- a/packages/windows_foundation/lib/src/collections/ivectorview.dart +++ b/packages/windows_foundation/lib/src/collections/ivectorview.dart @@ -32,20 +32,20 @@ abstract interface class IVectorView extends IInspectable IVectorView( super.ptr, { required String iterableIid, - COMObjectCreator? creator, - EnumCreator? enumCreator, - DoubleType? doubleType, - IntType? intType, - }) : _creator = creator, - _enumCreator = enumCreator, - _doubleType = doubleType, - _intType = intType, + EnumCreator? tEnumCreator, + COMObjectCreator? tObjectCreator, + DoubleType? tDoubleType, + IntType? tIntType, + }) : _tEnumCreator = tEnumCreator, + _tObjectCreator = tObjectCreator, + _tDoubleType = tDoubleType, + _tIntType = tIntType, _iterableIid = iterableIid; - final COMObjectCreator? _creator; - final EnumCreator? _enumCreator; - final DoubleType? _doubleType; - final IntType? _intType; + final EnumCreator? _tEnumCreator; + final COMObjectCreator? _tObjectCreator; + final DoubleType? _tDoubleType; + final IntType? _tIntType; final String _iterableIid; /// Creates an instance of [IVectorView] from the given [ptr] and @@ -59,40 +59,40 @@ abstract interface class IVectorView extends IInspectable /// `StorageFile?`), `WinRTEnum` (e.g., `DeviceClass`), or `WinRTStruct` /// (e.g., `BasicGeoposition`). /// - /// [doubleType] must be specified if [T] is `double`. + /// [tDoubleType] must be specified if [T] is `double`. /// ```dart /// final vectorView = IVectorView.fromPtr(ptr, - /// doubleType: DoubleType.float, - /// iterableIid: '{b01bee51-063a-5fda-bd72-d76637bb8cb8}'); + /// iterableIid: '{b01bee51-063a-5fda-bd72-d76637bb8cb8}', + /// tDoubleType: DoubleType.float); /// ``` /// - /// [intType] must be specified if [T] is `int`. + /// [tIntType] must be specified if [T] is `int`. /// ```dart /// final vectorView = IVectorView.fromPtr(ptr, - /// intType: IntType.uint64, - /// iterableIid: '{4b3a3229-7995-5f3c-b248-6c1f7e664f01}'); + /// iterableIid: '{4b3a3229-7995-5f3c-b248-6c1f7e664f01}', + /// tIntType: IntType.uint64); /// ``` /// - /// [creator] must be specified if [T] is `IInspectable?`. + /// [tObjectCreator] must be specified if [T] is `IInspectable?`. /// ```dart /// final vectorView = IVectorView.fromPtr(ptr, - /// creator: StorageFile.fromPtr, - /// iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}'); + /// iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', + /// tObjectCreator: StorageFile.fromPtr); /// ``` /// - /// [enumCreator] must be specified if [T] is `WinRTEnum`. + /// [tEnumCreator] must be specified if [T] is `WinRTEnum`. /// ```dart /// final vectorView = IVectorView.fromPtr(ptr, - /// enumCreator: DeviceClass.from, - /// iterableIid: '{47d4be05-58f1-522e-81c6-975eb4131bb9}'); + /// iterableIid: '{47d4be05-58f1-522e-81c6-975eb4131bb9}', + /// tEnumCreator: DeviceClass.from); /// ``` factory IVectorView.fromPtr( Pointer ptr, { required String iterableIid, - COMObjectCreator? creator, - EnumCreator? enumCreator, - DoubleType? doubleType, - IntType? intType, + EnumCreator? tEnumCreator, + COMObjectCreator? tObjectCreator, + DoubleType? tDoubleType, + IntType? tIntType, }) { if (T == bool) { return _IVectorViewBool.fromPtr(ptr, iterableIid: iterableIid) @@ -115,39 +115,39 @@ abstract interface class IVectorView extends IInspectable } if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); + if (tObjectCreator == null) throw ArgumentError.notNull('tObjectCreator'); return _IVectorViewInspectable.fromPtr(ptr, - creator: creator, iterableIid: iterableIid); + tObjectCreator: tObjectCreator, iterableIid: iterableIid); } if (T == double) { - if (doubleType == null) throw ArgumentError.notNull('doubleType'); - final vectorView = switch (doubleType) { + if (tDoubleType == null) throw ArgumentError.notNull('tDoubleType'); + final vectorView = switch (tDoubleType) { DoubleType.double => _IVectorViewDouble.fromPtr(ptr, - doubleType: doubleType, iterableIid: iterableIid), + tDoubleType: tDoubleType, iterableIid: iterableIid), DoubleType.float => _IVectorViewFloat.fromPtr(ptr, - doubleType: doubleType, iterableIid: iterableIid), + tDoubleType: tDoubleType, iterableIid: iterableIid), }; return vectorView as IVectorView; } if (T == int) { - if (intType == null) throw ArgumentError.notNull('intType'); - final vectorView = switch (intType) { + if (tIntType == null) throw ArgumentError.notNull('tIntType'); + final vectorView = switch (tIntType) { IntType.int16 => _IVectorViewInt16.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.int32 => _IVectorViewInt32.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.int64 => _IVectorViewInt64.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.uint8 => _IVectorViewUint8.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.uint16 => _IVectorViewUint16.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.uint32 => _IVectorViewUint32.fromPtr(ptr, - intType: intType, iterableIid: iterableIid), + tIntType: tIntType, iterableIid: iterableIid), IntType.uint64 => _IVectorViewUint64.fromPtr(ptr, - intType: intType, iterableIid: iterableIid) + tIntType: tIntType, iterableIid: iterableIid) }; return vectorView as IVectorView; } @@ -163,15 +163,15 @@ abstract interface class IVectorView extends IInspectable } if (isSubtypeOfWinRTFlagsEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); + if (tEnumCreator == null) throw ArgumentError.notNull('tEnumCreator'); return _IVectorViewWinRTFlagsEnum.fromPtr(ptr, - enumCreator: enumCreator, iterableIid: iterableIid); + tEnumCreator: tEnumCreator, iterableIid: iterableIid); } if (isSubtypeOfWinRTEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); + if (tEnumCreator == null) throw ArgumentError.notNull('tEnumCreator'); return _IVectorViewWinRTEnum.fromPtr(ptr, - enumCreator: enumCreator, iterableIid: iterableIid); + tEnumCreator: tEnumCreator, iterableIid: iterableIid); } if (isNullableObjectType()) { @@ -294,11 +294,13 @@ abstract interface class IVectorView extends IInspectable /// index. (int, {List items}) getMany(int startIndex, int valueSize); - late final _iIterable = IIterable.fromPtr(toInterface(_iterableIid), - creator: _creator, - enumCreator: _enumCreator, - doubleType: _doubleType, - intType: _intType); + late final _iIterable = IIterable.fromPtr( + toInterface(_iterableIid), + tEnumCreator: _tEnumCreator, + tObjectCreator: _tObjectCreator, + tDoubleType: _tDoubleType, + tIntType: _tIntType, + ); @override IIterator first() => _iIterable.first(); diff --git a/packages/windows_foundation/lib/src/collections/ivectorview_part.dart b/packages/windows_foundation/lib/src/collections/ivectorview_part.dart index d50d0433..f423f6e1 100644 --- a/packages/windows_foundation/lib/src/collections/ivectorview_part.dart +++ b/packages/windows_foundation/lib/src/collections/ivectorview_part.dart @@ -588,7 +588,7 @@ final class __IVectorViewDateTimeVtbl extends Struct { final class _IVectorViewDouble extends IVectorView { _IVectorViewDouble.fromPtr(super.ptr, - {required super.iterableIid, super.doubleType}); + {required super.iterableIid, super.tDoubleType}); late final __IVectorViewDoubleVtbl _vtable = ptr.ref.vtable.cast<__IVectorViewDoubleVtbl>().ref; @@ -773,7 +773,7 @@ final class __IVectorViewDurationVtbl extends Struct { final class _IVectorViewFloat extends IVectorView { _IVectorViewFloat.fromPtr(super.ptr, - {required super.iterableIid, super.doubleType}); + {required super.iterableIid, super.tDoubleType}); late final __IVectorViewFloatVtbl _vtable = ptr.ref.vtable.cast<__IVectorViewFloatVtbl>().ref; @@ -1058,7 +1058,7 @@ final class __IVectorViewGuidVtbl extends Struct { final class _IVectorViewInt16 extends IVectorView { _IVectorViewInt16.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorViewInt16Vtbl _vtable = ptr.ref.vtable.cast<__IVectorViewInt16Vtbl>().ref; @@ -1149,7 +1149,7 @@ final class __IVectorViewInt16Vtbl extends Struct { final class _IVectorViewInt32 extends IVectorView { _IVectorViewInt32.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorViewInt32Vtbl _vtable = ptr.ref.vtable.cast<__IVectorViewInt32Vtbl>().ref; @@ -1240,7 +1240,7 @@ final class __IVectorViewInt32Vtbl extends Struct { final class _IVectorViewInt64 extends IVectorView { _IVectorViewInt64.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorViewInt64Vtbl _vtable = ptr.ref.vtable.cast<__IVectorViewInt64Vtbl>().ref; @@ -1625,12 +1625,12 @@ final class __IVectorViewNitRangeVtbl extends Struct { final class _IVectorViewInspectable extends IVectorView { _IVectorViewInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.tObjectCreator}) + : super(tObjectCreator: tObjectCreator); late final __IVectorViewInspectableVtbl _vtable = ptr.ref.vtable.cast<__IVectorViewInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator tObjectCreator; @override T getAt(int index) { @@ -1650,7 +1650,7 @@ final class _IVectorViewInspectable extends IVectorView { return null as T; } - return creator(retValuePtr); + return tObjectCreator(retValuePtr); } @override @@ -1688,7 +1688,7 @@ final class _IVectorViewInspectable extends IVectorView { return ( retValuePtr.value, - items: items.toList(creator, length: retValuePtr.value) + items: items.toList(tObjectCreator, length: retValuePtr.value) ); } finally { free(items); @@ -2981,7 +2981,7 @@ final class __IVectorViewTextSegmentVtbl extends Struct { final class _IVectorViewUint8 extends IVectorView { _IVectorViewUint8.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorViewUint8Vtbl _vtable = ptr.ref.vtable.cast<__IVectorViewUint8Vtbl>().ref; @@ -3072,7 +3072,7 @@ final class __IVectorViewUint8Vtbl extends Struct { final class _IVectorViewUint16 extends IVectorView { _IVectorViewUint16.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorViewUint16Vtbl _vtable = ptr.ref.vtable.cast<__IVectorViewUint16Vtbl>().ref; @@ -3163,7 +3163,7 @@ final class __IVectorViewUint16Vtbl extends Struct { final class _IVectorViewUint32 extends IVectorView { _IVectorViewUint32.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorViewUint32Vtbl _vtable = ptr.ref.vtable.cast<__IVectorViewUint32Vtbl>().ref; @@ -3254,7 +3254,7 @@ final class __IVectorViewUint32Vtbl extends Struct { final class _IVectorViewUint64 extends IVectorView { _IVectorViewUint64.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorViewUint64Vtbl _vtable = ptr.ref.vtable.cast<__IVectorViewUint64Vtbl>().ref; @@ -3443,12 +3443,12 @@ final class __IVectorViewWindowIdVtbl extends Struct { final class _IVectorViewWinRTEnum extends IVectorView { _IVectorViewWinRTEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.tEnumCreator}) + : super(tEnumCreator: tEnumCreator); late final __IVectorViewWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IVectorViewWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T getAt(int index) { @@ -3461,7 +3461,7 @@ final class _IVectorViewWinRTEnum extends IVectorView { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -3502,7 +3502,7 @@ final class _IVectorViewWinRTEnum extends IVectorView { return ( retValuePtr.value, - items: items.toEnumList(enumCreator, length: retValuePtr.value) + items: items.toEnumList(tEnumCreator, length: retValuePtr.value) ); } finally { free(items); @@ -3537,12 +3537,12 @@ final class __IVectorViewWinRTEnumVtbl extends Struct { final class _IVectorViewWinRTFlagsEnum extends IVectorView { _IVectorViewWinRTFlagsEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.tEnumCreator}) + : super(tEnumCreator: tEnumCreator); late final __IVectorViewWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IVectorViewWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T getAt(int index) { @@ -3555,7 +3555,7 @@ final class _IVectorViewWinRTFlagsEnum extends IVectorView { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -3596,7 +3596,7 @@ final class _IVectorViewWinRTFlagsEnum extends IVectorView { return ( retValuePtr.value, - items: items.toEnumList(enumCreator, length: retValuePtr.value) + items: items.toEnumList(tEnumCreator, length: retValuePtr.value) ); } finally { free(items); diff --git a/packages/windows_foundation/lib/src/iasyncoperation.dart b/packages/windows_foundation/lib/src/iasyncoperation.dart index ec9c6a50..228a508c 100644 --- a/packages/windows_foundation/lib/src/iasyncoperation.dart +++ b/packages/windows_foundation/lib/src/iasyncoperation.dart @@ -18,7 +18,11 @@ part 'iasyncoperation_part.dart'; /// methods that have results but don't report progress. abstract interface class IAsyncOperation extends IInspectable implements IAsyncInfo { - IAsyncOperation(super.ptr); + IAsyncOperation( + super.ptr, { + DoubleType? tResultDoubleType, + IntType? tResultIntType, + }); late final _IAsyncOperationVtbl __vtable = ptr.ref.vtable.cast<_IAsyncOperationVtbl>().ref; @@ -29,36 +33,36 @@ abstract interface class IAsyncOperation extends IInspectable /// `String`, `Uri?`, `IInspectable?` (e.g., `StorageFile?`), `WinRTEnum` /// (e.g., `LaunchUriStatus`), or `WinRTStruct` (e.g., `LoadMoreItemsResult`). /// - /// [doubleType] must be specified if [TResult] is `double`. + /// [tResultDoubleType] must be specified if [TResult] is `double`. /// ```darts - /// final asyncOperation = - /// IAsyncOperation.fromPtr(ptr, doubleType: DoubleType.float); + /// final asyncOperation = IAsyncOperation.fromPtr(ptr, + /// tResultDoubleType: DoubleType.float); /// ``` /// - /// [intType] must be specified if [TResult] is `int`. + /// [tResultIntType] must be specified if [TResult] is `int`. /// ```dart /// final asyncOperation = - /// IAsyncOperation.fromPtr(ptr, intType: IntType.uint64); + /// IAsyncOperation.fromPtr(ptr, tResultIntType: IntType.uint64); /// ``` /// - /// [creator] must be specified if [TResult] is `IInspectable?`. + /// [tResultObjectCreator] must be specified if [TResult] is `IInspectable?`. /// ```dart /// ... - /// final asyncOperation = - /// IAsyncOperation(ptr, creator: StorageFile.fromPtr); + /// final asyncOperation = IAsyncOperation(ptr, + /// tResultObjectCreator: StorageFile.fromPtr); /// ``` /// - /// [enumCreator] must be specified if [TResult] is `WinRTEnum`. + /// [tResultEnumCreator] must be specified if [TResult] is `WinRTEnum`. /// ```dart - /// final asyncOperation = IAsyncOperation.fromPtr - /// (ptr, enumCreator: LaunchUriStatus.from); + /// final asyncOperation = IAsyncOperation.fromPtr(ptr, + /// tResultEnumCreator: LaunchUriStatus.from); /// ``` factory IAsyncOperation.fromPtr( Pointer ptr, { - COMObjectCreator? creator, - EnumCreator? enumCreator, - DoubleType? doubleType, - IntType? intType, + EnumCreator? tResultEnumCreator, + COMObjectCreator? tResultObjectCreator, + DoubleType? tResultDoubleType, + IntType? tResultIntType, }) { if (TResult == bool) { return _IAsyncOperationBool.fromPtr(ptr) as IAsyncOperation; @@ -69,29 +73,45 @@ abstract interface class IAsyncOperation extends IInspectable } if (isSubtypeOfInspectable()) { - if (creator == null) throw ArgumentError.notNull('creator'); - return _IAsyncOperationInspectable.fromPtr(ptr, creator: creator); + if (tResultObjectCreator == null) { + throw ArgumentError.notNull('tResultObjectCreator'); + } + + return _IAsyncOperationInspectable.fromPtr( + ptr, + tResultObjectCreator: tResultObjectCreator, + ); } if (TResult == double) { - if (doubleType == null) throw ArgumentError.notNull('doubleType'); - final asyncOperation = switch (doubleType) { - DoubleType.double => _IAsyncOperationDouble.fromPtr(ptr), - DoubleType.float => _IAsyncOperationFloat.fromPtr(ptr), + if (tResultDoubleType == null) + throw ArgumentError.notNull('tResultDoubleType'); + final asyncOperation = switch (tResultDoubleType) { + DoubleType.double => _IAsyncOperationDouble.fromPtr(ptr, + tResultDoubleType: tResultDoubleType), + DoubleType.float => _IAsyncOperationFloat.fromPtr(ptr, + tResultDoubleType: tResultDoubleType), }; return asyncOperation as IAsyncOperation; } if (TResult == int) { - if (intType == null) throw ArgumentError.notNull('intType'); - final asyncOperation = switch (intType) { - IntType.int16 => _IAsyncOperationInt16.fromPtr(ptr), - IntType.int32 => _IAsyncOperationInt32.fromPtr(ptr), - IntType.int64 => _IAsyncOperationInt64.fromPtr(ptr), - IntType.uint8 => _IAsyncOperationUint8.fromPtr(ptr), - IntType.uint16 => _IAsyncOperationUint16.fromPtr(ptr), - IntType.uint32 => _IAsyncOperationUint32.fromPtr(ptr), - IntType.uint64 => _IAsyncOperationUint64.fromPtr(ptr) + if (tResultIntType == null) throw ArgumentError.notNull('tResultIntType'); + final asyncOperation = switch (tResultIntType) { + IntType.int16 => + _IAsyncOperationInt16.fromPtr(ptr, tResultIntType: tResultIntType), + IntType.int32 => + _IAsyncOperationInt32.fromPtr(ptr, tResultIntType: tResultIntType), + IntType.int64 => + _IAsyncOperationInt64.fromPtr(ptr, tResultIntType: tResultIntType), + IntType.uint8 => + _IAsyncOperationUint8.fromPtr(ptr, tResultIntType: tResultIntType), + IntType.uint16 => + _IAsyncOperationUint16.fromPtr(ptr, tResultIntType: tResultIntType), + IntType.uint32 => + _IAsyncOperationUint32.fromPtr(ptr, tResultIntType: tResultIntType), + IntType.uint64 => + _IAsyncOperationUint64.fromPtr(ptr, tResultIntType: tResultIntType) }; return asyncOperation as IAsyncOperation; } @@ -109,14 +129,25 @@ abstract interface class IAsyncOperation extends IInspectable } if (isSubtypeOfWinRTFlagsEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); - return _IAsyncOperationWinRTFlagsEnum.fromPtr(ptr, - enumCreator: enumCreator); + if (tResultEnumCreator == null) { + throw ArgumentError.notNull('tResultEnumCreator'); + } + + return _IAsyncOperationWinRTFlagsEnum.fromPtr( + ptr, + tResultEnumCreator: tResultEnumCreator, + ); } if (isSubtypeOfWinRTEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); - return _IAsyncOperationWinRTEnum.fromPtr(ptr, enumCreator: enumCreator); + if (tResultEnumCreator == null) { + throw ArgumentError.notNull('tResultEnumCreator'); + } + + return _IAsyncOperationWinRTEnum.fromPtr( + ptr, + tResultEnumCreator: tResultEnumCreator, + ); } if (isSubtypeOfWinRTStruct()) { diff --git a/packages/windows_foundation/lib/src/iasyncoperation_part.dart b/packages/windows_foundation/lib/src/iasyncoperation_part.dart index f5736674..ca7d8c34 100644 --- a/packages/windows_foundation/lib/src/iasyncoperation_part.dart +++ b/packages/windows_foundation/lib/src/iasyncoperation_part.dart @@ -51,7 +51,7 @@ final class __IAsyncOperationBoolVtbl extends Struct { } final class _IAsyncOperationDouble extends IAsyncOperation { - _IAsyncOperationDouble.fromPtr(super.ptr); + _IAsyncOperationDouble.fromPtr(super.ptr, {super.tResultDoubleType}); late final __IAsyncOperationDoubleVtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationDoubleVtbl>().ref; @@ -92,7 +92,7 @@ final class __IAsyncOperationDoubleVtbl extends Struct { } final class _IAsyncOperationFloat extends IAsyncOperation { - _IAsyncOperationFloat.fromPtr(super.ptr); + _IAsyncOperationFloat.fromPtr(super.ptr, {super.tResultDoubleType}); late final __IAsyncOperationFloatVtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationFloatVtbl>().ref; @@ -174,7 +174,7 @@ final class __IAsyncOperationGuidVtbl extends Struct { } final class _IAsyncOperationInt16 extends IAsyncOperation { - _IAsyncOperationInt16.fromPtr(super.ptr); + _IAsyncOperationInt16.fromPtr(super.ptr, {super.tResultIntType}); late final __IAsyncOperationInt16Vtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationInt16Vtbl>().ref; @@ -215,7 +215,7 @@ final class __IAsyncOperationInt16Vtbl extends Struct { } final class _IAsyncOperationInt32 extends IAsyncOperation { - _IAsyncOperationInt32.fromPtr(super.ptr); + _IAsyncOperationInt32.fromPtr(super.ptr, {super.tResultIntType}); late final __IAsyncOperationInt32Vtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationInt32Vtbl>().ref; @@ -256,7 +256,7 @@ final class __IAsyncOperationInt32Vtbl extends Struct { } final class _IAsyncOperationInt64 extends IAsyncOperation { - _IAsyncOperationInt64.fromPtr(super.ptr); + _IAsyncOperationInt64.fromPtr(super.ptr, {super.tResultIntType}); late final __IAsyncOperationInt64Vtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationInt64Vtbl>().ref; @@ -341,11 +341,12 @@ final class __IAsyncOperationLoadMoreItemsResultVtbl extends Struct { final class _IAsyncOperationInspectable extends IAsyncOperation { - _IAsyncOperationInspectable.fromPtr(super.ptr, {required this.creator}); + _IAsyncOperationInspectable.fromPtr(super.ptr, + {required this.tResultObjectCreator}); late final __IAsyncOperationInspectableVtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator tResultObjectCreator; @override TResult getResults() { @@ -365,7 +366,7 @@ final class _IAsyncOperationInspectable return null as TResult; } - return creator(retValuePtr); + return tResultObjectCreator(retValuePtr); } } @@ -521,7 +522,7 @@ final class __IAsyncOperationStringVtbl extends Struct { } final class _IAsyncOperationUint8 extends IAsyncOperation { - _IAsyncOperationUint8.fromPtr(super.ptr); + _IAsyncOperationUint8.fromPtr(super.ptr, {super.tResultIntType}); late final __IAsyncOperationUint8Vtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationUint8Vtbl>().ref; @@ -562,7 +563,7 @@ final class __IAsyncOperationUint8Vtbl extends Struct { } final class _IAsyncOperationUint16 extends IAsyncOperation { - _IAsyncOperationUint16.fromPtr(super.ptr); + _IAsyncOperationUint16.fromPtr(super.ptr, {super.tResultIntType}); late final __IAsyncOperationUint16Vtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationUint16Vtbl>().ref; @@ -603,7 +604,7 @@ final class __IAsyncOperationUint16Vtbl extends Struct { } final class _IAsyncOperationUint32 extends IAsyncOperation { - _IAsyncOperationUint32.fromPtr(super.ptr); + _IAsyncOperationUint32.fromPtr(super.ptr, {super.tResultIntType}); late final __IAsyncOperationUint32Vtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationUint32Vtbl>().ref; @@ -644,7 +645,7 @@ final class __IAsyncOperationUint32Vtbl extends Struct { } final class _IAsyncOperationUint64 extends IAsyncOperation { - _IAsyncOperationUint64.fromPtr(super.ptr); + _IAsyncOperationUint64.fromPtr(super.ptr, {super.tResultIntType}); late final __IAsyncOperationUint64Vtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationUint64Vtbl>().ref; @@ -686,11 +687,12 @@ final class __IAsyncOperationUint64Vtbl extends Struct { final class _IAsyncOperationWinRTEnum extends IAsyncOperation { - _IAsyncOperationWinRTEnum.fromPtr(super.ptr, {required this.enumCreator}); + _IAsyncOperationWinRTEnum.fromPtr(super.ptr, + {required this.tResultEnumCreator}); late final __IAsyncOperationWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tResultEnumCreator; @override TResult getResults() { @@ -703,7 +705,7 @@ final class _IAsyncOperationWinRTEnum if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tResultEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -730,11 +732,11 @@ final class __IAsyncOperationWinRTEnumVtbl extends Struct { final class _IAsyncOperationWinRTFlagsEnum extends IAsyncOperation { _IAsyncOperationWinRTFlagsEnum.fromPtr(super.ptr, - {required this.enumCreator}); + {required this.tResultEnumCreator}); late final __IAsyncOperationWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IAsyncOperationWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tResultEnumCreator; @override TResult getResults() { @@ -747,7 +749,7 @@ final class _IAsyncOperationWinRTFlagsEnum if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tResultEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } diff --git a/packages/windows_foundation/lib/src/ireference.dart b/packages/windows_foundation/lib/src/ireference.dart index 040674e7..789d19be 100644 --- a/packages/windows_foundation/lib/src/ireference.dart +++ b/packages/windows_foundation/lib/src/ireference.dart @@ -35,15 +35,15 @@ abstract interface class IReference extends IInspectable { /// `int?`, `String?`, `WinRTEnum?` (e.g., `WebErrorStatus?`), or /// `WinRTStruct?` (e.g., `BasicGeoposition?`). /// - /// [enumCreator] must be specified if [T] is `WinRTEnum?`. + /// [tEnumCreator] must be specified if [T] is `WinRTEnum?`. /// ```dart /// final reference = IReference.fromPtr(ptr, - /// enumCreator: WebErrorStatus.from); + /// tEnumCreator: WebErrorStatus.from); /// ``` factory IReference.fromPtr( Pointer ptr, { required String referenceIid, - EnumCreator? enumCreator, + EnumCreator? tEnumCreator, }) { if (isSameType()) { return _IReferenceBool.fromPtr(ptr) as IReference; @@ -91,13 +91,13 @@ abstract interface class IReference extends IInspectable { } if (isSubtypeOfWinRTFlagsEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); - return _IReferenceWinRTFlagsEnum.fromPtr(ptr, enumCreator: enumCreator); + if (tEnumCreator == null) throw ArgumentError.notNull('tEnumCreator'); + return _IReferenceWinRTFlagsEnum.fromPtr(ptr, tEnumCreator: tEnumCreator); } if (isSubtypeOfWinRTEnum()) { - if (enumCreator == null) throw ArgumentError.notNull('enumCreator'); - return _IReferenceWinRTEnum.fromPtr(ptr, enumCreator: enumCreator); + if (tEnumCreator == null) throw ArgumentError.notNull('tEnumCreator'); + return _IReferenceWinRTEnum.fromPtr(ptr, tEnumCreator: tEnumCreator); } if (isSubtypeOfWinRTStruct()) { diff --git a/packages/windows_foundation/lib/src/ireference_part.dart b/packages/windows_foundation/lib/src/ireference_part.dart index fba01da4..0c7fe8e3 100644 --- a/packages/windows_foundation/lib/src/ireference_part.dart +++ b/packages/windows_foundation/lib/src/ireference_part.dart @@ -1122,11 +1122,11 @@ final class __IReferenceWhiteBalanceGainVtbl extends Struct { } final class _IReferenceWinRTEnum extends IReference { - _IReferenceWinRTEnum.fromPtr(super.ptr, {required this.enumCreator}); + _IReferenceWinRTEnum.fromPtr(super.ptr, {required this.tEnumCreator}); late final __IReferenceWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IReferenceWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T get value { @@ -1141,7 +1141,7 @@ final class _IReferenceWinRTEnum extends IReference { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -1157,11 +1157,11 @@ final class __IReferenceWinRTEnumVtbl extends Struct { } final class _IReferenceWinRTFlagsEnum extends IReference { - _IReferenceWinRTFlagsEnum.fromPtr(super.ptr, {required this.enumCreator}); + _IReferenceWinRTFlagsEnum.fromPtr(super.ptr, {required this.tEnumCreator}); late final __IReferenceWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IReferenceWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T get value { @@ -1176,7 +1176,7 @@ final class _IReferenceWinRTFlagsEnum extends IReference { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } diff --git a/packages/windows_foundation/lib/src/iwwwformurldecoderruntimeclass.dart b/packages/windows_foundation/lib/src/iwwwformurldecoderruntimeclass.dart index 346e8cdd..81c6917f 100644 --- a/packages/windows_foundation/lib/src/iwwwformurldecoderruntimeclass.dart +++ b/packages/windows_foundation/lib/src/iwwwformurldecoderruntimeclass.dart @@ -59,8 +59,8 @@ class IWwwFormUrlDecoderRuntimeClass extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{b1f00d3b-1f06-5117-93ea-2a0d79116701}'), - creator: IWwwFormUrlDecoderEntry.fromPtr, - iterableIid: '{876be83b-7218-5bfb-a169-83152ef7e146}'); + iterableIid: '{876be83b-7218-5bfb-a169-83152ef7e146}', + tObjectCreator: IWwwFormUrlDecoderEntry.fromPtr); @override IWwwFormUrlDecoderEntry? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_foundation/lib/src/wwwformurldecoder.dart b/packages/windows_foundation/lib/src/wwwformurldecoder.dart index a4140681..2d897157 100644 --- a/packages/windows_foundation/lib/src/wwwformurldecoder.dart +++ b/packages/windows_foundation/lib/src/wwwformurldecoder.dart @@ -49,8 +49,8 @@ class WwwFormUrlDecoder extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{b1f00d3b-1f06-5117-93ea-2a0d79116701}'), - creator: IWwwFormUrlDecoderEntry.fromPtr, - iterableIid: '{876be83b-7218-5bfb-a169-83152ef7e146}'); + iterableIid: '{876be83b-7218-5bfb-a169-83152ef7e146}', + tObjectCreator: IWwwFormUrlDecoderEntry.fromPtr); @override IWwwFormUrlDecoderEntry? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_gaming/lib/src/input/igamepadstatics.dart b/packages/windows_gaming/lib/src/input/igamepadstatics.dart index 3cf0d819..3104edfe 100644 --- a/packages/windows_gaming/lib/src/input/igamepadstatics.dart +++ b/packages/windows_gaming/lib/src/input/igamepadstatics.dart @@ -97,7 +97,7 @@ class IGamepadStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{47132ba0-6b17-5cd2-a8bd-b5d3443ccb13}', - creator: Gamepad.fromPtr) + tObjectCreator: Gamepad.fromPtr) .toList(); } } diff --git a/packages/windows_globalization/lib/src/collation/charactergroupings.dart b/packages/windows_globalization/lib/src/collation/charactergroupings.dart index 426f0b4b..6e8653aa 100644 --- a/packages/windows_globalization/lib/src/collation/charactergroupings.dart +++ b/packages/windows_globalization/lib/src/collation/charactergroupings.dart @@ -46,8 +46,8 @@ class CharacterGroupings extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{f7cf5a4a-2b7a-5bc9-a0c4-9dce07ff61c9}'), - creator: CharacterGrouping.fromPtr, - iterableIid: '{82e3abf0-06e3-5609-ba39-c51eb2f5fae6}'); + iterableIid: '{82e3abf0-06e3-5609-ba39-c51eb2f5fae6}', + tObjectCreator: CharacterGrouping.fromPtr); @override CharacterGrouping? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_globalization/lib/src/collation/icharactergroupings.dart b/packages/windows_globalization/lib/src/collation/icharactergroupings.dart index 2eb6d95b..10ea4f19 100644 --- a/packages/windows_globalization/lib/src/collation/icharactergroupings.dart +++ b/packages/windows_globalization/lib/src/collation/icharactergroupings.dart @@ -49,8 +49,8 @@ class ICharacterGroupings extends IInspectable late final _iVectorView = IVectorView.fromPtr( toInterface('{f7cf5a4a-2b7a-5bc9-a0c4-9dce07ff61c9}'), - creator: CharacterGrouping.fromPtr, - iterableIid: '{82e3abf0-06e3-5609-ba39-c51eb2f5fae6}'); + iterableIid: '{82e3abf0-06e3-5609-ba39-c51eb2f5fae6}', + tObjectCreator: CharacterGrouping.fromPtr); @override CharacterGrouping? getAt(int index) => _iVectorView.getAt(index); diff --git a/packages/windows_globalization/lib/src/ijapanesephoneticanalyzerstatics.dart b/packages/windows_globalization/lib/src/ijapanesephoneticanalyzerstatics.dart index 108958dd..1d29aac1 100644 --- a/packages/windows_globalization/lib/src/ijapanesephoneticanalyzerstatics.dart +++ b/packages/windows_globalization/lib/src/ijapanesephoneticanalyzerstatics.dart @@ -47,7 +47,7 @@ class IJapanesePhoneticAnalyzerStatics extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{1aad17cb-1829-5236-8aef-0b75f8dfd7a6}', - creator: JapanesePhoneme.fromPtr) + tObjectCreator: JapanesePhoneme.fromPtr) .toList(); } @@ -67,7 +67,7 @@ class IJapanesePhoneticAnalyzerStatics extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{1aad17cb-1829-5236-8aef-0b75f8dfd7a6}', - creator: JapanesePhoneme.fromPtr) + tObjectCreator: JapanesePhoneme.fromPtr) .toList(); } } diff --git a/packages/windows_graphics/lib/src/imaging/bitmappropertyset.dart b/packages/windows_graphics/lib/src/imaging/bitmappropertyset.dart index 0d7c165e..85260a39 100644 --- a/packages/windows_graphics/lib/src/imaging/bitmappropertyset.dart +++ b/packages/windows_graphics/lib/src/imaging/bitmappropertyset.dart @@ -30,8 +30,8 @@ class BitmapPropertySet extends IInspectable late final _iMap = IMap.fromPtr( toInterface('{2c70ef8d-5d4c-5185-8db7-fed87728165d}'), - creator: BitmapTypedValue.fromPtr, - iterableIid: '{05f9430c-2f22-5638-aa89-8c9abcd54ff9}'); + iterableIid: '{05f9430c-2f22-5638-aa89-8c9abcd54ff9}', + vObjectCreator: BitmapTypedValue.fromPtr); @override BitmapTypedValue? lookup(String key) => _iMap.lookup(key); diff --git a/packages/windows_graphics/lib/src/imaging/ibitmapdecoder.dart b/packages/windows_graphics/lib/src/imaging/ibitmapdecoder.dart index ca035599..c438a0a9 100644 --- a/packages/windows_graphics/lib/src/imaging/ibitmapdecoder.dart +++ b/packages/windows_graphics/lib/src/imaging/ibitmapdecoder.dart @@ -102,7 +102,7 @@ class IBitmapDecoder extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: ImageStream.fromPtr); + tResultObjectCreator: ImageStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -119,7 +119,7 @@ class IBitmapDecoder extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: BitmapFrame.fromPtr); + tResultObjectCreator: BitmapFrame.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_graphics/lib/src/imaging/ibitmapdecoderstatics.dart b/packages/windows_graphics/lib/src/imaging/ibitmapdecoderstatics.dart index fa3a93f5..c231372f 100644 --- a/packages/windows_graphics/lib/src/imaging/ibitmapdecoderstatics.dart +++ b/packages/windows_graphics/lib/src/imaging/ibitmapdecoderstatics.dart @@ -160,7 +160,7 @@ class IBitmapDecoderStatics extends IInspectable { return IVectorView.fromPtr( decoderInformationEnumerator, iterableIid: '{2b6bdb90-a4eb-5142-b582-3ccb1edc5789}', - creator: BitmapCodecInformation.fromPtr) + tObjectCreator: BitmapCodecInformation.fromPtr) .toList(); } @@ -177,7 +177,7 @@ class IBitmapDecoderStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: BitmapDecoder.fromPtr); + tResultObjectCreator: BitmapDecoder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -199,7 +199,7 @@ class IBitmapDecoderStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: BitmapDecoder.fromPtr); + tResultObjectCreator: BitmapDecoder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_graphics/lib/src/imaging/ibitmapframe.dart b/packages/windows_graphics/lib/src/imaging/ibitmapframe.dart index eee2c26b..42566041 100644 --- a/packages/windows_graphics/lib/src/imaging/ibitmapframe.dart +++ b/packages/windows_graphics/lib/src/imaging/ibitmapframe.dart @@ -50,7 +50,7 @@ class IBitmapFrame extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: ImageStream.fromPtr); + tResultObjectCreator: ImageStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -216,7 +216,7 @@ class IBitmapFrame extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: PixelDataProvider.fromPtr); + tResultObjectCreator: PixelDataProvider.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -252,7 +252,7 @@ class IBitmapFrame extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: PixelDataProvider.fromPtr); + tResultObjectCreator: PixelDataProvider.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_graphics/lib/src/imaging/ibitmapframewithsoftwarebitmap.dart b/packages/windows_graphics/lib/src/imaging/ibitmapframewithsoftwarebitmap.dart index 59f5a7c4..385ab9c1 100644 --- a/packages/windows_graphics/lib/src/imaging/ibitmapframewithsoftwarebitmap.dart +++ b/packages/windows_graphics/lib/src/imaging/ibitmapframewithsoftwarebitmap.dart @@ -56,7 +56,7 @@ class IBitmapFrameWithSoftwareBitmap extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: SoftwareBitmap.fromPtr); + tResultObjectCreator: SoftwareBitmap.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -75,7 +75,7 @@ class IBitmapFrameWithSoftwareBitmap extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: SoftwareBitmap.fromPtr); + tResultObjectCreator: SoftwareBitmap.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -110,7 +110,7 @@ class IBitmapFrameWithSoftwareBitmap extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: SoftwareBitmap.fromPtr); + tResultObjectCreator: SoftwareBitmap.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_graphics/lib/src/imaging/ibitmappropertiesview.dart b/packages/windows_graphics/lib/src/imaging/ibitmappropertiesview.dart index 6a7fc63d..3f76c24d 100644 --- a/packages/windows_graphics/lib/src/imaging/ibitmappropertiesview.dart +++ b/packages/windows_graphics/lib/src/imaging/ibitmappropertiesview.dart @@ -47,7 +47,7 @@ class IBitmapPropertiesView extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: BitmapPropertySet.fromPtr); + tResultObjectCreator: BitmapPropertySet.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_graphics/lib/src/imaging/isoftwarebitmapstatics.dart b/packages/windows_graphics/lib/src/imaging/isoftwarebitmapstatics.dart index 505473c7..0d4d2c3e 100644 --- a/packages/windows_graphics/lib/src/imaging/isoftwarebitmapstatics.dart +++ b/packages/windows_graphics/lib/src/imaging/isoftwarebitmapstatics.dart @@ -155,7 +155,7 @@ class ISoftwareBitmapStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: SoftwareBitmap.fromPtr); + tResultObjectCreator: SoftwareBitmap.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -174,7 +174,7 @@ class ISoftwareBitmapStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: SoftwareBitmap.fromPtr); + tResultObjectCreator: SoftwareBitmap.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_graphics/lib/src/printing3d/iprinting3dmultiplepropertymaterial.dart b/packages/windows_graphics/lib/src/printing3d/iprinting3dmultiplepropertymaterial.dart index 2d035f16..aa2c4899 100644 --- a/packages/windows_graphics/lib/src/printing3d/iprinting3dmultiplepropertymaterial.dart +++ b/packages/windows_graphics/lib/src/printing3d/iprinting3dmultiplepropertymaterial.dart @@ -50,7 +50,7 @@ class IPrinting3DMultiplePropertyMaterial extends IInspectable { return IVector.fromPtr(value, iterableIid: '{421d4b91-b13b-5f37-ae54-b5249bd80539}', - intType: IntType.uint32); + tIntType: IntType.uint32); } } diff --git a/packages/windows_media/lib/src/capture/frames/imediaframereader.dart b/packages/windows_media/lib/src/capture/frames/imediaframereader.dart index fe075538..0a3859be 100644 --- a/packages/windows_media/lib/src/capture/frames/imediaframereader.dart +++ b/packages/windows_media/lib/src/capture/frames/imediaframereader.dart @@ -90,7 +90,7 @@ class IMediaFrameReader extends IInspectable implements IClosable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: MediaFrameReaderStartStatus.from); + tResultEnumCreator: MediaFrameReaderStartStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/capture/frames/imediaframesource.dart b/packages/windows_media/lib/src/capture/frames/imediaframesource.dart index d35a2403..c067fe7d 100644 --- a/packages/windows_media/lib/src/capture/frames/imediaframesource.dart +++ b/packages/windows_media/lib/src/capture/frames/imediaframesource.dart @@ -93,7 +93,7 @@ class IMediaFrameSource extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{1f029a27-1123-538a-9261-8a380e12bac6}', - creator: MediaFrameFormat.fromPtr) + tObjectCreator: MediaFrameFormat.fromPtr) .toList(); } diff --git a/packages/windows_media/lib/src/capture/frames/imediaframesourcecontroller.dart b/packages/windows_media/lib/src/capture/frames/imediaframesourcecontroller.dart index 0ad702ae..2a057a1b 100644 --- a/packages/windows_media/lib/src/capture/frames/imediaframesourcecontroller.dart +++ b/packages/windows_media/lib/src/capture/frames/imediaframesourcecontroller.dart @@ -49,7 +49,7 @@ class IMediaFrameSourceController extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(value, - creator: MediaFrameSourceGetPropertyResult.fromPtr); + tResultObjectCreator: MediaFrameSourceGetPropertyResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -72,7 +72,7 @@ class IMediaFrameSourceController extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(value, - enumCreator: MediaFrameSourceSetPropertyStatus.from); + tResultEnumCreator: MediaFrameSourceSetPropertyStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/capture/frames/imediaframesourcecontroller2.dart b/packages/windows_media/lib/src/capture/frames/imediaframesourcecontroller2.dart index 67243787..f71993c0 100644 --- a/packages/windows_media/lib/src/capture/frames/imediaframesourcecontroller2.dart +++ b/packages/windows_media/lib/src/capture/frames/imediaframesourcecontroller2.dart @@ -60,7 +60,7 @@ class IMediaFrameSourceController2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: MediaFrameSourceGetPropertyResult.fromPtr); + tResultObjectCreator: MediaFrameSourceGetPropertyResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -95,7 +95,7 @@ class IMediaFrameSourceController2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - enumCreator: MediaFrameSourceSetPropertyStatus.from); + tResultEnumCreator: MediaFrameSourceSetPropertyStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_media/lib/src/capture/frames/imediaframesourcegroup.dart b/packages/windows_media/lib/src/capture/frames/imediaframesourcegroup.dart index bc291a3e..b531c1dc 100644 --- a/packages/windows_media/lib/src/capture/frames/imediaframesourcegroup.dart +++ b/packages/windows_media/lib/src/capture/frames/imediaframesourcegroup.dart @@ -81,7 +81,7 @@ class IMediaFrameSourceGroup extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{2e29c5b0-6aa9-50f2-91a4-5b67a5598f2e}', - creator: MediaFrameSourceInfo.fromPtr) + tObjectCreator: MediaFrameSourceInfo.fromPtr) .toList(); } } diff --git a/packages/windows_media/lib/src/capture/frames/imediaframesourcegroupstatics.dart b/packages/windows_media/lib/src/capture/frames/imediaframesourcegroupstatics.dart index 7f7b3852..a45d5d13 100644 --- a/packages/windows_media/lib/src/capture/frames/imediaframesourcegroupstatics.dart +++ b/packages/windows_media/lib/src/capture/frames/imediaframesourcegroupstatics.dart @@ -46,9 +46,9 @@ class IMediaFrameSourceGroupStatics extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(value, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: MediaFrameSourceGroup.fromPtr, - iterableIid: '{d0b71deb-76e8-5833-9623-2b1e1a8e1b72}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{d0b71deb-76e8-5833-9623-2b1e1a8e1b72}', + tObjectCreator: MediaFrameSourceGroup.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -66,7 +66,7 @@ class IMediaFrameSourceGroupStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( value, - creator: MediaFrameSourceGroup.fromPtr); + tResultObjectCreator: MediaFrameSourceGroup.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/capture/frames/imediaframesourceinfo2.dart b/packages/windows_media/lib/src/capture/frames/imediaframesourceinfo2.dart index abbea2f7..1bdc6e0c 100644 --- a/packages/windows_media/lib/src/capture/frames/imediaframesourceinfo2.dart +++ b/packages/windows_media/lib/src/capture/frames/imediaframesourceinfo2.dart @@ -66,7 +66,7 @@ class IMediaFrameSourceInfo2 extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{0895e56d-fe1f-5364-ab67-c597d8970b89}', - creator: MediaCaptureVideoProfileMediaDescription.fromPtr) + tObjectCreator: MediaCaptureVideoProfileMediaDescription.fromPtr) .toList(); } } diff --git a/packages/windows_media/lib/src/capture/frames/imultisourcemediaframereader.dart b/packages/windows_media/lib/src/capture/frames/imultisourcemediaframereader.dart index 9abc0c3e..84ee81c8 100644 --- a/packages/windows_media/lib/src/capture/frames/imultisourcemediaframereader.dart +++ b/packages/windows_media/lib/src/capture/frames/imultisourcemediaframereader.dart @@ -93,7 +93,7 @@ class IMultiSourceMediaFrameReader extends IInspectable implements IClosable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: MultiSourceMediaFrameReaderStartStatus.from); + tResultEnumCreator: MultiSourceMediaFrameReaderStartStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/capture/iadvancedphotocapture.dart b/packages/windows_media/lib/src/capture/iadvancedphotocapture.dart index bb0e400f..1b00dccd 100644 --- a/packages/windows_media/lib/src/capture/iadvancedphotocapture.dart +++ b/packages/windows_media/lib/src/capture/iadvancedphotocapture.dart @@ -45,7 +45,7 @@ class IAdvancedPhotoCapture extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: AdvancedCapturedPhoto.fromPtr); + tResultObjectCreator: AdvancedCapturedPhoto.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -64,7 +64,7 @@ class IAdvancedPhotoCapture extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: AdvancedCapturedPhoto.fromPtr); + tResultObjectCreator: AdvancedCapturedPhoto.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/capture/icapturedframecontrolvalues.dart b/packages/windows_media/lib/src/capture/icapturedframecontrolvalues.dart index 7ebef702..447b31ed 100644 --- a/packages/windows_media/lib/src/capture/icapturedframecontrolvalues.dart +++ b/packages/windows_media/lib/src/capture/icapturedframecontrolvalues.dart @@ -139,7 +139,7 @@ class ICapturedFrameControlValues extends IInspectable { return IReference.fromPtr(value, referenceIid: '{e20596aa-0bbe-5203-be6b-6b71ff5b0843}', - enumCreator: CaptureSceneMode.from) + tEnumCreator: CaptureSceneMode.from) .value; } diff --git a/packages/windows_media/lib/src/capture/icapturedframecontrolvalues2.dart b/packages/windows_media/lib/src/capture/icapturedframecontrolvalues2.dart index ac587946..994df248 100644 --- a/packages/windows_media/lib/src/capture/icapturedframecontrolvalues2.dart +++ b/packages/windows_media/lib/src/capture/icapturedframecontrolvalues2.dart @@ -53,7 +53,7 @@ class ICapturedFrameControlValues2 extends IInspectable { return IReference.fromPtr(value, referenceIid: '{58820185-5da0-5faa-86da-9bd9f03974fa}', - enumCreator: MediaCaptureFocusState.from) + tEnumCreator: MediaCaptureFocusState.from) .value; } diff --git a/packages/windows_media/lib/src/capture/ilowlagmediarecording3.dart b/packages/windows_media/lib/src/capture/ilowlagmediarecording3.dart index e7702112..f4842084 100644 --- a/packages/windows_media/lib/src/capture/ilowlagmediarecording3.dart +++ b/packages/windows_media/lib/src/capture/ilowlagmediarecording3.dart @@ -47,7 +47,7 @@ class ILowLagMediaRecording3 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: MediaCapturePauseResult.fromPtr); + tResultObjectCreator: MediaCapturePauseResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -65,7 +65,7 @@ class ILowLagMediaRecording3 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: MediaCaptureStopResult.fromPtr); + tResultObjectCreator: MediaCaptureStopResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_media/lib/src/capture/ilowlagphotocapture.dart b/packages/windows_media/lib/src/capture/ilowlagphotocapture.dart index 7e347d01..a566c4d1 100644 --- a/packages/windows_media/lib/src/capture/ilowlagphotocapture.dart +++ b/packages/windows_media/lib/src/capture/ilowlagphotocapture.dart @@ -43,7 +43,7 @@ class ILowLagPhotoCapture extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: CapturedPhoto.fromPtr); + tResultObjectCreator: CapturedPhoto.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/capture/imediacapture2.dart b/packages/windows_media/lib/src/capture/imediacapture2.dart index c68f8f89..157cc601 100644 --- a/packages/windows_media/lib/src/capture/imediacapture2.dart +++ b/packages/windows_media/lib/src/capture/imediacapture2.dart @@ -55,7 +55,7 @@ class IMediaCapture2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: LowLagMediaRecording.fromPtr); + tResultObjectCreator: LowLagMediaRecording.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -75,7 +75,7 @@ class IMediaCapture2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: LowLagMediaRecording.fromPtr); + tResultObjectCreator: LowLagMediaRecording.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -95,7 +95,7 @@ class IMediaCapture2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: LowLagMediaRecording.fromPtr); + tResultObjectCreator: LowLagMediaRecording.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -125,7 +125,7 @@ class IMediaCapture2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: LowLagMediaRecording.fromPtr); + tResultObjectCreator: LowLagMediaRecording.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -144,7 +144,7 @@ class IMediaCapture2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: LowLagPhotoCapture.fromPtr); + tResultObjectCreator: LowLagPhotoCapture.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -163,7 +163,7 @@ class IMediaCapture2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: LowLagPhotoSequenceCapture.fromPtr); + tResultObjectCreator: LowLagPhotoSequenceCapture.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/capture/imediacapture3.dart b/packages/windows_media/lib/src/capture/imediacapture3.dart index 2cfcabff..fc33441a 100644 --- a/packages/windows_media/lib/src/capture/imediacapture3.dart +++ b/packages/windows_media/lib/src/capture/imediacapture3.dart @@ -47,7 +47,7 @@ class IMediaCapture3 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: VariablePhotoSequenceCapture.fromPtr); + tResultObjectCreator: VariablePhotoSequenceCapture.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/capture/imediacapture4.dart b/packages/windows_media/lib/src/capture/imediacapture4.dart index 788ddb62..15456e0a 100644 --- a/packages/windows_media/lib/src/capture/imediacapture4.dart +++ b/packages/windows_media/lib/src/capture/imediacapture4.dart @@ -54,7 +54,7 @@ class IMediaCapture4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(op, - creator: IMediaExtension.fromPtr); + tResultObjectCreator: IMediaExtension.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -73,7 +73,7 @@ class IMediaCapture4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(op, - creator: IMediaExtension.fromPtr); + tResultObjectCreator: IMediaExtension.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -160,7 +160,7 @@ class IMediaCapture4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: VideoFrame.fromPtr); + tResultObjectCreator: VideoFrame.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -178,7 +178,7 @@ class IMediaCapture4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: VideoFrame.fromPtr); + tResultObjectCreator: VideoFrame.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -238,7 +238,7 @@ class IMediaCapture4 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: AdvancedPhotoCapture.fromPtr); + tResultObjectCreator: AdvancedPhotoCapture.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_media/lib/src/capture/imediacapture5.dart b/packages/windows_media/lib/src/capture/imediacapture5.dart index 605e096a..13b4a792 100644 --- a/packages/windows_media/lib/src/capture/imediacapture5.dart +++ b/packages/windows_media/lib/src/capture/imediacapture5.dart @@ -66,7 +66,7 @@ class IMediaCapture5 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: MediaCapturePauseResult.fromPtr); + tResultObjectCreator: MediaCapturePauseResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -84,7 +84,7 @@ class IMediaCapture5 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: MediaCaptureStopResult.fromPtr); + tResultObjectCreator: MediaCaptureStopResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -107,7 +107,7 @@ class IMediaCapture5 extends IInspectable { return IMapView.fromPtr(value, iterableIid: '{a038e80f-0b3d-5cd4-849d-13036e1f506e}', - creator: MediaFrameSource.fromPtr) + vObjectCreator: MediaFrameSource.fromPtr) .toMap(); } @@ -125,7 +125,7 @@ class IMediaCapture5 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: MediaFrameReader.fromPtr); + tResultObjectCreator: MediaFrameReader.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -144,7 +144,7 @@ class IMediaCapture5 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: MediaFrameReader.fromPtr); + tResultObjectCreator: MediaFrameReader.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -172,7 +172,7 @@ class IMediaCapture5 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: MediaFrameReader.fromPtr); + tResultObjectCreator: MediaFrameReader.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_media/lib/src/capture/imediacapture6.dart b/packages/windows_media/lib/src/capture/imediacapture6.dart index 2c0fd825..e930e400 100644 --- a/packages/windows_media/lib/src/capture/imediacapture6.dart +++ b/packages/windows_media/lib/src/capture/imediacapture6.dart @@ -73,7 +73,7 @@ class IMediaCapture6 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(value, - creator: MultiSourceMediaFrameReader.fromPtr); + tResultObjectCreator: MultiSourceMediaFrameReader.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_media/lib/src/capture/imediacapturestatics.dart b/packages/windows_media/lib/src/capture/imediacapturestatics.dart index df09f44d..bcd9edd3 100644 --- a/packages/windows_media/lib/src/capture/imediacapturestatics.dart +++ b/packages/windows_media/lib/src/capture/imediacapturestatics.dart @@ -62,7 +62,7 @@ class IMediaCaptureStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{dbd49d71-e07b-5e11-824a-62ace8bdfc3e}', - creator: MediaCaptureVideoProfile.fromPtr) + tObjectCreator: MediaCaptureVideoProfile.fromPtr) .toList(); } @@ -81,7 +81,7 @@ class IMediaCaptureStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{dbd49d71-e07b-5e11-824a-62ace8bdfc3e}', - creator: MediaCaptureVideoProfile.fromPtr) + tObjectCreator: MediaCaptureVideoProfile.fromPtr) .toList(); } @@ -101,7 +101,7 @@ class IMediaCaptureStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{dbd49d71-e07b-5e11-824a-62ace8bdfc3e}', - creator: MediaCaptureVideoProfile.fromPtr) + tObjectCreator: MediaCaptureVideoProfile.fromPtr) .toList(); } } diff --git a/packages/windows_media/lib/src/capture/imediacapturevideoprofile.dart b/packages/windows_media/lib/src/capture/imediacapturevideoprofile.dart index 74e0c0ac..88c7f88a 100644 --- a/packages/windows_media/lib/src/capture/imediacapturevideoprofile.dart +++ b/packages/windows_media/lib/src/capture/imediacapturevideoprofile.dart @@ -83,7 +83,7 @@ class IMediaCaptureVideoProfile extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{0895e56d-fe1f-5364-ab67-c597d8970b89}', - creator: MediaCaptureVideoProfileMediaDescription.fromPtr) + tObjectCreator: MediaCaptureVideoProfileMediaDescription.fromPtr) .toList(); } @@ -107,7 +107,7 @@ class IMediaCaptureVideoProfile extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{0895e56d-fe1f-5364-ab67-c597d8970b89}', - creator: MediaCaptureVideoProfileMediaDescription.fromPtr) + tObjectCreator: MediaCaptureVideoProfileMediaDescription.fromPtr) .toList(); } @@ -131,7 +131,7 @@ class IMediaCaptureVideoProfile extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{0895e56d-fe1f-5364-ab67-c597d8970b89}', - creator: MediaCaptureVideoProfileMediaDescription.fromPtr) + tObjectCreator: MediaCaptureVideoProfileMediaDescription.fromPtr) .toList(); } @@ -149,7 +149,7 @@ class IMediaCaptureVideoProfile extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{dbd49d71-e07b-5e11-824a-62ace8bdfc3e}', - creator: MediaCaptureVideoProfile.fromPtr) + tObjectCreator: MediaCaptureVideoProfile.fromPtr) .toList(); } } diff --git a/packages/windows_media/lib/src/capture/imediacapturevideoprofile2.dart b/packages/windows_media/lib/src/capture/imediacapturevideoprofile2.dart index 471c5caf..fe39500b 100644 --- a/packages/windows_media/lib/src/capture/imediacapturevideoprofile2.dart +++ b/packages/windows_media/lib/src/capture/imediacapturevideoprofile2.dart @@ -49,7 +49,7 @@ class IMediaCaptureVideoProfile2 extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{2e29c5b0-6aa9-50f2-91a4-5b67a5598f2e}', - creator: MediaFrameSourceInfo.fromPtr) + tObjectCreator: MediaFrameSourceInfo.fromPtr) .toList(); } diff --git a/packages/windows_media/lib/src/devices/core/ivariablephotosequencecontroller.dart b/packages/windows_media/lib/src/devices/core/ivariablephotosequencecontroller.dart index e5d1c432..af5704d8 100644 --- a/packages/windows_media/lib/src/devices/core/ivariablephotosequencecontroller.dart +++ b/packages/windows_media/lib/src/devices/core/ivariablephotosequencecontroller.dart @@ -173,7 +173,7 @@ class IVariablePhotoSequenceController extends IInspectable { return IVector.fromPtr(items, iterableIid: '{bd8eeadc-2dd9-5ad8-ac5d-f3b13b94b9c2}', - creator: FrameController.fromPtr); + tObjectCreator: FrameController.fromPtr); } } diff --git a/packages/windows_media/lib/src/devices/iadvancedphotocontrol.dart b/packages/windows_media/lib/src/devices/iadvancedphotocontrol.dart index 377bcbe8..26150028 100644 --- a/packages/windows_media/lib/src/devices/iadvancedphotocontrol.dart +++ b/packages/windows_media/lib/src/devices/iadvancedphotocontrol.dart @@ -66,7 +66,7 @@ class IAdvancedPhotoControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{7d090784-70a9-570c-be82-0d0890318975}', - enumCreator: AdvancedPhotoMode.from) + tEnumCreator: AdvancedPhotoMode.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/idigitalwindowcontrol.dart b/packages/windows_media/lib/src/devices/idigitalwindowcontrol.dart index ad2ce3c1..e688fb8a 100644 --- a/packages/windows_media/lib/src/devices/idigitalwindowcontrol.dart +++ b/packages/windows_media/lib/src/devices/idigitalwindowcontrol.dart @@ -140,7 +140,7 @@ class IDigitalWindowControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{a4f28d49-fb50-5c0d-ba48-6695e4612500}', - creator: DigitalWindowCapability.fromPtr) + tObjectCreator: DigitalWindowCapability.fromPtr) .toList(); } diff --git a/packages/windows_media/lib/src/devices/ifocuscontrol.dart b/packages/windows_media/lib/src/devices/ifocuscontrol.dart index 9e2a47ac..4e9dae84 100644 --- a/packages/windows_media/lib/src/devices/ifocuscontrol.dart +++ b/packages/windows_media/lib/src/devices/ifocuscontrol.dart @@ -65,7 +65,7 @@ class IFocusControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{26ba711b-3a32-5216-bc34-61ecafbebdc1}', - enumCreator: FocusPreset.from) + tEnumCreator: FocusPreset.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/ifocuscontrol2.dart b/packages/windows_media/lib/src/devices/ifocuscontrol2.dart index a9cebaa1..17c1d34e 100644 --- a/packages/windows_media/lib/src/devices/ifocuscontrol2.dart +++ b/packages/windows_media/lib/src/devices/ifocuscontrol2.dart @@ -85,7 +85,7 @@ class IFocusControl2 extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{561bc21f-4ae2-580a-a216-0ad48f373a4c}', - enumCreator: FocusMode.from) + tEnumCreator: FocusMode.from) .toList(); } @@ -108,7 +108,7 @@ class IFocusControl2 extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{cf8cbeb1-2a4c-522d-962f-84c31a598d68}', - enumCreator: ManualFocusDistance.from) + tEnumCreator: ManualFocusDistance.from) .toList(); } @@ -131,7 +131,7 @@ class IFocusControl2 extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{751664c6-f8d6-50a3-ab80-137c6d908c55}', - enumCreator: AutoFocusRange.from) + tEnumCreator: AutoFocusRange.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/ifocussettings.dart b/packages/windows_media/lib/src/devices/ifocussettings.dart index 78fe4049..c8af2b33 100644 --- a/packages/windows_media/lib/src/devices/ifocussettings.dart +++ b/packages/windows_media/lib/src/devices/ifocussettings.dart @@ -129,7 +129,7 @@ class IFocusSettings extends IInspectable { return IReference.fromPtr(value, referenceIid: '{b0060b8a-1105-5ad4-963d-f6cf1905d349}', - enumCreator: ManualFocusDistance.from) + tEnumCreator: ManualFocusDistance.from) .value; } diff --git a/packages/windows_media/lib/src/devices/ihdrvideocontrol.dart b/packages/windows_media/lib/src/devices/ihdrvideocontrol.dart index f85e5a91..a4a1aab9 100644 --- a/packages/windows_media/lib/src/devices/ihdrvideocontrol.dart +++ b/packages/windows_media/lib/src/devices/ihdrvideocontrol.dart @@ -65,7 +65,7 @@ class IHdrVideoControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{1d9679a7-2d06-5294-ac67-f9cd3561dcb8}', - enumCreator: HdrVideoMode.from) + tEnumCreator: HdrVideoMode.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/iinfraredtorchcontrol.dart b/packages/windows_media/lib/src/devices/iinfraredtorchcontrol.dart index 7087f918..96d7bfc3 100644 --- a/packages/windows_media/lib/src/devices/iinfraredtorchcontrol.dart +++ b/packages/windows_media/lib/src/devices/iinfraredtorchcontrol.dart @@ -65,7 +65,7 @@ class IInfraredTorchControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{58a4b7b6-36c3-5541-b383-3690d7293c10}', - enumCreator: InfraredTorchMode.from) + tEnumCreator: InfraredTorchMode.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/iisospeedcontrol.dart b/packages/windows_media/lib/src/devices/iisospeedcontrol.dart index 97974522..9edd3537 100644 --- a/packages/windows_media/lib/src/devices/iisospeedcontrol.dart +++ b/packages/windows_media/lib/src/devices/iisospeedcontrol.dart @@ -67,7 +67,7 @@ class IIsoSpeedControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{94839abe-9712-545a-a94d-a567a3e8dfb7}', - enumCreator: IsoSpeedPreset.from) + tEnumCreator: IsoSpeedPreset.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/imediadevicecontroller.dart b/packages/windows_media/lib/src/devices/imediadevicecontroller.dart index 7605dec3..df66fdac 100644 --- a/packages/windows_media/lib/src/devices/imediadevicecontroller.dart +++ b/packages/windows_media/lib/src/devices/imediadevicecontroller.dart @@ -46,7 +46,7 @@ class IMediaDeviceController extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{d7fc75d5-3492-5bbb-9b34-dac3e24e79d0}', - creator: IMediaEncodingProperties.fromPtr) + tObjectCreator: IMediaEncodingProperties.fromPtr) .toList(); } diff --git a/packages/windows_media/lib/src/devices/iopticalimagestabilizationcontrol.dart b/packages/windows_media/lib/src/devices/iopticalimagestabilizationcontrol.dart index 266a74ad..d60ade06 100644 --- a/packages/windows_media/lib/src/devices/iopticalimagestabilizationcontrol.dart +++ b/packages/windows_media/lib/src/devices/iopticalimagestabilizationcontrol.dart @@ -68,7 +68,7 @@ class IOpticalImageStabilizationControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{323d7734-94c2-544d-a560-56560fe68819}', - enumCreator: OpticalImageStabilizationMode.from) + tEnumCreator: OpticalImageStabilizationMode.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/iscenemodecontrol.dart b/packages/windows_media/lib/src/devices/iscenemodecontrol.dart index 3b78f4ef..fbcdda7b 100644 --- a/packages/windows_media/lib/src/devices/iscenemodecontrol.dart +++ b/packages/windows_media/lib/src/devices/iscenemodecontrol.dart @@ -49,7 +49,7 @@ class ISceneModeControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{16d26b98-2cbc-52f0-ab64-1723714418e9}', - enumCreator: CaptureSceneMode.from) + tEnumCreator: CaptureSceneMode.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/ivideotemporaldenoisingcontrol.dart b/packages/windows_media/lib/src/devices/ivideotemporaldenoisingcontrol.dart index c0fc085a..7def32b6 100644 --- a/packages/windows_media/lib/src/devices/ivideotemporaldenoisingcontrol.dart +++ b/packages/windows_media/lib/src/devices/ivideotemporaldenoisingcontrol.dart @@ -68,7 +68,7 @@ class IVideoTemporalDenoisingControl extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{caf26629-ee84-5d4c-ae37-9dc4b26978eb}', - enumCreator: VideoTemporalDenoisingMode.from) + tEnumCreator: VideoTemporalDenoisingMode.from) .toList(); } diff --git a/packages/windows_media/lib/src/devices/izoomcontrol2.dart b/packages/windows_media/lib/src/devices/izoomcontrol2.dart index 8d661c23..ae9f120e 100644 --- a/packages/windows_media/lib/src/devices/izoomcontrol2.dart +++ b/packages/windows_media/lib/src/devices/izoomcontrol2.dart @@ -50,7 +50,7 @@ class IZoomControl2 extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{db656915-8fac-5fb2-98e0-0e97421656c5}', - enumCreator: ZoomTransitionMode.from) + tEnumCreator: ZoomTransitionMode.from) .toList(); } diff --git a/packages/windows_media/lib/src/mediaproperties/imediaencodingprofile2.dart b/packages/windows_media/lib/src/mediaproperties/imediaencodingprofile2.dart index 955579ad..3fa20a66 100644 --- a/packages/windows_media/lib/src/mediaproperties/imediaencodingprofile2.dart +++ b/packages/windows_media/lib/src/mediaproperties/imediaencodingprofile2.dart @@ -53,7 +53,7 @@ class IMediaEncodingProfile2 extends IInspectable { return IVector.fromPtr(value, iterableIid: '{a3e2c972-a171-5b94-8389-e983ebc3f3b9}', - creator: AudioStreamDescriptor.fromPtr); + tObjectCreator: AudioStreamDescriptor.fromPtr); } void setVideoTracks(IIterable? value) { @@ -78,7 +78,7 @@ class IMediaEncodingProfile2 extends IInspectable { return IVector.fromPtr(value, iterableIid: '{3acbf03c-0a79-5823-aaa9-d88bc3f8f594}', - creator: VideoStreamDescriptor.fromPtr); + tObjectCreator: VideoStreamDescriptor.fromPtr); } } diff --git a/packages/windows_media/lib/src/mediaproperties/imediaencodingprofile3.dart b/packages/windows_media/lib/src/mediaproperties/imediaencodingprofile3.dart index 8266a6fd..faf423ac 100644 --- a/packages/windows_media/lib/src/mediaproperties/imediaencodingprofile3.dart +++ b/packages/windows_media/lib/src/mediaproperties/imediaencodingprofile3.dart @@ -53,7 +53,7 @@ class IMediaEncodingProfile3 extends IInspectable { return IVector.fromPtr(result, iterableIid: '{f3d07841-3852-509d-a12b-a9f2ac89da93}', - creator: TimedMetadataStreamDescriptor.fromPtr); + tObjectCreator: TimedMetadataStreamDescriptor.fromPtr); } } diff --git a/packages/windows_media/lib/src/mediaproperties/imediaencodingprofilestatics.dart b/packages/windows_media/lib/src/mediaproperties/imediaencodingprofilestatics.dart index c6452fe2..991e52bb 100644 --- a/packages/windows_media/lib/src/mediaproperties/imediaencodingprofilestatics.dart +++ b/packages/windows_media/lib/src/mediaproperties/imediaencodingprofilestatics.dart @@ -149,7 +149,7 @@ class IMediaEncodingProfileStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: MediaEncodingProfile.fromPtr); + tResultObjectCreator: MediaEncodingProfile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -168,7 +168,7 @@ class IMediaEncodingProfileStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: MediaEncodingProfile.fromPtr); + tResultObjectCreator: MediaEncodingProfile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_media/lib/src/ocr/iocrengine.dart b/packages/windows_media/lib/src/ocr/iocrengine.dart index e4671a91..aac3a69d 100644 --- a/packages/windows_media/lib/src/ocr/iocrengine.dart +++ b/packages/windows_media/lib/src/ocr/iocrengine.dart @@ -44,8 +44,8 @@ class IOcrEngine extends IInspectable { throwWindowsException(hr); } - final asyncOperation = - IAsyncOperation.fromPtr(result, creator: OcrResult.fromPtr); + final asyncOperation = IAsyncOperation.fromPtr(result, + tResultObjectCreator: OcrResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_media/lib/src/ocr/iocrenginestatics.dart b/packages/windows_media/lib/src/ocr/iocrenginestatics.dart index 2fdf81e6..3240640b 100644 --- a/packages/windows_media/lib/src/ocr/iocrenginestatics.dart +++ b/packages/windows_media/lib/src/ocr/iocrenginestatics.dart @@ -66,7 +66,7 @@ class IOcrEngineStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{48409a10-61b6-5db1-a69d-8abc46ac608a}', - creator: Language.fromPtr) + tObjectCreator: Language.fromPtr) .toList(); } diff --git a/packages/windows_media/lib/src/ocr/iocrline.dart b/packages/windows_media/lib/src/ocr/iocrline.dart index 49001ac3..7e965505 100644 --- a/packages/windows_media/lib/src/ocr/iocrline.dart +++ b/packages/windows_media/lib/src/ocr/iocrline.dart @@ -49,7 +49,7 @@ class IOcrLine extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{a0ce663a-46d0-55e5-928e-251eb67a1e99}', - creator: OcrWord.fromPtr) + tObjectCreator: OcrWord.fromPtr) .toList(); } diff --git a/packages/windows_media/lib/src/ocr/iocrresult.dart b/packages/windows_media/lib/src/ocr/iocrresult.dart index 3dd06064..d0fca5de 100644 --- a/packages/windows_media/lib/src/ocr/iocrresult.dart +++ b/packages/windows_media/lib/src/ocr/iocrresult.dart @@ -49,7 +49,7 @@ class IOcrResult extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{6afa94a2-60d7-5dbe-942d-81aa3929c85e}', - creator: OcrLine.fromPtr) + tObjectCreator: OcrLine.fromPtr) .toList(); } diff --git a/packages/windows_networking/lib/src/connectivity/iconnectionprofile2.dart b/packages/windows_networking/lib/src/connectivity/iconnectionprofile2.dart index 2f8243cc..660f879f 100644 --- a/packages/windows_networking/lib/src/connectivity/iconnectionprofile2.dart +++ b/packages/windows_networking/lib/src/connectivity/iconnectionprofile2.dart @@ -200,9 +200,9 @@ class IConnectionProfile2 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( value, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: NetworkUsage.fromPtr, - iterableIid: '{dd2656b1-8360-5772-b272-c47f7f0fc7a6}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{dd2656b1-8360-5772-b272-c47f7f0fc7a6}', + tObjectCreator: NetworkUsage.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -229,9 +229,9 @@ class IConnectionProfile2 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(value, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: ConnectivityInterval.fromPtr, - iterableIid: '{58051a8b-b259-5414-9b9a-caa0789e833e}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{58051a8b-b259-5414-9b9a-caa0789e833e}', + tObjectCreator: ConnectivityInterval.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } } diff --git a/packages/windows_networking/lib/src/connectivity/iconnectionprofile3.dart b/packages/windows_networking/lib/src/connectivity/iconnectionprofile3.dart index e530805d..1b1552f6 100644 --- a/packages/windows_networking/lib/src/connectivity/iconnectionprofile3.dart +++ b/packages/windows_networking/lib/src/connectivity/iconnectionprofile3.dart @@ -54,9 +54,9 @@ class IConnectionProfile3 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(value, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: AttributedNetworkUsage.fromPtr, - iterableIid: '{d061dcb9-6854-5ef9-8e03-008a7a704c48}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{d061dcb9-6854-5ef9-8e03-008a7a704c48}', + tObjectCreator: AttributedNetworkUsage.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } } diff --git a/packages/windows_networking/lib/src/connectivity/iconnectionprofile4.dart b/packages/windows_networking/lib/src/connectivity/iconnectionprofile4.dart index 58882888..c52cdbd3 100644 --- a/packages/windows_networking/lib/src/connectivity/iconnectionprofile4.dart +++ b/packages/windows_networking/lib/src/connectivity/iconnectionprofile4.dart @@ -54,9 +54,9 @@ class IConnectionProfile4 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(value, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: ProviderNetworkUsage.fromPtr, - iterableIid: '{f79bc7ba-01df-51ec-bfaf-fd883f698e07}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{f79bc7ba-01df-51ec-bfaf-fd883f698e07}', + tObjectCreator: ProviderNetworkUsage.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } } diff --git a/packages/windows_networking/lib/src/connectivity/iconnectionprofile5.dart b/packages/windows_networking/lib/src/connectivity/iconnectionprofile5.dart index 300ba705..a2762091 100644 --- a/packages/windows_networking/lib/src/connectivity/iconnectionprofile5.dart +++ b/packages/windows_networking/lib/src/connectivity/iconnectionprofile5.dart @@ -60,7 +60,7 @@ class IConnectionProfile5 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - enumCreator: ConnectionProfileDeleteStatus.from); + tResultEnumCreator: ConnectionProfileDeleteStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_networking/lib/src/connectivity/ilanidentifierdata.dart b/packages/windows_networking/lib/src/connectivity/ilanidentifierdata.dart index d3d15349..2f0278a7 100644 --- a/packages/windows_networking/lib/src/connectivity/ilanidentifierdata.dart +++ b/packages/windows_networking/lib/src/connectivity/ilanidentifierdata.dart @@ -63,7 +63,7 @@ class ILanIdentifierData extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{88318266-f3fd-50fc-8f08-b823a41b60c1}', - intType: IntType.uint8) + tIntType: IntType.uint8) .toList(); } } diff --git a/packages/windows_networking/lib/src/connectivity/inetworkadapter.dart b/packages/windows_networking/lib/src/connectivity/inetworkadapter.dart index a8dfb3b4..0929377e 100644 --- a/packages/windows_networking/lib/src/connectivity/inetworkadapter.dart +++ b/packages/windows_networking/lib/src/connectivity/inetworkadapter.dart @@ -128,7 +128,7 @@ class INetworkAdapter extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: ConnectionProfile.fromPtr); + tResultObjectCreator: ConnectionProfile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_networking/lib/src/connectivity/inetworkinformationstatics.dart b/packages/windows_networking/lib/src/connectivity/inetworkinformationstatics.dart index a7e6d6dd..9fcc03bc 100644 --- a/packages/windows_networking/lib/src/connectivity/inetworkinformationstatics.dart +++ b/packages/windows_networking/lib/src/connectivity/inetworkinformationstatics.dart @@ -49,7 +49,7 @@ class INetworkInformationStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{34dabef9-87d0-5b1c-a7ac-9d290adeb0c8}', - creator: ConnectionProfile.fromPtr) + tObjectCreator: ConnectionProfile.fromPtr) .toList(); } @@ -87,7 +87,7 @@ class INetworkInformationStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{accef3cd-5d92-5c01-8ac4-79fe74cd733e}', - creator: LanIdentifier.fromPtr) + tObjectCreator: LanIdentifier.fromPtr) .toList(); } @@ -105,7 +105,7 @@ class INetworkInformationStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{9e5f3ed0-cf1c-5d38-832c-acea6164bf5c}', - creator: HostName.fromPtr) + tObjectCreator: HostName.fromPtr) .toList(); } @@ -123,7 +123,7 @@ class INetworkInformationStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(value, - creator: ProxyConfiguration.fromPtr); + tResultObjectCreator: ProxyConfiguration.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -144,7 +144,7 @@ class INetworkInformationStatics extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{d7ec83c4-a17b-51bf-8997-aa33b9102dc9}', - creator: EndpointPair.fromPtr) + tObjectCreator: EndpointPair.fromPtr) .toList(); } diff --git a/packages/windows_networking/lib/src/connectivity/inetworkinformationstatics2.dart b/packages/windows_networking/lib/src/connectivity/inetworkinformationstatics2.dart index 3b17aec3..76c8c2dc 100644 --- a/packages/windows_networking/lib/src/connectivity/inetworkinformationstatics2.dart +++ b/packages/windows_networking/lib/src/connectivity/inetworkinformationstatics2.dart @@ -49,9 +49,9 @@ class INetworkInformationStatics2 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( value, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: ConnectionProfile.fromPtr, - iterableIid: '{34dabef9-87d0-5b1c-a7ac-9d290adeb0c8}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{34dabef9-87d0-5b1c-a7ac-9d290adeb0c8}', + tObjectCreator: ConnectionProfile.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } } diff --git a/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringclient.dart b/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringclient.dart index ad51c734..245e3c9d 100644 --- a/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringclient.dart +++ b/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringclient.dart @@ -68,7 +68,7 @@ class INetworkOperatorTetheringClient extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{9e5f3ed0-cf1c-5d38-832c-acea6164bf5c}', - creator: HostName.fromPtr) + tObjectCreator: HostName.fromPtr) .toList(); } } diff --git a/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringclientmanager.dart b/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringclientmanager.dart index 09e5c4e0..290c826e 100644 --- a/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringclientmanager.dart +++ b/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringclientmanager.dart @@ -48,7 +48,7 @@ class INetworkOperatorTetheringClientManager extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{4762ecb3-af48-5b63-89b7-78a42056549f}', - creator: NetworkOperatorTetheringClient.fromPtr) + tObjectCreator: NetworkOperatorTetheringClient.fromPtr) .toList(); } } diff --git a/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringmanager.dart b/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringmanager.dart index 5ab280bc..ec185816 100644 --- a/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringmanager.dart +++ b/packages/windows_networking/lib/src/networkoperators/inetworkoperatortetheringmanager.dart @@ -137,7 +137,8 @@ class INetworkOperatorTetheringManager extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: NetworkOperatorTetheringOperationResult.fromPtr); + tResultObjectCreator: + NetworkOperatorTetheringOperationResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -156,7 +157,8 @@ class INetworkOperatorTetheringManager extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: NetworkOperatorTetheringOperationResult.fromPtr); + tResultObjectCreator: + NetworkOperatorTetheringOperationResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_networking/test/collections_test.dart b/packages/windows_networking/test/collections_test.dart index 78f26366..6469335b 100644 --- a/packages/windows_networking/test/collections_test.dart +++ b/packages/windows_networking/test/collections_test.dart @@ -40,8 +40,11 @@ void main() { throwWindowsException(hr); } - return IVectorView.fromPtr(retValuePtr, - creator: HostName.fromPtr, iterableIid: IID_IIterable_HostName); + return IVectorView.fromPtr( + retValuePtr, + iterableIid: IID_IIterable_HostName, + tObjectCreator: HostName.fromPtr, + ); } IVectorView getVectorView() { diff --git a/packages/windows_security/lib/src/authentication/web/core/ifindallaccountsresult.dart b/packages/windows_security/lib/src/authentication/web/core/ifindallaccountsresult.dart index 7d62a482..767650fa 100644 --- a/packages/windows_security/lib/src/authentication/web/core/ifindallaccountsresult.dart +++ b/packages/windows_security/lib/src/authentication/web/core/ifindallaccountsresult.dart @@ -51,7 +51,7 @@ class IFindAllAccountsResult extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{cb15d439-a910-542a-89ed-7cfe67848a83}', - creator: WebAccount.fromPtr) + tObjectCreator: WebAccount.fromPtr) .toList(); } diff --git a/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics.dart b/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics.dart index 58f46666..de3c990a 100644 --- a/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics.dart +++ b/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics.dart @@ -52,7 +52,7 @@ class IWebAuthenticationCoreManagerStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: WebTokenRequestResult.fromPtr); + tResultObjectCreator: WebTokenRequestResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -72,7 +72,7 @@ class IWebAuthenticationCoreManagerStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: WebTokenRequestResult.fromPtr); + tResultObjectCreator: WebTokenRequestResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -90,7 +90,7 @@ class IWebAuthenticationCoreManagerStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: WebTokenRequestResult.fromPtr); + tResultObjectCreator: WebTokenRequestResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -110,7 +110,7 @@ class IWebAuthenticationCoreManagerStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: WebTokenRequestResult.fromPtr); + tResultObjectCreator: WebTokenRequestResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -129,7 +129,7 @@ class IWebAuthenticationCoreManagerStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(asyncInfo, - creator: WebAccount.fromPtr); + tResultObjectCreator: WebAccount.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -149,7 +149,7 @@ class IWebAuthenticationCoreManagerStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: WebAccountProvider.fromPtr); + tResultObjectCreator: WebAccountProvider.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -169,7 +169,7 @@ class IWebAuthenticationCoreManagerStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: WebAccountProvider.fromPtr); + tResultObjectCreator: WebAccountProvider.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics2.dart b/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics2.dart index e7ccb5e2..f275e99c 100644 --- a/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics2.dart +++ b/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics2.dart @@ -64,7 +64,7 @@ class IWebAuthenticationCoreManagerStatics2 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: WebAccountProvider.fromPtr); + tResultObjectCreator: WebAccountProvider.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics4.dart b/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics4.dart index 78e2eb4b..bc37ad8f 100644 --- a/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics4.dart +++ b/packages/windows_security/lib/src/authentication/web/core/iwebauthenticationcoremanagerstatics4.dart @@ -57,7 +57,7 @@ class IWebAuthenticationCoreManagerStatics4 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: FindAllAccountsResult.fromPtr); + tResultObjectCreator: FindAllAccountsResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -77,7 +77,7 @@ class IWebAuthenticationCoreManagerStatics4 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: FindAllAccountsResult.fromPtr); + tResultObjectCreator: FindAllAccountsResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -97,7 +97,7 @@ class IWebAuthenticationCoreManagerStatics4 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: WebAccountProvider.fromPtr); + tResultObjectCreator: WebAccountProvider.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -117,7 +117,7 @@ class IWebAuthenticationCoreManagerStatics4 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: WebAccountProvider.fromPtr); + tResultObjectCreator: WebAccountProvider.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -147,7 +147,7 @@ class IWebAuthenticationCoreManagerStatics4 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: WebAccountProvider.fromPtr); + tResultObjectCreator: WebAccountProvider.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_security/lib/src/authentication/web/core/iwebtokenrequestresult.dart b/packages/windows_security/lib/src/authentication/web/core/iwebtokenrequestresult.dart index 8caa530a..d26f8755 100644 --- a/packages/windows_security/lib/src/authentication/web/core/iwebtokenrequestresult.dart +++ b/packages/windows_security/lib/src/authentication/web/core/iwebtokenrequestresult.dart @@ -51,7 +51,7 @@ class IWebTokenRequestResult extends IInspectable { return IVectorView.fromPtr(value, iterableIid: '{7e5bb7ec-bbd7-5575-9a61-f5815fa22a0e}', - creator: WebTokenResponse.fromPtr) + tObjectCreator: WebTokenResponse.fromPtr) .toList(); } diff --git a/packages/windows_security/lib/src/credentials/iwebaccount2.dart b/packages/windows_security/lib/src/credentials/iwebaccount2.dart index 3928cfb4..9c50f2dc 100644 --- a/packages/windows_security/lib/src/credentials/iwebaccount2.dart +++ b/packages/windows_security/lib/src/credentials/iwebaccount2.dart @@ -88,7 +88,7 @@ class IWebAccount2 extends IInspectable implements IWebAccount { final asyncOperation = IAsyncOperation.fromPtr( asyncInfo, - creator: IRandomAccessStream.fromPtr); + tResultObjectCreator: IRandomAccessStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_security/lib/src/winrt_com_interop_helpers.dart b/packages/windows_security/lib/src/winrt_com_interop_helpers.dart index f195b6af..80b54009 100644 --- a/packages/windows_security/lib/src/winrt_com_interop_helpers.dart +++ b/packages/windows_security/lib/src/winrt_com_interop_helpers.dart @@ -57,8 +57,9 @@ final class WebAuthenticationCoreManagerInterop { } final asyncOperation = IAsyncOperation.fromPtr( - asyncOperationPtr, - creator: WebTokenRequestResult.fromPtr); + asyncOperationPtr, + tResultObjectCreator: WebTokenRequestResult.fromPtr, + ); return asyncOperation.toFuture(asyncOperation.getResults); } finally { free(pIID); @@ -99,8 +100,9 @@ final class WebAuthenticationCoreManagerInterop { } final asyncOperation = IAsyncOperation.fromPtr( - asyncOperationPtr, - creator: WebTokenRequestResult.fromPtr); + asyncOperationPtr, + tResultObjectCreator: WebTokenRequestResult.fromPtr, + ); return asyncOperation.toFuture(asyncOperation.getResults); } finally { free(pIID); diff --git a/packages/windows_storage/lib/src/fileproperties/istorageitemcontentproperties.dart b/packages/windows_storage/lib/src/fileproperties/istorageitemcontentproperties.dart index 03f2ef6b..25b931b9 100644 --- a/packages/windows_storage/lib/src/fileproperties/istorageitemcontentproperties.dart +++ b/packages/windows_storage/lib/src/fileproperties/istorageitemcontentproperties.dart @@ -50,7 +50,7 @@ class IStorageItemContentProperties extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: MusicProperties.fromPtr); + tResultObjectCreator: MusicProperties.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -67,7 +67,7 @@ class IStorageItemContentProperties extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: VideoProperties.fromPtr); + tResultObjectCreator: VideoProperties.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -84,7 +84,7 @@ class IStorageItemContentProperties extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: ImageProperties.fromPtr); + tResultObjectCreator: ImageProperties.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -102,7 +102,7 @@ class IStorageItemContentProperties extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: DocumentProperties.fromPtr); + tResultObjectCreator: DocumentProperties.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/fileproperties/istorageitemextraproperties.dart b/packages/windows_storage/lib/src/fileproperties/istorageitemextraproperties.dart index 09f044c1..e8b57854 100644 --- a/packages/windows_storage/lib/src/fileproperties/istorageitemextraproperties.dart +++ b/packages/windows_storage/lib/src/fileproperties/istorageitemextraproperties.dart @@ -48,7 +48,7 @@ class IStorageItemExtraProperties extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IMap.fromPtr(ptr, + tResultObjectCreator: (ptr) => IMap.fromPtr(ptr, iterableIid: '{fe2f3d47-5d47-5499-8374-430c7cda0204}')); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/iapplicationdatacontainer.dart b/packages/windows_storage/lib/src/iapplicationdatacontainer.dart index a0cd02b5..d1516fc8 100644 --- a/packages/windows_storage/lib/src/iapplicationdatacontainer.dart +++ b/packages/windows_storage/lib/src/iapplicationdatacontainer.dart @@ -103,7 +103,7 @@ class IApplicationDataContainer extends IInspectable { return IMapView.fromPtr(value, iterableIid: '{a785be1d-159e-53ad-9553-598b03dca048}', - creator: ApplicationDataContainer.fromPtr) + vObjectCreator: ApplicationDataContainer.fromPtr) .toMap(); } diff --git a/packages/windows_storage/lib/src/iapplicationdatastatics2.dart b/packages/windows_storage/lib/src/iapplicationdatastatics2.dart index d385e120..1bc8ef78 100644 --- a/packages/windows_storage/lib/src/iapplicationdatastatics2.dart +++ b/packages/windows_storage/lib/src/iapplicationdatastatics2.dart @@ -46,7 +46,7 @@ class IApplicationDataStatics2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( getForUserOperation, - creator: ApplicationData.fromPtr); + tResultObjectCreator: ApplicationData.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/idownloadsfolderstatics.dart b/packages/windows_storage/lib/src/idownloadsfolderstatics.dart index 13803c84..ff7b6bc0 100644 --- a/packages/windows_storage/lib/src/idownloadsfolderstatics.dart +++ b/packages/windows_storage/lib/src/idownloadsfolderstatics.dart @@ -46,7 +46,7 @@ class IDownloadsFolderStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -64,7 +64,7 @@ class IDownloadsFolderStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -83,7 +83,7 @@ class IDownloadsFolderStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -102,7 +102,7 @@ class IDownloadsFolderStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/idownloadsfolderstatics2.dart b/packages/windows_storage/lib/src/idownloadsfolderstatics2.dart index fd8541fe..5fe04c86 100644 --- a/packages/windows_storage/lib/src/idownloadsfolderstatics2.dart +++ b/packages/windows_storage/lib/src/idownloadsfolderstatics2.dart @@ -47,7 +47,7 @@ class IDownloadsFolderStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -66,7 +66,7 @@ class IDownloadsFolderStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -85,7 +85,7 @@ class IDownloadsFolderStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -104,7 +104,7 @@ class IDownloadsFolderStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/ifileiostatics.dart b/packages/windows_storage/lib/src/ifileiostatics.dart index c4fd2b9d..da9ed80a 100644 --- a/packages/windows_storage/lib/src/ifileiostatics.dart +++ b/packages/windows_storage/lib/src/ifileiostatics.dart @@ -148,7 +148,7 @@ class IFileIOStatics extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( linesOperation, - creator: (ptr) => IVector.fromPtr(ptr, + tResultObjectCreator: (ptr) => IVector.fromPtr(ptr, iterableIid: '{e2fcc7c1-3bfc-5a0b-b2b0-72e769d1cb7e}')); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -169,7 +169,7 @@ class IFileIOStatics extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( linesOperation, - creator: (ptr) => IVector.fromPtr(ptr, + tResultObjectCreator: (ptr) => IVector.fromPtr(ptr, iterableIid: '{e2fcc7c1-3bfc-5a0b-b2b0-72e769d1cb7e}')); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -260,8 +260,8 @@ class IFileIOStatics extends IInspectable { throwWindowsException(hr); } - final asyncOperation = - IAsyncOperation.fromPtr(operation, creator: IBuffer.fromPtr); + final asyncOperation = IAsyncOperation.fromPtr(operation, + tResultObjectCreator: IBuffer.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/iknownfoldersstatics3.dart b/packages/windows_storage/lib/src/iknownfoldersstatics3.dart index 69522616..95bf0f39 100644 --- a/packages/windows_storage/lib/src/iknownfoldersstatics3.dart +++ b/packages/windows_storage/lib/src/iknownfoldersstatics3.dart @@ -47,7 +47,7 @@ class IKnownFoldersStatics3 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/iknownfoldersstatics4.dart b/packages/windows_storage/lib/src/iknownfoldersstatics4.dart index 9019cf4e..0399dd78 100644 --- a/packages/windows_storage/lib/src/iknownfoldersstatics4.dart +++ b/packages/windows_storage/lib/src/iknownfoldersstatics4.dart @@ -47,7 +47,7 @@ class IKnownFoldersStatics4 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: KnownFoldersAccessStatus.from); + tResultEnumCreator: KnownFoldersAccessStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -67,7 +67,7 @@ class IKnownFoldersStatics4 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: KnownFoldersAccessStatus.from); + tResultEnumCreator: KnownFoldersAccessStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -84,7 +84,7 @@ class IKnownFoldersStatics4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/istoragefile.dart b/packages/windows_storage/lib/src/istoragefile.dart index ca910f6a..49deb6c4 100644 --- a/packages/windows_storage/lib/src/istoragefile.dart +++ b/packages/windows_storage/lib/src/istoragefile.dart @@ -95,7 +95,7 @@ class IStorageFile extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: IRandomAccessStream.fromPtr); + tResultObjectCreator: IRandomAccessStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -113,7 +113,7 @@ class IStorageFile extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageStreamTransaction.fromPtr); + tResultObjectCreator: StorageStreamTransaction.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -132,7 +132,7 @@ class IStorageFile extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -151,7 +151,7 @@ class IStorageFile extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -178,7 +178,7 @@ class IStorageFile extends IInspectable } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/istoragefile2.dart b/packages/windows_storage/lib/src/istoragefile2.dart index 8f5c2e0b..37557924 100644 --- a/packages/windows_storage/lib/src/istoragefile2.dart +++ b/packages/windows_storage/lib/src/istoragefile2.dart @@ -49,7 +49,7 @@ class IStorageFile2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: IRandomAccessStream.fromPtr); + tResultObjectCreator: IRandomAccessStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -68,7 +68,7 @@ class IStorageFile2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageStreamTransaction.fromPtr); + tResultObjectCreator: StorageStreamTransaction.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/istoragefilestatics.dart b/packages/windows_storage/lib/src/istoragefilestatics.dart index 232af7c0..00f4b698 100644 --- a/packages/windows_storage/lib/src/istoragefilestatics.dart +++ b/packages/windows_storage/lib/src/istoragefilestatics.dart @@ -46,7 +46,7 @@ class IStorageFileStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -64,7 +64,7 @@ class IStorageFileStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -93,7 +93,7 @@ class IStorageFileStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -118,7 +118,7 @@ class IStorageFileStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -147,7 +147,7 @@ class IStorageFileStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -172,7 +172,7 @@ class IStorageFileStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/istoragefilestatics2.dart b/packages/windows_storage/lib/src/istoragefilestatics2.dart index 1b58e1eb..082582ea 100644 --- a/packages/windows_storage/lib/src/istoragefilestatics2.dart +++ b/packages/windows_storage/lib/src/istoragefilestatics2.dart @@ -45,7 +45,7 @@ class IStorageFileStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/istoragefolder.dart b/packages/windows_storage/lib/src/istoragefolder.dart index 54726459..1c0a93e9 100644 --- a/packages/windows_storage/lib/src/istoragefolder.dart +++ b/packages/windows_storage/lib/src/istoragefolder.dart @@ -53,7 +53,7 @@ class IStorageFolder extends IInspectable implements IStorageItem { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -72,7 +72,7 @@ class IStorageFolder extends IInspectable implements IStorageItem { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -91,7 +91,7 @@ class IStorageFolder extends IInspectable implements IStorageItem { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -110,7 +110,7 @@ class IStorageFolder extends IInspectable implements IStorageItem { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -128,7 +128,7 @@ class IStorageFolder extends IInspectable implements IStorageItem { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -146,7 +146,7 @@ class IStorageFolder extends IInspectable implements IStorageItem { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -164,7 +164,7 @@ class IStorageFolder extends IInspectable implements IStorageItem { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: IStorageItem.fromPtr); + tResultObjectCreator: IStorageItem.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -184,9 +184,9 @@ class IStorageFolder extends IInspectable implements IStorageItem { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFile.fromPtr, - iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', + tObjectCreator: StorageFile.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -206,9 +206,9 @@ class IStorageFolder extends IInspectable implements IStorageItem { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFolder.fromPtr, - iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}', + tObjectCreator: StorageFolder.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -226,9 +226,9 @@ class IStorageFolder extends IInspectable implements IStorageItem { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: IStorageItem.fromPtr, - iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}', + tObjectCreator: IStorageItem.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } diff --git a/packages/windows_storage/lib/src/istoragefolder2.dart b/packages/windows_storage/lib/src/istoragefolder2.dart index 5a5f2e9a..18200fc7 100644 --- a/packages/windows_storage/lib/src/istoragefolder2.dart +++ b/packages/windows_storage/lib/src/istoragefolder2.dart @@ -44,7 +44,7 @@ class IStorageFolder2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: IStorageItem.fromPtr); + tResultObjectCreator: IStorageItem.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/istoragefolderstatics.dart b/packages/windows_storage/lib/src/istoragefolderstatics.dart index dd8bd3c8..68fc7ce1 100644 --- a/packages/windows_storage/lib/src/istoragefolderstatics.dart +++ b/packages/windows_storage/lib/src/istoragefolderstatics.dart @@ -44,7 +44,7 @@ class IStorageFolderStatics extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/istoragefolderstatics2.dart b/packages/windows_storage/lib/src/istoragefolderstatics2.dart index 9c961f83..37bebabc 100644 --- a/packages/windows_storage/lib/src/istoragefolderstatics2.dart +++ b/packages/windows_storage/lib/src/istoragefolderstatics2.dart @@ -46,7 +46,7 @@ class IStorageFolderStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/istorageitem.dart b/packages/windows_storage/lib/src/istorageitem.dart index bd211340..f9865d83 100644 --- a/packages/windows_storage/lib/src/istorageitem.dart +++ b/packages/windows_storage/lib/src/istorageitem.dart @@ -109,7 +109,7 @@ class IStorageItem extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: BasicProperties.fromPtr); + tResultObjectCreator: BasicProperties.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/istorageitem2.dart b/packages/windows_storage/lib/src/istorageitem2.dart index 72705ada..165f83a9 100644 --- a/packages/windows_storage/lib/src/istorageitem2.dart +++ b/packages/windows_storage/lib/src/istorageitem2.dart @@ -49,7 +49,7 @@ class IStorageItem2 extends IInspectable implements IStorageItem { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/istorageitemproperties.dart b/packages/windows_storage/lib/src/istorageitemproperties.dart index 03734172..6a9dd9cc 100644 --- a/packages/windows_storage/lib/src/istorageitemproperties.dart +++ b/packages/windows_storage/lib/src/istorageitemproperties.dart @@ -49,7 +49,7 @@ class IStorageItemProperties extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageItemThumbnail.fromPtr); + tResultObjectCreator: StorageItemThumbnail.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -69,7 +69,7 @@ class IStorageItemProperties extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageItemThumbnail.fromPtr); + tResultObjectCreator: StorageItemThumbnail.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -89,7 +89,7 @@ class IStorageItemProperties extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageItemThumbnail.fromPtr); + tResultObjectCreator: StorageItemThumbnail.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/istorageitemproperties2.dart b/packages/windows_storage/lib/src/istorageitemproperties2.dart index c678642a..f253d056 100644 --- a/packages/windows_storage/lib/src/istorageitemproperties2.dart +++ b/packages/windows_storage/lib/src/istorageitemproperties2.dart @@ -53,7 +53,7 @@ class IStorageItemProperties2 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageItemThumbnail.fromPtr); + tResultObjectCreator: StorageItemThumbnail.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -75,7 +75,7 @@ class IStorageItemProperties2 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageItemThumbnail.fromPtr); + tResultObjectCreator: StorageItemThumbnail.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -95,7 +95,7 @@ class IStorageItemProperties2 extends IInspectable final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageItemThumbnail.fromPtr); + tResultObjectCreator: StorageItemThumbnail.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/istoragelibrarychange.dart b/packages/windows_storage/lib/src/istoragelibrarychange.dart index 2e53fac3..fa681c2b 100644 --- a/packages/windows_storage/lib/src/istoragelibrarychange.dart +++ b/packages/windows_storage/lib/src/istoragelibrarychange.dart @@ -109,7 +109,7 @@ class IStorageLibraryChange extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: IStorageItem.fromPtr); + tResultObjectCreator: IStorageItem.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/istoragelibrarychangereader.dart b/packages/windows_storage/lib/src/istoragelibrarychangereader.dart index 6796aa2d..a5fa56c0 100644 --- a/packages/windows_storage/lib/src/istoragelibrarychangereader.dart +++ b/packages/windows_storage/lib/src/istoragelibrarychangereader.dart @@ -46,9 +46,9 @@ class IStorageLibraryChangeReader extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageLibraryChange.fromPtr, - iterableIid: '{87c15dfc-0c5e-518b-9206-97d3d9823c61}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{87c15dfc-0c5e-518b-9206-97d3d9823c61}', + tObjectCreator: StorageLibraryChange.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } diff --git a/packages/windows_storage/lib/src/pickers/ifileopenpicker.dart b/packages/windows_storage/lib/src/pickers/ifileopenpicker.dart index fd5c1410..a8868629 100644 --- a/packages/windows_storage/lib/src/pickers/ifileopenpicker.dart +++ b/packages/windows_storage/lib/src/pickers/ifileopenpicker.dart @@ -162,7 +162,7 @@ class IFileOpenPicker extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -180,9 +180,9 @@ class IFileOpenPicker extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFile.fromPtr, - iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', + tObjectCreator: StorageFile.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } } diff --git a/packages/windows_storage/lib/src/pickers/ifilesavepicker.dart b/packages/windows_storage/lib/src/pickers/ifilesavepicker.dart index c472bdfd..55a7cb26 100644 --- a/packages/windows_storage/lib/src/pickers/ifilesavepicker.dart +++ b/packages/windows_storage/lib/src/pickers/ifilesavepicker.dart @@ -122,7 +122,7 @@ class IFileSavePicker extends IInspectable { return IMap.fromPtr(value, iterableIid: '{4fed2669-d0d3-59f6-91d9-95902d728d6a}', - creator: (ptr) => IVector.fromPtr(ptr, + vObjectCreator: (ptr) => IVector.fromPtr(ptr, iterableIid: '{e2fcc7c1-3bfc-5a0b-b2b0-72e769d1cb7e}')); } @@ -215,7 +215,7 @@ class IFileSavePicker extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFile.fromPtr); + tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/pickers/ifolderpicker.dart b/packages/windows_storage/lib/src/pickers/ifolderpicker.dart index 648979d3..c4bb5ed3 100644 --- a/packages/windows_storage/lib/src/pickers/ifolderpicker.dart +++ b/packages/windows_storage/lib/src/pickers/ifolderpicker.dart @@ -162,7 +162,7 @@ class IFolderPicker extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: StorageFolder.fromPtr); + tResultObjectCreator: StorageFolder.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/search/istoragefilequeryresult.dart b/packages/windows_storage/lib/src/search/istoragefilequeryresult.dart index ca2f515d..a813d302 100644 --- a/packages/windows_storage/lib/src/search/istoragefilequeryresult.dart +++ b/packages/windows_storage/lib/src/search/istoragefilequeryresult.dart @@ -50,9 +50,9 @@ class IStorageFileQueryResult extends IInspectable final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFile.fromPtr, - iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', + tObjectCreator: StorageFile.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -70,9 +70,9 @@ class IStorageFileQueryResult extends IInspectable final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFile.fromPtr, - iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', + tObjectCreator: StorageFile.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } diff --git a/packages/windows_storage/lib/src/search/istoragefilequeryresult2.dart b/packages/windows_storage/lib/src/search/istoragefilequeryresult2.dart index 37b412f8..2fc1fc11 100644 --- a/packages/windows_storage/lib/src/search/istoragefilequeryresult2.dart +++ b/packages/windows_storage/lib/src/search/istoragefilequeryresult2.dart @@ -50,7 +50,7 @@ class IStorageFileQueryResult2 extends IInspectable return IMap.fromPtr(result, iterableIid: '{f819a276-b3f5-54d4-b8fd-c9adb7f700e3}', - creator: (ptr) => IVectorView.fromPtr(ptr, + vObjectCreator: (ptr) => IVectorView.fromPtr(ptr, iterableIid: '{5498f4f3-cee4-5b72-9729-815c4ad7b9dc}')); } diff --git a/packages/windows_storage/lib/src/search/istoragefolderqueryoperations.dart b/packages/windows_storage/lib/src/search/istoragefolderqueryoperations.dart index e5b992f6..3cca9bbb 100644 --- a/packages/windows_storage/lib/src/search/istoragefolderqueryoperations.dart +++ b/packages/windows_storage/lib/src/search/istoragefolderqueryoperations.dart @@ -54,7 +54,7 @@ class IStorageFolderQueryOperations extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - enumCreator: IndexedState.from); + tResultEnumCreator: IndexedState.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -237,9 +237,9 @@ class IStorageFolderQueryOperations extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFile.fromPtr, - iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', + tObjectCreator: StorageFile.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -258,9 +258,9 @@ class IStorageFolderQueryOperations extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFile.fromPtr, - iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', + tObjectCreator: StorageFile.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -280,9 +280,9 @@ class IStorageFolderQueryOperations extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFolder.fromPtr, - iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}', + tObjectCreator: StorageFolder.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -301,9 +301,9 @@ class IStorageFolderQueryOperations extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFolder.fromPtr, - iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}', + tObjectCreator: StorageFolder.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -323,9 +323,9 @@ class IStorageFolderQueryOperations extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: IStorageItem.fromPtr, - iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}', + tObjectCreator: IStorageItem.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } diff --git a/packages/windows_storage/lib/src/search/istoragefolderqueryresult.dart b/packages/windows_storage/lib/src/search/istoragefolderqueryresult.dart index 5c119c56..2ca22519 100644 --- a/packages/windows_storage/lib/src/search/istoragefolderqueryresult.dart +++ b/packages/windows_storage/lib/src/search/istoragefolderqueryresult.dart @@ -49,9 +49,9 @@ class IStorageFolderQueryResult extends IInspectable final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFolder.fromPtr, - iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}', + tObjectCreator: StorageFolder.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -69,9 +69,9 @@ class IStorageFolderQueryResult extends IInspectable final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: StorageFolder.fromPtr, - iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{4669befc-ae5c-52b1-8a97-5466ce61e94e}', + tObjectCreator: StorageFolder.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } diff --git a/packages/windows_storage/lib/src/search/istorageitemqueryresult.dart b/packages/windows_storage/lib/src/search/istorageitemqueryresult.dart index 37ae1cc9..c59bf5f1 100644 --- a/packages/windows_storage/lib/src/search/istorageitemqueryresult.dart +++ b/packages/windows_storage/lib/src/search/istorageitemqueryresult.dart @@ -50,9 +50,9 @@ class IStorageItemQueryResult extends IInspectable final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: IStorageItem.fromPtr, - iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}', + tObjectCreator: IStorageItem.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -70,9 +70,9 @@ class IStorageItemQueryResult extends IInspectable final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: IStorageItem.fromPtr, - iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}', + tObjectCreator: IStorageItem.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } diff --git a/packages/windows_storage/lib/src/search/istoragequeryresultbase.dart b/packages/windows_storage/lib/src/search/istoragequeryresultbase.dart index bf440563..5470f45b 100644 --- a/packages/windows_storage/lib/src/search/istoragequeryresultbase.dart +++ b/packages/windows_storage/lib/src/search/istoragequeryresultbase.dart @@ -44,7 +44,7 @@ class IStorageQueryResultBase extends IInspectable { } final asyncOperation = - IAsyncOperation.fromPtr(operation, intType: IntType.uint32); + IAsyncOperation.fromPtr(operation, tResultIntType: IntType.uint32); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -132,7 +132,7 @@ class IStorageQueryResultBase extends IInspectable { } final asyncOperation = - IAsyncOperation.fromPtr(operation, intType: IntType.uint32); + IAsyncOperation.fromPtr(operation, tResultIntType: IntType.uint32); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/streams/datareaderloadoperation.dart b/packages/windows_storage/lib/src/streams/datareaderloadoperation.dart index acbfe42d..73a9acda 100644 --- a/packages/windows_storage/lib/src/streams/datareaderloadoperation.dart +++ b/packages/windows_storage/lib/src/streams/datareaderloadoperation.dart @@ -23,7 +23,7 @@ class DataReaderLoadOperation extends IInspectable late final _iAsyncOperation = IAsyncOperation.fromPtr( toInterface('{ef60385f-be78-584b-aaef-7829ada2b0de}'), - intType: IntType.uint32); + tResultIntType: IntType.uint32); @override set completed(Pointer handler) => diff --git a/packages/windows_storage/lib/src/streams/datawriterstoreoperation.dart b/packages/windows_storage/lib/src/streams/datawriterstoreoperation.dart index 2b7300ca..ed30a87b 100644 --- a/packages/windows_storage/lib/src/streams/datawriterstoreoperation.dart +++ b/packages/windows_storage/lib/src/streams/datawriterstoreoperation.dart @@ -23,7 +23,7 @@ class DataWriterStoreOperation extends IInspectable late final _iAsyncOperation = IAsyncOperation.fromPtr( toInterface('{ef60385f-be78-584b-aaef-7829ada2b0de}'), - intType: IntType.uint32); + tResultIntType: IntType.uint32); @override set completed(Pointer handler) => diff --git a/packages/windows_storage/lib/src/streams/idatareader.dart b/packages/windows_storage/lib/src/streams/idatareader.dart index b278576d..4ebdc6ab 100644 --- a/packages/windows_storage/lib/src/streams/idatareader.dart +++ b/packages/windows_storage/lib/src/streams/idatareader.dart @@ -396,7 +396,7 @@ class IDataReader extends IInspectable { } final asyncOperation = - IAsyncOperation.fromPtr(operation, intType: IntType.uint32); + IAsyncOperation.fromPtr(operation, tResultIntType: IntType.uint32); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/streams/idatawriter.dart b/packages/windows_storage/lib/src/streams/idatawriter.dart index da00d59f..e0a972ec 100644 --- a/packages/windows_storage/lib/src/streams/idatawriter.dart +++ b/packages/windows_storage/lib/src/streams/idatawriter.dart @@ -271,7 +271,7 @@ class IDataWriter extends IInspectable { } final asyncOperation = - IAsyncOperation.fromPtr(operation, intType: IntType.uint32); + IAsyncOperation.fromPtr(operation, tResultIntType: IntType.uint32); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_storage/lib/src/streams/ifilerandomaccessstreamstatics.dart b/packages/windows_storage/lib/src/streams/ifilerandomaccessstreamstatics.dart index f2fea2ef..0421b450 100644 --- a/packages/windows_storage/lib/src/streams/ifilerandomaccessstreamstatics.dart +++ b/packages/windows_storage/lib/src/streams/ifilerandomaccessstreamstatics.dart @@ -54,7 +54,7 @@ class IFileRandomAccessStreamStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: IRandomAccessStream.fromPtr); + tResultObjectCreator: IRandomAccessStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -87,7 +87,7 @@ class IFileRandomAccessStreamStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: IRandomAccessStream.fromPtr); + tResultObjectCreator: IRandomAccessStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -106,7 +106,7 @@ class IFileRandomAccessStreamStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageStreamTransaction.fromPtr); + tResultObjectCreator: StorageStreamTransaction.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -132,7 +132,7 @@ class IFileRandomAccessStreamStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageStreamTransaction.fromPtr); + tResultObjectCreator: StorageStreamTransaction.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -152,7 +152,7 @@ class IFileRandomAccessStreamStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: IRandomAccessStream.fromPtr); + tResultObjectCreator: IRandomAccessStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -188,7 +188,7 @@ class IFileRandomAccessStreamStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: IRandomAccessStream.fromPtr); + tResultObjectCreator: IRandomAccessStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -208,7 +208,7 @@ class IFileRandomAccessStreamStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageStreamTransaction.fromPtr); + tResultObjectCreator: StorageStreamTransaction.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -241,7 +241,7 @@ class IFileRandomAccessStreamStatics extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: StorageStreamTransaction.fromPtr); + tResultObjectCreator: StorageStreamTransaction.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/streams/iinputstreamreference.dart b/packages/windows_storage/lib/src/streams/iinputstreamreference.dart index 424637b1..73fc0d30 100644 --- a/packages/windows_storage/lib/src/streams/iinputstreamreference.dart +++ b/packages/windows_storage/lib/src/streams/iinputstreamreference.dart @@ -43,7 +43,7 @@ class IInputStreamReference extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: IInputStream.fromPtr); + tResultObjectCreator: IInputStream.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_storage/lib/src/streams/irandomaccessstreamreference.dart b/packages/windows_storage/lib/src/streams/irandomaccessstreamreference.dart index e76e2f60..79fcd9c3 100644 --- a/packages/windows_storage/lib/src/streams/irandomaccessstreamreference.dart +++ b/packages/windows_storage/lib/src/streams/irandomaccessstreamreference.dart @@ -46,7 +46,7 @@ class IRandomAccessStreamReference extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: IRandomAccessStreamWithContentType.fromPtr); + tResultObjectCreator: IRandomAccessStreamWithContentType.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_system/lib/src/ifolderlauncheroptions.dart b/packages/windows_system/lib/src/ifolderlauncheroptions.dart index 25f0924a..013f9d05 100644 --- a/packages/windows_system/lib/src/ifolderlauncheroptions.dart +++ b/packages/windows_system/lib/src/ifolderlauncheroptions.dart @@ -48,7 +48,7 @@ class IFolderLauncherOptions extends IInspectable { return IVector.fromPtr(value, iterableIid: '{bb8b8418-65d1-544b-b083-6d172f568c73}', - creator: IStorageItem.fromPtr); + tObjectCreator: IStorageItem.fromPtr); } } diff --git a/packages/windows_system/lib/src/ilauncherstatics2.dart b/packages/windows_system/lib/src/ilauncherstatics2.dart index 58c87ef1..65128aea 100644 --- a/packages/windows_system/lib/src/ilauncherstatics2.dart +++ b/packages/windows_system/lib/src/ilauncherstatics2.dart @@ -50,7 +50,7 @@ class ILauncherStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LaunchUriResult.fromPtr); + tResultObjectCreator: LaunchUriResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -77,7 +77,7 @@ class ILauncherStatics2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LaunchUriResult.fromPtr); + tResultObjectCreator: LaunchUriResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -126,7 +126,7 @@ class ILauncherStatics2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: LaunchQuerySupportStatus.from); + tResultEnumCreator: LaunchQuerySupportStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -156,7 +156,7 @@ class ILauncherStatics2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: LaunchQuerySupportStatus.from); + tResultEnumCreator: LaunchQuerySupportStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -174,7 +174,7 @@ class ILauncherStatics2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: LaunchQuerySupportStatus.from); + tResultEnumCreator: LaunchQuerySupportStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -194,7 +194,7 @@ class ILauncherStatics2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: LaunchQuerySupportStatus.from); + tResultEnumCreator: LaunchQuerySupportStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -213,9 +213,9 @@ class ILauncherStatics2 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: AppInfo.fromPtr, - iterableIid: '{63d0bffe-0e34-55b3-83d5-314caff2b137}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{63d0bffe-0e34-55b3-83d5-314caff2b137}', + tObjectCreator: AppInfo.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -235,9 +235,9 @@ class ILauncherStatics2 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: AppInfo.fromPtr, - iterableIid: '{63d0bffe-0e34-55b3-83d5-314caff2b137}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{63d0bffe-0e34-55b3-83d5-314caff2b137}', + tObjectCreator: AppInfo.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -256,9 +256,9 @@ class ILauncherStatics2 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: AppInfo.fromPtr, - iterableIid: '{63d0bffe-0e34-55b3-83d5-314caff2b137}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{63d0bffe-0e34-55b3-83d5-314caff2b137}', + tObjectCreator: AppInfo.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } } diff --git a/packages/windows_system/lib/src/ilauncherstatics4.dart b/packages/windows_system/lib/src/ilauncherstatics4.dart index df11e473..98d07040 100644 --- a/packages/windows_system/lib/src/ilauncherstatics4.dart +++ b/packages/windows_system/lib/src/ilauncherstatics4.dart @@ -50,7 +50,7 @@ class ILauncherStatics4 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: LaunchQuerySupportStatus.from); + tResultEnumCreator: LaunchQuerySupportStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -73,7 +73,7 @@ class ILauncherStatics4 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: LaunchQuerySupportStatus.from); + tResultEnumCreator: LaunchQuerySupportStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -92,9 +92,9 @@ class ILauncherStatics4 extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: AppInfo.fromPtr, - iterableIid: '{63d0bffe-0e34-55b3-83d5-314caff2b137}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{63d0bffe-0e34-55b3-83d5-314caff2b137}', + tObjectCreator: AppInfo.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -112,7 +112,7 @@ class ILauncherStatics4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - enumCreator: LaunchUriStatus.from); + tResultEnumCreator: LaunchUriStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -135,7 +135,7 @@ class ILauncherStatics4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - enumCreator: LaunchUriStatus.from); + tResultEnumCreator: LaunchUriStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -164,7 +164,7 @@ class ILauncherStatics4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - enumCreator: LaunchUriStatus.from); + tResultEnumCreator: LaunchUriStatus.from); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -187,7 +187,7 @@ class ILauncherStatics4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LaunchUriResult.fromPtr); + tResultObjectCreator: LaunchUriResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -216,7 +216,7 @@ class ILauncherStatics4 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: LaunchUriResult.fromPtr); + tResultObjectCreator: LaunchUriResult.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_system/lib/src/iuser.dart b/packages/windows_system/lib/src/iuser.dart index eb47c5a3..87a86e4c 100644 --- a/packages/windows_system/lib/src/iuser.dart +++ b/packages/windows_system/lib/src/iuser.dart @@ -110,7 +110,7 @@ class IUser extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: IPropertySet.fromPtr); + tResultObjectCreator: IPropertySet.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -130,7 +130,7 @@ class IUser extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: IRandomAccessStreamReference.fromPtr); + tResultObjectCreator: IRandomAccessStreamReference.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_system/lib/src/iuser2.dart b/packages/windows_system/lib/src/iuser2.dart index bd72c254..86d6b31b 100644 --- a/packages/windows_system/lib/src/iuser2.dart +++ b/packages/windows_system/lib/src/iuser2.dart @@ -46,7 +46,7 @@ class IUser2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - enumCreator: UserAgeConsentResult.from); + tResultEnumCreator: UserAgeConsentResult.from); return asyncOperation.toFuture(asyncOperation.getResults); } } diff --git a/packages/windows_system/lib/src/iuserstatics.dart b/packages/windows_system/lib/src/iuserstatics.dart index e7e4d3fd..2454c89d 100644 --- a/packages/windows_system/lib/src/iuserstatics.dart +++ b/packages/windows_system/lib/src/iuserstatics.dart @@ -67,9 +67,9 @@ class IUserStatics extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: User.fromPtr, - iterableIid: '{d1bacd1f-0376-5823-8c29-1d45b9f4c191}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{d1bacd1f-0376-5823-8c29-1d45b9f4c191}', + tObjectCreator: User.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -89,9 +89,9 @@ class IUserStatics extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: User.fromPtr, - iterableIid: '{d1bacd1f-0376-5823-8c29-1d45b9f4c191}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{d1bacd1f-0376-5823-8c29-1d45b9f4c191}', + tObjectCreator: User.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -113,9 +113,9 @@ class IUserStatics extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr( operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: User.fromPtr, - iterableIid: '{d1bacd1f-0376-5823-8c29-1d45b9f4c191}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{d1bacd1f-0376-5823-8c29-1d45b9f4c191}', + tObjectCreator: User.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } diff --git a/packages/windows_ui/lib/src/notifications/itoastcollectionmanager.dart b/packages/windows_ui/lib/src/notifications/itoastcollectionmanager.dart index 5a739d7f..f51078bb 100644 --- a/packages/windows_ui/lib/src/notifications/itoastcollectionmanager.dart +++ b/packages/windows_ui/lib/src/notifications/itoastcollectionmanager.dart @@ -61,9 +61,9 @@ class IToastCollectionManager extends IInspectable { final asyncOperation = IAsyncOperation>.fromPtr(operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: ToastCollection.fromPtr, - iterableIid: '{8928d527-db5d-5a10-ae9b-430fa0906e74}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{8928d527-db5d-5a10-ae9b-430fa0906e74}', + tObjectCreator: ToastCollection.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); } @@ -81,7 +81,7 @@ class IToastCollectionManager extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: ToastCollection.fromPtr); + tResultObjectCreator: ToastCollection.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_ui/lib/src/notifications/itoastnotificationhistory2.dart b/packages/windows_ui/lib/src/notifications/itoastnotificationhistory2.dart index c0765d7c..e6dcc8f0 100644 --- a/packages/windows_ui/lib/src/notifications/itoastnotificationhistory2.dart +++ b/packages/windows_ui/lib/src/notifications/itoastnotificationhistory2.dart @@ -44,7 +44,7 @@ class IToastNotificationHistory2 extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{52c9428b-d37a-554d-bf55-b8685d5f552d}', - creator: ToastNotification.fromPtr) + tObjectCreator: ToastNotification.fromPtr) .toList(); } @@ -63,7 +63,7 @@ class IToastNotificationHistory2 extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{52c9428b-d37a-554d-bf55-b8685d5f552d}', - creator: ToastNotification.fromPtr) + tObjectCreator: ToastNotification.fromPtr) .toList(); } } diff --git a/packages/windows_ui/lib/src/notifications/itoastnotificationmanagerforuser2.dart b/packages/windows_ui/lib/src/notifications/itoastnotificationmanagerforuser2.dart index 79e5b7cc..7b222fa7 100644 --- a/packages/windows_ui/lib/src/notifications/itoastnotificationmanagerforuser2.dart +++ b/packages/windows_ui/lib/src/notifications/itoastnotificationmanagerforuser2.dart @@ -50,7 +50,7 @@ class IToastNotificationManagerForUser2 extends IInspectable { } final asyncOperation = IAsyncOperation.fromPtr(operation, - creator: ToastNotifier.fromPtr); + tResultObjectCreator: ToastNotifier.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } @@ -70,7 +70,7 @@ class IToastNotificationManagerForUser2 extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: ToastNotificationHistory.fromPtr); + tResultObjectCreator: ToastNotificationHistory.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_ui/lib/src/notifications/itoastnotifier.dart b/packages/windows_ui/lib/src/notifications/itoastnotifier.dart index 2dc85070..784795c6 100644 --- a/packages/windows_ui/lib/src/notifications/itoastnotifier.dart +++ b/packages/windows_ui/lib/src/notifications/itoastnotifier.dart @@ -94,7 +94,7 @@ class IToastNotifier extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{7a7b2a51-c182-5846-a861-4f9c036f24ad}', - creator: ScheduledToastNotification.fromPtr) + tObjectCreator: ScheduledToastNotification.fromPtr) .toList(); } } diff --git a/packages/windows_ui/lib/src/popups/imessagedialog.dart b/packages/windows_ui/lib/src/popups/imessagedialog.dart index c0de7302..62c230cf 100644 --- a/packages/windows_ui/lib/src/popups/imessagedialog.dart +++ b/packages/windows_ui/lib/src/popups/imessagedialog.dart @@ -74,7 +74,7 @@ class IMessageDialog extends IInspectable { return IVector.fromPtr(value, iterableIid: '{e63de42b-53c3-5e07-90d3-98172d545412}', - creator: IUICommand.fromPtr); + tObjectCreator: IUICommand.fromPtr); } int get defaultCommandIndex { @@ -164,7 +164,7 @@ class IMessageDialog extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( messageDialogAsyncOperation, - creator: IUICommand.fromPtr); + tResultObjectCreator: IUICommand.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_ui/lib/src/uiautomation/core/iremoteautomationclientsession.dart b/packages/windows_ui/lib/src/uiautomation/core/iremoteautomationclientsession.dart index 0f2e0e89..db621575 100644 --- a/packages/windows_ui/lib/src/uiautomation/core/iremoteautomationclientsession.dart +++ b/packages/windows_ui/lib/src/uiautomation/core/iremoteautomationclientsession.dart @@ -72,7 +72,7 @@ class IRemoteAutomationClientSession extends IInspectable { final asyncOperation = IAsyncOperation.fromPtr( operation, - creator: RemoteAutomationWindow.fromPtr); + tResultObjectCreator: RemoteAutomationWindow.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); } diff --git a/packages/windows_ui/lib/src/windowmanagement/iwindowingenvironment.dart b/packages/windows_ui/lib/src/windowmanagement/iwindowingenvironment.dart index 189548ea..d5b1f774 100644 --- a/packages/windows_ui/lib/src/windowmanagement/iwindowingenvironment.dart +++ b/packages/windows_ui/lib/src/windowmanagement/iwindowingenvironment.dart @@ -78,7 +78,7 @@ class IWindowingEnvironment extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{026730ab-250d-503c-a876-43bbb754ad44}', - creator: DisplayRegion.fromPtr) + tObjectCreator: DisplayRegion.fromPtr) .toList(); } diff --git a/packages/windows_ui/lib/src/windowmanagement/iwindowingenvironmentstatics.dart b/packages/windows_ui/lib/src/windowmanagement/iwindowingenvironmentstatics.dart index 07a29d4d..ac89b7b8 100644 --- a/packages/windows_ui/lib/src/windowmanagement/iwindowingenvironmentstatics.dart +++ b/packages/windows_ui/lib/src/windowmanagement/iwindowingenvironmentstatics.dart @@ -47,7 +47,7 @@ class IWindowingEnvironmentStatics extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{626a6481-0174-5a56-84c9-e8d4c48cfb1b}', - creator: WindowingEnvironment.fromPtr) + tObjectCreator: WindowingEnvironment.fromPtr) .toList(); } @@ -65,7 +65,7 @@ class IWindowingEnvironmentStatics extends IInspectable { return IVectorView.fromPtr(result, iterableIid: '{626a6481-0174-5a56-84c9-e8d4c48cfb1b}', - creator: WindowingEnvironment.fromPtr) + tObjectCreator: WindowingEnvironment.fromPtr) .toList(); } } diff --git a/packages/winrtgen/lib/src/extensions/type_identifier.dart b/packages/winrtgen/lib/src/extensions/type_identifier.dart index ea3b01e0..6edbeea3 100644 --- a/packages/winrtgen/lib/src/extensions/type_identifier.dart +++ b/packages/winrtgen/lib/src/extensions/type_identifier.dart @@ -35,56 +35,77 @@ extension TypeIdentifierHelpers on TypeIdentifier { String _parseGenericTypeIdentifierCreator(TypeIdentifier typeIdentifier) { final shortName = typeIdentifier.shortName.outerType; final typeArgs = typeIdentifier.typeArgs; - final args = ['ptr']; - if (shortName case 'IKeyValuePair' || 'IMap' || 'IMapView') { - // Handle enum key typeArg - if (typeArgs.first.type?.isEnum ?? false) { - final enumKeyCreator = typeArgs.first.creator; - args.add('enumKeyCreator: $enumKeyCreator'); - } + final genericParams = type?.genericParams; + if (genericParams == null) throw StateError('Type $this has no type.'); - // Handle int key typeArg - if (typeArgs.first.baseType - case BaseType.int32Type || BaseType.uint32Type) { - final typeProjection = TypeProjection(typeArgs.first); - final intType = 'IntType.${typeProjection.nativeType.toLowerCase()}'; - args.add('intType: $intType'); - } - } - - // Use the value (last) typeArg to parse the creator argument since the - // key (first) typeArg is handled above. - final typeArg = switch (shortName) { - 'IKeyValuePair' || 'IMap' || 'IMapView' => typeArgs.last, - _ => typeArgs.first, + final args = { + 'ptr', + if (shortName case 'IMap' || 'IMapView' || 'IVector' || 'IVectorView') + 'iterableIid: ${typeIdentifier.iterableIID.quote()}', }; - final creator = typeArg.creator; - if (creator != null) { - final typeArgIsEnum = typeArg.type?.isEnum ?? false; - final creatorParamName = typeArgIsEnum ? 'enumCreator' : 'creator'; - args.add('$creatorParamName: $creator'); - } - if (shortName case 'IMap' || 'IMapView' || 'IVector' || 'IVectorView') { - args.add('iterableIid: ${typeIdentifier.iterableIID.quote()}'); - } else if (shortName == 'IReference') { + if (shortName == 'IReference') { final referenceArgSignature = typeArgs.first.signature; final referenceSignature = 'pinterface($IID_IReference;$referenceArgSignature)'; final iid = referenceSignature.toIID(); args.add('referenceIid: ${iid.quote()}'); - } else { - if (creator == null) return '$shortName.fromPtr'; } - // Hanlde int typeArg in IIterable, IVector and IVectorView interfaces - if (typeIdentifier.shortName.typeArguments == 'int') { - final typeProjection = TypeProjection(typeArgs.first); - final intType = 'IntType.${typeProjection.nativeType.toLowerCase()}'; - args.add('intType: $intType'); + if (typeArgs case [final typeArg1, final typeArg2]) { + final typeArg1Creator = typeArg1.creator; + final typeArg1ParamName = genericParams[0].name.toCamelCase(); + final typeArg1TypeProjection = TypeProjection(typeArg1); + final typeArg1NativeType = + typeArg1TypeProjection.nativeType.toLowerCase(); + final typeArg2Creator = typeArg2.creator; + final typeArg2ParamName = genericParams[1].name.toCamelCase(); + final typeArg2TypeProjection = TypeProjection(typeArg2); + final typeArg2NativeType = + typeArg2TypeProjection.nativeType.toLowerCase(); + + if (typeArg1.isWinRTEnum) { + args.add('${typeArg1ParamName}EnumCreator: $typeArg1Creator'); + } else if (typeArg1Creator != null) { + args.add('${typeArg1ParamName}ObjectCreator: $typeArg1Creator'); + } else if (typeArg1TypeProjection.isDouble) { + args.add( + '${typeArg1ParamName}DoubleType: DoubleType.$typeArg1NativeType'); + } else if (typeArg1TypeProjection.isInteger) { + args.add('${typeArg1ParamName}IntType: IntType.$typeArg1NativeType'); + } + + if (typeArg2.isWinRTEnum) { + args.add('${typeArg2ParamName}EnumCreator: $typeArg2Creator'); + } else if (typeArg2Creator != null) { + args.add('${typeArg2ParamName}ObjectCreator: $typeArg2Creator'); + } else if (typeArg2TypeProjection.isDouble) { + args.add( + '${typeArg2ParamName}DoubleType: DoubleType.$typeArg2NativeType'); + } else if (typeArg2TypeProjection.isInteger) { + args.add('${typeArg2ParamName}IntType: IntType.$typeArg2NativeType'); + } + } else if (typeArgs case [final typeArg]) { + final typeArgCreator = typeArg.creator; + final typeArgParamName = genericParams[0].name.toCamelCase(); + final typeArgTypeProjection = TypeProjection(typeArg); + final typeArgNativeType = typeArgTypeProjection.nativeType.toLowerCase(); + + if (typeArg.isWinRTEnum) { + args.add('${typeArgParamName}EnumCreator: $typeArgCreator'); + } else if (typeArgCreator != null) { + args.add('${typeArgParamName}ObjectCreator: $typeArgCreator'); + } else if (typeArgTypeProjection.isDouble) { + args.add( + '${typeArgParamName}DoubleType: DoubleType.$typeArgNativeType'); + } else if (typeArgTypeProjection.isInteger) { + args.add('${typeArgParamName}IntType: IntType.$typeArgNativeType'); + } } + if (args.length == 1 && args.contains('ptr')) return '$shortName.fromPtr'; + return '(ptr) => $shortName.fromPtr(${args.join(', ')})'; } diff --git a/packages/winrtgen/lib/src/projections/generic_interface.dart b/packages/winrtgen/lib/src/projections/generic_interface.dart index af723906..dc70d896 100644 --- a/packages/winrtgen/lib/src/projections/generic_interface.dart +++ b/packages/winrtgen/lib/src/projections/generic_interface.dart @@ -138,12 +138,19 @@ final class GenericInterfaceProjection extends InterfaceProjection { Set get _superArguments => switch (shortName) { 'IMap' || 'IMapView' || 'IVector' || 'IVectorView' => { if (typeArgs case [final typeArg1, final typeArg2]) ...{ - if (typeArg1.isEnum) 'enumKeyCreator: enumKeyCreator', - if (typeArg2.isInspectable) 'creator: creator', - if (typeArg2.isEnum) 'enumCreator: enumCreator' + if (typeArg1.isEnum) + '${typeDef.genericParams[0].name.toCamelCase()}EnumCreator: ${typeDef.genericParams[0].name.toCamelCase()}EnumCreator' + else if (typeArg1.isInspectable) + '${typeDef.genericParams[0].name.toCamelCase()}ObjectCreator: ${typeDef.genericParams[0].name.toCamelCase()}ObjectCreator', + if (typeArg2.isEnum) + '${typeDef.genericParams[1].name.toCamelCase()}EnumCreator: ${typeDef.genericParams[1].name.toCamelCase()}EnumCreator' + else if (typeArg2.isInspectable) + '${typeDef.genericParams[1].name.toCamelCase()}ObjectCreator: ${typeDef.genericParams[1].name.toCamelCase()}ObjectCreator' } else if (typeArgs case [final typeArg]) ...{ - if (typeArg.isInspectable) 'creator: creator', - if (typeArg.isEnum) 'enumCreator: enumCreator' + if (typeArg.isEnum) + '${typeDef.genericParams[0].name.toCamelCase()}EnumCreator: ${typeDef.genericParams[0].name.toCamelCase()}EnumCreator' + else if (typeArg.isInspectable) + '${typeDef.genericParams[0].name.toCamelCase()}ObjectCreator: ${typeDef.genericParams[0].name.toCamelCase()}ObjectCreator' } }, _ => {} @@ -153,24 +160,31 @@ final class GenericInterfaceProjection extends InterfaceProjection { if (shortName case 'IMap' || 'IMapView' || 'IVector' || 'IVectorView') 'required super.iterableIid', if (typeArgs case [final typeArg1, final typeArg2]) ...{ - if (typeArg1.isEnum) 'required this.enumKeyCreator', - if (shortName case 'IMap' || 'IMapView' || 'IVector' || 'IVectorView' - when typeArg1.isDouble) - 'super.doubleType', - if (shortName case 'IMap' || 'IMapView' || 'IVector' || 'IVectorView' - when typeArg1.isInt) - 'super.intType', - if (typeArg2.isInspectable) 'required this.creator', - if (typeArg2.isEnum) 'required this.enumCreator' + if (typeArg1.isEnum) + 'required this.${typeDef.genericParams[0].name.toCamelCase()}EnumCreator' + else if (typeArg1.isInspectable) + 'required this.${typeDef.genericParams[0].name.toCamelCase()}ObjectCreator' + else if (typeArg1.isDouble) + 'super.${typeDef.genericParams[0].name.toCamelCase()}DoubleType' + else if (typeArg1.isInt) + 'super.${typeDef.genericParams[0].name.toCamelCase()}IntType', + if (typeArg2.isEnum) + 'required this.${typeDef.genericParams[1].name.toCamelCase()}EnumCreator' + else if (typeArg2.isInspectable) + 'required this.${typeDef.genericParams[1].name.toCamelCase()}ObjectCreator' + else if (typeArg2.isDouble) + 'super.${typeDef.genericParams[1].name.toCamelCase()}DoubleType' + else if (typeArg2.isInt) + 'super.${typeDef.genericParams[1].name.toCamelCase()}IntType', } else if (typeArgs case [final typeArg]) ...{ - if (shortName case 'IMap' || 'IMapView' || 'IVector' || 'IVectorView' - when typeArg.isDouble) - 'super.doubleType', - if (shortName case 'IMap' || 'IMapView' || 'IVector' || 'IVectorView' - when typeArg.isInt) - 'super.intType', - if (typeArg.isInspectable) 'required this.creator', - if (typeArg.isEnum) 'required this.enumCreator' + if (typeArg.isEnum) + 'required this.${typeDef.genericParams[0].name.toCamelCase()}EnumCreator' + else if (typeArg.isInspectable) + 'required this.${typeDef.genericParams[0].name.toCamelCase()}ObjectCreator' + else if (typeArg.isDouble) + 'super.${typeDef.genericParams[0].name.toCamelCase()}DoubleType' + else if (typeArg.isInt) + 'super.${typeDef.genericParams[0].name.toCamelCase()}IntType', } }; @@ -194,16 +208,18 @@ final class GenericInterfaceProjection extends InterfaceProjection { 'late final _${className}Vtbl _vtable = ptr.ref.vtable.cast<_${className}Vtbl>().ref;', if (typeArgs case [final typeArg1, final typeArg2]) ...{ if (typeArg1.isEnum) - 'final EnumCreator<${genericParams[0].name}> enumKeyCreator;', - if (typeArg2.isInspectable) - 'final COMObjectCreator<${genericParams[1].name}> creator;', + 'final EnumCreator<${genericParams[0].name}> ${genericParams[0].name.toCamelCase()}EnumCreator;' + else if (typeArg1.isInspectable) + 'final COMObjectCreator<${genericParams[0].name}> ${genericParams[0].name.toCamelCase()}ObjectCreator;', if (typeArg2.isEnum) - 'final EnumCreator<${genericParams[1].name}> enumCreator;' + 'final EnumCreator<${genericParams[1].name}> ${genericParams[1].name.toCamelCase()}EnumCreator;' + else if (typeArg2.isInspectable) + 'final COMObjectCreator<${genericParams[1].name}> ${genericParams[1].name.toCamelCase()}ObjectCreator;' } else if (typeArgs case [final typeArg]) ...{ - if (typeArg.isInspectable) - 'final COMObjectCreator<${genericParams[0].name}> creator;', if (typeArg.isEnum) - 'final EnumCreator<${genericParams[0].name}> enumCreator;' + 'final EnumCreator<${genericParams[0].name}> ${genericParams[0].name.toCamelCase()}EnumCreator;' + else if (typeArg.isInspectable) + 'final COMObjectCreator<${genericParams[0].name}> ${genericParams[0].name.toCamelCase()}ObjectCreator;' } }; } diff --git a/packages/winrtgen/lib/src/projections/method_forwarders.dart b/packages/winrtgen/lib/src/projections/method_forwarders.dart index d6afa28b..3041b55a 100644 --- a/packages/winrtgen/lib/src/projections/method_forwarders.dart +++ b/packages/winrtgen/lib/src/projections/method_forwarders.dart @@ -39,71 +39,51 @@ final class MethodForwardersProjection { /// The constructor arguments passed to the constructors of the [interface]. String? get constructorArgs { if (!isGenericInterface) return null; - final creatorArg = creatorArgument; - final iterableIidArg = iterableIidArgument; - final intTypeArg = intTypeArgument; - final args = [ - if (creatorArg != null) creatorArg, - if (iterableIidArg != null) iterableIidArg, - if (intTypeArg != null) intTypeArg - ]; - return args.isEmpty ? '' : ', ${args.join(', ')}'; - } - - String? get creatorArgument { - if (!isGenericInterface) return null; final typeSpec = interface.typeSpec; if (typeSpec == null) { throw StateError('Type $interface has no typeSpec.'); } - final typeArgs = typeSpec.typeArgs; - // Use the value (last) typeArg to parse the creator argument as it is not - // required for the key (first) typeArg. - final typeArg = switch (shortInterfaceName) { - 'IMap' || 'IMapView' => typeArgs.last, - _ => typeArgs.first, - }; - final creator = typeArg.creator; - if (creator == null) return null; - - final typeArgProjection = TypeProjection(typeArg); - return typeArgProjection.isWinRTEnum - ? 'enumCreator: $creator' - : 'creator: $creator'; - } - - String? get iterableIidArgument { - if (!isGenericInterface) return null; - - if (interface.typeSpec case final typeSpec?) { - return switch (shortInterfaceName) { - 'IMap' || - 'IMapView' || - 'IVector' || - 'IVectorView' => - 'iterableIid: ${typeSpec.iterableIID.quote()}', - _ => null - }; + final genericParams = typeSpec.type?.genericParams; + if (genericParams == null) { + throw StateError('Type $typeSpec has no type.'); } - throw StateError('Type $interface has no typeSpec.'); - } - - String? get intTypeArgument { - if (!isGenericInterface) return null; - - if (interface.typeSpec case final typeSpec?) { - if (typeArgs case 'int' || 'int?') { - final typeArg = typeSpec.dereference(); - final typeArgProjection = TypeProjection(typeArg); - return 'intType: IntType.${typeArgProjection.nativeType.toLowerCase()}'; - } - return null; - } + final args = { + if (shortInterfaceName + case 'IMap' || 'IMapView' || 'IVector' || 'IVectorView') + 'iterableIid: ${typeSpec.iterableIID.quote()}', + if (typeSpec.typeArgs case [final typeArg1, final typeArg2]) ...{ + if (typeArg1.creator case final creator?) + typeArg1.isWinRTEnum + ? '${genericParams[0].name.toCamelCase()}EnumCreator: $creator' + : '${genericParams[0].name.toCamelCase()}ObjectCreator: $creator' + else if (TypeProjection(typeArg1).isDouble) + '${genericParams[0].name.toCamelCase()}DoubleType: DoubleType.${TypeProjection(typeArg1).nativeType.toLowerCase()}' + else if (TypeProjection(typeArg1).isInteger) + '${genericParams[0].name.toCamelCase()}IntType: IntType.${TypeProjection(typeArg1).nativeType.toLowerCase()}', + if (typeArg2.creator case final creator?) + typeArg2.isWinRTEnum + ? '${genericParams[1].name.toCamelCase()}EnumCreator: $creator' + : '${genericParams[1].name.toCamelCase()}ObjectCreator: $creator' + else if (TypeProjection(typeArg2).isDouble) + '${genericParams[1].name.toCamelCase()}DoubleType: DoubleType.${TypeProjection(typeArg2).nativeType.toLowerCase()}' + else if (TypeProjection(typeArg2).isInteger) + '${genericParams[1].name.toCamelCase()}IntType: IntType.${TypeProjection(typeArg2).nativeType.toLowerCase()}', + } else if (typeSpec.typeArgs case [final typeArg]) ...{ + if (typeArg.creator case final creator?) + typeArg.isWinRTEnum + ? '${genericParams[0].name.toCamelCase()}EnumCreator: $creator' + : '${genericParams[0].name.toCamelCase()}ObjectCreator: $creator' + else if (TypeProjection(typeArg).isDouble) + '${genericParams[0].name.toCamelCase()}DoubleType: DoubleType.${TypeProjection(typeArg).nativeType.toLowerCase()}' + else if (TypeProjection(typeArg).isInteger) + '${genericParams[0].name.toCamelCase()}IntType: IntType.${TypeProjection(typeArg).nativeType.toLowerCase()}', + }, + }; - throw StateError('Type $interface has no typeSpec.'); + return args.isEmpty ? '' : ', ${args.join(', ')}'; } String get interfaceInstantiation { diff --git a/packages/winrtgen/lib/src/projections/types/array.dart b/packages/winrtgen/lib/src/projections/types/array.dart index 8e5014f5..b956652d 100644 --- a/packages/winrtgen/lib/src/projections/types/array.dart +++ b/packages/winrtgen/lib/src/projections/types/array.dart @@ -76,8 +76,10 @@ abstract base class ArrayParameterProjection extends ParameterProjection { EnumParameterProjection() || ObjectParameterProjection() when !typeArgIsObjectType => typeArgParamCreator.substring(0, typeArgParamCreator.indexOf('(')), - GenericEnumParameterProjection() => 'enumCreator', - GenericObjectParameterProjection() => 'creator', + final GenericEnumParameterProjection p => + '${p.type.toCamelCase()}EnumCreator', + final GenericObjectParameterProjection p => + '${p.type.toCamelCase()}ObjectCreator', _ => '' }; } diff --git a/packages/winrtgen/lib/src/projections/types/async.dart b/packages/winrtgen/lib/src/projections/types/async.dart index 37093635..6846e87f 100644 --- a/packages/winrtgen/lib/src/projections/types/async.dart +++ b/packages/winrtgen/lib/src/projections/types/async.dart @@ -82,37 +82,21 @@ final class AsyncOperationParameterProjection /// The constructor arguments passed to the constructor of `IAsyncOperation`. String get constructorArgs { - final typeArg = typeIdentifier.dereference(); - final typeProjection = TypeProjection(typeArg); - - // If the type argument is an enum or a WinRT object (e.g., StorageFile), - // the constructor of that class must be passed in the 'enumCreator' - // parameter for enums, 'creator' parameter for WinRT objects so that the - // IAsyncOperation implementation can instantiate the object. - final creator = typeArg.creator; - - // e.g., float, int32 - final nativeType = typeProjection.nativeType.toLowerCase(); - - // If the type argument is a double, 'doubleType' parameter must be - // specified so that the IAsyncOperation implementation can use the - // appropriate native double type - final doubleType = - this.typeArg == 'double' ? 'DoubleType.$nativeType' : null; - - // If the type argument is an int, 'intType' parameter must be specified so - // that the IAsyncOperation implementation can use the appropriate native - // integer type - final intType = this.typeArg == 'int' ? 'IntType.$nativeType' : null; - - final args = []; - if (typeProjection.isWinRTEnum) { - args.add('enumCreator: $creator'); - } else if (creator != null) { - args.add('creator: $creator'); - } - if (doubleType != null) args.add('doubleType: $doubleType'); - if (intType != null) args.add('intType: $intType'); + final [typeArg] = typeIdentifier.typeArgs; + final typeArgProjection = TypeProjection(typeArg); + final typeArgNativeType = typeArgProjection.nativeType.toLowerCase(); + + final args = { + if (typeArgProjection.isWinRTEnum) + 'tResultEnumCreator: ${typeArg.creator}' + else if (typeArg.creator case final creator?) + 'tResultObjectCreator: $creator', + if (typeArgProjection.isDouble) + 'tResultDoubleType: DoubleType.$typeArgNativeType' + else if (typeArgProjection.isInteger) + 'tResultIntType: IntType.$typeArgNativeType', + }; + return args.isEmpty ? '' : ', ${args.join(', ')}'; } diff --git a/packages/winrtgen/lib/src/projections/types/generic.dart b/packages/winrtgen/lib/src/projections/types/generic.dart index 92627d4a..1632f0cc 100644 --- a/packages/winrtgen/lib/src/projections/types/generic.dart +++ b/packages/winrtgen/lib/src/projections/types/generic.dart @@ -10,18 +10,14 @@ import '../parameter.dart'; final class GenericEnumParameterProjection extends ParameterProjection { GenericEnumParameterProjection(super.parameter); + String get genericParamName => method + .parent.genericParams[parameter.typeIdentifier.genericParamSequence].name; + @override - String get type { - final genericParamSequence = parameter.typeIdentifier.genericParamSequence; - return method.parent.genericParams[genericParamSequence].name; - } + String get type => genericParamName; @override - String get creator => switch (method.parent.genericParams) { - [final param, _] when param.name == type => - 'enumKeyCreator($identifier.value)', - _ => 'enumCreator($identifier.value)' - }; + String get creator => '${type.toCamelCase()}EnumCreator($identifier.value)'; @override String get into => '($identifier as WinRTEnum).value'; @@ -36,14 +32,14 @@ final class GenericObjectParameterProjection extends ParameterProjection { typeProjection.typeIdentifier.name == TypeArgKind.nullableInspectable.name; + String get genericParamName => method + .parent.genericParams[parameter.typeIdentifier.genericParamSequence].name; + @override - String get type { - final genericParamSequence = parameter.typeIdentifier.genericParamSequence; - return method.parent.genericParams[genericParamSequence].name; - } + String get type => genericParamName; @override - String get creator => 'creator($identifier)'; + String get creator => '${type.toCamelCase()}ObjectCreator($identifier)'; @override String get into => '($identifier as IInspectable).lpVtbl'; diff --git a/packages/winrtgen/lib/src/projections/types/ireference.dart b/packages/winrtgen/lib/src/projections/types/ireference.dart index 1deeb6cf..f345003a 100644 --- a/packages/winrtgen/lib/src/projections/types/ireference.dart +++ b/packages/winrtgen/lib/src/projections/types/ireference.dart @@ -2,6 +2,8 @@ // All rights reserved. Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +import 'package:winmd/winmd.dart'; + import '../../constants/constants.dart'; import '../../extensions/extensions.dart'; import '../parameter.dart'; @@ -14,8 +16,9 @@ final class IReferenceParameterProjection extends ParameterProjection { @override String get type => shortTypeName.typeArguments; - TypeProjection get typeArgProjection => - TypeProjection(typeProjection.typeIdentifier.typeArgs.first); + TypeIdentifier get typeArg => typeProjection.typeIdentifier.typeArgs.first; + + TypeProjection get typeArgProjection => TypeProjection(typeArg); String get toReferenceArgument => switch (type) { 'double?' => 'DoubleType.${typeArgProjection.nativeType.toLowerCase()}', @@ -25,25 +28,21 @@ final class IReferenceParameterProjection extends ParameterProjection { /// The constructor arguments passed to the constructor of `IReference`. String get referenceConstructorArgs { - // If the type argument is an enum, the constructor of the enum class must - // be passed in the 'enumCreator' parameter so that the 'IReference' - // implementation can instantiate the object - final enumCreator = typeArgProjection.isWinRTEnum - ? '${type.stripQuestionMarkSuffix()}.from' - : null; - // The IID for IReference must be passed in the 'referenceIid' parameter // so that the 'IReference' implementation can use the correct IID when // retrieving the value it holds. // To learn know more about how the IID is calculated, please see // https://learn.microsoft.com/uwp/winrt-cref/winrt-type-system#guid-generation-for-parameterized-types - final referenceArgSignature = - typeProjection.typeIdentifier.typeArgs.first.signature; + final referenceArgSignature = typeArg.signature; final referenceSignature = 'pinterface($IID_IReference;$referenceArgSignature)'; final referenceIid = referenceSignature.toIID(); - final args = ['referenceIid: ${referenceIid.quote()}']; - if (enumCreator != null) args.add('enumCreator: $enumCreator'); + + final args = { + 'referenceIid: ${referenceIid.quote()}', + if (typeArg.isWinRTEnum) 'tEnumCreator: ${typeArg.creator}' + }; + return ', ${args.join(', ')}'; } diff --git a/packages/winrtgen/lib/src/projections/types/map.dart b/packages/winrtgen/lib/src/projections/types/map.dart index c434e4a6..ceb5db2b 100644 --- a/packages/winrtgen/lib/src/projections/types/map.dart +++ b/packages/winrtgen/lib/src/projections/types/map.dart @@ -23,43 +23,37 @@ final class MapParameterProjection extends ParameterProjection { /// The constructor arguments passed to the constructors of `IMap` and /// `IMapView`. String get mapConstructorArgs { - final typeArgs = typeIdentifier.typeArgs; - final keyArgTypeProjection = TypeProjection(typeArgs.first); - final valueArgTypeProjection = TypeProjection(typeArgs.last); - - // If the type argument is an enum, the constructor of that class must be - // passed in the 'enumKeyCreator' parameter for enum, so that the 'IMap' and - // 'IMapView' implementations can instantiate the enum. - final enumKeyCreator = typeArgs.first.creator; - - // If the type argument is an enum, a WinRT object (e.g., IJsonValue), the - // constructor of that class must be passed in the 'enumCreator' parameter - // for enum, 'creator' parameter for WinRT object so that the 'IMap' and - // 'IMapView' implementations can instantiate the object - final creator = typeArgs.last.creator; - - // If the key type argument is an int, 'intType' parameter must be specified - // so that the IMap and IMapView implementations can use the appropriate - // native integer type - final intType = mapTypeArgs.split(', ')[0] == 'int' - ? 'IntType.${keyArgTypeProjection.nativeType.toLowerCase()}' - : null; + final [typeArg1, typeArg2] = typeIdentifier.typeArgs; + final keyArgTypeProjection = TypeProjection(typeArg1); + final keyArgNativeType = keyArgTypeProjection.nativeType.toLowerCase(); + final valueArgTypeProjection = TypeProjection(typeArg2); + final valueArgNativeType = valueArgTypeProjection.nativeType.toLowerCase(); // The IID for IIterable> must be passed in the // 'iterableIid' parameter so that the 'IMap' and 'IMapView' implementations // can use the correct IID when instantiating the IIterable object final iterableIid = typeIdentifier.iterableIID; - final args = ['iterableIid: ${iterableIid.quote()}']; - if (keyArgTypeProjection.isWinRTEnum) { - args.add('enumKeyCreator: $enumKeyCreator'); - } - if (valueArgTypeProjection.isWinRTEnum) { - args.add('enumCreator: $creator'); - } else if (creator != null) { - args.add('creator: $creator'); - } - if (intType != null) args.add('intType: $intType'); + final args = { + 'iterableIid: ${iterableIid.quote()}', + if (typeArg1.isWinRTEnum) + 'kEnumCreator: ${typeArg1.creator}' + else if (typeArg1.creator case final creator?) + 'kObjectCreator: $creator' + else if (keyArgTypeProjection.isDouble) + 'kDoubleType: DoubleType.$keyArgNativeType' + else if (keyArgTypeProjection.isInteger) + 'kIntType: IntType.$keyArgNativeType', + if (typeArg2.isWinRTEnum) + 'vEnumCreator: ${typeArg2.creator}' + else if (typeArg2.creator case final creator?) + 'vObjectCreator: $creator' + else if (valueArgTypeProjection.isDouble) + 'vDoubleType: DoubleType.$valueArgNativeType' + else if (valueArgTypeProjection.isInteger) + 'vIntType: IntType.$valueArgNativeType' + }; + return ', ${args.join(', ')}'; } diff --git a/packages/winrtgen/lib/src/projections/types/vector.dart b/packages/winrtgen/lib/src/projections/types/vector.dart index ed531f77..e3b3cea3 100644 --- a/packages/winrtgen/lib/src/projections/types/vector.dart +++ b/packages/winrtgen/lib/src/projections/types/vector.dart @@ -22,41 +22,27 @@ final class VectorParameterProjection extends ParameterProjection { /// The constructor arguments passed to the constructors of `IVector` and /// `IVectorView`. String get vectorConstructorArgs { - final typeArgProjection = TypeProjection(typeIdentifier.typeArgs.first); - - // If the type argument is an enum or a WinRT object (e.g., StorageFile), - // the constructor of that class must be passed in the 'enumCreator' - // parameter for enums, 'creator' parameter for WinRT objects so that the - // IVector and IVectorView implementations can instantiate the object - final creator = typeArgProjection.typeIdentifier.creator; + final [typeArg] = typeIdentifier.typeArgs; + final typeArgProjection = TypeProjection(typeArg); + final typeArgNativeType = typeArgProjection.nativeType.toLowerCase(); // The IID for IIterable must be passed in the 'iterableIid' parameter so // that the IVector and IVectorView implementations can use the correct IID // when instantiating the IIterable object final iterableIid = typeProjection.typeIdentifier.iterableIID; - // e.g., float, int32 - final nativeType = typeArgProjection.nativeType.toLowerCase(); - - // If the type argument is a double, 'doubleType' parameter must be - // specified so that the IVector and IVectorView implementations can use - // the appropriate native double type - final doubleType = - vectorTypeArg == 'double' ? 'DoubleType.$nativeType' : null; - - // If the type argument is an int, 'intType' parameter must be specified so - // that the IVector and IVectorView implementations can use the appropriate - // native integer type - final intType = vectorTypeArg == 'int' ? 'IntType.$nativeType' : null; - - final args = ['iterableIid: ${iterableIid.quote()}']; - if (typeArgProjection.isWinRTEnum) { - args.add('enumCreator: $creator'); - } else if (creator != null) { - args.add('creator: $creator'); - } - if (doubleType != null) args.add('doubleType: $doubleType'); - if (intType != null) args.add('intType: $intType'); + final args = { + 'iterableIid: ${iterableIid.quote()}', + if (typeArgProjection.isWinRTEnum) + 'tEnumCreator: ${typeArg.creator}' + else if (typeArg.creator case final creator?) + 'tObjectCreator: $creator', + if (typeArgProjection.isDouble) + 'tDoubleType: DoubleType.$typeArgNativeType' + else if (typeArgProjection.isInteger) + 'tIntType: IntType.$typeArgNativeType', + }; + return ', ${args.join(', ')}'; } diff --git a/packages/winrtgen/test/extensions/type_identifier_test.dart b/packages/winrtgen/test/extensions/type_identifier_test.dart index c6ae0530..371fb5d6 100644 --- a/packages/winrtgen/test/extensions/type_identifier_test.dart +++ b/packages/winrtgen/test/extensions/type_identifier_test.dart @@ -51,7 +51,7 @@ void main() { expect( method.returnType.typeIdentifier.creator, equals( - "(ptr) => IAsyncOperation.fromPtr(ptr, creator: (ptr) => IVectorView.fromPtr(ptr, creator: StorageFile.fromPtr, iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}'))")); + "(ptr) => IAsyncOperation.fromPtr(ptr, tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, iterableIid: '{9ac00304-83ea-5688-87b6-ae38aab65d0b}', tObjectCreator: StorageFile.fromPtr))")); }); test('(IAsyncOperation)', () { @@ -60,7 +60,7 @@ void main() { expect( method.returnType.typeIdentifier.creator, equals( - '(ptr) => IAsyncOperation.fromPtr(ptr, creator: StorageFile.fromPtr)')); + '(ptr) => IAsyncOperation.fromPtr(ptr, tResultObjectCreator: StorageFile.fromPtr)')); }); test('(IIterable>)', () { @@ -68,7 +68,7 @@ void main() { expect( typeDef.interfaces[3].typeSpec!.creator, equals( - '(ptr) => IIterable.fromPtr(ptr, creator: (ptr) => IKeyValuePair.fromPtr(ptr, creator: IJsonValue.fromPtr))')); + '(ptr) => IIterable.fromPtr(ptr, tObjectCreator: (ptr) => IKeyValuePair.fromPtr(ptr, vObjectCreator: IJsonValue.fromPtr))')); }); test('(IIterable>)', () { @@ -76,7 +76,7 @@ void main() { expect( typeDef.interfaces[1].typeSpec!.creator, equals( - '(ptr) => IIterable.fromPtr(ptr, creator: IKeyValuePair.fromPtr)')); + '(ptr) => IIterable.fromPtr(ptr, tObjectCreator: IKeyValuePair.fromPtr)')); }); test('(IMap)', () { @@ -86,7 +86,7 @@ void main() { expect( method.returnType.typeIdentifier.creator, equals( - "(ptr) => IMap.fromPtr(ptr, intType: IntType.uint32, creator: IBuffer.fromPtr, iterableIid: '{4fe7fe23-22b1-528c-881d-a4eceaef0f11}')")); + "(ptr) => IMap.fromPtr(ptr, iterableIid: '{4fe7fe23-22b1-528c-881d-a4eceaef0f11}', kIntType: IntType.uint32, vObjectCreator: IBuffer.fromPtr)")); }); test('(IMap)', () { @@ -94,7 +94,7 @@ void main() { expect( typeDef.interfaces[2].typeSpec!.creator, equals( - "(ptr) => IMap.fromPtr(ptr, creator: IJsonValue.fromPtr, iterableIid: '{dfabb6e1-0411-5a8f-aa87-354e7110f099}')")); + "(ptr) => IMap.fromPtr(ptr, iterableIid: '{dfabb6e1-0411-5a8f-aa87-354e7110f099}', vObjectCreator: IJsonValue.fromPtr)")); }); test('(IMap>)', () { @@ -104,7 +104,7 @@ void main() { expect( method.returnType.typeIdentifier.creator, equals( - "(ptr) => IMap.fromPtr(ptr, creator: (ptr) => IVectorView.fromPtr(ptr, iterableIid: '{5498f4f3-cee4-5b72-9729-815c4ad7b9dc}'), iterableIid: '{f819a276-b3f5-54d4-b8fd-c9adb7f700e3}')")); + "(ptr) => IMap.fromPtr(ptr, iterableIid: '{f819a276-b3f5-54d4-b8fd-c9adb7f700e3}', vObjectCreator: (ptr) => IVectorView.fromPtr(ptr, iterableIid: '{5498f4f3-cee4-5b72-9729-815c4ad7b9dc}'))")); }); test('(IMap)', () { @@ -121,7 +121,7 @@ void main() { expect( method.returnType.typeIdentifier.creator, equals( - "(ptr) => IMapView.fromPtr(ptr, enumKeyCreator: PedometerStepKind.from, creator: PedometerReading.fromPtr, iterableIid: '{098f29cb-bc91-5639-a541-d5a4811ec35b}')")); + "(ptr) => IMapView.fromPtr(ptr, iterableIid: '{098f29cb-bc91-5639-a541-d5a4811ec35b}', kEnumCreator: PedometerStepKind.from, vObjectCreator: PedometerReading.fromPtr)")); }); test('(IMapView)', () { @@ -154,7 +154,7 @@ void main() { expect( method.returnType.typeIdentifier.creator, equals( - "(ptr) => IVectorView.fromPtr(ptr, iterableIid: '{7784427e-f9cc-518d-964b-e50d5ce727f1}', intType: IntType.int64)")); + "(ptr) => IVectorView.fromPtr(ptr, iterableIid: '{7784427e-f9cc-518d-964b-e50d5ce727f1}', tIntType: IntType.int64)")); }); test('(Object?)', () { diff --git a/packages/winrtgen/test/goldens/imap_part.golden b/packages/winrtgen/test/goldens/imap_part.golden index 2e0da70d..f22d62ae 100644 --- a/packages/winrtgen/test/goldens/imap_part.golden +++ b/packages/winrtgen/test/goldens/imap_part.golden @@ -11,12 +11,12 @@ part of 'imap.dart'; final class _IMapGuidInspectable extends IMap { _IMapGuidInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapGuidInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapGuidInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(Guid key) { @@ -40,7 +40,7 @@ final class _IMapGuidInspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -250,12 +250,14 @@ final class __IMapGuidObjectVtbl extends Struct { final class _IMapInt16Inspectable extends IMap { _IMapInt16Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapInt16InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapInt16InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -275,7 +277,7 @@ final class _IMapInt16Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -353,12 +355,14 @@ final class __IMapInt16InspectableVtbl extends Struct { final class _IMapInt32Inspectable extends IMap { _IMapInt32Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapInt32InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapInt32InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -378,7 +382,7 @@ final class _IMapInt32Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -456,12 +460,14 @@ final class __IMapInt32InspectableVtbl extends Struct { final class _IMapInt64Inspectable extends IMap { _IMapInt64Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapInt64InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapInt64InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -481,7 +487,7 @@ final class _IMapInt64Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -665,12 +671,12 @@ final class __IMapObjectObjectVtbl extends Struct { final class _IMapStringInspectable extends IMap { _IMapStringInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapStringInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapStringInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(String key) { @@ -691,7 +697,7 @@ final class _IMapStringInspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -973,12 +979,12 @@ final class __IMapStringStringVtbl extends Struct { final class _IMapStringWinRTEnum extends IMap { _IMapStringWinRTEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.vEnumCreator}) + : super(vEnumCreator: vEnumCreator); late final __IMapStringWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IMapStringWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator vEnumCreator; @override V lookup(String key) { @@ -992,7 +998,7 @@ final class _IMapStringWinRTEnum extends IMap { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return vEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -1075,12 +1081,12 @@ final class __IMapStringWinRTEnumVtbl extends Struct { final class _IMapStringWinRTFlagsEnum extends IMap { _IMapStringWinRTFlagsEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.vEnumCreator}) + : super(vEnumCreator: vEnumCreator); late final __IMapStringWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IMapStringWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator vEnumCreator; @override V lookup(String key) { @@ -1094,7 +1100,7 @@ final class _IMapStringWinRTFlagsEnum extends IMap { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return vEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -1177,12 +1183,14 @@ final class __IMapStringWinRTFlagsEnumVtbl extends Struct { final class _IMapUint8Inspectable extends IMap { _IMapUint8Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapUint8InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapUint8InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1202,7 +1210,7 @@ final class _IMapUint8Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1280,12 +1288,14 @@ final class __IMapUint8InspectableVtbl extends Struct { final class _IMapUint16Inspectable extends IMap { _IMapUint16Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapUint16InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapUint16InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1305,7 +1315,7 @@ final class _IMapUint16Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1384,12 +1394,14 @@ final class __IMapUint16InspectableVtbl extends Struct { final class _IMapUint32Inspectable extends IMap { _IMapUint32Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapUint32InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapUint32InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1409,7 +1421,7 @@ final class _IMapUint32Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1488,12 +1500,14 @@ final class __IMapUint32InspectableVtbl extends Struct { final class _IMapUint64Inspectable extends IMap { _IMapUint64Inspectable.fromPtr(super.ptr, - {required super.iterableIid, super.intType, required this.creator}) - : super(creator: creator); + {required super.iterableIid, + super.kIntType, + required this.vObjectCreator}) + : super(vObjectCreator: vObjectCreator); late final __IMapUint64InspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapUint64InspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator vObjectCreator; @override V lookup(int key) { @@ -1513,7 +1527,7 @@ final class _IMapUint64Inspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1692,14 +1706,14 @@ final class __IMapUriStringVtbl extends Struct { final class _IMapWinRTEnumInspectable extends IMap { _IMapWinRTEnumInspectable.fromPtr(super.ptr, {required super.iterableIid, - required this.enumKeyCreator, - required this.creator}) - : super(enumKeyCreator: enumKeyCreator, creator: creator); + required this.kEnumCreator, + required this.vObjectCreator}) + : super(kEnumCreator: kEnumCreator, vObjectCreator: vObjectCreator); late final __IMapWinRTEnumInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapWinRTEnumInspectableVtbl>().ref; - final EnumCreator enumKeyCreator; - final COMObjectCreator creator; + final EnumCreator kEnumCreator; + final COMObjectCreator vObjectCreator; @override V lookup(K key) { @@ -1720,7 +1734,7 @@ final class _IMapWinRTEnumInspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override @@ -1804,14 +1818,14 @@ final class __IMapWinRTEnumInspectableVtbl extends Struct { final class _IMapWinRTFlagsEnumInspectable extends IMap { _IMapWinRTFlagsEnumInspectable.fromPtr(super.ptr, {required super.iterableIid, - required this.enumKeyCreator, - required this.creator}) - : super(enumKeyCreator: enumKeyCreator, creator: creator); + required this.kEnumCreator, + required this.vObjectCreator}) + : super(kEnumCreator: kEnumCreator, vObjectCreator: vObjectCreator); late final __IMapWinRTFlagsEnumInspectableVtbl _vtable = ptr.ref.vtable.cast<__IMapWinRTFlagsEnumInspectableVtbl>().ref; - final EnumCreator enumKeyCreator; - final COMObjectCreator creator; + final EnumCreator kEnumCreator; + final COMObjectCreator vObjectCreator; @override V lookup(K key) { @@ -1832,7 +1846,7 @@ final class _IMapWinRTFlagsEnumInspectable extends IMap { return null as V; } - return creator(retValuePtr); + return vObjectCreator(retValuePtr); } @override diff --git a/packages/winrtgen/test/goldens/ireference_part.golden b/packages/winrtgen/test/goldens/ireference_part.golden index fba01da4..0c7fe8e3 100644 --- a/packages/winrtgen/test/goldens/ireference_part.golden +++ b/packages/winrtgen/test/goldens/ireference_part.golden @@ -1122,11 +1122,11 @@ final class __IReferenceWhiteBalanceGainVtbl extends Struct { } final class _IReferenceWinRTEnum extends IReference { - _IReferenceWinRTEnum.fromPtr(super.ptr, {required this.enumCreator}); + _IReferenceWinRTEnum.fromPtr(super.ptr, {required this.tEnumCreator}); late final __IReferenceWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IReferenceWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T get value { @@ -1141,7 +1141,7 @@ final class _IReferenceWinRTEnum extends IReference { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -1157,11 +1157,11 @@ final class __IReferenceWinRTEnumVtbl extends Struct { } final class _IReferenceWinRTFlagsEnum extends IReference { - _IReferenceWinRTFlagsEnum.fromPtr(super.ptr, {required this.enumCreator}); + _IReferenceWinRTFlagsEnum.fromPtr(super.ptr, {required this.tEnumCreator}); late final __IReferenceWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IReferenceWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T get value { @@ -1176,7 +1176,7 @@ final class _IReferenceWinRTFlagsEnum extends IReference { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } diff --git a/packages/winrtgen/test/goldens/ivector_part.golden b/packages/winrtgen/test/goldens/ivector_part.golden index e8b09021..c94da951 100644 --- a/packages/winrtgen/test/goldens/ivector_part.golden +++ b/packages/winrtgen/test/goldens/ivector_part.golden @@ -1049,7 +1049,7 @@ final class __IVectorDateTimeVtbl extends Struct { final class _IVectorDouble extends IVector { _IVectorDouble.fromPtr(super.ptr, - {required super.iterableIid, super.doubleType}); + {required super.iterableIid, super.tDoubleType}); late final __IVectorDoubleVtbl _vtable = ptr.ref.vtable.cast<__IVectorDoubleVtbl>().ref; @@ -1365,7 +1365,7 @@ final class __IVectorDurationVtbl extends Struct { final class _IVectorFloat extends IVector { _IVectorFloat.fromPtr(super.ptr, - {required super.iterableIid, super.doubleType}); + {required super.iterableIid, super.tDoubleType}); late final __IVectorFloatVtbl _vtable = ptr.ref.vtable.cast<__IVectorFloatVtbl>().ref; @@ -1877,7 +1877,8 @@ final class __IVectorGuidVtbl extends Struct { } final class _IVectorInt16 extends IVector { - _IVectorInt16.fromPtr(super.ptr, {required super.iterableIid, super.intType}); + _IVectorInt16.fromPtr(super.ptr, + {required super.iterableIid, super.tIntType}); late final __IVectorInt16Vtbl _vtable = ptr.ref.vtable.cast<__IVectorInt16Vtbl>().ref; @@ -2032,7 +2033,8 @@ final class __IVectorInt16Vtbl extends Struct { } final class _IVectorInt32 extends IVector { - _IVectorInt32.fromPtr(super.ptr, {required super.iterableIid, super.intType}); + _IVectorInt32.fromPtr(super.ptr, + {required super.iterableIid, super.tIntType}); late final __IVectorInt32Vtbl _vtable = ptr.ref.vtable.cast<__IVectorInt32Vtbl>().ref; @@ -2187,7 +2189,8 @@ final class __IVectorInt32Vtbl extends Struct { } final class _IVectorInt64 extends IVector { - _IVectorInt64.fromPtr(super.ptr, {required super.iterableIid, super.intType}); + _IVectorInt64.fromPtr(super.ptr, + {required super.iterableIid, super.tIntType}); late final __IVectorInt64Vtbl _vtable = ptr.ref.vtable.cast<__IVectorInt64Vtbl>().ref; @@ -2883,12 +2886,12 @@ final class __IVectorNitRangeVtbl extends Struct { final class _IVectorInspectable extends IVector { _IVectorInspectable.fromPtr(super.ptr, - {required super.iterableIid, required this.creator}) - : super(creator: creator); + {required super.iterableIid, required this.tObjectCreator}) + : super(tObjectCreator: tObjectCreator); late final __IVectorInspectableVtbl _vtable = ptr.ref.vtable.cast<__IVectorInspectableVtbl>().ref; - final COMObjectCreator creator; + final COMObjectCreator tObjectCreator; @override T getAt(int index) { @@ -2908,7 +2911,7 @@ final class _IVectorInspectable extends IVector { return null as T; } - return creator(retValuePtr); + return tObjectCreator(retValuePtr); } @override @@ -2975,7 +2978,7 @@ final class _IVectorInspectable extends IVector { return ( retValuePtr.value, - items: items.toList(creator, length: retValuePtr.value) + items: items.toList(tObjectCreator, length: retValuePtr.value) ); } finally { free(items); @@ -5332,7 +5335,8 @@ final class __IVectorTextSegmentVtbl extends Struct { } final class _IVectorUint8 extends IVector { - _IVectorUint8.fromPtr(super.ptr, {required super.iterableIid, super.intType}); + _IVectorUint8.fromPtr(super.ptr, + {required super.iterableIid, super.tIntType}); late final __IVectorUint8Vtbl _vtable = ptr.ref.vtable.cast<__IVectorUint8Vtbl>().ref; @@ -5488,7 +5492,7 @@ final class __IVectorUint8Vtbl extends Struct { final class _IVectorUint16 extends IVector { _IVectorUint16.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorUint16Vtbl _vtable = ptr.ref.vtable.cast<__IVectorUint16Vtbl>().ref; @@ -5644,7 +5648,7 @@ final class __IVectorUint16Vtbl extends Struct { final class _IVectorUint32 extends IVector { _IVectorUint32.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorUint32Vtbl _vtable = ptr.ref.vtable.cast<__IVectorUint32Vtbl>().ref; @@ -5800,7 +5804,7 @@ final class __IVectorUint32Vtbl extends Struct { final class _IVectorUint64 extends IVector { _IVectorUint64.fromPtr(super.ptr, - {required super.iterableIid, super.intType}); + {required super.iterableIid, super.tIntType}); late final __IVectorUint64Vtbl _vtable = ptr.ref.vtable.cast<__IVectorUint64Vtbl>().ref; @@ -6134,12 +6138,12 @@ final class __IVectorWindowIdVtbl extends Struct { final class _IVectorWinRTEnum extends IVector { _IVectorWinRTEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.tEnumCreator}) + : super(tEnumCreator: tEnumCreator); late final __IVectorWinRTEnumVtbl _vtable = ptr.ref.vtable.cast<__IVectorWinRTEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T getAt(int index) { @@ -6152,7 +6156,7 @@ final class _IVectorWinRTEnum extends IVector { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -6220,7 +6224,7 @@ final class _IVectorWinRTEnum extends IVector { return ( retValuePtr.value, - items: items.toEnumList(enumCreator, length: retValuePtr.value) + items: items.toEnumList(tEnumCreator, length: retValuePtr.value) ); } finally { free(items); @@ -6294,12 +6298,12 @@ final class __IVectorWinRTEnumVtbl extends Struct { final class _IVectorWinRTFlagsEnum extends IVector { _IVectorWinRTFlagsEnum.fromPtr(super.ptr, - {required super.iterableIid, required this.enumCreator}) - : super(enumCreator: enumCreator); + {required super.iterableIid, required this.tEnumCreator}) + : super(tEnumCreator: tEnumCreator); late final __IVectorWinRTFlagsEnumVtbl _vtable = ptr.ref.vtable.cast<__IVectorWinRTFlagsEnumVtbl>().ref; - final EnumCreator enumCreator; + final EnumCreator tEnumCreator; @override T getAt(int index) { @@ -6312,7 +6316,7 @@ final class _IVectorWinRTFlagsEnum extends IVector { if (FAILED(hr)) throwWindowsException(hr); - return enumCreator(retValuePtr.value); + return tEnumCreator(retValuePtr.value); } finally { free(retValuePtr); } @@ -6380,7 +6384,7 @@ final class _IVectorWinRTFlagsEnum extends IVector { return ( retValuePtr.value, - items: items.toEnumList(enumCreator, length: retValuePtr.value) + items: items.toEnumList(tEnumCreator, length: retValuePtr.value) ); } finally { free(items); diff --git a/packages/winrtgen/test/projections/generic_interface_test.dart b/packages/winrtgen/test/projections/generic_interface_test.dart index baf76199..006fa3b9 100644 --- a/packages/winrtgen/test/projections/generic_interface_test.dart +++ b/packages/winrtgen/test/projections/generic_interface_test.dart @@ -332,7 +332,7 @@ void main() { expect( projection.namedConstructor, equals( - '_IAsyncOperationInspectable.fromPtr(super.ptr, {required this.creator});')); + '_IAsyncOperationInspectable.fromPtr(super.ptr, {required this.tResultObjectCreator});')); }); test('(3)', () { @@ -341,7 +341,7 @@ void main() { expect( projection.namedConstructor, equals( - '_IAsyncOperationWinRTEnum.fromPtr(super.ptr, {required this.enumCreator});')); + '_IAsyncOperationWinRTEnum.fromPtr(super.ptr, {required this.tResultEnumCreator});')); }); test('(4)', () { @@ -350,7 +350,7 @@ void main() { expect( projection.namedConstructor, equals( - '_IVectorInt32.fromPtr(super.ptr, {required super.iterableIid, super.intType});')); + '_IVectorInt32.fromPtr(super.ptr, {required super.iterableIid, super.tIntType});')); }); test('(5)', () { @@ -359,7 +359,7 @@ void main() { expect( projection.namedConstructor, equals( - '_IVectorViewFloat.fromPtr(super.ptr, {required super.iterableIid, super.doubleType});')); + '_IVectorViewFloat.fromPtr(super.ptr, {required super.iterableIid, super.tDoubleType});')); }); test('(6)', () { @@ -381,7 +381,7 @@ void main() { expect( projection.namedConstructor, equals( - '_IMapStringInspectable.fromPtr(super.ptr, {required super.iterableIid, required this.creator}) : super(creator: creator);')); + '_IMapStringInspectable.fromPtr(super.ptr, {required super.iterableIid, required this.vObjectCreator}) : super(vObjectCreator: vObjectCreator);')); }); test('(8)', () { @@ -392,7 +392,7 @@ void main() { expect( projection.namedConstructor, equals( - '_IMapWinRTEnumInspectable.fromPtr(super.ptr, {required super.iterableIid, required this.enumKeyCreator, required this.creator}) : super(enumKeyCreator: enumKeyCreator, creator: creator);')); + '_IMapWinRTEnumInspectable.fromPtr(super.ptr, {required super.iterableIid, required this.kEnumCreator, required this.vObjectCreator}) : super(kEnumCreator: kEnumCreator, vObjectCreator: vObjectCreator);')); }); }); diff --git a/packages/winrtgen/test/projections/getter_test.dart b/packages/winrtgen/test/projections/getter_test.dart index 74d30c64..21f483ac 100644 --- a/packages/winrtgen/test/projections/getter_test.dart +++ b/packages/winrtgen/test/projections/getter_test.dart @@ -310,7 +310,7 @@ void main() { expect(projection.failedCheck, equals(failedCheck())); expect(projection.nullCheck, isEmpty); expect(projection.returnStatement, - equals('return enumCreator(retValuePtr.value);')); + equals('return tEnumCreator(retValuePtr.value);')); expect(projection.postambles, equals(['free(retValuePtr);'])); }); @@ -343,7 +343,7 @@ void main() { expect(projection.failedCheck, equals(failedCheck())); expect(projection.nullCheck, isEmpty); expect(projection.returnStatement, - equals('return enumKeyCreator(retValuePtr.value);')); + equals('return kEnumCreator(retValuePtr.value);')); expect(projection.postambles, equals(['free(retValuePtr);'])); }); @@ -376,7 +376,7 @@ void main() { expect(projection.failedCheck, equals(failedCheck())); expect(projection.nullCheck, isEmpty); expect(projection.returnStatement, - equals('return enumCreator(retValuePtr.value);')); + equals('return tEnumCreator(retValuePtr.value);')); expect(projection.postambles, equals(['free(retValuePtr);'])); }); @@ -409,8 +409,8 @@ void main() { expect(projection.failedCheck, equals(failedCheck(freeRetVal: true))); expect(projection.nullCheck, equals(nullCheck('retValuePtr', castReturn: true))); - expect( - projection.returnStatement, equals('return creator(retValuePtr);')); + expect(projection.returnStatement, + equals('return tObjectCreator(retValuePtr);')); expect(projection.postambles, isEmpty); }); @@ -521,8 +521,8 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' return IMap.fromPtr(value, iterableIid: '{4fe7fe23-22b1-528c-881d-a4eceaef0f11}', - creator: IBuffer.fromPtr, - intType: IntType.uint32); + kIntType: IntType.uint32, + vObjectCreator: IBuffer.fromPtr); ''')); expect(projection.postambles, isEmpty); }); @@ -649,7 +649,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' return IVector.fromPtr(value, iterableIid: '{47d4be05-58f1-522e-81c6-975eb4131bb9}', - enumCreator: DeviceClass.from); + tEnumCreator: DeviceClass.from); ''')); expect(projection.postambles, isEmpty); }); @@ -682,7 +682,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' return IVector.fromPtr(value, iterableIid: '{421d4b91-b13b-5f37-ae54-b5249bd80539}', - intType: IntType.uint32); + tIntType: IntType.uint32); ''')); expect(projection.postambles, isEmpty); }); @@ -839,7 +839,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' return IVectorView.fromPtr(value, iterableIid: '{7784427e-f9cc-518d-964b-e50d5ce727f1}', - intType: IntType.int64).toList(); + tIntType: IntType.int64).toList(); ''')); expect(projection.postambles, isEmpty); }); diff --git a/packages/winrtgen/test/projections/method_forwarders_test.dart b/packages/winrtgen/test/projections/method_forwarders_test.dart index 974143b8..945cae44 100644 --- a/packages/winrtgen/test/projections/method_forwarders_test.dart +++ b/packages/winrtgen/test/projections/method_forwarders_test.dart @@ -56,28 +56,14 @@ void main() { expect( methodForwardersProjection.constructorArgs, equals( - ", creator: IJsonValue.fromPtr, iterableIid: '{cb0492b6-4113-55cf-b2c5-99eb428ba493}'")); - }); - - test('creatorArgument', () { - expect(methodForwardersProjection.creatorArgument, - equals('creator: IJsonValue.fromPtr')); - }); - - test('iterableIidArgument', () { - expect(methodForwardersProjection.iterableIidArgument, - equals("iterableIid: '{cb0492b6-4113-55cf-b2c5-99eb428ba493}'")); - }); - - test('intTypeArgument', () { - expect(methodForwardersProjection.intTypeArgument, isNull); + ", iterableIid: '{cb0492b6-4113-55cf-b2c5-99eb428ba493}', tObjectCreator: IJsonValue.fromPtr")); }); test('interfaceInsantiation', () { expect( methodForwardersProjection.interfaceInstantiation, equals( - "IVector.fromPtr(toInterface('{d44662bc-dce3-59a8-9272-4b210f33908b}'), creator: IJsonValue.fromPtr, iterableIid: '{cb0492b6-4113-55cf-b2c5-99eb428ba493}');")); + "IVector.fromPtr(toInterface('{d44662bc-dce3-59a8-9272-4b210f33908b}'), iterableIid: '{cb0492b6-4113-55cf-b2c5-99eb428ba493}', tObjectCreator: IJsonValue.fromPtr);")); }); test('methods', () { diff --git a/packages/winrtgen/test/projections/method_test.dart b/packages/winrtgen/test/projections/method_test.dart index 2eb4d729..86289bd3 100644 --- a/packages/winrtgen/test/projections/method_test.dart +++ b/packages/winrtgen/test/projections/method_test.dart @@ -293,7 +293,7 @@ void main() { expect(projection.failedCheck, equals(failedCheck())); expect(projection.nullCheck, isEmpty); expect(projection.returnStatement, - equals('return enumCreator(retValuePtr.value);')); + equals('return tEnumCreator(retValuePtr.value);')); expect(projection.postambles, equals(['free(retValuePtr);'])); }); @@ -325,7 +325,7 @@ void main() { expect(projection.failedCheck, equals(failedCheck())); expect(projection.nullCheck, isEmpty); expect(projection.returnStatement, - equals('return enumCreator(retValuePtr.value);')); + equals('return tEnumCreator(retValuePtr.value);')); expect(projection.postambles, equals(['free(retValuePtr);'])); }); @@ -357,8 +357,8 @@ void main() { expect(projection.failedCheck, equals(failedCheck(freeRetVal: true))); expect(projection.nullCheck, equals(nullCheck('retValuePtr', castReturn: true))); - expect( - projection.returnStatement, equals('return creator(retValuePtr);')); + expect(projection.returnStatement, + equals('return tObjectCreator(retValuePtr);')); expect(projection.postambles, isEmpty); }); @@ -561,7 +561,7 @@ void main() { expect(projection.nullCheck, isEmpty); expect(projection.returnStatement, equalsIgnoringWhitespace(''' final asyncOperation = - IAsyncOperation.fromPtr(operation, intType: IntType.uint32); + IAsyncOperation.fromPtr(operation, tResultIntType: IntType.uint32); return asyncOperation.toFuture(asyncOperation.getResults); ''')); expect(projection.postambles, isEmpty); @@ -600,7 +600,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' final asyncOperation = IAsyncOperation>.fromPtr(operation, - creator: (ptr) => IMapView.fromPtr(ptr, + tResultObjectCreator: (ptr) => IMapView.fromPtr(ptr, iterableIid: '{fe2f3d47-5d47-5499-8374-430c7cda0204}')); return asyncOperation.toFuture(() => asyncOperation.getResults().toMap()); ''')); @@ -636,7 +636,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' final asyncOperation = IAsyncOperation?>.fromPtr(operation, - creator: (ptr) => IReference.fromPtr(ptr, + tResultObjectCreator: (ptr) => IReference.fromPtr(ptr, referenceIid: '{5541d8a7-497c-5aa4-86fc-7713adbf2a2c}')); return asyncOperation.toFuture(() => asyncOperation.getResults()?.value); ''')); @@ -670,9 +670,9 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' final asyncOperation = IAsyncOperation>.fromPtr(operation, - creator: (ptr) => IVectorView.fromPtr(ptr, - creator: User.fromPtr, - iterableIid: '{d1bacd1f-0376-5823-8c29-1d45b9f4c191}')); + tResultObjectCreator: (ptr) => IVectorView.fromPtr(ptr, + iterableIid: '{d1bacd1f-0376-5823-8c29-1d45b9f4c191}', + tObjectCreator: User.fromPtr)); return asyncOperation.toFuture(() => asyncOperation.getResults().toList()); ''')); expect(projection.postambles, isEmpty); @@ -705,7 +705,7 @@ void main() { expect(projection.nullCheck, isEmpty); expect(projection.returnStatement, equalsIgnoringWhitespace(''' final asyncOperation = - IAsyncOperation.fromPtr(operation, creator: StorageFile.fromPtr); + IAsyncOperation.fromPtr(operation, tResultObjectCreator: StorageFile.fromPtr); return asyncOperation.toFuture(asyncOperation.getResults); ''')); expect(projection.postambles, isEmpty); @@ -773,7 +773,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' return IMap.fromPtr(result, iterableIid: '{f819a276-b3f5-54d4-b8fd-c9adb7f700e3}', - creator: (ptr) => IVectorView.fromPtr(ptr, + vObjectCreator: (ptr) => IVectorView.fromPtr(ptr, iterableIid: '{5498f4f3-cee4-5b72-9729-815c4ad7b9dc}')); ''')); expect(projection.postambles, isEmpty); @@ -935,7 +935,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' return IVector.fromPtr(value, iterableIid: '{3acbf03c-0a79-5823-aaa9-d88bc3f8f594}', - creator: VideoStreamDescriptor.fromPtr); + tObjectCreator: VideoStreamDescriptor.fromPtr); ''')); expect(projection.postambles, isEmpty); }); @@ -967,7 +967,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' return IVectorView.fromPtr(result, iterableIid: '{b01bee51-063a-5fda-bd72-d76637bb8cb8}', - doubleType: DoubleType.float).toList(); + tDoubleType: DoubleType.float).toList(); ''')); expect(projection.postambles, isEmpty); }); @@ -999,7 +999,7 @@ void main() { expect(projection.returnStatement, equalsIgnoringWhitespace(''' return IVectorView.fromPtr(result, iterableIid: '{81a643fb-f51c-5565-83c4-f96425777b66}', - intType: IntType.int32).toList(); + tIntType: IntType.int32).toList(); ''')); expect(projection.postambles, isEmpty); }); diff --git a/packages/winrtgen/test/projections/parameter_test.dart b/packages/winrtgen/test/projections/parameter_test.dart index 8db414aa..df79bb40 100644 --- a/packages/winrtgen/test/projections/parameter_test.dart +++ b/packages/winrtgen/test/projections/parameter_test.dart @@ -205,7 +205,7 @@ void main() { expect(projection.needsAllocation, isFalse); expect(projection.needsDeallocation, isFalse); expect(projection.creatorPreamble, isEmpty); - expect(projection.creator, equals('enumCreator(value.value)')); + expect(projection.creator, equals('tEnumCreator(value.value)')); expect(projection.into, equals('(value as WinRTEnum).value')); expect(projection.preambles, isEmpty); expect(projection.nullCheck, isEmpty); @@ -230,7 +230,7 @@ void main() { expect(projection.needsAllocation, isFalse); expect(projection.needsDeallocation, isFalse); expect(projection.creatorPreamble, isEmpty); - expect(projection.creator, equals('enumCreator(value.value)')); + expect(projection.creator, equals('tEnumCreator(value.value)')); expect(projection.into, equals('(value as WinRTEnum).value')); expect(projection.preambles, isEmpty); expect(projection.nullCheck, isEmpty); @@ -255,7 +255,7 @@ void main() { expect(projection.needsAllocation, isFalse); expect(projection.needsDeallocation, isFalse); expect(projection.creatorPreamble, isEmpty); - expect(projection.creator, equals('creator(value)')); + expect(projection.creator, equals('tObjectCreator(value)')); expect(projection.into, equals('(value as IInspectable).lpVtbl')); expect(projection.preambles, isEmpty); expect( @@ -423,7 +423,7 @@ void main() { expect(projection.creator, equalsIgnoringWhitespace(''' IReference.fromPtr(value, referenceIid: '{91c0ba96-9e69-5b82-bf1d-83ab2a509c53}', - enumCreator: BluetoothLEAdvertisementFlags.from).value + tEnumCreator: BluetoothLEAdvertisementFlags.from).value ''')); expect(projection.into, equals('value?.toReference().lpVtbl ?? nullptr')); expect(projection.preambles, isEmpty); @@ -477,7 +477,7 @@ void main() { expect(projection.creator, equalsIgnoringWhitespace(''' IVector.fromPtr(dnsServerList, iterableIid: '{9e5f3ed0-cf1c-5d38-832c-acea6164bf5c}', - creator: HostName.fromPtr) + tObjectCreator: HostName.fromPtr) ''')); expect(projection.into, equals('dnsServerList.lpVtbl')); expect(projection.preambles, isEmpty); diff --git a/pubspec.yaml b/pubspec.yaml index dfb8c805..a28efc17 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,5 +4,5 @@ environment: sdk: '^3.0.0' dev_dependencies: - lints: ^2.1.0 + lints: ^3.0.0 melos: ^3.0.1