Commit graph

399 commits

Author SHA1 Message Date
Sergey Bugaev
bb19eb8f23 IPCCompiler: Properly handle stream read errors
If we exhaust the buffer stream, the reads appear to succeed, but the stream
itself panics when we later attempt to drop it. To prevent it, we check for
errors explicitly.
2020-06-08 13:58:32 +02:00
Sergey Bugaev
fc481552f5 LibIPC+LibGfx+IPCCompiler: Drop some unused includes 2020-06-08 13:58:32 +02:00
Andreas Kling
3654710c41 LibIPC+Services: Support URL as a native IPC type 2020-06-07 22:55:33 +02:00
FalseHonesty
f958c693ee HackStudio: Support debugging variables with Enum types
Variables with enum types can now be both viewed and modified in the
variables view!
2020-06-03 08:12:50 +02:00
FalseHonesty
75e42648e1 HackStudio: Allow changing variable values in debugger
This patch adds a context menu to variables in the debugger variable
tree view that has an option to set the value of a variable. An input
box will pop up asking for the new value of the variable, which
is then parsed and used to set the actual variable.
2020-05-31 10:52:25 +02:00
FalseHonesty
12fe546be9 LibGUI+HackStudio: Fix cursor appearance and crash while debugging
HackStudio uses a TreeView to display the list of current variables
while debugging, and when the program completes, it sets that view's
model to a null model. This would trip an assertion if the TreeView
had something selected at the time, so this patch lessens the
assertion into a simple null check.

Additionally, the cursor would look laggy when moving about the
editor because the code was waiting for a window repaint to update
the cursor's look when it makes more sense to update the cursor
when it actually moves. This change also requires the base
GUI::TextEditor to expose a getter to tell if its currently in a drag
selection.

Finally, requesting a context menu in the line ruler on the side of
the editor would also place/remove breakpoints, which was counter
intuitive, so this requires a left click to modify breakpoint placement.
2020-05-30 10:18:14 +02:00
FalseHonesty
7ca562b200 LibMarkdown: Change MD Document parse API to return a RefPtr
Markdown documents are now obtained via the static Document::parse
method, which returns a RefPtr<Document>, or nullptr on failure.
2020-05-30 00:32:12 +02:00
Emanuele Torre
937d0be762 Meta: Add a script check the presence of "#pragma once" in header files
.. and make travis run it.

I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.

It also checks the presence of a (single) blank line above and below the
"#pragma once" line.

I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.

I also ran clang-format on the files I modified.
2020-05-29 07:59:45 +02:00
Sergey Bugaev
ec4902d1dd LibCore+Inspector: Move RPC sockets to /tmp/rpc
We have a hierarchical filesystem, let's make use of it :^)
2020-05-29 07:53:30 +02:00
Andreas Kling
42243d2e06 LibWeb: Rename Web::HtmlView => Web::PageView
This widget doesn't just view HTML, it views a web page. :^)
2020-05-28 18:22:54 +02:00
FalseHonesty
139dbfd5b5 LibGUI: Add up & down arrow hooks and input history to TextBox
This patch adds the ability to enable "input history" on a textbox,
allowing to navigate between the history with the arrow keys.

Also removes a custom TextBox subclass from HackStudio that added
the exact same hooks, and moves it to use the now standard ones.
2020-05-27 20:04:52 +02:00
Sergey Bugaev
fce49b3e32 LibGUI: Change GUI::KeyEvent::key() type to KeyCode
...instead of a plain int. Yay for some type safety.
2020-05-27 11:19:38 +02:00
Sergey Bugaev
602c3fdb3a AK: Rename FileSystemPath -> LexicalPath
And move canonicalized_path() to a static method on LexicalPath.

This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
2020-05-26 14:35:10 +02:00
Andreas Kling
2adb0a07e5 LibGUI: Get rid of Model::ColumnMetadata and always use auto-sizing
Auto-sizing of view columns is now enabled by default. This removes the
last remaining need for ColumnMetadata, so this patch gets rid of it.
2020-05-21 19:55:44 +02:00
Andreas Kling
2e03bded43 LibGUI: Add Model::Role::TextAlignment and remove from ColumnMetadata 2020-05-21 19:55:44 +02:00
Andreas Kling
04187576ff LibGUI: Models should always specify font via Model::Role::Font
This gets rid of one field in ColumnData. The goal is to get rid of all
fields and lose ColumnData entirely.
2020-05-21 19:55:44 +02:00
Andreas Kling
a1e7aa330c HackStudio: Don't use an OOB TextRange when looking for hovered text
We could going +1 past the end of a TextDocumentLine here. This caused
us to crash in the brave new world, so we could find it. :^)
2020-05-18 20:44:31 +02:00
Andreas Kling
cd29844632 LibIPC: Allow opt-in UTF-8 validation on message parameters
You can now mark String message parameters with the [UTF8] attribute.
This will cause the generated decoder to perform UTF-8 validation and
reject the message if the given parameter is not a valid UTF-8 string.

This frees up the receiving side from having to do this validation at
a higher level.
2020-05-16 14:13:09 +02:00
Sergey Bugaev
b8fef58c0c ProfileViewer: Fix opening the kernel image
The kernel image is now at /boot/Kernel (not /boot/kernel), so adjust
the paths accordingly.
2020-05-15 17:41:54 +02:00
Sergey Bugaev
450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00
Andreas Kling
977863ea07 LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking
a button.
2020-05-12 20:31:16 +02:00
Andreas Kling
413ab652c8 LibIPC+IPCCompiler: Templatize encoding/decoding of Optional<T>
This was the last one! IPCCompiler no longer has any type-specific
encoding/decoding logic! :^)
2020-05-12 19:04:05 +02:00
Andreas Kling
fbda28248a LibGfx+IPCCompiler: Add IPC encoders for Color and ShareableBitmap 2020-05-12 19:04:03 +02:00
Andreas Kling
3775983dfe LibIPC+LibGfx: Templatize IPC encoding as well as decoding
Now most classes dictate how they are serialized and deserialized when
transmitted across LibIPC sockets. This also makes the IPC compiler
a bit simpler. :^)
2020-05-12 18:49:24 +02:00
Andreas Kling
18ff75e67b HackStudio: Don't crash when navigating backtrace with up/down keys
It's up to BacktraceModel::index() to validate its inputs.
2020-05-12 15:09:54 +02:00
Linus Groh
358694567f Meta: Add script to enforce license headers & run it on Travis 2020-05-09 23:55:58 +02:00
Itamar
2acce56ac1 HackStudio: Update variables view based on the selected backtrace frame 2020-05-09 23:41:08 +02:00
Itamar
1fb62df02a HackStudio: Show a backtrace in the debug information tab 2020-05-09 23:41:08 +02:00
Itamar
b9f0f402f4 HackStudio: Reorganize debugger-related files
The debugger's files are now placed under HackStudio/Debugger
2020-05-09 23:41:08 +02:00
Andreas Kling
f596b12a04 LibVT+Terminal: Support hyperlinks in the terminal :^)
We now support basic hyperlinking in the terminal with <OSC>;8;;URL<ST>
Links are opened via LaunchServer on Ctrl+LeftMouse.
2020-05-09 16:16:16 +02:00
Itamar
14ee090f25 HackStudio: Support variable inspection in nested scopes 2020-05-08 12:16:10 +02:00
Itamar
f0cbaf453c HackStudio: Close the debug tab when debugged program exits 2020-05-08 12:16:10 +02:00
Itamar
b931771d24 HackStudio: Gracefully handle unfound source files 2020-05-07 23:32:11 +02:00
Linus Groh
8d01fd9863 HackStudio: Apply INI syntax highlighter when opening a .ini file 2020-05-07 22:04:56 +02:00
Linus Groh
520d464865 HackStudio: Rename ProjectType::{Javascript -> JavaScript} 2020-05-07 22:04:56 +02:00
Linus Groh
9dbab2d05e Misc: Replace "String(string_view)" with "string_view.to_string()"
StringView::to_string() was added in 917ccb1 but not actually used
anywhere yet.
2020-05-06 19:28:59 +02:00
Itamar
3dd0f755d0 HackStudio: Show local variables in the debugger
We now have a Debug Information tab, which displays the variables in
the current scope in a tree view.
2020-05-05 11:01:36 +02:00
Itamar
09ac22b37f HackStudio: Take scrolling into consideration when painting breakpoints
Also, we now scroll to the currently executed line when execution is
paused in the debugger.
2020-05-05 11:01:36 +02:00
Andreas Kling
e09b83c60c LibTextCodec: Start fleshing out a simple text codec library
We're starting with a very basic decoding API and only ISO-8859-1 and
UTF-8 decoding (and UTF-8 decoding is really a no-op since String is
expected to be UTF-8.)
2020-05-03 23:01:58 +02:00
Andreas Kling
78943f031e LibIPC: Add a simple IPC::Dictionary type (String key -> String value) 2020-05-03 23:01:58 +02:00
AnotherTest
6fcb6baa69 IPCCompiler: Add support for Optional<T> (so long as T is trivial) 2020-05-03 12:59:26 +02:00
Andreas Kling
a726fda546 IPCCompiler: Add support for Vector<i32>
It would be a lot nicer to support arbitrary Vector<T> but for now I'm
only adding Vector<i32> since I need it for something..
2020-05-02 01:29:55 +02:00
Andreas Kling
ea204ef05b LibMarkdown: Drop MD prefixes and move into "Markdown" namespace :^) 2020-04-28 21:04:25 +02:00
Andreas Kling
cba9550f1c HackStudio: Toolbar icon overhaul 2020-04-25 14:17:02 +02:00
Itamar
74f41d5f98 HackStudio: Add cpp debugger
The HackStudio debugger integrates with LibDebug to provide
source-level debugging.

The user can set breakpoints at various positions in the source code,
and then run the program in debug mode.

When the program is stopped, the current execution position is
displayed, and the user can insert/remove breakpoints, continue
execution, or single step the program.
2020-04-25 13:16:46 +02:00
Itamar
393560d8a2 HackStudio: GUI support for setting breakpoints on source code lines 2020-04-25 13:16:46 +02:00
Andreas Kling
0af5e0b9f8 Applications: Tweak main layout spacing and background 2020-04-23 18:30:59 +02:00
Andreas Kling
ab336e895f LibGUI: Add a ToolBarContainer widget and put most ToolBars in one
This mimics the Explorer toolbar container from Windows 2000 and looks
pretty neat! :^)
2020-04-23 17:44:49 +02:00
Andreas Kling
705cee528a LibGUI: Make it easier to create checkable GUI::Actions
This patch adds GUI::Action::create_checkable() helpers that work just
like the existing create() helpers, but the actions become checkable(!)

Clients are no longer required to manage the checked state of their
actions manually, but instead they will be checked/unchecked as needed
by GUI::Action itself before the activation hook is fired.
2020-04-21 17:21:28 +02:00
Andreas Kling
52a250cb61 LibGUI: Make MenuBar a Core::Object
This makes it show up in Inspector with all the menus inside it. :^)
2020-04-21 16:19:18 +02:00