Commit graph

252 commits

Author SHA1 Message Date
Andreas Kling
f7dce05c82 LibGUI: Remove confusing GModelNotification concept
This was a bad idea and it didn't stick. Instead we should just use the
simple "on_foo" hook functions like we do for everything else. :^)
2019-08-20 19:44:02 +02:00
Andreas Kling
462336ed49 LibVT: Add scrollback history to VT::Terminal
The default (hard-coded) history size is 500 lines. When the history is
altered, the TerminalClient is notified via terminal_history_changed().
2019-08-19 19:07:52 +02:00
Andreas Kling
6cd9c020ea LibC: Write to the dbg() every time we perror() in userspace
There's a high chance that we're interested in whatever errors come out
of perror(), so let's output those on the debugger as well.
2019-08-19 17:25:49 +02:00
Andreas Kling
3792c91059 LibGUI: Implement save_to(JsonObject&) for GWindow and GWidget 2019-08-19 16:34:53 +02:00
Andreas Kling
c2213449c0 LibCore: Move CObject serialization into CObject::save_to(JsonObject&)
The idea is for subclasses to override this and add whatever properties
are relevant for them, then call up to their base class, etc.
2019-08-19 16:34:53 +02:00
Andreas Kling
7038935f74 GraphicsBitmap: create_wrapper() should take pitch as a parameter
We shouldn't assume that the pitch of some arbitrary bitmap memory that
we're wrapping is going to be 16-byte aligned. Instead, just take the
pitch as a parameter.

Also update WindowServer to pass the pitch to the framebuffer bitmaps.
2019-08-19 13:45:22 +02:00
Andreas Kling
8aa3b74f80 LibCore: Make it possible to pass a parent to CFile constructors 2019-08-18 12:55:56 +02:00
Andreas Kling
dc572e31fa LibGUI: Let GWindow::set_main_widget() take ownership of the widget
We were already doing this anyway, with ~GWindow() calling delete on
the main widget.
2019-08-18 12:18:17 +02:00
Andreas Kling
fc6bd52e0d LibCore: Childify children of CLocalServer and IPC::Connection
Inspecting a "TextEditor" process with Inspector now looks awesome. :^)
2019-08-18 12:15:06 +02:00
Andreas Kling
a1a4013b1c LibGUI: Make the timers in GAbstractButton and GScrollBar into children 2019-08-18 12:14:15 +02:00
Andreas Kling
1b3599fbbc LibCore: Make CSocket's notifiers into children of the CSocket
The Inspector app quickly exposes crappy flat object hiearchies without
parent/child relationships. This is one of many commits that improves
the situation by making parent/child CObject relationships explicit.
2019-08-18 11:54:39 +02:00
Andreas Kling
5c7bb09a73 GTreeView: Support multiple root-level items
Previously it was only possible to have a single root-level item in a
GTreeView. This was an oversight and I didn't realize it because this
code was only ever used in the FileManager, which has one root ("/").

Also factored out item toggling into a separate function, and increase
the base indentation level so that root items can be toggled as well.

Finally, let the user toggle the selected item with the spacebar. :^)
2019-08-18 10:17:00 +02:00
Andreas Kling
f6cb2fd2fb GModel: Have create_index() take a const void*
This is just for convenience really. It lets you skip const_casting in
all the code that calls this API, which you would basically always be
doing otherwise.
2019-08-18 10:14:53 +02:00
Andreas Kling
203612439a LibGUI: Add LogStream operator<< for GModelIndex 2019-08-18 10:14:26 +02:00
Andreas Kling
fc43cf929d LibHTML: Implement basic block height computation
..and add vertical box properties to the layout tree dumps.
2019-08-18 08:39:52 +02:00
Andreas Kling
70eca3b500 LibHTML: Finish the block width calculation
Also add horizontal box values to the layout tree dump.
2019-08-18 08:39:52 +02:00
Andreas Kling
587ddc5126 LibHTML: Fix host build and turn on ccache 2019-08-18 08:39:52 +02:00
Conrad Pankoff
5e46122a82 Kernel: Add framebuffer ioctls; wrap raw ioctls with a C API 2019-08-18 07:40:02 +02:00
Conrad Pankoff
1868523e00 LibC: Move duplicated winsize struct definition into ioctl_numbers.h 2019-08-18 07:40:02 +02:00
Andreas Kling
266b9cb654 LibC: Fix strtol() not populating `endptr' for valid strings
We were not writing anything out to the `endptr` pointer if a number
was successfully parsed from the input string.

Fixes #460.
2019-08-17 22:07:48 +02:00
Andreas Kling
8a91b90258 GTableView: Fix column resize cursor not showing up in scrolled tables
If the table was scrolled somewhat, we'd stop showing the resize cursor
when hovering the mouse cursor between two table column headers.
2019-08-17 15:01:45 +02:00
Andreas Kling
8031960541 GTableView: Fix row selection when clicking between two cells
We should still select the entire row when you click between two cells.
2019-08-17 14:56:53 +02:00
Sergey Bugaev
e0e1be8c33 LibCore: Fix a crash in CArgsParser 2019-08-17 12:07:55 +02:00
Sergey Bugaev
bec646c0bb LibC: Implement wait()
This is a simple convenience wrapper over waitpid().
2019-08-17 12:07:55 +02:00
Sergey Bugaev
425c356288 Kernel+LibC+Userland: Support mounting other kinds of filesystems 2019-08-17 12:07:55 +02:00
Andreas Kling
1febd59f83 LibCore+rpcdump: Publish CObject graph to on-demand RPC socket
All programs that have a CEventLoop now allow local socket connections
via /tmp/rpc.PID and will dump a serialized JSON array of all the live
CObjects in the program onto connecting sockets.

Also added a small /bin/rpcdump tool that connects to an RPC socket and
produces a raw dump of the JSON that comes out.
2019-08-17 11:39:26 +02:00
Andreas Kling
2fa2d72761 CObject: Put all CObjects on a global IntrusiveList for introspection
This will allow us to easily traverse the entire CObject graph.
2019-08-17 11:26:19 +02:00
Andreas Kling
7127c4fdbb LibCore: CIODevice::set_error() is meant to be called with the 'errno'
The point of this function is to stash away the innermost error code
so that we don't lose it by the time we get back to the client code.
2019-08-17 11:07:15 +02:00
Jesse Buhagiar
bc22456f89 Kernel: Added unmount ability to VFS
It is now possible to unmount file systems from the VFS via `umount`.
It works via looking up the `fsid` of the filesystem from the `Inode`'s
metatdata so I'm not sure how fragile it is. It seems to work for now
though as something to get us going.
2019-08-17 09:29:54 +02:00
Andreas Kling
6ad3efe067 Kernel+LibC: Add get_process_name() syscall
It does exactly what it sounds like:

    int get_process_name(char* buffer, int buffer_size);
2019-08-15 20:55:10 +02:00
Andreas Kling
e62a2b7cf8 LibC: Fix clang-tidy warning about else-after-return in errno handling 2019-08-15 20:25:50 +02:00
Andreas Kling
9789ee9b58 GTableView: Add a way to customize cell painting per-column
You can now set a GTableCellPaintingDelegate per column in GTableView.
For columns with a painting delegate set, the view will defer to the
delegate for painting each cell in that column.
2019-08-14 20:34:46 +02:00
Andreas Kling
b777f740a4 StylePainter: Move progress bar painting from GProgressBar to here
We need to be able to paint progress bars without having a widget. :^)
2019-08-14 20:31:46 +02:00
Andreas Kling
f9b8a18fae GJsonArrayModel: Add hook for customizing the GModel::Role::Custom data 2019-08-14 20:30:18 +02:00
Conrad Pankoff
ecde025375 Libraries: Add LibPCIDB for reading PCI device information from pci.ids 2019-08-14 13:12:54 +02:00
Andreas Kling
ca9592d56f LibVT: Shave down VT::Attribute from 8 bytes to 3 bytes
We have one of these per character in the terminal buffers, so it's a
decent haircut. :^)
2019-08-13 12:59:58 +02:00
Andreas Kling
4fb02c78a9 LibVT: Rename VT::BufferPosition to VT::Position and move to own file 2019-08-13 12:56:10 +02:00
Andreas Kling
7d6689055f Kernel+LibC+crash: Add mprotect() syscall
This patch adds the mprotect() syscall to allow changing the protection
flags for memory regions. We don't do any region splitting/merging yet,
so this only works on whole mmap() regions.

Added a "crash -r" flag to verify that we crash when you attempt to
write to read-only memory. :^)
2019-08-12 19:33:24 +02:00
Andreas Kling
7e93418927 GButton: Allow non-checkable buttons to render as checked
This changes the behavior of the "is_checkable" flag on GAbstractButton
to only be about user interaction checkability. In other words, it now
only prevents the user from checking/unchecking the button, the code.
2019-08-12 18:50:19 +02:00
Andreas Kling
b24b111298 LibVT: Factor out terminal emulation from Terminal to make it reusable
Now that we're bringing back the in-kernel virtual console, we should
move towards having a single implementation of terminal emulation.

This patch rips out the emulation code from the Terminal application
and turns it into the beginnings of LibVT.

The basic design idea is that users of VT::Terminal will implement and
provide a VT::TerminalClient subclass to handle presentation-specific
things. We'll need to iterate on this, but it's a start. :^)
2019-08-12 17:34:48 +02:00
Andreas Kling
69ec08774b GJsonArrayModel: Add hook to customize what comes out of GModel::Sort
Now you can provide a massage_for_sort hook in your FieldSpec.
This allows you to implement arbitrary sorting rules for the data.
2019-08-12 11:54:18 +02:00
Ignas S
6228e18a09 GTableView and friends: API improvements for 'Sortable' flag. 2019-08-12 11:01:47 +02:00
Ignas S
405d7ddec8 GDirectoryModel: prevent sorting by icons. 2019-08-12 11:01:47 +02:00
Ignas S
823d5d097b GTableView: add 'sortable' column header flag.
This prevents sorting unsortable by unsortable things, like icons.
2019-08-12 11:01:47 +02:00
ignas-sa
0faaa1e53a GSortingProxyModel: Sort case insensitively by default (#441) 2019-08-11 18:11:25 +02:00
Ignas S
feabe6ed31 GScrollBar: highlight the scrubber while it's in use.
Originally, it would stop being highlighted if the mouse was moved away from
it, even while in use. Now it will stay highlighted for the duration of
usage.
2019-08-11 12:00:10 +02:00
Andreas Kling
ee83b1bcf4 LibCore: Use URL in CHttpRequest
Now there's just CHttpRequest::set_url(URL), no need to specify the
host, port and path manually anymore.

Updated ChanViewer and Downloader for the API change.
2019-08-10 19:32:03 +02:00
Andreas Kling
ed43770b2f AK: Add a basic URL class to help us handle URL's
We're gonna need these as we start to write more networking programs.
2019-08-10 17:30:35 +02:00
Andreas Kling
afd25679bc GJsonArrayModel: Support fields that aren't tied to a single JSON value
Change the custom data massaging callback to take a const JsonObject&.
This will allow binding together data from multiple fields into one
output in the model. :^)
2019-08-10 15:06:29 +02:00
Andreas Kling
078ce97c41 GJsonArrayModel: Add an optional "massage_for_display" fieldspec hook
This allows to you install a custom callback that can do anything with
Role::Display data before it's returned by GJsonArrayModel::data().
2019-08-10 11:06:29 +02:00