From 77a3ae85a5bdf3ebddacddde9153f93c46a2b569 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Tue, 12 Mar 2024 18:20:13 -0500 Subject: [PATCH] Add layout proto defs --- .../pinnacle/layout/v0alpha1/layout.proto | 47 +++++++++++++++++++ .../pinnacle/signal/v0alpha1/signal.proto | 11 ----- 2 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 api/protocol/pinnacle/layout/v0alpha1/layout.proto diff --git a/api/protocol/pinnacle/layout/v0alpha1/layout.proto b/api/protocol/pinnacle/layout/v0alpha1/layout.proto new file mode 100644 index 0000000..393bebd --- /dev/null +++ b/api/protocol/pinnacle/layout/v0alpha1/layout.proto @@ -0,0 +1,47 @@ +syntax = "proto2"; + +package pinnacle.layout.v0alpha1; + +import "pinnacle/v0alpha1/pinnacle.proto"; + +// Love how the response is the request and the request is the response + +message LayoutRequest { + // Respond to a layout request from the compositor. + message Geometries { + // The id of the request this layout response is responding to. + // + // Responding with a request_id that has already been responded to + // or that doesn't exist will return an error. + optional uint32 request_id = 1; + // Target geometries of all windows being laid out. + // + // Responding with a different number of geometries than + // requested windows will return an error. + repeated .pinnacle.v0alpha1.Geometry geometries = 2; + } + // Request a layout explicitly. + message ExplicitLayout {} + + oneof body { + Geometries geometries = 1; + ExplicitLayout layout = 2; + } +} + +// The compositor requested a layout. +// +// The client must respond with `LayoutRequest.geometries`. +message LayoutResponse { + optional uint32 request_id = 1; + optional string output_name = 2; + repeated uint32 window_ids = 3; + // Ids of all focused tags on the output. + repeated uint32 tag_ids = 4; + optional uint32 output_width = 5; + optional uint32 output_height = 6; +} + +service LayoutService { + rpc Layout(stream LayoutRequest) returns (stream LayoutResponse); +} diff --git a/api/protocol/pinnacle/signal/v0alpha1/signal.proto b/api/protocol/pinnacle/signal/v0alpha1/signal.proto index 4a0150a..4f2a82a 100644 --- a/api/protocol/pinnacle/signal/v0alpha1/signal.proto +++ b/api/protocol/pinnacle/signal/v0alpha1/signal.proto @@ -17,16 +17,6 @@ message OutputConnectResponse { optional string output_name = 1; } -message LayoutRequest { - optional StreamControl control = 1; -} -message LayoutResponse { - // The windows that need to be laid out. - repeated uint32 window_ids = 1; - // The tag that is being laid out. - optional uint32 tag_id = 2; -} - message WindowPointerEnterRequest { optional StreamControl control = 1; } @@ -45,7 +35,6 @@ message WindowPointerLeaveResponse { service SignalService { rpc OutputConnect(stream OutputConnectRequest) returns (stream OutputConnectResponse); - rpc Layout(stream LayoutRequest) returns (stream LayoutResponse); rpc WindowPointerEnter(stream WindowPointerEnterRequest) returns (stream WindowPointerEnterResponse); rpc WindowPointerLeave(stream WindowPointerLeaveRequest) returns (stream WindowPointerLeaveResponse); }