Commit graph

15173 commits

Author SHA1 Message Date
Luke
3bdaba0b28 Meta: Add macOS workflow to CI
A good number of contributors use macOS. However, we have a bit of
a tendency of breaking the macOS build without realising it.

Luckily, GitHub Actions does actually supply macOS environments,
so let's use it.
2020-12-28 19:35:32 +01:00
Idan Horowitz
b4bb2b141c FileManager: Implement the cut file operation
This exploits the comment lines in the text/uri-list specification:
https://tools.ietf.org/rfc/rfc2483.txt (page 11), which might be a bit
hackish, but the specification suggests doing the same for other uses,
so it should be fine.
2020-12-28 19:13:45 +01:00
Idan Horowitz
7450f20b81 FileManager: Add a delete_path helper for singular paths
This is just the syscalls and error handling that was done for each
file in delete_paths.

This will be used to prevent the unneeded construction of vectors
when performing cut operations
2020-12-28 19:13:45 +01:00
Egor Ananyin
f30d4f22ef LibJS: Add tests for new Math functions 2020-12-28 19:03:11 +01:00
Egor Ananyin
7c9c3a10d3 LibJS: Add almost all Math functions 2020-12-28 19:03:11 +01:00
Andreas Kling
a35693915e LibGUI: Make syntax highlighter communicate boldness instead of font
Now that fonts know their own weight, we no longer need highlighters to
tell us which font to use. Instead, they can just say "this should be
bold" and we'll find the right font ourselves.
2020-12-28 15:53:10 +01:00
Andreas Kling
105eb8e1bc LibGfx: Add FontDatabase::get(family, size, weight)
This function allows you to look up a font by its exact parameters.
2020-12-28 15:53:10 +01:00
Andreas Kling
cd9ad6a05e LibGUI: Tweak AbstractButton and subclass constructors
Taking a "const StringView&" for the initial text does not achieve
anything useful. Just take a "String" and move it into storage.
2020-12-28 15:53:10 +01:00
Peter Nelson
476911e1f9 LibGfx: fix OOB access in LZW decoder on bad input
This fixes an issue where a corrupted LZW code can result in the first
element of an empty buffer being accessed.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27863
2020-12-28 15:12:29 +01:00
Luke
be30dc2b18 LibJS: Implement Object.prototype.isPrototypeOf
Spec: https://tc39.es/ecma262/#sec-object.prototype.isprototypeof
2020-12-28 13:10:07 +01:00
AnotherTest
ee1d9217aa LibRegex: Fail early if eof seen after '(?'
Fixes #4583.
2020-12-28 13:09:22 +01:00
Andreas Kling
92c073a9d1 LIbGUI+LibGfx: Paint focused push buttons with a heavier look
Draw a heavy shadow frame around focused push buttons for emphasis.
For now I've used the ThreedShadow2 color role as it feels dark enough.
2020-12-28 12:41:26 +01:00
Andreas Kling
2bbf3b5d0b LibGUI: Always focus the file name textbox in GUI::FilePicker
Previously we would only auto-focus it when choosing a save location.
It seems nice to have the same behavior when opening a file.
2020-12-28 11:44:29 +01:00
Andreas Kling
a94d1626b5 WindowServer: Remove unnecessary clang-format disabler comment 2020-12-28 11:41:09 +01:00
Andreas Kling
bc67b04399 WindowServer: Don't lookup configuration values in compose()
The compose() function is supposed to be fast since it can execute
60 times per second. Let's not do obviously avoidable things like
configuration value lookups in there. :^)
2020-12-28 11:41:09 +01:00
Andreas Kling
ffa241250b LibGUI: Make GUI::FileIconProvider::icon_for_executable() a public API
This way we can use it instead of icon_for_path() in a bunch of places
and avoid loading the full FileIconProvider configuration.
2020-12-28 11:41:09 +01:00
Idan Horowitz
a49fd0ff5e Terminal: Created a simple Find window for searching within the terminal
This is simply a gui wrapper around the pre-existing TerminalWidget
methods for finding and scrolling.
2020-12-28 11:40:35 +01:00
Idan Horowitz
0ddde46c19 LibVT: Implement find and scroll helper methods in TerminalWidget
This is mostly based on TextDocument's similar methods, these will
help implement searching within the terminal application.

The support for unicode code points is shaky at best, and should
probably be improved further.
2020-12-28 11:40:35 +01:00
Idan Horowitz
6446135681 LibVT: Create VT::Range and use it to replace selection start / end
Based on GUI::TextRange, This is both a bit more expressive and will
eventually be used for searching within the terminal
2020-12-28 11:40:35 +01:00
Idan Horowitz
6efdabfc6f Base: Rename maximize/minimize icons to a more generic name
This reduces naming confusion when the icons are used for other
use cases that require a triangle shape
2020-12-28 11:40:35 +01:00
Andreas Kling
26cb083c6e FileManager: Created desktop shortcuts should use full basename
A shortcut to ReadMe.md should be called "ReadMe.md", not "ReadMe".
2020-12-28 09:38:11 +01:00
Andreas Kling
327f595f63 Browser: Show destination URLs as tooltips in the bookmarks bar 2020-12-28 01:43:58 +01:00
Andreas Kling
27262b639d Browser: Use Core::Object::remove_all_children() in bookmarks bar 2020-12-28 01:42:41 +01:00
Andreas Kling
71e9d06bb2 WindowServer: Spruce up the move/resize geometry label a little bit
Draw it in a threed style with a little shadow under it.
2020-12-28 01:40:09 +01:00
Linus Groh
58890e03b6 Everywhere: Move AppFile from LibGUI to LibDesktop
This was mentioned in #4574, and the more I think about it the more it
feels just right - let's move it there! :^)
Having to link LaunchServer against LibGUI explicitly should've been
telling enough...
2020-12-28 01:28:07 +01:00
Andreas Kling
97c42694db LibGUI: Make selected item tint color based on focused state
Use the inactive selection color for item icon tinting when the item
view is not focused.
2020-12-28 01:14:01 +01:00
Andreas Kling
0f1235be25 LibGUI: Show a hand cursor when hovering over a GUI::LinkLabel 2020-12-28 01:02:57 +01:00
Andreas Kling
644d5c5404 LibGUI: Switch focus if the currently focused widget is disabled 2020-12-28 01:02:57 +01:00
Brendan Coles
df6106854e Services: Fix typos 2020-12-28 00:55:45 +01:00
Andreas Kling
45d1c08386 Revert "Meta: Remove catchall lines in .gitignore (#4565)"
This reverts commit bee1774b92.

It made our .gitignore ignore *everything*.
2020-12-28 00:16:46 +01:00
Andreas Kling
4e99e013f0 Meta: Import the serenityos.org website
It doesn't seem right to not have the website in version control.
Also this way people can make changes to it. :^)
2020-12-28 00:12:12 +01:00
Andreas Kling
20e2700952 Kernel: Allow Userspace<T> pointers with invalid content
It's not an error to create a Userspace<T> that points to kernel memory
as the point of Userspace<T> is not to validate the address, but rather
to choose safe overloads that do validation before any data transfer
takes place.

Fixes #4581.
2020-12-27 23:43:15 +01:00
Brendan Coles
bceee87f61 LibELF: Reject ELF with program header p_filesz larger than p_memsz 2020-12-27 23:27:07 +01:00
Xavier Cooney
ca0f3db004 LibJS: Implement Array.prototype.sort() 2020-12-27 23:24:33 +01:00
Andreas Kling
a103eae0d4 LibJS: Run "prettier" on the tests :^) 2020-12-27 23:13:52 +01:00
Liav A
72b1998f0d Kernel: Introduce a new partitioning subsystem
The partitioning code was very outdated, and required a full refactor.
The new subsystem removes duplicated code and uses more AK containers.

The most important change is that all implementations of the
PartitionTable class conform to one interface, which made it possible
to remove unnecessary code in the EBRPartitionTable class.

Finding partitions is now done in the StorageManagement singleton,
instead of doing so in init.cpp.

Also, now we don't try to find partitions on demand - the kernel will
try to detect if a StorageDevice is partitioned, and if so, will check
what is the partition table, which could be MBR, GUID or EBR.
Then, it will create DiskPartitionMetadata object for each partition
that is available in the partition table. This object will be used
by the partition enumeration code to create a DiskPartition with the
correct minor number.
2020-12-27 23:07:44 +01:00
Liav A
bc18712adf Build: Fix build of grub image when choosing EBR scheme 2020-12-27 23:07:44 +01:00
Liav A
0f208669af Build: Fix build of grub image when choosing GPT scheme 2020-12-27 23:07:44 +01:00
Liav A
43d833d94f Kernel: Add DiskPartitionMetadata Class
This class will be used to describe a partition of a StorageDevice,
without creating a DiskPartition object.
2020-12-27 23:07:44 +01:00
Liav A
3a19e18d1e Kernel: Move Partition code files to the Storage folder
This folder is more appropriate for these files.
2020-12-27 23:07:44 +01:00
Liav A
247517cd4a Kernel: Introduce the DevFS
The DevFS along with DevPtsFS give a complete solution for populating
device nodes in /dev. The main purpose of DevFS is to eliminate the
need of device nodes generation when building the system.

Later on, DevFS will assist with exposing disk partition nodes.
2020-12-27 23:07:44 +01:00
Liav A
18e77aa285 Kernel: Add a method to determine the desired permissions of a Device
This method will be used later in DevFS, to set the appropriate
permissions for each device node.
2020-12-27 23:07:44 +01:00
Liav A
092a13211a Kernel: Convert read_block method to get a reference instead of pointer
BlockBasedFileSystem::read_block method should get a reference of
a UserOrKernelBuffer.

If we need to force caching a block, we will call other method to do so.
2020-12-27 23:07:44 +01:00
dantje
d1366b660e
LibGUI: Use Object::remove_all_children() in BreadcrumbBar (#4580) 2020-12-27 23:07:10 +01:00
Nathan Lanza
d1891f67ac
AK: Use direct-list-initialization for Vector::empend() (#4564)
clang trunk with -std=c++20 doesn't seem to properly look for an
aggregate initializer here when the type being constructed is a simple
aggregate (e.g. `struct Thing { int a; int b; };`). This template fails
to compile in a usage added 12/16/2020 in `AK/Trie.h`.

Both forms of initialization are supposed to call the
aggregate-initializers but direct-list-initialization delegating to
aggregate initializers is a new addition in c++20 that might not be
implemented yet.
2020-12-27 23:06:37 +01:00
Stephen Gregoratto
1867c928a9 LibC: Add fseeko/ftello
This changes the signatures for FILE::seek and FILE::tell, to use
`off_t` as they use lseek internally. `fpos_t` is also redefined to use
`off_t`.

Dr. POSIX says that fpos_t is:

> A non-array type containing all information needed to specify uniquely
> every position within a file.

In practice, most *NIX typedef it to `off_t`, or a struct containing an
`off_t` and some internal state.
2020-12-27 23:05:14 +01:00
Nathan Lanza
bee1774b92
Meta: Remove catchall lines in .gitignore (#4565)
These two lines caused this local .gitignore to supersede all inputs
in any files specified by a user's `core.excludesFile` configuration
since the first match was going to be `!*.*` for any file with a
decimal or any directory. `git check-ignore -v somefile` can be used to
test this.
2020-12-27 23:04:57 +01:00
Stephan Unverwerth
f603128e55 LibJS: Fix old object numeric key test now that toString() is correct 2020-12-27 23:04:09 +01:00
Stephan Unverwerth
d3524f47a0 LibJS: Implement (mostly) spec compliant version of Number.toString() 2020-12-27 23:04:09 +01:00
Stephan Unverwerth
be9c2feff0 LibJS: Fix parsing of numeric object keys
Numeric keys were interpreted as their source text, leading to
something like {0x10:true} to end up as {"0x10":true}
instead of {16:true}
2020-12-27 23:04:09 +01:00