Commit graph

9374 commits

Author SHA1 Message Date
Andreas Kling
9566f6c8b3 PaintBrush: Let's have Layer::rect() and Layer::relative_rect()
These two have the same semantics as GUI::Widget. The rect() is always
at location { 0, 0 }, while the relative_rect()'s location is relative
to the "parent", which in this case is the Layer's Image.
2020-05-12 23:49:52 +02:00
Andreas Kling
83d24dcb1d PaintBrush: Port all the existing toolbox tools to the Layer world :^)
Many tools are not working perfectly right yet, but we'll fix them!
2020-05-12 23:44:46 +02:00
Andreas Kling
7dd8f1b921 LibGUI: Add missing Vector.h include to Event.h 2020-05-12 23:28:08 +02:00
Andreas Kling
35c2d389f5 PaintBrush: Show the layer stack in a table view on the right hand side 2020-05-12 23:00:23 +02:00
Andreas Kling
985c2550c1 PaintBrush: Start refactoring to support layer-based images
The main editing widget is now the new ImageEditor widget, which works
on an Image object, which internally has a stack of Layer objects.

Layers are composited back-to-front when painting the Image inside an
ImageEditor.
2020-05-12 22:22:45 +02:00
Andreas Kling
a87f5e4154 Browser: Allow Ctrl+clicking on bookmark bar buttons :^) 2020-05-12 20:35:45 +02:00
Andreas Kling
977863ea07 LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking
a button.
2020-05-12 20:31:16 +02:00
Andreas Kling
3a905aed06 SystemMonitor: Remove the toolbar above the process table
This was looking a bit too whimsical and didn't really fit with the
overall look of the window anymore. The actions are available via
the context menu still.
2020-05-12 19:51:36 +02:00
Andreas Kling
8b8a5fc6c6 LibHTTP+ProtocolServer: Use CaseInsensitiveStringTraits for headers
These are supposed to be interpreted caselessly so let's just use the
case insensitive traits throughout. This means we'll understand things
like "Content-Length" even when they send "content-length" etc.
2020-05-12 19:10:01 +02:00
Andreas Kling
413ab652c8 LibIPC+IPCCompiler: Templatize encoding/decoding of Optional<T>
This was the last one! IPCCompiler no longer has any type-specific
encoding/decoding logic! :^)
2020-05-12 19:04:05 +02:00
Andreas Kling
6800f6eff5 LibDesktop: Remove accidental unused struct 2020-05-12 19:04:05 +02:00
Andreas Kling
fbda28248a LibGfx+IPCCompiler: Add IPC encoders for Color and ShareableBitmap 2020-05-12 19:04:03 +02:00
Andreas Kling
f8e3c8326d Terminal: When offering to open a URL, show name + icon for handler app
Instead of just saying "Open URL" when you right click on a hyperlink
in the terminal, we now say something like "Open in Browser". :^)
2020-05-12 18:49:24 +02:00
Andreas Kling
512c04c64f LaunchServer+LibDesktop: Add API to list handlers for a given URL
You can now ask for a list of applications that can handle opening
a given URL. This will be useful for creating context menus.
2020-05-12 18:49:24 +02:00
Andreas Kling
3775983dfe LibIPC+LibGfx: Templatize IPC encoding as well as decoding
Now most classes dictate how they are serialized and deserialized when
transmitted across LibIPC sockets. This also makes the IPC compiler
a bit simpler. :^)
2020-05-12 18:49:24 +02:00
Andreas Kling
cba4880301 LaunchServer: Remove tab characters in LaunchServer.ipc 2020-05-12 18:49:24 +02:00
Linus Groh
1383cd23bc LibJS: Add missing keywords/tokens
Some of these are required for syntax we have not implemented yet, some
are future reserved words in strict mode.
2020-05-12 18:47:38 +02:00
Andreas Kling
388ae07960 Browser: Some action fixes
- Use the same reload action in menu and toolbar
- Scope more actions inside Browser::Tab
2020-05-12 17:07:20 +02:00
Andreas Kling
8c51063a88 LibGUI: Actually check widgets in focus chain for keyboard shortcuts
We were iterating the ancestor chain of the focused widget when looking
for a matching keyboard shortcut, but we didn't actually look at the
ancestors at each step.

With this fix, we now correctly activate actions found in the ancestor
chain of the focused widgets. :^)
2020-05-12 17:05:00 +02:00
Andreas Kling
479f16bb6c LibGUI: Add KeyEvent::to_string()
This makes it way easier to debug key events.
2020-05-12 17:03:17 +02:00
Andreas Kling
90eec0a3d7 LibGUI: Use KeyCode stringification helper in Shortcut::to_string() 2020-05-12 17:02:33 +02:00
Andreas Kling
0ac9986c2f Kernel: Add a stringification helper for KeyCode 2020-05-12 17:02:20 +02:00
Andreas Kling
39d55d1d76 LibGUI: Add a way to highlight the focused widget for debugging
You can now pass --gui-focus-debug to any GUI::Application and it will
draw a cyan rectangle around the currently focused widget.
2020-05-12 15:48:31 +02:00
Andreas Kling
e064999e0d LibGUI: Allow scrolling through a ComboBox with the mouse wheel 2020-05-12 15:11:06 +02:00
Andreas Kling
18ff75e67b HackStudio: Don't crash when navigating backtrace with up/down keys
It's up to BacktraceModel::index() to validate its inputs.
2020-05-12 15:09:54 +02:00
Andreas Kling
575b674081 LibGUI: Add missing window() null check when widget's child is removed
Before notifying our window that a child was removed, we should first
check that we actually have a window! :^)
2020-05-12 14:06:25 +02:00
Andreas Kling
9d6c85e6a6 LibGUI: Remove ancient code for debugging widget underdraw 2020-05-12 13:43:37 +02:00
AnotherTest
0fbcb3c5b6 LibHTTP: Support Transfer-Encoding: chunked
We advertise ourselves to servers as supporting HTTP/1.1; we should put
our money where our mouth is, and start supporting some of its features.
2020-05-12 13:28:57 +02:00
AnotherTest
6b1ed26e6a LibC: Always assign the offset pointer to endptr in strto{u,}ll()
This patch makes strto{u,}l{l,}() behave more to-spec about endptr.
"If endptr is not NULL, strtoull stores the address of the first invalid
character in *endptr."
2020-05-12 13:28:57 +02:00
Nikolay Kochulin
3d342f72a7 Build: Use fakeroot if non-root build is possible
If genext2fs and fakeroot are installed, the build will no longer
require superuser privileges.
2020-05-12 10:22:46 +02:00
Linus Groh
0399b38f77 AK: Fix gcc 10.1 compiler warnings in Vector.h
It's complaining about "size_t >= 0" checks.

Fixes #2196.
2020-05-12 08:57:27 +02:00
AnotherTest
b64bb7a3e1 LibLine: Fix suggestion spacing regression
This patch fixes an issue where the line editor would put no spacing
between suggestions (only when there are two suggestions).
To reproduce, try on a build with no ports (starting with `pro`):
```
> pro<tab>
profilepro
```
2020-05-12 08:57:14 +02:00
Eryk Skalinski
ae3353bdbc LibWeb: Fixed non-spec processing of margin and padding 2020-05-12 08:53:58 +02:00
Andreas Kling
5f9d80d8bc LibWeb: Add basic support for CSS percentages
Many properties can now have percentage values that get resolved in
layout. The reference value (what is this a percentage *of*?) differs
per property, so I've added a helper where you provide a reference
value as an added parameter to the existing length_or_fallback().
2020-05-11 23:07:30 +02:00
Linus Groh
8ffdcce0d0 LibJS: Parse comma operator into SequenceExpression 2020-05-11 18:36:28 +02:00
Ben Wiederhake
71fd752289 LibC: Implement strtoull correctly
This fixes the behavior for several inputs:
- '-0' (shouldn't work but was accepted)
- '+3' (shouldn't work but was accepted)
- '13835058055282163712' (should work but returned 9223372036854775807 with errno=ERANGE)
2020-05-11 10:52:24 +02:00
Ben Wiederhake
4bff3defa8 LibC: strtod accuracy tests no longer need to skip 2020-05-11 10:52:24 +02:00
Ben Wiederhake
1f9dcdc41c LibC: Use more flexible digit parsing code, deduplicate 2020-05-11 10:52:24 +02:00
Ben Wiederhake
bc5d5bf75d LibC: Implement new strtod, accurate up to 8 eps
This strtod implementation is not perfectly accurate, as evidenced by the test
(accuracy_strtod.cpp), but it is sufficiently close (up to 8 eps).

The main sources of inaccuracy are:
- Highly repeated division/multiplication by 'base'
  (Each operation brings a multiplicative error of 1+2^-53.)
- Loss during the initial conversion from long long to double (most prominently,
  69294956446009195 should first be rounded to 69294956446009200 and then
  converted to 69294956446009200.0 and then divided by ten, yielding
  6929495644600920.0. Currently, it converts first to double, can't represent
  69294956446009195.0, and instead represents 69294956446009190, which
  eventually yields 6929495644600919.0. Close, but technically wrong.)

I believe that these issues can be fixed by rewriting the part at and after
    double value = digits.number();
and that the loss before that is acceptable.

Specifically, losing the exact exponent on overflow is obviously fine.
The only other loss occurs when the significant digits overflow a 'long long'.
But these store 64(-7ish) bits, and the mantissa of a double only stores 52 bits.
With a bit more thinking, one could probably get the error down to 1 or 2 eps.
(But not better.)

Fixes #1979.
2020-05-11 10:52:24 +02:00
Ben Wiederhake
c19d5943f1 LibC: Demonstrate strtod inaccuracy
See also #1979.
2020-05-11 10:52:24 +02:00
Linus Groh
5142acd13e LibWeb: Add very basic handling of "font-family" font stacks 2020-05-11 10:48:54 +02:00
Linus Groh
d20e26c690 AK: Add String::trim_spaces() 2020-05-11 10:48:54 +02:00
Linus Groh
673527d314 LibWeb: Ignore parsed pseudo-element selectors & empty complex selectors
Currently we don't deal with them, so they shouldn't return a
SimpleSelector - that'd be a false positive.

Also don't produce a ComplexSelector if no SimpleSelector was parsed.

This fixes a couple of rendering issues on awesomekling.github.io:
link colours, footer size, content max-width (and possibly more!)
2020-05-11 10:48:54 +02:00
Linus Groh
a427821dd1 LibWeb: Don't paint borders with width <= 0px
Previously we would only check if the border width property is empty and
skip drawing in that case, and enforcing a minimum width of 1px
otherwise - but "border: 0;" should not paint a border :^)
2020-05-11 10:48:54 +02:00
Linus Groh
8edf2bbcbd LibWeb: Set nav, main, article, aside, section to "display: block"
This makes the blog posts on awesomekling.github.io show up :^)
2020-05-11 10:48:54 +02:00
Linus Groh
51707b6c68 LibWeb: Draw the inspected node rect last in LayoutBox::render() 2020-05-11 10:48:54 +02:00
Ben Wiederhake
29a44bc325 Travis: Fix Cache spam
Back in 36ba0a35ee I thought that Travis would
automagically delete theoldest files. Apparently it does not.

Note that no dummy changes are needed, because BuildIt.sh lists itself
as a dependency for the Toolchain. Hooray for something that works!
2020-05-11 10:27:19 +02:00
Yonatan Goldschmidt
c377e6af29 Ports: Add preliminary dropbear port
This is very basic and doesn't support many features. Instead
of describing what it *doesn't* support, I'll describe what I
have tested:
1. Public key authentication (password is not supported)
2. Single command execution
3. PTY-less interactive bash shell (/bin/sh doesn't work)
4. Multi-user (i.e you can ssh as 'anon' as well as root)
2020-05-11 09:50:42 +02:00
Yonatan Goldschmidt
b03fefd9f8 LibC: Add minimal <netinet/ip.h>
It's based on <netinet/in.h> and more definitions might be required
here (e.g, IP header).
2020-05-11 09:50:42 +02:00
Yonatan Goldschmidt
d3bb6cf5a9 LibC: Add missing <sys/time.h> include in <utmp.h>
This file uses 'struct timeval' without including relevant header.
2020-05-11 09:50:42 +02:00