Improve bookmark API

This commit is contained in:
WerWolv
2021-01-20 20:16:24 +01:00
parent be738eb5e7
commit b2648afc7b
17 changed files with 108 additions and 67 deletions

View File

@@ -22,8 +22,7 @@ namespace hex {
It allows you to add/register new content that will be picked up and used by the ImHex core or by other
plugins when needed.
*/
class ContentRegistry {
public:
struct ContentRegistry {
ContentRegistry() = delete;
/* Settings Registry. Allows adding of new entries into the ImHex preferences window. */

View File

@@ -0,0 +1,31 @@
#pragma once
#include <hex.hpp>
#include <hex/helpers/utils.hpp>
#include <list>
namespace hex {
struct ImHexApi {
ImHexApi() = delete;
struct Bookmarks {
Bookmarks() = delete;
struct Entry {
Region region;
std::vector<char> name;
std::vector<char> comment;
u32 color;
};
static void add(Region region, std::string_view name, std::string_view comment, u32 color = 0x00000000);
static void add(u64 addr, size_t size, std::string_view name, std::string_view comment, u32 color = 0x00000000);
static std::list<Entry>& getEntries();
};
};
}