Commit graph

20733 commits

Author SHA1 Message Date
Linus Groh
90e5f607bd CI: Bump update-alternatives priority to 100
This didn't seem to have worked in the past, the new value matches the
recomendation on the GitHub Actions clang-11 default announcement:

https://github.com/actions/virtual-environments/issues/3235
2021-05-21 00:15:14 +01:00
Linus Groh
13288d956b CI: Also apt-get purge clang-11 in build_and_test_lagom step
We don't need it. A recent change to the ubuntu-20.04 image has made it
the default, causing builds to fail - we're installing and want to use
clang-12 anyway, so let's just get rid of the other installed versions.
2021-05-21 00:15:14 +01:00
r-paiva
943f4eb287 LibCore: Let IODevice::can_read_line() buffer until \n or EOF
If a line was larger than 1024 bytes or the file ended without a
newline character, can_read_line would return false.

IODevice::can_read_line() now reads until a newline is found or
EOF is reached.

fixes #5907
2021-05-20 23:53:06 +02:00
r-paiva
edcfbdf4bd AK: Added contains_in_range to Vector
Vector::contains_in_range() allows the search of an element in a given
range on a vector object.
Also added testcases for the new Vector method.
2021-05-20 23:53:06 +02:00
r-paiva
68de9008e7 Utilities: Fix grep match when reading from stdin
When reading from stdin, grep discards the last character,
even if that character is not \n.

This commit changes grep to no longer discard the last character from
a line.
2021-05-20 23:53:06 +02:00
Stephan Unverwerth
eed0bcaf42 LibGL: Implement glHint() 2021-05-20 23:29:56 +02:00
Gunnar Beutner
2a16c8bdb8 3DFileViewer: Clean up file handling
This unifies how 3DFileViewer handles the initial file when starting
the application and when opening files later on via the menu.

Errors are shown both for the initial load as well as when loading
files later on. An error during file load no longer clears the
existing model.

It also adds support for specifying the filename as a command-line
argument.

The opened file's name is shown in the titlebar.
2021-05-20 22:22:56 +02:00
Gunnar Beutner
728e6dad73 3DFileViewer: Move the example model into the home directory 2021-05-20 22:22:56 +02:00
Andreas Kling
1e0d855fdf TextEditor: Don't launch a WebContent process until it's needed
The HTML and Markdown preview modes both use an OutOfProcessWebView to
render the preview pane, and we were instantiating this view from GML.
This caused us to always spawn a WebContent process alongside every
TextEditor instance.

Fix this by deferring the OOPWV construction until we actually need it.
This makes launching TextEditor on a text file quite a bit faster. :^)
2021-05-20 22:12:42 +02:00
Andreas Kling
e95e64972c Clipboard+LibGUI: Remove unnecessary client/server greeting message 2021-05-20 22:12:42 +02:00
Andreas Kling
ec8363aec3 WindowServer+LibGUI: Make client/server greeting faster
Instead of doing a full IPC round-trip for the client and server to
greet each other upon connecting, the server now automatically sends
a "fast_greet" message when a client connects.

The client simply waits for that message to arrive before proceeding.
(Waiting is necessary since LibGUI relies on the palette information
included in the greeting.)
2021-05-20 22:12:42 +02:00
Andreas Kling
1150e9fe79 LibGfx: Remove unused current_system_theme() function 2021-05-20 22:12:42 +02:00
Max Wipfli
4cd8ca07e3 FontEditor: Make statusbar text generation more robust
This makes a few modifications to the statusbar text generation:
* Use the canonical U+XXXX representation of unicode characters.
* For control characters, display their alias instead of whitespace.
* Substitute RTL codepoints with U+FFFD so the text paints correctly.
* Only show the glyph's dimensions if it actually exists in the font.

This fixes #7286.
2021-05-20 22:10:45 +02:00
Max Wipfli
3c2565da94 AK: Add UnicodeUtils with Unicode-related helper functions
This introduces the UnicodeUtils file, which contains helper functions
related to Unicode. This is in contrast to StringUtils, whose functions
are not directly related to Unicode and are, in theory,
encoding-agnostic.
2021-05-20 22:10:45 +02:00
Max Wipfli
621a4008e6 FontEditor: Add tooltip to "Move Glyph" button
This adds a simple tooltip to the "Move Glyph" button to indicate its
functionality.
2021-05-20 22:10:45 +02:00
Tom
9dcc7a67e5 Kernel: Close a Thread tid lookup race
There is a window between dropping a thread's last reference and it
being removed from the list.

Found in #5541
2021-05-20 22:08:36 +02:00
Tobias Christiansen
adfdfd6aba LibWeb: Deal with Boxes that have a background, border and -radius
This hack allows for Boxes that have a background to be painted and a
border to accurately paint their border-radii if needed.
For that the box in with the background is drawn is extended to the
bordered_rect. The border is later drawn over this regardless.
Previously when drawing a Box that had all three, background, border
and a border-radius, there could be some white between the filling and
the border.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
a49812cb07 LibWeb: Take border-radius into account when painting borders
This applies to thicker borders. When drawing them we now don't
chamfer the corner if there is a border-radius present.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
7a566e54e5 LibWeb: Introduce struct to hold border radii and normalize once
The struct BorderRadiusData contains the four radii of the box.
In case the specified borders are too large for the dimensions of the
box, they get scaled down.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
c31046d952 LibWeb: Draw rounded corners for the backgrounds of Boxes
Even if the Box doesn't have a border-radius, we'll pass the rendering
of the Box and its corners to the Painter.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
9e04c0598b LibWeb: Basic rendering of border-radius
It supports all four corners.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
8b63c2a10e LibGfx: Add Painter::draw_circle_arc_intersecting()
This adds a function to draw a circle specified by a center point (
relative to the given Rect) and a radius. The circle arc is only drawn
inside the specified Rect as to allow for circle arc segments.
Technically this was already possible using draw_elliptical_arc(), but
the algorithm is quite involved and lead to wonky arcs when trying to
draw circle arc segments.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
819e0e0440 LibGfx: Add Painter::fill_rect_with_rounded_corners()
This paints a rectangle with rounded corners each specified by a
radius.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
520441d472 LibWeb: Resolve shorthand for border-radius
This takes care of the 1, 2, 3 and 4 parameter shorthand of the border-
radius identifier.
There are more as well as the ominous '/' character but that is for
another time. The 2 and 3 parameter versions are weird enough already.
I don't think anybody uses anything other than the 1 or 4 parameter
version or even the elliptical stuff.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
499934a848 LibWeb: Make border-radius attibutes accessible 2021-05-20 22:08:02 +02:00
Tobias Christiansen
0c261a1c95 LibWeb: Add border-radius to the CSS-parser
And resolve the shorthands.
2021-05-20 22:08:02 +02:00
Tobias Christiansen
d13526e1e7 LibWeb: Handle background-painting of Box in seperate function 2021-05-20 22:08:02 +02:00
Tobias Christiansen
ff0b3518fa LibWeb: Move the painting of the border out of paint()
So other Boxes can override this function.
2021-05-20 22:08:02 +02:00
Gunnar Beutner
3f42d39dce Solitaire: Fix a spelling mistake in one of the variable names 2021-05-20 22:07:20 +02:00
Ali Mohammad Pur
dc388297eb TextEditor+Browser: Enable HTML syntax highlighting on HTML documents 2021-05-20 22:06:45 +02:00
Ali Mohammad Pur
97a230e4ef LibWeb: Add a super basic HTML syntax highlighter
This can currently highlight tag names and attribute names/values.
2021-05-20 22:06:45 +02:00
Ali Mohammad Pur
aa7939bc6c LibWeb: Add position tracking information to HTML tokens 2021-05-20 22:06:45 +02:00
Ali Mohammad Pur
fd982f6562 LibWeb: Sort CMakeLists SOURCES entries 2021-05-20 22:06:45 +02:00
Linus Groh
c1b2813ddf Ports: Only do build check for configure, build, and install steps
This was breaking ports linting, which runs the script with the
'showproperty' option. This check is not needed for some other options
as well, so let's do it conditionally.
2021-05-20 20:04:58 +01:00
Andreas Kling
54f6ac1854 LibGUI: Don't mark "open" FilePicker as done if the file is not found
If you type in a filename that doesn't exist, show an error message
instead of closing the FilePicker "successfully."
2021-05-20 20:55:29 +02:00
Andreas Kling
9b9966b63b LibGUI: Make GUI::FilePicker handle absolute paths better
Some people apparently like to type in full absolute paths into the
filename box of GUI::FilePicker. So let's handle that as you'd expect
by using the full path as the selected path.
2021-05-20 20:55:29 +02:00
Andreas Kling
3773e72752 LibGUI: Tweak API for getting the selected path
Return a String instead of a LexicalPath. Also call it a path instead
of a file since that's what we're really returning.
2021-05-20 20:55:29 +02:00
Andreas Kling
8a6c37deef LibGfx: Remove Gfx::FontDatabase::default_bold_fixed_width_font()
Ask for a bold_variant() of the default_fixed_width_font() instead.
2021-05-20 20:55:29 +02:00
Andreas Kling
6a012ad79f LibGfx: Remove Gfx::FontDatabase::default_bold_font()
Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
2021-05-20 20:55:29 +02:00
Linus Groh
068ddf4513 Ports: Add build completion sanity check to .port_include.sh
Simply by checking whether a built libc.so exists, we should be able to
avoid strange build errors where that's not the case and just tell the
user upfront.

Fixes #7309.
2021-05-20 19:41:45 +01:00
Lenny Maiorani
98468ae2d2 Variant: Remove redundant inline keyword
Problem:
- `constexpr inline` is redundant because `constexpr` implies `inline`.

Solution:
- Remove redundancy.
2021-05-20 18:58:18 +02:00
Brendan Coles
3bbae6c18b HexEditor: find_and_highlight: Limit search to remaining buffer size 2021-05-20 18:40:18 +02:00
Idan Horowitz
df7d938808 Kernel: Stop allocating the PS2KeyboardDevice in the eternal heap
The PS2KeyboardDevice can be free'd in try_to_initialize if the
initialization failed, resulting in an assertion.
2021-05-20 18:40:02 +02:00
Andreas Kling
59fec42a25 StateMachineGenerator: Put output into the CMake build directory
Don't pollute the source directory with generated code.
2021-05-20 18:10:59 +02:00
Andreas Kling
93ef661914 WindowServer+DisplaySettings: Remove the weird "simple" wallpaper mode
Painting the wallpaper at 100% scale in the top left corner is a weird
mode and I don't think we need it. :^)
2021-05-20 17:52:38 +02:00
Andreas Kling
3046b3467c DisplaySettings: Improve wallpaper preview code
Previously, this code would create a bitmap with the size of the screen
resolution, draw the new wallpaper into it, and then scale it down for
display inside the MonitorWidget.

This was done on every paint event, which made the code quite slow and
allocation-happy.

Instead of this, we now scale down the new wallpaper to a miniature
of the same scale as the little MonitorWidget screen. The miniature is
then used for tiling, etc. The miniature is cached and reused across
paint events if nothing else changes.
2021-05-20 17:52:38 +02:00
Andreas Kling
df5f382b50 3DFileViewer: Remove unveil() calls and add "thread" pledge
An application that allows opening arbitrary files from the filesystem
needs to allow itself to access the filesystem, otherwise there's no
point in supporting the feature. :^)

And the "thread" pledge is needed for background thumbnail generation.
2021-05-20 17:52:38 +02:00
Andreas Kling
5419e2b510 Base: Update ladyball icons based on new variant from myphs 2021-05-20 17:52:38 +02:00
Ali Mohammad Pur
c6b12841ee Meta: Make generate_state_machine() generate a proper target
And use GENERATED_SOURCES (or add_dependencies) to make LibVT depend on
that target.
Fixes a FIXME.
2021-05-20 12:11:27 +01:00
Ali Mohammad Pur
a42bf04701 Meta: Add my email(s) to .mailmap
Also map the author name I used before to my current proper name.
2021-05-20 08:58:55 +01:00