summaryrefslogtreecommitdiffstats
path: root/third_party/rust/raw-window-handle/src/android.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/raw-window-handle/src/android.rs')
-rw-r--r--third_party/rust/raw-window-handle/src/android.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/third_party/rust/raw-window-handle/src/android.rs b/third_party/rust/raw-window-handle/src/android.rs
new file mode 100644
index 0000000000..abf65dda5f
--- /dev/null
+++ b/third_party/rust/raw-window-handle/src/android.rs
@@ -0,0 +1,31 @@
+use core::ptr;
+use libc::c_void;
+
+/// Raw window handle for Android.
+///
+/// ## Construction
+/// ```
+/// # use raw_window_handle::android::AndroidHandle;
+/// let handle = AndroidHandle {
+/// /* fields */
+/// ..AndroidHandle::empty()
+/// };
+/// ```
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
+pub struct AndroidHandle {
+ /// A pointer to an ANativeWindow.
+ pub a_native_window: *mut c_void,
+ #[doc(hidden)]
+ #[deprecated = "This field is used to ensure that this struct is non-exhaustive, so that it may be extended in the future. Do not refer to this field."]
+ pub _non_exhaustive_do_not_use: crate::seal::Seal,
+}
+
+impl AndroidHandle {
+ pub fn empty() -> AndroidHandle {
+ #[allow(deprecated)]
+ AndroidHandle {
+ a_native_window: ptr::null_mut(),
+ _non_exhaustive_do_not_use: crate::seal::Seal,
+ }
+ }
+}