Commit graph

20 commits

Author SHA1 Message Date
theonlyasdk 6da1d5eb57 Demos: Add sleep option to CatDog
Now you can put your CatDog to sleep while
you're at work :)
2024-05-14 15:45:33 -06:00
Tim Schumacher 874c7bba28 LibCore: Remove Stream.h 2023-02-13 00:50:07 +00:00
Tim Schumacher 606a3982f3 LibCore: Move Stream-based file into the Core namespace 2023-02-13 00:50:07 +00:00
Tim Schumacher d43a7eae54 LibCore: Rename File to DeprecatedFile
As usual, this removes many unused includes and moves used includes
further down the chain.
2023-02-13 00:50:07 +00:00
Andre Eisenbach e80f0b23e3 CatDog: Simplify animation frame logic and fix minor bugs
Moved all images into a Vector instead of storing every animation frame
in its own member variable. This greatly simplifies the bitmap selection
logic and removes redundant if() checks.

Also fixes minor state bugs. For example, CatDog woudld go to sleep
immediately after actively moving for > 5 seconds. Also fixes arbitrary
hardcoded values for mouse offset movement tresholds as well as
inconsistent movement increments. This allows clicking anywhere on the
CatDog window without moving CatDog.

In addition to removing many member variables, the API interface is
also cleaned up a bit to expose less CatDog internals. Nobody likes
exposed CatDog internals ;).

Variables and function are also renamed where necessary to (hopefully)
improve readability.
2022-12-16 08:50:35 -07:00
Andreas Kling cba9df1c53 CatDog: Make a factory function for CatDog and propagate errors
This fixes an astonishing 22 FIXMEs. :^)
2022-12-14 15:05:52 +00:00
Tim Schumacher 8940f2da7f LibCore: Use Core::Stream for ProcessStatisticsReader 2022-12-10 11:49:24 +00:00
MacDue 7be0b27dd3 Meta+Userland: Pass Gfx::IntPoint by value
This is just two ints or 8 bytes or the size of the reference on
x86_64 or AArch64.
2022-12-07 11:48:27 +01:00
Liav A 5dfb2b18f3 Applications: Use new global variables at /sys/kernel/ directory 2022-10-25 15:33:34 -06:00
Ben Wiederhake c214d31c5e Everywhere: Fix order of includes and #pragma once 2022-09-18 18:30:05 -07: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
kleines Filmröllchen 145f983ee1 Demos/CatDog: Introduce inspector & artist states based on open programs
These two new main states are determined by looking at the programs the
user has open. The artist state, using the new artist catdog, is
triggered by PixelPaint and FontEditor, and the inspector state is
triggered by Inspector, Profiler and SystemMonitor. This requires CatDog
to unveil /proc/all, and, for some reason, /etc/passwd.
2022-03-02 18:10:02 +01:00
kleines Filmröllchen 93bb943394 Demos/CatDog: Refactor the main states
CatDog's state was previously handled by a bunch of booleans that all
needed to be in sync pretty accurately, but some of these are exclusive
(like alerted and sleeping). This commit introduces a simple enum for
the main states of CatDog which exclude the roaming and direction
states. The main state determines the standing image of CatDog and will
have further effects in the future.
2022-03-02 18:10:02 +01:00
Andreas Kling 235f39e449 LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
Ben Wiederhake f717008bde CatDog: Switch to new mouse-tracking method 2021-09-08 10:53:49 +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
Hendiadyoin1 ed46d52252 Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one.
We avoid mixed usage for now though.

Also clean up some stale math includes and improper floatingpoint usage.
2021-07-19 16:34:21 +04:30
Marcus Nilsson e5367c13d8 CatDog: Remove global menu and add context menu
There was no way to close catdog since it relied on global menus, this
adds a context menu for opening the about dialog and quitting.

Fixes #7252
2021-05-18 18:59:18 +01:00
Gunnar Beutner e0fe38ea25 CatDog: Help the user debug their programs
This adds helpful speech bubbles to CatDog. CatDog just wants to
help, that's all.
2021-05-09 15:21:23 +02:00
Gunnar Beutner e229914a74 CatDog: Move the main widget into its own file 2021-05-09 15:21:23 +02:00