raiguard/tcom
git clone https://git.raiguard.me/raiguard/tcom
b78c31a
trunk
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 ) { 16hm . dynamic_init ( & g_panes , allocator ) 17} 18 19panes_fini :: proc () { 20all_panes_cleaned := hm . len ( g_panes ) == 0 21assert ( all_panes_cleaned ) 22if ! all_panes_cleaned { 23log . fatalf ( "Leaving dangling panes." ) 24} 25hm . dynamic_destroy ( & g_panes ) 26}