1
0
mirror of synced 2024-12-01 18:57:18 +01:00
ImHex/plugins/builtin/source/content/views.cpp

65 lines
2.8 KiB
C++
Raw Normal View History

#include "content/views/view_hex_editor.hpp"
2021-12-07 22:47:41 +01:00
#include "content/views/view_pattern_editor.hpp"
#include "content/views/view_pattern_data.hpp"
#include "content/views/view_information.hpp"
2022-03-04 19:06:29 +01:00
#include "content/views/view_about.hpp"
2021-12-07 22:47:41 +01:00
#include "content/views/view_tools.hpp"
#include "content/views/view_data_inspector.hpp"
#include "content/views/view_bookmarks.hpp"
#include "content/views/view_patches.hpp"
#include "content/views/view_command_palette.hpp"
#include "content/views/view_settings.hpp"
#include "content/views/view_data_processor.hpp"
#include "content/views/view_constants.hpp"
#include "content/views/view_store.hpp"
#include "content/views/view_provider_settings.hpp"
#include "content/views/view_find.hpp"
#include "content/views/view_theme_manager.hpp"
2023-07-23 23:37:47 +02:00
#include "content/views/view_logs.hpp"
#include "content/views/view_achievements.hpp"
2023-12-02 11:09:32 +01:00
#include "content/views/view_highlight_rules.hpp"
2023-12-13 13:04:59 +01:00
#include "content/views/view_tutorials.hpp"
2021-12-07 22:47:41 +01:00
#include <hex/api/layout_manager.hpp>
2021-12-07 22:47:41 +01:00
namespace hex::plugin::builtin {
void registerViews() {
ContentRegistry::Views::add<ViewHexEditor>();
ContentRegistry::Views::add<ViewPatternEditor>();
ContentRegistry::Views::add<ViewPatternData>();
ContentRegistry::Views::add<ViewDataInspector>();
ContentRegistry::Views::add<ViewInformation>();
ContentRegistry::Views::add<ViewBookmarks>();
ContentRegistry::Views::add<ViewPatches>();
ContentRegistry::Views::add<ViewTools>();
ContentRegistry::Views::add<ViewCommandPalette>();
2022-03-04 19:06:29 +01:00
ContentRegistry::Views::add<ViewAbout>();
2021-12-07 22:47:41 +01:00
ContentRegistry::Views::add<ViewSettings>();
ContentRegistry::Views::add<ViewDataProcessor>();
ContentRegistry::Views::add<ViewConstants>();
ContentRegistry::Views::add<ViewStore>();
ContentRegistry::Views::add<ViewProviderSettings>();
ContentRegistry::Views::add<ViewFind>();
ContentRegistry::Views::add<ViewThemeManager>();
2023-07-23 23:37:47 +02:00
ContentRegistry::Views::add<ViewLogs>();
ContentRegistry::Views::add<ViewAchievements>();
2023-12-02 11:09:32 +01:00
ContentRegistry::Views::add<ViewHighlightRules>();
2023-12-13 13:04:59 +01:00
ContentRegistry::Views::add<ViewTutorials>();
LayoutManager::registerLoadCallback([](std::string_view line) {
for (auto &[name, view] : ContentRegistry::Views::impl::getEntries()) {
std::string format = hex::format("{}=%d", view->getUnlocalizedName().get());
sscanf(line.data(), format.c_str(), &view->getWindowOpenState());
}
});
LayoutManager::registerStoreCallback([](ImGuiTextBuffer *buffer) {
for (auto &[name, view] : ContentRegistry::Views::impl::getEntries()) {
buffer->appendf("%s=%d\n", name.c_str(), view->getWindowOpenState());
}
});
2021-12-07 22:47:41 +01:00
}
}