2
* Here is where the extensions can get timed on when they load and
3
* unload. All of the timing is done in here.
6
* Ted Gould <ted@gould.cx>
8
* Copyright (C) 2004 Authors
10
* Released under GNU GPL, read the file 'COPYING' for more information
13
#ifndef INKSCAPE_EXTENSION_TIMER_H__
14
#define INKSCAPE_EXTENSION_TIMER_H__
16
#include <sigc++/sigc++.h>
17
#include <glibmm/timeval.h>
18
#include "extension-forward.h"
23
class ExpirationTimer {
24
/** \brief Circularly linked list of all timers */
25
static ExpirationTimer * timer_list;
26
/** \brief Which timer was on top when we started the idle loop */
27
static ExpirationTimer * idle_start;
28
/** \brief What the current timeout is */
30
/** \brief Has the timer been started? */
31
static bool timer_started;
33
/** \brief Is this extension locked from being unloaded? */
35
/** \brief Next entry in the list */
36
ExpirationTimer * next;
37
/** \brief When this timer expires */
38
Glib::TimeVal expiration;
39
/** \brief What extension this function relates to */
40
Extension * extension;
42
bool expired(void) const;
44
static bool idle_func (void);
45
static bool timer_func (void);
48
ExpirationTimer(Extension * in_extension);
49
~ExpirationTimer(void);
52
void lock (void) { locked = true; };
53
void unlock (void) { locked = false; };
55
/** \brief Set the timeout variable */
56
static void set_timeout (long in_seconds) { timeout = in_seconds; };
59
}; }; /* namespace Inkscape, Extension */
61
#endif /* INKSCAPE_EXTENSION_TIMER_H__ */
66
c-file-style:"stroustrup"
67
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
72
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :