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