From 032e1fa27ff9faa9a5d82624dbfc5fe8a48c339c Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Sun, 11 Dec 2022 12:43:48 +0400 Subject: =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0?= =?UTF-8?q?=205=20=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab5/src/main.rs | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 lab5/src/main.rs (limited to 'lab5/src/main.rs') diff --git a/lab5/src/main.rs b/lab5/src/main.rs new file mode 100644 index 0000000..d056ebb --- /dev/null +++ b/lab5/src/main.rs @@ -0,0 +1,44 @@ +mod utils; +mod window_state; + +mod check_window; +mod forge_window; +mod generate_window; +mod sign_window; + +use crate::window_state::WindowState; +use eframe::egui; + +fn main() { + let options = eframe::NativeOptions::default(); + eframe::run_native( + "Криптографические методы защиты информации", + options, + Box::new(|_cc| Box::new(Application::default())), + ); +} + +struct Application { + labs: Vec>, +} + +impl Default for Application { + fn default() -> Self { + Self { + labs: vec![ + Box::new(generate_window::Window::default()), + Box::new(sign_window::Window::default()), + Box::new(check_window::Window::default()), + Box::new(forge_window::Window::default()), + ], + } + } +} + +impl eframe::App for Application { + fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { + for window in &mut self.labs { + egui::Window::new(window.get_name()).show(ctx, |ui| window.update(ui)); + } + } +} -- cgit v1.2.3