From 8e5615402d3a6e713d74d863c4c8d8fc86e15b6f Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Mon, 10 Apr 2023 11:12:06 +0200 Subject: [PATCH 01/16] made constructor of `Application` `protected` and removed unused constructor --- src/application.cpp | 22 ---------------------- src/application.hpp | 14 ++------------ 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index 8ec150dd..c752a8ea 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -11,33 +11,11 @@ Application::Application( m_renderer{ m_window }, m_command_line_arguments{ std::move(command_line_arguments) } { } -Application::Application( - const std::string& title, - int x, - int y, - int width, - int height, - CommandLineArguments command_line_arguments -) - : m_window{ title, x, y, width, height }, - m_renderer{ m_window }, - m_command_line_arguments{ std::move(command_line_arguments) } { } - Application::Application(const std::string& title, WindowPosition position, CommandLineArguments command_line_arguments) : m_window{ title, position }, m_renderer{ m_window }, m_command_line_arguments{ std::move(command_line_arguments) } { } -Application::Application( - const std::string& title, - int x, - int y, - CommandLineArguments command_line_arguments -) - : m_window{ title, x, y, }, - m_renderer{ m_window }, - m_command_line_arguments{ std::move(command_line_arguments) } { } - void Application::run() { const auto start_time = elapsed_time(); s_num_steps_simulated = 0; diff --git a/src/application.hpp b/src/application.hpp index 24eb599d..714bde10 100644 --- a/src/application.hpp +++ b/src/application.hpp @@ -20,7 +20,7 @@ struct Application : public EventListener { protected: EventDispatcher m_event_dispatcher; -public: +protected: Application( const std::string& title, WindowPosition position, @@ -29,19 +29,9 @@ struct Application : public EventListener { CommandLineArguments command_line_arguments ); - Application( - const std::string& title, - int x, - int y, - int width, - int height, - CommandLineArguments command_line_arguments - ); - Application(const std::string& title, WindowPosition position, CommandLineArguments command_line_arguments); - Application(const std::string& title, int x, int y, CommandLineArguments command_line_arguments); - +public: Application(const Application&) = delete; Application& operator=(const Application&) = delete; From 694df52be4df5963529f79b8bccfded558ac3752 Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Mon, 10 Apr 2023 19:23:06 +0200 Subject: [PATCH 02/16] added documentation to the `Application` struct --- src/application.hpp | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/application.hpp b/src/application.hpp index 714bde10..1aaf80c5 100644 --- a/src/application.hpp +++ b/src/application.hpp @@ -8,6 +8,10 @@ #include "types.hpp" #include "window.hpp" +/** + * @brief Abstract base for an application. Inherit from this struct to create an application and customize the + * behavior. Do not create multiple instances of this struct. + */ struct Application : public EventListener { private: SdlContext context; @@ -21,6 +25,14 @@ struct Application : public EventListener { EventDispatcher m_event_dispatcher; protected: + /** + * @brief Creates a new application. + * @param title The text in the window title bar. + * @param position The position where the window should spawn at. + * @param width The width of the window. + * @param height The height of the window. + * @param command_line_arguments The command line arguments. + */ Application( const std::string& title, WindowPosition position, @@ -35,30 +47,68 @@ struct Application : public EventListener { Application(const Application&) = delete; Application& operator=(const Application&) = delete; + /** + * @brief Starts the main game loop. + */ void run(); + /** + * @brief Obtains the renderer for this application's window. + * @return The renderer. + */ [[nodiscard]] const Renderer& renderer() const { return m_renderer; } + /** + * @brief Obtains the window for this application. + * @return The window. + */ [[nodiscard]] const Window& window() const { return m_window; } + /** + * @brief Returns the elapsed time (in seconds) since the SDL2 library has been initialized. + * @return The elapsed time in seconds. + */ static double elapsed_time() { return static_cast(SDL_GetTicks()) / 1000.0; } + /** + * @brief Returns the index of the current simulation step. The application tries to execute a certain number + * of simulation steps per second. This is specified in the command line arguments (passed to the constructor). + * @return The index of the current simulation step. + */ static u64 simulation_step_index() { return s_num_steps_simulated; } + /** + * @brief Implements the EventListener. If the escape key is pressed or the windows is closed, the application + * gets closed. + * @param event The SDL event to handle. + */ void handle_event(const SDL_Event& event) override; protected: + /** + * @brief This function gets called from within the main game loop (i.e. by the run() function). Override this + * function to specify what should be done in every simulation step. + */ virtual void update() = 0; + + /** + * @brief Clears the contents of the window with a black color. Override this function to render additional + * window contents. + */ virtual void render() const; + /** + * @brief Returns the CommandLineArguments instance passed to this struct's constructor. + * @return The command line arguments. + */ [[nodiscard]] const CommandLineArguments& command_line_arguments() const { return m_command_line_arguments; } From 8abb80fa3dccc9071a055b1495ec50e2feee0031 Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Wed, 12 Apr 2023 22:26:58 +0200 Subject: [PATCH 03/16] rebased onto main --- src/tetris_application.hpp | 97 +++++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/src/tetris_application.hpp b/src/tetris_application.hpp index 8a786886..b27bd17f 100644 --- a/src/tetris_application.hpp +++ b/src/tetris_application.hpp @@ -11,7 +11,11 @@ #include #include -struct TetrisApplication : public Application { +/** + * @brief This struct inherits from Application and implements the game's functionality. Instantiate this struct + * and call run() on it to start the main game loop. + */ +struct TetrisApplication final : public Application { private: using TetrionHeaders = std::vector; @@ -27,44 +31,135 @@ struct TetrisApplication : public Application { static constexpr int width = 800; static constexpr int height = 600; + /** + * @brief Constructs a TetrisApplication instance. + * @param command_line_arguments The command line arguments passed to the executable. + */ explicit TetrisApplication(CommandLineArguments command_line_arguments); protected: + /** + * @brief Calls the update() functions on all elements of m_inputs. + */ void update_inputs(); void late_update_inputs(); + + /** + * @brief Calls the update() functions on all elements of m_tetrions. + */ void update_tetrions(); + + /** + * @brief Updates all inputs and all tetrions. + */ void update() override; + + /** + * @brief Renders the contents of the window. + */ void render() const override; private: + /** + * @brief Creates an input from given controls. + * @param controls The controls (e.g. keyboard bindings) to apply for this control. + * @param associated_tetrion The tetrion that is targeted by this input. + * @param on_event_callback Callback that is invoked when an input event happens. + * @return The input. + */ [[nodiscard]] std::unique_ptr create_input(Controls controls, Tetrion* associated_tetrion, Input::OnEventCallback on_event_callback); [[nodiscard]] static std::unique_ptr create_replay_input( + /** + * @brief Creates an input that replays a recorded game. + * @param tetrion_index The index of the tetrion that is targeted by this input. + * @param recording_reader A pointer to the RecordingReader that holds the recorded game. + * @param associated_tetrion The tetrion that is targeted by this input. + * @param on_event_callback Callback that is invoked when an input event happens. + * @return The input. + */ + [[nodiscard]] static std::unique_ptr create_recording_input( u8 tetrion_index, RecordingReader* constrecording_reader, Tetrion *constassociated_tetrion, Input::OnEventCallback on_event_callback ); + /** + * @brief Creates a callback that can be passed to create_input() or create_recording_input(). If a game is being + * recorded, the returned callback stores all events in the associated RecordingWriter (m_recording_writer). + * Otherwise, a callback that does nothing is returned. + * @param tetrion_index The index of the tetrion that shall be recorded. + * @return The callback. + */ [[nodiscard]] Input::OnEventCallback create_on_event_callback(int tetrion_index); + /** + * @brief Tries to load the settings from settings.json and stores them into m_settings. Applies default + * values upon failure. + */ void try_load_settings(); + /** + * @brief Returns true if the path to a recorded game was specified as command line argument, false otherwise. + * @return Whether a replay shall be replayed. + */ [[nodiscard]] bool is_replay_mode() const; + /** + * @brief Returns true if the current game shall be recorded, false otherwise. The game shall be recorded if it's + * not replaying a recorded game. + * @return Whether the game shall be recorded. + */ [[nodiscard]] bool game_is_recorded() const; + /** + * @brief Returns the random seed to be used for a given tetrion. The choice is based on whether a recorded + * game is being replayed (then the seed of the recording is used) or not (then the passed common_seed is used). + * @param tetrion_index The index of the tetrion this seed shall be used for. + * @param common_seed The common random seed to be used if the application is not replaying a recorded game. + * @return The seed for the tetrion. + */ [[nodiscard]] Random::Seed seed_for_tetrion(u8 tetrion_index, Random::Seed common_seed) const; + /** + * @brief Returns the starting level for a given tetrion. The choice is based on whether a recorded game is + * being replayed (then the starting level of the recording is used) or not (then the starting level is taken + * from the command line arguments (maybe its default value). + * @param tetrion_index The index of the tetrion this starting level shall be used for. + * @return The starting level. + */ [[nodiscard]] auto starting_level_for_tetrion(u8 tetrion_index) const -> decltype(CommandLineArguments::starting_level); + /** + * @brief Creates the TetrionHeader instances to be used when a game shall be recorded. This data is part of the + * header of the recording. + * @param seeds The seeds of all tetrions. + * @return The tetrion headers for all tetrions. + */ [[nodiscard]] TetrionHeaders create_tetrion_headers(std::span seeds) const; + /** + * @brief Creates the subdirectory for recorded games (if necessary) and instantiates a RecordingWriter to start + * recording the game. The output filename is based on the current date and time. + * @param tetrion_headers The tetrion headers of all tetrions. + * @return The RecordingWriter. + */ [[nodiscard]] static std::unique_ptr create_recording_writer(TetrionHeaders tetrion_headers); + /** + * @brief Creates seeds for a given number of tetrions. + * @param num_tetrions The number of tetrions. + * @return The seeds for all tetrions. + */ [[nodiscard]] std::vector create_seeds(u8 num_tetrions) const; + /** + * @brief Returns an tl::optional containing a pointer to the object managed by m_recording_writer if present. + * Otherwise returns an empty tl::optional. + * @return The pointer to the RecordingWriter as an tl::optional. + */ [[nodiscard]] tl::optional recording_writer_optional(); }; From 0624f79af759909b039963092bdf2d90c8adf359 Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Wed, 12 Apr 2023 22:30:00 +0200 Subject: [PATCH 04/16] fixed broken declaration of `create_replay_input` --- src/tetris_application.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tetris_application.hpp b/src/tetris_application.hpp index b27bd17f..07049b8f 100644 --- a/src/tetris_application.hpp +++ b/src/tetris_application.hpp @@ -71,6 +71,12 @@ struct TetrisApplication final : public Application { create_input(Controls controls, Tetrion* associated_tetrion, Input::OnEventCallback on_event_callback); [[nodiscard]] static std::unique_ptr create_replay_input( + u8 tetrion_index, + RecordingReader* recording_reader, + Tetrion* associated_tetrion, + Input::OnEventCallback on_event_callback + ); + /** * @brief Creates an input that replays a recorded game. * @param tetrion_index The index of the tetrion that is targeted by this input. @@ -82,7 +88,7 @@ struct TetrisApplication final : public Application { [[nodiscard]] static std::unique_ptr create_recording_input( u8 tetrion_index, RecordingReader* constrecording_reader, - Tetrion *constassociated_tetrion, + Tetrion* constassociated_tetrion, Input::OnEventCallback on_event_callback ); From c1acdfbd7a90c711d76bfbab8cfa1b836d87dc0c Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Wed, 12 Apr 2023 22:31:30 +0200 Subject: [PATCH 05/16] removed wrong declaration, moved doc comment --- src/tetris_application.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/tetris_application.hpp b/src/tetris_application.hpp index 07049b8f..f8ae8a66 100644 --- a/src/tetris_application.hpp +++ b/src/tetris_application.hpp @@ -70,13 +70,6 @@ struct TetrisApplication final : public Application { [[nodiscard]] std::unique_ptr create_input(Controls controls, Tetrion* associated_tetrion, Input::OnEventCallback on_event_callback); - [[nodiscard]] static std::unique_ptr create_replay_input( - u8 tetrion_index, - RecordingReader* recording_reader, - Tetrion* associated_tetrion, - Input::OnEventCallback on_event_callback - ); - /** * @brief Creates an input that replays a recorded game. * @param tetrion_index The index of the tetrion that is targeted by this input. @@ -85,10 +78,10 @@ struct TetrisApplication final : public Application { * @param on_event_callback Callback that is invoked when an input event happens. * @return The input. */ - [[nodiscard]] static std::unique_ptr create_recording_input( + [[nodiscard]] static std::unique_ptr create_replay_input( u8 tetrion_index, - RecordingReader* constrecording_reader, - Tetrion* constassociated_tetrion, + RecordingReader* recording_reader, + Tetrion* associated_tetrion, Input::OnEventCallback on_event_callback ); From 78066c77001e2dad6a6520d10367a4918439055d Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Mon, 10 Apr 2023 20:24:28 +0200 Subject: [PATCH 06/16] added documentation to the utils header, moved utils into a subdirectory --- CMakeLists.txt | 4 ++-- src/meson.build | 2 ++ src/recording.hpp | 2 +- src/utils/meson.build | 6 ++++++ src/{ => utils}/utils.cpp | 2 +- src/{ => utils}/utils.hpp | 24 ++++++++++++++++++++++++ 6 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 src/utils/meson.build rename src/{ => utils}/utils.cpp (96%) rename src/{ => utils}/utils.hpp (56%) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc37e276..81e934b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,8 @@ add_executable(oopetris src/random.hpp src/recording.hpp src/input_event.hpp - src/utils.hpp - src/utils.cpp + src/utils/utils.hpp + src/utils/utils.cpp src/command_line_arguments.hpp src/controls.hpp src/mino_stack.cpp diff --git a/src/meson.build b/src/meson.build index b4511124..81cb5577 100644 --- a/src/meson.build +++ b/src/meson.build @@ -52,3 +52,5 @@ src_files += files( ) inc_dirs += include_directories('.') + +subdir('utils') diff --git a/src/recording.hpp b/src/recording.hpp index 1df2515b..ba340e45 100644 --- a/src/recording.hpp +++ b/src/recording.hpp @@ -5,7 +5,7 @@ #include "tetrion.hpp" #include "tetrion_snapshot.hpp" #include "types.hpp" -#include "utils.hpp" +#include "utils/utils.hpp" #include #include #include diff --git a/src/utils/meson.build b/src/utils/meson.build new file mode 100644 index 00000000..4eab4064 --- /dev/null +++ b/src/utils/meson.build @@ -0,0 +1,6 @@ +src_files += files( + 'utils.hpp', + 'utils.cpp', +) + +inc_dirs += include_directories('.') diff --git a/src/utils.cpp b/src/utils/utils.cpp similarity index 96% rename from src/utils.cpp rename to src/utils/utils.cpp index dff26bd2..d5824a4e 100644 --- a/src/utils.cpp +++ b/src/utils/utils.cpp @@ -1,7 +1,7 @@ #include "utils.hpp" +#include "spdlog/spdlog.h" #include #include -#include namespace utils { [[nodiscard]] std::string current_date_time_iso8601() { diff --git a/src/utils.hpp b/src/utils/utils.hpp similarity index 56% rename from src/utils.hpp rename to src/utils/utils.hpp index 57905602..280345dc 100644 --- a/src/utils.hpp +++ b/src/utils/utils.hpp @@ -15,8 +15,20 @@ namespace utils { template concept integral = std::is_integral_v; + /** + * @brief Returns the current date and time as a string in ISO 8601 format without using any separators except for + * 'T' between the date and the time. + * @return The current date and time string. + */ [[nodiscard]] std::string current_date_time_iso8601(); + /** + * @brief Converts between big endian and little endian. This function is needed since not all compilers support + * std::byteswap as of yet. + * @tparam Integral The type of the value to convert. + * @param value The value to convert. + * @return The converted value. + */ template [[nodiscard]] constexpr Integral byte_swap(Integral value) noexcept { // based on source: slartibartswift @@ -29,6 +41,12 @@ namespace utils { return result; } + /** + * @brief Converts from the machine's native byte order to little endian. On a little endian machine, this function + * does return the input value. + * @param value A value in the machine's native byte order. + * @return The value in little endian. + */ [[nodiscard]] constexpr auto to_little_endian(integral auto value) { if constexpr (std::endian::native == std::endian::little) { return value; @@ -37,6 +55,12 @@ namespace utils { } } + /** + * @brief Converts from little endian to the machine's native byte order. On a little endian machine, this function + * does return the input value. + * @param value A value in little endian. + * @return The value in the machine's native byte order. + */ [[nodiscard]] constexpr auto from_little_endian(integral auto value) { return to_little_endian(value); } From 41cc031700bf148c059b53a22f4c2989f99342fe Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Mon, 10 Apr 2023 20:27:31 +0200 Subject: [PATCH 07/16] fixed meson error --- src/meson.build | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/meson.build b/src/meson.build index 81cb5577..715277b7 100644 --- a/src/meson.build +++ b/src/meson.build @@ -41,8 +41,6 @@ src_files += files( 'random.hpp', 'recording.hpp', 'input_event.hpp', - 'utils.hpp', - 'utils.cpp', 'command_line_arguments.hpp', 'controls.hpp', 'mino_stack.hpp', From 33b1d2656ba627c58142b000e2cabd30f008477a Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Wed, 12 Apr 2023 22:37:32 +0200 Subject: [PATCH 08/16] fixed include --- src/tetrion_snapshot.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tetrion_snapshot.hpp b/src/tetrion_snapshot.hpp index 2df9b018..127a49cf 100644 --- a/src/tetrion_snapshot.hpp +++ b/src/tetrion_snapshot.hpp @@ -2,7 +2,7 @@ #include "application.hpp" #include "tetrion.hpp" -#include "utils.hpp" +#include "utils/utils.hpp" #include #include #include From 3891faf844380b479580b8e0a893535a63a0f6c6 Mon Sep 17 00:00:00 2001 From: Michael Gerhold Date: Thu, 13 Apr 2023 19:51:07 +0200 Subject: [PATCH 09/16] fixed `#include`s --- src/random.hpp | 2 +- src/tetrion.hpp | 2 +- src/utils/utils.hpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/random.hpp b/src/random.hpp index 11bf1d06..b3debb1c 100644 --- a/src/random.hpp +++ b/src/random.hpp @@ -1,6 +1,6 @@ #pragma once -#include "utils.hpp" +#include "utils/utils.hpp" #include struct Random { diff --git a/src/tetrion.hpp b/src/tetrion.hpp index 81515509..be62a155 100644 --- a/src/tetrion.hpp +++ b/src/tetrion.hpp @@ -8,7 +8,7 @@ #include "tetromino.hpp" #include "text.hpp" #include "types.hpp" -#include "utils.hpp" +#include "utils/utils.hpp" #include #include #include diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index 280345dc..7100bc88 100644 --- a/src/utils/utils.hpp +++ b/src/utils/utils.hpp @@ -1,7 +1,6 @@ #pragma once -#include "types.hpp" -#include "utils.hpp" +#include "../types.hpp" #include #include #include From 92fd028f45d1b54c1dd7458387d213d73de87157 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Sat, 15 Apr 2023 15:09:24 +0200 Subject: [PATCH 10/16] add default Doxyfile for documentation --- Doxyfile | 393 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 393 insertions(+) create mode 100644 Doxyfile diff --git a/ Doxyfile b/ Doxyfile new file mode 100644 index 00000000..4452c330 --- /dev/null +++ b/ Doxyfile @@ -0,0 +1,393 @@ +# Doxyfile 1.9.4 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "OOpetris" +PROJECT_NUMBER = +PROJECT_BRIEF = +PROJECT_LOGO = +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +CREATE_SUBDIRS_LEVEL = 8 +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +JAVADOC_BANNER = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +PYTHON_DOCSTRING = YES +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 4 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +OPTIMIZE_OUTPUT_SLICE = NO +EXTENSION_MAPPING = +MARKDOWN_SUPPORT = YES +TOC_INCLUDE_HEADINGS = 5 +AUTOLINK_SUPPORT = YES +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +GROUP_NESTED_COMPOUNDS = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = NO +LOOKUP_CACHE_SIZE = 0 +NUM_PROC_THREADS = 1 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PACKAGE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +RESOLVE_UNNAMED_PARAMS = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO +SHOW_HEADERFILE = YES +SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO +FORCE_LOCAL_INCLUDES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_IF_INCOMPLETE_DOC = YES +WARN_NO_PARAMDOC = NO +WARN_AS_ERROR = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LINE_FORMAT = "at line $line of file $file" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.l \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f18 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +CLANG_ASSISTED_PARSING = NO +CLANG_ADD_INC_PATHS = YES +CLANG_OPTIONS = +CLANG_DATABASE_PATH = +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = NO +HTML_DYNAMIC_MENUS = YES +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_FEEDURL = +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = NO +GENERATE_TREEVIEW = NO +FULL_SIDEBAR = NO +ENUM_VALUES_PER_LINE = 4 +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +OBFUSCATE_EMAILS = YES +HTML_FORMULA_FORMAT = png +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +FORMULA_MACROFILE = +USE_MATHJAX = NO +MATHJAX_VERSION = MathJax_2 +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = +MAKEINDEX_CMD_NAME = makeindex +LATEX_MAKEINDEX_CMD = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4 +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +LATEX_BIB_STYLE = plain +LATEX_TIMESTAMP = NO +LATEX_EMOJI_DIRECTORY = +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_SUBDIR = +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_PROGRAMLISTING = YES +XML_NS_MEMB_FILE_SCOPE = NO +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +DIA_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +UML_LIMIT_NUM_FIELDS = 10 +DOT_UML_DETAILS = NO +DOT_WRAP_THRESHOLD = 17 +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DIR_GRAPH_MAX_DEPTH = 1 +DOT_IMAGE_FORMAT = png +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_CFG_FILE = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES From 9ee5eeee92107acf0003c7116c3644139b0a8619 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Sat, 15 Apr 2023 15:14:44 +0200 Subject: [PATCH 11/16] added doxygen CI - improved settings fo doxygen --- Doxyfile | 4 ++-- .github/workflows/docs.yml | 29 +++++++++++++++++++++++++++++ .gitignore | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/ Doxyfile b/ Doxyfile index 4452c330..3e880fb5 100644 --- a/ Doxyfile +++ b/ Doxyfile @@ -208,7 +208,7 @@ IGNORE_PREFIX = # Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES -HTML_OUTPUT = html +HTML_OUTPUT = docs HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = @@ -272,7 +272,7 @@ EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -GENERATE_LATEX = YES +GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = MAKEINDEX_CMD_NAME = makeindex diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..b614da6b --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,29 @@ +name: Doxygen Generation + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + workflow_dispatch: + +jobs: + generate-docs: + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: "0" + + - uses: mattnotmitt/doxygen-action@v1.9.5 + with: + doxyfile-path: ./Doxyfile + working-directory: "." + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs diff --git a/.gitignore b/.gitignore index 2ddb38d7..073f82c4 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,4 @@ cmake-build-* recordings/ /build-* /toolchains/ +docs/ From 887cf2b6036cad328e4f62fff50896253d2dfc8f Mon Sep 17 00:00:00 2001 From: Totto16 Date: Sat, 15 Apr 2023 15:18:12 +0200 Subject: [PATCH 12/16] fix cli --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b614da6b..2268a96e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,6 @@ jobs: - uses: mattnotmitt/doxygen-action@v1.9.5 with: doxyfile-path: ./Doxyfile - working-directory: "." - name: Deploy uses: peaceiris/actions-gh-pages@v3 From 1f80d88dc0991660ea3e51904a499cbac897ac97 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Sat, 15 Apr 2023 15:19:24 +0200 Subject: [PATCH 13/16] test ci --- .github/workflows/docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2268a96e..0edf6fb8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,6 +17,9 @@ jobs: with: fetch-depth: "0" + - name: test + run: ls -lsa + - uses: mattnotmitt/doxygen-action@v1.9.5 with: doxyfile-path: ./Doxyfile From b4bff014bae20db512225c96200ee00cd4e0b3b6 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Sat, 15 Apr 2023 15:22:31 +0200 Subject: [PATCH 14/16] chnage ci again --- .github/workflows/docs.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0edf6fb8..06d5ab35 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,19 +13,9 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: DenverCoder1/doxygen-github-pages-action@v1.2.0 with: - fetch-depth: "0" - - - name: test - run: ls -lsa - - - uses: mattnotmitt/doxygen-action@v1.9.5 - with: - doxyfile-path: ./Doxyfile - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: 63-add-documentation ## TODO change when all changes are in main + folder: docs + config_file: Doxyfile \ No newline at end of file From fb1748a416050ed0977124b1308a432c2a6e7ab8 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Sat, 15 Apr 2023 15:31:04 +0200 Subject: [PATCH 15/16] change deploy branch --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 06d5ab35..1179a60d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,6 +16,6 @@ jobs: - uses: DenverCoder1/doxygen-github-pages-action@v1.2.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - branch: 63-add-documentation ## TODO change when all changes are in main + branch: gh-pages folder: docs config_file: Doxyfile \ No newline at end of file From afc0bbac40223299b52cdc56cacdf6eddc39c453 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Sat, 15 Apr 2023 15:44:20 +0200 Subject: [PATCH 16/16] fixed Doxyfile naming --- Doxyfile => Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Doxyfile => Doxyfile (99%) diff --git a/ Doxyfile b/Doxyfile similarity index 99% rename from Doxyfile rename to Doxyfile index 3e880fb5..cbf60674 100644 --- a/ Doxyfile +++ b/Doxyfile @@ -121,7 +121,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = +INPUT = src/ INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.c \ *.cc \