summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-05-16AK+Userland: Remove nullability feature for the ByteBuffer typeGunnar Beutner
Nobody seems to use this particular feature, in fact there were some bugs which were uncovered by removing operator bool.
2021-05-16Userland: Don't explicitly call Vector<T>::is_null()Gunnar Beutner
This method always returns false so there's no reason for calling it.
2021-05-16LibGfx: Avoid copying ByteBuffers while loading PNG imagesGunnar Beutner
This wasn't much of a problem before because copying the ByteBuffer merely copied the RefPtr but now that ByteBuffer behaves like Vector this causes unnecessary allocations.
2021-05-16AK+Userland: Fix some compiler warnings and make variables const-refGunnar Beutner
This fixes a few compiler warnings and makes some variables const-ref in preparation for the next commit which changes how ByteBuffer works.
2021-05-16Userland: Add missing #includesGunnar Beutner
These two header files relied on transitive header includes.
2021-05-16LibC+Kernel: Add sys/ttydefaults.hDaniel Bertalan
This non-POSIX header is used in Linux/BSD systems for storing the default termios settings. This lets us setup new TTYs' `m_termios.c_cc` in a nicer way than using a magic string.
2021-05-16LibVT: Run clang-format on Terminal.cppLinus Groh
Some trailing whitespace is causing the CI to fail. :^)
2021-05-16LibGL: Add glBlendFunc() and glShadeModel() to call listsStephan Unverwerth
2021-05-16LibGL: Implement glShadeModel()Stephan Unverwerth
This turns off interpolation of vertex colors when GL_FLAT is selected.
2021-05-16LibVT: Implement ST (ESC \) escape sequenceDaniel Bertalan
Closes #7175
2021-05-16LibVT: Fix 8-bit control codes clobbering UTF-8Daniel Bertalan
Bytes in the 0x80..0x9F range were treated as C1 control codes, which prevented them from being parsed as UTF-8 bytes. This caused some characters (like U+DF, encoded as 0xC3 0x9F) from being recognized as printable characters.
2021-05-16LibVT: fix SM/RM not respecting private markersDaniel Bertalan
Since we now store intermediate characters separately, the intermediates should be checked for the presence of the '?' DEC private marker, not the first parameter.
2021-05-16LibVT: Implement new ANSI escape sequence parserDaniel Bertalan
This commit replaces the former, hand-written parser with a new one that can be generated automatically according to a state change diagram. The new `EscapeSequenceParser` class provides a more ergonomic interface to dealing with escape sequences. This interface has been inspired by Alacritty's [vte library](https://github.com/alacritty/vte/). I tried to avoid changing the application logic inside the `Terminal` class. While this code has not been thoroughly tested, I can't find regressions in the basic command line utilities or `vttest`. `Terminal` now displays nicer debug messages when it encounters an unknown escape sequence. Defensive programming and bounds checks have been added where we access parameters, and as a result, we can now endure 4-5 seconds of `cat /dev/urandom`. :D We generate EscapeSequenceStateMachine.h when building the in-kernel LibVT, and we assume that the file is already in place when the userland library is being built. This will probably cause problems later on, but I can't find a way to do it nicely.
2021-05-16LibVT: Add state machine file for the new parserDaniel Bertalan
The parser itself will be included in a later commit.
2021-05-16AK+Kernel+LibELF: Remove the need for `IteratorDecision::Continue`Nicholas Baron
By constraining two implementations, the compiler will select the best fitting one. All this will require is duplicating the implementation and simplifying for the `void` case. This constraining also informs both the caller and compiler by passing the callback parameter types as part of the constraint (e.g.: `IterationFunction<int>`). Some `for_each` functions in LibELF only take functions which return `void`. This is a minimal correctness check, as it removes one way for a function to incompletely do something. There seems to be a possible idiom where inside a lambda, a `return;` is the same as `continue;` in a for-loop.
2021-05-16LibLine: Make line management less broken when at the last lineAli Mohammad Pur
Previously, all sorts of weird stuff would happen when the editor was at the last line of the terminal (or when the printed line would be at the last line), this commit makes the editor scroll the terminal up before trying to write to a row that doesn't actually exist (yet). This fixes ^R search making a mess when initiated at the last line (especially with multiline prompts).
2021-05-16LibGL: Implement color blendingStephan Unverwerth
This implements different blend modes in the SoftwareRasterizer by first setting up the blend factors then rendering the pixels into a temporary buffer and finally mixing the contents of the temporary buffer with the contents of the backbuffer based on the blend factors.
2021-05-16LibGL: Add support for GL_BLEND in glEnable() and glDisable()Stephan Unverwerth
2021-05-16LibGL: Add defines and stubs for glBlendFunc()Stephan Unverwerth
2021-05-16LibGL: Add missing GLAPI function specifiersStephan Unverwerth
2021-05-16LibGUI: Tweak GUI::Button::on_context_menu_event hook signatureAndreas Kling
Pass the ContextMenuEvent as a mutable reference, so that clients want to accept/ignore the event.
2021-05-16LibGUI: Make GUI::Toolbar::add_action() return the toolbar buttonAndreas Kling
Previously there was no easy way for clients to access the button.
2021-05-15LibCpp: Modify parsing of a Name's scopeItamar
A Name node can now have a non-empty scope and a null name. For example, "AK::" has a non-empty scope and a null name component.
2021-05-15LibCpp: Modify logic of Parser::index_of_node_atItamar
After this commit, Parser::index_of_node_at will prefer to return nodes with greater indices. Since the parsing logic ensures that child nodes come after parent nodes, this change makes this function return child nodes when possible.
2021-05-15LibGUI: Add CommonActions helpers for "zoom in/out" and "reset zoom"Andreas Kling
2021-05-15TextEditor: Clear leftover whitespace when inserting newlineseuclidianAce
Previously when entering a newline, previous indentation would be left, leaving a line consisting only of whitespace. This fixes that.
2021-05-15LibGUI: Delay setting column width in AutocompleteBoxAndreas Kling
HeaderView doesn't allow you to set a column width until you've given it a model with some columns.
2021-05-15AK+LibC: Implement malloc_good_size() and use it for Vector/HashTableGunnar Beutner
This implements the macOS API malloc_good_size() which returns the true allocation size for a given requested allocation size. This allows us to make use of all the available memory in a malloc chunk. For example, for a malloc request of 35 bytes our malloc would internally use a chunk of size 64, however the remaining 29 bytes would be unused. Knowing the true allocation size allows us to request more usable memory that would otherwise be wasted and make that available for Vector, HashTable and potentially other callers in the future.
2021-05-15LibWeb: Fix incorrect variable names when parsing CSSGunnar Beutner
2021-05-15LibGfx: Fix incorrect origin for checkerboard pattern fillsAndreas Kling
The checkerboard pattern used in transparency backgrounds was sometimes misaligned with the grid. This happened because it was incorrectly anchoring the pattern to the clipped rect instead of the global grid of the underlying paint target.
2021-05-15LibDebug: Avoid unnecessary String allocation in append_to_line_info()Andreas Kling
This code path is very hot, and since we're seeing a lot of the same strings repeatedly (and they're heading into a FlyString for storage) let's construct those using FlyString(StringView) to avoid temporary String objects.
2021-05-15LibGfx/Vector*: Implement FormattersJelle Raaijmakers
2021-05-15Everywhere: Add a blank line after copyright header where missingLinus Groh
2021-05-15LibELF: Use binary search when looking up symbols :^)Andreas Kling
For whatever reason, symbolication was doing an O(n) walk of all the symbols, despite having sorted them beforehand. Changing this to a binary_search() makes symbolication noticeably faster and improves Profiler startup time.
2021-05-15LibELF: Remove sketchy use of "undefined" ELF::Image::SectionAndreas Kling
We were using ELF::Image::section(0) to indicate the "undefined" section, when what we really wanted was just Optional<Section>. So let's use Optional instead. :^)
2021-05-14LibCore: Expose DirIterator's underlying file descriptorMart G
2021-05-14Kernel+LibC: Add fstatatMart G
The function fstatat can do the same thing as the stat and lstat functions. However, it can be passed the file descriptor of a directory which will be used when as the starting point for relative paths. This is contrary to stat and lstat which use the current working directory as the starting for relative paths.
2021-05-14LibC: Move makedev(), major(), minor(), to sys/types.hJean-Baptiste Boric
It's technically not specified by POSIX, but it appears most Unix-like systems worth mentioning put those definitions there. Also, it's more logical since the dev_t type is defined there.
2021-05-14LibC: Move mman.h to sys/mman.hJean-Baptiste Boric
POSIX mandates that it is placed there.
2021-05-14LibC: Do not include errno.h inside unistd.hJean-Baptiste Boric
POSIX does not mandate this, therefore let's not do it.
2021-05-14LibThread: Port Lock to foreign environmentsJean-Baptiste Boric
2021-05-14Userland: Replace arc4random() with get_random<u32>()Jean-Baptiste Boric
2021-05-14AK: Introduce get_random_uniform()Jean-Baptiste Boric
This is arc4random_uniform(), but inside AK.
2021-05-14LibGL: Implement glFlush() and glFinish()Stephan Unverwerth
2021-05-14LibCore: Never connect to InspectorServer if getuid() == 0Andreas Kling
Let's just stay on the safe side with this.
2021-05-14LibImageDecoderClient: Decoded images with 0 frames are not successfulAndreas Kling
Previously you could pass anything (e.g a text file) to ImageDecoder and it would "succeed" in decoding it and give you back a 0-frame result. Let's consider that state a failure instead.
2021-05-14ImageViewer: Rename QSWidget => ImageViewer::ViewWidgetAndreas Kling
2021-05-14LibGUI: Fix logic typo in AbstractTableView::update_row_sizes()Andreas Kling
We should skip over non-visible *rows*, not *columns*.
2021-05-14LibCrypto: Prevent a signed overflow during BigInt Modular PowerDexesTTP
The algorithm isn't explicit about what type this needs to be. But this passes all of the tests, so that's probably fine.
2021-05-14LibGUI: Resize GUI::HeaderView section vector to final size immediatelyAndreas Kling
When computing row & column sizes in AbstractTableView, it iterates across both axes starting from 0. This caused us to grow the corresponding HeaderView's internal section vector by 1 entry for each step, leading to Vector::resize() thrashing. Since we already know the final size, just resize to that immediately, and the thrashing goes away. This gives a huge speedup when loading large files into Profiler. :^)