winit icon indicating copy to clipboard operation
winit copied to clipboard

Reduce code duplication between macOS and iOS

Open felixrabe opened this issue 6 years ago • 3 comments

There's duplicated code in:

  • src/platform_impl/macos
  • src/platform_impl/ios

Maybe introduce src/platform_impl/common_apple as a module that can hold common code for Apple platforms.

felixrabe avatar Jul 08 '19 09:07 felixrabe

Since "common_apple" isn't itself a device, I think that may not be the most organized place to put the common lib. What if we did something similar to the Xorg/Wayland setup? Something like this:

  • platform_impl/
    • apple/
      • common/
      • ios/
      • macos/
      • mod.rs
    • ...

I might be interested in working on it, I'm interested in the project and have been trying to find ways to help here and there. So far documentation only, but this seems like a good way to help clean up and learn more about the project.

alasher avatar Jul 15 '19 23:07 alasher

I'd personally rather have src/api/common_apple, but afaik, this is a minor detail to be bikesheding on.

goddessfreya avatar Jul 15 '19 23:07 goddessfreya

I also think platform_impl/apple/... makes more sense than my original suggestion.

@alasher As a first step, you could maybe start just moving the existing modules to their new place, without introducing a common module yet, to test out how the new layout feels.

Then, like in a separate PR, tackle moving the common bits to a common module.

(I personally prefer having two separate PRs / master commits for this.)

felixrabe avatar Jul 16 '19 10:07 felixrabe