So. Much. Work.
parent: tbd commit: b05f964
1 | use Future; |
2 | |
3 | use |
4 | , | OperationError
5 | , | GiteratedObject
6 | , |
7 | ; |
8 | |
9 | use crate::; |
10 | |
11 | use CallbackPtr; |
12 | |
13 | |
14 | |
15 | pub callback_ptr: CallbackPtr, |
16 | pub func: unsafe extern "C" fn |
17 | CallbackPtr, |
18 | &PluginState, |
19 | object: AnyObject, |
20 | , |
21 | |
22 | |
23 | |
24 | |
25 | Self |
26 | func: get_setting, |
27 | callback_ptr: callback.callback_ptr, |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | unsafe extern "C" |
34 | callback_ptr: CallbackPtr, |
35 | state: &PluginState, |
36 | object: AnyObject, |
37 | ; |
38 | |
39 | |
40 | unsafe |
41 | |
42 | |
43 | |
44 | |
45 | |
46 | Fut: , |
47 | S: Clone, |
48 | O: GiteratedObject, |
49 | OS: Setting, |
50 | F: Fn(S, O) -> Fut, |
51 | |
52 | unsafe extern "C" |
53 | callback: CallbackPtr, |
54 | state: &PluginState, |
55 | mut object: AnyObject, |
56 | |
57 | let _guard = trace_span! |
58 | "get_setting handler", |
59 | object = object_name, |
60 | setting = OS name |
61 | |
62 | .entered; |
63 | let state = unsafe ; |
64 | |
65 | let object = unsafe ; |
66 | |
67 | // Cast the callback ptr to ourselves |
68 | let callback: *const F = transmute; |
69 | let callback = callback.as_ref .unwrap; |
70 | |
71 | // let result = callback(state.clone(), *object); |
72 | |
73 | // match result { |
74 | // Ok(setting) => Ok(NewAnySetting::new(setting)), |
75 | // Err(_) => todo!(), |
76 | // } |
77 | |
78 | todo! |
79 | |
80 | |
81 | |
82 | |
83 | unsafe extern "C" |
84 | callback_ptr: CallbackPtr, |
85 | state: &PluginState, |
86 | object: AnyObject, |
87 | setting: AnySetting, |
88 | ; |
89 | |
90 | |
91 | unsafe |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | Fut: , |
98 | S: Clone, |
99 | O: GiteratedObject, |
100 | OS: Setting, |
101 | F: Fn(S, O, OS) -> Fut, |
102 | |
103 | unsafe extern "C" |
104 | callback: CallbackPtr, |
105 | state: &PluginState, |
106 | mut object: AnyObject, |
107 | setting: AnySetting, |
108 | |
109 | let _guard = trace_span! |
110 | "get_setting handler", |
111 | object = object_name, |
112 | setting = OS name |
113 | |
114 | .entered; |
115 | let state = unsafe ; |
116 | |
117 | let object = unsafe ; |
118 | |
119 | // Cast the callback ptr to ourselves |
120 | let callback: *const F = transmute; |
121 | let callback = callback.as_ref .unwrap; |
122 | |
123 | // let result = callback(state.clone(), *object); |
124 | |
125 | // match result { |
126 | // Ok(setting) => Ok(NewAnySetting::new(setting)), |
127 | // Err(_) => todo!(), |
128 | // } |
129 | todo! |
130 | |
131 | |
132 | |
133 | |
134 | func: unsafe extern "C" fn |
135 | &PluginState, |
136 | object: AnyObject, |
137 | setting_name: &str, |
138 | new_setting: NewAnySetting, |
139 | , |
140 | |
141 | |
142 | |
143 | unsafe extern "C" |
144 | state: &PluginState, |
145 | object: AnyObject, |
146 | setting_name: &str, |
147 | new_setting: NewAnySetting, |
148 | ; |
149 | |
150 | |
151 | |
152 | unsafe extern "C" |
153 | state: &PluginState, |
154 | object: AnyObject, |
155 | setting_name: &str, |
156 | new_setting: NewAnySetting, |
157 | |
158 | todo! |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | Self |
165 | func: setting_changed, |
166 | |
167 | |
168 | |
169 |