mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
LibGUI+WindowServer: Introduce new mouse tracking mechanism
This commit is contained in:
parent
bde3c7301e
commit
45126655cd
10 changed files with 94 additions and 3 deletions
33
Userland/Libraries/LibGUI/MouseTracker.h
Normal file
33
Userland/Libraries/LibGUI/MouseTracker.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/IntrusiveList.h>
|
||||
#include <LibGUI/Forward.h>
|
||||
#include <LibGfx/Point.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class MouseTracker {
|
||||
public:
|
||||
MouseTracker();
|
||||
virtual ~MouseTracker();
|
||||
|
||||
static void track_mouse_move(Badge<WindowServerConnection>, Gfx::IntPoint const&);
|
||||
|
||||
protected:
|
||||
virtual void track_mouse_move(Gfx::IntPoint const&) = 0;
|
||||
|
||||
private:
|
||||
IntrusiveListNode<MouseTracker> m_list_node;
|
||||
using List = IntrusiveList<MouseTracker, RawPtr<MouseTracker>, &MouseTracker::m_list_node>;
|
||||
static List s_trackers;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue