Make snowcap a workspace member

This commit is contained in:
Ottatop 2024-12-15 23:36:30 -06:00
parent 83f968c3c9
commit be18f9f884
17 changed files with 426 additions and 5248 deletions

368
Cargo.lock generated
View file

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "ab_glyph"
@ -284,34 +284,6 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]]
name = "axum"
version = "0.6.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf"
dependencies = [
"async-trait",
"axum-core 0.3.4",
"bitflags 1.3.2",
"bytes",
"futures-util",
"http 0.2.12",
"http-body 0.4.6",
"hyper 0.14.30",
"itoa",
"matchit",
"memchr",
"mime",
"percent-encoding",
"pin-project-lite",
"rustversion",
"serde",
"sync_wrapper 0.1.2",
"tower",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum"
version = "0.7.5"
@ -319,11 +291,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf"
dependencies = [
"async-trait",
"axum-core 0.4.3",
"axum-core",
"bytes",
"futures-util",
"http 1.1.0",
"http-body 1.0.1",
"http",
"http-body",
"http-body-util",
"itoa",
"matchit",
@ -339,23 +311,6 @@ dependencies = [
"tower-service",
]
[[package]]
name = "axum-core"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http 0.2.12",
"http-body 0.4.6",
"mime",
"rustversion",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum-core"
version = "0.4.3"
@ -365,8 +320,8 @@ dependencies = [
"async-trait",
"bytes",
"futures-util",
"http 1.1.0",
"http-body 1.0.1",
"http",
"http-body",
"http-body-util",
"mime",
"pin-project-lite",
@ -391,12 +346,6 @@ dependencies = [
"rustc-demangle",
]
[[package]]
name = "base64"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "base64"
version = "0.22.1"
@ -1709,25 +1658,6 @@ dependencies = [
"svg_fmt",
]
[[package]]
name = "h2"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
dependencies = [
"bytes",
"fnv",
"futures-core",
"futures-sink",
"futures-util",
"http 0.2.12",
"indexmap 2.2.6",
"slab",
"tokio",
"tokio-util",
"tracing",
]
[[package]]
name = "h2"
version = "0.4.5"
@ -1739,7 +1669,7 @@ dependencies = [
"fnv",
"futures-core",
"futures-sink",
"http 1.1.0",
"http",
"indexmap 2.2.6",
"slab",
"tokio",
@ -1812,17 +1742,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
[[package]]
name = "http"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]]
name = "http"
version = "1.1.0"
@ -1834,17 +1753,6 @@ dependencies = [
"itoa",
]
[[package]]
name = "http-body"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
dependencies = [
"bytes",
"http 0.2.12",
"pin-project-lite",
]
[[package]]
name = "http-body"
version = "1.0.1"
@ -1852,7 +1760,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
dependencies = [
"bytes",
"http 1.1.0",
"http",
]
[[package]]
@ -1863,8 +1771,8 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f"
dependencies = [
"bytes",
"futures-util",
"http 1.1.0",
"http-body 1.0.1",
"http",
"http-body",
"pin-project-lite",
]
@ -1880,30 +1788,6 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hyper"
version = "0.14.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9"
dependencies = [
"bytes",
"futures-channel",
"futures-core",
"futures-util",
"h2 0.3.26",
"http 0.2.12",
"http-body 0.4.6",
"httparse",
"httpdate",
"itoa",
"pin-project-lite",
"socket2",
"tokio",
"tower-service",
"tracing",
"want",
]
[[package]]
name = "hyper"
version = "1.4.1"
@ -1913,9 +1797,9 @@ dependencies = [
"bytes",
"futures-channel",
"futures-util",
"h2 0.4.5",
"http 1.1.0",
"http-body 1.0.1",
"h2",
"http",
"http-body",
"httparse",
"httpdate",
"itoa",
@ -1925,25 +1809,13 @@ dependencies = [
"want",
]
[[package]]
name = "hyper-timeout"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
dependencies = [
"hyper 0.14.30",
"pin-project-lite",
"tokio",
"tokio-io-timeout",
]
[[package]]
name = "hyper-timeout"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793"
dependencies = [
"hyper 1.4.1",
"hyper",
"hyper-util",
"pin-project-lite",
"tokio",
@ -1959,9 +1831,9 @@ dependencies = [
"bytes",
"futures-channel",
"futures-util",
"http 1.1.0",
"http-body 1.0.1",
"hyper 1.4.1",
"http",
"http-body",
"hyper",
"pin-project-lite",
"socket2",
"tokio",
@ -2390,7 +2262,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d"
dependencies = [
"cfg-if",
"windows-targets 0.48.5",
"windows-targets 0.52.6",
]
[[package]]
@ -2492,9 +2364,9 @@ name = "lua-build"
version = "0.1.0"
dependencies = [
"indexmap 2.2.6",
"prost 0.12.6",
"prost-build 0.12.6",
"prost-types 0.12.6",
"prost",
"prost-build",
"prost-types",
"walkdir",
]
@ -3276,7 +3148,7 @@ dependencies = [
"pinnacle",
"pinnacle-api",
"pinnacle-api-defs",
"prost 0.13.1",
"prost",
"serde",
"shellexpand",
"smithay",
@ -3291,8 +3163,8 @@ dependencies = [
"tokio",
"tokio-stream",
"toml",
"tonic 0.12.0",
"tonic-reflection 0.12.0",
"tonic",
"tonic-reflection",
"tracing",
"tracing-appender",
"tracing-subscriber",
@ -3318,7 +3190,7 @@ dependencies = [
"snowcap-api",
"tokio",
"tokio-stream",
"tonic 0.12.0",
"tonic",
"tower",
"tracing",
"tracing-subscriber",
@ -3330,9 +3202,9 @@ name = "pinnacle-api-defs"
version = "0.0.1"
dependencies = [
"const_format",
"prost 0.13.1",
"tonic 0.12.0",
"tonic-build 0.12.0",
"prost",
"tonic",
"tonic-build",
]
[[package]]
@ -3475,31 +3347,20 @@ dependencies = [
[[package]]
name = "prost"
version = "0.12.6"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29"
checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec"
dependencies = [
"bytes",
"prost-derive 0.12.6",
]
[[package]]
name = "prost"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc"
dependencies = [
"bytes",
"prost-derive 0.13.1",
"prost-derive",
]
[[package]]
name = "prost-build"
version = "0.12.6"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4"
checksum = "d0f3e5beed80eb580c68e2c600937ac2c4eedabdfd5ef1e5b7ea4f3fba84497b"
dependencies = [
"bytes",
"heck",
"itertools",
"log",
@ -3507,29 +3368,8 @@ dependencies = [
"once_cell",
"petgraph",
"prettyplease",
"prost 0.12.6",
"prost-types 0.12.6",
"regex",
"syn 2.0.71",
"tempfile",
]
[[package]]
name = "prost-build"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1"
dependencies = [
"bytes",
"heck",
"itertools",
"log",
"multimap",
"once_cell",
"petgraph",
"prettyplease",
"prost 0.13.1",
"prost-types 0.13.1",
"prost",
"prost-types",
"regex",
"syn 2.0.71",
"tempfile",
@ -3537,22 +3377,9 @@ dependencies = [
[[package]]
name = "prost-derive"
version = "0.12.6"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1"
dependencies = [
"anyhow",
"itertools",
"proc-macro2",
"quote",
"syn 2.0.71",
]
[[package]]
name = "prost-derive"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca"
checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3"
dependencies = [
"anyhow",
"itertools",
@ -3563,20 +3390,11 @@ dependencies = [
[[package]]
name = "prost-types"
version = "0.12.6"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0"
checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc"
dependencies = [
"prost 0.12.6",
]
[[package]]
name = "prost-types"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2"
dependencies = [
"prost 0.13.1",
"prost",
]
[[package]]
@ -4160,19 +3978,19 @@ dependencies = [
"iced_futures",
"iced_runtime",
"iced_wgpu",
"prost 0.12.6",
"prost",
"raw-window-handle",
"smithay-client-toolkit 0.19.2",
"smithay-clipboard",
"snowcap-api-defs",
"tokio",
"tokio-stream",
"tonic 0.11.0",
"tonic-reflection 0.11.0",
"tonic",
"tonic-reflection",
"tracing",
"tracing-subscriber",
"xdg",
"xkbcommon 0.7.0",
"xkbcommon 0.8.0",
]
[[package]]
@ -4181,24 +3999,25 @@ version = "0.1.0"
dependencies = [
"from_variants",
"futures",
"hyper-util",
"snowcap-api-defs",
"thiserror",
"tokio",
"tokio-stream",
"tonic 0.11.0",
"tonic",
"tower",
"tracing",
"xdg",
"xkbcommon 0.7.0",
"xkbcommon 0.8.0",
]
[[package]]
name = "snowcap-api-defs"
version = "0.1.0"
dependencies = [
"prost 0.12.6",
"tonic 0.11.0",
"tonic-build 0.11.0",
"prost",
"tonic",
"tonic-build",
"walkdir",
]
@ -4563,16 +4382,6 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "tokio-io-timeout"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf"
dependencies = [
"pin-project-lite",
"tokio",
]
[[package]]
name = "tokio-macros"
version = "2.3.0"
@ -4653,33 +4462,6 @@ dependencies = [
"winnow 0.6.13",
]
[[package]]
name = "tonic"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13"
dependencies = [
"async-stream",
"async-trait",
"axum 0.6.20",
"base64 0.21.7",
"bytes",
"h2 0.3.26",
"http 0.2.12",
"http-body 0.4.6",
"hyper 0.14.30",
"hyper-timeout 0.4.1",
"percent-encoding",
"pin-project",
"prost 0.12.6",
"tokio",
"tokio-stream",
"tower",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tonic"
version = "0.12.0"
@ -4688,19 +4470,19 @@ checksum = "f738b6a169a29bca4e39656db89c44a08e09c5b700b896ee9e7459f0652e81dd"
dependencies = [
"async-stream",
"async-trait",
"axum 0.7.5",
"base64 0.22.1",
"axum",
"base64",
"bytes",
"h2 0.4.5",
"http 1.1.0",
"http-body 1.0.1",
"h2",
"http",
"http-body",
"http-body-util",
"hyper 1.4.1",
"hyper-timeout 0.5.1",
"hyper",
"hyper-timeout",
"hyper-util",
"percent-encoding",
"pin-project",
"prost 0.13.1",
"prost",
"socket2",
"tokio",
"tokio-stream",
@ -4710,19 +4492,6 @@ dependencies = [
"tracing",
]
[[package]]
name = "tonic-build"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2"
dependencies = [
"prettyplease",
"proc-macro2",
"prost-build 0.12.6",
"quote",
"syn 2.0.71",
]
[[package]]
name = "tonic-build"
version = "0.12.0"
@ -4731,35 +4500,22 @@ checksum = "690943cc223adcdd67bb597a2e573ead1b88e999ba37528fe8e6356bf44b29b6"
dependencies = [
"prettyplease",
"proc-macro2",
"prost-build 0.13.1",
"prost-build",
"quote",
"syn 2.0.71",
]
[[package]]
name = "tonic-reflection"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "548c227bd5c0fae5925812c4ec6c66ffcfced23ea370cb823f4d18f0fc1cb6a7"
dependencies = [
"prost 0.12.6",
"prost-types 0.12.6",
"tokio",
"tokio-stream",
"tonic 0.11.0",
]
[[package]]
name = "tonic-reflection"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87e0d3c6688e3b0be22d877b9c6ba86a7c5409e6b505ec8f7c99f026ae09530a"
dependencies = [
"prost 0.13.1",
"prost-types 0.13.1",
"prost",
"prost-types",
"tokio",
"tokio-stream",
"tonic 0.12.0",
"tonic",
]
[[package]]

View file

@ -4,10 +4,13 @@ members = [
"api/rust",
"api/rust/pinnacle-api-macros",
"wlcs_pinnacle",
"api/lua/build"
"api/lua/build",
# snowcap
"snowcap",
"snowcap/api/rust",
"snowcap/snowcap-api-defs",
]
exclude = [
"snowcap", # Submodule
"lcat", # The docs building repo is currently cloned into this repo in CI
]
@ -38,6 +41,9 @@ clap = { version = "4.5.7", features = ["derive"] }
dircpy = "0.3.16"
tempfile = "3.10.1"
indexmap = "2.2.6"
anyhow = { version = "1.0.86", features = ["backtrace"] }
snowcap-api-defs = { path = "./snowcap/snowcap-api-defs" }
hyper-util = { version = "0.1.6", features = ["tokio"] }
[workspace.dependencies.smithay]
git = "https://github.com/Smithay/smithay"
@ -96,7 +102,7 @@ tracing = { workspace = true }
tracing-subscriber = { workspace = true }
tracing-appender = "0.2.3"
# Errors
anyhow = { version = "1.0.86", features = ["backtrace"] }
anyhow = { workspace = true }
thiserror = "1.0.61"
# xcursor stuff
xcursor = { version = "0.3.5" }

View file

@ -4,10 +4,8 @@ version = "0.1.0"
edition = "2021"
[dependencies]
prost = "0.12.6"
prost-types = "0.12.6"
prost = { workspace = true }
prost-types = "0.13.4"
indexmap = "2.2.6"
[build-dependencies]
prost-build = "0.12.6"
walkdir = "2.5.0"
prost-build = "0.13.4"

View file

@ -1,23 +0,0 @@
use std::path::PathBuf;
fn main() {
println!("cargo:rerun-if-changed=../../protocol");
let mut proto_paths = Vec::new();
for entry in walkdir::WalkDir::new("../../protocol") {
let entry = entry.unwrap();
if entry.file_type().is_file() && entry.path().extension().is_some_and(|ext| ext == "proto")
{
proto_paths.push(entry.into_path());
}
}
let descriptor_path = PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("lua-build.bin");
prost_build::Config::new()
.file_descriptor_set_path(descriptor_path)
.compile_protos(&proto_paths, &["../../protocol"])
.unwrap();
}

View file

@ -1,7 +1,6 @@
use std::collections::HashMap;
use indexmap::{IndexMap, IndexSet};
use prost::Message as _;
use prost_types::{
field_descriptor_proto::{Label, Type},
DescriptorProto, EnumDescriptorProto, FieldDescriptorProto, ServiceDescriptorProto,
@ -297,9 +296,25 @@ fn generate_returned_table(msgs: &MessageMap) -> String {
}
fn main() {
let file_descriptor_set_bytes = include_bytes!(concat!(env!("OUT_DIR"), "/lua-build.bin"));
let file_descriptor_set =
prost_types::FileDescriptorSet::decode(&file_descriptor_set_bytes[..]).unwrap();
let Some(proto_dir) = std::env::args().nth(1) else {
eprintln!("Usage: ./lua-build <proto-dir>");
return;
};
let mut proto_paths = Vec::new();
for entry in walkdir::WalkDir::new(&proto_dir) {
let entry = entry.unwrap();
if entry.file_type().is_file() && entry.path().extension().is_some_and(|ext| ext == "proto")
{
proto_paths.push(entry.into_path());
}
}
let file_descriptor_set = prost_build::Config::new()
.load_fds(&proto_paths, &[proto_dir])
.unwrap();
let mut enums = EnumMap::new();
let mut msgs = MessageMap::new();

View file

@ -1,10 +1,35 @@
---@lcat nodoc
---@enum pinnacle.signal.v0alpha1.StreamControl
local pinnacle_signal_v0alpha1_StreamControl = {
STREAM_CONTROL_UNSPECIFIED = 0,
STREAM_CONTROL_READY = 1,
STREAM_CONTROL_DISCONNECT = 2,
---@enum pinnacle.v0alpha1.SetOrToggle
local pinnacle_v0alpha1_SetOrToggle = {
SET_OR_TOGGLE_UNSPECIFIED = 0,
SET_OR_TOGGLE_SET = 1,
SET_OR_TOGGLE_UNSET = 2,
SET_OR_TOGGLE_TOGGLE = 3,
}
---@enum pinnacle.v0alpha1.Backend
local pinnacle_v0alpha1_Backend = {
BACKEND_UNSPECIFIED = 0,
BACKEND_WINDOW = 1,
BACKEND_TTY = 2,
}
---@enum pinnacle.window.v0alpha1.FullscreenOrMaximized
local pinnacle_window_v0alpha1_FullscreenOrMaximized = {
FULLSCREEN_OR_MAXIMIZED_UNSPECIFIED = 0,
FULLSCREEN_OR_MAXIMIZED_NEITHER = 1,
FULLSCREEN_OR_MAXIMIZED_FULLSCREEN = 2,
FULLSCREEN_OR_MAXIMIZED_MAXIMIZED = 3,
}
---@enum pinnacle.window.v0alpha1.WindowState
local pinnacle_window_v0alpha1_WindowState = {
WINDOW_STATE_UNSPECIFIED = 0,
WINDOW_STATE_TILED = 1,
WINDOW_STATE_FLOATING = 2,
WINDOW_STATE_FULLSCREEN = 3,
WINDOW_STATE_MAXIMIZED = 4,
}
---@enum pinnacle.input.v0alpha1.Modifier
@ -53,45 +78,6 @@ local pinnacle_input_v0alpha1_SetLibinputSettingRequest_TapButtonMap = {
TAP_BUTTON_MAP_LEFT_MIDDLE_RIGHT = 2,
}
---@enum pinnacle.v0alpha1.SetOrToggle
local pinnacle_v0alpha1_SetOrToggle = {
SET_OR_TOGGLE_UNSPECIFIED = 0,
SET_OR_TOGGLE_SET = 1,
SET_OR_TOGGLE_UNSET = 2,
SET_OR_TOGGLE_TOGGLE = 3,
}
---@enum pinnacle.v0alpha1.Backend
local pinnacle_v0alpha1_Backend = {
BACKEND_UNSPECIFIED = 0,
BACKEND_WINDOW = 1,
BACKEND_TTY = 2,
}
---@enum pinnacle.window.v0alpha1.FullscreenOrMaximized
local pinnacle_window_v0alpha1_FullscreenOrMaximized = {
FULLSCREEN_OR_MAXIMIZED_UNSPECIFIED = 0,
FULLSCREEN_OR_MAXIMIZED_NEITHER = 1,
FULLSCREEN_OR_MAXIMIZED_FULLSCREEN = 2,
FULLSCREEN_OR_MAXIMIZED_MAXIMIZED = 3,
}
---@enum pinnacle.window.v0alpha1.WindowState
local pinnacle_window_v0alpha1_WindowState = {
WINDOW_STATE_UNSPECIFIED = 0,
WINDOW_STATE_TILED = 1,
WINDOW_STATE_FLOATING = 2,
WINDOW_STATE_FULLSCREEN = 3,
WINDOW_STATE_MAXIMIZED = 4,
}
---@enum pinnacle.render.v0alpha1.Filter
local pinnacle_render_v0alpha1_Filter = {
FILTER_UNSPECIFIED = 0,
FILTER_BILINEAR = 1,
FILTER_NEAREST_NEIGHBOR = 2,
}
---@enum pinnacle.output.v0alpha1.Transform
local pinnacle_output_v0alpha1_Transform = {
TRANSFORM_UNSPECIFIED = 0,
@ -105,120 +91,23 @@ local pinnacle_output_v0alpha1_Transform = {
TRANSFORM_FLIPPED_270 = 8,
}
---@enum pinnacle.render.v0alpha1.Filter
local pinnacle_render_v0alpha1_Filter = {
FILTER_UNSPECIFIED = 0,
FILTER_BILINEAR = 1,
FILTER_NEAREST_NEIGHBOR = 2,
}
---@enum pinnacle.signal.v0alpha1.StreamControl
local pinnacle_signal_v0alpha1_StreamControl = {
STREAM_CONTROL_UNSPECIFIED = 0,
STREAM_CONTROL_READY = 1,
STREAM_CONTROL_DISCONNECT = 2,
}
---@class google.protobuf.Empty
---@class pinnacle.signal.v0alpha1.OutputConnectRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.OutputConnectResponse
---@field output_name string?
---@class pinnacle.signal.v0alpha1.OutputDisconnectRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.OutputDisconnectResponse
---@field output_name string?
---@class pinnacle.signal.v0alpha1.OutputResizeRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.OutputResizeResponse
---@field output_name string?
---@field logical_width integer?
---@field logical_height integer?
---@class pinnacle.signal.v0alpha1.OutputMoveRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.OutputMoveResponse
---@field output_name string?
---@field x integer?
---@field y integer?
---@class pinnacle.signal.v0alpha1.WindowPointerEnterRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.WindowPointerEnterResponse
---@field window_id integer?
---@class pinnacle.signal.v0alpha1.WindowPointerLeaveRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.WindowPointerLeaveResponse
---@field window_id integer?
---@class pinnacle.signal.v0alpha1.TagActiveRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.TagActiveResponse
---@field tag_id integer?
---@field active boolean?
---@class pinnacle.input.v0alpha1.SetKeybindRequest
---@field modifiers pinnacle.input.v0alpha1.Modifier[]?
---@field raw_code integer?
---@field xkb_name string?
---@field group string?
---@field description string?
---@class pinnacle.input.v0alpha1.SetKeybindResponse
---@class pinnacle.input.v0alpha1.KeybindDescriptionsRequest
---@class pinnacle.input.v0alpha1.KeybindDescriptionsResponse
---@field descriptions pinnacle.input.v0alpha1.KeybindDescription[]?
---@class pinnacle.input.v0alpha1.KeybindDescription
---@field modifiers pinnacle.input.v0alpha1.Modifier[]?
---@field raw_code integer?
---@field xkb_name string?
---@field group string?
---@field description string?
---@class pinnacle.input.v0alpha1.SetMousebindRequest
---@field modifiers pinnacle.input.v0alpha1.Modifier[]?
---@field button integer?
---@field edge pinnacle.input.v0alpha1.SetMousebindRequest.MouseEdge?
---@class pinnacle.input.v0alpha1.SetMousebindResponse
---@class pinnacle.input.v0alpha1.SetXkbConfigRequest
---@field rules string?
---@field variant string?
---@field layout string?
---@field model string?
---@field options string?
---@class pinnacle.input.v0alpha1.SetRepeatRateRequest
---@field rate integer?
---@field delay integer?
---@class pinnacle.input.v0alpha1.SetLibinputSettingRequest
---@field accel_profile pinnacle.input.v0alpha1.SetLibinputSettingRequest.AccelProfile?
---@field accel_speed number?
---@field calibration_matrix pinnacle.input.v0alpha1.SetLibinputSettingRequest.CalibrationMatrix?
---@field click_method pinnacle.input.v0alpha1.SetLibinputSettingRequest.ClickMethod?
---@field disable_while_typing boolean?
---@field left_handed boolean?
---@field middle_emulation boolean?
---@field rotation_angle integer?
---@field scroll_button integer?
---@field scroll_button_lock boolean?
---@field scroll_method pinnacle.input.v0alpha1.SetLibinputSettingRequest.ScrollMethod?
---@field natural_scroll boolean?
---@field tap_button_map pinnacle.input.v0alpha1.SetLibinputSettingRequest.TapButtonMap?
---@field tap_drag boolean?
---@field tap_drag_lock boolean?
---@field tap boolean?
---@class pinnacle.input.v0alpha1.SetLibinputSettingRequest.CalibrationMatrix
---@field matrix number[]?
---@class pinnacle.input.v0alpha1.SetXcursorRequest
---@field theme string?
---@field size integer?
---@class pinnacle.v0alpha1.Geometry
---@field x integer?
---@field y integer?
@ -295,21 +184,6 @@ local pinnacle_output_v0alpha1_Transform = {
---@field output_name string?
---@field window_ids integer[]?
---@class pinnacle.process.v0alpha1.SpawnRequest
---@field args string[]?
---@field once boolean?
---@field has_callback boolean?
---@class pinnacle.process.v0alpha1.SpawnResponse
---@field stdout string?
---@field stderr string?
---@field exit_code integer?
---@field exit_message string?
---@class pinnacle.process.v0alpha1.SetEnvRequest
---@field key string?
---@field value string?
---@class pinnacle.window.v0alpha1.CloseRequest
---@field window_id integer?
@ -392,11 +266,69 @@ local pinnacle_output_v0alpha1_Transform = {
---@field ssd boolean?
---@field state pinnacle.window.v0alpha1.WindowState?
---@class pinnacle.render.v0alpha1.SetUpscaleFilterRequest
---@field filter pinnacle.render.v0alpha1.Filter?
---@class pinnacle.input.v0alpha1.SetKeybindRequest
---@field modifiers pinnacle.input.v0alpha1.Modifier[]?
---@field raw_code integer?
---@field xkb_name string?
---@field group string?
---@field description string?
---@class pinnacle.render.v0alpha1.SetDownscaleFilterRequest
---@field filter pinnacle.render.v0alpha1.Filter?
---@class pinnacle.input.v0alpha1.SetKeybindResponse
---@class pinnacle.input.v0alpha1.KeybindDescriptionsRequest
---@class pinnacle.input.v0alpha1.KeybindDescriptionsResponse
---@field descriptions pinnacle.input.v0alpha1.KeybindDescription[]?
---@class pinnacle.input.v0alpha1.KeybindDescription
---@field modifiers pinnacle.input.v0alpha1.Modifier[]?
---@field raw_code integer?
---@field xkb_name string?
---@field group string?
---@field description string?
---@class pinnacle.input.v0alpha1.SetMousebindRequest
---@field modifiers pinnacle.input.v0alpha1.Modifier[]?
---@field button integer?
---@field edge pinnacle.input.v0alpha1.SetMousebindRequest.MouseEdge?
---@class pinnacle.input.v0alpha1.SetMousebindResponse
---@class pinnacle.input.v0alpha1.SetXkbConfigRequest
---@field rules string?
---@field variant string?
---@field layout string?
---@field model string?
---@field options string?
---@class pinnacle.input.v0alpha1.SetRepeatRateRequest
---@field rate integer?
---@field delay integer?
---@class pinnacle.input.v0alpha1.SetLibinputSettingRequest
---@field accel_profile pinnacle.input.v0alpha1.SetLibinputSettingRequest.AccelProfile?
---@field accel_speed number?
---@field calibration_matrix pinnacle.input.v0alpha1.SetLibinputSettingRequest.CalibrationMatrix?
---@field click_method pinnacle.input.v0alpha1.SetLibinputSettingRequest.ClickMethod?
---@field disable_while_typing boolean?
---@field left_handed boolean?
---@field middle_emulation boolean?
---@field rotation_angle integer?
---@field scroll_button integer?
---@field scroll_button_lock boolean?
---@field scroll_method pinnacle.input.v0alpha1.SetLibinputSettingRequest.ScrollMethod?
---@field natural_scroll boolean?
---@field tap_button_map pinnacle.input.v0alpha1.SetLibinputSettingRequest.TapButtonMap?
---@field tap_drag boolean?
---@field tap_drag_lock boolean?
---@field tap boolean?
---@class pinnacle.input.v0alpha1.SetLibinputSettingRequest.CalibrationMatrix
---@field matrix number[]?
---@class pinnacle.input.v0alpha1.SetXcursorRequest
---@field theme string?
---@field size integer?
---@class pinnacle.output.v0alpha1.Mode
---@field pixel_width integer?
@ -470,41 +402,79 @@ local pinnacle_output_v0alpha1_Transform = {
---@field enabled boolean?
---@field powered boolean?
---@class pinnacle.render.v0alpha1.SetUpscaleFilterRequest
---@field filter pinnacle.render.v0alpha1.Filter?
---@class pinnacle.render.v0alpha1.SetDownscaleFilterRequest
---@field filter pinnacle.render.v0alpha1.Filter?
---@class pinnacle.signal.v0alpha1.OutputConnectRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.OutputConnectResponse
---@field output_name string?
---@class pinnacle.signal.v0alpha1.OutputDisconnectRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.OutputDisconnectResponse
---@field output_name string?
---@class pinnacle.signal.v0alpha1.OutputResizeRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.OutputResizeResponse
---@field output_name string?
---@field logical_width integer?
---@field logical_height integer?
---@class pinnacle.signal.v0alpha1.OutputMoveRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.OutputMoveResponse
---@field output_name string?
---@field x integer?
---@field y integer?
---@class pinnacle.signal.v0alpha1.WindowPointerEnterRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.WindowPointerEnterResponse
---@field window_id integer?
---@class pinnacle.signal.v0alpha1.WindowPointerLeaveRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.WindowPointerLeaveResponse
---@field window_id integer?
---@class pinnacle.signal.v0alpha1.TagActiveRequest
---@field control pinnacle.signal.v0alpha1.StreamControl?
---@class pinnacle.signal.v0alpha1.TagActiveResponse
---@field tag_id integer?
---@field active boolean?
---@class pinnacle.process.v0alpha1.SpawnRequest
---@field args string[]?
---@field once boolean?
---@field has_callback boolean?
---@class pinnacle.process.v0alpha1.SpawnResponse
---@field stdout string?
---@field stderr string?
---@field exit_code integer?
---@field exit_message string?
---@class pinnacle.process.v0alpha1.SetEnvRequest
---@field key string?
---@field value string?
local google = {}
google.protobuf = {}
google.protobuf.Empty = {}
local pinnacle = {}
pinnacle.signal = {}
pinnacle.signal.v0alpha1 = {}
pinnacle.signal.v0alpha1.OutputConnectRequest = {}
pinnacle.signal.v0alpha1.OutputConnectResponse = {}
pinnacle.signal.v0alpha1.OutputDisconnectRequest = {}
pinnacle.signal.v0alpha1.OutputDisconnectResponse = {}
pinnacle.signal.v0alpha1.OutputResizeRequest = {}
pinnacle.signal.v0alpha1.OutputResizeResponse = {}
pinnacle.signal.v0alpha1.OutputMoveRequest = {}
pinnacle.signal.v0alpha1.OutputMoveResponse = {}
pinnacle.signal.v0alpha1.WindowPointerEnterRequest = {}
pinnacle.signal.v0alpha1.WindowPointerEnterResponse = {}
pinnacle.signal.v0alpha1.WindowPointerLeaveRequest = {}
pinnacle.signal.v0alpha1.WindowPointerLeaveResponse = {}
pinnacle.signal.v0alpha1.TagActiveRequest = {}
pinnacle.signal.v0alpha1.TagActiveResponse = {}
pinnacle.input = {}
pinnacle.input.v0alpha1 = {}
pinnacle.input.v0alpha1.SetKeybindRequest = {}
pinnacle.input.v0alpha1.SetKeybindResponse = {}
pinnacle.input.v0alpha1.KeybindDescriptionsRequest = {}
pinnacle.input.v0alpha1.KeybindDescriptionsResponse = {}
pinnacle.input.v0alpha1.KeybindDescription = {}
pinnacle.input.v0alpha1.SetMousebindRequest = {}
pinnacle.input.v0alpha1.SetMousebindResponse = {}
pinnacle.input.v0alpha1.SetXkbConfigRequest = {}
pinnacle.input.v0alpha1.SetRepeatRateRequest = {}
pinnacle.input.v0alpha1.SetLibinputSettingRequest = {}
pinnacle.input.v0alpha1.SetLibinputSettingRequest.CalibrationMatrix = {}
pinnacle.input.v0alpha1.SetXcursorRequest = {}
pinnacle.v0alpha1 = {}
pinnacle.v0alpha1.Geometry = {}
pinnacle.v0alpha1.QuitRequest = {}
@ -532,11 +502,6 @@ pinnacle.tag.v0alpha1.GetRequest = {}
pinnacle.tag.v0alpha1.GetResponse = {}
pinnacle.tag.v0alpha1.GetPropertiesRequest = {}
pinnacle.tag.v0alpha1.GetPropertiesResponse = {}
pinnacle.process = {}
pinnacle.process.v0alpha1 = {}
pinnacle.process.v0alpha1.SpawnRequest = {}
pinnacle.process.v0alpha1.SpawnResponse = {}
pinnacle.process.v0alpha1.SetEnvRequest = {}
pinnacle.window = {}
pinnacle.window.v0alpha1 = {}
pinnacle.window.v0alpha1.CloseRequest = {}
@ -557,10 +522,20 @@ pinnacle.window.v0alpha1.GetPropertiesResponse = {}
pinnacle.window.v0alpha1.AddWindowRuleRequest = {}
pinnacle.window.v0alpha1.WindowRuleCondition = {}
pinnacle.window.v0alpha1.WindowRule = {}
pinnacle.render = {}
pinnacle.render.v0alpha1 = {}
pinnacle.render.v0alpha1.SetUpscaleFilterRequest = {}
pinnacle.render.v0alpha1.SetDownscaleFilterRequest = {}
pinnacle.input = {}
pinnacle.input.v0alpha1 = {}
pinnacle.input.v0alpha1.SetKeybindRequest = {}
pinnacle.input.v0alpha1.SetKeybindResponse = {}
pinnacle.input.v0alpha1.KeybindDescriptionsRequest = {}
pinnacle.input.v0alpha1.KeybindDescriptionsResponse = {}
pinnacle.input.v0alpha1.KeybindDescription = {}
pinnacle.input.v0alpha1.SetMousebindRequest = {}
pinnacle.input.v0alpha1.SetMousebindResponse = {}
pinnacle.input.v0alpha1.SetXkbConfigRequest = {}
pinnacle.input.v0alpha1.SetRepeatRateRequest = {}
pinnacle.input.v0alpha1.SetLibinputSettingRequest = {}
pinnacle.input.v0alpha1.SetLibinputSettingRequest.CalibrationMatrix = {}
pinnacle.input.v0alpha1.SetXcursorRequest = {}
pinnacle.output = {}
pinnacle.output.v0alpha1 = {}
pinnacle.output.v0alpha1.Mode = {}
@ -574,93 +549,46 @@ pinnacle.output.v0alpha1.GetRequest = {}
pinnacle.output.v0alpha1.GetResponse = {}
pinnacle.output.v0alpha1.GetPropertiesRequest = {}
pinnacle.output.v0alpha1.GetPropertiesResponse = {}
pinnacle.render = {}
pinnacle.render.v0alpha1 = {}
pinnacle.render.v0alpha1.SetUpscaleFilterRequest = {}
pinnacle.render.v0alpha1.SetDownscaleFilterRequest = {}
pinnacle.signal = {}
pinnacle.signal.v0alpha1 = {}
pinnacle.signal.v0alpha1.OutputConnectRequest = {}
pinnacle.signal.v0alpha1.OutputConnectResponse = {}
pinnacle.signal.v0alpha1.OutputDisconnectRequest = {}
pinnacle.signal.v0alpha1.OutputDisconnectResponse = {}
pinnacle.signal.v0alpha1.OutputResizeRequest = {}
pinnacle.signal.v0alpha1.OutputResizeResponse = {}
pinnacle.signal.v0alpha1.OutputMoveRequest = {}
pinnacle.signal.v0alpha1.OutputMoveResponse = {}
pinnacle.signal.v0alpha1.WindowPointerEnterRequest = {}
pinnacle.signal.v0alpha1.WindowPointerEnterResponse = {}
pinnacle.signal.v0alpha1.WindowPointerLeaveRequest = {}
pinnacle.signal.v0alpha1.WindowPointerLeaveResponse = {}
pinnacle.signal.v0alpha1.TagActiveRequest = {}
pinnacle.signal.v0alpha1.TagActiveResponse = {}
pinnacle.process = {}
pinnacle.process.v0alpha1 = {}
pinnacle.process.v0alpha1.SpawnRequest = {}
pinnacle.process.v0alpha1.SpawnResponse = {}
pinnacle.process.v0alpha1.SetEnvRequest = {}
pinnacle.signal.v0alpha1.StreamControl = pinnacle_signal_v0alpha1_StreamControl
pinnacle.v0alpha1.SetOrToggle = pinnacle_v0alpha1_SetOrToggle
pinnacle.v0alpha1.Backend = pinnacle_v0alpha1_Backend
pinnacle.window.v0alpha1.FullscreenOrMaximized = pinnacle_window_v0alpha1_FullscreenOrMaximized
pinnacle.window.v0alpha1.WindowState = pinnacle_window_v0alpha1_WindowState
pinnacle.input.v0alpha1.Modifier = pinnacle_input_v0alpha1_Modifier
pinnacle.input.v0alpha1.SetMousebindRequest.MouseEdge = pinnacle_input_v0alpha1_SetMousebindRequest_MouseEdge
pinnacle.input.v0alpha1.SetLibinputSettingRequest.AccelProfile = pinnacle_input_v0alpha1_SetLibinputSettingRequest_AccelProfile
pinnacle.input.v0alpha1.SetLibinputSettingRequest.ClickMethod = pinnacle_input_v0alpha1_SetLibinputSettingRequest_ClickMethod
pinnacle.input.v0alpha1.SetLibinputSettingRequest.ScrollMethod = pinnacle_input_v0alpha1_SetLibinputSettingRequest_ScrollMethod
pinnacle.input.v0alpha1.SetLibinputSettingRequest.TapButtonMap = pinnacle_input_v0alpha1_SetLibinputSettingRequest_TapButtonMap
pinnacle.v0alpha1.SetOrToggle = pinnacle_v0alpha1_SetOrToggle
pinnacle.v0alpha1.Backend = pinnacle_v0alpha1_Backend
pinnacle.window.v0alpha1.FullscreenOrMaximized = pinnacle_window_v0alpha1_FullscreenOrMaximized
pinnacle.window.v0alpha1.WindowState = pinnacle_window_v0alpha1_WindowState
pinnacle.render.v0alpha1.Filter = pinnacle_render_v0alpha1_Filter
pinnacle.output.v0alpha1.Transform = pinnacle_output_v0alpha1_Transform
pinnacle.render.v0alpha1.Filter = pinnacle_render_v0alpha1_Filter
pinnacle.signal.v0alpha1.StreamControl = pinnacle_signal_v0alpha1_StreamControl
pinnacle.signal.v0alpha1.SignalService = {}
pinnacle.signal.v0alpha1.SignalService.OutputConnect = {}
pinnacle.signal.v0alpha1.SignalService.OutputConnect.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.OutputConnect.method = "OutputConnect"
pinnacle.signal.v0alpha1.SignalService.OutputConnect.request = ".pinnacle.signal.v0alpha1.OutputConnectRequest"
pinnacle.signal.v0alpha1.SignalService.OutputConnect.response = ".pinnacle.signal.v0alpha1.OutputConnectResponse"
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect = {}
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect.method = "OutputDisconnect"
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect.request = ".pinnacle.signal.v0alpha1.OutputDisconnectRequest"
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect.response = ".pinnacle.signal.v0alpha1.OutputDisconnectResponse"
pinnacle.signal.v0alpha1.SignalService.OutputResize = {}
pinnacle.signal.v0alpha1.SignalService.OutputResize.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.OutputResize.method = "OutputResize"
pinnacle.signal.v0alpha1.SignalService.OutputResize.request = ".pinnacle.signal.v0alpha1.OutputResizeRequest"
pinnacle.signal.v0alpha1.SignalService.OutputResize.response = ".pinnacle.signal.v0alpha1.OutputResizeResponse"
pinnacle.signal.v0alpha1.SignalService.OutputMove = {}
pinnacle.signal.v0alpha1.SignalService.OutputMove.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.OutputMove.method = "OutputMove"
pinnacle.signal.v0alpha1.SignalService.OutputMove.request = ".pinnacle.signal.v0alpha1.OutputMoveRequest"
pinnacle.signal.v0alpha1.SignalService.OutputMove.response = ".pinnacle.signal.v0alpha1.OutputMoveResponse"
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter = {}
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter.method = "WindowPointerEnter"
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter.request = ".pinnacle.signal.v0alpha1.WindowPointerEnterRequest"
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter.response = ".pinnacle.signal.v0alpha1.WindowPointerEnterResponse"
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave = {}
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave.method = "WindowPointerLeave"
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave.request = ".pinnacle.signal.v0alpha1.WindowPointerLeaveRequest"
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave.response = ".pinnacle.signal.v0alpha1.WindowPointerLeaveResponse"
pinnacle.signal.v0alpha1.SignalService.TagActive = {}
pinnacle.signal.v0alpha1.SignalService.TagActive.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.TagActive.method = "TagActive"
pinnacle.signal.v0alpha1.SignalService.TagActive.request = ".pinnacle.signal.v0alpha1.TagActiveRequest"
pinnacle.signal.v0alpha1.SignalService.TagActive.response = ".pinnacle.signal.v0alpha1.TagActiveResponse"
pinnacle.input.v0alpha1.InputService = {}
pinnacle.input.v0alpha1.InputService.SetKeybind = {}
pinnacle.input.v0alpha1.InputService.SetKeybind.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetKeybind.method = "SetKeybind"
pinnacle.input.v0alpha1.InputService.SetKeybind.request = ".pinnacle.input.v0alpha1.SetKeybindRequest"
pinnacle.input.v0alpha1.InputService.SetKeybind.response = ".pinnacle.input.v0alpha1.SetKeybindResponse"
pinnacle.input.v0alpha1.InputService.SetMousebind = {}
pinnacle.input.v0alpha1.InputService.SetMousebind.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetMousebind.method = "SetMousebind"
pinnacle.input.v0alpha1.InputService.SetMousebind.request = ".pinnacle.input.v0alpha1.SetMousebindRequest"
pinnacle.input.v0alpha1.InputService.SetMousebind.response = ".pinnacle.input.v0alpha1.SetMousebindResponse"
pinnacle.input.v0alpha1.InputService.KeybindDescriptions = {}
pinnacle.input.v0alpha1.InputService.KeybindDescriptions.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.KeybindDescriptions.method = "KeybindDescriptions"
pinnacle.input.v0alpha1.InputService.KeybindDescriptions.request = ".pinnacle.input.v0alpha1.KeybindDescriptionsRequest"
pinnacle.input.v0alpha1.InputService.KeybindDescriptions.response = ".pinnacle.input.v0alpha1.KeybindDescriptionsResponse"
pinnacle.input.v0alpha1.InputService.SetXkbConfig = {}
pinnacle.input.v0alpha1.InputService.SetXkbConfig.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetXkbConfig.method = "SetXkbConfig"
pinnacle.input.v0alpha1.InputService.SetXkbConfig.request = ".pinnacle.input.v0alpha1.SetXkbConfigRequest"
pinnacle.input.v0alpha1.InputService.SetXkbConfig.response = ".google.protobuf.Empty"
pinnacle.input.v0alpha1.InputService.SetRepeatRate = {}
pinnacle.input.v0alpha1.InputService.SetRepeatRate.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetRepeatRate.method = "SetRepeatRate"
pinnacle.input.v0alpha1.InputService.SetRepeatRate.request = ".pinnacle.input.v0alpha1.SetRepeatRateRequest"
pinnacle.input.v0alpha1.InputService.SetRepeatRate.response = ".google.protobuf.Empty"
pinnacle.input.v0alpha1.InputService.SetLibinputSetting = {}
pinnacle.input.v0alpha1.InputService.SetLibinputSetting.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetLibinputSetting.method = "SetLibinputSetting"
pinnacle.input.v0alpha1.InputService.SetLibinputSetting.request = ".pinnacle.input.v0alpha1.SetLibinputSettingRequest"
pinnacle.input.v0alpha1.InputService.SetLibinputSetting.response = ".google.protobuf.Empty"
pinnacle.input.v0alpha1.InputService.SetXcursor = {}
pinnacle.input.v0alpha1.InputService.SetXcursor.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetXcursor.method = "SetXcursor"
pinnacle.input.v0alpha1.InputService.SetXcursor.request = ".pinnacle.input.v0alpha1.SetXcursorRequest"
pinnacle.input.v0alpha1.InputService.SetXcursor.response = ".google.protobuf.Empty"
pinnacle.v0alpha1.PinnacleService = {}
pinnacle.v0alpha1.PinnacleService.Quit = {}
pinnacle.v0alpha1.PinnacleService.Quit.service = "pinnacle.v0alpha1.PinnacleService"
@ -724,17 +652,6 @@ pinnacle.tag.v0alpha1.TagService.GetProperties.service = "pinnacle.tag.v0alpha1.
pinnacle.tag.v0alpha1.TagService.GetProperties.method = "GetProperties"
pinnacle.tag.v0alpha1.TagService.GetProperties.request = ".pinnacle.tag.v0alpha1.GetPropertiesRequest"
pinnacle.tag.v0alpha1.TagService.GetProperties.response = ".pinnacle.tag.v0alpha1.GetPropertiesResponse"
pinnacle.process.v0alpha1.ProcessService = {}
pinnacle.process.v0alpha1.ProcessService.Spawn = {}
pinnacle.process.v0alpha1.ProcessService.Spawn.service = "pinnacle.process.v0alpha1.ProcessService"
pinnacle.process.v0alpha1.ProcessService.Spawn.method = "Spawn"
pinnacle.process.v0alpha1.ProcessService.Spawn.request = ".pinnacle.process.v0alpha1.SpawnRequest"
pinnacle.process.v0alpha1.ProcessService.Spawn.response = ".pinnacle.process.v0alpha1.SpawnResponse"
pinnacle.process.v0alpha1.ProcessService.SetEnv = {}
pinnacle.process.v0alpha1.ProcessService.SetEnv.service = "pinnacle.process.v0alpha1.ProcessService"
pinnacle.process.v0alpha1.ProcessService.SetEnv.method = "SetEnv"
pinnacle.process.v0alpha1.ProcessService.SetEnv.request = ".pinnacle.process.v0alpha1.SetEnvRequest"
pinnacle.process.v0alpha1.ProcessService.SetEnv.response = ".google.protobuf.Empty"
pinnacle.window.v0alpha1.WindowService = {}
pinnacle.window.v0alpha1.WindowService.Close = {}
pinnacle.window.v0alpha1.WindowService.Close.service = "pinnacle.window.v0alpha1.WindowService"
@ -806,17 +723,42 @@ pinnacle.window.v0alpha1.WindowService.AddWindowRule.service = "pinnacle.window.
pinnacle.window.v0alpha1.WindowService.AddWindowRule.method = "AddWindowRule"
pinnacle.window.v0alpha1.WindowService.AddWindowRule.request = ".pinnacle.window.v0alpha1.AddWindowRuleRequest"
pinnacle.window.v0alpha1.WindowService.AddWindowRule.response = ".google.protobuf.Empty"
pinnacle.render.v0alpha1.RenderService = {}
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter = {}
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter.service = "pinnacle.render.v0alpha1.RenderService"
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter.method = "SetUpscaleFilter"
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter.request = ".pinnacle.render.v0alpha1.SetUpscaleFilterRequest"
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter.response = ".google.protobuf.Empty"
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter = {}
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter.service = "pinnacle.render.v0alpha1.RenderService"
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter.method = "SetDownscaleFilter"
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter.request = ".pinnacle.render.v0alpha1.SetDownscaleFilterRequest"
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter.response = ".google.protobuf.Empty"
pinnacle.input.v0alpha1.InputService = {}
pinnacle.input.v0alpha1.InputService.SetKeybind = {}
pinnacle.input.v0alpha1.InputService.SetKeybind.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetKeybind.method = "SetKeybind"
pinnacle.input.v0alpha1.InputService.SetKeybind.request = ".pinnacle.input.v0alpha1.SetKeybindRequest"
pinnacle.input.v0alpha1.InputService.SetKeybind.response = ".pinnacle.input.v0alpha1.SetKeybindResponse"
pinnacle.input.v0alpha1.InputService.SetMousebind = {}
pinnacle.input.v0alpha1.InputService.SetMousebind.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetMousebind.method = "SetMousebind"
pinnacle.input.v0alpha1.InputService.SetMousebind.request = ".pinnacle.input.v0alpha1.SetMousebindRequest"
pinnacle.input.v0alpha1.InputService.SetMousebind.response = ".pinnacle.input.v0alpha1.SetMousebindResponse"
pinnacle.input.v0alpha1.InputService.KeybindDescriptions = {}
pinnacle.input.v0alpha1.InputService.KeybindDescriptions.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.KeybindDescriptions.method = "KeybindDescriptions"
pinnacle.input.v0alpha1.InputService.KeybindDescriptions.request = ".pinnacle.input.v0alpha1.KeybindDescriptionsRequest"
pinnacle.input.v0alpha1.InputService.KeybindDescriptions.response = ".pinnacle.input.v0alpha1.KeybindDescriptionsResponse"
pinnacle.input.v0alpha1.InputService.SetXkbConfig = {}
pinnacle.input.v0alpha1.InputService.SetXkbConfig.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetXkbConfig.method = "SetXkbConfig"
pinnacle.input.v0alpha1.InputService.SetXkbConfig.request = ".pinnacle.input.v0alpha1.SetXkbConfigRequest"
pinnacle.input.v0alpha1.InputService.SetXkbConfig.response = ".google.protobuf.Empty"
pinnacle.input.v0alpha1.InputService.SetRepeatRate = {}
pinnacle.input.v0alpha1.InputService.SetRepeatRate.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetRepeatRate.method = "SetRepeatRate"
pinnacle.input.v0alpha1.InputService.SetRepeatRate.request = ".pinnacle.input.v0alpha1.SetRepeatRateRequest"
pinnacle.input.v0alpha1.InputService.SetRepeatRate.response = ".google.protobuf.Empty"
pinnacle.input.v0alpha1.InputService.SetLibinputSetting = {}
pinnacle.input.v0alpha1.InputService.SetLibinputSetting.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetLibinputSetting.method = "SetLibinputSetting"
pinnacle.input.v0alpha1.InputService.SetLibinputSetting.request = ".pinnacle.input.v0alpha1.SetLibinputSettingRequest"
pinnacle.input.v0alpha1.InputService.SetLibinputSetting.response = ".google.protobuf.Empty"
pinnacle.input.v0alpha1.InputService.SetXcursor = {}
pinnacle.input.v0alpha1.InputService.SetXcursor.service = "pinnacle.input.v0alpha1.InputService"
pinnacle.input.v0alpha1.InputService.SetXcursor.method = "SetXcursor"
pinnacle.input.v0alpha1.InputService.SetXcursor.request = ".pinnacle.input.v0alpha1.SetXcursorRequest"
pinnacle.input.v0alpha1.InputService.SetXcursor.response = ".google.protobuf.Empty"
pinnacle.output.v0alpha1.OutputService = {}
pinnacle.output.v0alpha1.OutputService.SetLocation = {}
pinnacle.output.v0alpha1.OutputService.SetLocation.service = "pinnacle.output.v0alpha1.OutputService"
@ -858,6 +800,64 @@ pinnacle.output.v0alpha1.OutputService.GetProperties.service = "pinnacle.output.
pinnacle.output.v0alpha1.OutputService.GetProperties.method = "GetProperties"
pinnacle.output.v0alpha1.OutputService.GetProperties.request = ".pinnacle.output.v0alpha1.GetPropertiesRequest"
pinnacle.output.v0alpha1.OutputService.GetProperties.response = ".pinnacle.output.v0alpha1.GetPropertiesResponse"
pinnacle.render.v0alpha1.RenderService = {}
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter = {}
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter.service = "pinnacle.render.v0alpha1.RenderService"
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter.method = "SetUpscaleFilter"
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter.request = ".pinnacle.render.v0alpha1.SetUpscaleFilterRequest"
pinnacle.render.v0alpha1.RenderService.SetUpscaleFilter.response = ".google.protobuf.Empty"
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter = {}
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter.service = "pinnacle.render.v0alpha1.RenderService"
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter.method = "SetDownscaleFilter"
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter.request = ".pinnacle.render.v0alpha1.SetDownscaleFilterRequest"
pinnacle.render.v0alpha1.RenderService.SetDownscaleFilter.response = ".google.protobuf.Empty"
pinnacle.signal.v0alpha1.SignalService = {}
pinnacle.signal.v0alpha1.SignalService.OutputConnect = {}
pinnacle.signal.v0alpha1.SignalService.OutputConnect.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.OutputConnect.method = "OutputConnect"
pinnacle.signal.v0alpha1.SignalService.OutputConnect.request = ".pinnacle.signal.v0alpha1.OutputConnectRequest"
pinnacle.signal.v0alpha1.SignalService.OutputConnect.response = ".pinnacle.signal.v0alpha1.OutputConnectResponse"
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect = {}
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect.method = "OutputDisconnect"
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect.request = ".pinnacle.signal.v0alpha1.OutputDisconnectRequest"
pinnacle.signal.v0alpha1.SignalService.OutputDisconnect.response = ".pinnacle.signal.v0alpha1.OutputDisconnectResponse"
pinnacle.signal.v0alpha1.SignalService.OutputResize = {}
pinnacle.signal.v0alpha1.SignalService.OutputResize.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.OutputResize.method = "OutputResize"
pinnacle.signal.v0alpha1.SignalService.OutputResize.request = ".pinnacle.signal.v0alpha1.OutputResizeRequest"
pinnacle.signal.v0alpha1.SignalService.OutputResize.response = ".pinnacle.signal.v0alpha1.OutputResizeResponse"
pinnacle.signal.v0alpha1.SignalService.OutputMove = {}
pinnacle.signal.v0alpha1.SignalService.OutputMove.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.OutputMove.method = "OutputMove"
pinnacle.signal.v0alpha1.SignalService.OutputMove.request = ".pinnacle.signal.v0alpha1.OutputMoveRequest"
pinnacle.signal.v0alpha1.SignalService.OutputMove.response = ".pinnacle.signal.v0alpha1.OutputMoveResponse"
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter = {}
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter.method = "WindowPointerEnter"
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter.request = ".pinnacle.signal.v0alpha1.WindowPointerEnterRequest"
pinnacle.signal.v0alpha1.SignalService.WindowPointerEnter.response = ".pinnacle.signal.v0alpha1.WindowPointerEnterResponse"
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave = {}
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave.method = "WindowPointerLeave"
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave.request = ".pinnacle.signal.v0alpha1.WindowPointerLeaveRequest"
pinnacle.signal.v0alpha1.SignalService.WindowPointerLeave.response = ".pinnacle.signal.v0alpha1.WindowPointerLeaveResponse"
pinnacle.signal.v0alpha1.SignalService.TagActive = {}
pinnacle.signal.v0alpha1.SignalService.TagActive.service = "pinnacle.signal.v0alpha1.SignalService"
pinnacle.signal.v0alpha1.SignalService.TagActive.method = "TagActive"
pinnacle.signal.v0alpha1.SignalService.TagActive.request = ".pinnacle.signal.v0alpha1.TagActiveRequest"
pinnacle.signal.v0alpha1.SignalService.TagActive.response = ".pinnacle.signal.v0alpha1.TagActiveResponse"
pinnacle.process.v0alpha1.ProcessService = {}
pinnacle.process.v0alpha1.ProcessService.Spawn = {}
pinnacle.process.v0alpha1.ProcessService.Spawn.service = "pinnacle.process.v0alpha1.ProcessService"
pinnacle.process.v0alpha1.ProcessService.Spawn.method = "Spawn"
pinnacle.process.v0alpha1.ProcessService.Spawn.request = ".pinnacle.process.v0alpha1.SpawnRequest"
pinnacle.process.v0alpha1.ProcessService.Spawn.response = ".pinnacle.process.v0alpha1.SpawnResponse"
pinnacle.process.v0alpha1.ProcessService.SetEnv = {}
pinnacle.process.v0alpha1.ProcessService.SetEnv.service = "pinnacle.process.v0alpha1.ProcessService"
pinnacle.process.v0alpha1.ProcessService.SetEnv.method = "SetEnv"
pinnacle.process.v0alpha1.ProcessService.SetEnv.request = ".pinnacle.process.v0alpha1.SetEnvRequest"
pinnacle.process.v0alpha1.ProcessService.SetEnv.response = ".google.protobuf.Empty"
return {
google = google,

View file

@ -16,7 +16,7 @@ tokio = { workspace = true, features = ["net"] }
tokio-stream = { workspace = true }
tonic = { workspace = true }
tower = { version = "0.4.13", features = ["util"] }
hyper-util = { version = "0.1.6", features = ["tokio"] }
hyper-util = { workspace = true }
futures = "0.3.30"
num_enum = "0.7.2"
xkbcommon = { workspace = true }

View file

@ -93,7 +93,7 @@ gen-lua-pb-defs:
#!/usr/bin/env bash
set -euxo pipefail
cargo build --package lua-build
./target/debug/lua-build > "./api/lua/pinnacle/grpc/defs.lua"
./target/debug/lua-build ./api/protocol > "./api/lua/pinnacle/grpc/defs.lua"
# Run `cargo run`
run *args: gen-lua-pb-defs

4188
snowcap/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,26 +1,3 @@
[workspace]
members = [
"api/rust",
"snowcap-api-defs",
"api/lua/build"
]
[workspace.dependencies]
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
tokio-stream = { version = "0.1.15", features = ["net"] }
prost = "0.12.6"
tonic = "0.11.0"
tonic-reflection = "0.11.0"
tonic-build = "0.11.0"
xdg = "2.5.2"
snowcap-api-defs = { path = "./snowcap-api-defs" }
xkbcommon = "0.7.0"
tracing = "0.1.40"
[workspace.lints.clippy]
too_many_arguments = "allow"
type_complexity = "allow"
[package]
name = "snowcap"
version = "0.0.1"
@ -28,13 +5,13 @@ edition = "2021"
[dependencies]
smithay-client-toolkit = "0.19.1"
anyhow = { version = "1.0.86", features = ["backtrace"] }
anyhow = { workspace = true }
iced = { version = "0.12.1", default-features = false, features = ["wgpu", "tokio"] }
iced_wgpu = "0.12.1"
iced_runtime = "0.12.1"
iced_futures = "0.12.0"
tracing = { workspace = true }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tracing-subscriber = { workspace = true }
raw-window-handle = "0.6.2"
xdg = { workspace = true }
smithay-clipboard = "0.7.1"

View file

@ -1,13 +0,0 @@
[package]
name = "lua-build"
version = "0.1.0"
edition = "2021"
[dependencies]
prost = "0.12.6"
prost-types = "0.12.6"
indexmap = "2.2.6"
[build-dependencies]
prost-build = "0.12.6"
walkdir = "2.5.0"

View file

@ -1,23 +0,0 @@
use std::path::PathBuf;
fn main() {
println!("cargo:rerun-if-changed=../../protobuf");
let mut proto_paths = Vec::new();
for entry in walkdir::WalkDir::new("../../protobuf") {
let entry = entry.unwrap();
if entry.file_type().is_file() && entry.path().extension().is_some_and(|ext| ext == "proto")
{
proto_paths.push(entry.into_path());
}
}
let descriptor_path = PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("lua-build.bin");
prost_build::Config::new()
.file_descriptor_set_path(descriptor_path)
.compile_protos(&proto_paths, &["../../protobuf"])
.unwrap();
}

View file

@ -1,333 +0,0 @@
use std::collections::HashMap;
use indexmap::{IndexMap, IndexSet};
use prost::Message as _;
use prost_types::{
field_descriptor_proto::{Label, Type},
DescriptorProto, EnumDescriptorProto, FieldDescriptorProto, ServiceDescriptorProto,
};
type EnumMap = IndexMap<String, EnumData>;
type MessageMap = IndexMap<String, MessageData>;
#[derive(Debug)]
struct MessageData {
fields: Vec<Field>,
}
#[derive(Debug)]
struct Field {
name: String,
label: Option<Label>,
r#type: FieldType,
}
#[derive(Debug)]
enum FieldType {
Builtin(Type),
Message(String),
Enum(String),
}
fn parse_message_enums(enums: &mut EnumMap, prefix: &str, message: &DescriptorProto) {
let prefix = format!("{prefix}.{}", message.name());
for r#enum in message.enum_type.iter() {
parse_enum(enums, &prefix, r#enum);
}
for msg in message.nested_type.iter() {
let name = msg.name();
parse_message_enums(enums, &format!("{prefix}.{name}"), msg);
}
}
fn parse_enum(enums: &mut EnumMap, prefix: &str, enum_desc: &EnumDescriptorProto) {
let name = enum_desc.name().to_string();
let values = enum_desc.value.iter().map(|val| {
let name = val.name().to_string();
let number = val.number.unwrap();
EnumValue { name, number }
});
enums.insert(
format!("{prefix}.{name}"),
EnumData {
values: values.collect(),
},
);
}
fn parse_message(msgs: &mut MessageMap, prefix: &str, message: &DescriptorProto) {
let name = format!("{prefix}.{}", message.name());
let mut fields: HashMap<Option<i32>, Vec<Field>> = HashMap::new();
for field in message.field.iter() {
fields
// .entry(field.oneof_index)
.entry(None)
.or_default()
.push(parse_field(field));
}
let data = MessageData {
fields: fields.remove(&None).unwrap_or_default(),
};
msgs.insert(name.clone(), data);
for msg in message.nested_type.iter() {
parse_message(msgs, &name, msg);
}
}
fn parse_field(field: &FieldDescriptorProto) -> Field {
Field {
name: field.name().to_string(),
label: field.label.is_some().then_some(field.label()),
r#type: {
if let Some(type_name) = field.type_name.as_ref() {
if let Some(r#type) = field.r#type.is_some().then_some(field.r#type()) {
match r#type {
Type::Enum => FieldType::Enum(type_name.clone()),
Type::Message => FieldType::Message(type_name.clone()),
_ => panic!(),
}
} else {
FieldType::Builtin(field.r#type())
}
} else {
FieldType::Builtin(field.r#type())
}
},
}
}
#[derive(Debug)]
struct EnumData {
values: Vec<EnumValue>,
}
#[derive(Debug)]
struct EnumValue {
name: String,
number: i32,
}
fn generate_enum_definitions(enums: &EnumMap) -> String {
let mut ret = String::new();
for (name, data) in enums.iter() {
let mut table = format!("---@enum {name}\nlocal {} = {{\n", name.replace('.', "_"));
for val in data.values.iter() {
table += &format!(" {} = {},\n", &val.name, val.number);
}
table += "}\n\n";
ret += &table;
}
ret
}
fn generate_message_classes(msgs: &MessageMap) -> String {
let mut ret = String::new();
for (name, data) in msgs.iter() {
let mut class = format!("---@class {name}\n");
for field in data.fields.iter() {
let r#type = match &field.r#type {
FieldType::Builtin(builtin) => match builtin {
Type::Double | Type::Float => "number",
Type::Int32
| Type::Int64
| Type::Uint32
| Type::Uint64
| Type::Fixed64
| Type::Fixed32
| Type::Sfixed32
| Type::Sfixed64
| Type::Sint32
| Type::Sint64 => "integer",
Type::Bool => "boolean",
Type::String | Type::Bytes => "string",
Type::Group | Type::Message | Type::Enum => "any",
}
.to_string(),
FieldType::Message(s) | FieldType::Enum(s) => s.trim_start_matches('.').to_string(),
};
let non_nil = if field
.label
.is_some_and(|label| matches!(label, Label::Required))
{
""
} else {
"?"
};
let repeated = if field
.label
.is_some_and(|label| matches!(label, Label::Repeated))
{
"[]"
} else {
""
};
class += &format!("---@field {} {type}{repeated}{non_nil}\n", &field.name);
}
class += "\n";
ret += &class;
}
ret
}
struct Visited {
children: HashMap<String, Visited>,
}
fn generate_message_tables(msgs: &MessageMap) -> String {
let mut ret = String::new();
let mut visited = HashMap::<String, Visited>::new();
for name in msgs.keys() {
let segments = name.trim_start_matches('.').split('.');
let mut current = &mut visited;
let mut prev_segments = Vec::new();
for segment in segments {
current = &mut current
.entry(segment.to_string())
.or_insert_with(|| {
if prev_segments.is_empty() {
ret += &format!("local {segment} = {{}}\n")
} else {
ret += &format!(
"{} = {{}}\n",
prev_segments
.iter()
.chain([&segment])
.copied()
.collect::<Vec<_>>()
.join(".")
);
}
Visited {
children: HashMap::new(),
}
})
.children;
prev_segments.push(segment);
}
}
ret
}
fn populate_table_enums(enums: &EnumMap) -> String {
let mut ret = String::new();
for name in enums.keys() {
let name = name.trim_start_matches('.');
let type_name = name.replace('.', "_");
ret += &format!("{name} = {type_name}\n");
}
ret
}
fn populate_service_defs(prefix: &str, service: &ServiceDescriptorProto) -> String {
let mut ret = String::new();
let name = format!("{prefix}.{}", service.name());
ret += &format!("{name} = {{}}\n");
for method in service.method.iter() {
ret += &format!("{name}.{} = {{}}\n", method.name());
ret += &format!("{name}.{}.service = \"{name}\"\n", method.name());
ret += &format!("{name}.{n}.method = \"{n}\"\n", n = method.name());
ret += &format!(
"{name}.{}.request = \"{}\"\n",
method.name(),
method.input_type()
);
ret += &format!(
"{name}.{}.response = \"{}\"\n",
method.name(),
method.output_type()
);
}
ret
}
fn generate_returned_table(msgs: &MessageMap) -> String {
let mut toplevel_packages = IndexSet::new();
for name in msgs.keys() {
let toplevel_package = name.trim_start_matches('.').split('.').next();
if let Some(toplevel_package) = toplevel_package {
toplevel_packages.insert(toplevel_package.to_string());
}
}
let mut ret = String::from("return {\n");
for pkg in toplevel_packages {
ret += &format!(" {pkg} = {pkg},\n");
}
ret += "}\n";
ret
}
fn main() {
let file_descriptor_set_bytes = include_bytes!(concat!(env!("OUT_DIR"), "/lua-build.bin"));
let file_descriptor_set =
prost_types::FileDescriptorSet::decode(&file_descriptor_set_bytes[..]).unwrap();
let mut enums = EnumMap::new();
let mut msgs = MessageMap::new();
let mut services = String::new();
for proto in file_descriptor_set.file.iter() {
let package = proto.package().to_string();
for r#enum in proto.enum_type.iter() {
parse_enum(&mut enums, &package, r#enum);
}
for msg in proto.message_type.iter() {
parse_message_enums(&mut enums, &package, msg);
parse_message(&mut msgs, &package, msg);
}
for service in proto.service.iter() {
services += &populate_service_defs(&package, service);
}
}
println!(
"{}",
generate_enum_definitions(&enums) + "\n"
+ &generate_message_classes(&msgs) + "\n"
+ &generate_message_tables(&msgs) + "\n"
// + &populate_message_tables(&msgs)
+ &populate_table_enums(&enums) + "\n" + &services + "\n" + &generate_returned_table(&msgs)
);
}

View file

@ -1,3 +1,5 @@
---@lcat nodoc
---@enum snowcap.widget.v0alpha1.Alignment
local snowcap_widget_v0alpha1_Alignment = {
ALIGNMENT_UNSPECIFIED = 0,
@ -80,6 +82,8 @@ local snowcap_layer_v0alpha1_Layer = {
}
---@class google.protobuf.Empty
---@class snowcap.input.v0alpha1.Modifiers
---@field shift boolean?
---@field ctrl boolean?
@ -101,8 +105,6 @@ local snowcap_layer_v0alpha1_Layer = {
---@field button integer?
---@field pressed boolean?
---@class google.protobuf.Empty
---@class snowcap.widget.v0alpha1.Padding
---@field top number?
---@field right number?
@ -221,6 +223,9 @@ local snowcap_layer_v0alpha1_Layer = {
---@class snowcap.v0alpha1.Nothing
local google = {}
google.protobuf = {}
google.protobuf.Empty = {}
local snowcap = {}
snowcap.input = {}
snowcap.input.v0alpha1 = {}
@ -229,9 +234,6 @@ snowcap.input.v0alpha1.KeyboardKeyRequest = {}
snowcap.input.v0alpha1.KeyboardKeyResponse = {}
snowcap.input.v0alpha1.PointerButtonRequest = {}
snowcap.input.v0alpha1.PointerButtonResponse = {}
local google = {}
google.protobuf = {}
google.protobuf.Empty = {}
snowcap.widget = {}
snowcap.widget.v0alpha1 = {}
snowcap.widget.v0alpha1.Padding = {}
@ -288,7 +290,7 @@ snowcap.layer.v0alpha1.LayerService.Close.request = ".snowcap.layer.v0alpha1.Clo
snowcap.layer.v0alpha1.LayerService.Close.response = ".google.protobuf.Empty"
return {
snowcap = snowcap,
google = google,
snowcap = snowcap,
}

View file

@ -15,6 +15,7 @@ xkbcommon = { workspace = true }
from_variants = "1.0.2"
tracing = { workspace = true }
thiserror = "1.0.62"
hyper-util = { workspace = true }
[lints.rust]
missing_docs = "warn"

View file

@ -16,6 +16,7 @@ pub mod layer;
pub mod snowcap;
pub mod widget;
use hyper_util::rt::TokioIo;
use snowcap_api_defs::snowcap::{
input::v0alpha1::input_service_client::InputServiceClient,
layer::v0alpha1::layer_service_client::LayerServiceClient,
@ -60,11 +61,13 @@ fn socket_name() -> String {
///
/// Only one snowcap instance can be open per Wayland session.
/// This function will search for a Snowcap socket at
/// `$XDG_RUNTIME_DIR/$snowcap-grpc-$WAYLAND_DISPLAY.sock` and connect to it.
/// `$XDG_RUNTIME_DIR/snowcap-grpc-$WAYLAND_DISPLAY.sock` and connect to it.
pub async fn connect() -> Result<Layer, Box<dyn std::error::Error>> {
let channel = Endpoint::try_from("http://[::]:50051")?
.connect_with_connector(service_fn(|_: Uri| {
tokio::net::UnixStream::connect(socket_dir().join(socket_name()))
.connect_with_connector(service_fn(|_: Uri| async {
Ok::<_, std::io::Error>(TokioIo::new(
tokio::net::UnixStream::connect(socket_dir().join(socket_name())).await?,
))
}))
.await?;

View file

@ -36,4 +36,4 @@ gen-lua-pb-defs:
#!/usr/bin/env bash
set -euxo pipefail
cargo build --package lua-build
./target/debug/lua-build > "./api/lua/snowcap/grpc/defs.lua"
../target/debug/lua-build ./api/protobuf > "./api/lua/snowcap/grpc/defs.lua"