46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
/* 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
|
|
* Menu(Strings[0..n]) -> Nodes[0..n]
|
|
*
|
|
*/
|
|
|
|
enum workspace_editor_node_type
|
|
{
|
|
Workspace_EditorNode_None,
|
|
Workspace_EditorNode_Text,
|
|
Workspace_EditorNode_Menu,
|
|
};
|
|
|
|
struct workspace_editor_node
|
|
{
|
|
workspace_editor_node_type Type;
|
|
|
|
workspace_editor_node *Next;
|
|
workspace_editor_node *Prev;
|
|
|
|
ui_box *Box;
|
|
ui_box *TitleBox;
|
|
|
|
v2 P;
|
|
};
|
|
|
|
//- 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);
|
|
|
|
//- sixten: Builder code
|
|
static void Workspace_EditorDrawCallback(render_group *Group, glyph_atlas *Atlas, ui_box *Box, void *Data);
|
|
static void Workspace_BuildEditor(struct workspace *Workspace, struct workspace_view *View);
|
|
|
|
#endif //VN_WORKSPACE_EDITOR_H
|