Commit graph

1767 commits

Author SHA1 Message Date
Tom
75f61fe3d9 AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe
This makes most operations thread safe, especially so that they
can safely be used in the Kernel. This includes obtaining a strong
reference from a weak reference, which now requires an explicit
call to WeakPtr::strong_ref(). Another major change is that
Weakable::make_weak_ref() may require the explicit target type.
Previously we used reinterpret_cast in WeakPtr, assuming that it
can be properly converted. But WeakPtr does not necessarily have
the knowledge to be able to do this. Instead, we now ask the class
itself to deliver a WeakPtr to the type that we want.

Also, WeakLink is no longer specific to a target type. The reason
for this is that we want to be able to safely convert e.g. WeakPtr<T>
to WeakPtr<U>, and before this we just reinterpret_cast the internal
WeakLink<T> to WeakLink<U>, which is a bold assumption that it would
actually produce the correct code. Instead, WeakLink now operates
on just a raw pointer and we only make those constructors/operators
available if we can verify that it can be safely cast.

In order to guarantee thread safety, we now use the least significant
bit in the pointer for locking purposes. This also means that only
properly aligned pointers can be used.
2020-11-10 19:11:52 +01:00
asynts
3b3edbc4d2 AK: Rename new_out to out and new_warn to warn. 2020-11-09 16:21:29 +01:00
AnotherTest
e99c2261e3 Spreadsheet: Add support for copying ranges of cells to other cells
Now the entire range is copied to the area around the target cell,
translating the current cursor to the target.
2020-11-08 21:46:13 +01:00
AnotherTest
7878596532 Spreadsheet: Update the view when using the cell editor 2020-11-08 21:46:13 +01:00
AnotherTest
0e544b8afa Spreadsheet: Enable Drag&Drop and Copy/Paste
These currently only work on the current sheet, in the current
Spreadsheet instance, but they're still freakin' cool!
2020-11-03 16:47:56 +01:00
AnotherTest
821e875bc0 Spreadsheet: Serialise Positions to URLs and add Sheet::from_uri() 2020-11-03 16:47:56 +01:00
Brendan Coles
ed5469c1c2 Applications: Use pledge and unveil 2020-11-02 22:36:27 +01:00
Brendan Coles
5ed7ca3627 Applications: Use GUI::Icon::default_icon to set application icon 2020-11-02 21:06:17 +01:00
Brendan Coles
e8ff7c895b Applications: Use GUI::CommonActions for save and save as menu options 2020-11-02 13:14:58 +01:00
Brendan Coles
90a30f694d SoundPlayer: Optionally allow playback to loop indefinitely 2020-11-01 10:33:57 +01:00
Andreas Kling
39c9319b6d Terminal: Run clang-format 2020-10-31 19:54:23 +01:00
AnotherTest
1bd3a2d09f Spreadsheet: Add support for example views and hyperlinks in the docs
Now the functions can actually be demonstrated by small examples,
embedded right inside the documentation via:
spreadsheet://example/<page>#<example_name>

Also allows pages to link to each other via the same scheme:
spreadsheet://doc/<page>
2020-10-31 15:40:13 +01:00
Andreas Kling
982e066100 LibGfx: Move FontDatabase from LibGUI to LibGfx
Not sure why I put this into LibGUI in the first place.
2020-10-31 13:56:21 +01:00
Brendan Coles
e569f7fd1c Applications: Use application icons for dialog windows 2020-10-31 13:48:15 +01:00
Brendan Coles
15b68b4653 Spreadsheet: Add Help menu 2020-10-31 13:39:18 +01:00
Andreas Kling
aef56159a8 LibGUI: Add Widget focus policies
Every widget now has a GUI::FocusPolicy that determines how it can
receive focus:

- NoFocus: The widget is not focusable (default)
- TabFocus: The widget can be focused using the tab key.
- ClickFocus: The widget can be focused by clicking on it.
- StrongFocus: Both of the above.

For widgets that have a focus proxy, getting/setting the focus policy
will affect the proxy instead.
2020-10-30 17:03:28 +01:00
Andreas Kling
9d347352a1 LibGfx+LibGUI+Clients: Make fonts findable by their qualified name
The qualified name of a font is "<Family> <Size> <Weight>". You can
get the QN of a Font via the Font::qualified_name() API, and you can
get any system font by QN from the GUI::FontDatabase. :^)
2020-10-25 21:18:18 +01:00
Andreas Kling
260b52215c HexEditor: Use the system default fixed width font 2020-10-25 21:18:18 +01:00
asynts
1254cbbd0b AK: Eradicate calls to warn(). 2020-10-25 18:52:51 +01:00
Andreas Kling
80b77cec38 LibGfx+FontEditor+Fonts: Add family, size and weight metadata to fonts
This makes finding fonts from the same family much less difficult. :^)
2020-10-25 10:12:03 +01:00
Andreas Kling
688675e89b LibGUI: Make table view row height+padding font-size-relative
This makes tables look a lot nicer with different-sized fonts. :^)
2020-10-25 10:12:03 +01:00
asynts
88bca152c9 AK: Eradicate the uses of out(). 2020-10-24 12:56:25 +02:00
Andreas Kling
46c15276e9 LibWeb: Fix Document construction mishap in <template> element
Ref-counted objects must not be stack allocated. Make DOM::Document's
constructor private to avoid this issue. (I wish we could mark classes
as heap-only..)
2020-10-23 08:33:16 +02:00
Andreas Kling
c31cc8c060 FileManager: Ignore model updates during widget construction
We can't use current_view() before we've actually constructed the
subviews, so just ignore statusbar update requests before they get
a chance to call current_view().

This is not the most beautiful thing, and maybe we can think of a
nicer approach.
2020-10-22 18:52:54 +02:00
Andreas Kling
460d3e3969 FileManager: Update the error label overlay on back/forward navigation
Fixes #3817.
2020-10-22 18:27:28 +02:00
Andreas Kling
39a7358b51 FileManager: Set up the model error/complete callbacks earlier
We need to set these up before calling set_root_path, as that's where
the error callbacks would fire from.
2020-10-22 18:26:59 +02:00
Luke
e8a9e8aed5 LibWeb: Add namespace to Element 2020-10-22 15:24:42 +02:00
BenJilks
afd52e2576 PixelPaint: Tool properties panel
Each tool can have its own set of properties that can be modified
through a panel on the right side.

The tools I've added properties for are:

Pen:
	Thickness

Brush:
	Size
	Hardness

Spray:
	Thickness
	Density

Bucket:
	Threshold
2020-10-16 00:03:53 +02:00
Andreas Kling
1d96ecf148 Everywhere: Add missing <AK/TemporaryChange.h> includes
Don't rely on HashTable.h pulling this in.
2020-10-15 23:49:53 +02:00
Linus Groh
20907780bd FileManager: Only set ~/Desktop as model root path in desktop mode
Setting it as model root path in DirectoryView::setup_model() for
windowed mode as well would cause an issue with the following:

- "open ~/Desktop"
- "FileManager ~/Desktop"
- "Show in FileManager..." from Desktop context menu

When viewing the Desktop as the initial path it would be the same and
on_path_change wasn't called, leading to various widgets and window
properties not being updated.

Fixes #3772.
2020-10-15 23:49:34 +02:00
BenJilks
5f15fb17d9 PixelPaint: Basic brush tool
This patch adds a very basic implementation of the classic brush
tool. It features a wide brush with a falloff around the edges.
2020-10-14 20:36:40 +02:00
AnotherTest
93f4388e45 LibGfx+PixelPaint: Fix distortions in convolutions with size != 4 or 5 2020-10-12 20:04:48 +02:00
Tom
95434d70ed LibGfx: Allow specifying a separate source bitmap for Filter::apply
By allowing to specify a separate source bitmap when calling Filter::apply
the same filter can be applied to multiple areas, and also doesn't need
to use a temporary bitmap. This also enables us to apply the filter to
multiple regions properly, even if they are (almost) adjacent.

If no separate source bitmap is supplied then a temporary bitmap is still
necessary.
2020-10-12 20:04:48 +02:00
Tom
da8d87c297 LibGfx: Make Filter::Parameters more light-weight
By moving the Bitmap and Rect out of Filter::Parameters we can re-use
the parameters more efficiently, allowing the filter to be applied
to many bitmaps without having to re-create the filter every time.
2020-10-12 20:04:48 +02:00
Tom
8af02fc8b3 LibGfx: Move filters from PixelPaint into LibGfx
This allows re-using the same filters outside of PixelPaint.
2020-10-12 20:04:48 +02:00
Tom
f9700ffb41 PixelPaint: Move GUI logic and filter parameters out of filters 2020-10-12 20:04:48 +02:00
Peter Elliott
b82f2df4c8 Piano: Add UI support for different lengths of notes 2020-10-12 19:41:53 +02:00
Peter Elliott
27b990ec19 Piano: Add note names to RollWidget 2020-10-12 19:41:53 +02:00
Peter Elliott
01bff0141e Piano: Highlight pressed key in roll widget 2020-10-12 19:41:53 +02:00
Kesse Jones
31791945ab FileManager: Added menu to show dotfiles in directory context menu 2020-10-10 23:29:18 +02:00
Linus Groh
fcd263f17b FileManager: Fix file creation error message
s/String::format/String::formatted/ - the error message was not being
formatted properly.
2020-10-10 00:53:09 +02:00
Linus Groh
e7c53bee16 Spreadsheet: Fix rendering of documentation examples
s/String::format/String::formatted/ - the Markdown source was not being
formatted properly.
2020-10-10 00:53:09 +02:00
Linus Groh
870dd44ba9 Help: Replace InProcessWebView with OutOfProcessWebView 2020-10-08 23:20:52 +02:00
Linus Groh
f6af2d747e TextEditor: Replace InProcessWebView with OutOfProcessWebView 2020-10-08 23:20:52 +02:00
Lenny Maiorani
9eef5fc446 SinglyLinkedList: Remove unused includes
Several files include `AK/SinglyLinkedList.h` without using
it. Removing it to simplify.
2020-10-08 09:54:41 +02:00
asynts
9123920a19 Welcome: Use new format functions. 2020-10-06 20:29:26 +02:00
asynts
ff3552bb14 TextEditor: Use new format functions. 2020-10-06 20:29:26 +02:00
asynts
712e348fad Terminal: Use new format functions. 2020-10-06 20:29:26 +02:00
asynts
0dec600a2a SystemMonitor: Use new format functions. 2020-10-06 20:29:26 +02:00
asynts
f005548d56 Spreadsheet: Use new format functions.
In a few places I also simplified a few format strings:

    -outln("{} item{}", items, items.size() == 1 ? ' ' : 's');
    +outln("{} item(s)", items);

In my opinion this is more readable and in some places it incorrectly
wrote '0 item' which is "fixed" now. In other places the placeholder
space looked weird.
2020-10-06 15:28:39 +02:00