2023-12-23 21:09:41 +01:00
|
|
|
#include <hex/api/imhex_api.hpp>
|
2023-01-20 21:16:28 +01:00
|
|
|
#include <hex/api/content_registry.hpp>
|
|
|
|
|
2023-12-23 21:09:41 +01:00
|
|
|
#include <pl/core/evaluator.hpp>
|
2023-03-10 16:06:18 +01:00
|
|
|
|
2023-01-20 21:16:28 +01:00
|
|
|
namespace hex::plugin::builtin {
|
|
|
|
|
2024-07-10 20:50:58 +02:00
|
|
|
void drawHexVisualizer(pl::ptrn::Pattern &, bool, std::span<const pl::core::Token::Literal> arguments);
|
|
|
|
void drawChunkBasedEntropyVisualizer(pl::ptrn::Pattern &, bool, std::span<const pl::core::Token::Literal> arguments);
|
2023-01-20 21:16:28 +01:00
|
|
|
|
|
|
|
void registerPatternLanguageVisualizers() {
|
2023-10-31 10:56:20 +01:00
|
|
|
using ParamCount = pl::api::FunctionParameterCount;
|
|
|
|
|
2023-12-23 21:09:41 +01:00
|
|
|
ContentRegistry::PatternLanguage::addVisualizer("hex_viewer", drawHexVisualizer, ParamCount::exactly(1));
|
2023-10-31 10:56:20 +01:00
|
|
|
ContentRegistry::PatternLanguage::addVisualizer("chunk_entropy", drawChunkBasedEntropyVisualizer, ParamCount::exactly(2));
|
2023-01-20 21:16:28 +01:00
|
|
|
}
|
|
|
|
|
2023-12-23 21:09:41 +01:00
|
|
|
}
|