Commit graph

26393 commits

Author SHA1 Message Date
Timothy Flynn
6719e5cb17 LibUnicode: Generate locale subtag data as multiple smaller tables
This commit is preemptive to upcoming commits which add more subtags to
the CLDR generator. Rather than generating a giant HashMap containing
all data, generate more (smaller) Array-based tables. This mimics the
UCD generator. This also allows simpler lookups at runtime since we can
generate index-based lookups into the smaller tables rather easily.

Without this change, adding the remaining locale subtags would result
in the generation and compilation of UnicodeLocale.cpp taking about 30s
on my machine. With this change, it takes about half that. Additionally,
the size of the generated file reduces by about 1.5MB.
2021-08-27 12:32:24 +01:00
Timothy Flynn
b8ad4d302e LibUnicode: Move Locale enumeration from generated UCD data to CLDR data
The UCD set of data contained a very small subset of all locales just to
handle some special casing rules. This enumeration will be needed within
the CLDR generator as well. So rather than duplicate the enum, remove it
from the UCD generator in favor of the full list of locales known by the
CLDR generator.
2021-08-27 12:32:24 +01:00
Andreas Kling
317f55bb25 ConfigServer: Update the configuration cache on file changes
We were only notifying clients about the change, but didn't actually
update the internal cache in ConfigServer itself.

Thanks to "The Grey One" for pointing this out. :^)
2021-08-27 13:31:45 +02:00
Mustafa Quraish
4bd9ac1f66 Pong: Remove unused Core::ConfigFile imports
This application was including, opening and unveiling the path for
a config file, however it never actually reads or saves anything
from the configuration file.

Since it's easy enough to add it back later if needed, probably
makes sense to remove the unused code right now?
2021-08-27 12:45:50 +02:00
Mustafa Quraish
998d3a98ec Spider: Use LibConfig instead of Core::ConfigFile
There was a lot of error handling here previously when writing to
a config file failed, but this was removed since we have no way of
conveying a `Config::write` failure from the ConfigServer.
2021-08-27 12:45:50 +02:00
Mustafa Quraish
458471cc37 Snake: Use LibConfig instead of Core::ConfigFile 2021-08-27 12:45:50 +02:00
Maciej Zygmanowski
3ad9df1522 PixelPaint: Make Layer passed to tools a pointer
Some tools (e.g. ZoomTool) doesn't need layer to work. This commit
makes mouse events fire even if there is no layer. This fixes
a bug that ZoomTool didn't work when there is no layers.
2021-08-27 12:45:06 +02:00
Maciej Zygmanowski
0224dc2882 PixelPaint: Pass raw mouse event to Tools and wrap them all in a struct
This commit adds a Tool::MouseEvent struct, which contains events that
may be needed by tools: layer-relative, image-relative and raw (editor-
relative) event.

The raw event is used by ZoomTool to properly pan the view. This fixes
a bug which caused image to snap out of sight.
2021-08-27 12:45:06 +02:00
Maciej Zygmanowski
635130ef76 PixelPaint: Make scaling exponential
This matches behaviour of other image editors, e.g GIMP.
The default ZoomTool sensitivity was increased for better zooming
experience :^)
2021-08-27 12:45:06 +02:00
thankyouverycool
96dee93d3f FontEditor: Adjust margins and spacing
Brings vertical spacing in line with most other apps using
ToolbarContainers. Fixes GroupBox margins since CSS ordering
change.
2021-08-27 12:38:29 +02:00
thankyouverycool
e8e7c59c34 FontEditor: Let WindowServer manage modified markings
Simplifies building modified/new font titles and lets FontEditor
make use of the comfy ellipsis close button.
2021-08-27 12:38:29 +02:00
thankyouverycool
a621932c11 FontEditor: Save discrete undo and redo states for each Command
Makes undo/redo actions compatible with the updated UndoStack sans
finalization. Fixes having to click actions twice.
2021-08-27 12:38:29 +02:00
thankyouverycool
92fb2e2a28 Base: Add FontEditor alias to shellrc 2021-08-27 12:38:29 +02:00
Mustafa Quraish
22a1035f1b HexEditor: Use LibConfig instead of Core::ConfigFile 2021-08-27 12:37:07 +02:00
Andreas Kling
7b62113db7 FileManager: Report errors from chdir(), if any 2021-08-26 23:41:38 +02:00
Andreas Kling
83d3720842 ConfigServer: Monitor opened config files for changes
After opening a domain configuration and putting into our configuration
cache, we now monitor the underlying file for changes and send out
notifications to monitoring clients as needed.

This patch has three FIXME's:

- We create a new Core::FileWatcher for each domain.
- We don't yet detect removed keys.
- We don't know the type of key, so we assume everything is a string.

There are a number of ways we can solve those problems but let's not
hold up this patch while we wait for solutions. :^)
2021-08-26 23:41:38 +02:00
Andreas Kling
696dbc889f FileManager: Make DirectoryView listen for configuration changes
DirectoryView now inherits from Config::Listener and will update its
view mode immediately if changed from elsewhere.

This is pretty neat. :^)
2021-08-26 23:41:38 +02:00
Andreas Kling
c8c58626e9 FileManager: Move "View as ViewType" actions into DirectoryView
Let DirectoryView manage these actions itself. This matches what we
already do for a bunch of other actions, and prepares for the next
patch which will add Config::Listener to the mix.
2021-08-26 23:41:38 +02:00
Andreas Kling
edf7843409 ConfigServer+LibConfig: Add way for clients to listen for config changes
This patch adds a Config::Listener abstract class that anyone can
inherit from and receive notifications when configuration values change.

We don't yet monitor file system changes, so these only work for changes
made by ConfigServer itself.

In order to receive these notifications, clients must monitor the domain
by calling monitor_domain(). Only pledged domains can be monitored.

Note that the client initiating the change does not get notified.
2021-08-26 23:41:38 +02:00
Andreas Kling
9509f2ff87 LibWeb: Remove outdated FIXME about ACID2
I should have removed this in 1fa5fba432.
2021-08-26 23:41:37 +02:00
Timothy Flynn
a57615c2b4 Meta: Ensure cmake fails if we are unable to unzip the CLDR database 2021-08-26 23:40:23 +02:00
Timothy Flynn
9663525542 CI: Ensure unzip is installed on the builders
The CLDR database comes in a .zip file.
2021-08-26 23:40:23 +02:00
Timothy Flynn
a061d874c9 LibJS: Implement Intl.DisplayNames.prototype.resolvedOptions 2021-08-26 22:04:09 +01:00
Timothy Flynn
17bb652775 LibJS: Implement Intl.DisplayNames.prototype.of
Note that only option type=region is really implemented. Other types
will resort to the fallback option. This prototype method will be able
to implement other type options once LibUnicode supports more.
2021-08-26 22:04:09 +01:00
Timothy Flynn
38d29a40dc LibJS: Implement Intl.getCanonicalLocales 2021-08-26 22:04:09 +01:00
Timothy Flynn
e8dd2eea74 LibJS: Implement the Intl.DisplayNames constructor
There is notably FIXME notations in this commit regarding Unicode locale
extensions. We are not parsing extensions (or private use extensions) at
all yet.
2021-08-26 22:04:09 +01:00
Timothy Flynn
1c2ac69e3c js: Implement pretty-printing of Intl.DisplayNames 2021-08-26 22:04:09 +01:00
Timothy Flynn
0fb4e8b749 LibJS: Implement a nearly empty Intl.DisplayNames object
This adds plumbing for the Intl.DisplayNames object, constructor, and
prototype.
2021-08-26 22:04:09 +01:00
Timothy Flynn
137e98cb6f LibUnicode: Add public accessors to generated locale data 2021-08-26 22:04:09 +01:00
Timothy Flynn
b7a95cba65 LibUnicode: Implement grammar validators for Unicode TR-35
ECMA-402 requires validating user input against the EBNF grammar for
Unicode locales described in TR-35: https://www.unicode.org/reports/tr35

This commit adds validators for that grammar, as well as other helper to
e.g. canonicalize a locale string.
2021-08-26 22:04:09 +01:00
Timothy Flynn
3127454642 CI: Skip Unicode caches for Fuzzer build
There is a bit of a race here between the Fuzzer and non-Fuzzer Lagom
builds. If the Unicode caches are empty, and the Fuzzer build completes
first, then the UCD and CLDR directories will be empty or won't exist.
Skip handling the Unicode caches for this build.
2021-08-26 22:04:09 +01:00
Timothy Flynn
e883792fd4 CI: Cache downloaded Unicode CLDR database 2021-08-26 22:04:09 +01:00
Timothy Flynn
ea21573ed8 LibUnicode: Download Unicode's CLDR database and generate locale data
The Unicode standard publishes a database known as the Common Locale
Data Repository (CLDR). This is a massive set of data from which anyone
implementing Unicode's Technical Standard #35 may generate their
implementation: https://www.unicode.org/reports/tr35/

This commit updates LibUnicode to download the compressed database and
extract a small subset. That subset is used to generate a list of
available locales and the territories (AKA regions) associated with each
locale.
2021-08-26 22:04:09 +01:00
Timothy Flynn
262e412634 AK: Implement method to convert a String/StringView to title case
This implementation preserves consecutive spaces in the orginal string.
2021-08-26 22:04:09 +01:00
TheFightingCatfish
d2af27d2d0 FileManager: Change the cwd when opening a directory
The `open()` function of DirectoryView should change the current working
directory, so that the "Go to Location" menu item can process relative
paths correctly. Update other functions in DirectoryView to use `open()`
when opening a directory.
2021-08-26 22:02:15 +02:00
TheFightingCatfish
ce66c40160 FileManager: Remove "on activation" debug spam 2021-08-26 22:02:15 +02:00
Ali Mohammad Pur
355c2eef57 AK: Make explode_byte depend on sizeof(FlatPtr) instead of ARCH(...)
The assumption that FlatPtr is 64-bit on every platform except i686 is
not correct, and also makes the definition of explode_byte() less nice
to look at.
2021-08-26 22:00:17 +02:00
Ralf Donau
a6fc80f069 Games: Remove unveiling /tmp/portal/config
Config::pledge_domains is applied before, hence /tmp/portal/config
can and should be veiled.
2021-08-26 21:40:39 +02:00
Ralf Donau
5a0be07cf0 FlappyBug: Use LibConfig instead of Core::ConfigFile 2021-08-26 19:54:50 +02:00
Stephan Unverwerth
b54573739c LibGL: Implement glTexEnvf
This controls how fetched texels are combined with the color that was
produced by a preceding texture unit or with the vertex color if it is
the first texture unit.

Currently only a small subset of possible combine modes is implemented
as required by glquake.
2021-08-26 19:54:31 +02:00
Stephan Unverwerth
19a08ff187 LibGL: Implement glPixelStorei
This sets the length of a row for the image to be transferred. This
value is measured in pixels. When a rectangle with a width less than
this value is transferred the remaining pixels of this row are skipped.
2021-08-26 19:53:57 +02:00
Scott R. Parish
eb368a5000 Calculator: The equal key will now also finish the operation
Prior to this if you typed "1+2=" you would not get the answer, instead
you'd be left with "2" on the screen; Calculator wanted you to hit the
enter key to get the answer. Now you can either use the enter or the
equal key to finish the operation and get the answer.
2021-08-26 17:35:15 +02:00
Thitat Auareesuksakul
f119c5580a Solitaire: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Thitat Auareesuksakul
573d14b7b5 Chess: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Thitat Auareesuksakul
666397e1a7 2048: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Andreas Kling
1fa5fba432 LibWeb: Make the base StyleValue::to_length() return an undefined length
Previously it was returning an "auto" length. This caused all the new
"initial" values to effectively turn into auto values long before layout
had a chance to resolve them.

This broke replaced elements with intrinsic size but no specified width
or height, and is the reason that Mr. ACID2 temporarily lost his eyes.
2021-08-26 13:25:52 +02:00
Andreas Kling
243e9a8b4a LibWeb: Correct CSS initial values for min-width and min-height
The initial value for these is auto, not 0.
2021-08-26 13:25:52 +02:00
Andreas Kling
cf8f1c5a5f LibWeb: Remove unused CSS::StyleProperties::string_or_fallback() 2021-08-26 13:25:52 +02:00
Andy Jansson
bb399c6955 FileManager: Change read_i32 call to read_bool
The FileManager/Window/Maximized flag was incorrectly read from the
ConfigServer using read_i32 instead of the intended read_bool function
call.

It is now being read with the correct type :^)
2021-08-26 12:05:51 +02:00
Andreas Kling
827bf5232e Minesweeper: Use LibConfig instead of Core::ConfigFile 2021-08-26 00:54:28 +02:00