2021-06-26 01:18:33 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-01 18:09:40 +01:00
|
|
|
#include <hex/ui/view.hpp>
|
2021-06-26 01:18:33 +02:00
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
|
2021-12-07 22:47:41 +01:00
|
|
|
namespace hex::plugin::builtin {
|
2021-06-26 01:18:33 +02:00
|
|
|
|
2022-03-04 20:52:39 +01:00
|
|
|
enum class ConstantType
|
|
|
|
{
|
2021-06-26 01:18:33 +02:00
|
|
|
Int10,
|
|
|
|
Int16BigEndian,
|
|
|
|
Int16LittleEndian
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Constant {
|
|
|
|
std::string name, description;
|
|
|
|
std::string category;
|
|
|
|
ConstantType type;
|
|
|
|
std::string value;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ViewConstants : public View {
|
|
|
|
public:
|
|
|
|
explicit ViewConstants();
|
2022-03-04 20:52:39 +01:00
|
|
|
~ViewConstants() override = default;
|
2021-06-26 01:18:33 +02:00
|
|
|
|
|
|
|
void drawContent() override;
|
|
|
|
|
2023-04-10 21:30:27 +02:00
|
|
|
ImVec2 getMinSize() const override {
|
|
|
|
return scaled(ImVec2(300, 400));
|
|
|
|
}
|
|
|
|
|
|
|
|
ImVec2 getMaxSize() const override {
|
|
|
|
return { FLT_MAX, 800_scaled };
|
|
|
|
}
|
|
|
|
|
2021-06-26 01:18:33 +02:00
|
|
|
private:
|
|
|
|
void reloadConstants();
|
|
|
|
|
|
|
|
std::vector<Constant> m_constants;
|
2021-09-09 12:58:44 +02:00
|
|
|
std::vector<size_t> m_filterIndices;
|
|
|
|
std::string m_filter;
|
2021-06-26 01:18:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|