mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:57:36 +00:00
LibCore: Move LibGUI/GTimer to LibCore/CTimer.
This commit is contained in:
parent
667e678aa6
commit
47a2982119
5 changed files with 14 additions and 14 deletions
|
@ -7,7 +7,7 @@
|
||||||
#include <SharedGraphics/Rect.h>
|
#include <SharedGraphics/Rect.h>
|
||||||
#include <LibGUI/GWidget.h>
|
#include <LibGUI/GWidget.h>
|
||||||
#include <LibCore/CNotifier.h>
|
#include <LibCore/CNotifier.h>
|
||||||
#include <LibGUI/GTimer.h>
|
#include <LibCore/CTimer.h>
|
||||||
|
|
||||||
class Font;
|
class Font;
|
||||||
|
|
||||||
|
@ -160,5 +160,5 @@ private:
|
||||||
|
|
||||||
int m_glyph_width { 0 };
|
int m_glyph_width { 0 };
|
||||||
|
|
||||||
GTimer m_cursor_blink_timer;
|
CTimer m_cursor_blink_timer;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
#include <LibGUI/GTimer.h>
|
#include <LibCore/CTimer.h>
|
||||||
|
|
||||||
GTimer::GTimer(CObject* parent)
|
CTimer::CTimer(CObject* parent)
|
||||||
: CObject(parent)
|
: CObject(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GTimer::~GTimer()
|
CTimer::~CTimer()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void GTimer::start()
|
void CTimer::start()
|
||||||
{
|
{
|
||||||
start(m_interval);
|
start(m_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GTimer::start(int interval)
|
void CTimer::start(int interval)
|
||||||
{
|
{
|
||||||
if (m_active)
|
if (m_active)
|
||||||
return;
|
return;
|
||||||
|
@ -22,7 +22,7 @@ void GTimer::start(int interval)
|
||||||
m_active = true;
|
m_active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GTimer::stop()
|
void CTimer::stop()
|
||||||
{
|
{
|
||||||
if (!m_active)
|
if (!m_active)
|
||||||
return;
|
return;
|
||||||
|
@ -30,7 +30,7 @@ void GTimer::stop()
|
||||||
m_active = false;
|
m_active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GTimer::timer_event(CTimerEvent&)
|
void CTimer::timer_event(CTimerEvent&)
|
||||||
{
|
{
|
||||||
if (m_single_shot)
|
if (m_single_shot)
|
||||||
stop();
|
stop();
|
|
@ -3,10 +3,10 @@
|
||||||
#include <LibCore/CObject.h>
|
#include <LibCore/CObject.h>
|
||||||
#include <AK/Function.h>
|
#include <AK/Function.h>
|
||||||
|
|
||||||
class GTimer final : public CObject {
|
class CTimer final : public CObject {
|
||||||
public:
|
public:
|
||||||
explicit GTimer(CObject* parent = nullptr);
|
explicit CTimer(CObject* parent = nullptr);
|
||||||
virtual ~GTimer() override;
|
virtual ~CTimer() override;
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
void start(int interval);
|
void start(int interval);
|
||||||
|
@ -21,7 +21,7 @@ public:
|
||||||
|
|
||||||
Function<void()> on_timeout;
|
Function<void()> on_timeout;
|
||||||
|
|
||||||
virtual const char* class_name() const override { return "GTimer"; }
|
virtual const char* class_name() const override { return "CTimer"; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void timer_event(CTimerEvent&) override;
|
virtual void timer_event(CTimerEvent&) override;
|
|
@ -11,6 +11,7 @@ OBJS = \
|
||||||
CNetworkJob.o \
|
CNetworkJob.o \
|
||||||
CNetworkResponse.o \
|
CNetworkResponse.o \
|
||||||
CObject.o \
|
CObject.o \
|
||||||
|
CTimer.o \
|
||||||
CEventLoop.o \
|
CEventLoop.o \
|
||||||
CEvent.o
|
CEvent.o
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,6 @@ LIBGUI_OBJS = \
|
||||||
GTreeView.o \
|
GTreeView.o \
|
||||||
GFileSystemModel.o \
|
GFileSystemModel.o \
|
||||||
GSplitter.o \
|
GSplitter.o \
|
||||||
GTimer.o \
|
|
||||||
GSpinBox.o \
|
GSpinBox.o \
|
||||||
GGroupBox.o \
|
GGroupBox.o \
|
||||||
GWindow.o
|
GWindow.o
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue