Commit Graph

3816 Commits

Author SHA1 Message Date
Sam Atkins
27adbd1792 HexEditor: Stop allocating a String for every character printed
When we have a single char, we can directly construct a StringView for
it instead, which doesn't require a String allocation.
2024-01-06 16:08:49 +00:00
Cubic Love
30ea7b27d4 PixelPaint: Add link to manpage
Add a link to the manpage in the Help menu.
2024-01-04 12:08:37 -07:00
Torstennator
82e85172e5 PixelPaint: Fix crash when started with path
This change fixes the initial tool selection when pixelpaint is started
with a path. Previously an already existing editor was expected when
the default tool was initially propagated - which was not the case if
pixelpaint was launched to directly load an existing image.
2024-01-02 17:14:38 +01:00
Timothy Flynn
d8fa226a8f Ladybird+LibWebView+WebContent: Make the screenshot IPCs async
These IPCs are different than other IPCs in that we can't just set up a
callback function to be invoked when WebContent sends us the screenshot
data. There are multiple places that would set that callback, and they
would step on each other's toes.

Instead, the screenshot APIs on ViewImplementation now return a Promise
which callers can interact with to receive the screenshot (or an error).
2024-01-01 10:11:45 +01:00
Andreas Kling
b6d4eea7ac LibJS: Never give back virtual memory once it belongs to a cell type
Instead of returning HeapBlock memory to the kernel (or a non-type
specific shared cache), we now keep a BlockAllocator per CellAllocator
and implement "deallocation" by basically informing the kernel that we
don't need the physical memory right now.

This is done with MADV_FREE or MADV_DONTNEED if available, but for other
platforms (including SerenityOS) we munmap and then re-mmap the memory
to achieve the same effect. It's definitely clunky, so I've added a
FIXME about implementing the madvise options on SerenityOS too.

The important outcome of this change is that GC types that use a
type-specific allocator become immune to use-after-free type confusion
attacks, since their virtual addresses will only ever be re-used for
the same exact type again and again.

Fixes #22274
2023-12-31 15:35:56 +01:00
Liav A
60a96b3786 Userland: Actually use the correct character map index from KeyEvent
Instead of using a scan code, which for scan code set 2 will not
represent the expected character mapping index, we could just use
another variable in the KeyEvent structure that correctly points to the
character index.

This change is mostly relevant to the KeyboardMapper application, and
also to the WindowServer code, as both handle KeyEvents and need to
use the character mapping index in various situations.
2023-12-29 16:40:59 +01:00
Lucas CHOLLET
97ded2dc61 FileManager: Conditionally display the "ICC profile:" line
If the "ICC Profile" group is shown, no need to include the related line
in the "Image" group.
2023-12-29 07:57:12 +00:00
Mr.UNIX
44d623d588 CrashReporter: Port CrashReporter to GML Compiler 2023-12-27 15:29:50 +01:00
tetektoza
2751f32a18 HexEditor: Move drawing cursor under a lambda and reuse it
This is a cleanup patch dones for paint event for HexEditor, moving
repeated chunks of code under a common lambda.
2023-12-27 09:22:09 +01:00
tetektoza
017dea2993 HexEditor: Don't initialize background/text colors twice
This is a cleanup patch, moves a chunk of repeated code to one place
instead of assigning variables with the same values twice in two
different places of code.
2023-12-27 09:22:09 +01:00
tetektoza
bd1d384cf6 HexEditor: Remove moving cursor outside bounds if selecting with mouse
Currently if users select last bytes in HexEditor with mouse in either
Hex or Text mode, they will be able to move cursor on the byte outside
bounds. If then they try to write something in either of those modes,
app will crash.

This patch moves the recently added "replace" cursor to always be on the
last byte of the selection instead of being on the byte after the last
selected byte.
2023-12-27 09:22:09 +01:00
tetektoza
c4c9971ed0 HexEditor: Change cursor type from caret to black box
This patch changes cursor type from caret to black box for both Hex and
Text modes, because right now the way how blinking caret looks like is
more closer to "insert" mode in similar editors, whereas the real
behavior of this cursor is more of a "replace" mode seen in similar
editors like GHex.
2023-12-27 09:22:09 +01:00
tetektoza
1ea675a9ec HexEditor: Remove blinking of the cursor 2023-12-27 09:22:09 +01:00
Mr.UNIX
467faee1b8 Calendar: Add a link to the Manual in Help Menu 2023-12-26 18:37:35 +01:00
Timothy Flynn
bacf3cede4 Ladybird+BrowserSettings: Load the NTP/home resource files with LibWeb 2023-12-24 14:09:23 +01:00
Shannon Booth
e2e7c4d574 Everywhere: Use to_number<T> instead of to_{int,uint,float,double}
In a bunch of cases, this actually ends up simplifying the code as
to_number will handle something such as:

```
Optional<I> opt;
if constexpr (IsSigned<I>)
    opt = view.to_int<I>();
else
    opt = view.to_uint<I>();
```

For us.

The main goal here however is to have a single generic number conversion
API between all of the String classes.
2023-12-23 20:41:07 +01:00
Ali Mohammad Pur
5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
Torstennator
b61e4e7cd9 PixelPaint: Repaint histogram data when the widget gets resized
This patch enables the histogram to redraw itself when it gets resized
without calculating the data again through the image.
2023-12-14 09:07:20 -07:00
Torstennator
c85c61571c PixelPaint: Make use of DynamicWidgetContainer
This patch adds the new DynamicWidgetContainer for the right panel
elements. This allows the user to collapse, expand or even detach
widgets to a separate window. The collapsed or expanded state is
persisted so that they are restored after application startup.
With this change it is possible to shrink the size of widgets to a
minimum in order to give more space to other currently important
widgets.
2023-12-14 09:07:20 -07:00
Torstennator
c74e2d04d1 PixelPaint: Fix crash on mouse moves
This pr fixes a problem where the application would crash if the mouse
was moved while the editor was still loading the image. With this
change tool related mouse move events are discarded as long as there is
no active tool.
2023-12-14 09:04:31 -07:00
Torstennator
d462d6280a PixelPaint: Fix initial tool selection
This changes how the initial tool is beeing set on application startup.
With this change the initial tool is set the same way as when the tool
is changed via the frontend. Thus it also updates the tool properties
window which wasn't done before leaving the properties empty as long
the tool was changed for the first time.
2023-12-14 09:04:31 -07:00
Timothy Flynn
451df70275 Ladybird+LibWebView: Ensure existing Inspector widgets inspect the page
If the Inspector widget already exists, be sure to inspect the page when
it is re-opened. However, this should be a no-op if the page was already
inspected (as any existing Inspector will be reset if a new page load
began).

Note this is not an issue in the AppKit chrome.
2023-12-10 16:45:08 +01:00
Kyle Pereira
8191f2b47a LibPDF: Add parameter for background color of render 2023-12-10 16:44:24 +01:00
Bastiaan van der Plaat
466153e680 Ladybird+LibWeb: Add basic select element support 2023-12-09 22:06:20 +01:00
tetektoza
8118ea764f NetworkSettings: Port NetworkSettings to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza
1e11116d65 VideoPlayer: Port VideoPlayer to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza
e26548989a GamesSettings: Port GamesSettings to GML compilation
Co-Authored-By: Tim Schumacher <timschumi@gmx.de>
2023-12-08 01:06:09 +01:00
tetektoza
935aaab757 HexEditor: Port HexEditor to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza
9deaa74ad6 LibGUI: Split HorizontalSlider to separate header
This patch splits HorizontalSlider to separate header so it can be used
as a component in .gml files with new GML compiler.
2023-12-08 01:06:09 +01:00
Timothy Flynn
7e974f530d Ladybird+LibWebView: Add an Inspector action to clone a DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
d5d6ff8bf1 Ladybird+LibWebView: Add an Inspector action to insert a child DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
71fdf0860e Ladybird+LibWebView: Add an Inspector action to screenshot a DOM node 2023-12-07 10:53:12 +01:00
Timothy Flynn
e3df035c5d Ladybird+LibWebView: Add an Inspector action to copy a node's HTML/text 2023-12-07 10:53:12 +01:00
Timothy Flynn
51a0673b5c Ladybird+LibWebView: Add an Inspector action to copy an attribute value 2023-12-07 10:53:12 +01:00
Timothy Flynn
8162dc5ee6 LibWeb+LibWebView+WebContent: Separate tag/attribute in Inspector menu
It was a bit short-sighted to combine the tag and attribute names into
one string when the Inspector requests a context menu. We will want both
values for some context menu actions. Send both names, as well as the
attribute value, when requesting the context menu.
2023-12-07 10:53:12 +01:00
Timothy Flynn
5006330bc6 Browser: Add an Inspector context menu to edit the DOM 2023-12-06 13:04:50 +01:00
Sam Atkins
53f9be4ea8 Browser: Implement "Copy Email/Phone" menu item for links 2023-12-05 11:36:22 -05:00
Sam Atkins
8d987aa9d6 Browser: Make "Copy URL" action's shortcut more consistent
"Copy &URL" matches what we do in LadybirdQt, and "Copy Image &URL".
2023-12-05 11:36:22 -05:00
Sam Atkins
db9a507f7f TextEditor: Give the --preview-mode argument a short version 2023-12-05 09:20:32 -05:00
Timothy Flynn
05c8d5ba57 Base+Ladybird: Move Ladybird-related HTML files to their own folder
Pages like the new tab page, error page, etc. all belong solely to
Ladybird, but are scattered across a couple of subfolders in Base. This
moves them all to Base/res/ladybird.
2023-12-04 19:46:35 -05:00
Andreas Kling
8b7d27b349 LibJS+LibWeb: More bringing module loading closer to spec
In particular, this patch removes three host hooks on JS::VM in favor
of the new JS-side module loading stuff.
2023-12-03 20:46:55 +01:00
Timothy Flynn
582f19ba24 Ladybird: Allow opening the Inspector with both ctrl+shift+I and F12
Ladybird on Serenity currently only uses F12, and on other platforms
only uses ctrl+shift+I. Most browsers support both hotkeys, so let's do
the same for consistency.

Note that the AppKit chrome cannot support both shortcuts. macOS does
not allow setting multiple "key equivalent" strings on an action. There
are some questionable hacks we could do to support this eventually, but
for now, just ctrl+shift+I is supported on macOS.
2023-12-02 22:54:06 +01:00
Timothy Flynn
b385a44f6f Browser: Remove the standalone JavaScript console 2023-12-02 10:34:22 +01:00
Timothy Flynn
0037fdaf11 Browser: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Andreas Kling
3dc5f467a8 LibJS: Always allocate ExecutionContext objects on the malloc heap
Instead of allocating these in a mixture of ways, we now always put
them on the malloc heap, and keep an intrusive linked list of them
that we can iterate for GC marking purposes.
2023-11-29 09:48:18 +01:00
Shannon Booth
d1ed04a6cb FontEditor: Use String.to_uppercase
Remove the last user of Unicode::to_unicode_uppercase_full
2023-11-28 17:15:27 -05:00
Dan Klishch
80d1c93edf AK+Applications: Return value from JsonObject::get_double more often
Previously, we were returning an empty optional if key contained a
numerical value which was not stored as double. Stop doing that and
rename the method to signify the change in the behavior.

Apparently, this fixes bug in an InspectorWidget in Ladybird on
Serenity: it showed 0 for element's boxes with integer sizes.
2023-11-25 11:02:17 +01:00
Timothy Flynn
c03b69e664 LibWebView+Ladybird: Remove now-unused WebView TreeModel
This was used to provided base functionality for model-based chromes for
viewing the DOM and accessibility trees. All chromes now use the WebView
inspector model for those trees, thus this class is unused.
2023-11-24 08:37:19 +01:00
Timothy Flynn
39e32e80cd Browser: Port the Inspector to the WebView InspectorClient 2023-11-24 08:37:19 +01:00
Timothy Flynn
30e96749de LibWebView+WebContent: Remove unused did_get_dom_node_properties IPC
This is never invoked. The functionality it provides is implemented by
the return value of the `inspect_dom_node` IPC.
2023-11-24 08:37:19 +01:00
Lachlan Jowett
4f5824cbd0 DisplaySettings: Desktop crash when non-image file type is used
If the user selects an non-image file
as their background, then at next
startup the desktop crashes.
2023-11-18 11:21:32 +00:00
sSt3lla
6b72fc0924 Calculator: Convert DeprecatedString to String 2023-11-17 17:17:00 +00:00
Kemal Zebari
6b5a0100d9 Browser: Move BookmarksBarWidget::PerformEditOn to anon namespace
Since none of `BookmarksBarWidget`'s methods use this enum class any
longer, let's just move it to the anonymous namespace so that
`BookmarkEditor` can still make use of it.
2023-11-14 15:38:09 -07:00
Timothy Flynn
9421ffd4ec Browser: Implement pasting Web data to the clipboard 2023-11-11 08:54:37 +01:00
Sönke Holz
6824d2a788 Userland+Tests: Add initial riscv64 support 2023-11-10 10:30:08 -07:00
Shane Murphy
d2fbc15f5d Terminal: Fix zoom when font size is missing
If Terminal was configured with a typeface that does not have a font
for any given size, the zoom in and out button in the menu bar would
not work because font lookup was exact.

Use Font::AllowInexactMatch::Larger when zooming in and
Font::AllowInexactMatch::Smaller when zooming out to allow finding the
closest font size in the requested direction.
2023-11-09 16:09:18 +01:00
Tim Schumacher
a2f60911fe AK: Rename GenericTraits to DefaultTraits
This feels like a more fitting name for something that provides the
default values for Traits.
2023-11-09 10:05:51 -05:00
Andreas Kling
b1b2ca1485 LibJS: Add basic monomorphic caching for PutById property access
This patch makes it possible for JS::Object::internal_set() to populate
a CacheablePropertyMetadata, and uses this to implement a basic
monomorphic cache for the most common form of property write access.
2023-11-09 16:02:14 +01:00
Strawby
df6668ff5b Calculator: Add Manual link to the help-context-menu 2023-11-08 16:26:23 +00:00
Strawby
056070ff85 3DFileViewer: Add Manual link to the help-context-menu 2023-11-08 16:26:23 +00:00
Tim Ledbetter
e510d81567 Assistant: Prioritize results which exactly match a query 2023-11-08 09:52:24 +01:00
Sam Atkins
39579436c1 GamesSettings: Make chess preview widget resilient to missing images
Previously we would give up on loading the piece images if one fails.
That was awkward because 2 out of 3 places where `set_piece_set_name()`
is called can't propagate errors, so we'd just crash.

Instead, let's skip any images that fail to load, and then when painting
the preview, skip any missing bitmaps and show a warning message that
some are missing.
2023-11-07 19:44:11 +01:00
Sam Atkins
4f99f1750e GamesSettings: Pass a String to ChessGamePreview::set_piece_set_name() 2023-11-07 19:44:11 +01:00
Timothy Flynn
818471b7a7 BrowserSettings+Ladybird: Convert home / new tab page to resource URIs 2023-11-06 09:39:59 +01:00
Timothy Flynn
30fac0abb9 Browser: Convert the inspector widget to the WebView model class
This creates a LibGUI-specific wrapper around the WebView model classes
and uses it for the inspector widget tree / table view models.
2023-11-05 09:11:23 +01:00
Timothy Flynn
0aa375441a Browser: Mark the DOM tree as loaded before selecting any DOM node
The first thing that `set_selection` does is return early if the DOM-
loaded flag is false. Set it to true so it can actually do something.
This fixes inspecting a DOM node from the context menu.
2023-11-05 09:11:23 +01:00
Simon Wanner
93908fcbcb LibJS+Embedders: Unify stack trace format for uncaught errors
Previously these handlers duplicated code and used formats that
were different from the one Error.prototype.stack uses.

Now they use the same Error::stack_string function, which accepts
a new parameter for compacting stack traces with repeating frames.
2023-11-02 07:37:41 +01:00
Timothy Flynn
99216b2a87 ClockSettings: Use a Vector as the time zone model's container type
The time zones were stored as a static Span until commit 0bc401a1d6, and
are now stored in a Vector. By continuing to tell the ItemListModel that
the container is a Span, we create a temporary Span in its constructor,
which the model tries to hold a constant reference to. Use the default
Vector container type now instead to prevent creating such temporaries.
2023-10-31 15:21:34 +01:00
Andrew Kaster
1567332e34 Userland+Tests: Remove uses of direct file loading for BitmapFont
Route them through Core::Resource APIs instead.
2023-10-29 13:12:28 -06:00
Andrew Kaster
d8ab9ed87c LibGfx+Userland: Remove dependency on GUI::TabWidget from StylePainter
Move TabPosition into its own file, and using it into the global
namespace the same way we do for Gfx::Orientation. This unbreaks the gn
build, and out of tree builds.
2023-10-27 16:51:03 -06:00
Bastiaan van der Plaat
5a7f43ad38 Maps: Add favorites panel with favorite places management 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat
f35791343e Maps: Use name + coordinates in search marker tooltip 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat
54ec744398 Maps: Add custom context menu actions option to MapWidget 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat
f18c6eb0ea Maps: Make Maps a recommended CMake component instead of required 2023-10-26 17:23:54 -06:00
lanmonster
e5c9d7ce26 Calendar: Add inputs to change event end date/time 2023-10-26 11:10:23 +02:00
lanmonster
a7c3d39bab Calendar: Add end date/time to events 2023-10-26 11:10:23 +02:00
lanmonster
4984faa108 Calendar: Rename m_date_time to m_start_date_time
This is in preparation to add m_end_date_time
2023-10-26 11:10:23 +02:00
lanmonster
a4fcec6815 Calendar: Rename input variables
These were named foo_combo, when in reality there more spinboxes than
comboboxes. Change to foo_input to accomodate whatever type of input
they may be.
2023-10-26 11:10:23 +02:00
lanmonster
edee914093 Calendar: Update day range when the month changes
Previously it was possible to create an event on Feb 31(!)
2023-10-26 11:10:23 +02:00
lanmonster
97cc5b2da4 Calendar: Use GML for AddEventDialog 2023-10-26 11:10:23 +02:00
Timothy Flynn
ae6e2e682e Browser: Add a context menu item to search for the selected text 2023-10-24 07:28:30 +02:00
Timothy Flynn
00826b2512 BrowserSettings: Use index column when casting to a search engine field
Regressed in e8d921820a.

I must've run an old version of the Serenity image when I tested this
after a fixup.
2023-10-23 13:36:48 -04:00
Timothy Flynn
e8d921820a Browser+BrowserSettings: Migrate to LibWebView for search engines 2023-10-23 12:12:36 -04:00
Bastiaan van der Plaat
5870a1a9a1 AK: Remove rarely used ExtraMathConstants.h 2023-10-23 12:04:51 +01:00
Timothy Flynn
192aa0838a Browser: Use LibWebView to decide what parts of a URL to highlight 2023-10-20 07:18:54 +02:00
Timothy Flynn
55092dd164 LibGUI+Browser: Move GUI::UrlBox to the Browser application
Browser is the only user of this component. Move it to allow making use
of LibWebView for URL highlighting.
2023-10-20 07:18:54 +02:00
Jelle Raaijmakers
126adfc392 3DFileViewer: Set timer to 15ms instead of 20ms
This approaches 60FPS and feels a bit smoother.
2023-10-15 12:14:07 +02:00
Jelle Raaijmakers
77c16d2ae7 3DFileViewer: Show correct framerate
We were confusing the time spent rendering with the time spent rendering
_and_ waiting for the next frame, which is important since we render
frames on a timer.
2023-10-15 12:14:07 +02:00
Cubic Love
f2b7224d93 GamesSettings+LibCards: Make 'Red' the default card back
The red back is a more suitable default as it's a traditional vanilla
design and red is one of Serenity's brand colors.
2023-10-15 07:25:20 +02:00
Timothy Flynn
d2c7e1ea7d Browser: Sanitize user-provided URLs with LibWebView 2023-10-13 13:37:11 -04:00
Tim Ledbetter
54a28afc13 LibIMAP: Stop parsing immediately on error
This makes the parser more resilient to invalid IMAP messages.

Usages of `Optional` have also been removed where the empty case is
equivalent to an empty object.
2023-10-13 11:12:18 -06:00
Ali Mohammad Pur
aeee98b3a1 AK+Everywhere: Remove the null state of DeprecatedString
This commit removes DeprecatedString's "null" state, and replaces all
its users with one of the following:
- A normal, empty DeprecatedString
- Optional<DeprecatedString>

Note that null states of DeprecatedFlyString/StringView/etc are *not*
affected by this commit. However, DeprecatedString::empty() is now
considered equal to a null StringView.
2023-10-13 18:33:21 +03:30
Sam Atkins
ff8969bd5f GamesSettings: Center cards vertically after recent size change 2023-10-11 10:56:43 +01:00
Sam Atkins
eff25f9116 LibCards: Stop calling the card back image a "background" image
It's not a background, past me!
2023-10-11 10:56:43 +01:00
Sam Atkins
d8e8b300c8 GamesSettings+LibCards: Add setting for card-front image sets 2023-10-11 10:56:43 +01:00
Sam Atkins
18dfc61280 LibGfx: Expose BitmapFont glyph data as Spans instead of raw pointers 2023-10-10 14:36:25 +02:00
Sam Atkins
a1c24ef3ad LibGfx: Remove infallible BitmapFont::create() factory function
This was only used in TestFontHandling. So, let's remove it, and use
the "create" name for the fallible one.
2023-10-10 14:36:25 +02:00
Andreas Kling
65717e3b75 LibJS: Inline fast case for Value::to_{boolean,number,numeric,primitive}
These functions all have a very common case that can be dealt with a
very simple inline check, often avoiding the need to call an out-of-line
function. This patch moves the common case to inline functions in a new
ValueInlines.h header (necessary due to header dependency issues..)

8% speed-up on the entire Kraken benchmark :^)
2023-10-07 07:13:52 +02:00
Karol Kosek
03a54a519a Userland: Port remaining calls to Widget::set_tooltip_deprecated()
Replaces `set_tooltip_deprecated(string);` with
`set_tooltip(MUST(String::from_deprecated_string(string)));`
purely to get rid of the deprecated function in the following commit.
2023-10-06 08:20:11 +02:00
Karol Kosek
ed3e729d4e Userland: Use nondeprecated set_tooltip for static and formatted strings 2023-10-06 08:20:11 +02:00
Karol Kosek
46a97844c7 Applications: Stop calling set_tooltip_deprecated when we do have String 2023-10-06 08:20:11 +02:00
Karol Kosek
9c923f20f4 Spreadsheet: Make cell metadata hint return String 2023-10-06 08:20:11 +02:00
Karol Kosek
4836d33ae4 Assistant: Port tooltips to String 2023-10-06 08:20:11 +02:00
Karol Kosek
3944c39b3a LibGUI: Port tooltip in Breadcrumbbar to String 2023-10-06 08:20:11 +02:00
Karol Kosek
a3ddba4191 Userland: Port GUI::Application::show_tooltip() to String
This most importantly gets rid of a chain of "String to DeprecatedString
to String" transformations when setting a tooltip from GUI::Widget's
set_tooltip function.
2023-10-06 08:20:11 +02:00
Gurkirat Singh
f51e8e785c Browser: Treat absolute path as local file 2023-10-06 08:12:41 +02:00
Timothy Flynn
0bc401a1d6 LibTimeZone+Userland: Include Link entries when returning all time zones
We currently only return primary time zones, i.e. time zones that are
not a Link. LibJS will require knowledge of Link entries, and whether
each entry is or is not a Link.
2023-10-05 17:01:02 +02:00
Jelle Raaijmakers
3c02e3ba09 Maps: Pad grid size to prevent missing tiles
Previously, we would divide the widget width and height by the tile size
and round up, which did not result in enough tiles to cover the entire
widget. Although this calculation is correct if you starting drawing
tiles in the top left corner, we have an additional offset to account
for.

Now, we take the number of tiles that fit in the widget completely and
pad it with 2 tiles to account for the partial left/right and top/bottom
sides. An additional tile is added to account for the iterator
translating by width / 2, which rounds down again.

The resulting tile rects are always intersected with the widget
dimensions, so even if we're generating more tile coordinates than
strictly necessary, we're not performing the actual download or draw
operations.
2023-10-03 20:25:09 +02:00
Jelle Raaijmakers
eb4dd7f896 Maps: Fix spiraling tile iterator end
The `operator++` of the spiraling tile iterator was repeating the first
coordinates (`0, 0`) instead of moving to the next tile on the first
iteration. Swapping the move and check ensures we get to the end of the
iterator, fixing gray tiles that would sometimes pop up in the lower
right.

Since we never return from `operator++` without setting a valid
position, we can drop `current_x` and `current_y` and just use the
`Gfx::Point<T>` directly.
2023-10-03 20:25:09 +02:00
Jelle Raaijmakers
092bb76cd6 Maps: Use bilinear blending for downscaled tiles
Since we divide the width and height of the downscaled tiles by 2,
bilinear blending is identical to box sampling and should be preferred
since it's the simpler one of the two algorithms.
2023-10-03 20:25:09 +02:00
Tim Ledbetter
eaa6304aab Userland: Return empty if ImageDecoder client receives an invalid frame
This simplifies error checking for all the users of the ImageDecoder
client.
2023-10-03 08:33:53 +02:00
Kemal Zebari
18124a5611 SpaceAnalyzer: Port to GML compiler 2023-10-02 21:28:40 +02:00
Tim Ledbetter
c087ba24b9 Assistant: Avoid an unnecessary copy of the results list 2023-10-01 14:34:28 +02:00
Tim Ledbetter
55f4d468ad Assistant: Remember currently selected result when updating results
This fixes an issue where the selected result index would be reset to
0 when the file cache finished building and the results list updated.
2023-10-01 14:34:28 +02:00
kleines Filmröllchen
614ff9c46e Maps: Load tiles starting from center
The information the user is most interested in is usually in the center,
so we should start loading tiles from the center and move outwards.
Since tiles are loaded in draw order, simply drawing them in this order
achieves the desired effect. The current center-outwards loading
algorithm is a basic spiral algorithm, but others may be evaluated
later.
2023-09-30 11:11:05 +02:00
Karol Kosek
e75d694974 Userland: Compare event MIME type list with a StringView
The following commit will port MIME types to String. Traits<String>
- used in Vector::contains_slow - can't compare String type with char*,
so we need to use StringView instead.
2023-09-29 14:40:21 +01:00
Karol Kosek
2f35348104 Userland: Store MIME keys as String in Core::MimeData 2023-09-29 14:40:21 +01:00
Karol Kosek
4f638d3af2 Userland: Take StringView in MimeData::data() and has_{format,text,urls} 2023-09-29 14:40:21 +01:00
circl
3e1a154440 Browser: Add support for color pickers 2023-09-27 12:16:41 +01:00
kleines Filmröllchen
062e0db46c LibCore: Make MappedFile OwnPtr-based
Since it will become a stream in a little bit, it should behave like all
non-trivial stream classes, who are not primarily intended to have
shared ownership to make closing behavior more predictable. Across all
uses of MappedFile, there is only one use case of shared mapped files in
LibVideo, which now uses the thin SharedMappedFile wrapper.
2023-09-27 03:22:56 +02:00
Cubic Love
4c64c0b61e Base+Maps: Add manpage for Maps
Also, list Maps in Applications.md and add a link to the manpage in
Map's Help menu.
2023-09-25 16:20:20 +01:00
Tim Ledbetter
f34b1c7a7e PixelPaint: Make tool properties widget construction non-fallible
`Tool::get_properties_widget()` now also returns a NNRP to a widget
rather than a raw pointer.
2023-09-25 10:58:31 +02:00
Tim Ledbetter
5df88dab07 FileManager: Make PropertiesWindow::make_button() non-fallible 2023-09-25 10:58:31 +02:00
Tim Ledbetter
b4e134cb52 Userland: Use non-fallible EventReceiver::add() where possible 2023-09-25 10:58:31 +02:00
Bastiaan van der Plaat
deb7ecfbe9 Maps: Add search panel 2023-09-24 20:05:33 -06:00
Bastiaan van der Plaat
2c2a1da306 Maps: Fix map rendering clipping issue when not full window size 2023-09-24 20:05:33 -06:00
Bastiaan van der Plaat
2bdd39f198 Maps: Add LatLngBounds struct 2023-09-24 20:05:33 -06:00
Bastiaan van der Plaat
5d37e1c220 Userland: Remember window state of productivity / editor applications 2023-09-24 20:00:00 -06:00
Tim Ledbetter
3aa49f268c Userland: Make Window::set_main_widget() non-fallible 2023-09-21 10:20:23 +02:00
Bastiaan van der Plaat
aed25991e6 Maps: Add MapsSettings with multiple tile providers options 2023-09-18 12:46:41 -06:00
Bastiaan van der Plaat
264782557e Maps: Fix bug when opening attribution url by adding launch unveil 2023-09-18 12:46:41 -06:00
Bastiaan van der Plaat
e3cd789ea8 Maps: Add context menu to the map widget 2023-09-18 11:12:04 -06:00
Tim Ledbetter
a6f6a1afd2 Userland: Prefer non-fallible construction for LibGUI objects 2023-09-18 18:00:45 +02:00
Tim Ledbetter
0d7b13edac Userland: Make GUI::Window construction non-fallible 2023-09-17 16:47:28 -06:00
Aliaksandr Kalenik
3c675e3f25 Userland+Ladybird: Always specify url to be about:srcdoc in load_html()
After moving to navigables, we started reusing the code that populates
session history entries with the srcdoc attribute value from iframes
in `Page::load_html()` for loading HTML.

This change addresses a crash in `determine_the_origin` which occurred
because this method expected the URL to be `about:srcdoc` if we also
provided HTML content (previously, it was the URL passed along with the
HTML content into `load_html()`).
2023-09-17 21:08:59 +02:00
Tim Ledbetter
1beadba0bb 3DFileViewer: Remove DeprecatedString usage in object loader
This change also improves error handling if the given .obj file
contains malformed floating point numbers.
2023-09-16 11:07:44 +02:00
Tim Ledbetter
ffda0785c0 Applications: Make creation of tabs non-fallible 2023-09-16 11:06:50 +02:00
Tim Ledbetter
ccab5ddf9b LibGUI+Applications: Use String in make_about_action() 2023-09-16 11:05:49 +02:00
Tim Ledbetter
c74f7e5f2a Userland: Don't use String::from_utf8() for literal strings 2023-09-15 08:44:52 +02:00
implicitfield
63d09f6daf Browser+Ladybird: Let the list of user agent strings be shared 2023-09-13 19:33:07 -04:00
Bastiaan van der Plaat
d63fb8fa61 Maps: Add show SerenityOS users feature 2023-09-13 21:41:37 +02:00
Bastiaan van der Plaat
dfb54083ee Maps: Add markers to map widget 2023-09-13 21:41:37 +02:00
Bastiaan van der Plaat
599a37aa0c Maps: Add panels to map widget 2023-09-13 21:41:37 +02:00
Bastiaan van der Plaat
048e8d7744 Maps: Add toolbar and frame border to map widget 2023-09-13 21:41:37 +02:00
Bastiaan van der Plaat
b5f91e3365 Maps: Remember last window position and size 2023-09-13 21:41:37 +02:00
Jelle Raaijmakers
ec416563a8 Maps: Zoom on doubleclick 2023-09-10 22:45:42 +02:00
Jelle Raaijmakers
0f330a4dcf Maps: Scale cached tiles from lower and higher zoom levels
When zooming in or out, if a tile is not yet cached, Maps now also
checks the lower and higher zoom levels for cached tiles and composites
a preview tile that is shown until the actual tile is loaded in.
2023-09-10 22:45:42 +02:00
Jelle Raaijmakers
cf898f08ab Maps: Limit parallel downloading of tiles
Previously we would bombard RequestServer with as many requests as it
would take, but when frantically zooming in and out, we would run out of
fd's causing the Maps application to hang.

This implements a tile download queue and limits the amount of parallel
downloads to 8. This fixes the hangs accompanied by this debug console
message:

    Peer endpoint error: recvfd: Too many open files (errno=24)

It does not fix other sporadic hangs caused by requests that are never
finished, however.
2023-09-10 22:45:42 +02:00
Bastiaan van der Plaat
494a8cb816 AK: Add to_radians and to_degrees math functions 2023-09-10 08:38:29 +01:00
Karol Kosek
f789d26e37 LibIMAP+Mail: Rename MultiPartBody's mime_type to multipart_subtype 2023-09-09 11:19:37 -06:00