raiguard/tcom

git clone https://git.raiguard.me/raiguard/tcom

Caleb HeuerMore stuffsb78c31a

trunk
643 B26 linesraw
1package tcom
2
3import rt "base:runtime"
4import hm "core:container/handle_map"
5import "core:log"
6
7g_focused_pane: Pane_Handle
8g_panes: Panes
9
10// TODO: Consider if handle_map is the correct data structure for this.
11Pane_Handle :: distinct hm.Handle16
12Panes :: distinct hm.Dynamic_Handle_Map(Pane, Pane_Handle)
13Pane_Iterator :: hm.Dynamic_Handle_Map_Iterator(Panes)
14
15panes_init :: proc(allocator: rt.Allocator) {
16	hm.dynamic_init(&g_panes, allocator)
17}
18
19panes_fini :: proc() {
20	all_panes_cleaned := hm.len(g_panes) == 0
21	assert(all_panes_cleaned)
22	if !all_panes_cleaned {
23		log.fatalf("Leaving dangling panes.")
24	}
25	hm.dynamic_destroy(&g_panes)
26}