Age | Commit message (Collapse) | Author |
|
|
|
eg, `errno enotsup` now shows the description and number for ENOTSUP.
|
|
And align the output nicely while we're at it. :^)
|
|
As we directly write to the stream, we don't need to store a copy of the
entire image in memory. However, writing to a stream is heavier on the
CPU than to a ByteBuffer. This commit unfortunately makes `add_pixels`
two times slower.
|
|
This concerns both `BufferedSeekable` and `BufferedFile`.
|
|
|
|
The `layout-test-mode` flag changes the font to be SerenitySans as this
is the font used for layout tests for cross-platform compatibility of
tests.
|
|
|
|
This adds information about the user owning the process to our netstat
output. We do not fully match the behaviour of Linux as we don't show
an inode information.
|
|
Some change in our JsonObject API broke the logic here. We now read
the correct type from the JsonObject and convert it to a string ourself.
|
|
Some change in our JsonObject API broke the logic here. We now read
the correct type from the JsonObject and convert it to a string ourself.
|
|
"The official project language is American English […]."
https://github.com/SerenityOS/serenity/blob/5d2e9156239cd707a22ecea6c87d48e5fc1cbe84/CONTRIBUTING.md?plain=1#L30
Here's a short statistic of the occurrences of the word "behavio(u)r":
$ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n
2 BEHAVIOR
24 Behaviour
32 behaviour
407 Behavior
992 behavior
Therefore, it is clear that "behaviour" (56 occurrences) should be
regarded a typo, and "behavior" (1401 occurrences) should be preferred.
Note that The occurrences in LibJS are intentionally NOT changed,
because there are taken verbatim from the specification. Hence:
$ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n
2 BEHAVIOR
10 behaviour
24 Behaviour
407 Behavior
1014 behavior
|
|
|
|
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.
This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.
From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
|
|
This implements the '-i' flag in the GNU version, without suffix
support.
|
|
- The veil was never closed.
- unveil() only works with absolute paths.
- Files from the regular input list weren't unveiled.
|
|
For now, only for color spaces that are supported by Profile::to_pcs()
and Profile::from_pcs(), which currently means that all matrix profiles
(but not LUT profiles) in the source color space work, and that
matrix profiles with parametric curves in the destination color
space work.
This adds Profile::convert_image(Bitmap, source_profile), and
adds a `--convert-to-color-profile file.icc` flag to `image`.
It only takes a file path, so to use it with the built-in
sRGB profile, you have to write it to a file first:
% Build/lagom/icc -n sRGB --reencode-to serenity-sRGB.icc
`image` by default writes the source image's color profile
to the output image, and most image viewers display images
looking at the profile.
For example, take `Seven_Coloured_Pencils_(rg-switch_sRGB).jpg`
from https://commons.wikimedia.org/wiki/User:Colin/BrowserTest.
It looks normal in image viewers because they apply the unusual
profile embedded in the profile. But if you run
% Build/lagom/image -o huh.png --strip-color-profile \
'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg'
and then look at huh.png, you can see how the image's colors
look like when interpreted as sRGB (which is the color space
PNG data is in if the PNG doesn't store an embedded profile).
If you now run
% Build/lagom/image -o wow.png \
--convert-to-color-profile serenity-sRGB.icc --strip-color-profile \
'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg'
this will convert that image to sRGB, but then not write
the profile to the output image (verify with `Build/lagom/icc wow.png`).
It will look correct in image viewers, since they display PNGs without
an embedded color profile as sRGB.
(This works because 'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg'
contains a matrix profile, and Serenity's built-in sRGB profile
uses a matrix profile with a parametric curve.)
|
|
Instead of crashing we give a helpful warning message to the user.
This also removes a fixme! :^)
|
|
-a and -p both require only one of the flags.
We will inform the user of this for both -a and -p <PID>.
|
|
|
|
If --measure is passed, icc prints the color pairs with the smallest
and largest perceptual difference between them.
Converting 254 * 254 * 254 * 4 = 65 Million colors from sRGB to LAB
and then computing 254 * 254 * 254 * 3 = 49 Million DeltaEs between
them takes a while. On my laptop, it takes 17s to run. So there's
a small progress display.
|
|
That pattern seems to show up a lot in code written by people that
aren't intimately familiar with the lifetime model of Error and Strings.
This commit makes the compiler detect it and present a more helpful
diagnostic than "garbage string at runtime".
|
|
This is always nice to factorize code, but even better when it contains
magic numbers.
|
|
|
|
With this change we support the well-known and shorter way to
create a listener on all interfaces:
`nc -lvp 1337`
instead of:
`nc -lv 0.0.0.0 1337`
|
|
|
|
|
|
|
|
Without `-y`, to show the current full year you'd have to specify which
one: `cal 2023`. Adding `-y` makes it possible to see the full current
year without remembering what year we are in.
This option is also stolen from FreeBSD :^)
Additionally, validate args: prevent passing both -3 and -y at the
same time. Passing both `--three-month-mode` and `--year` to `cal`
doesn't make sense. You'd either want the one or the other.
|
|
This allows to view just the previous, current, and next month
simultaneously. The idea for this is shamelessly stolen from FreeBSD :^)
|
|
Making it configurable in system settings :^)
The --start-day option can still overwrite this global default.
This change makes it no longer possible to use unveil: as we have
to load the Calendar config file, which might be in a dynamic location.
It's also neccessary to add `cpath` to the pledge, as opening a
nonexistent config file with Core::ConfigFile::open_for_app creates it.
|
|
Making all the other parts of the world happier :^)
Add a `--starting-day` (`-s`) option to be compatible with GNU cal,
which has a similar option. The GNU option takes allows passing either
an int or a day name. Let's do something similar using weekdays we
already have in AK/DateConstants.h.
Also add myself to the copyright header, as by now I've modified most of
the lines in this file.
|
|
I think this looks a lot prettier:
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
than that:
01 02 03 04
05 06 07 08 09 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
|
|
Additionally rename a loop variable in serenity_main() because
after introducing the `Header` enum IMO it's less readable with `i`.
|
|
Do this by constructing month rows from a Vector of Strings.
|
|
For now let's use them from AK/DateConstants.h, in accordance with the
FIXME those propably should be provided by the locale.
|
|
...in the format strings. Additionally, get rid of magic numbers,
and make them `constexpr`.
|
|
For now this only has an effect when displaying two-digit years, but
when month names get implemented this will be helpful.
|
|
...instead of putting a star `*` next to it. This makes `cal`s output
much prettier, and gets rid of one FIXME. :^)
Don't use the escape sequence from the deleted FIXME - \e[30;47m would
set the background to white and foreground to black - which presumably
wouldn't do much on a light-theme terminal. Instead use \e[7m which sets
the color as "inverted".
|
|
This additionally fixes a couple of code quality issues in `cal`,
removes reading from unset variables and writing to variables which are
never read.
|
|
This fixes cal not highlighting the current day.
After this commit `cal` will show something like this among its output
for the 23rd day of the month
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23*24 25
26 27 28
|
|
Every other cal implementation just highlights the current day instead
of letting you specify a custom one to highlight. It doesn't seem to be
that useful, and is currently broken - no day gets highlighted at all,
because the `target_day` global is never written to.
Moreover, this complicates parsing the arguments. This commit also fixes
parsing a case where just a year is provided to `cal` - for example `cal
2023`.
|
|
`Core::DeprecatedFile::absolute_path` uses `stat` to determine whether a
file exists, which will always fail after the first `unveil` call
`aplay` does. Reorder things so we don't get a stack trace thrown at us
for each file being played.
|
|
|
|
This is quite useful for userspace applications that can't cope with the
restriction, but it's still useful to impose other non-configurable
restrictions by using jails.
|
|
|
|
|
|
This has the side-effect of making the algorithm name case-sensitive,
but there doesn't seem to be an especially good reason to support that.
On the other hand, converting an AK::String to lowercase would require
linking LibUnicode.
|
|
|
|
|