Compare commits
2 Commits
a-star
...
846a082f79
| Author | SHA1 | Date | |
|---|---|---|---|
| 846a082f79 | |||
| d1373fc061 |
@@ -13,7 +13,9 @@ Creation-Date: 2020-02-03T22:11:42-08:00
|
|||||||
* Kinda big meh on this. It's very much oneshot based
|
* Kinda big meh on this. It's very much oneshot based
|
||||||
and not incredibly compatible with vulkano...
|
and not incredibly compatible with vulkano...
|
||||||
[ ] Investigate lyon maybe
|
[ ] Investigate lyon maybe
|
||||||
[X] Currently using local copies of a few libraries:
|
[ ] Event system
|
||||||
|
[ ] HTML like layout scripts
|
||||||
|
[x] Currently using local copies of a few libraries:
|
||||||
[x] shade_runner ( not gonna happen, my fork has diverged too far )
|
[x] shade_runner ( not gonna happen, my fork has diverged too far )
|
||||||
[ ] Make a toolpath
|
[ ] Make a toolpath
|
||||||
[X] Read from GPU?
|
[X] Read from GPU?
|
||||||
|
|||||||
90
notes/layout-scripts.txt
Normal file
90
notes/layout-scripts.txt
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
Content-Type: text/x-zim-wiki
|
||||||
|
Wiki-Format: zim 0.4
|
||||||
|
Creation-Date: 2020-10-06T22:33:37-07:00
|
||||||
|
|
||||||
|
====== layout-scripts ======
|
||||||
|
Created Tuesday 06 October 2020
|
||||||
|
|
||||||
|
===== Keywords =====
|
||||||
|
|
||||||
|
***table will need some description of it's requested elements***
|
||||||
|
**Actually I think this could just be done in the parser. Emitting warnings if names dont match**
|
||||||
|
|
||||||
|
elem table {
|
||||||
|
}
|
||||||
|
|
||||||
|
**elem is a keyword specifying that the next token will implement some type of rendering behaviour in this case, it is a table.**
|
||||||
|
|
||||||
|
elem table : globalTableFormatting {
|
||||||
|
meta tableFormatting {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
meta globalTableFormatting : {
|
||||||
|
}
|
||||||
|
|
||||||
|
**meta is a keyword specifying that the next token will contain some subset of the data that an elem that needs to render.**
|
||||||
|
|
||||||
|
|
||||||
|
===== Nesting =====
|
||||||
|
|
||||||
|
**There is no way around a tree structure in the markup.**
|
||||||
|
|
||||||
|
elem table {
|
||||||
|
meta tableFormatting {
|
||||||
|
color: Black,
|
||||||
|
}
|
||||||
|
elem tr {
|
||||||
|
elem tc {
|
||||||
|
text: "testText1"
|
||||||
|
}
|
||||||
|
elem tc {
|
||||||
|
text: "testText2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
**But I think I can strongly type the nesting structure, e.g**
|
||||||
|
|
||||||
|
struct Table {
|
||||||
|
fn addChild(child: TableRow)
|
||||||
|
}
|
||||||
|
elem!(table, Table)
|
||||||
|
|
||||||
|
struct TableRow {
|
||||||
|
fn addChild(child: TableColumn)
|
||||||
|
}
|
||||||
|
elem!(table, TableRow)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -26,7 +26,6 @@ pub struct EventSystem;
|
|||||||
impl<'a> System<'a> for EventSystem {
|
impl<'a> System<'a> for EventSystem {
|
||||||
type SystemData = (
|
type SystemData = (
|
||||||
Entities<'a>,
|
Entities<'a>,
|
||||||
WriteStorage<'a, Position>,
|
|
||||||
WriteStorage<'a, Evented>,
|
WriteStorage<'a, Evented>,
|
||||||
Write<'a, PersistentState>,
|
Write<'a, PersistentState>,
|
||||||
Write<'a, VkProcessor>,
|
Write<'a, VkProcessor>,
|
||||||
@@ -35,21 +34,19 @@ impl<'a> System<'a> for EventSystem {
|
|||||||
|
|
||||||
fn run(&mut self, (
|
fn run(&mut self, (
|
||||||
entity,
|
entity,
|
||||||
mut position_list,
|
|
||||||
mut evented_list,
|
mut evented_list,
|
||||||
mut state,
|
mut state,
|
||||||
mut vk_processor,
|
mut vk_processor,
|
||||||
event_stack
|
event_stack
|
||||||
): Self::SystemData) {
|
): Self::SystemData) {
|
||||||
|
|
||||||
for (position, evented) in (&mut position_list, &evented_list).join() {
|
for (evented) in (&evented_list).join() {
|
||||||
for event in &*event_stack {
|
for event in &*event_stack {
|
||||||
match event {
|
match event {
|
||||||
TrEvent::WindowEvent { window_id, event } => {
|
TrEvent::WindowEvent { window_id, event } => {
|
||||||
match event {
|
match event {
|
||||||
TrWindowEvent::MouseInput { device_id, state, button, modifiers } => {
|
TrWindowEvent::MouseInput { device_id, state, button, modifiers } => {
|
||||||
if *state == ElementState::Pressed {
|
if *state == ElementState::Pressed {
|
||||||
position.x += 100.0;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ pub fn main() {
|
|||||||
compu_frame: CompuFrame::new((0, 0)),
|
compu_frame: CompuFrame::new((0, 0)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
let mut g = Graph::new();
|
let mut g = Graph::new();
|
||||||
let mut matrix : Vec<Vec<NodeIndex<u32>>> = vec![vec![NodeIndex::new(1); 20]; 20];
|
let mut matrix : Vec<Vec<NodeIndex<u32>>> = vec![vec![NodeIndex::new(1); 20]; 20];
|
||||||
|
|
||||||
@@ -176,10 +176,7 @@ pub fn main() {
|
|||||||
(c, e, 1),
|
(c, e, 1),
|
||||||
(e, f, 1),
|
(e, f, 1),
|
||||||
(d, e, 1),
|
(d, e, 1),
|
||||||
]);
|
]);*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// and the thing that renders it
|
// and the thing that renders it
|
||||||
world.create_entity()
|
world.create_entity()
|
||||||
|
|||||||
Reference in New Issue
Block a user