The second one adds a type called CGDisplayReconfigurationCallbackHandle that safely manages the reconfiguration callbacks for a generic boxed FnMut(CGDirectDisplayID, CGDisplayChangeSummaryFlags), taking care of marshalling the pointers around in the correct way... hopefully (one can never be sure).
The second commit, I guess, might be more controversial so let me know if unwanted and I will resend the PR with just the first part (and host the second in a different repo/crate).
This CR contains two main commits:
The first one adds unsafe bindings and type declarations for:
The second one adds a type called
CGDisplayReconfigurationCallbackHandle
that safely manages the reconfiguration callbacks for a generic boxedFnMut(CGDirectDisplayID, CGDisplayChangeSummaryFlags)
, taking care of marshalling the pointers around in the correct way... hopefully (one can never be sure).The second commit, I guess, might be more controversial so let me know if unwanted and I will resend the PR with just the first part (and host the second in a different repo/crate).