dbbc525174
* Build refactoring and initial plugin support * Possibly fixed linux / mac build * Added libdl to libglad build script * Add glfw to imgui dependencies * Refactored common functionality into "libimhex" for plugins * Added plugin loading and example plugin * Added proper API for creating a custom view and a custom tools entry with plugins
40 lines
939 B
C++
40 lines
939 B
C++
#pragma once
|
|
|
|
#include <hex.hpp>
|
|
|
|
#include "imgui.h"
|
|
#include "views/view.hpp"
|
|
#include "lang/pattern_data.hpp"
|
|
|
|
#include <vector>
|
|
#include <tuple>
|
|
#include <cstdio>
|
|
|
|
namespace hex {
|
|
|
|
namespace prv { class Provider; }
|
|
|
|
class ViewCommandPalette : public View {
|
|
public:
|
|
ViewCommandPalette();
|
|
~ViewCommandPalette() override;
|
|
|
|
void drawContent() override;
|
|
void drawMenu() override;
|
|
|
|
bool handleShortcut(int key, int mods) override;
|
|
|
|
bool hasViewMenuItemEntry() override { return false; }
|
|
ImVec2 getMinSize() override { return ImVec2(400, 100); }
|
|
ImVec2 getMaxSize() override { return ImVec2(400, 100); }
|
|
|
|
private:
|
|
bool m_justOpened = false;
|
|
std::vector<char> m_commandBuffer;
|
|
std::vector<std::string> m_lastResults;
|
|
std::string m_exactResult;
|
|
|
|
std::vector<std::string> getCommandResults(std::string_view command);
|
|
};
|
|
|
|
} |