#[rustfmt::skip] // This file has been automatically generated by `jnim` from `InputEvent.class`. // DO NOT EDIT use jnim::*; use crate::android::os::Parcelable; use crate::android::os::ParcelableObject; pub struct InputEvent { __object: JObject, __supper: JObject, __parcelable: ParcelableObject, } impl JNameMaker for InputEvent { const JAVA_PATH: &'static [u8] = b"android/view/InputEvent\0"; } impl JPlainMarker for InputEvent { fn class(env: Option<&JEnv>) -> Option { static CACHE: CachedID = CachedID::new(); CACHE.get(|| JEnv::env(env)?.find_class(Self::JAVA_PATH)) } } impl core::ops::Deref for InputEvent { type Target = JObject; fn deref(&self) -> &Self::Target { &self.__supper } } impl AsRef for InputEvent { fn as_ref(&self) -> &JObject { &self.__supper } } // impl interfaces impl Parcelable for InputEvent {} impl AsRef for InputEvent { fn as_ref(&self) -> &ParcelableObject { &self.__parcelable } } // field impl InputEvent {} // method impl InputEvent { pub fn get_device_id<'a>(&'a self, env: &'a JEnv) -> Option { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"getDeviceId\0", b"()I\0"))? .call(env, self.as_ref(), ()) } pub fn get_device<'a>(&'a self, env: &'a JEnv) -> Option<&'a JObject> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"getDevice\0", b"()Landroid/view/InputDevice;\0"))? .call(env, self.as_ref(), ()) } pub fn get_source<'a>(&'a self, env: &'a JEnv) -> Option { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"getSource\0", b"()I\0"))? .call(env, self.as_ref(), ()) } pub fn is_from_source<'a>(&'a self, env: &'a JEnv, arg0: JInt) -> Option { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"isFromSource\0", b"(I)Z\0"))? .call(env, self.as_ref(), (arg0,)) } pub fn get_event_time<'a>(&'a self, env: &'a JEnv) -> Option { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"getEventTime\0", b"()J\0"))? .call(env, self.as_ref(), ()) } pub fn describe_contents<'a>(&'a self, env: &'a JEnv) -> Option { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::class(Some(env))?.method(env, b"describeContents\0", b"()I\0"))? .call(env, self.as_ref(), ()) } } #[test] fn test_type_zero() { assert_eq!(0, std::mem::size_of::()); }