vn/code/vn_workspace_nav_editor.h

71 lines
1.7 KiB
C
Raw Normal View History

/* date = November 5th 2023 4:38 pm */
#ifndef VN_WORKSPACE_NAV_EDITOR_H
#define VN_WORKSPACE_NAV_EDITOR_H
2023-12-23 07:27:22 +00:00
#define W_STRING_CHUNK_SIZE 128
struct workspace_string_chunk
{
workspace_string_chunk *Next;
workspace_string_chunk *Prev;
u8 Data[W_STRING_CHUNK_SIZE - 2*sizeof(workspace_string_chunk *)];
};
struct workspace_string_chunk_list
{
workspace_string_chunk *First;
workspace_string_chunk *Last;
};
struct scene_nav_item_node
{
2023-12-23 07:27:22 +00:00
scene_nav_item_node *Next;
scene_nav_item_node *Prev;
workspace_string_chunk *HoverTextStringChunk;
workspace_string_chunk *ActionStringChunk;
scene_nav_item Item;
};
struct scene_nav_item_list
{
2023-12-23 07:27:22 +00:00
scene_nav_item_node *First;
scene_nav_item_node *Last;
u64 Count;
};
struct workspace_view_nav_editor
{
2023-12-23 07:27:22 +00:00
//- sixten: items
scene_nav_item_list Items;
scene_nav_item_node *FirstFree;
scene_nav_item_node *LastFree;
//- sixten: strings
workspace_string_chunk_list FreeStrings;
//- sixten: inspect info
scene_nav_item_node *SelectedItem;
b32 TextureDropdownOpen;
b32 NavActionDropdownOpen;
text_edit_state NavActionStringEditState;
text_edit_state HoverTextEditState;
s32 ActiveTextThing;
//- sixten: file info
string FileName;
string FilePath;
};
2023-12-23 07:27:22 +00:00
static void W_NavEditorSerializeItems(workspace_view_nav_editor *Editor);
static scene_nav_item_node *W_SceneNavItemNodeAlloc(arena *Arena, workspace_view_nav_editor *Editor);
static void W_SceneNavItemNodeRelease(workspace_view_nav_editor *Editor, scene_nav_item_node *Node);
2023-12-23 07:27:22 +00:00
static void W_NavEditorInspectNode(scene_nav_item_node *Node);
static void W_NavEditorSetup(workspace_view *View, string FilePath, string FileName, string FileContents);
static void W_BuildNavEditor(workspace_view *View);
#endif //VN_WORKSPACE_NAV_EDITOR_H