Commit Graph

17962 Commits

Author SHA1 Message Date
lucastarche
3947d301e5 PixelPaint: ImageEditor scaling method
Moved the code on mousewheel_event to its own function.
2021-03-23 08:21:08 +01:00
Petróczi Zoltán
ca49f96b78 LibJS Date: Added "Invalid Date".
Setting an invalid value on a Date object now makes it invalid.
Setting it again but with correct values makes it valid again.
2021-03-22 20:58:22 +01:00
Petróczi Zoltán
d231c5e65b LibJS Date: Added toUTCString()
toGMTString() is deprecated but is kept for compatibility's sake, but because
HTTP Dates are always expressed in GMT, it should be safe to call toUTCString()
in toGMTString().
2021-03-22 20:58:22 +01:00
Andreas Kling
036b5c2804 LibWeb: Import new CSS parser
It's not finished or hooked up to anything yet, but let's get it into
the tree so we can continue working on it.

Original work by @stelar7.
2021-03-22 18:40:08 +01:00
AnotherTest
ba2df70eab Spreadsheet: Do not assume that a worksheet always exists
Fixes #5910.
Fixes #4822 (as far as I can tell).
2021-03-22 17:46:17 +01:00
AnotherTest
534626f917 Spreadsheet: Save the cells under the correct name
This broke in 6a6f19a72f, which replaced
the representation of columns with numbers.
As a result, the save logic would store cells as
"\x<column_index><row_number>", which is obviously wrong.
Fixes #5905.
Also simplifies the control flow in `import_worksheet` a bit.
2021-03-22 17:46:17 +01:00
AnotherTest
7b4fa860d2 Spreadsheet: Check for parse errors after parsing the source
There won't be any parse errors before we actually try to parse
something.
Fixes input like "=1+" crashing the spreadsheet instead of just causing
an error in the cell.
2021-03-22 17:46:17 +01:00
AnotherTest
fef165f1d2 Spreadsheet: Do not assume that user input has balanced parenthesis
Otherwise people with broken paren keys, or people with entertaining
ideas like "=9\b)" will cause an assert to trip.
Fixes #5909.
2021-03-22 17:46:17 +01:00
Brendan Coles
677e5e4d84 readelf: Use Loader.so interpreter for dynamic section and symbols 2021-03-22 17:46:05 +01:00
Brendan Coles
8ad74684ea LibELF: DynamicObject: Add rpath and runpath helpers 2021-03-22 17:46:05 +01:00
AnotherTest
2efa17184d Shell: Add tests for slices 2021-03-22 13:15:08 +01:00
AnotherTest
4ff430b615 Base: Document Shell's variable indexing behaviour 2021-03-22 13:15:08 +01:00
AnotherTest
6c94207ee0 Base: Document Shell's immediate functions 2021-03-22 13:15:08 +01:00
AnotherTest
3b8fa5a753 Shell: Add support for indexing into variables
Now a variable may have an optional slice (only _one_ slice), which can
also use negative indices to index from the end.
This works on both lists and strings.
The contents of the slice have the same semantics as brace expansions.
For example:
```sh
$ x=(1 2 3 4 5 6)
$ echo $x[1..3] # select indices 1, 2, 3
2 3 4
$ echo $x[3,4,1,0] # select indices 3, 4, 1, 0 (in that order)
4 5 2 1
$ x="Well Hello Friends!"
$ echo $x[5..9]
Hello
```
2021-03-22 13:15:08 +01:00
Nick Johnson
ddcef0452a NotificationServer: Close connection on notification close
When the notification was closed, the connection was kept around. This
caused the core event loop to take up nearly all CPU, so instead of
checking the connection we clear it on close and add state variables
to check state.
2021-03-22 12:46:16 +01:00
Nick Johnson
9d09594e44 Notification: Remove default image
This takes up a lot of space if it is not used, and the default image
does not give value. Therefore, we hide the image widget if an invalid
image is passed.
2021-03-22 12:46:16 +01:00
Nick Johnson
c7f00717c3 Notification: Use RefPtr for connection
With this RefPtr, we can initialize the connection to the
NotificationServer upon showing the notification. With this, we can
prevent double shows and updates or closes before showing.
2021-03-22 12:46:16 +01:00
Nick Johnson
e17752fc91 Notification: Use on_close
on_close_request is not called at any point if close is explicitly
called, so we must instead use on_close.
2021-03-22 12:46:16 +01:00
Nick Johnson
8f6894d250 LibGUI+Notification: Add mutable notifications
This commit puts all of the remaining pieces in place. This adds a
mechanism to update the text, title, and icon of an image. If an image
is not provided, the default ladybug will be shown.
2021-03-22 12:46:16 +01:00
Nick Johnson
147a2c4ca2 Notification: Prevent showing a closed window
If a notification was closed, the connection will now be dead. To
prevent inconsistencies between when a user closes a notification and
when an application closes an applicated, check if the notification has
been closed before allowing any action.
2021-03-22 12:46:16 +01:00
Nick Johnson
0fd1e6f062 LibGUI+Notification: Add notification closing
Closing a notification will now allow it to be shown again, as
m_showing being false means it can be re-shown.
2021-03-22 12:46:16 +01:00
Nick Johnson
ef4144c183 Notification: Member-ize updatable components
Changes the necessary widgets to be pointers so we can later change
their underlying data.
2021-03-22 12:46:16 +01:00
Nick Johnson
f2814dd6c1 Notification: Allow getting window by ID
This is a neccessity so a connection can get the notification it is
connected to for later updates.
2021-03-22 12:46:16 +01:00
Nick Johnson
a437430294 Notification: Give a unique internal ID
This will allow us to later query the notifications from a connection
and safely update it without exposing it to any other applications, as
it is session based.
2021-03-22 12:46:16 +01:00
Nick Johnson
7351c77a42 LibGUI+Notification: Use lifetime connection
In order to allow notifications to be updated, we will create a persistent connection for the lifetime of the notification.
2021-03-22 12:46:16 +01:00
Luke
dddaa529b2 LibWeb: Advertise that we support the deflate content encoding 2021-03-22 12:45:34 +01:00
Luke
6cad2aba5e LibHTTP: Add support for the deflate content encoding 2021-03-22 12:45:34 +01:00
Andreas Kling
0255c8d976 Only apply auto-naming of function expressions based on syntax
The auto naming of function expressions is a purely syntactic
decision, so shouldn't be decided based on the dynamic type of
an assignment. This moves the decision making into the parser.

One icky hack is that we add a field to FunctionExpression to
indicate whether we can autoname. The real solution is to actually
generate a CompoundExpression node so that the parser can make
the correct decision, however this would have a potentially
significant run time cost.

This does not correct the behaviour for class expressions.

Patch from Anonymous.
2021-03-22 12:44:07 +01:00
Andreas Kling
7241ff3967 LibJS: *Actually* check for negative zero in JS::Value(double)
As @nico pointed out, 0.0 == -0.0 in C++, even though they are not
bitwise identical. Use the same trick as Value::is_negative_zero() to
really check for it.

This allows JS::Value(0.0) to correctly become an Int32-backed 0 value.
2021-03-22 08:06:47 +01:00
AnotherTest
9b68f91c0b Spreadsheet: Add an export wizard, and support for custom CSV exports
Fixes #4269.
2021-03-22 07:43:58 +01:00
AnotherTest
bba3a7a2cb Spreadsheet: Ignore empty cells when calculating data bounds
There's no reason to use extra rows/columns to represent empty cells
when exporting.
2021-03-22 07:43:58 +01:00
AnotherTest
8bd138cbbe Spreadsheet/XSV: Make the writer respect QuoteAll
Also make the header container type generic, and name an enum.
2021-03-22 07:43:58 +01:00
AnotherTest
3c151b3de6 Spreadsheet: Add an import wizard, and add support for custom CSV files
Fixes the import half of #4269.
2021-03-22 07:43:58 +01:00
AnotherTest
3bbcde9192 Spreadsheet/XSV: Add at() accessors
These are just aliases for operator[].
Also make the headers() getter return a vector of empty strings when the
csv file has no explicit headers.
2021-03-22 07:43:58 +01:00
AnotherTest
39f3f3be94 LibGUI: Allow ItemListModel to have 2D items
This makes it possible to use it as a model for e.g. TableViews.
2021-03-22 07:43:58 +01:00
AnotherTest
6eeb8225f8 LibGUI: Add a few missing classes to the forwarding header 2021-03-22 07:43:58 +01:00
AnotherTest
714ce4741d LibGUI: Allow a wizard page to return null as its next page 2021-03-22 07:43:58 +01:00
AnotherTest
b072cb725f LibGUI: Allow constructing a string Variant from StringView 2021-03-22 07:43:58 +01:00
AnotherTest
c1d67d6b17 Spreadsheet: Don't assume that the 'cells' field is an object
It might be missing, or not be an object.
Fixes #4821.
2021-03-22 07:43:58 +01:00
AnotherTest
9f8d518e82 Spreadsheet: Only append new columns/rows every 50ms
Fixes #5550.
2021-03-22 07:43:58 +01:00
Brendan Coles
7191098356 UserspaceEmulator: Add support for SC_abort syscall 2021-03-22 07:43:44 +01:00
Yuval Tasher
d2b7500c65 LibGUI: remove empty TODO. 2021-03-22 07:43:26 +01:00
Andreas Kling
14d598fe7f LibJS: Don't try to store negative zero as an Int32 JS::Value 2021-03-21 21:40:10 +01:00
Andreas Kling
6870349599 LibJS: Flatten Value::to_numeric()
The basic idea here is to inline to_primitive() to get rid of the
function call overhead.
2021-03-21 21:39:39 +01:00
Andreas Kling
00965e3dad LibJS: Add fast path for add() with two numeric JS::Values 2021-03-21 21:39:39 +01:00
Andreas Kling
37cd1a95fc LibJS: Only call GlobalObject::vm() once in add() 2021-03-21 21:39:39 +01:00
Andreas Kling
c8382c32e9 LibJS: Split Value::Type::Number into Int32 and Double
We now store 32-bit integers as 32-bit integers directly which avoids
having to convert them from doubles when they're only used as 32-bit
integers anyway. :^)

This patch feels a bit incomplete and there's a lot of opportunities
to take advantage of this information. We'll have to find and exploit
them eventually.
2021-03-21 21:39:39 +01:00
Andreas Kling
630d83be8f LibJS: Always inline some tiny Interpreter getters 2021-03-21 21:39:39 +01:00
Andreas Kling
e0abfcb27d LibJS: Don't track executing AST nodes in a Vector
Instead just link together the InterpreterNodeScopes in a linked list.
This was surprisingly hot on CanvasCycle.
2021-03-21 21:39:39 +01:00
Andreas Kling
46e61d208b LibJS: Avoid unnecessary FlyString(String) churn in Reference ctors 2021-03-21 21:39:39 +01:00