Age | Commit message (Collapse) | Author |
|
The theming system can now control title bar height, title button
size, title stripe color and the title text shadow color.
The implemented theme metrics system could be later extended to LibGUI
to allow themes to change widget padding, border width, etc.
|
|
|
|
All the shards always intersect unless they're empty.
So rather than checking for intersection, just check
whether they're empty or not.
|
|
|
|
The DC reset interval was initialized to garbage :)
|
|
|
|
|
|
|
|
This patch adds functions like `load_jpeg` to JPGLoader to make the
JPEG decoder conform to the API that bitmap loader uses :^)
|
|
This patch adds support for JPEG decoding. The JPEG decoder is capable
of handling standard 2x1 horizontal, 2x1 vertical and quartered chroma
subsampling. The implemented Inverse DCT performs with a decent speed.
As of interchange formats, since we tend to ignore the metadata in APPn
markers, the decoder can handle any format compatible with JFIF, which
includes EXIFs and sometimes WebMs too. The decoder does not support
progressive JPEGs yet.
|
|
The new ImageDecoder service (available for members of "image" via
/tmp/portal/image) allows you to decode images in a separate process.
This will allow programs to confidently load untrusted images, since
the bulk of the security concerns are sandboxed to a separate process.
The only API right now is a synchronous IPC DecodeImage() call that
takes a shbuf with encoded image data and returns a shared buffer and
metadata for the decoded image.
It also comes with a very simple library for interfacing with the
ImageDecoder service: LibImageDecoderClient. The name is a bit of a
mouthful but I guess we can rename it later if we think of something
nicer to call it.
There's obviously a bit of overhead to spawning a separate process
for every image decode, so this is mostly only appropriate for
untrusted images (e.g stuff downloaded from the web) and not necessary
for trusted local images (e.g stuff in /res)
|
|
|
|
Since the current image handling APIs don't provide a way to handle a
file which can contain multiple images, we just pick the largest one.
This gives the best chance of a good looking result.
|
|
This add support to the ICO file decoder for loading uncompressed bitmap icon files.
It is limited to 32-bit color icons, no 4/8/16 bit or paletted formats yet.
This is in addition to the PNG compressed ICO format support added previously.
With this we can now load the favicons for github, google and twitter.
|
|
This adds support for loading the first image from ICO format images only if they are PNG encoded.
This is useful for loading favicons, which are sometimes PNGs with an ICO extension and sometimes actual ICO files.
In particular we can now load the favicon from new.ycombinator.com
|
|
|
|
Adds an *almost fully featured BMP loader to process .bmp files.
Features:
- All header formats are supported
- Full RLE4/8/24 support
- Color scaling (e.g. distributing a 5-bit color throughout the 8-bit
color spectrum, so 5-bit white is still 0xffffff)
- Full BITMASK/ALPHABITMASK support
*Not included:
- 1D Huffman compression. Good luck actually finding a bmp in the wild
that uses this
- Use of any field in the V4/V5 header. Color spaces? Endpoints? No
thanks :)
This loader was tested with the images at
https://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html. This
loader correctly displays 81 out of the 90 total images (for reference,
firefox displays 64 correctly). Note that not rendering the images at
the bottom is counted as displaying correctly.
|
|
|
|
Move the image file detection code to the File class to prevent code duplication.
|
|
|
|
|
|
This adds support for decoding the Adam7 interlacing used in some PNGs.
Notably this includes many of the images (such as the eyes) used in the acid2 test :^)
Note that the HTML engine still doesn't understand the <object> tag well enough to show the eyes on the test.
|
|
|
|
|
|
If we can't decode the input data, just have a null decoder. In this
state we simply return a null bitmap and whatever empty values make
sense for each API.
This way, we don't try to decode the same thing over and over since
it's not gonna work anyway. :^)
|
|
Get rid of the weird old signature:
- int StringType::to_int(bool& ok) const
And replace it with sensible new signature:
- Optional<int> StringType::to_int() const
|
|
Return StylePainter::paint_button() before color initializations
when possible and replace an overdrawn rect in paint_button_new()
with more explicit shadow lines. Also standardize some comments.
|
|
Only filter types 0 thru 4 are valid.
|
|
|
|
Now correctly returns HoverHighlight instead of ThreedHighlight.
|
|
This adds a "shine" effect to the bottom-right edges of pressed
and checked buttons, complementing the sunken shadow already
present at top-left and creating greater illusion of depth.
It is similar to the effect used in classic Windows and is
theme agnostic in Serenity, but produces the best result when
ThreedHighlight is a radiant color of Button.
|
|
|
|
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
|
|
|
|
|
|
It was really confusing that add_clip_rect() didn't apply transforms
to the new clip rect, but instead interpreted it as an absolute rect.
This makes web pages with <iframe> render correctly when scrolled.
Something might break from this, but we'll find it soon enough. :^)
|
|
The operator has to live in the namespace Gfx.
|
|
|
|
|
|
|
|
This avoids a bunch of strlen()'s when we're parsing web colors.
|
|
.. and make travis run it.
I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.
It also checks the presence of a (single) blank line above and below the
"#pragma once" line.
I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.
I also ran clang-format on the files I modified.
|
|
And move canonicalized_path() to a static method on LexicalPath.
This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
|
|
|
|
|
|
Replace codepoint variable type from char to u32.
|
|
There's a large amount of code duplication here right now, which will
need to be reduced.
|
|
|
|
This allows you to measure the width of a UTF-32 sequence.
|
|
Closes https://github.com/SerenityOS/serenity/issues/2080
|