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

90 lines
2.3 KiB
Rust
Raw Permalink 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,
OutputDisconnectRequest,
2024-04-12 18:46:52 +02:00
OutputResizeRequest,
OutputMoveRequest,
2024-02-23 23:24:43 +01:00
WindowPointerEnterRequest,
2024-04-18 21:42:49 +02:00
WindowPointerLeaveRequest,
TagActiveRequest
2024-02-23 23:24:43 +01:00
);
2024-02-22 01:08:23 +01:00
}
}
pub mod layout {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.layout.v0alpha1");
}
}
pub mod render {
pub mod v0alpha1 {
tonic::include_proto!("pinnacle.render.v0alpha1");
}
}
}
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("pinnacle");