Commit Graph

3530 Commits

Author SHA1 Message Date
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
Andreas Kling
418bc484e4 Revert "IPCCompiler: Use string hashes for IPC endpoint magic"
This reverts commit 59218007a3.
2021-04-25 11:24:12 +02:00
sin-ack
53aec3e06d LibGUI: Implement Vim motion system
This patch implements Vim motions.  The VimMotion class will accept
keycodes from the editing engine to build up a motion, and will
signal when a motion is complete via VimMotion::is_complete().  The
editing engine can then call VimMotion::get_range() to obtain a
TextRange object which can be used to perform operations on the text,
or VimMotion::get_position() to obtain a TextPosition which is the
new position of the cursor after the motion.

Currently, the following motions are supported:

- h/j/k/l, regular Vim line and character movements
- 0/^/$, start/end of line and start of non-blank
- w/e/b/ge, word-related movements
- W/E/B/gE, WORD (anything non-blank) versions of the above motions
- gg/G, document related movements
- t/f, to/find character

All motions except gg/G accept a number prefix to repeat the motion that
many times.

This patch updates insert, normal and visual modes to use this motion
system for movement.
2021-04-25 10:41:16 +02:00
Gunnar Beutner
f40ee1b03f LibC+LibELF: Implement more fully-features dlfcn functionality
This implements more of the dlfcn functionality. Most notably:

* It's now possible to dlopen() libraries which were already
  loaded at program startup time. This does not cause those
  libraries to be loaded twice.
* Errors are reported via dlerror() rather than by crashing
  the program.
* Calls to the dl*() functions are thread-safe.
2021-04-25 10:14:50 +02:00
Gunnar Beutner
549d9bd3ea LibC: Move the __pthread_mutex_trylock function to LibC
Let's move this to LibC because the dynamic loader depends
on this function.
2021-04-25 10:14:50 +02:00
Hendiadyoin1
acd65a5f86 UserspaceEmulator: Add more Instructions
Adds:
* CMC
* POPA
* POPAD
* POPF
* PUSHA
* PUSHAD
* PUSHF
* PUSH_RM16
* SAHF
* FPU:
  * FNOP
  * FPREM
  * FSINCOS
  * FCMOVxx
  * FISTTP
2021-04-25 09:56:29 +02:00
Gunnar Beutner
2447dcd1ea LibC: Implement the rewinddir() function 2021-04-25 09:54:39 +02:00
Andrew Kaster
35c0a6c54d AK+Userland: Move AK/TestSuite.h into LibTest and rework Tests' CMake
As many macros as possible are moved to Macros.h, while the
macros to create a test case are moved to TestCase.h. TestCase is now
the only user-facing header for creating a test case. TestSuite and its
helpers have moved into a .cpp file. Instead of requiring a TEST_MAIN
macro to be instantiated into the test file, a TestMain.cpp file is
provided instead that will be linked against each test. This has the
side effect that, if we wanted to have test cases split across multiple
files, it's as simple as adding them all to the same executable.

The test main should be portable to kernel mode as well, so if
there's a set of tests that should be run in self-test mode in kernel
space, we can accomodate that.

A new serenity_test CMake function streamlines adding a new test with
arguments for the test source file, subdirectory under /usr/Tests to
install the test application and an optional list of libraries to link
against the test application. To accomodate future test where the
provided TestMain.cpp is not suitable (e.g. test-js), a CUSTOM_MAIN
parameter can be passed to the function to not link against the
boilerplate main function.
2021-04-25 09:36:49 +02:00
Rok Povsic
77d4b6e435 VimEditingEngine: Add handling { and } to move between empty lines 2021-04-25 09:34:51 +02:00
Brian Gianforcaro
f8fffe4613 LibWeb: Utilize SourceLocation for HTMLDocumentParser logging 2021-04-25 09:32:03 +02:00
Brian Gianforcaro
6d69c97b99 LibWeb: Utilize SourceLocation for HTMLTokenizer logging 2021-04-25 09:32:03 +02:00
Brian Gianforcaro
1411ae1bc7 LibWeb: Utilize SourceLocation for CSS/Tokenizer logging 2021-04-25 09:32:03 +02:00
Brian Gianforcaro
46524426fb LibWeb: Utilize SourceLocation for CSS/Parser logging 2021-04-25 09:32:03 +02:00
Brian Gianforcaro
4022d3cb75 LibWeb: Use SourceLocation for DeprecatedCSSParser logging. 2021-04-25 09:32:03 +02:00