2019-08-19 05:51:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
--- 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
|
2022-07-05 10:37:14 +02:00
|
|
|
-- @noreturn
|
2021-12-17 22:46:08 +01:00
|
|
|
-- @staticfct naughty.connect_signal
|
2019-08-19 05:51:58 +02:00
|
|
|
-- @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
|
2022-07-05 10:37:14 +02:00
|
|
|
-- @noreturn
|
2021-12-17 22:46:08 +01:00
|
|
|
-- @staticfct naughty.emit_signal
|
2019-08-19 05:51:58 +02:00
|
|
|
|
|
|
|
--- Disconnect a signal from a source.
|
|
|
|
-- @tparam string name The name of the signal
|
|
|
|
-- @tparam function func The attached function
|
2021-12-17 22:46:08 +01:00
|
|
|
-- @staticfct naughty.disconnect_signal
|
2019-08-19 05:51:58 +02:00
|
|
|
-- @treturn boolean If the disconnection was successful
|