Preparando la interfaz
This commit is contained in:
commit
66bedbb5f1
17 files changed
+876
No files matched your search
@@ -0,0 +1,55 @@
|
||||
#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
|
||||
Reference in new issue
Block a user