Commit graph

26686 commits

Author SHA1 Message Date
Timothy Flynn
0b1f5118d5 LibJS: Implement Intl.Locale.prototype.maximize 2021-09-04 13:51:40 +01:00
Timothy Flynn
03d7f01e0c LibJS: Add a constructor to create an Intl.Locale object from a LocaleID 2021-09-04 13:51:40 +01:00
Timothy Flynn
3abfe7f7db LibJS: Add missing Intl.Locale initializer for plain boolean type 2021-09-04 13:51:40 +01:00
Timothy Flynn
e6a2ab1202 LibUnicode: Generate an implementation of the Add Likely Subtags method 2021-09-04 13:51:40 +01:00
Timothy Flynn
28ae63177e LibUnicode: Generate the entire locale likely-subtags dataset
The amount of aliases in the likely-subtags dataset is quite large, so
this also needed to change the way the data is generated. Otherwise, the
compiler would complain about the size of the generated code.

Previously, a static method was generated that would effectively parse
the dataset into a HashMap of Unicode::LanguageID at runtime. We now
perform that parsing at generation-time, and instead generate an Array
of a structure similar to Unicode::LanguageID (we cannot use the same
structure because it contains String and Optional, which cannot be used
at compile-time).
2021-09-04 13:51:40 +01:00
Timothy Flynn
ca90231794 LibUnicode: Define is_unicode_*_subtag helpers inline in their header
The UnicodeLocale generator will need to parse canonicalized locale
strings, and will require using these methods. However, the generator
cannot depend on LibUnicode because Locale.cpp within LibUnicode already
depends on the generated file. Instead, defining the methods that the
generator needs inline allows the generator to use them without linking
against LibUnicode.
2021-09-04 13:51:40 +01:00
Andreas Kling
74ce098d58 Kernel: Delete the rvalue-ref qualified version of KResultOr::value()
This makes calling value() on a temporary KResultOr be a compile-time
error. This exposed a number of missing error checks (fixed in the
preceding commits.)
2021-09-04 13:08:37 +02:00
Andreas Kling
d065de1fcf Kernel: Add missing error check when opening TTY for a new process 2021-09-04 13:08:37 +02:00
Andreas Kling
4b3bc3805b Kernel: Add missing error check when opening root file system 2021-09-04 13:08:37 +02:00
Andreas Kling
b02eb8224c Kernel/VirtIO: Add two missing error checks in VirtIO::ConsolePort 2021-09-04 13:08:37 +02:00
Karol Kosek
791309a3d2 Utilities: Support grepping recursively from paths in the argument
Previously, the recursive flag always searched for file contents from
the current directory, ignoring the path argument entirely.
2021-09-04 15:36:31 +04:30
Liav A
8cb4fcdbd8 Meta: Add q35grub option in run.sh
This option is similar to the qgrub option, but instead of starting a
QEMU PIIX4 machine, it starts a QEMU Q35 machine, booting a grub image
disk within it.
2021-09-04 12:54:00 +02:00
Mustafa Quraish
1da081bf86 Mandelbrot: Use the new Zoom cursor
It makes it really clear now that you can use the mouse to zoom
when you see the zoom cursor.
2021-09-04 03:35:23 +02:00
Mustafa Quraish
92df9d464a PixelPaint: Use Zoom and Eyedropper cursors
Use the newly added cursors for ZoomTool and PickerTool
2021-09-04 03:35:23 +02:00
Mustafa Quraish
30e91ecff6 Cursors: Add new Magnifying glass cursor
There are a few places in the system where this could be useful,
such as PixelPaint and the MandelBrot demo. It seems general enough
that it is probably useful to have it as a system-wide cursor rather
than loading it manually each time.
2021-09-04 03:35:23 +02:00
Mustafa Quraish
30ce1d8562 Cursors: Add new Eyedropper cursor
This can be used immediately in PixelPaint (separate commit), but
I am adding this as a system-wide cursor since it may also be useful
for other applications that want to use it.
2021-09-04 03:35:23 +02:00
Musab Kılıç
81326ac8c7 PixelPaint: Add invert filter 2021-09-04 03:35:17 +02:00
Mustafa Quraish
280cbf2e18 PixelPaint: Make tools use the new API for property change shortcuts
Every tool that has a slider now registers the primary/secondary
sliders and now uses the same keyboard shortcuts to modify the
primary and secondary properties. `[` and `]` for the primary,
`{` and `}` for the secondary.
2021-09-04 03:33:44 +02:00
Mustafa Quraish
d28fb8926f PixelPaint: Add mechanism for tools to use keyboard shortcuts
There are quite a few tools that might want to change certain values
based on consistent keyboard shortcuts. This commit allows tools to
hook up a "primary" and "secondary" slider with the base `Tool`
class, which can then handle updating those sliders with the common
shortcuts.

Note that any derived classes that want to override the `on_keydown`
function will manually need to call `Tool::on_keydown()`.
2021-09-04 03:33:44 +02:00
Thitat Auareesuksakul
8d36893ddf SoundPlayer: Add spacebar keyboard shortcut for play/pause 2021-09-04 03:33:35 +02:00
Mustafa Quraish
8f2521ce52 HexEditor: Use FileSystemAccessClient, add unveils
Most of the code here is based off the implementation of how
TextEditor uses FileSystemAccessClient.
2021-09-04 03:32:58 +02:00
Mustafa Quraish
eae21c7e31 PDFViewer: Use FileSystemAccessClient to open files 2021-09-04 03:32:30 +02:00
Mustafa Quraish
d645f637f1 PixelPaint: Add separator in image menu
I think it looks a bit nicer having a separator between the
"flip" and "rotate" sections.
2021-09-04 03:30:03 +02:00
Mustafa Quraish
7263e57ce8 PixelPaint: Allow modifiable thickness for RectangleTool :^) 2021-09-04 03:30:03 +02:00
Mustafa Quraish
9ed32582e2 LibGfx/Painter: Add draw_rect_with_thickness method
Previously there was no way to draw rectangles with any specific
thickness, like we can do with ellises, for instance. This method
is just a simple wrapper around `draw_line()` several times. At
least for now, we don't need to do anything sophisticated since
this will only be used by PixelPaint.`
2021-09-04 03:30:03 +02:00
Mustafa Quraish
6910cbc075 PixelPaint: Add Copy Merged action
This allows the user to copy the merged bitmap (all visible layers).
2021-09-04 03:30:03 +02:00
Tobias Christiansen
65d52467f4 PixelPaint: Parse saved Guides from the ProjectLoader in main
This patch allows PixelPaint to recreate saved Guides from .pp files.
2021-09-04 03:29:09 +02:00
Tobias Christiansen
508d563189 PixelPaint: Add ProjectLoader to abstract away opening of files
This new class will open and parse files (either images directly or .pp
project files) and one can get the parsed Image as well as other
information from it.

This patch removes a bunch of 'try_create_from..." methods from Image in
favor of using the ProjectLoader.

The only json_metadata that is available are Guides for now.
2021-09-04 03:29:09 +02:00
Tobias Christiansen
b3f53a0b5a PixelPaint: Save Guides when writing project to file 2021-09-04 03:29:09 +02:00
Tobias Christiansen
e867e4b84b PixelPaint: Move saving a project from Image into ImageEditor
The ImageEditor knows more about the image than Image itself. So to save
a project with all the information known to the program about an image
it's logical that ImageEditor performs that task rather than the Image.

There isn't any additional data added yet, but now there's the
possibility to do so.
2021-09-04 03:29:09 +02:00
Tobias Christiansen
60e526fdd2 PixelPaint: Move serialization of Image into seperate function
This eliminates duplicated code.
2021-09-04 03:29:09 +02:00
Karol Kosek
d81ba98976 SoundPlayer: Don't try to dereference null-pointer buffers
d049626f40 tried to resample the buffer
before checking if it points to a valid location.
This caused a crash, generally at the end of the file.
2021-09-04 03:28:33 +02:00
Musab Kılıç
0139a56aa5 Piano: Format slider values when initially set 2021-09-04 03:24:03 +02:00
Musab Kılıç
7b45653331 ImageViewer: Kindly ask the user if they want to delete a file 2021-09-04 03:22:46 +02:00
Andreas Kling
7dda773426 AK: Add rvalue-ref qualifiers for Optional's value() and value_or()
This avoids a value copy when calling value() or value_or() on a
temporary Optional. This is very common when using the HashMap::get()
API like this:

    auto value = hash_map.get(key).value_or(fallback_value);
2021-09-04 03:02:08 +02:00
Andreas Kling
0b36499f46 AK: Convert Optional.h to east-const style 2021-09-04 03:02:08 +02:00
Musab Kılıç
764d31b6c3 Piano: Draw note names on top of notes 2021-09-03 23:34:38 +02:00
Daniel Bertalan
d7b6cc6421 Everywhere: Prevent risky implicit casts of (Nonnull)RefPtr
Our existing implementation did not check the element type of the other
pointer in the constructors and move assignment operators. This meant
that some operations that would require explicit casting on raw pointers
were done implicitly, such as:
- downcasting a base class to a derived class (e.g. `Kernel::Inode` =>
  `Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp),
- casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>`
  in LibIMAP/Client.cpp)

This, of course, allows gross violations of the type system, and makes
the need to type-check less obvious before downcasting. Luckily, while
adding the `static_ptr_cast`s, only two truly incorrect usages were
found; in the other instances, our casts just needed to be made
explicit.
2021-09-03 23:20:23 +02:00
brapru
bad23e3f8c Kernel: Convert Routing to east-const style 2021-09-03 23:18:50 +02:00
Karol Kosek
ad5bd209ba DisplaySettings: Add context menu for wallpapers
This adds a 'Show in File Manager' action and copy path action to file
context menu for quicker navigation. :^)
2021-09-03 23:15:47 +02:00
Tom
77953a937d Meta: Add the ability to specify clang with serenity.sh
This enables maintaining gcc and clang builds side-by-side.
2021-09-03 23:12:17 +02:00
Luke Wilde
2f426765a6 LibWeb: Add support HTMLScriptElement.supports
See 33ff054a6c
2021-09-03 23:11:58 +02:00
Luke Wilde
ed97ee902b LibWeb: Add support for IDL static functions 2021-09-03 23:11:58 +02:00
Dawid Wolosowicz
678d958be2 Base: Remove the solid background from go-down.png icon 2021-09-03 23:09:25 +02:00
Brian Gianforcaro
d30be39215 Meta: Remove Coverity workflow until it's ready
This commit snuck into the tree via a PR for some sonar cloud fixes.
Some how I cross contaminated my branches.

Unfortunately the coverity workflow isn't ready for prime time yet,
so lets remove it until we have all the issues ironed out.
2021-09-03 19:01:10 +04:30
Andreas Kling
7df8483379 LibIPC: Convert Encoder class to east-const style 2021-09-03 15:36:51 +02:00
Andreas Kling
2ef1cd8d12 LibSQL: Replace Optional<NonnullRefPtr<T>> with RefPtr<T>
We generally don't use Optional with nullable types, since they already
have an empty state, and having multiple empty states is confusing.
2021-09-03 15:36:51 +02:00
Sam Atkins
e2c32a6c65 Everywhere: Use my shiny new serenityos.org email :^) 2021-09-03 12:22:36 +02:00
Luke Wilde
01af7d1ae1 Kernel: Don't use {:p} when printing out invalid userspace stack pointer
`userspace_esp` is a virtual address and thus using `{:p}` on it is
invalid and will cause an assertion failure.

I ran into this while testing #9772.
2021-09-03 11:46:40 +02:00
Brian Gianforcaro
2b13c9942d Meta: Fix toolchain caching for Sonar Cloud workflow
The matrix variables were left over from copy/pasting the contents
of the normal CI workflow. We also should always skip saving the
cache, as the normal CI pipeliens will refresh the toolchain and
we should just be reading the cache.
2021-09-03 11:46:15 +02:00