14#include <glibmm/main.h>
22#define TIMER_SCALE_VALUE 20
39 extension(in_extension)
53 Glib::signal_timeout().connect(sigc::ptr_fun(&
timer_func),
timeout * 1000 / TIMER_SCALE_VALUE);
108 auto const current = Glib::DateTime::create_now_utc();
111 if (time_left < 0) time_left = 0;
125 if (
locked > 0)
return false;
127 auto const current = Glib::DateTime::create_now_utc();
175 Glib::signal_timeout().connect(sigc::ptr_fun(&
timer_func),
timeout * 1000 / TIMER_SCALE_VALUE);
196 Glib::signal_idle().connect(sigc::ptr_fun(&
idle_func));
static long timeout
What the current timeout is (in seconds)
static ExpirationTimer * timer_list
Circularly linked list of all timers.
int locked
Is this extension locked from being unloaded?
Glib::DateTime expiration
When this timer expires.
static bool timer_func()
A timer function to set up the idle function.
ExpirationTimer(Extension *in_extension)
Create a new expiration timer.
static bool timer_started
Has the timer been started?
virtual ~ExpirationTimer()
Deletes a ExpirationTimer.
Extension * extension
What extension this function relates to.
void touch()
Touches the timer to extend the length before it expires.
static bool idle_func()
This function goes in the idle loop to find expired extensions.
static ExpirationTimer * idle_start
Which timer was on top when we started the idle loop.
ExpirationTimer * next
Next entry in the list.
bool expired() const
Check to see if the timer has expired.
The object that is the basis for the Extension system.
@ STATE_UNLOADED
The extension has not been loaded.
void set_state(state_t in_state)
A function to set whether the extension should be loaded or unloaded.
static char const *const current
Inkscape::Extension::Extension: Frontend to certain, possibly pluggable, actions.
Helper class to stream background task notifications as a series of messages.