From f69d05deb717a254736b69e43ed929e508d38660 Mon Sep 17 00:00:00 2001 From: Able Date: Sat, 15 Jan 2022 08:45:29 -0600 Subject: [PATCH] minimal protocol for y --- .gitignore | 2 ++ Cargo.toml | 8 ++++++++ src/lib.rs | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 src/lib.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96ef6c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b7d541e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "y-compositor-protocol" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..da447c6 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,35 @@ +pub struct WindowOption { + funct: WindowFunction, + symbol: char, +} + +pub type WindowBar = Vec; + +pub type WindowID = u64; + +pub struct Window { + bar: WindowBar, +} + +// TODO: Seperate out this versioning into ableos-ver +#[repr(C)] +pub struct Version { + pub major: u8, + pub minor: u8, + pub patch: u8, +} + +pub type WindowFunction = fn() -> (); + +pub enum Protocol { + Version(Version), + + WindowCreate(Window), + WindowClose(WindowID), + + ReturnWindowID(WindowID), + // WindowAccess(WindowID), +} + +#[test] +fn test_version() {}