2021-01-20 20:16:24 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include <list>
|
2021-08-29 22:15:18 +02:00
|
|
|
#include <vector>
|
2021-09-08 15:18:24 +02:00
|
|
|
#include <string>
|
2021-01-20 20:16:24 +01:00
|
|
|
|
2021-09-21 02:29:54 +02:00
|
|
|
#include <hex/helpers/concepts.hpp>
|
2021-12-16 23:48:52 +01:00
|
|
|
#include <hex/api/task.hpp>
|
2021-12-23 15:11:38 +01:00
|
|
|
#include <hex/api/keybinding.hpp>
|
2021-09-21 02:29:54 +02:00
|
|
|
|
2021-01-20 20:16:24 +01:00
|
|
|
namespace hex {
|
|
|
|
|
2021-09-21 02:29:54 +02:00
|
|
|
namespace prv { class Provider; }
|
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
namespace ImHexApi {
|
|
|
|
namespace Common {
|
2021-01-20 20:16:24 +01:00
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
void closeImHex(bool noQuestions = false);
|
|
|
|
void restartImHex();
|
2021-08-21 13:55:21 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
namespace Bookmarks {
|
2021-01-20 20:16:24 +01:00
|
|
|
struct Entry {
|
|
|
|
Region region;
|
|
|
|
|
|
|
|
std::vector<char> name;
|
|
|
|
std::vector<char> comment;
|
|
|
|
u32 color;
|
2021-02-24 21:42:18 +01:00
|
|
|
bool locked;
|
2021-01-20 20:16:24 +01:00
|
|
|
};
|
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
void add(Region region, const std::string &name, const std::string &comment, u32 color = 0x00000000);
|
|
|
|
void add(u64 addr, size_t size, const std::string &name, const std::string &comment, u32 color = 0x00000000);
|
2021-01-20 20:16:24 +01:00
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
std::list<Entry>& getEntries();
|
2021-01-20 20:16:24 +01:00
|
|
|
};
|
2021-08-21 13:55:21 +02:00
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
namespace Provider {
|
|
|
|
|
|
|
|
prv::Provider* get();
|
|
|
|
const std::vector<prv::Provider*>& getProviders();
|
2021-09-21 02:29:54 +02:00
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
bool isValid();
|
2021-09-21 02:29:54 +02:00
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
void add(prv::Provider *provider);
|
2021-09-21 02:29:54 +02:00
|
|
|
|
|
|
|
template<hex::derived_from<prv::Provider> T>
|
2021-10-16 11:37:29 +02:00
|
|
|
void add(auto&& ... args) {
|
2021-09-21 02:29:54 +02:00
|
|
|
add(new T(std::forward<decltype(args)>(args)...));
|
|
|
|
}
|
|
|
|
|
2021-10-16 11:37:29 +02:00
|
|
|
void remove(prv::Provider *provider);
|
2021-09-21 02:29:54 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-12-16 23:48:52 +01:00
|
|
|
namespace Tasks {
|
|
|
|
|
|
|
|
Task createTask(const std::string &unlocalizedName, u64 maxValue);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-01-20 20:16:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|