diff --git a/Cool b/Cool index 8d8fc39f5..bdc876b04 160000 --- a/Cool +++ b/Cool @@ -1 +1 @@ -Subproject commit 8d8fc39f5dfa8cbc88cfbb846ff5615d68d224bc +Subproject commit bdc876b04dad0aa0dee8b19d7c8d73e135c9ef42 diff --git a/lib/cmd b/lib/cmd index 86cd6cc03..bc8a39f6a 160000 --- a/lib/cmd +++ b/lib/cmd @@ -1 +1 @@ -Subproject commit 86cd6cc03ec2790917f0f8d2822fee47dfa51892 +Subproject commit bc8a39f6a0c6392ea1242475f8b560a4c535c227 diff --git a/src/App.h b/src/App.h index aa7bbd06d..6e421ffa8 100644 --- a/src/App.h +++ b/src/App.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include "CommandCore/CommandExecutor_TopLevel.h" #include "CommandCore/CommandExecutor_WithoutHistory_Ref.h" #include "CommandCore/ReversibleCommandExecutor_WithoutHistory_Ref.h" @@ -116,18 +116,18 @@ class App : public Cool::IApp { private: // Serialization - friend class cereal::access; + friend class ser20::access; template static void serialize_impl(Archive& archive, AppT&& app) // Template to allow us to use it for both App& and App const&. { archive( - cereal::make_nvp("Recently opened projects", app._recently_opened_projects), - cereal::make_nvp("Gallery Poster", app._gallery_poster), - cereal::make_nvp("Tips", app._tips_manager), - cereal::make_nvp("Output view", app._output_view), - cereal::make_nvp("Webcams config", Cool::WebcamsConfigs::instance()), - cereal::make_nvp("MIDI config", Cool::midi_manager()), - cereal::make_nvp("OSC config", Cool::osc_manager()) + ser20::make_nvp("Recently opened projects", app._recently_opened_projects), + ser20::make_nvp("Gallery Poster", app._gallery_poster), + ser20::make_nvp("Tips", app._tips_manager), + ser20::make_nvp("Output view", app._output_view), + ser20::make_nvp("Webcams config", Cool::WebcamsConfigs::instance()), + ser20::make_nvp("MIDI config", Cool::midi_manager()), + ser20::make_nvp("OSC config", Cool::osc_manager()) ); } template diff --git a/src/CommandCore/LAB_REGISTER_COMMAND.h b/src/CommandCore/LAB_REGISTER_COMMAND.h index cf188a789..9ade50846 100644 --- a/src/CommandCore/LAB_REGISTER_COMMAND.h +++ b/src/CommandCore/LAB_REGISTER_COMMAND.h @@ -1,9 +1,8 @@ #pragma once - -#include -#include +#include +#include #include "CommandCore/PolymorphicCommand.h" -#define LAB_REGISTER_COMMAND(CommandType) \ - CEREAL_REGISTER_TYPE(Lab::PolymorphicCommand) \ - CEREAL_REGISTER_POLYMORPHIC_RELATION(Lab::ICommand, Lab::PolymorphicCommand) +#define LAB_REGISTER_COMMAND(CommandType) \ + SER20_REGISTER_TYPE(Lab::PolymorphicCommand) \ + SER20_REGISTER_POLYMORPHIC_RELATION(Lab::ICommand, Lab::PolymorphicCommand) diff --git a/src/CommandCore/LAB_REGISTER_REVERSIBLE_COMMAND.h b/src/CommandCore/LAB_REGISTER_REVERSIBLE_COMMAND.h index 4907fec59..96195deb6 100644 --- a/src/CommandCore/LAB_REGISTER_REVERSIBLE_COMMAND.h +++ b/src/CommandCore/LAB_REGISTER_REVERSIBLE_COMMAND.h @@ -1,9 +1,8 @@ #pragma once - -#include -#include +#include +#include #include "CommandCore/PolymorphicReversibleCommand.h" -#define LAB_REGISTER_REVERSIBLE_COMMAND(CommandType) \ - CEREAL_REGISTER_TYPE(Lab::PolymorphicReversibleCommand) \ - CEREAL_REGISTER_POLYMORPHIC_RELATION(Lab::IReversibleCommand, Lab::PolymorphicReversibleCommand) +#define LAB_REGISTER_REVERSIBLE_COMMAND(CommandType) \ + SER20_REGISTER_TYPE(Lab::PolymorphicReversibleCommand) \ + SER20_REGISTER_POLYMORPHIC_RELATION(Lab::IReversibleCommand, Lab::PolymorphicReversibleCommand) diff --git a/src/CommandCore/PolymorphicReversibleCommand.h b/src/CommandCore/PolymorphicReversibleCommand.h index 5b3203479..6b59c0bc6 100644 --- a/src/CommandCore/PolymorphicReversibleCommand.h +++ b/src/CommandCore/PolymorphicReversibleCommand.h @@ -47,7 +47,7 @@ class PolymorphicReversibleCommand final : public IReversibleCommand { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { diff --git a/src/Commands/Command_AddLink.h b/src/Commands/Command_AddLink.h index 09061e1cb..be6f99d1d 100644 --- a/src/Commands/Command_AddLink.h +++ b/src/Commands/Command_AddLink.h @@ -18,13 +18,13 @@ struct Command_AddLink { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Link id", link_id), - cereal::make_nvp("Link", link) + ser20::make_nvp("Link id", link_id), + ser20::make_nvp("Link", link) ); } }; @@ -39,12 +39,12 @@ struct ReversibleCommand_AddLink { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd) + ser20::make_nvp("Forward", fwd) ); } }; diff --git a/src/Commands/Command_AddNode.h b/src/Commands/Command_AddNode.h index c6122a983..78c8e9131 100644 --- a/src/Commands/Command_AddNode.h +++ b/src/Commands/Command_AddNode.h @@ -18,13 +18,13 @@ struct Command_AddNode { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Node id", node_id), - cereal::make_nvp("Node", node) + ser20::make_nvp("Node id", node_id), + ser20::make_nvp("Node", node) ); } }; @@ -39,12 +39,12 @@ struct ReversibleCommand_AddNode { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd) + ser20::make_nvp("Forward", fwd) ); } }; diff --git a/src/Commands/Command_ChangeNodeDefinition.h b/src/Commands/Command_ChangeNodeDefinition.h index 88cfcb301..5629bfb7f 100644 --- a/src/Commands/Command_ChangeNodeDefinition.h +++ b/src/Commands/Command_ChangeNodeDefinition.h @@ -18,13 +18,13 @@ struct Command_ChangeNodeDefinition { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Node id", node_id), - cereal::make_nvp("New value", new_value) + ser20::make_nvp("Node id", node_id), + ser20::make_nvp("New value", new_value) ); } }; @@ -40,13 +40,13 @@ struct ReversibleCommand_ChangeNodeDefinition { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd), - cereal::make_nvp("Old value", old_value) + ser20::make_nvp("Forward", fwd), + ser20::make_nvp("Old value", old_value) ); } }; diff --git a/src/Commands/Command_FinishedEditingVariable.h b/src/Commands/Command_FinishedEditingVariable.h index cc699ea46..a78ca3a70 100644 --- a/src/Commands/Command_FinishedEditingVariable.h +++ b/src/Commands/Command_FinishedEditingVariable.h @@ -20,7 +20,7 @@ struct Command_FinishedEditingVariable { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive&) { diff --git a/src/Commands/Command_OpenImageExporter.h b/src/Commands/Command_OpenImageExporter.h index 389e40d6d..28ffa2977 100644 --- a/src/Commands/Command_OpenImageExporter.h +++ b/src/Commands/Command_OpenImageExporter.h @@ -16,7 +16,7 @@ struct Command_OpenImageExporter { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive&) { diff --git a/src/Commands/Command_OpenVideoExporter.h b/src/Commands/Command_OpenVideoExporter.h index 3007d904a..3cdf3e711 100644 --- a/src/Commands/Command_OpenVideoExporter.h +++ b/src/Commands/Command_OpenVideoExporter.h @@ -16,7 +16,7 @@ struct Command_OpenVideoExporter { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive&) { diff --git a/src/Commands/Command_RemoveLink.h b/src/Commands/Command_RemoveLink.h index cf312d38c..6d6fc7aab 100644 --- a/src/Commands/Command_RemoveLink.h +++ b/src/Commands/Command_RemoveLink.h @@ -18,13 +18,13 @@ struct Command_RemoveLink { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Link id", link_id), - cereal::make_nvp("Link", link) + ser20::make_nvp("Link id", link_id), + ser20::make_nvp("Link", link) ); } }; @@ -39,12 +39,12 @@ struct ReversibleCommand_RemoveLink { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd) + ser20::make_nvp("Forward", fwd) ); } }; diff --git a/src/Commands/Command_RemoveNode.h b/src/Commands/Command_RemoveNode.h index dcc6fb04a..8ce31a8a4 100644 --- a/src/Commands/Command_RemoveNode.h +++ b/src/Commands/Command_RemoveNode.h @@ -18,13 +18,13 @@ struct Command_RemoveNode { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Node id", node_id), - cereal::make_nvp("Node", node) + ser20::make_nvp("Node id", node_id), + ser20::make_nvp("Node", node) ); } }; @@ -40,13 +40,13 @@ struct ReversibleCommand_RemoveNode { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd), - cereal::make_nvp("Node position", node_pos) + ser20::make_nvp("Forward", fwd), + ser20::make_nvp("Node position", node_pos) ); } }; diff --git a/src/Commands/Command_SetMainNodeId.h b/src/Commands/Command_SetMainNodeId.h index f70e3cb0e..60119fcba 100644 --- a/src/Commands/Command_SetMainNodeId.h +++ b/src/Commands/Command_SetMainNodeId.h @@ -16,12 +16,12 @@ struct Command_SetMainNodeId { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Main node id", main_node_id) + ser20::make_nvp("Main node id", main_node_id) ); } }; @@ -37,13 +37,13 @@ struct ReversibleCommand_SetMainNodeId { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd), - cereal::make_nvp("Old main node id", old_main_node_id) + ser20::make_nvp("Forward", fwd), + ser20::make_nvp("Old main node id", old_main_node_id) ); } }; diff --git a/src/Commands/Command_SetVariable.h b/src/Commands/Command_SetVariable.h index a183457d1..6655a5562 100644 --- a/src/Commands/Command_SetVariable.h +++ b/src/Commands/Command_SetVariable.h @@ -65,13 +65,13 @@ struct Command_SetVariable { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Variable ref", var_ref), - cereal::make_nvp("Value", value) + ser20::make_nvp("Variable ref", var_ref), + ser20::make_nvp("Value", value) ); } }; @@ -109,13 +109,13 @@ struct ReversibleCommand_SetVariable { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd), - cereal::make_nvp("Old value", old_value) + ser20::make_nvp("Forward", fwd), + ser20::make_nvp("Old value", old_value) ); } }; diff --git a/src/Commands/Command_SetVariableDefaultMetadata.h b/src/Commands/Command_SetVariableDefaultMetadata.h index 07afc5a57..4abaa3900 100644 --- a/src/Commands/Command_SetVariableDefaultMetadata.h +++ b/src/Commands/Command_SetVariableDefaultMetadata.h @@ -35,13 +35,13 @@ struct Command_SetVariableDefaultMetadata { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Variable ref", var_ref), - cereal::make_nvp("Default metadata", default_metadata) + ser20::make_nvp("Variable ref", var_ref), + ser20::make_nvp("Default metadata", default_metadata) ); } }; @@ -73,13 +73,13 @@ struct ReversibleCommand_SetVariableDefaultMetadata { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd), - cereal::make_nvp("Old default metadata", old_default_metadata) + ser20::make_nvp("Forward", fwd), + ser20::make_nvp("Old default metadata", old_default_metadata) ); } }; diff --git a/src/Commands/Command_SetVariableDefaultValue.h b/src/Commands/Command_SetVariableDefaultValue.h index 16afd832c..7141980ae 100644 --- a/src/Commands/Command_SetVariableDefaultValue.h +++ b/src/Commands/Command_SetVariableDefaultValue.h @@ -36,13 +36,13 @@ struct Command_SetVariableDefaultValue { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Variable ref", var_ref), - cereal::make_nvp("Default value", default_value) + ser20::make_nvp("Variable ref", var_ref), + ser20::make_nvp("Default value", default_value) ); } }; @@ -74,13 +74,13 @@ struct ReversibleCommand_SetVariableDefaultValue { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd), - cereal::make_nvp("Old default value", old_default_value) + ser20::make_nvp("Forward", fwd), + ser20::make_nvp("Old default value", old_default_value) ); } }; diff --git a/src/Commands/Command_SetVariableMetadata.h b/src/Commands/Command_SetVariableMetadata.h index 1658dd1f8..7cf458429 100644 --- a/src/Commands/Command_SetVariableMetadata.h +++ b/src/Commands/Command_SetVariableMetadata.h @@ -35,13 +35,13 @@ struct Command_SetVariableMetadata { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Variable ref", var_ref), - cereal::make_nvp("Metadata", metadata) + ser20::make_nvp("Variable ref", var_ref), + ser20::make_nvp("Metadata", metadata) ); } }; @@ -73,13 +73,13 @@ struct ReversibleCommand_SetVariableMetadata { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Forward", fwd), - cereal::make_nvp("Old metadata", old_metadata) + ser20::make_nvp("Forward", fwd), + ser20::make_nvp("Old metadata", old_metadata) ); } }; diff --git a/src/Commands/_README.md b/src/Commands/_README.md index 3b3599181..2f30eb82f 100644 --- a/src/Commands/_README.md +++ b/src/Commands/_README.md @@ -7,24 +7,24 @@ - Make it default-constructible by {}-intializing all the members of the struct - Define a ```cpp -namespace cereal { +namespace ser20 { template void serialize(Archive& archive, Lab::Command_SetValue& command) { - archive(cereal::make_nvp("Id", command.id), - cereal::make_nvp("Value", command.value)); + archive(ser20::make_nvp("Id", command.id), + ser20::make_nvp("Value", command.value)); } template void serialize(Archive& archive, Lab::ReversibleCommand_SetValue& command) { - archive(cereal::make_nvp("Id", command.forward_command.id), - cereal::make_nvp("Value", command.forward_command.value), - cereal::make_nvp("Old value", command.old_value)); + archive(ser20::make_nvp("Id", command.forward_command.id), + ser20::make_nvp("Value", command.forward_command.value), + ser20::make_nvp("Old value", command.old_value)); } -} // namespace cereal +} // namespace ser20 ``` diff --git a/src/Commands/generate_commands.py b/src/Commands/generate_commands.py index ff62d48d9..3845372e4 100644 --- a/src/Commands/generate_commands.py +++ b/src/Commands/generate_commands.py @@ -88,24 +88,24 @@ def command_set(cmd: SetterCommand): }} // namespace Lab -namespace cereal {{ +namespace ser20 {{ template void serialize(Archive& archive, Lab::Command_{cmd.name}& command) {{ - archive(cereal::make_nvp("{cmd.user_facing_name}", command.value)); + archive(ser20::make_nvp("{cmd.user_facing_name}", command.value)); }} template void serialize(Archive& archive, Lab::ReversibleCommand_{cmd.name}& command) {{ archive( - cereal::make_nvp("{cmd.user_facing_name}", command.forward_command.value), - cereal::make_nvp("Old {cmd.user_facing_name}", command.old_value) + ser20::make_nvp("{cmd.user_facing_name}", command.forward_command.value), + ser20::make_nvp("Old {cmd.user_facing_name}", command.old_value) ); }} -}} // namespace cereal +}} // namespace ser20 """ diff --git a/src/Commands/generated2/Command_SetCameraZoom.inl b/src/Commands/generated2/Command_SetCameraZoom.inl index a9b22ace8..1c96c93a7 100644 --- a/src/Commands/generated2/Command_SetCameraZoom.inl +++ b/src/Commands/generated2/Command_SetCameraZoom.inl @@ -70,21 +70,21 @@ inline auto Command_SetCameraZoom::make_reversible(const MakeReversibleCommandCo } // namespace Lab -namespace cereal { +namespace ser20 { template void serialize(Archive& archive, Lab::Command_SetCameraZoom& command) { - archive(cereal::make_nvp("camera zoom", command.value)); + archive(ser20::make_nvp("camera zoom", command.value)); } template void serialize(Archive& archive, Lab::ReversibleCommand_SetCameraZoom& command) { archive( - cereal::make_nvp("camera zoom", command.forward_command.value), - cereal::make_nvp("Old camera zoom", command.old_value) + ser20::make_nvp("camera zoom", command.forward_command.value), + ser20::make_nvp("Old camera zoom", command.old_value) ); } -} // namespace cereal +} // namespace ser20 diff --git a/src/Debug/generated/DebugOptions.inl b/src/Debug/generated/DebugOptions.inl index 3fa1c8f15..7bddab2d8 100644 --- a/src/Debug/generated/DebugOptions.inl +++ b/src/Debug/generated/DebugOptions.inl @@ -103,41 +103,41 @@ private: private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( #if DEBUG - cereal::make_nvp("Framerate window", show_framerate_window), - cereal::make_nvp("ImGui Demo window", show_imgui_demo_window), - cereal::make_nvp("Show history", show_history_window), - cereal::make_nvp("Show nodes and links registries", show_nodes_and_links_registries), - cereal::make_nvp("Log when rendering", log_when_rendering), - cereal::make_nvp("Log when updating particles", log_when_updating_particles), - cereal::make_nvp("Log when compiling nodes", log_when_compiling_nodes), - cereal::make_nvp("Log when parsing node definition", log_when_parsing_node_definition), - cereal::make_nvp("Log when executing a command", log_when_executing_a_command), - cereal::make_nvp("Log project-related events", log_project_related_events), - cereal::make_nvp("Show generated shader code", show_generated_shader_code), - cereal::make_nvp("Test all Variable Widgets", test_all_variable_widgets__window), - cereal::make_nvp("Test Shaders Compilation", test_shaders_compilation__window), - cereal::make_nvp("Open Empty Window", empty_window) + ser20::make_nvp("Framerate window", show_framerate_window), + ser20::make_nvp("ImGui Demo window", show_imgui_demo_window), + ser20::make_nvp("Show history", show_history_window), + ser20::make_nvp("Show nodes and links registries", show_nodes_and_links_registries), + ser20::make_nvp("Log when rendering", log_when_rendering), + ser20::make_nvp("Log when updating particles", log_when_updating_particles), + ser20::make_nvp("Log when compiling nodes", log_when_compiling_nodes), + ser20::make_nvp("Log when parsing node definition", log_when_parsing_node_definition), + ser20::make_nvp("Log when executing a command", log_when_executing_a_command), + ser20::make_nvp("Log project-related events", log_project_related_events), + ser20::make_nvp("Show generated shader code", show_generated_shader_code), + ser20::make_nvp("Test all Variable Widgets", test_all_variable_widgets__window), + ser20::make_nvp("Test Shaders Compilation", test_shaders_compilation__window), + ser20::make_nvp("Open Empty Window", empty_window) #else - cereal::make_nvp("Framerate window", show_framerate_window), - cereal::make_nvp("ImGui Demo window", show_imgui_demo_window), - cereal::make_nvp("Show history", show_history_window), - cereal::make_nvp("Show nodes and links registries", show_nodes_and_links_registries), - cereal::make_nvp("Log when rendering", log_when_rendering), - cereal::make_nvp("Log when updating particles", log_when_updating_particles), - cereal::make_nvp("Log when compiling nodes", log_when_compiling_nodes), - cereal::make_nvp("Log when parsing node definition", log_when_parsing_node_definition), - cereal::make_nvp("Log when executing a command", log_when_executing_a_command), - cereal::make_nvp("Log project-related events", log_project_related_events), - cereal::make_nvp("Show generated shader code", show_generated_shader_code), - cereal::make_nvp("Test all Variable Widgets", test_all_variable_widgets__window), - cereal::make_nvp("Test Shaders Compilation", test_shaders_compilation__window), - cereal::make_nvp("Open Empty Window", empty_window) + ser20::make_nvp("Framerate window", show_framerate_window), + ser20::make_nvp("ImGui Demo window", show_imgui_demo_window), + ser20::make_nvp("Show history", show_history_window), + ser20::make_nvp("Show nodes and links registries", show_nodes_and_links_registries), + ser20::make_nvp("Log when rendering", log_when_rendering), + ser20::make_nvp("Log when updating particles", log_when_updating_particles), + ser20::make_nvp("Log when compiling nodes", log_when_compiling_nodes), + ser20::make_nvp("Log when parsing node definition", log_when_parsing_node_definition), + ser20::make_nvp("Log when executing a command", log_when_executing_a_command), + ser20::make_nvp("Log project-related events", log_project_related_events), + ser20::make_nvp("Show generated shader code", show_generated_shader_code), + ser20::make_nvp("Test all Variable Widgets", test_all_variable_widgets__window), + ser20::make_nvp("Test Shaders Compilation", test_shaders_compilation__window), + ser20::make_nvp("Open Empty Window", empty_window) #endif ); diff --git a/src/Debug/generated/DebugOptionsCpp.inl b/src/Debug/generated/DebugOptionsCpp.inl index a89125fdb..6cc6efded 100644 --- a/src/Debug/generated/DebugOptionsCpp.inl +++ b/src/Debug/generated/DebugOptionsCpp.inl @@ -7,13 +7,13 @@ #include #include -#include +#include namespace Lab { void DebugOptions::save_to_file() { - Cool::Serialization::save( + Cool::Serialization::save( instance(), Cool::Path::user_data() / "debug-options-lab.json", "Debug Options" @@ -23,7 +23,7 @@ void DebugOptions::save_to_file() auto DebugOptions::load_debug_options() -> Instance { auto the_instance = Instance{}; - auto const err = Cool::Serialization::load(the_instance, Cool::Path::user_data() / "debug-options-lab.json"); + auto const err = Cool::Serialization::load(the_instance, Cool::Path::user_data() / "debug-options-lab.json"); std::ignore = err; // We don't care about preserving the backward compatibility of debug options. If we break it, we can ignore it. return the_instance; } diff --git a/src/Dependencies/Camera2DManager.h b/src/Dependencies/Camera2DManager.h index 030fefd59..4fcd83793 100644 --- a/src/Dependencies/Camera2DManager.h +++ b/src/Dependencies/Camera2DManager.h @@ -26,13 +26,13 @@ class Camera2DManager { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Camera", _camera), - cereal::make_nvp("Is editable in view", _is_editable_in_view) + ser20::make_nvp("Camera", _camera), + ser20::make_nvp("Is editable in view", _is_editable_in_view) ); } }; diff --git a/src/Dependencies/Camera3DManager.h b/src/Dependencies/Camera3DManager.h index 299ca01be..fcb676bf1 100644 --- a/src/Dependencies/Camera3DManager.h +++ b/src/Dependencies/Camera3DManager.h @@ -45,14 +45,14 @@ class Camera3DManager { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Camera", _camera), - cereal::make_nvp("View controller", _view_controller), - cereal::make_nvp("Is editable in view", _is_editable_in_view) + ser20::make_nvp("Camera", _camera), + ser20::make_nvp("View controller", _view_controller), + ser20::make_nvp("Is editable in view", _is_editable_in_view) ); } }; diff --git a/src/Dependencies/History.h b/src/Dependencies/History.h index 2087ee0c0..d9dd0e76a 100644 --- a/src/Dependencies/History.h +++ b/src/Dependencies/History.h @@ -1,7 +1,6 @@ #pragma once - #include -#include +#include #include "CommandCore/ReversibleCommand.h" namespace Lab { diff --git a/src/Gallery/ArtworkInfo.h b/src/Gallery/ArtworkInfo.h index c89347aa2..acd5e058d 100644 --- a/src/Gallery/ArtworkInfo.h +++ b/src/Gallery/ArtworkInfo.h @@ -10,13 +10,13 @@ struct ArtworkInfo { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Title", title), - cereal::make_nvp("Description", description) + ser20::make_nvp("Title", title), + ser20::make_nvp("Description", description) ); } }; diff --git a/src/Gallery/AuthorInfo.h b/src/Gallery/AuthorInfo.h index c1ad62564..c0a19ab3c 100644 --- a/src/Gallery/AuthorInfo.h +++ b/src/Gallery/AuthorInfo.h @@ -10,13 +10,13 @@ struct AuthorInfo { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Name", name), - cereal::make_nvp("Link", link) + ser20::make_nvp("Name", name), + ser20::make_nvp("Link", link) ); } }; diff --git a/src/Gallery/GalleryPoster.h b/src/Gallery/GalleryPoster.h index 6ecfc7f2a..682d5dd37 100644 --- a/src/Gallery/GalleryPoster.h +++ b/src/Gallery/GalleryPoster.h @@ -27,15 +27,15 @@ class GalleryPoster { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Artwork info", _artwork_info), - cereal::make_nvp("Author info", _author_info), - cereal::make_nvp("Legal info", _legal_info), - cereal::make_nvp("Aspect Ratio", _aspect_ratio) + ser20::make_nvp("Artwork info", _artwork_info), + ser20::make_nvp("Author info", _author_info), + ser20::make_nvp("Legal info", _legal_info), + ser20::make_nvp("Aspect Ratio", _aspect_ratio) ); } }; diff --git a/src/Gallery/LegalInfo.h b/src/Gallery/LegalInfo.h index 693553dfd..063c812af 100644 --- a/src/Gallery/LegalInfo.h +++ b/src/Gallery/LegalInfo.h @@ -13,12 +13,12 @@ struct LegalInfo { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Email", email) + ser20::make_nvp("Email", email) ); } }; diff --git a/src/Module/Module.h b/src/Module/Module.h index 694aae98b..d32048071 100644 --- a/src/Module/Module.h +++ b/src/Module/Module.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include #include "Dependencies/Ui.h" namespace Lab { @@ -37,7 +37,7 @@ class Module { _needs_to_rerender_flag.set_clean(); } virtual void imgui_windows(Ui_Ref) const = 0; /// The ui() method should be const, because it should only trigger commands, not modify internal values (allows us to handle history / re-rendering at a higher level). If you really need to mutate one of your member variables, mark it as `mutable`. - virtual void update(){}; + virtual void update() {}; [[nodiscard]] virtual auto needs_to_rerender() const -> bool { @@ -57,13 +57,13 @@ class Module { Cool::DirtyFlag _needs_to_rerender_flag; private: - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Name", _name), - cereal::make_nvp("Dirty Flag: needs to rerender", _needs_to_rerender_flag) + ser20::make_nvp("Name", _name), + ser20::make_nvp("Dirty Flag: needs to rerender", _needs_to_rerender_flag) ); } }; diff --git a/src/Module_Compositing/Module_Compositing.h b/src/Module_Compositing/Module_Compositing.h index 8173e58e5..24ae8f894 100644 --- a/src/Module_Compositing/Module_Compositing.h +++ b/src/Module_Compositing/Module_Compositing.h @@ -49,12 +49,12 @@ class Module_Compositing : public Module { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Base Module", cereal::base_class(this)) + ser20::make_nvp("Base Module", ser20::base_class(this)) ); } }; diff --git a/src/Module_Particles/Module_Particles.h b/src/Module_Particles/Module_Particles.h index 86e121252..9e8d9ef05 100644 --- a/src/Module_Particles/Module_Particles.h +++ b/src/Module_Particles/Module_Particles.h @@ -58,12 +58,12 @@ class Module_Particles : public Module { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Base Module", cereal::base_class(this)) + ser20::make_nvp("Base Module", ser20::base_class(this)) ); } }; diff --git a/src/ModulesGraph/DirtyFlags.h b/src/ModulesGraph/DirtyFlags.h index 36050170d..f90fe19b8 100644 --- a/src/ModulesGraph/DirtyFlags.h +++ b/src/ModulesGraph/DirtyFlags.h @@ -13,13 +13,13 @@ struct DirtyFlags { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Rerender", rerender), - cereal::make_nvp("Regenerate code", regenerate_code) + ser20::make_nvp("Rerender", rerender), + ser20::make_nvp("Regenerate code", regenerate_code) ); } }; diff --git a/src/ModulesGraph/ModulesGraph.h b/src/ModulesGraph/ModulesGraph.h index e5b7d6340..9c9cf3723 100644 --- a/src/ModulesGraph/ModulesGraph.h +++ b/src/ModulesGraph/ModulesGraph.h @@ -29,12 +29,12 @@ struct ModulesGraphNode { Cool::RenderTarget render_target{}; private: - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Module", module) + ser20::make_nvp("Module", module) ); } }; @@ -102,16 +102,16 @@ class ModulesGraph { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Compositing module", _compositing_module), - cereal::make_nvp("Particles module", _particles_module_nodes), - cereal::make_nvp("Dirty flags", _dirty_flags), - cereal::make_nvp("Node editor", _nodes_editor), - cereal::make_nvp("Main node ID", _main_node_id) + ser20::make_nvp("Compositing module", _compositing_module), + ser20::make_nvp("Particles module", _particles_module_nodes), + ser20::make_nvp("Dirty flags", _dirty_flags), + ser20::make_nvp("Node editor", _nodes_editor), + ser20::make_nvp("Main node ID", _main_node_id) ); } }; diff --git a/src/Nodes/Node.h b/src/Nodes/Node.h index 3e881134b..e1c8ceda0 100644 --- a/src/Nodes/Node.h +++ b/src/Nodes/Node.h @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include "Cool/Nodes/NodeDefinitionIdentifier.h" namespace Lab { @@ -19,18 +19,18 @@ struct NodePodPart { std::optional particles_count{}; // HACK Only used in the case of a Particle Initializer node private: - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Name", name), - cereal::make_nvp("Definition", id_names), - cereal::make_nvp("Input Pins", input_pins), - cereal::make_nvp("Output Pins", output_pins), - cereal::make_nvp("Number of main input pins", number_of_main_input_pins), - cereal::make_nvp("Number of function inputs", number_of_function_inputs), - cereal::make_nvp("Particle count", particles_count) + ser20::make_nvp("Name", name), + ser20::make_nvp("Definition", id_names), + ser20::make_nvp("Input Pins", input_pins), + ser20::make_nvp("Output Pins", output_pins), + ser20::make_nvp("Number of main input pins", number_of_main_input_pins), + ser20::make_nvp("Number of function inputs", number_of_function_inputs), + ser20::make_nvp("Particle count", particles_count) ); } }; @@ -41,13 +41,13 @@ struct NodeAsPOD { std::vector value_inputs{}; private: - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("POD part", pod_part), - cereal::make_nvp("Value inputs", value_inputs) + ser20::make_nvp("POD part", pod_part), + ser20::make_nvp("Value inputs", value_inputs) ); } }; @@ -57,10 +57,10 @@ class Node { Node() = default; Node(Cool::NodeDefinitionIdentifier const& id_names, size_t number_of_main_input_pins, size_t number_of_function_inputs) : _d{ - .id_names = id_names, - .number_of_main_input_pins = number_of_main_input_pins, - .number_of_function_inputs = number_of_function_inputs, - } + .id_names = id_names, + .number_of_main_input_pins = number_of_main_input_pins, + .number_of_function_inputs = number_of_function_inputs, + } {} explicit Node(NodePodPart const& pod_part) : _d{pod_part} @@ -116,13 +116,13 @@ class Node { // NB: when adding data to Node, add it to NodePodPart if it is some pod data. Otherwise add it here but you then also need to add it to NodeAsPOD too, and to as_pod(), and to the constructor that takes NodeAsPOD, and to paste_nodes() of NodesConfig. private: - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("POD part", _d), - cereal::make_nvp("Value inputs", _value_inputs) + ser20::make_nvp("POD part", _d), + ser20::make_nvp("Value inputs", _value_inputs) ); } }; diff --git a/src/Nodes/NodesCategoryConfig.h b/src/Nodes/NodesCategoryConfig.h index 53a32a7ef..4b3cb2ba6 100644 --- a/src/Nodes/NodesCategoryConfig.h +++ b/src/Nodes/NodesCategoryConfig.h @@ -29,13 +29,13 @@ class NodesCategoryConfig { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Color", _nodes_kind), - cereal::make_nvp("Number of main input pins", _number_of_main_input_pins) + ser20::make_nvp("Color", _nodes_kind), + ser20::make_nvp("Number of main input pins", _number_of_main_input_pins) ); } }; diff --git a/src/Nodes/NodesClipboard.h b/src/Nodes/NodesClipboard.h index f5fb353a0..d99d6dbd5 100644 --- a/src/Nodes/NodesClipboard.h +++ b/src/Nodes/NodesClipboard.h @@ -10,13 +10,13 @@ struct NodeInClipboard { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Node", node_as_pod), - cereal::make_nvp("Position", position) + ser20::make_nvp("Node", node_as_pod), + ser20::make_nvp("Position", position) ); } }; @@ -27,13 +27,13 @@ struct NodesClipboard { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("Nodes", nodes), - cereal::make_nvp("Links", links) + ser20::make_nvp("Nodes", nodes), + ser20::make_nvp("Links", links) ); } }; diff --git a/src/Project.h b/src/Project.h index 1124bb1e7..f97bd4e9a 100644 --- a/src/Project.h +++ b/src/Project.h @@ -33,7 +33,7 @@ struct Project { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { @@ -42,17 +42,17 @@ struct Project { history.set_max_saved_size(0); // TODO HACK to avoid a crash when deserializing the history: https://github.com/orgs/CoolLibs/projects/1/views/1?pane=issue&itemId=46983814 #endif archive( - cereal::make_nvp("Coollab version", debug_info_coollab_version), // Must be first, purely informative, so that users can know what version of Coollab a project was built with. - cereal::make_nvp("Time", clock), - cereal::make_nvp("View Constraint", view_constraint), - cereal::make_nvp("Exporter (Image and Video)", exporter), - cereal::make_nvp("Camera 3D Manager", camera_3D_manager), - cereal::make_nvp("Camera 2D Manager", camera_2D_manager), - cereal::make_nvp("Modules Graph", modules_graph), - cereal::make_nvp("History", history), - cereal::make_nvp("Audio", audio), - cereal::make_nvp("OSC Endpoint", osc_endpoint), - cereal::make_nvp("MIDI Channels", Cool::midi_manager().all_values()) + ser20::make_nvp("Coollab version", debug_info_coollab_version), // Must be first, purely informative, so that users can know what version of Coollab a project was built with. + ser20::make_nvp("Time", clock), + ser20::make_nvp("View Constraint", view_constraint), + ser20::make_nvp("Exporter (Image and Video)", exporter), + ser20::make_nvp("Camera 3D Manager", camera_3D_manager), + ser20::make_nvp("Camera 2D Manager", camera_2D_manager), + ser20::make_nvp("Modules Graph", modules_graph), + ser20::make_nvp("History", history), + ser20::make_nvp("Audio", audio), + ser20::make_nvp("OSC Endpoint", osc_endpoint), + ser20::make_nvp("MIDI Channels", Cool::midi_manager().all_values()) ); } }; diff --git a/src/ProjectManager/Command_NewProject.h b/src/ProjectManager/Command_NewProject.h index 93a962ec6..fce9a6c34 100644 --- a/src/ProjectManager/Command_NewProject.h +++ b/src/ProjectManager/Command_NewProject.h @@ -10,9 +10,9 @@ struct Command_NewProject { } // namespace Lab -namespace cereal { +namespace ser20 { template void serialize(Archive&, Lab::Command_NewProject&) { } -} // namespace cereal +} // namespace ser20 diff --git a/src/ProjectManager/Command_OpenBackupProject.h b/src/ProjectManager/Command_OpenBackupProject.h index 7d8ae24a1..e00ccef5a 100644 --- a/src/ProjectManager/Command_OpenBackupProject.h +++ b/src/ProjectManager/Command_OpenBackupProject.h @@ -10,9 +10,9 @@ struct Command_OpenBackupProject { } // namespace Lab -namespace cereal { +namespace ser20 { template void serialize(Archive&, Lab::Command_OpenBackupProject&) { } -} // namespace cereal +} // namespace ser20 diff --git a/src/ProjectManager/Command_OpenProject.h b/src/ProjectManager/Command_OpenProject.h index 23af63eb2..ed3fd7e9c 100644 --- a/src/ProjectManager/Command_OpenProject.h +++ b/src/ProjectManager/Command_OpenProject.h @@ -12,9 +12,9 @@ struct Command_OpenProject { } // namespace Lab -namespace cereal { +namespace ser20 { template void serialize(Archive&, Lab::Command_OpenProject&) { } -} // namespace cereal +} // namespace ser20 diff --git a/src/ProjectManager/Command_PackageProjectInto.h b/src/ProjectManager/Command_PackageProjectInto.h index 77be2d5ae..25df4f7e9 100644 --- a/src/ProjectManager/Command_PackageProjectInto.h +++ b/src/ProjectManager/Command_PackageProjectInto.h @@ -12,9 +12,9 @@ struct Command_PackageProjectInto { } // namespace Lab -namespace cereal { +namespace ser20 { template void serialize(Archive&, Lab::Command_PackageProjectInto&) { } -} // namespace cereal +} // namespace ser20 diff --git a/src/ProjectManager/Command_SaveProject.h b/src/ProjectManager/Command_SaveProject.h index a54df481a..0c8b7a510 100644 --- a/src/ProjectManager/Command_SaveProject.h +++ b/src/ProjectManager/Command_SaveProject.h @@ -12,9 +12,9 @@ struct Command_SaveProject { } // namespace Lab -namespace cereal { +namespace ser20 { template void serialize(Archive&, Lab::Command_SaveProject&) { } -} // namespace cereal +} // namespace ser20 diff --git a/src/ProjectManager/Command_SaveProjectAs.h b/src/ProjectManager/Command_SaveProjectAs.h index 8de25e420..59f39a575 100644 --- a/src/ProjectManager/Command_SaveProjectAs.h +++ b/src/ProjectManager/Command_SaveProjectAs.h @@ -12,9 +12,9 @@ struct Command_SaveProjectAs { } // namespace Lab -namespace cereal { +namespace ser20 { template void serialize(Archive&, Lab::Command_SaveProjectAs&) { } -} // namespace cereal +} // namespace ser20 diff --git a/src/ProjectManager/RecentlyOpened.h b/src/ProjectManager/RecentlyOpened.h index b9385b635..0c3d8f57f 100644 --- a/src/ProjectManager/RecentlyOpened.h +++ b/src/ProjectManager/RecentlyOpened.h @@ -26,12 +26,12 @@ class RecentlyOpened { private: // Serialization - friend class cereal::access; + friend class ser20::access; template void serialize(Archive& archive) { archive( - cereal::make_nvp("List", _list) + ser20::make_nvp("List", _list) ); } }; diff --git a/src/Serialization/impl.cpp b/src/Serialization/impl.cpp index a4d4d7ee0..d857098f5 100644 --- a/src/Serialization/impl.cpp +++ b/src/Serialization/impl.cpp @@ -1,43 +1,43 @@ /// /// We put all our serialization here in a separate .cpp file -/// because including "cereal/archives/json.hpp" slows down +/// because including "ser20/archives/json.hpp" slows down /// compilation by A LOT. So we want to avoid recompiling /// this file as much as possible. /// -#include +#include #include "Cool/Serialization/Serialization.h" #include "SNodesCategoryConfig.h" #include "SNodesClipboard.h" #include "SProject.h" // -#include "cereal/archives/json.hpp" +#include "ser20/archives/json.hpp" namespace Lab { auto do_save(Project const& project, std::filesystem::path const& path) -> bool { - return Cool::Serialization::save(project, path, "Project"); + return Cool::Serialization::save(project, path, "Project"); } auto do_load(Project& project, std::filesystem::path const& path) -> Cool::OptionalErrorMessage { - return Cool::Serialization::load(project, path); + return Cool::Serialization::load(project, path); } auto do_save(NodesCategoryConfig const& config, std::filesystem::path const& path) -> bool { - return Cool::Serialization::save(config, path); + return Cool::Serialization::save(config, path); } auto do_load(NodesCategoryConfig& config, std::filesystem::path const& path) -> Cool::OptionalErrorMessage { - return Cool::Serialization::load(config, path); + return Cool::Serialization::load(config, path); } auto string_from_nodes_clipboard(NodesClipboard const& clipboard) -> std::string { auto ss = std::stringstream{}; { - auto archive = cereal::JSONOutputArchive{ss}; - archive(cereal::make_nvp("Coollab copied nodes, you can paste this in Coollab to paste the nodes.", clipboard)); + auto archive = ser20::JSONOutputArchive{ss}; + archive(ser20::make_nvp("Coollab copied nodes, you can paste this in Coollab to paste the nodes.", clipboard)); } // archive actual work happens during its destruction return ss.str(); } @@ -46,7 +46,7 @@ auto string_to_nodes_clipboard(std::string const& string) -> NodesClipboard auto clipboard = NodesClipboard{}; { auto ss = std::stringstream{string}; - auto archive = cereal::JSONInputArchive{ss}; + auto archive = ser20::JSONInputArchive{ss}; archive(clipboard); } // archive actual work happens during its destruction return clipboard; @@ -54,5 +54,5 @@ auto string_to_nodes_clipboard(std::string const& string) -> NodesClipboard } // namespace Lab -CEREAL_REGISTER_TYPE(Lab::Module_Compositing); // NOLINT -CEREAL_REGISTER_TYPE(Lab::Module_Particles); // NOLINT \ No newline at end of file +SER20_REGISTER_TYPE(Lab::Module_Compositing); // NOLINT +SER20_REGISTER_TYPE(Lab::Module_Particles); // NOLINT \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 5674279af..c5da654dd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,7 +3,7 @@ #include "Cool/Path/Path.h" #include "Cool/Path/PathsConfig.h" // -#include // Must be included last otherwise it slows down compilation because it includes +#include // Must be included last otherwise it slows down compilation because it includes class PathsConfig : public Cool::PathsConfig { public: