From 203741c1f15e3cd6318b42154c36b6247ec2bde5 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sun, 24 Nov 2024 01:15:19 +0100 Subject: [PATCH] branding --- .DS_Store | Bin 0 -> 6148 bytes README.md | 2 +- github/OSUI.svg | 90 +++++++++++++++++++++++++++++++++ github/{OSUI.png => OSUIt.png} | Bin github/OSUIw.svg | 90 +++++++++++++++++++++++++++++++++ src/lib.rs | 12 ++--- styling.md | 9 ++++ 7 files changed, 193 insertions(+), 10 deletions(-) create mode 100644 .DS_Store create mode 100644 github/OSUI.svg rename github/{OSUI.png => OSUIt.png} (100%) create mode 100644 github/OSUIw.svg create mode 100644 styling.md diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b4c51467bb0f93faeae1d267b2e19b70aefec959 GIT binary patch literal 6148 zcmeHKJxc>Y5S>kq5D`oo!Op8x5CSREpCMu+sHC*fB$5OYE@&d!-7m1x%3on;nL@1X zZ7lo)7J{X3c9&!~XDmf@26o@xeC*qMcii3*k*bbbWuhVx<;fuLo4Pdgo?r0(?8f?Wt=8zp4fyhR_t(oCmycV1y!CB- z&~e_4!WgBLGpy915j8w+Rmsi9UH;9zr-$yj=J)34$I~^;%kkEs_IVvyI-^r+dMlut z!)e6juB=||99(E_Tj#Q-qdp(g;l77-48}H{_?j=hm2PL_F89ayb$88hdvmxen3v - 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