2023-06-17 17:00:55 +00:00
|
|
|
/* date = May 13th 2023 6:20 pm */
|
|
|
|
|
|
|
|
#ifndef VN_WORKSPACE_EDITOR_H
|
|
|
|
#define VN_WORKSPACE_EDITOR_H
|
|
|
|
|
|
|
|
/* sixten(NOTE): Node types
|
|
|
|
*
|
|
|
|
* Text(String, opt. Character) -> Node
|
2023-07-19 15:09:41 +00:00
|
|
|
* Branch(Strings[0..n]) -> Nodes[0..n]
|
2023-06-17 17:00:55 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum workspace_editor_node_type
|
|
|
|
{
|
|
|
|
Workspace_EditorNode_None,
|
2023-07-19 15:09:41 +00:00
|
|
|
Workspace_EditorNode_Start,
|
2023-06-17 17:00:55 +00:00
|
|
|
Workspace_EditorNode_Text,
|
2023-07-19 15:09:41 +00:00
|
|
|
Workspace_EditorNode_Branch,
|
2023-06-17 17:00:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct workspace_editor_node
|
|
|
|
{
|
|
|
|
workspace_editor_node_type Type;
|
|
|
|
|
|
|
|
workspace_editor_node *Next;
|
|
|
|
workspace_editor_node *Prev;
|
|
|
|
|
|
|
|
ui_box *Box;
|
|
|
|
ui_box *TitleBox;
|
2023-07-19 15:09:41 +00:00
|
|
|
ui_box *CloseBox;
|
2023-06-17 17:00:55 +00:00
|
|
|
|
|
|
|
v2 P;
|
|
|
|
};
|
|
|
|
|
2023-07-19 15:09:41 +00:00
|
|
|
struct workspace_editor_lister_dropdown
|
|
|
|
{
|
|
|
|
// sixten: Input field
|
|
|
|
char InputField[128];
|
|
|
|
s32 InputFieldUsed;
|
|
|
|
b32 InputFieldSelected;
|
|
|
|
|
|
|
|
// sixten: Properties
|
|
|
|
b32 Open;
|
|
|
|
v2 P;
|
|
|
|
};
|
|
|
|
|
2023-06-17 17:00:55 +00:00
|
|
|
//- sixten: Managing nodes
|
|
|
|
static workspace_editor_node *Workspace_GetNewEditorNode(struct workspace_view *View);
|
|
|
|
|
|
|
|
//- sixten: Transformations
|
|
|
|
inline v2 Workspace_ViewToWorld(v2 Offset, r32 Scale, v2 Dim, v2 P);
|
|
|
|
inline v2 Workspace_WorldToView(v2 Offset, r32 Scale, v2 Dim, v2 P);
|
|
|
|
inline r32 Workspace_CalculateScaleFromZoomLevel(r32 ZoomLevel);
|
|
|
|
|
2023-07-19 15:09:41 +00:00
|
|
|
//- sixten: Lister dropdown
|
|
|
|
static void Workspace_OpenListerDropdown(v2 MouseP);
|
|
|
|
|
2023-06-17 17:00:55 +00:00
|
|
|
//- sixten: Builder code
|
2023-07-19 15:09:41 +00:00
|
|
|
static void Workspace_BuildEditorListerDropdown(workspace_editor_lister_dropdown *ListerDropdown);
|
2023-06-17 17:00:55 +00:00
|
|
|
static void Workspace_EditorDrawCallback(render_group *Group, glyph_atlas *Atlas, ui_box *Box, void *Data);
|
2023-07-19 15:09:41 +00:00
|
|
|
static void Workspace_BuildEditor(struct workspace_view *View);
|
2023-06-17 17:00:55 +00:00
|
|
|
|
|
|
|
#endif //VN_WORKSPACE_EDITOR_H
|