-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathinheritance.rs
More file actions
176 lines (176 loc) · 6.24 KB
/
Copy pathinheritance.rs
File metadata and controls
176 lines (176 loc) · 6.24 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#[cxx::bridge(namespace = "")]
#[allow(unused_unsafe)]
mod inheritance {
extern "C++" {
include!("cxx-qt-lib/qmodelindex.h");
type QModelIndex = cxx_qt_lib::QModelIndex;
include!("cxx-qt-lib/qvariant.h");
type QVariant = cxx_qt_lib::QVariant;
type QAbstractItemModel;
}
unsafe extern "C++" {
include ! (< QtCore / QObject >);
include!("cxx-qt/connection.h");
#[doc(hidden)]
#[namespace = "Qt"]
#[rust_name = "CxxQtConnectionType"]
#[allow(dead_code)]
type ConnectionType = cxx_qt::ConnectionType;
#[doc(hidden)]
#[namespace = "rust::cxxqt1"]
#[rust_name = "CxxQtQMetaObjectConnection"]
#[allow(dead_code)]
type QMetaObjectConnection = cxx_qt::QMetaObjectConnection;
}
unsafe extern "C++" {
include!("directory/file_ident.cxxqt.h");
}
unsafe extern "C++" {
#[doc = "The C++ type for the QObject "]
#[doc = "MyObjectRust"]
#[doc = "\n"]
#[doc = "Use this type when referring to the QObject as a pointer"]
#[doc = "\n"]
#[doc = "See the book for more information: <https://kdab.github.io/cxx-qt/book/concepts/generated_qobject.html>"]
type MyObject;
}
extern "Rust" {
type MyObjectRust;
}
extern "Rust" {
#[cxx_name = "data"]
#[doc(hidden)]
unsafe fn data(self: &MyObject, _index: &QModelIndex, _role: i32) -> QVariant;
}
extern "Rust" {
#[cxx_name = "has_children"]
#[doc(hidden)]
unsafe fn has_children(self: &MyObject, _parent: &QModelIndex) -> bool;
}
unsafe extern "C++" {
#[cxx_name = "hasChildrenCxxQtInherit"]
#[doc = " Inherited hasChildren from the base class"]
fn has_children_super(self: &MyObject, parent: &QModelIndex) -> bool;
}
unsafe extern "C++" {
#[cxx_name = "helloWorldCxxQtInherit"]
fn hello_world(self: &MyObject, parent: &QModelIndex) -> bool;
}
extern "C++" {
#[cxx_name = "fetch_moreCxxQtInherit"]
#[doc = " Inherited fetchMore from the base class"]
unsafe fn fetch_more(self: Pin<&mut MyObject>, index: &QModelIndex);
}
extern "C++" {
#[doc(hidden)]
#[cxx_name = "upcastPtr"]
#[namespace = "rust::cxxqt1"]
unsafe fn cxx_qt_ffi_MyObject_upcastPtr(thiz: *const MyObject)
-> *const QAbstractItemModel;
#[doc(hidden)]
#[cxx_name = "downcastPtr"]
#[namespace = "rust::cxxqt1"]
unsafe fn cxx_qt_ffi_MyObject_downcastPtr(
base: *const QAbstractItemModel,
) -> *const MyObject;
}
extern "Rust" {
#[cxx_name = "createRs"]
#[namespace = "cxx_qt_MyObject"]
fn create_rs_MyObjectRust() -> Box<MyObjectRust>;
}
unsafe extern "C++" {
#[doc(hidden)]
#[cxx_name = "unsafeRust"]
#[namespace = "rust::cxxqt1"]
fn cxx_qt_ffi_MyObject_unsafeRust(outer: &MyObject) -> &MyObjectRust;
}
unsafe extern "C++" {
#[doc(hidden)]
#[cxx_name = "unsafeRustMut"]
#[namespace = "rust::cxxqt1"]
fn cxx_qt_ffi_MyObject_unsafeRustMut(outer: Pin<&mut MyObject>) -> Pin<&mut MyObjectRust>;
}
extern "C++" {
#[doc(hidden)]
#[cxx_name = "upcastPtr"]
#[namespace = "rust::cxxqt1"]
unsafe fn cxx_qt_ffi_QPushButton_upcastPtr(thiz: *const QPushButton) -> *const QObject;
#[doc(hidden)]
#[cxx_name = "downcastPtr"]
#[namespace = "rust::cxxqt1"]
unsafe fn cxx_qt_ffi_QPushButton_downcastPtr(base: *const QObject) -> *const QPushButton;
}
extern "C++" {
type QPushButton;
}
extern "C++" {
include ! (< QtWidgets / QPushButton >);
}
extern "C++" {
#[doc(hidden)]
#[cxx_name = "upcastPtr"]
#[namespace = "rust::cxxqt1"]
unsafe fn cxx_qt_ffi_QPushButtonChild_upcastPtr(
thiz: *const QPushButtonChild,
) -> *const QPushButton;
#[doc(hidden)]
#[cxx_name = "downcastPtr"]
#[namespace = "rust::cxxqt1"]
unsafe fn cxx_qt_ffi_QPushButtonChild_downcastPtr(
base: *const QPushButton,
) -> *const QPushButtonChild;
}
extern "C++" {
type QPushButtonChild;
}
extern "C++" {
#[doc(hidden)]
#[namespace = ""]
type QObject = cxx_qt::QObject;
}
}
unsafe impl ::cxx_qt::casting::Upcast<inheritance::QAbstractItemModel> for inheritance::MyObject {
unsafe fn upcast_ptr(this: *const Self) -> *const inheritance::QAbstractItemModel {
inheritance::cxx_qt_ffi_MyObject_upcastPtr(this)
}
unsafe fn from_base_ptr(base: *const inheritance::QAbstractItemModel) -> *const Self {
inheritance::cxx_qt_ffi_MyObject_downcastPtr(base)
}
}
#[doc(hidden)]
#[allow(clippy::unnecessary_box_returns)]
pub fn create_rs_MyObjectRust() -> std::boxed::Box<MyObjectRust> {
std::boxed::Box::new(core::default::Default::default())
}
impl ::core::ops::Deref for inheritance::MyObject {
type Target = MyObjectRust;
fn deref(&self) -> &Self::Target {
inheritance::cxx_qt_ffi_MyObject_unsafeRust(self)
}
}
impl ::cxx_qt::CxxQtType for inheritance::MyObject {
type Rust = MyObjectRust;
fn rust(&self) -> &Self::Rust {
inheritance::cxx_qt_ffi_MyObject_unsafeRust(self)
}
fn rust_mut(self: core::pin::Pin<&mut Self>) -> core::pin::Pin<&mut Self::Rust> {
inheritance::cxx_qt_ffi_MyObject_unsafeRustMut(self)
}
}
unsafe impl ::cxx_qt::casting::Upcast<::cxx_qt::QObject> for inheritance::QPushButton {
unsafe fn upcast_ptr(this: *const Self) -> *const ::cxx_qt::QObject {
inheritance::cxx_qt_ffi_QPushButton_upcastPtr(this)
}
unsafe fn from_base_ptr(base: *const ::cxx_qt::QObject) -> *const Self {
inheritance::cxx_qt_ffi_QPushButton_downcastPtr(base)
}
}
unsafe impl ::cxx_qt::casting::Upcast<inheritance::QPushButton> for inheritance::QPushButtonChild {
unsafe fn upcast_ptr(this: *const Self) -> *const inheritance::QPushButton {
inheritance::cxx_qt_ffi_QPushButtonChild_upcastPtr(this)
}
unsafe fn from_base_ptr(base: *const inheritance::QPushButton) -> *const Self {
inheritance::cxx_qt_ffi_QPushButtonChild_downcastPtr(base)
}
}