Commit graph

32980 commits

Author SHA1 Message Date
electrikmilk
bd9c4a6de5 Base: Add more emojis 2022-01-16 15:26:34 -08:00
flyingwombat921
ed271aa7c5 Documentation: Swap 'Right' and 'Wrong' code practice 2022-01-16 15:16:44 -08:00
Daniel Bertalan
6e00dd64a1 Tests: Test whether stdio streams are flushed correctly on exit 2022-01-16 14:59:21 -08:00
Daniel Bertalan
a1dfa1efb2 LibC: Flush all file streams on exit
The POSIX standard specifies the following:

> If the main() function returns to its original caller, or if the
> exit() function is called, all open files are closed (hence all output
> streams are flushed) before program termination.

This means that flushing `stdin` and `stdout` only is not enough, as the
program might have pending writes in other file buffers too.

Now that we support `fflush(nullptr)`, we call that in `exit()` to flush
all streams. This fixes one of bash's generated headers not being
written to disk.
2022-01-16 14:59:21 -08:00
Daniel Bertalan
6a6dbf5b0b LibC: Implement fflush(nullptr)
This caused all open file streams to be flushed.

This commit also changes `FILE::create` to handle buffer allocation
failure gracefully.
2022-01-16 14:59:21 -08:00
Andreas Kling
b4e864d02d Kernel: Make Process::m_list_node non-mutable
The mutable keyword was not achieving anything, so let's remove it.
2022-01-16 23:31:01 +01:00
Andreas Kling
df34f7b90b Kernel: Use an IntrusiveRedBlackTree for kernel regions
We were already using a non-intrusive RedBlackTree, and since the kernel
regions tree is non-owning, this is a trivial conversion that makes a
bunch of the tree operations infallible (by being allocation-free.) :^)
2022-01-16 23:31:01 +01:00
thankyouverycool
66e72ed5e6 LibGUI: Allow selecting glyphs by dragging in GlyphMapWidget 2022-01-16 21:36:39 +01:00
thankyouverycool
c094bb60bc FontEditor: Set GlyphEditor glyph on initialization
Fixes GlyphEditor appearing blank on start and subsequent
re-initializations.
2022-01-16 21:36:39 +01:00
thankyouverycool
8f60ea4470 FontEditor: Disambiguate save function from save-as action 2022-01-16 21:36:39 +01:00
thankyouverycool
c2b7bbbb2c FontEditor: Update GlyphEditor and width widgets on paste and delete
Fixes unsynced state between widgets after paste and delete actions.
2022-01-16 21:36:39 +01:00
thankyouverycool
7d7f683715 FontEditor: Correct GroupBox height
Font Metadata's GroupBox height was off by an _unsightly_ 2 pixels.
Now we make heights explicit for all child widgets and let shrink_to_fit
automatically calculate things.
2022-01-16 21:36:39 +01:00
thankyouverycool
24bd2a427c FontEditor: Calculate GlyphEditor toolbar widths more precisely
Fixes pixel imperfect toolbar widths when editing small fonts.
2022-01-16 21:36:39 +01:00
thankyouverycool
2e849250eb FontEditor: Remove unnecessary call during GlyphEditor init
GlyphEditor's relative rect is automatically set during layout.
2022-01-16 21:36:39 +01:00
thankyouverycool
ff42ad88ee FontEditor: Remove .gitignore artifact from old build system 2022-01-16 21:36:39 +01:00
creator1creeper1
326c6130a5 Kernel: Don't access directory table of uninitialized PageDirectory
PageDirectory gets initialized step-by-step in
PageDirectory::try_create_for_userspace(). This initialization may fail
anywhere in this function - for example, we may not be able to
allocate a directory table, in which case
PageDirectory::try_create_for_userspace() will return a null pointer.
We recognize this condition and early-return ENOMEM. However, at this
point, we need to correctly destruct the only partially initialized
PageDirectory. Previously, PageDirectory::~PageDirectory() would assume
that the object it was destructing was always fully initialized. It now
uses the new helper PageDirectory::is_cr3_initialized() to correctly
recognize when the directory table was not yet initialized. This helper
checks if the pointer to the directory table is null. Only if it is not
null does the destructor try to fetch the directory table using
PageDirectory::cr3().
2022-01-16 12:08:57 -08:00
electrikmilk
3a6d4d14e1 Base: Add some symbols to Katica
Adds 20A0—20CF, 20D0—20FF, and 2150—218F to Katica.
2022-01-16 12:04:41 -08:00
Idan Horowitz
2297d0b4bf LibJS: Rewrite the Encode AO to handle unpaired UTF-16 surrogates 2022-01-16 19:31:59 +01:00
Idan Horowitz
be9cbd428e LibJS: Check validity of encoded unicode code points in the Decode AO
As required by the specification:
7. If Octets does not contain a valid UTF-8 encoding of a Unicode code
point, throw a URIError exception.
2022-01-16 19:31:59 +01:00
Ali Mohammad Pur
afabfc1964 Ports: Correct the config.sub path for freetype
This regressed in cdd6d68, setting the correct path makes it build
again.
2022-01-16 19:57:37 +03:30
Marcus Nilsson
8b39ec7c18 SystemMonitor: Don't display empty CPU graphs when number of CPUs < 4
When we have less than 4 CPUs we don't need to display a whole row of
CPU graphs.
2022-01-16 15:04:40 +01:00
davidot
a5b11f7484 LibJS: Fix that '_' no longer accessed the last value in the REPL
This is now also not a concept that VM knows about and handled
completely by the REPL.
2022-01-16 14:57:12 +01:00
Linus Groh
30af8121ce LibJS: Fix value of Generator.prototype.constructor
The spec says:

    27.5.1.1 Generator.prototype.constructor
    https://tc39.es/ecma262/#sec-generator.prototype.constructor

    The initial value of Generator.prototype.constructor is
    %GeneratorFunction.prototype%.

But we had it set to %GeneratorFunction% (the GeneratorFunction
constructor).
2022-01-16 14:50:22 +01:00
Linus Groh
4ed49e05a9 LibJS: Rename GeneratorObjectPrototype to GeneratorPrototype
Given we usually call objects Foo{Object,Constructor,Prototype} or
Foo{,Constructor,Prototype}, this name was an odd choice.
The new one matches the spec better, which calls it the "Generator
Prototype Object", so we simply omit the Object suffix as usual as it's
implied.
2022-01-16 14:50:22 +01:00
Kenneth Myhra
b76c66a9ed groupadd: Port to LibMain and use the new Core::Group abstraction :^) 2022-01-16 11:19:07 +01:00
Kenneth Myhra
a99b50ce8c LibCore: Add Core::Group abstraction for group management :^)
This adds the Core::Group C++ abstraction to ease interaction with the
group entry database, as well as represent the Group entry.

Core::Group abstraction currently contains the following functionality:
- Add a group entry - 'Core::Group::add_group()'
2022-01-16 11:19:07 +01:00
Michel Hermier
adfdb63e02 LibC: Fix scandir not checking for allocation failure 2022-01-16 11:18:04 +01:00
Michel Hermier
1af072e0f3 LibC: Make *alloc return NULL in case of failure (POSIX) 2022-01-16 11:18:04 +01:00
Michel Hermier
3bf89f1859 LibC: Document some posix *alloc urls 2022-01-16 11:18:04 +01:00
Michel Hermier
cb3cc6ec27 AK: Remove kfree definition 2022-01-16 11:18:04 +01:00
Michel Hermier
9039f8fb0f AK: Remove kcalloc definition 2022-01-16 11:18:04 +01:00
Jan de Visser
6e9f06fc9f LibSQL: Introduce SELECT ... LIMIT xxx OFFSET yyy
What it says on the tin.
2022-01-16 11:17:15 +01:00
Jan de Visser
7fc901d1b3 LibSQL+SQLServer: Implement first cut of SELECT ... ORDER BY foo
Ordering is done by replacing the straight Vector holding the query
result in the SQLResult object with a dedicated Vector subclass that
inserts result rows according to their sort key using a binary search.
This is done in the ResultSet class.

There are limitations:
- "SELECT ... ORDER BY 1" (or 2 or 3 etc) is supposed to sort by the
n-th result column. This doesn't work yet
- "SELECT ... column-expression alias ... ORDER BY alias" is supposed to
sort by the column with the given alias. This doesn't work yet

What does work however is something like
```SELECT foo FROM bar SORT BY quux```
i.e. sorted by a column not in the result set. Once functions are
supported it should be possible to sort by random functions.
2022-01-16 11:17:15 +01:00
Sam Atkins
53cd87cc1d CharacterMap+Base: Give Character Map an icon 2022-01-16 11:17:03 +01:00
Sam Atkins
83a9661c04 CharacterMap+Base: Add man page for Character Map :^) 2022-01-16 11:17:03 +01:00
Sam Atkins
2a7c638cd9 CharacterMap: Add a find-by-name window
This works the same way as the command-line usage, searching against the
display name as provided by LibUnicode.

I've modified the search loop to cover every possible unicode
code-point, since my previous logic was flawed. Code-points are not
dense, there are gaps, so simply iterating up to the count of them will
skip ones with higher values. Surprisingly, iterating all 1,114,112 of
them still runs in a third of a second. Computers are fast!
2022-01-16 11:17:03 +01:00
Sam Atkins
2bf7abcb28 CharacterMap: Add previous, next, and go-to glyph buttons
These work the same as in FontEditor, where I shamelessly stole them
from. :^)
2022-01-16 11:17:03 +01:00
Sam Atkins
e975db23c0 LibGUI+FontEditor: Move seek-prev/next-glyph logic into GlyphMapWidget 2022-01-16 11:17:03 +01:00
Sam Atkins
9ca8428238 CharacterMap: Add output box for copying arbitrary character sequences
This adds a TextBox along the bottom of the window. Double-clicking on a
character will append it to this box, which you can edit as any other
TextBox, or click the copy button to copy the output to the clipboard.
2022-01-16 11:17:03 +01:00
Sam Atkins
ff500ffcc4 LibGUI: Add on_glyph_double_clicked() callback to GlyphMapWidget
This will be used by CharacterMap.

In implementing this, extracted the logic for finding which glyph is at
a given position within the widget.
2022-01-16 11:17:03 +01:00
Sam Atkins
2327ea8970 CharacterMap: Add new Character Map application :^) 2022-01-16 11:17:03 +01:00
Sam Atkins
1d79e8cb0f LibGUI: Preserve glyph selection when changing font 2022-01-16 11:17:03 +01:00
Sam Atkins
70a79ea70c LibGUI: Remove unused method definitions from GlyphMapWidget
These got added recently but were never implemented, so let's remove
them. :^)
2022-01-16 11:17:03 +01:00
Sam Atkins
15a7dfbc30 LibGUI: Recalculate GlyphMapWidget content size when changing font
Previously, if it was displaying N glyphs per line, then you changed
font to one that was a drastically different size, it would continue to
display N glyphs per line until you resized the window. Now, we
immediately recalculate how many to show, so that they fill the
available width. :^)
2022-01-16 11:17:03 +01:00
Sam Atkins
21a24c36a8 LibGUI: Make GlyphMapWidget work with vector fonts
This basically just meant replacing the `m_font` field with the one
inherited from Widget.
2022-01-16 11:17:03 +01:00
Sam Atkins
8175cd0a28 LibGUI+FontEditor: Move GlyphMapWidget to LibGUI
This will allow us to use this in other apps, such as the upcoming
Character Map. :^)
2022-01-16 11:17:03 +01:00
Sam Atkins
dd17df76e9 LibGUI: Make button icons settable in GML
`Widget::load_from_gml()` doesn't yet return `ErrorOr`, so we log a
warning message if loading the icon fails.
2022-01-16 11:17:03 +01:00
kleines Filmröllchen
49011e2030 Documentation: Explain the array-like types and their differences
It's not at all obvious how we need three different array-like types.
This change to the Patterns documentation attempts to explain why they
exist, how they differ (mostly in allocation behavior) and what their
use cases are. This builds on #11844 which fixates and tests the
hereby-described allocation behavior of FixedArray.
2022-01-16 11:14:26 +01:00
Matt Jacobson
47e8d58553 AK: Fix logic in String::operator>(const String&)
Null strings should not compare greater than non-null strings.

Add tests for >, <, >=, and <= comparison involving null strings.
2022-01-16 11:08:23 +01:00
Timothy Flynn
c74f75b910 LibJS: Implement Date.prototype.setUTCDate 2022-01-16 11:07:02 +01:00