change project structure to make more sense
(move wm only stuff to wm dir)
This commit is contained in:
14
Cargo.toml
14
Cargo.toml
@@ -9,7 +9,7 @@ default-run = "ming"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [ "linux" ]
|
members = [ "wm", "wm/linux" ]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
bmp-rust = "0.5.0"
|
bmp-rust = "0.5.0"
|
||||||
@@ -17,20 +17,16 @@ blake2 = { version = "0.10.6", default-features = false }
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ming-wm-lib = { path = "ming-wm-lib" }
|
ming-wm-lib = { path = "ming-wm-lib" }
|
||||||
blake2 = { version = "0.10.6", default-features = false }
|
wm = { path = "wm", optional = true }
|
||||||
linux = { path = "linux" }
|
|
||||||
termion = { version = "4.0.3", optional = true }
|
|
||||||
rodio = { version = "0.19.0", default-features = false, features = [ "flac", "mp3", "symphonia-vorbis", "wav" ], optional = true }
|
rodio = { version = "0.19.0", default-features = false, features = [ "flac", "mp3", "symphonia-vorbis", "wav" ], optional = true }
|
||||||
rand = { version = "0.9.0", default-features = false, features = [ "small_rng" ], optional = true }
|
rand = { version = "0.9.0", default-features = false, features = [ "small_rng" ], optional = true }
|
||||||
id3 = { version = "1.10.0", optional = true }
|
id3 = { version = "1.10.0", optional = true }
|
||||||
mp4ameta = { version = "0.11.0", optional = true }
|
mp4ameta = { version = "0.11.0", optional = true }
|
||||||
metaflac = { version = "0.2.5", optional = true }
|
metaflac = { version = "0.2.5", optional = true }
|
||||||
bmp-rust = "0.5.0"
|
|
||||||
pty-process = { version = "0.5.1", optional = true }
|
pty-process = { version = "0.5.1", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "main", "terminal" ]
|
default = [ "wm", "terminal" ]
|
||||||
main = [ "termion" ]
|
|
||||||
terminal = [ "pty-process" ]
|
terminal = [ "pty-process" ]
|
||||||
audio_player = [ "id3", "mp4ameta", "metaflac", "rand", "rodio" ]
|
audio_player = [ "id3", "mp4ameta", "metaflac", "rand", "rodio" ]
|
||||||
|
|
||||||
@@ -39,8 +35,8 @@ lto = true
|
|||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "ming"
|
name = "ming"
|
||||||
path = "src/bin/main.rs"
|
path = "src/bin/wm.rs"
|
||||||
required-features = [ "main" ]
|
required-features = [ "wm" ]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "mingFiles_Audio_Player"
|
name = "mingFiles_Audio_Player"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ming-wm-lib"
|
name = "ming-wm-lib"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
repository = "https://github.com/stjet/ming-wm"
|
repository = "https://github.com/stjet/ming-wm"
|
||||||
description = "library for building windows for ming-wm in rust"
|
description = "library for building windows for ming-wm in rust"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ use std::vec;
|
|||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
|
|
||||||
use crate::components::Component;
|
use crate::components::Component;
|
||||||
use ming_wm_lib::framebuffer_types::{ Dimensions, Point };
|
use crate::framebuffer_types::{ Dimensions, Point };
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use crate::themes::ThemeInfo;
|
||||||
use ming_wm_lib::messages::WindowMessage;
|
use crate::messages::WindowMessage;
|
||||||
use ming_wm_lib::window_manager_types::DrawInstructions;
|
use crate::window_manager_types::DrawInstructions;
|
||||||
|
|
||||||
pub struct HighlightButton<T> {
|
pub struct HighlightButton<T> {
|
||||||
name_: String,
|
name_: String,
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
|
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use crate::themes::ThemeInfo;
|
||||||
use ming_wm_lib::messages::WindowMessage;
|
use crate::messages::WindowMessage;
|
||||||
use ming_wm_lib::window_manager_types::DrawInstructions;
|
use crate::window_manager_types::DrawInstructions;
|
||||||
|
|
||||||
pub mod toggle_button;
|
pub mod toggle_button;
|
||||||
pub mod highlight_button;
|
pub mod highlight_button;
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
use std::vec;
|
use std::vec;
|
||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
|
|
||||||
|
use crate::framebuffer_types::{ Dimensions, Point };
|
||||||
use ming_wm_lib::framebuffer_types::{ Dimensions, Point };
|
use crate::themes::ThemeInfo;
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use crate::messages::WindowMessage;
|
||||||
use ming_wm_lib::messages::WindowMessage;
|
use crate::window_manager_types::DrawInstructions;
|
||||||
use ming_wm_lib::window_manager_types::DrawInstructions;
|
use crate::utils::calc_actual_lines;
|
||||||
use ming_wm_lib::utils::calc_actual_lines;
|
|
||||||
use crate::components::Component;
|
use crate::components::Component;
|
||||||
|
|
||||||
const MONO_WIDTH: u8 = 10;
|
const MONO_WIDTH: u8 = 10;
|
||||||
@@ -2,10 +2,10 @@ use std::vec;
|
|||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
|
|
||||||
use crate::components::Component;
|
use crate::components::Component;
|
||||||
use ming_wm_lib::framebuffer_types::{ Dimensions, Point };
|
use crate::framebuffer_types::{ Dimensions, Point };
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use crate::themes::ThemeInfo;
|
||||||
use ming_wm_lib::messages::WindowMessage;
|
use crate::messages::WindowMessage;
|
||||||
use ming_wm_lib::window_manager_types::DrawInstructions;
|
use crate::window_manager_types::DrawInstructions;
|
||||||
|
|
||||||
const MONO_WIDTH: u8 = 10;
|
const MONO_WIDTH: u8 = 10;
|
||||||
|
|
||||||
@@ -2,10 +2,10 @@ use std::vec;
|
|||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
|
|
||||||
use crate::components::Component;
|
use crate::components::Component;
|
||||||
use ming_wm_lib::framebuffer_types::{ Dimensions, Point };
|
use crate::framebuffer_types::{ Dimensions, Point };
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use crate::themes::ThemeInfo;
|
||||||
use ming_wm_lib::messages::WindowMessage;
|
use crate::messages::WindowMessage;
|
||||||
use ming_wm_lib::window_manager_types::DrawInstructions;
|
use crate::window_manager_types::DrawInstructions;
|
||||||
|
|
||||||
pub struct ToggleButton<T> {
|
pub struct ToggleButton<T> {
|
||||||
name_: String,
|
name_: String,
|
||||||
@@ -4,6 +4,7 @@ pub mod themes;
|
|||||||
pub mod serialize;
|
pub mod serialize;
|
||||||
pub mod messages;
|
pub mod messages;
|
||||||
pub mod ipc;
|
pub mod ipc;
|
||||||
|
pub mod components;
|
||||||
pub mod dirs;
|
pub mod dirs;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod logging;
|
pub mod logging;
|
||||||
|
|||||||
@@ -214,3 +214,16 @@ pub fn path_autocomplete(current_path: &str, partial_path: &str) -> Option<Strin
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_all_files(dir: PathBuf) -> Vec<PathBuf> {
|
||||||
|
let mut files = Vec::new();
|
||||||
|
for entry in read_dir(dir).unwrap() {
|
||||||
|
let path = entry.unwrap().path();
|
||||||
|
if path.is_dir() {
|
||||||
|
files.extend(get_all_files(path));
|
||||||
|
} else {
|
||||||
|
files.push(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
files
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLik
|
|||||||
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse };
|
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse };
|
||||||
use ming_wm_lib::framebuffer_types::Dimensions;
|
use ming_wm_lib::framebuffer_types::Dimensions;
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use ming_wm_lib::themes::ThemeInfo;
|
||||||
use ming_wm_lib::utils::{ concat_paths, path_autocomplete, format_seconds, Substring };
|
use ming_wm_lib::utils::{ concat_paths, get_all_files, path_autocomplete, format_seconds, Substring };
|
||||||
use ming_wm_lib::dirs::home;
|
use ming_wm_lib::dirs::home;
|
||||||
use ming_wm_lib::ipc::listen;
|
use ming_wm_lib::ipc::listen;
|
||||||
use ming_wm::fs::get_all_files;
|
|
||||||
|
|
||||||
fn get_artist(path: &PathBuf) -> Option<String> {
|
fn get_artist(path: &PathBuf) -> Option<String> {
|
||||||
let ext = path.extension().unwrap();
|
let ext = path.extension().unwrap();
|
||||||
|
|||||||
@@ -6,15 +6,19 @@ use std::io::{ stdin, stdout, BufReader, BufRead, Write };
|
|||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
use linux::fb::Framebuffer;
|
//termion is an external dep, will be removed eventually
|
||||||
use linux::raw::RawStdout;
|
use wm::termion::input::TermRead;
|
||||||
use termion::input::TermRead;
|
use wm::termion::event::Key;
|
||||||
use termion::event::Key;
|
|
||||||
|
use wm::linux::fb::Framebuffer;
|
||||||
|
use wm::linux::raw::RawStdout;
|
||||||
|
use wm::framebuffer::{ FramebufferWriter, FramebufferInfo };
|
||||||
|
use wm::window_manager::WindowManager;
|
||||||
|
|
||||||
use ming_wm_lib::window_manager_types::KeyChar;
|
use ming_wm_lib::window_manager_types::KeyChar;
|
||||||
use ming_wm_lib::messages::*;
|
use ming_wm_lib::messages::*;
|
||||||
use ming_wm::framebuffer::{ FramebufferWriter, FramebufferInfo };
|
|
||||||
use ming_wm::window_manager::WindowManager;
|
include!(concat!(env!("OUT_DIR"), "/password.rs"));
|
||||||
|
|
||||||
const CLEAR_ALL: &'static str = "\x1b[2J";
|
const CLEAR_ALL: &'static str = "\x1b[2J";
|
||||||
const HIDE_CURSOR: &'static str = "\x1b[?25l";
|
const HIDE_CURSOR: &'static str = "\x1b[?25l";
|
||||||
@@ -71,7 +75,7 @@ fn init(framebuffer: Framebuffer, framebuffer_info: FramebufferInfo) {
|
|||||||
|
|
||||||
writer.init(framebuffer_info.clone());
|
writer.init(framebuffer_info.clone());
|
||||||
|
|
||||||
let mut wm: WindowManager = WindowManager::new(writer, framebuffer, dimensions, rotate, grayscale);
|
let mut wm: WindowManager = WindowManager::new(writer, framebuffer, dimensions, rotate, grayscale, PASSWORD_HASH);
|
||||||
|
|
||||||
let mut stdout = RawStdout::new(stdout());
|
let mut stdout = RawStdout::new(stdout());
|
||||||
stdout.enter_raw_mode().unwrap();
|
stdout.enter_raw_mode().unwrap();
|
||||||
14
wm/Cargo.toml
Normal file
14
wm/Cargo.toml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[package]
|
||||||
|
name = "wm"
|
||||||
|
version = "1.0.3"
|
||||||
|
repository = "https://github.com/stjet/ming-wm"
|
||||||
|
license = "GPL-3.0-or-later"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ming-wm-lib = { path = "../ming-wm-lib" }
|
||||||
|
linux = { path = "linux" }
|
||||||
|
blake2 = { version = "0.10.6", default-features = false }
|
||||||
|
termion = { version = "4.0.3" }
|
||||||
|
bmp-rust = "0.5.0"
|
||||||
|
|
||||||
@@ -7,8 +7,8 @@ use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse };
|
|||||||
use ming_wm_lib::framebuffer_types::Dimensions;
|
use ming_wm_lib::framebuffer_types::Dimensions;
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use ming_wm_lib::themes::ThemeInfo;
|
||||||
use ming_wm_lib::dirs::exe_dir;
|
use ming_wm_lib::dirs::exe_dir;
|
||||||
use crate::components::Component;
|
use ming_wm_lib::components::Component;
|
||||||
use crate::components::paragraph::Paragraph;
|
use ming_wm_lib::components::paragraph::Paragraph;
|
||||||
|
|
||||||
pub struct About {
|
pub struct About {
|
||||||
dimensions: Dimensions,
|
dimensions: Dimensions,
|
||||||
@@ -8,8 +8,8 @@ use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse };
|
|||||||
use ming_wm_lib::dirs::exe_dir;
|
use ming_wm_lib::dirs::exe_dir;
|
||||||
use ming_wm_lib::framebuffer_types::Dimensions;
|
use ming_wm_lib::framebuffer_types::Dimensions;
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use ming_wm_lib::themes::ThemeInfo;
|
||||||
use crate::components::paragraph::Paragraph;
|
use ming_wm_lib::components::paragraph::Paragraph;
|
||||||
use crate::components::Component;
|
use ming_wm_lib::components::Component;
|
||||||
|
|
||||||
pub struct Help {
|
pub struct Help {
|
||||||
dimensions: Dimensions,
|
dimensions: Dimensions,
|
||||||
@@ -7,13 +7,12 @@ use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse, WindowManager
|
|||||||
use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLikeType };
|
use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLikeType };
|
||||||
use blake2::{ Blake2b512, Digest };
|
use blake2::{ Blake2b512, Digest };
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/password.rs"));
|
|
||||||
|
|
||||||
//const PASSWORD_HASH: [u8; 64] = [220, 88, 183, 188, 240, 27, 107, 181, 58, 191, 198, 170, 114, 38, 7, 148, 6, 179, 75, 128, 231, 171, 172, 220, 85, 38, 36, 113, 116, 146, 70, 197, 163, 179, 158, 192, 130, 53, 247, 48, 47, 209, 95, 96, 179, 211, 4, 122, 254, 127, 21, 165, 139, 199, 151, 226, 216, 176, 123, 41, 194, 221, 58, 69];
|
//const PASSWORD_HASH: [u8; 64] = [220, 88, 183, 188, 240, 27, 107, 181, 58, 191, 198, 170, 114, 38, 7, 148, 6, 179, 75, 128, 231, 171, 172, 220, 85, 38, 36, 113, 116, 146, 70, 197, 163, 179, 158, 192, 130, 53, 247, 48, 47, 209, 95, 96, 179, 211, 4, 122, 254, 127, 21, 165, 139, 199, 151, 226, 216, 176, 123, 41, 194, 221, 58, 69];
|
||||||
|
|
||||||
pub struct LockScreen {
|
pub struct LockScreen {
|
||||||
dimensions: Dimensions,
|
dimensions: Dimensions,
|
||||||
input_password: String,
|
input_password: String,
|
||||||
|
password_hash: [u8; 64],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WindowLike for LockScreen {
|
impl WindowLike for LockScreen {
|
||||||
@@ -28,7 +27,7 @@ impl WindowLike for LockScreen {
|
|||||||
//check password
|
//check password
|
||||||
let mut hasher = Blake2b512::new();
|
let mut hasher = Blake2b512::new();
|
||||||
hasher.update((self.input_password.clone() + "salt?sorrycryptographers").as_bytes());
|
hasher.update((self.input_password.clone() + "salt?sorrycryptographers").as_bytes());
|
||||||
if hasher.finalize() == PASSWORD_HASH.into() {
|
if hasher.finalize() == self.password_hash.into() {
|
||||||
WindowMessageResponse::Request(WindowManagerRequest::Unlock)
|
WindowMessageResponse::Request(WindowManagerRequest::Unlock)
|
||||||
} else {
|
} else {
|
||||||
self.input_password = String::new();
|
self.input_password = String::new();
|
||||||
@@ -73,10 +72,11 @@ impl WindowLike for LockScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl LockScreen {
|
impl LockScreen {
|
||||||
pub fn new() -> Self {
|
pub fn new(password_hash: [u8; 64]) -> Self {
|
||||||
Self {
|
Self {
|
||||||
dimensions: [0, 0],
|
dimensions: [0, 0],
|
||||||
input_password: String::new(),
|
input_password: String::new(),
|
||||||
|
password_hash,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,8 @@ use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse, WindowManager
|
|||||||
use ming_wm_lib::framebuffer_types::Dimensions;
|
use ming_wm_lib::framebuffer_types::Dimensions;
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use ming_wm_lib::themes::ThemeInfo;
|
||||||
use ming_wm_lib::utils::point_inside;
|
use ming_wm_lib::utils::point_inside;
|
||||||
use crate::components::Component;
|
use ming_wm_lib::components::Component;
|
||||||
use crate::components::press_button::PressButton;
|
use ming_wm_lib::components::press_button::PressButton;
|
||||||
|
|
||||||
//seems like framebuffer only updates if (real) key is pressed...
|
//seems like framebuffer only updates if (real) key is pressed...
|
||||||
//on mobile, volume down button seems to work but is annoying
|
//on mobile, volume down button seems to work but is annoying
|
||||||
@@ -7,9 +7,9 @@ use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse, WindowManager
|
|||||||
use ming_wm_lib::framebuffer_types::Dimensions;
|
use ming_wm_lib::framebuffer_types::Dimensions;
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use ming_wm_lib::themes::ThemeInfo;
|
||||||
use ming_wm_lib::dirs::exe_dir;
|
use ming_wm_lib::dirs::exe_dir;
|
||||||
|
use ming_wm_lib::components::Component;
|
||||||
|
use ming_wm_lib::components::highlight_button::HighlightButton;
|
||||||
use crate::fs::{ ExeWindowInfos, get_all_executable_windows };
|
use crate::fs::{ ExeWindowInfos, get_all_executable_windows };
|
||||||
use crate::components::Component;
|
|
||||||
use crate::components::highlight_button::HighlightButton;
|
|
||||||
|
|
||||||
static CATEGORIES: [&'static str; 9] = ["About", "Utils", "Games", "Editing", "Files", "Internet", "Misc", "Help", "Lock"];
|
static CATEGORIES: [&'static str; 9] = ["About", "Utils", "Games", "Editing", "Files", "Internet", "Misc", "Help", "Lock"];
|
||||||
|
|
||||||
@@ -6,8 +6,8 @@ use ming_wm_lib::window_manager_types::{ DrawInstructions, WindowLike, WindowLik
|
|||||||
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse, WindowManagerRequest, ShortcutType, InfoType, WindowsVec };
|
use ming_wm_lib::messages::{ WindowMessage, WindowMessageResponse, WindowManagerRequest, ShortcutType, InfoType, WindowsVec };
|
||||||
use ming_wm_lib::framebuffer_types::Dimensions;
|
use ming_wm_lib::framebuffer_types::Dimensions;
|
||||||
use ming_wm_lib::themes::ThemeInfo;
|
use ming_wm_lib::themes::ThemeInfo;
|
||||||
use crate::components::Component;
|
use ming_wm_lib::components::Component;
|
||||||
use crate::components::toggle_button::ToggleButton;
|
use ming_wm_lib::components::toggle_button::ToggleButton;
|
||||||
|
|
||||||
const PADDING: usize = 4;
|
const PADDING: usize = 4;
|
||||||
const META_WIDTH: usize = 175; //of the window button
|
const META_WIDTH: usize = 175; //of the window button
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
use std::fs::{ read_dir, File };
|
use std::fs::{ read_dir, File };
|
||||||
use std::path::PathBuf;
|
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
@@ -34,19 +33,6 @@ pub fn get_font_char_from_fonts(fonts: &[String], c: char) -> (char, Vec<Vec<u8>
|
|||||||
get_font_char(&p, '?').unwrap_or(('?', vec![vec![0]], 0))
|
get_font_char(&p, '?').unwrap_or(('?', vec![vec![0]], 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_all_files(dir: PathBuf) -> Vec<PathBuf> {
|
|
||||||
let mut files = Vec::new();
|
|
||||||
for entry in read_dir(dir).unwrap() {
|
|
||||||
let path = entry.unwrap().path();
|
|
||||||
if path.is_dir() {
|
|
||||||
files.extend(get_all_files(path));
|
|
||||||
} else {
|
|
||||||
files.push(path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
files
|
|
||||||
}
|
|
||||||
|
|
||||||
//Category, Vec<Display name, file name>
|
//Category, Vec<Display name, file name>
|
||||||
pub type ExeWindowInfos = HashMap<String, Vec<(String, String)>>;
|
pub type ExeWindowInfos = HashMap<String, Vec<(String, String)>>;
|
||||||
|
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
pub use linux;
|
||||||
|
pub use termion;
|
||||||
|
|
||||||
pub mod framebuffer;
|
pub mod framebuffer;
|
||||||
pub mod window_manager;
|
pub mod window_manager;
|
||||||
pub mod components;
|
|
||||||
pub mod fs;
|
pub mod fs;
|
||||||
mod proxy_window_like;
|
mod proxy_window_like;
|
||||||
mod essential;
|
mod essential;
|
||||||
@@ -65,12 +65,13 @@ pub struct WindowManager {
|
|||||||
current_workspace: u8,
|
current_workspace: u8,
|
||||||
framebuffer: Framebuffer,
|
framebuffer: Framebuffer,
|
||||||
clipboard: Option<String>,
|
clipboard: Option<String>,
|
||||||
|
password_hash: [u8; 64],
|
||||||
}
|
}
|
||||||
|
|
||||||
//1 is up, 2 is down
|
//1 is up, 2 is down
|
||||||
|
|
||||||
impl WindowManager {
|
impl WindowManager {
|
||||||
pub fn new(writer: FramebufferWriter, framebuffer: Framebuffer, dimensions: Dimensions, rotate: bool, grayscale: bool) -> Self {
|
pub fn new(writer: FramebufferWriter, framebuffer: Framebuffer, dimensions: Dimensions, rotate: bool, grayscale: bool, password_hash: [u8; 64]) -> Self {
|
||||||
//println!("bg: {}x{}", dimensions[0], dimensions[1] - TASKBAR_HEIGHT - INDICATOR_HEIGHT);
|
//println!("bg: {}x{}", dimensions[0], dimensions[1] - TASKBAR_HEIGHT - INDICATOR_HEIGHT);
|
||||||
let mut wm = WindowManager {
|
let mut wm = WindowManager {
|
||||||
writer: RefCell::new(writer),
|
writer: RefCell::new(writer),
|
||||||
@@ -86,6 +87,7 @@ impl WindowManager {
|
|||||||
current_workspace: 0,
|
current_workspace: 0,
|
||||||
framebuffer,
|
framebuffer,
|
||||||
clipboard: None,
|
clipboard: None,
|
||||||
|
password_hash,
|
||||||
};
|
};
|
||||||
wm.lock();
|
wm.lock();
|
||||||
wm.change_theme();
|
wm.change_theme();
|
||||||
@@ -136,7 +138,7 @@ impl WindowManager {
|
|||||||
fn lock(&mut self) {
|
fn lock(&mut self) {
|
||||||
self.locked = true;
|
self.locked = true;
|
||||||
self.window_infos = Vec::new();
|
self.window_infos = Vec::new();
|
||||||
self.add_window_like(Box::new(LockScreen::new()), [0, 0], None);
|
self.add_window_like(Box::new(LockScreen::new(self.password_hash)), [0, 0], None);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn unlock(&mut self) {
|
fn unlock(&mut self) {
|
||||||
Reference in New Issue
Block a user