Commit Graph

154 Commits

Author SHA1 Message Date
Andreas Kling
58240fdb33 Do a pass of compiler warning fixes.
This is really making me question not using 64-bit integers more.
2019-04-23 13:00:53 +02:00
Andreas Kling
7efd61fcf5 WindowSerer+LibGUI: Send multiple rects in invalidation/flush messages.
This patch moves to sending up to 32 rects at a time when coordinating the
painting between WindowServer and its clients. Rects are also merged into
a minimal DisjointRectSet on the server side before painting.

Interactive resize looks a lot better after this change, since we can
usually do all the repainting needed in one go.
2019-04-20 17:23:35 +02:00
Andreas Kling
5eedb22834 Sprinkle use of AK::Vector in various places.
Some of these are less helpful than others. Avoiding a bunch of mallocs
in the event loop wakeup code is definitely nice.
2019-04-20 14:02:19 +02:00
Andreas Kling
86361d3d45 WindowServer: Improve the look of menus.
This patch makes menus stand out a bit more from their background by using
the same kind of shading that Windows 2000 had.
2019-04-16 17:02:26 +02:00
Andreas Kling
f61549ca5f Make better use of geometry class helpers in some places. 2019-04-16 13:58:02 +02:00
Andreas Kling
a082738f04 SharedGraphics: Move PainterStateSaver out of line. 2019-04-16 01:01:03 +02:00
Andreas Kling
9eab8734fe PNGLoader: Disable debug spam. 2019-04-15 23:47:42 +02:00
Andreas Kling
0f4050903d GVariant: Add to_bool(), to_int() and to_color(). 2019-04-13 12:39:20 +02:00
Andreas Kling
3674bb9429 GVariant: Tweak stringification of Color, Boolean and Invalid variants. 2019-04-12 14:49:45 +02:00
Andreas Kling
09339fa912 StylePainter: Don't paint hover frame around disabled CoolBar buttons. 2019-04-12 02:51:59 +02:00
Andreas Kling
a1015840ff Color: Add a simple lightened() helper. 2019-04-12 02:50:43 +02:00
Andreas Kling
476c43ab22 Painter: Add alpha-blending support to blit_dimmed(). 2019-04-12 02:50:28 +02:00
Andreas Kling
93b76628a5 GGroupBox: Improve appearance with new FrameShape::Box style. 2019-04-11 14:27:31 +02:00
Andreas Kling
5e0577a042 Introduce LibCore and move GElapsedTimer => CElapsedTimer.
I need a layer somewhere between AK (usable both by userspace and kernel)
and LibGUI (usable by userspace except WindowServer.) So here's LibCore.
2019-04-10 16:14:44 +02:00
Andreas Kling
a74f3615ac Color: Add to_grayscale() and darkened() helpers. 2019-04-10 16:00:29 +02:00
Andreas Kling
30e2d62c38 WindowServer: Factor out some parts of compose().
The main compositing loop was getting pretty unwieldy. Break out some parts
into functions so it's more understandable.
2019-04-10 13:51:47 +02:00
Andreas Kling
4ab0cd5d4c LibGUI: Move frame painting from GFrame to StylePainter.
This way it can be used by others who might not have a GFrame object.
2019-04-10 03:43:46 +02:00
Andreas Kling
4abffa4dbe GSpinBox: Put nice little arrow glyphs on the buttons. 2019-04-10 01:37:08 +02:00
Andreas Kling
f12573cb63 Add a slight hover highlight to GButton and WSButton. :^) 2019-04-06 04:08:09 +02:00
Andreas Kling
4533539e8a Painter: Add text elision support (only right-hand side supported.)
Some window titles didn't fit on the taskbar buttons, so I needed a way
to collapse the remaining part of the text into "..."
2019-04-04 15:19:04 +02:00
Andreas Kling
19eb814850 LibGUI: Make it possible for GButton to be checkable. 2019-04-04 13:18:27 +02:00
Andreas Kling
c02c9880b6 AK: Add Eternal<T> and use it in various places.
This is useful for static locals that never need to be destroyed:

Thing& Thing::the()
{
    static Eternal<Thing> the;
    return the;
}

The object will be allocated in data segment memory and will never have
its destructor invoked.
2019-04-03 16:52:25 +02:00
Andreas Kling
5b296718d8 GraphicsBitmap: Use MappedFile. 2019-04-03 14:32:45 +02:00
Andreas Kling
c0009e3173 PNGLoader: Use MappedFile. 2019-04-03 14:15:35 +02:00
Andreas Kling
3dc3754cde Font: Clean up AK::MappedFile and use it for mapping font files. 2019-04-03 13:51:49 +02:00
Andreas Kling
17e02e7450 Move NetworkOrdered.h to AK/ since it's used in both kernel and userspace. 2019-04-02 20:04:54 +02:00
Andreas Kling
2334ffcbf8 WindowServer: Add a WSCursor class (a bitmap and a hotspot.)
Also import a bunch of cursors I drew. Only the default ("arrow") cursor is
ever used so far.
2019-03-31 22:09:10 +02:00
Andreas Kling
9538c06a45 LibGUI: Add a simple GSplitter container widget.
This allows you to put multiple widgets in a container and makes the space
in between them draggable to resize the two adjacent widgets.
2019-03-30 13:53:30 +01:00
Andreas Kling
f249c40aaa Rename Painter::set_clip_rect() to add_clip_rect().
It was confusing to see multiple calls to set_foo() in a row. Since this is
an intersecting operation, let's call it add_clip_rect() instead.
2019-03-29 15:01:54 +01:00
Andreas Kling
2e0f4da1f7 StylePainter: Fix underdraw in new button style. 2019-03-29 02:57:33 +01:00
Andreas Kling
d48f486634 LibGUI: Don't draw left and right side of surfaces that span entire window.
In other words, if a surface stretches from the left side of the window
all the way to the right side, skip shading and highlighting the sides.
This makes widgets blend together just slightly with the window. :^)
2019-03-29 02:20:22 +01:00
Andreas Kling
e2cd7529ab StylePainter: Tweak ButtonStyle::Normal highlights. 2019-03-28 17:46:24 +01:00
Andreas Kling
c7ab643883 Move LibGUI/GStyle to SharedGraphics/StylePainter.
I want to paint some buttons in WindowServer where we don't have LibGUI.
2019-03-28 17:32:38 +01:00
Andreas Kling
9fa21fa585 LibGUI: Add a GPainter class that inherits from Painter.
This gets rid of the last little piece of LibGUI knowledge in Painter.
2019-03-28 17:19:56 +01:00
Andreas Kling
0058da734e Kernel: Add Inode::truncate(size).
- Use this to implement the O_TRUNC open flag.
- Fix creat() to pass O_CREAT | O_TRUNC | O_WRONLY.
- Make sure we truncate wherever appropriate.
2019-03-27 16:42:30 +01:00
Andreas Kling
08085f48a0 SharedGraphics: Font::width() shouldn't add spacing to the very last glyph. 2019-03-25 13:35:24 +01:00
Andreas Kling
eabc097dd4 SharedGraphics: Oops, I was compiling puff() in SLOW mode for testing. 2019-03-24 00:53:16 +01:00
Andreas Kling
60d25f0f4a Kernel: Introduce threads, and refactor everything in support of it.
The scheduler now operates on threads, rather than on processes.
Each process has a main thread, and can have any number of additional
threads. The process exits when the main thread exits.

This patch doesn't actually spawn any additional threads, it merely
does all the plumbing needed to make it possible. :^)
2019-03-23 22:03:17 +01:00
Andreas Kling
92627154a7 FileManager: Add basic thumbnailing of PNG images.
These use nearest neighbor and are computed synchronously on directory load
so it's neither fast nor very beautiful. These issues both need work on
other parts of the system to fix.
2019-03-23 12:37:33 +01:00
Andreas Kling
86570d3b1a SharedGraphics: Add Painter::draw_scaled_bitmap().
It's just a simple nearest-neighbor scale with alpha blending but it gets
the job done.
2019-03-22 04:20:10 +01:00
Andreas Kling
7c0a185970 Use the PNG loader for all images, and get rid of the .rgb files. 2019-03-22 00:21:03 +01:00
Andreas Kling
796bc56a13 PNGLoader: Reduce unfiltering branchiness even more.
Use a dummy scanline for y=0 filled with all zeroes to avoid having to check
y on every iteration before grabbing color data from scanline[y - 1].
2019-03-21 16:55:31 +01:00
Andreas Kling
cd1afde48c PNGLoader: Templatize the unfiltering functions to reduce branchiness.
This also allows us to dodge processing alpha values in non-alpha PNGs
without a branch.
2019-03-21 16:45:04 +01:00
Andreas Kling
cfc521d57e PNGLoader: Reorganize the unfiltering code to make it easier to work with. 2019-03-21 16:19:11 +01:00
Andreas Kling
fe25f957e5 PNGLoader: Allocate enough space for the compressed data buffer up front.
This is a 2x speedup on wallpaper loading.
2019-03-21 14:08:14 +01:00
Andreas Kling
332b5a96f6 PNGLoader: Remove a bunch of unnecessary data copying.
Use ByteBuffer::wrap() to avoid copying buffers around a bit. This is about
a 10% speedup on loading a wallpaper-type PNG.
2019-03-21 13:58:40 +01:00
Andreas Kling
65348e7dc1 PNGLoader: Support for color type 2 (RGB triplets) and multiple IDAT chunks. 2019-03-21 05:25:54 +01:00
Andreas Kling
42755e98cf SharedGraphics: Implement a simple PNG decoder.
This is extremely unoptimized, but it does successfully load "folder32.png"
so it must be at least somewhat correct. :^)
2019-03-21 03:57:42 +01:00
Andreas Kling
67009cee8e IRCClient: Add ability to change nickname. 2019-03-20 04:21:58 +01:00
Andreas Kling
e15cc4509f LibGUI: More GInputBox refinements.
Fix some GBoxLayout bugs to make the buttons in GInputBox line up better.
There are still some imperfections due to rounding errors.
2019-03-19 03:00:42 +01:00