Commit graph

270 commits

Author SHA1 Message Date
Itamar
8af67210cf HackStudio: Detach from debugged process before terminating
Fixes #3308
2020-09-26 17:18:21 +02:00
Itamar
6c73fdf8d1 HackStudio: Fix FormEditor widget icons loading
Previously, when resolving the paths for the FormEditor widget icons
we didn't take into the account that calling class_name() returns the
widget name with a "GUI::" prefix.

Also, we now skip over widgets that we don't have an icon for.
2020-09-26 17:18:21 +02:00
Ben Wiederhake
25488ddcad Meta+DevTools: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
Itamar
b7bd2ed9d2 HackStudio: Add auto-complete capability to the Editor 2020-09-21 20:16:03 +02:00
Itamar
7d6e6eb268 HackStudio: Add AutoCompleteBox
Can be used to display the list of autocomplete suggestions and apply
a suggestion that was chosen by the user.
2020-09-21 20:16:03 +02:00
Itamar
42bdcf1828 HackStudio: Basic C++ autocomplete logic
CppAutoComplete gets a string of code and a position within it, and
returns a Vector of auto-complete suggestions that are relevant for the
given position.

Currently, it's very naive - it uses our CppLexer to find identifiers
in the code which the auto-complete target is a prefix of.
2020-09-21 20:16:03 +02:00
Itamar
e3e5e57fde HackStudio: Move bulk of GUI logic into HackStudioWidget
Previously, the GUI logic of HackStudio was all stuffed into main(),
and it started getting a bit out of hand :)
2020-09-19 21:39:05 +02:00
Itamar
b82a254da0 HackStudio: Only refresh Git widget on save if initialized 2020-09-18 15:20:55 +02:00
Itamar
1e96e46a81 HackStudio: Refresh the Git widget state on file save 2020-09-15 21:43:29 +02:00
Itamar
d1eedd0e9f HackStudio: View unstaged diffs in files with DiffViewer 2020-09-15 21:43:29 +02:00
Itamar
ba11082b4b HackStudio: Add functionality to GitRepo object
Added functionality for:
- Original files contents (without the current changes)
- Unstaged diffs
- Checking whether a file is tracked
2020-09-15 21:43:29 +02:00
Itamar
8306a84967 HackStudio: Add DiffViewer widget
This widget presents a diff in a nice graphical way, side by side.
2020-09-15 21:43:29 +02:00
Itamar
7c70183f3f HackStudio: Make the actions tab visible when using the form editor
Previously, the strucutre of the HackStudio widgets made it so the
actions tab would be hidden when the "edit mode" was something other
than EditMode::Text (for example, when using the form editor).
2020-09-15 21:43:29 +02:00
Itamar
dac7db830a HackStudio: Fix "Add new Editor" action 2020-09-15 21:43:29 +02:00
Itamar
f300b81648 HackStudio: Add "commit" and "refresh" actions to Git widget 2020-09-15 21:43:29 +02:00
Itamar
435c6c6f96 HackStudio: Add basic Git integration
This adds a "Git" tab to Hackstudio.
Currently has support for staging and unstaging files.
2020-09-15 21:43:29 +02:00
Andreas Kling
ad7030ce4a HackStudio: Tighten some unnecessarily broad lambda captures 2020-09-13 21:52:37 +02:00
Ben Wiederhake
04e3122526 HackStudio: Reduce debug spam 2020-09-12 13:46:15 +02:00
Andreas Kling
dbd2fa8b8f HackStudio: Use widget override cursors 2020-09-11 16:06:00 +02:00
Andreas Kling
b4f307f982 LibGUI+WindowServer: Rename window "override cursor" to just "cursor"
Let's just say each window has a cursor, there's not really overriding
going on.
2020-09-11 14:26:37 +02:00
Andreas Kling
0f9be82826 LibGfx: Move StandardCursor enum to LibGfx
This enum existed both in LibGUI and WindowServer which was silly and
error-prone.
2020-09-10 19:25:13 +02:00
Luke
5fd88e51c5 HackStudio: Highlight register changes, minor disassembly view fix
Also adds shortcuts for step in (F11), step out (Shift-F11) and
step over (F10).
2020-08-30 17:31:33 +02:00
Ben Wiederhake
f36c67c960 HackStudio: Mark default action in context menu 2020-08-30 09:47:49 +02:00
Ben Wiederhake
d063dc1e71 HackStudio: Mark compilation-unit-only functions as static 2020-08-28 11:37:33 +02:00
thankyouverycool
8a364c503d Base: Rename icon subdirectories by explicit app name
Renames widgets/ to hackstudio/, vbwidgets/ to visualbuilder/ and
paintbrush/ to pixelpaint/.
2020-08-27 15:38:02 +02:00
thankyouverycool
ebba297b42 Base: Move 16x16 common icons to /res/icons/16x16/
Drops the '16' suffix from filenames. Resizes inconsistent
audio-volume icons to intended size.
2020-08-27 15:38:02 +02:00
Ben Wiederhake
9f7ec33180 Meta: Force semi-colon after MAKE_AK_NONXXXABLE()
Before, we had about these occurrence counts:
COPY: 13 without, 33 with
MOVE: 12 without, 28 with

Clearly, 'with' was the preferred way. However, this introduced double-semicolons
all over the place, and caused some warnings to trigger.

This patch *forces* the usage of a semi-colon when calling the macro,
by removing the semi-colon within the macro. (And thus also gets rid
of the double-semicolon.)
2020-08-27 10:12:04 +02:00
thankyouverycool
30ad295fa1 Base+HackStudio: Rename project file extensions to .hsp
More concise in Views and consistent with other extensions.
2020-08-26 16:59:34 +02:00
thankyouverycool
45901d4141 LibGUI+HackStudio: Associate new icons with their extensions 2020-08-26 16:59:34 +02:00
Andreas Kling
44e371635e LibGUI: Move table view headers into their own widget
This patch introduces the HeaderView class, which is a widget that
implements the column headers of TableView and TreeView.

This greatly simplifies event management in the view implementations
and also makes it much easier to eventually implement row headers.
2020-08-26 00:51:35 +02:00
Luke
916e5e8cb3 HackStudio: Add a registers view for the current function in debug mode 2020-08-25 09:46:06 +02:00
Luke
3ddc42fdf1 HackStudio: Add a disassembly view for the current function in debug mode 2020-08-25 09:46:06 +02:00
Luke
694b86a4bf LibDebug: Move everything into the "Debug" namespace 2020-08-25 09:46:06 +02:00
Itamar
5c494eefd6 HackStudio: Implement "Step Over" debugging action
The "Step Over" action continues execution without stepping into
instructions in subsequent function calls.
2020-08-22 09:48:59 +02:00
Itamar
99788e6b32 HackStudio: Implement "Step Out" debugging action
The "Step Out" action continues execution until the current function
returns.

Also, LibDebug/StackFrameUtils was introduced to eliminate the
duplication of stack frame inspection logic between the "Step Out"
action and the BacktraceModel.
2020-08-22 09:48:59 +02:00
Itamar
cb432ffe8c HackStudio: Add icons for "step in" and "step out" 2020-08-22 09:48:59 +02:00
Itamar
f5aa0988f5 HackStudio: Move debugger actions to a toolbar in the debug widget 2020-08-22 09:48:59 +02:00
Andreas Kling
56c3748dcc LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
Andreas Kling
c0462c65cf HackStudio: Move everything into the HackStudio namespace 2020-08-17 18:05:35 +02:00
Andreas Kling
9102b624ac LibGUI+DevTools+Applications: Use ModelIndex::data() in many places
This way you don't have to keep track of which model it came from.
2020-08-16 16:44:09 +02:00
Andreas Kling
a1e381a0f8 LibGUI: Move GUI::Model::Role to GUI::ModelRole
This is preparation for using ModelRole in the ModelIndex API.
2020-08-16 16:44:09 +02:00
Matus Ferech
0dac7af6c5 HackStudio: Silence make output when checking if make is present 2020-08-15 20:11:46 +02:00
Matus Ferech
e451ce816c HackStudio: Use Core::ArgsParser for path to workspace 2020-08-15 20:11:46 +02:00
Linus Groh
2e5c434e22 Misc: Use automatic window positioning in more applications
This is a follow up to #2936 / d3e3b4ae56aa79d9bde12ca1f143dcf116f89a4c.

Affected programs:
- Applications: Browser (Download, View source, Inspect DOM tree, JS
  console), Terminal (Settings)
- Demos: Cube, Eyes, Fire, HelloWorld, LibGfxDemo, WebView,
  WidgetGallery
- DevTools: HackStudio, Inspector, Profiler
- Games: 2048, Minesweeper, Snake, Solitaire
- Userland: test-web

A few have been left out where manual positioning is done on purpose,
e.g. ClipboardManager (to be close to the menu bar) or VisualBuilder (to
preserve alignment of the multiple application windows).
2020-08-15 17:38:19 +02:00
Itamar
627f258c97 HackStudio: Use CodeDocument instead of TextDocument
This commit adds a new GUI widget type, called CodeDocument, which
is a TextDocument that can additionaly store data related to the
debugger.

This fixes various bugs and crashes that occured when we switched
between files in debug mode, because we previously held stale breakpoint
data for the previous file in the Editor object.
We now keep this data at the "document" level rather than the Editor
level, which fixes things.
2020-08-15 15:06:35 +02:00
Itamar
7eac9fe10e HackStudio: Support debugging library code
We can now step into library code in the debugger.

Since we now need the whole source code of our libraries
(and not just the headers), we clone the whole serenity git repo into
/usr/share/serenity.
2020-08-15 15:06:35 +02:00
Itamar
311a355505 HackStudio: Change singlestepping logic in the debugger
Previously, we did source-level singlestepping by inserting a
breakpoint at every source line and continued execution until we hit
a breakpoint. We did this because we used to not generate source
locations debug info for library code, and it allowed us to not single
step through lots of library code to get to the next source line
(which is super slow).

Since we now do generate source locations debug info for libraries
(-g1), we can improve the way we implement source level stepping by
stepping at the assembly level until we reach a different source code
location.
2020-08-15 15:06:35 +02:00
Andreas Kling
75b8f4e4e6 LibGUI: Make focus events more aware of why focus is changing
This patch adds GUI::FocusEvent which has a GUI::FocusSource.
The focus source is one of three things:

- Programmatic
- Mouse
- Keyboard

This allows receivers of focus events to implement different behaviors
depending on how they receive/lose focus.
2020-08-15 00:05:45 +02:00
Ben Wiederhake
7893871d5a HackStudio: Mark compilation-unit-only functions as static
This also resolves some typing issues that only 'accidentally' worked, like declaring
a function to return type A, and the definition actually returning type B (which works
if type B is a subtype of type A). I like to call these "ninja imports".

To prevent problems like this in the future, I put all globals in a HackStudio.h.
I'm not sure about the name, but main.h and common.h felt wrong.
2020-08-12 20:40:59 +02:00
Andreas Kling
845aaaf5fd HackStudio: Use adopt_own(*new T) instead of OwnPtr(new T) 2020-08-12 12:17:20 +02:00