Commit Graph

4492 Commits

Author SHA1 Message Date
Andreas Kling
786494b62d LibHTML: Adjust mouse event positions before using them for hit testing
This fixes the issue where you couldn't click on links at the bottom of
scrollable documents. :^)
2019-10-03 09:17:27 +02:00
Andreas Kling
a181cae3e0 GScrollableWidget: Add to_content_position(Point)
A handy helper function for converting a widget space coordinate into a
content space coordinate.
2019-10-03 09:15:57 +02:00
Sergey Bugaev
f02c9aaac4 LibGUI: Remove GModel::on_selection_changed
The selection is no longer managed by the model.
2019-10-03 08:23:54 +02:00
Sergey Bugaev
395e4210ef Help: Follow clicked links
This also adds a toolbar and a menu which allow you to
navigate back and forth through history ^)
2019-10-03 08:23:54 +02:00
Sergey Bugaev
afdc5688ec LibC: Implement dirname() and basename()
And write section 3 man pages for them.
2019-10-03 08:23:54 +02:00
Sergey Bugaev
8fbcfa934a Base: Add some "See also" links to the man pages
We can do this now that we have link support in LibMarkdown and LibHTML ^)
2019-10-03 08:23:54 +02:00
Sergey Bugaev
30437b0936 LibMarkdown: Implement link support
We can now parse links that like this:

   visit the [SerenityOS home page](http://www.serenityos.org/)

producing proper <a> HTML elements ^)
2019-10-03 08:23:54 +02:00
Sergey Bugaev
3c90aab7dd Build: Add LibMarkdown to the library search path 2019-10-03 08:23:54 +02:00
Sergey Bugaev
ad51a70c54 Ports: Add a TinyCC port
It does build, but doesn't quite work yet.
2019-10-03 08:18:05 +02:00
Sergey Bugaev
89bf38864a LibC: Misc additions 2019-10-03 08:18:05 +02:00
Brandon Scott
17597f4681 LibGUI: Fix GDirectoryModel lifetime bug.
Thumbnail generation callbacks were getting called after the class was already being destroyed causing a crash to occur.
2019-10-03 08:17:41 +02:00
Andreas Kling
9da121f837 SystemMonitor: Make all tabs except the process table lazily loaded
We now use GLazyWidget for all the secondary tabs, which makes the
program start up way faster than before.

There's a noticeable delay when you click on the "PCI Devices" tab
for the first time, but that's definitely better than always eating
that delay before seeing a window at all. :^)
2019-10-02 20:26:19 +02:00
Andreas Kling
183f7c9830 LibGUI: Add GLazyWidget, a convenience widget for lazily-built UI's
Here's how you can use this to speed up startup time:

    auto widget = GLazyWidget::construct();
    widget->on_first_show = [](auto& self) {
        self.set_layout(...);
        ...
    };

Basically, it allows you to delay building the widget subtree until
it's shown for the first time.
2019-10-02 20:24:29 +02:00
Andreas Kling
7e2b9c3c40 GWidget: Dispatch Show and Hide events when widget visibility changes 2019-10-02 20:24:03 +02:00
Andreas Kling
3f2c1a2e3d Kernel: Add SIOCGIFHWADDR ioctl to get the MAC address of an adapter 2019-10-02 18:20:11 +02:00
Andreas Kling
345086ab72 BXVGADevice: Log a debug message whenever the resolution changes
Fixes #618.
2019-10-02 17:16:46 +02:00
Andreas Kling
da463d9b11 Terminal: Remove crashy assertion about line length
If we resize/maximize the window, we might end up with some lines in
history that had a different length than the current terminal width.
That's okay, so let's not crash because of it.

Fixes #620.
2019-10-02 17:12:46 +02:00
Andreas Kling
35138437ef Kernel+SystemMonitor: Add fault counters
This patch adds three separate per-process fault counters:

- Inode faults

    An inode fault happens when we've memory-mapped a file from disk
    and we end up having to load 1 page (4KB) of the file into memory.

- Zero faults

    Memory returned by mmap() is lazily zeroed out. Every time we have
    to zero out 1 page, we count a zero fault.

- CoW faults

    VM objects can be shared by multiple mappings that make their own
    unique copy iff they want to modify it. The typical reason here is
    memory shared between a parent and child process.
2019-10-02 14:13:49 +02:00
Andreas Kling
c33ac7f170 Kernel: Don't update Thread TSS if scheduler tick reschedules it
If we didn't find anything else that wants to run, we don't need to
update the current thread's TSS since we're just gonna return to the
same thread anyway.
2019-10-02 13:47:44 +02:00
Andreas Kling
5ab044beae Ext2FS: Make Ext2FSInode::is_directory() fast
This patch overloads Inode::is_directory() with a faster version that
doesn't require instantiating the whole InodeMetadata.

If you have an Ext2FSInode&, calling is_directory() should be instant
since we can just look directly at the raw inode bits.
2019-10-02 13:47:44 +02:00
Andreas Kling
d553bae749 Kernel: Allocate more 8-byte slabs than anything else
We need these for PhysicalPage objects. Ultimately I'd like to get rid
of these objects entirely, but while we still have to deal with them,
let's at least handle large demand a bit better.
2019-10-02 13:47:40 +02:00
Andreas Kling
8f842375a2 LibHTML: Implement the <hr> element
This also meant I had to implement basic support for the border-styles
"inset" and "outset". If it's neither of those, we default to "solid".
2019-10-01 20:50:11 +02:00
Andreas Kling
53fae2af4f LibHTML: Implement basic border rendering
We currently assume the border-style is solid, and simply draw a box
around the padded LayoutNode rect. :^)
2019-10-01 20:31:56 +02:00
Andreas Kling
7573e3c46d LibHTML: Include padding when rendering background colors 2019-10-01 20:25:31 +02:00
Andreas Kling
86b7dd6d5d LibHTML: Tweak default CSS to bring it a bit closer to HTML4 2019-10-01 20:16:42 +02:00
Andreas Kling
53db492aba Base: Rename the "html" test directory to "www"
It was conflicting with the html program and I'm too lazy to deal with
that right now. :^)
2019-10-01 20:16:09 +02:00
Andreas Kling
d481ae95b5 Kernel: Defer creation of Region CoW bitmaps until they're needed
Instead of allocating and populating a Copy-on-Write bitmap for each
Region up front, wait until we actually clone the Region for sharing
with another process.

In most cases, we never need any CoW bits and we save ourselves a lot
of kmalloc() memory and time.
2019-10-01 19:58:41 +02:00
Andreas Kling
9e7560fae9 AK: Make Bitmap constructors public to allow make<Bitmap>()
I don't love this, but I also don't love the Bitmap class in general.
2019-10-01 19:58:07 +02:00
Andreas Kling
3d4ed7f38d Kernel: mmap() with both MAP_PRIVATE and MAP_SHARED is an error 2019-10-01 19:31:55 +02:00
Andreas Kling
c58d1868cb Kernel: Fix munmap() bad splitting of already-split Regions
When splitting an Region that's already the result of an earlier split,
we have to take the Region's offset-in-VMObject into account since it
may be non-zero.
2019-10-01 11:40:40 +02:00
Andreas Kling
4bfd4dc6c7 AK: Remove empty files JsonArray.cpp and JsonObject.cpp 2019-10-01 11:24:54 +02:00
Brandon Scott
08a1fb8f1a LibGUI+PaintBrush: Fix to GFilePicker and PaintBrush enhancements.
GFilePicker
- Fixed GFilePicker to use new ref-counted construct method to stop crashing on open dialog.
  - PaintBrush is still crashing on open dialog due to an unrelated issue.

PaintBrush
- Created 16x16 icon for PaintBrush
- Moved Open option into App menu.
- Changed help menu to make use of the standardized About dialog.
2019-10-01 09:17:56 +02:00
Larkin Nickle
3fb88cb76d Help+man.md: Add man sections
Also correct minor formatting mistake in TelnetServer.md.
2019-09-30 21:38:39 +02:00
Larkin Nickle
e7c2467231 Add TelnetServer man page 2019-09-30 21:38:39 +02:00
Andreas Kling
a5e5a3fab7 LibHTML: Implement basic support for inline style attributes
You can now style elements with inline styles:

    <div style="color: #ff0000">This is red!</div>

Pretty neat :^)
2019-09-30 20:25:33 +02:00
Andreas Kling
b2a0d20580 LibHTML: Refactor the CSS parser into a class
Also added a parser function for standalone style declarations.
2019-09-30 20:24:38 +02:00
Andreas Kling
8d797fc62e LibHTML: Fix incorrect CSS object model
A StyleRule has a StyleDeclaration which has many StyleProperty. :^)
2019-09-30 20:06:17 +02:00
Andreas Kling
ac20919b13 Kernel: Make it possible to turn off VM guard pages at compile time
This might be useful for debugging since guard pages introduce a fair
amount of noise in the virtual address space.
2019-09-30 17:22:16 +02:00
Andreas Kling
1a279c5b2a GMessageBox: Hide the constructor and fix broken usages
We no longer support creating CObjects on the stack. Use construct().
2019-09-30 17:20:53 +02:00
Andreas Kling
c5e057438c MBVGADevice: Log address/pitch/width/height when created 2019-09-30 15:04:16 +02:00
Andreas Kling
8e775d241e Kernel: Make DiskBackedFS flush writes if cache is completely dirty
If we want to make a new entry in the disk cache when it's completely
full of dirty blocks, we'll now synchronously flush the writes at that
point. Maybe it's not ideal, but at least we can keep going.
2019-09-30 11:46:56 +02:00
Andreas Kling
922fd703c9 Kernel: Convert the DiskBackedFS write API to take "const u8*"
This way clients are not required to have instantiated ByteBuffers
and can choose whatever memory scheme works best for them.

Also converted some of the Ext2FS code to use stack buffers instead.
2019-09-30 11:23:36 +02:00
Andreas Kling
1fc2612667 Kernel: Make DiskBackedFS::read_block() write to client-provided memory
Instead of having DiskBackedFS allocate a ByteBuffer, leave it to each
client to provide buffer space.

This is significantly faster in many cases where we can use a stack
buffer and avoid heap allocation entirely.
2019-09-30 11:04:30 +02:00
Andreas Kling
a61f6ccc27 Kernel: Implement a simpler, bigger cache for DiskBackedFS
The hashmap cache was ridiculously slow and hurt us more than it helped
us. This patch replaces it with a flat memory cache that keeps up to
10'000 blocks in cache with a simple dirty bit.

The syncd task will wake up periodically and call flush_writes() on all
file systems, which now causes us to traverse the cache and write all
dirty blocks to disk.

There's a ton of room for improvement here, but this itself is already
drastically better when doing repeated GCC invocations.
2019-09-30 10:34:50 +02:00
Andreas Kling
8f45a259fc ByteBuffer: Remove pointer() in favor of data()
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-30 08:57:01 +02:00
Andreas Kling
dd696e7c75 LibM: Fix Toolchain build
We can't rely on libstdc++ inside LibC or LibM, since these libraries
are part of the Toolchain bringup build.
2019-09-29 22:07:02 +02:00
Andreas Kling
941981ec4f LibM: Implement various trig functions
Patch from Anonymous.
2019-09-29 21:04:08 +02:00
Andreas Kling
3ebfa9f044 LibDraw: Some build fixes for strange platforms
Patch from Anonymous.
2019-09-29 21:02:49 +02:00
Andreas Kling
6d7854919a LibC: Some build fixes for strange platforms
Patch from Anonymous.
2019-09-29 21:02:13 +02:00
Andreas Kling
3900eebf15 FileManager+LibGUI+html: Add an icon to represent HTML files
This also becomes the app icon for the little "html" program. :^)
2019-09-29 21:00:41 +02:00