#[rustfmt::skip] // This file has been automatically generated by `jnim` from `SurfaceHolderCallback.class`. // DO NOT EDIT use jnim::*; pub trait SurfaceHolderCallback: AsRef { fn surface_holder_callback_class(env: Option<&JEnv>) -> Option { const NAME: &'static [u8] = b"android/view/SurfaceHolder$Callback\0"; static CACHE: CachedID = CachedID::new(); CACHE.get(|| JEnv::env(env)?.find_class(NAME)) } fn surface_created<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::view::SurfaceHolderObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| Self::surface_holder_callback_class(Some(env))?.method(env, b"surfaceCreated\0", b"(Landroid/view/SurfaceHolder;)V\0"))? .call(env, self.as_ref(), (arg0,)) } fn surface_changed<'a>( &'a self, env: &'a JEnv, arg0: &'a crate::android::view::SurfaceHolderObject, arg1: JInt, arg2: JInt, arg3: JInt, ) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| { Self::surface_holder_callback_class(Some(env))?.method(env, b"surfaceChanged\0", b"(Landroid/view/SurfaceHolder;III)V\0") })? .call(env, self.as_ref(), (arg0, arg1, arg2, arg3)) } fn surface_destroyed<'a>(&'a self, env: &'a JEnv, arg0: &'a crate::android::view::SurfaceHolderObject) -> Option<()> { static CACHE: CachedID = CachedID::new(); CACHE .get(|| { Self::surface_holder_callback_class(Some(env))?.method(env, b"surfaceDestroyed\0", b"(Landroid/view/SurfaceHolder;)V\0") })? .call(env, self.as_ref(), (arg0,)) } } pub struct SurfaceHolderCallbackObject { __object: JObject, } impl SurfaceHolderCallback for SurfaceHolderCallbackObject {} impl JNameMaker for SurfaceHolderCallbackObject { const JAVA_PATH: &'static [u8] = b"android/view/SurfaceHolder$Callback\0"; } impl JPlainMarker for SurfaceHolderCallbackObject { 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 SurfaceHolderCallbackObject { type Target = JObject; fn deref(&self) -> &Self::Target { &self.__object } } impl AsRef for SurfaceHolderCallbackObject { fn as_ref(&self) -> &JObject { &self.__object } } #[test] fn test_type_zero() { assert_eq!(0, std::mem::size_of::()); }