Commit Graph

3543 Commits

Author SHA1 Message Date
Jean-Baptiste Boric
f9d82ecf18 Run: Remove useless serenity.h include 2021-04-27 23:06:16 +02:00
Andreas Kling
504d622864 LibWeb: Remove unnecessary temporary Vector in text layout
Now that we have Layout::TextNode::ChunkIterator, we don't need to
accumulate all the chunks in a vector before dividing them into lines.
2021-04-27 19:11:59 +02:00
Andreas Kling
37e29a630b LibWeb: Minor cleanup tweak in TextNode::split_into_lines_by_rules()
Merge an unnecessarily nested branch with its parent.
2021-04-27 19:11:59 +02:00
Andreas Kling
5074aaea69 LibWeb: Refactor Layout::TextNode splitting into a chunk iterator
Creating a ChunkIterator allows you to iterate over the text in a
Layout::TextNode at your leisure by calling next() when you want
another chunk.

This is one of many steps towards improving inline layout.
2021-04-27 19:11:59 +02:00
Paul Berg
03d8ee1082 VimEditingEngine: allow selection of the endline character
This patch fixes the visual selection of endline characters in the
VimEditingEngine. When the visual mode is disabled and the cursor
is located on the endline character, it is shifted back to the last
character of the line.
2021-04-27 19:05:16 +02:00
Brian Gianforcaro
48632461c1 Tests: Convert file system suid-sgid stripping test to be LibTest based. 2021-04-27 17:58:11 +02:00
Brian Gianforcaro
41387df5f8 Tests: Convert pledge-test-failures.cpp to be LibTest based. 2021-04-27 17:58:11 +02:00
Brian Gianforcaro
122869f086 Tests: Convert unveil-test-failures.cpp to be LibTest based. 2021-04-27 17:58:11 +02:00
Brian Gianforcaro
a9df58d7b2 LibTest: Add FAIL() macro allow tests to force failure with message. 2021-04-27 17:58:11 +02:00
sin-ack
ace2c337dc VimEditingEngine: Handle arrow, Home/End and Page keys
This patch adds handling of the arrow, Home/End, and PageUp/PageDown
keys to the Vim emulation mode.  Home acts as 0, End acts as $, arrow
keys act as their HJKL variants, and PageUp/Down behaves as you would
expect.

This patch also moves the default handling of the aforementioned keys
to insert mode, since regular EditingEngine semantics are more
appropriate there.
2021-04-27 13:10:10 +02:00
Jelle Raaijmakers
d1f33ec795 LibPthread: Use realtime clock for futex_wait()
If we get an absolute time passed to one of the pthread_*wait methods,
this is not an absolute monotonic time but rather an absolute wall
time. This means that we also need to pass FUTEX_CLOCK_REALTIME to the
futex syscall to ensure we're not using the monotonic clock.
2021-04-27 09:19:55 +02:00
sin-ack
d6dc81874d EditingEngine: Split selection from movement functions
This patch moves selection updates outside movement functions in
EditingEngine.  Previously, movement functions would automatically
update the selection based on whether the Shift key was pressed down
during movement.  However, not all EditingEngine subclasses want that;
VimEditingEngine being a good example (because all selection is handled
in visual mode).

Therefore, this patch moves all selection updating to
EditingEngine::on_key().  Subclasses wishing to provide custom movement
and selection semantics should override it (and VimEditingEngine already
does).
2021-04-27 09:03:38 +02:00
Jelle Raaijmakers
2e1320f264 WindowServer: Reevaluate hovered window on window rect change
When a new Window instance is added to the WindowManager, it does not
yet have an updated value for `m_frame->rect()` and we're not checking
if there is a new candidate for the hovered window, which we need to do
since the mouse cursor might hover above the newly opened window.

This fixes both issues: as soon as a Window frame's rect is changed,
ask the WindowManager to reevaluate its hovered window. This takes care
of newly opened windows _and_ windows that are programmatically changed
in size.

This works because when a Window becomes hovered, the WindowManager
sends out an enter event. This event in turn triggers the Window to
evaluate the cursor type under the mouse position and to update it when
necessary.

Fixes #4809.
2021-04-27 08:58:13 +02:00
Jelle Raaijmakers
83dfc4aa46 LibGUI/Window: Do not reset mouse cursor on show()
Window::m_cursor already has ::None as its default value, so let's not
overwrite its value if it was set to something else.
2021-04-27 08:58:13 +02:00
Jagger De Leo
cec8488d9d Demos: Add Starfield screensaver demo 2021-04-26 23:13:27 +02:00
kleines Filmröllchen
563cc17a50 LibAudio: Support 32 and 64-bit float WAV files
LibAudio's WavLoader plugin for loading WAV files now supports loading
audio files with 32-bit float or 64-bit float samples.

By supporting these new non-int sample formats, Audio::Buffer now stores
the sample format (out of a list of supported formats) instead of the
raw bit depth. (The bit depth is easily calculated with
pcm_bits_per_sample)
2021-04-26 19:08:40 +02:00
DexesTTP
91c210c39a LibGUI: Make common locations configurable 2021-04-26 18:57:57 +02:00
Gunnar Beutner
fddcaafe5f Utilities: Make ls respect options when specifying more than one path
When specifying more than one path (e.g. with ls -l /usr /bin) ls
would ignore other display options and fall back to showing the files
in short mode.
2021-04-26 18:44:30 +02:00
thankyouverycool
ed634a4582 FontEditor: Don't put invalid clicks on the undo stack 2021-04-26 18:43:35 +02:00
thankyouverycool
8febfb169d FontEditor: Warn on unsaved changes
Standardizes saving conventions: Editor now warns on close, new,
and open if there are unsaved changes, and new files prompt to
Save As.
2021-04-26 18:43:35 +02:00
thankyouverycool
67f81adc55 Calendar: Swap Liza for Marieta 2021-04-26 18:41:54 +02:00
Gunnar Beutner
ba9a285d56 Profiler: Use NonnullOwnPtr for libraries 2021-04-26 17:13:55 +02:00
Gunnar Beutner
eb798d5538 Kernel+Profiler: Improve profiling subsystem
This turns the perfcore format into more a log than it was before,
which lets us properly log process, thread and region
creation/destruction. This also makes it unnecessary to dump the
process' regions every time it is scheduled like we did before.

Incidentally this also fixes 'profile -c' because we previously ended
up incorrectly dumping the parent's region map into the profile data.

Log-based mmap support enables profiling shared libraries which
are loaded at runtime, e.g. via dlopen().

This enables profiling both the parent and child process for
programs which use execve(). Previously we'd discard the profiling
data for the old process.

The Profiler tool has been updated to not treat thread IDs as
process IDs anymore. This enables support for processes with more
than one thread. Also, there's a new widget to filter which
process should be displayed.
2021-04-26 17:13:55 +02:00
sppmacd
d164da7d19
Browser: Add basic support for search engines
If you start a URL with a '?' character, the Browser will use the
user-selected search engine (none by default).

For now, there are several engines hardcoded and there is no support
for custom search engines.
2021-04-26 11:52:19 +02:00
dhirsbrunner
cd9e352460 LibC: Fix typo in signal.h: ol_dset -> old_set 2021-04-26 11:27:13 +02:00
Sahan Fernando
b4e125cf86 Userland: Make rmdir take multiple paths 2021-04-26 09:32:42 +02:00
Panagiotis Vasilopoulos
43956c9611 LibC: Add additional data types
- Reorganized some variables (alphabetically and based on their function) so that the new ones don't stick out.
- See: https://github.com/SerenityOS/serenity/issues/6068

Co-authored-by: Linus Groh <mail@linusgroh.de>
2021-04-26 09:24:21 +02:00
Linus Groh
7b1ba4bd5c LibJS: Fallback to undefined if last value in eval() is empty
For something like eval(""), the VM's 'last value' is an empty value,
which we must not leak.

Fixes #6643.
2021-04-25 22:52:19 +02:00
Idan Horowitz
2b4c2301a9 LibJS: Stop rolling back parser state that is immediately replaced
This showed up on a profile (barely), so should help a tiny bit with
perf in parsing arrow functions.
2021-04-25 22:46:34 +02:00
Linus Groh
aef502e8e0 LibJS: Change PropertyName::as_number() return type to u32
This is how it's stored internally - even though we still only construct
from i32. I had the compiler yell at me while trying something with this
and didn't want to add yet another cast, so let's quickly fix this.
2021-04-25 22:42:48 +02:00
Linus Groh
c61de8e4be LibJS: Use Object::get_own_properties() for getOwnPropertyNames() 2021-04-25 22:40:21 +02:00
Linus Groh
af62678c31 LibJS: Don't assume call_frame->current_node in Exception constructor
It's a nullptr in promise reaction job functions, for example. Regressed
in 97d49cb.

Fixes #6641.
2021-04-25 21:45:23 +02:00
Linus Groh
dbe72fd962 Everywhere: Remove empty line after function body opening curly brace 2021-04-25 20:20:00 +02:00
Rafał
2d6be48c6f
LibGUI: Select last word when double clicking at the end of a line
Fixes #6565.
2021-04-25 19:51:03 +02:00
Linus Groh
c2f936b14c LibWeb: Use full source URL as script filename
Just the basename is not enough in most cases, as it's usually not
immediately obvious where scripts are loaded from.
2021-04-25 19:28:25 +02:00
DexesTTP
71d27abb97 Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with
the recent introduction of the WebSocket service, long-lasting
connections with another server are not part of it. To better reflect
this, this commit renames it to RequestServer.

This commit also changes the existing 'protocol' portal to 'request',
the existing 'protocol' user and group to 'request', and most mentions
of the 'download' aspect of the request to 'request' when relevant, to
make everything consistent across the system.

Note that LibProtocol still exists as-is, but the more generic Client
class and the more specific Download class have both been renamed to a
more accurate RequestClient and Request to match the new names.

This commit only change names, not behaviors.
2021-04-25 19:04:34 +02:00
DexesTTP
22413ef729 LibWeb: Add WebSocket bindings
The WebSocket bindings match the original specification from the
WHATWG living standard, but do not match the later update of the
standard that involves FETCH. The FETCH update will be handled later
since the changes would also affect XMLHttpRequest.
2021-04-25 19:04:34 +02:00
DexesTTP
68bfb46a6f LibWeb: Add exception support in IDL constructors 2021-04-25 19:04:34 +02:00
DexesTTP
d398943c37 Utilities: Update telws to use the isolated WebSocket service 2021-04-25 19:04:34 +02:00
DexesTTP
62ed26164b Services: Add a WebSocket service
The WebSocket service isolates communication with a WebSocket to its
own isolated process. Similar to other isolating services, it has its
own user and group.
2021-04-25 19:04:34 +02:00
DexesTTP
c11ca9df33 LibWebSocket+telws: Use my own copyright headers :^)
Since I guess I'll start attributing my own code, might as well change
it for the previously written WebSocket code too !
2021-04-25 19:04:34 +02:00
FalseHonesty
d8409c0e29 HackStudio: Display variable type name in expression evaluator 2021-04-25 19:03:57 +02:00
FalseHonesty
4f2c0e9968 HackStudio: Implement custom JS -> C++ "proxy" objects
This patch adds a custom JS Object type that will convert written
properties to their C++ equivalents, reflecting JS writes back
to the debugging session. This is better than a simple proxy because
printing this custom object works as expected because properties
still exist on the object as existing handlers expect.
2021-04-25 19:03:57 +02:00
FalseHonesty
60d329a186 HackStudio: Add evaluate expression popup to debugger
This implements a dialog that can be used to evaluate a JS expression
in the HackStudio's Debugger context. It also implements simple
C++ Variable <-> JS Value conversion, allowing for JS expressions
to read/write variables in the debugger scope.

Currently, C++ structs are mapped to JS objects by way of a JS proxy,
however this leads to issues when printing, so this will be changed
in a later commit.
2021-04-25 19:03:57 +02:00
FalseHonesty
bee16bb83a LibJS: Don't suppress GlobalObject variable lookup exceptions
In HackStudio's Debugger a custom GlobalObject is used to reflect
debugger variables into the JS scope by overriding GlobalObject's
get method. However, when throwing a custom error during that lookup
it was replaced with the generic "not found" js exception. This patch
makes it instead pass along the custom error.
2021-04-25 19:03:57 +02:00
Andreas Kling
6c2ec4c1a4 Userland+Base: Add "ladyball" logo for the system :^)
Thanks to Katalin Kult for the artwork!
2021-04-25 18:57:10 +02:00
TheGeopard
2b78d90d04 FileManager: Unzip from context Menu
This adds a new context menu entry allowing you to extract ZIP archives
by invoking /bin/unzip
2021-04-25 18:40:42 +02:00
TheGeopard
6a4ea4bf55 unzip: Add output directory option
This allows setting the output directory for unzip by adding a new
optional argument
2021-04-25 18:40:42 +02:00
sin-ack
62af6cd4f9 IPCCompiler: Remove hardcoded endpoint magic, attempt deux
This patch removes the IPC endpoint numbers that needed to be specified
in the IPC files.  Since the string hash is a (hopefully) collision free
number that depends on the name of the endpoint, we now use that
instead. :^)

Additionally, endpoint magic is now treated as a u32, because endpoint
numbers were never negative anyway.

For cases where the endpoint number does have to be hardcoded (a current
case is LookupServer because the endpoint number must be known in LibC),
the syntax has been made more explicit to avoid confusing those
unfamiliar.  To hardcode the endpoint magic, the following syntax is now
used:

endpoint EndpointName [magic=1234]
2021-04-25 14:06:56 +02:00
kleines Filmröllchen
d77e7e99e4 Piano: Add track Volume and improve QOL
This patch implements a couple of enhancements to the synthesizer
engine:

* Each track has a volume control.
* The input and tooltips for all controls are improved.
* The noise channel is pitched, which allows for basic drum synthesis.
2021-04-25 11:30:41 +02:00