summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-06-25WindowServer: Redraw screen when switching back from ttySahan Fernando
2021-06-25Userland: Add FB_FLUSH ioctl for fbdevSahan Fernando
2021-06-25FileManager: Add "Open in New Window" context menu actionSam Atkins
2021-06-25HackStudio: Do not create a new LanguageClient unless neededItamar
Previously, whenever Editor::set_document() was called, we destroyed the previous LanguageClient instance of the editor and created a new one. We now check if the language of the existing LanguageClient matches the new document, and if so we do not create a new LanguageClient instance. This fixes an issue where doing "goto definition" would crash HackStudio. This was probably introduced in 44418cb351. The crash occurred because when doing "goto definition", we called a AK::Function callback from the LanguageClient, which internally called Editor::set_document(). Editor::set_document() destroyed the existing LanguageClient, which cased a VERIFY in Function::clear() to fail because we were trying to destroy the AK::Function object while executing inside it.
2021-06-25LibGUI: Add TextEditor::has_document()Itamar
2021-06-25HackStudio: Add LanguageClient::Language() getterItamar
2021-06-25LibAudio: Implement a basic FLAC loaderkleines Filmröllchen
This commit adds a loader for the FLAC audio codec, the Free Lossless Audio codec by the Xiph.Org foundation. LibAudio will automatically read and parse FLAC files, so users do not need to adjust. This implementation is bare-bones and needs to be improved upon. There are many bugs, verbatim subframes and any kind of seeking is not supported. However, stereo files exported by libavcodec on highest compression setting seem to work well.
2021-06-25LibAudio: Make ResampleHelper templated for different sample typeskleines Filmröllchen
Previously, ResampleHelper was fixed on handling double's, which makes it unsuitable for the upcoming FLAC loader that needs to resample integers. For this reason, ResampleHelper is templated to support theoretically any type of sample, though only the necessary i32 and double are templated right now. The ResampleHelper implementations are moved from WavLoader.cpp to Buffer.cpp. This also improves some imports in the WavLoader files.
2021-06-25LibAudio: Make LoaderPlugin::error_string return String&kleines Filmröllchen
Previously, error_string() returned char* which is bad Serenity style and caused issues when other error handling methods were tried. As both WavLoader and (future) FLAC loader store a String internally for the error message, it makes sense to return a String reference instead.
2021-06-25LibAudio: Add the Int32 sample formatkleines Filmröllchen
The signed 32-bit PCM sample format is required for the FLAC standard.
2021-06-25LibCore: Add InputFileStream::seekkleines Filmröllchen
As a file is able to seek(), InputFileStreams can delegate the seek() easily. This allows for seeking to specific locations in the file.
2021-06-25LibJS: Make sure to always initialize Reference::m_base_valueAndreas Kling
2021-06-25LibJS: Rename Reference methods to match the specAndreas Kling
- get -> get_value (GetValue in the spec) - put -> put_value (PutValue in the spec) Also add spec links. :^)
2021-06-25LibJS: Bring Reference records a bit closer to the ECMAScript specAndreas Kling
Our Reference class now has the same fields as the spec: - Base (a non-nullish value, an environment record, or `unresolvable`) - Referenced Name (the name of the binding) - Strict (whether the reference originated in strict mode code) - ThisValue (if non-empty, the reference represents a `super` keyword) The main difference from before is that we now resolve the environment record that a reference interacts with. Previously we simply resolved to either "local variable" or "global variable". The associated abstract operations are still largely non-conforming, since we don't yet implement proper variable bindings. But this patch should at least fix a handful of test262 cases. :^) There's one minor regression: some TypeError message strings get a little worse due to doing a RequireObjectCoercible earlier in the evaluation of MemberExpression.
2021-06-25LibJS: Evaluate `this` in terms of ResolveThisBindingAndreas Kling
2021-06-25LibJS: Remove outdated FIXME in GetThisEnvironmentAndreas Kling
2021-06-25LibJS: Rename VM::get_reference() => resolve_binding()Andreas Kling
This function maps to the ResolveBinding operation from the spec, so let's rename it to match.
2021-06-25LibWeb: Support :active pseudo-class for hyperlinks, :focus possiblyPaul Irwin
Adds support for the :active pseudo-class for hyperlinks (<a> tags only). Also, since it was very similar to :focus and an element having a focused state was already implemented, I went ahead and implemented that pseudo-class too, although I cannot come up with a working example to validate it.
2021-06-25Browser: Add alternate shortcut F6 for focusing the location boxAatos Majava
2021-06-25LibGUI: Add alternate shortcut F5 to the "reload" common actionAatos Majava
2021-06-25LibGUI: Make Action::shortcut() return const&Aatos Majava
Also do the same for Action::alternate_shortcut().
2021-06-25LibGUI: Add a new constructor to ActionAatos Majava
This constructor allows you to omit the modifier keys. Instead of doing "{ 0, Key_F5 }" you can now just do "Key_F5"
2021-06-25LibGUI: Actually use the Action alternate shortcutAatos Majava
This adds the actual functionality to Window and Application.
2021-06-25LibGUI: Add support for an alternate keyboard shortcut in ActionAatos Majava
This patch adds the alternate_shortcut member to LibGUI::Action, which enables one Action to have two keyboard shortcuts. Note that the string used in menus and tooltips only shows the main shortcut, which is the same behaviour as in Firefox and Chrome.
2021-06-24LibGUI: Add update() when changing widget color or paletteSpencer Dixon
2021-06-25WindowServer: Scale Mouse movementsAlexander
This fixes a bug where if the current screen was using scaling, the mouse would be twice as fast as normal.
2021-06-24Userland: Replace VERIFY(is<T>) with verify_cast<T>Andreas Kling
Instead of doing a VERIFY(is<T>(x)) and *then* casting it to T, we can just do the cast right away with verify_cast<T>. :^)
2021-06-24LibJS: Protect execution context variable environments from GCAndreas Kling
At the moment these environments are always the same as the lexical ones, so this didn't cause any trouble. Once we start separating them we have to make sure both environments are protected.
2021-06-24AK: Rename downcast<T> => verify_cast<T>Andreas Kling
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
2021-06-24LibJS: Rename ExecutionContext::callee => functionAndreas Kling
This matches what ECMAScript calls it. Also make it a JS::Function* instead of a generic Value, since it will always either be a function object or null.
2021-06-24LibJS: Rename CallFrame => ExecutionContextAndreas Kling
This struct represents what the ECMAScript specification calls an "execution context" so let's use the same terminology. :^)
2021-06-24LibVT: Only resize the line after all rewrapping is doneAli Mohammad Pur
Otherwise we would end up inserting empty cells into the wrapped lines. Fixes #8227.
2021-06-24LibCore+AK: Use proper atomics in `Singleton`Daniel Bertalan
2021-06-24LibGfx: Don't `constexpr` functions returning StringsDaniel Bertalan
Since strings don't have a constexpr constructor, these won't have any effect anyways. Furthermore, this is explicitly disallowed by the standard, and makes Clang tools freak out.
2021-06-24Userland: Disambiguate dependent typesDaniel Bertalan
Clang produced an error on these pieces of code without the `typename` keyword.
2021-06-24Everywhere: Use nothrow new with `adopt_{ref,own}_if_nonnull`Daniel Bertalan
This commit converts naked `new`s to `AK::try_make` and `AK::try_create` wherever possible. If the called constructor is private, this can not be done, so we instead now use the standard-defined and compiler-agnostic `new (nothrow)`.
2021-06-24Utilities: Validate user with Core::Account in userdelbrapru
Previously the remove home directory option never actually removed the user's home directory because it was not properly unveiled. By validating the user with Core::Account, we can identify the user's home directory earlier in the program and unveil as necessary. Additionally, by identifying if the user does not exist much earlier in the program, this elimates depending on getpwent to validate the user and creating unneccessary temp files.
2021-06-24LibJS: Fix clang-tidy warnings in AST.hAndreas Kling
- Add/remove `move()` as suggested. - Add missing `explicit` on single-parameter constructors.
2021-06-24LibJS: Don't use m_ prefix for argument name in ScriptFunctionAndreas Kling
2021-06-24LibJS: Remove unused DeclarativeEnvironmentRecord::type()Andreas Kling
Nothing was using this, and we now have separate classes for the different types of environment records instead.
2021-06-24LibJS: Add ObjectEnvironmentRecord.[[IsWithEnvironment]] fieldAndreas Kling
This is true for environments created by `with` statements, and false for other (global) object environments. Also add the WithBaseObject abstract operation while we're here.
2021-06-24Games: Add SpiderJamie Mansfield
Scoring is designed to mimic Microsoft's implementation - starting at 500, decreasing by 1 every move, and increasing by 100 for every full stack. Fixes GH-5319.
2021-06-24LibCards: Support non-alternating colour patience gamesJamie Mansfield
This introduces a new MovementType concept to LibCards, starting the process to allow other patience games to be implemented using it - that differ more substantially from Klondike in logic. This is currently used for two purposes: 1. to verify that the 'grabbed' stack of cards is valid* (sequential and correct colours) and 2. to allow 'grabbed' stacks to be pushed onto same-colour, either-colour, or alternating-colour stacks * Klondike doesn't need this logic, as per how the game works any 'grabbed' selection is guaranteed to be valid.
2021-06-24LibSymbolication: Fix incorrect argument type for symbolicate()Gunnar Beutner
2021-06-24Profiler: Use u32 when constructing InstructionDataGunnar Beutner
When constructing values of the InstructionData type we assume that the event_count field is a size_t while it actually is a u32. On x86_64 this fails because those are different types.
2021-06-24Userland: Add more TODO()s for arch-specific codeGunnar Beutner
This enables building more of the userspace applications for x86_64.
2021-06-24Solitaire: Maybe fix rare crash from completing a game with TAB (#8217)Sam Atkins
The crash happens very rarely and is hard to reproduce so it is hard to know for certain, but I am confident this fixes it. I previously delayed the start of the game-over animation by one frame, but neglected to check m_start_game_over_animation_next_frame wasn't set. This means multiple calls to start_game_over_animation() on the same frame (or rather, before the first timer_event) would each call Object::start_timer(). Now that we do check the flag, that should no longer be possible. Fixes #8122.
2021-06-24Userland: Remove dummy IPC methodsGunnar Beutner
They're not used anywhere and are unnecessary boilerplate code. So let's remove them and update IPCCompiler to allow for empty endpoint declarations.
2021-06-24 LibELF: Fix missing includeHendiadyoin1
A few files are expecting that someone brings PAGE_SIZE from possibly the Kernel with them
2021-06-24LibSQL: Make lexer and parser more standard SQL compliantJan de Visser
SQL was standardized before there was consensus on sane language syntax constructs had evolved. The language is mostly case-insensitive, with unquoted text converted to upper case. Identifiers can include lower case characters and other 'special' characters by enclosing the identifier with double quotes. A double quote is escaped by doubling it. Likewise, a single quote in a literal string is escaped by doubling it. All this means that the strategy used in the lexer, where a token's value is a StringView 'window' on the source string, does not work, because the value needs to be massaged before being handed to the parser. Therefore a token now has a String containing its value. Given the limited lifetime of a token, this is acceptable overhead. Not doing this means that for example quote removal and double quote escaping would need to be done in the parser or in AST node construction, which would spread lexing basically all over the place. Which would be suboptimal. There was some impact on the sql utility and SyntaxHighlighter component which was addressed by storing the token's end position together with the start position in order to properly highlight it. Finally, reviewing the tests for parsing numeric literals revealed an inconsistency in which tokens we accept or reject: `1a` is accepted but `1e` is rejected. Related to this is the fate of `0x`. Added a FIXME reminding us to address this.