diff --git a/src/application.rs b/src/application.rs index 6cbc02a7..c5c4c0ce 100644 --- a/src/application.rs +++ b/src/application.rs @@ -3,7 +3,7 @@ use crate::window_events; use crate::pipeline::Pipeline; use crate::texture::Texture; use crate::resource_cache::ResourceCache; -use crate::gui_layout::GuiLayout; +use crate::layout_system::LayoutSystem; use crate::gui_node::GuiNode; use winit::event::*; use winit::event_loop::*; @@ -70,7 +70,7 @@ impl Application { // Data structure maintaining the user interface let gui_rect_pipeline = Pipeline::new( - &device, swap_chain_descriptor.format, Vec::new(), &mut shader_cache, ("shaders/shader.vert", "shaders/shader.frag") + &device, swap_chain_descriptor.format, Vec::new(), &mut shader_cache, ("shaders/shader.vert", "shaders/shader.frag"), ); pipeline_cache.set("gui_rect", gui_rect_pipeline); @@ -79,7 +79,7 @@ impl Application { let gui_root = rctree::Node::new(gui_root_data); // Main window in the XML layout language - let mut main_window_layout = GuiLayout::new(); + let mut main_window_layout = LayoutSystem::new(); main_window_layout.load_layout("window", "main"); Self { diff --git a/src/layout_dom_node.rs b/src/layout_dom_node.rs new file mode 100644 index 00000000..e69de29b diff --git a/src/gui_layout.rs b/src/layout_system.rs similarity index 97% rename from src/gui_layout.rs rename to src/layout_system.rs index e44d69bf..1c037aaf 100644 --- a/src/gui_layout.rs +++ b/src/layout_system.rs @@ -5,13 +5,14 @@ use crate::layout_abstract_syntax::*; use crate::layout_attribute_parser::*; use crate::resource_cache::ResourceCache; -pub struct GuiLayout { +pub struct LayoutSystem { + // pub dom_tree: rctree::Node< pub loaded_layouts: ResourceCache>, attribute_parser: AttributeParser, } -impl GuiLayout { - pub fn new() -> GuiLayout { +impl LayoutSystem { + pub fn new() -> LayoutSystem { Self { loaded_layouts: ResourceCache::new(), attribute_parser: AttributeParser::new(), @@ -19,7 +20,7 @@ impl GuiLayout { } pub fn load_layout(&mut self, namespace: &str, name: &str) { - // Load and parse the XML layout + // Load and parse the requested XML layout let xml_path = self.layout_xml_path(namespace, name); let window_main = self.parse_xml_file(&xml_path[..]).unwrap(); diff --git a/src/main.rs b/src/main.rs index 7c26aab7..4791f43d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,10 +9,11 @@ mod draw_command; mod gui_node; mod gui_attributes; mod window_events; -mod gui_layout; +mod layout_system; mod layout_abstract_types; mod layout_abstract_syntax; mod layout_attribute_parser; +mod layout_dom_node; use application::Application; use winit::event_loop::EventLoop;