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