Commit Graph

1293 Commits

Author SHA1 Message Date
Andreas Kling
e7512ae2d1 GFileSystemModel: Don't copy the null-terminator after readlink() 2020-01-28 10:52:10 +01:00
Andreas Kling
c5db596c78 LibGUI: Fix crash when trying to scroll above the head of the document
We can't go higher than line 0. Can't rely on max() here since line
numbers are unsigned.

Fixes #1145.
2020-01-27 22:59:46 +01:00
Andreas Kling
f7b394af7d LibGUI: Add symlink targets as a column in GFileSystemModel
Also make sure to hide this column by default where we don't expect
to see it.
2020-01-27 22:19:05 +01:00
Andreas Kling
f2f0965edd LibGUI: Have GFileSystemModel use stat instead of lstat for the root
This allows you to set the GFileSystemModel root to a symlink to a
directory and it nicely opens that directory like you would expect.
2020-01-27 22:10:19 +01:00
Andreas Kling
65961d3ffc LibC: Add WSTOPSIG macro
This macro can be used on the "status" output from sys$waitpid() to
find out which signal caused the waitee process to stop.

Fixes #794.
2020-01-27 20:47:56 +01:00
Andreas Kling
23ffd6c319 Kernel+LibC+Userland: Switch to 64-bit time_t
Let's not have that 2038 problem people are talking about. :^)
2020-01-27 10:59:29 +01:00
Andreas Kling
6906edee9a LibGUI: Add 64-bit signed integer support to GVariant
What was previously the "Int" type is now "Int32" and "Int64".
2020-01-27 10:55:10 +01:00
Linus Groh
174583cda5 LibVT: Add parameter names in function signatures for clarity 2020-01-26 15:58:06 +01:00
Linus Groh
3549623dc6 LibVT: Rename escape$r to DECSTBM (Set Top and Bottom Margins) 2020-01-26 15:58:06 +01:00
Linus Groh
79f88db6fb LibVT: Remove empty line 2020-01-26 15:58:06 +01:00
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