insanity
parent: tbd commit: 6ea28ab
1 | use |
2 | |
3 | , | IntoPluginOperationHandler
4 | , |
5 | , | IntoPluginValueGetter
6 | Callback, CallbackPtr, |
7 | , |
8 | , | FfiError
9 | , |
10 | , | FfiValueUntyped
11 | |
12 | , |
13 | , | InitializationVTable
14 | IntoObjectVTable, IntoSettingVTable, IntoValueVTable, Object, ObjectVTable, SettingVTable, |
15 | VTable, ValueVTable, |
16 | , |
17 | FfiValueMut, FfiValueRef, |
18 | ; |
19 | use |
20 | , GiteratedOperation, Setting, | GiteratedObject
21 | , | GiteratedObjectValue
22 | ; |
23 | |
24 | use trace_span; |
25 | |
26 | |
27 | init_state: FfiValueUntyped, |
28 | vtable: &'static , |
29 | |
30 | |
31 | |
32 | |
33 | // vtable: &'static VTable<InitializationVTable>, |
34 | |
35 | todo! |
36 | // PluginStackBuilder { |
37 | // init_state: state, |
38 | // vtable |
39 | // } |
40 | |
41 | |
42 | |
43 | todo! |
44 | |
45 | |
46 | |
47 | let _guard = trace_span! .entered; |
48 | |
49 | let func = self.vtable.register_object; |
50 | |
51 | let mut init_state = self.init_state.pin; |
52 | |
53 | unsafe |
54 | func |
55 | unsafe , |
56 | , | object_name
57 | VTABLE, |
58 | |
59 | ; |
60 | |
61 | self |
62 | |
63 | |
64 | |
65 | |
66 | D: + , |
67 | O: GiteratedObject, |
68 | |
69 | let _guard = trace_span! .entered; |
70 | |
71 | let mut init_state = self.init_state.pin; |
72 | |
73 | unsafe |
74 | |
75 | unsafe , |
76 | , | object_name
77 | , | operation_name
78 | VTABLE, |
79 | |
80 | |
81 | |
82 | self |
83 | |
84 | |
85 | |
86 | |
87 | O: GiteratedObject, |
88 | OS: IntoSettingVTable + Setting, |
89 | HG: , |
90 | HS: , |
91 | |
92 | let _guard = trace_span! .entered; |
93 | |
94 | let mut init_state = self.init_state.pin; |
95 | |
96 | unsafe |
97 | |
98 | unsafe , |
99 | , | object_name
100 | OS name, |
101 | OSVTABLE, |
102 | |
103 | |
104 | |
105 | self |
106 | |
107 | |
108 | |
109 | |
110 | O: GiteratedObject, |
111 | OS: IntoSettingVTable + Setting, |
112 | |
113 | let _guard = trace_span! .entered; |
114 | |
115 | let mut init_state = self.init_state.pin; |
116 | |
117 | unsafe |
118 | |
119 | unsafe , |
120 | , | object_name
121 | OS name, |
122 | OSVTABLE, |
123 | |
124 | |
125 | |
126 | self |
127 | |
128 | |
129 | |
130 | |
131 | O: GiteratedObject, |
132 | V: IntoValueVTable + , |
133 | T: , |
134 | |
135 | let _guard = trace_span! .entered; |
136 | |
137 | let mut init_state = self.init_state.pin; |
138 | |
139 | unsafe |
140 | |
141 | unsafe , |
142 | , | object_name
143 | , | value_name
144 | VTABLE, |
145 | |
146 | |
147 | |
148 | // unsafe { |
149 | // (self.vtable.value_getter)( |
150 | // self.init_state, |
151 | // O::object_name(), |
152 | // V::value_name(), |
153 | // ValueGetterCallback::new::<S, O, V, T>(handler), |
154 | // ) |
155 | // } |
156 | |
157 | self |
158 | |
159 | |
160 | |
161 | A, |
162 | O: GiteratedObject + IntoObjectVTable, |
163 | D: + , |
164 | T: , |
165 | > |
166 | &mut self, |
167 | handler: T, |
168 | |
169 | let _guard = trace_span! .entered; |
170 | |
171 | // unsafe { |
172 | // (self.vtable.operation_handler)( |
173 | // self.init_state, |
174 | // O::object_name(), |
175 | // D::operation_name(), |
176 | // OperationHandlerCallback::new::<S, O, D, A, T>(handler), |
177 | // ) |
178 | // } |
179 | |
180 | // TODO: Yikes? |
181 | self.; |
182 | |
183 | self.; |
184 | |
185 | self |
186 | |
187 | |
188 | // pub fn value_getter<O, V, T>(&mut self, handler: T) -> &mut Self |
189 | // where |
190 | // O: GiteratedObject + IntoObjectVTable, |
191 | // V: GiteratedObjectValue<Object = O> + IntoValueVTable<O>, |
192 | // T: IntoPluginValueGetter<S, O, V>, |
193 | // { |
194 | // let _guard = trace_span!("register value_getter handler").entered(); |
195 | |
196 | // unsafe { |
197 | // (self.vtable.value_getter)( |
198 | // self.init_state, |
199 | // O::object_name(), |
200 | // V::value_name(), |
201 | // ValueGetterCallback::new::<S, O, V, T>(handler), |
202 | // ) |
203 | // } |
204 | |
205 | // // TODO: Yikes? |
206 | // self.object::<O>(); |
207 | // self.value::<O, V>(); |
208 | |
209 | // self |
210 | // } |
211 | |
212 | |
213 | |
214 | O: GiteratedObject + IntoObjectVTable, |
215 | OS: Setting + IntoSettingVTable, |
216 | T: , |
217 | |
218 | let _guard = trace_span! .entered; |
219 | |
220 | // unsafe { |
221 | // (self.vtable.setting_getter)( |
222 | // self.init_state, |
223 | // O::object_name(), |
224 | // OS::name(), |
225 | // SettingGetterCallback::new::<S, O, OS, T>(handler), |
226 | // ) |
227 | // } |
228 | |
229 | self.; |
230 | |
231 | let mut init_state = self.init_state.pin; |
232 | |
233 | unsafe |
234 | |
235 | unsafe , |
236 | , | object_name
237 | OS name, |
238 | OSVTABLE, |
239 | |
240 | ; |
241 | |
242 | self |
243 | |
244 | |
245 | |
246 | |
247 | |
248 | |
249 | O: GiteratedObject + IntoObjectVTable + 'static, |
250 | VS: + IntoValueVTable + Setting + IntoSettingVTable, |
251 | HG: , |
252 | HS: ; |
253 | } |
254 | |
255 | impl ValueSettingExt for PluginStackBuilder |
256 | |
257 | |
258 | O: GiteratedObject + IntoObjectVTable + 'static, |
259 | VS: + IntoValueVTable + Setting + IntoSettingVTable, |
260 | HG: , |
261 | HS: , |
262 | |
263 | self |
264 | |
265 | |
266 | |
267 | |
268 | ; |
269 | |
270 | |
271 | type CallbackFunc = unsafe extern "C" fn |
272 | callback: , |
273 | state: , |
274 | object: , |
275 | ; |
276 | |
277 | |
278 | |
279 | unsafe extern "C" |
280 | callback: , |
281 | state: , |
282 | object: , |
283 | ; |
284 | |
285 | ; |
286 | |
287 | |
288 | |
289 | |
290 | O: GiteratedObject, |
291 | VS: , |
292 | HG: , |
293 | |
294 | unsafe extern "C" |
295 | _callback: , |
296 | _state: , |
297 | _object: , |
298 | |
299 | // let result = HG::get_setting(callback, state, object)?; |
300 | |
301 | // let setting = *result.transmute_owned::<VS>(); |
302 | |
303 | todo!; |
304 | |
305 | // Ok(NewAnyValue::new(setting)) |
306 | |
307 | |
308 | |
309 | todo! |
310 | |
311 | |
312 |