Commit graph

32287 commits

Author SHA1 Message Date
Andreas Kling
0c09617b48 LibGUI: Don't show "last saved" information for never-saved documents
When showing the "unsaved changes" dialog for an empty path, we should
say "last saved at ..." since that would be a lie.
2022-01-04 21:49:44 +01:00
Andreas Kling
219339d2a5 FontEditor: Use GUI::MessageBox::ask_about_unsaved_changes() 2022-01-04 21:49:44 +01:00
Andreas Kling
1a54ac262a PixelPaint: Make ImageEditor::m_undo_stack a regular value member 2022-01-04 21:49:44 +01:00
Andreas Kling
490d385d01 PixelPaint: Use GUI::MessageBox::ask_about_unsaved_changes()
To make the last-saved-at timestamp show up correctly, we also now mark
the editor's undo stack as unmodified on save.
2022-01-04 21:49:44 +01:00
Andreas Kling
82b071943d PixelPaint: Add "save" action
Let's have this as a complement to the "save as" action :^)
2022-01-04 21:49:44 +01:00
Andreas Kling
5c68e91dd7 TextEditor: Use early return style in "save" action callback 2022-01-04 21:49:44 +01:00
Andreas Kling
7178c39a78 TextEditor: Show time-since-last-save in "unsaved changes" dialogs :^) 2022-01-04 21:49:44 +01:00
Andreas Kling
e5e109a556 LibGUI: Add optional unmodified timestamp to "unsaved changes" dialogs
This allows us to show "last saved N seconds ago" when asking the user
what to do. :^)
2022-01-04 21:49:44 +01:00
Andreas Kling
c4cc796f86 LibGUI: Make GUI::UndoStack remember time it was last set to unmodified
This can be used to determine how much time has passed since a document
was saved. :^)
2022-01-04 21:49:44 +01:00
Andreas Kling
c08872f5da TextEditor: Use GUI::MessageBox::ask_about_unsaved_changes() 2022-01-04 21:49:44 +01:00
Andreas Kling
8e336d3404 LibGUI: Add GUI::MessageBox::ask_about_unsaved_changes()
This is a static helper function for asking the user what they want to
do about unsaved changes. It behaves as a standard Yes/No/Cancel box
with text and buttons tailored to the typical unsaved changes use case.
2022-01-04 21:49:44 +01:00
Jean-Paul Balabanian
3f597c70b4 Base: Add keymap for Norwegian Macintosh keyboards
There is a significant difference between the PC keyboard
mapping and the Macintosh mapping in Norwegian.
2022-01-04 21:40:15 +01:00
Tobias Christiansen
f92172c7c3 PixelPaint: Add a Bloom filter
A bloom filter creates fringes around bright areas in the image
mimicking the behavior of real-world cameras.
It gets its own category "Artistic" in the Filter Gallery since its not
one filter per se but a combination of multiple.

The filter works as follows:
- Get only the light areas (above a threshold) of the image
- Blur that image
- Compose onto the original image
2022-01-04 21:41:14 +02:00
Tobias Christiansen
e4b7d38e18 LibGfx: Add LumaFilter
This allows you to specify a luminosity range, all pixels that fall
outside this range are set to black, the others are untouched.
2022-01-04 21:41:14 +02:00
Tobias Christiansen
06ae5b3536 LibGfx: Add BitmapMixer
With this BitmapMixer one can draw one Bitmap onto another with
different modes.
For now the only supported mixing methods implemented are Add and
Lightest (which is very naive).
2022-01-04 21:41:14 +02:00
Tobias Christiansen
9d45e5ac8f PixelPaint: Add the FastBoxBlurFilter with configurable parameters :^)
The FastBoxBlurFilter has been living in LibGfx for a while and now
it's accessible in PixelPaint. The parameters for the filter are exposed
via the new Filter Gallery.
2022-01-04 21:41:14 +02:00
Tobias Christiansen
b0ab979169 LibGfx: Add BitmapFormat::BGRx8888 support to the FastBoxBlurFilter
1268b39ba introduced template specialization when reading/writing
to/from the bitmap that increased the speed of the filter.
To keep that while supporting more than one BitmapFormat, the
appropriate {get,set}_pixel<>() functions are detemined and stored in
Function<>s.
2022-01-04 21:41:14 +02:00
Rummskartoffel
902b8f1583 Calendar: Port to LibMain and TRY all the things 2022-01-04 20:46:17 +02:00
Aatos Majava
d17dca5c91 Kernel: Update key_code_count
This was not updated when the Menu button was added.
2022-01-04 17:57:54 +00:00
Jelle Raaijmakers
a362a95912 LibSoftGPU: Shift U/V coordinates just once in Sampler 2022-01-04 17:48:28 +00:00
Jelle Raaijmakers
bca1b9f475 LibSoftGPU: Use AK::mix instead of manual interpolation 2022-01-04 17:48:28 +00:00
Jelle Raaijmakers
8da0925d6d AK: Add mix 2022-01-04 17:48:28 +00:00
Tom
10efbfb09e Kernel: Scan ACPI memory ranges for the RSDP table
On some systems the ACPI RSDP table may be located in ACPI reserved
memory ranges rather than in the EBDA or BIOS areas.
2022-01-04 17:46:36 +00:00
Tom
190572b714 Kernel: Fix possible buffer overrun when scanning a MappedROM
If the length of the prefix was less than the chunk_size argument
we were potentionally reading past the mapped memory region.
2022-01-04 17:46:36 +00:00
Tom
e70aa690d2 Kernel: Fix determining EBDA size
The first byte of the EBDA structure contains the size of the EBDA
in 1 KiB units. We were incorrectly using the word at offset 0x413
of the BDA which specifies the number of KiB before the EBDA structure.
2022-01-04 17:46:36 +00:00
Daniel Bertalan
84c6d6649e Toolchain: Fix building the aarch64 toolchain
The `aarch64/t-aarch64` makefile fragment needs to be included for the
aarch64-specific parts of GCC to be built. Before 738e52da5, this was
done implicitly, but now it is not. This caused the following error when
building the toolchain: "aarch64-builtins.o: No such file or directory".
2022-01-04 17:40:09 +00:00
Daniel Bertalan
0eb3718556 Kernel: Include correct header for DistinctNumeric in DeviceFileTypes.h
Fixes an aarch64 build failure.
2022-01-04 17:40:09 +00:00
Idan Horowitz
4f551f54c4 Kernel: Align GDT to the size of a Descriptor
This is not actually required by the specification, but it means we
will take the aligned fast-path in QEMU.
2022-01-04 19:08:07 +02:00
Idan Horowitz
f0b82c4b17 Kernel: Replace incorrect loop condition in write_raw_gdt_entry
Contradictory to the comment above it, this while loop was actually
clearing the selectors above or equal to the edited one (instead of
the selectors that were skipped when the gdt was extended), this wasn't
really an issue so far, as all calls to this function did extend the
GDT, which meant this condition was always false, but future calls to
this function that will try to edit an existing entry would fail.
2022-01-04 19:08:07 +02:00
Idan Horowitz
e424e3b88c Kernel: Use enum instead of magic numbers for GDT descriptor types
Some of the enum members were also renamed to reflect the fact that the
segment sizes are not necessarily 32bit (64bit on x86_64).
2022-01-04 19:08:07 +02:00
Idan Horowitz
2066491f6e LibC: Use NULL instead of nullptr in serenity.h
nullptr is a c++ keyword that can not be used in LibC headers.
2022-01-04 19:08:07 +02:00
Idan Horowitz
91b80da4b4 Kernel: Make Thread::m_kernel_stack_region a NonnullOwnPtr
This OwnPtr is always non-null, so let's enforce it statically.
2022-01-04 19:08:07 +02:00
Tobias Christiansen
fd90e10600 PixelPaint: Fix crash on applying with no filter selected
The wrong conception that done() would stop the program flow right there
lead to the lambda not properly aborting when no filter was selected.

The ExecAborted would be processed and then the nullptr that was
m_selected_filter would be happily dereferenced.

This patch fixes that.
2022-01-04 18:36:27 +02:00
Tobias Christiansen
d42abb3c7b PixelPaint: Use the wrapped filters for the Filter Gallery
Now, the filters can supply the Filter Gallery with a GUI::Widget such
that the user can interact with the filter. The Filter Gallery in turn
only calls apply() on the filter once it should be run.

This decouples the PixelPaint filters a lot from the ones supported by
LibGfx and paves the way to filters with settings.

For now there still are just the plain LibGfx filters so this change
feels like introducing a lot of boilerplate, but in the future there
will be a lot more to see.
2022-01-04 14:40:00 +01:00
Tobias Christiansen
0deadcdb28 PixelPaint: Create wrappers for all supported filters 2022-01-04 14:40:00 +01:00
Tobias Christiansen
5cf0357be1 PixelPaint: Create Filter base class
All the filters will need a wrapper around them, and this is going to be
their base class
2022-01-04 14:40:00 +01:00
Tobias Christiansen
0334783cf0 PixelPaint: Add filter icon
I created this icon for a previous PR, but somehow didn't commit it.
2022-01-04 14:40:00 +01:00
Tobias Christiansen
ea19f6dd4a PixelPaint: Extend Filter Gallery dialog to accommodate settings
For now, the space is empty, but it's there.
2022-01-04 14:40:00 +01:00
Timothy Flynn
534b2be16f LibJS: Implement Number.prototype.toExponential 2022-01-04 13:07:42 +00:00
Timothy Flynn
dc984c53d8 LibJS: Implement Number.prototype.toPrecision
As noted in the prototype comments, this implementation becomes less
accurate as the precision approaches the limit of 100. For example:

    (3).toPrecision(100)

Should result in "3." followed by 99 "0"s. However, due to the loss of
accuracy in the floating point computations, we currently result in
"2.9999999...".
2022-01-04 13:07:42 +00:00
Owen Smith
f1eb975a7a Kernel: Replace divide_rounded_up uses with ceil_div in Ext2FileSystem
This function was duplicated with ceil_div in AK.
2022-01-04 14:18:15 +02:00
mjz19910
154d33f240 unzip: Port to LibMain 2022-01-04 10:59:42 +00:00
mjz19910
7c05db19a1 zip: Port to LibMain :^) 2022-01-04 10:59:42 +00:00
mjz19910
eacbbca4c4 LibCore: Impliment ErrorOr wrapper for chdir 2022-01-04 10:59:42 +00:00
Mathieu PATUREL
571d090609 profile: Specify the /proc/profile path in the help message 2022-01-04 07:56:54 +00:00
Mathieu PATUREL
cdbcb70913 profile: Don't print anything when disabling profiling
Just like when enabling profiling. Plus it's more unixy to not print
anything on success
2022-01-04 07:56:54 +00:00
Andrew Kaster
1a17425fb5 Meta: Remove clang warnings with no violations
At some point we probably needed these, but no code complains about them
with the current state of the codebase.
2022-01-04 07:51:31 +00:00
Andrew Kaster
5cbc734081 SystemMonitor: Remove unused functions and enable warning globally
These two helpers were the only unused functions clang could detect in
the entire codebase. Now that's commitment to no dead code :^)
2022-01-04 07:51:31 +00:00
Andrew Kaster
f8ea9cd64e Userland: Resolve unused-but-set-varaible warnings
These are almost always bugs, so enable globally.

Remove unused counter variables in SystemMonitor and disk_benchmark.
2022-01-04 07:51:31 +00:00
Andrew Kaster
d809637023 Userland: Resolve tautological-constant-out-of-range-compare warnings
Stop comparing platform-specific sized integer types to max() values of
other interger types. Enable the warning everywhere.
2022-01-04 07:51:31 +00:00