11#include <toast/events/event.hpp>
19struct UpdateHierarchyData : Event<UpdateHierarchyData> {
20 struct HierarchyElement {
27 std::vector<HierarchyElement> children;
31 HierarchyElement() =
default;
35 bool is_empty =
false;
36 uint64_t workspace_handle = 0;
43 workspace_handle(handle) { }
48struct HierarchyNodesEnabled : Event<HierarchyNodesEnabled> {
50 std::vector<toast::UID> path;
54 std::vector<Entry> nodes;
55 uint64_t workspace_handle = 0;
57 HierarchyNodesEnabled() =
default;
59 HierarchyNodesEnabled(std::vector<Entry> nodes, uint64_t handle) : nodes(std::move(nodes)), workspace_handle(handle) { }
62struct WorkspaceCreate : Event<WorkspaceCreate> {
66 WorkspaceCreate(
toast::UID parent, std::string_view type) : parent(parent), type(type) { }
69struct WorkspaceSpawn : Event<WorkspaceSpawn> {
75 WorkspaceSpawn() =
default;
79 WorkspaceSpawn(
toast::UID parent, std::string_view uri) : parent(parent), is_uri(
true), uri(uri) { }
82struct [[deprecated]] WorkspaceRemove : Event<WorkspaceRemove> {
85 WorkspaceRemove(
toast::UID target) : target(target) { }
88struct WorkspaceDestroy : Event<WorkspaceDestroy> {
91 WorkspaceDestroy(uint64_t handle) : handle(handle) { }
94struct SetActiveWorkspace : Event<SetActiveWorkspace> {
97 SetActiveWorkspace(uint64_t handle) : handle(handle) { }
100struct WorkspaceSave : Event<WorkspaceSave> {
103 uint64_t workspace_handle = 0;
104 uint64_t request = 0;
106 WorkspaceSave(
toast::UID target, std::string uri, uint64_t workspace_handle = 0, uint64_t request = 0)
109 workspace_handle(workspace_handle),
114 uint64_t workspace_handle = 0;
115 uint64_t request = 0;
116 bool success =
false;
117 std::vector<uint8_t> snapshot;
121struct WorkspaceAutosave : Event<WorkspaceAutosave> {
125 WorkspaceAutosave(uint64_t handle, std::string uri) : handle(handle), uri(std::move(uri)) { }
128struct WorkspaceCreateNode : Event<WorkspaceCreateNode> {
132 WorkspaceCreateNode(
toast::UID parent, std::string_view type) : parent(parent), type(type) { }
135struct WorkspaceRemoveNode : Event<WorkspaceRemoveNode> {
138 WorkspaceRemoveNode(
toast::UID target) : target(target) { }
141struct WorkspaceMoveNodeTo : Event<WorkspaceMoveNodeTo> {
148 new_parent(new_parent),
149 predecessor(predecessor) { }
181 uint64_t workspace_handle = 0;
183 bool success =
false;
193 glm::vec3 color {0.0f};
194 std::vector<glm::vec4> planes;
195 bool resizable =
false;
196 uint32_t color_id = 0;
205 std::vector<int16_t> depths;
212 std::vector<VoxelPieceLayoutData> pieces;
241 std::vector<toast::UID> targets;
242 glm::vec4 plane {0.0f};
247 std::vector<toast::UID> targets;
254 glm::ivec3 voxel {0};
257 uint32_t search_axis = 0;
258 int32_t search_step = 1;
262 std::vector<toast::UID> targets;
269 bool replace =
false;
277 bool unit_grid =
true;
278 bool voxel_grid =
false;
280 bool voxel_edges =
false;
281 bool projections =
false;
287 glm::vec4 plane {0.0f};
291 uint64_t workspace_handle = 0;
297 uint32_t paint_id = 1;
299 uint32_t default_mode = 0;
304 uint64_t workspace = 0;
305 uint64_t source_workspace = 0;
309struct SetFocusedNode : Event<SetFocusedNode> {
315struct NodeChangeParam : Event<NodeChangeParam> {
317 std::string parameter;
320 NodeChangeParam(
toast::UID node, std::string_view parameter, std::string_view value)
322 parameter(parameter),
326struct NodeChangeName : Event<NodeChangeName> {
330 NodeChangeName(
toast::UID n, std::string_view name) : node(n), name(name) { }
333struct NodeCallFunction : Event<NodeCallFunction> {
335 std::string function;
337 NodeCallFunction(
toast::UID node, std::string_view f) : node(node), function(f) { }
340struct NodeEnabled : Event<NodeEnabled> {
344 NodeEnabled(
toast::UID n,
bool enabled) : node(n), enabled(enabled) { }
347struct WorkspacePause : Event<WorkspacePause> {
351 WorkspacePause(uint64_t handle,
bool paused) : handle(handle), paused(paused) { }
354struct SetGizmoTool : Event<SetGizmoTool> {
357 SetGizmoTool(uint32_t tool) : tool(tool) { }
362struct SetRenderMode : Event<SetRenderMode> {
365 SetRenderMode(uint32_t mode) : mode(mode) { }
368struct SetCoordinateSpace : Event<SetCoordinateSpace> {
371 SetCoordinateSpace(
bool world) : world(world) { }
374struct SetSnapping : Event<SetSnapping> {
379 SetSnapping(uint32_t kind,
bool enabled,
float value) : kind(kind), enabled(enabled), value(value) { }
382struct SetCameraMode : Event<SetCameraMode> {
385 SetCameraMode(
bool game) : game(game) { }
389struct EditorCameraFlyMode : Event<EditorCameraFlyMode> {
392 EditorCameraFlyMode(
bool active) : active(active) { }
400struct EditorCameraMoveState : Event<EditorCameraMoveState> {
401 bool forward, back, left, right, up, down, boost;
403 EditorCameraMoveState(
bool forward,
bool back,
bool left,
bool right,
bool up,
bool down,
bool boost)
414struct EditorCameraLook : Event<EditorCameraLook> {
417 EditorCameraLook(
float dx,
float dy) : dx(dx), dy(dy) { }
420enum class EditorCameraMode : uint8_t {
425struct SetEditorCameraSettings : Event<SetEditorCameraSettings> {
426 EditorCameraMode mode;
429 uint64_t workspace_handle;
431 SetEditorCameraSettings(EditorCameraMode mode,
float speed, uint64_t workspace_handle = 0)
434 workspace_handle(workspace_handle) { }
436 SetEditorCameraSettings(uint32_t mode,
float speed, uint64_t workspace_handle = 0)
437 : mode(
static_cast<EditorCameraMode
>(mode)),
439 workspace_handle(workspace_handle) { }
442struct EditorCameraGesture : Event<EditorCameraGesture> {
445 EditorCameraGesture(
float dx,
float dy,
float zoom) : dx(dx), dy(dy), zoom(zoom) { }
448struct InspectorContent : Event<InspectorContent> {
449 struct InspectorField {
453 InspectorField(std::string_view name, std::string_view value) : name(name), value(value) { }
459 std::vector<InspectorField> parameters;
460 std::vector<toast::NodeMessage> messages;
463 std::string_view uid, std::string_view name,
bool enabled, std::vector<InspectorField> fields,
464 std::vector<toast::NodeMessage> messages
469 parameters(std::move(fields)),
470 messages(std::move(messages)) { }
473struct InspectorLuaContent : Event<InspectorLuaContent> {
478 bool is_array =
false;
479 std::string ref_type;
481 std::string default_value;
482 std::string display_name;
483 bool read_only =
false;
492 std::vector<LuaField> fields;
497 std::vector<LuaField> fields;
498 std::vector<LuaSubgroup> subgroups;
503 std::vector<LuaField> fields;
504 std::vector<LuaGroup> groups;
508 uint32_t schema_version = 0;
509 std::vector<LuaScriptCard> scripts;
511 InspectorLuaContent() =
default;
513 InspectorLuaContent(std::string_view uid, uint32_t schema_version, std::vector<LuaScriptCard> scripts)
515 schema_version(schema_version),
516 scripts(std::move(scripts)) { }
519struct NodeChangeLuaParam : Event<NodeChangeLuaParam> {
524 NodeChangeLuaParam(
toast::UID node, std::string_view path, std::string_view value) : node(node), path(path), value(value) { }
527enum class HistoryOperation : uint8_t {
548 uint64_t sequence = 0;
549 std::vector<uint64_t> parents;
551 std::string node_name;
552 HistoryOperation operation = HistoryOperation::initial;
554 std::string previous_value;
555 std::string current_value;
559 uint64_t workspace_handle = 0;
560 std::vector<uint8_t> snapshot;
561 bool available =
true;
562 bool initially_saved =
false;
563 std::string unavailable_reason;
567 uint64_t workspace_handle = 0;
568 std::vector<uint8_t> before_snapshot;
569 std::vector<uint8_t> after_snapshot;
571 std::string node_name;
572 HistoryOperation operation = HistoryOperation::change_value;
574 std::string previous_value;
575 std::string current_value;
579 uint64_t workspace_handle = 0;
580 uint64_t request = 0;
581 std::vector<uint8_t> snapshot;
585 uint64_t workspace_handle = 0;
586 uint64_t request = 0;
587 bool success =
false;
592 uint64_t workspace_handle = 0;
593 uint64_t request = 0;
594 bool is_merge =
false;
595 std::vector<uint8_t> base_snapshot;
596 std::vector<uint8_t> current_snapshot;
597 std::vector<uint8_t> incoming_snapshot;
601 uint64_t workspace_handle = 0;
602 uint64_t request = 0;
603 bool success =
false;
604 std::vector<uint8_t> snapshot;
609 uint64_t workspace_handle = 0;
610 bool available =
true;
611 std::string unavailable_reason;
612 uint64_t current_revision = 0;
613 bool is_dirty =
false;
614 bool transaction_open =
false;
615 std::vector<HistoryRevision> revisions;
619 uint64_t workspace_handle = 0;
623 uint64_t workspace_handle = 0;
627 uint64_t workspace_handle = 0;
631 uint64_t workspace_handle = 0;
632 uint64_t revision = 0;
636 uint64_t workspace_handle = 0;
637 uint64_t revision = 0;
641 uint64_t workspace_handle = 0;
642 uint64_t revision = 0;
646 enum class Phase : uint8_t {
651 uint64_t workspace_handle = 0;
652 uint64_t transaction = 0;
653 Phase phase = Phase::begin;
654 HistoryOperation operation = HistoryOperation::change_value;
659enum class HistoryConflictKind : uint8_t {
673 std::string node_name;
674 HistoryConflictKind kind = HistoryConflictKind::value;
676 uint32_t value_type = 0;
677 bool is_array =
false;
678 std::string ref_type;
679 std::string base_value;
680 std::string current_value;
681 std::string incoming_value;
685 uint64_t workspace_handle = 0;
686 uint64_t request = 0;
687 bool is_merge =
false;
688 uint64_t source_revision = 0;
689 std::vector<HistoryConflict> conflicts;
693 enum class Choice : uint8_t {
699 uint64_t conflict = 0;
700 Choice choice = Choice::current;
701 std::string custom_value;
705 uint64_t workspace_handle = 0;
706 uint64_t request = 0;
708 std::vector<HistoryConflictResolution> resolutions;
Intrusive reference-counted handle to a Node.
Definition box.hpp:35
Base object type for the scene graph.
Requests a single RenderDoc frame capture around the next rendered frame, sent on F12 in the viewport...
Definition workspace_events.hpp:397
Definition workspace_events.hpp:49
Definition workspace_events.hpp:692
Definition workspace_events.hpp:670
Definition workspace_events.hpp:546
Definition workspace_events.hpp:474
Definition workspace_events.hpp:495
Definition workspace_events.hpp:501
Definition workspace_events.hpp:490
Definition workspace_events.hpp:165
Definition workspace_events.hpp:290
Definition workspace_events.hpp:210
std::vector< VoxelProjectionData > projections
front, side, top
Definition workspace_events.hpp:214
Definition workspace_events.hpp:46
Definition workspace_events.hpp:618
Definition workspace_events.hpp:302
Definition workspace_events.hpp:284
Definition workspace_events.hpp:276
Definition workspace_events.hpp:20
Definition workspace_events.hpp:608
Definition workspace_events.hpp:272
Definition workspace_events.hpp:266
Definition workspace_events.hpp:252
Definition workspace_events.hpp:261
Definition workspace_events.hpp:223
Definition workspace_events.hpp:233
Definition workspace_events.hpp:187
Definition workspace_events.hpp:199
std::vector< uint8_t > colors
rgba, alpha 0 is empty
Definition workspace_events.hpp:204
std::vector< uint8_t > edges_v
rgba, width x (height + 1)
Definition workspace_events.hpp:207
std::vector< uint8_t > edges_h
rgba, (width + 1) x height, alpha 0 is no line
Definition workspace_events.hpp:206
Definition workspace_events.hpp:246
Definition workspace_events.hpp:217
Definition workspace_events.hpp:240
Definition workspace_events.hpp:578
Definition workspace_events.hpp:630
Definition workspace_events.hpp:635
Definition workspace_events.hpp:175
Definition workspace_events.hpp:157
Definition workspace_events.hpp:152
Definition workspace_events.hpp:566
Definition workspace_events.hpp:684
Definition workspace_events.hpp:558
Definition workspace_events.hpp:600
Definition workspace_events.hpp:584
Definition workspace_events.hpp:645
Definition workspace_events.hpp:640
Definition workspace_events.hpp:161
Definition workspace_events.hpp:591
Definition workspace_events.hpp:626
Definition workspace_events.hpp:704
Definition workspace_events.hpp:113
Definition workspace_events.hpp:622
Unique identifier for everything that exists in our engine.