Commit graph

43221 commits

Author SHA1 Message Date
Julian Offenhäuser
4bd79338e8 LibPDF: Fix off-by-one error in Reader::remaining() 2022-11-19 15:42:08 +01:00
Julian Offenhäuser
4b1a72ff7a LibPDF: Fix loop condition in parse_xref_stream()
We previously compared two unrelated values to determine if we parsed
the xref table to completion. We now check if we added every subsection
instead, and double check to make sure we never read past the end.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
a17a23a3f0 LibPDF: Make some variable names in parse_xref_stream() more clear
I found these to be a bit misleading.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
f926dfe36b LibPDF: Implement the DCT filter
This filter basically tells us that we are dealing with a JPEG.
Note that by serializing the resulting image we assume that this filter
is the last one in the chain, everything else would be highly unlikely.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
baaf42360e LibPDF: Derive alternate ICC color space from the number of components
We currently don't support ICC color spaces and fall back to a "simple"
one instead.

If no alternative is specified however, we are allowed to pick the
closest match based on the number of color components.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
16ed407c01 LibPDF: Support cascading stream filters
You can specify multiple filters as an array, where each one is fed the
output of the one before it.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
becd648a78 LibPDF: Parse hexadecimal values in name objects correctly 2022-11-19 15:42:08 +01:00
Julian Offenhäuser
0308300b78 PDFViewer: Take the mousewheel delta into account for scrolling
We now respect the system-wide setting for scroll speed, where we would
previously use a fixed step.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
9b1331a984 PDFViewer: Simplify user-facing error messages
We now show a simple, if less helpful, message to the user and print
the verbose error message to serial instead.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
e782d03f96 PDFViewer: Invalidate document when a page fails to load
This fixes an issue where we would show an error message on every
subsequent paint event, making it impossible to close or use the
application further.

Some more architectural work is needed if we want to invalidate the
sidebar entries as well.
2022-11-19 15:42:08 +01:00
thankyouverycool
ef30073127 LibGUI: Let Delete remove selections greater than 1 in GlyphMapWidget
Updates keydown_event() to work with the new bubbling mechanism
for action shortcuts.
2022-11-19 15:41:09 +01:00
thankyouverycool
92a75ccaed FontEditor: Include file basename in error messages when available
And write messages in the [action] failed: [error] format to match
common error message formatting elsewhere in Userland.
2022-11-19 15:41:09 +01:00
thankyouverycool
9725fd162f LibGUI+Applications: Allow GlyphMapWidget's set_font() to fail
And TRY early during initialization in FontEditor to leave the app
in a valid state on error. Fixes OOM crashes when cloning the original
font for highlight modifications.
2022-11-19 15:41:09 +01:00
thankyouverycool
1be830e3c6 LibGfx: Add pure virtual fallible clone() for Fonts 2022-11-19 15:41:09 +01:00
thankyouverycool
d9fb838cf6 LibGUI+FontEditor: Allow system emoji to be toggled in GlyphMapWidget
And remove their red backgrounds when visible to not be confused with
deletion highlights.
2022-11-19 15:41:09 +01:00
thankyouverycool
c974e644ec FontEditor: Add Layout options to View menu
Like other apps, FontEditor now organizes widget visibility toggles
under a View->Layout submenu. The main toolbar and the status bar
can now be turned on and off.
2022-11-19 15:41:09 +01:00
thankyouverycool
61d93092cf FontEditor: Remove redundant set_scale() helper 2022-11-19 15:41:09 +01:00
thankyouverycool
8f7dbf363e FontEditor: Remove overzealous find-and-replace ""sv operator 2022-11-19 15:41:09 +01:00
thankyouverycool
894b41ef4d FontEditor: Consolidate GlyphEditor's flip_{horizontally,vertically} 2022-11-19 15:41:09 +01:00
thankyouverycool
d867871bda FontEditor: Standardize Gfx::RotationDirections for rotate_90() 2022-11-19 15:41:09 +01:00
Andreas Kling
fb00d3ed25 Kernel+lsirq: Track per-CPU IRQ handler call counts
Each GenericInterruptHandler now tracks the number of calls that each
CPU has serviced.

This takes care of a FIXME in the /sys/kernel/interrupts generator.

Also, the lsirq command line tool now displays per-CPU call counts.
2022-11-19 15:39:30 +01:00
Andreas Kling
94b514b981 Kernel: Add MAX_CPU_COUNT global constant
Instead of just hard-coding the x86 Processor array to size 64,
we now use a named constant that you can also reference elsewhere. :^)
2022-11-19 15:39:30 +01:00
Andreas Kling
9b3db63e14 Kernel: Rename GenericInterruptHandler "invoking count" to "call count" 2022-11-19 15:39:30 +01:00
MacDue
8a5d2be617 Everywhere: Remove unnecessary mutable attributes from lambdas
These lambdas were marked mutable as they captured a Ptr wrapper
class by value, which then only returned const-qualified references
to the value they point from the previous const pointer operators.

Nothing is actually mutating in the lambdas state here, and now
that the Ptr operators don't add extra const qualifiers these
can be removed.
2022-11-19 14:37:31 +00:00
MacDue
66a428ae03 LibJS+LibWeb: Return non-const types from Ptr class operators
Even if the pointer value is const, the value they point to is not
necessarily const, so these functions should not add the qualifier.

This also removes the redundant non-const implementations of these
operators.
2022-11-19 14:37:31 +00:00
MacDue
3483407ddc AK: Return non-const types from Ptr class operators
Even if the pointer value is const, the value they point to is not
necessarily const, so these functions should not add the qualifier.

This also removes the redundant non-const implementations of these
operators.
2022-11-19 14:37:31 +00:00
Jamie Mansfield
24caacfe28 LibJS: Add spec comments to TypedArray.prototype.entries 2022-11-19 14:23:28 +00:00
Jamie Mansfield
67ed3e1d93 LibJS: Add spec comments to TypedArray.prototype.keys 2022-11-19 14:23:28 +00:00
Jamie Mansfield
db00097700 LibJS: Match spec behaviour in TypedArray.prototype.join
This corrects 2 TRYs to MUSTs and a replaces a call to is_nullish to
is_undefined.
2022-11-19 14:23:28 +00:00
Jamie Mansfield
5341af6225 LibJS: Add spec comments to TypedArray.prototype.join 2022-11-19 14:23:28 +00:00
Jamie Mansfield
70a4e4bd67 LibJS: Add missing assert to TypedArray.prototype.indexOf 2022-11-19 14:23:28 +00:00
Jamie Mansfield
80d2d3812a LibJS: Add spec comments to TypedArray.prototype.indexOf 2022-11-19 14:23:28 +00:00
Jamie Mansfield
f1b4412005 LibJS: Add missing assert to TypedArray.prototype.includes 2022-11-19 14:23:28 +00:00
Jamie Mansfield
34f27f76ec LibJS: Add spec comments to TypedArray.prototype.includes 2022-11-19 14:23:28 +00:00
Jamie Mansfield
43456ad708 LibJS: Add spec comments to TypedArray.prototype.reduceRight 2022-11-19 14:23:28 +00:00
Jamie Mansfield
364d873e33 LibJS: Add spec comments to TypedArray.prototype.reduce 2022-11-19 14:23:28 +00:00
Jamie Mansfield
d7654aebd7 LibJS: Match spec behaviour in TypedArray.prototype.fill
This just replaces an instance where TRY was used when MUST should
have been, reflecting the difference between ? and ! in the spec.
2022-11-19 14:23:28 +00:00
Jamie Mansfield
d492887dcd LibJS: Add spec comments to TypedArray.prototype.fill 2022-11-19 14:23:28 +00:00
Andreas Kling
524baa29e8 LibC+Tests: Simplify getpwuid_r() and getpwnam_r() and add tests
These functions are now implemented in terms of getpwent_r() which
allows us to remove two FIXMEs about global variable shenanigans.

I'm also adding tests for both APIs. :^)
2022-11-19 11:11:13 +01:00
Andreas Kling
cc189ce0f3 LibC: Make getpwent_r() behave more like glibc
Two things:
- We now fail with ENOENT when we reach the end of the database.
- Errors are returned directly instead of via errno.
2022-11-19 11:11:13 +01:00
Julian Offenhäuser
7c4f5b58be LibPDF: Use Gfx::PathRasterizer for Adobe Type 1 font rendering
This gives much better visual results than painting the path directly.
It also has the nice side effect that Type 1 fonts will now look much
more similar to TrueType fonts, which use the same class :^)

In addition, we can now cache glyph bitmaps for repeated use.
2022-11-19 11:04:34 +01:00
Julian Offenhäuser
0b6299849e LibGfx: Move TTF::Rasterizer to its own files
The custom TTF path rasterizer is actually generic enough for it to be
used for other fonts. To make this more clear, it now lives on its own
in the "Font" directory.
2022-11-19 11:04:34 +01:00
thankyouverycool
d444724d24 ThemeEditor: Update GML and polish interface
Registers the PreviewWidget for addition directly into GML. Fixes
its previous double Frame borders. Also standardizes the Apply and
Reset buttons as DialogButtons and spaces them consistently with
other apps. Gives the TabWidget some tasteful container margins.
2022-11-19 11:04:11 +01:00
thankyouverycool
e99277611b Magnifier+ThemeEditor: Use CommonMenus::make_accessibility_menu() 2022-11-19 11:04:11 +01:00
thankyouverycool
f31a56d086 LibGUI: Add CommonMenus
Right now only the accessibility menu is shared across apps but
it's a good bit of boilerplate that can be consolidated and will
make adding ColorBlindnessFilters to other widgets trivial.
2022-11-19 11:04:11 +01:00
thankyouverycool
7252a1aa4d LibGUI: Add fallible try_create_checkable() Action 2022-11-19 11:04:11 +01:00
thankyouverycool
032ca748c6 LibGUI: Add ColorFilterer class
Widgets will inherit from ColorFilterer in order to create the
accessibility CommonMenu
2022-11-19 11:04:11 +01:00
thankyouverycool
c88d77361c LibGUI: Allow adding previously constructed menus to Menubar 2022-11-19 11:04:11 +01:00
thankyouverycool
9cf93528f5 LibGUI: Accept() mouse wheel events in {Spin,Combo}Boxes
Prevents ScrollableContainerWidgets from moving when changing
values in embedded widgets with the mouse wheel.
2022-11-19 11:04:11 +01:00
thankyouverycool
5c9a140084 LibGUI: Display shortcut text for Alt Graph modifier
Fixes Accessibility menus in ThemeEditor and Magnifier not showing
their complete shortcut combinations
2022-11-19 11:04:11 +01:00