Rename GUI Layout to Layout System
This commit is contained in:
parent
559833be8e
commit
f32f39d5a6
|
|
@ -3,7 +3,7 @@ use crate::window_events;
|
||||||
use crate::pipeline::Pipeline;
|
use crate::pipeline::Pipeline;
|
||||||
use crate::texture::Texture;
|
use crate::texture::Texture;
|
||||||
use crate::resource_cache::ResourceCache;
|
use crate::resource_cache::ResourceCache;
|
||||||
use crate::gui_layout::GuiLayout;
|
use crate::layout_system::LayoutSystem;
|
||||||
use crate::gui_node::GuiNode;
|
use crate::gui_node::GuiNode;
|
||||||
use winit::event::*;
|
use winit::event::*;
|
||||||
use winit::event_loop::*;
|
use winit::event_loop::*;
|
||||||
|
|
@ -70,7 +70,7 @@ impl Application {
|
||||||
|
|
||||||
// Data structure maintaining the user interface
|
// Data structure maintaining the user interface
|
||||||
let gui_rect_pipeline = Pipeline::new(
|
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);
|
pipeline_cache.set("gui_rect", gui_rect_pipeline);
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ impl Application {
|
||||||
let gui_root = rctree::Node::new(gui_root_data);
|
let gui_root = rctree::Node::new(gui_root_data);
|
||||||
|
|
||||||
// Main window in the XML layout language
|
// 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");
|
main_window_layout.load_layout("window", "main");
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,14 @@ use crate::layout_abstract_syntax::*;
|
||||||
use crate::layout_attribute_parser::*;
|
use crate::layout_attribute_parser::*;
|
||||||
use crate::resource_cache::ResourceCache;
|
use crate::resource_cache::ResourceCache;
|
||||||
|
|
||||||
pub struct GuiLayout {
|
pub struct LayoutSystem {
|
||||||
|
// pub dom_tree: rctree::Node<
|
||||||
pub loaded_layouts: ResourceCache<rctree::Node<LayoutAbstractNode>>,
|
pub loaded_layouts: ResourceCache<rctree::Node<LayoutAbstractNode>>,
|
||||||
attribute_parser: AttributeParser,
|
attribute_parser: AttributeParser,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GuiLayout {
|
impl LayoutSystem {
|
||||||
pub fn new() -> GuiLayout {
|
pub fn new() -> LayoutSystem {
|
||||||
Self {
|
Self {
|
||||||
loaded_layouts: ResourceCache::new(),
|
loaded_layouts: ResourceCache::new(),
|
||||||
attribute_parser: AttributeParser::new(),
|
attribute_parser: AttributeParser::new(),
|
||||||
|
|
@ -19,7 +20,7 @@ impl GuiLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_layout(&mut self, namespace: &str, name: &str) {
|
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 xml_path = self.layout_xml_path(namespace, name);
|
||||||
let window_main = self.parse_xml_file(&xml_path[..]).unwrap();
|
let window_main = self.parse_xml_file(&xml_path[..]).unwrap();
|
||||||
|
|
||||||
|
|
@ -9,10 +9,11 @@ mod draw_command;
|
||||||
mod gui_node;
|
mod gui_node;
|
||||||
mod gui_attributes;
|
mod gui_attributes;
|
||||||
mod window_events;
|
mod window_events;
|
||||||
mod gui_layout;
|
mod layout_system;
|
||||||
mod layout_abstract_types;
|
mod layout_abstract_types;
|
||||||
mod layout_abstract_syntax;
|
mod layout_abstract_syntax;
|
||||||
mod layout_attribute_parser;
|
mod layout_attribute_parser;
|
||||||
|
mod layout_dom_node;
|
||||||
|
|
||||||
use application::Application;
|
use application::Application;
|
||||||
use winit::event_loop::EventLoop;
|
use winit::event_loop::EventLoop;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue