Stage 8a: panels as plain functions; content selection on the uid Selection

- New panel kit (imgui/window/panel.*): list/card drawing with multi-select,
  rename, arrow keys, drag hooks and tooltips; a list panel helper for the
  context menu, shortcuts and footer; panels build their Actions inline.
- Layers, nulls, events, sounds, spritesheets, regions, shaders and
  animations are plain functions over a small persistent state struct.
- Content items are selected by uid in the shared Selection (one kind per
  content type, plus a focus per kind); regions are those of the focused
  spritesheet. Selection survives undo, paste and removal like the timeline's.
- Combo labels are computed when drawn (Document::choices_get).
- Deletes the Window callback framework, WINDOW_FLAGS, Storage and the
  per-window selection snapshot fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 17:47:21 -04:00
1 parent e50d76c784
commit d08f59d7ba
37 files changed
+2355 -2578

No files matched your search

+13 -3
View File
@@ -26,13 +26,18 @@ namespace anm2ed
class Manager;
struct Command;
// Ids and labels for a combo box of content items.
struct Choices
{
std::vector<int> ids{};
std::vector<std::string> labels{};
};
struct DocumentData
{
std::filesystem::path path{};
uint64_t tabId{};
Snapshots snapshots{};
std::map<int, Storage> regionBySpritesheet{};
Storage animation{};
resource::AssetStore assets{};
std::map<int, resource::Image> textureDrafts{};
int changeAllFramePropertiesRegionId{-1};
@@ -146,6 +151,12 @@ namespace anm2ed
void reference_set(Reference);
std::set<Reference> selected_get(SelectionKind) const;
void selected_set(SelectionKind, const std::set<Reference>&);
std::set<int> selected_ids_get(SelectionKind) const;
void selected_ids_set(SelectionKind, const std::set<int>&);
int focused_id_get(SelectionKind) const;
void focused_id_set(SelectionKind, int);
void selected_clear(SelectionKind);
Choices choices_get(SelectionKind, int = -1) const;
std::set<int> animations_selected_get() const;
void animations_selected_set(const std::set<int>&);
std::set<Reference> item_frame_references_get(Reference) const;
@@ -155,7 +166,6 @@ namespace anm2ed
void frame_references_clear();
std::vector<Reference> layer_references_get();
Storage* layer_regions_get(int);
const model::Frame* frame_get() const;
const model::Track* item_get() const;
const model::Spritesheet* spritesheet_get() const;