mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
Compare commits
27 Commits
v1.37.1
...
releases/v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f8131b7c4 | ||
|
|
b6b24dfd29 | ||
|
|
041f113402 | ||
|
|
5f61fe2c4f | ||
|
|
96cc7e8ba8 | ||
|
|
22b3daf082 | ||
|
|
1deb27a6df | ||
|
|
73fdc3c6ea | ||
|
|
cae0f772d5 | ||
|
|
51547dc941 | ||
|
|
1508efac7a | ||
|
|
16dc239e0f | ||
|
|
899f00ed2f | ||
|
|
9ebfffd346 | ||
|
|
76b2c09450 | ||
|
|
69246de145 | ||
|
|
aee4b4fdf6 | ||
|
|
a6a78cef00 | ||
|
|
30b25a39a7 | ||
|
|
1f0b5e1ee1 | ||
|
|
d6658c3471 | ||
|
|
398eecaa1d | ||
|
|
b6616c1a0f | ||
|
|
5d3315f51c | ||
|
|
ec7298f0c0 | ||
|
|
92c2018f71 | ||
|
|
956952021d |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,6 +7,7 @@ build*/
|
||||
local/
|
||||
venv/
|
||||
.cache/
|
||||
install/
|
||||
|
||||
*.mgc
|
||||
*.kdev4
|
||||
|
||||
@@ -329,6 +329,7 @@ macro(createPackage)
|
||||
|
||||
install(FILES ${IMHEX_ICON} DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources")
|
||||
install(TARGETS main BUNDLE DESTINATION ".")
|
||||
install(TARGETS updater BUNDLE DESTINATION ".")
|
||||
|
||||
# Update library references to make the bundle portable
|
||||
postprocess_bundle(imhex_all main)
|
||||
@@ -666,12 +667,15 @@ macro(setupCompilerFlags target)
|
||||
addCCXXFlag("-Wno-unknown-pragmas" ${target})
|
||||
|
||||
# Enable hardening flags
|
||||
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
|
||||
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
|
||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
|
||||
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
|
||||
|
||||
if (NOT EMSCRIPTEN)
|
||||
addCommonFlag("-fstack-protector-strong" ${target})
|
||||
if (NOT EMSCRIPTEN)
|
||||
addCommonFlag("-fstack-protector-strong" ${target})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
@@ -800,8 +804,8 @@ macro(addBundledLibraries)
|
||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/lunasvg EXCLUDE_FROM_ALL)
|
||||
set(LUNASVG_LIBRARIES lunasvg)
|
||||
else()
|
||||
find_package(LunaSVG REQUIRED)
|
||||
set(LUNASVG_LIBRARIES lunasvg)
|
||||
find_package(lunasvg REQUIRED)
|
||||
set(LUNASVG_LIBRARIES lunasvg::lunasvg)
|
||||
endif()
|
||||
|
||||
if (NOT USE_SYSTEM_LLVM)
|
||||
@@ -925,11 +929,17 @@ function(generateSDKDirectory)
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
|
||||
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/ui DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
|
||||
install(TARGETS ui ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/ui/include DESTINATION "${SDK_PATH}/lib/ui/include")
|
||||
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(TARGETS fonts ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/fonts/include DESTINATION "${SDK_PATH}/lib/fonts/include")
|
||||
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()
|
||||
|
||||
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
|
||||
%{_libdir}/libimhex.so*
|
||||
%{_libdir}/%{name}/
|
||||
%{_libdir}/*.hexpluglib
|
||||
/usr/lib/debug/%{_libdir}/*.debug
|
||||
%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
|
||||
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: 72e9b93c8f...9833500589
@@ -327,6 +327,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
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)) {
|
||||
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindowRead());
|
||||
|
||||
|
||||
@@ -260,9 +260,6 @@ namespace ImGuiExt {
|
||||
}
|
||||
|
||||
Texture::Texture(Texture&& other) noexcept {
|
||||
if (m_textureId != 0)
|
||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
||||
|
||||
m_textureId = other.m_textureId;
|
||||
m_width = other.m_width;
|
||||
m_height = other.m_height;
|
||||
@@ -271,8 +268,10 @@ namespace ImGuiExt {
|
||||
}
|
||||
|
||||
Texture& Texture::operator=(Texture&& other) noexcept {
|
||||
if (m_textureId != 0)
|
||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
||||
if (this == &other)
|
||||
return *this;
|
||||
|
||||
this->reset();
|
||||
|
||||
m_textureId = other.m_textureId;
|
||||
m_width = other.m_width;
|
||||
@@ -288,6 +287,11 @@ namespace ImGuiExt {
|
||||
}
|
||||
|
||||
void Texture::reset() {
|
||||
#if !defined(OS_WEB)
|
||||
if (glDeleteTextures == nullptr)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (m_textureId != 0) {
|
||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
||||
m_textureId = 0;
|
||||
|
||||
@@ -53,6 +53,9 @@ namespace hex {
|
||||
void drawImGui();
|
||||
void drawWithShader();
|
||||
|
||||
void unlockFrameRate();
|
||||
void forceNewFrame();
|
||||
|
||||
GLFWwindow *m_window = nullptr;
|
||||
|
||||
std::string m_windowTitle, m_windowTitleFull;
|
||||
@@ -64,17 +67,22 @@ namespace hex {
|
||||
std::list<std::string> m_popupsToOpen;
|
||||
std::set<int> m_pressedKeys;
|
||||
|
||||
std::atomic<bool> m_unlockFrameRate = true;
|
||||
|
||||
ImGuiExt::ImHexCustomData m_imguiCustomData;
|
||||
|
||||
u32 m_searchBarPosition = 0;
|
||||
bool m_emergencyPopupOpen = false;
|
||||
|
||||
std::jthread m_frameRateThread;
|
||||
std::chrono::duration<double, std::nano> m_remainingUnlockedTime;
|
||||
|
||||
std::mutex m_sleepMutex;
|
||||
std::atomic<bool> m_sleepFlag;
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -42,12 +42,18 @@ namespace hex::messaging {
|
||||
|
||||
static auto listenerThread = std::jthread([](const std::stop_token &stopToken){
|
||||
std::vector<u8> buffer(0xFFFF);
|
||||
while (!stopToken.stop_requested()) {
|
||||
|
||||
while (true) {
|
||||
int result = ::read(fifo, buffer.data(), buffer.size());
|
||||
if (result > 0) {
|
||||
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");
|
||||
if (pipe == nullptr) return;
|
||||
|
||||
while (fgets(buffer.data(), buffer.size(), pipe) != nullptr)
|
||||
while (fgets(buffer.data(), buffer.size() - 1, pipe) != nullptr)
|
||||
result += buffer.data();
|
||||
|
||||
auto exitCode = WEXITSTATUS(pclose(pipe));
|
||||
|
||||
@@ -204,17 +204,20 @@ namespace hex {
|
||||
|
||||
i64 sleepTicks = 0;
|
||||
i64 sleepMilliSeconds = 0;
|
||||
if (delta >= 0) {
|
||||
sleepTicks = delta / period;
|
||||
} else {
|
||||
sleepTicks = -1 + delta / period;
|
||||
if (period > 0) {
|
||||
if (delta >= 0) {
|
||||
sleepTicks = 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);
|
||||
|
||||
return WVR_REDRAW;
|
||||
@@ -614,7 +617,7 @@ namespace hex {
|
||||
|
||||
glfwSetFramebufferSizeCallback(m_window, [](GLFWwindow* window, int width, int height) {
|
||||
auto *win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
||||
win->m_unlockFrameRate = true;
|
||||
win->unlockFrameRate();
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
ImHexApi::System::impl::setMainWindowSize(width, height);
|
||||
|
||||
@@ -100,6 +100,9 @@ namespace hex {
|
||||
}
|
||||
|
||||
Window::~Window() {
|
||||
m_frameRateThread.request_stop();
|
||||
m_frameRateThread.join();
|
||||
|
||||
EventProviderDeleted::unsubscribe(this);
|
||||
RequestCloseImHex::unsubscribe(this);
|
||||
RequestUpdateWindowTitle::unsubscribe(this);
|
||||
@@ -300,7 +303,7 @@ namespace hex {
|
||||
|
||||
{
|
||||
std::unique_lock lock(m_sleepMutex);
|
||||
m_sleepCondVar.wait_for(lock, std::chrono::microseconds(100));
|
||||
m_sleepCondVar.wait(lock);
|
||||
if (m_sleepFlag.exchange(false))
|
||||
break;
|
||||
}
|
||||
@@ -311,7 +314,7 @@ namespace hex {
|
||||
|
||||
// Unlock frame rate if any mouse button is being held down to allow drag scrolling to be smooth
|
||||
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
|
||||
if (
|
||||
@@ -320,12 +323,12 @@ namespace hex {
|
||||
ImGui::IsKeyPressed(ImGuiKey_LeftSuper) || ImGui::IsKeyPressed(ImGuiKey_RightSuper) ||
|
||||
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
|
||||
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
|
||||
@@ -334,6 +337,9 @@ namespace hex {
|
||||
}
|
||||
|
||||
void Window::frameBegin() {
|
||||
// Run all deferred calls
|
||||
TaskManager::runDeferredCalls();
|
||||
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui_ImplGlfw_NewFrame();
|
||||
|
||||
@@ -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) {
|
||||
const auto &io = ImGui::GetIO();
|
||||
@@ -362,13 +368,15 @@ namespace hex {
|
||||
ImFontConfig cfg;
|
||||
cfg.OversampleH = cfg.OversampleV = 1, cfg.PixelSnapH = true;
|
||||
cfg.SizePixels = ImHexApi::Fonts::DefaultFontSize;
|
||||
io.Fonts->AddFontDefault(&cfg);
|
||||
font = io.Fonts->AddFontDefault(&cfg);
|
||||
ImGui_ImplOpenGL3_CreateFontsTexture();
|
||||
io.Fonts->ClearInputData();
|
||||
io.Fonts->ClearTexData();
|
||||
} else {
|
||||
currentFont = font->ContainerAtlas;
|
||||
}
|
||||
|
||||
ImGui::SetCurrentFont(font);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -682,9 +690,6 @@ namespace hex {
|
||||
return banner->shouldClose();
|
||||
});
|
||||
}
|
||||
|
||||
// Run all deferred calls
|
||||
TaskManager::runDeferredCalls();
|
||||
}
|
||||
|
||||
void Window::frame() {
|
||||
@@ -927,6 +932,23 @@ namespace hex {
|
||||
#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() {
|
||||
auto initialWindowProperties = ImHexApi::System::getInitialWindowProperties();
|
||||
glfwSetErrorCallback([](int error, const char *desc) {
|
||||
@@ -1027,7 +1049,7 @@ namespace hex {
|
||||
if (win == nullptr)
|
||||
return;
|
||||
|
||||
win->m_unlockFrameRate = true;
|
||||
win->unlockFrameRate();
|
||||
};
|
||||
|
||||
static const auto isMainWindow = [](GLFWwindow *window) {
|
||||
@@ -1163,7 +1185,7 @@ namespace hex {
|
||||
Duration passedTime = {};
|
||||
|
||||
std::chrono::steady_clock::time_point startTime = {}, endTime = {};
|
||||
Duration requestedFrameTime = {}, remainingUnlockedTime = {};
|
||||
Duration requestedFrameTime = {};
|
||||
float targetFps = 0;
|
||||
|
||||
const auto nativeFps = []() -> float {
|
||||
@@ -1182,32 +1204,37 @@ namespace hex {
|
||||
|
||||
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 (targetFps < 15) {
|
||||
targetFps = nativeFps;
|
||||
}
|
||||
|
||||
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);
|
||||
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();
|
||||
});
|
||||
m_wakeupFlag = false;
|
||||
}
|
||||
|
||||
endTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 644 B After Width: | Height: | Size: 4.6 KiB |
@@ -1000,7 +1000,7 @@
|
||||
"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.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.quick_settings.simplified": "Simple Ansicht",
|
||||
"hex.builtin.welcome.start.create_file": "Neue Datei erstellen",
|
||||
|
||||
@@ -1143,7 +1143,7 @@
|
||||
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
|
||||
"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.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.popup.create_workspace.title": "Create new Workspace",
|
||||
"hex.builtin.popup.create_workspace.desc": "Enter a name for the new Workspace",
|
||||
|
||||
@@ -994,7 +994,7 @@
|
||||
"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.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.quick_settings.simplified": "",
|
||||
"hex.builtin.welcome.start.create_file": "Crear Nuevo Archivo",
|
||||
|
||||
@@ -1015,7 +1015,7 @@
|
||||
"hex.builtin.welcome.learn.imhex.link": "https://docs.werwolv.net/imhex/",
|
||||
"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.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.popup.create_workspace.title": "Új munkaterület létrehozása",
|
||||
"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.title": "Documentazione dei Pattern",
|
||||
"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.quick_settings.simplified": "",
|
||||
"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.title": "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.quick_settings.simplified": "",
|
||||
"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.title": "패턴 언어 문서",
|
||||
"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.quick_settings.simplified": "단순화",
|
||||
"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.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.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.quick_settings.simplified": "",
|
||||
"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.title": "Документация 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.popup.create_workspace.title": "Создать новое пространство",
|
||||
"hex.builtin.popup.create_workspace.desc": "Введите имя нового пространства",
|
||||
|
||||
@@ -1058,7 +1058,7 @@
|
||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||
"hex.builtin.welcome.learn.pattern.title": "模式文档",
|
||||
"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.nightly_build": "你正在运行ImHex的夜间构建。\n\n请在GitHub问题跟踪器上报告您遇到的任何错误!",
|
||||
"hex.builtin.welcome.quick_settings.simplified": "简化",
|
||||
|
||||
@@ -995,7 +995,7 @@
|
||||
"hex.builtin.welcome.learn.pattern.link": "https://docs.werwolv.net/pattern-language/",
|
||||
"hex.builtin.welcome.learn.pattern.title": "模式語言說明文件",
|
||||
"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.quick_settings.simplified": "",
|
||||
"hex.builtin.welcome.start.create_file": "建立新檔案",
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace hex::plugin::builtin {
|
||||
if (ImHexApi::System::isBorderlessWindowModeEnabled()) {
|
||||
#if defined(OS_WINDOWS)
|
||||
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::InvisibleButton("##logo", ImVec2(menuBarHeight, menuBarHeight));
|
||||
if (ImGui::IsItemHovered() && ImGui::IsAnyMouseDown())
|
||||
|
||||
@@ -122,6 +122,7 @@ namespace hex::plugin::diffing {
|
||||
column.provider = -1;
|
||||
column.hexEditor.setSelectionUnchecked(std::nullopt, std::nullopt);
|
||||
column.diffTree.clear();
|
||||
column.differences.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,32 +355,34 @@ namespace hex::plugin::diffing {
|
||||
// Draw changes
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Indent();
|
||||
switch (typeA) {
|
||||
case DifferenceType::Insertion:
|
||||
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
|
||||
providers[a.provider]->read(regionA.start, data.data(), data.size());
|
||||
drawByteString(data);
|
||||
break;
|
||||
case DifferenceType::Mismatch:
|
||||
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
|
||||
providers[a.provider]->read(regionA.start, data.data(), data.size());
|
||||
drawByteString(data);
|
||||
if (a.provider != -1 && b.provider != -1) {
|
||||
switch (typeA) {
|
||||
case DifferenceType::Insertion:
|
||||
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
|
||||
providers[a.provider]->read(regionA.start, data.data(), data.size());
|
||||
drawByteString(data);
|
||||
break;
|
||||
case DifferenceType::Mismatch:
|
||||
data.resize(std::min<u64>(17, (regionA.end - regionA.start) + 1));
|
||||
providers[a.provider]->read(regionA.start, data.data(), data.size());
|
||||
drawByteString(data);
|
||||
|
||||
ImGui::SameLine(0, 0);
|
||||
ImGuiExt::TextFormatted(" {} ", ICON_VS_ARROW_RIGHT);
|
||||
ImGui::SameLine(0, 0);
|
||||
ImGui::SameLine(0, 0);
|
||||
ImGuiExt::TextFormatted(" {} ", ICON_VS_ARROW_RIGHT);
|
||||
ImGui::SameLine(0, 0);
|
||||
|
||||
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
|
||||
providers[b.provider]->read(regionB.start, data.data(), data.size());
|
||||
drawByteString(data);
|
||||
break;
|
||||
case DifferenceType::Deletion:
|
||||
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
|
||||
providers[b.provider]->read(regionB.start, data.data(), data.size());
|
||||
drawByteString(data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
|
||||
providers[b.provider]->read(regionB.start, data.data(), data.size());
|
||||
drawByteString(data);
|
||||
break;
|
||||
case DifferenceType::Deletion:
|
||||
data.resize(std::min<u64>(17, (regionB.end - regionB.start) + 1));
|
||||
providers[b.provider]->read(regionB.start, data.data(), data.size());
|
||||
drawByteString(data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
ImGui::Unindent();
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ namespace hex::plugin::disasm {
|
||||
|
||||
// Create a capstone disassembler instance
|
||||
if (currArchitecture->start()) {
|
||||
ON_SCOPE_EXIT {
|
||||
currArchitecture->end();
|
||||
};
|
||||
|
||||
std::vector<u8> buffer(1_MiB, 0x00);
|
||||
|
||||
const u64 codeOffset = region.getStartAddress() - m_imageBaseAddress;
|
||||
@@ -93,8 +97,6 @@ namespace hex::plugin::disasm {
|
||||
if (hadError) break;
|
||||
hadError = true;
|
||||
}
|
||||
|
||||
currArchitecture->end();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -136,59 +138,64 @@ namespace hex::plugin::disasm {
|
||||
auto ®ion = m_regionToDisassemble.get(provider);
|
||||
auto &range = m_range.get(provider);
|
||||
|
||||
// Draw region selection picker
|
||||
ui::regionSelectionPicker(®ion, provider, &range, true, true);
|
||||
|
||||
ImGuiExt::Header("hex.disassembler.view.disassembler.position"_lang);
|
||||
|
||||
// Draw base address input
|
||||
ImGui::BeginDisabled(m_disassemblerTask.isRunning());
|
||||
{
|
||||
auto &address = m_imageLoadAddress.get(provider);
|
||||
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_load_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
|
||||
ImGui::SameLine();
|
||||
ImGuiExt::HelpHover("hex.disassembler.view.disassembler.image_load_address.hint"_lang, ICON_VS_INFO);
|
||||
}
|
||||
// Draw region selection picker
|
||||
ui::regionSelectionPicker(®ion, provider, &range, true, true);
|
||||
|
||||
// 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);
|
||||
ImGuiExt::Header("hex.disassembler.view.disassembler.position"_lang);
|
||||
|
||||
// Draw base address input
|
||||
{
|
||||
auto &address = m_imageLoadAddress.get(provider);
|
||||
ImGuiExt::InputHexadecimal("hex.disassembler.view.disassembler.image_load_address"_lang, &address, ImGuiInputTextFlags_CharsHexadecimal);
|
||||
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();
|
||||
|
||||
// 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
|
||||
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()) {
|
||||
ImGui::PushID(index);
|
||||
if (ImGui::Selectable(limitStringLength(fontName, 50).c_str(), m_path == path)) {
|
||||
m_path = path;
|
||||
m_pixelPerfectFont = false;
|
||||
changed = true;
|
||||
}
|
||||
ImGui::SetItemTooltip("%s", fontName.c_str());
|
||||
ImGui::PopID();
|
||||
|
||||
index += 1;
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
|
||||
@@ -65,7 +65,9 @@ namespace hex::fonts {
|
||||
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());
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
|
||||
#include <hex/helpers/logger.hpp>
|
||||
#include <hex/helpers/menu_items.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <loaders/dotnet/dotnet_loader.hpp>
|
||||
@@ -88,7 +89,7 @@ std::vector<const Script*> loadAllScripts() {
|
||||
hex::ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.extras" }, 5000, [] {
|
||||
static bool menuJustOpened = true;
|
||||
|
||||
if (ImGui::BeginMenuEx("hex.script_loader.menu.run_script"_lang, ICON_VS_LIBRARY)) {
|
||||
if (menu::beginMenuEx("hex.script_loader.menu.run_script"_lang, ICON_VS_LIBRARY)) {
|
||||
if (menuJustOpened) {
|
||||
menuJustOpened = false;
|
||||
if (!updaterTask.isRunning()) {
|
||||
@@ -99,9 +100,9 @@ std::vector<const Script*> loadAllScripts() {
|
||||
}
|
||||
|
||||
if (updaterTask.isRunning()) {
|
||||
ImGuiExt::TextSpinner("hex.script_loader.menu.loading"_lang);
|
||||
menu::menuItem("hex.script_loader.menu.loading"_lang, Shortcut::None, false, false);
|
||||
} else if (scripts.empty()) {
|
||||
ImGui::TextUnformatted("hex.script_loader.menu.no_scripts"_lang);
|
||||
menu::menuItem("hex.script_loader.menu.no_scripts"_lang, Shortcut::None, false, false);
|
||||
}
|
||||
|
||||
for (const auto &script : scripts) {
|
||||
@@ -109,14 +110,14 @@ std::vector<const Script*> loadAllScripts() {
|
||||
if (background)
|
||||
continue;
|
||||
|
||||
if (ImGui::MenuItem(name.c_str(), loader->getTypeName().c_str())) {
|
||||
if (menu::menuItem(name.c_str())) {
|
||||
runnerTask = TaskManager::createTask("hex.script_loader.task.running", TaskManager::NoProgress, [entryPoint](auto&) {
|
||||
entryPoint();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndMenu();
|
||||
menu::endMenu();
|
||||
} else {
|
||||
menuJustOpened = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user