Skip to content

Commit

Permalink
Add core namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Oct 9, 2024
1 parent 411c99c commit 8f3f743
Show file tree
Hide file tree
Showing 324 changed files with 1,000 additions and 1,028 deletions.
12 changes: 8 additions & 4 deletions source/base/lib/inc/tactile/base/document/document.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
namespace tactile {

class IDocumentVisitor;

namespace core {
// These types are intentionally defined in core.
class UUID;
class Registry; // NB: This type is intentionally defined in core.
class Registry;
} // namespace core

/**
* Provides the basic document API.
Expand Down Expand Up @@ -87,13 +91,13 @@ class IDocument
* A registry.
*/
[[nodiscard]]
virtual auto get_registry() -> Registry& = 0;
virtual auto get_registry() -> core::Registry& = 0;

/**
* \copydoc get_registry()
*/
[[nodiscard]]
virtual auto get_registry() const -> const Registry& = 0;
virtual auto get_registry() const -> const core::Registry& = 0;

/**
* Returns the graphical size of the associated content.
Expand Down Expand Up @@ -129,7 +133,7 @@ class IDocument
* The associated UUID.
*/
[[nodiscard]]
virtual auto get_uuid() const -> const UUID& = 0;
virtual auto get_uuid() const -> const core::UUID& = 0;
};

} // namespace tactile
4 changes: 2 additions & 2 deletions source/core/lib/inc/tactile/core/cmd/command.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "tactile/base/prelude.hpp"

namespace tactile {
namespace tactile::core {

/**
* Represents editor actions that can be repeatedly executed and reverted.
Expand Down Expand Up @@ -59,4 +59,4 @@ class ICommand
}
};

} // namespace tactile
} // namespace tactile::core
4 changes: 2 additions & 2 deletions source/core/lib/inc/tactile/core/cmd/command_stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "tactile/base/prelude.hpp"
#include "tactile/core/cmd/command.hpp"

namespace tactile {
namespace tactile::core {

/**
* Manages a history of commands.
Expand Down Expand Up @@ -215,4 +215,4 @@ class CommandStack final
auto _get_next_command_index() const -> std::size_t;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -39,4 +39,4 @@ class CreateLayerCommand final : public ICommand
bool m_layer_was_added;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -39,4 +39,4 @@ class DuplicateLayerCommand final : public ICommand
bool m_layer_was_added;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -35,4 +35,4 @@ class MoveLayerDownCommand final : public ICommand
EntityID m_layer_id;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -35,4 +35,4 @@ class MoveLayerUpCommand final : public ICommand
EntityID m_layer_id;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -39,4 +39,4 @@ class RemoveLayerCommand final : public ICommand
bool m_layer_was_removed;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -41,4 +41,4 @@ class SetLayerOpacityCommand final : public ICommand
float m_old_opacity;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -38,4 +38,4 @@ class SetLayerVisibilityCommand final : public ICommand
bool m_old_visibility;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
#include <optional>
#include <string>

#include "tactile/base/document/document.hpp"
#include "tactile/base/meta/attribute.hpp"
#include "tactile/base/prelude.hpp"
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"
#include "tactile/core/util/uuid.hpp"

namespace tactile {

class IDocument;
namespace tactile::core {

/**
* A command for creating properties and adding them to meta contexts.
Expand Down Expand Up @@ -47,4 +46,4 @@ class CreatePropertyCommand final : public ICommand
Attribute m_value;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

#include <string> // string

#include "tactile/base/document/document.hpp"
#include "tactile/base/meta/attribute.hpp"
#include "tactile/base/prelude.hpp"
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {

class IDocument;
namespace tactile::core {

/**
* A command for removing properties from meta contexts.
Expand Down Expand Up @@ -41,4 +40,4 @@ class RemovePropertyCommand final : public ICommand
Attribute m_value;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

#include <string> // string

#include "tactile/base/document/document.hpp"
#include "tactile/base/prelude.hpp"
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {

class IDocument;
namespace tactile::core {

/**
* A command for renaming properties attached to meta contexts.
Expand Down Expand Up @@ -50,4 +49,4 @@ class RenamePropertyCommand final : public ICommand
void _rename_property(std::string_view from, std::string to);
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
#include "tactile/base/prelude.hpp"
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"
#include "tactile/base/document/document.hpp"

namespace tactile {

class IDocument;
namespace tactile::core {

/**
* A command for updating property values.
Expand Down Expand Up @@ -49,4 +48,4 @@ class UpdatePropertyCommand final : public ICommand
Attribute m_old_property_value;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -51,4 +51,4 @@ class CreateObjectCommand final : public ICommand
bool m_object_was_added;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

#pragma once

#include "tactile/base/document/document.hpp"
#include "tactile/base/numeric/vec.hpp"
#include "tactile/base/prelude.hpp"
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {

class IDocument;
namespace tactile::core {

/**
* A command for changing the position of objects.
Expand Down Expand Up @@ -39,4 +38,4 @@ class MoveObjectCommand final : public ICommand
Float2 m_old_position;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -41,4 +41,4 @@ class RemoveObjectCommand final : public ICommand
bool m_object_was_removed;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

#include <string> // string

#include "tactile/base/document/document.hpp"
#include "tactile/base/prelude.hpp"
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {

class IDocument;
namespace tactile::core {

/**
* A command for changing the type tag of objects.
Expand Down Expand Up @@ -43,4 +42,4 @@ class SetObjectTagCommand final : public ICommand
std::string m_old_tag;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

#pragma once

#include "tactile/base/document/document.hpp"
#include "tactile/base/prelude.hpp"
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {

class IDocument;
namespace tactile::core {

/**
* A command for changing the visibility of objects.
Expand Down Expand Up @@ -38,4 +37,4 @@ class SetObjectVisibilityCommand final : public ICommand
bool m_old_visibility;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "tactile/core/entity/entity.hpp"
#include "tactile/core/tile/tileset_spec.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -41,4 +41,4 @@ class AddTilesetCommand final : public ICommand
bool m_tileset_was_added;
};

} // namespace tactile
} // namespace tactile::core
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "tactile/core/cmd/command.hpp"
#include "tactile/core/entity/entity.hpp"

namespace tactile {
namespace tactile::core {

class MapDocument;

Expand Down Expand Up @@ -41,4 +41,4 @@ class RemoveTilesetCommand final : public ICommand
bool m_tileset_was_removed;
};

} // namespace tactile
} // namespace tactile::core
Loading

0 comments on commit 8f3f743

Please sign in to comment.