1
0
mirror of synced 2024-12-02 19:27:21 +01:00
ImHex/plugins/builtin/include/content/views/view_pattern_data.hpp
Polshakov Dmitry 5dfa9cf501
patterns: Move logic to draw patterns into separate class (#472)
* refactor(patterns): add visitor interface

* refactor(patterns): add public accessors

* refactor(patterns): add method to get pattern value

* refactor(pattern): make some methods public

* refactor(pattern): extract code to draw GUI

* refactor(patterns): remove GUI related code from patterns

* refactor: move common GUI function from pattern to pattern_drawer

* refactor(pattern_drawer): extract common code into methods

* refactor: rename ImGuiDrawer -> PatternDrawer

* refactor(patternr): move displayEnd into PatternDrawer

* refactor: use ArrayPattern concept to restrict argument type

Co-authored-by: Dmitry Polshakov <dmitry.polshakov@dsr-corporation.com>
2022-03-21 13:52:07 +01:00

27 lines
535 B
C++

#pragma once
#include <hex.hpp>
#include <imgui.h>
#include <hex/pattern_language/pattern_drawer.hpp>
#include <hex/ui/view.hpp>
#include <vector>
#include <tuple>
#include <cstdio>
namespace hex::plugin::builtin {
class ViewPatternData : public View {
public:
ViewPatternData();
~ViewPatternData() override;
void drawContent() override;
private:
std::map<prv::Provider *, std::vector<std::shared_ptr<pl::Pattern>>> m_sortedPatterns;
hex::pl::PatternDrawer m_drawer;
};
}