istg if I see another extern crate

This commit is contained in:
gallant 2023-07-27 14:49:15 -05:00
parent 1afca4cd38
commit 62cdf806df
5 changed files with 31 additions and 4 deletions

View file

@ -7,4 +7,4 @@ edition = "2021"
[dependencies]
smithay = "0.3.0"
lazy_static = "1.4.0"
lazy_static = "1.4.0"

View file

@ -1,3 +1,5 @@
use lazy_static::lazy_static;
lazy_static! {
pub static ref LOG_FILE: Mutex<BufWriter<File>> = {
// here we would add the code to grab the location of the log file from the config file.
@ -13,4 +15,4 @@ pub fn log(entry: &str) {
let mut log = LOG_FILE.lock().unwrap();
log.write_all(entry.as_bytes()).unwrap();
log.flush().unwrap();
}
}

12
src/input.rs Normal file
View file

@ -0,0 +1,12 @@
use crate::state::*;
use smithay::backend::input::{
InputBackend
};
impl InputBackend for Waycrab{}
fn dispatch_new_events<F>(
&mut self,
callback: F) -> Result<(),InputBackend::EventError>{
}
}

View file

@ -1,5 +1,4 @@
#[macro_use]
extern crate lazy_static;
mod backend;

14
src/state.rs Normal file
View file

@ -0,0 +1,14 @@
#[derive(Debug)]
struct Waycrab {
uptime: std::time::Instant
}
impl Waycrab{
pub fn new() -> Self
{
Waycrab {
uptime: std::time::Instant::now()
}
}
}