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
|
|
|
|
|
2023-08-22 03:19:51 +00:00
|
|
|
////////////////////////////////
|
|
|
|
//~ sixten: Workspace View Types
|
|
|
|
|
2023-06-17 17:00:55 +00:00
|
|
|
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
|
|
|
|
{
|
2023-08-22 03:19:51 +00:00
|
|
|
W_View_Startup,
|
|
|
|
W_View_Editor,
|
|
|
|
W_View_CommandPalette,
|
|
|
|
W_View_Settings,
|
|
|
|
W_View_TextEditor,
|
|
|
|
W_View_SceneView,
|
2023-09-05 17:50:49 +00:00
|
|
|
W_View_CharacterEditor,
|
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
|
|
|
|
{
|
2023-08-22 03:19:51 +00:00
|
|
|
W_Settings_All,
|
|
|
|
W_Settings_General,
|
|
|
|
W_Settings_Theme,
|
|
|
|
W_Settings_Developer,
|
2023-06-17 17:00:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct workspace_view_settings
|
|
|
|
{
|
|
|
|
workspace_settings_category Category;
|
2023-08-22 03:19:51 +00:00
|
|
|
r32 GlobalScroll;
|
2023-06-27 14:14:28 +00:00
|
|
|
|
|
|
|
// sixten: General
|
|
|
|
b32 GeneralDropdownOpen;
|
|
|
|
|
|
|
|
// sixten: Theme
|
|
|
|
r32 ThemeScroll;
|
2023-06-17 17:00:55 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 03:19:51 +00:00
|
|
|
////////////////////////////////
|
|
|
|
//~ sixten: Workspace View Functions
|
|
|
|
|
2023-06-17 17:00:55 +00:00
|
|
|
//- sixten: Views
|
2023-08-22 03:19:51 +00:00
|
|
|
inline workspace_view *W_CreateNewView(workspace_view_type Type, workspace_panel *Parent);
|
|
|
|
inline void W_DestroyView(workspace_view *View);
|
|
|
|
inline b32 W_ViewIsCurrent(workspace_view *View);
|
|
|
|
inline string W_GetViewName(workspace_view *View);
|
2023-06-17 17:00:55 +00:00
|
|
|
|
|
|
|
//- sixten: Builder code
|
2023-08-22 03:19:51 +00:00
|
|
|
static void W_ViewListerInputCallback(render_group *Group, glyph_atlas *Atlas, ui_box *Box, void *Data);
|
|
|
|
static void W_BuildViewTypeLister(workspace_view *View);
|
|
|
|
static void W_BuildView(workspace_view *View);
|
2023-06-17 17:00:55 +00:00
|
|
|
|
|
|
|
#endif //VN_WORKSPACE_VIEW_H
|