pinnacle/api/lua/msg.lua

82 lines
3.2 KiB
Lua
Raw Normal View History

2023-08-01 11:06:35 -05:00
-- SPDX-License-Identifier: GPL-3.0-or-later
2023-06-26 21:05:29 -05:00
---@meta _
---@class _Msg
2023-09-09 19:27:05 -05:00
---@field SetKeybind { key: { Int: Keys?, String: string? }, modifiers: Modifier[], callback_id: integer }?
2023-09-10 21:54:58 -05:00
---@field SetMousebind { modifiers: (Modifier)[], button: integer, edge: "Press"|"Release", callback_id: integer }?
--Windows
2023-07-22 17:43:36 -05:00
---@field CloseWindow { window_id: WindowId }?
---@field SetWindowSize { window_id: WindowId, width: integer?, height: integer? }?
---@field MoveWindowToTag { window_id: WindowId, tag_id: TagId }?
---@field ToggleTagOnWindow { window_id: WindowId, tag_id: TagId }?
---@field ToggleFloating { window_id: WindowId }?
---@field ToggleFullscreen { window_id: WindowId }?
---@field ToggleMaximized { window_id: WindowId }?
2023-09-05 23:18:44 -05:00
---@field AddWindowRule { cond: _WindowRuleCondition, rule: _WindowRule }?
2023-09-10 21:54:58 -05:00
---@field WindowMoveGrab { button: integer }?
---@field WindowResizeGrab { button: integer }?
2023-08-11 18:48:51 -05:00
--
2023-07-22 17:43:36 -05:00
---@field Spawn { command: string[], callback_id: integer? }?
---@field SpawnOnce { command: string[], callback_id: integer? }?
2023-09-10 04:49:31 -05:00
---@field SetEnv { key: string, value: string }?
2023-06-30 21:34:07 -05:00
--Tags
2023-07-22 17:43:36 -05:00
---@field ToggleTag { tag_id: TagId }?
---@field SwitchToTag { tag_id: TagId }?
---@field AddTags { output_name: string, tag_names: string[] }?
---@field RemoveTags { tag_ids: TagId[] }?
---@field SetLayout { tag_id: TagId, layout: Layout }?
2023-07-11 11:59:38 -05:00
--Outputs
2023-07-22 17:43:36 -05:00
---@field ConnectForAllOutputs { callback_id: integer }?
2023-08-04 13:45:38 -05:00
---@field SetOutputLocation { output_name: OutputName, x: integer?, y: integer? }?
2023-09-28 10:17:28 -05:00
--Input
---@field SetXkbConfig XkbConfig?
2023-09-28 18:46:08 -05:00
---@field SetLibinputSetting LibinputSetting?
2023-09-28 10:17:28 -05:00
---@field Request Request?
2023-06-26 21:05:29 -05:00
---@alias Msg _Msg | "Quit"
---@alias FullscreenOrMaximized
---| "Neither"
2023-08-11 18:48:51 -05:00
---| "Fullscreen"
---| "Maximized"
2023-07-11 11:59:38 -05:00
--------------------------------------------------------------------------------------------
---@class __Request
2023-07-11 11:59:38 -05:00
--Windows
2023-07-22 17:43:36 -05:00
---@field GetWindowProps { window_id: WindowId }?
2023-07-11 11:59:38 -05:00
--Outputs
2023-07-22 17:43:36 -05:00
---@field GetOutputProps { output_name: string }?
2023-07-19 18:55:22 -05:00
--Tags
2023-07-22 17:43:36 -05:00
---@field GetTagProps { tag_id: TagId }?
2023-07-11 11:59:38 -05:00
---@alias _Request __Request | "GetWindows" | "GetOutputs" | "GetTags"
---@alias Request { request_id: integer, request: _Request }
2023-06-26 21:05:29 -05:00
---@class IncomingMsg
2023-07-22 17:43:36 -05:00
---@field CallCallback { callback_id: integer, args: Args? }?
---@field RequestResponse { request_id: integer, response: RequestResponse }?
2023-06-26 21:05:29 -05:00
---@class Args
2023-07-22 17:43:36 -05:00
---@field Spawn { stdout: string?, stderr: string?, exit_code: integer?, exit_msg: string? }?
---@field ConnectForAllOutputs { output_name: string }?
2023-06-26 21:05:29 -05:00
---@alias WindowId integer | "None"
2023-10-18 20:16:26 -05:00
---@alias TagId integer | "None"
---@alias RequestId integer
2023-07-18 15:12:23 -05:00
---@alias OutputName string
2023-06-26 21:05:29 -05:00
---@class RequestResponse
2023-07-18 21:10:43 -05:00
--Windows
---@field Window { window_id: WindowId }?
2023-07-22 17:43:36 -05:00
---@field Windows { window_ids: WindowId[] }?
---@field WindowProps { size: integer[]?, loc: integer[]?, class: string?, title: string?, focused: boolean?, floating: boolean?, fullscreen_or_maximized: FullscreenOrMaximized? }?
2023-07-18 21:10:43 -05:00
--Outputs
2023-07-22 17:43:36 -05:00
---@field Output { output_name: OutputName? }?
---@field Outputs { output_names: OutputName[] }?
---@field OutputProps { make: string?, model: string?, loc: integer[]?, res: integer[]?, refresh_rate: integer?, physical_size: integer[]?, focused: boolean?, tag_ids: integer[]? }?
2023-07-18 21:10:43 -05:00
--Tags
2023-07-22 17:43:36 -05:00
---@field Tags { tag_ids: TagId[] }?
---@field TagProps { active: boolean?, name: string?, output_name: string? }?