Serenity Operating System
1/*
2 * Copyright (c) 2021, Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <AK/Badge.h>
10#include <AK/Function.h>
11#include <AK/IntrusiveList.h>
12#include <LibGUI/Forward.h>
13#include <LibGfx/Point.h>
14
15namespace GUI {
16
17class MouseTracker {
18public:
19 MouseTracker();
20 virtual ~MouseTracker();
21
22 static void track_mouse_move(Badge<ConnectionToWindowServer>, Gfx::IntPoint);
23
24protected:
25 virtual void track_mouse_move(Gfx::IntPoint) = 0;
26
27private:
28 IntrusiveListNode<MouseTracker> m_list_node;
29 using List = IntrusiveList<&MouseTracker::m_list_node>;
30 static List s_trackers;
31};
32
33}