Commit Graph

7182 Commits

Author SHA1 Message Date
Andreas Kling
49b9683381 FileManager: Make "show dotfiles" affect the tree view as well
Previously this only affected the main directory view.
2021-07-27 18:27:49 +02:00
Andreas Kling
4486e5b26d LibGUI: Remove some unused code in GUI::TreeView 2021-07-27 18:27:49 +02:00
Jamie Mansfield
28ee513bdf Spider: Make statusbar high score display configurable
You can now choose what statistic (currently only high score or best
time) to display in the statusbar.
2021-07-27 16:53:56 +02:00
Jamie Mansfield
821af6a6ef Spider: Start game if first move is to draw cards
This fixes a bug where the game wouldn't consider it had started.
2021-07-27 16:53:56 +02:00
Jamie Mansfield
26cb559d37 Spider: Track win and loss counts
Again, this isn't exposed anywhere yet.
2021-07-27 16:53:56 +02:00
Jamie Mansfield
f7eb6772ce Spider: Get user confirmation to close when there is a active game 2021-07-27 16:53:56 +02:00
Jamie Mansfield
4df9d05f91 Spider: Track quickest game time
This isn't exposed in the game anywhere yet.
2021-07-27 16:53:56 +02:00
Jamie Mansfield
29f15cfbae Spider: Standardise fetching the mode identifier
This eliminates some code duplication, and will be helpful for future
commits introducing further statistic tracking.
2021-07-27 16:53:56 +02:00
Gunnar Beutner
78c81854cc LibC: Don't include C++ headers in C system headers 2021-07-27 16:53:16 +02:00
Gunnar Beutner
57417a3d6e Kernel: Support loading the kernel at almost arbitrary virtual addresses
This enables further work on implementing KASLR by adding relocation
support to the pre-kernel and updating the kernel to be less dependent
on specific virtual memory layouts.
2021-07-27 13:15:16 +02:00
Gunnar Beutner
e3d2ca6bd2 LibSymbolication: Fix integer overflow when calculating region addresses 2021-07-27 13:15:16 +02:00
Gunnar Beutner
ff292fbe5a LibELF: Fix unaligned writes in the relocation code 2021-07-27 13:15:16 +02:00
Gunnar Beutner
daeb371180 DynamicLoader+LibELF: Move self-relocation code into a separate file 2021-07-27 13:15:16 +02:00
Lennon Donaghy
c4887882cc Utilities: Allow 'less' to scroll to top/bottom using 'G' and 'g' 2021-07-27 13:08:43 +02:00
Andreas Kling
751cb094ff LibGfx: Remove Gfx::ImageDecoder::bitmap() in favor of frame(index)
To transparently support multi-frame images, all decoder plugins have
already been updated to return their only bitmap for frame(0).

This patch completes the remaining cleanup work by removing the
ImageDecoder::bitmap() API and having all clients call frame() instead.
2021-07-27 01:29:50 +02:00
Andreas Kling
d01b4327fa LibGfx: Improve ImageDecoder construction
Previously, ImageDecoder::create() would return a NonnullRefPtr and
could not "fail", although the returned decoder may be "invalid" which
you then had to check anyway.

The new interface looks like this:

    static RefPtr<Gfx::ImageDecoder> try_create(ReadonlyBytes);

This simplifies ImageDecoder since it no longer has to worry about its
validity. Client code gets slightly clearer as well.
2021-07-27 01:17:05 +02:00
Linus Groh
c6f4ecced9 LibJS: Update Temporal spec comment that's now been corrected
See: https://github.com/tc39/proposal-temporal/commit/6d2350f
2021-07-26 23:39:11 +01:00
Maciej Zygmanowski
13773d3ced SystemMonitor: Display connection status icons in Network tab 2021-07-27 00:28:12 +02:00
ovf
13c7d55320 LibWeb: Fix parsing of character references in attribute values 2021-07-27 00:03:43 +02:00
Martin Blicha
0505a815f7 LibChess: Early check of legal move
One of the conditions for legal move is that the target square is not
occupied by a piece of the same color as the moving piece.

Instead of checking this for each piece separately at the end, we can
check this at the beginning and avoid more expensive checks.
2021-07-26 23:53:41 +02:00
Nicholas Hollett
4857943a71 HackStudio: Resize editors when removing panes
Splitter does weird things when you resize and then remove children.
This works around the limitation by forcing at least one of the editors
to fill the space. It's janky, but at least doesn't result in the last
editor not filling the window.
2021-07-26 23:46:39 +02:00
Brian Gianforcaro
46c9b1d81c Kernel+LibC: Use argument for TIOCGPGRP ioctl value
In preparation for modifying the Kernel IOCTL API to return KResult
instead of int, we need to fix this ioctl to an argument to receive
it's return value, instead of using the actual function return value.
2021-07-27 01:23:37 +04:30
Tom
1a664d80f9 Mail: Prompt for password if no password was saved
This allows the user to create a mail configuration without having
to save the password in clear text (or any other form) to disk.
2021-07-26 21:55:18 +04:30
Tom
81c183e06a LibGUI: Add InputType enum to allow creating a password InputBox dialog 2021-07-26 21:55:18 +04:30
Tobias Christiansen
5745e8e18c LibWeb: Add blurring support to box-shadow
Now the box-shadow-rendering is done by using the new
Gfx::FastBoxBlurFilter. :^)
2021-07-26 17:54:19 +01:00
Tobias Christiansen
d1844e424d LibGfx: Add FastBoxBlurFilter
This patch adds a FastBoxBlurFilter to the system. It can be created by
specifying a Bitmap it will work on.
There are two uses implemented:
- apply_single_pass() applys an implementation of a linear-time
box-blur algorithm with the specified radius using a horizontal and a
vertical pass and utilizinga sliding window.
- apply_three_passes() gets a better Gaussian approximation by applying
  the filter three times. For this to work the radius of each pass is
  calculated to fit Gauss the best.
2021-07-26 17:54:19 +01:00
sin-ack
48d4062b47 NotificationServer: Expand the notification when hovered
Now, instead of showing a tooltip, the entire notification will be
shown when the user hovers over a notification. In the future, limiting
the amount of lines shown within the notification and moving extra lines
to the tooltip again might be a good idea.
2021-07-26 21:14:39 +04:30
sin-ack
e11940fd01 Userland: Move text wrapping/elision into the new TextLayout :^)
This class now contains all the fun bits about laying out text in a
rect. It will handle line wrapping at a certain width, cutting off lines
that don't fit the given rect, and handling text elision.
Painter::draw_text now internally uses this.

Future work here would be not laying out text twice (once actually
preparing the lines to be rendered and once to get the bounding box),
and possibly adding left elision if necessary.

Additionally, this commit makes the Utf32View versions of
Painter::draw_text convert to Utf8View internally. The intention is to
completely remove those versions, but they're kept at the moment to keep
the scope of this PR small.
2021-07-26 21:14:39 +04:30
sin-ack
a5a32fbcce LibGUI: Ignore the Enter event by default
If this is not ignored by default, then one can move the mouse fast
enough to skip hovering over a parent element and hover directly over
the child, causing the parent to never receive an Enter event.
2021-07-26 21:14:39 +04:30
sin-ack
cfc9ee6f16 LibGUI: Only dispatch Leave if the now-hovered widget isn't a child
Without this change, when the mouse starts hovering over a child widget,
the parent would receive a Leave event despite the parent widget not
losing mouse hover.
2021-07-26 21:14:39 +04:30
sin-ack
444ed56521 LibGUI: Add virtual handlers for WindowEntered and WindowLeft events
These can be useful if an application wants to react to the cursor
entering the window at any point, rather than just on a widget.
2021-07-26 21:14:39 +04:30
sin-ack
6162e78c7f LibGUI: Let GUI applications create an inspectable EventLoop
GUI applications automatically have EventLoops created for them via
GUI::Application; however before this commit it was not possible to make
the application event loop inspectable. This exposes a third optional
argument to GUI::Application which allows one to make the application
event loop inspectable.
2021-07-26 21:14:39 +04:30
Timothy Flynn
2e3a5b884c LibJS: Implement Unicode aware String.prototype.to{Upper,Lower}Case 2021-07-26 17:03:55 +01:00
Timothy Flynn
98d8274040 Meta: Add LibUnicode (and its tests) to Lagom
This is primarily to allow using LibUnicode within LibJS and its REPL.

Note: this seems to be the first time that a Lagom dependency requires
generated source files. For this to work, some of Lagom's CMakeLists.txt
commands needed to be re-organized to include the CMake files that fetch
and parse UnicodeData.txt. The paths required to invoke the generator
also differ depending on what is currently building (SerenityOS vs.
Lagom as part of the Serenity build vs. a standalone Lagom build).
2021-07-26 17:03:55 +01:00
Timothy Flynn
4dda3edc9e LibUnicode: Introduce a Unicode library for interacting with UCD files
The Unicode standard publishes the Unicode Character Database (UCD) with
information about every code point, such as each code point's upper case
mapping. LibUnicode exists to download and parse UCD files at build time
and to provide accessors to that data.

As a start, LibUnicode includes upper- and lower-case code point
converters.
2021-07-26 17:03:55 +01:00
Patrick Meyer
83f88df757 Kernel: Add option to build with coverage instrumentation and KCOV
GCC and Clang allow us to inject a call to a function named
__sanitizer_cov_trace_pc on every edge. This function has to be defined
by us. By noting down the caller in that function we can trace the code
we have encountered during execution. Such information is used by
coverage guided fuzzers like AFL and LibFuzzer to determine if a new
input resulted in a new code path. This makes fuzzing much more
effective.

Additionally this adds a basic KCOV implementation. KCOV is an API that
allows user space to request the kernel to start collecting coverage
information for a given user space thread. Furthermore KCOV then exposes
the collected program counters to user space via a BlockDevice which can
be mmaped from user space.

This work is required to add effective support for fuzzing SerenityOS to
the Syzkaller syscall fuzzer. :^) :^)
2021-07-26 17:40:28 +02:00
Idan Horowitz
67b3255fe8 LibJS: Implement Temporal.PlainDate.from 2021-07-26 16:15:31 +01:00
Idan Horowitz
07485802c6 LibJS: Implement Temporal.PlainDate.compare 2021-07-26 16:15:31 +01:00
Idan Horowitz
2c6bd3a61b LibJS: Use narrower types in Temporal PlainDate/PlainDateTime/Calendar
These are bounds-checked during construction of PlainDate/PlainDateTime
and as such theres no need to widen them in these internal AO calls.
2021-07-26 16:15:31 +01:00
davidot
c5c32ad274 LibWeb: Make functions and attributes in bindings writable
This allows overwriting of for example
EventTarget.prototype.addEventListener as css3test does.
2021-07-26 15:56:15 +01:00
davidot
7a56ca1250 LibJS: Implement a naive String.prototype.localeCompare 2021-07-26 15:56:15 +01:00
davidot
e22539bdd9 LibWeb: Fix that non-member calls to window gave the wrong this_value
We treat all NativeFunctions as strict mode and thus window function
which were called in a global context (i.e. `setTimeout(f, 0)`) got a
null this_value. But we really need to treat all functions not defined
by the ECMAScript specification as non-strict. In most cases this won't
matter however since Window is also the global_object we have an extra
bit of logic.
To fix this more correctly we would need to track the strictness of
NativeFunctions.
2021-07-26 15:56:15 +01:00
davidot
a67f0cbfa2 LibWeb: Make the custom CSSDeclaration methods only work on strings
Otherwise it will try to convert it to a string later anyway. And as far
as I'm aware there are no style properties with just a number or
JavaScript symbol as name.
2021-07-26 15:56:15 +01:00
davidot
e42eaa5d95 LibWeb: Add a CustomHasProperty trait to WrapperGenerator
We immediately use this in CSSStyleDeclaration to fix that "background"
in element.style did not return true.
This is the mechanism used in css3test.com for detecting support of
features.
2021-07-26 15:56:15 +01:00
davidot
0b74cc4712 LibWeb: Convert WrapperGenerator and the generated code to east-const 2021-07-26 15:56:15 +01:00
Jamie Mansfield
3d4abd7154 KeyboardSettings: Prevent minimising the window
This matches how the new MouseSettings application works.
2021-07-26 14:56:49 +02:00
Jamie Mansfield
902559fc2d KeyboardSettings: Prevent resizing the window
This matches the other settings applications.
2021-07-26 14:56:49 +02:00
Jamie Mansfield
3129956c4e DisplaySettings: Prevent minimising the window
This matches how the new MouseSettings application works.
2021-07-26 14:56:49 +02:00
Kenneth Myhra
7a4f59f638 LibC: Declare wide character type functions in wctype.h
Declares all wide character handling functions in wctype.h. All calls
are forwarded to the corresponding character handling function in
ctype.h.

These functions are declared, but not implemented:
- iswctype
- wctype
- towctrans
- wctrans

This should also resolve a build issue with the 'sed' port getting
confused with iswprint being declared twice. Seems like it expected
more functions from wctype.h and then had a backup strategy of adding
its own wctype.h.
2021-07-26 11:36:21 +02:00
Vinicius
5e87c798d2 TextDocument: Fix indentation duplicating spaces
Auto indentation will consider only leading spaces before the cursor.
Fixes #8973.
2021-07-26 12:56:52 +04:30