32 lines
		
	
	
		
			698 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			698 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
use std::collections::HashMap;
 | 
						|
 | 
						|
use super::Gui;
 | 
						|
 | 
						|
mod song_edit;
 | 
						|
 | 
						|
trait Window {
 | 
						|
    fn show(&mut self, gui: &mut Gui, ctx: &egui::Context, open: &mut bool) -> anyhow::Result<()>;
 | 
						|
    fn name(&self) -> &'static str;
 | 
						|
}
 | 
						|
 | 
						|
pub enum WindowIndex {
 | 
						|
    SongEdit
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
pub struct WindowManager {
 | 
						|
    windows: HashMap<WindowIndex, Box<dyn Window>>
 | 
						|
}
 | 
						|
 | 
						|
impl WindowManager {
 | 
						|
    pub fn new() -> Self {
 | 
						|
        let mut windows = HashMap::new();
 | 
						|
        windows.instert(WindowIndex::SongEdit, Box::<song_edit::GuiSongEditor>::default());
 | 
						|
        Self {
 | 
						|
            windows: HashMap::from_iter([
 | 
						|
                (WindowIndex::SongEdit, Box::<song_edit::GuiSongEditor>::default())   
 | 
						|
            ])
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |