Commit graph

43876 commits

Author SHA1 Message Date
Rodrigo Tobar 164422f8d8 LibPDF: Add further common names 2022-11-30 14:51:14 +01:00
Rodrigo Tobar 5277ad1d6d LibPDF: Implement Run Length Decoding
This is a simple decoding process that is needed by some streams.
2022-11-30 14:51:14 +01:00
Rodrigo Tobar e776048309 LibPDF: Ignore whitespace on hex strings
The spec says that whitespaces should be ignored, but we weren't. PDFs
with whitespaces in their hex strings were thus crushing the parser.
2022-11-30 14:51:14 +01:00
Andreas Kling 9d4e0ba442 LibWeb: Fix WebIDL overload resolution with platform object arguments
We now check if an argument value is a platform object that implements
the relevant IDL interface when resolving overloads.

This makes passing a Path2D object to CanvasRenderingContext2D.fill()
actually choose the Path2D overload. :^)
2022-11-30 14:43:22 +01:00
Andreas Kling 12ddeeb9ce LibWeb: Add PlatformObject::implements_interface(String)
This can be used to ask a PlatformObject if it implements a given IDL
interface. It's implemented by a chain of virtual overrides that get
inserted for each subclass by the WEB_PLATFORM_OBJECT macro.
2022-11-30 14:43:22 +01:00
Andreas Kling 00a98c24a2 LibWeb: Update incorrect WEB_PLATFORM_OBJECT base class for two classes 2022-11-30 14:43:22 +01:00
Andreas Kling b1f8c5879f LibIDL: Fix bug where entire EffectiveOverloadSet was erased
There was a funny bug here: by storing the "last matched item" as a
pointer, and then using Vector::remove_all_matching() to remove all
items that didn't have that exact address, we would end up removing
everything unless the last item matched was the very first item.

(This happened because every time an item was removed from the vector,
the remaining contents shift one step towards the start of the vector,
affecting item addresses.)

This patch fixes the issue by storing the last match as an index.
2022-11-30 14:43:22 +01:00
Andreas Kling c266284559 LibWeb: Support creating Path2D objects from SVG path strings
This reuses the SVG path parsing code.
2022-11-30 14:43:22 +01:00
Andreas Kling 65d762130a LibWeb: Factor out SVG path parsing from SVGPathElement
Converting a Vector<PathInstruction> is now done by a free function so
that we can share this code with HTML::Path2D. :^)
2022-11-30 14:43:22 +01:00
Andreas Oppebøen b716c14c32 MouseDemo: Eliminate visual artifacts when filling in the color
The drawing had several visual artifacts with the colors not perfectly
filling out their outlines. By re-using the path for both stroke and
fill, we ensure that the exact same floating point coordinates are
used. Drawing the fill first and the stroke after also helps eliminate
artifacts.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen 54edd162a9 MouseDemo: Draw blue color for longer to indicate double click
When double-clicking, the button remains blue a bit longer. This
provides a convenient way to test the double click speed.

Piggybacks the timer for the scroll indicators, which is a bit weird,
but not noticeable.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen 3cf81f1930 MouseDemo: Restart timer when scrolling to avoid blinking indicator
When scrolling, a timer is triggered to hide the indicator cross. When
we continuously scroll, the indicator cross would then blink once the
timer kicks in. Instead, let's cancel the current timer and schedule a
new one, making the indicator visually smooth.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen 2c142e4c57 MouseDemo: Show distinct colors for primary vs secondary button
This shows mouse down of primary button in blue color,
and secondary button in light blue color.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen 903bfc3d68 MouseDemo: Replace constructor with initialization at member definition
This adheres to CodingStyle.md#other-punctuation which states:
> Prefer initialization at member definition whenever possible

Since the zero-arg constructor was only initializing members, it was
simply removed.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen 29de0dbea5 LibGfx: Add missing color LightBlue
Will be used in a follow-up commit as alternative to Blue
2022-11-30 12:56:29 +00:00
Filiph Sandström 4a766245fa HackStudio: Replace blank file when opening a new one
Before this we just added a new tab and left the `(Untitled)` tab in the
background. Now we instead check that it hasn't been modified and that
it's empty; if both these conditions are true we replace the blank
editor with the newly opened one.
2022-11-30 12:36:54 +00:00
Sam Atkins fc86ea7e5b Base: Use spaces instead of underscores to separate emoji codepoints
This broke the build, oops!
2022-11-30 12:24:52 +00:00
Andreas Oppebøen 8cca9e94a2 PixelPaint: Record action for all select operations to allow undo
Since selections with the select tools support undo, it makes
sense for the edit operations 'select all', 'none', 'invert' and
'clear selection' to also support undo.
2022-11-30 12:18:06 +00:00
Andreas Oppebøen 427d488d7e PixelPaint: Record action when erasing a selection to allow undo 2022-11-30 12:18:06 +00:00
Xexxa 01653bd94b Base: Add emoji flags for provinces in Liberia
🏴󠁬󠁲󠁢󠁭󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0062_U+E006D_U+E007F LR-BM
Bomi
🏴󠁬󠁲󠁢󠁧󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0062_U+E0067_U+E007F LR-BG
Bong
🏴󠁬󠁲󠁧󠁰󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0067_U+E0070_U+E007F LR-GP
Gbarpolu
🏴󠁬󠁲󠁧󠁢󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0067_U+E0062_U+E007F LR-GB
Grand Bassa
🏴󠁬󠁲󠁣󠁭󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0063_U+E006D_U+E007F LR-CM
Grand Cape Mount
🏴󠁬󠁲󠁧󠁧󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0067_U+E0067_U+E007F LR-GG
Grand Gedeh
🏴󠁬󠁲󠁧󠁫󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0067_U+E006B_U+E007F LR-GK
Grand Kru
🏴󠁬󠁲󠁬󠁯󠁿 - U+1F3F4_U+E006C_U+E0072_U+E006C_U+E006F_U+E007F LR-LO
Lofa
🏴󠁬󠁲󠁭󠁧󠁿 - U+1F3F4_U+E006C_U+E0072_U+E006D_U+E0067_U+E007F LR-MG
Margibi
🏴󠁬󠁲󠁭󠁯󠁿 - U+1F3F4_U+E006C_U+E0072_U+E006D_U+E006F_U+E007F LR-MO
Montserrado
🏴󠁬󠁲󠁭󠁹󠁿 - U+1F3F4_U+E006C_U+E0072_U+E006D_U+E0079_U+E007F LR-MY
Maryland
🏴󠁬󠁲󠁮󠁩󠁿 - U+1F3F4_U+E006C_U+E0072_U+E006E_U+E0069_U+E007F LR-NI
Nimba
🏴󠁬󠁲󠁲󠁩󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0072_U+E0069_U+E007F LR-RI
Rivercess
🏴󠁬󠁲󠁲󠁧󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0072_U+E0067_U+E007F LR-RG
River Gee
🏴󠁬󠁲󠁳󠁩󠁿 - U+1F3F4_U+E006C_U+E0072_U+E0073_U+E0069_U+E007F LR-SI
Sinoe
2022-11-30 12:13:13 +00:00
Tim Schumacher d402f6cdb3 LibCore: Add support for ReadonlyBytes to MemoryStream 2022-11-30 12:09:53 +00:00
Filiph Sandström 38a882ddfa HackStudio: User-definable documentation search paths
This resolves a 3+ year old FIXME related to tooltip documentation
search paths. By default we now search man3 in addition to man2 that we
previously only searched.
2022-11-30 12:08:01 +00:00
Timothy Flynn aba7f11a50 LibSQL: Partially implement the DELETE command
This implements enough to delete rows filtered by a WHERE clause.
2022-11-30 11:43:13 +01:00
Timothy Flynn 6d3f68cc11 LibSQL: Store a NonnullRefPtr to the table definition in SQL::Row
Also return a direct reference to the table from its getter.
2022-11-30 11:43:13 +01:00
Timothy Flynn 5336f23c7e LibSQL: Remove unused SQL::Row constructors/methods 2022-11-30 11:43:13 +01:00
Timothy Flynn 4b70908dc4 LibSQL+SQLServer: Return a NonnullRefPtr from Database::get_table
Database::get_table currently either returns a RefPtr to an existing
table, a nullptr if the table doesn't exist, or an Error if some
internal error occured. Change this to return a NonnullRefPtr to an
exisiting table, or a SQL::Result with any error, including if the
table was not found. Callers can then handle that specific error code
if they want.

Returning a NonnullRefPtr will enable some further cleanup. This had
some fallout of needing to change some other methods' return types from
AK::ErrorOr to SQL::Result so that TRY may continue to be used.
2022-11-30 11:43:13 +01:00
Timothy Flynn 56843baff9 LibSQL+SQLServer: Return a NonnullRefPtr from Database::get_schema
Database::get_schema currently either returns a RefPtr to an existing
schema, a nullptr if the schema doesn't exist, or an Error if some
internal error occured. Change this to return a NonnullRefPtr to an
exisiting schema, or a SQL::Result with any error, including if the
schema was not found. Callers can then handle that specific error code
if they want.

Returning a NonnullRefPtr will enable some further cleanup. This had
some fallout of needing to change some other methods' return types from
AK::ErrorOr to SQL::Result so that TRY may continue to be used.
2022-11-30 11:43:13 +01:00
Timothy Flynn 7464dfa974 LibSQL: Add missing definition of Value's u32 comparator
This was declared but not defined (nor was it used, but an upcoming
commit will be using it).
2022-11-30 11:43:13 +01:00
Timothy Flynn 47dd1b9f8b LibSQL: Don't copy strings when searching for a column's index
Also don't cast the return value to an int.
2022-11-30 11:43:13 +01:00
Timothy Flynn c3a6fad080 LibSQL: Rename Row::next_pointer setter to Row::set_next_pointer 2022-11-30 11:43:13 +01:00
Timothy Flynn 0986b383cd SQLServer+SQLStudio+sql: Rename a couple of SQL IPC commands for clarity
Rename sql_statement to prepare_statement and statement_execute to
execute_statement. The former aligns more with other database libraries
(e.g. Java's JDBC prepareStatement). The latter reads less awkwardly.
2022-11-30 11:43:13 +01:00
Timothy Flynn 17988bab75 LibSQL: Immediately commit database modifications (for now)
This ensures tables survive the database connection quitting. LibSQL
does not have transactional sessions yet, and probably won't for a
while, so let's just commit each modification as it comes.
2022-11-30 11:43:13 +01:00
Timothy Flynn 8f3c22718e LibSQL: Support BOOLEAN column types in the CREATE TABLE command
The database already supports BOOLEAN, this just hooks up the executor
as well.
2022-11-30 11:43:13 +01:00
Andreas Kling 3821f35e4e Meta: Add Gregory Bertilson to the contributors list :^) 2022-11-30 10:12:11 +01:00
Zaggy1024 b1c7bbc4ba LibVideo/VP9: Make get_tile_offset static and remove magic numbers
This can use the new utility functions for converting units now.
2022-11-30 08:28:30 +01:00
Zaggy1024 f5ea6c89df LibVideo/VP9: Put reference frames into a struct 2022-11-30 08:28:30 +01:00
Zaggy1024 e6b696fe24 LibVideo/VP9: Remove now-unused clear_context function from Parser 2022-11-30 08:28:30 +01:00
Zaggy1024 71aac25635 LibVideo/VP9: Move partitioning contexts to TileContext
Like the non-zero tokens and segmentation IDs, these can be moved into
the tile decoding loop for above context and allocated by TileContext
for left context.
2022-11-30 08:28:30 +01:00
Zaggy1024 720fc5a853 LibVideo/VP9: Use unit conversion functions in BlockContext
This should make things in there seem a little less magical :^)
2022-11-30 08:28:30 +01:00
Zaggy1024 1fe22f2141 LibVideo/VP9: Move segmentation id prediction context to TileContext
These can also be stored in the same places as the non-zero tokens
contexts.
2022-11-30 08:28:30 +01:00
Zaggy1024 9df72080a1 LibVideo/VP9: Add FIXME about implementation of tiled decoding 2022-11-30 08:28:30 +01:00
Zaggy1024 2f043a0bd4 LibVideo/VP9: Move the above non-zero tokens context into decode_tiles
We can store this context in the stack of Parser::decode_tiles and use
spans to give access to the sections of the context for each tile and
subsequently each block.
2022-11-30 08:28:30 +01:00
Zaggy1024 4e7e9d8479 LibVideo/VP9: Move the left non-zero tokens context to TileContext
The array containing the vertical line of bools indicating whether non-
zero tokens were decoded in each sub-block is moved to TileContext, and
a span of the valid range for a block to read and write to is created
when we construct a BlockContext.
2022-11-30 08:28:30 +01:00
Zaggy1024 06082d310f LibVideo/VP9: Split/clean up the token tree-parsing context function
Since the context information for parsing residual tokens changes based
on whether we're parsing the first coefficient or subsequent ones, the
TreeParser::get_tokens_context function was split into two new ones to
allow them to read more cleanly. All variables now have meaningful
names to aid in readability as well.

The math used in the function for the first token was changed to
be more friendly to tile- or block-specific coordinates to facilitate
range-restricted Spans of the above and left context arrays.
2022-11-30 08:28:30 +01:00
Zaggy1024 3667f9bf2c LibVideo/VP9: Store m_mode_context in BlockContext
This is set by motion vector selection to later be used by inter block
info parsing.
2022-11-30 08:28:30 +01:00
Zaggy1024 b5cce5a448 LibVideo/VP9: Move the m_use_prev_frame_mvs field to FrameContext 2022-11-30 08:28:30 +01:00
Zaggy1024 6ffb0844a1 LibVideo/VP9: Remove the m_use_hp field from Parser
This one is entirely scoped to the motion vector parsing function and
its individual component read function.
2022-11-30 08:28:30 +01:00
Zaggy1024 316dad7bf7 LibVideo/VP9: Remove m_tokens and m_token_cache from Parser
Only the residual tokens array needs to be kept for the transforms to
use after all the tokens have been parsed. The token cache is able to
be kept in the stack only for the duration of the token parsing loop.
2022-11-30 08:28:30 +01:00
Zaggy1024 a4f14f220d LibVideo/VP9: Fully qualify all reference frame type enum values
Since the enum is used as an index to arrays, it unfortunately can't
be converted to an enum class, but at least we can make sure to use it
with the qualified enum name to make things a bit clearer.
2022-11-30 08:28:30 +01:00
Zaggy1024 db9f1a18f8 LibVideo/VP9: Convert TransformMode to an enum class
TXModeSelect was also renamed to plain Select, since the qualified name
will be TransformMode::Select.
2022-11-30 08:28:30 +01:00