Merge pull request #2921 from Aire-One/doc_fix_modules_summaries
[Draft/Proposal] DOC - Fix modules summaries.
This commit is contained in:
commit
a0386dad91
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Layout module for awful
|
--- Layout module for awful.
|
||||||
--
|
--
|
||||||
-- @author Julien Danjou <julien@danjou.info>
|
-- @author Julien Danjou <julien@danjou.info>
|
||||||
-- @copyright 2008 Julien Danjou
|
-- @copyright 2008 Julien Danjou
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
--- A menu for awful
|
--- A menu for awful.
|
||||||
--
|
--
|
||||||
-- @author Damien Leone <damien.leone@gmail.com>
|
-- @author Damien Leone <damien.leone@gmail.com>
|
||||||
-- @author Julien Danjou <julien@danjou.info>
|
-- @author Julien Danjou <julien@danjou.info>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Screen module for awful
|
--- Screen module for awful.
|
||||||
--
|
--
|
||||||
-- @author Julien Danjou <julien@danjou.info>
|
-- @author Julien Danjou <julien@danjou.info>
|
||||||
-- @copyright 2008 Julien Danjou
|
-- @copyright 2008 Julien Danjou
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Utility module for awful
|
--- Utility module for awful.
|
||||||
--
|
--
|
||||||
-- @author Julien Danjou <julien@danjou.info>
|
-- @author Julien Danjou <julien@danjou.info>
|
||||||
-- @copyright 2008 Julien Danjou
|
-- @copyright 2008 Julien Danjou
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-- A calendar popup wibox
|
-- A calendar popup wibox.
|
||||||
--
|
--
|
||||||
-- Display a month or year calendar popup using `calendar_popup.month` or `calendar_popup.year`.
|
-- Display a month or year calendar popup using `calendar_popup.month` or `calendar_popup.year`.
|
||||||
-- The calendar style can be tweaked by providing tables of style properties at creation:
|
-- The calendar style can be tweaked by providing tables of style properties at creation:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Display the current client layout (`awful.layout`) icon or name
|
--- Display the current client layout (`awful.layout`) icon or name.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- @author Julien Danjou <julien@danjou.info>
|
-- @author Julien Danjou <julien@danjou.info>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Taglist widget module for awful
|
--- Taglist widget module for awful.
|
||||||
--
|
--
|
||||||
-- Here is a more advanced example of how to extent the `taglist`. It provides:
|
-- Here is a more advanced example of how to extent the `taglist`. It provides:
|
||||||
--
|
--
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Filesystem module for gears
|
--- Filesystem module for gears.
|
||||||
--
|
--
|
||||||
-- @utillib gears.filesystem
|
-- @utillib gears.filesystem
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Math module for gears
|
--- Math module for gears.
|
||||||
--
|
--
|
||||||
-- @utillib gears.math
|
-- @utillib gears.math
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- String module for gears
|
--- String module for gears.
|
||||||
--
|
--
|
||||||
-- @utillib gears.string
|
-- @utillib gears.string
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Table module for gears
|
--- Table module for gears.
|
||||||
--
|
--
|
||||||
-- @utillib gears.table
|
-- @utillib gears.table
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Menubar module, which aims to provide a freedesktop menu alternative
|
--- Menubar module, which aims to provide a freedesktop menu alternative.
|
||||||
--
|
--
|
||||||
-- List of menubar keybindings:
|
-- List of menubar keybindings:
|
||||||
-- ---
|
-- ---
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
--- Collection of layouts that can be used in widget boxes
|
--- Collection of layouts that can be used in widget boxes.
|
||||||
--
|
--
|
||||||
-- @author Uli Schlachter
|
-- @author Uli Schlachter
|
||||||
-- @copyright 2010 Uli Schlachter
|
-- @copyright 2010 Uli Schlachter
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-- A calendar widget
|
-- A calendar widget.
|
||||||
--
|
--
|
||||||
-- This module defines two widgets: a month calendar and a year calendar
|
-- This module defines two widgets: a month calendar and a year calendar
|
||||||
--
|
--
|
||||||
|
|
|
@ -1,6 +1,23 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
-- A widget to display image.
|
||||||
|
--
|
||||||
|
-- The `wibox.widget.imagebox` is part of the Awesome WM's wiboxes system
|
||||||
|
-- (see @{03-declarative-layout.md}).
|
||||||
|
--
|
||||||
|
-- This widget displays an image. The image can be a file,
|
||||||
|
-- a cairo image surface, or an rsvg handle object (see the
|
||||||
|
-- [image property](#image)).
|
||||||
|
--
|
||||||
|
-- Use a `wibox.widget.imagebox`
|
||||||
|
-- ---
|
||||||
|
--
|
||||||
|
-- @DOC_wibox_widget_defaults_imagebox_EXAMPLE@
|
||||||
|
--
|
||||||
|
-- Alternatively, you can declare the `imagebox` widget using the
|
||||||
|
-- declarative pattern (Both codes are strictly equivalent):
|
||||||
|
--
|
||||||
|
-- @DOC_wibox_widget_declarative-pattern_imagebox_EXAMPLE@
|
||||||
--
|
--
|
||||||
--@DOC_wibox_widget_defaults_imagebox_EXAMPLE@
|
|
||||||
-- @author Uli Schlachter
|
-- @author Uli Schlachter
|
||||||
-- @copyright 2010 Uli Schlachter
|
-- @copyright 2010 Uli Schlachter
|
||||||
-- @widgetmod wibox.widget.imagebox
|
-- @widgetmod wibox.widget.imagebox
|
||||||
|
@ -125,11 +142,29 @@ local function load_and_apply(ib, file, image_loader, image_setter)
|
||||||
return image_applied
|
return image_applied
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set an imagebox' image
|
--- The image rendered by the `imagebox`.
|
||||||
|
--
|
||||||
|
-- It can can be any of the following:
|
||||||
|
--
|
||||||
|
-- * A `string` : Interpreted as the path to an image file,
|
||||||
|
-- * A cairo image surface : Directly used as is,
|
||||||
|
-- * An rsvg handle object : Directly used as is,
|
||||||
|
-- * `nil` : Unset the image.
|
||||||
|
--
|
||||||
-- @property image
|
-- @property image
|
||||||
-- @param image This can can be string, cairo image surface, rsvg handle object or nil. A string is
|
-- @tparam image image The image to render.
|
||||||
-- interpreted as the path to an image file. Nil will deny previously set image.
|
-- @see set_image
|
||||||
-- @return true on success, false if the image cannot be used
|
|
||||||
|
--- Set the `imagebox` image.
|
||||||
|
--
|
||||||
|
-- The image can be a file, a cairo image surface, or an rsvg handle object
|
||||||
|
-- (see the [image property](#image)).
|
||||||
|
-- @method imagebox:set_image
|
||||||
|
-- @tparam image image The image to render.
|
||||||
|
-- @treturn boolean `true` on success, `false` if the image cannot be used.
|
||||||
|
-- @usage my_imagebox:set_image(beautiful.awesome_icon)
|
||||||
|
-- @usage my_imagebox:set_image('/usr/share/icons/theme/my_icon.png')
|
||||||
|
-- @see image
|
||||||
function imagebox:set_image(image)
|
function imagebox:set_image(image)
|
||||||
local setup_succeed
|
local setup_succeed
|
||||||
|
|
||||||
|
@ -169,23 +204,23 @@ function imagebox:set_image(image)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set a clip shape for this imagebox
|
--- Set a clip shape for this imagebox.
|
||||||
-- A clip shape define an area where the content is displayed and one where it
|
-- A clip shape define an area where the content is displayed and one where it
|
||||||
-- is trimmed.
|
-- is trimmed.
|
||||||
--
|
--
|
||||||
-- @property clip_shape
|
-- @property clip_shape
|
||||||
-- @tparam gears.shape clip_shape A `gears_shape` compatible shape function
|
-- @tparam function|gears.shape clip_shape A `gears.shape` compatible shape function.
|
||||||
-- @see gears.shape
|
-- @see gears.shape
|
||||||
-- @see set_clip_shape
|
-- @see set_clip_shape
|
||||||
|
|
||||||
--- Set a clip shape for this imagebox
|
--- Set a clip shape for this imagebox.
|
||||||
-- A clip shape define an area where the content is displayed and one where it
|
-- A clip shape define an area where the content is displayed and one where it
|
||||||
-- is trimmed.
|
-- is trimmed.
|
||||||
--
|
--
|
||||||
-- Any other parameters will be passed to the clip shape function
|
-- Any other parameters will be passed to the clip shape function.
|
||||||
--
|
--
|
||||||
-- @tparam function clip_shape A `gears_shape` compatible shape function.
|
-- @tparam function|gears.shape clip_shape A `gears_shape` compatible shape function.
|
||||||
-- @method set_clip_shape
|
-- @method imagebox:set_clip_shape
|
||||||
-- @see gears.shape
|
-- @see gears.shape
|
||||||
-- @see clip_shape
|
-- @see clip_shape
|
||||||
function imagebox:set_clip_shape(clip_shape, ...)
|
function imagebox:set_clip_shape(clip_shape, ...)
|
||||||
|
@ -195,24 +230,39 @@ function imagebox:set_clip_shape(clip_shape, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Should the image be resized to fit into the available space?
|
--- Should the image be resized to fit into the available space?
|
||||||
|
-- @DOC_wibox_widget_imagebox_resize_EXAMPLE@
|
||||||
-- @property resize
|
-- @property resize
|
||||||
-- @param allowed If false, the image will be clipped, else it will be resized
|
-- @tparam boolean resize
|
||||||
-- to fit into the available space.
|
|
||||||
|
--- Should the image be resized to fit into the available space?
|
||||||
|
-- @tparam boolean allowed If `false`, the image will be clipped, else it will
|
||||||
|
-- be resized to fit into the available space.
|
||||||
|
-- @method imagebox:set_resize
|
||||||
function imagebox:set_resize(allowed)
|
function imagebox:set_resize(allowed)
|
||||||
self._private.resize_forbidden = not allowed
|
self._private.resize_forbidden = not allowed
|
||||||
self:emit_signal("widget::redraw_needed")
|
self:emit_signal("widget::redraw_needed")
|
||||||
self:emit_signal("widget::layout_changed")
|
self:emit_signal("widget::layout_changed")
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns a new imagebox.
|
--- Returns a new `wibox.widget.imagebox` instance.
|
||||||
-- Any other arguments will be passed to the clip shape function
|
--
|
||||||
-- @param image the image to display, may be nil
|
-- This is the constructor of `wibox.widget.imagebox`. It creates a new
|
||||||
-- @param resize_allowed If false, the image will be clipped, else it will be resized
|
-- instance of imagebox widget.
|
||||||
-- to fit into the available space.
|
--
|
||||||
-- @param clip_shape A `gears.shape` compatible function
|
-- Alternatively, the declarative layout syntax can handle
|
||||||
-- @treturn table A new `imagebox`
|
-- `wibox.widget.imagebox` instanciation.
|
||||||
|
--
|
||||||
|
-- The image can be a file, a cairo image surface, or an rsvg handle object
|
||||||
|
-- (see the [image property](#image)).
|
||||||
|
--
|
||||||
|
-- Any additional arguments will be passed to the clip shape function.
|
||||||
|
-- @tparam[opt] image image The image to display (may be `nil`).
|
||||||
|
-- @tparam[opt] boolean resize_allowed If `false`, the image will be
|
||||||
|
-- clipped, else it will be resized to fit into the available space.
|
||||||
|
-- @tparam[opt] function clip_shape A `gears.shape` compatible function.
|
||||||
|
-- @treturn wibox.widget.imagebox A new `wibox.widget.imagebox` widget instance.
|
||||||
-- @constructorfct 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})
|
||||||
|
|
||||||
gtable.crush(ret, imagebox, true)
|
gtable.crush(ret, imagebox, true)
|
||||||
|
@ -225,7 +275,7 @@ local function new(image, resize_allowed, clip_shape)
|
||||||
end
|
end
|
||||||
|
|
||||||
ret._private.clip_shape = clip_shape
|
ret._private.clip_shape = clip_shape
|
||||||
ret._private.clip_args = {}
|
ret._private.clip_args = {...}
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** awesome mousegrabber API
|
/** awesome mousegrabber API.
|
||||||
* @author Julien Danjou <julien@danjou.info>
|
* @author Julien Danjou <julien@danjou.info>
|
||||||
* @copyright 2008-2009 Julien Danjou
|
* @copyright 2008-2009 Julien Danjou
|
||||||
* @coreclassmod mousegrabber
|
* @coreclassmod mousegrabber
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** awesome drawable API
|
/** awesome drawable API.
|
||||||
*
|
*
|
||||||
* Furthermore to the classes described here, one can also use signals as
|
* Furthermore to the classes described here, one can also use signals as
|
||||||
* described in @{signals}.
|
* described in @{signals}.
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** awesome screen API
|
/** awesome screen API.
|
||||||
*
|
*
|
||||||
* Screen objects can be added and removed over time. To get a callback for all
|
* Screen objects can be added and removed over time. To get a callback for all
|
||||||
* current and future screens, use `awful.screen.connect_for_each_screen`:
|
* current and future screens, use `awful.screen.connect_for_each_screen`:
|
||||||
|
|
2
root.c
2
root.c
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** awesome root window API
|
/** awesome root window API.
|
||||||
* @author Julien Danjou <julien@danjou.info>
|
* @author Julien Danjou <julien@danjou.info>
|
||||||
* @copyright 2008-2009 Julien Danjou
|
* @copyright 2008-2009 Julien Danjou
|
||||||
* @coreclassmod root
|
* @coreclassmod root
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
--DOC_NO_USAGE
|
||||||
|
local parent = ... --DOC_HIDE
|
||||||
|
local wibox = require( "wibox" ) --DOC_HIDE
|
||||||
|
local beautiful = require( "beautiful" ) --DOC_HIDE
|
||||||
|
|
||||||
|
local my_imagebox = wibox.widget {
|
||||||
|
image = beautiful.awesome_icon,
|
||||||
|
resize = false,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
}
|
||||||
|
|
||||||
|
parent:add(my_imagebox) --DOC_HIDE
|
||||||
|
|
||||||
|
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
|
@ -1,15 +1,11 @@
|
||||||
--DOC_GEN_IMAGE --DOC_HIDE
|
--DOC_GEN_IMAGE
|
||||||
|
--DOC_NO_USAGE
|
||||||
local parent = ... --DOC_HIDE
|
local parent = ... --DOC_HIDE
|
||||||
local wibox = require( "wibox" ) --DOC_HIDE
|
local wibox = require( "wibox" ) --DOC_HIDE
|
||||||
local beautiful = require( "beautiful" ) --DOC_HIDE
|
local beautiful = require( "beautiful" ) --DOC_HIDE
|
||||||
|
|
||||||
parent:add( --DOC_HIDE
|
local my_imagebox = wibox.widget.imagebox(beautiful.awesome_icon, false)
|
||||||
|
|
||||||
wibox.widget {
|
parent:add(my_imagebox) --DOC_HIDE
|
||||||
image = beautiful.awesome_icon,
|
|
||||||
resize = false,
|
|
||||||
widget = wibox.widget.imagebox
|
|
||||||
}
|
|
||||||
|
|
||||||
) --DOC_HIDE
|
|
||||||
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
--DOC_HIDE_ALL
|
||||||
|
--DOC_GEN_IMAGE
|
||||||
|
local parent = ...
|
||||||
|
local wibox = require( "wibox" )
|
||||||
|
local beautiful = require( "beautiful" )
|
||||||
|
|
||||||
|
local function cell_centered_widget(widget)
|
||||||
|
return wibox.widget {
|
||||||
|
widget,
|
||||||
|
valign = 'center',
|
||||||
|
halign = 'center',
|
||||||
|
content_fill_vertical = false,
|
||||||
|
content_fill_horizontal = false,
|
||||||
|
widget = wibox.container.place
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local function build_ib(size, resize)
|
||||||
|
return cell_centered_widget({
|
||||||
|
resize = resize,
|
||||||
|
forced_width = size,
|
||||||
|
forced_height = size,
|
||||||
|
image = beautiful.awesome_icon,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local l = wibox.widget {
|
||||||
|
homogeneous = false,
|
||||||
|
spacing = 5,
|
||||||
|
layout = wibox.layout.grid,
|
||||||
|
}
|
||||||
|
parent:add(l)
|
||||||
|
|
||||||
|
l:add_widget_at(cell_centered_widget(wibox.widget.textbox('resize = true')), 1, 1)
|
||||||
|
l:add_widget_at(cell_centered_widget(wibox.widget.textbox('resize = false')), 2, 1)
|
||||||
|
l:add_widget_at(cell_centered_widget(wibox.widget.textbox('imagebox size')), 3, 1)
|
||||||
|
|
||||||
|
for i,size in ipairs({16, 32, 64}) do
|
||||||
|
l:add_widget_at(build_ib(size, true), 1, i + 1)
|
||||||
|
l:add_widget_at(build_ib(size, false), 2, i + 1)
|
||||||
|
l:add_widget_at(cell_centered_widget(wibox.widget.textbox(size..'x'..size)), 3, i + 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
Loading…
Reference in New Issue