mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-17 18:11:30 +01:00
Add not that great documentation file
This commit is contained in:
parent
017ef8f09d
commit
6898d19140
4 changed files with 1436 additions and 41 deletions
1395
api/lua/doc.md
Normal file
1395
api/lua/doc.md
Normal file
File diff suppressed because it is too large
Load diff
|
@ -34,7 +34,7 @@ end
|
|||
|
||||
---Get all tags on this output.
|
||||
---@return Tag[]
|
||||
---@see OutputGlobal.tags — The corresponding module function
|
||||
---@see OutputModule.tags — The corresponding module function
|
||||
function output:tags()
|
||||
return output_module.tags(self)
|
||||
end
|
||||
|
@ -42,35 +42,35 @@ end
|
|||
---Add tags to this output.
|
||||
---@param ... string The names of the tags you want to add. You can also pass in a table.
|
||||
---@overload fun(self: self, tag_names: string[])
|
||||
---@see OutputGlobal.add_tags — The corresponding module function
|
||||
---@see OutputModule.add_tags — The corresponding module function
|
||||
function output:add_tags(...)
|
||||
output_module.add_tags(self, ...)
|
||||
end
|
||||
|
||||
---Get this output's make.
|
||||
---@return string|nil
|
||||
---@see OutputGlobal.make — The corresponding module function
|
||||
---@see OutputModule.make — The corresponding module function
|
||||
function output:make()
|
||||
return output_module.make(self)
|
||||
end
|
||||
|
||||
---Get this output's model.
|
||||
---@return string|nil
|
||||
---@see OutputGlobal.model — The corresponding module function
|
||||
---@see OutputModule.model — The corresponding module function
|
||||
function output:model()
|
||||
return output_module.model(self)
|
||||
end
|
||||
|
||||
---Get this output's location in the global space, in pixels.
|
||||
---@return { x: integer, y: integer }|nil
|
||||
---@see OutputGlobal.loc — The corresponding module function
|
||||
---@see OutputModule.loc — The corresponding module function
|
||||
function output:loc()
|
||||
return output_module.loc(self)
|
||||
end
|
||||
|
||||
---Get this output's resolution in pixels.
|
||||
---@return { w: integer, h: integer }|nil
|
||||
---@see OutputGlobal.res — The corresponding module function
|
||||
---@see OutputModule.res — The corresponding module function
|
||||
function output:res()
|
||||
return output_module.res(self)
|
||||
end
|
||||
|
@ -78,21 +78,21 @@ end
|
|||
---Get this output's refresh rate in millihertz.
|
||||
---For example, 60Hz will be returned as 60000.
|
||||
---@return integer|nil
|
||||
---@see OutputGlobal.refresh_rate — The corresponding module function
|
||||
---@see OutputModule.refresh_rate — The corresponding module function
|
||||
function output:refresh_rate()
|
||||
return output_module.refresh_rate(self)
|
||||
end
|
||||
|
||||
---Get this output's physical size in millimeters.
|
||||
---@return { w: integer, h: integer }|nil
|
||||
---@see OutputGlobal.physical_size — The corresponding module function
|
||||
---@see OutputModule.physical_size — The corresponding module function
|
||||
function output:physical_size()
|
||||
return output_module.physical_size(self)
|
||||
end
|
||||
|
||||
---Get whether or not this output is focused. This is currently defined as having the cursor on it.
|
||||
---@return boolean|nil
|
||||
---@see OutputGlobal.focused — The corresponding module function
|
||||
---@see OutputModule.focused — The corresponding module function
|
||||
function output:focused()
|
||||
return output_module.focused(self)
|
||||
end
|
||||
|
@ -227,7 +227,7 @@ end
|
|||
---Get the output the specified tag is on.
|
||||
---@param tag Tag
|
||||
---@return Output|nil
|
||||
---@see TagGlobal.output — A global method for fully qualified syntax (for you Rustaceans out there)
|
||||
---@see TagModule.output — A global method for fully qualified syntax (for you Rustaceans out there)
|
||||
---@see Tag.output — The corresponding object method
|
||||
function output_module.get_for_tag(tag)
|
||||
local response = Request({
|
||||
|
@ -357,7 +357,7 @@ end
|
|||
|
||||
---Get the specified output's tags.
|
||||
---@param op Output
|
||||
---@see TagGlobal.get_on_output — The called function
|
||||
---@see TagModule.get_on_output — The called function
|
||||
---@see Output.tags — The corresponding object method
|
||||
function output_module.tags(op)
|
||||
return require("tag").get_on_output(op)
|
||||
|
@ -367,7 +367,7 @@ end
|
|||
---@param op Output
|
||||
---@param ... string The names of the tags you want to add. You can also pass in a table.
|
||||
---@overload fun(op: Output, tag_names: string[])
|
||||
---@see TagGlobal.add — The called function
|
||||
---@see TagModule.add — The called function
|
||||
---@see Output.add_tags — The corresponding object method
|
||||
function output_module.add_tags(op, ...)
|
||||
require("tag").add(op, ...)
|
||||
|
|
|
@ -44,40 +44,40 @@ end
|
|||
|
||||
---Get this tag's active status.
|
||||
---@return boolean|nil active `true` if the tag is active, `false` if not, and `nil` if the tag doesn't exist.
|
||||
---@see TagGlobal.active — The corresponding module function
|
||||
---@see TagModule.active — The corresponding module function
|
||||
function tag:active()
|
||||
return tag_module.active(self)
|
||||
end
|
||||
|
||||
---Get this tag's name.
|
||||
---@return string|nil name The name of this tag, or nil if it doesn't exist.
|
||||
---@see TagGlobal.name — The corresponding module function
|
||||
---@see TagModule.name — The corresponding module function
|
||||
function tag:name()
|
||||
return tag_module.name(self)
|
||||
end
|
||||
|
||||
---Get this tag's output.
|
||||
---@return Output|nil output The output this tag is on, or nil if the tag doesn't exist.
|
||||
---@see TagGlobal.output — The corresponding module function
|
||||
---@see TagModule.output — The corresponding module function
|
||||
function tag:output()
|
||||
return tag_module.output(self)
|
||||
end
|
||||
|
||||
---Switch to this tag.
|
||||
---@see TagGlobal.switch_to — The corresponding module function
|
||||
---@see TagModule.switch_to — The corresponding module function
|
||||
function tag:switch_to()
|
||||
tag_module.switch_to(self)
|
||||
end
|
||||
|
||||
---Toggle this tag.
|
||||
---@see TagGlobal.toggle — The corresponding module function
|
||||
---@see TagModule.toggle — The corresponding module function
|
||||
function tag:toggle()
|
||||
tag_module.toggle(self)
|
||||
end
|
||||
|
||||
---Set this tag's layout.
|
||||
---@param layout Layout
|
||||
---@see TagGlobal.set_layout — The corresponding module function
|
||||
---@see TagModule.set_layout — The corresponding module function
|
||||
function tag:set_layout(layout)
|
||||
tag_module.set_layout(self, layout)
|
||||
end
|
||||
|
@ -391,7 +391,7 @@ end
|
|||
---Get the output the specified tag is on.
|
||||
---@param t Tag
|
||||
---@return Output|nil
|
||||
---@see OutputGlobal.get_for_tag — The called function
|
||||
---@see OutputModule.get_for_tag — The called function
|
||||
---@see Tag.output — The corresponding object method
|
||||
function tag_module.output(t)
|
||||
return require("output").get_for_tag(t)
|
||||
|
|
|
@ -41,7 +41,7 @@ end
|
|||
---window.get_focused():set_size({}) -- do absolutely nothing useful
|
||||
---```
|
||||
---@param size { w: integer?, h: integer? }
|
||||
---@see WindowGlobal.set_size — The corresponding module function
|
||||
---@see WindowModule.set_size — The corresponding module function
|
||||
function window:set_size(size)
|
||||
window_module.set_size(self, size)
|
||||
end
|
||||
|
@ -57,7 +57,7 @@ end
|
|||
---@param name string
|
||||
---@param output Output?
|
||||
---@overload fun(self: self, t: Tag)
|
||||
---@see WindowGlobal.move_to_tag — The corresponding module function
|
||||
---@see WindowModule.move_to_tag — The corresponding module function
|
||||
function window:move_to_tag(name, output)
|
||||
window_module.move_to_tag(self, name, output)
|
||||
end
|
||||
|
@ -75,7 +75,7 @@ end
|
|||
---@param name string
|
||||
---@param output Output?
|
||||
---@overload fun(self: self, t: Tag)
|
||||
---@see WindowGlobal.toggle_tag — The corresponding module function
|
||||
---@see WindowModule.toggle_tag — The corresponding module function
|
||||
function window:toggle_tag(name, output)
|
||||
window_module.toggle_tag(self, name, output)
|
||||
end
|
||||
|
@ -89,7 +89,7 @@ end
|
|||
---```lua
|
||||
---window.get_focused():close() -- close the currently focused window
|
||||
---```
|
||||
---@see WindowGlobal.close — The corresponding module function
|
||||
---@see WindowModule.close — The corresponding module function
|
||||
function window:close()
|
||||
window_module.close(self)
|
||||
end
|
||||
|
@ -100,7 +100,7 @@ end
|
|||
---```lua
|
||||
---window.get_focused():toggle_floating() -- toggles the focused window between tiled and floating
|
||||
---```
|
||||
---@see WindowGlobal.toggle_floating — The corresponding module function
|
||||
---@see WindowModule.toggle_floating — The corresponding module function
|
||||
function window:toggle_floating()
|
||||
window_module.toggle_floating(self)
|
||||
end
|
||||
|
@ -114,7 +114,7 @@ end
|
|||
----- ...should have size equal to `{ w = 3840, h = 2160 }`.
|
||||
---```
|
||||
---@return { w: integer, h: integer }|nil size The size of the window, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.size — The corresponding module function
|
||||
---@see WindowModule.size — The corresponding module function
|
||||
function window:size()
|
||||
return window_module.size(self)
|
||||
end
|
||||
|
@ -133,7 +133,7 @@ end
|
|||
----- ...should have loc equal to `{ x = 1920, y = 0 }`.
|
||||
---```
|
||||
---@return { x: integer, y: integer }|nil loc The location of the window, or nil if it's not on-screen or alive.
|
||||
---@see WindowGlobal.loc — The corresponding module function
|
||||
---@see WindowModule.loc — The corresponding module function
|
||||
function window:loc()
|
||||
return window_module.loc(self)
|
||||
end
|
||||
|
@ -147,7 +147,7 @@ end
|
|||
----- ...should print "Alacritty".
|
||||
---```
|
||||
---@return string|nil class This window's class, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.class — The corresponding module function
|
||||
---@see WindowModule.class — The corresponding module function
|
||||
function window:class()
|
||||
return window_module.class(self)
|
||||
end
|
||||
|
@ -161,7 +161,7 @@ end
|
|||
----- ...should print the directory Alacritty is in or what it's running (what's in its title bar).
|
||||
---```
|
||||
---@return string|nil title This window's title, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.title — The corresponding module function
|
||||
---@see WindowModule.title — The corresponding module function
|
||||
function window:title()
|
||||
return window_module.title(self)
|
||||
end
|
||||
|
@ -175,7 +175,7 @@ end
|
|||
----- ...should print `true`.
|
||||
---```
|
||||
---@return boolean|nil floating `true` if it's floating, `false` if it's tiled, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.floating — The corresponding module function
|
||||
---@see WindowModule.floating — The corresponding module function
|
||||
function window:floating()
|
||||
return window_module.floating(self)
|
||||
end
|
||||
|
@ -187,7 +187,7 @@ end
|
|||
---print(window.get_focused():focused()) -- should print `true`.
|
||||
---```
|
||||
---@return boolean|nil floating `true` if it's floating, `false` if it's tiled, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.focused — The corresponding module function
|
||||
---@see WindowModule.focused — The corresponding module function
|
||||
function window:focused()
|
||||
return window_module.focused(self)
|
||||
end
|
||||
|
@ -260,7 +260,7 @@ end
|
|||
---@param name string
|
||||
---@param output Output?
|
||||
---@overload fun(w: Window, t: Tag)
|
||||
---@see WindowGlobal.toggle_tag — The corresponding object method
|
||||
---@see Window.toggle_tag — The corresponding object method
|
||||
function window_module.toggle_tag(w, name, output)
|
||||
if type(name) == "table" then
|
||||
SendMsg({
|
||||
|
@ -298,7 +298,7 @@ end
|
|||
---@param name string
|
||||
---@param output Output?
|
||||
---@overload fun(w: Window, t: Tag)
|
||||
---@see WindowGlobal.move_to_tag — The corresponding object method
|
||||
---@see Window.move_to_tag — The corresponding object method
|
||||
function window_module.move_to_tag(w, name, output)
|
||||
if type(name) == "table" then
|
||||
SendMsg({
|
||||
|
@ -343,7 +343,7 @@ end
|
|||
---```
|
||||
---@param win Window
|
||||
---@param size { w: integer?, h: integer? }
|
||||
---@see WindowGlobal.set_size — The corresponding object method
|
||||
---@see Window.set_size — The corresponding object method
|
||||
function window_module.set_size(win, size)
|
||||
SendMsg({
|
||||
SetWindowSize = {
|
||||
|
@ -367,7 +367,7 @@ end
|
|||
---end
|
||||
---```
|
||||
---@param win Window
|
||||
---@see WindowGlobal.close — The corresponding object method
|
||||
---@see Window.close — The corresponding object method
|
||||
function window_module.close(win)
|
||||
SendMsg({
|
||||
CloseWindow = {
|
||||
|
@ -378,7 +378,7 @@ end
|
|||
|
||||
---Toggle the specified window between tiled and floating.
|
||||
---@param win Window
|
||||
---@see WindowGlobal.toggle_floating — The corresponding object method
|
||||
---@see Window.toggle_floating — The corresponding object method
|
||||
function window_module.toggle_floating(win)
|
||||
SendMsg({
|
||||
ToggleFloating = {
|
||||
|
@ -397,7 +397,7 @@ end
|
|||
---```
|
||||
---@param win Window
|
||||
---@return { w: integer, h: integer }|nil size The size of the window, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.size — The corresponding object method
|
||||
---@see Window.size — The corresponding object method
|
||||
function window_module.size(win)
|
||||
local response = Request({
|
||||
GetWindowProps = {
|
||||
|
@ -430,7 +430,7 @@ end
|
|||
---```
|
||||
---@param win Window
|
||||
---@return { x: integer, y: integer }|nil loc The location of the window, or nil if it's not on-screen or alive.
|
||||
---@see WindowGlobal.loc — The corresponding object method
|
||||
---@see Window.loc — The corresponding object method
|
||||
function window_module.loc(win)
|
||||
local response = Request({
|
||||
GetWindowProps = {
|
||||
|
@ -461,7 +461,7 @@ end
|
|||
---```
|
||||
---@param win Window
|
||||
---@return string|nil class This window's class, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.class — The corresponding object method
|
||||
---@see Window.class — The corresponding object method
|
||||
function window_module.class(win)
|
||||
local response = Request({
|
||||
GetWindowProps = {
|
||||
|
@ -485,7 +485,7 @@ end
|
|||
---```
|
||||
---@param win Window
|
||||
---@return string|nil title This window's title, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.title — The corresponding object method
|
||||
---@see Window.title — The corresponding object method
|
||||
function window_module.title(win)
|
||||
local response = Request({
|
||||
GetWindowProps = {
|
||||
|
@ -509,7 +509,7 @@ end
|
|||
---```
|
||||
---@param win Window
|
||||
---@return boolean|nil floating `true` if it's floating, `false` if it's tiled, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.floating — The corresponding object method
|
||||
---@see Window.floating — The corresponding object method
|
||||
function window_module.floating(win)
|
||||
local response = Request({
|
||||
GetWindowProps = {
|
||||
|
@ -531,7 +531,7 @@ end
|
|||
---```
|
||||
---@param win Window
|
||||
---@return boolean|nil floating `true` if it's floating, `false` if it's tiled, or nil if it doesn't exist.
|
||||
---@see WindowGlobal.focused — The corresponding object method
|
||||
---@see Window.focused — The corresponding object method
|
||||
function window_module.focused(win)
|
||||
local response = Request({
|
||||
GetWindowProps = {
|
||||
|
|
Loading…
Reference in a new issue