mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 00:10:02 -05:00
Compare commits
38 Commits
feature/co
...
v1.37.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73fdc3c6ea | ||
|
|
cae0f772d5 | ||
|
|
51547dc941 | ||
|
|
1508efac7a | ||
|
|
16dc239e0f | ||
|
|
899f00ed2f | ||
|
|
9ebfffd346 | ||
|
|
76b2c09450 | ||
|
|
69246de145 | ||
|
|
aee4b4fdf6 | ||
|
|
a6a78cef00 | ||
|
|
30b25a39a7 | ||
|
|
1f0b5e1ee1 | ||
|
|
d6658c3471 | ||
|
|
398eecaa1d | ||
|
|
b6616c1a0f | ||
|
|
5d3315f51c | ||
|
|
ec7298f0c0 | ||
|
|
92c2018f71 | ||
|
|
956952021d | ||
|
|
f112123d39 | ||
|
|
1a1ef9e7e0 | ||
|
|
39543fbda8 | ||
|
|
835863523b | ||
|
|
e6c8c69fda | ||
|
|
e2d30eeba2 | ||
|
|
1da82d1403 | ||
|
|
73b9df24cf | ||
|
|
f93e1194d6 | ||
|
|
677cff244d | ||
|
|
8d88e328fa | ||
|
|
acb5ef561d | ||
|
|
444b5219e2 | ||
|
|
a4c7e0db90 | ||
|
|
f4e1824b7b | ||
|
|
fcb5e18102 | ||
|
|
70d4e21c4b | ||
|
|
2e2d5d31bc |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,6 +7,7 @@ build*/
|
|||||||
local/
|
local/
|
||||||
venv/
|
venv/
|
||||||
.cache/
|
.cache/
|
||||||
|
install/
|
||||||
|
|
||||||
*.mgc
|
*.mgc
|
||||||
*.kdev4
|
*.kdev4
|
||||||
|
|||||||
@@ -381,6 +381,10 @@ endfunction()
|
|||||||
macro(configureCMake)
|
macro(configureCMake)
|
||||||
message(STATUS "Configuring ImHex v${IMHEX_VERSION}")
|
message(STATUS "Configuring ImHex v${IMHEX_VERSION}")
|
||||||
|
|
||||||
|
if (DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||||
|
message(STATUS "Using toolchain file: \"${CMAKE_TOOLCHAIN_FILE}\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable position independent code for all targets" FORCE)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable position independent code for all targets" FORCE)
|
||||||
|
|
||||||
# Configure use of recommended build tools
|
# Configure use of recommended build tools
|
||||||
@@ -662,12 +666,15 @@ macro(setupCompilerFlags target)
|
|||||||
addCCXXFlag("-Wno-unknown-pragmas" ${target})
|
addCCXXFlag("-Wno-unknown-pragmas" ${target})
|
||||||
|
|
||||||
# Enable hardening flags
|
# Enable hardening flags
|
||||||
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
|
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
|
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
|
||||||
|
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
|
||||||
|
|
||||||
if (NOT EMSCRIPTEN)
|
if (NOT EMSCRIPTEN)
|
||||||
addCommonFlag("-fstack-protector-strong" ${target})
|
addCommonFlag("-fstack-protector-strong" ${target})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
@@ -796,8 +803,8 @@ macro(addBundledLibraries)
|
|||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/lunasvg EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/lunasvg EXCLUDE_FROM_ALL)
|
||||||
set(LUNASVG_LIBRARIES lunasvg)
|
set(LUNASVG_LIBRARIES lunasvg)
|
||||||
else()
|
else()
|
||||||
find_package(LunaSVG REQUIRED)
|
find_package(lunasvg REQUIRED)
|
||||||
set(LUNASVG_LIBRARIES lunasvg)
|
set(LUNASVG_LIBRARIES lunasvg::lunasvg)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT USE_SYSTEM_LLVM)
|
if (NOT USE_SYSTEM_LLVM)
|
||||||
@@ -921,11 +928,17 @@ function(generateSDKDirectory)
|
|||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
|
||||||
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||||
|
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/ui DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/ui/include DESTINATION "${SDK_PATH}/lib/ui/include")
|
||||||
install(TARGETS ui ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
install(FILES ${CMAKE_SOURCE_DIR}/plugins/ui/CMakeLists.txt DESTINATION "${SDK_PATH}/lib/ui/")
|
||||||
|
if (WIN32)
|
||||||
|
install(TARGETS ui ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/fonts DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/fonts/include DESTINATION "${SDK_PATH}/lib/fonts/include")
|
||||||
install(TARGETS fonts ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
install(FILES ${CMAKE_SOURCE_DIR}/plugins/fonts/CMakeLists.txt DESTINATION "${SDK_PATH}/lib/fonts/")
|
||||||
|
if (WIN32)
|
||||||
|
install(TARGETS fonts ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(addIncludesFromLibrary target library)
|
function(addIncludesFromLibrary target library)
|
||||||
|
|||||||
1
dist/rpm/imhex.spec
vendored
1
dist/rpm/imhex.spec
vendored
@@ -128,6 +128,5 @@ cp -a lib/third_party/xdgpp/LICENSE %{buildroot
|
|||||||
%{_datadir}/mime/packages/%{name}.xml
|
%{_datadir}/mime/packages/%{name}.xml
|
||||||
%{_libdir}/libimhex.so*
|
%{_libdir}/libimhex.so*
|
||||||
%{_libdir}/%{name}/
|
%{_libdir}/%{name}/
|
||||||
%{_libdir}/*.hexpluglib
|
|
||||||
/usr/lib/debug/%{_libdir}/*.debug
|
/usr/lib/debug/%{_libdir}/*.debug
|
||||||
%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
|
%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
|
||||||
2
lib/external/disassembler
vendored
2
lib/external/disassembler
vendored
Submodule lib/external/disassembler updated: f9aa3ebc94...a2217dd3bc
2
lib/external/libwolv
vendored
2
lib/external/libwolv
vendored
Submodule lib/external/libwolv updated: 4b42068eca...00021679c2
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: 69b71a2c43...9833500589
@@ -872,7 +872,8 @@ namespace hex {
|
|||||||
|
|
||||||
SemanticVersion getImHexVersion() {
|
SemanticVersion getImHexVersion() {
|
||||||
#if defined IMHEX_VERSION
|
#if defined IMHEX_VERSION
|
||||||
return SemanticVersion(IMHEX_VERSION);
|
static auto version = SemanticVersion(IMHEX_VERSION);
|
||||||
|
return version;
|
||||||
#else
|
#else
|
||||||
return {};
|
return {};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -327,6 +327,7 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SetNextWindowPos(position, ImGuiCond_Always, pivot);
|
ImGui::SetNextWindowPos(position, ImGuiCond_Always, pivot);
|
||||||
|
ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID);
|
||||||
if (ImGui::Begin("##TutorialMessage", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing)) {
|
if (ImGui::Begin("##TutorialMessage", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing)) {
|
||||||
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindowRead());
|
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindowRead());
|
||||||
|
|
||||||
|
|||||||
@@ -871,8 +871,10 @@ void TextEditor::SetFocus() {
|
|||||||
SetSelection(mInteractiveStart, mInteractiveEnd, mSelectionMode);
|
SetSelection(mInteractiveStart, mInteractiveEnd, mSelectionMode);
|
||||||
ResetCursorBlinkTime();
|
ResetCursorBlinkTime();
|
||||||
EnsureCursorVisible();
|
EnsureCursorVisible();
|
||||||
ImGui::SetKeyboardFocusHere(-1);
|
if (!this->mReadOnly) {
|
||||||
mUpdateFocus = false;
|
ImGui::SetKeyboardFocusHere(-1);
|
||||||
|
mUpdateFocus = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditor::RenderText(const char *aTitle, const ImVec2 &lineNumbersStartPos, const ImVec2 &textEditorSize) {
|
void TextEditor::RenderText(const char *aTitle, const ImVec2 &lineNumbersStartPos, const ImVec2 &textEditorSize) {
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ namespace hex {
|
|||||||
void drawImGui();
|
void drawImGui();
|
||||||
void drawWithShader();
|
void drawWithShader();
|
||||||
|
|
||||||
|
void unlockFrameRate();
|
||||||
|
void forceNewFrame();
|
||||||
|
|
||||||
GLFWwindow *m_window = nullptr;
|
GLFWwindow *m_window = nullptr;
|
||||||
|
|
||||||
std::string m_windowTitle, m_windowTitleFull;
|
std::string m_windowTitle, m_windowTitleFull;
|
||||||
@@ -64,17 +67,22 @@ namespace hex {
|
|||||||
std::list<std::string> m_popupsToOpen;
|
std::list<std::string> m_popupsToOpen;
|
||||||
std::set<int> m_pressedKeys;
|
std::set<int> m_pressedKeys;
|
||||||
|
|
||||||
std::atomic<bool> m_unlockFrameRate = true;
|
|
||||||
|
|
||||||
ImGuiExt::ImHexCustomData m_imguiCustomData;
|
ImGuiExt::ImHexCustomData m_imguiCustomData;
|
||||||
|
|
||||||
u32 m_searchBarPosition = 0;
|
u32 m_searchBarPosition = 0;
|
||||||
bool m_emergencyPopupOpen = false;
|
bool m_emergencyPopupOpen = false;
|
||||||
|
|
||||||
std::jthread m_frameRateThread;
|
std::jthread m_frameRateThread;
|
||||||
|
std::chrono::duration<double, std::nano> m_remainingUnlockedTime;
|
||||||
|
|
||||||
|
std::mutex m_sleepMutex;
|
||||||
std::atomic<bool> m_sleepFlag;
|
std::atomic<bool> m_sleepFlag;
|
||||||
std::condition_variable m_sleepCondVar;
|
std::condition_variable m_sleepCondVar;
|
||||||
std::mutex m_sleepMutex;
|
|
||||||
|
std::mutex m_wakeupMutex;
|
||||||
|
std::atomic<bool> m_wakeupFlag;
|
||||||
|
std::condition_variable m_wakeupCondVar;
|
||||||
|
|
||||||
|
|
||||||
gl::Shader m_postProcessingShader;
|
gl::Shader m_postProcessingShader;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -492,7 +492,9 @@ namespace hex::init {
|
|||||||
meanScale = 1.0F;
|
meanScale = 1.0F;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
meanScale /= hex::ImHexApi::System::getBackingScaleFactor();
|
#if !defined(OS_LINUX)
|
||||||
|
meanScale /= hex::ImHexApi::System::getBackingScaleFactor();
|
||||||
|
#endif
|
||||||
|
|
||||||
ImHexApi::System::impl::setGlobalScale(meanScale);
|
ImHexApi::System::impl::setGlobalScale(meanScale);
|
||||||
ImHexApi::System::impl::setNativeScale(meanScale);
|
ImHexApi::System::impl::setNativeScale(meanScale);
|
||||||
|
|||||||
@@ -42,12 +42,18 @@ namespace hex::messaging {
|
|||||||
|
|
||||||
static auto listenerThread = std::jthread([](const std::stop_token &stopToken){
|
static auto listenerThread = std::jthread([](const std::stop_token &stopToken){
|
||||||
std::vector<u8> buffer(0xFFFF);
|
std::vector<u8> buffer(0xFFFF);
|
||||||
while (!stopToken.stop_requested()) {
|
|
||||||
|
while (true) {
|
||||||
int result = ::read(fifo, buffer.data(), buffer.size());
|
int result = ::read(fifo, buffer.data(), buffer.size());
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
EventNativeMessageReceived::post(std::vector<u8>{ buffer.begin(), buffer.begin() + result });
|
EventNativeMessageReceived::post(std::vector<u8>{ buffer.begin(), buffer.begin() + result });
|
||||||
} else {
|
}
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
||||||
|
if (stopToken.stop_requested())
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (result <= 0) {
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ namespace hex {
|
|||||||
FILE *pipe = popen("dbus-send --session --print-reply --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' 2>&1", "r");
|
FILE *pipe = popen("dbus-send --session --print-reply --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' 2>&1", "r");
|
||||||
if (pipe == nullptr) return;
|
if (pipe == nullptr) return;
|
||||||
|
|
||||||
while (fgets(buffer.data(), buffer.size(), pipe) != nullptr)
|
while (fgets(buffer.data(), buffer.size() - 1, pipe) != nullptr)
|
||||||
result += buffer.data();
|
result += buffer.data();
|
||||||
|
|
||||||
auto exitCode = WEXITSTATUS(pclose(pipe));
|
auto exitCode = WEXITSTATUS(pclose(pipe));
|
||||||
|
|||||||
@@ -70,6 +70,9 @@ namespace hex {
|
|||||||
const auto newScale = LOWORD(wParam) / 96.0F;
|
const auto newScale = LOWORD(wParam) / 96.0F;
|
||||||
const auto oldScale = ImHexApi::System::getNativeScale();
|
const auto oldScale = ImHexApi::System::getNativeScale();
|
||||||
|
|
||||||
|
if (u32(oldScale * 10) == u32(newScale * 10))
|
||||||
|
break;
|
||||||
|
|
||||||
EventDPIChanged::post(oldScale, newScale);
|
EventDPIChanged::post(oldScale, newScale);
|
||||||
ImHexApi::System::impl::setNativeScale(newScale);
|
ImHexApi::System::impl::setNativeScale(newScale);
|
||||||
|
|
||||||
@@ -201,17 +204,20 @@ namespace hex {
|
|||||||
|
|
||||||
i64 sleepTicks = 0;
|
i64 sleepTicks = 0;
|
||||||
i64 sleepMilliSeconds = 0;
|
i64 sleepMilliSeconds = 0;
|
||||||
if (delta >= 0) {
|
if (period > 0) {
|
||||||
sleepTicks = delta / period;
|
if (delta >= 0) {
|
||||||
} else {
|
sleepTicks = delta / period;
|
||||||
sleepTicks = -1 + delta / period;
|
} else {
|
||||||
|
sleepTicks = -1 + delta / period;
|
||||||
|
}
|
||||||
|
|
||||||
|
sleepMilliSeconds = delta - (period * sleepTicks);
|
||||||
|
const double sleepTime = std::round(1000.0 * double(sleepMilliSeconds) / double(performanceFrequency.QuadPart));
|
||||||
|
if (sleepTime >= 0.0) {
|
||||||
|
Sleep(DWORD(sleepTime));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sleepMilliSeconds = delta - (period * sleepTicks);
|
|
||||||
const double sleepTime = std::round(1000.0 * double(sleepMilliSeconds) / double(performanceFrequency.QuadPart));
|
|
||||||
if (sleepTime >= 0.0) {
|
|
||||||
Sleep(DWORD(sleepTime));
|
|
||||||
}
|
|
||||||
timeEndPeriod(granularity);
|
timeEndPeriod(granularity);
|
||||||
|
|
||||||
return WVR_REDRAW;
|
return WVR_REDRAW;
|
||||||
@@ -611,7 +617,7 @@ namespace hex {
|
|||||||
|
|
||||||
glfwSetFramebufferSizeCallback(m_window, [](GLFWwindow* window, int width, int height) {
|
glfwSetFramebufferSizeCallback(m_window, [](GLFWwindow* window, int width, int height) {
|
||||||
auto *win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
auto *win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
||||||
win->m_unlockFrameRate = true;
|
win->unlockFrameRate();
|
||||||
|
|
||||||
glViewport(0, 0, width, height);
|
glViewport(0, 0, width, height);
|
||||||
ImHexApi::System::impl::setMainWindowSize(width, height);
|
ImHexApi::System::impl::setMainWindowSize(width, height);
|
||||||
|
|||||||
@@ -100,6 +100,9 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Window::~Window() {
|
Window::~Window() {
|
||||||
|
m_frameRateThread.request_stop();
|
||||||
|
m_frameRateThread.join();
|
||||||
|
|
||||||
EventProviderDeleted::unsubscribe(this);
|
EventProviderDeleted::unsubscribe(this);
|
||||||
RequestCloseImHex::unsubscribe(this);
|
RequestCloseImHex::unsubscribe(this);
|
||||||
RequestUpdateWindowTitle::unsubscribe(this);
|
RequestUpdateWindowTitle::unsubscribe(this);
|
||||||
@@ -311,7 +314,7 @@ namespace hex {
|
|||||||
|
|
||||||
// Unlock frame rate if any mouse button is being held down to allow drag scrolling to be smooth
|
// Unlock frame rate if any mouse button is being held down to allow drag scrolling to be smooth
|
||||||
if (ImGui::IsAnyMouseDown())
|
if (ImGui::IsAnyMouseDown())
|
||||||
m_unlockFrameRate = true;
|
this->unlockFrameRate();
|
||||||
|
|
||||||
// Unlock frame rate if any modifier key is held down since they don't generate key repeat events
|
// Unlock frame rate if any modifier key is held down since they don't generate key repeat events
|
||||||
if (
|
if (
|
||||||
@@ -320,12 +323,12 @@ namespace hex {
|
|||||||
ImGui::IsKeyPressed(ImGuiKey_LeftSuper) || ImGui::IsKeyPressed(ImGuiKey_RightSuper) ||
|
ImGui::IsKeyPressed(ImGuiKey_LeftSuper) || ImGui::IsKeyPressed(ImGuiKey_RightSuper) ||
|
||||||
ImGui::IsKeyPressed(ImGuiKey_LeftAlt) || ImGui::IsKeyPressed(ImGuiKey_RightAlt)
|
ImGui::IsKeyPressed(ImGuiKey_LeftAlt) || ImGui::IsKeyPressed(ImGuiKey_RightAlt)
|
||||||
) {
|
) {
|
||||||
m_unlockFrameRate = true;
|
this->unlockFrameRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unlock frame rate if there's more than one viewport since these don't call the glfw callbacks registered here
|
// Unlock frame rate if there's more than one viewport since these don't call the glfw callbacks registered here
|
||||||
if (ImGui::GetPlatformIO().Viewports.size() > 1)
|
if (ImGui::GetPlatformIO().Viewports.size() > 1)
|
||||||
m_unlockFrameRate = true;
|
this->unlockFrameRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide the window as soon as the render loop exits to make the window
|
// Hide the window as soon as the render loop exits to make the window
|
||||||
@@ -334,6 +337,9 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Window::frameBegin() {
|
void Window::frameBegin() {
|
||||||
|
// Run all deferred calls
|
||||||
|
TaskManager::runDeferredCalls();
|
||||||
|
|
||||||
ImGui_ImplOpenGL3_NewFrame();
|
ImGui_ImplOpenGL3_NewFrame();
|
||||||
ImGui_ImplGlfw_NewFrame();
|
ImGui_ImplGlfw_NewFrame();
|
||||||
|
|
||||||
@@ -343,7 +349,7 @@ namespace hex {
|
|||||||
auto ¤tFont = ImGui::GetIO().Fonts;
|
auto ¤tFont = ImGui::GetIO().Fonts;
|
||||||
for (const auto &[name, font] : fontDefinitions) {
|
for (const auto &[name, font] : fontDefinitions) {
|
||||||
// If the texture for this atlas has been built already, don't do it again
|
// If the texture for this atlas has been built already, don't do it again
|
||||||
if (font == nullptr || font->ContainerAtlas->TexID != 0)
|
if (font == nullptr || font->ContainerAtlas == nullptr || font->ContainerAtlas->TexID != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
currentFont = font->ContainerAtlas;
|
currentFont = font->ContainerAtlas;
|
||||||
@@ -353,7 +359,7 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const auto &font = ImHexApi::Fonts::getFont("hex.fonts.font.default");
|
auto font = ImHexApi::Fonts::getFont("hex.fonts.font.default");
|
||||||
|
|
||||||
if (font == nullptr) {
|
if (font == nullptr) {
|
||||||
const auto &io = ImGui::GetIO();
|
const auto &io = ImGui::GetIO();
|
||||||
@@ -362,13 +368,15 @@ namespace hex {
|
|||||||
ImFontConfig cfg;
|
ImFontConfig cfg;
|
||||||
cfg.OversampleH = cfg.OversampleV = 1, cfg.PixelSnapH = true;
|
cfg.OversampleH = cfg.OversampleV = 1, cfg.PixelSnapH = true;
|
||||||
cfg.SizePixels = ImHexApi::Fonts::DefaultFontSize;
|
cfg.SizePixels = ImHexApi::Fonts::DefaultFontSize;
|
||||||
io.Fonts->AddFontDefault(&cfg);
|
font = io.Fonts->AddFontDefault(&cfg);
|
||||||
ImGui_ImplOpenGL3_CreateFontsTexture();
|
ImGui_ImplOpenGL3_CreateFontsTexture();
|
||||||
io.Fonts->ClearInputData();
|
io.Fonts->ClearInputData();
|
||||||
io.Fonts->ClearTexData();
|
io.Fonts->ClearTexData();
|
||||||
} else {
|
} else {
|
||||||
currentFont = font->ContainerAtlas;
|
currentFont = font->ContainerAtlas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::SetCurrentFont(font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,9 +690,6 @@ namespace hex {
|
|||||||
return banner->shouldClose();
|
return banner->shouldClose();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run all deferred calls
|
|
||||||
TaskManager::runDeferredCalls();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::frame() {
|
void Window::frame() {
|
||||||
@@ -927,6 +932,23 @@ namespace hex {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Window::unlockFrameRate() {
|
||||||
|
{
|
||||||
|
std::scoped_lock lock(m_wakeupMutex);
|
||||||
|
m_remainingUnlockedTime = std::chrono::seconds(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->forceNewFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::forceNewFrame() {
|
||||||
|
std::scoped_lock lock(m_wakeupMutex);
|
||||||
|
m_wakeupFlag = true;
|
||||||
|
m_wakeupCondVar.notify_all();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Window::initGLFW() {
|
void Window::initGLFW() {
|
||||||
auto initialWindowProperties = ImHexApi::System::getInitialWindowProperties();
|
auto initialWindowProperties = ImHexApi::System::getInitialWindowProperties();
|
||||||
glfwSetErrorCallback([](int error, const char *desc) {
|
glfwSetErrorCallback([](int error, const char *desc) {
|
||||||
@@ -1027,7 +1049,7 @@ namespace hex {
|
|||||||
if (win == nullptr)
|
if (win == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
win->m_unlockFrameRate = true;
|
win->unlockFrameRate();
|
||||||
};
|
};
|
||||||
|
|
||||||
static const auto isMainWindow = [](GLFWwindow *window) {
|
static const auto isMainWindow = [](GLFWwindow *window) {
|
||||||
@@ -1163,7 +1185,7 @@ namespace hex {
|
|||||||
Duration passedTime = {};
|
Duration passedTime = {};
|
||||||
|
|
||||||
std::chrono::steady_clock::time_point startTime = {}, endTime = {};
|
std::chrono::steady_clock::time_point startTime = {}, endTime = {};
|
||||||
Duration requestedFrameTime = {}, remainingUnlockedTime = {};
|
Duration requestedFrameTime = {};
|
||||||
float targetFps = 0;
|
float targetFps = 0;
|
||||||
|
|
||||||
const auto nativeFps = []() -> float {
|
const auto nativeFps = []() -> float {
|
||||||
@@ -1182,32 +1204,36 @@ namespace hex {
|
|||||||
|
|
||||||
targetFps = ImHexApi::System::getTargetFPS();
|
targetFps = ImHexApi::System::getTargetFPS();
|
||||||
|
|
||||||
if (m_unlockFrameRate.exchange(false)) {
|
|
||||||
remainingUnlockedTime = std::chrono::seconds(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the target frame rate is below 15, use the current monitor's refresh rate
|
// If the target frame rate is below 15, use the current monitor's refresh rate
|
||||||
if (targetFps < 15) {
|
if (targetFps < 15) {
|
||||||
targetFps = nativeFps;
|
targetFps = nativeFps;
|
||||||
}
|
}
|
||||||
|
|
||||||
passedTime += iterationTime;
|
passedTime += iterationTime;
|
||||||
if (remainingUnlockedTime > std::chrono::nanoseconds(0)) {
|
{
|
||||||
remainingUnlockedTime -= iterationTime;
|
|
||||||
} else {
|
|
||||||
targetFps = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
requestedFrameTime = (Duration(1.0E9) / targetFps) / 1.3;
|
|
||||||
if (passedTime >= requestedFrameTime) {
|
|
||||||
std::scoped_lock lock(m_sleepMutex);
|
std::scoped_lock lock(m_sleepMutex);
|
||||||
m_sleepFlag = true;
|
|
||||||
m_sleepCondVar.notify_all();
|
|
||||||
|
|
||||||
passedTime = {};
|
if (m_remainingUnlockedTime > std::chrono::nanoseconds(0)) {
|
||||||
|
m_remainingUnlockedTime -= iterationTime;
|
||||||
|
} else {
|
||||||
|
targetFps = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
requestedFrameTime = (Duration(1.0E9) / targetFps) / 1.3;
|
||||||
|
if (passedTime >= requestedFrameTime) {
|
||||||
|
m_sleepFlag = true;
|
||||||
|
m_sleepCondVar.notify_all();
|
||||||
|
|
||||||
|
passedTime = {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
{
|
||||||
|
std::unique_lock lock(m_wakeupMutex);
|
||||||
|
m_wakeupCondVar.wait_for(lock, requestedFrameTime, [&] {
|
||||||
|
return m_wakeupFlag || stopToken.stop_requested();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
endTime = std::chrono::steady_clock::now();
|
endTime = std::chrono::steady_clock::now();
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 644 B After Width: | Height: | Size: 4.6 KiB |
@@ -781,8 +781,8 @@
|
|||||||
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Benutzerdefinierte Enkodierung laden...",
|
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Benutzerdefinierte Enkodierung laden...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save": "Speichern",
|
"hex.builtin.view.hex_editor.menu.file.save": "Speichern",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save_as": "Speichern unter...",
|
"hex.builtin.view.hex_editor.menu.file.save_as": "Speichern unter...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.search": "Suchen",
|
"hex.builtin.view.hex_editor.menu.file.search": "Suchen...",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.select": "Auswählen",
|
"hex.builtin.view.hex_editor.menu.edit.select": "Auswählen...",
|
||||||
"hex.builtin.view.hex_editor.name": "Hex Editor",
|
"hex.builtin.view.hex_editor.name": "Hex Editor",
|
||||||
"hex.builtin.view.hex_editor.search.find": "Suchen",
|
"hex.builtin.view.hex_editor.search.find": "Suchen",
|
||||||
"hex.builtin.view.hex_editor.search.hex": "Hex",
|
"hex.builtin.view.hex_editor.search.hex": "Hex",
|
||||||
@@ -1000,7 +1000,7 @@
|
|||||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||||
"hex.builtin.welcome.learn.pattern.title": "Pattern Language Dokumentation",
|
"hex.builtin.welcome.learn.pattern.title": "Pattern Language Dokumentation",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "Erweitere ImHex mit neuen Funktionen mit Plugins",
|
"hex.builtin.welcome.learn.plugins.desc": "Erweitere ImHex mit neuen Funktionen mit Plugins",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
|
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
|
||||||
"hex.builtin.welcome.quick_settings.simplified": "Simple Ansicht",
|
"hex.builtin.welcome.quick_settings.simplified": "Simple Ansicht",
|
||||||
"hex.builtin.welcome.start.create_file": "Neue Datei erstellen",
|
"hex.builtin.welcome.start.create_file": "Neue Datei erstellen",
|
||||||
|
|||||||
@@ -850,7 +850,7 @@
|
|||||||
"hex.builtin.view.hex_editor.menu.file.save": "Save",
|
"hex.builtin.view.hex_editor.menu.file.save": "Save",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save_as": "Save As...",
|
"hex.builtin.view.hex_editor.menu.file.save_as": "Save As...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.search": "Search...",
|
"hex.builtin.view.hex_editor.menu.file.search": "Search...",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.select": "Select",
|
"hex.builtin.view.hex_editor.menu.edit.select": "Select...",
|
||||||
"hex.builtin.view.hex_editor.name": "Hex editor",
|
"hex.builtin.view.hex_editor.name": "Hex editor",
|
||||||
"hex.builtin.view.hex_editor.search.find": "Find",
|
"hex.builtin.view.hex_editor.search.find": "Find",
|
||||||
"hex.builtin.view.hex_editor.search.hex": "Hex",
|
"hex.builtin.view.hex_editor.search.hex": "Hex",
|
||||||
@@ -1143,7 +1143,7 @@
|
|||||||
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
|
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
|
||||||
"hex.builtin.welcome.learn.imhex.title": "ImHex Documentation",
|
"hex.builtin.welcome.learn.imhex.title": "ImHex Documentation",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "Extend ImHex with additional features using plugins",
|
"hex.builtin.welcome.learn.plugins.desc": "Extend ImHex with additional features using plugins",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
|
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
|
||||||
"hex.builtin.popup.create_workspace.title": "Create new Workspace",
|
"hex.builtin.popup.create_workspace.title": "Create new Workspace",
|
||||||
"hex.builtin.popup.create_workspace.desc": "Enter a name for the new Workspace",
|
"hex.builtin.popup.create_workspace.desc": "Enter a name for the new Workspace",
|
||||||
|
|||||||
@@ -777,8 +777,8 @@
|
|||||||
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Cargar codificación personalizada...",
|
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Cargar codificación personalizada...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save": "Guardar",
|
"hex.builtin.view.hex_editor.menu.file.save": "Guardar",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save_as": "Guardar como...",
|
"hex.builtin.view.hex_editor.menu.file.save_as": "Guardar como...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.search": "Buscar",
|
"hex.builtin.view.hex_editor.menu.file.search": "Buscar...",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.select": "Seleccionar",
|
"hex.builtin.view.hex_editor.menu.edit.select": "Seleccionar...",
|
||||||
"hex.builtin.view.hex_editor.name": "Editor hexadecimal",
|
"hex.builtin.view.hex_editor.name": "Editor hexadecimal",
|
||||||
"hex.builtin.view.hex_editor.search.find": "Buscar",
|
"hex.builtin.view.hex_editor.search.find": "Buscar",
|
||||||
"hex.builtin.view.hex_editor.search.hex": "Hexadecimal",
|
"hex.builtin.view.hex_editor.search.hex": "Hexadecimal",
|
||||||
@@ -994,7 +994,7 @@
|
|||||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||||
"hex.builtin.welcome.learn.pattern.title": "Documentación de Pattern Language",
|
"hex.builtin.welcome.learn.pattern.title": "Documentación de Pattern Language",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "Extienda ImHex con características adicionales mediante plugins",
|
"hex.builtin.welcome.learn.plugins.desc": "Extienda ImHex con características adicionales mediante plugins",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "API de Plugins",
|
"hex.builtin.welcome.learn.plugins.title": "API de Plugins",
|
||||||
"hex.builtin.welcome.quick_settings.simplified": "",
|
"hex.builtin.welcome.quick_settings.simplified": "",
|
||||||
"hex.builtin.welcome.start.create_file": "Crear Nuevo Archivo",
|
"hex.builtin.welcome.start.create_file": "Crear Nuevo Archivo",
|
||||||
|
|||||||
@@ -778,8 +778,8 @@
|
|||||||
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Saját kódolás betöltése...",
|
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "Saját kódolás betöltése...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save": "Mentés",
|
"hex.builtin.view.hex_editor.menu.file.save": "Mentés",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save_as": "Mentés másként...",
|
"hex.builtin.view.hex_editor.menu.file.save_as": "Mentés másként...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.search": "Keresés",
|
"hex.builtin.view.hex_editor.menu.file.search": "Keresés...",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.select": "Kijelölés",
|
"hex.builtin.view.hex_editor.menu.edit.select": "Kijelölés...",
|
||||||
"hex.builtin.view.hex_editor.name": "Hex szerkesztő",
|
"hex.builtin.view.hex_editor.name": "Hex szerkesztő",
|
||||||
"hex.builtin.view.hex_editor.search.find": "Kereső",
|
"hex.builtin.view.hex_editor.search.find": "Kereső",
|
||||||
"hex.builtin.view.hex_editor.search.hex": "Hex",
|
"hex.builtin.view.hex_editor.search.hex": "Hex",
|
||||||
@@ -1015,7 +1015,7 @@
|
|||||||
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
|
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
|
||||||
"hex.builtin.welcome.learn.imhex.title": "ImHex dokumentáció",
|
"hex.builtin.welcome.learn.imhex.title": "ImHex dokumentáció",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "ImHex funkcióinak bővítése bővítményekkel",
|
"hex.builtin.welcome.learn.plugins.desc": "ImHex funkcióinak bővítése bővítményekkel",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "Bővítmény API",
|
"hex.builtin.welcome.learn.plugins.title": "Bővítmény API",
|
||||||
"hex.builtin.popup.create_workspace.title": "Új munkaterület létrehozása",
|
"hex.builtin.popup.create_workspace.title": "Új munkaterület létrehozása",
|
||||||
"hex.builtin.popup.create_workspace.desc": "Adjon nevet az új munkaterületnek",
|
"hex.builtin.popup.create_workspace.desc": "Adjon nevet az új munkaterületnek",
|
||||||
|
|||||||
@@ -995,7 +995,7 @@
|
|||||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||||
"hex.builtin.welcome.learn.pattern.title": "Documentazione dei Pattern",
|
"hex.builtin.welcome.learn.pattern.title": "Documentazione dei Pattern",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "Espandi l'utilizzo di ImHex con i Plugin",
|
"hex.builtin.welcome.learn.plugins.desc": "Espandi l'utilizzo di ImHex con i Plugin",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
|
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
|
||||||
"hex.builtin.welcome.quick_settings.simplified": "",
|
"hex.builtin.welcome.quick_settings.simplified": "",
|
||||||
"hex.builtin.welcome.start.create_file": "Crea un nuovo File",
|
"hex.builtin.welcome.start.create_file": "Crea un nuovo File",
|
||||||
|
|||||||
@@ -995,7 +995,7 @@
|
|||||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||||
"hex.builtin.welcome.learn.pattern.title": "ImHexオリジナル言語について",
|
"hex.builtin.welcome.learn.pattern.title": "ImHexオリジナル言語について",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "ImHexの機能を拡張する",
|
"hex.builtin.welcome.learn.plugins.desc": "ImHexの機能を拡張する",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "プラグインAPI",
|
"hex.builtin.welcome.learn.plugins.title": "プラグインAPI",
|
||||||
"hex.builtin.welcome.quick_settings.simplified": "",
|
"hex.builtin.welcome.quick_settings.simplified": "",
|
||||||
"hex.builtin.welcome.start.create_file": "新規ファイルを作成",
|
"hex.builtin.welcome.start.create_file": "新規ファイルを作成",
|
||||||
|
|||||||
@@ -777,8 +777,8 @@
|
|||||||
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "사용자 정의 인코딩 불러오기...",
|
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "사용자 정의 인코딩 불러오기...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save": "저장",
|
"hex.builtin.view.hex_editor.menu.file.save": "저장",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save_as": "다른 이름으로 저장...",
|
"hex.builtin.view.hex_editor.menu.file.save_as": "다른 이름으로 저장...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.search": "검색",
|
"hex.builtin.view.hex_editor.menu.file.search": "검색...",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.select": "선택",
|
"hex.builtin.view.hex_editor.menu.edit.select": "선택...",
|
||||||
"hex.builtin.view.hex_editor.name": "헥스 편집기",
|
"hex.builtin.view.hex_editor.name": "헥스 편집기",
|
||||||
"hex.builtin.view.hex_editor.search.find": "찾기",
|
"hex.builtin.view.hex_editor.search.find": "찾기",
|
||||||
"hex.builtin.view.hex_editor.search.hex": "헥스",
|
"hex.builtin.view.hex_editor.search.hex": "헥스",
|
||||||
@@ -995,7 +995,7 @@
|
|||||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||||
"hex.builtin.welcome.learn.pattern.title": "패턴 언어 문서",
|
"hex.builtin.welcome.learn.pattern.title": "패턴 언어 문서",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "플러그인을 사용하여 추가 기능으로 ImHex를 확장하세요",
|
"hex.builtin.welcome.learn.plugins.desc": "플러그인을 사용하여 추가 기능으로 ImHex를 확장하세요",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "플러그인 API",
|
"hex.builtin.welcome.learn.plugins.title": "플러그인 API",
|
||||||
"hex.builtin.welcome.quick_settings.simplified": "단순화",
|
"hex.builtin.welcome.quick_settings.simplified": "단순화",
|
||||||
"hex.builtin.welcome.start.create_file": "새 파일 만들기",
|
"hex.builtin.welcome.start.create_file": "새 파일 만들기",
|
||||||
|
|||||||
@@ -995,7 +995,7 @@
|
|||||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||||
"hex.builtin.welcome.learn.pattern.title": "Documentação da linguagem padrão",
|
"hex.builtin.welcome.learn.pattern.title": "Documentação da linguagem padrão",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "Estenda o ImHex com recursos adicionais usando plugins",
|
"hex.builtin.welcome.learn.plugins.desc": "Estenda o ImHex com recursos adicionais usando plugins",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
|
"hex.builtin.welcome.learn.plugins.title": "Plugins API",
|
||||||
"hex.builtin.welcome.quick_settings.simplified": "",
|
"hex.builtin.welcome.quick_settings.simplified": "",
|
||||||
"hex.builtin.welcome.start.create_file": "Criar Novo Arquivo",
|
"hex.builtin.welcome.start.create_file": "Criar Novo Arquivo",
|
||||||
|
|||||||
@@ -1111,7 +1111,7 @@
|
|||||||
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
|
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
|
||||||
"hex.builtin.welcome.learn.imhex.title": "Документация ImHex",
|
"hex.builtin.welcome.learn.imhex.title": "Документация ImHex",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "Расширьте возможности ImHex с помощью плагинов",
|
"hex.builtin.welcome.learn.plugins.desc": "Расширьте возможности ImHex с помощью плагинов",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "API плагинов",
|
"hex.builtin.welcome.learn.plugins.title": "API плагинов",
|
||||||
"hex.builtin.popup.create_workspace.title": "Создать новое пространство",
|
"hex.builtin.popup.create_workspace.title": "Создать новое пространство",
|
||||||
"hex.builtin.popup.create_workspace.desc": "Введите имя нового пространства",
|
"hex.builtin.popup.create_workspace.desc": "Введите имя нового пространства",
|
||||||
|
|||||||
@@ -849,7 +849,7 @@
|
|||||||
"hex.builtin.view.hex_editor.menu.edit.paste_all": "粘贴全部",
|
"hex.builtin.view.hex_editor.menu.edit.paste_all": "粘贴全部",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.remove": "删除……",
|
"hex.builtin.view.hex_editor.menu.edit.remove": "删除……",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.resize": "修改大小……",
|
"hex.builtin.view.hex_editor.menu.edit.resize": "修改大小……",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.select": "选择",
|
"hex.builtin.view.hex_editor.menu.edit.select": "选择……",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.select_all": "全选",
|
"hex.builtin.view.hex_editor.menu.edit.select_all": "全选",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.set_base": "设置基地址",
|
"hex.builtin.view.hex_editor.menu.edit.set_base": "设置基地址",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.set_page_size": "设置页面大小",
|
"hex.builtin.view.hex_editor.menu.edit.set_page_size": "设置页面大小",
|
||||||
@@ -1058,7 +1058,7 @@
|
|||||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||||
"hex.builtin.welcome.learn.pattern.title": "模式文档",
|
"hex.builtin.welcome.learn.pattern.title": "模式文档",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": "通过插件扩展 ImHex 获得更多功能",
|
"hex.builtin.welcome.learn.plugins.desc": "通过插件扩展 ImHex 获得更多功能",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "插件 API",
|
"hex.builtin.welcome.learn.plugins.title": "插件 API",
|
||||||
"hex.builtin.welcome.nightly_build": "你正在运行ImHex的夜间构建。\n\n请在GitHub问题跟踪器上报告您遇到的任何错误!",
|
"hex.builtin.welcome.nightly_build": "你正在运行ImHex的夜间构建。\n\n请在GitHub问题跟踪器上报告您遇到的任何错误!",
|
||||||
"hex.builtin.welcome.quick_settings.simplified": "简化",
|
"hex.builtin.welcome.quick_settings.simplified": "简化",
|
||||||
|
|||||||
@@ -777,8 +777,8 @@
|
|||||||
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "載入自訂編碼...",
|
"hex.builtin.view.hex_editor.menu.file.load_encoding_file": "載入自訂編碼...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save": "儲存",
|
"hex.builtin.view.hex_editor.menu.file.save": "儲存",
|
||||||
"hex.builtin.view.hex_editor.menu.file.save_as": "另存為...",
|
"hex.builtin.view.hex_editor.menu.file.save_as": "另存為...",
|
||||||
"hex.builtin.view.hex_editor.menu.file.search": "搜尋",
|
"hex.builtin.view.hex_editor.menu.file.search": "搜尋...",
|
||||||
"hex.builtin.view.hex_editor.menu.edit.select": "選取",
|
"hex.builtin.view.hex_editor.menu.edit.select": "選取...",
|
||||||
"hex.builtin.view.hex_editor.name": "十六進位編輯器",
|
"hex.builtin.view.hex_editor.name": "十六進位編輯器",
|
||||||
"hex.builtin.view.hex_editor.search.find": "尋找",
|
"hex.builtin.view.hex_editor.search.find": "尋找",
|
||||||
"hex.builtin.view.hex_editor.search.hex": "十六進位",
|
"hex.builtin.view.hex_editor.search.hex": "十六進位",
|
||||||
@@ -995,7 +995,7 @@
|
|||||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||||
"hex.builtin.welcome.learn.pattern.title": "模式語言說明文件",
|
"hex.builtin.welcome.learn.pattern.title": "模式語言說明文件",
|
||||||
"hex.builtin.welcome.learn.plugins.desc": " 使用外掛程式來拓展 ImHex 的功能",
|
"hex.builtin.welcome.learn.plugins.desc": " 使用外掛程式來拓展 ImHex 的功能",
|
||||||
"hex.builtin.welcome.learn.plugins.link": "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide",
|
"hex.builtin.welcome.learn.plugins.link": "https://docs.werwolv.net/imhex/common/extending-imhex",
|
||||||
"hex.builtin.welcome.learn.plugins.title": "外掛程式 API",
|
"hex.builtin.welcome.learn.plugins.title": "外掛程式 API",
|
||||||
"hex.builtin.welcome.quick_settings.simplified": "",
|
"hex.builtin.welcome.quick_settings.simplified": "",
|
||||||
"hex.builtin.welcome.start.create_file": "建立新檔案",
|
"hex.builtin.welcome.start.create_file": "建立新檔案",
|
||||||
|
|||||||
@@ -33,6 +33,9 @@
|
|||||||
namespace hex::plugin::builtin {
|
namespace hex::plugin::builtin {
|
||||||
|
|
||||||
bool ProcessMemoryProvider::open() {
|
bool ProcessMemoryProvider::open() {
|
||||||
|
if (m_selectedProcess == nullptr)
|
||||||
|
return false;
|
||||||
|
|
||||||
#if defined(OS_WINDOWS)
|
#if defined(OS_WINDOWS)
|
||||||
m_processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, m_selectedProcess->id);
|
m_processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, m_selectedProcess->id);
|
||||||
if (m_processHandle == nullptr)
|
if (m_processHandle == nullptr)
|
||||||
|
|||||||
@@ -52,9 +52,10 @@ namespace hex::plugin::builtin {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
EventProviderClosing::subscribe(this, [this](const prv::Provider *provider, bool*) {
|
EventProviderClosing::subscribe(this, [this](const prv::Provider *provider, bool*) {
|
||||||
if (m_provider == provider)
|
if (m_provider == provider) {
|
||||||
ImHexApi::Provider::remove(this, false);
|
ImHexApi::Provider::remove(this, false);
|
||||||
m_provider = nullptr;
|
m_provider = nullptr;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ namespace hex::plugin::builtin {
|
|||||||
}, nullptr);
|
}, nullptr);
|
||||||
ImPlot::SetupAxisTicks(ImAxis_Y1, 0, largestFrameTime * 1.25F, 3);
|
ImPlot::SetupAxisTicks(ImAxis_Y1, 0, largestFrameTime * 1.25F, 3);
|
||||||
|
|
||||||
static std::vector<double> values(100);
|
static std::vector<double> values(100, 0.0);
|
||||||
|
|
||||||
values.push_back(ImHexApi::System::getLastFrameTime());
|
values.push_back(ImHexApi::System::getLastFrameTime());
|
||||||
if (values.size() > 100)
|
if (values.size() > 100)
|
||||||
|
|||||||
@@ -1089,10 +1089,6 @@ namespace hex::plugin::builtin {
|
|||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
|
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetStyle().FramePadding.y + 1_scaled);
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetStyle().FramePadding.y + 1_scaled);
|
||||||
if (m_patternEvaluating && m_runningEvaluators == 0) {
|
|
||||||
m_patternEvaluating = false;
|
|
||||||
m_textEditor.JumpToLine();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewPatternEditor::drawEnvVars(ImVec2 size, std::list<EnvVar> &envVars) {
|
void ViewPatternEditor::drawEnvVars(ImVec2 size, std::list<EnvVar> &envVars) {
|
||||||
@@ -1953,7 +1949,8 @@ namespace hex::plugin::builtin {
|
|||||||
runtime.setLogCallback([this, provider](auto level, auto message) {
|
runtime.setLogCallback([this, provider](auto level, auto message) {
|
||||||
std::scoped_lock lock(m_logMutex);
|
std::scoped_lock lock(m_logMutex);
|
||||||
|
|
||||||
for (auto line : wolv::util::splitString(message, "\n")) {
|
auto lines = wolv::util::splitString(message, "\n");
|
||||||
|
for (auto &line : lines) {
|
||||||
if (!wolv::util::trim(line).empty()) {
|
if (!wolv::util::trim(line).empty()) {
|
||||||
switch (level) {
|
switch (level) {
|
||||||
using enum pl::core::LogConsole::Level;
|
using enum pl::core::LogConsole::Level;
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ namespace hex::plugin::builtin {
|
|||||||
if (ImHexApi::System::isBorderlessWindowModeEnabled()) {
|
if (ImHexApi::System::isBorderlessWindowModeEnabled()) {
|
||||||
#if defined(OS_WINDOWS)
|
#if defined(OS_WINDOWS)
|
||||||
ImGui::SetCursorPosX(5_scaled);
|
ImGui::SetCursorPosX(5_scaled);
|
||||||
ImGui::Image(*s_logoTexture, s_logoTexture->getSize() * u32(1_scaled));
|
ImGui::Image(*s_logoTexture, s_logoTexture->getSize() * 0.1_scaled);
|
||||||
ImGui::SetCursorPosX(5_scaled);
|
ImGui::SetCursorPosX(5_scaled);
|
||||||
ImGui::InvisibleButton("##logo", ImVec2(menuBarHeight, menuBarHeight));
|
ImGui::InvisibleButton("##logo", ImVec2(menuBarHeight, menuBarHeight));
|
||||||
if (ImGui::IsItemHovered() && ImGui::IsAnyMouseDown())
|
if (ImGui::IsItemHovered() && ImGui::IsAnyMouseDown())
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ namespace hex::plugin::diffing {
|
|||||||
column.provider = -1;
|
column.provider = -1;
|
||||||
column.hexEditor.setSelectionUnchecked(std::nullopt, std::nullopt);
|
column.hexEditor.setSelectionUnchecked(std::nullopt, std::nullopt);
|
||||||
column.diffTree.clear();
|
column.diffTree.clear();
|
||||||
|
column.differences.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,32 +355,34 @@ namespace hex::plugin::diffing {
|
|||||||
// Draw changes
|
// Draw changes
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Indent();
|
ImGui::Indent();
|
||||||
switch (typeA) {
|
if (a.provider != -1 && b.provider != -1) {
|
||||||
case DifferenceType::Insertion:
|
switch (typeA) {
|
||||||
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
|
case DifferenceType::Insertion:
|
||||||
providers[a.provider]->read(regionA.start, data.data(), data.size());
|
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
|
||||||
drawByteString(data);
|
providers[a.provider]->read(regionA.start, data.data(), data.size());
|
||||||
break;
|
drawByteString(data);
|
||||||
case DifferenceType::Mismatch:
|
break;
|
||||||
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
|
case DifferenceType::Mismatch:
|
||||||
providers[a.provider]->read(regionA.start, data.data(), data.size());
|
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
|
||||||
drawByteString(data);
|
providers[a.provider]->read(regionA.start, data.data(), data.size());
|
||||||
|
drawByteString(data);
|
||||||
|
|
||||||
ImGui::SameLine(0, 0);
|
ImGui::SameLine(0, 0);
|
||||||
ImGuiExt::TextFormatted(" {} ", ICON_VS_ARROW_RIGHT);
|
ImGuiExt::TextFormatted(" {} ", ICON_VS_ARROW_RIGHT);
|
||||||
ImGui::SameLine(0, 0);
|
ImGui::SameLine(0, 0);
|
||||||
|
|
||||||
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
|
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
|
||||||
providers[b.provider]->read(regionB.start, data.data(), data.size());
|
providers[b.provider]->read(regionB.start, data.data(), data.size());
|
||||||
drawByteString(data);
|
drawByteString(data);
|
||||||
break;
|
break;
|
||||||
case DifferenceType::Deletion:
|
case DifferenceType::Deletion:
|
||||||
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
|
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
|
||||||
providers[b.provider]->read(regionB.start, data.data(), data.size());
|
providers[b.provider]->read(regionB.start, data.data(), data.size());
|
||||||
drawByteString(data);
|
drawByteString(data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::Unindent();
|
ImGui::Unindent();
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ namespace hex::plugin::disasm {
|
|||||||
|
|
||||||
for (u8 byte : instruction.bytes)
|
for (u8 byte : instruction.bytes)
|
||||||
disassembly.bytes += hex::format("{0:02X} ", byte);
|
disassembly.bytes += hex::format("{0:02X} ", byte);
|
||||||
disassembly.bytes.pop_back();
|
if (!disassembly.bytes.empty())
|
||||||
|
disassembly.bytes.pop_back();
|
||||||
|
|
||||||
return disassembly;
|
return disassembly;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ namespace hex::plugin::disasm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ViewDisassembler::~ViewDisassembler() {
|
ViewDisassembler::~ViewDisassembler() {
|
||||||
EventDataChanged::unsubscribe(this);
|
|
||||||
EventRegionSelected::unsubscribe(this);
|
|
||||||
EventProviderDeleted::unsubscribe(this);
|
EventProviderDeleted::unsubscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,6 +52,10 @@ namespace hex::plugin::disasm {
|
|||||||
|
|
||||||
// Create a capstone disassembler instance
|
// Create a capstone disassembler instance
|
||||||
if (currArchitecture->start()) {
|
if (currArchitecture->start()) {
|
||||||
|
ON_SCOPE_EXIT {
|
||||||
|
currArchitecture->end();
|
||||||
|
};
|
||||||
|
|
||||||
std::vector<u8> buffer(1_MiB, 0x00);
|
std::vector<u8> buffer(1_MiB, 0x00);
|
||||||
|
|
||||||
const u64 codeOffset = region.getStartAddress() - m_imageBaseAddress;
|
const u64 codeOffset = region.getStartAddress() - m_imageBaseAddress;
|
||||||
@@ -95,8 +97,6 @@ namespace hex::plugin::disasm {
|
|||||||
if (hadError) break;
|
if (hadError) break;
|
||||||
hadError = true;
|
hadError = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
currArchitecture->end();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -138,59 +138,64 @@ namespace hex::plugin::disasm {
|
|||||||
auto ®ion = m_regionToDisassemble.get(provider);
|
auto ®ion = m_regionToDisassemble.get(provider);
|
||||||
auto &range = m_range.get(provider);
|
auto &range = m_range.get(provider);
|
||||||
|
|
||||||
// Draw region selection picker
|
ImGui::BeginDisabled(m_disassemblerTask.isRunning());
|
||||||
ui::regionSelectionPicker(®ion, provider, &range, true, true);
|
|
||||||
|
|
||||||
ImGuiExt::Header("hex.disassembler.view.disassembler.position"_lang);
|
|
||||||
|
|
||||||
// Draw base address input
|
|
||||||
{
|
{
|
||||||
auto &address = m_imageLoadAddress.get(provider);
|
// Draw region selection picker
|
||||||
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_load_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
|
ui::regionSelectionPicker(®ion, provider, &range, true, true);
|
||||||
ImGui::SameLine();
|
|
||||||
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_load_address.hint"_lang, ICON_VS_INFO);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw code region start address input
|
ImGuiExt::Header("hex.disassembler.view.disassembler.position"_lang);
|
||||||
ImGui::BeginDisabled(m_range == ui::RegionType::EntireData);
|
|
||||||
{
|
// Draw base address input
|
||||||
auto &address = m_imageBaseAddress.get(provider);
|
{
|
||||||
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_base_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
|
auto &address = m_imageLoadAddress.get(provider);
|
||||||
ImGui::SameLine();
|
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_load_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
|
||||||
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_base_address.hint"_lang, ICON_VS_INFO);
|
ImGui::SameLine();
|
||||||
|
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_load_address.hint"_lang, ICON_VS_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw code region start address input
|
||||||
|
ImGui::BeginDisabled(m_range == ui::RegionType::EntireData);
|
||||||
|
{
|
||||||
|
auto &address = m_imageBaseAddress.get(provider);
|
||||||
|
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_base_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_base_address.hint"_lang, ICON_VS_INFO);
|
||||||
|
}
|
||||||
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
|
// Draw settings
|
||||||
|
{
|
||||||
|
ImGuiExt::Header("hex.ui.common.settings"_lang);
|
||||||
|
|
||||||
|
// Draw architecture selector
|
||||||
|
const auto &architectures = ContentRegistry::Disassembler::impl::getArchitectures();
|
||||||
|
if (architectures.empty()) {
|
||||||
|
ImGuiExt::TextSpinner("hex.disassembler.view.disassembler.arch"_lang);
|
||||||
|
} else {
|
||||||
|
const auto &currArchitecture = m_currArchitecture.get(provider);
|
||||||
|
if (currArchitecture == nullptr) {
|
||||||
|
m_currArchitecture = architectures.begin()->second();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginCombo("hex.disassembler.view.disassembler.arch"_lang, currArchitecture->getName().c_str())) {
|
||||||
|
for (const auto &[name, creator] : architectures) {
|
||||||
|
if (ImGui::Selectable(name.c_str(), name == currArchitecture->getName())) {
|
||||||
|
m_currArchitecture = creator();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::EndCombo();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw sub-settings for each architecture
|
||||||
|
if (ImGuiExt::BeginBox()) {
|
||||||
|
currArchitecture->drawSettings();
|
||||||
|
}
|
||||||
|
ImGuiExt::EndBox();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
// Draw settings
|
|
||||||
{
|
|
||||||
ImGuiExt::Header("hex.ui.common.settings"_lang);
|
|
||||||
|
|
||||||
// Draw architecture selector
|
|
||||||
const auto &architectures = ContentRegistry::Disassembler::impl::getArchitectures();
|
|
||||||
if (architectures.empty()) {
|
|
||||||
ImGuiExt::TextSpinner("hex.disassembler.view.disassembler.arch"_lang);
|
|
||||||
} else {
|
|
||||||
const auto &currArchitecture = m_currArchitecture.get(provider);
|
|
||||||
if (currArchitecture == nullptr) {
|
|
||||||
m_currArchitecture = architectures.begin()->second();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui::BeginCombo("hex.disassembler.view.disassembler.arch"_lang, currArchitecture->getName().c_str())) {
|
|
||||||
for (const auto &[name, creator] : architectures) {
|
|
||||||
if (ImGui::Selectable(name.c_str(), name == currArchitecture->getName())) {
|
|
||||||
m_currArchitecture = creator();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ImGui::EndCombo();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw sub-settings for each architecture
|
|
||||||
if (ImGuiExt::BeginBox()) {
|
|
||||||
currArchitecture->drawSettings();
|
|
||||||
}
|
|
||||||
ImGuiExt::EndBox();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw disassemble button
|
// Draw disassemble button
|
||||||
ImGui::BeginDisabled(m_disassemblerTask.isRunning() || region.getStartAddress() < m_imageBaseAddress);
|
ImGui::BeginDisabled(m_disassemblerTask.isRunning() || region.getStartAddress() < m_imageBaseAddress);
|
||||||
|
|||||||
@@ -37,13 +37,18 @@ namespace hex::fonts {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 index = 0;
|
||||||
for (const auto &[path, fontName] : hex::getFonts()) {
|
for (const auto &[path, fontName] : hex::getFonts()) {
|
||||||
|
ImGui::PushID(index);
|
||||||
if (ImGui::Selectable(limitStringLength(fontName, 50).c_str(), m_path == path)) {
|
if (ImGui::Selectable(limitStringLength(fontName, 50).c_str(), m_path == path)) {
|
||||||
m_path = path;
|
m_path = path;
|
||||||
m_pixelPerfectFont = false;
|
m_pixelPerfectFont = false;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
ImGui::SetItemTooltip("%s", fontName.c_str());
|
ImGui::SetItemTooltip("%s", fontName.c_str());
|
||||||
|
ImGui::PopID();
|
||||||
|
|
||||||
|
index += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ namespace hex::fonts {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadFont(widget, name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());
|
TaskManager::doLater([&name, &font, &widget] {
|
||||||
|
loadFont(widget, name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
loadFont(widget.getWidget(), name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());
|
loadFont(widget.getWidget(), name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());
|
||||||
|
|||||||
Reference in New Issue
Block a user