From a46f6edae425be1466008dc43b1a033274203c78 Mon Sep 17 00:00:00 2001 From: Milind Sharma Date: Sat, 21 Feb 2026 00:36:04 +0800 Subject: [PATCH] refactor: ship generated protobuf bindings --- .gitmodules | 3 - Cargo.lock | 460 ---- Cargo.toml | 10 +- README.md | 17 +- build.rs | 52 - kicad | 1 - src/proto/generated/kiapi.board.commands.rs | 543 +++++ src/proto/generated/kiapi.board.rs | 190 ++ src/proto/generated/kiapi.board.types.rs | 2123 ++++++++++++++++++ src/proto/generated/kiapi.common.commands.rs | 676 ++++++ src/proto/generated/kiapi.common.project.rs | 97 + src/proto/generated/kiapi.common.rs | 108 + src/proto/generated/kiapi.common.types.rs | 1033 +++++++++ src/proto/generated/kiapi.schematic.types.rs | 79 + src/proto/mod.rs | 16 +- 15 files changed, 4863 insertions(+), 545 deletions(-) delete mode 100644 .gitmodules delete mode 100644 build.rs delete mode 160000 kicad create mode 100644 src/proto/generated/kiapi.board.commands.rs create mode 100644 src/proto/generated/kiapi.board.rs create mode 100644 src/proto/generated/kiapi.board.types.rs create mode 100644 src/proto/generated/kiapi.common.commands.rs create mode 100644 src/proto/generated/kiapi.common.project.rs create mode 100644 src/proto/generated/kiapi.common.rs create mode 100644 src/proto/generated/kiapi.common.types.rs create mode 100644 src/proto/generated/kiapi.schematic.types.rs diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5f575aa..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "kicad"] - path = kicad - url = https://gitlab.com/kicad/code/kicad.git diff --git a/Cargo.lock b/Cargo.lock index 2e1ed12..c607a1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,27 +2,12 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "aho-corasick" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" -dependencies = [ - "memchr", -] - [[package]] name = "anyhow" version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" -[[package]] -name = "bitflags" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" - [[package]] name = "bytes" version = "1.11.1" @@ -39,12 +24,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - [[package]] name = "cmake" version = "0.1.57" @@ -60,98 +39,12 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - [[package]] name = "find-msvc-tools" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" -[[package]] -name = "fixedbitset" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" - -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[package]] -name = "getrandom" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasip2", - "wasip3", -] - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash", -] - -[[package]] -name = "hashbrown" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - -[[package]] -name = "indexmap" -version = "2.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" -dependencies = [ - "equivalent", - "hashbrown 0.16.1", - "serde", - "serde_core", -] - [[package]] name = "itertools" version = "0.14.0" @@ -161,61 +54,24 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" - [[package]] name = "kicad-ipc-rs" version = "0.1.0" dependencies = [ "nng", "prost", - "prost-build", "prost-types", "thiserror", "tokio", "tracing", ] -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - -[[package]] -name = "libc" -version = "0.2.182" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" - -[[package]] -name = "linux-raw-sys" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" - [[package]] name = "log" version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - -[[package]] -name = "multimap" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" - [[package]] name = "nng" version = "1.0.1" @@ -242,33 +98,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -[[package]] -name = "petgraph" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" -dependencies = [ - "fixedbitset", - "hashbrown 0.15.5", - "indexmap", -] - [[package]] name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - [[package]] name = "proc-macro2" version = "1.0.106" @@ -288,25 +123,6 @@ dependencies = [ "prost-derive", ] -[[package]] -name = "prost-build" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" -dependencies = [ - "heck", - "itertools", - "log", - "multimap", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn", - "tempfile", -] - [[package]] name = "prost-derive" version = "0.14.3" @@ -338,102 +154,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "regex" -version = "1.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" - -[[package]] -name = "rustix" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "semver" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - [[package]] name = "shlex" version = "1.3.0" @@ -451,19 +171,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" -dependencies = [ - "fastrand", - "getrandom", - "once_cell", - "rustix", - "windows-sys", -] - [[package]] name = "thiserror" version = "2.0.18" @@ -542,175 +249,8 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "wasip2" -version = "1.0.2+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags", - "hashbrown 0.15.5", - "indexmap", - "semver", -] - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index adca376..ae753de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,16 +4,13 @@ version = "0.1.0" edition = "2021" license = "MIT" description = "Rust client library for the KiCad IPC API (async-first)" -repository = "https://github.com/Milind220/kicad-api-rust" -homepage = "https://github.com/Milind220/kicad-api-rust" +repository = "https://github.com/Milind220/kicad-ipc-rs" +homepage = "https://github.com/Milind220/kicad-ipc-rs" readme = "README.md" keywords = ["kicad", "eda", "pcb", "ipc"] categories = ["api-bindings", "asynchronous"] include = [ "/src/**", - "/kicad/api/proto/**", - "/.gitmodules", - "/build.rs", "/README.md", "/LICENSE", "/Cargo.toml", @@ -32,6 +29,3 @@ prost-types = { version = "0.14.1", optional = true } thiserror = "2.0.12" tokio = { version = "1.48.0", features = ["sync", "time", "rt", "macros"], optional = true } tracing = { version = "0.1.41", optional = true } - -[build-dependencies] -prost-build = "0.14.1" diff --git a/README.md b/README.md index 7e4294b..aa5fe49 100644 --- a/README.md +++ b/README.md @@ -13,21 +13,12 @@ Alpha. `v0.1.0` release candidate. - Real-world user testing: still limited. - Issues and PRs welcome. -## Build Inputs +## Protobuf Source -This crate compiles protobuf definitions from a KiCad git submodule: +This crate ships checked-in Rust protobuf output under `src/proto/generated/`. -```bash -git submodule update --init --recursive -``` - -Default proto root: `kicad/api/proto` - -Optional override: - -```bash -KICAD_PROTO_ROOT=/absolute/path/to/api/proto cargo build -``` +- Consumers do **not** need KiCad source checkout or git submodules. +- Maintainers can regenerate bindings from upstream KiCad proto as needed. ## Local Testing diff --git a/build.rs b/build.rs deleted file mode 100644 index 4af81eb..0000000 --- a/build.rs +++ /dev/null @@ -1,52 +0,0 @@ -use std::fs; -use std::io; -use std::path::{Path, PathBuf}; - -fn collect_proto_files(root: &Path, out: &mut Vec) -> io::Result<()> { - for entry in fs::read_dir(root)? { - let entry = entry?; - let path = entry.path(); - if path.is_dir() { - collect_proto_files(&path, out)?; - continue; - } - - if path.extension().and_then(|ext| ext.to_str()) == Some("proto") { - out.push(path); - } - } - - Ok(()) -} - -fn main() { - let proto_root = std::env::var_os("KICAD_PROTO_ROOT") - .map(PathBuf::from) - .unwrap_or_else(|| PathBuf::from("kicad/api/proto")); - - if !proto_root.exists() { - panic!( - "KiCad proto root not found at '{}'. Initialize submodule with `git submodule update --init --recursive` or set KICAD_PROTO_ROOT.", - proto_root.display() - ); - } - - println!("cargo:rerun-if-changed={}", proto_root.display()); - - let mut proto_files = Vec::new(); - collect_proto_files(&proto_root, &mut proto_files).unwrap_or_else(|err| { - panic!( - "failed to enumerate proto files under {}: {err}", - proto_root.display() - ) - }); - - proto_files.sort(); - - let mut config = prost_build::Config::new(); - config.protoc_arg("--experimental_allow_proto3_optional"); - - config - .compile_protos(&proto_files, &[proto_root]) - .expect("failed to compile KiCad protobuf schema"); -} diff --git a/kicad b/kicad deleted file mode 160000 index b512143..0000000 --- a/kicad +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b512143573edd2f5814ed1dc1a46a37f6c76be19 diff --git a/src/proto/generated/kiapi.board.commands.rs b/src/proto/generated/kiapi.board.commands.rs new file mode 100644 index 0000000..46e3285 --- /dev/null +++ b/src/proto/generated/kiapi.board.commands.rs @@ -0,0 +1,543 @@ +// This file is @generated by prost-build. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetBoardStackup { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardStackupResponse { + #[prost(message, optional, tag = "1")] + pub stackup: ::core::option::Option, +} +/// Changes the stackup for the given board according to the contents of the message (**not yet implemented**) +/// WARNING: any existing content on layers that are removed by this call is deleted. This operation cannot be undone. +/// Returns BoardStackupResponse with the updated stackup, in normalized form +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateBoardStackup { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub stackup: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetBoardEnabledLayers { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardEnabledLayersResponse { + /// The number of copper layers enabled in this board. + #[prost(uint32, tag = "1")] + pub copper_layer_count: u32, + /// A list of all layers enabled in this board, including copper layers and ones which cannot be disabled. + #[prost(enumeration = "super::types::BoardLayer", repeated, tag = "2")] + pub layers: ::prost::alloc::vec::Vec, +} +/// Changes which layers are enabled in the board stackup +/// WARNING: any existing content on layers that are removed by this call is deleted. This operation cannot be undone. +/// Returns BoardEnabledLayersResponse with the updated layer set. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetBoardEnabledLayers { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + /// The number of copper layers to enable in the board. Currently, this must be an even number >= 2. + #[prost(uint32, tag = "2")] + pub copper_layer_count: u32, + /// The non-copper layers to enable. Note that any copper layers in this list are ignored; copper layers are enabled + /// by setting copper_layer_count. Note that the F/B.Courtyard, Edge.Cuts, and Margin layers cannot be disabled and + /// will be present in the board even if they are omitted from this list. + #[prost(enumeration = "super::types::BoardLayer", repeated, tag = "3")] + pub layers: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetGraphicsDefaults { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GraphicsDefaultsResponse { + #[prost(message, optional, tag = "1")] + pub defaults: ::core::option::Option, +} +/// Returns a Vector2 with the specified origin point +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetBoardOrigin { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + #[prost(enumeration = "BoardOriginType", tag = "2")] + pub r#type: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetBoardOrigin { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + #[prost(enumeration = "BoardOriginType", tag = "2")] + pub r#type: i32, + #[prost(message, optional, tag = "3")] + pub origin: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNets { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + /// If provided, will only return nets that belong to the given netclass. + /// If more than one netclass_filter is given, nets belonging to any of the given classes will + /// be returned. + #[prost(string, repeated, tag = "2")] + pub netclass_filter: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NetsResponse { + #[prost(message, repeated, tag = "1")] + pub nets: ::prost::alloc::vec::Vec, +} +/// Retrieve all the copper items belonging to a certain net or set of nets +/// returns kiapi.common.commands.GetItemsResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetItemsByNet { + /// Specifies which document to query, which fields to return, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// List of one or more types of items to retreive + #[prost( + enumeration = "super::super::common::types::KiCadObjectType", + repeated, + tag = "2" + )] + pub types: ::prost::alloc::vec::Vec, + /// A list of net codes to filter items by + #[prost(message, repeated, tag = "3")] + pub net_codes: ::prost::alloc::vec::Vec, +} +/// Retrieve all the copper items belonging to a certain net class or set of net classes +/// returns kiapi.common.commands.GetItemsResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetItemsByNetClass { + /// Specifies which document to query, which fields to return, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// List of one or more types of items to retreive + #[prost( + enumeration = "super::super::common::types::KiCadObjectType", + repeated, + tag = "2" + )] + pub types: ::prost::alloc::vec::Vec, + /// A list of net class names to filter items by + #[prost(string, repeated, tag = "3")] + pub net_classes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// A net may be part of multiple classes that have a priority ordering, which will result in a +/// composite "effective" netclass containing the merged/overridden properties of all the constituent +/// netclasses it contains. This message retrieves this effective netclass for a net or list of +/// nets. +/// Returns NetClassForNetsResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNetClassForNets { + #[prost(message, repeated, tag = "1")] + pub net: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NetClassForNetsResponse { + /// Map of net name to netclass info + #[prost(map = "string, message", tag = "1")] + pub classes: ::std::collections::HashMap< + ::prost::alloc::string::String, + super::super::common::project::NetClass, + >, +} +/// Refills some or all zones on the board. +/// This is a blocking operation; it will return Empty immediately, but KiCad will return +/// ApiStatusCode.AS_BUSY to all future API requests until the zone fill has completed. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RefillZones { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + /// A list of zones to refill. If empty, all zones are refilled. + #[prost(message, repeated, tag = "2")] + pub zones: ::prost::alloc::vec::Vec, +} +/// Computes the polygon representation of a pad, merging any custom shapes together. +/// This representation will approximate curves as a series of segments. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPadShapeAsPolygon { + /// The board to process + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + /// A list of one or more pads to process + #[prost(message, repeated, tag = "2")] + pub pads: ::prost::alloc::vec::Vec, + /// The layer to process + #[prost(enumeration = "super::types::BoardLayer", tag = "3")] + pub layer: i32, +} +/// Returned from GetPadShapeAsPolygon. The pads and polygons repeated fields will have the same length +/// and can be treated as a list of tuples. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PadShapeAsPolygonResponse { + /// The pads that were processed + #[prost(message, repeated, tag = "1")] + pub pads: ::prost::alloc::vec::Vec, + /// The polygon representation of each pad + #[prost(message, repeated, tag = "2")] + pub polygons: ::prost::alloc::vec::Vec< + super::super::common::types::PolygonWithHoles, + >, +} +/// Tests if the given set of items with padstacks (pads or vias) has content on the given set of layers. +/// This is a dynamic call rather than a property of the padstack because pads and vias can be set to only include +/// shapes on connected copper layers, and whether or not the pad is connected can't be determined in isolation. +/// To optimize API call performance, multiple items and multiple layers to test may be passed in with this +/// command message. The return will include the results for each valid item on each valid layer. +/// Note that not all layers make sense for a given item (for example, testing against BL_UNDEFINED never makes +/// sense). In general, the internal KiCad APIs will not return an error when testing non-sensical layers for a given +/// item, and instead will return a default of "true" for any such layers. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CheckPadstackPresenceOnLayers { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub items: ::prost::alloc::vec::Vec, + #[prost(enumeration = "super::types::BoardLayer", repeated, tag = "3")] + pub layers: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct PadstackPresenceEntry { + #[prost(message, optional, tag = "1")] + pub item: ::core::option::Option, + #[prost(enumeration = "super::types::BoardLayer", tag = "2")] + pub layer: i32, + #[prost(enumeration = "PadstackPresence", tag = "3")] + pub presence: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PadstackPresenceResponse { + #[prost(message, repeated, tag = "1")] + pub entries: ::prost::alloc::vec::Vec, +} +/// Returns InjectDrcErrorResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InjectDrcError { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + #[prost(enumeration = "DrcSeverity", tag = "2")] + pub severity: i32, + #[prost(string, tag = "3")] + pub message: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub position: ::core::option::Option, + #[prost(message, repeated, tag = "5")] + pub items: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct InjectDrcErrorResponse { + #[prost(message, optional, tag = "1")] + pub marker: ::core::option::Option, +} +/// returns BoardLayers +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetVisibleLayers { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardLayerResponse { + #[prost(enumeration = "super::types::BoardLayer", tag = "1")] + pub layer: i32, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardLayers { + #[prost(enumeration = "super::types::BoardLayer", repeated, tag = "1")] + pub layers: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetVisibleLayers { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + #[prost(enumeration = "super::types::BoardLayer", repeated, tag = "2")] + pub layers: ::prost::alloc::vec::Vec, +} +/// returns BoardLayerResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetActiveLayer { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetActiveLayer { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + #[prost(enumeration = "super::types::BoardLayer", tag = "2")] + pub layer: i32, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardEditorAppearanceSettings { + #[prost(enumeration = "InactiveLayerDisplayMode", tag = "1")] + pub inactive_layer_display: i32, + #[prost(enumeration = "NetColorDisplayMode", tag = "2")] + pub net_color_display: i32, + #[prost(enumeration = "BoardFlipMode", tag = "3")] + pub board_flip: i32, + #[prost(enumeration = "RatsnestDisplayMode", tag = "4")] + pub ratsnest_display: i32, +} +/// Returns BoardEditorAppearanceSettings +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetBoardEditorAppearanceSettings {} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SetBoardEditorAppearanceSettings { + #[prost(message, optional, tag = "1")] + pub settings: ::core::option::Option, +} +/// Selects and begins an interactive move of the given item(s). +/// NOTE: Takes ownership of the active commit, if one exists: +/// the move tool will push the commit when the user confirms the move, +/// or roll back the commit if the user cancels the move. Keep this in +/// mind if using this command in combination with commands that create +/// or modify items using an explicit commit. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InteractiveMoveItems { + #[prost(message, optional, tag = "1")] + pub board: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub items: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum BoardOriginType { + BotUnknown = 0, + BotGrid = 1, + BotDrill = 2, +} +impl BoardOriginType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::BotUnknown => "BOT_UNKNOWN", + Self::BotGrid => "BOT_GRID", + Self::BotDrill => "BOT_DRILL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BOT_UNKNOWN" => Some(Self::BotUnknown), + "BOT_GRID" => Some(Self::BotGrid), + "BOT_DRILL" => Some(Self::BotDrill), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PadstackPresence { + PspUnknown = 0, + /// The padstack has a shape on a given layer (is flashed) + PspPresent = 1, + /// The padstack has no shape on a given layer (is not flashed) + PspNotPresent = 2, +} +impl PadstackPresence { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::PspUnknown => "PSP_UNKNOWN", + Self::PspPresent => "PSP_PRESENT", + Self::PspNotPresent => "PSP_NOT_PRESENT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PSP_UNKNOWN" => Some(Self::PspUnknown), + "PSP_PRESENT" => Some(Self::PspPresent), + "PSP_NOT_PRESENT" => Some(Self::PspNotPresent), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DrcSeverity { + DrsUnknown = 0, + DrsWarning = 1, + DrsError = 2, + DrsExclusion = 3, + DrsIgnore = 4, + DrsInfo = 5, + DrsAction = 6, + DrsDebug = 7, + DrsUndefined = 8, +} +impl DrcSeverity { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DrsUnknown => "DRS_UNKNOWN", + Self::DrsWarning => "DRS_WARNING", + Self::DrsError => "DRS_ERROR", + Self::DrsExclusion => "DRS_EXCLUSION", + Self::DrsIgnore => "DRS_IGNORE", + Self::DrsInfo => "DRS_INFO", + Self::DrsAction => "DRS_ACTION", + Self::DrsDebug => "DRS_DEBUG", + Self::DrsUndefined => "DRS_UNDEFINED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DRS_UNKNOWN" => Some(Self::DrsUnknown), + "DRS_WARNING" => Some(Self::DrsWarning), + "DRS_ERROR" => Some(Self::DrsError), + "DRS_EXCLUSION" => Some(Self::DrsExclusion), + "DRS_IGNORE" => Some(Self::DrsIgnore), + "DRS_INFO" => Some(Self::DrsInfo), + "DRS_ACTION" => Some(Self::DrsAction), + "DRS_DEBUG" => Some(Self::DrsDebug), + "DRS_UNDEFINED" => Some(Self::DrsUndefined), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum InactiveLayerDisplayMode { + IldmUnknown = 0, + /// Inactive layers are shown + IldmNormal = 1, + /// Inactive layers are shown with dimmed colors + IldmDimmed = 2, + /// Inactive layers are hidden + IldmHidden = 3, +} +impl InactiveLayerDisplayMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::IldmUnknown => "ILDM_UNKNOWN", + Self::IldmNormal => "ILDM_NORMAL", + Self::IldmDimmed => "ILDM_DIMMED", + Self::IldmHidden => "ILDM_HIDDEN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ILDM_UNKNOWN" => Some(Self::IldmUnknown), + "ILDM_NORMAL" => Some(Self::IldmNormal), + "ILDM_DIMMED" => Some(Self::IldmDimmed), + "ILDM_HIDDEN" => Some(Self::IldmHidden), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum NetColorDisplayMode { + NcdmUnknown = 0, + /// Net and netclass colors are shown in the ratsnest and on all copper items + NcdmAll = 1, + /// Net and netclass colors are shown in the ratsnest only + NcdmRatsnest = 2, + /// Net and netclass colors are not shown + NcdmOff = 3, +} +impl NetColorDisplayMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::NcdmUnknown => "NCDM_UNKNOWN", + Self::NcdmAll => "NCDM_ALL", + Self::NcdmRatsnest => "NCDM_RATSNEST", + Self::NcdmOff => "NCDM_OFF", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NCDM_UNKNOWN" => Some(Self::NcdmUnknown), + "NCDM_ALL" => Some(Self::NcdmAll), + "NCDM_RATSNEST" => Some(Self::NcdmRatsnest), + "NCDM_OFF" => Some(Self::NcdmOff), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum BoardFlipMode { + BfmUnknown = 0, + /// Normal ("non-flipped") mode + BfmNormal = 1, + /// "Flipped" mode, viewed from the back and mirrored around the X axis + BfmFlippedX = 2, +} +impl BoardFlipMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::BfmUnknown => "BFM_UNKNOWN", + Self::BfmNormal => "BFM_NORMAL", + Self::BfmFlippedX => "BFM_FLIPPED_X", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BFM_UNKNOWN" => Some(Self::BfmUnknown), + "BFM_NORMAL" => Some(Self::BfmNormal), + "BFM_FLIPPED_X" => Some(Self::BfmFlippedX), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum RatsnestDisplayMode { + RdmUnknown = 0, + /// Ratsnest lines are drawn to objects even if they are on hidden layers + RdmAllLayers = 1, + /// Ratsnest lines are hidden when at least one endpoint is an item on a hidden layer + RdmVisibleLayers = 2, +} +impl RatsnestDisplayMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::RdmUnknown => "RDM_UNKNOWN", + Self::RdmAllLayers => "RDM_ALL_LAYERS", + Self::RdmVisibleLayers => "RDM_VISIBLE_LAYERS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RDM_UNKNOWN" => Some(Self::RdmUnknown), + "RDM_ALL_LAYERS" => Some(Self::RdmAllLayers), + "RDM_VISIBLE_LAYERS" => Some(Self::RdmVisibleLayers), + _ => None, + } + } +} diff --git a/src/proto/generated/kiapi.board.rs b/src/proto/generated/kiapi.board.rs new file mode 100644 index 0000000..1eb9cb7 --- /dev/null +++ b/src/proto/generated/kiapi.board.rs @@ -0,0 +1,190 @@ +// This file is @generated by prost-build. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardFinish { + #[prost(string, tag = "1")] + pub type_name: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardImpedanceControl { + #[prost(bool, tag = "1")] + pub is_controlled: bool, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardEdgeConnector {} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Castellation { + #[prost(bool, tag = "1")] + pub has_castellated_pads: bool, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct EdgePlating { + #[prost(bool, tag = "1")] + pub has_edge_plating: bool, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardEdgeSettings { + #[prost(message, optional, tag = "1")] + pub connector: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub castellation: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub plating: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardStackupCopperLayer {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardStackupDielectricProperties { + #[prost(double, tag = "1")] + pub epsilon_r: f64, + #[prost(double, tag = "2")] + pub loss_tangent: f64, + #[prost(string, tag = "3")] + pub material_name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub thickness: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardStackupDielectricLayer { + /// A single dielectric slot (between copper layers) can be made up of multiple physical layers + #[prost(message, repeated, tag = "1")] + pub layer: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardStackupLayer { + #[prost(message, optional, tag = "1")] + pub thickness: ::core::option::Option, + #[prost(enumeration = "types::BoardLayer", tag = "2")] + pub layer: i32, + #[prost(bool, tag = "3")] + pub enabled: bool, + #[prost(enumeration = "BoardStackupLayerType", tag = "4")] + pub r#type: i32, + #[prost(message, optional, tag = "5")] + pub dielectric: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub color: ::core::option::Option, + #[prost(string, tag = "7")] + pub material_name: ::prost::alloc::string::String, + /// The name of the layer shown in the KiCad GUI, which may be a default value like "F.Cu" or may + /// have been customized by the user. This field does not apply to dielectric layers. + #[prost(string, tag = "8")] + pub user_name: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardStackup { + #[prost(message, optional, tag = "1")] + pub finish: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub impedance: ::core::option::Option, + /// NOTE: m_HasThicknessConstrains appears to be unused + #[prost(message, optional, tag = "3")] + pub edge: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub layers: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardLayerGraphicsDefaults { + #[prost(enumeration = "BoardLayerClass", tag = "1")] + pub layer: i32, + #[prost(message, optional, tag = "2")] + pub text: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub line_thickness: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GraphicsDefaults { + #[prost(message, repeated, tag = "1")] + pub layers: ::prost::alloc::vec::Vec, +} +/// Anything that isn't stackup or design rules +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardSettings { + /// Dimension default settings + #[prost(message, optional, tag = "1")] + pub graphics_defaults: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BoardDesignRules {} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum BoardStackupLayerType { + BsltUnknown = 0, + BsltCopper = 1, + BsltDielectric = 2, + BsltSilkscreen = 3, + BsltSoldermask = 4, + BsltSolderpaste = 5, + BsltUndefined = 7, +} +impl BoardStackupLayerType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::BsltUnknown => "BSLT_UNKNOWN", + Self::BsltCopper => "BSLT_COPPER", + Self::BsltDielectric => "BSLT_DIELECTRIC", + Self::BsltSilkscreen => "BSLT_SILKSCREEN", + Self::BsltSoldermask => "BSLT_SOLDERMASK", + Self::BsltSolderpaste => "BSLT_SOLDERPASTE", + Self::BsltUndefined => "BSLT_UNDEFINED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BSLT_UNKNOWN" => Some(Self::BsltUnknown), + "BSLT_COPPER" => Some(Self::BsltCopper), + "BSLT_DIELECTRIC" => Some(Self::BsltDielectric), + "BSLT_SILKSCREEN" => Some(Self::BsltSilkscreen), + "BSLT_SOLDERMASK" => Some(Self::BsltSoldermask), + "BSLT_SOLDERPASTE" => Some(Self::BsltSolderpaste), + "BSLT_UNDEFINED" => Some(Self::BsltUndefined), + _ => None, + } + } +} +/// LAYER_CLASS_* in BOARD_DESIGN_SETTINGS -- needs to become an enum class +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum BoardLayerClass { + BlcUnknown = 0, + BlcSilkscreen = 1, + BlcCopper = 2, + BlcEdges = 3, + BlcCourtyard = 4, + BlcFabrication = 5, + BlcOther = 6, +} +impl BoardLayerClass { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::BlcUnknown => "BLC_UNKNOWN", + Self::BlcSilkscreen => "BLC_SILKSCREEN", + Self::BlcCopper => "BLC_COPPER", + Self::BlcEdges => "BLC_EDGES", + Self::BlcCourtyard => "BLC_COURTYARD", + Self::BlcFabrication => "BLC_FABRICATION", + Self::BlcOther => "BLC_OTHER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BLC_UNKNOWN" => Some(Self::BlcUnknown), + "BLC_SILKSCREEN" => Some(Self::BlcSilkscreen), + "BLC_COPPER" => Some(Self::BlcCopper), + "BLC_EDGES" => Some(Self::BlcEdges), + "BLC_COURTYARD" => Some(Self::BlcCourtyard), + "BLC_FABRICATION" => Some(Self::BlcFabrication), + "BLC_OTHER" => Some(Self::BlcOther), + _ => None, + } + } +} diff --git a/src/proto/generated/kiapi.board.types.rs b/src/proto/generated/kiapi.board.types.rs new file mode 100644 index 0000000..8edd53e --- /dev/null +++ b/src/proto/generated/kiapi.board.types.rs @@ -0,0 +1,2123 @@ +// This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct NetCode { + #[prost(int32, tag = "1")] + pub value: i32, +} +/// Describes a copper item's net +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Net { + /// A unique code representing this net + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + /// Human-readable net name + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, +} +/// Represents a track segment on a board +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Track { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub end: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub width: ::core::option::Option, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "5")] + pub locked: i32, + #[prost(enumeration = "BoardLayer", tag = "6")] + pub layer: i32, + #[prost(message, optional, tag = "7")] + pub net: ::core::option::Option, +} +/// Represents an arc track (not a PCB_SHAPE in arc shape) +/// Arc tracks in KiCad store start, midpoint, and end. +/// All other values (center point, angles, etc) are inferred. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Arc { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub start: ::core::option::Option, + /// Arc midpoint + #[prost(message, optional, tag = "3")] + pub mid: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub end: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub width: ::core::option::Option, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "6")] + pub locked: i32, + #[prost(enumeration = "BoardLayer", tag = "7")] + pub layer: i32, + #[prost(message, optional, tag = "8")] + pub net: ::core::option::Option, +} +/// Which corners are chamfered in a PSS_CHAMFEREDRECT +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ChamferedRectCorners { + #[prost(bool, tag = "1")] + pub top_left: bool, + #[prost(bool, tag = "2")] + pub top_right: bool, + #[prost(bool, tag = "3")] + pub bottom_left: bool, + #[prost(bool, tag = "4")] + pub bottom_right: bool, +} +/// Controls for how copper zones connect to a pad +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct ZoneConnectionSettings { + #[prost(enumeration = "ZoneConnectionStyle", tag = "1")] + pub zone_connection: i32, + #[prost(message, optional, tag = "2")] + pub thermal_spokes: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SolderMaskOverrides { + /// Solder mask expansion/contraction + #[prost(message, optional, tag = "1")] + pub solder_mask_margin: ::core::option::Option< + super::super::common::types::Distance, + >, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct SolderPasteOverrides { + /// Solder paste expansion/contraction + #[prost(message, optional, tag = "1")] + pub solder_paste_margin: ::core::option::Option< + super::super::common::types::Distance, + >, + /// Solder paste expansion/contraction ratio + #[prost(message, optional, tag = "2")] + pub solder_paste_margin_ratio: ::core::option::Option< + super::super::common::types::Ratio, + >, +} +/// The defintion of a padstack on a single layer +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PadStackLayer { + /// The board layer of this padstack entry. For Front/Inner/Back padstacks, In1_Cu is used to represent inner layers. + #[prost(enumeration = "BoardLayer", tag = "1")] + pub layer: i32, + /// The shape of the pad on this layer + #[prost(enumeration = "PadStackShape", tag = "2")] + pub shape: i32, + /// The size (x and y) of the shape on this layer + #[prost(message, optional, tag = "3")] + pub size: ::core::option::Option, + /// How much to round the corners of the shape by, as a fraction of min(size.x, size.y) + /// Only used for PSS_ROUNDRECT or PSS_CHAMFEREDRECT + #[prost(double, tag = "4")] + pub corner_rounding_ratio: f64, + /// How much to round the corners of the shape by, as a fraction of min(size.x, size.y) + /// Only used for PSS_CHAMFEREDRECT + #[prost(double, tag = "5")] + pub chamfer_ratio: f64, + #[prost(message, optional, tag = "6")] + pub chamfered_corners: ::core::option::Option, + #[prost(message, repeated, tag = "7")] + pub custom_shapes: ::prost::alloc::vec::Vec, + /// If shape == PSS_CUSTOM, defines the shape of the anchor (only PSS_CIRCLE and PSS_RECTANGLE supported at present) + #[prost(enumeration = "PadStackShape", tag = "8")] + pub custom_anchor_shape: i32, + /// Reserved for future use -- at the moment, zone connection settings are not per-layer + #[prost(message, optional, tag = "9")] + pub zone_settings: ::core::option::Option, + /// The difference in side length between the short and long pads in a trapezoid. Only one of x or y may be nonzero. + /// Only used for PSS_TRAPEZOID + #[prost(message, optional, tag = "10")] + pub trapezoid_delta: ::core::option::Option, + /// The offset of the center of this shape from the center of the pad (which is defined as the hole center) + #[prost(message, optional, tag = "11")] + pub offset: ::core::option::Option, +} +/// Properties for the outer technical layers of a padstack on the top or bottom of the stack +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct PadStackOuterLayer { + #[prost(enumeration = "SolderMaskMode", tag = "1")] + pub solder_mask_mode: i32, + #[prost(enumeration = "SolderPasteMode", tag = "2")] + pub solder_paste_mode: i32, + /// NOTE: At present, KiCad does not support different solder mask expansion settings for the top and bottom layers + #[prost(message, optional, tag = "3")] + pub solder_mask_settings: ::core::option::Option, + /// NOTE: At present, KiCad does not support different solder paste expansion settings for the top and bottom layers + #[prost(message, optional, tag = "4")] + pub solder_paste_settings: ::core::option::Option, + #[prost(enumeration = "ViaPluggingMode", tag = "5")] + pub plugging_mode: i32, + #[prost(enumeration = "ViaCoveringMode", tag = "6")] + pub covering_mode: i32, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct DrillProperties { + /// Lowest (closest to F_Cu) layer this drill exists on. + #[prost(enumeration = "BoardLayer", tag = "1")] + pub start_layer: i32, + /// Highest (closest to B_Cu) layer this drill exists on. + #[prost(enumeration = "BoardLayer", tag = "2")] + pub end_layer: i32, + /// The diameter, in x and y, of the pad's drilled hole, if this pad has a hole. + /// x and y will be the same value if the hole is round. + #[prost(message, optional, tag = "3")] + pub diameter: ::core::option::Option, + #[prost(enumeration = "DrillShape", tag = "4")] + pub shape: i32, + #[prost(enumeration = "ViaDrillCappingMode", tag = "5")] + pub capped: i32, + #[prost(enumeration = "ViaDrillFillingMode", tag = "6")] + pub filled: i32, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct PostMachiningProperties { + #[prost(enumeration = "ViaDrillPostMachiningMode", tag = "1")] + pub mode: i32, + #[prost(int32, tag = "2")] + pub size: i32, + #[prost(int32, tag = "3")] + pub depth: i32, + #[prost(int32, tag = "4")] + pub angle: i32, +} +/// A pad stack definition for a multilayer pad or via. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PadStack { + /// What type of pad stack this represents. + #[prost(enumeration = "PadStackType", tag = "1")] + pub r#type: i32, + /// The set of board layers this padstack has a definition for + #[prost(enumeration = "BoardLayer", repeated, tag = "2")] + pub layers: ::prost::alloc::vec::Vec, + /// Properties of the drilled hole in this padstack, if it has one + #[prost(message, optional, tag = "3")] + pub drill: ::core::option::Option, + /// How to treat pad shapes on unconnected layers. + #[prost(enumeration = "UnconnectedLayerRemoval", tag = "4")] + pub unconnected_layer_removal: i32, + #[prost(message, repeated, tag = "5")] + pub copper_layers: ::prost::alloc::vec::Vec, + /// The overall rotation of this padstack (affects all layers) + #[prost(message, optional, tag = "6")] + pub angle: ::core::option::Option, + /// Solder mask and paste settings for the front + #[prost(message, optional, tag = "7")] + pub front_outer_layers: ::core::option::Option, + /// Solder mask and paste settings for the back + #[prost(message, optional, tag = "8")] + pub back_outer_layers: ::core::option::Option, + /// Controls for how copper zones connect to the padstack + #[prost(message, optional, tag = "9")] + pub zone_settings: ::core::option::Option, + /// Optional secondary drill hit for backdrilling + #[prost(message, optional, tag = "10")] + pub secondary_drill: ::core::option::Option, + /// Optional tertiary drill hit for backdrilling + #[prost(message, optional, tag = "11")] + pub tertiary_drill: ::core::option::Option, + #[prost(message, optional, tag = "12")] + pub front_post_machining: ::core::option::Option, + #[prost(message, optional, tag = "13")] + pub back_post_machining: ::core::option::Option, +} +/// Represents a via +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Via { + /// The unique identifier of the via + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + /// The location of the via's center point + #[prost(message, optional, tag = "2")] + pub position: ::core::option::Option, + /// The pad stack definition for this via. + #[prost(message, optional, tag = "3")] + pub pad_stack: ::core::option::Option, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "4")] + pub locked: i32, + #[prost(message, optional, tag = "5")] + pub net: ::core::option::Option, + #[prost(enumeration = "ViaType", tag = "6")] + pub r#type: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardGraphicShape { + #[prost(message, optional, tag = "1")] + pub shape: ::core::option::Option, + #[prost(enumeration = "BoardLayer", tag = "2")] + pub layer: i32, + #[prost(message, optional, tag = "3")] + pub net: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub id: ::core::option::Option, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "5")] + pub locked: i32, +} +/// A board-specific text object, existing on a board layer +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardText { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub text: ::core::option::Option, + #[prost(enumeration = "BoardLayer", tag = "3")] + pub layer: i32, + #[prost(bool, tag = "4")] + pub knockout: bool, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "5")] + pub locked: i32, +} +/// A board-specific textbox, existing on a board layer +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BoardTextBox { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub textbox: ::core::option::Option, + #[prost(enumeration = "BoardLayer", tag = "3")] + pub layer: i32, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "4")] + pub locked: i32, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct ThermalSpokeSettings { + #[prost(message, optional, tag = "1")] + pub width: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub angle: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub gap: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SymbolPinInfo { + /// The pin name for the associated symbol pin, if one exists + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// The electrical type of the associated symbol pin, if one exists (EPT_UNKNOWN if not) + #[prost(enumeration = "super::super::common::types::ElectricalPinType", tag = "2")] + pub r#type: i32, + /// True if the pin is attached to a no-connect marker in the schematic + #[prost(bool, tag = "3")] + pub no_connect: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Pad { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "2")] + pub locked: i32, + #[prost(string, tag = "3")] + pub number: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub net: ::core::option::Option, + #[prost(enumeration = "PadType", tag = "5")] + pub r#type: i32, + #[prost(message, optional, tag = "6")] + pub pad_stack: ::core::option::Option, + /// A pad's position is always relative to the parent footprint's origin + #[prost(message, optional, tag = "7")] + pub position: ::core::option::Option, + /// Copper-to-copper clearance override + #[prost(message, optional, tag = "8")] + pub copper_clearance_override: ::core::option::Option< + super::super::common::types::Distance, + >, + /// Since: 9.0.4 + #[prost(message, optional, tag = "9")] + pub pad_to_die_length: ::core::option::Option, + /// Information about the associated symbol pin, if one exists + /// Since: 9.0.7 + #[prost(message, optional, tag = "10")] + pub symbol_pin: ::core::option::Option, + /// Since: 10.0.0 + #[prost(message, optional, tag = "11")] + pub pad_to_die_delay: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct HatchFillSettings { + #[prost(message, optional, tag = "1")] + pub thickness: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub gap: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub orientation: ::core::option::Option, + #[prost(double, tag = "4")] + pub hatch_smoothing_ratio: f64, + #[prost(double, tag = "5")] + pub hatch_hole_min_area_ratio: f64, + #[prost(enumeration = "ZoneHatchFillBorderMode", tag = "6")] + pub border_mode: i32, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct TeardropSettings { + #[prost(enumeration = "TeardropType", tag = "1")] + pub r#type: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CopperZoneSettings { + #[prost(message, optional, tag = "1")] + pub connection: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub clearance: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub min_thickness: ::core::option::Option, + #[prost(enumeration = "IslandRemovalMode", tag = "4")] + pub island_mode: i32, + #[prost(uint64, tag = "5")] + pub min_island_area: u64, + #[prost(enumeration = "ZoneFillMode", tag = "6")] + pub fill_mode: i32, + #[prost(message, optional, tag = "7")] + pub hatch_settings: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub net: ::core::option::Option, + #[prost(message, optional, tag = "9")] + pub teardrop: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct RuleAreaSettings { + #[prost(bool, tag = "1")] + pub keepout_copper: bool, + #[prost(bool, tag = "2")] + pub keepout_vias: bool, + #[prost(bool, tag = "3")] + pub keepout_tracks: bool, + #[prost(bool, tag = "4")] + pub keepout_pads: bool, + #[prost(bool, tag = "5")] + pub keepout_footprints: bool, + #[prost(bool, tag = "6")] + pub placement_enabled: bool, + #[prost(enumeration = "PlacementRuleSourceType", tag = "7")] + pub placement_source_type: i32, + #[prost(string, tag = "8")] + pub placement_source: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ZoneBorderSettings { + #[prost(enumeration = "ZoneBorderStyle", tag = "1")] + pub style: i32, + #[prost(message, optional, tag = "2")] + pub pitch: ::core::option::Option, +} +/// The set of filled polygons of a zone on a single board layer +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ZoneFilledPolygons { + #[prost(enumeration = "BoardLayer", tag = "1")] + pub layer: i32, + #[prost(message, optional, tag = "2")] + pub shapes: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ZoneLayerProperties { + #[prost(enumeration = "BoardLayer", tag = "1")] + pub layer: i32, + #[prost(message, optional, tag = "2")] + pub hatching_offset: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Zone { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(enumeration = "ZoneType", tag = "2")] + pub r#type: i32, + #[prost(enumeration = "BoardLayer", repeated, tag = "3")] + pub layers: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub outline: ::core::option::Option, + #[prost(string, tag = "5")] + pub name: ::prost::alloc::string::String, + #[prost(uint32, tag = "8")] + pub priority: u32, + #[prost(bool, tag = "9")] + pub filled: bool, + #[prost(message, repeated, tag = "10")] + pub filled_polygons: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "11")] + pub border: ::core::option::Option, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "12")] + pub locked: i32, + #[prost(message, repeated, tag = "13")] + pub layer_properties: ::prost::alloc::vec::Vec, + #[prost(oneof = "zone::Settings", tags = "6, 7")] + pub settings: ::core::option::Option, +} +/// Nested message and enum types in `Zone`. +pub mod zone { + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Settings { + #[prost(message, tag = "6")] + CopperSettings(super::CopperZoneSettings), + #[prost(message, tag = "7")] + RuleAreaSettings(super::RuleAreaSettings), + } +} +/// An aligned dimension is drawn parallel to the line segment between the start and end points +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct AlignedDimensionAttributes { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub end: ::core::option::Option, + /// Perpendicular distance from dimension endpoints to crossbar + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, + /// Length of extension lines past the crossbar + #[prost(message, optional, tag = "4")] + pub extension_height: ::core::option::Option, +} +/// An orthogonal dimension is drawn parallel to the X or Y axis of the coordinate system +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct OrthogonalDimensionAttributes { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub end: ::core::option::Option, + /// Perpendicular distance from dimension endpoints to crossbar + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, + /// Length of extension lines past the crossbar + #[prost(message, optional, tag = "4")] + pub extension_height: ::core::option::Option, + /// Which axis the dimension is parallel to + #[prost(enumeration = "super::super::common::types::AxisAlignment", tag = "5")] + pub alignment: i32, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct RadialDimensionAttributes { + /// The center of the dimensioned circle or arc + #[prost(message, optional, tag = "1")] + pub center: ::core::option::Option, + /// A point on the radius of the circle or arc + #[prost(message, optional, tag = "2")] + pub radius_point: ::core::option::Option, + /// The distance from radius_point to draw the first segment of the leader line. + /// The second segment is drawn from the end of the first segment to the text position. + #[prost(message, optional, tag = "3")] + pub leader_length: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct LeaderDimensionAttributes { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub end: ::core::option::Option, + #[prost(enumeration = "DimensionTextBorderStyle", tag = "3")] + pub border_style: i32, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct CenterDimensionAttributes { + #[prost(message, optional, tag = "1")] + pub center: ::core::option::Option, + /// A point on the end of one of the four radial spokes drawn from the center point + #[prost(message, optional, tag = "2")] + pub end: ::core::option::Option, +} +/// A dimension in KiCad is a special type of text object. +/// To know the visual appearance of the dimension as rendered by KiCad, use GetTextAsShapes +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Dimension { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "2")] + pub locked: i32, + #[prost(enumeration = "BoardLayer", tag = "3")] + pub layer: i32, + #[prost(message, optional, tag = "4")] + pub text: ::core::option::Option, + #[prost(bool, tag = "10")] + pub override_text_enabled: bool, + #[prost(string, tag = "11")] + pub override_text: ::prost::alloc::string::String, + #[prost(string, tag = "12")] + pub prefix: ::prost::alloc::string::String, + #[prost(string, tag = "13")] + pub suffix: ::prost::alloc::string::String, + #[prost(enumeration = "DimensionUnit", tag = "14")] + pub unit: i32, + #[prost(enumeration = "DimensionUnitFormat", tag = "15")] + pub unit_format: i32, + #[prost(enumeration = "DimensionArrowDirection", tag = "16")] + pub arrow_direction: i32, + #[prost(enumeration = "DimensionPrecision", tag = "17")] + pub precision: i32, + #[prost(bool, tag = "18")] + pub suppress_trailing_zeroes: bool, + #[prost(message, optional, tag = "19")] + pub line_thickness: ::core::option::Option, + #[prost(message, optional, tag = "20")] + pub arrow_length: ::core::option::Option, + #[prost(message, optional, tag = "21")] + pub extension_offset: ::core::option::Option, + #[prost(enumeration = "DimensionTextPosition", tag = "22")] + pub text_position: i32, + #[prost(bool, tag = "23")] + pub keep_text_aligned: bool, + #[prost(oneof = "dimension::DimensionStyle", tags = "5, 6, 7, 8, 9")] + pub dimension_style: ::core::option::Option, +} +/// Nested message and enum types in `Dimension`. +pub mod dimension { + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] + pub enum DimensionStyle { + #[prost(message, tag = "5")] + Aligned(super::AlignedDimensionAttributes), + #[prost(message, tag = "6")] + Orthogonal(super::OrthogonalDimensionAttributes), + #[prost(message, tag = "7")] + Radial(super::RadialDimensionAttributes), + #[prost(message, tag = "8")] + Leader(super::LeaderDimensionAttributes), + #[prost(message, tag = "9")] + Center(super::CenterDimensionAttributes), + } +} +/// TODO +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ReferenceImage {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Group { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub items: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct FieldId { + #[prost(int32, tag = "1")] + pub id: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Field { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub text: ::core::option::Option, + /// Since 9.0.1 + #[prost(bool, tag = "4")] + pub visible: bool, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct FootprintAttributes { + #[prost(string, tag = "1")] + pub description: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub keywords: ::prost::alloc::string::String, + #[prost(bool, tag = "3")] + pub not_in_schematic: bool, + #[prost(bool, tag = "4")] + pub exclude_from_position_files: bool, + #[prost(bool, tag = "5")] + pub exclude_from_bill_of_materials: bool, + #[prost(bool, tag = "6")] + pub exempt_from_courtyard_requirement: bool, + #[prost(bool, tag = "7")] + pub do_not_populate: bool, + #[prost(enumeration = "FootprintMountingStyle", tag = "8")] + pub mounting_style: i32, + /// Since: 9.0.7 + #[prost(bool, tag = "9")] + pub allow_soldermask_bridges: bool, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct NetTieDefinition { + #[prost(string, repeated, tag = "1")] + pub pad_number: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct FootprintDesignRuleOverrides { + #[prost(message, optional, tag = "1")] + pub solder_mask: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub solder_paste: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub copper_clearance: ::core::option::Option, + #[prost(enumeration = "ZoneConnectionStyle", tag = "4")] + pub zone_connection: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Footprint3DModel { + #[prost(string, tag = "1")] + pub filename: ::prost::alloc::string::String, + /// Scaling factor along each axis + #[prost(message, optional, tag = "2")] + pub scale: ::core::option::Option, + /// Rotation around each axis, in degrees + #[prost(message, optional, tag = "3")] + pub rotation: ::core::option::Option, + /// Offset from footprint center + #[prost(message, optional, tag = "4")] + pub offset: ::core::option::Option, + #[prost(bool, tag = "5")] + pub visible: bool, + #[prost(double, tag = "6")] + pub opacity: f64, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct JumperGroup { + #[prost(string, repeated, tag = "1")] + pub pad_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct JumperSettings { + /// / If true, duplicate pad names in this footprint are jumpered together + #[prost(bool, tag = "1")] + pub duplicate_names_are_jumpered: bool, + #[prost(message, repeated, tag = "2")] + pub groups: ::prost::alloc::vec::Vec, +} +/// A footprint definition (i.e. what would be in a library) +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Footprint { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub anchor: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub attributes: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub overrides: ::core::option::Option, + #[prost(message, repeated, tag = "5")] + pub net_ties: ::prost::alloc::vec::Vec, + #[prost(enumeration = "BoardLayer", repeated, tag = "6")] + pub private_layers: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "7")] + pub reference_field: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub value_field: ::core::option::Option, + #[prost(message, optional, tag = "9")] + pub datasheet_field: ::core::option::Option, + #[prost(message, optional, tag = "10")] + pub description_field: ::core::option::Option, + /// All footprint items except for mandatory fields + #[prost(message, repeated, tag = "11")] + pub items: ::prost::alloc::vec::Vec<::prost_types::Any>, + #[prost(message, optional, tag = "12")] + pub jumpers: ::core::option::Option, +} +/// An instance of a footprint on a board +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FootprintInstance { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub position: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub orientation: ::core::option::Option, + #[prost(enumeration = "BoardLayer", tag = "4")] + pub layer: i32, + #[prost(enumeration = "super::super::common::types::LockedState", tag = "5")] + pub locked: i32, + #[prost(message, optional, tag = "6")] + pub definition: ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub reference_field: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub value_field: ::core::option::Option, + #[prost(message, optional, tag = "9")] + pub datasheet_field: ::core::option::Option, + #[prost(message, optional, tag = "10")] + pub description_field: ::core::option::Option, + #[prost(message, optional, tag = "11")] + pub attributes: ::core::option::Option, + #[prost(message, optional, tag = "12")] + pub overrides: ::core::option::Option, + /// The sheet path to the associated symbol for this footprint instance, if one exists + #[prost(message, optional, tag = "13")] + pub symbol_path: ::core::option::Option, + /// The name of the hierarchical sheet the associated symbol for this footprint exists on, + /// or the empty string if there is no associated symbol + /// Since: 9.0.7 + #[prost(string, tag = "14")] + pub symbol_sheet_name: ::prost::alloc::string::String, + /// The filename of the hierarchical sheet the associated symbol for this footprint exists on, + /// or the empty string if there is no associated symbol + /// Since: 9.0.7 + #[prost(string, tag = "15")] + pub symbol_sheet_filename: ::prost::alloc::string::String, + /// The the footprint filters given by the symbol this footprint is associated with, + /// or the empty string if there is no associated symbol + /// Since: 9.0.7 + #[prost(string, tag = "16")] + pub symbol_footprint_filters: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum BoardLayer { + BlUnknown = 0, + BlUndefined = 1, + BlUnselected = 2, + BlFCu = 3, + BlIn1Cu = 4, + BlIn2Cu = 5, + BlIn3Cu = 6, + BlIn4Cu = 7, + BlIn5Cu = 8, + BlIn6Cu = 9, + BlIn7Cu = 10, + BlIn8Cu = 11, + BlIn9Cu = 12, + BlIn10Cu = 13, + BlIn11Cu = 14, + BlIn12Cu = 15, + BlIn13Cu = 16, + BlIn14Cu = 17, + BlIn15Cu = 18, + BlIn16Cu = 19, + BlIn17Cu = 20, + BlIn18Cu = 21, + BlIn19Cu = 22, + BlIn20Cu = 23, + BlIn21Cu = 24, + BlIn22Cu = 25, + BlIn23Cu = 26, + BlIn24Cu = 27, + BlIn25Cu = 28, + BlIn26Cu = 29, + BlIn27Cu = 30, + BlIn28Cu = 31, + BlIn29Cu = 32, + BlIn30Cu = 33, + BlBCu = 34, + BlBAdhes = 35, + BlFAdhes = 36, + BlBPaste = 37, + BlFPaste = 38, + BlBSilkS = 39, + BlFSilkS = 40, + BlBMask = 41, + BlFMask = 42, + BlDwgsUser = 43, + BlCmtsUser = 44, + BlEco1User = 45, + BlEco2User = 46, + BlEdgeCuts = 47, + BlMargin = 48, + BlBCrtYd = 49, + BlFCrtYd = 50, + BlBFab = 51, + BlFFab = 52, + BlUser1 = 53, + BlUser2 = 54, + BlUser3 = 55, + BlUser4 = 56, + BlUser5 = 57, + BlUser6 = 58, + BlUser7 = 59, + BlUser8 = 60, + BlUser9 = 61, + BlRescue = 62, + BlUser10 = 63, + BlUser11 = 64, + BlUser12 = 65, + BlUser13 = 66, + BlUser14 = 67, + BlUser15 = 68, + BlUser16 = 69, + BlUser17 = 70, + BlUser18 = 71, + BlUser19 = 72, + BlUser20 = 73, + BlUser21 = 74, + BlUser22 = 75, + BlUser23 = 76, + BlUser24 = 77, + BlUser25 = 78, + BlUser26 = 79, + BlUser27 = 80, + BlUser28 = 81, + BlUser29 = 82, + BlUser30 = 83, + BlUser31 = 84, + BlUser32 = 85, + BlUser33 = 86, + BlUser34 = 87, + BlUser35 = 88, + BlUser36 = 89, + BlUser37 = 90, + BlUser38 = 91, + BlUser39 = 92, + BlUser40 = 93, + BlUser41 = 94, + BlUser42 = 95, + BlUser43 = 96, + BlUser44 = 97, + BlUser45 = 98, +} +impl BoardLayer { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::BlUnknown => "BL_UNKNOWN", + Self::BlUndefined => "BL_UNDEFINED", + Self::BlUnselected => "BL_UNSELECTED", + Self::BlFCu => "BL_F_Cu", + Self::BlIn1Cu => "BL_In1_Cu", + Self::BlIn2Cu => "BL_In2_Cu", + Self::BlIn3Cu => "BL_In3_Cu", + Self::BlIn4Cu => "BL_In4_Cu", + Self::BlIn5Cu => "BL_In5_Cu", + Self::BlIn6Cu => "BL_In6_Cu", + Self::BlIn7Cu => "BL_In7_Cu", + Self::BlIn8Cu => "BL_In8_Cu", + Self::BlIn9Cu => "BL_In9_Cu", + Self::BlIn10Cu => "BL_In10_Cu", + Self::BlIn11Cu => "BL_In11_Cu", + Self::BlIn12Cu => "BL_In12_Cu", + Self::BlIn13Cu => "BL_In13_Cu", + Self::BlIn14Cu => "BL_In14_Cu", + Self::BlIn15Cu => "BL_In15_Cu", + Self::BlIn16Cu => "BL_In16_Cu", + Self::BlIn17Cu => "BL_In17_Cu", + Self::BlIn18Cu => "BL_In18_Cu", + Self::BlIn19Cu => "BL_In19_Cu", + Self::BlIn20Cu => "BL_In20_Cu", + Self::BlIn21Cu => "BL_In21_Cu", + Self::BlIn22Cu => "BL_In22_Cu", + Self::BlIn23Cu => "BL_In23_Cu", + Self::BlIn24Cu => "BL_In24_Cu", + Self::BlIn25Cu => "BL_In25_Cu", + Self::BlIn26Cu => "BL_In26_Cu", + Self::BlIn27Cu => "BL_In27_Cu", + Self::BlIn28Cu => "BL_In28_Cu", + Self::BlIn29Cu => "BL_In29_Cu", + Self::BlIn30Cu => "BL_In30_Cu", + Self::BlBCu => "BL_B_Cu", + Self::BlBAdhes => "BL_B_Adhes", + Self::BlFAdhes => "BL_F_Adhes", + Self::BlBPaste => "BL_B_Paste", + Self::BlFPaste => "BL_F_Paste", + Self::BlBSilkS => "BL_B_SilkS", + Self::BlFSilkS => "BL_F_SilkS", + Self::BlBMask => "BL_B_Mask", + Self::BlFMask => "BL_F_Mask", + Self::BlDwgsUser => "BL_Dwgs_User", + Self::BlCmtsUser => "BL_Cmts_User", + Self::BlEco1User => "BL_Eco1_User", + Self::BlEco2User => "BL_Eco2_User", + Self::BlEdgeCuts => "BL_Edge_Cuts", + Self::BlMargin => "BL_Margin", + Self::BlBCrtYd => "BL_B_CrtYd", + Self::BlFCrtYd => "BL_F_CrtYd", + Self::BlBFab => "BL_B_Fab", + Self::BlFFab => "BL_F_Fab", + Self::BlUser1 => "BL_User_1", + Self::BlUser2 => "BL_User_2", + Self::BlUser3 => "BL_User_3", + Self::BlUser4 => "BL_User_4", + Self::BlUser5 => "BL_User_5", + Self::BlUser6 => "BL_User_6", + Self::BlUser7 => "BL_User_7", + Self::BlUser8 => "BL_User_8", + Self::BlUser9 => "BL_User_9", + Self::BlRescue => "BL_Rescue", + Self::BlUser10 => "BL_User_10", + Self::BlUser11 => "BL_User_11", + Self::BlUser12 => "BL_User_12", + Self::BlUser13 => "BL_User_13", + Self::BlUser14 => "BL_User_14", + Self::BlUser15 => "BL_User_15", + Self::BlUser16 => "BL_User_16", + Self::BlUser17 => "BL_User_17", + Self::BlUser18 => "BL_User_18", + Self::BlUser19 => "BL_User_19", + Self::BlUser20 => "BL_User_20", + Self::BlUser21 => "BL_User_21", + Self::BlUser22 => "BL_User_22", + Self::BlUser23 => "BL_User_23", + Self::BlUser24 => "BL_User_24", + Self::BlUser25 => "BL_User_25", + Self::BlUser26 => "BL_User_26", + Self::BlUser27 => "BL_User_27", + Self::BlUser28 => "BL_User_28", + Self::BlUser29 => "BL_User_29", + Self::BlUser30 => "BL_User_30", + Self::BlUser31 => "BL_User_31", + Self::BlUser32 => "BL_User_32", + Self::BlUser33 => "BL_User_33", + Self::BlUser34 => "BL_User_34", + Self::BlUser35 => "BL_User_35", + Self::BlUser36 => "BL_User_36", + Self::BlUser37 => "BL_User_37", + Self::BlUser38 => "BL_User_38", + Self::BlUser39 => "BL_User_39", + Self::BlUser40 => "BL_User_40", + Self::BlUser41 => "BL_User_41", + Self::BlUser42 => "BL_User_42", + Self::BlUser43 => "BL_User_43", + Self::BlUser44 => "BL_User_44", + Self::BlUser45 => "BL_User_45", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BL_UNKNOWN" => Some(Self::BlUnknown), + "BL_UNDEFINED" => Some(Self::BlUndefined), + "BL_UNSELECTED" => Some(Self::BlUnselected), + "BL_F_Cu" => Some(Self::BlFCu), + "BL_In1_Cu" => Some(Self::BlIn1Cu), + "BL_In2_Cu" => Some(Self::BlIn2Cu), + "BL_In3_Cu" => Some(Self::BlIn3Cu), + "BL_In4_Cu" => Some(Self::BlIn4Cu), + "BL_In5_Cu" => Some(Self::BlIn5Cu), + "BL_In6_Cu" => Some(Self::BlIn6Cu), + "BL_In7_Cu" => Some(Self::BlIn7Cu), + "BL_In8_Cu" => Some(Self::BlIn8Cu), + "BL_In9_Cu" => Some(Self::BlIn9Cu), + "BL_In10_Cu" => Some(Self::BlIn10Cu), + "BL_In11_Cu" => Some(Self::BlIn11Cu), + "BL_In12_Cu" => Some(Self::BlIn12Cu), + "BL_In13_Cu" => Some(Self::BlIn13Cu), + "BL_In14_Cu" => Some(Self::BlIn14Cu), + "BL_In15_Cu" => Some(Self::BlIn15Cu), + "BL_In16_Cu" => Some(Self::BlIn16Cu), + "BL_In17_Cu" => Some(Self::BlIn17Cu), + "BL_In18_Cu" => Some(Self::BlIn18Cu), + "BL_In19_Cu" => Some(Self::BlIn19Cu), + "BL_In20_Cu" => Some(Self::BlIn20Cu), + "BL_In21_Cu" => Some(Self::BlIn21Cu), + "BL_In22_Cu" => Some(Self::BlIn22Cu), + "BL_In23_Cu" => Some(Self::BlIn23Cu), + "BL_In24_Cu" => Some(Self::BlIn24Cu), + "BL_In25_Cu" => Some(Self::BlIn25Cu), + "BL_In26_Cu" => Some(Self::BlIn26Cu), + "BL_In27_Cu" => Some(Self::BlIn27Cu), + "BL_In28_Cu" => Some(Self::BlIn28Cu), + "BL_In29_Cu" => Some(Self::BlIn29Cu), + "BL_In30_Cu" => Some(Self::BlIn30Cu), + "BL_B_Cu" => Some(Self::BlBCu), + "BL_B_Adhes" => Some(Self::BlBAdhes), + "BL_F_Adhes" => Some(Self::BlFAdhes), + "BL_B_Paste" => Some(Self::BlBPaste), + "BL_F_Paste" => Some(Self::BlFPaste), + "BL_B_SilkS" => Some(Self::BlBSilkS), + "BL_F_SilkS" => Some(Self::BlFSilkS), + "BL_B_Mask" => Some(Self::BlBMask), + "BL_F_Mask" => Some(Self::BlFMask), + "BL_Dwgs_User" => Some(Self::BlDwgsUser), + "BL_Cmts_User" => Some(Self::BlCmtsUser), + "BL_Eco1_User" => Some(Self::BlEco1User), + "BL_Eco2_User" => Some(Self::BlEco2User), + "BL_Edge_Cuts" => Some(Self::BlEdgeCuts), + "BL_Margin" => Some(Self::BlMargin), + "BL_B_CrtYd" => Some(Self::BlBCrtYd), + "BL_F_CrtYd" => Some(Self::BlFCrtYd), + "BL_B_Fab" => Some(Self::BlBFab), + "BL_F_Fab" => Some(Self::BlFFab), + "BL_User_1" => Some(Self::BlUser1), + "BL_User_2" => Some(Self::BlUser2), + "BL_User_3" => Some(Self::BlUser3), + "BL_User_4" => Some(Self::BlUser4), + "BL_User_5" => Some(Self::BlUser5), + "BL_User_6" => Some(Self::BlUser6), + "BL_User_7" => Some(Self::BlUser7), + "BL_User_8" => Some(Self::BlUser8), + "BL_User_9" => Some(Self::BlUser9), + "BL_Rescue" => Some(Self::BlRescue), + "BL_User_10" => Some(Self::BlUser10), + "BL_User_11" => Some(Self::BlUser11), + "BL_User_12" => Some(Self::BlUser12), + "BL_User_13" => Some(Self::BlUser13), + "BL_User_14" => Some(Self::BlUser14), + "BL_User_15" => Some(Self::BlUser15), + "BL_User_16" => Some(Self::BlUser16), + "BL_User_17" => Some(Self::BlUser17), + "BL_User_18" => Some(Self::BlUser18), + "BL_User_19" => Some(Self::BlUser19), + "BL_User_20" => Some(Self::BlUser20), + "BL_User_21" => Some(Self::BlUser21), + "BL_User_22" => Some(Self::BlUser22), + "BL_User_23" => Some(Self::BlUser23), + "BL_User_24" => Some(Self::BlUser24), + "BL_User_25" => Some(Self::BlUser25), + "BL_User_26" => Some(Self::BlUser26), + "BL_User_27" => Some(Self::BlUser27), + "BL_User_28" => Some(Self::BlUser28), + "BL_User_29" => Some(Self::BlUser29), + "BL_User_30" => Some(Self::BlUser30), + "BL_User_31" => Some(Self::BlUser31), + "BL_User_32" => Some(Self::BlUser32), + "BL_User_33" => Some(Self::BlUser33), + "BL_User_34" => Some(Self::BlUser34), + "BL_User_35" => Some(Self::BlUser35), + "BL_User_36" => Some(Self::BlUser36), + "BL_User_37" => Some(Self::BlUser37), + "BL_User_38" => Some(Self::BlUser38), + "BL_User_39" => Some(Self::BlUser39), + "BL_User_40" => Some(Self::BlUser40), + "BL_User_41" => Some(Self::BlUser41), + "BL_User_42" => Some(Self::BlUser42), + "BL_User_43" => Some(Self::BlUser43), + "BL_User_44" => Some(Self::BlUser44), + "BL_User_45" => Some(Self::BlUser45), + _ => None, + } + } +} +/// What copper layer shape mode the padstack uses +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PadStackType { + PstUnknown = 0, + /// The same shape is used on all copper layers + PstNormal = 1, + /// The padstack uses up to three different shapes (F_Cu, inner layers, B_Cu) + PstFrontInnerBack = 2, + /// The padstack's shape may differ on arbitrary copper layers + PstCustom = 3, +} +impl PadStackType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::PstUnknown => "PST_UNKNOWN", + Self::PstNormal => "PST_NORMAL", + Self::PstFrontInnerBack => "PST_FRONT_INNER_BACK", + Self::PstCustom => "PST_CUSTOM", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PST_UNKNOWN" => Some(Self::PstUnknown), + "PST_NORMAL" => Some(Self::PstNormal), + "PST_FRONT_INNER_BACK" => Some(Self::PstFrontInnerBack), + "PST_CUSTOM" => Some(Self::PstCustom), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum UnconnectedLayerRemoval { + UlrUnknown = 0, + /// Keep annular rings on all layers + UlrKeep = 1, + /// Remove annular rings on unconnected layers, including start and end layers. + UlrRemove = 2, + /// Remove annular rings on unconnected layers, but preserve start and end layers even if unconnected. + UlrRemoveExceptStartAndEnd = 3, + /// Keep annular rings only on the start and end layers regardless of connections. + /// Since: 10.0.0 + UlrStartEndOnly = 4, +} +impl UnconnectedLayerRemoval { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::UlrUnknown => "ULR_UNKNOWN", + Self::UlrKeep => "ULR_KEEP", + Self::UlrRemove => "ULR_REMOVE", + Self::UlrRemoveExceptStartAndEnd => "ULR_REMOVE_EXCEPT_START_AND_END", + Self::UlrStartEndOnly => "ULR_START_END_ONLY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ULR_UNKNOWN" => Some(Self::UlrUnknown), + "ULR_KEEP" => Some(Self::UlrKeep), + "ULR_REMOVE" => Some(Self::UlrRemove), + "ULR_REMOVE_EXCEPT_START_AND_END" => Some(Self::UlrRemoveExceptStartAndEnd), + "ULR_START_END_ONLY" => Some(Self::UlrStartEndOnly), + _ => None, + } + } +} +/// The shape of a pad on a given layer +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PadStackShape { + PssUnknown = 0, + PssCircle = 1, + PssRectangle = 2, + PssOval = 3, + PssTrapezoid = 4, + PssRoundrect = 5, + PssChamferedrect = 6, + PssCustom = 7, +} +impl PadStackShape { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::PssUnknown => "PSS_UNKNOWN", + Self::PssCircle => "PSS_CIRCLE", + Self::PssRectangle => "PSS_RECTANGLE", + Self::PssOval => "PSS_OVAL", + Self::PssTrapezoid => "PSS_TRAPEZOID", + Self::PssRoundrect => "PSS_ROUNDRECT", + Self::PssChamferedrect => "PSS_CHAMFEREDRECT", + Self::PssCustom => "PSS_CUSTOM", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PSS_UNKNOWN" => Some(Self::PssUnknown), + "PSS_CIRCLE" => Some(Self::PssCircle), + "PSS_RECTANGLE" => Some(Self::PssRectangle), + "PSS_OVAL" => Some(Self::PssOval), + "PSS_TRAPEZOID" => Some(Self::PssTrapezoid), + "PSS_ROUNDRECT" => Some(Self::PssRoundrect), + "PSS_CHAMFEREDRECT" => Some(Self::PssChamferedrect), + "PSS_CUSTOM" => Some(Self::PssCustom), + _ => None, + } + } +} +/// enum class ZONE_CONNECTION +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ZoneConnectionStyle { + ZcsUnknown = 0, + ZcsInherited = 1, + ZcsNone = 2, + ZcsThermal = 3, + ZcsFull = 4, + /// Thermal reliefs for plated through holes, solid for SMD pads + ZcsPthThermal = 5, +} +impl ZoneConnectionStyle { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::ZcsUnknown => "ZCS_UNKNOWN", + Self::ZcsInherited => "ZCS_INHERITED", + Self::ZcsNone => "ZCS_NONE", + Self::ZcsThermal => "ZCS_THERMAL", + Self::ZcsFull => "ZCS_FULL", + Self::ZcsPthThermal => "ZCS_PTH_THERMAL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ZCS_UNKNOWN" => Some(Self::ZcsUnknown), + "ZCS_INHERITED" => Some(Self::ZcsInherited), + "ZCS_NONE" => Some(Self::ZcsNone), + "ZCS_THERMAL" => Some(Self::ZcsThermal), + "ZCS_FULL" => Some(Self::ZcsFull), + "ZCS_PTH_THERMAL" => Some(Self::ZcsPthThermal), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum SolderMaskMode { + SmmUnknown = 0, + SmmMasked = 1, + SmmUnmasked = 2, + SmmFromDesignRules = 3, +} +impl SolderMaskMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::SmmUnknown => "SMM_UNKNOWN", + Self::SmmMasked => "SMM_MASKED", + Self::SmmUnmasked => "SMM_UNMASKED", + Self::SmmFromDesignRules => "SMM_FROM_DESIGN_RULES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SMM_UNKNOWN" => Some(Self::SmmUnknown), + "SMM_MASKED" => Some(Self::SmmMasked), + "SMM_UNMASKED" => Some(Self::SmmUnmasked), + "SMM_FROM_DESIGN_RULES" => Some(Self::SmmFromDesignRules), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ViaCoveringMode { + VcmUnknown = 0, + VcmCovered = 1, + VcmUncovered = 2, + VcmFromDesignRules = 3, +} +impl ViaCoveringMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::VcmUnknown => "VCM_UNKNOWN", + Self::VcmCovered => "VCM_COVERED", + Self::VcmUncovered => "VCM_UNCOVERED", + Self::VcmFromDesignRules => "VCM_FROM_DESIGN_RULES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VCM_UNKNOWN" => Some(Self::VcmUnknown), + "VCM_COVERED" => Some(Self::VcmCovered), + "VCM_UNCOVERED" => Some(Self::VcmUncovered), + "VCM_FROM_DESIGN_RULES" => Some(Self::VcmFromDesignRules), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ViaPluggingMode { + VpmUnknown = 0, + VpmPlugged = 1, + VpmUnplugged = 2, + VpmFromDesignRules = 3, +} +impl ViaPluggingMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::VpmUnknown => "VPM_UNKNOWN", + Self::VpmPlugged => "VPM_PLUGGED", + Self::VpmUnplugged => "VPM_UNPLUGGED", + Self::VpmFromDesignRules => "VPM_FROM_DESIGN_RULES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VPM_UNKNOWN" => Some(Self::VpmUnknown), + "VPM_PLUGGED" => Some(Self::VpmPlugged), + "VPM_UNPLUGGED" => Some(Self::VpmUnplugged), + "VPM_FROM_DESIGN_RULES" => Some(Self::VpmFromDesignRules), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum SolderPasteMode { + SpmUnknown = 0, + SpmPaste = 1, + SpmNoPaste = 2, + SpmFromDesignRules = 3, +} +impl SolderPasteMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::SpmUnknown => "SPM_UNKNOWN", + Self::SpmPaste => "SPM_PASTE", + Self::SpmNoPaste => "SPM_NO_PASTE", + Self::SpmFromDesignRules => "SPM_FROM_DESIGN_RULES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SPM_UNKNOWN" => Some(Self::SpmUnknown), + "SPM_PASTE" => Some(Self::SpmPaste), + "SPM_NO_PASTE" => Some(Self::SpmNoPaste), + "SPM_FROM_DESIGN_RULES" => Some(Self::SpmFromDesignRules), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DrillShape { + DsUnknown = 0, + DsCircle = 1, + DsOblong = 2, + DsUndefined = 3, +} +impl DrillShape { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DsUnknown => "DS_UNKNOWN", + Self::DsCircle => "DS_CIRCLE", + Self::DsOblong => "DS_OBLONG", + Self::DsUndefined => "DS_UNDEFINED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DS_UNKNOWN" => Some(Self::DsUnknown), + "DS_CIRCLE" => Some(Self::DsCircle), + "DS_OBLONG" => Some(Self::DsOblong), + "DS_UNDEFINED" => Some(Self::DsUndefined), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ViaDrillCappingMode { + VdcmUnknown = 0, + VdcmCapped = 1, + VdcmUncapped = 2, + VdcmFromDesignRules = 3, +} +impl ViaDrillCappingMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::VdcmUnknown => "VDCM_UNKNOWN", + Self::VdcmCapped => "VDCM_CAPPED", + Self::VdcmUncapped => "VDCM_UNCAPPED", + Self::VdcmFromDesignRules => "VDCM_FROM_DESIGN_RULES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VDCM_UNKNOWN" => Some(Self::VdcmUnknown), + "VDCM_CAPPED" => Some(Self::VdcmCapped), + "VDCM_UNCAPPED" => Some(Self::VdcmUncapped), + "VDCM_FROM_DESIGN_RULES" => Some(Self::VdcmFromDesignRules), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ViaDrillFillingMode { + VdfmUnknown = 0, + VdfmFilled = 1, + VdfmUnfilled = 2, + VdfmFromDesignRules = 3, +} +impl ViaDrillFillingMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::VdfmUnknown => "VDFM_UNKNOWN", + Self::VdfmFilled => "VDFM_FILLED", + Self::VdfmUnfilled => "VDFM_UNFILLED", + Self::VdfmFromDesignRules => "VDFM_FROM_DESIGN_RULES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VDFM_UNKNOWN" => Some(Self::VdfmUnknown), + "VDFM_FILLED" => Some(Self::VdfmFilled), + "VDFM_UNFILLED" => Some(Self::VdfmUnfilled), + "VDFM_FROM_DESIGN_RULES" => Some(Self::VdfmFromDesignRules), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ViaDrillPostMachiningMode { + VdpmUnknown = 0, + VdpmNotPostMachined = 1, + VdpmCounterbore = 2, + VdpmCountersink = 3, +} +impl ViaDrillPostMachiningMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::VdpmUnknown => "VDPM_UNKNOWN", + Self::VdpmNotPostMachined => "VDPM_NOT_POST_MACHINED", + Self::VdpmCounterbore => "VDPM_COUNTERBORE", + Self::VdpmCountersink => "VDPM_COUNTERSINK", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VDPM_UNKNOWN" => Some(Self::VdpmUnknown), + "VDPM_NOT_POST_MACHINED" => Some(Self::VdpmNotPostMachined), + "VDPM_COUNTERBORE" => Some(Self::VdpmCounterbore), + "VDPM_COUNTERSINK" => Some(Self::VdpmCountersink), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ViaType { + VtUnknown = 0, + /// Through vias always start on F_Cu and end on B_Cu + VtThrough = 1, + /// Blind/buried vias can have arbitrary start and end layers + VtBlindBuried = 2, + /// Microvias, blind/buried vias, can have arbitrary start and end layers, but also have different + /// size defaults and design rules + VtMicro = 3, + /// Blind vias start on an outer layer and end in the middle + /// + /// Since V10 + VtBlind = 4, + /// Buried vias start and end on inner layers + /// + /// Since V10 + VtBuried = 5, +} +impl ViaType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::VtUnknown => "VT_UNKNOWN", + Self::VtThrough => "VT_THROUGH", + Self::VtBlindBuried => "VT_BLIND_BURIED", + Self::VtMicro => "VT_MICRO", + Self::VtBlind => "VT_BLIND", + Self::VtBuried => "VT_BURIED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VT_UNKNOWN" => Some(Self::VtUnknown), + "VT_THROUGH" => Some(Self::VtThrough), + "VT_BLIND_BURIED" => Some(Self::VtBlindBuried), + "VT_MICRO" => Some(Self::VtMicro), + "VT_BLIND" => Some(Self::VtBlind), + "VT_BURIED" => Some(Self::VtBuried), + _ => None, + } + } +} +/// NOTE: There has been some discussion about what to do with pad attributes and properties. +/// This may be considered somewhat unstable until we decide what to do with the KiCad side. +/// It is not clear what the set of mutually-exclusive pad types will be at the end of the day, +/// versus what will be non-exclusive attributes/properties. +/// For now, this maps to PAD_ATTRIB in KiCad. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PadType { + PtUnknown = 0, + PtPth = 1, + PtSmd = 2, + PtEdgeConnector = 3, + PtNpth = 4, +} +impl PadType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::PtUnknown => "PT_UNKNOWN", + Self::PtPth => "PT_PTH", + Self::PtSmd => "PT_SMD", + Self::PtEdgeConnector => "PT_EDGE_CONNECTOR", + Self::PtNpth => "PT_NPTH", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PT_UNKNOWN" => Some(Self::PtUnknown), + "PT_PTH" => Some(Self::PtPth), + "PT_SMD" => Some(Self::PtSmd), + "PT_EDGE_CONNECTOR" => Some(Self::PtEdgeConnector), + "PT_NPTH" => Some(Self::PtNpth), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum CustomPadShapeZoneFillStrategy { + CpszUnknown = 0, + CpszOutline = 1, + CpszConvexhull = 2, +} +impl CustomPadShapeZoneFillStrategy { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::CpszUnknown => "CPSZ_UNKNOWN", + Self::CpszOutline => "CPSZ_OUTLINE", + Self::CpszConvexhull => "CPSZ_CONVEXHULL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CPSZ_UNKNOWN" => Some(Self::CpszUnknown), + "CPSZ_OUTLINE" => Some(Self::CpszOutline), + "CPSZ_CONVEXHULL" => Some(Self::CpszConvexhull), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ZoneType { + ZtUnknown = 0, + ZtCopper = 1, + ZtGraphical = 2, + ZtRuleArea = 3, + ZtTeardrop = 4, +} +impl ZoneType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::ZtUnknown => "ZT_UNKNOWN", + Self::ZtCopper => "ZT_COPPER", + Self::ZtGraphical => "ZT_GRAPHICAL", + Self::ZtRuleArea => "ZT_RULE_AREA", + Self::ZtTeardrop => "ZT_TEARDROP", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ZT_UNKNOWN" => Some(Self::ZtUnknown), + "ZT_COPPER" => Some(Self::ZtCopper), + "ZT_GRAPHICAL" => Some(Self::ZtGraphical), + "ZT_RULE_AREA" => Some(Self::ZtRuleArea), + "ZT_TEARDROP" => Some(Self::ZtTeardrop), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum TeardropType { + TdtUnknown = 0, + TdtNone = 1, + TdtUnspecified = 2, + TdtViaPad = 3, + TdtTrackEnd = 4, +} +impl TeardropType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::TdtUnknown => "TDT_UNKNOWN", + Self::TdtNone => "TDT_NONE", + Self::TdtUnspecified => "TDT_UNSPECIFIED", + Self::TdtViaPad => "TDT_VIA_PAD", + Self::TdtTrackEnd => "TDT_TRACK_END", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TDT_UNKNOWN" => Some(Self::TdtUnknown), + "TDT_NONE" => Some(Self::TdtNone), + "TDT_UNSPECIFIED" => Some(Self::TdtUnspecified), + "TDT_VIA_PAD" => Some(Self::TdtViaPad), + "TDT_TRACK_END" => Some(Self::TdtTrackEnd), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum IslandRemovalMode { + IrmUnknown = 0, + IrmAlways = 1, + IrmNever = 2, + IrmArea = 3, +} +impl IslandRemovalMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::IrmUnknown => "IRM_UNKNOWN", + Self::IrmAlways => "IRM_ALWAYS", + Self::IrmNever => "IRM_NEVER", + Self::IrmArea => "IRM_AREA", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "IRM_UNKNOWN" => Some(Self::IrmUnknown), + "IRM_ALWAYS" => Some(Self::IrmAlways), + "IRM_NEVER" => Some(Self::IrmNever), + "IRM_AREA" => Some(Self::IrmArea), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ZoneFillMode { + ZfmUnknown = 0, + ZfmSolid = 1, + ZfmHatched = 2, +} +impl ZoneFillMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::ZfmUnknown => "ZFM_UNKNOWN", + Self::ZfmSolid => "ZFM_SOLID", + Self::ZfmHatched => "ZFM_HATCHED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ZFM_UNKNOWN" => Some(Self::ZfmUnknown), + "ZFM_SOLID" => Some(Self::ZfmSolid), + "ZFM_HATCHED" => Some(Self::ZfmHatched), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ZoneHatchSmoothing { + ZhsUnknown = 0, + ZhsNone = 1, + ZhsFillet = 2, + ZhsArcLowDef = 3, + ZhsArcHighDef = 4, +} +impl ZoneHatchSmoothing { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::ZhsUnknown => "ZHS_UNKNOWN", + Self::ZhsNone => "ZHS_NONE", + Self::ZhsFillet => "ZHS_FILLET", + Self::ZhsArcLowDef => "ZHS_ARC_LOW_DEF", + Self::ZhsArcHighDef => "ZHS_ARC_HIGH_DEF", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ZHS_UNKNOWN" => Some(Self::ZhsUnknown), + "ZHS_NONE" => Some(Self::ZhsNone), + "ZHS_FILLET" => Some(Self::ZhsFillet), + "ZHS_ARC_LOW_DEF" => Some(Self::ZhsArcLowDef), + "ZHS_ARC_HIGH_DEF" => Some(Self::ZhsArcHighDef), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ZoneHatchFillBorderMode { + ZhfbmUnknown = 0, + ZhfbmUseMinZoneThickness = 1, + ZhfbmUseHatchThickness = 2, +} +impl ZoneHatchFillBorderMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::ZhfbmUnknown => "ZHFBM_UNKNOWN", + Self::ZhfbmUseMinZoneThickness => "ZHFBM_USE_MIN_ZONE_THICKNESS", + Self::ZhfbmUseHatchThickness => "ZHFBM_USE_HATCH_THICKNESS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ZHFBM_UNKNOWN" => Some(Self::ZhfbmUnknown), + "ZHFBM_USE_MIN_ZONE_THICKNESS" => Some(Self::ZhfbmUseMinZoneThickness), + "ZHFBM_USE_HATCH_THICKNESS" => Some(Self::ZhfbmUseHatchThickness), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PlacementRuleSourceType { + PrstUnknown = 0, + PrstSheetName = 1, + PrstComponentClass = 2, + PrstGroup = 3, + PrstDesignBlock = 4, +} +impl PlacementRuleSourceType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::PrstUnknown => "PRST_UNKNOWN", + Self::PrstSheetName => "PRST_SHEET_NAME", + Self::PrstComponentClass => "PRST_COMPONENT_CLASS", + Self::PrstGroup => "PRST_GROUP", + Self::PrstDesignBlock => "PRST_DESIGN_BLOCK", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PRST_UNKNOWN" => Some(Self::PrstUnknown), + "PRST_SHEET_NAME" => Some(Self::PrstSheetName), + "PRST_COMPONENT_CLASS" => Some(Self::PrstComponentClass), + "PRST_GROUP" => Some(Self::PrstGroup), + "PRST_DESIGN_BLOCK" => Some(Self::PrstDesignBlock), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ZoneBorderStyle { + ZbsUnknown = 0, + ZbsSolid = 1, + ZbsDiagonalFull = 2, + ZbsDiagonalEdge = 3, + ZbsInvisible = 4, +} +impl ZoneBorderStyle { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::ZbsUnknown => "ZBS_UNKNOWN", + Self::ZbsSolid => "ZBS_SOLID", + Self::ZbsDiagonalFull => "ZBS_DIAGONAL_FULL", + Self::ZbsDiagonalEdge => "ZBS_DIAGONAL_EDGE", + Self::ZbsInvisible => "ZBS_INVISIBLE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ZBS_UNKNOWN" => Some(Self::ZbsUnknown), + "ZBS_SOLID" => Some(Self::ZbsSolid), + "ZBS_DIAGONAL_FULL" => Some(Self::ZbsDiagonalFull), + "ZBS_DIAGONAL_EDGE" => Some(Self::ZbsDiagonalEdge), + "ZBS_INVISIBLE" => Some(Self::ZbsInvisible), + _ => None, + } + } +} +/// The style of the optional frame applied to dimension text +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DimensionTextBorderStyle { + DtbsUnknown = 0, + DtbsNone = 1, + DtbsRectangle = 2, + DtbsCircle = 3, + DtbsRoundrect = 4, +} +impl DimensionTextBorderStyle { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DtbsUnknown => "DTBS_UNKNOWN", + Self::DtbsNone => "DTBS_NONE", + Self::DtbsRectangle => "DTBS_RECTANGLE", + Self::DtbsCircle => "DTBS_CIRCLE", + Self::DtbsRoundrect => "DTBS_ROUNDRECT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DTBS_UNKNOWN" => Some(Self::DtbsUnknown), + "DTBS_NONE" => Some(Self::DtbsNone), + "DTBS_RECTANGLE" => Some(Self::DtbsRectangle), + "DTBS_CIRCLE" => Some(Self::DtbsCircle), + "DTBS_ROUNDRECT" => Some(Self::DtbsRoundrect), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DimensionUnitFormat { + DufUnknown = 0, + DufNoSuffix = 1, + DufBareSuffix = 2, + DufParenSuffix = 3, +} +impl DimensionUnitFormat { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DufUnknown => "DUF_UNKNOWN", + Self::DufNoSuffix => "DUF_NO_SUFFIX", + Self::DufBareSuffix => "DUF_BARE_SUFFIX", + Self::DufParenSuffix => "DUF_PAREN_SUFFIX", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DUF_UNKNOWN" => Some(Self::DufUnknown), + "DUF_NO_SUFFIX" => Some(Self::DufNoSuffix), + "DUF_BARE_SUFFIX" => Some(Self::DufBareSuffix), + "DUF_PAREN_SUFFIX" => Some(Self::DufParenSuffix), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DimensionArrowDirection { + DadUnknown = 0, + DadInward = 1, + DadOutward = 2, +} +impl DimensionArrowDirection { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DadUnknown => "DAD_UNKNOWN", + Self::DadInward => "DAD_INWARD", + Self::DadOutward => "DAD_OUTWARD", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DAD_UNKNOWN" => Some(Self::DadUnknown), + "DAD_INWARD" => Some(Self::DadInward), + "DAD_OUTWARD" => Some(Self::DadOutward), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DimensionPrecision { + DpUnknown = 0, + /// No digits after decimal point + DpFixed0 = 1, + /// 1 digit after decimal point + DpFixed1 = 2, + /// 2 digits after decimal point + DpFixed2 = 3, + /// 3 digits after decimal point + DpFixed3 = 4, + /// 4 digits after decimal point + DpFixed4 = 5, + /// 5 digits after decimal point + DpFixed5 = 6, + /// Precision depends on unit selection; 2 digits for inches, 0 for mils, 1 for mm + DpScaledIn2 = 7, + /// Precision depends on unit selection; 3 digits for inches, 0 for mils, 2 for mm + DpScaledIn3 = 8, + /// Precision depends on unit selection; 4 digits for inches, 1 for mils, 3 for mm + DpScaledIn4 = 9, + /// Precision depends on unit selection; 5 digits for inches, 2 for mils, 4 for mm + DpScaledIn5 = 10, +} +impl DimensionPrecision { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DpUnknown => "DP_UNKNOWN", + Self::DpFixed0 => "DP_FIXED_0", + Self::DpFixed1 => "DP_FIXED_1", + Self::DpFixed2 => "DP_FIXED_2", + Self::DpFixed3 => "DP_FIXED_3", + Self::DpFixed4 => "DP_FIXED_4", + Self::DpFixed5 => "DP_FIXED_5", + Self::DpScaledIn2 => "DP_SCALED_IN_2", + Self::DpScaledIn3 => "DP_SCALED_IN_3", + Self::DpScaledIn4 => "DP_SCALED_IN_4", + Self::DpScaledIn5 => "DP_SCALED_IN_5", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DP_UNKNOWN" => Some(Self::DpUnknown), + "DP_FIXED_0" => Some(Self::DpFixed0), + "DP_FIXED_1" => Some(Self::DpFixed1), + "DP_FIXED_2" => Some(Self::DpFixed2), + "DP_FIXED_3" => Some(Self::DpFixed3), + "DP_FIXED_4" => Some(Self::DpFixed4), + "DP_FIXED_5" => Some(Self::DpFixed5), + "DP_SCALED_IN_2" => Some(Self::DpScaledIn2), + "DP_SCALED_IN_3" => Some(Self::DpScaledIn3), + "DP_SCALED_IN_4" => Some(Self::DpScaledIn4), + "DP_SCALED_IN_5" => Some(Self::DpScaledIn5), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DimensionTextPosition { + DtpUnknown = 0, + DtpOutside = 1, + DtpInline = 2, + DtpManual = 3, +} +impl DimensionTextPosition { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DtpUnknown => "DTP_UNKNOWN", + Self::DtpOutside => "DTP_OUTSIDE", + Self::DtpInline => "DTP_INLINE", + Self::DtpManual => "DTP_MANUAL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DTP_UNKNOWN" => Some(Self::DtpUnknown), + "DTP_OUTSIDE" => Some(Self::DtpOutside), + "DTP_INLINE" => Some(Self::DtpInline), + "DTP_MANUAL" => Some(Self::DtpManual), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DimensionUnit { + DuUnknown = 0, + DuInches = 1, + DuMils = 2, + DuMillimeters = 3, + DuAutomatic = 4, +} +impl DimensionUnit { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DuUnknown => "DU_UNKNOWN", + Self::DuInches => "DU_INCHES", + Self::DuMils => "DU_MILS", + Self::DuMillimeters => "DU_MILLIMETERS", + Self::DuAutomatic => "DU_AUTOMATIC", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DU_UNKNOWN" => Some(Self::DuUnknown), + "DU_INCHES" => Some(Self::DuInches), + "DU_MILS" => Some(Self::DuMils), + "DU_MILLIMETERS" => Some(Self::DuMillimeters), + "DU_AUTOMATIC" => Some(Self::DuAutomatic), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum FootprintMountingStyle { + FmsUnknown = 0, + FmsThroughHole = 1, + FmsSmd = 2, + FmsUnspecified = 3, +} +impl FootprintMountingStyle { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::FmsUnknown => "FMS_UNKNOWN", + Self::FmsThroughHole => "FMS_THROUGH_HOLE", + Self::FmsSmd => "FMS_SMD", + Self::FmsUnspecified => "FMS_UNSPECIFIED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FMS_UNKNOWN" => Some(Self::FmsUnknown), + "FMS_THROUGH_HOLE" => Some(Self::FmsThroughHole), + "FMS_SMD" => Some(Self::FmsSmd), + "FMS_UNSPECIFIED" => Some(Self::FmsUnspecified), + _ => None, + } + } +} diff --git a/src/proto/generated/kiapi.common.commands.rs b/src/proto/generated/kiapi.common.commands.rs new file mode 100644 index 0000000..ba823ff --- /dev/null +++ b/src/proto/generated/kiapi.common.commands.rs @@ -0,0 +1,676 @@ +// This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetVersion {} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetVersionResponse { + #[prost(message, optional, tag = "1")] + pub version: ::core::option::Option, +} +/// A command to check if the connection to KiCad is OK +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Ping {} +/// Returns the full path to the given KiCad binary +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetKiCadBinaryPath { + /// The short name of the binary, such as `kicad-cli` or `kicad-cli.exe`. If on Windows, an `.exe` + /// extension will be assumed if not present. + #[prost(string, tag = "1")] + pub binary_name: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct PathResponse { + #[prost(string, tag = "1")] + pub path: ::prost::alloc::string::String, +} +/// returns kiapi.common.types.Box2 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetTextExtents { + /// A temporary text item to calculate the bounding box for + #[prost(message, optional, tag = "1")] + pub text: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TextOrTextBox { + #[prost(oneof = "text_or_text_box::Inner", tags = "1, 2")] + pub inner: ::core::option::Option, +} +/// Nested message and enum types in `TextOrTextBox`. +pub mod text_or_text_box { + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Inner { + #[prost(message, tag = "1")] + Text(super::super::types::Text), + #[prost(message, tag = "2")] + Textbox(super::super::types::TextBox), + } +} +/// Render the given text object(s) as shapes. Depending on whether the text is using +/// the KiCad stroke font or a custom font, the response will be a compound shape containing +/// a set of polygons or a set of segments. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetTextAsShapes { + #[prost(message, repeated, tag = "1")] + pub text: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TextWithShapes { + #[prost(message, optional, tag = "1")] + pub text: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub shapes: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetTextAsShapesResponse { + #[prost(message, repeated, tag = "1")] + pub text_with_shapes: ::prost::alloc::vec::Vec, +} +/// Return a writeable path that a plugin can use for storing persistent data such as configuration +/// files, etc. This path may not yet exist; actual creation of the directory for a given plugin is +/// up to the plugin itself. Files in this path will not be modified if the plugin is uninstalled or +/// upgraded. +/// +/// Returns StringResponse +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetPluginSettingsPath { + /// The identifier of the plugin + #[prost(string, tag = "1")] + pub identifier: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct StringResponse { + #[prost(string, tag = "1")] + pub response: ::prost::alloc::string::String, +} +/// Refreshes the given frame, if that frame is open +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct RefreshEditor { + #[prost(enumeration = "super::types::FrameType", tag = "1")] + pub frame: i32, +} +/// Retrieves a list of open documents of the given type +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetOpenDocuments { + /// Which type of documents to query + #[prost(enumeration = "super::types::DocumentType", tag = "1")] + pub r#type: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetOpenDocumentsResponse { + #[prost(message, repeated, tag = "1")] + pub documents: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SaveDocument { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SaveOptions { + /// Overwrite destination file(s) if they exist + #[prost(bool, tag = "1")] + pub overwrite: bool, + /// If the file being saved normally requires a project (for example, a board or schematic), + /// this flag will cause a new project to be saved alongside the new file + #[prost(bool, tag = "2")] + pub include_project: bool, +} +/// Saves the given document to a new location and does not open the new copy +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SaveCopyOfDocument { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, + #[prost(string, tag = "2")] + pub path: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub options: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RevertDocument { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, +} +/// +/// Runs a TOOL_ACTION using the TOOL_MANAGER of a given frame. +/// WARNING: The TOOL_ACTIONs are specifically *not* an API. +/// Command names may change as code is refactored, and commands may disappear. +/// This API method is provided for low-level prototyping purposes only. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct RunAction { + /// Action name, like "eeschema.InteractiveSelection.ClearSelection" + #[prost(string, tag = "1")] + pub action: ::prost::alloc::string::String, +} +/// +/// NOTE: At the moment, RAS_FRAME_NOT_OPEN won't be returned as the handler is inside the frame. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct RunActionResponse { + #[prost(enumeration = "RunActionStatus", tag = "1")] + pub status: i32, +} +/// +/// Begins a staged set of changes. Any modifications made to a document through the API after this +/// call will be saved to a pending commit, and will not appear in KiCad until a matching call to +/// END_COMMIT. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BeginCommit {} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct BeginCommitResponse { + /// Opaque identifier tracking a commit + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct EndCommit { + /// The ID that was given by BeginCommit + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + /// What to do with this commit + #[prost(enumeration = "CommitAction", tag = "2")] + pub action: i32, + /// Optional message describing this changeset + #[prost(string, tag = "3")] + pub message: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct EndCommitResponse {} +/// Creates new items on a given document +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateItems { + /// Specifies which document to create on, which fields are included, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// List of items to create + #[prost(message, repeated, tag = "2")] + pub items: ::prost::alloc::vec::Vec<::prost_types::Any>, + /// Items may be created on a top-level document (sheet, board, etc) or inside a container + /// (symbol, footprint). If this field is not empty, it holds the ID of a symbol or footprint + /// that the items should be added to. This ID must be an existing symbol (for schematic + /// documents) or footprint (for board documents). If the given container does not exist or is + /// not the correct item type, the CreateItems call will fail. + #[prost(message, optional, tag = "3")] + pub container: ::core::option::Option, +} +/// Per-item status feedback for creation and update calls +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ItemStatus { + #[prost(enumeration = "ItemStatusCode", tag = "1")] + pub code: i32, + #[prost(string, tag = "2")] + pub error_message: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ItemCreationResult { + #[prost(message, optional, tag = "1")] + pub status: ::core::option::Option, + /// The created version of the item, including an updated KIID as applicable + #[prost(message, optional, tag = "2")] + pub item: ::core::option::Option<::prost_types::Any>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateItemsResponse { + /// Specifies which document was modified, which fields are included in created_items, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// Status of the overall request; may return IRS_OK even if no items were created + #[prost(enumeration = "super::types::ItemRequestStatus", tag = "2")] + pub status: i32, + /// Status of each item to be created + #[prost(message, repeated, tag = "3")] + pub created_items: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetItems { + /// Specifies which document to query, which fields to return, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// List of one or more types of items to retreive + #[prost(enumeration = "super::types::KiCadObjectType", repeated, tag = "2")] + pub types: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetItemsById { + /// Specifies which document to query, which fields to return, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub items: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetItemsResponse { + /// Specifies which document was modified, which fields are included in items, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// Status of the overall request; may return IRS_OK even if no items were retrieved + #[prost(enumeration = "super::types::ItemRequestStatus", tag = "2")] + pub status: i32, + #[prost(message, repeated, tag = "3")] + pub items: ::prost::alloc::vec::Vec<::prost_types::Any>, +} +/// Updates items in a given document +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateItems { + /// Specifies which document to modify, which fields are included, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// List of items to modify + #[prost(message, repeated, tag = "2")] + pub items: ::prost::alloc::vec::Vec<::prost_types::Any>, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ItemUpdateResult { + #[prost(message, optional, tag = "1")] + pub status: ::core::option::Option, + /// The update version of the item + #[prost(message, optional, tag = "2")] + pub item: ::core::option::Option<::prost_types::Any>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateItemsResponse { + /// Specifies which document was modified, which fields are included in updated_items, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// Status of the overall request; may return IRS_OK even if no items were modified + #[prost(enumeration = "super::types::ItemRequestStatus", tag = "2")] + pub status: i32, + /// Status of each item to be created + #[prost(message, repeated, tag = "3")] + pub updated_items: ::prost::alloc::vec::Vec, +} +/// Deletes items in a given document +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteItems { + /// Specifies which document to modify + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// List of item KIIDs to delete + #[prost(message, repeated, tag = "2")] + pub item_ids: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ItemDeletionResult { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(enumeration = "ItemDeletionStatus", tag = "2")] + pub status: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteItemsResponse { + /// Specifies which document was modified, etc. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// Status of the overall request; may return IRS_OK even if no items were deleted + #[prost(enumeration = "super::types::ItemRequestStatus", tag = "2")] + pub status: i32, + /// Status of each item requested to be deleted + #[prost(message, repeated, tag = "3")] + pub deleted_items: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetBoundingBox { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub items: ::prost::alloc::vec::Vec, + /// Some item types can have independently-movable text as children (e.g. footprints) + /// This mode controls whether or not these are included in the box + #[prost(enumeration = "BoundingBoxMode", tag = "3")] + pub mode: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetBoundingBoxResponse { + #[prost(message, repeated, tag = "1")] + pub items: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub boxes: ::prost::alloc::vec::Vec, +} +/// Retrieves a list of items. Returns SelectionResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSelection { + /// Specifies which document to query for selected items. + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// An optional list of types to filter on. + /// If none are provided, all selected items will be returned. + #[prost(enumeration = "super::types::KiCadObjectType", repeated, tag = "2")] + pub types: ::prost::alloc::vec::Vec, +} +/// The set of currently selected items +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SelectionResponse { + #[prost(message, repeated, tag = "1")] + pub items: ::prost::alloc::vec::Vec<::prost_types::Any>, +} +/// Adds the given items to the selection. Returns SelectionResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddToSelection { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// The items to select + #[prost(message, repeated, tag = "2")] + pub items: ::prost::alloc::vec::Vec, +} +/// Removes the given items to the selection. Returns SelectionResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveFromSelection { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + /// The items to deselect + #[prost(message, repeated, tag = "2")] + pub items: ::prost::alloc::vec::Vec, +} +/// Removes all items from selection +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClearSelection { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, +} +/// Tests if a certain point falls within tolerance of an item's geometry +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HitTest { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub position: ::core::option::Option, + #[prost(int32, tag = "4")] + pub tolerance: i32, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct HitTestResponse { + #[prost(enumeration = "HitTestResult", tag = "1")] + pub result: i32, +} +/// returns common.types.TitleBlockInfo +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetTitleBlockInfo { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SaveDocumentToString { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SavedDocumentResponse { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, + #[prost(string, tag = "2")] + pub contents: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SaveSelectionToString {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SavedSelectionResponse { + #[prost(message, repeated, tag = "1")] + pub ids: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub contents: ::prost::alloc::string::String, +} +/// Attempts to parse the given string as a s-expression formatted container with items, +/// similar to how the Paste action inside the KiCad editor works. If the parse is successful, +/// the items will be created and inserted into the editor. +/// Returns CreateItemsResponse +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ParseAndCreateItemsFromString { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, + #[prost(string, tag = "2")] + pub contents: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum RunActionStatus { + RasUnknown = 0, + /// The action was submitted successfully. + RasOk = 1, + /// The action was unknown for the targeted frame. + RasInvalid = 2, + /// The targeted frame was not open when the call was submitted. + RasFrameNotOpen = 3, +} +impl RunActionStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::RasUnknown => "RAS_UNKNOWN", + Self::RasOk => "RAS_OK", + Self::RasInvalid => "RAS_INVALID", + Self::RasFrameNotOpen => "RAS_FRAME_NOT_OPEN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RAS_UNKNOWN" => Some(Self::RasUnknown), + "RAS_OK" => Some(Self::RasOk), + "RAS_INVALID" => Some(Self::RasInvalid), + "RAS_FRAME_NOT_OPEN" => Some(Self::RasFrameNotOpen), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum CommitAction { + CmaUnknown = 0, + /// Commit the changes to the design + CmaCommit = 1, + /// Cancel this commit + CmaDrop = 2, +} +impl CommitAction { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::CmaUnknown => "CMA_UNKNOWN", + Self::CmaCommit => "CMA_COMMIT", + Self::CmaDrop => "CMA_DROP", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CMA_UNKNOWN" => Some(Self::CmaUnknown), + "CMA_COMMIT" => Some(Self::CmaCommit), + "CMA_DROP" => Some(Self::CmaDrop), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ItemStatusCode { + IscUnknown = 0, + /// The item was created or updated + IscOk = 1, + /// The item's type is not valid for the given document + IscInvalidType = 2, + /// The item to be created had a specified KIID and that KIID was already in use + IscExisting = 3, + /// The item to be updated did not exist in the given document + IscNonexistent = 4, + /// The item to be updated is not allowed to be modified by the API + IscImmutable = 5, + /// The item to be created does not have valid data for the given document + IscInvalidData = 7, +} +impl ItemStatusCode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::IscUnknown => "ISC_UNKNOWN", + Self::IscOk => "ISC_OK", + Self::IscInvalidType => "ISC_INVALID_TYPE", + Self::IscExisting => "ISC_EXISTING", + Self::IscNonexistent => "ISC_NONEXISTENT", + Self::IscImmutable => "ISC_IMMUTABLE", + Self::IscInvalidData => "ISC_INVALID_DATA", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ISC_UNKNOWN" => Some(Self::IscUnknown), + "ISC_OK" => Some(Self::IscOk), + "ISC_INVALID_TYPE" => Some(Self::IscInvalidType), + "ISC_EXISTING" => Some(Self::IscExisting), + "ISC_NONEXISTENT" => Some(Self::IscNonexistent), + "ISC_IMMUTABLE" => Some(Self::IscImmutable), + "ISC_INVALID_DATA" => Some(Self::IscInvalidData), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ItemDeletionStatus { + IdsUnknown = 0, + IdsOk = 1, + /// The item did not exist in the given document + IdsNonexistent = 2, + /// The item is not allowed to be modified by the API + IdsImmutable = 3, +} +impl ItemDeletionStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::IdsUnknown => "IDS_UNKNOWN", + Self::IdsOk => "IDS_OK", + Self::IdsNonexistent => "IDS_NONEXISTENT", + Self::IdsImmutable => "IDS_IMMUTABLE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "IDS_UNKNOWN" => Some(Self::IdsUnknown), + "IDS_OK" => Some(Self::IdsOk), + "IDS_NONEXISTENT" => Some(Self::IdsNonexistent), + "IDS_IMMUTABLE" => Some(Self::IdsImmutable), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum BoundingBoxMode { + BbmUnknown = 0, + BbmItemOnly = 1, + BbmItemAndChildText = 2, +} +impl BoundingBoxMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::BbmUnknown => "BBM_UNKNOWN", + Self::BbmItemOnly => "BBM_ITEM_ONLY", + Self::BbmItemAndChildText => "BBM_ITEM_AND_CHILD_TEXT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BBM_UNKNOWN" => Some(Self::BbmUnknown), + "BBM_ITEM_ONLY" => Some(Self::BbmItemOnly), + "BBM_ITEM_AND_CHILD_TEXT" => Some(Self::BbmItemAndChildText), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum HitTestResult { + HtrUnknown = 0, + HtrNoHit = 1, + HtrHit = 2, +} +impl HitTestResult { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::HtrUnknown => "HTR_UNKNOWN", + Self::HtrNoHit => "HTR_NO_HIT", + Self::HtrHit => "HTR_HIT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "HTR_UNKNOWN" => Some(Self::HtrUnknown), + "HTR_NO_HIT" => Some(Self::HtrNoHit), + "HTR_HIT" => Some(Self::HtrHit), + _ => None, + } + } +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetNetClasses {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NetClassesResponse { + #[prost(message, repeated, tag = "1")] + pub net_classes: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetNetClasses { + #[prost(message, repeated, tag = "1")] + pub net_classes: ::prost::alloc::vec::Vec, + /// Whether to merge or replace the existing netclasses with the contents of this message + /// Note that this only happens at the level of netclass name: for example, if merge_mode is set to + /// MMM_MERGE, the design has netclasses \["Default", "HV"\], and this message has netclasses + /// \["Default", "LV"\], the resulting set will be \["Default", "HV", "LV"\] -- the Default netclass + /// will have its properties replaced with those in this message, the "LV" netclass will be added, + /// and the "HV" netclass will be left alone. If merge_mode is set to MMM_REPLACE, the "HV" class + /// will be erased. Note that there must always be a "Default" netclass, so it will not be erased + /// even if merge_mode is MMM_REPLACE and there is no "Default" class specified in this message. + #[prost(enumeration = "super::types::MapMergeMode", tag = "3")] + pub merge_mode: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ExpandTextVariables { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, + #[prost(string, repeated, tag = "2")] + pub text: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ExpandTextVariablesResponse { + #[prost(string, repeated, tag = "1")] + pub text: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// returns kiapi.common.project.TextVariables +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetTextVariables { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetTextVariables { + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub variables: ::core::option::Option, + /// Whether to merge or replace the existing text variables map with the contents of this message + #[prost(enumeration = "super::types::MapMergeMode", tag = "3")] + pub merge_mode: i32, +} diff --git a/src/proto/generated/kiapi.common.project.rs b/src/proto/generated/kiapi.common.project.rs new file mode 100644 index 0000000..32b1fe2 --- /dev/null +++ b/src/proto/generated/kiapi.common.project.rs @@ -0,0 +1,97 @@ +// This file is @generated by prost-build. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NetClassBoardSettings { + #[prost(message, optional, tag = "1")] + pub clearance: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub track_width: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub diff_pair_track_width: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub diff_pair_gap: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub diff_pair_via_gap: ::core::option::Option, + /// The default padstack to use for vias belonging to this netclass + /// Currently KiCad only supports specifying the drill diameter and annular size on all layers for + /// netclass via stacks. Complex padstacks and other via features cannot be specified here. + #[prost(message, optional, tag = "6")] + pub via_stack: ::core::option::Option, + /// The default padstack to use for microvias belonging to this netclass + /// Currently KiCad only supports specifying the drill diameter and annular size on all layers for + /// netclass via stacks. Complex padstacks and other via features cannot be specified here. + #[prost(message, optional, tag = "7")] + pub microvia_stack: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub color: ::core::option::Option, + /// Since 10.0.0 + #[prost(string, optional, tag = "9")] + pub tuning_profile: ::core::option::Option<::prost::alloc::string::String>, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct NetClassSchematicSettings { + #[prost(message, optional, tag = "1")] + pub wire_width: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub bus_width: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub color: ::core::option::Option, + #[prost(enumeration = "super::types::StrokeLineStyle", optional, tag = "4")] + pub line_style: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NetClass { + /// The name of the netclass (the literal string "Default" for the default netclass) + /// May be empty for composite netclasses + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(int32, optional, tag = "2")] + pub priority: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub board: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub schematic: ::core::option::Option, + #[prost(enumeration = "NetClassType", tag = "5")] + pub r#type: i32, + /// If this is a composite netclass, a list of the names of the "real" netclasses that make it up + #[prost(string, repeated, tag = "6")] + pub constituents: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TextVariables { + #[prost(map = "string, string", tag = "1")] + pub variables: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum NetClassType { + NctUnknown = 0, + /// An explicitly-defined netclass, created by the user and saved in the project file + NctExplicit = 1, + /// An implicit (effective) netclass, made up of multiple explicit netclasses + NctImplicit = 2, +} +impl NetClassType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::NctUnknown => "NCT_UNKNOWN", + Self::NctExplicit => "NCT_EXPLICIT", + Self::NctImplicit => "NCT_IMPLICIT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NCT_UNKNOWN" => Some(Self::NctUnknown), + "NCT_EXPLICIT" => Some(Self::NctExplicit), + "NCT_IMPLICIT" => Some(Self::NctImplicit), + _ => None, + } + } +} diff --git a/src/proto/generated/kiapi.common.rs b/src/proto/generated/kiapi.common.rs new file mode 100644 index 0000000..750a2c2 --- /dev/null +++ b/src/proto/generated/kiapi.common.rs @@ -0,0 +1,108 @@ +// This file is @generated by prost-build. +/// +/// For future expansion: any header fields that should be sent with a request +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ApiRequestHeader { + /// An opaque string identifying a running instance of KiCad. If this is set to a non-empty + /// string in an API request, KiCad will reject the request if the value doesn't match its own + /// token. This can be used to let API clients make sure they are still talking to the same + /// instance of KiCad if they are long-running. + #[prost(string, tag = "1")] + pub kicad_token: ::prost::alloc::string::String, + /// A string identifying an API client. Should be set by the client to a value that is unique + /// to a specific instance of a client, for example the package name of the client plus its + /// process ID or a random string, e.g. "com.github.me.my_awesome_plugin-73951". The main purpose + /// of this name is to identify the client in debug logs. + #[prost(string, tag = "2")] + pub client_name: ::prost::alloc::string::String, +} +/// +/// The top-level envelope container for an API request (message from a client to the KiCad API server) +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ApiRequest { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub message: ::core::option::Option<::prost_types::Any>, +} +/// +/// For future expansion: any header fields that should be sent with a response +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ApiResponseHeader { + /// / An opaque string identifying a running instance of KiCad. + #[prost(string, tag = "1")] + pub kicad_token: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ApiResponse { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub status: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub message: ::core::option::Option<::prost_types::Any>, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ApiResponseStatus { + /// / A code describing the category of error (or AS_OK if no error) + #[prost(enumeration = "ApiStatusCode", tag = "1")] + pub status: i32, + /// / A human-readable description of the error, if any + #[prost(string, tag = "2")] + pub error_message: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ApiStatusCode { + AsUnknown = 0, + /// Request succeeded + AsOk = 1, + /// Request timed out + AsTimeout = 2, + /// The request had invalid parameters or otherwise was illegal + AsBadRequest = 3, + /// KiCad has recently started and cannot handle API requests yet + AsNotReady = 4, + /// The request was not handled by KiCad + AsUnhandled = 5, + /// The kicad_token in the request didn't match this KiCad's token + AsTokenMismatch = 6, + /// KiCad is busy performing an operation and can't accept API commands + AsBusy = 7, + /// The requested API call has not yet been implemented + AsUnimplemented = 8, +} +impl ApiStatusCode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::AsUnknown => "AS_UNKNOWN", + Self::AsOk => "AS_OK", + Self::AsTimeout => "AS_TIMEOUT", + Self::AsBadRequest => "AS_BAD_REQUEST", + Self::AsNotReady => "AS_NOT_READY", + Self::AsUnhandled => "AS_UNHANDLED", + Self::AsTokenMismatch => "AS_TOKEN_MISMATCH", + Self::AsBusy => "AS_BUSY", + Self::AsUnimplemented => "AS_UNIMPLEMENTED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AS_UNKNOWN" => Some(Self::AsUnknown), + "AS_OK" => Some(Self::AsOk), + "AS_TIMEOUT" => Some(Self::AsTimeout), + "AS_BAD_REQUEST" => Some(Self::AsBadRequest), + "AS_NOT_READY" => Some(Self::AsNotReady), + "AS_UNHANDLED" => Some(Self::AsUnhandled), + "AS_TOKEN_MISMATCH" => Some(Self::AsTokenMismatch), + "AS_BUSY" => Some(Self::AsBusy), + "AS_UNIMPLEMENTED" => Some(Self::AsUnimplemented), + _ => None, + } + } +} diff --git a/src/proto/generated/kiapi.common.types.rs b/src/proto/generated/kiapi.common.types.rs new file mode 100644 index 0000000..8bc994a --- /dev/null +++ b/src/proto/generated/kiapi.common.types.rs @@ -0,0 +1,1033 @@ +// This file is @generated by prost-build. +/// The set of object types (from KICAD_T) that are exposed to the API. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum KiCadObjectType { + KotUnknown = 0, + KotPcbFootprint = 1, + KotPcbPad = 2, + KotPcbShape = 3, + KotPcbReferenceImage = 4, + KotPcbField = 5, + KotPcbGenerator = 6, + KotPcbText = 7, + KotPcbTextbox = 8, + KotPcbTable = 9, + KotPcbTablecell = 10, + KotPcbTrace = 11, + KotPcbVia = 12, + KotPcbArc = 13, + KotPcbMarker = 14, + KotPcbDimension = 15, + KotPcbZone = 16, + KotPcbGroup = 17, + KotSchMarker = 18, + KotSchJunction = 19, + KotSchNoConnect = 20, + KotSchBusWireEntry = 21, + KotSchBusBusEntry = 22, + KotSchLine = 23, + KotSchShape = 24, + KotSchBitmap = 25, + KotSchTextbox = 26, + KotSchText = 27, + KotSchTable = 28, + KotSchTablecell = 29, + KotSchLabel = 30, + KotSchGlobalLabel = 31, + KotSchHierLabel = 32, + KotSchDirectiveLabel = 33, + KotSchField = 34, + KotSchSymbol = 35, + KotSchSheetPin = 36, + KotSchSheet = 37, + KotSchPin = 38, + /// KOT_LIB_SHAPE = 40; + /// KOT_LIB_TEXT = 41; + /// KOT_LIB_TEXTBOX = 42; + /// KOT_LIB_PIN = 43; + /// KOT_LIB_FIELD = 44; + KotLibSymbol = 39, + KotWsgLine = 45, + KotWsgRect = 46, + KotWsgPoly = 47, + KotWsgText = 48, + KotWsgBitmap = 49, + KotWsgPage = 50, + KotSchGroup = 51, + KotPcbBarcode = 52, +} +impl KiCadObjectType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::KotUnknown => "KOT_UNKNOWN", + Self::KotPcbFootprint => "KOT_PCB_FOOTPRINT", + Self::KotPcbPad => "KOT_PCB_PAD", + Self::KotPcbShape => "KOT_PCB_SHAPE", + Self::KotPcbReferenceImage => "KOT_PCB_REFERENCE_IMAGE", + Self::KotPcbField => "KOT_PCB_FIELD", + Self::KotPcbGenerator => "KOT_PCB_GENERATOR", + Self::KotPcbText => "KOT_PCB_TEXT", + Self::KotPcbTextbox => "KOT_PCB_TEXTBOX", + Self::KotPcbTable => "KOT_PCB_TABLE", + Self::KotPcbTablecell => "KOT_PCB_TABLECELL", + Self::KotPcbTrace => "KOT_PCB_TRACE", + Self::KotPcbVia => "KOT_PCB_VIA", + Self::KotPcbArc => "KOT_PCB_ARC", + Self::KotPcbMarker => "KOT_PCB_MARKER", + Self::KotPcbDimension => "KOT_PCB_DIMENSION", + Self::KotPcbZone => "KOT_PCB_ZONE", + Self::KotPcbGroup => "KOT_PCB_GROUP", + Self::KotSchMarker => "KOT_SCH_MARKER", + Self::KotSchJunction => "KOT_SCH_JUNCTION", + Self::KotSchNoConnect => "KOT_SCH_NO_CONNECT", + Self::KotSchBusWireEntry => "KOT_SCH_BUS_WIRE_ENTRY", + Self::KotSchBusBusEntry => "KOT_SCH_BUS_BUS_ENTRY", + Self::KotSchLine => "KOT_SCH_LINE", + Self::KotSchShape => "KOT_SCH_SHAPE", + Self::KotSchBitmap => "KOT_SCH_BITMAP", + Self::KotSchTextbox => "KOT_SCH_TEXTBOX", + Self::KotSchText => "KOT_SCH_TEXT", + Self::KotSchTable => "KOT_SCH_TABLE", + Self::KotSchTablecell => "KOT_SCH_TABLECELL", + Self::KotSchLabel => "KOT_SCH_LABEL", + Self::KotSchGlobalLabel => "KOT_SCH_GLOBAL_LABEL", + Self::KotSchHierLabel => "KOT_SCH_HIER_LABEL", + Self::KotSchDirectiveLabel => "KOT_SCH_DIRECTIVE_LABEL", + Self::KotSchField => "KOT_SCH_FIELD", + Self::KotSchSymbol => "KOT_SCH_SYMBOL", + Self::KotSchSheetPin => "KOT_SCH_SHEET_PIN", + Self::KotSchSheet => "KOT_SCH_SHEET", + Self::KotSchPin => "KOT_SCH_PIN", + Self::KotLibSymbol => "KOT_LIB_SYMBOL", + Self::KotWsgLine => "KOT_WSG_LINE", + Self::KotWsgRect => "KOT_WSG_RECT", + Self::KotWsgPoly => "KOT_WSG_POLY", + Self::KotWsgText => "KOT_WSG_TEXT", + Self::KotWsgBitmap => "KOT_WSG_BITMAP", + Self::KotWsgPage => "KOT_WSG_PAGE", + Self::KotSchGroup => "KOT_SCH_GROUP", + Self::KotPcbBarcode => "KOT_PCB_BARCODE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "KOT_UNKNOWN" => Some(Self::KotUnknown), + "KOT_PCB_FOOTPRINT" => Some(Self::KotPcbFootprint), + "KOT_PCB_PAD" => Some(Self::KotPcbPad), + "KOT_PCB_SHAPE" => Some(Self::KotPcbShape), + "KOT_PCB_REFERENCE_IMAGE" => Some(Self::KotPcbReferenceImage), + "KOT_PCB_FIELD" => Some(Self::KotPcbField), + "KOT_PCB_GENERATOR" => Some(Self::KotPcbGenerator), + "KOT_PCB_TEXT" => Some(Self::KotPcbText), + "KOT_PCB_TEXTBOX" => Some(Self::KotPcbTextbox), + "KOT_PCB_TABLE" => Some(Self::KotPcbTable), + "KOT_PCB_TABLECELL" => Some(Self::KotPcbTablecell), + "KOT_PCB_TRACE" => Some(Self::KotPcbTrace), + "KOT_PCB_VIA" => Some(Self::KotPcbVia), + "KOT_PCB_ARC" => Some(Self::KotPcbArc), + "KOT_PCB_MARKER" => Some(Self::KotPcbMarker), + "KOT_PCB_DIMENSION" => Some(Self::KotPcbDimension), + "KOT_PCB_ZONE" => Some(Self::KotPcbZone), + "KOT_PCB_GROUP" => Some(Self::KotPcbGroup), + "KOT_SCH_MARKER" => Some(Self::KotSchMarker), + "KOT_SCH_JUNCTION" => Some(Self::KotSchJunction), + "KOT_SCH_NO_CONNECT" => Some(Self::KotSchNoConnect), + "KOT_SCH_BUS_WIRE_ENTRY" => Some(Self::KotSchBusWireEntry), + "KOT_SCH_BUS_BUS_ENTRY" => Some(Self::KotSchBusBusEntry), + "KOT_SCH_LINE" => Some(Self::KotSchLine), + "KOT_SCH_SHAPE" => Some(Self::KotSchShape), + "KOT_SCH_BITMAP" => Some(Self::KotSchBitmap), + "KOT_SCH_TEXTBOX" => Some(Self::KotSchTextbox), + "KOT_SCH_TEXT" => Some(Self::KotSchText), + "KOT_SCH_TABLE" => Some(Self::KotSchTable), + "KOT_SCH_TABLECELL" => Some(Self::KotSchTablecell), + "KOT_SCH_LABEL" => Some(Self::KotSchLabel), + "KOT_SCH_GLOBAL_LABEL" => Some(Self::KotSchGlobalLabel), + "KOT_SCH_HIER_LABEL" => Some(Self::KotSchHierLabel), + "KOT_SCH_DIRECTIVE_LABEL" => Some(Self::KotSchDirectiveLabel), + "KOT_SCH_FIELD" => Some(Self::KotSchField), + "KOT_SCH_SYMBOL" => Some(Self::KotSchSymbol), + "KOT_SCH_SHEET_PIN" => Some(Self::KotSchSheetPin), + "KOT_SCH_SHEET" => Some(Self::KotSchSheet), + "KOT_SCH_PIN" => Some(Self::KotSchPin), + "KOT_LIB_SYMBOL" => Some(Self::KotLibSymbol), + "KOT_WSG_LINE" => Some(Self::KotWsgLine), + "KOT_WSG_RECT" => Some(Self::KotWsgRect), + "KOT_WSG_POLY" => Some(Self::KotWsgPoly), + "KOT_WSG_TEXT" => Some(Self::KotWsgText), + "KOT_WSG_BITMAP" => Some(Self::KotWsgBitmap), + "KOT_WSG_PAGE" => Some(Self::KotWsgPage), + "KOT_SCH_GROUP" => Some(Self::KotSchGroup), + "KOT_PCB_BARCODE" => Some(Self::KotPcbBarcode), + _ => None, + } + } +} +/// Mapped to GR_TEXT_H_ALIGN_T +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum HorizontalAlignment { + HaUnknown = 0, + HaLeft = 1, + HaCenter = 2, + HaRight = 3, + HaIndeterminate = 4, +} +impl HorizontalAlignment { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::HaUnknown => "HA_UNKNOWN", + Self::HaLeft => "HA_LEFT", + Self::HaCenter => "HA_CENTER", + Self::HaRight => "HA_RIGHT", + Self::HaIndeterminate => "HA_INDETERMINATE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "HA_UNKNOWN" => Some(Self::HaUnknown), + "HA_LEFT" => Some(Self::HaLeft), + "HA_CENTER" => Some(Self::HaCenter), + "HA_RIGHT" => Some(Self::HaRight), + "HA_INDETERMINATE" => Some(Self::HaIndeterminate), + _ => None, + } + } +} +/// Mapped to GR_TEXT_V_ALIGN_T +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum VerticalAlignment { + VaUnknown = 0, + VaTop = 1, + VaCenter = 2, + VaBottom = 3, + VaIndeterminate = 4, +} +impl VerticalAlignment { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::VaUnknown => "VA_UNKNOWN", + Self::VaTop => "VA_TOP", + Self::VaCenter => "VA_CENTER", + Self::VaBottom => "VA_BOTTOM", + Self::VaIndeterminate => "VA_INDETERMINATE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VA_UNKNOWN" => Some(Self::VaUnknown), + "VA_TOP" => Some(Self::VaTop), + "VA_CENTER" => Some(Self::VaCenter), + "VA_BOTTOM" => Some(Self::VaBottom), + "VA_INDETERMINATE" => Some(Self::VaIndeterminate), + _ => None, + } + } +} +/// Mapped to LINE_STYLE +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum StrokeLineStyle { + SlsUnknown = 0, + SlsDefault = 1, + SlsSolid = 2, + SlsDash = 3, + SlsDot = 4, + SlsDashdot = 5, + SlsDashdotdot = 6, +} +impl StrokeLineStyle { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::SlsUnknown => "SLS_UNKNOWN", + Self::SlsDefault => "SLS_DEFAULT", + Self::SlsSolid => "SLS_SOLID", + Self::SlsDash => "SLS_DASH", + Self::SlsDot => "SLS_DOT", + Self::SlsDashdot => "SLS_DASHDOT", + Self::SlsDashdotdot => "SLS_DASHDOTDOT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SLS_UNKNOWN" => Some(Self::SlsUnknown), + "SLS_DEFAULT" => Some(Self::SlsDefault), + "SLS_SOLID" => Some(Self::SlsSolid), + "SLS_DASH" => Some(Self::SlsDash), + "SLS_DOT" => Some(Self::SlsDot), + "SLS_DASHDOT" => Some(Self::SlsDashdot), + "SLS_DASHDOTDOT" => Some(Self::SlsDashdotdot), + _ => None, + } + } +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct CommandStatusResponse { + #[prost(enumeration = "CommandStatus", tag = "1")] + pub status: i32, +} +/// * +/// Describes a particular version of KiCad +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct KiCadVersion { + #[prost(uint32, tag = "1")] + pub major: u32, + #[prost(uint32, tag = "2")] + pub minor: u32, + #[prost(uint32, tag = "3")] + pub patch: u32, + /// Full identifier string, potentially containing git hashes, packager-added info, etc. + #[prost(string, tag = "4")] + pub full_version: ::prost::alloc::string::String, +} +/// * +/// Describes a KIID, or UUID of an object in a KiCad editor model. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Kiid { + /// The KIID's value in standard UUID format, stored as a string for easy portability + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, +} +/// * +/// Describes a KiCad LIB_ID; a unique identifier for a loaded symbol or footprint +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct LibraryIdentifier { + /// The library portion of the LIB_ID + #[prost(string, tag = "1")] + pub library_nickname: ::prost::alloc::string::String, + /// The symbol or footprint name + #[prost(string, tag = "2")] + pub entry_name: ::prost::alloc::string::String, +} +/// * +/// Describes a unique sheet in a schematic +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SheetPath { + /// The canonical path to the sheet. The first KIID will be the root sheet, etc. + #[prost(message, repeated, tag = "1")] + pub path: ::prost::alloc::vec::Vec, + /// The path converted to a human readable form such as "/", "/child", or "/child/grandchild" + #[prost(string, tag = "2")] + pub path_human_readable: ::prost::alloc::string::String, +} +/// * +/// Describes a KiCad project +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ProjectSpecifier { + /// The name of the project (without the kicad_pro extension) + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// The path to the project directory + #[prost(string, tag = "2")] + pub path: ::prost::alloc::string::String, +} +/// * +/// Describes a document that will be the target of a request +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DocumentSpecifier { + #[prost(enumeration = "DocumentType", tag = "1")] + pub r#type: i32, + #[prost(message, optional, tag = "5")] + pub project: ::core::option::Option, + #[prost(oneof = "document_specifier::Identifier", tags = "2, 3, 4")] + pub identifier: ::core::option::Option, +} +/// Nested message and enum types in `DocumentSpecifier`. +pub mod document_specifier { + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Identifier { + /// If type == DT_SYMBOL or DT_FOOTPRINT, identifies a certain library entry + #[prost(message, tag = "2")] + LibId(super::LibraryIdentifier), + /// If type == DT_SCHEMATIC, identifies a sheet with a given path + #[prost(message, tag = "3")] + SheetPath(super::SheetPath), + /// If type == DT_PCB, identifies a PCB with a given filename, e.g. "board.kicad_pcb" + #[prost(string, tag = "4")] + BoardFilename(::prost::alloc::string::String), + } +} +/// * +/// This header is included in requests and responses about item(s) in a document +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ItemHeader { + /// Which document is this request targeting? + #[prost(message, optional, tag = "1")] + pub document: ::core::option::Option, + /// Which container within the document is this request targeting? + /// If container is omitted or empty, the document is used as the container. + #[prost(message, optional, tag = "2")] + pub container: ::core::option::Option, + /// Which fields on the item(s) are included with this request or response + #[prost(message, optional, tag = "3")] + pub field_mask: ::core::option::Option<::prost_types::FieldMask>, +} +/// Describes a point or distance in 2D space. All coordinates are in nanometers. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Vector2 { + #[prost(int64, tag = "1")] + pub x_nm: i64, + #[prost(int64, tag = "2")] + pub y_nm: i64, +} +/// Describes a point or distance in 3D space. All coordinates are in nanometers. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Vector3 { + #[prost(int64, tag = "1")] + pub x_nm: i64, + #[prost(int64, tag = "2")] + pub y_nm: i64, + #[prost(int64, tag = "3")] + pub z_nm: i64, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Vector3D { + #[prost(double, tag = "1")] + pub x_nm: f64, + #[prost(double, tag = "2")] + pub y_nm: f64, + #[prost(double, tag = "3")] + pub z_nm: f64, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Box2 { + #[prost(message, optional, tag = "1")] + pub position: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub size: ::core::option::Option, +} +/// Describes a quantity of distance (size, length, etc). All coordinates are in nanometers. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Distance { + #[prost(int64, tag = "1")] + pub value_nm: i64, +} +/// Corresponds to EDA_ANGLE, where the underlying storage is degrees +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Angle { + #[prost(double, tag = "1")] + pub value_degrees: f64, +} +/// Represents a value from 0.0 to 1.0 +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Ratio { + #[prost(double, tag = "1")] + pub value: f64, +} +/// Represents a time delay in attoseconds. Since 10.0.0. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Time { + #[prost(int64, tag = "1")] + pub value_as: i64, +} +/// Corresponds to COLOR4D. Each color channel is a double from 0.0 to 1.0. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Color { + #[prost(double, tag = "1")] + pub r: f64, + #[prost(double, tag = "2")] + pub g: f64, + #[prost(double, tag = "3")] + pub b: f64, + #[prost(double, tag = "4")] + pub a: f64, +} +/// The formulation of arc that is used in KiCad core geometry code. +/// Start, midpoint (on the arc) and end are stored. Angle, center point, etc are calculated. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ArcStartMidEnd { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub mid: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub end: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct PolyLineNode { + #[prost(oneof = "poly_line_node::Geometry", tags = "1, 2")] + pub geometry: ::core::option::Option, +} +/// Nested message and enum types in `PolyLineNode`. +pub mod poly_line_node { + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] + pub enum Geometry { + #[prost(message, tag = "1")] + Point(super::Vector2), + #[prost(message, tag = "2")] + Arc(super::ArcStartMidEnd), + } +} +/// Corresponds to class SHAPE_LINE_CHAIN: A closed or open polyline that can include arcs. +/// For non-arc cases, each node is a point along the line. An implicit line segment exists +/// between the last and first node if closed is true. When arcs are present, the arc start and +/// end points are not duplicated by point nodes (meaning, for example, a rectangle with rounded +/// corners could be represented with four arc nodes and no point nodes). +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PolyLine { + #[prost(message, repeated, tag = "1")] + pub nodes: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "2")] + pub closed: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PolygonWithHoles { + #[prost(message, optional, tag = "1")] + pub outline: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub holes: ::prost::alloc::vec::Vec, +} +/// Corresponds to SHAPE_POLY_SET: a set of polygons or polylines +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PolySet { + #[prost(message, repeated, tag = "1")] + pub polygons: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TextAttributes { + #[prost(string, tag = "1")] + pub font_name: ::prost::alloc::string::String, + #[prost(enumeration = "HorizontalAlignment", tag = "2")] + pub horizontal_alignment: i32, + #[prost(enumeration = "VerticalAlignment", tag = "3")] + pub vertical_alignment: i32, + #[prost(message, optional, tag = "4")] + pub angle: ::core::option::Option, + #[prost(double, tag = "5")] + pub line_spacing: f64, + #[prost(message, optional, tag = "6")] + pub stroke_width: ::core::option::Option, + #[prost(bool, tag = "7")] + pub italic: bool, + #[prost(bool, tag = "8")] + pub bold: bool, + #[prost(bool, tag = "9")] + pub underlined: bool, + /// Deprecated since 9.0.1 (text items are now always visible, only Fields can be hidden) + #[prost(bool, tag = "10")] + pub visible: bool, + #[prost(bool, tag = "11")] + pub mirrored: bool, + #[prost(bool, tag = "12")] + pub multiline: bool, + #[prost(bool, tag = "13")] + pub keep_upright: bool, + #[prost(message, optional, tag = "14")] + pub size: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Text { + /// Reserved for future use; base text objects don't have IDs right now + /// kiapi.common.types.KIID id = 1; + #[prost(message, optional, tag = "2")] + pub position: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub attributes: ::core::option::Option, + #[prost(string, tag = "5")] + pub text: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub hyperlink: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TextBox { + #[prost(message, optional, tag = "2")] + pub top_left: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub bottom_right: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub attributes: ::core::option::Option, + #[prost(string, tag = "6")] + pub text: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct StrokeAttributes { + #[prost(message, optional, tag = "1")] + pub width: ::core::option::Option, + #[prost(enumeration = "StrokeLineStyle", tag = "2")] + pub style: i32, + #[prost(message, optional, tag = "3")] + pub color: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct GraphicFillAttributes { + #[prost(enumeration = "GraphicFillType", tag = "1")] + pub fill_type: i32, + /// Color of the fill (not used in board and footprints) + #[prost(message, optional, tag = "2")] + pub color: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct GraphicAttributes { + #[prost(message, optional, tag = "1")] + pub stroke: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub fill: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GraphicSegmentAttributes { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub end: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GraphicRectangleAttributes { + #[prost(message, optional, tag = "1")] + pub top_left: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub bottom_right: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub corner_radius: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GraphicArcAttributes { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub mid: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub end: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GraphicCircleAttributes { + #[prost(message, optional, tag = "1")] + pub center: ::core::option::Option, + /// A point on the radius of the circle. This is stored instead of just a radius so that the point + /// by which the user can adjust the circle radius is persisted. + #[prost(message, optional, tag = "2")] + pub radius_point: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GraphicBezierAttributes { + #[prost(message, optional, tag = "1")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub control1: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub control2: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub end: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GraphicShape { + /// Reserved for future use; base EDA_SHAPE doesn't have an ID or locked state right now + /// KIID id = 1; + /// LockedState locked = 2; + #[prost(message, optional, tag = "3")] + pub attributes: ::core::option::Option, + #[prost(oneof = "graphic_shape::Geometry", tags = "4, 5, 6, 7, 8, 9")] + pub geometry: ::core::option::Option, +} +/// Nested message and enum types in `GraphicShape`. +pub mod graphic_shape { + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Geometry { + #[prost(message, tag = "4")] + Segment(super::GraphicSegmentAttributes), + #[prost(message, tag = "5")] + Rectangle(super::GraphicRectangleAttributes), + #[prost(message, tag = "6")] + Arc(super::GraphicArcAttributes), + #[prost(message, tag = "7")] + Circle(super::GraphicCircleAttributes), + #[prost(message, tag = "8")] + Polygon(super::PolySet), + #[prost(message, tag = "9")] + Bezier(super::GraphicBezierAttributes), + } +} +/// A SHAPE_COMPOUND in KiCad +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CompoundShape { + #[prost(message, repeated, tag = "1")] + pub shapes: ::prost::alloc::vec::Vec, +} +/// The text strings that can be set in a drawing sheet for the title block +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct TitleBlockInfo { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub date: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub revision: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub company: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub comment1: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub comment2: ::prost::alloc::string::String, + #[prost(string, tag = "7")] + pub comment3: ::prost::alloc::string::String, + #[prost(string, tag = "8")] + pub comment4: ::prost::alloc::string::String, + #[prost(string, tag = "9")] + pub comment5: ::prost::alloc::string::String, + #[prost(string, tag = "10")] + pub comment6: ::prost::alloc::string::String, + #[prost(string, tag = "11")] + pub comment7: ::prost::alloc::string::String, + #[prost(string, tag = "12")] + pub comment8: ::prost::alloc::string::String, + #[prost(string, tag = "13")] + pub comment9: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum CommandStatus { + CsUnknown = 0, + /// Command succeeded + CsOk = 1, + /// Command failed + CsFailed = 2, +} +impl CommandStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::CsUnknown => "CS_UNKNOWN", + Self::CsOk => "CS_OK", + Self::CsFailed => "CS_FAILED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CS_UNKNOWN" => Some(Self::CsUnknown), + "CS_OK" => Some(Self::CsOk), + "CS_FAILED" => Some(Self::CsFailed), + _ => None, + } + } +} +/// * +/// Some commands are specific to a KiCad window (frame). This list contains all addressable frames. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum FrameType { + FtUnknown = 0, + FtProjectManager = 1, + FtSchematicEditor = 2, + FtPcbEditor = 3, + FtSpiceSimulator = 4, + FtSymbolEditor = 5, + FtFootprintEditor = 6, + FtDrawingSheetEditor = 7, +} +impl FrameType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::FtUnknown => "FT_UNKNOWN", + Self::FtProjectManager => "FT_PROJECT_MANAGER", + Self::FtSchematicEditor => "FT_SCHEMATIC_EDITOR", + Self::FtPcbEditor => "FT_PCB_EDITOR", + Self::FtSpiceSimulator => "FT_SPICE_SIMULATOR", + Self::FtSymbolEditor => "FT_SYMBOL_EDITOR", + Self::FtFootprintEditor => "FT_FOOTPRINT_EDITOR", + Self::FtDrawingSheetEditor => "FT_DRAWING_SHEET_EDITOR", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FT_UNKNOWN" => Some(Self::FtUnknown), + "FT_PROJECT_MANAGER" => Some(Self::FtProjectManager), + "FT_SCHEMATIC_EDITOR" => Some(Self::FtSchematicEditor), + "FT_PCB_EDITOR" => Some(Self::FtPcbEditor), + "FT_SPICE_SIMULATOR" => Some(Self::FtSpiceSimulator), + "FT_SYMBOL_EDITOR" => Some(Self::FtSymbolEditor), + "FT_FOOTPRINT_EDITOR" => Some(Self::FtFootprintEditor), + "FT_DRAWING_SHEET_EDITOR" => Some(Self::FtDrawingSheetEditor), + _ => None, + } + } +} +/// * +/// Identifier for the type of document being targeted by a request +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DocumentType { + DoctypeUnknown = 0, + DoctypeSchematic = 1, + DoctypeSymbol = 2, + DoctypePcb = 3, + DoctypeFootprint = 4, + DoctypeDrawingSheet = 5, + DoctypeProject = 6, +} +impl DocumentType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::DoctypeUnknown => "DOCTYPE_UNKNOWN", + Self::DoctypeSchematic => "DOCTYPE_SCHEMATIC", + Self::DoctypeSymbol => "DOCTYPE_SYMBOL", + Self::DoctypePcb => "DOCTYPE_PCB", + Self::DoctypeFootprint => "DOCTYPE_FOOTPRINT", + Self::DoctypeDrawingSheet => "DOCTYPE_DRAWING_SHEET", + Self::DoctypeProject => "DOCTYPE_PROJECT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DOCTYPE_UNKNOWN" => Some(Self::DoctypeUnknown), + "DOCTYPE_SCHEMATIC" => Some(Self::DoctypeSchematic), + "DOCTYPE_SYMBOL" => Some(Self::DoctypeSymbol), + "DOCTYPE_PCB" => Some(Self::DoctypePcb), + "DOCTYPE_FOOTPRINT" => Some(Self::DoctypeFootprint), + "DOCTYPE_DRAWING_SHEET" => Some(Self::DoctypeDrawingSheet), + "DOCTYPE_PROJECT" => Some(Self::DoctypeProject), + _ => None, + } + } +} +/// * +/// Status of a request that included an ItemHeader +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ItemRequestStatus { + IrsUnknown = 0, + IrsOk = 1, + /// The given document is not open in KiCad + IrsDocumentNotFound = 2, + /// The given field_mask contains invalid specifiers + IrsFieldMaskInvalid = 3, +} +impl ItemRequestStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::IrsUnknown => "IRS_UNKNOWN", + Self::IrsOk => "IRS_OK", + Self::IrsDocumentNotFound => "IRS_DOCUMENT_NOT_FOUND", + Self::IrsFieldMaskInvalid => "IRS_FIELD_MASK_INVALID", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "IRS_UNKNOWN" => Some(Self::IrsUnknown), + "IRS_OK" => Some(Self::IrsOk), + "IRS_DOCUMENT_NOT_FOUND" => Some(Self::IrsDocumentNotFound), + "IRS_FIELD_MASK_INVALID" => Some(Self::IrsFieldMaskInvalid), + _ => None, + } + } +} +/// Describes whether or not an item is locked for editing or movement +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum LockedState { + LsUnknown = 0, + LsUnlocked = 1, + LsLocked = 2, +} +impl LockedState { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::LsUnknown => "LS_UNKNOWN", + Self::LsUnlocked => "LS_UNLOCKED", + Self::LsLocked => "LS_LOCKED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "LS_UNKNOWN" => Some(Self::LsUnknown), + "LS_UNLOCKED" => Some(Self::LsUnlocked), + "LS_LOCKED" => Some(Self::LsLocked), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum GraphicFillType { + GftUnknown = 0, + GftUnfilled = 1, + GftFilled = 2, +} +impl GraphicFillType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::GftUnknown => "GFT_UNKNOWN", + Self::GftUnfilled => "GFT_UNFILLED", + Self::GftFilled => "GFT_FILLED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "GFT_UNKNOWN" => Some(Self::GftUnknown), + "GFT_UNFILLED" => Some(Self::GftUnfilled), + "GFT_FILLED" => Some(Self::GftFilled), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum AxisAlignment { + AaUnknown = 0, + AaXAxis = 1, + AaYAxis = 2, +} +impl AxisAlignment { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::AaUnknown => "AA_UNKNOWN", + Self::AaXAxis => "AA_X_AXIS", + Self::AaYAxis => "AA_Y_AXIS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AA_UNKNOWN" => Some(Self::AaUnknown), + "AA_X_AXIS" => Some(Self::AaXAxis), + "AA_Y_AXIS" => Some(Self::AaYAxis), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum MapMergeMode { + MmmUnknown = 0, + /// The existing map will be merged with the incoming map; keys that are not present in the + /// incoming map will be preserved with their original values + MmmMerge = 1, + /// The existing map will be cleared and replaced with the incoming map + MmmReplace = 2, +} +impl MapMergeMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::MmmUnknown => "MMM_UNKNOWN", + Self::MmmMerge => "MMM_MERGE", + Self::MmmReplace => "MMM_REPLACE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MMM_UNKNOWN" => Some(Self::MmmUnknown), + "MMM_MERGE" => Some(Self::MmmMerge), + "MMM_REPLACE" => Some(Self::MmmReplace), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ElectricalPinType { + EptUnknown = 0, + EptInput = 1, + EptOutput = 2, + EptBidirectional = 3, + EptTristate = 4, + EptPassive = 5, + /// A free pin is not internally connected and may connect to any net (route-through) + EptFree = 6, + EptUnspecified = 7, + EptPowerInput = 8, + EptPowerOutput = 9, + EptOpenCollector = 10, + EptOpenEmitter = 11, + /// A no-connect pin should not be connected to any net + EptNoConnect = 12, +} +impl ElectricalPinType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::EptUnknown => "EPT_UNKNOWN", + Self::EptInput => "EPT_INPUT", + Self::EptOutput => "EPT_OUTPUT", + Self::EptBidirectional => "EPT_BIDIRECTIONAL", + Self::EptTristate => "EPT_TRISTATE", + Self::EptPassive => "EPT_PASSIVE", + Self::EptFree => "EPT_FREE", + Self::EptUnspecified => "EPT_UNSPECIFIED", + Self::EptPowerInput => "EPT_POWER_INPUT", + Self::EptPowerOutput => "EPT_POWER_OUTPUT", + Self::EptOpenCollector => "EPT_OPEN_COLLECTOR", + Self::EptOpenEmitter => "EPT_OPEN_EMITTER", + Self::EptNoConnect => "EPT_NO_CONNECT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "EPT_UNKNOWN" => Some(Self::EptUnknown), + "EPT_INPUT" => Some(Self::EptInput), + "EPT_OUTPUT" => Some(Self::EptOutput), + "EPT_BIDIRECTIONAL" => Some(Self::EptBidirectional), + "EPT_TRISTATE" => Some(Self::EptTristate), + "EPT_PASSIVE" => Some(Self::EptPassive), + "EPT_FREE" => Some(Self::EptFree), + "EPT_UNSPECIFIED" => Some(Self::EptUnspecified), + "EPT_POWER_INPUT" => Some(Self::EptPowerInput), + "EPT_POWER_OUTPUT" => Some(Self::EptPowerOutput), + "EPT_OPEN_COLLECTOR" => Some(Self::EptOpenCollector), + "EPT_OPEN_EMITTER" => Some(Self::EptOpenEmitter), + "EPT_NO_CONNECT" => Some(Self::EptNoConnect), + _ => None, + } + } +} diff --git a/src/proto/generated/kiapi.schematic.types.rs b/src/proto/generated/kiapi.schematic.types.rs new file mode 100644 index 0000000..3303621 --- /dev/null +++ b/src/proto/generated/kiapi.schematic.types.rs @@ -0,0 +1,79 @@ +// This file is @generated by prost-build. +/// / Represents a schematic line segment, which may be a wire, bus, or graphical line +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Line { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub start: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub end: ::core::option::Option, + /// * + /// One of: LAYER_BUS, LAYER_WIRE, LAYER_NOTES + #[prost(enumeration = "SchematicLayer", tag = "4")] + pub layer: i32, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Text { + #[prost(message, optional, tag = "1")] + pub text: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LocalLabel { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub position: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub text: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GlobalLabel { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub position: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub text: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HierarchicalLabel { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub position: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub text: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DirectiveLabel { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub position: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub text: ::core::option::Option, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum SchematicLayer { + SlUnknown = 0, +} +impl SchematicLayer { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::SlUnknown => "SL_UNKNOWN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SL_UNKNOWN" => Some(Self::SlUnknown), + _ => None, + } + } +} diff --git a/src/proto/mod.rs b/src/proto/mod.rs index 40fb8d8..8b9362d 100644 --- a/src/proto/mod.rs +++ b/src/proto/mod.rs @@ -1,38 +1,38 @@ pub(crate) mod kiapi { #[allow(dead_code)] pub mod common { - include!(concat!(env!("OUT_DIR"), "/kiapi.common.rs")); + include!("generated/kiapi.common.rs"); pub mod commands { - include!(concat!(env!("OUT_DIR"), "/kiapi.common.commands.rs")); + include!("generated/kiapi.common.commands.rs"); } pub mod project { - include!(concat!(env!("OUT_DIR"), "/kiapi.common.project.rs")); + include!("generated/kiapi.common.project.rs"); } pub mod types { - include!(concat!(env!("OUT_DIR"), "/kiapi.common.types.rs")); + include!("generated/kiapi.common.types.rs"); } } #[allow(dead_code)] pub mod board { - include!(concat!(env!("OUT_DIR"), "/kiapi.board.rs")); + include!("generated/kiapi.board.rs"); pub mod commands { - include!(concat!(env!("OUT_DIR"), "/kiapi.board.commands.rs")); + include!("generated/kiapi.board.commands.rs"); } pub mod types { - include!(concat!(env!("OUT_DIR"), "/kiapi.board.types.rs")); + include!("generated/kiapi.board.types.rs"); } } #[allow(dead_code)] pub mod schematic { pub mod types { - include!(concat!(env!("OUT_DIR"), "/kiapi.schematic.types.rs")); + include!("generated/kiapi.schematic.types.rs"); } } }