Commit graph

1610 commits

Author SHA1 Message Date
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
b0de6aa8d8 Base: Import some 32x32 icons. 2019-03-23 12:38:41 +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
1355d09c72 GItemView: Implement up/down/left/right keyboard navigation. 2019-03-23 04:05:58 +01:00
Andreas Kling
82ca3e58b8 FileManager: Make sure the status bar callback is hooked up. 2019-03-23 03:56:33 +01:00
Andreas Kling
19fa70c821 LibGUI: Add a GItemView class.
This is a GAbstractView subclass that implements a icon-based view onto
a GModel. It still need a bunch of work, but it's in basic usable shape.
2019-03-23 03:54:45 +01:00
Andreas Kling
5707d7f547 LibGUI: Add GAbstractView base class for GTableView.
This is in preparation for adding a new view class.
2019-03-23 02:04:31 +01:00
Andreas Kling
994cf10b3e LibGUI: Rename GTableModel => GModel. 2019-03-23 01:42:49 +01:00
Andreas Kling
9d4b4c2689 FileManager: Add a default icon for image files. 2019-03-22 12:54:27 +01:00
Andreas Kling
5ca62f356b FileManager: Open PNG files with QuickShow when activated. 2019-03-22 12:43:29 +01:00
Andreas Kling
d563dc0565 LibGUI: Add a setting to make GLabel stretch its icon.
Use this in QuickShow to allow arbitrarily scaling the opened image.
2019-03-22 04:20:48 +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
e4498194c2 LibGUI: Remove unnecessary timer in GProgressBar. 2019-03-22 02:49:57 +01:00
Andreas Kling
c3b0c1ba68 LibGUI: Add a GProgressBar widget. 2019-03-22 02:49:45 +01:00
Andreas Kling
23fe630057 AK: Allow printing a literal '%' character with the printf family. 2019-03-22 01:50:32 +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
c2a38c86cf AK: Fix busted __udivmoddi4() implementation. 2019-03-21 17:33:06 +01:00
Andreas Kling
1484a9eabd WindowServer: Remove some old commented-out code. 2019-03-21 17:22:29 +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
e4dfd5a3a4 WindowServer: Support PNG wallpapers.
Fix up /bin/pape so it tells the WindowServer which wallpaper file to use.
2019-03-21 15:54:19 +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
9dfcd95cd7 Use 64-bit integers inside Stopwatch to enable longer timings. 2019-03-21 13:41:36 +01:00
Andreas Kling
0114c61cf1 Userland: Turn off double buffering in QuickShow.
Since this program is primarily used to display potentially huge but still
static images, let's not put extra strain on the system by double buffering.
2019-03-21 13:31:47 +01:00
Andreas Kling
5708c12e24 LibC: Add PAGE_SIZE to limits.h 2019-03-21 13:31:27 +01:00
Andreas Kling
93a6681388 LibC: malloc() should use mmap() directly for allocations >= PAGE_SIZE.
This is a solid speedup on PNG loading, and basically everything else.
Once again I find a way to defer writing a better allocator for now. :^)
2019-03-21 13:29:20 +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
ed2303e2d8 TextEditor: The delete key should work even when there's no selection. 2019-03-20 23:11:00 +01:00
Andreas Kling
be4533717a FileManager: Add ability to create new directories. 2019-03-20 22:40:06 +01:00
Andreas Kling
1030e6b848 FileManager: Add a "Location:" label. 2019-03-20 22:01:02 +01:00
Andreas Kling
86e2348b74 Kernel+LibC: Don't crash upon traversal of large directories. 2019-03-20 18:31:12 +01:00
Andreas Kling
7b32afdcfc Kernel: Oops, forgot to add Alarm.h earlier. Here it is. 2019-03-20 18:16:15 +01:00
Andreas Kling
f0915641c5 TextEditor: Add "delete" action. 2019-03-20 18:16:04 +01:00
Andreas Kling
daa1dcb5e8 FileManager: Use a GTextEditor for the location bar + tweak icons. 2019-03-20 18:12:56 +01:00
Andreas Kling
367bb9e4eb Kernel: Remove ioctl for getting a socket peer's PID.
Now that everything is nice and mature, the WindowServer can just use the
client PID it receives in the Greeting message, and we can get rid of this
hacky ioctl. :^)
2019-03-20 17:14:48 +01:00
Andreas Kling
bc1da7f1fd Kernel: Snooze the NetworkTask until there are incoming packets to process.
This is accomplished using a new Alarm class and a BlockedSnoozing state.
Basically, you call Process::snooze_until(some_alarm) and then the scheduler
won't wake up the process until some_alarm.is_ringing() returns true.
2019-03-20 17:09:46 +01:00
Andreas Kling
93aa4d581d Meta: Tweak ReadMe and add a new screenshot. 2019-03-20 15:52:37 +01:00
Andreas Kling
cdb82f6fbb LibC: Fix bug in scanf() family where we'd capture invalid data. 2019-03-20 15:29:04 +01:00
Andreas Kling
951377e93e GTableView: Add ability to hide individual columns at view-level.
Use this in IRCClient to hide the "sender" column in the server message view
since everything in that view comes from the "Server" anyway.
2019-03-20 13:36:07 +01:00
Andreas Kling
d17a91f185 Move WindowServer into Servers. 2019-03-20 04:34:14 +01:00
Andreas Kling
9120b05a40 Rename DNSLookupServer => LookupServer. 2019-03-20 04:26:30 +01:00
Andreas Kling
67009cee8e IRCClient: Add ability to change nickname. 2019-03-20 04:21:58 +01:00
Andreas Kling
4ea625e08b Userland: Allow ping <hostname> :^) 2019-03-20 03:38:09 +01:00
Andreas Kling
696f9c5bc0 LibC: Let gethostbyname() handle IPv4 address as input.
It would be neat to do a reverse lookup too, but for now we just parse
the IPv4 address into a dword.
2019-03-20 03:37:05 +01:00
Andreas Kling
f47945759b LibGUI: Make GTableModel a retainable object.
It became clear that this class needs to support multiple owners.
2019-03-20 03:27:07 +01:00
Andreas Kling
41c744b3c8 Kernel: Don't panic if a call redirected to Device::open() has an error.
Just pass the error to the user. I hit this when opening so many Terminal
windows that PTYMultiplexer::open() ran out of master/slave pairs.
2019-03-20 02:55:12 +01:00
Andreas Kling
6f966ca51d Kernel: Accepting sockets don't need to retain the client sockets.
This is all taken care of by the respective FileDescriptors.
Before this patch, we were leaking every single socket, not great!
2019-03-20 02:48:02 +01:00