Commit Graph

1283 Commits

Author SHA1 Message Date
Linus Groh
fd8c250866 LibVT: Replace escape$h_l with SM (Set Mode) / RM (Reset Mode) 2020-01-26 15:58:06 +01:00
Linus Groh
be57b81336 LibVT: Rename escape$f to HVP (Horizontal and Vertical Position) 2020-01-26 15:58:06 +01:00
Linus Groh
2edd8e37ae LibVT: Rename escape$c to DA (Device Attributes) 2020-01-26 15:58:06 +01:00
Linus Groh
dcb5bf9e50 LibVT: Rename escape$m to SGR (Select Graphic Rendition) 2020-01-26 15:58:06 +01:00
Linus Groh
296afbe624 LibVT: Rename escape$H to CUP (Cursor Position) 2020-01-26 15:58:06 +01:00
Linus Groh
5cdfc58242 LibVT: Rename escape$D to CUB (Cursor Backward) 2020-01-26 15:58:06 +01:00
Linus Groh
428a55a196 LibVT: Rename escape$C to CUF (Cursor Forward) 2020-01-26 15:58:06 +01:00
Linus Groh
35310dbd22 LibVT: Rename escape$B to CUD (Cursor Down) 2020-01-26 15:58:06 +01:00
Linus Groh
cc73284c64 LibVT: Rename escape$A to CUU (Cursor Up) 2020-01-26 15:58:06 +01:00
Andreas Kling
3c129172d4 LibCore: Add UDP socket and server classes 2020-01-26 14:45:07 +01:00
Andreas Kling
8e7e502f37 LibCore: CSocket::set_blocking() was backwards 2020-01-26 14:29:33 +01:00
Andreas Kling
f24173b0f1 LibC: Only accept the first response from LookupServer in netdb code
If a DNS server responds with multiple answers for a question, we will
get a newline-separated sequence of answers from LookupServer.

However, we don't handle this properly yet in LibC, so just split the
response by line and only care about the first answer for now.
2020-01-26 12:23:37 +01:00
Andreas Kling
8c1f2d7131 LibVT: Rename escape$K and escape$J to EL and ED respectively
We should rename all of these functions to match the real VT100 names.
This will make it 100% easier to work on LibVT.

For reference: https://vt100.net/docs/vt100-ug/
2020-01-25 20:54:40 +01:00
Andreas Kling
4ed5c13792 LibVT: Fix off-by-ones in ED (Erase in Display) and EL (Erase in Line) 2020-01-25 20:51:49 +01:00
Andreas Kling
a3069b16fd LibVT: Make backspace (BS) non-destructive
I did not realize this was a thing. This fixes an artifact in vttest.
2020-01-25 20:39:23 +01:00
Andreas Kling
dca92af431 LibVT: Support IND and RI (cursor down/up basically) 2020-01-25 20:26:35 +01:00
Andreas Kling
0d191aae13 LibVT: Rename EscapeState::ExpectBracket => GotEscape
Seems like there are many escape sequences that don't start with
brackets, so let's call the post-escape state "GotEscape" instead. :^)
2020-01-25 20:02:31 +01:00
Andreas Kling
897ad1b927 LibVT: Support NEL (Next Line)
I think this can just behave as if you sent a newline character ('\n').
2020-01-25 20:01:43 +01:00
Andreas Kling
ab77bd4c3a LibVT: Support <esc>#8 to fill screen with E's
This is apparently a "confidence test" supported by VT100.
2020-01-25 19:52:35 +01:00
Andreas Kling
25f04b06ad LibVT: Don't go into "stomp" state after moving the cursor
The curious "stomp" state occurs when you type your way all the way
over to the right side of the terminal buffer, and we "stomp" once on
the very last column, before jumping to the next line.

We should never go into "stomp" state in response to programmatically
setting the cursor position. This fixes a small artifact in vttest.
2020-01-25 19:50:23 +01:00
Andreas Kling
20e41ab381 LibVT: Support HVP (Horizontal and Vertical Position) (final 'f') 2020-01-25 19:49:42 +01:00
Andreas Kling
e6f5ce8285 LibVT: Support the DA (Device Attributes) request (final 'c')
This is used by vttest on startup to query the device for identity.
2020-01-25 19:12:08 +01:00
Andreas Kling
74829cdb75 LibIPC: Short-cirtcuit post_message() if socket already disconnected
To allow for more asynchronous teardown of IClientConnection, make the
post_message() function simply return if called after the IPC socket
has been closed.
2020-01-25 10:34:32 +01:00
Andreas Kling
b0192cfb38 Meta: Remove some copyright headers added in error 2020-01-25 10:34:32 +01:00
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
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
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
a93f35ac71 LibCore: Remove redundant check in CObject::dispatch_event() 2020-01-23 21:33:15 +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
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
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
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
5b992b130a LibDraw: Remove old PNG_STOPWATCH_DEBUG debug code 2020-01-21 15:40:14 +01:00
Andreas Kling
07075cd001 Kernel+LibC: Clean up open() flag (O_*) definitions
These were using a mix of decimal, octal and hexadecimal for no reason.
2020-01-21 13:34:39 +01:00
Andreas Kling
6081c76515 Kernel: Make O_RDONLY non-zero
Sergey suggested that having a non-zero O_RDONLY would make some things
less confusing, and it seems like he's right about that.

We can now easily check read/write permissions separately instead of
dancing around with the bits.

This patch also fixes unveil() validation for O_RDWR which previously
forgot to check for "r" permission.
2020-01-21 13:27:08 +01:00