Commit graph

20991 commits

Author SHA1 Message Date
Gunnar Beutner afbab621aa Toolchain: Use set -o pipefail to the toolchain build script
Previously the buildstep function would obscure error codes because
the return value of the function was the exit code for the sed command
which caused us to continue execution even though one of the build
steps had failed.

With set -o pipefail the return value of the buildstep function is
the real command's exit code.
2021-05-27 08:58:37 +01:00
Erik Biederstadt 3ea256b1c6 3DFileViewer: Add view menu
The view menu contains:
1. A fullscreen option (also accessed by pressing F11).
2. Rotation axis controls (x, y, z, or any combination)
3. Rotation speed controls (No rotation, slow, normal, or fast)
2021-05-27 08:57:13 +01:00
Gunnar Beutner 1ce32ef675 Kernel: Let the user read/write more than one page from/to dev files
Previously reads and writes to /dev/zero, /dev/full, /dev/null and
/dev/random were limited to 4096 bytes.

This removes that restriction so that users can enjoy more zero bytes
in their buffers.
2021-05-27 09:30:19 +02:00
Max Wipfli a272c04c8a
Base: Make desktop shortcuts owned by anon (#7495)
This fixes #7492.
2021-05-27 08:52:46 +02:00
Andreas Kling 993211f184 Ports: Bump curl to 7.77.0 :^) 2021-05-27 08:48:29 +02:00
Gunnar Beutner 49dd4e5193 Kernel: Block when writing to TCP sockets when the send window is full
Previously we'd just dump those packets into the network adapter's
send queue and hope for the best. Instead we should wait until the peer
has sent TCP ACK packets.

Ideally this would parse the TCP window size option from the SYN or
SYN|ACK packet, but for now we just assume the window size is 64 kB.
2021-05-26 23:09:28 +02:00
Gunnar Beutner b436dd138b Kernel: Avoid allocations when sending IP packets
Previously we'd allocate buffers when sending packets. This patch
avoids these allocations by using the NetworkAdapter's packet queue.

At the same time this also avoids copying partially constructed
packets in order to prepend Ethernet and/or IPv4 headers. It also
properly truncates UDP and raw IP packets.
2021-05-26 23:09:28 +02:00
Gunnar Beutner f8310b7796 Kernel: Move packet allocation into helper methods 2021-05-26 23:09:28 +02:00
Andreas Kling c739b3cafa Help: Tweak splitter spacing in main UI layout
This doesn't look perfect, but it's slightly better than unmodified.
2021-05-26 22:41:26 +02:00
Andreas Kling 7a24a60e72 LibGUI: Paint some knurling in the middle of GUI::Splitter
This makes splitters stand out visually so you can actually spot them.
Before this, you had to guess/know where they were, which was weird.

The look of the knurling is the same as GUI::ResizeCorner, to build on
the established visual language.
2021-05-26 22:17:47 +02:00
Andreas Kling 89272e810a LibGUI: Have GUI::Splitter track all grabbable areas
Instead of computing the grabbable areas on the fly in mouse event
handlers, we now figure out which parts of the splitter are grabbable
when something moves around, and then remember it.

This makes the code a lot easier to follow.
2021-05-26 22:17:47 +02:00
Andreas Kling 25468fdcf7 Playground: Start out with a GUI::Frame on the right hand side
This looks a lot nicer than starting with a plain GUI::Widget.
2021-05-26 22:17:47 +02:00
Samuel Kelemen 49999006ef LibGfx: remove constexpr, add noexcept on interpolate method
This removes `constexpr` from the interpolate method in Color.h and adds
`noexcept`. The roundf call cannot be constexpr on clang. This is the
only incompatibility preventing serenity from building under clang. I
tested this on OSX Big Sur 11.3 and 11.3.1, and everything works with
this change.
2021-05-27 00:01:38 +04:30
Brian Gianforcaro 2045782a6e Kernel: Switch VMObject to IntrusiveList from InlineLinkedList 2021-05-26 20:24:32 +02:00
Brian Gianforcaro e6f73d69a2 Kernel: Switch Region to IntrusiveList from InlineLinkedList 2021-05-26 20:24:32 +02:00
Brian Gianforcaro e0da61f9d6 Kernel: Switch LocalSocket to IntrusiveList from InlineLinkedList 2021-05-26 20:24:32 +02:00
Brian Gianforcaro 493d4d1cd7 Kernel: Switch Inode to IntrusiveList from InlineLinkedList 2021-05-26 20:24:32 +02:00
Gunnar Beutner 971f4ca71c Hearts: Highlight cards when an invalid play is attempted
This briefly inverts the selected card when the user attempts to make
an invalid play.
2021-05-26 19:57:08 +02:00
Jelle Raaijmakers 2c772d1848 LibGUI/AbstractView: Remove on_selection
Since the introduction of multi-select, we have had both `on_selection`
and `on_selection_change`, the latter of which was only invoked when a
change in selection came in through the model.

This removes `AbstractView::on_selection` and replaces it usage with
the more explicit `on_selection_change` everywhere.
2021-05-26 17:39:13 +04:30
Jesse Buhagiar ebe38639bc LibGL: Fix incorrect sign compare caused by GLsizei changes 2021-05-26 16:36:53 +04:30
Jesse Buhagiar 343e66b816 3DFileViewer: Support textured models
Models that contain UV co-ordinates are now supported,
and will display with a texture wrapped around it, provided
a `bmp` with the same name as the object is in the same
directory as the 3D Model.
2021-05-26 16:36:53 +04:30
Jesse Buhagiar 3287709df9 LibGL: Add texture sampling to SW Rasterizer
The software rasterizer now samples a texture passed to us from the
GL context. This is currently a bit of a hack, as we should be
scanning from a list of texture units and checking if they are
enabled. For now, this at least gives some visual confirmation
that texturing is working as it should
2021-05-26 16:36:53 +04:30
Jesse Buhagiar e21ba0cd12 LibGL: Implement glTexCoord2f 2021-05-26 16:36:53 +04:30
Jesse Buhagiar 4f324ba4d7 LibGL: Implement Texture State Management
Some very primitive Texture State management. Data can now be
uploaded to textures.
2021-05-26 16:36:53 +04:30
Jesse Buhagiar 21dff6d40b LibGL: Add Texture Name Allocation
Texture names can now be allocated via
`glGenTextures` and deallocated via `glDeleteTextures`.
2021-05-26 16:36:53 +04:30
Jesse Buhagiar 8a69e6714e LibGL: Change GLsizei from unsigned to signed integral type
There is some really wild stuff going on in the OpenGL spec for this..
The Khronos website states that GLsizei is a 32-bit non-negative value
used for sizes, however, some functions such as `glGenTextures` state
that the input `n` could be negative, which implies signage. Most other
implementations of `gl.h` seem to `typedef` this to `int` so we should
too.
2021-05-26 16:36:53 +04:30
Jesse Buhagiar 2b123cc592 AK: Implement AK::Stack 2021-05-26 16:36:53 +04:30
Ali Mohammad Pur 814e35902e Base: Add a WebAssembly mandelbrot demo
This is now good enough to make a showcase of :P
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur 6af596d9e8 LibJS+LibWeb: Make Uint8ClampedArray use TypedArray
Instead of being its own separate unrelated class.
This automatically makes typed array properties available to it,
as well as making it available to the runtime.
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur ba5da79617 LibWasm: Add execution hooks and a debugger mode to the wasm tool
This is useful for debugging *our* implementation of wasm :P
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur f740667fa1 LibCore: Add a standard error stream getter 2021-05-26 15:34:13 +04:30
Ali Mohammad Pur 800bcb9965 LibWasm: Drop previous frame when a structured end instruction is run 2021-05-26 15:34:13 +04:30
Ali Mohammad Pur 7966168fea LibWasm: Turn memory read failures into traps 2021-05-26 15:34:13 +04:30
Ali Mohammad Pur c31a4e9013 LibWasm: Once more fix structured instruction label indices
This finally works correctly. ™️
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur d05e5dbdcf LibWasm: Drop the correct number of frames
Prior to this commit, we would be dropping an extra frame.
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur a21ebae652 LibWasm: Implement checked truncation instructions
This implements the 8 i<n>.truncate.f<n>_<s> instructions.
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur 59e01e2813 AK: Define MakeSigned<...>::Type as void in the base struct
This was probably forgotten in the last rewrite, this would make
IsIntegeral<T> not work for floating points.
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur cf8b75c2e5 LibWasm+LibWeb: Partially resolve memory exports
This allows the JS side to access the wasm memory, assuming it's
exported by the module.
This can be used to draw stuff on the wasm side and display them from
the js side, for example :^)
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur 4a459d2430 LibWasm: Correct memory init size when instantiating
These limits are in units of page size, not bytes.
Also fixes incorrect debug logs.
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur 4fd43a8f96 LibJS: Allow ArrayBuffer to not own its backing data buffer as well
This is implemented as a ByteBuffer* in a variant, so its size should
only be increased by an index.
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur 3926eab3b7 LibWasm+LibWeb: Implement (a very basic version of) the JS link/import
This allows Wasm code to call javascript functions.
2021-05-26 15:34:13 +04:30
Ali Mohammad Pur a2af04837e LibWeb: Implement a very basic WebAssembly JS API
This impl is *extremely* simple, and is missing a lot of things, it's
also not particularly spec-compliant in some places, but it's definitely
a start :^)
2021-05-26 15:34:13 +04:30
Linus Groh bdd7741ae1 js: Consolidate and re-implement the load() function
This replaces the two sloppy copies of the load() function with a
cleaned up implementation:

- Only use the first argument, to load multiple files just call the
  function multiple times
- Fix a crash when using any non-string argument
- Throw an error if the file can't be opened instead of logging to
  stderr
- Don't use parse_and_run(), which would print the AST of the loaded
  file when using -A, for example - it's used either way as the entry
  point in both REPL and non-REPL mode, so we already get exception
  handling and all that
2021-05-26 01:04:09 +01:00
Linus Groh 64f4dc9a36 js: Use default constructor and destructor for global objects 2021-05-26 01:01:07 +01:00
Marcin Gasperowicz f2d2640c5f js: Define load() in global object for scripts
Having load() present is required in order to run test262.
2021-05-26 00:27:18 +01:00
Gunnar Beutner c6299d1e5d Kernel: Don't try to send TCP packets larger than the MSS
Previously TCPSocket::send_tcp_packet() would try to send TCP packets
which matched whatever size the userspace program specified. We'd try to
break those packets up into smaller fragments, however a much better
approach is to limit TCP packets to the maximum segment size and
avoid fragmentation altogether.
2021-05-25 22:20:37 +02:00
Gunnar Beutner dce97678ae LibCore: Handle partial writes in Socket::send()
Right now Socket::send() assumes that it can send everything in one
go. However, send() is allowed to do partial writes and while that
can't happen at the moment there's nothing that says this can't
happen in the future (like in the next commit).
2021-05-25 22:20:37 +02:00
Timothy Flynn a428812ba2 Solitaire: Persist high score separately per game mode
With different scoring rules for one-card vs. three-card draw mode, it
makes more sense to separately track their high scores.
2021-05-25 21:20:50 +02:00
Timothy Flynn 5d4cca7e0c Solitaire: Award bonus points based on time elapsed
The exact formula used for bonus points seems to vary by implementation.
This uses Klondike Solitaire's formula:

    https://en.wikipedia.org/wiki/Klondike_(solitaire)#Scoring
2021-05-25 21:20:50 +02:00
Timothy Flynn 0f80e9e4db Solitaire: Tweak scoring for three-card draw mode
Currently, the player loses 100 points each time the waste stack is
recycled. In three-card draw mode, it's standard to only lose 20 points
after the third recycle event.
2021-05-25 21:20:50 +02:00