| 1 | // Aseprite UI Library |
| 2 | // Copyright (C) 2020-2021 Igara Studio S.A. |
| 3 | // Copyright (C) 2001-2017 David Capello |
| 4 | // |
| 5 | // This file is released under the terms of the MIT license. |
| 6 | // Read LICENSE.txt for more information. |
| 7 | |
| 8 | #ifndef UI_CURSOR_H_INCLUDED |
| 9 | #define UI_CURSOR_H_INCLUDED |
| 10 | #pragma once |
| 11 | |
| 12 | #include "gfx/point.h" |
| 13 | #include "os/cursor.h" |
| 14 | #include "os/surface.h" |
| 15 | |
| 16 | namespace ui { |
| 17 | |
| 18 | class Cursor { |
| 19 | public: |
| 20 | Cursor(const os::SurfaceRef& surface = nullptr, |
| 21 | const gfx::Point& focus = gfx::Point(0, 0)); |
| 22 | |
| 23 | const os::SurfaceRef& surface() const { return m_surface; } |
| 24 | const gfx::Point& focus() const { return m_focus; } |
| 25 | os::CursorRef nativeCursor(const int scale) const; |
| 26 | |
| 27 | void reset(); |
| 28 | |
| 29 | private: |
| 30 | os::SurfaceRef m_surface; |
| 31 | gfx::Point m_focus; |
| 32 | mutable os::CursorRef m_cursor; |
| 33 | mutable int m_scale; |
| 34 | }; |
| 35 | |
| 36 | } // namespace ui |
| 37 | |
| 38 | #endif |
| 39 | |