Commit Graph

1308 Commits

Author SHA1 Message Date
Andreas Kling
2d39da5405 LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.

The new convention is:

- "LibFoo" is a userspace library that provides the "Foo" namespace.

That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
2020-02-02 15:15:30 +01:00
Andreas Kling
d67da8c101 LibGUI: Add GHBoxLayout and GVBoxLayout convenience classes 2020-02-02 15:09:48 +01:00
asliturk
9dfe6521fc LibGUI: Save current wallpaper setting to WindowManager.ini. 2020-02-02 15:08:37 +01:00
Jesse Buhagiar
5f78e2ff3a LibC: Implement putpwent()
It was previously impossible to (correctly) put an entry into the
password file via libc. This patch implements the functionality
to do so.
2020-02-02 10:58:45 +01:00
Jesse Buhagiar
dfaa5ecf81 LibC: Implement append modes for fopen()
Previously, `fopen()` didn't contain an implementation for the
append modes, even though the Kernel supports it via `O_APPEND`.

This patch rectifies that by implementing them so an assert is
no longer thrown.
2020-02-02 10:58:45 +01:00
Jesse Buhagiar
cdbdd397db LibC: Move FILE definition to bits/FILE.h
There are some headers in libc that require us to have definitions,
such as `FILE` available to us (such as in `pwd.h`). It is bad
practice to include the entirety of `stdio.h`, so it makes more
sense to put `FILE` into it's own header.
2020-02-02 10:58:45 +01:00
Andrew Kaster
117820f610 Meta: Claim copyright on files added by me
Demos/DynamicLink, LibC/cxxabi.cpp, and LibELF/ELFDynamic*.[cpp/h]
2020-02-02 02:05:38 +01:00
Andreas Kling
5b47b0d867 LibGUI: Make GAction scoped to its CObject parent (widget or window)
Unparented GActions are still parented to the application like before,
making them globally available.

This makes it possible to have actions that work whenever a specific
window is active, no matter which widget is currently focused. :^)
2020-02-02 02:03:39 +01:00
Andreas Kling
6ab9dc4ff4 LibCore: is<CObject>(object) should not default to true
Otherwise we'll lie about anything that doesn't implement is<T>() and
think it's indeed a T.
2020-02-02 02:03:39 +01:00
Andreas Kling
d0c230855d LibCore: Fix CArgsParser build on my host machine 2020-02-01 20:18:53 +01:00
Andreas Kling
998765a7a6 LibC: The exec() family of functions should not search "." by default
We should only execute the filename verbatim if it contains a slash (/)
character somewhere. Otherwise, we need to look through the entries in
the PATH environment variable.

This fixes an issue where you could easily "override" system programs
by placing them in a directory you control, and then waiting for
someone to come there and run e.g "ls" :^)

Test: LibC/exec-should-not-search-current-directory.cpp
2020-02-01 16:14:09 +01:00
Andreas Kling
089110af93 LibPthread: Disable debug spam by default 2020-02-01 12:25:51 +01:00
Sergey Bugaev
831ff2d0ac LibGUI: Only consider starting a drag from an already selected item
This means we can deselect other items immediately when performing a mouse-down
on an unselected item.
2020-01-28 15:08:27 +01:00
Sergey Bugaev
f9b4d981a8 LibGUI+FileManager: Try better to detect executables
We will now consider a file to be an executable if any of the executable
permission bits are set.
2020-01-28 15:08:27 +01:00
Sergey Bugaev
9276582535 LibCore: Rewrite CArgsParser
This is a complete reimplementation of CArgsParser with a different API.

Now, CArgsParser properly supports and distinguishes between:
* Positional arguments (required or not)
* Options

Options can be short and/or long.

The API allows you to add custom option and argument types. A few types are
pre-implemented for convenience:
* Boolean options (take no value)
* String and integer options (take a required value)
* String and integer arguments
* Vector-of-string arguments

This commit doesn't include changes for all the users of CArgsParser (see next
commit for that).
2020-01-28 13:50:18 +01:00
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