use super::*;
wxwidgets! {
#[doc(alias = "wxPCXHandler")]
#[doc(alias = "PCXHandler")]
class PCXHandler
= PCXHandlerIsOwned<true>(wxPCXHandler) impl
PCXHandlerMethods,
ImageHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PCXHandlerIsOwned<OWNED> {
pub fn new() -> PCXHandlerIsOwned<OWNED> {
unsafe { PCXHandlerIsOwned(ffi::wxPCXHandler_new()) }
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PCXHandlerIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PCXHandlerIsOwned<OWNED>> for ImageHandlerIsOwned<OWNED> {
fn from(o: PCXHandlerIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PCXHandlerIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PCXHandlerIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PCXHandlerIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPCXHandler_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for PCXHandlerIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPNGHandler")]
#[doc(alias = "PNGHandler")]
class PNGHandler
= PNGHandlerIsOwned<true>(wxPNGHandler) impl
PNGHandlerMethods,
ImageHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PNGHandlerIsOwned<OWNED> {
pub fn new() -> PNGHandlerIsOwned<OWNED> {
unsafe { PNGHandlerIsOwned(ffi::wxPNGHandler_new()) }
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PNGHandlerIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PNGHandlerIsOwned<OWNED>> for ImageHandlerIsOwned<OWNED> {
fn from(o: PNGHandlerIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PNGHandlerIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PNGHandlerIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PNGHandlerIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPNGHandler_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for PNGHandlerIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPNMHandler")]
#[doc(alias = "PNMHandler")]
class PNMHandler
= PNMHandlerIsOwned<true>(wxPNMHandler) impl
PNMHandlerMethods,
ImageHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PNMHandlerIsOwned<OWNED> {
pub fn new() -> PNMHandlerIsOwned<OWNED> {
unsafe { PNMHandlerIsOwned(ffi::wxPNMHandler_new()) }
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PNMHandlerIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PNMHandlerIsOwned<OWNED>> for ImageHandlerIsOwned<OWNED> {
fn from(o: PNMHandlerIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PNMHandlerIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PNMHandlerIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PNMHandlerIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPNMHandler_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for PNMHandlerIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPaintDC")]
#[doc(alias = "PaintDC")]
class PaintDC
= PaintDCIsOwned<true>(wxPaintDC) impl
PaintDCMethods,
ClientDCMethods,
WindowDCMethods,
DCMethods,
ObjectMethods
}
impl<const OWNED: bool> PaintDCIsOwned<OWNED> {
pub fn new<W: WindowMethods>(window: Option<&W>) -> PaintDCIsOwned<OWNED> {
unsafe {
let window = match window {
Some(r) => r.as_ptr(),
None => ptr::null_mut(),
};
PaintDCIsOwned(ffi::wxPaintDC_new(window))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PaintDCIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PaintDCIsOwned<OWNED>> for ClientDCIsOwned<OWNED> {
fn from(o: PaintDCIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PaintDCIsOwned<OWNED>> for WindowDCIsOwned<OWNED> {
fn from(o: PaintDCIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PaintDCIsOwned<OWNED>> for DCIsOwned<OWNED> {
fn from(o: PaintDCIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PaintDCIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PaintDCIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PaintDCIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPaintDC_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for PaintDCIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPaintEvent")]
#[doc(alias = "PaintEvent")]
class PaintEvent
= PaintEventIsOwned<true>(wxPaintEvent) impl
PaintEventMethods,
EventMethods,
ObjectMethods
}
impl<const OWNED: bool> PaintEventIsOwned<OWNED> {
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PaintEventIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PaintEventIsOwned<OWNED>> for EventIsOwned<OWNED> {
fn from(o: PaintEventIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PaintEventIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PaintEventIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PaintEventIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPaintEvent_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for PaintEventIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPalette")]
#[doc(alias = "Palette")]
class Palette
= PaletteIsOwned<true>(wxPalette) impl
PaletteMethods,
GDIObjectMethods,
ObjectMethods
}
impl<const OWNED: bool> PaletteIsOwned<OWNED> {
pub fn new() -> PaletteIsOwned<OWNED> {
unsafe { PaletteIsOwned(ffi::wxPalette_new()) }
}
pub fn new_with_palette<P: PaletteMethods>(palette: &P) -> PaletteIsOwned<OWNED> {
unsafe {
let palette = palette.as_ptr();
PaletteIsOwned(ffi::wxPalette_new1(palette))
}
}
pub fn new_with_int(
n: c_int,
red: *const c_void,
green: *const c_void,
blue: *const c_void,
) -> PaletteIsOwned<OWNED> {
unsafe { PaletteIsOwned(ffi::wxPalette_new2(n, red, green, blue)) }
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PaletteIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PaletteIsOwned<OWNED>> for GDIObjectIsOwned<OWNED> {
fn from(o: PaletteIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PaletteIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PaletteIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PaletteIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPalette_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for PaletteIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPanel")]
#[doc(alias = "Panel")]
class Panel
= PanelIsOwned<true>(wxPanel) impl
PanelMethods,
EvtHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PanelIsOwned<OWNED> {
pub fn new_2step() -> PanelIsOwned<OWNED> {
unsafe { PanelIsOwned(ffi::wxPanel_new()) }
}
pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods>(
parent: Option<&W>,
id: c_int,
pos: &P,
size: &S,
style: c_long,
name: &str,
) -> PanelIsOwned<OWNED> {
unsafe {
let parent = match parent {
Some(r) => r.as_ptr(),
None => ptr::null_mut(),
};
let pos = pos.as_ptr();
let size = size.as_ptr();
let name = WxString::from(name);
let name = name.as_ptr();
PanelIsOwned(ffi::wxPanel_new1(parent, id, pos, size, style, name))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl<const OWNED: bool> Clone for PanelIsOwned<OWNED> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PanelIsOwned<OWNED>> for WindowIsOwned<OWNED> {
fn from(o: PanelIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PanelIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
fn from(o: PanelIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PanelIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PanelIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PanelIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPanel_CLASSINFO()) }
}
}
impl<const OWNED: bool> WindowMethods for PanelIsOwned<OWNED> {
fn create<W: WindowMethods, P: PointMethods, S: SizeMethods>(
&self,
parent: Option<&W>,
id: c_int,
pos: &P,
size: &S,
style: c_long,
name: &str,
) -> bool {
unsafe {
let parent = match parent {
Some(r) => r.as_ptr(),
None => ptr::null_mut(),
};
let pos = pos.as_ptr();
let size = size.as_ptr();
let name = WxString::from(name);
let name = name.as_ptr();
ffi::wxPanel_Create(self.as_ptr(), parent, id, pos, size, style, name)
}
}
}
wxwidgets! {
#[doc(alias = "wxPasswordEntryDialog")]
#[doc(alias = "PasswordEntryDialog")]
class PasswordEntryDialog
= PasswordEntryDialogIsOwned<true>(wxPasswordEntryDialog) impl
PasswordEntryDialogMethods,
TextEntryDialogMethods,
DialogMethods,
TopLevelWindowMethods,
NonOwnedWindowMethods,
WindowMethods,
EvtHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PasswordEntryDialogIsOwned<OWNED> {
pub fn new<W: WindowMethods, P: PointMethods>(
parent: Option<&W>,
message: &str,
caption: &str,
default_value: &str,
style: c_long,
pos: &P,
) -> PasswordEntryDialogIsOwned<OWNED> {
unsafe {
let parent = match parent {
Some(r) => r.as_ptr(),
None => ptr::null_mut(),
};
let message = WxString::from(message);
let message = message.as_ptr();
let caption = WxString::from(caption);
let caption = caption.as_ptr();
let default_value = WxString::from(default_value);
let default_value = default_value.as_ptr();
let pos = pos.as_ptr();
PasswordEntryDialogIsOwned(ffi::wxPasswordEntryDialog_new(
parent,
message,
caption,
default_value,
style,
pos,
))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl<const OWNED: bool> Clone for PasswordEntryDialogIsOwned<OWNED> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PasswordEntryDialogIsOwned<OWNED>> for TextEntryDialogIsOwned<OWNED> {
fn from(o: PasswordEntryDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PasswordEntryDialogIsOwned<OWNED>> for DialogIsOwned<OWNED> {
fn from(o: PasswordEntryDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PasswordEntryDialogIsOwned<OWNED>> for TopLevelWindowIsOwned<OWNED> {
fn from(o: PasswordEntryDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PasswordEntryDialogIsOwned<OWNED>> for NonOwnedWindowIsOwned<OWNED> {
fn from(o: PasswordEntryDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PasswordEntryDialogIsOwned<OWNED>> for WindowIsOwned<OWNED> {
fn from(o: PasswordEntryDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PasswordEntryDialogIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
fn from(o: PasswordEntryDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PasswordEntryDialogIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PasswordEntryDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PasswordEntryDialogIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPasswordEntryDialog_CLASSINFO()) }
}
}
wxwidgets! {
#[doc(alias = "wxPen")]
#[doc(alias = "Pen")]
class Pen
= PenIsOwned<true>(wxPen) impl
PenMethods,
GDIObjectMethods,
ObjectMethods
}
impl<const OWNED: bool> PenIsOwned<OWNED> {
pub fn new() -> PenIsOwned<OWNED> {
unsafe { PenIsOwned(ffi::wxPen_new()) }
}
pub fn new_with_peninfo(info: *const c_void) -> PenIsOwned<OWNED> {
unsafe { PenIsOwned(ffi::wxPen_new1(info)) }
}
pub fn new_with_bitmap<B: BitmapMethods>(stipple: &B, width: c_int) -> PenIsOwned<OWNED> {
unsafe {
let stipple = stipple.as_ptr();
PenIsOwned(ffi::wxPen_new3(stipple, width))
}
}
pub fn new_with_pen<P: PenMethods>(pen: &P) -> PenIsOwned<OWNED> {
unsafe {
let pen = pen.as_ptr();
PenIsOwned(ffi::wxPen_new4(pen))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PenIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PenIsOwned<OWNED>> for GDIObjectIsOwned<OWNED> {
fn from(o: PenIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PenIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PenIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PenIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPen_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for PenIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPenList")]
#[doc(alias = "PenList")]
class PenList
= PenListIsOwned<true>(wxPenList) impl
PenListMethods
}
impl<const OWNED: bool> PenListIsOwned<OWNED> {
pub fn new() -> PenListIsOwned<OWNED> {
unsafe { PenListIsOwned(ffi::wxPenList_new()) }
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PenListIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> Drop for PenListIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxPenList_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPersistenceManager")]
#[doc(alias = "PersistenceManager")]
class PersistenceManager
= PersistenceManagerIsOwned<true>(wxPersistenceManager) impl
PersistenceManagerMethods
}
impl<const OWNED: bool> PersistenceManagerIsOwned<OWNED> {
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PersistenceManagerIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> Drop for PersistenceManagerIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxPersistenceManager_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPickerBase")]
#[doc(alias = "PickerBase")]
class PickerBase
= PickerBaseIsOwned<true>(wxPickerBase) impl
PickerBaseMethods,
ControlMethods,
WindowMethods,
EvtHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PickerBaseIsOwned<OWNED> {
pub fn none() -> Option<&'static Self> {
None
}
}
impl<const OWNED: bool> Clone for PickerBaseIsOwned<OWNED> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PickerBaseIsOwned<OWNED>> for ControlIsOwned<OWNED> {
fn from(o: PickerBaseIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PickerBaseIsOwned<OWNED>> for WindowIsOwned<OWNED> {
fn from(o: PickerBaseIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PickerBaseIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
fn from(o: PickerBaseIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PickerBaseIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PickerBaseIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PickerBaseIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPickerBase_CLASSINFO()) }
}
}
wxwidgets! {
#[doc(alias = "wxPoint")]
#[doc(alias = "Point")]
class Point
= PointIsOwned<true>(wxPoint) impl
PointMethods
}
impl<const OWNED: bool> PointIsOwned<OWNED> {
pub fn new() -> PointIsOwned<OWNED> {
unsafe { PointIsOwned(ffi::wxPoint_new()) }
}
pub fn new_with_int(x: c_int, y: c_int) -> PointIsOwned<OWNED> {
unsafe { PointIsOwned(ffi::wxPoint_new1(x, y)) }
}
pub fn new_with_realpoint<R: RealPointMethods>(pt: &R) -> PointIsOwned<OWNED> {
unsafe {
let pt = pt.as_ptr();
PointIsOwned(ffi::wxPoint_new2(pt))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PointIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> Drop for PointIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxPoint_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPopupTransientWindow")]
#[doc(alias = "PopupTransientWindow")]
class PopupTransientWindow
= PopupTransientWindowIsOwned<true>(wxPopupTransientWindow) impl
PopupTransientWindowMethods,
PopupWindowMethods,
NonOwnedWindowMethods,
WindowMethods,
EvtHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PopupTransientWindowIsOwned<OWNED> {
pub fn new_2step() -> PopupTransientWindowIsOwned<OWNED> {
unsafe { PopupTransientWindowIsOwned(ffi::wxPopupTransientWindow_new()) }
}
pub fn new<W: WindowMethods>(
parent: Option<&W>,
flags: c_int,
) -> PopupTransientWindowIsOwned<OWNED> {
unsafe {
let parent = match parent {
Some(r) => r.as_ptr(),
None => ptr::null_mut(),
};
PopupTransientWindowIsOwned(ffi::wxPopupTransientWindow_new1(parent, flags))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl<const OWNED: bool> Clone for PopupTransientWindowIsOwned<OWNED> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PopupTransientWindowIsOwned<OWNED>> for PopupWindowIsOwned<OWNED> {
fn from(o: PopupTransientWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PopupTransientWindowIsOwned<OWNED>> for NonOwnedWindowIsOwned<OWNED> {
fn from(o: PopupTransientWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PopupTransientWindowIsOwned<OWNED>> for WindowIsOwned<OWNED> {
fn from(o: PopupTransientWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PopupTransientWindowIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
fn from(o: PopupTransientWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PopupTransientWindowIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PopupTransientWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PopupTransientWindowIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPopupTransientWindow_CLASSINFO()) }
}
}
wxwidgets! {
#[doc(alias = "wxPopupWindow")]
#[doc(alias = "PopupWindow")]
class PopupWindow
= PopupWindowIsOwned<true>(wxPopupWindow) impl
PopupWindowMethods,
NonOwnedWindowMethods,
WindowMethods,
EvtHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PopupWindowIsOwned<OWNED> {
pub fn new_2step() -> PopupWindowIsOwned<OWNED> {
unsafe { PopupWindowIsOwned(ffi::wxPopupWindow_new()) }
}
pub fn new<W: WindowMethods>(parent: Option<&W>, flags: c_int) -> PopupWindowIsOwned<OWNED> {
unsafe {
let parent = match parent {
Some(r) => r.as_ptr(),
None => ptr::null_mut(),
};
PopupWindowIsOwned(ffi::wxPopupWindow_new1(parent, flags))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl<const OWNED: bool> Clone for PopupWindowIsOwned<OWNED> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PopupWindowIsOwned<OWNED>> for NonOwnedWindowIsOwned<OWNED> {
fn from(o: PopupWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PopupWindowIsOwned<OWNED>> for WindowIsOwned<OWNED> {
fn from(o: PopupWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PopupWindowIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
fn from(o: PopupWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PopupWindowIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PopupWindowIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PopupWindowIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPopupWindow_CLASSINFO()) }
}
}
wxwidgets! {
#[doc(alias = "wxPreferencesEditor")]
#[doc(alias = "PreferencesEditor")]
class PreferencesEditor
= PreferencesEditorIsOwned<true>(wxPreferencesEditor) impl
PreferencesEditorMethods
}
impl<const OWNED: bool> PreferencesEditorIsOwned<OWNED> {
pub fn new(title: &str) -> PreferencesEditorIsOwned<OWNED> {
unsafe {
let title = WxString::from(title);
let title = title.as_ptr();
PreferencesEditorIsOwned(ffi::wxPreferencesEditor_new(title))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PreferencesEditorIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> Drop for PreferencesEditorIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxPreferencesEditor_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPreferencesPage")]
#[doc(alias = "PreferencesPage")]
class PreferencesPage
= PreferencesPageIsOwned<true>(wxPreferencesPage) impl
PreferencesPageMethods
}
impl<const OWNED: bool> PreferencesPageIsOwned<OWNED> {
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for PreferencesPageIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> Drop for PreferencesPageIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxPreferencesPage_delete(self.0) }
}
}
}
wxwidgets! {
#[doc(alias = "wxPropertySheetDialog")]
#[doc(alias = "PropertySheetDialog")]
class PropertySheetDialog
= PropertySheetDialogIsOwned<true>(wxPropertySheetDialog) impl
PropertySheetDialogMethods,
DialogMethods,
NonOwnedWindowMethods,
WindowMethods,
EvtHandlerMethods,
ObjectMethods
}
impl<const OWNED: bool> PropertySheetDialogIsOwned<OWNED> {
pub fn new_2step() -> PropertySheetDialogIsOwned<OWNED> {
unsafe { PropertySheetDialogIsOwned(ffi::wxPropertySheetDialog_new()) }
}
pub fn new<W: WindowMethods, P: PointMethods, S: SizeMethods>(
parent: Option<&W>,
id: c_int,
title: &str,
pos: &P,
size: &S,
style: c_long,
name: &str,
) -> PropertySheetDialogIsOwned<OWNED> {
unsafe {
let parent = match parent {
Some(r) => r.as_ptr(),
None => ptr::null_mut(),
};
let title = WxString::from(title);
let title = title.as_ptr();
let pos = pos.as_ptr();
let size = size.as_ptr();
let name = WxString::from(name);
let name = name.as_ptr();
PropertySheetDialogIsOwned(ffi::wxPropertySheetDialog_new1(
parent, id, title, pos, size, style, name,
))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl<const OWNED: bool> Clone for PropertySheetDialogIsOwned<OWNED> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<PropertySheetDialogIsOwned<OWNED>> for DialogIsOwned<OWNED> {
fn from(o: PropertySheetDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PropertySheetDialogIsOwned<OWNED>> for TopLevelWindowIsOwned<OWNED> {
fn from(o: PropertySheetDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PropertySheetDialogIsOwned<OWNED>> for NonOwnedWindowIsOwned<OWNED> {
fn from(o: PropertySheetDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PropertySheetDialogIsOwned<OWNED>> for WindowIsOwned<OWNED> {
fn from(o: PropertySheetDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PropertySheetDialogIsOwned<OWNED>> for EvtHandlerIsOwned<OWNED> {
fn from(o: PropertySheetDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<PropertySheetDialogIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: PropertySheetDialogIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for PropertySheetDialogIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxPropertySheetDialog_CLASSINFO()) }
}
}
impl<const OWNED: bool> TopLevelWindowMethods for PropertySheetDialogIsOwned<OWNED> {
fn create_str<W: WindowMethods, P: PointMethods, S: SizeMethods>(
&self,
parent: Option<&W>,
id: c_int,
title: &str,
pos: &P,
size: &S,
style: c_long,
name: &str,
) -> bool {
unsafe {
let parent = match parent {
Some(r) => r.as_ptr(),
None => ptr::null_mut(),
};
let title = WxString::from(title);
let title = title.as_ptr();
let pos = pos.as_ptr();
let size = size.as_ptr();
let name = WxString::from(name);
let name = name.as_ptr();
ffi::wxPropertySheetDialog_Create(
self.as_ptr(),
parent,
id,
title,
pos,
size,
style,
name,
)
}
}
}