From f39056dff119d158e98ad7497ea508c338d651b7 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Thu, 9 Jan 2025 19:47:54 -0600 Subject: [PATCH] proto: Remove old proto2 files --- api/protocol/google/protobuf/empty.proto | 51 ------ .../pinnacle/input/v0alpha1/input.proto | 163 ------------------ .../pinnacle/layout/v0alpha1/layout.proto | 56 ------ .../pinnacle/output/v0alpha1/output.proto | 133 -------------- .../pinnacle/process/v0alpha1/process.proto | 31 ---- .../pinnacle/render/v0alpha1/render.proto | 35 ---- .../pinnacle/signal/v0alpha1/signal.proto | 83 --------- api/protocol/pinnacle/tag/v0alpha1/tag.proto | 55 ------ api/protocol/pinnacle/v0alpha1/pinnacle.proto | 59 ------- .../pinnacle/window/v0alpha1/window.proto | 151 ---------------- justfile | 6 +- pinnacle-api-defs/build.rs | 19 +- 12 files changed, 5 insertions(+), 837 deletions(-) delete mode 100644 api/protocol/google/protobuf/empty.proto delete mode 100644 api/protocol/pinnacle/input/v0alpha1/input.proto delete mode 100644 api/protocol/pinnacle/layout/v0alpha1/layout.proto delete mode 100644 api/protocol/pinnacle/output/v0alpha1/output.proto delete mode 100644 api/protocol/pinnacle/process/v0alpha1/process.proto delete mode 100644 api/protocol/pinnacle/render/v0alpha1/render.proto delete mode 100644 api/protocol/pinnacle/signal/v0alpha1/signal.proto delete mode 100644 api/protocol/pinnacle/tag/v0alpha1/tag.proto delete mode 100644 api/protocol/pinnacle/v0alpha1/pinnacle.proto delete mode 100644 api/protocol/pinnacle/window/v0alpha1/window.proto diff --git a/api/protocol/google/protobuf/empty.proto b/api/protocol/google/protobuf/empty.proto deleted file mode 100644 index 0e5a68fe1..000000000 --- a/api/protocol/google/protobuf/empty.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/emptypb"; -option java_multiple_files = true; -option java_outer_classname = "EmptyProto"; -option java_package = "com.google.protobuf"; -option objc_class_prefix = "GPB"; - -// A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -message Empty {} diff --git a/api/protocol/pinnacle/input/v0alpha1/input.proto b/api/protocol/pinnacle/input/v0alpha1/input.proto deleted file mode 100644 index a2e6ae3aa..000000000 --- a/api/protocol/pinnacle/input/v0alpha1/input.proto +++ /dev/null @@ -1,163 +0,0 @@ -syntax = "proto2"; - -package pinnacle.input.v0alpha1; - -import "google/protobuf/empty.proto"; - -enum Modifier { - MODIFIER_UNSPECIFIED = 0; - MODIFIER_SHIFT = 1; - MODIFIER_CTRL = 2; - MODIFIER_ALT = 3; - MODIFIER_SUPER = 4; -} - -message SetKeybindRequest { - repeated Modifier modifiers = 1; - oneof key { - uint32 raw_code = 2; - string xkb_name = 3; - } - optional string group = 4; - optional string description = 5; -} -message SetKeybindResponse {} - -message KeybindDescriptionsRequest {} - -message KeybindDescriptionsResponse { - repeated KeybindDescription descriptions = 1; -} - -message KeybindDescription { - repeated Modifier modifiers = 1; - optional uint32 raw_code = 2; - optional string xkb_name = 3; - optional string group = 4; - optional string description = 5; -} - -message SetMousebindRequest { - repeated Modifier modifiers = 1; - // A button code corresponding to one of the `BTN_` prefixed definitions in input-event-codes.h - optional uint32 button = 2; - enum MouseEdge { - MOUSE_EDGE_UNSPECIFIED = 0; - MOUSE_EDGE_PRESS = 1; - MOUSE_EDGE_RELEASE = 2; - } - optional MouseEdge edge = 3; -} -message SetMousebindResponse {} - -message SetXkbConfigRequest { - optional string rules = 1; - optional string variant = 2; - optional string layout = 3; - optional string model = 4; - optional string options = 5; -} - -message SetRepeatRateRequest { - // How often the key should repeat, in milliseconds - optional int32 rate = 1; - // How long the key has to be held down before repeating, in milliseconds - optional int32 delay = 2; -} - -message SetLibinputSettingRequest { - // Pointer acceleration profile - enum AccelProfile { - ACCEL_PROFILE_UNSPECIFIED = 0; - // No acceleration - ACCEL_PROFILE_FLAT = 1; - // Acceleration - ACCEL_PROFILE_ADAPTIVE = 2; - } - - message CalibrationMatrix { - // Exactly 6 floats - repeated float matrix = 1; - } - - // The click method defines when to generate software-emulated - // buttons, usually on a device that does not have a specific - // physical button available. - enum ClickMethod { - CLICK_METHOD_UNSPECIFIED = 0; - CLICK_METHOD_BUTTON_AREAS = 1; - CLICK_METHOD_CLICK_FINGER = 2; - } - - // The scroll method of a device selects when to generate scroll axis - // events instead of pointer motion events. - enum ScrollMethod { - SCROLL_METHOD_UNSPECIFIED = 0; - SCROLL_METHOD_NO_SCROLL = 1; - SCROLL_METHOD_TWO_FINGER = 2; - SCROLL_METHOD_EDGE = 3; - SCROLL_METHOD_ON_BUTTON_DOWN = 4; - } - - // Map 1/2/3 finger taps to buttons - enum TapButtonMap { - TAP_BUTTON_MAP_UNSPECIFIED = 0; - // 1 tap = left mouse, 2 = right, 3 = middle - TAP_BUTTON_MAP_LEFT_RIGHT_MIDDLE = 1; - // 1 tap = left mouse, 2 = middle, 3 = right - TAP_BUTTON_MAP_LEFT_MIDDLE_RIGHT = 2; - } - - oneof setting { - AccelProfile accel_profile = 1; - double accel_speed = 2; - CalibrationMatrix calibration_matrix = 3; - ClickMethod click_method = 4; - // When `true`, the device will be disabled while typing - // and for a short period after. - bool disable_while_typing = 5; - bool left_handed = 6; - bool middle_emulation = 7; - uint32 rotation_angle = 8; - // When the scroll method is set to `SCROLL_METHOD_ON_BUTTON_DOWN`, - // pointer motion will become scroll motion and - // the specified button will also not have any press/release events - // generated. - uint32 scroll_button = 9; - // Only applies when the scroll method is `SCROLL_METHOD_ON_BUTTON_DOWN`. - // When `false`, the scroll button must be held down to button scroll. - // When `true`, the scroll button toggles scrolling instead. - bool scroll_button_lock = 10; - ScrollMethod scroll_method = 11; - // When `true`, the direction of scrolling will be reversed. - // Useful for eg. trackpads. - bool natural_scroll = 12; - TapButtonMap tap_button_map = 13; - // Enable or disable double-tap dragging - bool tap_drag = 14; - // Enable or disable a timeout that allows tap-drags to continue - // when the finger is lifted and placed back during a tap-drag - bool tap_drag_lock = 15; - // Enable or disable tap-to-click - bool tap = 16; - } -} - -message SetXcursorRequest { - optional string theme = 1; - optional uint32 size = 2; -} - -service InputService { - rpc SetKeybind(SetKeybindRequest) returns (stream SetKeybindResponse); - rpc SetMousebind(SetMousebindRequest) returns (stream SetMousebindResponse); - - rpc KeybindDescriptions(KeybindDescriptionsRequest) returns (KeybindDescriptionsResponse); - - rpc SetXkbConfig(SetXkbConfigRequest) returns (google.protobuf.Empty); - rpc SetRepeatRate(SetRepeatRateRequest) returns (google.protobuf.Empty); - - rpc SetLibinputSetting(SetLibinputSettingRequest) returns (google.protobuf.Empty); - - rpc SetXcursor(SetXcursorRequest) returns (google.protobuf.Empty); -} diff --git a/api/protocol/pinnacle/layout/v0alpha1/layout.proto b/api/protocol/pinnacle/layout/v0alpha1/layout.proto deleted file mode 100644 index 917b6d568..000000000 --- a/api/protocol/pinnacle/layout/v0alpha1/layout.proto +++ /dev/null @@ -1,56 +0,0 @@ -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 { - // A response 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; - // The output this request is responding to. - optional string output_name = 2; - // 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 = 3; - } - // An explicit layout request. - message ExplicitLayout { - // NULLABLE - // - // Layout this output. - // - // If it is null, the focused output will be used. - optional string output_name = 1; - } - - 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/output/v0alpha1/output.proto b/api/protocol/pinnacle/output/v0alpha1/output.proto deleted file mode 100644 index d4dd82285..000000000 --- a/api/protocol/pinnacle/output/v0alpha1/output.proto +++ /dev/null @@ -1,133 +0,0 @@ -syntax = "proto2"; - -package pinnacle.output.v0alpha1; - -import "google/protobuf/empty.proto"; - -message Mode { - optional uint32 pixel_width = 1; - optional uint32 pixel_height = 2; - optional uint32 refresh_rate_millihz = 3; -} - -enum Transform { - TRANSFORM_UNSPECIFIED = 0; - TRANSFORM_NORMAL = 1; - TRANSFORM_90 = 2; - TRANSFORM_180 = 3; - TRANSFORM_270 = 4; - TRANSFORM_FLIPPED = 5; - TRANSFORM_FLIPPED_90 = 6; - TRANSFORM_FLIPPED_180 = 7; - TRANSFORM_FLIPPED_270 = 8; -} - -message SetLocationRequest { - optional string output_name = 1; - optional int32 x = 2; - optional int32 y = 3; -} - -message SetModeRequest { - optional string output_name = 1; - optional uint32 pixel_width = 2; - optional uint32 pixel_height = 3; - // NULLABLE - optional uint32 refresh_rate_millihz = 4; -} - -message SetModelineRequest { - optional string output_name = 1; - optional float clock = 2; - optional uint32 hdisplay = 3; - optional uint32 hsync_start = 4; - optional uint32 hsync_end = 5; - optional uint32 htotal = 6; - optional uint32 vdisplay = 7; - optional uint32 vsync_start = 8; - optional uint32 vsync_end = 9; - optional uint32 vtotal = 10; - optional bool hsync_pos = 11; - optional bool vsync_pos = 12; -} - -message SetScaleRequest { - optional string output_name = 1; - oneof absolute_or_relative { - float absolute = 2; - float relative = 3; - } -} - -message SetTransformRequest { - optional string output_name = 1; - optional Transform transform = 2; -} - -message SetPoweredRequest { - optional string output_name = 1; - optional bool powered = 2; -} - -message GetRequest {} -message GetResponse { - repeated string output_names = 1; -} - -message GetPropertiesRequest { - optional string output_name = 1; -} -message GetPropertiesResponse { - // The monitor's manufacturer - optional string make = 1; - // The model of the monitor - optional string model = 2; - // The x-coord of the output in the global space - optional int32 x = 3; - // The y coord of the output in the global space - optional int32 y = 4; - // The logical width of the output in the global space - // taking into account scaling, in pixels. - optional uint32 logical_width = 13; - // The logical height of the output in the global space - // taking into account scaling, in pixels. - optional uint32 logical_height = 14; - // NULLABLE - // - // The current mode - optional Mode current_mode = 5; - // NULLABLE - // - // The preferred mode - optional Mode preferred_mode = 6; - // All available modes - repeated Mode modes = 7; - // In millimeters - optional uint32 physical_width = 8; - // In millimeters - optional uint32 physical_height = 9; - optional bool focused = 10; - repeated uint32 tag_ids = 11; - optional float scale = 12; - optional Transform transform = 15; - // NULLABLE - // - // The EDID serial number of this output, if it exists. - optional uint32 serial = 16; - // Window ids of the keyboard focus stack for this output. - repeated uint32 keyboard_focus_stack_window_ids = 17; - optional bool enabled = 18; - optional bool powered = 19; - optional string serial_str = 20; -} - -service OutputService { - rpc SetLocation(SetLocationRequest) returns (google.protobuf.Empty); - rpc SetMode(SetModeRequest) returns (google.protobuf.Empty); - rpc SetModeline(SetModelineRequest) returns (google.protobuf.Empty); - rpc SetScale(SetScaleRequest) returns (google.protobuf.Empty); - rpc SetTransform(SetTransformRequest) returns (google.protobuf.Empty); - rpc SetPowered(SetPoweredRequest) returns (google.protobuf.Empty); - rpc Get(GetRequest) returns (GetResponse); - rpc GetProperties(GetPropertiesRequest) returns (GetPropertiesResponse); -} diff --git a/api/protocol/pinnacle/process/v0alpha1/process.proto b/api/protocol/pinnacle/process/v0alpha1/process.proto deleted file mode 100644 index e1817bbc5..000000000 --- a/api/protocol/pinnacle/process/v0alpha1/process.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto2"; - -package pinnacle.process.v0alpha1; - -import "google/protobuf/empty.proto"; - -message SpawnRequest { - repeated string args = 1; - // Whether or not to spawn `args` if it is already running. - // - // `false` for yes, `true` for no - optional bool once = 2; - optional bool has_callback = 3; -} - -message SpawnResponse { - optional string stdout = 1; - optional string stderr = 2; - optional int32 exit_code = 3; - optional string exit_message = 4; -} - -message SetEnvRequest { - optional string key = 1; - optional string value = 2; -} - -service ProcessService { - rpc Spawn(SpawnRequest) returns (stream SpawnResponse); - rpc SetEnv(SetEnvRequest) returns (google.protobuf.Empty); -} diff --git a/api/protocol/pinnacle/render/v0alpha1/render.proto b/api/protocol/pinnacle/render/v0alpha1/render.proto deleted file mode 100644 index a5df5f0cb..000000000 --- a/api/protocol/pinnacle/render/v0alpha1/render.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto2"; - -package pinnacle.render.v0alpha1; - -import "google/protobuf/empty.proto"; - -// The filtering method. -enum Filter { - FILTER_UNSPECIFIED = 0; - // Bilinear filtering. - // - // This will cause up- and downscaling to be blurry. - FILTER_BILINEAR = 1; - // Nearest neighbor filtering. - // - // This will cause edges to become pixelated when scaling. - FILTER_NEAREST_NEIGHBOR = 2; -} - -message SetUpscaleFilterRequest { - // The filter that will be used. - optional Filter filter = 1; -} - -message SetDownscaleFilterRequest { - // The filter that will be used. - optional Filter filter = 1; -} - -service RenderService { - // Set the upscaling filter the renderer will use when upscaling buffers. - rpc SetUpscaleFilter(SetUpscaleFilterRequest) returns (google.protobuf.Empty); - // Set the downscaling filter the renderer will use when downscaling buffers. - rpc SetDownscaleFilter(SetDownscaleFilterRequest) returns (google.protobuf.Empty); -} diff --git a/api/protocol/pinnacle/signal/v0alpha1/signal.proto b/api/protocol/pinnacle/signal/v0alpha1/signal.proto deleted file mode 100644 index 603dd0453..000000000 --- a/api/protocol/pinnacle/signal/v0alpha1/signal.proto +++ /dev/null @@ -1,83 +0,0 @@ -syntax = "proto2"; - -package pinnacle.signal.v0alpha1; - -enum StreamControl { - STREAM_CONTROL_UNSPECIFIED = 0; - // The client is ready to receive the next signal. - STREAM_CONTROL_READY = 1; - // The client wishes to disconnect a signal connection. - STREAM_CONTROL_DISCONNECT = 2; -} - -message OutputConnectRequest { - optional StreamControl control = 1; -} -message OutputConnectResponse { - optional string output_name = 1; -} -message OutputDisconnectRequest { - optional StreamControl control = 1; -} -message OutputDisconnectResponse { - optional string output_name = 1; -} - -message OutputResizeRequest { - optional StreamControl control = 1; -} - -// An output's logical size changed -message OutputResizeResponse { - optional string output_name = 1; - optional uint32 logical_width = 2; - optional uint32 logical_height = 3; -} - -message OutputMoveRequest { - optional StreamControl control = 1; -} - -// An output's location in the global space changed -message OutputMoveResponse { - optional string output_name = 1; - optional int32 x = 2; - optional int32 y = 3; -} - -message WindowPointerEnterRequest { - optional StreamControl control = 1; -} -message WindowPointerEnterResponse { - // The window that the pointer entered. - optional uint32 window_id = 1; -} - -message WindowPointerLeaveRequest { - optional StreamControl control = 1; -} -message WindowPointerLeaveResponse { - // The window that the pointer left. - optional uint32 window_id = 1; -} - -message TagActiveRequest { - optional StreamControl control = 1; -} -message TagActiveResponse { - optional uint32 tag_id = 1; - // The tag was set to active or inactive. - optional bool active = 2; -} - -service SignalService { - rpc OutputConnect(stream OutputConnectRequest) returns (stream OutputConnectResponse); - rpc OutputDisconnect(stream OutputDisconnectRequest) returns (stream OutputDisconnectResponse); - rpc OutputResize(stream OutputResizeRequest) returns (stream OutputResizeResponse); - rpc OutputMove(stream OutputMoveRequest) returns (stream OutputMoveResponse); - - rpc WindowPointerEnter(stream WindowPointerEnterRequest) returns (stream WindowPointerEnterResponse); - rpc WindowPointerLeave(stream WindowPointerLeaveRequest) returns (stream WindowPointerLeaveResponse); - - rpc TagActive(stream TagActiveRequest) returns (stream TagActiveResponse); -} diff --git a/api/protocol/pinnacle/tag/v0alpha1/tag.proto b/api/protocol/pinnacle/tag/v0alpha1/tag.proto deleted file mode 100644 index b6522819e..000000000 --- a/api/protocol/pinnacle/tag/v0alpha1/tag.proto +++ /dev/null @@ -1,55 +0,0 @@ -syntax = "proto2"; - -package pinnacle.tag.v0alpha1; - -import "google/protobuf/empty.proto"; -import "pinnacle/v0alpha1/pinnacle.proto"; - -message SetActiveRequest { - optional uint32 tag_id = 1; - optional .pinnacle.v0alpha1.SetOrToggle set_or_toggle = 2; -} - -message SwitchToRequest { - optional uint32 tag_id = 1; -} - -message AddRequest { - optional string output_name = 1; - repeated string tag_names = 2; -} -message AddResponse { - repeated uint32 tag_ids = 1; -} - -message RemoveRequest { - repeated uint32 tag_ids = 1; -} - -message GetRequest {} -message GetResponse { - repeated uint32 tag_ids = 1; -} - -message GetPropertiesRequest { - optional uint32 tag_id = 1; -} -message GetPropertiesResponse { - // Whether or not this tag is active - optional bool active = 1; - // The name of this tag - optional string name = 2; - // The output this tag is on - optional string output_name = 3; - // All windows that have this tag - repeated uint32 window_ids = 4; -} - -service TagService { - rpc SetActive(SetActiveRequest) returns (google.protobuf.Empty); - rpc SwitchTo(SwitchToRequest) returns (google.protobuf.Empty); - rpc Add(AddRequest) returns (AddResponse); - rpc Remove(RemoveRequest) returns (google.protobuf.Empty); - rpc Get(GetRequest) returns (GetResponse); - rpc GetProperties(GetPropertiesRequest) returns (GetPropertiesResponse); -} diff --git a/api/protocol/pinnacle/v0alpha1/pinnacle.proto b/api/protocol/pinnacle/v0alpha1/pinnacle.proto deleted file mode 100644 index a70df3609..000000000 --- a/api/protocol/pinnacle/v0alpha1/pinnacle.proto +++ /dev/null @@ -1,59 +0,0 @@ -syntax = "proto2"; - -package pinnacle.v0alpha1; - -import "google/protobuf/empty.proto"; - -message Geometry { - optional int32 x = 1; - optional int32 y = 2; - optional int32 width = 3; - optional int32 height = 4; -} - -enum SetOrToggle { - SET_OR_TOGGLE_UNSPECIFIED = 0; - SET_OR_TOGGLE_SET = 1; - SET_OR_TOGGLE_UNSET = 2; - SET_OR_TOGGLE_TOGGLE = 3; -} - -message QuitRequest {} - -message ReloadConfigRequest {} - -// A manual ping request independent of any HTTP keepalive. -// -// Tonic does not seems to give you the means to run something -// when a keepalive ping fails, so this is for the Rust API to -// ping the compositor. -message PingRequest { - optional bytes payload = 1; -} - -message PingResponse { - optional bytes payload = 1; -} - -message ShutdownWatchRequest {} -message ShutdownWatchResponse {} - -enum Backend { - BACKEND_UNSPECIFIED = 0; - BACKEND_WINDOW = 1; - BACKEND_TTY = 2; -} - -message BackendRequest {} -message BackendResponse { - optional Backend backend = 1; -} - -service PinnacleService { - rpc Quit(QuitRequest) returns (google.protobuf.Empty); - rpc ReloadConfig(ReloadConfigRequest) returns (google.protobuf.Empty); - rpc Ping(PingRequest) returns (PingResponse); - rpc ShutdownWatch(ShutdownWatchRequest) returns (stream ShutdownWatchResponse); - // Gets the currently running backend. - rpc Backend(BackendRequest) returns (BackendResponse); -} diff --git a/api/protocol/pinnacle/window/v0alpha1/window.proto b/api/protocol/pinnacle/window/v0alpha1/window.proto deleted file mode 100644 index 486c25cb6..000000000 --- a/api/protocol/pinnacle/window/v0alpha1/window.proto +++ /dev/null @@ -1,151 +0,0 @@ -syntax = "proto2"; - -package pinnacle.window.v0alpha1; - -import "google/protobuf/empty.proto"; -import "pinnacle/v0alpha1/pinnacle.proto"; - -message CloseRequest { - optional uint32 window_id = 1; -} - -// Set the window's location and size -message SetGeometryRequest { - optional uint32 window_id = 1; - optional .pinnacle.v0alpha1.Geometry geometry = 2; -} - -message SetFullscreenRequest { - optional uint32 window_id = 1; - optional .pinnacle.v0alpha1.SetOrToggle set_or_toggle = 2; -} - -message SetMaximizedRequest { - optional uint32 window_id = 1; - optional .pinnacle.v0alpha1.SetOrToggle set_or_toggle = 2; -} - -message SetFloatingRequest { - optional uint32 window_id = 1; - optional .pinnacle.v0alpha1.SetOrToggle set_or_toggle = 2; -} - -message SetFocusedRequest { - optional uint32 window_id = 1; - optional .pinnacle.v0alpha1.SetOrToggle set_or_toggle = 2; -} - -message MoveToTagRequest { - optional uint32 window_id = 1; - optional uint32 tag_id = 2; -} - -message SetTagRequest { - optional uint32 window_id = 1; - optional uint32 tag_id = 2; - optional .pinnacle.v0alpha1.SetOrToggle set_or_toggle = 3; -} - -// Raise a window. -message RaiseRequest { - // The id of the window to raise. - optional uint32 window_id = 1; -} - -message MoveGrabRequest { - optional uint32 button = 1; -} - -message ResizeGrabRequest { - optional uint32 button = 1; -} - - -message GetRequest {} -message GetResponse { - repeated uint32 window_ids = 1; -} - -message GetPropertiesRequest { - optional uint32 window_id = 1; -} -message GetPropertiesResponse { - optional .pinnacle.v0alpha1.Geometry geometry = 1; - optional string class = 2; - optional string title = 3; - optional bool focused = 4; - optional bool floating = 5 [deprecated = true]; - optional FullscreenOrMaximized fullscreen_or_maximized = 6 [deprecated = true]; - repeated uint32 tag_ids = 7; - optional WindowState state = 8; -} - -enum FullscreenOrMaximized { - FULLSCREEN_OR_MAXIMIZED_UNSPECIFIED = 0; - FULLSCREEN_OR_MAXIMIZED_NEITHER = 1; - FULLSCREEN_OR_MAXIMIZED_FULLSCREEN = 2; - FULLSCREEN_OR_MAXIMIZED_MAXIMIZED = 3; -} - -message AddWindowRuleRequest { - optional WindowRuleCondition cond = 1; - optional WindowRule rule = 2; -} - -message WindowRuleCondition { - repeated WindowRuleCondition any = 1; - repeated WindowRuleCondition all = 2; - repeated string classes = 3; - repeated string titles = 4; - repeated uint32 tags = 5; -} - -enum WindowState { - WINDOW_STATE_UNSPECIFIED = 0; - WINDOW_STATE_TILED = 1; - WINDOW_STATE_FLOATING = 2; - WINDOW_STATE_FULLSCREEN = 3; - WINDOW_STATE_MAXIMIZED = 4; -} - -message WindowRule { - optional string output = 1; - repeated uint32 tags = 2; - - // DEPRECATED - // TODO: remove in 0.1/0.2 - // `true` for floating, `false` for tiled - optional bool floating = 3; - - // DEPRECATED - // TODO: remove in 0.1/0.2 - optional FullscreenOrMaximized fullscreen_or_maximized = 4; - - optional int32 x = 5; - optional int32 y = 6; - optional int32 width = 7; - optional int32 height = 8; - // true to force ssd, false to force csd, null to not force anything - optional bool ssd = 9; - - optional WindowState state = 10; -} - -service WindowService { - rpc Close(CloseRequest) returns (google.protobuf.Empty); - rpc SetGeometry(SetGeometryRequest) returns (google.protobuf.Empty); - rpc SetFullscreen(SetFullscreenRequest) returns (google.protobuf.Empty); - rpc SetMaximized(SetMaximizedRequest) returns (google.protobuf.Empty); - rpc SetFloating(SetFloatingRequest) returns (google.protobuf.Empty); - rpc SetFocused(SetFocusedRequest) returns (google.protobuf.Empty); - rpc MoveToTag(MoveToTagRequest) returns (google.protobuf.Empty); - rpc SetTag(SetTagRequest) returns (google.protobuf.Empty); - rpc Raise(RaiseRequest) returns (google.protobuf.Empty); - rpc MoveGrab(MoveGrabRequest) returns (google.protobuf.Empty); - rpc ResizeGrab(ResizeGrabRequest) returns (google.protobuf.Empty); - - rpc Get(GetRequest) returns (GetResponse); - rpc GetProperties(GetPropertiesRequest) returns (GetPropertiesResponse); - - rpc AddWindowRule(AddWindowRuleRequest) returns (google.protobuf.Empty); -} diff --git a/justfile b/justfile index 1d42650be..914b9d4f0 100644 --- a/justfile +++ b/justfile @@ -32,7 +32,7 @@ install-protos: proto_dir="{{xdg_data_dir}}/protobuf" rm -rf "${proto_dir}" mkdir -p "{{xdg_data_dir}}" - cp -r "{{rootdir}}/api/protocol" "${proto_dir}" + cp -r "{{rootdir}}/api/protobuf" "${proto_dir}" # Install the Lua library (requires Luarocks) install-lua-lib: gen-lua-pb-defs @@ -75,7 +75,7 @@ install-protos-root: proto_dir="{{root_xdg_data_dir}}/protobuf" rm -rf "${proto_dir}" mkdir -p "{{root_xdg_data_dir}}" - cp -r "{{rootdir}}/api/protocol" "${proto_dir}" + cp -r "{{rootdir}}/api/protobuf" "${proto_dir}" # [root] Install the Lua library (requires Luarocks) install-lua-lib-root: @@ -93,7 +93,7 @@ gen-lua-pb-defs: #!/usr/bin/env bash set -euxo pipefail cargo build --package lua-build - ./target/debug/lua-build ./api/protocol > "./api/lua/pinnacle/grpc/defs.lua" + ./target/debug/lua-build ./api/protobuf > "./api/lua/pinnacle/grpc/defs.lua" # Run `cargo run` run *args: gen-lua-pb-defs diff --git a/pinnacle-api-defs/build.rs b/pinnacle-api-defs/build.rs index 7667d6661..4f7fb9a80 100644 --- a/pinnacle-api-defs/build.rs +++ b/pinnacle-api-defs/build.rs @@ -1,28 +1,13 @@ use std::path::PathBuf; fn main() { - println!("cargo:rerun-if-changed=../api/protocol"); + println!("cargo:rerun-if-changed=../api/protobuf"); let mut proto_paths = Vec::new(); - // TODO: remove this - for entry in walkdir::WalkDir::new("../api/protocol") { - let entry = entry.unwrap(); - - if entry.file_type().is_file() && entry.path().extension().is_some_and(|ext| ext == "proto") - { - proto_paths.push(entry.into_path()); - } - } - for entry in walkdir::WalkDir::new("../api/protobuf") { let entry = entry.unwrap(); - // TODO: remove - if entry.path().ends_with("empty.proto") { - continue; - } - if entry.file_type().is_file() && entry.path().extension().is_some_and(|ext| ext == "proto") { proto_paths.push(entry.into_path()); @@ -33,6 +18,6 @@ fn main() { tonic_build::configure() .file_descriptor_set_path(descriptor_path) - .compile_protos(&proto_paths, &["../api/protocol", "../api/protobuf"]) + .compile_protos(&proto_paths, &["../api/protobuf"]) .unwrap(); }