package tcom import rt "base:runtime" import hm "core:container/handle_map" import "core:log" g_focused_pane: Pane_Handle g_panes: Panes // TODO: Consider if handle_map is the correct data structure for this. Pane_Handle :: distinct hm.Handle16 Panes :: distinct hm.Dynamic_Handle_Map(Pane, Pane_Handle) Pane_Iterator :: hm.Dynamic_Handle_Map_Iterator(Panes) panes_init :: proc(allocator: rt.Allocator) { hm.dynamic_init(&g_panes, allocator) } panes_fini :: proc() { all_panes_cleaned := hm.len(g_panes) == 0 assert(all_panes_cleaned) if !all_panes_cleaned { log.fatalf("Leaving dangling panes.") } hm.dynamic_destroy(&g_panes) }