[PATCH 0/2] MR2489: include: Add Windows.System.DispatcherQueue declaration.
From: Biswapriyo Nath <nathbappai(a)gmail.com> I.e. get rid of nested namespaces and forward declares, separate attributes with commas and right align pointer declarations. Signed-off-by: Biswapriyo Nath <nathbappai(a)gmail.com> --- include/windows.system.idl | 76 ++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/include/windows.system.idl b/include/windows.system.idl index aaf5ecd69a1..f21080cc71f 100644 --- a/include/windows.system.idl +++ b/include/windows.system.idl @@ -26,48 +26,44 @@ import "eventtoken.idl"; import "windowscontracts.idl"; import "windows.foundation.idl"; -namespace Windows { - namespace System { - interface IUser; - interface IUserStatics; - interface IUserChangedEventArgs; - interface IUserChangedEventArgs2; - runtimeclass User; - runtimeclass UserChangedEventArgs; - } -} +namespace Windows.System +{ + interface IUser; + interface IUserStatics; + interface IUserChangedEventArgs; + interface IUserChangedEventArgs2; -namespace Windows { - namespace System { - [ - contract(Windows.Foundation.UniversalApiContract, 1.0), - exclusiveto(Windows.System.UserChangedEventArgs), - uuid(086459dc-18c6-48db-bc99-724fb9203ccc) - ] - interface IUserChangedEventArgs : IInspectable - { - [propget] HRESULT User([out, retval] Windows.System.User** value); - } + runtimeclass User; + runtimeclass UserChangedEventArgs; - [ - contract(Windows.Foundation.UniversalApiContract, 1.0), - marshaling_behavior(agile), - static(Windows.System.IUserStatics, Windows.Foundation.UniversalApiContract, 1.0), - threading(both), - ] - runtimeclass User - { - [default] interface Windows.System.IUser; - } + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.System.UserChangedEventArgs), + uuid(086459dc-18c6-48db-bc99-724fb9203ccc) + ] + interface IUserChangedEventArgs : IInspectable + { + [propget] HRESULT User([out, retval] Windows.System.User **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.System.IUserStatics, Windows.Foundation.UniversalApiContract, 1.0), + threading(both), + ] + runtimeclass User + { + [default] interface Windows.System.IUser; + } - [ - contract(Windows.Foundation.UniversalApiContract, 1.0), - marshaling_behavior(agile) - ] - runtimeclass UserChangedEventArgs - { - [default] interface Windows.System.IUserChangedEventArgs; - [contract(Windows.Foundation.UniversalApiContract, 10.0)] interface Windows.System.IUserChangedEventArgs2; - } + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass UserChangedEventArgs + { + [default] interface Windows.System.IUserChangedEventArgs; + [contract(Windows.Foundation.UniversalApiContract, 10.0)] interface Windows.System.IUserChangedEventArgs2; } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2489
From: Biswapriyo Nath <nathbappai(a)gmail.com> Signed-off-by: Biswapriyo Nath <nathbappai(a)gmail.com> --- include/windows.system.idl | 162 +++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/include/windows.system.idl b/include/windows.system.idl index f21080cc71f..60f8705ed53 100644 --- a/include/windows.system.idl +++ b/include/windows.system.idl @@ -28,14 +28,135 @@ import "windows.foundation.idl"; namespace Windows.System { + typedef enum DispatcherQueuePriority DispatcherQueuePriority; + + interface IDispatcherQueue; + interface IDispatcherQueue2; + interface IDispatcherQueueController; + interface IDispatcherQueueControllerStatics; + interface IDispatcherQueueShutdownStartingEventArgs; + interface IDispatcherQueueStatics; + interface IDispatcherQueueTimer; interface IUser; interface IUserStatics; interface IUserChangedEventArgs; interface IUserChangedEventArgs2; + runtimeclass DispatcherQueue; + runtimeclass DispatcherQueueController; + runtimeclass DispatcherQueueShutdownStartingEventArgs; + runtimeclass DispatcherQueueTimer; runtimeclass User; runtimeclass UserChangedEventArgs; + declare + { + interface Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueue *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueue *, Windows.System.DispatcherQueueShutdownStartingEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueueTimer *, IInspectable *>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0) + ] + enum DispatcherQueuePriority + { + Low = -10, + Normal = 0, + High = 10 + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + uuid(dfa2dc9c-1a2d-4917-98f2-939af1d6e0c8) + ] + delegate HRESULT DispatcherQueueHandler(); + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.System.DispatcherQueue), + uuid(603e88e4-a338-4ffe-a457-a5cfb9ceb899) + ] + interface IDispatcherQueue : IInspectable + { + HRESULT CreateTimer([out, retval] Windows.System.DispatcherQueueTimer **result); + [overload("TryEnqueue")] HRESULT TryEnqueue([in] Windows.System.DispatcherQueueHandler *callback, [out, retval] boolean *result); + [overload("TryEnqueue")] HRESULT TryEnqueueWithPriority([in] Windows.System.DispatcherQueuePriority priority, [in] Windows.System.DispatcherQueueHandler *callback, [out, retval] boolean *result); + [eventadd] HRESULT ShutdownStarting([in] Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueue *, Windows.System.DispatcherQueueShutdownStartingEventArgs *> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT ShutdownStarting([in] EventRegistrationToken token); + [eventadd] HRESULT ShutdownCompleted([in] Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueue *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT ShutdownCompleted([in] EventRegistrationToken token); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.System.DispatcherQueue), + uuid(c822c647-30ef-506e-bd1e-a647ae6675ff) + ] + interface IDispatcherQueue2 : IInspectable + { + [propget] HRESULT HasThreadAccess([out, retval] boolean *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.System.DispatcherQueueController), + uuid(22f34e66-50db-4e36-a98d-61c01b384d20) + ] + interface IDispatcherQueueController : IInspectable + { + [propget] HRESULT DispatcherQueue([out, retval] Windows.System.DispatcherQueue **value); + HRESULT ShutdownQueueAsync([out, retval] Windows.Foundation.IAsyncAction **operation); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.System.DispatcherQueueController), + uuid(0a6c98e0-5198-49a2-a313-3f70d1f13c27) + ] + interface IDispatcherQueueControllerStatics : IInspectable + { + HRESULT CreateOnDedicatedThread([out, retval] Windows.System.DispatcherQueueController **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.System.DispatcherQueueShutdownStartingEventArgs), + uuid(c4724c4c-ff97-40c0-a226-cc0aaa545e89) + ] + interface IDispatcherQueueShutdownStartingEventArgs : IInspectable + { + HRESULT GetDeferral([out, retval] Windows.Foundation.Deferral **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.System.DispatcherQueue), + uuid(a96d83d7-9371-4517-9245-d0824ac12c74) + ] + interface IDispatcherQueueStatics : IInspectable + { + HRESULT GetForCurrentThread([out, retval] Windows.System.DispatcherQueue **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.System.DispatcherQueueTimer), + uuid(5feabb1d-a31c-4727-b1ac-37454649d56a) + ] + interface IDispatcherQueueTimer : IInspectable + { + [propget] HRESULT Interval([out, retval] Windows.Foundation.TimeSpan *value); + [propput] HRESULT Interval([in] Windows.Foundation.TimeSpan value); + [propget] HRESULT IsRunning([out, retval] boolean *value); + [propget] HRESULT IsRepeating([out, retval] boolean *value); + [propput] HRESULT IsRepeating([in] boolean value); + HRESULT Start(); + HRESULT Stop(); + [eventadd] HRESULT Tick([in] Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueueTimer *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT Tick([in] EventRegistrationToken token); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.System.UserChangedEventArgs), @@ -46,6 +167,47 @@ namespace Windows.System [propget] HRESULT User([out, retval] Windows.System.User **value); } + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + marshaling_behavior(agile), + static(Windows.System.IDispatcherQueueStatics, Windows.Foundation.UniversalApiContract, 5.0), + threading(both) + ] + runtimeclass DispatcherQueue + { + [default] interface Windows.System.IDispatcherQueue; + [contract(Windows.Foundation.UniversalApiContract, 8.0)] interface Windows.System.IDispatcherQueue2; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + marshaling_behavior(agile), + static(Windows.System.IDispatcherQueueControllerStatics, Windows.Foundation.UniversalApiContract, 5.0), + threading(both) + ] + runtimeclass DispatcherQueueController + { + [default] interface Windows.System.IDispatcherQueueController; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + marshaling_behavior(agile) + ] + runtimeclass DispatcherQueueShutdownStartingEventArgs + { + [default] interface Windows.System.IDispatcherQueueShutdownStartingEventArgs; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + marshaling_behavior(agile) + ] + runtimeclass DispatcherQueueTimer + { + [default] interface Windows.System.IDispatcherQueueTimer; + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(agile), -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2489
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details: The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=130998 Your paranoid android. === debian11 (32 bit report) === uiautomationcore: uiautomation.c:12055: Test failed: Timed out waiting for the child process
Mohamad Al-Jaf (@maljaf) commented about include/windows.system.idl:
+ + declare + { + interface Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueue *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueue *, Windows.System.DispatcherQueueShutdownStartingEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueueTimer *, IInspectable *>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0) + ] + enum DispatcherQueuePriority + { + Low = -10, + Normal = 0, + High = 10 We usually add a comma to the last entry in enums.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2489#note_27727
Mohamad Al-Jaf (@maljaf) commented about include/windows.system.idl:
+ contract(Windows.Foundation.UniversalApiContract, 5.0), + uuid(dfa2dc9c-1a2d-4917-98f2-939af1d6e0c8) + ] + delegate HRESULT DispatcherQueueHandler(); + + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.System.DispatcherQueue), + uuid(603e88e4-a338-4ffe-a457-a5cfb9ceb899) + ] + interface IDispatcherQueue : IInspectable + { + HRESULT CreateTimer([out, retval] Windows.System.DispatcherQueueTimer **result); + [overload("TryEnqueue")] HRESULT TryEnqueue([in] Windows.System.DispatcherQueueHandler *callback, [out, retval] boolean *result); + [overload("TryEnqueue")] HRESULT TryEnqueueWithPriority([in] Windows.System.DispatcherQueuePriority priority, [in] Windows.System.DispatcherQueueHandler *callback, [out, retval] boolean *result); + [eventadd] HRESULT ShutdownStarting([in] Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueue *, Windows.System.DispatcherQueueShutdownStartingEventArgs *> *handler, [out, retval] EventRegistrationToken *token); Some of these lines are a bit long, like these ones. The parameters are usually split like this:
```suggestion:-1+0 [overload("TryEnqueue")] HRESULT TryEnqueueWithPriority([in] Windows.System.DispatcherQueuePriority priority, [in] Windows.System.DispatcherQueueHandler *callback, [out, retval] boolean *result); [eventadd] HRESULT ShutdownStarting([in] Windows.Foundation.TypedEventHandler<Windows.System.DispatcherQueue *, Windows.System.DispatcherQueueShutdownStartingEventArgs *> *handler, [out, retval] EventRegistrationToken *token); ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2489#note_27728
Is this for mingw Firefox build? I've been meaning to submit header patches for it. I also had a patch to add IDispatcherQueue for graphics capture, windows.ui.composition.idl too. It looks like Firefox also needs windows.ui.core which I have here: https://gitlab.winehq.org/maljaf/wine/-/commit/4d4f46507dee8eef096b15f974b26... I'll have to split them up for easier review, they're fairly large. Also, you're adding definitions here, not declarations. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2489#note_27729
Yes, this is for mingw Firefox build. If you are working on the same thing, should I close this merge request? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2489#note_27732
On Fri Mar 24 07:23:23 2023 +0000, Biswapriyo Nath wrote:
Yes, this is for mingw Firefox build. If you are working on the same thing, should I close this merge request? No, keep it open. It's mostly coincidental that Firefox needs the same headers/definitions as the DLLs I'm working on. Here's another header that's needed: https://gitlab.winehq.org/wine/wine/-/merge_requests/2491
I'll submit my other patches later, though if you've already worked on them feel free to submit them. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2489#note_27735
participants (4)
-
Biswapriyo Nath -
Biswapriyo Nath (@Biswa96) -
Marvin -
Mohamad Al-Jaf (@maljaf)