I think it would be very nice to have something like that to reduce the burden of implementing COM interfaces. This shows for instance on the windows.gaming.input module a 30% LoC reduction (from ~6800 to ~4700), even though the module already had a boilerplate helper macros already.
The MR introduces macros to automatically implement each IUnknown method, as well as all of them at once. It also includes a helper to implement IInspectable methods at once, as well as macros to forward both interface methods to a base interface or an outer object. Last, it provides higher-level macros to implement a main interface and any number of sub interfaces and generate IUnknown, forwarding and vtables for all of them at once, with IInspectable support when needed.
It uses widl to generate additional per-interface macros, for things like inheritance and vtable generation. The rest of the macros are otherwise shared in a Wine-specific header.
The implementation is split to show individual macro being used, although they are later replaced by higher-level macros. The individual helpers are still useful in some corner cases where specific behavior needs to be implemented, or for aggregating classes.
--
v3: include: Add a parameter to COM helper END to control QI traces.
windows.gaming.input: Use the new COM macros everywhere possible.
include: Introduce new macros for COM heritage implementation.
widl: Generate some INTERFACE_IMPL/FWD helper macros.
include: Introduce new macros for IInspectable WinRT implementation.
include: Introduce new macros for COM IUnknown implementation.
include: Introduce new macros for COM QueryInterface implementation.
widl: Generate some QUERY_INTERFACE helper macros.
include: Introduce new macros for COM AddRef/Release implementation.
include: Introduce new helper macros for COM implementation.
windows.gaming.input: Use the new INTERFACE_VTBL macros.
widl: Generate some INTERFACE_VTBL helper macros.
windows.gaming.input: Use a separate interface for IAgileObject.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6207
--
v2: mshtml: Use actual referenced prop flags for window script props.
jscript: Make most builtin global objects configurable.
jscript: Delete external props before redefining them.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6678
This completely refactors the winex11 window state tracking, keeping track of the desired/pending/current window state and config in a fully asynchronous way, and avoiding duplicate requests. I believe this mitigates various race conditions that we're suffering from, solving most spurious event feedback loops when the X11 state is being applied while some win32 state change is being requested, and fixing the spurious d3d/ddraw/user32 test failures.
--
v9: winex11: Request window state updates asynchronously.
winex11: Update the window client config on window state changes.
winex11: Wait for pending ConfigureNotify before updating the client state.
winex11: Wait for pending _NET_WM_STATE before updating the client state.
winex11: Don't expect WM_STATE events on override-redirect windows.
winex11: Listen to PropertyNotify events on the virtual desktop window.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6569
This completely refactors the winex11 window state tracking, keeping track of the desired/pending/current window state and config in a fully asynchronous way, and avoiding duplicate requests. I believe this mitigates various race conditions that we're suffering from, solving most spurious event feedback loops when the X11 state is being applied while some win32 state change is being requested, and fixing the spurious d3d/ddraw/user32 test failures.
--
v8: winex11: Request window state updates asynchronously.
winex11: Update the window client config on window state changes.
winex11: Wait for pending ConfigureNotify before updating the client state.
winex11: Wait for pending _NET_WM_STATE before updating the client state.
winex11: Don't expect WM_STATE events on override-redirect windows.
winex11: Listen to PropertyNotify events on the virtual desktop window.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6569