Commit graph

6448 commits

Author SHA1 Message Date
Sergey Bugaev c0b32f7b76 Meta: Claim copyright for files created by me
This changes copyright holder to myself for the source code files that I've
created or have (almost) completely rewritten. Not included are the files
that were significantly changed by others even though it was me who originally
created them (think HtmlView), or the many other files I've contributed code to.
2020-01-24 15:15:16 +01:00
Dan MacDonald f1e9588040 Ports: Add GNU sed 4.2.1 (#1127)
4.2.1 was the last version not to depend upon Gnulib.
2020-01-24 14:09:52 +01:00
Brian Callahan d22415631f Ports: Add byacc port 2020-01-24 11:36:18 +01:00
Brian Callahan b8b2b30102 Ports: Add flex and pcre2 ports 2020-01-24 11:36:01 +01:00
Andreas Kling ca413a5b50 AK: Use swap-based assignment in OwnPtr
Also provide a specialized swap(OwnPtr, OwnPtr) that allows swapping
an OwnPtr with itself.
2020-01-24 09:35:55 +01:00
Andreas Kling 7c74d3a657 TextEditor: Focus the editor after opening a new file 2020-01-23 21:33:15 +01:00
Andreas Kling 1c34348b0c GTextEditor: Create the "go to line" action eagerly
Previously it was created the first time you requested a context menu
for the GTextEditor by right-clicking in it.

That meant it wasn't possible to use Ctrl+L to "go to line" before you
had first right-clicked the editor.
2020-01-23 21:33:15 +01:00
Andreas Kling a33259483a GTextEditor: Move "Go to line" feature from HackStudio into GTextEditor
This is a handy feature for any multi-line GTextEditor, so let's just
have it in the base widget. :^)

Fixes #1122.
2020-01-23 21:33:15 +01:00
Andreas Kling ebfb3d91e2 TextEditor: Various UI text tweaks 2020-01-23 21:33:15 +01:00
Andreas Kling 9e2c595c64 GTextEditor: Make color of non-highlighted line numbers darker
Fixes #1123.
2020-01-23 21:33:15 +01:00
Andreas Kling b88be25214 GTextEditor: Disable auto-indentation while pasting
Fixes #1121.
2020-01-23 21:33:15 +01:00
Andreas Kling 14b83ee12f LibGUI: Give GTextDocument access to the GTextEditor during commands
It's useful for the GTextDocument to have access to the initiating
GTextEditor widget during the initial execution of a command.

Since commands are executed via calls to GUndoCommand::redo(), we do
this by wrapping the invocation of redo() in a new helper called
GTextDocumentUndoCommand::execute_from(GTextDocument::Client).

This is then used to fetch the current auto-indentation feature state
and the soft tab width, both used by text insertion.
2020-01-23 21:33:15 +01:00
Andreas Kling 03d73cbaae Kernel: Allow Socket subclasses to fail construction
For example, socket(AF_INET) should only succeed for valid SOCK_TYPEs.
2020-01-23 21:33:15 +01:00
Andreas Kling a93f35ac71 LibCore: Remove redundant check in CObject::dispatch_event() 2020-01-23 21:33:15 +01:00
Brian Callahan b90af9b1ed Ports: Add mawk port (#1117) 2020-01-23 20:41:40 +01:00
Andreas Kling 3de5439579 AK: Let's call decrementing reference counts "unref" instead of "deref"
It always bothered me that we're using the overloaded "dereference"
term for this. Let's call it "unreference" instead. :^)
2020-01-23 15:14:21 +01:00
Andreas Kling 4aa1b5b40e LibC: The pwd and grp related functions need to preserve empty fieldso
Now that String::split() defaults to keep_empty=false, we need to make
sure the pwd and grp functions in LibC keep the empty ones.

This fixes "id" moaning about invalid lines in /etc/group.
2020-01-23 14:33:58 +01:00
Andreas Kling 95504b5850 Base: Note in pledge(2) man page which promises are extensions
Also add a little "History" section noting that pledge() is an original
OpenBSD invention and that our implementation differs in many ways.
2020-01-23 10:41:07 +01:00
Andreas Kling 15aac1f9e9 Build: Fix silly mistake in makeall.sh 2020-01-23 10:41:07 +01:00
Brian Gianforcaro cf151fa0e1 rpcdump: Use pledge() and unveil() 2020-01-23 10:22:54 +01:00
Brian Gianforcaro e3e22cd42e lspci: Use pledge() and unveil() 2020-01-23 09:51:45 +01:00
Andreas Kling d66bbc21ce AK: Unbreak FileSystemPath after String::split() changes
FileSystemPath(".") should not have a title(). This was caught by the
unit test for FileSystemPath, yay! :^)
2020-01-22 22:35:12 +01:00
Andreas Kling e64c335e5a Revert "Kernel: Replace IRQHandler with the new InterruptHandler class"
This reverts commit 6c72736b26.

I am unable to boot on my home machine with this change in the tree.
2020-01-22 22:27:06 +01:00
Oliver Kraitschy 8e21e31b3a Build: use absolute path for /sbin/mke2fs
Distros like Debian and Ubuntu don't have /sbin in PATH, thus mke2fs is
not found.
2020-01-22 22:04:29 +01:00
Sergey Bugaev b6aae25244 LibGUI: Rename GAbstractColumnView to GAbstractTableView
This is to prevent confusion with GColumnsView, which is unrelated.
2020-01-22 21:22:23 +01:00
Sergey Bugaev dec95cb8b3 LibGUI: Let GModel specify the drag data type
GModel subclasses can now override drag_data_type() to specify which type
GAbstractView should set for drag data. The default implementation returns a
null string, which disables dragging from this widget.
2020-01-22 21:22:23 +01:00
Sergey Bugaev d3ce7ae0e3 LibGUI: Move most of mouse event handling to GAbstractView
This deduplicates existing code, and also gives all the model-backed widgets
selection manipulation and drag support for free :^)
2020-01-22 21:22:23 +01:00
Sergey Bugaev fd11c96e8e LibGUI: Misc tweaks
Minus two empty lines because clang-format insists on it,
and plus an underscore.
2020-01-22 21:22:23 +01:00
Sergey Bugaev 91d3fc54be LibGUI: Move index_at_event_position() up to GAbstractView
It's now an abstract (pure virtual) public method in GAbstractView that
individual widgets have to implement. This will allow us to move more
selection-related logic into GAbstractView in order to share it between
implementations.
2020-01-22 21:22:23 +01:00
Sergey Bugaev ff66101f9e LibGUI: Add GItemView::index_at_event_position()
This replaces GItemView::item_at_event_position(), which used to return a raw
int, requiring callers to call model()->index() with it again.
2020-01-22 21:22:23 +01:00
Sergey Bugaev 2ccad40a16 LibGUI: Add GListView::index_at_event_position()
And port GListView::mousedown_event() to it.
2020-01-22 21:22:23 +01:00
Sergey Bugaev b4923938e1 LibVT: Input dragged file path into the terminal on drop
We also support dropping plain text and non-file URLs.
2020-01-22 21:22:23 +01:00
Sergey Bugaev 6a64077ed7 AK: Also add a keep_empty argument to String::split[_limit]()
Just like String[View]::split_view() has already.
2020-01-22 21:22:23 +01:00
Jesse Buhagiar 9cbce68b1d Meta: Change copyright holder of `FloppyDiskDevice.* 2020-01-22 14:37:44 +01:00
Liav A 6c72736b26 Kernel: Replace IRQHandler with the new InterruptHandler class
System components that need an IRQ handling are now inheriting the
InterruptHandler class.

In addition to that, the initialization process of PATAChannel was
changed to fit the changes.
PATAChannel, E1000NetworkAdapter and RTL8139NetworkAdapter are now
inheriting from PCI::Device instead of InterruptHandler directly.
2020-01-22 12:22:09 +01:00
Liav A 1ee37245cd Kernel: Introduce IRQ sharing support
The support is very basic - Each component that needs to handle IRQs
inherits from InterruptHandler class. When the InterruptHandler
constructor is called it registers itself in a SharedInterruptHandler.
When an IRQ is fired, the SharedInterruptHandler is invoked, then it
iterates through a list of the registered InterruptHandlers.

Also, InterruptEnabler class was created to provide a way to enable IRQ
handling temporarily, similar to InterruptDisabler (in CPU.h, which does
the opposite).

In addition to that a PCI::Device class has been added, that inherits
from InterruptHandler.
2020-01-22 12:22:09 +01:00
Liav A 2a160faf98 Kernel: Run clang-format on KeyboardDevice.cpp 2020-01-22 12:22:09 +01:00
Brian Gianforcaro ce6864dd79 man: Use unveil() 2020-01-22 11:40:41 +01:00
Brian Gianforcaro 319cb28452 dmesg: Use pledge() and unveil() 2020-01-22 11:40:22 +01:00
Brian Gianforcaro 521c6dbbee LookupServer: Lock unveil() after initialization.
Once LookupServer is initialized it should never need
access to any any paths for the lifetime of the process.

Lock the veil post initialization.
2020-01-22 11:25:09 +01:00
Andreas Kling 50f9d27d3b Help: Use unveil() 2020-01-21 22:09:12 +01:00
Andreas Kling 72d68b4025 LibCore: Fix broken "stay_within" mechanism in event dispatch
The "stay_within" parameter to CObject::dispatch_event() optionally
specifies a node in the CObject parent chain where event dispatch
should stop bubbling upwards.

Since event dispatch is done recursively, this was not working right,
as we would simply return from the innermost dispatch loop, leaving
the event un-accepted, which meant that the penultimately inner
dispatch loop would pick up the event and keep bubbling it anyway.

This made it possible for events to jump across window boundaries
within an application, in cases where one window was a CObject ancestor
of another window. This is typically the case with dialog windows.

Fix #1078.
2020-01-21 21:55:25 +01:00
Andreas Kling a5e482833d LibGUI: Make GDialog accept escape key press events
Anyone who "handles" an event should really also be accepting it.
2020-01-21 21:55:25 +01:00
Andreas Kling 82cb5b6f64 LibGUI: GFileSystemModel::index() now survives negative inputs
If asked to create an index with negative row and/or column, we should
just return an invalid GModelIndex() instead of asserting.
2020-01-21 21:55:25 +01:00
Andreas Kling ecd5589d4f LibGUI: Fix missing initializer for GColumnsView::m_model_column 2020-01-21 21:55:25 +01:00
Andreas Kling a14f08fcc9 LibGUI: Import GColorPicker from the PaintBrush application 2020-01-21 21:55:25 +01:00
Andreas Kling 30ad7953ca Kernel: Rename UnveilState to VeilState 2020-01-21 19:28:59 +01:00
Andreas Kling 66598f60fe SystemMonitor: Show process unveil() state as "Veil"
A process has one of three veil states:

- None: unveil() has never been called.
- Dropped: unveil() has been called, and can be called again.
- Locked: unveil() has been called, and cannot be called again.
2020-01-21 18:56:23 +01:00
Andreas Kling edf509c19e SystemMonitor: Use unveil() 2020-01-21 18:45:18 +01:00
Andreas Kling 41716aebde Shell: Disable SH_DEBUG by default and tidy up command timing logging 2020-01-21 16:22:31 +01:00