add 'cursor' ui property

This commit is contained in:
MihailRis
2024-12-30 21:41:05 +03:00
parent 10f0bd0290
commit cb9690ebc7
14 changed files with 144 additions and 1 deletions
+42 -1
View File
@@ -1,5 +1,8 @@
#pragma once
#include <string>
#include <optional>
enum class DrawPrimitive {
point = 0,
line,
@@ -7,9 +10,47 @@ enum class DrawPrimitive {
};
enum class BlendMode {
normal, addition, inversion
/// @brief Normal blending mode.
normal,
/// @brief Additive blending mode.
addition,
/// @brief Subtractive blending mode.
inversion
};
/// @brief Standard GLFW 3.4 cursor shapes (same order and count as in GLFW).
/// It also works in GLFW 3.3 (unsupported shapes will be replaced with the arrow).
enum class CursorShape {
/// @brief Regular arrow
ARROW,
/// @brief Text input I-beam
TEXT,
/// @brief Crosshair
CROSSHAIR,
/// @brief Pointing hand
POINTER,
/// @brief Horizontal resize arrow
EW_RESIZE,
/// @brief Vertical resize arrow
NS_RESIZE,
// GLFW 3.4+ cursor shapes
/// @brief Diagonal resize arrow (top-left to bottom-right)
NWSE_RESIZE,
/// @brief Diagonal resize arrow (top-right to bottom-left)
NESW_RESIZE,
/// @brief All-direction resize arrow
ALL_RESIZE,
/// @brief Operation not allowed
NOT_ALLOWED,
LAST=NOT_ALLOWED
};
std::optional<CursorShape> CursorShape_from(std::string_view name);
std::string to_string(CursorShape shape);
class Flushable {
public:
virtual ~Flushable() = default;