marlersoft / zigwin32gen

Generates Complete Zig bindings for Win32. See https://github.com/marlersoft/zigwin32 for the bindings themselves.
108 stars 17 forks source link

replace method mixins with fields for all base types #38

Closed marler8997 closed 3 months ago

marler8997 commented 3 months ago

This adds all base types (aka interfaces) going up the inheritance tree as union fields for every COM base type. This removes the need for the method mixins as any inherited method can be called through a single field. i.e. instead of:

foo.IUnknown_Release();

you now do:

foo.IUnknown.Release();

Note that the method names no longer need to be namespaced as well. In a future change we'd still like to get to:

foo.Release();

if possible. To accomplish this we'll need to check for symbol conflicts between all inherited interfaces and remove all but one of the conflicting symbols. We would probably give precedence to the type/interface furthest down the inheritance tree and also note that you'll still be able to call any methods that were omitted through the appropriate union field.