mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
Improve bookmark API
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include "patches.hpp"
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
|
||||
namespace hex {
|
||||
|
||||
@@ -30,8 +30,8 @@ namespace hex {
|
||||
[[nodiscard]] static const Patches& getPatches() { return ProjectFile::s_patches; }
|
||||
static void setPatches(const Patches &patches) { ProjectFile::s_hasUnsavedChanged = true; ProjectFile::s_patches = patches; }
|
||||
|
||||
[[nodiscard]] static const std::list<Bookmark>& getBookmarks() { return ProjectFile::s_bookmarks; }
|
||||
static void setBookmarks(const std::list<Bookmark> &bookmarks) { ProjectFile::s_hasUnsavedChanged = true; ProjectFile::s_bookmarks = bookmarks; }
|
||||
[[nodiscard]] static const std::list<ImHexApi::Bookmarks::Entry>& getBookmarks() { return ProjectFile::s_bookmarks; }
|
||||
static void setBookmarks(const std::list<ImHexApi::Bookmarks::Entry> &bookmarks) { ProjectFile::s_hasUnsavedChanged = true; ProjectFile::s_bookmarks = bookmarks; }
|
||||
|
||||
private:
|
||||
static inline std::string s_currProjectFilePath;
|
||||
@@ -40,7 +40,7 @@ namespace hex {
|
||||
static inline std::string s_filePath;
|
||||
static inline std::string s_pattern;
|
||||
static inline Patches s_patches;
|
||||
static inline std::list<Bookmark> s_bookmarks;
|
||||
static inline std::list<ImHexApi::Bookmarks::Entry> s_bookmarks;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -13,14 +13,11 @@ namespace hex {
|
||||
|
||||
class ViewBookmarks : public View {
|
||||
public:
|
||||
explicit ViewBookmarks(std::list<Bookmark> &bookmarks);
|
||||
ViewBookmarks();
|
||||
~ViewBookmarks() override;
|
||||
|
||||
void drawContent() override;
|
||||
void drawMenu() override;
|
||||
|
||||
private:
|
||||
std::list<Bookmark> &m_bookmarks;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace hex {
|
||||
|
||||
class ViewHexEditor : public View {
|
||||
public:
|
||||
ViewHexEditor(std::vector<lang::PatternData*> &patternData, const std::list<Bookmark> &bookmarks);
|
||||
ViewHexEditor(std::vector<lang::PatternData*> &patternData);
|
||||
~ViewHexEditor() override;
|
||||
|
||||
void drawContent() override;
|
||||
@@ -33,7 +33,6 @@ namespace hex {
|
||||
imgui_addons::ImGuiFileBrowser m_fileBrowser;
|
||||
|
||||
std::vector<lang::PatternData*> &m_patternData;
|
||||
const std::list<Bookmark> &m_bookmarks;
|
||||
|
||||
std::map<u64, u32> m_highlightedBytes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user