Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndk: Replace open-coded bool getters with bitflags wrappers #486

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarijnS95
Copy link
Member

And "correct" their ABI to match how it is used in the actual NDK getter functions. Also add missing aliases and upstream documentation where sensible.


CC @rib, I've been thinking about this to make our wrapper types more consistent, but it may be more inconvenient to use now except in the case when checking multiple flags at once...

Comment on lines -351 to -354
#[inline]
pub fn teriary(self) -> bool {
self.0 & ffi::AMOTION_EVENT_BUTTON_TERTIARY != 0
}
Copy link
Member Author

@MarijnS95 MarijnS95 Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this PR will fix the teriary -> TERTIARY typo as pointed out in rust-mobile/android-activity#168 (and a "problem" for android-activity if/when rust-mobile/android-activity#163 is merged), by freshly copying the constants from the header file.

@MarijnS95
Copy link
Member Author

We should also do this for ndk::configuration::DiffResult, which most likely benefits from the autogenerated Debug implementation too.

And "correct" their ABI to match how it is used in the actual NDK
getter functions.
@MarijnS95 MarijnS95 changed the title ndk/event: Replace open-coded bool getters with bitflags wrappers ndk: Replace open-coded bool getters with bitflags wrappers Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant