comparison src/state.rs @ 13:97e543f50f62

Split GTK UI into another module.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 01 Nov 2020 16:08:29 +0100
parents d43c31aff57c
children adab13145994
comparison
equal deleted inserted replaced
12:d43c31aff57c 13:97e543f50f62
16 16
17 use std::fs::File; 17 use std::fs::File;
18 use std::sync::{Arc, Mutex}; 18 use std::sync::{Arc, Mutex};
19 19
20 use input_linux::{AbsoluteAxis, Key, MiscKind, SynchronizeKind, UInputHandle}; 20 use input_linux::{AbsoluteAxis, Key, MiscKind, SynchronizeKind, UInputHandle};
21 use crate::{WIDTH, HEIGHT, MAX_X, MAX_Y}; 21 use crate::{DEFAULT_WIDTH, DEFAULT_HEIGHT, MAX_X, MAX_Y};
22 use crate::uinput::{create_uinput_device, input_axis_new, input_misc_new, input_key_new, input_synchronize_new}; 22 use crate::uinput::{create_uinput_device, input_axis_new, input_misc_new, input_key_new, input_synchronize_new};
23 23
24 pub struct State { 24 pub struct State {
25 dev: UInputHandle<File>, 25 dev: UInputHandle<File>,
26 width: f64, 26 width: f64,
38 dev.sys_path()? 38 dev.sys_path()?
39 ); 39 );
40 40
41 Ok(Arc::new(Mutex::new(State { 41 Ok(Arc::new(Mutex::new(State {
42 dev, 42 dev,
43 width: WIDTH as f64, 43 width: DEFAULT_WIDTH as f64,
44 height: HEIGHT as f64, 44 height: DEFAULT_HEIGHT as f64,
45 selected_tool: Key::ButtonToolPen, 45 selected_tool: Key::ButtonToolPen,
46 pressed: false, 46 pressed: false,
47 }))) 47 })))
48 } 48 }
49 49