use super::*;
wxwidgets! {
#[doc(alias = "wxJPEGHandler")]
#[doc(alias = "JPEGHandler")]
class JPEGHandler
= JPEGHandlerIsOwned<true>(wxJPEGHandler) impl
JPEGHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> JPEGHandlerIsOwned<OWNED> {
pub fn new() -> JPEGHandlerIsOwned<OWNED> {
unsafe { JPEGHandlerIsOwned(ffi::wxJPEGHandler_new()) }
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for JPEGHandlerIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<JPEGHandlerIsOwned<OWNED>> for ImageHandlerIsOwned<OWNED> {
fn from(o: JPEGHandlerIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<JPEGHandlerIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: JPEGHandlerIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for JPEGHandlerIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxJPEGHandler_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for JPEGHandlerIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}
impl<const OWNED: bool> ImageHandlerMethods for JPEGHandlerIsOwned<OWNED> {
}
wxwidgets! {
#[doc(alias = "wxJoystickEvent")]
#[doc(alias = "JoystickEvent")]
class JoystickEvent
= JoystickEventIsOwned<true>(wxJoystickEvent) impl
JoystickEventMethods,
EventMethods,
ObjectMethods
}
impl<const OWNED: bool> JoystickEventIsOwned<OWNED> {
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for JoystickEventIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<JoystickEventIsOwned<OWNED>> for EventIsOwned<OWNED> {
fn from(o: JoystickEventIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<JoystickEventIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: JoystickEventIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for JoystickEventIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxJoystickEvent_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for JoystickEventIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}