56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
|
|
namespace tahgibu {
|
|
|
|
enum class Tool {
|
|
Select,
|
|
Move,
|
|
Scale,
|
|
Rotate,
|
|
Transform,
|
|
Vertices,
|
|
Draw,
|
|
Eraser,
|
|
Sprite,
|
|
ColorPicker,
|
|
Zoom,
|
|
Pan,
|
|
};
|
|
|
|
struct ToolInfo {
|
|
Tool id;
|
|
const char* label;
|
|
};
|
|
|
|
// Registro de herramientas. La barra superior se genera a partir de esta
|
|
// tabla: agregar una herramienta nueva = agregar un valor al enum y una línea aquí.
|
|
inline constexpr ToolInfo kToolInfos[] = {
|
|
{Tool::Select, "Seleccionar"},
|
|
{Tool::Move, "Mover"},
|
|
{Tool::Scale, "Escalar"},
|
|
{Tool::Rotate, "Rotar"},
|
|
{Tool::Transform, "Transformar"},
|
|
{Tool::Vertices, "Vértices"},
|
|
{Tool::Draw, "Dibujar"},
|
|
{Tool::Eraser, "Borrador"},
|
|
{Tool::Sprite, "Sprite"},
|
|
{Tool::ColorPicker, "Color"},
|
|
{Tool::Zoom, "Zoom"},
|
|
{Tool::Pan, "Mano"},
|
|
};
|
|
|
|
inline constexpr std::size_t kToolCount = sizeof(kToolInfos) / sizeof(kToolInfos[0]);
|
|
|
|
inline const char* toolLabel(Tool tool) noexcept {
|
|
for (const ToolInfo& info : kToolInfos) {
|
|
if (info.id == tool) {
|
|
return info.label;
|
|
}
|
|
}
|
|
return "?";
|
|
}
|
|
|
|
} // namespace tahgibu
|