sys: Added clang-format file, formatted entire project

This commit is contained in:
WerWolv
2022-01-24 20:53:17 +01:00
parent a66fec489c
commit 0e08b0226b
168 changed files with 5178 additions and 4866 deletions

View File

@@ -14,7 +14,7 @@ namespace hex {
class Plugin {
public:
explicit Plugin(const fs::path &path);
Plugin(const Plugin&) = delete;
Plugin(const Plugin &) = delete;
Plugin(Plugin &&other) noexcept;
~Plugin();
@@ -25,28 +25,29 @@ namespace hex {
[[nodiscard]] std::string getCompatibleVersion() const;
void setImGuiContext(ImGuiContext *ctx) const;
[[nodiscard]] const fs::path& getPath() const;
[[nodiscard]] const fs::path &getPath() const;
[[nodiscard]] bool isLoaded() const;
private:
using InitializePluginFunc = void(*)();
using GetPluginNameFunc = const char*(*)();
using GetPluginAuthorFunc = const char*(*)();
using GetPluginDescriptionFunc = const char*(*)();
using GetCompatibleVersionFunc = const char*(*)();
using SetImGuiContextFunc = void(*)(ImGuiContext*);
using InitializePluginFunc = void (*)();
using GetPluginNameFunc = const char *(*)();
using GetPluginAuthorFunc = const char *(*)();
using GetPluginDescriptionFunc = const char *(*)();
using GetCompatibleVersionFunc = const char *(*)();
using SetImGuiContextFunc = void (*)(ImGuiContext *);
void *m_handle = nullptr;
fs::path m_path;
mutable bool m_initialized = false;
InitializePluginFunc m_initializePluginFunction = nullptr;
GetPluginNameFunc m_getPluginNameFunction = nullptr;
GetPluginAuthorFunc m_getPluginAuthorFunction = nullptr;
GetPluginDescriptionFunc m_getPluginDescriptionFunction = nullptr;
GetCompatibleVersionFunc m_getCompatibleVersionFunction = nullptr;
SetImGuiContextFunc m_setImGuiContextFunction = nullptr;
InitializePluginFunc m_initializePluginFunction = nullptr;
GetPluginNameFunc m_getPluginNameFunction = nullptr;
GetPluginAuthorFunc m_getPluginAuthorFunction = nullptr;
GetPluginDescriptionFunc m_getPluginDescriptionFunction = nullptr;
GetCompatibleVersionFunc m_getCompatibleVersionFunction = nullptr;
SetImGuiContextFunc m_setImGuiContextFunction = nullptr;
template<typename T>
[[nodiscard]] auto getPluginFunction(const std::string &symbol) {
@@ -54,7 +55,7 @@ namespace hex {
}
private:
[[nodiscard]] void* getPluginFunction(const std::string &symbol);
[[nodiscard]] void *getPluginFunction(const std::string &symbol);
};
class PluginManager {
@@ -65,7 +66,7 @@ namespace hex {
static void unload();
static void reload();
static const auto& getPlugins() {
static const auto &getPlugins() {
return PluginManager::s_plugins;
}

View File

@@ -18,5 +18,5 @@ namespace hex::init {
std::vector<Task> getInitTasks();
std::vector<Task> getExitTasks();
std::vector<Argument>& getInitArguments();
std::vector<Argument> &getInitArguments();
}

View File

@@ -42,10 +42,10 @@ namespace hex {
void exitImGui();
friend void *ImHexSettingsHandler_ReadOpenFn(ImGuiContext *ctx, ImGuiSettingsHandler *, const char *);
friend void ImHexSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler *handler, void *, const char* line);
friend void ImHexSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf);
friend void ImHexSettingsHandler_ReadLine(ImGuiContext *, ImGuiSettingsHandler *handler, void *, const char *line);
friend void ImHexSettingsHandler_WriteAll(ImGuiContext *ctx, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf);
GLFWwindow* m_window = nullptr;
GLFWwindow *m_window = nullptr;
double m_targetFps = 60.0;
bool m_layoutConfigured = false;