-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
431 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
pub use crate::prelude::*; | ||
|
||
use std::path::PathBuf; | ||
use crate::gui::ui::StringField; | ||
use crate::gui::ui::{StringField, editor::{widget::Widget, settings::Settings}}; | ||
|
||
pub struct Directory { | ||
} | ||
#[derive(Default)] | ||
pub struct Directory; | ||
|
||
impl Directory { | ||
pub fn new() -> Self { | ||
Self {} | ||
Default::default() | ||
} | ||
} | ||
|
||
pub fn show(&mut self, ui: &mut egui::Ui, directory: &mut PathBuf) { | ||
StringField::new().show(ui, directory) | ||
impl Widget for Directory { | ||
type Input = PathBuf; | ||
fn show(&mut self, settings: &Settings, ui: &mut egui::Ui, directory: &mut PathBuf) { | ||
StringField::new().show(settings, ui, directory) | ||
} | ||
} |
30 changes: 17 additions & 13 deletions
30
tools/editor/src/gui/ui/layout/editor/ir/function/method.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
use crate::gui::ui::editor::settings::Settings; | ||
use crate::gui::ui::editor::widget::Widget; | ||
use crate::gui::ui::{EditableList, OptionalField}; | ||
use crate::gui::ui::editor::ir::{Attributes, Identifier, Parameter, Synchrony, Type, Visibility}; | ||
pub use crate::prelude::*; | ||
|
||
pub struct Method { | ||
|
||
} | ||
#[derive(Default)] | ||
pub struct Method; | ||
|
||
impl Method { | ||
pub fn new() -> Self { | ||
Self {} | ||
Default::default() | ||
} | ||
} | ||
|
||
pub fn show(&mut self, ui: &mut egui::Ui, method: &mut ligen_ir::Method) { | ||
impl Widget for Method { | ||
type Input = ligen_ir::Method; | ||
fn show(&mut self, settings: &Settings, ui: &mut egui::Ui, method: &mut ligen_ir::Method) { | ||
ui.horizontal_top(|ui| { | ||
Visibility::new().show(ui, &mut method.visibility); | ||
Synchrony::new().show(ui, &mut method.synchrony); | ||
Identifier::new().show(ui, &mut method.identifier); | ||
EditableList::new("Inputs", "Add input").show(ui, &mut method.inputs, |ui, parameter| { | ||
Parameter::new().show(ui, parameter); | ||
Visibility::new().show(settings, ui, &mut method.visibility); | ||
Synchrony::new().show(settings, ui, &mut method.synchrony); | ||
Identifier::new().show(settings, ui, &mut method.identifier); | ||
EditableList::new("Inputs", "Add input").show(settings, ui, &mut method.inputs, |ui, parameter| { | ||
Parameter::new().show(settings, ui, parameter); | ||
}); | ||
OptionalField::new("Output").show(ui, &mut method.output, |ui, output| { | ||
Type::new().show(ui, output); | ||
OptionalField::new("Output").show(settings, ui, &mut method.output, |ui, output| { | ||
Type::new().show(settings, ui, output); | ||
}); | ||
Attributes::new().show(ui, &mut method.attributes); | ||
Attributes::new().show(settings, ui, &mut method.attributes); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 11 additions & 9 deletions
20
tools/editor/src/gui/ui/layout/editor/ir/function/parameter.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
pub use crate::prelude::*; | ||
|
||
use crate::gui::ui::editor::ir::{Attributes, Identifier, Type}; | ||
use crate::gui::ui::editor::{ir::{Attributes, Identifier, Type}, widget::Widget, settings::Settings}; | ||
|
||
pub struct Parameter { | ||
|
||
} | ||
#[derive(Default)] | ||
pub struct Parameter; | ||
|
||
impl Parameter { | ||
pub fn new() -> Self { | ||
Self {} | ||
Default::default() | ||
} | ||
} | ||
|
||
pub fn show(&mut self, ui: &mut egui::Ui, parameter: &mut ligen_ir::Parameter) { | ||
impl Widget for Parameter { | ||
type Input = ligen_ir::Parameter; | ||
fn show(&mut self, settings: &Settings, ui: &mut egui::Ui, parameter: &mut ligen_ir::Parameter) { | ||
ui.horizontal_top(|ui| { | ||
Type::new().show(ui, &mut parameter.type_); | ||
Identifier::new().show(ui, &mut parameter.identifier); | ||
Attributes::new().show(ui, &mut parameter.attributes); | ||
Type::new().show(settings, ui, &mut parameter.type_); | ||
Identifier::new().show(settings, ui, &mut parameter.identifier); | ||
Attributes::new().show(settings, ui, &mut parameter.attributes); | ||
}); | ||
} | ||
} |
15 changes: 9 additions & 6 deletions
15
tools/editor/src/gui/ui/layout/editor/ir/function/synchrony.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
pub use crate::prelude::*; | ||
|
||
use crate::gui::ui::EnumField; | ||
use crate::gui::ui::{EnumField, editor::{widget::Widget, settings::Settings}}; | ||
|
||
pub struct Synchrony { | ||
} | ||
#[derive(Default)] | ||
pub struct Synchrony; | ||
|
||
impl Synchrony { | ||
pub fn new() -> Self { | ||
Self {} | ||
Default::default() | ||
} | ||
} | ||
|
||
pub fn show(&mut self, ui: &mut egui::Ui, synchrony: &mut ligen_ir::Synchrony) { | ||
EnumField::new().id_source("synchrony").show(ui, synchrony); | ||
impl Widget for Synchrony { | ||
type Input = ligen_ir::Synchrony; | ||
fn show(&mut self, settings: &Settings, ui: &mut egui::Ui, synchrony: &mut ligen_ir::Synchrony) { | ||
EnumField::new().id_source("synchrony").show(settings, ui, synchrony); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
use crate::gui::ui::editor::settings::Settings; | ||
use crate::gui::ui::editor::widget::Widget; | ||
pub use crate::prelude::*; | ||
|
||
use crate::gui::ui::editor::ir::{Attributes, Identifier, Path, Visibility}; | ||
use crate::gui::ui::OptionalField; | ||
|
||
pub struct Import {} | ||
#[derive(Default)] | ||
pub struct Import; | ||
|
||
impl Import { | ||
pub fn new() -> Self { | ||
Self {} | ||
Default::default() | ||
} | ||
} | ||
|
||
pub fn show(&mut self, ui: &mut egui::Ui, import: &mut ligen_ir::Import) { | ||
ui.horizontal_top(|ui| { | ||
Visibility::new().show(ui, &mut import.visibility); | ||
Path::new().show(ui, &mut import.path); | ||
OptionalField::new("as").show(ui, &mut import.renaming, |ui, renaming| { | ||
Identifier::new().show(ui, renaming); | ||
}); | ||
Attributes::new().show(ui, &mut import.attributes); | ||
impl Widget for Import { | ||
type Input = ligen_ir::Import; | ||
fn show(&mut self, settings: &Settings, ui: &mut egui::Ui, import: &mut ligen_ir::Import) { | ||
ui.horizontal_top(|ui| { | ||
Visibility::new().show(settings, ui, &mut import.visibility); | ||
Path::new().show(settings, ui, &mut import.path); | ||
OptionalField::new("as").show(settings, ui, &mut import.renaming, |ui, renaming| { | ||
Identifier::new().show(settings, ui, renaming); | ||
}); | ||
Attributes::new().show(settings, ui, &mut import.attributes); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
use crate::{prelude::*, gui::ui::EditableList}; | ||
use crate::{prelude::*, gui::ui::{EditableList, editor::{widget::Widget, settings::Settings}}}; | ||
|
||
use super::{Attributes, Method, Function, Object, Path, Identifier, Visibility}; | ||
|
||
#[derive(Default)] | ||
pub struct Interface { | ||
editable: bool | ||
} | ||
pub struct Interface; | ||
|
||
impl Interface { | ||
pub fn new() -> Self { | ||
Default::default() | ||
} | ||
} | ||
|
||
pub fn editable(&mut self, editable: bool) -> &mut Self { | ||
self.editable = editable; | ||
self | ||
} | ||
|
||
pub fn show(&mut self, ui: &mut egui::Ui, interface: &mut ligen_ir::Interface) { | ||
impl Widget for Interface { | ||
type Input = ligen_ir::Interface; | ||
fn show(&mut self, settings: &Settings, ui: &mut egui::Ui, interface: &mut ligen_ir::Interface) { | ||
ui.vertical(|ui| { | ||
ui.horizontal_top(|ui| { | ||
Visibility::new().show(ui, &mut interface.visibility); | ||
Identifier::new().show(ui, &mut interface.identifier); | ||
Visibility::new().show(settings, ui, &mut interface.visibility); | ||
Identifier::new().show(settings, ui, &mut interface.identifier); | ||
}); | ||
EditableList::new(format!("Objects - Symbols: {}", interface.objects.len()), "Add object").show(ui, &mut interface.objects, |ui, object| { | ||
Object::new().show(ui, object); | ||
EditableList::new(format!("Objects - Symbols: {}", interface.objects.len()), "Add object").show(settings, ui, &mut interface.objects, |ui, object| { | ||
Object::new().show(settings, ui, object); | ||
}); | ||
EditableList::new(format!("Functions - Symbols: {}", interface.functions.len()), "Add function").show(ui, &mut interface.functions, |ui, function| { | ||
Function::new().show(ui, function); | ||
EditableList::new(format!("Functions - Symbols: {}", interface.functions.len()), "Add function").show(settings, ui, &mut interface.functions, |ui, function| { | ||
Function::new().show(settings, ui, function); | ||
}); | ||
EditableList::new(format!("Methods - Symbols: {}", interface.methods.len()), "Add method").show(ui, &mut interface.methods, |ui, function| { | ||
Method::new().show(ui, function); | ||
EditableList::new(format!("Methods - Symbols: {}", interface.methods.len()), "Add method").show(settings, ui, &mut interface.methods, |ui, function| { | ||
Method::new().show(settings, ui, function); | ||
}); | ||
EditableList::new("Interfaces", "Add interface").show(ui, &mut interface.interfaces, |ui, interface| { | ||
Path::new().show(ui, interface); | ||
EditableList::new("Interfaces", "Add interface").show(settings, ui, &mut interface.interfaces, |ui, interface| { | ||
Path::new().show(settings, ui, interface); | ||
}); | ||
Attributes::new().show(ui, &mut interface.attributes); | ||
Attributes::new().show(settings, ui, &mut interface.attributes); | ||
}); | ||
} | ||
} |
Oops, something went wrong.