Commit graph

9850 commits

Author SHA1 Message Date
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
AnotherTest
6fcdfe1169 Shell: Correct program stop behaviour
Prior to this, we would only wait for program exit; the shell should
stop waiting once the program has been stopped.
Fixes #2230
2020-05-15 14:44:57 +02:00
Andreas Kling
c6ddbd1f3e LibJS: Add side-effect-free version of Value::to_string()
There are now two API's on Value:

- Value::to_string(Interpreter&) -- may throw.
- Value::to_string_without_side_effects() -- will never throw.

These are some pretty big sweeping changes, so it's possible that I did
some part the wrong way. We'll work it out as we go. :^)

Fixes #2123.
2020-05-15 13:50:42 +02:00
Andreas Kling
d8aa2a6997 AK: StringBuilder with 0 initial capacity shouldn't build null String
With 0 initial capacity, we don't allocate an underlying ByteBuffer
for the StringBuilder, which would then lead to a null String() being
returned from to_string().

This patch makes sure we always build a valid String.
2020-05-15 13:50:42 +02:00
Linus Groh
85f2987848 Docs: Update required clang-format version to 10 in CONTRIBUTING.md 2020-05-15 12:26:23 +02:00
Sergey Bugaev
7aad44b825 Shell: Print correct errno when execvp() fails
Amusingly enough, this was caused by yet another bug.
2020-05-15 11:43:58 +02:00
Sergey Bugaev
888329233b LibC: Fix execvp() errno
Of course, using dbg() in the middle will change errno (most likely, reset
it to zero).
2020-05-15 11:43:58 +02:00
Sergey Bugaev
752617cbb2 Kernel: Disallow opening socket files
You can still open files that have sockets attached to them from inside
the kernel via VFS::open() (and in fact, that is what LocalSocket itslef uses),
but trying to do that from userspace using open() will now fail with ENXIO.
2020-05-15 11:43:58 +02:00
Sergey Bugaev
00c166e2ca Base: Allow NotificationServer to access the Clipboard
Otherwise it fails to even start.
2020-05-15 11:43:58 +02:00
Sergey Bugaev
e5a231e36f Clipboard: Remove accidentally commited file 2020-05-15 10:01:35 +02:00
Sergey Bugaev
32f8e57834 Build: Ask GCC to always emit colorful diagnostics 2020-05-15 10:01:35 +02:00
Sergey Bugaev
486540fa90 Build: Allow using CMake 3.16
Because apparently that's what a lot of people have,
and they report it works fine.
2020-05-15 10:01:35 +02:00
Andreas Kling
97a8b6e402 Clipboard: Add missing copyright header 2020-05-15 10:00:17 +02:00
Linus Groh
4e0ed34d7e js: Throw a regular SyntaxError for errors from the parser 2020-05-15 09:53:52 +02:00
Linus Groh
33defef267 LibJS: Let parser keep track of errors
Rather than printing them to stderr directly the parser now keeps a
Vector<Error>, which allows the "owner" of the parser to consume them
individually after parsing.

The Error struct has a message, line number, column number and a
to_string() helper function to format this information into a meaningful
error message.

The Function() constructor will now include an error message when
throwing a SyntaxError.
2020-05-15 09:53:52 +02:00
Linus Groh
00b61a212f LibJS: Remove syntax errors from lexer
Giving the lexer the ability to generate errors adds unnecessary
complexity - also it only calls its syntax_error() function in one place
anyway ("unterminated string literal"). But since the lexer *also* emits
tokens like Eof or UnterminatedStringLiteral, it should be up to the
consumer of these tokens to decide what to do.

Also remove the option to not print errors to stderr as that's not
relevant anymore.
2020-05-15 09:53:52 +02:00
AnotherTest
3485613f4a LibCore: Make IODevice::can_read_line() const
This also makes LibHTTP's Job::can_read_line() const, as IODevice was
keeping that from being const.
Fixes #2219
2020-05-15 09:50:48 +02:00
DexesTTP
5386508119 Meta: Updated BuildInstructions.md for the cmake update
List of changes:
- The cmake command has been moved away from the main build instructions since
  the BuildIt script executes it automatically
- The ninja install has been clarified to take the BuildIt script into account
  and explain that the folder needs to be cleaned before executing cmake
- The ports instructions have been updated to use the make commands
- "brew install bash" has been added to the macOS prerequisites as per #2132
- The build instructions headers have been indented to group the prerequisites
  together
- The build instructions code snippets have been standardized into code blocks
- Fixed a typo
2020-05-15 09:48:14 +02:00
DexesTTP
c715b13ffc Meta: Updated CodingStyle.md clang-format requirement from 8 to 10
Fixes #2213
2020-05-15 09:48:14 +02:00
Andreas Kling
7cc442dc44 LibGUI: Fix build (LibGUI depends on Clipboard IPC classes) 2020-05-15 09:46:55 +02:00
Andreas Kling
660f5baf8f ps: Widen the username column slightly 2020-05-15 00:01:01 +02:00
Andreas Kling
244efe050a Clipboard: Move the system clipboard to a dedicated service process :^)
This commit moves the clipboard from WindowServer into a new Clipboard
service program. Clipboard runs as the unprivileged "clipboard" user
and with a much tighter pledge than WindowServer.

To keep things working as before, all GUI::Application users now make
a connection to Clipboard after making the connection to WindowServer.
It could be interesting to connect to Clipboard on demand, but right
now that would necessitate expanding every GUI app's pledge to include
"unix" and also unveiling the clipboard portal, which I prefer not to.
2020-05-14 22:53:58 +02:00
Andreas Kling
f4c60740bd AK: Make FileSystemPath::extension() return what's after the last '.' 2020-05-14 20:41:17 +02:00
Andreas Kling
953669374c open: Create a Core::EventLoop before using Desktop::Launcher
We can't talk to IPC servers without having an event loop.
2020-05-14 20:22:20 +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
Pierre
49727ffee4 PaintBrush: Added 'Move active layer up/down' to the Menu
This allowes the active layer to be moved up or down.
2020-05-14 14:44:27 +02:00
Pierre
80a360683f PaintBrush: Add 'Remove active layer' to the Menu
This allows the active Layer to be removed through the Menu or by using
the shortcut Ctrl+D.
2020-05-14 14:44:27 +02:00
Andrew Kaster
3c3c1b4013 LibUnwind: Create UnwindBase.h to capture the EH ABI in code
The header is essentially just a commented + annotated version of both
the Itanium Exception Handling ABI Level I, and the 386-specific
SystemV ABI for the same. Wrapping one's head around the spec is half
the work :^)
2020-05-14 08:50:10 +02:00
Linus Groh
7bfd24ca76 LibWeb: Support the :root pseudo class 2020-05-14 08:49:51 +02:00
Linus Groh
2f29e61203 LibWeb: Make CSS pseudo classes case-insensitive 2020-05-14 08:49:51 +02:00
Andreas Kling
31c178b9b5 PaintBrush: Start the app with an "empty" single layer image :^) 2020-05-13 22:28:33 +02:00
Andreas Kling
40a72883ff PaintBrush: Add "Delete layer" action to move tool context menu 2020-05-13 22:12:14 +02:00
Andreas Kling
b25c6ab884 PaintBrush: Tweak initial main window size 2020-05-13 22:12:03 +02:00
Andreas Kling
720ebee1be PaintBrush: Add move tool context menu with "move to back/front"
Tools can now have an in-image context menu which you get when right-
clicking inside the image editing area. Our first use of this is to
provide the ability to move layers to the back/front. :^)
2020-05-13 22:03:29 +02:00
Andreas Kling
02d9cf2039 PaintBrush: Tool::on_contextmenu() => on_tool_button_context_menu() 2020-05-13 21:51:43 +02:00
Andreas Kling
72e57561a1 PaintBrush: Activate tool properly when right-clicking tool button
If we don't go via the action, the tool button becomes checked which
can bypass the exclusivity mechanism. That should probably also be
fixed but it's far outside the scope of where I am right now. :^)
2020-05-13 21:50:13 +02:00
Andreas Kling
410cdba5a9 PaintBrush: Switch the active layer when clicking one with move tool
This feels very intuitive and nice, although maybe we need some way to
override this behavior for the scenario where you're intending to move
something currently behind something else.
2020-05-13 21:46:19 +02:00
Andreas Kling
0f77be046f PaintBrush: Draw an outline around the image boundaries 2020-05-13 21:29:50 +02:00
Andreas Kling
a95ed3fdcc PaintBrush: Add keyboard shortcuts for selecting different layers 2020-05-13 21:25:13 +02:00
Andreas Kling
3fe5dc35f2 LibGUI: Add AbstractTableView::move_selection(int steps)
This allows embedders to step the selection up/down and also simplifies
AbstractTableView by sharing code between Key_Up and Key_Down. :^)
2020-05-13 21:24:27 +02:00
Andreas Kling
4cf3f00bab PaintBrush: Add "Create new layer..." action
This action pops up a dialog asking for a name + dimensions. If OK is
clicked, you get a new layer with those specifications. :^)
2020-05-13 21:16:55 +02:00
Andreas Kling
0f3e58ffe0 PaintBrush: Clip layer contents outside the image rect when compositing 2020-05-13 21:12:32 +02:00
Andreas Kling
14aa7f2d44 LibGUI: Add GUI::MessageBox::show_error() convenience function
This is just a wrapper around show() that puts up a standard-looking
error message.
2020-05-13 21:11:49 +02:00
Andreas Kling
7ca9259ffd PaintBrush: Don't paint over the nice GUI::Frame around ImageEditor 2020-05-13 19:49:38 +02:00
Andreas Kling
98cb442edf PaintBrush: Add a "Tool" menu and put all the tools in it 2020-05-13 19:49:38 +02:00
Linus Groh
cbd746e3ec LibWeb: Support "transparent" CSS color value 2020-05-13 19:25:49 +02:00
Linus Groh
57857cd8f6 LibWeb: Make parsing of most CSS values case-insensitive
These are all valid:

width: AUTO;
height: 10PX;
color: LiMeGrEeN;
2020-05-13 19:25:49 +02:00
Linus Groh
d8cdf3f5e1 LibWeb: Make CSS property parsing case-insensitive
These are all valid:

background-COLOR: red;
Background-Color: red;
BACKGROUND-COLOR: red;
BaCkGrOuNd-CoLoR: red;
2020-05-13 19:25:49 +02:00
Linus Groh
1277290a4a AK: Add StringView::equals_ignoring_case()
StringUtils::equals_ignoring_case() already operates on a StringView&,
so StringView should have the method directly without having to go
through a temporary String (which also has the method).
2020-05-13 19:25:49 +02:00
AnotherTest
6cd4d136a0 Shell: Break out of continuation when ^C is pressed
This fixes the little issue with Shell not allowing cancellation of
commands once they were in continuation mode
```
$ ls '
$ # No matter what we do here, we cannot escape 'ls'
```
2020-05-13 15:07:44 +02:00