Commit graph

15414 commits

Author SHA1 Message Date
Andreas Kling
7841528cd4 LibCore: Remove Core::Object::is_widget() in favor of RTTI 2021-01-01 16:08:49 +01:00
Andreas Kling
42179715c3 LibCore: Remove some hand-rolled type information from Core::Object
Both is_action() and is_window() can be answered by RTTI.
2021-01-01 16:08:49 +01:00
Andreas Kling
32fd59b471 LibGUI: Remove some hand-rolled type information from Widget 2021-01-01 16:08:49 +01:00
Andreas Kling
167906d02b PixelPaint: Remove hand-rolled type information in favor of RTTI 2021-01-01 16:08:49 +01:00
Jesse Buhagiar
ef5e9af6d3 DisplaySettings: Remove root_widget() from DisplaySettings
This fixes a weird dependency graph in DisplaySettings. The widget itself
(which is described in `gml` now), no longer contains `root_widget()`.

The widget itself has been moved into a tabbed pane, to get it ready
to add some more features and bring it more up to date with the current
UI code.
2021-01-01 15:55:08 +01:00
Andreas Kling
865f524d5b AK+LibGUI+LibWeb: Remove AK::TypeTraits in favor of RTTI-based helpers
Now that we have RTTI in userspace, we can do away with all this manual
hackery and use dynamic_cast.

We keep the is<T> and downcast<T> helpers since they still provide good
readability improvements. Note that unlike dynamic_cast<T>, downcast<T>
does not fail in a recoverable way, but will assert if the object being
casted is not a T.
2021-01-01 15:33:30 +01:00
Andreas Kling
7c3b6b10e4 Kernel: Remove the limited use of AK::TypeTraits we had in the kernel
This was only used for VMObject and we can do without it there. This is
preparation for migrating to dynamic_cast-based helpers in userspace.
2021-01-01 15:32:44 +01:00
Linus Groh
aa92adeedf LibJS: Fix email in TypedArray{Constructor,Prototype} copyright headers 2021-01-01 15:02:58 +01:00
Andrew Kaster
347bf6459d Applications+LibGUI: Convert all GML consumers to use the LibCore finder
Remove Widget::find_child_by_name and Widget::find_descendant_by_name,
and convert all users to using the type-safer version in Core::Object.
2021-01-01 14:45:09 +01:00
Andrew Kaster
5b03a0867f LibCore: Add typed find_child and find_descendant helpers to Object
These look a lot like the parallel functionality in GUI::Widget :).
These use dynamic_cast now, to make use of that RTTI we just added.
2021-01-01 14:45:09 +01:00
Andrew Kaster
350d4d3543 Meta: Enable RTTI for Userspace programs
RTTI is still disabled for the Kernel, and for the Dynamic Loader. This
allows for much less awkward navigation of class heirarchies in LibCore,
LibGUI, LibWeb, and LibJS (eventually). Measured RootFS size increase
was < 1%, and libgui.so binary size was ~3.3%. The small binary size
increase here seems worth it :^)
2021-01-01 14:45:09 +01:00
Brian Gianforcaro
43908db594 CMake: Add public cmake option to document BUILD_LAGOM
- Making this an option makes this option visible to users and tooling.
2021-01-01 14:37:04 +01:00
Brian Gianforcaro
40f671ac67 CMake: Add public cmake option to document ENABLE_ALL_THE_DEBUG_MACROS
- Making this an option makes this option visible to users and tooling.
- Rename `ALL_THE_DEBUG_MACROS` -> `ENABLE_ALL_THE_DEBUG_MACROS`.
2021-01-01 14:37:04 +01:00
Brian Gianforcaro
ab6ee9f7b2 CMake: Remove some trailing whitespace from a few CMakeLists.txt files 2021-01-01 14:37:04 +01:00
Brian Gianforcaro
6d67c4cafc CMake: Consolidate all options to the root of the project 2021-01-01 14:37:04 +01:00
Brendan Coles
74a65cffbd LibELF: validate_program_headers: Validate p_memsz and p_align 2021-01-01 14:34:25 +01:00
AnotherTest
887a62582d ProtocolServer: Use an empty Optional<IPC::File> to pass along "no fd"
Passing `-1` wouldn't work, as these are passed to `sendfd()'.
Fixes #4706.
2021-01-01 14:26:43 +01:00
Brendan Coles
f2973875e3 Base: Add Coffee theme 2021-01-01 13:10:54 +01:00
Andreas Kling
fc75421d50 Terminal: Tweak "Find" menu item -> "Find..."
The ellipsis (...) in a menu item traditionally means that the action
will require more input before executing. In this case, you need to
provide a search string. :^)
2021-01-01 02:19:45 +01:00
Andreas Kling
39efb3df18 LibGUI: Hide unnecessary scrollbars in MultiView
This removes pointless scrollbars in FilePicker which looks nice.
2021-01-01 02:12:39 +01:00
Andreas Kling
3eba01a02d LibGUI: Simplify setup code in GUI::MultiView
Use for_each_view_implementation() to avoid duplicating the setup code
for each subview.
2021-01-01 02:12:39 +01:00
Andreas Kling
71663a9431 FileManager: Hide unnecessary scrollbars in DirectoryView 2021-01-01 02:12:39 +01:00
Andrew Kaster
a3a9016701 DynamicLoader: Tell the linker to not add a PT_INTERP header
Use the GNU LD option --no-dynamic-linker. This allows uncommenting some
code in the Kernel that gets upset if your ELF interpreter has its own
interpreter.
2021-01-01 02:12:28 +01:00
Andreas Kling
4ea4cd5ee3 FileManager: Defer setting FileSystemModel root path in DirectoryView
Otherwise we always load the root directory on startup before switching
to whatever directory we actually wanted to open.
2021-01-01 01:55:30 +01:00
Andreas Kling
950a736127 Base: Add a desktop shortcut to the root directory 2021-01-01 01:48:20 +01:00
Andreas Kling
e82195ed1d Base: Add 32x32 variant of the hard-disk icon 2021-01-01 01:48:07 +01:00
Andreas Kling
78fbfd7795 Meta: Update project copyright dates (2018-2021) :^) 2021-01-01 01:14:16 +01:00
Andreas Kling
af7800d947 WindowServer: Flash modal window when clicking on window blocked by it
This makes window modality a bit more discoverable by indicating to the
user that the modal window must be closed before mouse interaction is
possible in the clicked window.
2021-01-01 01:10:53 +01:00
Andreas Kling
2e8db6560f LibGUI: Transfer focus when checking exclusive button programmatically
When calling set_checked(true) on an exclusive button, we will now
transfer focus to the newly checked button if one of its now-unchecked
siblings had focus before.

This makes windows that place initial focus somewhere in a group of
radio buttons look nicer when they show up, since focus will be on
whichever radio button was pre-checked, which may not be the first one
in the group.
2021-01-01 00:40:12 +01:00
Andreas Kling
5e19e72a6a LibGUI: Simplify RadioButton by using AbstractButton exclusive mode
Making an AbstractButton exclusive means that we enforce that only one
of the exclusive buttons within the same parent widget can be checked
at a time.

RadioButton was doing exactly the same thing, except in a custom way.
So just remove the custom code and make it exclusive. :^)
2021-01-01 00:33:44 +01:00
Andreas Kling
f0482a4cab Terminal: Make the settings window modal 2021-01-01 00:08:32 +01:00
Stephan Unverwerth
bb27b212de LibGfx: Introduce provisional font interface
Old font functionality has been moved into BitmapFont
and an abstract Font interface has been introduced to
faciliate further development of TTF font integration.
2020-12-31 23:40:27 +01:00
Andreas Kling
ac50bc79e4 Terminal: Move the settings window to GML :^) 2020-12-31 23:38:39 +01:00
Andreas Kling
f330dc3886 LibGUI: Add a bunch of missing widget registrations 2020-12-31 23:32:13 +01:00
Andreas Kling
87ad68c75b Meta: Use a raw string delimiter in text-to-cpp-string.sh
Otherwise we can't have the sequence ')"' in GML :^)
2020-12-31 23:31:22 +01:00
Tom
a4b3eb6b2d LibWeb: Clear circular download reference when download finished 2020-12-31 22:15:00 +01:00
Andrew Kaster
084c296362 Piano: Quit the audio thread by checking Core::EventLoop for exit
The infinite loop here doesn't really work at all for an application
process that expects to be able to exit. Check against
Core::EventLoop::current() to see if it's time to
exit, and return 0 from the thread function if so.

The thread will be joined in its destructor, which doesn't assert
anymore now that Thread is a jthread.
2020-12-31 21:59:20 +01:00
Andrew Kaster
06865c78c7 LibAudio: Make it so that an unused WavWriter is destructible
WavWriter::finalize didn't check that m_file was actually valid before
trying to seek and close it. The file is only set by set_file, so it's
not an invariant. Just add a null guard to finalize().
2020-12-31 21:59:20 +01:00
Andrew Kaster
644f5ec160 LibThread: Give Thread std::jthread semantics
Because pthread_create will always call pthread_exit internally before
exiting the thread function, we can remove the odd requirement that the
user's thread function must call Thread::quit internally.

Make Thread::join clear m_tid on success, and print to stderr on
failure. Call join from ~Thread(). Now if you write an infinite loop in
your thread in an application and don't have an exit condition, you will
block in the thread's destructor forever. Time for stop_token? :)
2020-12-31 21:59:20 +01:00
Andrew Kaster
2b3993b008 LibThread: Hide Thread's constructor, as it is a Core::Object
Just constructing one of these guys on the stack willy nilly will leak
the first reference to them. There might be other C_OBJECTs that have
public constructors, seems like a good place for some static analysis
checks :).

Force users to call the construct() method for it.
2020-12-31 21:59:20 +01:00
Dan MacDonald
b7fd5315e5
Ports: Hard-code SERENITY_ARCH=i686 until other architectures work (#4688) 2020-12-31 21:54:51 +01:00
Linus Groh
fb220d5678 Meta+Docs+CI: Require clang-format >= 11 2020-12-31 21:51:00 +01:00
Linus Groh
bbe787a0af Everywhere: Re-format with clang-format-11
Compared to version 10 this fixes a bunch of formatting issues, mostly
around structs/classes with attributes like [[gnu::packed]], and
incorrect insertion of spaces in parameter types ("T &"/"T &&").
I also removed a bunch of // clang-format off/on and FIXME comments that
are no longer relevant - on the other hand it tried to destroy a couple of
neatly formatted comments, so I had to add some as well.
2020-12-31 21:51:00 +01:00
AnotherTest
2568a93b5d ProtocolServer: Avoid blocking all downloads when client stops reading
Fixes #4668.
2020-12-31 16:57:09 +01:00
AnotherTest
83fed3fd5d LibWeb: Don't hold on to the Download instance after it's finished
Fixes* 4668
2020-12-31 16:57:09 +01:00
AnotherTest
a6b04cf8ef LibProtocol: Ensure download is finished before invoking on_finished 2020-12-31 16:57:09 +01:00
Linus Groh
a8ac8c6a8f AK: Add missing 'template' keywords in TypeList
This caused the AK build to be broken on OpenBSD (and possibly other
platforms / compiler versions).
Fixes #4692.
2020-12-31 16:16:07 +01:00
Andreas Kling
e6e4fe4f51 LibGUI: Add 1px of margin to EmojiPickerDialog
The left and top highlight edges were cut off by the dialog frame.
Add a small margin to make sure all buttons can be painted fully.
2020-12-31 14:39:23 +01:00
Andreas Kling
d441dec5d8 LibGUI: Make the emojis in the emoji input dialog fit in the window
GUI::Button has a default min-width of 32, so we have to override that
here in order to squeeze all the emojis into the window.

Fixes #4689.
2020-12-31 14:32:09 +01:00
Linus Groh
c0356fc183 WindowServer: Send WindowDeactivated event to windows blocked by modal
When a new modal window is created, we still want to forward the
WindowDeactivated event to its parent window, despite it being blocked
by the newly created modal (which causes WindowServer's Window::event()
to ignore all incoming events from WindowManager for that window).

This fixes the "terminal doesn't stop blinking when blocked by modal
window" bug.
2020-12-31 14:31:05 +01:00