Commit graph

414 commits

Author SHA1 Message Date
Andreas Kling bc1ec588f0 TextEditor: Tweak 16x16 icon
In keeping with the slightly-higher-contrast theme.
2020-07-04 19:44:27 +02:00
Andreas Kling 14edd67bcc Profiler: Use SortingProxyModel::set_sort_role()
Use the new API to avoid duplicating code in the RunningProcessesModel.
2020-07-04 19:22:30 +02:00
Andreas Kling ca93c22ae2 LibGUI: Turn GUI::Application::the() into a pointer
During app teardown, the Application object may be destroyed before
something else, and so having Application::the() return a reference was
obscuring the truth about its lifetime.

This patch makes the API more honest by returning a pointer. While
this makes call sites look a bit more sketchy, do note that the global
Application pointer only becomes null during app teardown.
2020-07-04 16:54:55 +02:00
Andreas Kling 1dd1595043 LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
2020-07-04 14:05:57 +02:00
Andreas Kling e7393bfb7b Profiler: Turn the "choose a process" functionality into a GUI::Dialog
This feels a bit nicer and make it possible to reuse this in other
places as well. :^)
2020-07-02 20:46:59 +02:00
Andreas Kling f5d920eb2e Profiler: Make the RunningProcessesModel actually sortable
GUI::TableView looks at data(Model::Role::Sort) to know which order
things should be in.
2020-07-02 07:35:11 +02:00
Andreas Kling d4c92bd1b7 Profiler: Allow specifying a PID to profile with --pid 2020-07-01 21:07:53 +02:00
Andreas Kling 8d52e200ee Profiler: If run without arguments, let user select process from a list
We now show a list of running processes that the user can choose from.
After choosing one, we start profiling it and show a timer with a stop
button that the user has to press to stop profiling.
2020-07-01 20:49:51 +02:00
Andreas Kling 8661af9b72 Profiler: Rename from ProfileViewer :^) 2020-07-01 19:43:17 +02:00
AnotherTest 7b72001667 Inspector: Expand and show properties in a TreeView
This allows the inspector to show arbitrary json structures.
2020-07-01 11:18:19 +02:00
Nico Weber 12cbc4ad0d Everywhere: Replace some uses of fork/exec with posix_spawn
It's less code, and it's potentially more efficient once
posix_spawn is a real syscall.
2020-06-29 12:04:27 +02:00
Andreas Kling 2ba9e9b9c9 HackStudio: Use Web::PageView::load_html() for the documentation popup
Also simplify the way we change the background color a little bit.
2020-06-21 21:54:30 +02:00
Matthew Olsson e8e728454c AK: JsonParser improvements
- Parsing invalid JSON no longer asserts
    Instead of asserting when coming across malformed JSON,
    JsonParser::parse now returns an Optional<JsonValue>.
- Disallow trailing commas in JSON objects and arrays
- No longer parse 'undefined', as that is a purely JS thing
- No longer allow non-whitespace after anything consumed by the initial
  parse() call. Examples of things that were valid and no longer are:
    - undefineddfz
    - {"foo": 1}abcd
    - [1,2,3]4
- JsonObject.for_each_member now iterates in original insertion order
2020-06-13 12:43:22 +02:00
Andreas Kling fdfda6dec2 AK: Make string-to-number conversion helpers return Optional
Get rid of the weird old signature:

- int StringType::to_int(bool& ok) const

And replace it with sensible new signature:

- Optional<int> StringType::to_int() const
2020-06-12 21:28:55 +02:00
Andreas Kling 116cf92156 LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
2020-06-10 10:59:04 +02:00
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