aboutsummaryrefslogtreecommitdiff
path: root/src/ui/cursor.hpp
blob: aec3fc405712b8808ce9f190acd8225a1ec6d6c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

// ReSharper disable once CppUnusedIncludeDirective
#include "pre.hpp"

#include <memory>
#include "system_headers.hpp"

#include "base.hpp"

namespace cru::ui {
class Cursor : public Object {
 public:
  using Ptr = std::shared_ptr<Cursor>;

  Cursor(HCURSOR handle, bool auto_release);
  Cursor(const Cursor& other) = delete;
  Cursor(Cursor&& other) = delete;
  Cursor& operator=(const Cursor& other) = delete;
  Cursor& operator=(Cursor&& other) = delete;
  ~Cursor() override;

  HCURSOR GetHandle() const { return handle_; }

 private:
  HCURSOR handle_;
  bool auto_release_;
};

namespace cursors {
extern Cursor::Ptr arrow;
extern Cursor::Ptr hand;
extern Cursor::Ptr i_beam;

void LoadSystemCursors();
}  // namespace cursors
}  // namespace cru::ui