/* * Copyright (c) 2022, Jelle Raaijmakers * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include namespace Desktop { class Screensaver : public GUI::Widget { C_OBJECT_ABSTRACT(Screensaver) public: Function on_screensaver_exit; static ErrorOr> create_window(StringView title, StringView icon); virtual void keydown_event(GUI::KeyEvent&) override; virtual void mousedown_event(GUI::MouseEvent& event) override; virtual void mousemove_event(GUI::MouseEvent& event) override; protected: Screensaver() : m_start_time(AK::Time::now_monotonic()) { } private: void trigger_exit(); Optional m_mouse_origin; AK::Time m_start_time; }; }