Commit graph

3120 commits

Author SHA1 Message Date
Andreas Kling 69fea8d41d VisualBuilder: Expose the "name" property on all widgets. 2019-07-10 20:34:17 +02:00
Andreas Kling b06d2c04dc CObject: Add a "name" property.
This will be useful for things like the VisualBuilder code generator.
2019-07-10 20:33:53 +02:00
Andreas Kling c33766f039 LibCore: Tweak slightly-off error message in CProcessStatisticsReader. 2019-07-10 15:32:30 +02:00
Andreas Kling 245ae479eb ProcessManager: Use CProcessStatisticsReader to get process data.
It was silly to duplicate this functionality in so many places. Now everyone
uses CProcessStatisticsReader to parse /proc/all :^)
2019-07-10 15:27:52 +02:00
Andreas Kling 64d9b43734 WindowServer: Use CProcessStatisticsReader in WSCPUMonitor. 2019-07-10 15:22:44 +02:00
Andreas Kling ea6363c540 top: Remove some unused code. 2019-07-10 15:22:42 +02:00
Andreas Kling 01216f3c3f Userland+LibCore: Use CProcessStatisticsReader to implement top.
Also tweaked CProcessStatisticsReader a bit to simplify the API.
2019-07-10 13:56:28 +02:00
Andreas Kling 7083a0104a LibGUI: Add GActionGroup, a way to group a bunch of GActions.
This can be used to make a bunch of actions mutually exclusive.
This patch only implements the exclusivity behavior for buttons.
2019-07-09 22:10:03 +02:00
Andreas Kling 2ae0333f5d GAction: Remove "custom_data" and the related convenience constructors.
This mechanism was never actually used, just something I imagined would be
useful while I was first creating the class.
2019-07-09 21:28:52 +02:00
Andreas Kling fe69b326e9 Build: Prepend $PRE_CXX before the C++ compiler.
This allows you to set e.g PRE_CXX=ccache in your environment and enjoy
cached rebuilds. This makes "./makeall.sh" take 5 seconds instead of 50
seconds on my machine. :^)
2019-07-09 19:24:05 +02:00
Andreas Kling 182c5d8aad Kernel: Pick up standard includes from ../Toolchain, not ../Root 2019-07-09 17:28:26 +02:00
Andreas Kling b149dd7584 LibC: Provide generic versions of memcpy() and memset() for non-i386 builds.
We don't actually do any non-i386 builds at the moment, this is just gently
steering in a nice direction for the future. :^)
2019-07-09 15:48:55 +02:00
Andreas Kling c452aa891f AK: Add Platform.h with an ARCH() macro.
You can currently use this to detect the CPU architecture like so:

    #if ARCH(I386)
        ...
    #elif ARCH(X86_64)
        ...
    #else
        ...
    #endif

This will be helpful for separating out architecture-specific code blocks.
2019-07-09 15:48:04 +02:00
Andreas Kling 149fd7e045 Kernel: Move PhysicalAddress.h into VM/ 2019-07-09 15:04:45 +02:00
Andreas Kling eca5c2bdf8 Kernel: Move VirtualAddress.h into VM/ 2019-07-09 15:04:45 +02:00
Andreas Kling 23a6c2086b Kernel: Move SharedMemory.{cpp,h} into FileSystem/ 2019-07-09 15:04:45 +02:00
Andreas Kling f4cec2f110 Kernel: Move File.{cpp,h} into FileSystem/
Also tweak the kernel's Makefile to use -nostdinc and -nostdinc++.
This prevents us from picking up random headers from ../Root, which may
include older versions of kernel headers.

Since we still need <initializer_list> for Vector, we specifically include
the necessary GCC path. This is a bit hackish but it works for now.
2019-07-09 15:04:45 +02:00
Andreas Kling 6c87d3afa9 Kernel: Move i8253.cpp => Arch/i386/PIT.cpp 2019-07-09 15:04:45 +02:00
Andreas Kling 9fdcede491 Kernel: Move PIC.cpp into Arch/i386/ 2019-07-09 15:04:43 +02:00
Andreas Kling aa2cfed6b0 Shell: Remove some unused code. 2019-07-09 13:51:41 +02:00
Andreas Kling c110cf193d Kernel: Have the open() syscall take an explicit path length parameter.
Instead of computing the path length inside the syscall handler, let the
caller do that work. This allows us to implement to new variants of open()
and creat(), called open_with_path_length() and creat_with_path_length().
These are suitable for use with e.g StringView.
2019-07-08 20:01:49 +02:00
Andreas Kling fc4022d173 Shell: Handle SIGWINCH to get a nice behavior when resizing.
When resizing the terminal, we now clear the entire current line and reset
the shell's LineEditor input state. This makes it look and feel kinda the
same as xterm.

Fixes #286.
2019-07-08 19:06:06 +02:00
Andreas Kling 2c81477f16 Terminal: Try to preserve line contents when resizing the terminal window.
This is still destructive when shrinking, but clearly better than throwing
everything away.
2019-07-08 19:02:08 +02:00
Andreas Kling 4d904340b4 Kernel: Don't interrupt blocked syscalls to dispatch ignored signals.
This was just causing syscalls to return EINTR for no reason.
2019-07-08 18:59:48 +02:00
Andreas Kling cda5a6eca3 Kernel: Add LogStream operator<< for Process.
It simply prints "process-name(pid)", nothing fancy, but kinda useful.
2019-07-08 18:58:19 +02:00
Andreas Kling fc127eb769 LibHTML: Create anonymous blocks around inline children of blocks. 2019-07-08 17:42:23 +02:00
Andreas Kling 2caec95d30 StringBuilder: Reset the internal builder length after building.
This puts the StringBuilder back into a pristine state, allowing you
to use it to build more strings after you've built one.
2019-07-08 15:57:25 +02:00
Andreas Kling 0e75aba7c3 StringView: Rename characters() to characters_without_null_termination().
This should make you think twice before trying to use the const char* from
a StringView as if it's a null-terminated string.
2019-07-08 15:38:44 +02:00
Andreas Kling 567551bc12 AK: Add some missing includes in SinglyLinkedList. 2019-07-08 14:06:22 +02:00
Andreas Kling 5b19911025 AK: Add JsonValue::to_bool(). 2019-07-08 14:06:03 +02:00
Andreas Kling 56563cb305 CDirIterator: Fix another instance of StringView::characters() misuse. 2019-07-08 14:03:19 +02:00
Andreas Kling c79b048198 MappedFile: Fix misuse of StringView::characters().
This makes me wonder if the open() syscall should take characters+length
and we'd compute the length at the LibC layer instead. That way we could
also provide an optional non-POSIX open() that takes the length directly..
2019-07-08 13:59:10 +02:00
Andreas Kling a8aadf73e9 AK: Add JsonObject::set(key, &&value) overload.
This dodges a whole bunch of value copying in JsonParser.
2019-07-08 13:08:21 +02:00
Andreas Kling 7bb1e465c6 AK: Make it easy to convert between JsonValue and IPv4Address.
They still use string storage, but this change makes it nice and easy to
work with IPv4 addresses in JSON data.
2019-07-08 13:03:55 +02:00
Andreas Kling d8f1a7e046 AK: Add LogStream operator<< for IPv4Address. 2019-07-08 11:43:42 +02:00
Andreas Kling b6dcb5e7ae LibC: Use IPv4Address::from_string() in gethostbyname(). 2019-07-08 11:40:12 +02:00
Andreas Kling dddcedfd11 AK: Add IPv4Address::from_string(StringView).
This attempts to parse an IPv4Address from a string, and gives us an excuse
to try out the new Optional<T> for the return value. :^)
2019-07-08 11:38:58 +02:00
Andreas Kling 7b2a4c02e7 AK: Add a simple Optional<T> template.
This can be used to store any type, with a flag that says if any value
is present or not.
2019-07-08 11:29:38 +02:00
Andreas Kling a0ee2bad72 String: String::to_int() should fail for any empty string, not just null. 2019-07-08 10:51:45 +02:00
Andreas Kling f9089da2bc LogStream: Uninline some public functions so the linker can find them. 2019-07-08 09:22:22 +02:00
Andreas Kling 34709a2c24 IDEDiskDevice: Fix build after merging slave device changes. 2019-07-08 08:20:12 +02:00
Andreas Kling 3c71dc4320 LibHTML: Oops, fix build.
It's another "hacking on the train and forgetting to try a full build"
episode, this time starring LibHTML.
2019-07-08 08:18:53 +02:00
Jesse ab90d2e251 Kernel: Extended IDE interface to allow slave device usage (#283)
The IDE Disk Controller driver has been extended to allow the secondary device on the channel to be initialised and used. A test as to whether this is working (for anyone interested) is to modify `init.cpp:87` to `auto dev_hd0 = IDEDiskDevice::create(IdeDiskDevice::DeviceType::SLAVE);`. The kernel will fail to boot, as there is no disk attached to CHANNEL 1's slave. This was born out of the fact that my FAT driver can't be tested as easily without creating a partition on `hda`.
2019-07-08 08:16:52 +02:00
Andreas Kling 8812b35c5e LibHTML: Reorganize layout tree build so that parents add their children.
This will allow us to insert anonymous blocks with ease.
2019-07-08 07:33:58 +02:00
Andreas Kling 0ccad4208f LibHTML: Move layout tree building to a separate function. 2019-07-08 07:24:15 +02:00
Andreas Kling 9526b0e13a LibHTML: Add InheritStyleValue and InitialStyleValue.
These correspond to the 'inherit' and 'initial' CSS values respectively.
2019-07-08 07:15:56 +02:00
Andreas Kling 105a97685e LibHTML: Fix host build after Libraries/ shuffle. 2019-07-08 07:14:18 +02:00
Andreas Kling 752d297321 IRCClient: Fix build. Forgot to update a function signature. 2019-07-07 22:27:48 +02:00
Andreas Kling ea9340aeca IRCClient: Implement the "part from channel" action.
Also make sure the action is disabled while we're not in a window that
corresponds to an open channel. :^)

Fixes #277.
2019-07-07 21:58:57 +02:00
Andreas Kling d47432487d GStackWidget: Add a notification hook for when the active widget changes. 2019-07-07 21:50:38 +02:00