Commit Graph

26 Commits

Author SHA1 Message Date
Cubic Love
3d10132021 Starfield: Rename starfield_window to starfield_widget
Linus says it should be a widget and not a window!
2023-04-12 19:34:27 +02:00
Tim Schumacher
82a152b696 LibGfx: Remove try_ prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit
it.
2023-01-26 20:24:37 +00:00
Sam Atkins
0c24522635 LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)
Rip that bandaid off!

This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
  the only one.

The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
2023-01-06 13:36:02 -07:00
HawDevelopment
a21703f1df Demos: Add ability to use scroll wheel in starfield
This change adds the ability to use the scroll wheel to change
the speed in starfield.
2022-12-28 14:49:05 -05:00
Jelle Raaijmakers
18b6bdb563 Demos+LibDesktop: Centralize screensaver logic
We have 3 demos with pretty similar window logic and quitting behavior
on user activity, so centralize that into `Desktop::Screensaver`.
2022-12-27 12:38:08 +01:00
Tim Schumacher
ce2f1b845f Everywhere: Mark dependencies of most targets as PRIVATE
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.

Also included are changes to readd now missing dependencies to tools
that actually need them.
2022-11-01 14:49:09 +00:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
Lenny Maiorani
0ec688f86e Demos: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-15 23:00:03 +02:00
Jagger De Leo
742cca4bfe Starfield: Add app icon
Previously, Starfield used app-screensaver icon.
2022-02-01 04:11:56 +00:00
Brian Gianforcaro
cf4fa936be Everywhere: Use default execpromises argument for Core::System::pledge 2021-11-28 08:04:57 +01:00
pbrw
bd61558ed8 Starfield: Use TRY() a lot more :^) 2021-11-25 08:49:31 +01:00
Andreas Kling
21a5fb0fa2 LibCore+LibSystem: Move syscall wrappers from LibSystem to LibCore
With this change, System::foo() becomes Core::System::foo().

Since LibCore builds on other systems than SerenityOS, we now have to
make sure that wrappers work with just a standard C library underneath.
2021-11-23 11:33:36 +01:00
Mustafa Quraish
4d302e0e88 Everywhere: Use Application::construct() with Main::Arguments directly
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
2021-11-22 21:13:42 -08:00
Mustafa Quraish
2fbcab46bf Everywhere: Use ArgsParser::parse() with Main::Arguments directly
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
2021-11-22 21:13:42 -08:00
Pedro Pereira
0ed3520ef5 Starfield: Port to LibMain
Simplified two pledge() by using TRY().
2021-11-22 21:56:20 +01:00
Pedro Pereira
efe5f37b04 Starfield: Modify speed by Plus or Minus keypresses
Although this is supposed to be a screensaver, it makes all the sense in
the world that it should support modifying the speed interactively. :^)
2021-11-21 16:40:14 +00:00
Pedro Pereira
7b923d1376 Starfield: Modify speed by command argument
This change allows us to change the speed variable by passing a
-s or --speed argument.
2021-11-21 16:40:14 +00:00
Pedro Pereira
6ac97d4397 Starfield: Support variable speed
This change allows us to modify the speed in which the Starfield is
generated. Increasing the speed also increases the length of each trail.
2021-11-21 16:40:14 +00:00
Andreas Kling
0de33b3d6c LibGfx: Use ErrorOr<T> for Bitmap::try_create()
Another one that was used in a fajillion places.
2021-11-08 00:35:27 +01:00
Timothy
73c1b1617a Everywhere: Replace most cases of exit() with Application::quit()
Application::quit() is nicer for most cases where exit() is used. Cases
where exit() is used intentionally for early termination are left
intact.
2021-08-03 18:55:52 +02:00
Brian Gianforcaro
4374e1e213 Demos: Remove unused header includes 2021-08-01 08:10:16 +02:00
Andreas Kling
c7d891765c LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
2021-07-21 18:02:15 +02:00
Gunnar Beutner
631d36fd98 Everywhere: Add component declarations
This adds component declarations so that users can select to not build
certain parts of the OS.
2021-06-17 11:03:51 +02:00
Andreas Kling
31d4bcf5bf Userland: Tighten a *lot* of pledges! :^)
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
2021-05-13 23:28:40 +02:00
Andreas Kling
41dc73adc4 Demos: Fix a bunch of incorrect use of GUI::PaintEvent::rect()
A bunch of programs were using the paint event rect as the rect
to draw into. Since the event rect could be any invalidated part
of the widget, we need to be passing the full Widget::rect().
2021-05-09 10:11:30 +02:00
Jagger De Leo
cec8488d9d Demos: Add Starfield screensaver demo 2021-04-26 23:13:27 +02:00