diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b4c5146 Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md index efbfe8f..4c90589 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- OSUI + OSUI

diff --git a/github/OSUI.svg b/github/OSUI.svg new file mode 100644 index 0000000..9339c50 --- /dev/null +++ b/github/OSUI.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/github/OSUI.png b/github/OSUIt.png similarity index 100% rename from github/OSUI.png rename to github/OSUIt.png diff --git a/github/OSUIw.svg b/github/OSUIw.svg new file mode 100644 index 0000000..79a536b --- /dev/null +++ b/github/OSUIw.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib.rs b/src/lib.rs index 51926fc..38bd8b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -228,7 +228,7 @@ pub enum Command { pub enum CommandResult { Element(*mut Element), - None + None, } pub struct Document { @@ -241,12 +241,7 @@ impl Document { self.cmd_sender.send(Command::Exit).unwrap(); } pub fn get_element_by_id(&self, id: &str) -> Option<&mut Box> { - self.cmd_sender - .send(Command::GetElementById(id.to_string())) - .unwrap(); - let rx = - unsafe { &*(self.cmd_recv as *const std::sync::mpsc::Receiver) }; - if let Ok(CommandResult::Element(e)) = rx.recv() { + if let Some(e) = self.get_element_by_id_raw(id) { Some(convert(unsafe { &mut *e })) } else { None @@ -256,8 +251,7 @@ impl Document { self.cmd_sender .send(Command::GetElementById(id.to_string())) .unwrap(); - let rx = - unsafe { &*(self.cmd_recv as *const std::sync::mpsc::Receiver) }; + let rx = unsafe { &*(self.cmd_recv as *const std::sync::mpsc::Receiver) }; if let Ok(CommandResult::Element(e)) = rx.recv() { Some(e) } else { diff --git a/styling.md b/styling.md new file mode 100644 index 0000000..be2752c --- /dev/null +++ b/styling.md @@ -0,0 +1,9 @@ +`color`, `background`: `$color{}\x1b[0m`; + +`font`: `$font{}\x1b[0m`; + +`width`, `height`: `n`, `n%`, `auto`; + +`x`, `y`: `n`, `n%`, `center`, `auto`; + +`display`: `row`, `column`, `overlap`; \ No newline at end of file