Commit Graph

239 Commits

Author SHA1 Message Date
Tim Schumacher
8940f2da7f LibCore: Use Core::Stream for ProcessStatisticsReader 2022-12-10 11:49:24 +00:00
FrHun
59028515c0 LibGUI: Split OpacitySlider into vertical and horizontal helper classes 2022-12-09 00:25:30 +01:00
Andreas Kling
d88c7fee32 LibGfx+Userland: Make PNGWriter::encode() return ErrorOr<ByteBuffer>
This is a first step towards handling PNG encoding failures instead of
just falling over and crashing the program.

This initial step will cause encode() to return an error if the final
ByteBuffer copy fails to allocate. There are more potential failures
that will be surfaced by subsequent commits.

Two FIXMEs were killed in the making of this patch. :^)
2022-12-08 13:01:11 +00:00
Andreas Kling
95b4ffad39 Mandelbrot: Make it possible for export_image to return an error
...and if we do get an error, present it to the user.
2022-12-08 13:01:11 +00:00
Filiph Sandström
01cdd3f181 WindowServer+MouseSettings: Improve buttons_switched naming
Before this commit it was a bit ambiguous which buttons the function
name were referring to; this instead now makes it clear that it's
related to mouse input. Additionally, this also fixes incorrect getter
naming leftover from yesteryear.
2022-12-08 07:04:09 -05:00
MacDue
27fae78335 Meta+Userland: Pass Gfx::IntSize by value
Just two ints like Gfx::IntPoint.
2022-12-07 11:48:27 +01: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
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Andreas Oppebøen
b716c14c32 MouseDemo: Eliminate visual artifacts when filling in the color
The drawing had several visual artifacts with the colors not perfectly
filling out their outlines. By re-using the path for both stroke and
fill, we ensure that the exact same floating point coordinates are
used. Drawing the fill first and the stroke after also helps eliminate
artifacts.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen
54edd162a9 MouseDemo: Draw blue color for longer to indicate double click
When double-clicking, the button remains blue a bit longer. This
provides a convenient way to test the double click speed.

Piggybacks the timer for the scroll indicators, which is a bit weird,
but not noticeable.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen
3cf81f1930 MouseDemo: Restart timer when scrolling to avoid blinking indicator
When scrolling, a timer is triggered to hide the indicator cross. When
we continuously scroll, the indicator cross would then blink once the
timer kicks in. Instead, let's cancel the current timer and schedule a
new one, making the indicator visually smooth.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen
2c142e4c57 MouseDemo: Show distinct colors for primary vs secondary button
This shows mouse down of primary button in blue color,
and secondary button in light blue color.
2022-11-30 12:56:29 +00:00
Andreas Oppebøen
903bfc3d68 MouseDemo: Replace constructor with initialization at member definition
This adheres to CodingStyle.md#other-punctuation which states:
> Prefer initialization at member definition whenever possible

Since the zero-arg constructor was only initializing members, it was
simply removed.
2022-11-30 12:56:29 +00: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
Liav A
5dfb2b18f3 Applications: Use new global variables at /sys/kernel/ directory 2022-10-25 15:33:34 -06:00
demostanis
34acae90c7 Userland: Let applications make use of make_command_palette_action() 2022-10-25 10:21:18 +01:00
demostanis
1eac02c9a4 CatDog: Make it always on top 2022-10-13 12:37:54 +01:00
Ali Mohammad Pur
166a905951 Userland: Properly populate GENERATED_SOURCES
We previously put the generated headers in SOURCES, which did not mark
them as GENERATED (and did not produce a proper dependency).
This commit moves all generated headers into GENERATED_SOURCES, and
removes useless header SOURCES.
2022-10-12 15:55:15 +01:00
Timothy Flynn
7cab86ad28 Userland: Unveil /proc/all in applications which require it
These were missed in 7af5eef. It is needed for any application using
e.g. FileSystemAccessServer.
2022-10-03 17:09:21 +01:00
Timothy Flynn
25e0ab3ee4 Userland: Tighten promises by removing 'proc' where it isn't used
This is a partial revert of commit 7af5eef. After 97d15e9, the 'proc'
promise is not needed for operations using getsid().

This also fixes launching several applications in which 7af5eef added
the 'proc' promise only in the second call to pledge().
2022-10-03 17:09:21 +01:00
Peter Elliott
7af5eef0dd SystemServer+LoginServer+Userland: Switch to sid-based sockets
This commit does three things atomically:
- switch over Core::Account+SystemServer+LoginServer to sid based socket
  names.
- change socket names with %uid to %sid.
- add/update necessary pledges and unveils.

Userland: Switch over servers to sid based sockets

Userland: Properly pledge and unveil for sid based sockets
2022-10-03 11:11:29 +02:00
networkException
4230dbbb21 AK+Everywhere: Replace "protocol" with "scheme" url helpers
URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.

See https://url.spec.whatwg.org/#concept-url-scheme
2022-09-29 09:39:04 +01:00
Ben Wiederhake
c214d31c5e Everywhere: Fix order of includes and #pragma once 2022-09-18 18:30:05 -07:00
Andrew Kaster
8ed5ed3ec0 LibGL: Make GL::create_context fallible
Propagate errors in places that are already set up to handle them, like
WebGLRenderingContext and the Tubes demo, and convert other callers
to using MUST.
2022-09-16 15:32:38 +02:00
Linus Groh
81f1183e28 Tubes: Run clang-format 2022-09-11 23:24:33 +01:00
Jelle Raaijmakers
9dfe50170e Demos: Add Tubes :^) 2022-09-11 22:45:49 +01:00
networkException
1346a653e4 WidgetGallery: Port file picker to use FileSystemAccessClient
Previously we would unveil the home directory of anon to allow showing
anything in the file picker. This patch removes direct access to the
home directory and instead makes WidgetGallery connect to
FileSystemAccessServer to open a file, making the application more user
agnostic and allowing directories outside /home/anon to be shown.
2022-09-10 20:41:16 +01:00
MacDue
b609dd7348 Eyes: Add an option to show/hide the window frame
This works the same as in the Cube demo, and now allows enjoying
the eyes without any obstructions :^)

The window frame can now be disabled with the -h/--hide-window
command-line option, or via toggle in the GUI.
2022-08-25 13:42:17 +02:00
thankyouverycool
0d4fd4e2a6 LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindows
with the RenderAbove WindowMode. This mode will ensure child
windows always draw above their parents, even when focus is lost.
RenderAbove modals are automatically themed the same as the old
ToolWindows. Fixes ToolWindows rendering above ALL normal windows,
regardless of parent. We can't rely on WindowType to create these
sort of effects because of WindowManager's strict display hierarchy.
2022-08-25 13:28:50 +02:00
thankyouverycool
f833473df0 Apps+Demos+Dialogs: Remove unnecessary minimum window sizes
The new layout system conveniently calculates these for us now.
In the case of Mandelbrot where it needs to be overriden, make
sure to disable obey min widget size first. In EmojiInputDialog's
case, the window needs to be resized instead to center correctly.
2022-08-25 13:28:50 +02:00
Lucas CHOLLET
bee5bcda73 Everywhere: Replace hardcoded anon's uid in unveil path with %uid 2022-08-14 21:52:35 +01:00
Lucas CHOLLET
c5b7c9f479 LibCore+LaunchServer: Move portal directory to /tmp/user/%uid
The `/tmp/user` directory is owned by root, this solution prevents
malicious users to interfere with other users' portals.

This commit also moves `launch`'s portal in the user directory.
2022-08-14 21:52:35 +01:00
Linus Groh
8150d71821 Everywhere: Prefix 'TYPEDEF_DISTINCT_ORDERED_ID' with 'AK_' 2022-07-22 23:09:43 +01:00
Lucas CHOLLET
70846d701c LaunchServer+SystemServer: Move the portal to a user-specific directory
Various changes are needed to support this:
 - The directory is created by Core::Account on login (and located in
   /tmp).
 - Service's sockets are now deleted on exit (to allow re-creation)
 - SystemServer needs to handle SIGTERM to correctly destroy services.
2022-07-19 11:15:14 +01:00
FrHun
dfefd1ec88 WidgetGallery: Make inspectable
WidgetGallery is only a demo anyways, and the perfect target to test the
Inspector.
2022-07-15 12:38:35 +02: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
FrHun
53215be7ae WidgetGallery: Repair GML layout on BasicsTab 2022-07-04 11:15:40 +02:00
FrHun
8dd08d47f1 Applications: Remove usages of deprecated implicit conversions
These deprecated conversions are currently in place to make the system
compile, but they are to be removed soon. This prepares that.
2022-06-28 17:52:42 +01:00
FrHun
8081a8a5de LibGUI: Add layout spacer support to GML
This is a bit of a hack, but it is an easy way to finally get spacers
into GML.
This will translate well if spacers are later to become child objects of
the continer widget.
2022-06-10 21:26:06 +01:00
MacDue
8ac5f625e9 LibGfx: Rename draw_ellipse/circle to fill_ellipse/circle
This makes these functions more consistent with the non-aa painter.
2022-06-01 19:33:45 +02:00
Sam Atkins
cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
Sam Atkins
84b98da259 Userland: Set tab-widget properties in GML instead of code 2022-05-11 20:16:43 +02:00
MacDue
739d870091 Fire: Ignore mouse events outside the window (to the left)
This fixes a small issue where if you drag the cursor outside the
window on the left-hand side, the fire demo will still respond to
the mouse events, but wrapped around to the right of the window.
2022-05-08 18:15:12 +02:00
MacDue
934ea4faf1 Fire: Replace #defines with constexprs 2022-05-08 18:15:12 +02:00
EWouters
053fc51b7d Mandelbrot: Remove image export confirmation dialog
Andreas mentioned this dialog is not needed in the monthly update
video[^1].

[^1]: https://youtu.be/yUmHEYs5n34?t=364
2022-05-08 16:38:19 +02:00
MacDue
cf5b6c5c8d Demos/Eyes: Render eyes antialiased
This looks good, and is a good way to test ellipse rendering is
working properly.
2022-05-07 22:59:02 +02:00
Liav A
b401f278ad Userland: Re-organize /dev GPU nodes 2022-05-05 20:55:57 +02:00
EWouters
d3bc3da873 Mandelbrot: Add BMP and QOI image formats as options for export
Inspired by #13558 I added the option to export as QOI to the
Mandelbrot demo. I added BMP as well for completeness.
2022-04-20 08:19:25 -04:00
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00