doc: Add a constructor stereotype for everything.

This forces the constructor functions to be at the top of the API
documentation rather than in a random position.
This commit is contained in:
Emmanuel Lepage Vallee 2019-06-07 14:59:34 -04:00
parent 63ca0f0d8f
commit 11d7a614d9
55 changed files with 85 additions and 56 deletions

View File

@ -52,6 +52,8 @@ tparam_alias('tab', 'table')
tparam_alias('screen', 'screen') tparam_alias('screen', 'screen')
tparam_alias('screen_or_idx', 'screen|int') tparam_alias('screen_or_idx', 'screen|int')
-- The first stereotype are the constructors.
new_type("constructorfct", "Constructors", false, "Parameters")
-- Hack to get the functions on top of the signals and properties -- Hack to get the functions on top of the signals and properties
new_type("function", "Functions", false, "Parameters") new_type("function", "Functions", false, "Parameters")
-- Documentation for objects properties -- Documentation for objects properties
@ -223,8 +225,14 @@ custom_display_name_handler = function(item, default_handler)
-- more consistent. Right now some have their full awful.foo.bar while other -- more consistent. Right now some have their full awful.foo.bar while other
-- have "just" `bar`. Given we use constructors from metatables, we have no -- have "just" `bar`. Given we use constructors from metatables, we have no
-- choice but to use the full function name. It also makes copy/paste easier. -- choice but to use the full function name. It also makes copy/paste easier.
if item.type == "function" and (not ret:find(".", 1, true)) and (not ret:find(":", 1, true)) then if (item.type == "function" or item.type == "constructorfct")
return item.module.name .. "." .. ret and (not ret:find(".", 1, true)) and (not ret:find(":", 1, true)) then
ret = item.module.name .. "." .. ret
end
-- It isn't there by default.
if item.type == "constructorfct" then
ret = ret .. " " .. item.args
end end
return ret return ret

View File

@ -125,6 +125,7 @@ widget.merge_duplicates = true
-- @tparam[opt] table args.labels Labels used for displaying human-readable keynames. -- @tparam[opt] table args.labels Labels used for displaying human-readable keynames.
-- @tparam[opt] table args.group_rules Rules for showing 3rd-party hotkeys. @see `awful.hotkeys_popup.keys.vim`. -- @tparam[opt] table args.group_rules Rules for showing 3rd-party hotkeys. @see `awful.hotkeys_popup.keys.vim`.
-- @return Widget instance. -- @return Widget instance.
-- @constructorfct awful.widget.hotkeys_popup.widget.new
function widget.new(args) function widget.new(args)
args = args or {} args = args or {}
local widget_instance = { local widget_instance = {

View File

@ -663,7 +663,7 @@ end
-- @tparam[opt=false] boolean args.autostart Start the grabbing immediately -- @tparam[opt=false] boolean args.autostart Start the grabbing immediately
-- @tparam[opt=false] boolean args.mask_modkeys Do not call the callbacks on -- @tparam[opt=false] boolean args.mask_modkeys Do not call the callbacks on
-- modifier keys (like `Control` or `Mod4`) events. -- modifier keys (like `Control` or `Mod4`) events.
-- @function awful.keygrabber -- @constructorfct awful.keygrabber
function keygrab.run_with_keybindings(args) function keygrab.run_with_keybindings(args)
args = args or {} args = args or {}

View File

@ -394,7 +394,7 @@ end
-- @tparam table|number args.offset The X and Y offset compared to the parent object -- @tparam table|number args.offset The X and Y offset compared to the parent object
-- @tparam boolean args.hide_on_right_click Whether or not to hide the popup on -- @tparam boolean args.hide_on_right_click Whether or not to hide the popup on
-- right clicks. -- right clicks.
-- @function awful.popup -- @constructorfct awful.popup
local function create_popup(_, args) local function create_popup(_, args)
assert(args) assert(args)

View File

@ -259,7 +259,7 @@ end
-- layout = awful.layout.suit.max, -- layout = awful.layout.suit.max,
-- }) -- })
-- --
-- @function awful.tag.add -- @constructorfct awful.tag.add
-- @param name The tag name, a string -- @param name The tag name, a string
-- @param props The tags inital properties, a table -- @param props The tags inital properties, a table
-- @return The created tag -- @return The created tag

View File

@ -502,7 +502,7 @@ end
-- @tparam[opt=top] string args.fg_normal -- @tparam[opt=top] string args.fg_normal
-- @tparam[opt=top] string args.fg_focus -- @tparam[opt=top] string args.fg_focus
-- @tparam[opt=top] string args.font -- @tparam[opt=top] string args.font
-- @function awful.titlebar -- @constructorfct awful.titlebar
local function new(c, args) local function new(c, args)
args = args or {} args = args or {}
local position = args.position or "top" local position = args.position or "top"

View File

@ -577,7 +577,7 @@ end
-- @see text -- @see text
-- @see markup -- @see markup
-- @see align -- @see align
-- @function awful.tooltip -- @constructorfct awful.tooltip
function tooltip.new(args) function tooltip.new(args)
-- gears.object, properties are linked to set_/get_ functions -- gears.object, properties are linked to set_/get_ functions
local self = object { local self = object {

View File

@ -344,7 +344,7 @@ end
-- @tparam string args.stretch If the wibar need to be stretched to fill the screen. -- @tparam string args.stretch If the wibar need to be stretched to fill the screen.
--@DOC_wibox_constructor_COMMON@ --@DOC_wibox_constructor_COMMON@
-- @return The new wibar -- @return The new wibar
-- @function awful.wibar -- @constructorfct awful.wibar
function awfulwibar.new(args) function awfulwibar.new(args)
args = args or {} args = args or {}
local position = args.position or "top" local position = args.position or "top"

View File

@ -24,6 +24,7 @@ local button = { mt = {} }
--- Create a button widget. When clicked, the image is deplaced to make it like --- Create a button widget. When clicked, the image is deplaced to make it like
-- a real button. -- a real button.
-- --
-- @constructorfct awful.widget.button
-- @param args Widget arguments. "image" is the image to display. -- @param args Widget arguments. "image" is the image to display.
-- @return A textbox widget configured as a button. -- @return A textbox widget configured as a button.
function button.new(args) function button.new(args)

View File

@ -371,7 +371,7 @@ end
-- @tparam table args.style_normal Cell style for the normal day cells (see `cell_properties`) -- @tparam table args.style_normal Cell style for the normal day cells (see `cell_properties`)
-- @tparam table args.style_focus Cell style for the current day cell (see `cell_properties`) -- @tparam table args.style_focus Cell style for the current day cell (see `cell_properties`)
-- @treturn wibox A wibox containing the calendar -- @treturn wibox A wibox containing the calendar
-- @function awful.widget.calendar_popup.month -- @constructorfct awful.widget.calendar_popup.month
function calendar_popup.month(args) function calendar_popup.month(args)
return get_cal_wibox("month", args) return get_cal_wibox("month", args)
end end
@ -407,7 +407,7 @@ end
-- @tparam table args.style_normal Cell style for the normal day cells (see `cell_properties`) -- @tparam table args.style_normal Cell style for the normal day cells (see `cell_properties`)
-- @tparam table args.style_focus Cell style for the current day cell (see `cell_properties`) -- @tparam table args.style_focus Cell style for the current day cell (see `cell_properties`)
-- @treturn wibox A wibox containing the calendar -- @treturn wibox A wibox containing the calendar
-- @function awful.widget.calendar_popup.year -- @constructorfct awful.widget.calendar_popup.year
function calendar_popup.year(args) function calendar_popup.year(args)
return get_cal_wibox("year", args) return get_cal_wibox("year", args)
end end

View File

@ -99,7 +99,7 @@ end
--- Returns a new clienticon. --- Returns a new clienticon.
-- @tparam client c The client whose icon should be displayed. -- @tparam client c The client whose icon should be displayed.
-- @treturn widget A new `widget` -- @treturn widget A new `widget`
-- @function awful.widget.clienticon -- @constructorfct awful.widget.clienticon
local function new(c) local function new(c)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})

View File

@ -252,7 +252,11 @@ local function update_layout(self)
update_status(self) update_status(self)
end end
--- Create a keyboard layout widget. It shows current keyboard layout name in a textbox. --- Create a keyboard layout widget.
--
-- It shows current keyboard layout name in a textbox.
--
-- @constructorfct awful.widget.keyboardlayout
-- @return A keyboard layout widget. -- @return A keyboard layout widget.
function keyboardlayout.new() function keyboardlayout.new()
local widget = textbox() local widget = textbox()

View File

@ -16,6 +16,7 @@ local launcher = { mt = {} }
-- @param args Standard widget table arguments, plus image for the image path -- @param args Standard widget table arguments, plus image for the image path
-- and command for the command to run on click, or either menu to create menu. -- and command for the command to run on click, or either menu to create menu.
-- @return A launcher widget. -- @return A launcher widget.
-- @constructorfct awful.widget.launcher
function launcher.new(args) function launcher.new(args)
if not args.command and not args.menu then return end if not args.command and not args.menu then return end
local w = wbutton(args) local w = wbutton(args)

View File

@ -44,6 +44,7 @@ end
-- symbol of the current tag. -- symbol of the current tag.
-- @param screen The screen number that the layout will be represented for. -- @param screen The screen number that the layout will be represented for.
-- @return An imagebox widget configured as a layoutbox. -- @return An imagebox widget configured as a layoutbox.
-- @constructorfct awful.widget.layoutbox
function layoutbox.new(screen) function layoutbox.new(screen)
screen = get_screen(screen or 1) screen = get_screen(screen or 1)

View File

@ -382,7 +382,7 @@ end
-- @tparam string|pattern args.style.shape_border_width_selected -- @tparam string|pattern args.style.shape_border_width_selected
-- @tparam string|pattern args.style.shape_border_color_selected -- @tparam string|pattern args.style.shape_border_color_selected
-- @treturn widget The action widget. -- @treturn widget The action widget.
-- @function awful.widget.layoutlist -- @constructorfct awful.widget.layoutlist
local is_connected, instances = false, setmetatable({}, {__mode = "v"}) local is_connected, instances = false, setmetatable({}, {__mode = "v"})

View File

@ -91,7 +91,7 @@ end
-- @param[opt] widget The widget to display. -- @param[opt] widget The widget to display.
-- @param[opt] s The screen to display on. -- @param[opt] s The screen to display on.
-- @treturn table A new only_on_screen container -- @treturn table A new only_on_screen container
-- @function wibox.container.only_on_screen -- @constructorfct awful.widget.only_on_screen
local function new(widget, s) local function new(widget, s)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})

View File

@ -113,7 +113,7 @@ end
-- for the matching modifiers + key. See @{awful.prompt.run} for details. -- for the matching modifiers + key. See @{awful.prompt.run} for details.
-- @return An instance of prompt widget, inherits from -- @return An instance of prompt widget, inherits from
-- `wibox.container.background`. -- `wibox.container.background`.
-- @function awful.widget.prompt -- @constructorfct awful.widget.prompt
function widgetprompt.new(args) function widgetprompt.new(args)
args = args or {} args = args or {}
local promptbox = background() local promptbox = background()

View File

@ -462,7 +462,7 @@ end
-- @param style **DEPRECATED** use args.style -- @param style **DEPRECATED** use args.style
-- @param update_function **DEPRECATED** use args.update_function -- @param update_function **DEPRECATED** use args.update_function
-- @param base_widget **DEPRECATED** use args.base_widget -- @param base_widget **DEPRECATED** use args.base_widget
-- @function awful.widget.taglist -- @constructorfct awful.widget.taglist
function taglist.new(args, filter, buttons, style, update_function, base_widget) function taglist.new(args, filter, buttons, style, update_function, base_widget)
local screen = nil local screen = nil

View File

@ -518,7 +518,7 @@ end
-- @param style **DEPRECATED** use args.style -- @param style **DEPRECATED** use args.style
-- @param update_function **DEPRECATED** use args.update_function -- @param update_function **DEPRECATED** use args.update_function
-- @param base_widget **DEPRECATED** use args.base_widget -- @param base_widget **DEPRECATED** use args.base_widget
-- @function awful.tasklist -- @constructorfct awful.widget.tasklist
function tasklist.new(args, filter, buttons, style, update_function, base_widget) function tasklist.new(args, filter, buttons, style, update_function, base_widget)
local screen = nil local screen = nil

View File

@ -64,6 +64,7 @@ local watch = { mt = {} }
-- --
-- @return The widget used by this watch. -- @return The widget used by this watch.
-- @return Its gears.timer. -- @return Its gears.timer.
-- @constructorfct awful.widget.watch
function watch.new(command, timeout, callback, base_widget) function watch.new(command, timeout, callback, base_widget)
timeout = timeout or 5 timeout = timeout or 5
base_widget = base_widget or textbox() base_widget = base_widget or textbox()

View File

@ -37,6 +37,7 @@ end
-- garbage-collected at any time, but might be useful to keep. -- garbage-collected at any time, but might be useful to keep.
-- @param creation_cb Callback that is used for creating missing cache entries. -- @param creation_cb Callback that is used for creating missing cache entries.
-- @return A new cache object. -- @return A new cache object.
-- @constructorfct gears.cache
function cache.new(creation_cb) function cache.new(creation_cb)
return setmetatable({ return setmetatable({
_cache = setmetatable({}, { __mode = "v" }), _cache = setmetatable({}, { __mode = "v" }),

View File

@ -20,6 +20,7 @@ local matrix_mt = {}
-- @tparam number x0 The x0 transformation part. -- @tparam number x0 The x0 transformation part.
-- @tparam number y0 The y0 transformation part. -- @tparam number y0 The y0 transformation part.
-- @return A new matrix describing the given transformation. -- @return A new matrix describing the given transformation.
-- @constructorfct create
function matrix.create(xx, yx, xy, yy, x0, y0) function matrix.create(xx, yx, xy, yy, x0, y0)
return setmetatable({ return setmetatable({
xx = xx, xy = xy, x0 = x0, xx = xx, xy = xy, x0 = x0,
@ -31,6 +32,7 @@ end
-- @tparam number x The translation in x direction. -- @tparam number x The translation in x direction.
-- @tparam number y The translation in y direction. -- @tparam number y The translation in y direction.
-- @return A new matrix describing the given transformation. -- @return A new matrix describing the given transformation.
-- @constructorfct create_translate
function matrix.create_translate(x, y) function matrix.create_translate(x, y)
return matrix.create(1, 0, 0, 1, x, y) return matrix.create(1, 0, 0, 1, x, y)
end end
@ -39,6 +41,7 @@ end
-- @tparam number sx The scaling in x direction. -- @tparam number sx The scaling in x direction.
-- @tparam number sy The scaling in y direction. -- @tparam number sy The scaling in y direction.
-- @return A new matrix describing the given transformation. -- @return A new matrix describing the given transformation.
-- @constructorfct create_scale
function matrix.create_scale(sx, sy) function matrix.create_scale(sx, sy)
return matrix.create(sx, 0, 0, sy, 0, 0) return matrix.create(sx, 0, 0, sy, 0, 0)
end end
@ -46,6 +49,7 @@ end
--- Create a new rotation matrix --- Create a new rotation matrix
-- @tparam number angle The angle of the rotation in radians. -- @tparam number angle The angle of the rotation in radians.
-- @return A new matrix describing the given transformation. -- @return A new matrix describing the given transformation.
-- @constructorfct create_rotate
function matrix.create_rotate(angle) function matrix.create_rotate(angle)
local c, s = math.cos(angle), math.sin(angle) local c, s = math.cos(angle), math.sin(angle)
return matrix.create(c, s, -s, c, 0, 0) return matrix.create(c, s, -s, c, 0, 0)
@ -56,6 +60,7 @@ end
-- @tparam number y The vertical rotation point -- @tparam number y The vertical rotation point
-- @tparam number angle The angle of the rotation in radians. -- @tparam number angle The angle of the rotation in radians.
-- @return A new matrix describing the given transformation. -- @return A new matrix describing the given transformation.
-- @constructorfct create_rotate_at
function matrix.create_rotate_at(x, y, angle) function matrix.create_rotate_at(x, y, angle)
return matrix.create_translate( -x, -y ) return matrix.create_translate( -x, -y )
* matrix.create_rotate ( angle ) * matrix.create_rotate ( angle )

View File

@ -157,7 +157,7 @@ local timer_instance_mt = {
-- "timeout" signal. -- "timeout" signal.
-- @tparam[opt=false] boolean args.single_shot Run only once then stop. -- @tparam[opt=false] boolean args.single_shot Run only once then stop.
-- @treturn timer -- @treturn timer
-- @function gears.timer -- @constructorfct gears.timer
function timer.new(args) function timer.new(args)
args = args or {} args = args or {}
local ret = object() local ret = object()
@ -257,6 +257,8 @@ function timer.mt.__call(_, ...)
return timer.new(...) return timer.new(...)
end end
--@DOC_object_COMMON@
return setmetatable(timer, timer.mt) return setmetatable(timer, timer.mt)
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -14,7 +14,7 @@ local gobject = require("gears.object")
local action = {} local action = {}
--- Create a new action. --- Create a new action.
-- @function naughty.action -- @constructorfct naughty.action
-- @tparam table args The arguments. -- @tparam table args The arguments.
-- @tparam string args.name The name. -- @tparam string args.name The name.
-- @tparam string args.position The position. -- @tparam string args.position The position.
@ -124,4 +124,6 @@ local function new(_, args)
return ret return ret
end end
--@DOC_object_COMMON@
return setmetatable(action, {__call = new}) return setmetatable(action, {__call = new})

View File

@ -451,7 +451,7 @@ end
-- @usage naughty.notify({ title = "Achtung!", message = "You're idling", timeout = 0 }) -- @usage naughty.notify({ title = "Achtung!", message = "You're idling", timeout = 0 })
-- @treturn ?table The notification object, or nil in case a notification was -- @treturn ?table The notification object, or nil in case a notification was
-- not displayed. -- not displayed.
-- @function naughty.notification -- @constructorfct naughty.notification
local function create(args) local function create(args)
if cst.config.notify_callback then if cst.config.notify_callback then
args = cst.config.notify_callback(args) args = cst.config.notify_callback(args)

View File

@ -316,7 +316,7 @@ end
--- Returns a new arcchart layout. --- Returns a new arcchart layout.
-- @param[opt] widget The widget to display. -- @param[opt] widget The widget to display.
-- @function wibox.container.arcchart -- @constructorfct wibox.container.arcchart
local function new(widget) local function new(widget)
local ret = base.make_widget(nil, nil, { local ret = base.make_widget(nil, nil, {
enable_properties = true, enable_properties = true,

View File

@ -385,7 +385,7 @@ end
-- @param[opt] widget The widget to display. -- @param[opt] widget The widget to display.
-- @param[opt] bg The background to use for that widget. -- @param[opt] bg The background to use for that widget.
-- @param[opt] shape A `gears.shape` compatible shape function -- @param[opt] shape A `gears.shape` compatible shape function
-- @function wibox.container.background -- @constructorfct wibox.container.background
local function new(widget, bg, shape) local function new(widget, bg, shape)
local ret = base.make_widget(nil, nil, { local ret = base.make_widget(nil, nil, {
enable_properties = true, enable_properties = true,

View File

@ -136,7 +136,7 @@ end
-- @param[opt] width The maximum width of the widget. nil for no limit. -- @param[opt] width The maximum width of the widget. nil for no limit.
-- @param[opt] height The maximum height of the widget. nil for no limit. -- @param[opt] height The maximum height of the widget. nil for no limit.
-- @treturn table A new constraint container -- @treturn table A new constraint container
-- @function wibox.container.constraint -- @constructorfct wibox.container.constraint
local function new(widget, strategy, width, height) local function new(widget, strategy, width, height)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})

View File

@ -190,7 +190,7 @@ end
-- @param[opt] color A color for the margins. -- @param[opt] color A color for the margins.
-- @param[opt] draw_empty whether or not to draw the margin when the content is empty -- @param[opt] draw_empty whether or not to draw the margin when the content is empty
-- @treturn table A new margin container -- @treturn table A new margin container
-- @function wibox.container.margin -- @constructorfct wibox.container.margin
local function new(widget, left, right, top, bottom, color, draw_empty) local function new(widget, left, right, top, bottom, color, draw_empty)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})

View File

@ -108,7 +108,7 @@ end
-- @param[opt] widget The widget to display. -- @param[opt] widget The widget to display.
-- @param[opt] reflection A table describing the reflection to apply. -- @param[opt] reflection A table describing the reflection to apply.
-- @treturn table A new mirror container -- @treturn table A new mirror container
-- @function wibox.container.mirror -- @constructorfct wibox.container.mirror
local function new(widget, reflection) local function new(widget, reflection)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})
ret._private.horizontal = false ret._private.horizontal = false

View File

@ -172,7 +172,7 @@ end
-- @tparam[opt="center"] string halign The horizontal alignment -- @tparam[opt="center"] string halign The horizontal alignment
-- @tparam[opt="center"] string valign The vertical alignment -- @tparam[opt="center"] string valign The vertical alignment
-- @treturn table A new place container. -- @treturn table A new place container.
-- @function wibox.container.place -- @constructorfct wibox.container.place
local function new(widget, halign, valign) local function new(widget, halign, valign)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})

View File

@ -233,7 +233,7 @@ end
--- Returns a new radialprogressbar layout. A radialprogressbar layout --- Returns a new radialprogressbar layout. A radialprogressbar layout
-- radialprogressbars a given widget. Use `.widget` to set the widget. -- radialprogressbars a given widget. Use `.widget` to set the widget.
-- @param[opt] widget The widget to display. -- @param[opt] widget The widget to display.
-- @function wibox.container.radialprogressbar -- @constructorfct wibox.container.radialprogressbar
local function new(widget) local function new(widget)
local ret = base.make_widget(nil, nil, { local ret = base.make_widget(nil, nil, {
enable_properties = true, enable_properties = true,

View File

@ -133,7 +133,7 @@ end
-- @param[opt] widget The widget to display. -- @param[opt] widget The widget to display.
-- @param[opt] dir The direction to rotate to. -- @param[opt] dir The direction to rotate to.
-- @treturn table A new rotate container. -- @treturn table A new rotate container.
-- @function wibox.container.rotate -- @constructorfct wibox.container.rotate
local function new(widget, dir) local function new(widget, dir)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})

View File

@ -425,7 +425,7 @@ local function get_layout(dir, widget, fps, speed, extra_space, expand, max_size
end end
--- Get a new horizontal scrolling container. --- Get a new horizontal scrolling container.
-- @function wibox.container.scroll.horizontal -- @constructorfct wibox.container.scroll.horizontal
-- @param[opt] widget The widget that should be scrolled -- @param[opt] widget The widget that should be scrolled
-- @param[opt=20] fps The number of frames per second -- @param[opt=20] fps The number of frames per second
-- @param[opt=10] speed The speed of the animation -- @param[opt=10] speed The speed of the animation
@ -440,7 +440,7 @@ function scroll.horizontal(widget, fps, speed, extra_space, expand, max_size, st
end end
--- Get a new vertical scrolling container. --- Get a new vertical scrolling container.
-- @function wibox.container.scroll.vertical -- @constructorfct wibox.container.scroll.vertical
-- @param[opt] widget The widget that should be scrolled -- @param[opt] widget The widget that should be scrolled
-- @param[opt=20] fps The number of frames per second -- @param[opt=20] fps The number of frames per second
-- @param[opt=10] speed The speed of the animation -- @param[opt=10] speed The speed of the animation

View File

@ -253,7 +253,7 @@ end
-- @tparam[opt=nil] table args -- @tparam[opt=nil] table args
--@DOC_wibox_constructor_COMMON@ --@DOC_wibox_constructor_COMMON@
-- @treturn wibox The new wibox -- @treturn wibox The new wibox
-- @function .wibox -- @constructorfct wibox
local function new(args) local function new(args)
args = args or {} args = args or {}

View File

@ -279,6 +279,7 @@ end
-- three widgets. The widget set via :set_left() is left-aligned. :set_right() -- three widgets. The widget set via :set_left() is left-aligned. :set_right()
-- sets a widget which will be right-aligned. The remaining space between those -- sets a widget which will be right-aligned. The remaining space between those
-- two will be given to the widget set via :set_middle(). -- two will be given to the widget set via :set_middle().
-- @constructorfct wibox.layout.align.horizontal
-- @tparam[opt] widget left Widget to be put to the left. -- @tparam[opt] widget left Widget to be put to the left.
-- @tparam[opt] widget middle Widget to be put to the middle. -- @tparam[opt] widget middle Widget to be put to the middle.
-- @tparam[opt] widget right Widget to be put to the right. -- @tparam[opt] widget right Widget to be put to the right.
@ -296,6 +297,7 @@ end
-- three widgets. The widget set via :set_top() is top-aligned. :set_bottom() -- three widgets. The widget set via :set_top() is top-aligned. :set_bottom()
-- sets a widget which will be bottom-aligned. The remaining space between those -- sets a widget which will be bottom-aligned. The remaining space between those
-- two will be given to the widget set via :set_middle(). -- two will be given to the widget set via :set_middle().
-- @constructorfct wibox.layout.align.vertical
-- @tparam[opt] widget top Widget to be put to the top. -- @tparam[opt] widget top Widget to be put to the top.
-- @tparam[opt] widget middle Widget to be put to the middle. -- @tparam[opt] widget middle Widget to be put to the middle.
-- @tparam[opt] widget bottom Widget to be put to the right. -- @tparam[opt] widget bottom Widget to be put to the right.

View File

@ -322,7 +322,7 @@ end
-- Note that widgets ignore `forced_height`. They will use the preferred/minimum width -- Note that widgets ignore `forced_height`. They will use the preferred/minimum width
-- on the horizontal axis, and a stretched height on the vertical axis. -- on the horizontal axis, and a stretched height on the vertical axis.
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
-- @function wibox.layout.fixed.horizontal -- @constructorfct wibox.layout.fixed.horizontal
function fixed.horizontal(...) function fixed.horizontal(...)
return get_layout("x", ...) return get_layout("x", ...)
end end
@ -333,7 +333,7 @@ end
-- Note that widgets ignore `forced_width`. They will use the preferred/minimum height -- Note that widgets ignore `forced_width`. They will use the preferred/minimum height
-- on the vertical axis, and a stretched width on the horizontal axis. -- on the vertical axis, and a stretched width on the horizontal axis.
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
-- @function wibox.layout.fixed.vertical -- @constructorfct wibox.layout.fixed.vertical
function fixed.vertical(...) function fixed.vertical(...)
return get_layout("y", ...) return get_layout("y", ...)
end end

View File

@ -170,7 +170,7 @@ end
--- Returns a new horizontal flex layout. A flex layout shares the available space --- Returns a new horizontal flex layout. A flex layout shares the available space
-- equally among all widgets. Widgets can be added via :add(widget). -- equally among all widgets. Widgets can be added via :add(widget).
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
-- @function wibox.layout.flex.horizontal -- @constructorfct wibox.layout.flex.horizontal
function flex.horizontal(...) function flex.horizontal(...)
return get_layout("horizontal", ...) return get_layout("horizontal", ...)
end end
@ -178,7 +178,7 @@ end
--- Returns a new vertical flex layout. A flex layout shares the available space --- Returns a new vertical flex layout. A flex layout shares the available space
-- equally among all widgets. Widgets can be added via :add(widget). -- equally among all widgets. Widgets can be added via :add(widget).
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
-- @function wibox.layout.flex.vertical -- @constructorfct wibox.layout.flex.vertical
function flex.vertical(...) function flex.vertical(...)
return get_layout("vertical", ...) return get_layout("vertical", ...)
end end

View File

@ -885,7 +885,7 @@ end
-- --
-- A grid layout sets widgets in a grids of custom number of rows and columns. -- A grid layout sets widgets in a grids of custom number of rows and columns.
-- @tparam[opt="y"] string orientation The preferred grid extension direction. -- @tparam[opt="y"] string orientation The preferred grid extension direction.
-- @function wibox.layout.grid -- @constructorfct wibox.layout.grid
local function new(orientation) local function new(orientation)
-- Preference for vertical direction: fill rows first, extend grid with new row -- Preference for vertical direction: fill rows first, extend grid with new row
local dir = (orientation == "horizontal"or orientation == "vertical") local dir = (orientation == "horizontal"or orientation == "vertical")
@ -924,7 +924,7 @@ end
-- up to `forced_num_rows`. Then the next column is filled, creating it if it doesn't exist. -- up to `forced_num_rows`. Then the next column is filled, creating it if it doesn't exist.
-- @tparam number|nil forced_num_rows Forced number of rows (`nil` for automatic). -- @tparam number|nil forced_num_rows Forced number of rows (`nil` for automatic).
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
-- @function wibox.layout.grid.horizontal -- @constructorfct wibox.layout.grid.horizontal
function grid.horizontal(forced_num_rows, widget, ...) function grid.horizontal(forced_num_rows, widget, ...)
local ret = new("horizontal") local ret = new("horizontal")
ret:set_forced_num_rows(forced_num_rows) ret:set_forced_num_rows(forced_num_rows)
@ -942,7 +942,7 @@ end
-- up to `forced_num_cols`. Then the next row is filled, creating it if it doesn't exist. -- up to `forced_num_cols`. Then the next row is filled, creating it if it doesn't exist.
-- @tparam number|nil forced_num_cols Forced number of columns (`nil` for automatic). -- @tparam number|nil forced_num_cols Forced number of columns (`nil` for automatic).
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
-- @function wibox.layout.grid.vertical -- @constructorfct wibox.layout.grid.vertical
function grid.vertical(forced_num_cols, widget, ...) function grid.vertical(forced_num_cols, widget, ...)
local ret = new("vertical") local ret = new("vertical")
ret:set_forced_num_cols(forced_num_cols) ret:set_forced_num_cols(forced_num_cols)

View File

@ -212,7 +212,7 @@ function manual_layout:reset()
end end
--- Create a manual layout. --- Create a manual layout.
-- @function wibox.layout.manual -- @constructorfct wibox.layout.manual
-- @tparam table ... Widgets to add to the layout. -- @tparam table ... Widgets to add to the layout.
local function new_manual(...) local function new_manual(...)

View File

@ -457,7 +457,7 @@ end
--- Returns a new horizontal ratio layout. A ratio layout shares the available space. --- Returns a new horizontal ratio layout. A ratio layout shares the available space.
-- equally among all widgets. Widgets can be added via :add(widget). -- equally among all widgets. Widgets can be added via :add(widget).
-- @function wibox.layout.ratio.horizontal -- @constructorfct wibox.layout.ratio.horizontal
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
function ratio.horizontal(...) function ratio.horizontal(...)
return get_layout("horizontal", ...) return get_layout("horizontal", ...)
@ -465,7 +465,7 @@ end
--- Returns a new vertical ratio layout. A ratio layout shares the available space. --- Returns a new vertical ratio layout. A ratio layout shares the available space.
-- equally among all widgets. Widgets can be added via :add(widget). -- equally among all widgets. Widgets can be added via :add(widget).
-- @function wibox.layout.ratio.vertical -- @constructorfct wibox.layout.ratio.vertical
-- @tparam widget ... Widgets that should be added to the layout. -- @tparam widget ... Widgets that should be added to the layout.
function ratio.vertical(...) function ratio.vertical(...)
return get_layout("vertical", ...) return get_layout("vertical", ...)

View File

@ -156,7 +156,7 @@ function stack:set_vertical_offset(value)
end end
--- Create a new stack layout. --- Create a new stack layout.
-- @function wibox.layout.stack -- @constructorfct wibox.layout.stack
-- @treturn widget A new stack layout -- @treturn widget A new stack layout
local function new(...) local function new(...)

View File

@ -352,7 +352,7 @@ end
-- @tparam number|nil date.day Date day -- @tparam number|nil date.day Date day
-- @tparam[opt="Monospace 10"] string font Font of the calendar -- @tparam[opt="Monospace 10"] string font Font of the calendar
-- @treturn widget The month calendar widget -- @treturn widget The month calendar widget
-- @function wibox.widget.calendar.month -- @constructorfct wibox.widget.calendar.month
function calendar.month(date, font) function calendar.month(date, font)
return get_calendar("month", date, font) return get_calendar("month", date, font)
end end
@ -368,7 +368,7 @@ end
-- @tparam number|nil date.day Date day -- @tparam number|nil date.day Date day
-- @tparam[opt="Monospace 10"] string font Font of the calendar -- @tparam[opt="Monospace 10"] string font Font of the calendar
-- @treturn widget The year calendar widget -- @treturn widget The year calendar widget
-- @function wibox.widget.calendar.year -- @constructorfct wibox.widget.calendar.year
function calendar.year(date, font) function calendar.year(date, font)
return get_calendar("year", date, font) return get_calendar("year", date, font)
end end

View File

@ -225,7 +225,7 @@ function checkbox:set_paddings(val)
end end
--- Create a new checkbox. --- Create a new checkbox.
-- @function wibox.widget.checkbox -- @constructorfct wibox.widget.checkbox
-- @tparam[opt=false] boolean checked -- @tparam[opt=false] boolean checked
-- @tparam[opt] table args -- @tparam[opt] table args
-- @tparam gears.color args.color The color. -- @tparam gears.color args.color The color.

View File

@ -319,7 +319,7 @@ end
-- @param args Standard widget() arguments. You should add width and height -- @param args Standard widget() arguments. You should add width and height
-- key to set graph geometry. -- key to set graph geometry.
-- @return A new graph widget. -- @return A new graph widget.
-- @function wibox.widget.graph -- @constructorfct wibox.widget.graph
function graph.new(args) function graph.new(args)
args = args or {} args = args or {}

View File

@ -157,7 +157,7 @@ end
-- to fit into the available space. -- to fit into the available space.
-- @param clip_shape A `gears.shape` compatible function -- @param clip_shape A `gears.shape` compatible function
-- @treturn table A new `imagebox` -- @treturn table A new `imagebox`
-- @function wibox.widget.imagebox -- @constructorfct wibox.widget.imagebox
local function new(image, resize_allowed, clip_shape) local function new(image, resize_allowed, clip_shape)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})

View File

@ -1,7 +1,7 @@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- @author Uli Schlachter -- @author Uli Schlachter
-- @copyright 2010 Uli Schlachter -- @copyright 2010 Uli Schlachter
-- @classmod wibox.widget -- @module wibox.widget
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
local cairo = require("lgi").cairo local cairo = require("lgi").cairo

View File

@ -219,7 +219,7 @@ function piechart:get_data()
end end
--- Create a new piechart. --- Create a new piechart.
-- @function wibox.widget.piechart -- @constructorfct wibox.widget.piechart
-- @tparam table data_list The data. -- @tparam table data_list The data.
local function new(data_list) local function new(data_list)

View File

@ -427,7 +427,7 @@ end
-- @param args Standard widget() arguments. You should add width and height -- @param args Standard widget() arguments. You should add width and height
-- key to set progressbar geometry. -- key to set progressbar geometry.
-- @return A progressbar widget. -- @return A progressbar widget.
-- @function wibox.widget.progressbar -- @constructorfct wibox.widget.progressbar
function progressbar.new(args) function progressbar.new(args)
args = args or {} args = args or {}

View File

@ -186,7 +186,7 @@ for _, prop in ipairs {"orientation", "color", "thickness", "span_ratio",
end end
--- Create a new separator. --- Create a new separator.
-- @function wibox.widget.separator -- @constructorfct wibox.widget.separator
-- @tparam table args The arguments (all properties are available). -- @tparam table args The arguments (all properties are available).
local function new(args) local function new(args)

View File

@ -475,7 +475,7 @@ end
--- Create a slider widget. --- Create a slider widget.
-- @tparam[opt={}] table args -- @tparam[opt={}] table args
-- @function wibox.widget.slider -- @constructorfct wibox.widget.slider
local function new(args) local function new(args)
local ret = base.make_widget(nil, nil, { local ret = base.make_widget(nil, nil, {
enable_properties = true, enable_properties = true,

View File

@ -166,7 +166,7 @@ end
-- Note that this widget can only exist once. -- Note that this widget can only exist once.
-- @tparam boolean revers Show in the opposite direction -- @tparam boolean revers Show in the opposite direction
-- @treturn table The new `systray` widget -- @treturn table The new `systray` widget
-- @function wibox.widget.systray -- @constructorfct wibox.widget.systray
local function new(revers) local function new(revers)
local ret = wbase.make_widget(nil, nil, {enable_properties = true}) local ret = wbase.make_widget(nil, nil, {enable_properties = true})

View File

@ -280,7 +280,7 @@ end
-- @tparam[opt=""] string text The textbox content -- @tparam[opt=""] string text The textbox content
-- @tparam[opt=false] boolean ignore_markup Ignore the pango/HTML markup -- @tparam[opt=false] boolean ignore_markup Ignore the pango/HTML markup
-- @treturn table A new textbox widget -- @treturn table A new textbox widget
-- @function wibox.widget.textbox -- @constructorfct wibox.widget.textbox
local function new(text, ignore_markup) local function new(text, ignore_markup)
local ret = base.make_widget(nil, nil, {enable_properties = true}) local ret = base.make_widget(nil, nil, {enable_properties = true})

View File

@ -88,7 +88,7 @@ end
-- e.g. "Z" for UTC, "±hh:mm" or "Europe/Amsterdam". See -- e.g. "Z" for UTC, "±hh:mm" or "Europe/Amsterdam". See
-- https://developer.gnome.org/glib/stable/glib-GTimeZone.html#g-time-zone-new. -- https://developer.gnome.org/glib/stable/glib-GTimeZone.html#g-time-zone-new.
-- @treturn table A textbox widget. -- @treturn table A textbox widget.
-- @function wibox.widget.textclock -- @constructorfct wibox.widget.textclock
local function new(format, refresh, tzid) local function new(format, refresh, tzid)
local w = textbox() local w = textbox()
gtable.crush(w, textclock, true) gtable.crush(w, textclock, true)

View File

@ -1173,7 +1173,7 @@ luaA_screen_count(lua_State *L)
* @tparam integer width width for screen. * @tparam integer width width for screen.
* @tparam integer height height for screen. * @tparam integer height height for screen.
* @return The new screen. * @return The new screen.
* @function fake_add * @constructorfct fake_add
*/ */
static int static int
luaA_screen_fake_add(lua_State *L) luaA_screen_fake_add(lua_State *L)