1
0
mirror of synced 2024-11-27 17:10:51 +01:00
ImHex/plugins/builtin/include/content/views/view_diff.hpp
2023-02-16 08:53:05 +01:00

52 lines
922 B
C++

#pragma once
#include <hex.hpp>
#include <imgui.h>
#include <hex/ui/view.hpp>
#include <hex/api/task.hpp>
#include <array>
#include <string>
#include <vector>
#include "ui/hex_editor.hpp"
#include <IntervalTree.h>
namespace hex::plugin::builtin {
class ViewDiff : public View {
public:
ViewDiff();
~ViewDiff() override;
void drawContent() override;
public:
struct Column {
ui::HexEditor hexEditor;
int provider = -1;
i32 scrollLock = 0;
};
enum class DifferenceType : u8 {
Added,
Removed,
Modified
};
struct Diff {
Region region;
DifferenceType type;
};
private:
std::array<Column, 2> m_columns;
std::vector<Diff> m_diffs;
TaskHolder m_diffTask;
std::atomic<bool> m_analyzed = false;
};
}