Big refactor
I forked this project some time ago because it seemed quite dead but I liked the premise. Now that some life has returned and I got my fork into a good condition I wanted to open the discussion on whether (some of) these changes should be merged.
My overarching goal was to make the code more robust.
I tried to check and document the unsafe code, verified the platform implementations with each platform's documentation and added graceful error handling.
The biggest and potentially most controversial API change is probably the merging of EventSource and EditorWindow into only EditorWindow. I did not understand the original motivation to separate them. In my fork of ampli-Fe I used Arc<EditorWindow> and everything worked out fine.
I tested the changes using the ampli-Fe fork in REAPER on Debian, Windows and macOS. Windows using DX12 has a weird graphical issue but I would imagine that's down to something with the update to wgpu 0.12, will double check that and create a separate issue. The original macOS implementation did not work in REAPER, as the mouse input and rendered output were misaligned. Returning the subview instead of the parent NSView as RawWindowHandle fixed this.
That's about the gist of it. I'd be interested to hear your thoughts on this.
I'll have to cleanup my git log a bit, all those duplicate commits...
Edit: formatting