types.hpp is UI-free: theme moves to util/imgui/theme.hpp, ImGui conversions and dummy values to layout.hpp

The model and edit layers no longer include ImGui or localization headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 18:45:44 -04:00
1 parent ab276f6f08
commit 901c11691b
14 files changed
+68 -47

No files matched your search

+2
View File
@@ -1,5 +1,7 @@
#include "toast.hpp"
#include "util/imgui/layout.hpp"
#include <format>
#include <imgui/imgui.h>
+2
View File
@@ -6,6 +6,8 @@
#include <string>
#include <utility>
#include <imgui/imgui.h>
#include "canvas.hpp"
#include "manager.hpp"
#include "settings.hpp"
+2
View File
@@ -3,6 +3,8 @@
#include <algorithm>
#include <format>
#include <glm/gtc/type_ptr.hpp>
#include "math.hpp"
#include "path.hpp"
#include "util/imgui/draw.hpp"
+2
View File
@@ -5,6 +5,8 @@
#include <set>
#include <utility>
#include <glm/gtc/type_ptr.hpp>
#include "actions.hpp"
#include "imgui_internal.h"
#include "math.hpp"
@@ -1,5 +1,7 @@
#include "change_all_frame_properties.hpp"
#include <glm/gtc/type_ptr.hpp>
#include <algorithm>
#include <ranges>
#include <set>
@@ -1,5 +1,7 @@
#include "generate_animation_from_grid.hpp"
#include <glm/gtc/type_ptr.hpp>
#include "math.hpp"
#include "model/frames.hpp"
#include "types.hpp"
+2
View File
@@ -6,6 +6,8 @@
#include <string>
#include <vector>
#include <imgui/imgui.h>
#include "document.hpp"
#include "settings.hpp"
#include "strings.hpp"
+1
View File
@@ -9,6 +9,7 @@
#include "render.hpp"
#include "strings.hpp"
#include "types.hpp"
#include "util/imgui/theme.hpp"
namespace anm2ed
{
+2
View File
@@ -1,5 +1,7 @@
#pragma once
#include <imgui/imgui.h>
#include "icon.hpp"
#include "settings.hpp"
#include "strings.hpp"
-46
View File
@@ -1,34 +1,6 @@
#pragma once
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <imgui/imgui.h>
#include "strings.hpp"
namespace anm2ed::types::theme
{
#define THEMES \
X(LIGHT, LABEL_THEME_LIGHT) \
X(DARK, LABEL_THEME_DARK) \
X(CLASSIC, LABEL_THEME_CLASSIC)
enum Type
{
#define X(symbol, string) symbol,
THEMES
#undef X
COUNT
};
constexpr StringType STRINGS[] = {
#define X(symbol, string) string,
THEMES
#undef X
};
#undef THEMES
}
namespace anm2ed::types::shortcut
{
@@ -112,22 +84,4 @@ namespace anm2ed::types
};
constexpr auto ID_NONE = -1;
constexpr ImVec2 to_imvec2(const glm::vec2& v) noexcept { return {v.x, v.y}; }
constexpr glm::vec2 to_vec2(const ImVec2& v) noexcept { return {v.x, v.y}; }
constexpr glm::ivec2 to_ivec2(const ImVec2& v) noexcept { return {v.x, v.y}; }
constexpr ImVec4 to_imvec4(const glm::vec4& v) noexcept { return {v.x, v.y, v.z, v.w}; }
constexpr glm::vec4 to_vec4(const ImVec4& v) noexcept { return {v.x, v.y, v.z, v.w}; }
template <typename T> constexpr T& dummy_value()
{
static T value{};
return value;
}
template <typename T> constexpr T& dummy_value_negative()
{
static T value{-1};
return value;
}
}
+22
View File
@@ -2,8 +2,30 @@
#include <string>
#include <glm/glm.hpp>
#include <imgui/imgui.h>
namespace anm2ed::types
{
constexpr ImVec2 to_imvec2(const glm::vec2& v) noexcept { return {v.x, v.y}; }
constexpr glm::vec2 to_vec2(const ImVec2& v) noexcept { return {v.x, v.y}; }
constexpr glm::ivec2 to_ivec2(const ImVec2& v) noexcept { return {v.x, v.y}; }
constexpr ImVec4 to_imvec4(const glm::vec4& v) noexcept { return {v.x, v.y, v.z, v.w}; }
constexpr glm::vec4 to_vec4(const ImVec4& v) noexcept { return {v.x, v.y, v.z, v.w}; }
template <typename T> constexpr T& dummy_value()
{
static T value{};
return value;
}
template <typename T> constexpr T& dummy_value_negative()
{
static T value{-1};
return value;
}
}
namespace anm2ed::imgui
{
float row_widget_width_get(int, float = ImGui::GetContentRegionAvail().x);
+2
View File
@@ -1,5 +1,7 @@
#include "popup.hpp"
#include "layout.hpp"
#include <imgui/imgui.h>
#include "types.hpp"
+2
View File
@@ -1,5 +1,7 @@
#include "theme.hpp"
#include <imgui/imgui.h>
namespace anm2ed::imgui
{
constexpr ImVec4 COLOR_LIGHT_BUTTON{0.98f, 0.98f, 0.98f, 1.0f};
+25 -1
View File
@@ -1,6 +1,30 @@
#pragma once
#include "types.hpp"
#include "strings.hpp"
namespace anm2ed::types::theme
{
#define THEMES \
X(LIGHT, LABEL_THEME_LIGHT) \
X(DARK, LABEL_THEME_DARK) \
X(CLASSIC, LABEL_THEME_CLASSIC)
enum Type
{
#define X(symbol, string) symbol,
THEMES
#undef X
COUNT
};
constexpr StringType STRINGS[] = {
#define X(symbol, string) string,
THEMES
#undef X
};
#undef THEMES
}
namespace anm2ed::imgui
{