Commit graph

9568 commits

Author SHA1 Message Date
Andreas Kling 76bcd284f9 AK: Remove experimental clang -Wconsumed stuff
This stopped working quite some time ago due to Clang losing track of
typestates for some reason and everything becoming "unknown".

Since we're primarily using GCC anyway, it doesn't seem worth it to try
and maintain this non-working experiment for a secondary compiler.

Also it doesn't look like the Clang team is actively maintaining this
flag anyway. So good-bye, -Wconsumed. :/
2020-05-16 10:55:54 +02:00
Andreas Kling 16c858d9f0 Kernel: Remove dubious use of "volatile" in E1000 adapter driver 2020-05-16 10:55:54 +02:00
Andreas Kling 03eb0e5638 Kernel: Let's say that IO::delay(N) delays for N microseconds
Supposedly that's how much delay you get when doing I/O on port 0x80.
2020-05-16 10:55:54 +02:00
Andreas Kling 85aafe492d Kernel: Remove dubious use of "volatile" in HPET code 2020-05-16 10:55:54 +02:00
Andreas Kling ca4f714d68 Kernel: Use consistent names for kmalloc globals and remove volatile 2020-05-16 10:55:54 +02:00
Shannon Booth 154a6e69a4 Shell: Use DirIterator::SkipParentAndBaseDir 2020-05-16 10:09:00 +02:00
Andrew Kaster e5ad6a491e LibELF: Handle DT_SONAME dynamic entries
Store the offset in the string table for the DT_SONAME entry. Now that
the build uses cmake, cmake is helpfully passing --Wl,-soname to the
linker for shared objects. This makes the LinkDemo run again.
2020-05-16 09:52:57 +02:00
Shannon Booth 3d153e5ed3 Build: Disable deprecated volatile warning
We will probably need to fix this at some stage, but for now let's just
disable the warning.
2020-05-16 09:51:31 +02:00
Shannon Booth 2ffbdf5680 Toolchain/Ports: Update to gcc 10.1.0 2020-05-16 09:51:31 +02:00
Shannon Booth 113a95e9e1 Kernel: Annotate UnhandledInterruptHandler::eoi with [[noreturn]] 2020-05-16 09:51:31 +02:00
Shannon Booth df43e09433 LibGUI+WindowServer: Allow applications to set custom cursor bitmaps
This will allow e.g PaintBrush to use custom cursors for each tool.
2020-05-16 09:44:55 +02:00
Shannon Booth 8c1b01e79b Kernel: Tidy up SharedBuffer interface
Make is_shared_with() const and hide private members.
2020-05-16 09:44:00 +02:00
Sergey Bugaev f7ae66cee3 ClipboardHistory: Add a clipboard history applet :^)
It will listen for clipboard content changes in the backgroud. Once you click
on its icon, it will pop up a window listing all recorded clipboard contents.
You can then double-click on an item to copy it again.
2020-05-16 09:13:25 +02:00
Sergey Bugaev acc107a44f FileManager+LibGUI+Userland: Switch clipboard to MIME types
We will now actually use MIME types for clipboard. The default type is now
"text/plain" (instead of just "text").

This also fixes some issues in copy(1) and paste(1).
2020-05-16 09:11:46 +02:00
Andreas Kling de7827faf7 LibM: Fix floor() and floorf() for negative numbers
And add a LibJS test to exercise the code. :^)
2020-05-15 22:05:59 +02:00
Andreas Kling 8f293b7543 LibM: Add floorf() for @rexim :^) 2020-05-15 21:51:02 +02:00
Andreas Kling 16965db86b LibVT: Move out the Line class from Terminal to its own class 2020-05-15 18:57:50 +02:00
Sergey Bugaev 345fbd1fc1 LibCore: Fix timer expiration processing
The previous code did not account for the case when there are timers present,
but none are enabled, and used a zero polling timeout.

Fixes https://github.com/SerenityOS/serenity/issues/2222
2020-05-15 17:41:54 +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
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