Commit graph

26637 commits

Author SHA1 Message Date
Timothy Flynn
940c023e09 LibJS: Compare Unicode locale variants using case-insensitive matching
In the IsStructurallyValidLanguageTag AO, we of course cannot assume the
variants are canonicalized to lower-case yet, because canonicalization
hasn't happened yet.
2021-09-02 17:56:42 +01:00
Timothy Flynn
fdedb3ab33 LibJS: Remove duplicated error message from ErrorTypes.h
ErrorType::IntlInvalidCode has almost exactly the same message as
ErrorType::OptionIsNotValidValue. Remove it, as all uses of the former
are semantically interchangeable with the latter.
2021-09-02 17:56:42 +01:00
Timothy Flynn
21c4922ac0 LibUnicode: Add helper methods to LocaleID and LanguageID for LibJS
Add a method to remove an extension type from the locale's extension set
and methods to convert a locale and language to a string without
canonicalization. Each of these will be used by LibJS.
2021-09-02 17:56:42 +01:00
Timothy Flynn
a05419db55 LibUnicode: Add lexer to test if a string matches the "type" production 2021-09-02 17:56:42 +01:00
Timothy Flynn
113bf4a9dd LibUnicode: Add missing structures to forwarding header 2021-09-02 17:56:42 +01:00
Timothy Flynn
128779938d js: Implement pretty-printing of Intl.Locale 2021-09-02 17:56:42 +01:00
Timothy Flynn
2c10e9fdd3 LibJS: Implement a nearly empty Intl.Locale object
This adds plumbing for the Intl.Locale object, constructor, and
prototype.
2021-09-02 17:56:42 +01:00
Stephan Unverwerth
e7d3483618 LibGL: Implement glTexSubImage2D 2021-09-02 21:00:24 +04:30
Stephan Unverwerth
1aed453d8c LibGL: Add GL_TETXURE*_ARB aliases
These defines were introduced when multitexturing was only supported via
the extension EXT_multitexture. GLQuake makes use of them.
2021-09-02 21:00:24 +04:30
Stephan Unverwerth
e34fc4e336 LibGL: Support additional enums in glGetIntegerv
GL_MAX_TETXURE_UNITS: Returns the available units for multitexturing
GL_MAX_TETXURE_SIZE: Returns the maximum width/height for textures
2021-09-02 21:00:24 +04:30
Stephan Unverwerth
7c60f4bbab LibGL: Fix glTexImage2D texture dimension validation
This now verifies that width and height are a power of 2. The previous
check was nonsensical, probably because it was written against a spec
with improper text formatting, turning 2^x into 2*x :^)
2021-09-02 21:00:24 +04:30
Stephan Unverwerth
05a7a4640d LibGL: Allow numerical internal formats in glTexImage2D
Prior to version 1.1 OpenGL only allowed the numbers 1,2,3 and 4 to be
used as internal texture formats. Symbolic constants were introduced
first with the EXT_texture extension and then later adopted into the
core profile.
2021-09-02 21:00:24 +04:30
Stephan Unverwerth
15299b763c LibGL: Implement glPolygonOffset 2021-09-02 21:00:24 +04:30
Stephan Unverwerth
7cbaaf8366 LibGL: Implement glDrawBuffer 2021-09-02 21:00:24 +04:30
Mahmoud Mandour
b069c1306c About: Display the full version 2021-09-02 16:17:18 +01:00
Mahmoud Mandour
eb6f9d469a AboutDialog: Accept a version string
This allows applications to specify a version string to appear in the
`AboutDialog`.
2021-09-02 16:17:18 +01:00
Mahmoud Mandour
7742f37c10 LibCore: Refactor a version-reading utility
`ArgsParser` and `AboutDialog` had the same procedure to read the
version from `/res/version.ini`. Now they use the `SERENITY_VERSION`
string by default.

This commit refactored the version-reading utility to the new
`Core::Version` namespace.
2021-09-02 16:17:18 +01:00
Mahmoud Mandour
ad80d4dce0 LibCore+LibGUI: Define a Serenity version in LibCore
Before, `AboutDialog` and `ArgsParser` read from a build-time created
file called `/res/version.ini`. This caused problems with utilities
unveiling specific paths leaving the version file unaccessible.

This commit hard-codes a serenity version in `LibCore`, and use it in
`ArgsParser` and `AboutDialog`.

The previous version contained the hash of the last GIT commit, this is
omitted for the default use for the sake of simplicity.
2021-09-02 16:17:18 +01:00
Karol Kosek
e3f7753233 TextEditor: Stop calling window->set_modified(false) on file save
We use TextEditor::on_modified_change() to update the modified window
flag, which it also works on file saves, so we don't have to unset
it there anymore!

It isn't really what the FIXME note asked about -- GUI::TextDocument
only sends us notifications about the changes, but overall I don't
think it's that bad, given that the whole window update logic is now
in one function. :^)
2021-09-02 09:12:51 +02:00
Luke Wilde
1d8f8ea5b1 LibWeb: Add initial support for AbortController and AbortSignal
The DOM specification says that the primary use case for these is to
give Promises abort semantics. It is also a prerequisite for Fetch,
as it is used to make Fetch abortable.
a
2021-09-02 09:12:17 +02:00
Luke Wilde
dd1a49ff93 LibWeb: Add missing shadow including ancestor checks in EventDispatcher 2021-09-02 09:11:24 +02:00
Luke Wilde
bd55f0ad64 LibWeb: Add shadow including ancestor/descendant checks 2021-09-02 09:11:24 +02:00
Mustafa Quraish
dd5ceb74e9 PixelPaint: Ctrl+click on palette colors now sets primary/secondary
Previously it would only change the color of the ColorWidget itself,
but not make it the primary/secondary color. I think it feels nicer
this way, if I'm adding a color to the palette I likely want to use
it.

If you *really* need to only change the color of the palette, you
can just Ctrl+Middle click.
2021-09-02 09:09:12 +02:00
Mustafa Quraish
8d8ec6365b PixelPaint: Allow changing colors temporarily without palette
Previously, if you wanted to use a custom color, the only way to
do so was to first Ctrl+click on one of the pallette colors, which
would just change that palette item. Then, you would need to
manually click on that color.

Now, you can just click on the preview of the primary/secondary
color to open up the picker and only temporarily use the new color
without affecting the palette at all.
2021-09-02 09:09:12 +02:00
Andrew Kaster
58797a1289 Tests: Remove all file(GLOB) from CMakeLists in Tests
Using a file(GLOB) to find all the test files in a directory is an easy
hack to get things started, but has some drawbacks. Namely, if you add
a test, it won't be found again without re-running CMake. `ninja` seems
to do this automatically, but it would be nice to one day stop seeing it
rechecking our globbed directories.
2021-09-02 09:08:23 +02:00
sin-ack
b5a145b466 Tests: Add tests for Core::deferred_invoke 2021-09-02 03:47:47 +04:30
sin-ack
749f62860e LibCore: Remove deferred_invoke overload with Object& parameter
This is not necessary because the user can just use this, which is
referenced until the deferred invocation is complete.
2021-09-02 03:47:47 +04:30
sin-ack
8ea22121ac Userland: Migrate to argument-less deferred_invoke
Only one place used this argument and it was to hold on to a strong ref
for the object. Since we already do that now, there's no need to keep
this argument around since this can be easily captured.

This commit contains no changes.
2021-09-02 03:47:47 +04:30
sin-ack
e9121f8b1f LibCore+Userland: Implement Core::deferred_invoke
Core::deferred_invoke is a way of executing an action after previously
queued events have been processed. It removes the requirement of
having/being a Core::Object subclass in order to defer invocation
through Core::Object::deferred_invoke.

Core::Object::deferred_invoke now delegates to Core::deferred_invoke.
The version with the Object& argument is still present but will be
removed in the following commits.

This commit additionally fixes a new places where the
DeferredInvocationEvent was dispatched to the event loop directly, and
replaces them with the Core::deferred_invoke equivalent.
2021-09-02 03:47:47 +04:30
thankyouverycool
ac24842f48 Welcome: Update tips.txt
Super+Wheeling window opacity was removed in 370d374.
Guilty only of being ahead of its time.
2021-09-02 00:39:12 +02:00
thankyouverycool
902d24136b Welcome: Replace rand()/srand() with AK::get_random_uniform() 2021-09-02 00:39:12 +02:00
thankyouverycool
02121336b4 Welcome: Make license headers uniform 2021-09-02 00:39:12 +02:00
thankyouverycool
03b6f8e7fd LibGUI: Don't draw Scrollbar scrubber when scrubber rect is null
Fixes null scrubbers drawing over the decrement button when
window dimensions dictate they disappear.
2021-09-01 23:02:01 +01:00
thankyouverycool
93e45588e5 LibGUI:: Style Combo and SpinBox buttons as ThickCaps
These suffered the same visual defect as scrollbars when styled
as normal buttons: against backgrounds with the same color as
their highlighting, aspect was lost.
2021-09-01 23:02:01 +01:00
sin-ack
c93c54c656 js: Use CodepointOriented spans and use the codepoint length of token
We were previously using byte-oriented spans. This would work if not for
token.line_column() being in codepoints.
2021-09-01 23:04:26 +02:00
Dawid Wolosowicz
977b62a213 3DFileViewer: Maintain the FPS counter's position
Without this, any resize of the GLContextWidget might leave the label
somewhere it shouldn't be. Toggling fullscreen is a single example of
that behavior.
2021-09-01 23:04:10 +02:00
Andreas Kling
51ae913bfe LibIMAP: Stop leaking a Core::Promise<bool> in IMAP::Client::connect() 2021-09-01 23:02:18 +02:00
Andreas Kling
f4c4b42db9 AK: Move forward() into the std namespace
Same as we already did with move(). This allows compiler diagnostics
and static analyzers like SonarCloud to detect more issues.
2021-09-01 23:02:18 +02:00
Andreas Kling
ee562a8ed7 LibIMAP: Remove accidental use of STL 2021-09-01 23:02:18 +02:00
Karol Kosek
848c4fc43d LibGUI: Show an error message box in the FilePicker on no permissions
The first attempt in #9037 used a special label as a view, if it wanted
to communicate any kind of error, but that sure did look a bit ugly.

Here, we are just showing a message box right before setting the new
path as:
- the contents of the previous directory will be visible in background,
  which I find pretty nice, and
- I don't have to deal with adding a path history vector to reopen
  the previous directory (which might not even exist then). :^)
2021-09-01 23:01:18 +02:00
Dawid Wolosowicz
14c30af7d8 SpaceAnalyzer: Enable icons within the breadcrumbbar
The breadcrumbbar in here serves exactly the same purpose as the one in
File Manager. Given that, I believe it's worth to keep these two
visually consistent.
2021-09-01 23:00:28 +02:00
Thitat Auareesuksakul
1600d5a446 SoundPlayer: Use GUI::ActionGroup for Visualization menu
Removed the old custom checkbox selection code in the Visualization
menu and replaced them with GUI::ActionGroup with set_exclusive
enabled instead :^)
2021-09-01 19:19:35 +02:00
Brian Gianforcaro
4de0f68486 Profiler: Minor static code analysis issues in FlameGraphView 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
16f0248ca2 Profiler: Use = default for empty destructor 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
c0341215de Kernel: Use = default for empty destructors 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
e15be89e18 Meta: Add Sonar Cloud link / badge to the README.md 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
511822c9fe HackStudio: Fix typo in C++ file extension mapping code
This looks like a copy past bug where we were checking "cc" twice
instead of checking for the equivalent header extension.

Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
0bd089b282 SoundPlayer: Fix file leak in M3UParser::from_file(..)
Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
afa0fb55b0 Kernel: Don't cast to NetworkOrdered<u16>* from random data
NetworkOrdered is a non trivial type, and it's undefined behavior to
cast a random pointer to it and then pretend it's that type.

Instead just call AK::convert_between_host_and_network_endian on the
individual u16*. This suppresses static analysis warnings.

I don't think there was a "bug" in the previous code, it worked, but
it was very brittle.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
668c429900 Kernel: Convert UserOrKernelBuffer callbacks to use AK::Bytes 2021-09-01 18:06:14 +02:00