1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use {
std::{
io::prelude::*,
fs::File,
},
crate::{
cx::Cx,
}
};
impl Cx {
pub fn desktop_load_dependencies(&mut self){
for (path,dep) in &mut self.dependencies{
if let Ok(mut file_handle) = File::open(path) {
let mut buffer = Vec::<u8>::new();
if file_handle.read_to_end(&mut buffer).is_ok() {
dep.data = Some(Ok(buffer));
}
else{
dep.data = Some(Err("read_to_end failed".to_string()));
}
}
else{
dep.data = Some(Err("File open failed".to_string()));
}
}
}
/*
pub(crate) fn process_desktop_pre_event(&mut self, event: &mut Event)
{
match event {
Event::FingerDown(fe) => {
fe.tap_count = self.fingers.process_tap_count(fe.digit_id, fe.abs, fe.time);
},
Event::KeyDown(ke) => {
self.keyboard.process_key_down(ke.clone());
},
Event::KeyUp(ke) => {
self.keyboard.process_key_up(ke.clone());
},
Event::AppLostFocus => {
self.call_all_keys_up();
},
_ => ()
};
}
pub(crate) fn process_desktop_post_event(&mut self, event: &mut Event) -> bool {
match event {
Event::FingerUp(fe) => { // decapture automatically
self.fingers.release_digit(fe.digit);
},
Event::FingerHover(_) => { // new last area finger over
self.fingers.cycle_over_last();
},
Event::FingerDrag(_) => {
self.finger_drag.cycle_drag();
},
_ => {}
}
false
}*/
}