Commit Graph

30747 Commits

Author SHA1 Message Date
Timothy Flynn
f2f4980f15 LibUnicode: Remove unused field from UnicodeData generator 2021-11-30 11:24:02 +01:00
Brian Gianforcaro
d7568b28b4 Kernel: Surface errors when generating a process core dump :^) 2021-11-30 11:16:35 +01:00
Brian Gianforcaro
fa517b213a Kernel: Handle string format errors in FileSystem APIs :^) 2021-11-30 11:16:35 +01:00
Brian Gianforcaro
e626d7098d Kernel: Handle string format errors in Device::pseudo_path(..) :^) 2021-11-30 11:16:35 +01:00
Brian Gianforcaro
1f65728d8b Kernel: Handle string format errors in PCIDeviceAttributeSysFSComponent 2021-11-30 11:16:35 +01:00
Brian Gianforcaro
74ee491b84 Kernel: Handle string format errors in SlabAllocator stats :^)
Switch to KString::formatted and fix API so we can propagate errors.
2021-11-30 11:16:35 +01:00
Brian Gianforcaro
a0e59099fc Kernel: Handle string format errors in KCOVInstance :^) 2021-11-30 11:16:35 +01:00
Brian Gianforcaro
a5cec06135 Kernel: Handle string format error in page_fault_handler(..) :^)
Utilize the new KString::formatted to provide a fallback
if formatting fails because of OOM or whatever reason.
2021-11-30 11:16:35 +01:00
Brian Gianforcaro
4cc41ea186 Kernel: Add an error propagating KString::format(..) API :^)
In the continuous effort of better handling OOM in the kernel,
we want to move away from all AK::String usage. One of the final
pieces left to accomplish this goal is replacing all of the usages
of `String::formatted` with something that can actually propagate
failure.

The StringBuilder API was enhanced in the recent past to propagate
failure and thus a slightly modified version of what exists in
`AK::format` will work well for implementing failable format with
`KString`.
2021-11-30 11:16:35 +01:00
Beyley Thomas
cd41af5ac2 Keymaps: Add Workman keymap 2021-11-30 10:55:27 +01:00
scwfri
dbd40e4c2a LibGUI: Implement vim motions for LeftBrace and RightBrace
In VimEditingEngine, implemented vim motions for Key_LeftBrace and
Key_RightBrace
2021-11-30 10:55:19 +01:00
Jelle Raaijmakers
e187207610 Kernel: Register Virtio console ports with device management
Previously, Virtio console ports would not show up in `/sys/dev/char/`.
Also adds support to `SystemServer` to create more than one console
port device in `/dev/` in the multiport case.
2021-11-30 10:53:41 +01:00
Jelle Raaijmakers
2565f458d1 ClipboardHistory: Add debug dump action
This allows for easy dumping of clipboard data to the debug console.
2021-11-30 10:52:18 +01:00
thankyouverycool
298a6b9937 LibGUI+FontEditor: Allow ComboBox on_change callback to be toggled
When calling set_selected_index() on ComboBox, allow its on_change
callback to be disabled. Fixes FontEditor window state erroneously
switching to modified when initializing between different slopes
and weights.
2021-11-30 10:51:51 +01:00
thankyouverycool
ca062d83db FontEditor: Convert to east const 2021-11-30 10:51:51 +01:00
thankyouverycool
de77e28360 FontEditor: Correct member type and initialization in UndoGlyph
Makes code_point type u32, consistent with the rest of the system,
and properly initializes it.
2021-11-30 10:51:51 +01:00
thankyouverycool
e3e3c03dca FontEditor: Remove unused Vector<String> 2021-11-30 10:51:51 +01:00
thankyouverycool
ca77aea099 FontEditor: Correct NewFontDialog layout issues
Fixes incorrect scale initialization and inconsistent margins, sets
minimum values for glyph width and height to 1, and labels page 1
more precisely as "Typeface" properties.
2021-11-30 10:51:51 +01:00
thankyouverycool
9b184fc1cb FontEditor: Clean up GlyphMapWidget header
Fixes minor organizational inconsistency and zeroes initializations
for rows and columns as the previous values haven't been meaningful
since the map was converted to a scrollable widget. No functional
changes.
2021-11-30 10:51:51 +01:00
thankyouverycool
7d73d2dfc8 FontEditor: Remove superfluous 'this' pointers 2021-11-30 10:51:51 +01:00
thankyouverycool
e29abc5395 LibGfx+FontEditor: Consolidate BitmapFont width and height limits
And make them more self-documenting. Previously these constraints
were duplicated across multiple files.
2021-11-30 10:51:51 +01:00
thankyouverycool
541f1de3a8 FontEditor: Add scaled offset members to GlyphEditor
Previously these were undescriptive globals making them a bit cryptic.
2021-11-30 10:51:51 +01:00
thankyouverycool
aa09e40eb2 FontEditor: Update status bar on initialization
Fixes incorrect glyph status immediately after loading a new font.
2021-11-30 10:51:51 +01:00
thankyouverycool
ae922c67fd FontEditor: Remove code duplication when resizing GlyphEditor
The left column now also enforces a minimum width to prevent especially
small fonts from hiding the glyph toolbars and width widgets.
2021-11-30 10:51:51 +01:00
thankyouverycool
c1744822a1 FontEditor: Account for glyph width when pasting
Fixes glyphs not expanding up to their maximum width if necessary
when pasting larger glyphs into smaller ones.
2021-11-30 10:51:51 +01:00
thankyouverycool
281805696b FontEditor: Don't allow cutting and copying absent glyphs
And update status bar on cut. Fixes placing these effectless actions
on the undo stack.
2021-11-30 10:51:51 +01:00
thankyouverycool
d2b211f14a FontEditor: Don't null check newly created NonnullRefPtr fonts 2021-11-30 10:51:51 +01:00
thankyouverycool
74938e6f42 FontEditor: Factor out redundant code for a request to close 2021-11-30 10:51:51 +01:00
thankyouverycool
1e052f5a91 FontEditor: Convert mode and transform buttons into toolbar actions
This will let us more easily organize and assign shortcuts to new
modes and transformations as they are built, and it generally looks
more polished as a uniform interface. Also adds a counterclockwise
option to the rotate action, moves Copy as Character to the edit
menu as it doesn't directly impact GlyphEditor, and makes the paint
and move modes exclusive checkables to make the editor's state more
visually obvious.
2021-11-30 10:51:51 +01:00
thankyouverycool
b7c8dee29a Base: Add icon for 90 degree counterclockwise rotation 2021-11-30 10:51:51 +01:00
thankyouverycool
922e80e72b FontEditor: Simplify start-up
Previusly a cloned or newly loaded font was moved twice from main to
the constructor and then from constructor to an init routine where it
was finally used. The unmasked font is now moved only once, directly
to initialization, and redundant error checking is discarded.
2021-11-30 10:51:51 +01:00
thankyouverycool
56a8a2b493 FontEditor: Use LibUnicode to convert character case
Fixes characters beyond the Basic Latin code block not showing
their upper-case form in the preview window.
2021-11-30 10:51:51 +01:00
thankyouverycool
edf86af4f4 LibGfx+FontEditor: Add helper to determine raw glyph presence
GlyphBitmaps are considered present if they have a width greater
than zero. This adds a counterpart method for raw (unmasked) glyphs
and makes intent more explicit throughout FontEditor.
2021-11-30 10:51:51 +01:00
Arne Elster
cdaa179eeb LibCore: Fix relative seeking in IODevice
The recently introduced read buffer in IODevice broke relative seeking.
The amount of data in the buffer wouldn't get taken into account.
2021-11-30 10:51:10 +01:00
Lady Gegga
b818d4c7e3 Base: Add some Vai characters to font Katica Regular 10
A500–A577 https://www.unicode.org/charts/PDF/UA500.pdf
2021-11-29 18:20:07 -08:00
Timothy Flynn
1039159a6c LibJS: Change LargerOfTwoTemporalUnits AO to return a StringView 2021-11-30 00:01:07 +00:00
Luke Wilde
2cea4ad508 LibJS: Implement Temporal.Duration.prototype.subtract 2021-11-29 22:56:35 +00:00
Luke Wilde
ac8c3919cb LibJS: Implement Temporal.Duration.prototype.add 2021-11-29 22:56:35 +00:00
Luke Wilde
acf8729a81 LibJS: Implement Temporal.Duration.prototype.round 2021-11-29 22:56:35 +00:00
Timothy Flynn
4a08fd2be2 LibJS: Implement Intl.DateTimeFormat.prototype.resolvedOptions 2021-11-29 22:48:46 +00:00
Timothy Flynn
d0e1997e07 LibJS: Implement Intl.DateTimeFormat.supportedLocalesOf 2021-11-29 22:48:46 +00:00
Timothy Flynn
6ad00088c0 js: Implement pretty-printing of Intl.DateTimeFormat 2021-11-29 22:48:46 +00:00
Timothy Flynn
16151aa7d5 LibJS+LibUnicode: Implement the Intl.DateTimeFormat constructor 2021-11-29 22:48:46 +00:00
Timothy Flynn
75b2a09a2f LibJS: Implement a nearly empty Intl.DateTimeFormat object
This adds plumbing for the Intl.DateTimeFormat object, constructor, and
prototype.

Note that unlike other Intl objects, the Intl.DateTimeFormat object has
a LibUnicode structure as a base. This is to prevent wild amounts of
code duplication between LibUnicode, Intl.DateTimeFormat, and other
not-yet-defined Intl structures, because there's 12 fields shared
between them.
2021-11-29 22:48:46 +00:00
Timothy Flynn
6dbdfb6ba1 LibUnicode: Add special handling of hour cycle (hc) Unicode keywords
For other keywords, allowed values per locale are generated at compile
time. But since the CLDR doesn't present hour cycles on a per-locale
basis, and hour cycles lookups depend on runtime data, we must handle
hour cycle keyword lookups differently than other keywords.
2021-11-29 22:48:46 +00:00
Timothy Flynn
71903ea7e1 LibUnicode: Parse and generate calendar (ca) Unicode keywords
Also removes a few fly-by "StringView x = nullptr;" unnecessary
initializers.
2021-11-29 22:48:46 +00:00
Timothy Flynn
48ce72e472 LibUnicode: Parse and generate regional hour cycles
Unlike most data in the CLDR, hour cycles are not stored on a per-locale
basis. Instead, they are keyed by a string that is usually a region, but
sometimes is a locale. Therefore, given a locale, to determine the hour
cycles for that locale, we:

    1. Check if the locale itself is assigned hour cycles.
    2. If the locale has a region, check if that region is assigned hour
       cycles.
    3. Otherwise, maximize that locale, and if the maximized locale has
       a region, check if that region is assigned hour cycles.
    4. If the above all fail, fallback to the "001" region.

Further, each locale's default hour cycle is the first assigned hour
cycle.
2021-11-29 22:48:46 +00:00
Timothy Flynn
15fc03ef34 LibUnicode: Sort generated enums case-insensitively
This hasn't mattered yet by chance, because the source for all enums
contains names of the same case. But the enum generated for hour cycle
regions will have mixed case. Sort them case-insensitively in order to
traverse these names in the same order in both generate_enum and
generate_mapping.
2021-11-29 22:48:46 +00:00
Timothy Flynn
7872934861 LibUnicode: Parse and generate available candidate format patterns
These formats are used by ECMA-402 when neither a date nor time style is
specified. In that case, these patterns are searched for a best match.
2021-11-29 22:48:46 +00:00
Timothy Flynn
287d43f4be LibUnicode: Hard-code an alias from the Gregorian calendar to Gregory
This alias exists because the name "Gregorian" is too long to be used in
a locale identifier, i.e. "en-u-ca-gregorian" is invalid. Aliases for
calendars are defined here:
https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-bcp47/bcp47/calendar.json

However, CLDR version 40 neglected to actually include the cldr-bcp47
package in its release, so we don't have access to this data. So for now
hard-code this alias so that JavaScript can actually access it. See:
https://unicode-org.atlassian.net/browse/CLDR-15158
2021-11-29 22:48:46 +00:00