From 3da2264df2c77723e547bad3706c858f67870947 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 18 Aug 2019 23:51:58 -0400 Subject: [PATCH] doc: Add a shared section for the signal documentation. --- docs/common/signals.ldoc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/common/signals.ldoc diff --git a/docs/common/signals.ldoc b/docs/common/signals.ldoc new file mode 100644 index 000000000..2c636169b --- /dev/null +++ b/docs/common/signals.ldoc @@ -0,0 +1,27 @@ + + +--- Connect a global signal on the module. +-- +-- Functions connected to this signal source will be executed when any +-- module object emits the signal. +-- +-- It is also used for some generic module signals such as +-- `request::display`. +-- +-- @tparam string name The name of the signal +-- @tparam function func The function to attach +-- @function naughty.connect_signal +-- @usage naughty.connect_signal("added", function(notif) +-- -- do something +-- end) + +--- Emit a module signal. +-- @tparam string name The signal name. +-- @param ... The signal callback arguments +-- @function naughty.emit_signal + +--- Disconnect a signal from a source. +-- @tparam string name The name of the signal +-- @tparam function func The attached function +-- @function naughty.disconnect_signal +-- @treturn boolean If the disconnection was successful