Commit Graph

61 Commits

Author SHA1 Message Date
Lucas CHOLLET
e8115bfdb1 Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01: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
Karol Kosek
9d7345d17b Chess: Import/Export chessboards using LibFileSystemAccessClient
With this change, the wpath and cpath promises as well as unveiling
user's entire home directory are no longer needed. :^)
2022-08-08 22:03:30 -04: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
sin-ack
c8585b77d2 Everywhere: Replace single-char StringView op. arguments with chars
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).

No functional changes.
2022-07-12 23:11: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
MacDue
5cb7e4f2f0 Chess: Paint move marker antialiased 2022-06-05 16:16:17 +01:00
Sam Atkins
cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Linus Groh
fd60c9fac7 Games: Add reload icon to 'New Game' actions 2022-03-18 01:10:16 +01:00
Andreas Kling
a6a8ba80fc LibGfx: Rename Color::from_rgba() => Color::from_argb()
This matches the rename of RGBA32 to ARGB32. It also makes more sense
when you see it used with 32-bit hexadecimal literals:

Before:
    Color::from_rgba(0xaarrggbb)

After:
    Color::from_argb(0xaarrggbb)
2022-03-04 23:40:21 +01:00
Lenny Maiorani
27c30ca063 Games: 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-16 22:08:55 +00:00
Vitaly Dyachkov
32b8795091 LibConfig: Rename pledge_domains(String) => pledge_domain(String)
pledge_domains() that takes only one String argument was specifically
added as a shortcut for pledging a single domain. So, it makes sense to
use singular here.
2022-02-11 18:06:39 +01:00
kleines Filmröllchen
1a8c8d2383 Chess: Don't use Vector in a literal iterator 2022-01-28 23:40:25 +01:00
David Lindbom
e5c6026a9a Chess: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
Astraeus-
88ce05317f Chess: Convert to try_create_default_icon 2021-12-18 23:36:59 +01:00
Brian Gianforcaro
cf4fa936be Everywhere: Use default execpromises argument for Core::System::pledge 2021-11-28 08:04:57 +01:00
Pedro Pereira
45e29d58e2 Chess: TRY() all the things in serenity_main() :^) 2021-11-27 17:18:44 +01:00
Pedro Pereira
70a3962ce9 Chess: Replace construct() with TRY(try_create()) pattern 2021-11-24 13:51:07 +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
Pedro Pereira
55db1811c7 Chess: Port to LibMain
Simplified two pledge() and five unveil() by using TRY().
2021-11-22 23:55:42 +01:00
Andreas Kling
8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +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
6b75a4dfc3 Everywhere: Mark overridden methods 'override'
This is good practice, and fixes some IDE warnings.
2021-11-02 22:56:53 +01:00
Filiph Sandström
d6a0726302 Everywhere: Rename left/right-click to primary/secondary
This resolves #10641.
2021-10-27 22:05:58 +03:00
Luke Wilde
4332b35798 Chess: Perform pledges earlier 2021-08-28 12:22:16 +04:30
Ralf Donau
a6fc80f069 Games: Remove unveiling /tmp/portal/config
Config::pledge_domains is applied before, hence /tmp/portal/config
can and should be veiled.
2021-08-26 21:40:39 +02:00
Thitat Auareesuksakul
573d14b7b5 Chess: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
networkException
acde7d12b0 Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system
configs more inline with the regular ConfigFile::open functions.
2021-08-22 01:32:25 +02:00
networkException
938051feb8 Everywhere: Use Core::ConfigFile::AllowWriting::Yes to allow writing 2021-08-22 01:32:25 +02:00
Andreas Kling
687a12d7fb Userland: Add GUI::Window::add_menu() and use it everywhere
Applications previously had to create a GUI::Menubar object, add menus
to it, and then call GUI::Window::set_menubar().

This patch introduces GUI::Window::add_menu() which creates the menubar
automatically and adds items to it. Application code becomes slightly
simpler as a result. :^)
2021-07-21 21:24:26 +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
Joshua Gollaher
eea95c4532 Chess: Remove 1:1 window aspect ratio 2021-06-11 11:31:35 +02:00
BrandonKi
ee38f5241d LibChess: Change cursor style when hovering or dragging valid piece 2021-06-02 11:18:40 +02:00
Andreas Kling
6a012ad79f LibGfx: Remove Gfx::FontDatabase::default_bold_font()
Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
2021-05-20 20:55:29 +02:00
Jean-Baptiste Boric
0262a99a1f Chess: Fix signed/unsigned issues
Make everything signed so that we don't have to deal with silly casting
issues thoughout the Chess code. I am unsure if this affects the chess
AI negatively, it seems just as "intelligent" before and after this
change :^)
2021-05-17 18:14:05 +01:00
Andreas Kling
67ed580532 Chess: Make the main widget a GUI::Frame for a nicer look :^) 2021-05-17 12:02:38 +02:00
Jean-Baptiste Boric
090936e424 Userland: Replace arc4random() with get_random<u32>() 2021-05-14 22:24:02 +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
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Linus Groh
83d980ab9e Chess+Help: Remove erroneous ampersand from app name
This is not applicable here, the alt shortcut is set elsewhere.
2021-05-07 20:37:28 +01:00
Gunnar Beutner
b613817bca Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
Andreas Kling
7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Nicholas-Baron
73dd293ec4 Everywhere: Add -Wdouble-promotion warning
This warning informs of float-to-double conversions. The best solution
seems to be to do math *either* in 32-bit *or* in 64-bit, and only to
cross over when absolutely necessary.
2021-04-16 19:01:54 +02:00
Andreas Kling
d8787e0e12 Chess: Alt shortcuts and book title capitalization in menus 2021-04-14 21:32:37 +02:00