2020-12-16 22:43:07 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <hex/views/view.hpp>
|
2020-12-16 22:43:07 +01:00
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <imgui.h>
|
|
|
|
#include <hex/lang/pattern_data.hpp>
|
2020-12-16 22:43:07 +01:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <tuple>
|
|
|
|
#include <cstdio>
|
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
namespace prv { class Provider; }
|
|
|
|
|
|
|
|
class ViewCommandPalette : public View {
|
|
|
|
public:
|
|
|
|
ViewCommandPalette();
|
|
|
|
~ViewCommandPalette() override;
|
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
void drawContent() override;
|
|
|
|
void drawMenu() override;
|
2021-01-27 14:26:24 +01:00
|
|
|
bool isAvailable() override { return true; }
|
2020-12-16 22:43:07 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|