summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
Diffstat (limited to 'Applications')
-rw-r--r--Applications/Clock/.gitignore3
-rw-r--r--Applications/Clock/ClockWidget.cpp37
-rw-r--r--Applications/Clock/ClockWidget.h16
-rw-r--r--Applications/Clock/Makefile35
-rw-r--r--Applications/Clock/main.cpp22
5 files changed, 0 insertions, 113 deletions
diff --git a/Applications/Clock/.gitignore b/Applications/Clock/.gitignore
deleted file mode 100644
index 6710497633..0000000000
--- a/Applications/Clock/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.o
-*.d
-Clock
diff --git a/Applications/Clock/ClockWidget.cpp b/Applications/Clock/ClockWidget.cpp
deleted file mode 100644
index 97001edbb5..0000000000
--- a/Applications/Clock/ClockWidget.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <stdio.h>
-#include <time.h>
-#include <SharedGraphics/Painter.h>
-#include "ClockWidget.h"
-
-ClockWidget::ClockWidget(GWidget* parent)
- : GWidget(parent)
-{
- set_relative_rect({ 0, 0, 100, 40 });
- start_timer(300);
-}
-
-ClockWidget::~ClockWidget()
-{
-}
-
-void ClockWidget::paint_event(GPaintEvent&)
-{
- auto now = time(nullptr);
- auto& tm = *localtime(&now);
-
- char timeBuf[128];
- sprintf(timeBuf, "%02u:%02u:%02u", tm.tm_hour, tm.tm_min, tm.tm_sec);
-
- Painter painter(*this);
- painter.fill_rect(rect(), Color::LightGray);
- painter.draw_text(rect(), timeBuf, TextAlignment::Center, Color::Black);
-}
-
-void ClockWidget::timer_event(GTimerEvent&)
-{
- auto now = time(nullptr);
- if (now == m_last_time)
- return;
- m_last_time = now;
- update();
-}
diff --git a/Applications/Clock/ClockWidget.h b/Applications/Clock/ClockWidget.h
deleted file mode 100644
index d9702a575f..0000000000
--- a/Applications/Clock/ClockWidget.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma once
-
-#include <LibGUI/GWidget.h>
-
-class ClockWidget final : public GWidget {
-public:
- explicit ClockWidget(GWidget* parent = nullptr);
- virtual ~ClockWidget() override;
-
-private:
- virtual void paint_event(GPaintEvent&) override;
- virtual void timer_event(GTimerEvent&) override;
-
- time_t m_last_time { 0 };
-};
-
diff --git a/Applications/Clock/Makefile b/Applications/Clock/Makefile
deleted file mode 100644
index 8e12d768c9..0000000000
--- a/Applications/Clock/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-OBJS = \
- ClockWidget.o \
- main.o
-
-APP = Clock
-
-ARCH_FLAGS =
-STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
-USERLAND_FLAGS = -ffreestanding -fno-stack-protector
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
-FLAVOR_FLAGS = -march=i686 -m32 -fno-exceptions -fno-rtti
-OPTIMIZATION_FLAGS = -Os
-INCLUDE_FLAGS = -I../.. -I. -I../../LibC
-
-DEFINES = -DSERENITY -DSANITIZE_PTRS -DUSERLAND
-
-CXXFLAGS = -MMD -MP $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(USERLAND_FLAGS) $(FLAVOR_FLAGS) $(ARCH_FLAGS) $(STANDARD_FLAGS) $(INCLUDE_FLAGS) $(DEFINES)
-CXX = clang
-LD = ld
-AR = ar
-LDFLAGS = -static --strip-debug -melf_i386 -e _start --gc-sections
-
-all: $(APP)
-
-$(APP): $(OBJS)
- $(LD) -o $(APP) $(LDFLAGS) $(OBJS) ../../LibGUI/LibGUI.a ../../LibC/LibC.a
-
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(APPS) $(OBJS) *.d
-
diff --git a/Applications/Clock/main.cpp b/Applications/Clock/main.cpp
deleted file mode 100644
index 49f25a892c..0000000000
--- a/Applications/Clock/main.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <LibGUI/GApplication.h>
-#include <LibGUI/GWindow.h>
-#include "ClockWidget.h"
-
-int main(int argc, char** argv)
-{
- GApplication app(argc, argv);
-
- auto* window = new GWindow;
- window->set_title("Clock");
- window->set_rect({ 600, 100, 100, 40 });
- window->set_should_exit_app_on_close(true);
-
- auto* clock_widget = new ClockWidget;
- clock_widget->set_relative_rect({ 0, 0, 100, 40 });
- window->set_main_widget(clock_widget);
-
- window->show();
- return app.exec();
-}
-
-