vn/code/vn_workspace_view.h

79 lines
1.9 KiB
C
Raw Normal View History

2023-06-17 17:00:55 +00:00
/* date = June 11th 2023 1:20 pm */
#ifndef VN_WORKSPACE_VIEW_H
#define VN_WORKSPACE_VIEW_H
struct workspace_view
{
2023-07-19 15:09:41 +00:00
memory_arena *Arena;
2023-06-17 17:00:55 +00:00
enum workspace_view_type Type;
workspace_panel *Parent;
workspace_view *Next;
workspace_view *Prev;
void *Data;
};
enum workspace_view_type
{
Workspace_View_Startup,
Workspace_View_Editor,
Workspace_View_CommandPalette,
Workspace_View_Settings,
2023-07-19 15:09:41 +00:00
Workspace_View_TextEditor,
2023-06-17 17:00:55 +00:00
};
struct workspace_view_editor
{
v2 Offset;
r32 ZoomLevel;
r32 Scale; // sixten(NOTE): Read-only, based on the zoom level
workspace_editor_node *FirstNode;
workspace_editor_node *LastNode;
workspace_editor_node *FirstFreeNode;
workspace_editor_node *LastFreeNode;
2023-07-19 15:09:41 +00:00
workspace_editor_lister_dropdown ListerDropdown;
2023-06-17 17:00:55 +00:00
};
struct workspace_view_command_palette
{
b32 ListerFieldSelected;
2023-06-21 16:59:36 +00:00
u8 ListerInput[128];
2023-06-17 17:00:55 +00:00
s32 ListerInputUsed;
text_edit_state ListerInputEditState;
};
enum workspace_settings_category
{
Workspace_Settings_All,
Workspace_Settings_General,
2023-06-23 12:38:15 +00:00
Workspace_Settings_Theme,
2023-06-17 17:00:55 +00:00
Workspace_Settings_Developer,
};
struct workspace_view_settings
{
workspace_settings_category Category;
2023-06-27 14:14:28 +00:00
// sixten: General
b32 GeneralDropdownOpen;
// sixten: Theme
r32 ThemeScroll;
2023-06-17 17:00:55 +00:00
};
//- sixten: Views
inline workspace_view *Workspace_CreateNewView(workspace_view_type Type, workspace_panel *Parent);
inline void Workspace_DestroyView(workspace_view *View);
2023-07-19 15:09:41 +00:00
inline b32 Workspace_ViewIsCurrent(workspace_view *View);
2023-06-17 17:00:55 +00:00
inline string Workspace_GetViewName(workspace_view *View);
//- sixten: Builder code
static void Workspace_ViewListerInputCallback(render_group *Group, glyph_atlas *Atlas, ui_box *Box, void *Data);
2023-07-19 15:09:41 +00:00
static void Workspace_BuildViewTypeLister(workspace_view *View);
static void Workspace_BuildView(workspace_view *View);
2023-06-17 17:00:55 +00:00
#endif //VN_WORKSPACE_VIEW_H