2009-08-28 12:05:38 +02:00
|
|
|
--- awesome timer API
|
|
|
|
-- @author Julien Danjou <julien@danjou.info>
|
|
|
|
-- @copyright 2009 Julien Danjou
|
|
|
|
module("timer")
|
|
|
|
|
2009-08-30 06:20:52 +02:00
|
|
|
--- Timer object. This type of object is useful when triggering events in a repeatedly.
|
2009-08-28 12:05:38 +02:00
|
|
|
-- The timer will emit the "timeout" signal every N seconds, N being the timeout value.
|
|
|
|
-- @field timeout Interval in seconds to emit the timeout signal.
|
|
|
|
-- Can be any value, including floating ones (i.e. 1.5 second).
|
|
|
|
-- @field started Read-only boolean field indicating if the timer has been started.
|
|
|
|
-- @class table
|
|
|
|
-- @name timer
|
|
|
|
|
|
|
|
--- Start the timer.
|
|
|
|
-- @param -
|
|
|
|
-- @name start
|
|
|
|
-- @class function
|
|
|
|
|
|
|
|
--- Stop the timer.
|
|
|
|
-- @param -
|
|
|
|
-- @name stop
|
|
|
|
-- @class function
|
|
|
|
|
|
|
|
--- Add a signal.
|
|
|
|
-- @param name A signal name.
|
2009-08-30 06:20:52 +02:00
|
|
|
-- @param func A function to call when the signal is emitted.
|
2010-08-25 20:37:49 +02:00
|
|
|
-- @name connect_signal
|
2009-08-28 12:05:38 +02:00
|
|
|
-- @class function
|
|
|
|
|
|
|
|
--- Remove a signal.
|
|
|
|
-- @param name A signal name.
|
|
|
|
-- @param func A function to remove.
|
2010-08-25 20:37:49 +02:00
|
|
|
-- @name disconnect_signal
|
2009-08-28 12:05:38 +02:00
|
|
|
-- @class function
|
|
|
|
|
|
|
|
--- Emit a signal.
|
|
|
|
-- @param name A signal name.
|
|
|
|
-- @param ... Various arguments, optional.
|
|
|
|
-- @name emit_signal
|
|
|
|
-- @class function
|
2010-09-17 17:10:53 +02:00
|
|
|
|
|
|
|
--- Get the number of instances.
|
|
|
|
-- @return The number of timer objects alive.
|
|
|
|
-- @name instances
|
|
|
|
-- @class function
|