Unlike ensure_web_prototype<T>(), the cached version doesn't require the
prototype type to be fully formed, so we can use it without including
the FooPrototype.h header. It's also a bit less verbose. :^)
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.
There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
This patch moves the following things to being GC-allocated:
- Bindings::CallbackType
- HTML::EventHandler
- DOM::IDLEventListener
- DOM::DOMEventListener
- DOM::NodeFilter
Note that we only use PlatformObject for things that might be exposed
to web content. Anything that is only used internally inherits directly
from JS::Cell instead, making them a bit more lightweight.
This will be inherited by "legacy platform objects", i.e objects that
need to hijack indexed and/or named property access as described in the
IDL spec: https://webidl.spec.whatwg.org/#dfn-legacy-platform-object
Instead of overriding JS::Object virtuals, subclasses only need to
implement a very simple interface for property queries.
Note that this code is taken verbatim from code generator output.
I didn't write any of this now, so it's effectively "moved" code.
The UCD only cares about a few locales for special casing rules (az, lt,
and tr). Unfortunately, LibUnicode cannot use LibLocale once the
libraries are separate because LibLocale will need to use LibUnicode for
many more things; thus there would be a circular dependency. Instead,
just generate the small enum needed for this one use case.
This is generated by GenerateLocaleData, which will soon be in the
Locale namespace. Move it out of CurrencyCode.h, as that will continue
to live in the Unicode namespace.
Currently, LibUnicodeData contains the generated UCD and CLDR data. Move
the UCD data to the main LibUnicode library, and rename LibUnicodeData
to LibLocaleData. This is another prepatory change to migrate to
LibLocale.
To prepare for placing all CLDR generated data in a new library,
LibLocale, this moves the code generators for the CLDR data to the
LibLocale subfolder.
The generated locale data contains an enum also named Variant, as
variants are part of locale strings. This hasn't been an issue, but as
includes are reordered, the order in which the enum and AK::Variant are
included may cause an ambiguity error.
This patch adds the ability to select multiple entries in a column using
a rubber band selection. Currently the implementation is lacking support
for expanding a selection using the ctrl modifier.
This patch extracts logic for getting colum at an event position and for
getting an index in a column at an event position from
index_at_event_position into separate functions.
Previously we would simply compute the basename of the hovered url's
path and display it as the resource that will be opened. This patch adds
a fallback for non file urls to simply show the full url, making http
urls show up properly.
The variable `print_verbose` (which prints verbose information about the
USB devices connected to the system) was uninitialized in `lsusb`. This
was causing the verbose information to be printed if `-v` was NOT seen
on the command line.
Vectorscopes are a standard tool in professional video/film color
grading. *Very* simply, the Vectorscope shows image colors with hue as
the angle and saturation as the radius; brightness for each point in the
scope is determined by the number of "color vectors" at that point. More
specifically, the Vectorscope shows a 2D UV histogram of the image,
where U and V are the chroma ("color") channels of the image.
Co-authored-by: MacDue <macdue@dueutil.tech>
The histogram is perfectly fine with being drawn at any size, but the
code currently fixes its height to 65. Once the histogram is in a
subclass and several GML things around it change, the fixed height
breaks, so we move the height specification to GML. Additionally, the
container is specified to shrink as much as possible, alleviating a
hard-coded UI size. The user can now change histogram height in GML,
which is a lot more obvious.
These are two new smart pointers that are really just raw pointers under
the hood. The initial benefit is all in the names, they allow us to
declare that we're pointing at something in the GC heap.
Later we may also find ways to add debugging logic or static analysis to
these types.
When compiling with SDL_opengl, all kinds of differences between LibGL
and OpenGL constants and types popped up as redefinition warnings and
errors.
This fixes all LibGL-related warnings when compiling PrBoom+ :^)
Since 5064b58 SpinBox buttons are disabled if value reaches the
min or max allowed. Consequently this swallows the final MouseUp
event, leaving the repeat timer running. Fixes SpinBoxes
{dec,inc}rementing their value in perpetuity after min/max value
is reached through button clicking.
This requires a special case with names as the default function is
supposed to have a unique name ("*default*" in our case) but when
checked should have name "default".
Before this we attempted to hack around this by only overriding
has_binding. However this did not cover all cases, for example when
assigning to variables before their declaration it didn't throw.
By using the new find_binding_and_index virtual method we can just
pretend the indirect bindings are real.
Since indirect binding do come from a normal environment we need to
ensure you cannot modify the binding and that properties like mutable
are false as expected by the spec for such an indirect binding.
This is an export which looks like `export {} from "module"`, and
although it doesn't have any real export entries it should still add
"module" to the required modules to load.
When the value for a SpinBox equals the max, disable the increment
button. Functionally, clicking the button doesn't do anything because
the set_value() clamps the value to min/max and updates the textbox.
However it is still nice to indicate to the user that they've reached
the max. Same goes for minimum value and the decrement button.
Previously the value of the SpinBox is re-evaluated after every change
to the TextBox control. This leads to very unintuitive behavior such as
the user deleting the contents of the box and it having no
visible effect. This happens because the TextBox no longer has a valid
number and so gets reset to the current m_value of the SpinBox.
By defering the update of to the SpinBox value until focus leaves the
control we provide a much more intuitive experience with the text box.
We do still validate when a user types something that it parses to an
int. If it does not we delete the most recent character. This in effect
prevents non-numeric numbers from being entered.
Upon losing focus the value will be checked. If empty we set the SpinBox
value to the minimum allowed value.
With a new DragCopy cursor icon being used on accepted events, this
caused a 'false assumption' that everything can be dropped into
AbstractView.
This will now only happen if the View is editable, which still isn't
perfect, but at least the Settings app will no longer change cursors.
Also note that we won't get "drag move" events as the comment below
says, which disables automatic scrolling when dragging an element.
... instead of in the center of the cursor bitmap.
It doesn't make much of a difference, as the default cursor hotspot is
center. But since now we switch between a normal Drag cursor and
DragCopy one that has set hotspot, this caused the overlay to shake.
Previously, the cursor would use a default cursor on window frames such
as the title bar and menu bar, which was not quite correct as drop
events were still handled there.
Layer::erase_selection used to erase the entire bounding box of the
selection. With the add/subtract merge modes for the selection tool it
is possible to create selections which are not rectangular. This leads
to deleting pixels that were not selected.
This change adjusts the erase behavior to walk the selection rect and
check if a pixel is selected or not before deleting.
Wand Selection tool uses similar logic to the Bucket Tool. Flood filling
and threshold calculations to determine the affected area just in this
case we do not set the pixels of the selected area, instead we use
those pixels to alter the selection mask.
In the future we can probably abstract out the shared flood logic so
both tools can share the code.
Before, the warning dialog would be opened after the NewProjectDialog,
leading to focus-fighting by the two windows. This fixes that and makes
the action more consistent with the standard serenity way of handling
unsaved changes by asking before the NewProjectDialog is brought up.
The way this is achieved avoids having to rewrite open_project as well.
This commit fixes a crash that would occur due to an unnamed file being
automatically saved via EditorWrapper::save(). Now, we throw up a
FilePicker::get_save_filepath.
Specializing point_position_to_preferred_cell for the
RectangleSelectTool as it selects a new cells with a rounding
behavior instead of a flooring behavior
This is done to allow querying the current active tool inside the
event_with_pan_and_scale_applied and event_adjusted_for_layer
functions without risking a null pointer dereference
This method is used to point a position at the preferred pixel of
the image. Certain tools may want to specify a different preferred
pixel for the same input position.
When the location currently displayed in FileManager is removed, find
the nearest existing parent path and open it in the window.
Without the fix, the FileManager window remained in the deleted
directory.
Changing the path in 'DirectoryView' object will automatically update
other components in the FileManager (breadcrumb bar, directory tree
view).
This commit fixes FileSystemModel behaviour when the root path of the
model has been deleted.
In this case, the model index resolved for the root path is invalid and
passing it to 'begin_delete_rows' would trigger assertion failure.
Instead of deleting all children rows one by one, we simply invalidate
the whole model.
And adjust some GML properties. Since a808cfa, splitters grow
opportunistically. Setting them to fixed sizes now quite literally
fixes them in place. Fixes immovable splitters missed in the
aforementioned commit.
Previously, for a regex such as /[a-sy-z]/i, we would incorrectly think
the character "u" fell into the range "a-s" because neither of the
conditions "u > s && U > s" or "u < a && U < a" would be true, resulting
in the lookup falling back to assuming the character is in the range.
Instead, first explicitly check if the character falls into the range,
rather than checking if it falls outside the range. If the explicit
checks fail, then we know the character is outside the range.