summaryrefslogtreecommitdiff
path: root/DevTools/HackStudio/Editor.h
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2020-04-24 23:48:25 +0300
committerAndreas Kling <kling@serenityos.org>2020-04-25 13:16:46 +0200
commit393560d8a2de4b507497786f3203e0c0cebb13c2 (patch)
tree207abdab49a27982d944358b714be64c66ccdd3a /DevTools/HackStudio/Editor.h
parent009b4ea3f418e3cd88a4b66e0d6531b871d270c7 (diff)
downloadserenity-393560d8a2de4b507497786f3203e0c0cebb13c2.zip
HackStudio: GUI support for setting breakpoints on source code lines
Diffstat (limited to 'DevTools/HackStudio/Editor.h')
-rw-r--r--DevTools/HackStudio/Editor.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/DevTools/HackStudio/Editor.h b/DevTools/HackStudio/Editor.h
index d188e3655c..e4197da613 100644
--- a/DevTools/HackStudio/Editor.h
+++ b/DevTools/HackStudio/Editor.h
@@ -26,6 +26,8 @@
#pragma once
+#include "BreakpointCallback.h"
+#include <AK/Optional.h>
#include <LibGUI/TextEditor.h>
#include <LibWeb/Forward.h>
@@ -42,6 +44,12 @@ public:
EditorWrapper& wrapper();
const EditorWrapper& wrapper() const;
+ const Vector<size_t>& breakpoint_lines() const { return m_breakpoint_lines; }
+ void set_execution_position(size_t line_number);
+ void clear_execution_position();
+
+ BreakpointChangeCallback on_breakpoint_change;
+
private:
virtual void focusin_event(Core::Event&) override;
virtual void focusout_event(Core::Event&) override;
@@ -56,6 +64,10 @@ private:
void show_documentation_tooltip_if_available(const String&, const Gfx::Point& screen_location);
void navigate_to_include_if_available(String);
+ Gfx::Rect breakpoint_icon_rect(size_t line_number) const;
+ static const Gfx::Bitmap& breakpoint_icon_bitmap();
+ static const Gfx::Bitmap& current_position_icon_bitmap();
+
explicit Editor();
RefPtr<GUI::Window> m_documentation_tooltip_window;
@@ -65,4 +77,8 @@ private:
bool m_hovering_editor { false };
bool m_hovering_link { false };
bool m_holding_ctrl { false };
+ bool m_hovering_lines_ruler { false };
+
+ Vector<size_t> m_breakpoint_lines;
+ Optional<size_t> m_execution_position;
};