doc: Document the client layouts. (#1247)

This commit doesn't add any useful documentation, but adds
previously hidden documentation variables. It can be the basis
of a better layout documentation.

Fix #1246
This commit is contained in:
Emmanuel Lepage Vallée 2016-12-09 20:24:22 -05:00 committed by Daniel Hahler
parent 91d970aed6
commit 548b15e883
10 changed files with 77 additions and 24 deletions

View File

@ -49,6 +49,8 @@ new_type("beautiful", "Theme variables", false, "Type")
new_type("deprecated", "Deprecated functions", false, "param") new_type("deprecated", "Deprecated functions", false, "param")
-- For the legacy stateless layout related functions -- For the legacy stateless layout related functions
new_type("legacylayout", "Layout related functions", false, "param") new_type("legacylayout", "Layout related functions", false, "param")
-- Have a category for the client layouts
new_type("clientlayout", "Client layouts", false, "param")
-- More fitting section names -- More fitting section names
kind_names={topic='Documentation', module='Libraries'} kind_names={topic='Documentation', module='Libraries'}
@ -94,9 +96,6 @@ file = {
-- Ignore the drawing window, users should only care about wiboxes -- Ignore the drawing window, users should only care about wiboxes
'../objects/drawin.c', '../objects/drawin.c',
-- exclude layout, but we need an extra bit of documentation elsewhere.
'../lib/awful/layout/suit/'
} }
} }

View File

@ -28,12 +28,8 @@ end
local layout = {} local layout = {}
--- Default predefined layouts
--
-- @fixme Add documentation on available layouts as all of them are hidden
layout.suit = require("awful.layout.suit") layout.suit = require("awful.layout.suit")
-- The default list of layouts
layout.layouts = { layout.layouts = {
layout.suit.floating, layout.suit.floating,
layout.suit.tile, layout.suit.tile,
@ -53,6 +49,30 @@ layout.layouts = {
layout.suit.corner.se, layout.suit.corner.se,
} }
--- The default list of layouts.
--
-- The default value is:
--
-- awful.layout.suit.floating,
-- awful.layout.suit.tile,
-- awful.layout.suit.tile.left,
-- awful.layout.suit.tile.bottom,
-- awful.layout.suit.tile.top,
-- awful.layout.suit.fair,
-- awful.layout.suit.fair.horizontal,
-- awful.layout.suit.spiral,
-- awful.layout.suit.spiral.dwindle,
-- awful.layout.suit.max,
-- awful.layout.suit.max.fullscreen,
-- awful.layout.suit.magnifier,
-- awful.layout.suit.corner.nw,
-- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se,
--
-- @field layout.layouts
-- This is a special lock used by the arrange function. -- This is a special lock used by the arrange function.
-- This avoids recurring call by emitted signals. -- This avoids recurring call by emitted signals.
local arrange_lock = false local arrange_lock = false

View File

@ -3,7 +3,7 @@
-- Display master client in a corner of the screen, and slaves in one -- Display master client in a corner of the screen, and slaves in one
-- column and one row around the master. -- column and one row around the master.
-- See Pull Request for example : https://github.com/awesomeWM/awesome/pull/251 -- See Pull Request for example : https://github.com/awesomeWM/awesome/pull/251
-- @module awful.layout.suit.corner -- @module awful.layout
-- @author Alexis Brenon <brenon.alexis+awesomewm@gmail.com> -- @author Alexis Brenon <brenon.alexis+awesomewm@gmail.com>
-- @copyright 2015 Alexis Brenon -- @copyright 2015 Alexis Brenon
@ -32,7 +32,7 @@ local capi = {screen = screen}
-- @param surface -- @param surface
-- @see gears.surface -- @see gears.surface
--- Actually arrange clients of p.clients for corner layout -- Actually arrange clients of p.clients for corner layout
-- @param p Mandatory table containing required informations for layouts -- @param p Mandatory table containing required informations for layouts
-- (clients to arrange, workarea geometry, etc.) -- (clients to arrange, workarea geometry, etc.)
-- @param orientation String indicating in which corner is the master window. -- @param orientation String indicating in which corner is the master window.
@ -162,18 +162,38 @@ end
local corner = {} local corner = {}
corner.row_privileged = false corner.row_privileged = false
--- Corner layout.
-- Display master client in a corner of the screen, and slaves in one
-- column and one row around the master.
-- @clientlayout awful.layout.suit.corner.nw
corner.nw = { corner.nw = {
name = "cornernw", name = "cornernw",
arrange = function (p) return do_corner(p, "NW") end arrange = function (p) return do_corner(p, "NW") end
} }
--- Corner layout.
-- Display master client in a corner of the screen, and slaves in one
-- column and one row around the master.
-- @clientlayout awful.layout.suit.corner.ne
corner.ne = { corner.ne = {
name = "cornerne", name = "cornerne",
arrange = function (p) return do_corner(p, "NE") end arrange = function (p) return do_corner(p, "NE") end
} }
--- Corner layout.
-- Display master client in a corner of the screen, and slaves in one
-- column and one row around the master.
-- @clientlayout awful.layout.suit.corner.sw
corner.sw = { corner.sw = {
name = "cornersw", name = "cornersw",
arrange = function (p) return do_corner(p, "SW") end arrange = function (p) return do_corner(p, "SW") end
} }
--- Corner layout.
-- Display master client in a corner of the screen, and slaves in one
-- column and one row around the master.
-- @clientlayout awful.layout.suit.corner.se
corner.se = { corner.se = {
name = "cornerse", name = "cornerse",
arrange = function (p) return do_corner(p, "SE") end arrange = function (p) return do_corner(p, "SE") end

View File

@ -1,9 +1,9 @@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
--- Fair layouts module for awful --- Fair layouts module for awful.
-- --
-- @author Josh Komoroske -- @author Josh Komoroske
-- @copyright 2012 Josh Komoroske -- @copyright 2012 Josh Komoroske
-- @module awful.layout.suit.fair -- @module awful.layout
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Grab environment we need -- Grab environment we need

View File

@ -3,7 +3,7 @@
-- --
-- @author Gregor Best -- @author Gregor Best
-- @copyright 2008 Gregor Best -- @copyright 2008 Gregor Best
-- @module awful.layout.suit.floating -- @module awful.layout
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Grab environment we need -- Grab environment we need
@ -102,6 +102,9 @@ end
function floating.arrange() function floating.arrange()
end end
--- The floating layout.
-- @clientlayout awful.layout.suit.
floating.name = "floating" floating.name = "floating"
return floating return floating

View File

@ -2,7 +2,7 @@
--- Suits for awful --- Suits for awful
-- @author Julien Danjou <julien@danjou.info> -- @author Julien Danjou <julien@danjou.info>
-- @copyright 2008 Julien Danjou -- @copyright 2008 Julien Danjou
-- @module awful.layout.suit -- @module awful.layout
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
return return

View File

@ -3,7 +3,7 @@
-- --
-- @author Julien Danjou <julien@danjou.info> -- @author Julien Danjou <julien@danjou.info>
-- @copyright 2008 Julien Danjou -- @copyright 2008 Julien Danjou
-- @module awful.layout.suit.magnifier -- @module awful.layout
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Grab environment we need -- Grab environment we need
@ -137,6 +137,9 @@ function magnifier.arrange(p)
end end
end end
--- The magnifier layout.
-- @clientlayout awful.layout.suit.magnifier
magnifier.name = "magnifier" magnifier.name = "magnifier"
return magnifier return magnifier

View File

@ -3,7 +3,7 @@
-- --
-- @author Julien Danjou <julien@danjou.info> -- @author Julien Danjou <julien@danjou.info>
-- @copyright 2008 Julien Danjou -- @copyright 2008 Julien Danjou
-- @module awful.layout.suit.max -- @module awful.layout
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Grab environment we need -- Grab environment we need
@ -42,14 +42,14 @@ local function fmax(p, fs)
end end
--- Maximized layout. --- Maximized layout.
-- @param screen The screen to arrange. -- @clientlayout awful.layout.suit.max.name
max.name = "max" max.name = "max"
function max.arrange(p) function max.arrange(p)
return fmax(p, false) return fmax(p, false)
end end
--- Fullscreen layout. --- Fullscreen layout.
-- @param screen The screen to arrange. -- @clientlayout awful.layout.suit.max.fullscreen
max.fullscreen = {} max.fullscreen = {}
max.fullscreen.name = "fullscreen" max.fullscreen.name = "fullscreen"
function max.fullscreen.arrange(p) function max.fullscreen.arrange(p)

View File

@ -5,7 +5,7 @@
-- @copyright 2009 Uli Schlachter -- @copyright 2009 Uli Schlachter
-- @copyright 2008 Julien Danjou -- @copyright 2008 Julien Danjou
-- --
-- @module awful.layout.suit.spiral -- @module awful.layout
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Grab environment we need -- Grab environment we need
@ -69,14 +69,16 @@ local function do_spiral(p, _spiral)
end end
end end
--- Dwindle layout --- Dwindle layout.
-- @clientlayout awful.layout.suit.spiral.dwindle
spiral.dwindle = {} spiral.dwindle = {}
spiral.dwindle.name = "dwindle" spiral.dwindle.name = "dwindle"
function spiral.dwindle.arrange(p) function spiral.dwindle.arrange(p)
return do_spiral(p, false) return do_spiral(p, false)
end end
--- Spiral layout --- Spiral layout.
-- @clientlayout awful.layout.suit.spiral.name
spiral.name = "spiral" spiral.name = "spiral"
function spiral.arrange(p) function spiral.arrange(p)
return do_spiral(p, true) return do_spiral(p, true)

View File

@ -5,7 +5,7 @@
-- @author Julien Danjou <julien@danjou.info> -- @author Julien Danjou <julien@danjou.info>
-- @copyright 2009 Donald Ephraim Curtis -- @copyright 2009 Donald Ephraim Curtis
-- @copyright 2008 Julien Danjou -- @copyright 2008 Julien Danjou
-- @module awful.layout.suit.tile -- @module awful.layout
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Grab environment we need -- Grab environment we need
@ -293,6 +293,9 @@ local function do_tile(param, orientation)
end end
--- The main tile algo, on the right.
-- @param screen The screen number to tile.
-- @clientlayout awful.layout.suit.tile.top
tile.right = {} tile.right = {}
tile.right.name = "tile" tile.right.name = "tile"
tile.right.arrange = do_tile tile.right.arrange = do_tile
@ -300,8 +303,9 @@ function tile.right.mouse_resize_handler(c, corner, x, y)
return mouse_resize_handler(c, corner, x, y) return mouse_resize_handler(c, corner, x, y)
end end
--- The main tile algo, on left. --- The main tile algo, on the left.
-- @param screen The screen number to tile. -- @param screen The screen number to tile.
-- @clientlayout awful.layout.suit.tile.left
tile.left = {} tile.left = {}
tile.left.name = "tileleft" tile.left.name = "tileleft"
function tile.left.arrange(p) function tile.left.arrange(p)
@ -311,8 +315,9 @@ function tile.left.mouse_resize_handler(c, corner, x, y)
return mouse_resize_handler(c, corner, x, y, "left") return mouse_resize_handler(c, corner, x, y, "left")
end end
--- The main tile algo, on bottom. --- The main tile algo, on the bottom.
-- @param screen The screen number to tile. -- @param screen The screen number to tile.
-- @clientlayout awful.layout.suit.tile.bottom
tile.bottom = {} tile.bottom = {}
tile.bottom.name = "tilebottom" tile.bottom.name = "tilebottom"
function tile.bottom.arrange(p) function tile.bottom.arrange(p)
@ -322,8 +327,9 @@ function tile.bottom.mouse_resize_handler(c, corner, x, y)
return mouse_resize_handler(c, corner, x, y, "bottom") return mouse_resize_handler(c, corner, x, y, "bottom")
end end
--- The main tile algo, on top. --- The main tile algo, on the top.
-- @param screen The screen number to tile. -- @param screen The screen number to tile.
-- @clientlayout awful.layout.suit.tile.top
tile.top = {} tile.top = {}
tile.top.name = "tiletop" tile.top.name = "tiletop"
function tile.top.arrange(p) function tile.top.arrange(p)