summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-31LibMarkdown: Match HTML formatting of Commonmark testsPeter Elliott
This patch changes the HTML formatting (where to put newlines, etc...) to better match commonmark's test cases. This has minimal effect of the correctness of our markdown implementation, but makes it easier to test. Changes: - Use <em> instead of <i>. - Newline before end of code block. - <hr /> instead of <hr>. - Newline before first list item. - Newline between lines of a paragraph. - Trim whitespace on lines of paragraphs. Tests passed: 33/652 -> 87/652
2021-08-31Tests: Test LibMarkdown against commonmark test suitePeter Elliott
TestCommonmark runs the CommonMark test suite (https://spec.commonmark.org/0.30/spec.json) against LibMarkdown. Currently 44/652 tests pass.
2021-08-31LibMarkdown: Add render_to_inline_html() to DocumentPeter Elliott
This api is useful when you want to render a markdown document to HTML, but you want to embed it in a existing html document.
2021-08-31LibTest: Add TEST_SETUP macro that runs before all test casesPeter Elliott
2021-08-31Config CLI: Handle missing config values correctlyMustafa Quraish
If the domain/group/key doesn't exist in the config, exit with non-zero status and don't print out anything. Previously the CLI would print a single empty line if the config value was not found with LibConfig. Now, we use the proper `Config::Client::the().read_string()` API which can return an `Optional` type indicating failure.`
2021-08-31Kernel/VirtIO: Don't expose constructors as public methodLiav A
This leads to a bad pattern where anyone could create an RNG or a Console object. Instead, let's just use the common pattern of a static method to instantiate a new object and return it wrapped by a NonnullRefPtr.
2021-08-31Kernel/VirtIO: Remove redundant VirtIO word from filenamesLiav A
Now that all related VirtIO classes are in the VirtIO namespace, let's just remove the redundant VirtIO word from filenames.
2021-08-31Kernel/VirtIO: Move everything into the VirtIO namespaceLiav A
Before of this change, many specific classes to VirtIO were in the Kernel namespace, which polluted it. Everything should be more organized now, but there's still room for improvement later.
2021-08-31Kernel/VirtIO: Remove the m_class_name memberLiav A
This class member was used only to determine the device type when printing messages to the debug log. Instead, remove this class member, and add a quick way to find the device type according to how the VirtIO specification says to do that. This simplifies construction of VirtIODevices a bit, because now the constructor doesn't need to ask for a String identified with the device type.
2021-08-31Kernel/PCI: Fix offset error of the PCI_SUBSYSTEM valuesLiav A
Apparently both PCI_SUBSYSTEM_ID and PCI_SUBSYSTEM_VENDOR_ID offsets should be swapped from one to another to be correct.
2021-08-31Kernel/VirtIO: Make RNG device to not be a CharacterDeviceLiav A
This class as a CharacterDevice really was not useful, because you couldn't even read from it. Also, the random number generator interface should be the /dev/random, so any other interface to get random numbers is generally not a good idea. Instead, let's keep this functionality as an entropy source for random numbers generation, but without exposing a device node.
2021-08-31echo: Support octal, hexadecimal and unicode escape sequencesTheFightingCatfish
2021-08-31AudioApplet: Fix applet positioning bugJoe Bentley
Currently when clicking the percentage toggle, there is a delay in moving the applet window position. This is because after the applet is resized, the applet area is repositioned asynchronously. This takes advantage of the new AppletAreaRectChange event to reposition the slider window when necessary.
2021-08-31WindowServer: Add message to notify clients of applet area resizeJoe Bentley
Applets and windows would like to be able to know when the applet area has been resized. For example, this happens asynchronously after an applet has been resized, so we cannot then rely on the applet area position synchronously after resizing. This adds a new message applet_area_rect_changed and associated Event AppletAreaRectChange, and the appropriate virtual functions.
2021-08-31GameOfLife: Don't enable rotate button if a pattern isn't selectedMusab Kılıç
2021-08-31Build: Pass "-z separate-code" to linkerAndreas Kling
This tells the linker to not combine read-only data and executable code, instead favoring multiple PT_LOAD headers with more precise permissions. This greatly reduces the amount of executable pages in all our programs and libraries. /usr/lib/libjs.so before: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x00000000 0x00000000 0x2fc77c 0x2fc77c R E 0x1000 LOAD 0x2fc900 0x002fd900 0x002fd900 0x0c708 0x0dd1c RW 0x1000 /usr/lib/libjs.so after: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x00000000 0x00000000 0x80e60 0x80e60 R 0x1000 LOAD 0x081000 0x00081000 0x00081000 0x25f6c9 0x25f6c9 R E 0x1000 LOAD 0x2e1000 0x002e1000 0x002e1000 0x1c27c 0x1c27c R 0x1000 LOAD 0x2fd900 0x002fe900 0x002fe900 0x0c708 0x0dd1c RW 0x1000 As you can see, we go from 0x2fc77c bytes of executable memory down to 0x25f6c9 (a ~20% reduction!) The memory that was previous executable is now simply read-only instead. :^)
2021-08-31Kernel: Ignore zero-sized PT_LOAD headers when loading ELF imagesAndreas Kling
2021-08-31LibELF: Allow (but ignore) PT_LOAD headers with zero sizeAndreas Kling
GNU ld sometimes generates zero-sized PT_LOAD headers when running with the "-z separate-code" option. Let's not choke on such headers, we can just ignore them and move along.
2021-08-31PixelPaint: Rename `Mode` to `FillMode` for Ellipse/RectangleMustafa Quraish
The prior commits add the `DrawMode` enum to keep track of where the shape is being drawn from. With this addition, the prior `Mode` enum name is confusing, so this commit renames it to `FillMode` to be more explicit :^)
2021-08-31PixelPaint: Add ability to draw rectangle from centerMustafa Quraish
Essentially the same logic as the prior commit, but now for the `RectangleTool` class. Pressing `alt` lets you draw the rectangle with the starting position as the center.
2021-08-31PixelPaint: Add ability to draw ellipse from centerMustafa Quraish
Like other common image editing applications, now if you press `alt` while drawing an ellipse, it uses the starting position as the center of the ellipse as opposed to one of the corners of the bounding rect. The EllipseTool class now keeps track of a `DrawMode`, which is either `DrawMode::FromCorner` (default), or `DrawMode::FromCenter` (the option added by this commit). The `draw_using()` function was modified to now take in the start and end positions and construct the `ellipse_intersecting_rect` itself, since we need to construct it differently based on the drawing mode.
2021-08-31KeyboardSettings: Reuse generic GUI::ItemListModelKarol Kosek
This change removes the manually created model class in order to use a generic GUI::ItemListModel. Besides from code reusability, it also makes the list searchable as you type.
2021-08-31LibGUI: Reuse draw_item_text function in ListViewKarol Kosek
This commit will highlight searched text!
2021-08-31LibGUI: Enable searching through ListView items by keyboardKarol Kosek
ComboBoxes and a FontPicker window will now react to keyboard press.
2021-08-31LibGUI: Make ItemListModel searchableKarol Kosek
2021-08-31Spreadsheet: Implement begin() and end()Karol Kosek
2021-08-31Spreadsheet: Add RowIterator::index()Karol Kosek
2021-08-31Kernel/Userland: Expose usb device address and use it in `lsusb`Jesse Buhagiar
We now expose the `USBDevice`'s address in the SysFS object. This means that device addresses are no longer determined by the name of the file in the `/bus/usb/` directory. This was an incorrect way of determining device address, as a standard PC can have multiple USB controllers (and hence multiple buses) that can have overlapping device IDs.
2021-08-31Shell: Use new Statistics tool in 'time -n' commandTobias Christiansen
The new Statistics utility is now used when calling 'time -n' to get some more information of the timings. For now only the standard deviation is given in addition to the average. This commit completely undos #9645 because everything that touched moved into AK::Statistics.
2021-08-31AK: Add Statistics helperTobias Christiansen
This patch adds a helper to AK which allows for basic statistical analysis of values. The median algorithm is very naive and slow, but it works.
2021-08-31AK: Don't perform the shift when it's too large when decoding LEB128Ali Mohammad Pur
Prior to this, we calculated whether the shift was too large for the result, and then did the shift regardless. Found by OSS-Fuzz: https://oss-fuzz.com/testcase-detail/6046441716973568
2021-08-31LibRegex: Implement min/max repetition using the Repeat bytecodeAli Mohammad Pur
This makes repetitions with large max bounds work correctly. Also fixes an OOM issue found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4725721980338176
2021-08-31LibWasm: Limit the number of function localsAli Mohammad Pur
It's possible for the module to request too many locals, we now reject such modules instead of trying to allocate space for them. The value itself is chosen arbitrarily, so future tweaks _might_ be necessary. Found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4755809098661888
2021-08-31LibRegex: Limit the number of nested capture groups allowed in BREAli Mohammad Pur
Found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4869334212673536
2021-08-31LibJS: Implement Temporal.Instant.prototype.toJSON()Linus Groh
2021-08-31LibJS: Implement Temporal.Instant.prototype.toLocaleString()Linus Groh
2021-08-31LibJS: Implement Temporal.Instant.prototype.toString()Linus Groh
2021-08-31LibAudio: Implement decoding verbatim blocks in FLACKarol Kosek
They're mostly used in literal random data, so it isn't like there is a high demand for it, but it's cool to have more complete implementation anyway. :^)
2021-08-31LibGUI: Bias text towards bottom when tabs at top have uneven spacingsin-ack
This makes the text on inactive tabs in Browser look a lil' bit nicer. :^)
2021-08-31LibGUI: Adjust content area and focus rect of tab buttonssin-ack
This improves the look of tabs and their focus rects. In particular, the concept of a "text rect" is removed, and whatever tab content area is left over after the icon and close button are added is used as the area to draw the text into. This approach is simpler than having a separate text rect.
2021-08-31Kernel: Don't VERIFY_NOT_REACHED in LocalSocket::has_attached_peer()Owen Smith
Invoking sendmsg on a listening socket triggers this assertion as sendto calls has_attached_peer before checking the result of send_buffer_for.
2021-08-31Piano: Use LibDSP to implement delaykleines Filmröllchen
This is the first step in transitioning Piano to a full LibDSP backend. For now, the delay effect is replaced with a (mostly identical) implementation in LibDSP. The new ProcessorParameterSlider attaches to a LibDSP::Processor's range parameter (LibDSP::ProcessorRangeParameter) and changes it automatically. It also has the ability to update an external GUI::Label. This is used for the three delay parameters and it will become useful for auto-generating UI for Processors.
2021-08-31Libraries: Add LibDSPkleines Filmröllchen
LibDSP is a library for digital signal processing, and is primarily intended to support the future DAW version of Piano.
2021-08-31AK: Make SinglyLinkedList::remove() publickleines Filmröllchen
This is a nice API to have outside of the class, and it is convenient for LibDSP.
2021-08-31Piano: Add velocity and pitch supportkleines Filmröllchen
As Piano will later move to the RollNote defintions of LibDSP, it's a good idea to already insert velocity and pitch support, even though it's currently not used.
2021-08-31AK: Add FixedPoint arithmetic helperHediadyoin1
Co-authored-by: Hendiadyoin1 <leon2002.la@gmail.com> Co-authored-by: kleines Filmröllchen <malu.bertsch@gmail.com>
2021-08-31Meta: Don't allow overlap in sonar cube file classificationBrian Gianforcaro
Test files were getting analyzed twice, which the tool does not like, and causes it to exit with a fatal error. Also make the workflow run in PRs anytime the file is edited, so that we can get immediate feedback without waiting till the next day.
2021-08-31Profiler: Add a flamegraph view for the stackNicholas Hollett
The flamegraph makes it easier to quickly spot expensive functions, based on the width of their bar.
2021-08-31LibGfx: Add color helper for getting shades and tintsNicholas Hollett
Shades are colors darker than the color, tints are colors lighter. This is helpful in places where we need a bunch of similar colors with some small differences.
2021-08-31Meta: Require unzip and tar explicitly in CMakeListsAndrew Kaster
This should help stem the tide of people hopping in the build problems channel on discord because they don't have unzip installed.