Skip to content

Commit

Permalink
[designer] Add jml_tools module
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Oct 23, 2023
1 parent 83ff43e commit 94d39c5
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 28 deletions.
9 changes: 5 additions & 4 deletions tools/jml-designer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@ set(sources
"Component/ValuePropertyComponent.cpp"
"Component/ValuePropertyComponent.hpp"

"Core/Color.cpp"
"Core/Color.hpp"
"Core/Justification.cpp"
"Core/Justification.hpp"
"Core/ValueTree.cpp"
"Core/ValueTree.hpp"
"Core/ValueTreeObject.hpp"
"Core/ValueTreeObjectList.hpp"

Expand Down Expand Up @@ -139,7 +135,12 @@ target_include_directories(jml-designer
target_link_libraries(jml-designer
PRIVATE
juce::juce_gui_extra
jml::jml_tools

PUBLIC
lua::lua
sol2::sol2

JMLDesigner_BinaryData
juce::juce_recommended_warning_flags
)
3 changes: 1 addition & 2 deletions tools/jml-designer/Component/ColorPropertyComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "ColorPropertyComponent.hpp"

#include "Core/Color.hpp"
#include "Core/ValueTree.hpp"
#include <jml_tools/jml_tools.hpp>

namespace jml::designer {

Expand Down
2 changes: 1 addition & 1 deletion tools/jml-designer/Core/Justification.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Justification.hpp"

#include "Core/ValueTree.hpp"
#include <jml_tools/jml_tools.hpp>

namespace jml::designer {

Expand Down
3 changes: 2 additions & 1 deletion tools/jml-designer/Document/Document.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "Document.hpp"

#include "Core/ValueTree.hpp"
#include "Layers/GroupLayer.hpp"
#include "Layers/ShapeLayer.hpp"
#include "Layers/TextLayer.hpp"

#include <jml_tools/jml_tools.hpp>

namespace jml::designer {

Document::Document(juce::ValueTree valueTree, juce::UndoManager* um)
Expand Down
3 changes: 2 additions & 1 deletion tools/jml-designer/Layer/Export/ExportPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "ExportPanel.hpp"

#include "Component/PropertyPanel.hpp"
#include "Core/ValueTree.hpp"

#include <jml_tools/jml_tools.hpp>

namespace jml::designer {

Expand Down
2 changes: 1 addition & 1 deletion tools/jml-designer/Layer/Export/ExportPanel.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "Core/ValueTree.hpp"
#include "Layer/Export/ImageExporter.hpp"
#include "Layer/LayerSelection.hpp"

#include <jml_tools/jml_tools.hpp>
#include <juce_gui_basics/juce_gui_basics.h>

namespace jml::designer {
Expand Down
4 changes: 2 additions & 2 deletions tools/jml-designer/Layer/Layer.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "Layer.hpp"

#include "Component/PropertyPanel.hpp"
#include "Core/Color.hpp"
#include "Core/ValueTree.hpp"

#include <jml_tools/jml_tools.hpp>

namespace jml::designer {

Expand Down
4 changes: 2 additions & 2 deletions tools/jml-designer/Layers/TextLayer.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "TextLayer.hpp"

#include "Component/PropertyPanel.hpp"
#include "Core/Color.hpp"
#include "Core/Justification.hpp"
#include "Core/ValueTree.hpp"

#include <jml_tools/jml_tools.hpp>

namespace jml::designer {

Expand Down
4 changes: 2 additions & 2 deletions tools/jml-designer/Tool/ShapeTool.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "ShapeTool.hpp"

#include "Core/Color.hpp"
#include "Core/ValueTree.hpp"
#include "Document/DocumentCanvas.hpp"
#include "Layers/ShapeLayer.hpp"

#include <jml_tools/jml_tools.hpp>

namespace jml::designer {

ShapeTool::ShapeTool(DocumentCanvas& c, Shape shape) noexcept : Tool{c}, _shape{shape}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include "Color.hpp"

auto juce::VariantConverter<juce::Colour>::fromVar(juce::var const& v) -> juce::Colour
{
return juce::Colour::fromString(v.toString());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include <juce_graphics/juce_graphics.h>

template<>
struct juce::VariantConverter<juce::Colour>
{
Expand Down
2 changes: 2 additions & 0 deletions tools/jml_tools/jml_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

#include "BinaryData.hpp"

#include "graphics/Color.cpp" // NOLINT
#include "graphics/Drawable.cpp" // NOLINT
#include "value/ValueTree.cpp" // NOLINT
2 changes: 2 additions & 0 deletions tools/jml_tools/jml_tools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ END_JUCE_MODULE_DECLARATION

#include <lua_juce/lua_juce.hpp>

#include "graphics/Color.hpp"
#include "graphics/Drawable.hpp"
#include "value/ValueTree.hpp"
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "ValueTree.hpp"

namespace jml::designer {
namespace jml {

auto loadValueTree(juce::File const& file, bool asXml) -> juce::ValueTree
{
Expand Down Expand Up @@ -42,4 +40,4 @@ auto saveValueTree(juce::ValueTree const& v, juce::File const& file, bool asXml)
return false;
}

} // namespace jml::designer
} // namespace jml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#pragma once

#include <juce_data_structures/juce_data_structures.h>

namespace jml::designer {
namespace jml {

template<typename T>
[[nodiscard]] auto toVar(T const& v) -> juce::var
Expand All @@ -25,4 +23,4 @@ template<typename T>
[[nodiscard]] auto loadValueTree(juce::File const& file, bool asXml) -> juce::ValueTree;
auto saveValueTree(juce::ValueTree const& v, juce::File const& file, bool asXml) -> bool;

} // namespace jml::designer
} // namespace jml

0 comments on commit 94d39c5

Please sign in to comment.