mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:27:34 +00:00
WindowServer+LibGfx: Move CursorParams to LibGfx
They will be used by MouseSettings in the next commit.
This commit is contained in:
parent
0363cd3d55
commit
3597b6eb9d
5 changed files with 145 additions and 115 deletions
37
Userland/Libraries/LibGfx/CursorParams.h
Normal file
37
Userland/Libraries/LibGfx/CursorParams.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/StringView.h>
|
||||
#include <LibGfx/Point.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
class CursorParams {
|
||||
public:
|
||||
static CursorParams parse_from_filename(StringView const&, Gfx::IntPoint const&);
|
||||
|
||||
CursorParams() = default;
|
||||
|
||||
CursorParams(Gfx::IntPoint const& hotspot)
|
||||
: m_hotspot(hotspot)
|
||||
{
|
||||
}
|
||||
CursorParams constrained(Gfx::Bitmap const&) const;
|
||||
|
||||
Gfx::IntPoint const& hotspot() const { return m_hotspot; }
|
||||
unsigned frames() const { return m_frames; }
|
||||
unsigned frame_ms() const { return m_frame_ms; }
|
||||
|
||||
private:
|
||||
Gfx::IntPoint m_hotspot;
|
||||
unsigned m_frames { 1 };
|
||||
unsigned m_frame_ms { 0 };
|
||||
bool m_have_hotspot { false };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue