1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
use super::*;
// wxUIActionSimulator
wxwidgets! {
/// wxUIActionSimulator is a class used to simulate user interface actions such as a mouse click or a key press.
/// - [`UIActionSimulator`] represents a C++ `wxUIActionSimulator` class instance which your code has ownership, [`UIActionSimulatorIsOwned`]`<false>` represents one which don't own.
/// - Use [`UIActionSimulator`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
/// - See [C++ `wxUIActionSimulator` class's documentation](https://docs.wxwidgets.org/3.2/classwx_u_i_action_simulator.html) for more details.
#[doc(alias = "wxUIActionSimulator")]
#[doc(alias = "UIActionSimulator")]
class UIActionSimulator
= UIActionSimulatorIsOwned<true>(wxUIActionSimulator) impl
UIActionSimulatorMethods
}
impl<const OWNED: bool> UIActionSimulatorIsOwned<OWNED> {
/// Default constructor.
///
/// See [C++ `wxUIActionSimulator::wxUIActionSimulator()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_u_i_action_simulator.html#aa0f66cea40a642075482e06ccf2b75cb).
pub fn new() -> UIActionSimulatorIsOwned<OWNED> {
unsafe { UIActionSimulatorIsOwned(ffi::wxUIActionSimulator_new()) }
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for UIActionSimulatorIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> Drop for UIActionSimulatorIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxUIActionSimulator_delete(self.0) }
}
}
}
// wxURLDataObject
wxwidgets! {
/// wxURLDataObject is a wxDataObject containing an URL and can be used e.g.
/// - [`URLDataObject`] represents a C++ `wxURLDataObject` class instance which your code has ownership, [`URLDataObjectIsOwned`]`<false>` represents one which don't own.
/// - Use [`URLDataObject`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
/// - See [C++ `wxURLDataObject` class's documentation](https://docs.wxwidgets.org/3.2/classwx_u_r_l_data_object.html) for more details.
#[doc(alias = "wxURLDataObject")]
#[doc(alias = "URLDataObject")]
class URLDataObject
= URLDataObjectIsOwned<true>(wxURLDataObject) impl
URLDataObjectMethods,
DataObjectMethods
}
impl<const OWNED: bool> URLDataObjectIsOwned<OWNED> {
/// Constructor, may be used to initialize the URL.
///
/// See [C++ `wxURLDataObject::wxURLDataObject()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_u_r_l_data_object.html#a57104fc32eb66f8fa666b1f2799631d5).
pub fn new(url: &str) -> URLDataObjectIsOwned<OWNED> {
unsafe {
let url = WxString::from(url);
let url = url.as_ptr();
URLDataObjectIsOwned(ffi::wxURLDataObject_new(url))
}
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for URLDataObjectIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<URLDataObjectIsOwned<OWNED>> for DataObjectIsOwned<OWNED> {
fn from(o: URLDataObjectIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> Drop for URLDataObjectIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxURLDataObject_delete(self.0) }
}
}
}
// wxUpdateUIEvent
wxwidgets! {
/// This class is used for pseudo-events which are called by wxWidgets to give an application the chance to update various user interface elements.
/// - [`UpdateUIEvent`] represents a C++ `wxUpdateUIEvent` class instance which your code has ownership, [`UpdateUIEventIsOwned`]`<false>` represents one which don't own.
/// - Use [`UpdateUIEvent`]'s `new()` or [`Buildable::builder()`] (if available) to create an instance of this class.
/// - See [C++ `wxUpdateUIEvent` class's documentation](https://docs.wxwidgets.org/3.2/classwx_update_u_i_event.html) for more details.
#[doc(alias = "wxUpdateUIEvent")]
#[doc(alias = "UpdateUIEvent")]
class UpdateUIEvent
= UpdateUIEventIsOwned<true>(wxUpdateUIEvent) impl
UpdateUIEventMethods,
CommandEventMethods,
EventMethods,
ObjectMethods
}
impl<const OWNED: bool> UpdateUIEventIsOwned<OWNED> {
/// Constructor.
///
/// See [C++ `wxUpdateUIEvent::wxUpdateUIEvent()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_update_u_i_event.html#aa25df58e7047f819f5dd0520eb2cc8ea).
pub fn new(command_id: c_int) -> UpdateUIEventIsOwned<OWNED> {
unsafe { UpdateUIEventIsOwned(ffi::wxUpdateUIEvent_new(command_id)) }
}
pub fn none() -> Option<&'static Self> {
None
}
}
impl Clone for UpdateUIEventIsOwned<false> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl<const OWNED: bool> From<UpdateUIEventIsOwned<OWNED>> for CommandEventIsOwned<OWNED> {
fn from(o: UpdateUIEventIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<UpdateUIEventIsOwned<OWNED>> for EventIsOwned<OWNED> {
fn from(o: UpdateUIEventIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> From<UpdateUIEventIsOwned<OWNED>> for ObjectIsOwned<OWNED> {
fn from(o: UpdateUIEventIsOwned<OWNED>) -> Self {
unsafe { Self::from_ptr(o.as_ptr()) }
}
}
impl<const OWNED: bool> DynamicCast for UpdateUIEventIsOwned<OWNED> {
fn class_info() -> ClassInfoIsOwned<false> {
unsafe { ClassInfoIsOwned::from_ptr(ffi::wxUpdateUIEvent_CLASSINFO()) }
}
}
impl<const OWNED: bool> Drop for UpdateUIEventIsOwned<OWNED> {
fn drop(&mut self) {
if OWNED {
unsafe { ffi::wxObject_delete(self.0) }
}
}
}