blob: 18c092f1b081816a5bb20f5c00379efe93a47a85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include <LibGUI/GTimer.h>
GTimer::GTimer(CObject* parent)
: CObject(parent)
{
}
GTimer::~GTimer()
{
}
void GTimer::start()
{
start(m_interval);
}
void GTimer::start(int interval)
{
if (m_active)
return;
start_timer(interval);
m_active = true;
}
void GTimer::stop()
{
if (!m_active)
return;
stop_timer();
m_active = false;
}
void GTimer::timer_event(CTimerEvent&)
{
if (m_single_shot)
stop();
if (on_timeout)
on_timeout();
}
|