Andreas Kling
7b5bcec562
GTextEditor: Fix computing content x/rect values with line wrapping
...
This makes the cursor actually get painted on the right visual line
when in line-wrapping mode.
2019-08-25 11:24:23 +02:00
Andreas Kling
2e31b6627e
GTextEditor: Take horizontal padding into account for line visual rects
2019-08-25 11:24:23 +02:00
Andreas Kling
9752e683f6
GTextEditor: Start working on a line-wrapping feature
...
This is not finished, but since the feature is controlled by a runtime
flag, the broken implementation should not affect users of this widget
too much (in theory :^).)
2019-08-25 11:24:23 +02:00
Andreas Kling
23b70d5c59
GTextEditor: Clean up some of the rect computations
...
Moving some rect computations to separate functions to make it easier
to reuse them.
2019-08-25 07:17:09 +02:00
Andrew Weller
e75e33eb46
TextEditor: Replaced 'Find' button with 'Prev' and 'Next' buttons.
2019-08-24 21:57:42 +02:00
Andreas Kling
d3a8fe70a2
LibC: Fix strtol() handling of invalid characters
...
Rewrite this function to go from left-to-right instead of right-to-left
since this allows us to accumulate valid characters before encountering
any invalid ones.
This fixes parsing of strings emitted by GCC, like "1, %0|%0, %1}". :^)
2019-08-24 12:37:58 +02:00
Andreas Kling
748b38d80f
GTextEditor: Fix obvious bug in find()
...
We forgot to rewind the search cursor after a partial match, which
would make us fail to find "xxy" in "xxxxy".
2019-08-23 13:54:25 +02:00
Andreas Kling
0c72371ad9
GTextEditor: Implement a simple text search API
...
- GTextRange find(const StringView& needle, const GTextPosition& start)
This function searches for the needle in the haystack (the full text)
and returns a GTextRange for the closest match after "start".
If the needle is not found, it returns an invalid GTextRange.
If no "start" position is provided, the search begins at the head of
the text document. :^)
2019-08-21 21:23:17 +02:00
Andreas Kling
5670a3e064
GTextEditor: Run clang-format on GTextEditor.cpp
2019-08-21 20:20:07 +02:00
Andreas Kling
d5431a6df8
GTextEditor: Rename is_automatic_indentation_enabled() API
...
The previous name was is_automatic_indentation() which sounds weird.
2019-08-21 19:33:54 +02:00
Andreas Kling
9e5c5627d5
GTextEditor: Give Line objects a back-reference to the GTextEditor
...
This will allow us to do more complicated things in Line without having
to pass the editor around all the time.
2019-08-21 19:32:39 +02:00
Andreas Kling
dc3c6be6f2
GScrollBar: Allow scrolling the scrollbar by mouse-wheeling over it
2019-08-20 20:11:20 +02:00
Andreas Kling
076827a05d
GModel: Rename on_model_update(GModel&) => on_update()
...
Just simplifying the API of this hook a little bit.
2019-08-20 19:45:08 +02:00
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