diff options
Diffstat (limited to 'lab2/src/main.rs')
| -rw-r--r-- | lab2/src/main.rs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lab2/src/main.rs b/lab2/src/main.rs new file mode 100644 index 0000000..162666e --- /dev/null +++ b/lab2/src/main.rs @@ -0,0 +1,45 @@ +mod window_state; + +mod compute_window; +mod decrypt_window; +mod encrypt_window; +mod generate_window; + +mod utils; + +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<Box<dyn WindowState>>, +} + +impl Default for Application { + fn default() -> Self { + Self { + labs: vec![ + Box::new(generate_window::Window::default()), + Box::new(encrypt_window::Window::default()), + Box::new(decrypt_window::Window::default()), + Box::new(compute_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)); + } + } +} |