summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2022-01-11LibGL: Set `q` parameter for `glTexCoord` to 1 by defaultJelle Raaijmakers
According to the manual, if `q` is not specified, it is 1.
2022-01-11LibGL: Implement `glTexCoord2i`Jelle Raaijmakers
2022-01-11LibSoftGPU: Only render complete primitivesJelle Raaijmakers
Previously, we were expecting triangles and quads to consist of complete sets of vertices. However, a more common behavior is to ignore all vertices that do not make up a full primitive. For example, OpenGL specifies for `GL_QUADS`: "The total number of vertices between Begin and End is 4n + k, where 0 ≤ k ≤ 3; if k is not zero, the final k vertices are ignored." This changes the behavior of `Device::draw_primitives()` to both return early if no full set of vertices was provided, and to ignore any additional vertices that are not part of a full set.
2022-01-11LibGL: Remove duplicate `private:` from SoftwareGLContext.hJelle Raaijmakers
2022-01-11LibGfx+LibGL: Do not crash if matrix inverse does not existJelle Raaijmakers
Allow `Matrix::inverse()` to return an error and deal with those in LibGL. Also use this opportunity to more efficiently calculate the transpose of the model view matrix for the normal transformation.
2022-01-11LibGL: Stub `glPointSize`Jelle Raaijmakers
2022-01-11LibGL: Implement `glLightModeli`Jelle Raaijmakers
2022-01-11LibGL: Implement `glTexEnvi`Jelle Raaijmakers
2022-01-11LibGL: Implement `glRotated`Jelle Raaijmakers
2022-01-11LibGL: Implement `glColor3d` and `glColor3ubv`Jelle Raaijmakers
2022-01-11LibJS: Actually implement get_iana_time_zone_offset_nanoseconds()Linus Groh
Instead of hard-coding an UTC offset of zero seconds, which worked for the sole UTC time zone, we can now get the proper offset from the TZDB!
2022-01-11LibJS: Support non-UTC time zones in Temporal :^)Linus Groh
We can now recognize & normalize all time zones from the IANA time zone database and not just 'UTC', which makes the LibJS Temporal implementation a lot more useful! Thanks to the newly added LibTimeZone, this was incredibly easy to implement :^) This already includes these recent editorial changes in the Temporal spec: https://github.com/tc39/proposal-temporal/commit/27bffe1
2022-01-11LibTimeZone: Operate in UTC-only mode when !ENABLE_TIME_ZONE_DATALinus Groh
Instead of only having dummy functions that don't work with any input, let's at least support one time zone: 'UTC'. This matches the basic Temporal implementation for engines without ECMA-262, for example.
2022-01-11LibJS: Check if input was exhausted after parsing UTC offset fractionLinus Groh
Previously parse_time_zone_numeric_utc_offset_syntax() would return true to indicate success when parsing a string with an invalid number of digits in the fractional seconds part (e.g. 23:59:59.9999999999). We need to check if the lexer has any characters remaining, and return false if that's the case.
2022-01-11LibJS/Tests: Add Temporal.TimeZone() tests for numeric UTC offsetLinus Groh
This works now, let's test it :^)
2022-01-11Applets/Audio: Propagate errors by extracting out GUI initializationcreator1creeper1
This commit extracts out the GUI initialization in AudioWidget into the new try_initialize_graphical_elements function. This function is now able to use try_set_main_widget instead of set_main_widget. It's only called by the fallible try_create method.
2022-01-11Applets/ResourceGraph: Propagate errors in create_appletcreator1creeper1
We now return an error if we fail to parse the applet spec in the expected format. We can now also use try_set_main_widget instead of set_main_widget.
2022-01-11LibCore+flock: Make Core::System::waitpid more ergonomicJunior Rantila
2022-01-11LibGUI: Don't paint text cursor if TextEditor is disabledMarcus Nilsson
This looked a bit odd in the rare case of disabling a focused TextEditor.
2022-01-11LibGUI: Change gradient colors when ValueSlider is disabledMarcus Nilsson
Make it more obivous when ValueSlider is disabled by changing the gradient colors.
2022-01-11LibC: Add daemon(3) implementation to match behavior of Linux and BSDsAndrew Kaster
This helper that originally appeared in 4.4BSD helps to daemonize a process by forking, setting itself as session leader, chdir to "/" and closing stdin/stdout.
2022-01-11LibTimeZone: Begin generating GMT offset rules for each time zoneTimothy Flynn
This is a rather naive implementation, but serves as a first pass at determining the GMT offset for a time zone at a particular point in time. This implementation ignores DST (because we are not parsing any RULE entries yet), and ignores any offset patterns of the form "Mon>4" or "lastSun".
2022-01-11LibTimeZone: Add methods to canonicalize a time zone nameTimothy Flynn
2022-01-11LibTimeZone: Add method to convert a time zone to a stringTimothy Flynn
2022-01-11LibTimeZone: Do not separate the generated data from the main libraryTimothy Flynn
This CMakeLists.txt was basically copy-pasted from LibUnicode, where the generated data is separated into its own library. This was to let other libraries / applications decide if they actually want to link the data because it is so large. LibTimeZone's generated data is significantly smaller, so this separation really isn't needed.
2022-01-11Meta: Convert new help page link styles for the man page websitekleines Filmröllchen
The special URL links (help://man) and the application opening links now work on the man page website. While the page links are translated correctly, the application launch can't be implemented. For this reason, an explanatory error page is shown instead.
2022-01-11Help+Base: Add help://man URLs for links between man pageskleines Filmröllchen
The URLs of the form `help://man/<section>/<page>` link to another help page inside the help application. All previous relative page links are replaced by this new form. This doesn't change any behavior but it looks much nicer :^) Note that man doesn't handle these new links, but the previous relative links didn't work either.
2022-01-11Help: Refactor link handlingkleines Filmröllchen
Link handling is now split up between open_page and open_url. While open_page can handle any sort of input and is responsible for handling history UI, open_url deals in URLs and takes one of a few different actions depending on the exact URL given. Currently, only file:// URLs are handled but this will change in the next few commits. Note that this commit breaks relative URLs on purpose. After the new help:// URLs, they won't be needed anyways. The reasoning is that many URLs not specifically pointing to man page directories will cause a (non-deadly) unveil violation in `real_path_for`. This specifically concerns the new application launch URLs that are added in the next commit.
2022-01-11LibGUI: Make Tableview handle multi-selected indexes when deletingGlenford Williams
Previously when the delete key was pressed, only the first selected cell index would have been deleted. This commit remedies that by first checking when more than a single index is selected.
2022-01-11AK+LibC+LibPthread: Introduce NoAllocationGuardkleines Filmröllchen
NoAllocationGuard is an RAII stack guard that prevents allocations while it exists. This is done through a thread-local global flag which causes malloc to crash on a VERIFY if it is false. The guard allows for recursion. The intended use case for this class is in real-time audio code. In such code, allocations are really bad, and this is an easy way of dynamically enforcing the no-allocations rule while giving the user good feedback if it is violated. Before real-time audio code is executed, e.g. in LibDSP, a NoAllocationGuard is instantiated. This is not done with this commit, as currently some code in LibDSP may still incorrectly allocate in real- time situations. Other use cases for the Kernel have also been added, so this commit builds on the previous to add the support both in Userland and in the Kernel.
2022-01-10LibC: Implement strsep()Linus Groh
2022-01-10Taskbar: Tweak taskbar button progress bar renderingAndreas Kling
The rects didn't take the "thin cap" button style into account, causing in-button progress bars to look a little off.
2022-01-10LibJS: Include hour-cycle in DateTimeFormat optionsTimothy Flynn
This is a normative change to the Intl spec: https://github.com/tc39/ecma402/commit/20e5c26 Note that this doesn't actually affect us. Its purpose is to provide the hour-cycle to BestFitFormatMatcher. This AO is implementation defined, and ours just invokes BasicFormatMatcher, which doesn't use this field. We could now have LibUnicode generate this field and use it to find a better format pattern, though.
2022-01-10LibUnicode: Add an hour-cycle field to DateTimeFormat's format patternTimothy Flynn
2022-01-10LibGUI+AK: Add DRAG_DEBUG opt and put drag operations behind dbgln_ifMarcus Nilsson
No need to have this enabled all the time.
2022-01-102048: Add action icons for New Game and SettingsDylan Katz
2022-01-102048: Simplify dialog box when target reachedDylan Katz
Previously, upon reaching the target, the player is presented with potentially two dialog boxes: one asking if the user wants to continue endlessly and another showing the player's statistics, which would only be shown if the user does not want to continue. This commit consolidates these into a single dialog box that shows the relevant statistics and asks the user if they want to continue endlessly.
2022-01-102048: Fix off-by-1 when opening settingsDylan Katz
When opening 2048's settings, it translates the target tile into a power of 2. Previously, it was done incorrectly, causing the resulting value to be off by one, and the number would increase every time one opens, saves and closes the settings. With this change, it now works as expected.
2022-01-09LibGUI: Show hours and minutes in "unsaved changes" dialogsRafał Babiarz
2022-01-09LibGL: Add stub for `glColorMaterial`Jelle Raaijmakers
2022-01-09LibGL: Add capabilities to context parametersJelle Raaijmakers
Context parameters are LibGL's way of centrally defining all parameters that can be retrieved through `glGetBoolean*`, `glGetInteger*`, etc. The spec describes that capabilities such as `GL_LIGHTING` can also be retrieved through these methods, but it should not be possible to retrieve random boolean parameters through `glIsEnabled`. For example, `GL_UNPACK_LSB_FIRST` can only be retrieved through `glGet*`. This moves reading of capabilities to `::get_context_parameter` and implements its use in `::gl_is_enabled`.
2022-01-09LibJS: Implement proper Iterator recordsLinus Groh
Instead of using plain objects as Iterator records, causes confusion about the object itself actually being its [[Iterator]] slot, and requires non-standard type conversion shenanigans fpr the [[NextValue]] and [[Done]] internal slots, implement a proper Iterator record struct and use it throughout. Also annotate the remaining Iterator AOs with spec comments while we're here.
2022-01-09LibJS: Use Optional<Value> for potentially missing value in Iterator AOsLinus Groh
Given we're already moving away from using the empty Value elsewhere, and I'm about to update most of this code, let's do this small tweak now.
2022-01-09LibCrypto: Link against LibCoreDaniel Bertalan
The ASN1 parser calls `LibCore::DateTime::create` and `LibCore::DateTime::now`.
2022-01-09Spreadsheet: Properly pass parent window to WorkbookGlenford Williams
Change the parent of the WizardDialog to that of the Spreadsheet window. Previously the WizardDialog was using the open file dialog as the parent resulting in the csv import dialog
2022-01-09PixelPaint: Verify that we have an ImageEditor instead of returningMarcus Nilsson
We should never be in a state where an action requiring an ImageEditor is enabled if all tabs are closed.
2022-01-09PixelPaint: Disable actions when no ImageEditor is openMarcus Nilsson
Disable all actions when the last tab is closed and enable them when a new ImageEditor is created.
2022-01-09LibGUI: Add Menu::set_children_actions_enabled() helperMarcus Nilsson
This adds a helper function to Menu that allows us to set all the children enabled/disabled.
2022-01-09PixelPaint: Keep a RefPtr to layer in LayerPropertiesWidgetMarcus Nilsson
Using a WeakPtr to keep a reference to the active layer caused it to be destroyed when the last tab was closed, which made the m_layer == layer check in set_layer() return early since it was already null. Because of this the LayerPropertiesWidget was never disabled.
2022-01-09PixelPaint: Make PaletteWidget::set_image_editor take a ImageEditor*Marcus Nilsson
After closing the last open ImageEditor, selecting a color would try to dereference it causing a crash. Instead make set_image_editor() take a pointer to it and set it to nullptr when closing the last tab like we do with LayerListWidget and LayerPropertiesWidget.