mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-03 05:57:40 -05:00
feat: Added file information command line option and fullscreen view
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <content/providers/file_provider.hpp>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/helpers/magic.hpp>
|
||||
#include <hex/ui/view.hpp>
|
||||
#include <ui/markdown.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
class ViewFullScreenFileInfo : public View::FullScreen {
|
||||
public:
|
||||
explicit ViewFullScreenFileInfo(std::fs::path filePath);
|
||||
|
||||
void drawContent() override;
|
||||
|
||||
private:
|
||||
std::fs::path m_filePath;
|
||||
FileProvider m_provider;
|
||||
TaskHolder m_analysisTask;
|
||||
|
||||
std::string m_mimeType;
|
||||
std::string m_fileDescription;
|
||||
std::vector<magic::FoundPattern> m_foundPatterns;
|
||||
std::optional<ui::Markdown> m_fullDescription;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <ui/text_editor.hpp>
|
||||
#include <content/text_highlighting/pattern_language.hpp>
|
||||
#include <hex/helpers/magic.hpp>
|
||||
#include <ui/pattern_drawer.hpp>
|
||||
|
||||
namespace pl::ptrn { class Pattern; }
|
||||
@@ -114,16 +115,10 @@ namespace hex::plugin::builtin {
|
||||
u32 color;
|
||||
};
|
||||
|
||||
struct PossiblePattern {
|
||||
std::fs::path path;
|
||||
std::string author;
|
||||
std::string description;
|
||||
};
|
||||
|
||||
std::unique_ptr<pl::PatternLanguage> m_editorRuntime;
|
||||
|
||||
std::mutex m_possiblePatternFilesMutex;
|
||||
PerProvider<std::vector<PossiblePattern>> m_possiblePatternFiles;
|
||||
PerProvider<std::vector<magic::FoundPattern>> m_possiblePatternFiles;
|
||||
bool m_runAutomatically = false;
|
||||
bool m_triggerEvaluation = false;
|
||||
std::atomic<bool> m_triggerAutoEvaluate = false;
|
||||
|
||||
Reference in New Issue
Block a user