From 1fa69b34a0968cf79461f37b8d9fdadba745b4d3 Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 8 Sep 2026 12:54:05 +0200 Subject: feat: source view zoom and line mentions --- src/ui/source_view.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/ui/source_view.h') diff --git a/src/ui/source_view.h b/src/ui/source_view.h index 5673d69..b38772b 100644 --- a/src/ui/source_view.h +++ b/src/ui/source_view.h @@ -7,6 +7,7 @@ #include #include #include +#include #include struct ImDrawList; @@ -44,6 +45,10 @@ namespace Hsdbg auto draw(Debugger& debugger) -> void; auto set_highlighted_line(uint32_t line) -> void; + + auto set_frame_extent(uint32_t first, uint32_t last) -> void; + + auto set_changed_locals(const std::unordered_set* names) -> void { m_changed_locals = names; } auto set_highlighting(bool enabled) -> void { m_highlighting_enabled = enabled; } auto set_line_numbers(bool enabled) -> void { m_line_numbers = enabled; } auto set_highlight_current_line(bool enabled) -> void { m_highlight_current_line = enabled; } @@ -52,6 +57,8 @@ namespace Hsdbg auto set_current_line_color(unsigned int color) -> void { m_current_line_color = color; } auto set_mono_font(ImFont* font) -> void { m_mono_font = font; } + auto set_font_size(float size) -> void { m_font_size = size; } + auto font_size() const -> float { return m_font_size; } auto path() const -> const std::filesystem::path& { return m_path; } auto line_count() const -> size_t { return m_lines.size(); } @@ -66,6 +73,7 @@ namespace Hsdbg private: auto draw_open_bar() -> void; auto draw_lines(Debugger& debugger) -> void; + auto handle_zoom() -> void; auto draw_macro_span(ImDrawList* draw_list, const std::string& line, const SourceSpan& span) -> void; @@ -91,5 +99,16 @@ namespace Hsdbg std::string m_error; uint32_t m_highlighted_line = 0; bool m_scroll_to_highlight = false; + + bool m_editing_path = false; + bool m_focus_path = false; + + float m_font_size = 16.0f; + float m_zoom_accumulator = 0.0f; + double m_zoom_badge_until = 0.0; + + uint32_t m_frame_first_line = 0; + uint32_t m_frame_last_line = 0; + const std::unordered_set* m_changed_locals = nullptr; }; } -- cgit v1.3