Flatten src into model, edit and ui, with .h headers

Resources and utilities sit directly in src. The ImGui windows, wizards, popups and helpers are in ui.
Headers that would shadow system ones are renamed: math_util, timestamp, subprocess, localization.
Includes are written from src.
This commit is contained in:
shweet committed 2026-11-22 17:12:05 -05:00
1 parent a515267e26
commit 7fb2c607c2
175 files changed
+537 -537

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
#pragma once
#include <map>
#include <set>
#include "model/model.h"
namespace anm2ed
{
enum class SelectionKind
{
ANIMATIONS,
ANIMATION_GROUPS,
TRACKS,
GROUPS,
FRAMES,
SPRITESHEETS,
REGIONS,
SHADERS,
LAYERS,
NULLS,
EVENTS,
SOUNDS,
LIBRARIES
};
// What is selected, by element uid, plus the focused animation/track/frame. uids follow elements through edits,
// so nothing here is repaired by index; the UI reads it as References through a UidIndex.
struct Selection
{
std::map<SelectionKind, std::set<std::uint64_t>> uids{};
Handle focus{};
std::map<SelectionKind, std::uint64_t> focuses{};
bool operator==(const Selection&) const = default;
};
std::set<Reference> selection_references_get(const Selection&, const model::UidIndex&, SelectionKind);
void selection_references_set(Selection&, const model::Model&, SelectionKind, const std::set<Reference>&);
Reference selection_focus_get(const Selection&, const model::UidIndex&);
void selection_focus_set(Selection&, const model::Model&, Reference);
// Content items (spritesheets, regions of the focused spritesheet, shaders, layers, ...) are selected by uid and
// read back as ids.
std::set<int> selection_ids_get(const Selection&, const model::Model&, SelectionKind);
void selection_ids_set(Selection&, const model::Model&, SelectionKind, const std::set<int>&);
int selection_focus_id_get(const Selection&, const model::Model&, SelectionKind);
void selection_focus_id_set(Selection&, const model::Model&, SelectionKind, int);
void selection_follow(Selection&, const model::Model&, const model::UidIndex&, Reference);
}