Fucking whatever there you go
parent: tbd commit: 57c2ca5
1 | use OnceLock; |
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 | Self |
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 | DS, |
142 | DF, |
143 | A, |
144 | O: GiteratedObject + IntoObjectVTable, |
145 | D: + , |
146 | T: , |
147 | > |
148 | &mut self, |
149 | handler: T, |
150 | |
151 | let _guard = trace_span! .entered; |
152 | |
153 | unsafe |
154 | |
155 | self.init_state, |
156 | , | object_name
157 | , | operation_name
158 | , |
159 | |
160 | |
161 | |
162 | // TODO: Yikes? |
163 | self.; |
164 | |
165 | self.; |
166 | |
167 | self |
168 | |
169 | |
170 | // pub fn value_getter<O, V, T>(&mut self, handler: T) -> &mut Self |
171 | // where |
172 | // O: GiteratedObject + IntoObjectVTable, |
173 | // V: GiteratedObjectValue<Object = O> + IntoValueVTable<O>, |
174 | // T: IntoPluginValueGetter<S, O, V>, |
175 | // { |
176 | // let _guard = trace_span!("register value_getter handler").entered(); |
177 | |
178 | // unsafe { |
179 | // (self.vtable.value_getter)( |
180 | // self.init_state, |
181 | // O::object_name(), |
182 | // V::value_name(), |
183 | // ValueGetterCallback::new::<S, O, V, T>(handler), |
184 | // ) |
185 | // } |
186 | |
187 | // // TODO: Yikes? |
188 | // self.object::<O>(); |
189 | // self.value::<O, V>(); |
190 | |
191 | // self |
192 | // } |
193 | |
194 | // pub fn setting_getter<O, OS, T>(&mut self, handler: T) -> &mut Self |
195 | // where |
196 | // O: GiteratedObject + IntoObjectVTable, |
197 | // OS: Setting + IntoSettingVTable, |
198 | // T: IntoPluginSettingGetter<S, O, OS>, |
199 | // { |
200 | // let _guard = trace_span!("register setting_getter handler").entered(); |
201 | |
202 | // unsafe { |
203 | // (self.vtable.setting_getter)( |
204 | // self.init_state, |
205 | // O::object_name(), |
206 | // OS::name(), |
207 | // SettingGetterCallback::new::<S, O, OS, T>(handler), |
208 | // ) |
209 | // } |
210 | |
211 | // self.object::<O>(); |
212 | // // self.setting::<O, OS>(); |
213 | |
214 | // self |
215 | // } |
216 | |
217 | |
218 | |
219 | |
220 | |
221 | O: GiteratedObject + IntoObjectVTable + 'static, |
222 | VS: + + Setting + IntoSettingVTable, |
223 | HG: , |
224 | HS: ; |
225 | } |
226 | |
227 | for |
228 | |
229 | |
230 | O: GiteratedObject + IntoObjectVTable + 'static, |
231 | VS: + + Setting + IntoSettingVTable, |
232 | HG: , |
233 | HS: , |
234 | |
235 | self |
236 | |
237 | |
238 | |
239 | |
240 | unsafe extern "C" |
241 | callback: CallbackPtr, |
242 | state: &PluginState, |
243 | object: AnyObject, |
244 | ; |
245 | |
246 | ; |
247 | |
248 | |
249 | |
250 | |
251 | O: GiteratedObject, |
252 | VS: , |
253 | HG: , |
254 | |
255 | unsafe extern "C" |
256 | callback: CallbackPtr, |
257 | state: &PluginState, |
258 | object: AnyObject, |
259 | |
260 | let result = HG get_setting?; |
261 | |
262 | let setting = *result.; |
263 | |
264 | Ok |
265 | |
266 | |
267 | |
268 | self.callback_ptr |
269 | |
270 | |
271 |