2020-11-10 14:26:38 +00:00
|
|
|
#include "window.hpp"
|
|
|
|
|
2021-01-13 16:28:27 +00:00
|
|
|
#include <hex/api/content_registry.hpp>
|
|
|
|
#include <hex/providers/provider.hpp>
|
|
|
|
#include <hex/lang/pattern_data.hpp>
|
|
|
|
#include <hex/helpers/utils.hpp>
|
2021-01-12 15:50:15 +00:00
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
#include "views/view_hexeditor.hpp"
|
|
|
|
#include "views/view_pattern.hpp"
|
2020-11-10 20:31:04 +00:00
|
|
|
#include "views/view_pattern_data.hpp"
|
2020-11-10 23:13:09 +00:00
|
|
|
#include "views/view_hashes.hpp"
|
2020-11-12 08:38:52 +00:00
|
|
|
#include "views/view_information.hpp"
|
2020-11-14 20:16:03 +00:00
|
|
|
#include "views/view_help.hpp"
|
2020-11-14 23:46:38 +00:00
|
|
|
#include "views/view_tools.hpp"
|
2020-11-15 00:42:43 +00:00
|
|
|
#include "views/view_strings.hpp"
|
2020-11-20 23:12:58 +00:00
|
|
|
#include "views/view_data_inspector.hpp"
|
2020-11-22 22:07:50 +00:00
|
|
|
#include "views/view_disassembler.hpp"
|
2020-11-27 23:33:26 +00:00
|
|
|
#include "views/view_bookmarks.hpp"
|
2020-11-29 01:06:41 +00:00
|
|
|
#include "views/view_patches.hpp"
|
2020-12-16 21:43:07 +00:00
|
|
|
#include "views/view_command_palette.hpp"
|
2021-01-11 19:31:40 +00:00
|
|
|
#include "views/view_settings.hpp"
|
2020-11-10 20:31:04 +00:00
|
|
|
|
|
|
|
#include <vector>
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-12-01 17:19:49 +00:00
|
|
|
int main(int argc, char **argv) {
|
2021-01-13 16:28:27 +00:00
|
|
|
using namespace hex;
|
|
|
|
|
|
|
|
Window window(argc, argv);
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-10 20:31:04 +00:00
|
|
|
// Shared Data
|
2021-01-13 16:28:27 +00:00
|
|
|
std::vector<lang::PatternData*> patternData;
|
|
|
|
std::list<Bookmark> bookmarks;
|
2020-11-27 23:33:26 +00:00
|
|
|
|
2020-11-10 20:31:04 +00:00
|
|
|
// Create views
|
2021-01-13 16:28:27 +00:00
|
|
|
ContentRegistry::Views::add<ViewHexEditor>(patternData, bookmarks);
|
|
|
|
ContentRegistry::Views::add<ViewPattern>(patternData);
|
|
|
|
ContentRegistry::Views::add<ViewPatternData>(patternData);
|
|
|
|
ContentRegistry::Views::add<ViewDataInspector>();
|
|
|
|
ContentRegistry::Views::add<ViewHashes>();
|
|
|
|
ContentRegistry::Views::add<ViewInformation>();
|
|
|
|
ContentRegistry::Views::add<ViewStrings>();
|
|
|
|
ContentRegistry::Views::add<ViewDisassembler>();
|
|
|
|
ContentRegistry::Views::add<ViewBookmarks>(bookmarks);
|
|
|
|
ContentRegistry::Views::add<ViewPatches>();
|
|
|
|
ContentRegistry::Views::add<ViewTools>();
|
|
|
|
ContentRegistry::Views::add<ViewCommandPalette>();
|
|
|
|
ContentRegistry::Views::add<ViewHelp>();
|
|
|
|
ContentRegistry::Views::add<ViewSettings>();
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-12-05 21:10:03 +00:00
|
|
|
if (argc > 1)
|
2021-01-13 16:28:27 +00:00
|
|
|
View::postEvent(Events::FileDropped, argv[1]);
|
2020-12-05 21:10:03 +00:00
|
|
|
|
2021-01-12 15:50:15 +00:00
|
|
|
window.initPlugins();
|
2020-11-10 14:26:38 +00:00
|
|
|
window.loop();
|
|
|
|
|
2021-01-12 15:50:15 +00:00
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
2020-11-10 14:26:38 +00:00
|
|
|
}
|