Skip to content

Commit

Permalink
ndk-sys: Regenerate against NDK 25.2.9519653 with rust-bindgen 0.66.0
Browse files Browse the repository at this point in the history
Regenerate `ndk-sys` against the latest NDK toolchain with the latest
`rust-bindgen` release, noting that this `rust-bindgen` bump has some
breaking type changes that trickle down into downstream `ndk` and
`ndk-glue` crates too.
  • Loading branch information
MarijnS95 committed Jun 15, 2023
1 parent 51c6dbd commit de1499e
Show file tree
Hide file tree
Showing 10 changed files with 9,321 additions and 10,150 deletions.
2 changes: 1 addition & 1 deletion ndk-sys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unreleased

- Regenerate against NDK 25.0.8775105 with `rust-bindgen 0.59.2`. (#324)
- **Breaking:** Regenerate against NDK `25.2.9519653` with `rust-bindgen 0.66.0`. (#324, #370)

# 0.4.1 (2022-11-23)

Expand Down
2 changes: 1 addition & 1 deletion ndk-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ndk-sys"
version = "0.4.0+25.0.8775105"
version = "0.4.0+25.0.8775105" # Current source contains 25.2.9519653
authors = ["The Rust Windowing contributors"]
edition = "2018"
description = "FFI bindings for the Android NDK"
Expand Down
4,615 changes: 2,204 additions & 2,411 deletions ndk-sys/src/ffi_aarch64.rs

Large diffs are not rendered by default.

4,629 changes: 2,206 additions & 2,423 deletions ndk-sys/src/ffi_arm.rs

Large diffs are not rendered by default.

4,996 changes: 2,401 additions & 2,595 deletions ndk-sys/src/ffi_i686.rs

Large diffs are not rendered by default.

5,077 changes: 2,445 additions & 2,632 deletions ndk-sys/src/ffi_x86_64.rs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ndk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- asset: Use entire asset length when mapping buffer. (#387)
- Bump MSRV to 1.64 for `raw-window-handle 0.5.1`. (#388)
- Bump optional `jni` dependency for doctest example from `0.19` to `0.21`. (#390)
- **Breaking:** Upgrade to [`ndk-sys 0.5.0`](../ndk-sys/CHANGELOG.md#050-TODO). (#370)
- **Breaking:** Upgrade `bitflags` crate from `1` to `2`. (#394)
- **Breaking:** Upgrade `num_enum` crate from `0.5.1` to `0.6`. (#398)

Expand Down Expand Up @@ -38,7 +39,7 @@
# 0.5.0 (2021-11-22)

- **Breaking:** Replace `add_fd_with_callback` `ident` with constant value `ALOOPER_POLL_CALLBACK`,
as per https://developer.android.com/ndk/reference/group/looper#alooper_addfd.
as per <https://developer.android.com/ndk/reference/group/looper#alooper_addfd>.
- **Breaking:** Accept unboxed closure in `add_fd_with_callback`.
- aaudio: Replace "Added in" comments with missing `#[cfg(feature)]`.
- aaudio: Add missing `fn get_allowed_capture_policy()`.
Expand Down
6 changes: 1 addition & 5 deletions ndk/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ impl Asset {
impl io::Read for Asset {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
unsafe {
let res = ffi::AAsset_read(
self.ptr.as_ptr(),
buf.as_mut_ptr() as *mut _,
buf.len() as ffi::size_t,
);
let res = ffi::AAsset_read(self.ptr.as_ptr(), buf.as_mut_ptr() as *mut _, buf.len());
if res >= 0 {
Ok(res as usize)
} else {
Expand Down
104 changes: 44 additions & 60 deletions ndk/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ impl MotionEvent {
/// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_getpointercount)
#[inline]
pub fn pointer_count(&self) -> usize {
unsafe { ffi::AMotionEvent_getPointerCount(self.ptr.as_ptr()) as usize }
unsafe { ffi::AMotionEvent_getPointerCount(self.ptr.as_ptr()) }
}

/// An iterator over the pointers in this motion event
Expand Down Expand Up @@ -480,7 +480,7 @@ impl MotionEvent {
/// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_gethistorysize)
#[inline]
pub fn history_size(&self) -> usize {
unsafe { ffi::AMotionEvent_getHistorySize(self.ptr.as_ptr()) as usize }
unsafe { ffi::AMotionEvent_getHistorySize(self.ptr.as_ptr()) }
}

/// An iterator over the historical events contained in this event.
Expand Down Expand Up @@ -604,80 +604,73 @@ impl<'a> Pointer<'a> {

#[inline]
pub fn pointer_id(&self) -> i32 {
unsafe { ffi::AMotionEvent_getPointerId(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getPointerId(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn axis_value(&self, axis: Axis) -> f32 {
unsafe {
ffi::AMotionEvent_getAxisValue(
self.event.as_ptr(),
axis as i32,
self.index as ffi::size_t,
)
}
unsafe { ffi::AMotionEvent_getAxisValue(self.event.as_ptr(), axis as i32, self.index) }
}

#[inline]
pub fn orientation(&self) -> f32 {
unsafe { ffi::AMotionEvent_getOrientation(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getOrientation(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn pressure(&self) -> f32 {
unsafe { ffi::AMotionEvent_getPressure(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getPressure(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn raw_x(&self) -> f32 {
unsafe { ffi::AMotionEvent_getRawX(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getRawX(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn raw_y(&self) -> f32 {
unsafe { ffi::AMotionEvent_getRawY(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getRawY(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn x(&self) -> f32 {
unsafe { ffi::AMotionEvent_getX(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getX(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn y(&self) -> f32 {
unsafe { ffi::AMotionEvent_getY(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getY(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn size(&self) -> f32 {
unsafe { ffi::AMotionEvent_getSize(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getSize(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn tool_major(&self) -> f32 {
unsafe { ffi::AMotionEvent_getToolMajor(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getToolMajor(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn tool_minor(&self) -> f32 {
unsafe { ffi::AMotionEvent_getToolMinor(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getToolMinor(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn touch_major(&self) -> f32 {
unsafe { ffi::AMotionEvent_getTouchMajor(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getTouchMajor(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn touch_minor(&self) -> f32 {
unsafe { ffi::AMotionEvent_getTouchMinor(self.event.as_ptr(), self.index as ffi::size_t) }
unsafe { ffi::AMotionEvent_getTouchMinor(self.event.as_ptr(), self.index) }
}

#[inline]
pub fn tool_type(&self) -> ToolType {
let tool_type = unsafe {
ffi::AMotionEvent_getToolType(self.event.as_ptr(), self.index as ffi::size_t) as u32
};
let tool_type =
unsafe { ffi::AMotionEvent_getToolType(self.event.as_ptr(), self.index) as u32 };
tool_type.try_into().unwrap()
}
}
Expand Down Expand Up @@ -743,12 +736,7 @@ impl<'a> HistoricalMotionEvent<'a> {
/// docs](https://developer.android.com/ndk/reference/group/input#amotionevent_gethistoricaleventtime)
#[inline]
pub fn event_time(&self) -> i64 {
unsafe {
ffi::AMotionEvent_getHistoricalEventTime(
self.event.as_ptr(),
self.history_index as ffi::size_t,
)
}
unsafe { ffi::AMotionEvent_getHistoricalEventTime(self.event.as_ptr(), self.history_index) }
}

/// An iterator over the pointers of this historical motion event
Expand All @@ -758,9 +746,7 @@ impl<'a> HistoricalMotionEvent<'a> {
event: self.event,
history_index: self.history_index,
next_pointer_index: 0,
pointer_count: unsafe {
ffi::AMotionEvent_getPointerCount(self.event.as_ptr()) as usize
},
pointer_count: unsafe { ffi::AMotionEvent_getPointerCount(self.event.as_ptr()) },
_marker: std::marker::PhantomData,
}
}
Expand Down Expand Up @@ -840,9 +826,7 @@ impl<'a> HistoricalPointer<'a> {

#[inline]
pub fn pointer_id(&self) -> i32 {
unsafe {
ffi::AMotionEvent_getPointerId(self.event.as_ptr(), self.pointer_index as ffi::size_t)
}
unsafe { ffi::AMotionEvent_getPointerId(self.event.as_ptr(), self.pointer_index) }
}

#[inline]
Expand All @@ -856,8 +840,8 @@ impl<'a> HistoricalPointer<'a> {
ffi::AMotionEvent_getHistoricalAxisValue(
self.event.as_ptr(),
axis as i32,
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -867,8 +851,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalOrientation(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -878,8 +862,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalPressure(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -889,8 +873,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalRawX(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -900,8 +884,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalRawY(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -911,8 +895,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalX(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -922,8 +906,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalY(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -933,8 +917,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalSize(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -944,8 +928,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalToolMajor(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -955,8 +939,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalToolMinor(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -966,8 +950,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalTouchMajor(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand All @@ -977,8 +961,8 @@ impl<'a> HistoricalPointer<'a> {
unsafe {
ffi::AMotionEvent_getHistoricalTouchMinor(
self.event.as_ptr(),
self.pointer_index as ffi::size_t,
self.history_index as ffi::size_t,
self.pointer_index,
self.history_index,
)
}
}
Expand Down
Loading

0 comments on commit de1499e

Please sign in to comment.