Commit graph

26294 commits

Author SHA1 Message Date
Andrew Kaster
47471c0ec2 Meta: Prefer SerenityOS_SOURCE_DIR to CMAKE_SOURCE_DIR
By using SerenityOS_SOURCE_DIR we can make custom targets and commands
agnostic to the actual location of the root CMakeLists directory.
All we care about is the root of the SerenityOS project.
2021-08-28 08:44:17 +01:00
Andrew Kaster
20e904d87c Meta: Move code generator helpers to their own CMake helper file
compile_gml, compile_ipc, and generate_state_machine all use host
tools to generate sources for the target build. As part of trying to
organize host tools into a common area, let's move these helper rules to
a common file that we can add other host tools to later. And, keep the
host tool helpers separate from the CMake target helpers for apps and
libraries.
2021-08-28 08:44:17 +01:00
Andrew Kaster
a83847f8bf Meta: Move components CMake helpers to their own file
It's hard to follow how all the functions in the utils.cmake helper file
flow together, so let's move the pieces that are related to each other
into specialized helpers. First up: all the ConfigureComponents related
properties and functions.
2021-08-28 08:44:17 +01:00
Ralf Donau
e36931fffe Utilities: Add a command line client for ConfigServer
This is an alternative to the ini utility which accesses the
configuration files through the newly introduced ConfigServer.
2021-08-28 08:24:48 +01:00
Mustafa Quraish
2dea772d48 shot: Get only cropped region from WindowServer
Previously, we were always getting the full screen(s) bitmap from
the WindowServer and cropping it manually. The `get_screen_bitmap`
function already took in a `crop_region`, so we are now utilizing
that.
2021-08-28 08:18:41 +01:00
Mustafa Quraish
5f23958abd WindowServer: Always return properly cropped bitmap
Previously, when `screen_index` was not provided when calling
`ClientConnection::get_screen_bitmap`, the bitmap that was created
was always the size of the bounding rect of the screen. The actual
screen bitmap was being cropped, but the bitmap being returned was
of the original size with just black pixels everywhere else.
2021-08-28 08:18:41 +01:00
Simon Danner
16830a60ec LibGUI: Select common location on Filepicker startup 2021-08-28 08:17:00 +01:00
Robert Syring
4f2dc8db26 LibUnicode: Change unzip commands to also extract subdirectories
Changed unzip commands from * to ** in order to also extract subdirectories from cldr.zip.
2021-08-28 08:13:32 +01:00
Mustafa Quraish
5a8ac56fb9 PixelPaint: Always change cursor when active tool is set
Previously, if you used one of the keyboard shortcuts to select a
different tool, it didn't change the cursor to the corresponding
one till you clicked somewhere / did something else to trigger an
update. This was pretty jarring since there's no indication as to
whether the tool change was successful or not.

This patch just calls `set_override_cursor()` when a valid active
tool is set to immediately update it.
2021-08-28 08:10:44 +01:00
kleines Filmröllchen
01b38ffc9a Documentation: Add configuration information for VSCode
This is a combination of the efforts of multiple people and hours of
pain trying to configure VSCode properly. This should give a good
baseline for anyone trying to develop Serenity with VSCode.

Co-authored-by: Hendiadyoin1 <leon2002.la@gmail.com>
2021-08-27 23:37:39 +01:00
Linus Groh
a8329272cc LibJS: Implement Temporal.ZonedDateTime.prototype.eraYear 2021-08-27 23:36:52 +01:00
Linus Groh
b59e9260db LibJS: Implement Temporal.ZonedDateTime.prototype.era 2021-08-27 23:36:52 +01:00
Linus Groh
f59e4d6738 LibJS: Implement Temporal.PlainYearMonth.prototype.eraYear 2021-08-27 23:36:52 +01:00
Linus Groh
b11ea98648 LibJS: Implement Temporal.PlainYearMonth.prototype.era 2021-08-27 23:36:52 +01:00
Linus Groh
f2f671f340 LibJS: Implement Temporal.PlainDateTime.prototype.eraYear 2021-08-27 23:36:52 +01:00
Linus Groh
276d3f5089 LibJS: Implement Temporal.PlainDateTime.prototype.era 2021-08-27 23:36:52 +01:00
Linus Groh
418c22f9b3 LibJS: Implement Temporal.PlainDate.prototype.eraYear 2021-08-27 23:36:52 +01:00
Linus Groh
6f7d6d917e LibJS: Implement Temporal.PlainDate.prototype.era 2021-08-27 23:36:52 +01:00
Linus Groh
c3e0d78ba6 LibJS: Implement Temporal.Calendar.prototype.eraYear() 2021-08-27 23:36:52 +01:00
Linus Groh
f746850d1c LibJS: Implement Temporal.Calendar.prototype.era() 2021-08-27 23:36:52 +01:00
Mustafa Quraish
525a7e487b AudioApplet: Remove wpath and cpath priviliges 2021-08-27 23:17:05 +02:00
Mustafa Quraish
17299db61a Hearts: Remove wpath and cpath priviliges
There are no longer needed since the config file is not being
modified by the application directly.
2021-08-27 23:17:05 +02:00
Mustafa Quraish
c646efaf49 AudioApplet: Use LibConfig instead of Core::ConfigFile
No longer need to store `RefPtr<Core::ConfigFile>` :^)
2021-08-27 23:17:05 +02:00
Mustafa Quraish
0af3855fb9 Hearts: Use LibConfig instead of Core::ConfigFile 2021-08-27 23:17:05 +02:00
Musab Kılıç
3edeb9b7e7 Shell: Use variable instead of iteration_times.size() in builtin_time 2021-08-27 23:16:53 +02:00
Musab Kılıç
29a9be6503 Shell: Add iteration_times.ensure_capacity() in builtin_time 2021-08-27 23:16:53 +02:00
Mustafa Quraish
75a706b6eb Everywhere: Use the Optional<T>::operator==(T) operator
In general, I think `opt == x` looks much nicer than
`opt.has_value() && opt.value() == x`, so I'm updating
the remaining few instances I could find with some regex
magic in my search.
2021-08-27 23:13:51 +02:00
kleines Filmröllchen
2dc614127e Meta: Add System32 to the PATH so that reg.exe is always found
On my machine (c), /mnt/c/Windows/System32 is not on the PATH by
default. This causes reg.exe to fail, which is responsible for detecting
the presence of QEMU. By putting this path on the PATH on WSL, it will
always work regardless of the specific PATH configuration, and QEMU is
always detected.
2021-08-27 21:24:25 +01:00
kleines Filmröllchen
7d7d310df6 Base+Utilities: Add the asctl audio utility, replacing avol
The new asctl (audio server control) utility expands on avol with a
completely new command line interface (documented in the man page) that
supports retrieving and setting all exposed audio server settings, like
volume and sample rate. This is currently the only user-facing way of
changing the sample rate.
2021-08-27 23:35:27 +04:30
kleines Filmröllchen
f99e6507ee AK: Add Traits for Enums
Enums can be hashed as their underlying integral type. This allows enum
keys in hash maps etc.
2021-08-27 23:35:27 +04:30
kleines Filmröllchen
22b836dd7b Userland: Two low-sample rate fixes
1) The Sound Player visualizer couldn't deal with small sample buffers,
   which occur on low sample rates. Now, it simply doesn't update its
buffer, meaning the display is broken on low sample rates. I'm not too
familiar with the visualizer to figure out a proper fix for now, but
this mitigates the issue (and "normal" sample rates still work).
2) Piano wouldn't buffer enough samples for small sample rates, so the
   sample count per buffer is now increased to 2^12, introducing minor
amounts of (acceptable) lag.
2021-08-27 23:35:27 +04:30
kleines Filmröllchen
d049626f40 Userland+LibAudio: Make audio applications support dynamic sample rate
All audio applications (aplay, Piano, Sound Player) respect the ability
of the system to have theoretically any sample rate. Therefore, they
resample their own audio into the system sample rate.

LibAudio previously had its loaders resample their own audio, even
though they expose their sample rate. This is now changed. The loaders
output audio data in their file's sample rate, which the user has to
query and resample appropriately. Resampling code from Buffer, WavLoader
and FlacLoader is removed.

Note that these applications only check the sample rate at startup,
which is reasonable (the user has to restart applications when changing
the sample rate). Fully dynamic adaptation could both lead to errors and
will require another IPC interface. This seems to be enough for now.
2021-08-27 23:35:27 +04:30
kleines Filmröllchen
9880a5c481 AudioServer: Expose the ability to get and set the sample rate
Two new IPC calls allow audio clients to get and set the sample rate.
The AudioServer calls into the new ioctl of the sound card.
2021-08-27 23:35:27 +04:30
kleines Filmröllchen
d0ceaa24a6 Kernel: Implement ioctl for the SB16 to change sample rate
Two new ioctl requests are used to get and set the sample rate of the
sound card. The SB16 device keeps track of the sample rate separately,
because I don't want to figure out how to read the sample rate from the
device; it's easier that way.

The soundcard write doesn't set the sample rate to 44100 Hz every time
anymore, as we want to change it externally.
2021-08-27 23:35:27 +04:30
kleines Filmröllchen
2c9afaf5ac Kernel: Modernize SB16.cpp
This was some old code that could use mostly some east-const :^)
2021-08-27 23:35:27 +04:30
Idan Horowitz
24dbf18936 LibJS: Implement Temporal.PlainDateTime.prototype.withPlainTime() 2021-08-27 19:01:30 +01:00
Idan Horowitz
0f464f38d3 LibJS: Implement Temporal.PlainTime.prototype.equals() 2021-08-27 19:01:30 +01:00
Idan Horowitz
684e62476b LibJS: Implement Temporal.PlainTime.compare() 2021-08-27 19:01:30 +01:00
Idan Horowitz
a77cdc5f92 LibJS: Implement Temporal.PlainTime.from() 2021-08-27 19:01:30 +01:00
Idan Horowitz
bb857330d2 LibJS: Implement Temporal.PlainDate.prototype.toPlainDateTime() 2021-08-27 19:01:30 +01:00
Idan Horowitz
f6370fe3f7 LibJS: Add the ToTemporalTime AO and stub the ParseTemporalTimeString AO
This AO is required for a bunch of PlainTime related methods.

As part of this change the `TemporalTime` record was renamed to
`UnregulatedTemporalTime` and a new `TemporalTime` record that matches
the other Temporal parse result records was added. This also has the
added benefit of getting rid of a would be round-trip cast from integer
to double and back in `ParseTemporalTimeString`.
2021-08-27 19:01:30 +01:00
Idan Horowitz
32fc81c186 LibJS: Implement Temporal.PlainDateTime.prototype.equals() 2021-08-27 16:40:16 +01:00
Idan Horowitz
9ed877e8e7 LibJS: Implement Temporal.PlainDateTime.compare() 2021-08-27 16:40:16 +01:00
Idan Horowitz
28fa4d1568 LibJS: Add the CompareTemporalTime & CompareISODateTime AOs
These are required for implementing comparisons between `PlainTime`s and
`PlainDateTime`s.
2021-08-27 16:40:16 +01:00
Timothy Flynn
86b99fd9a6 LibJS: Extend Intl.DisplayNames.of to support currency tags 2021-08-27 12:32:24 +01:00
Timothy Flynn
8b93d51212 LibUnicode: Parse Unicode CLDR currencies and generate locale mappings 2021-08-27 12:32:24 +01:00
Timothy Flynn
297db925fc LibUnicode: Extract cldr-numbers dataset from CLDR database
This dataset holds the values needed to handle DisplayNames.prototype.of
with a type option of "currency".
2021-08-27 12:32:24 +01:00
Timothy Flynn
a029e3d38a LibJS: Extend Intl.DisplayNames.of to support script tags 2021-08-27 12:32:24 +01:00
Timothy Flynn
0f02def3c2 LibUnicode: Parse Unicode CLDR scripts and generate locale mappings 2021-08-27 12:32:24 +01:00
Timothy Flynn
ca77a7c573 LibJS: Extend Intl.DisplayNames.of to support language tags 2021-08-27 12:32:24 +01:00