Commit graph

4992 commits

Author SHA1 Message Date
Andreas Kling 635717ed0f LibHTML: Add parse_html_fragment()
This function parses a partial DOM and returns it wrapped in a document
fragment node (DocumentFragment.)

There are now two entrances into the HTML parser, one for parsing full
documents, and one for parsing fragments. Internally the both wrap the
same parsing function.
2019-11-06 20:30:39 +01:00
Andreas Kling f404a1dc16 LibHTML: Add DocumentFragment
Right now this is just a simple ParentNode subclass with its node type
being DOCUMENT_FRAGMENT_NODE.
2019-11-06 20:27:53 +01:00
Andreas Kling 26493a3039 LibHTML: Add TreeNode::remove_child()
This removes a child from the tree and returns it to the caller.
It optionally (but by default) calls removed_from(parent) on the child.
2019-11-06 20:26:17 +01:00
Andreas Kling 9a5e065229 AK: Always rebuild unit tests if AK headers change
This is a hack to avoid failing AK unit tests because it didn't even
try to rebuild.
2019-11-06 19:14:34 +01:00
Andreas Kling 2f16e31afc Kernel: A running process should keep its TTY alive
It's not safe to use a raw pointer for Process::m_tty. A pseudoterminal
pair will disappear when file descriptors are closed, and we'd end up
looking dangly. Just use a RefPtr.
2019-11-06 16:52:54 +01:00
Andreas Kling 083c5f8b89 Kernel: Rework Process::Priority into ThreadPriority
Scheduling priority is now set at the thread level instead of at the
process level.

This is a step towards allowing processes to set different priorities
for threads. There's no userspace API for that yet, since only the main
thread's priority is affected by sched_setparam().
2019-11-06 16:30:06 +01:00
Andreas Kling e33bbdb6ba AK: Remove unused AK::not_implemented()
Whatever this was supposed to be, it was ironically... not implemented.
2019-11-06 13:58:08 +01:00
Andreas Kling 14dc323f4d Kernel: Sort the C++ objects in the Makefile 2019-11-06 13:45:21 +01:00
Andreas Kling 49635e62fa LibELF: Move AK/ELF/ into Libraries/LibELF/
Let's arrange things like this instead. It didn't feel right for all of
the ELF handling code to live in AK.
2019-11-06 13:42:38 +01:00
Andreas Kling 31beff8afb Kernel: Remove unnecessary init_ksyms() function 2019-11-06 13:36:37 +01:00
Andreas Kling 4f4d4670fe Kernel: Don't instantiate and throw away ProcFS + DevPtsFS on boot
Oops, we were creating these and then throwing them away. They will
get instantiated a bit later, when we bring up the mounts in /etc/fstab
from userspace.
2019-11-06 13:21:44 +01:00
Andreas Kling 9a4b117f48 Kernel: Simplify kernel entry points slightly
It was silly to push the address of the stack pointer when we can also
just change the callee argument to be a value type.
2019-11-06 13:15:55 +01:00
Andreas Kling 349d2ec1c2 Kernel: Link with libgcc
This allows us to get rid of all the custom 64-bit division helpers.
I wanted to do this ages ago but couldn't get it working. Turns out it
was unstable due to libgcc using the regular ABI and the kernel being
built with -mregparm=3.

Now that we build the kernel with regular calls, we can just link with
libgcc and get this stuff for free. :^)
2019-11-06 13:07:07 +01:00
Andreas Kling 1c6f8d3cbd Kernel: Don't build with -mregparm=3
It was really confusing to have different calling conventions in kernel
and userspace. Also this has prevented us from linking with libgcc.
2019-11-06 13:04:47 +01:00
Andreas Kling 01b21e5e05 Kernel: Use KParams::has() instead of !KParams::get().is_null()
Also rename a local variable to be consistent with what it represents.
2019-11-06 11:47:04 +01:00
Andreas Kling 9e570d0d6d Kernel+SystemServer: Get rid of two virtual consoles
Having four virtual (text) consoles by default seems really overkill
for a system that can't even switch to them anyway (yet!)
2019-11-06 11:41:50 +01:00
Andreas Kling 2ad0ec325a AK: Get rid of TStyle (output styling helper for LogStream)
This didn't end up getting used, so let's get rid of it.
2019-11-06 11:37:03 +01:00
Andreas Kling 1c8f017730 Kernel: Remove unused SynthFS filesystem
This used to be the base class of ProcFS and DevPtsFS but not anymore.
2019-11-06 11:36:24 +01:00
Andreas Kling f3f0b08d43 LibHTML: Build some foundation for text selection
Add LayoutPosition and LayoutRange classes. The layout tree root node
now has a selection() LayoutRange. It's essentially a start and end
LayoutPosition.

A LayoutPosition is a LayoutNode, and an optional index into that node.
The index is only relevant for text nodes, where it's the character
index into the rendered text.

HtmlView now updates the selection start/end of the LayoutDocument when
clicking and dragging with the left mouse button.

We don't paint the selection yet, and there's no way to copy what's
selected. It only exists as a LayoutRange.
2019-11-05 22:13:26 +01:00
Andreas Kling 2755184e11 HackStudio: Update the "remove current editor" action enabled state
This action should not be enabled when there is only one editor open,
since you are not allowed to be editor-less.
2019-11-05 21:08:17 +01:00
Andreas Kling cb627a3ada HackStudio: Allow removing the current editor with Alt+Shift+E
Note that you are not allowed to remove the very last editor.

These keybinds are all temporary while I figure out what the right ones
should be. I'm not exactly sure how, but it'll reveal itself. :^)
2019-11-05 21:02:31 +01:00
Andreas Kling 538d5f82c1 HackStudio: Allow switching between editors with Ctrl+E / Ctrl+Shift+E 2019-11-05 20:56:36 +01:00
Andreas Kling f844715106 HackStudio: Allow adding more editors by pressing Ctrl+Alt+E
We also now start out with a single editor, instead of two. :^)
2019-11-05 20:56:30 +01:00
Andreas Kling d3558b6137 LibCore+LibGUI: Allow inserting a CObject/GWidget before another
When adding a widget to a parent, you don't always want to append it to
the set of existing children, but instead insert it before one of them.

This patch makes that possible by adding CObject::insert_child_before()
which also produces a ChildAdded event with an additional before_child
pointer. This pointer is then used by GWidget to make sure that any
layout present maintains the correct order. (Without doing that, newly
added children would still be appended into the layout order, despite
having a different widget sibling order.)
2019-11-05 20:41:27 +01:00
Andreas Kling 0f81eaf8a2 HackStudio: Put annoying debug spam behind EDITOR_DEBUG 2019-11-05 20:09:06 +01:00
Till Mayer ac9907ee61 SoundPlayer: Changed some small cosmetic things
Renamed "Position" to "Elapsed". "channel/channels" automatically
changes now when more than one channel exist. The current file name
is now displayed in the window title.
2019-11-05 19:50:11 +01:00
Till Mayer 94a9649945 AWavLoader: Fixed incorrect computation of m_loaded_samples
m_loaded_samples was incremented with the value of the processed
buffer. This causes m_loaded_samples to be bigger at some point
than m_total_samples when downsampling, as the buffer would contain
more samples than actually loaded.
2019-11-05 19:50:11 +01:00
Andreas Kling 173ae370db disk_benchmark: Add a -c flag to enable use of disk caches
By default, disk_benchmark will now use the O_DIRECT flag, causing it
to bypass the kernel's disk caches. This gives you "disk performance"
numbers rather than "disk cache performance" numbers.

You can use "disk_benchmark -c" to enable the caches.

Fixes #703.
2019-11-05 19:37:23 +01:00
Andreas Kling 59ed235c85 Kernel: Implement O_DIRECT open() flag to bypass disk caches
Files opened with O_DIRECT will now bypass the disk cache in read/write
operations (though metadata operations will still hit the disk cache.)

This will allow us to test actual disk performance instead of testing
disk *cache* performance, if that's what we want. :^)

There's room for improvment here, we're very aggressively flushing any
dirty cache entries for the specific block before reading/writing that
block. This is done by walking the entire cache, which may be slow.
2019-11-05 19:35:12 +01:00
Andreas Kling 3de3daf765 run: Unbreak the run script 2019-11-05 18:56:43 +01:00
Andreas Kling 1466a7364c LibHTML: Add TreeNode::next_in_pre_order()
This function allows you to traverse in pre-order without recursing.
2019-11-05 18:36:06 +01:00
Dan MacDonald 17752b2973 run: Comment out qemu packet capture 2019-11-05 18:07:49 +01:00
João Paulo Pulga 4d3be45ff4 HackStudio: Don't parse documentation if already parsed 2019-11-05 07:06:15 +01:00
Till Mayer 77f3c12dc9 SoundPlayer: Added playback controls
The playback of a file can now be paused, stopped, continued and the
user can seek to any part of the file.
2019-11-04 20:55:46 +01:00
Till Mayer 2f13517a1a LibAudio: Added playback control features to audio server
LibAudio now supports pausing playback, clearing the buffer queue,
retrieving the played samples since the last clear and retrieving
the currently playing shared buffer id
2019-11-04 20:55:46 +01:00
Till Mayer e7ccbdbe30 SoundPlayer: Added playback control icons and application icon 2019-11-04 20:55:46 +01:00
Till Mayer 4c9fdad1bf LibGUI: Added getter for m_dragging 2019-11-04 20:55:46 +01:00
Till Mayer 112d36bfa0 SoundPlayer: Make sample widget display contents of the whole buffer
The SampleWidget now displays the contents of the whole buffer.
2019-11-04 20:55:46 +01:00
Andreas Kling 4623811ec3 AK: Let's just log unimplemented printf() format strings
It's too dang frustrating that we actually crash whenever we hit some
unimplemented printf specifier. Let's just log the whole format string
and carry on as best we can.
2019-11-04 20:48:30 +01:00
Andreas Kling 715d7a8532 LibHTML: Add a convenient way to get from any layout node to the root 2019-11-04 20:45:47 +01:00
Your Name 2946b0e2d4 Janitorial: Have sync.sh sudo automagically
Run sudo and keep environment just like in makeall.sh
2019-11-04 19:42:21 +01:00
Your Name e46b251d61 SystemMonitor: Add device column to filesystems tab 2019-11-04 19:42:21 +01:00
Andreas Kling f215f0c226 ProcFS: Fix Clang build (or really, Qt Creator syntax highlighting)
The Clang parser used by Qt Creator kept getting confused by this code.
2019-11-04 18:14:04 +01:00
Hüseyin ASLITÜRK e2f0ac13a4 FileManager: Remember my last view mode (#731) 2019-11-04 17:27:56 +01:00
Andreas Kling f76168a3ea FileManager: Make copying faster with ftruncate() and a bigger buffer
Apply the same techniques from "cp" to make copying files much faster.
2019-11-04 17:25:44 +01:00
Andreas Kling 721585473b Ext2FS: Don't uncache inodes while they are being watched
If an inode is observed by watch_file(), we won't uncache it.
This allows a program to watch a file without keeping it open.
2019-11-04 17:25:44 +01:00
Dan MacDonald 56bbf30f28 Ports: Add nesalizer NES emulator (#722) 2019-11-04 15:18:27 +01:00
Jesse Buhagiar 6c1a549057 PATAChannel: Alert user when no PCI device is found
This helps aid debugging of issues such as #695, where the bridge chip
that controls IDE is NOT a PIIX3/4 compatible controller. Instead of
just hanging when the DMA registers can't be accessed, the system will
inform the user that no valid IDE controller has been found. In this
case, the system will not attempt to initialise the DMA registers and
instead use PIO mode.
2019-11-04 15:15:48 +01:00
Andreas Kling 1b2ef8582c Kernel: Make File's can_read/can_write take a const FileDescription&
Asking a File if we could possibly read or write it will never mutate
the asking FileDescription&, so it should be const.
2019-11-04 14:03:14 +01:00
Andreas Kling e8fee92357 Kernel: Don't update fd offset on read/write error
If something goes wrong with a read or write operation, we don't want
to add the error number to the fd's offset. :^)
2019-11-04 13:58:28 +01:00