pinnacle/pinnacle-api-defs/src/lib.rs

80 lines
2 KiB
Rust
Raw Normal View History

pub mod pinnacle {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.v0alpha1");
}
pub mod input {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.input.v0alpha1");
}
}
pub mod output {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.output.v0alpha1");
}
}
pub mod tag {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.tag.v0alpha1");
}
}
pub mod window {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.window.v0alpha1");
}
}
pub mod process {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.process.v0alpha1");
}
}
2024-02-22 01:08:23 +01:00
pub mod signal {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.signal.v0alpha1");
2024-02-23 23:24:43 +01:00
pub trait SignalRequest {
fn from_control(control: StreamControl) -> Self;
fn control(&self) -> StreamControl;
}
macro_rules! impl_signal_request {
( $( $request:ident ),* ) => {
$(
impl SignalRequest for $request {
fn from_control(control: StreamControl) -> Self {
$request {
control: Some(control as i32),
}
}
fn control(&self) -> StreamControl {
self.control()
}
}
)*
};
}
impl_signal_request!(
OutputConnectRequest,
WindowPointerEnterRequest,
WindowPointerLeaveRequest
);
2024-02-22 01:08:23 +01:00
}
}
pub mod layout {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.layout.v0alpha1");
}
}
}
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("pinnacle");