Commit Graph

39104 Commits

Author SHA1 Message Date
FrHun
a4aced7f3a LibGUI: Introduce UIDimension properties 2022-06-28 17:52:42 +01:00
FrHun
b47bf2fd7c LibGUI: Use UIDimension in place of int in Widget 2022-06-28 17:52:42 +01:00
FrHun
024305e742 LibGUI: Add UIDimension and UISize types
These types are used to represent size information for layouts.
They can hold integer (int) values ≥0 or special values like shrink
and fit.
2022-06-28 17:52:42 +01:00
FrHun
e29314f837 LibGUI: Refactor BoxLayout for minor readability improvements 2022-06-28 17:52:42 +01:00
FrHun
e08508dcc1 LibGUI: Add direction totals to Margins 2022-06-28 17:52:42 +01:00
Humberto Alves
c9ed88309b Playground: Set editor->on_change before opening files
Set `editor->on_change` callback before opening files, otherwise the
compiled GML preview will only be available after some manual input in
the text editor.
2022-06-28 17:23:47 +01:00
Maciej
4fbe43f282 ln: Fix typo in arguments argument 2022-06-28 09:20:30 +01:00
Luke Wilde
50642f85ac LibWeb/WebGL: Add WebGLRenderingContextBase.canvas 2022-06-27 22:54:41 +01:00
Luke Wilde
0ec8a19a34 LibWeb/WebGL: Forward the render context ref count to HTMLCanvasElement
This allows HTMLCanvasElement and WebGL rendering contexts to share
their lifetime, as JS allows them to arbitrarily access them at any
time and WebGLRCB.canvas expects a non-null return value.
2022-06-27 22:54:41 +01:00
Luke Wilde
adf8341c4e LibWeb: Forward CRC2D's ref count to HTMLCanvasElement
This allows HTMLCanvasElement and CRC2D to share their lifetime, as JS
allows them to arbitrarily access them at any time and CRC2D.canvas
expects a non-null return value.
2022-06-27 22:54:41 +01:00
Luke Wilde
cd9864bbf1 LibHTTP+RequestServer: Recognize more HTTP methods
Previously it would default to GET for all of these and cause the
Discord API to return Method Not Allowed errors for certain endpoints.
2022-06-27 22:53:36 +01:00
Luke Wilde
1ceba560f4 LibWeb: Add CDATASection
Not used for anything currently other than exposing it on the Window
object. This allows Web Components Polyfills to patch its prototype.
2022-06-27 22:53:04 +01:00
Luke Wilde
2916b3bebf Ports: Update curl to 7.84.0 2022-06-27 22:51:52 +01:00
Cyber Gsus
f97e664d8f LibJS: Check for add overflow in DataViewConstructor
Use the Checked type from AK to verify that offset + view_byte_length
is buffer_byte_length at most.
2022-06-27 20:51:00 +01:00
Humberto Alves
bbfafa19b4 LibGUI: Invert button icons only when the contrast ratio improves
Fix the algorithm that automatically inverts solid color button icons
when placed in similarly colored backgrounds. It was meant for fixing
black icons in dark themed buttons.

However, there may be situations where the resulting inverted version
is actually worse than the original. This change prevents those cases.
2022-06-27 20:22:40 +01:00
Lucas CHOLLET
0c2dc6be66 Help: Use LibWeb to open files via RequestServer 2022-06-27 20:22:15 +01:00
Lucas CHOLLET
662711fa26 Browser+LibWeb+WebContent: Allow Browser to load local files
To achieve this goal:
 - The Browser unveils "/tmp/portal/filesystemaccess"
 - Pass the page through LoadRequest => ResourceLoader
 - ResourceLoader requests a file to the FileSystemAccessServer via IPC
 - OutOfProcessWebView handles it and sends a file descriptor back to
 the Page.
2022-06-27 20:22:15 +01:00
Lucas CHOLLET
1ba9c821fb WindowServer: Make window stealing related functions synchronous
This allows us to make sure that those operations are performed
in the right order. Affected functions are:
 - add_window_stealing_for_client
 - set_window_parent_from_client
 - remove_window_stealing_for_client
 - remove_window_stealing
2022-06-27 20:22:15 +01:00
Lucas CHOLLET
deb525fd9d LibFileSystemAccessClient: Return an errno instead of a string literal
Returning an errno to ease error transmission over IPC.
2022-06-27 20:22:15 +01:00
Lucas CHOLLET
9521952f36 FileSystemAccessServer: Manage concurrent file requests
Before this patch, when you called FileSystemAccessServer::Client::try_*
twice, the second call used the same variable to store the promise. This
"race condition" is now solved using a HashMap, to store multiple
parallel requests.
2022-06-27 20:22:15 +01:00
Lucas CHOLLET
e432a284d7 LibCore: Avoid some successive allocations in Stream::read_all()
For the general case, allocations will always have the size of a block.
In case of a smaller read a block will be filled entirely before another
allocation appends.

It also adds a specialization for Stream::File::read_all() that tries to
detect the size of the file with fstat to perform a single allocation.
2022-06-27 20:22:15 +01:00
Lucas CHOLLET
3843b8c0a1 AK: Perform a resize in ByteBuffer::get_bytes_for_writing()
ByteBuffer::get_bytes_for_writing() was only ensuring capacity before
this patch. The method needs to call resize to register the appended
data, otherwise it will be overwritten with next data addition.
2022-06-27 20:22:15 +01:00
Andrew Kaster
9d70f0383f Browser: Remove GML formatting errors from BrowserSettingsWidget.gml
Regressed in commit 6571455499

This is supposed to be caught by the GML format lint in Azure, but it
looks like a :ninjamerge: occured instead :^)
2022-06-27 08:23:13 +01:00
Ali Mohammad Pur
db4a5aafc8 Spreadsheet: Display a detailed view of a cell error on hover
With this, Spreadsheet can now show an almost full stack trace for the
error (which is infintely better than just the error message).
2022-06-26 22:21:17 +01:00
Ali Mohammad Pur
64ef808aeb Spreadsheet: Allow importing sheets into an existing workbook 2022-06-26 22:21:17 +01:00
Ali Mohammad Pur
135683795b Spreadsheet: Throw if lookup value doesn't exist and no default is given
And explicitly state which value wasn't found and where in the error.
2022-06-26 22:21:17 +01:00
Ali Mohammad Pur
746b8ec8de Spreadsheet: Make it possible to refer to ranges in other sheets
Now the range A0:C4 in a sheet named "foo" can be represented as:

    R`sheet("foo"):A0:C4`

This makes it possible to do cross-sheet lookups and more.
2022-06-26 22:21:17 +01:00
Ali Mohammad Pur
2104e9a6e4 AK: Recognize __CLION_IDE__ as well as __CLION_IDE_
This used to be `__CLION_IDE_` before, but it seems to have been fixed
in the latest EAP.
2022-06-26 22:21:17 +01:00
Ali Mohammad Pur
0e2f4c50d3 Spreadsheet: Prevent OOB access to text editor buffer
For some reason LibGUI sends two events for each edit, and one of them
contains an OOB cursor if a character was deleted.
This works around that for now.
2022-06-26 22:21:17 +01:00
Xexxa
b691269912 Base+Browser+BrowserSettings: Add default page for new tab 2022-06-26 22:18:30 +01:00
Xexxa
6571455499 Browser+BrowserSettings: Add preference for new tab 2022-06-26 22:18:30 +01:00
Lenny Maiorani
ef46100fd3 LibGfx: Increase cache-friendliness in FastBoxBlurFilter
Change from 4 vectors of u8 to a single vector of a struct of 4
u8. Since all the accesses are on the same indicies into each vector
the cache pressure is decreased by co-locating the data.

When scrolling up and down in the `box-shadow` example page the
profile changes from about 75% of the function calls being in
`apply_single_pass()` to only about 70% on my machine.
2022-06-26 22:11:10 +01:00
MacDue
b652546a16 LibWeb: Fix parsing of background-size: contain/cover
The lack of the commit() before returning the x_value here meant,
that in parse_background_value() the token stream would be one token
behind after parsing the background-size. This led to it to returning
null, after it sees the unexpected 'second' contain / cover token.

With this change all of backgrounds.html is working again.
2022-06-26 22:04:20 +01:00
Linus Groh
93b4c3bb82 LibJS: Infer file extensions when resolving module paths
This allows `import "./foo"` to succeed, even if the file is actually
called `foo.js`. IDEs commonly exclude file extensions in auto-imports.

Closes #14364.
2022-06-26 22:03:53 +01:00
Linus Groh
2b3dd87296 LibJS: Rename filepath to filename in module related code
This is already the parameter name of Core::File::open() and
VM::get_stored_module() - both of which this is passed to - as well as
the member name of the Module class.
2022-06-26 22:03:53 +01:00
Linus Groh
893978ea89 LibJS: Replace enumeration macro in typed_array_species_create()
Use the newly added TypedArrayBase::intrinsic_constructor() instead to
get the required constructor from the global object.

Also add spec comments while we're here.
2022-06-26 21:57:39 +01:00
Linus Groh
3885fa1d10 LibJS: Store fn pointer to its intrinsic constructor on TypedArrayBase
This represents "the intrinsic object listed in column one of Table X"
in the spec.
2022-06-26 21:57:39 +01:00
Liav A
e85b3fc750 Ports: Add edid-decode port 2022-06-25 12:10:04 +01:00
Liav A
e02da2ed41 LibC: Implement the getsubopt function
This is a LibC function that POSIX defines to help userspace programs
to get suboptions. An example of a suboption is the token "pixclk" from
a Shell command running "edid-decode --gtf w=1024,h=768,pixclk=48".
The function should be run in a while loop to acquire all suboptions
until the last one.
2022-06-25 12:10:04 +01:00
Liav A
410b2f5d29 Ports: Add GNU findutils utility suite 2022-06-25 12:08:43 +01:00
Liav A
e20706760f Ports: Add GNU gzip utility port 2022-06-25 12:01:45 +01:00
Liav A
f8611ec7bd Ports: Add GNU cpio archive utility port 2022-06-25 12:01:19 +01:00
Liav A
1cd610072a Ports: Add lz4 compression utility 2022-06-25 11:59:42 +01:00
Liav A
cd115270fc Kernel/Graphics: Move GenericDisplayConnector code to a new sub-folder
In the same fashion like in the Linux kernel, we support pre-initialized
framebuffers that were set up by either the BIOS or the bootloader.
These framebuffers can be backed by any kind of video hardware, and are
not tied to VGA hardware at all. Therefore, this code should be in a
separate sub-folder in the Graphics subsystem to indicate this.
2022-06-25 11:32:09 +01:00
Tim Schumacher
5b86698bb8 Ports/qt6-qtbase: Add md4c as a dependency 2022-06-24 23:20:28 +01:00
Tim Schumacher
a50400072e Ports: Add a port of md4c 2022-06-24 23:20:28 +01:00
Ali Mohammad Pur
d338d2b59b Shell: Ignore SIGCHLD after a few unsuccessful attempts at handling it
As noted by the comment, a stray SIGCHLD can make the shell go into an
infinite loop, pretend the signal doesn't exist after trying 10 times in
5ms.
2022-06-24 22:53:16 +01:00
Xexxa
eb4ea45822 Base: Add Counting Rod Numerals to font Katica Regular 10
1D360–1D378 https://www.unicode.org/charts/PDF/U1D360.pdf
Co-authored-by: python-69 <102885151+python-69@users.noreply.github.com>
2022-06-24 22:50:13 +01:00
Xexxa
6cda017477 Base: Add Block Elements to font Katica Regular 10
2580–259F https://www.unicode.org/charts/PDF/U2580.pdf
Co-authored-by: python-69 <102885151+python-69@users.noreply.github.com>
2022-06-24 22:50:13 +01:00
Xexxa
f4c8c93119 Base: Add Buginese to font Katica Regular 10
1A00-1A1F https://www.unicode.org/charts/PDF/U1A00.pdf
Co-authored-by: python-69 <102885151+python-69@users.noreply.github.com>
2022-06-24 22:50:13 +01:00