vn/code/vn_workspace_view.h

85 lines
1.8 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
2023-08-22 03:19:51 +00:00
////////////////////////////////
//~ sixten: Workspace View Types
2023-06-17 17:00:55 +00:00
struct workspace_view
{
2023-12-23 07:27:22 +00:00
arena *Arena;
workspace_panel *Parent;
workspace_view *Next;
workspace_view *Prev;
enum workspace_view_kind Kind;
void *Data;
2023-06-17 17:00:55 +00:00
};
enum workspace_view_kind
2023-06-17 17:00:55 +00:00
{
2023-12-23 07:27:22 +00:00
W_ViewKind_None,
W_ViewKind_Startup,
W_ViewKind_Settings,
W_ViewKind_FileLister,
W_ViewKind_TextEditor,
W_ViewKind_SceneView,
W_ViewKind_NavEditor,
W_ViewKind_ImageViewer,
W_ViewKind_Error,
};
struct workspace_view_error
{
2023-12-23 07:27:22 +00:00
string Message;
2023-06-17 17:00:55 +00:00
};
enum workspace_settings_category
{
2023-12-23 07:27:22 +00:00
W_Settings_All,
W_Settings_General,
W_Settings_Developer,
2023-06-17 17:00:55 +00:00
};
struct workspace_view_settings
{
2023-12-23 07:27:22 +00:00
workspace_settings_category Category;
r32 GlobalScroll;
// sixten: General
b32 GeneralDropdownOpen;
};
struct workspace_view_image_viewer
{
string FileName;
render_handle Texture;
r32 Scale;
v2_r32 Offset;
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
inline workspace_view *W_CreateNewView(workspace_view_kind Type, workspace_panel *Parent);
2023-08-22 03:19:51 +00:00
inline void W_DestroyView(workspace_view *View);
inline b32 W_ViewIsCurrent(workspace_view *View);
2023-12-23 07:27:22 +00:00
inline string W_NameFromView(arena *Arena, 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
2023-12-23 07:27:22 +00:00
//- sixten: View Implementations
static b32 W_ImageViewerSetup(workspace_view *View, string Name, string Contents);
static void W_BuildImageViewer(workspace_view *View);
static void W_BuildSceneView(workspace_view *View);
static void W_BuildSettings(workspace_view *View);
2023-06-17 17:00:55 +00:00
#endif //VN_WORKSPACE_VIEW_H