LibCore: Move LibGUI/GTimer to LibCore/CTimer.

This commit is contained in:
Andreas Kling 2019-04-12 00:09:45 +02:00
parent 667e678aa6
commit 47a2982119
Notes: sideshowbarker 2024-07-19 14:44:45 +09:00
5 changed files with 14 additions and 14 deletions

View file

@ -7,7 +7,7 @@
#include <SharedGraphics/Rect.h>
#include <LibGUI/GWidget.h>
#include <LibCore/CNotifier.h>
#include <LibGUI/GTimer.h>
#include <LibCore/CTimer.h>
class Font;
@ -160,5 +160,5 @@ private:
int m_glyph_width { 0 };
GTimer m_cursor_blink_timer;
CTimer m_cursor_blink_timer;
};

View file

@ -1,20 +1,20 @@
#include <LibGUI/GTimer.h>
#include <LibCore/CTimer.h>
GTimer::GTimer(CObject* parent)
CTimer::CTimer(CObject* parent)
: CObject(parent)
{
}
GTimer::~GTimer()
CTimer::~CTimer()
{
}
void GTimer::start()
void CTimer::start()
{
start(m_interval);
}
void GTimer::start(int interval)
void CTimer::start(int interval)
{
if (m_active)
return;
@ -22,7 +22,7 @@ void GTimer::start(int interval)
m_active = true;
}
void GTimer::stop()
void CTimer::stop()
{
if (!m_active)
return;
@ -30,7 +30,7 @@ void GTimer::stop()
m_active = false;
}
void GTimer::timer_event(CTimerEvent&)
void CTimer::timer_event(CTimerEvent&)
{
if (m_single_shot)
stop();

View file

@ -3,10 +3,10 @@
#include <LibCore/CObject.h>
#include <AK/Function.h>
class GTimer final : public CObject {
class CTimer final : public CObject {
public:
explicit GTimer(CObject* parent = nullptr);
virtual ~GTimer() override;
explicit CTimer(CObject* parent = nullptr);
virtual ~CTimer() override;
void start();
void start(int interval);
@ -21,7 +21,7 @@ public:
Function<void()> on_timeout;
virtual const char* class_name() const override { return "GTimer"; }
virtual const char* class_name() const override { return "CTimer"; }
private:
virtual void timer_event(CTimerEvent&) override;

View file

@ -11,6 +11,7 @@ OBJS = \
CNetworkJob.o \
CNetworkResponse.o \
CObject.o \
CTimer.o \
CEventLoop.o \
CEvent.o

View file

@ -49,7 +49,6 @@ LIBGUI_OBJS = \
GTreeView.o \
GFileSystemModel.o \
GSplitter.o \
GTimer.o \
GSpinBox.o \
GGroupBox.o \
GWindow.o