summaryrefslogtreecommitdiff
path: root/Libraries/LibVT
AgeCommit message (Collapse)Author
2020-12-30LibGUI: Rewrite layout system in terms of min and max sizesAndreas Kling
This patch removes size policies and preferred sizes, and replaces them with min-size and max-size for each widget. Box layout now works in 3 passes: 1) Set all items (widgets/spacers) to their min-size 2) Distribute remaining space evenly, respecting max-size 3) Place widgets one after the other, adding spacing in between I've also added convenience helpers for setting a fixed size (which is the same as setting min-size and max-size to the same value.) This significantly reduces the verbosity of widget layout and makes GML a bit more pleasant to write, too. :^)
2020-12-28LibVT: Implement find and scroll helper methods in TerminalWidgetIdan Horowitz
This is mostly based on TextDocument's similar methods, these will help implement searching within the terminal application. The support for unicode code points is shaky at best, and should probably be improved further.
2020-12-28LibVT: Create VT::Range and use it to replace selection start / endIdan Horowitz
Based on GUI::TextRange, This is both a bit more expressive and will eventually be used for searching within the terminal
2020-12-28Everywhere: Move AppFile from LibGUI to LibDesktopLinus Groh
This was mentioned in #4574, and the more I think about it the more it feels just right - let's move it there! :^) Having to link LaunchServer against LibGUI explicitly should've been telling enough...
2020-12-27LibVT: Use the 'U+FFFD replacement character' to indicate a parsing errorIdan Horowitz
Based on this recommendation in the Unicode standard: https://www.unicode.org/versions/Unicode13.0.0/ch23.pdf (Page 32)
2020-12-27Terminal+LibVT: Use GUI::AppFileLinus Groh
2020-12-26LibC: Fix some incorrect printf usagesSahan Fernando
2020-12-25AK: Remove custom %b format string specifierAndreas Kling
This was a non-standard specifier alias for %02x. This patch replaces all uses of it with new-style formatting functions instead.
2020-12-24Terminal+LibVT: Use GUI::FileIconProvider for app iconsLinus Groh
2020-12-21LibVT+Terminal: Add the option to disable the bellAlex McGrath
2020-12-07LibVT: Add "Copy name" action to terminal link context menuLinus Groh
Similar to "Copy URL" there is now a "Copy name" action in the context menu specialized for terminal links. I chose to not alter the behaviour of the existing copy action to prevent surprises when text is selected and the user happens to place the cursor over a link. Closes #4187.
2020-12-07LibVT: Enable TerminalWidget copy/paste menu actions conditionallyLinus Groh
The copy action is now only enabled if there is a selection. The paste action is now only enabled if the clipboard contains something the terminal considers pasteable - that is, non-empty data with a text/* MIME-type. Previously we'd happily paste things like bitmaps into the terminal, causing it to blow up.
2020-12-04LibVT: Auto-scroll the terminalJulian Offenhäuser
TerminalWidget will now automatically scroll up or down when the user drags the mouse out of its bounds while selecting text. This happens at a fixed speed.
2020-11-29LibVT: Make terminal scrollback max size configurableAnotherTest
2020-11-10LibVT: Add TerminalWidget::scroll_to_bottom() APIAndreas Kling
(And use this internally when scrolling to bottom on non-modifier keydown events.)
2020-11-03LibVT: Copying from terminal scrollback resulted in wrong textAndreas Kling
This regressed when turning the terminal history into a circular buffer as only the non-const version of Terminal::line() was updated with the new indexing logic.
2020-10-31LibGfx: Move FontDatabase from LibGUI to LibGfxAndreas Kling
Not sure why I put this into LibGUI in the first place.
2020-10-30LibGUI: Add Widget focus policiesAndreas Kling
Every widget now has a GUI::FocusPolicy that determines how it can receive focus: - NoFocus: The widget is not focusable (default) - TabFocus: The widget can be focused using the tab key. - ClickFocus: The widget can be focused by clicking on it. - StrongFocus: Both of the above. For widgets that have a focus proxy, getting/setting the focus policy will affect the proxy instead.
2020-10-30LibVT: Use dbgln() in TerminalWidgetAndreas Kling
2020-10-25LibGfx+LibGUI+Clients: Make fonts findable by their qualified nameAndreas Kling
The qualified name of a font is "<Family> <Size> <Weight>". You can get the QN of a Font via the Font::qualified_name() API, and you can get any system font by QN from the GUI::FontDatabase. :^)
2020-10-02Everywhere: Fix typosNico Weber
Mostly in comments, but sprintf() now prints "August" instead of "Auguest" so that's something.
2020-09-25Meta+LibHTTP through LibWeb: Make clang-format-10 cleanBen Wiederhake
2020-09-15LibVT: Use xterm modifier scheme for tilde keys tooNico Weber
2020-09-15LibVT+LibLine: Use `1;mods` CSI parameters for ctrl/alt/shift-arrow keysNico Weber
xterms send a bitmask (+ 1) in the 2nd CSI parameter if "special" keys (arrow keys, pgup/down, etc) are sent with modifiers held down. Serenity's Terminal used to send ^[[O, which is a nonexistent escape sequence and a misread of VT100's ^[O (ie the '[' is replaced by 'O'). Since the xterm scheme also supports shift and alt modifiers, switch to that. More flexible, and makes ctrl-left/right and alt-left/right work in SerenityOS's bash port. Also do this for page up/down. No behavior change for SerenityOS's Shell.
2020-09-13Terminal: Make sure empty hrefs set a null string on AttributeNico Weber
Else, we store an empty but allocated string for each Attribute after a href was emitted (since it's ended by a non-null empty string), which makes Line objects very expensive to destroy and to modify. Reduces `disasm /bin/id` from 414ms to 380ms (min-of-5). There's a lot more perf wins to be had with better href handling (most lines don't have any hrefs, so instead of storing a string per Attr, maybe we could have a vector of hrefs per line and int offsets into that in each Attr for example), but this is a simple, obvious, and effective improvement, so let's start with this.
2020-09-11LibVT: Show an I-beam cursor over TerminalWidgetAndreas Kling
..and implement this using the new widget override cursor mechanism.
2020-09-11LibGUI+WindowServer: Rename window "override cursor" to just "cursor"Andreas Kling
Let's just say each window has a cursor, there's not really overriding going on.
2020-09-10LibGfx: Move StandardCursor enum to LibGfxAndreas Kling
This enum existed both in LibGUI and WindowServer which was silly and error-prone.
2020-09-10LibVT: Let Terminal keep history in a circular bufferNico Weber
This makes Terminal::scroll_up() O(1) instead of O(n) in the size of the history. (It's still O(n) in the size of visible lines.) Reduces time to run `disasm /bin/id` with the default terminal window size from 530ms to 409ms (min-of-5) on my system.
2020-09-10LibVT: Let Terminal only expose history_size, not storageNico Weber
2020-09-05LibGUI: Make the Clipboard API deal in raw byte buffers a bit moreAndreas Kling
To open up for putting not just text/plain content on the clipboard, let's make the GUI::Clipboard API a bit more raw-data-friendly. :^)
2020-08-30LibVT+Terminal: Mark default action in context menuBen Wiederhake
2020-08-30Libraries: Unbreak building with extra debug macrosBen Wiederhake
2020-08-27Base: Move 16x16 common icons to /res/icons/16x16/thankyouverycool
Drops the '16' suffix from filenames. Resizes inconsistent audio-volume icons to intended size.
2020-08-18WindowServer+LibVT: Convert some dbgprintf() to dbg()Sergey Bugaev
These kept annoying me, because these were the only two lines in the default boot log that went unattributed.
2020-08-15LibGUI: Make focus events more aware of why focus is changingAndreas Kling
This patch adds GUI::FocusEvent which has a GUI::FocusSource. The focus source is one of three things: - Programmatic - Mouse - Keyboard This allows receivers of focus events to implement different behaviors depending on how they receive/lose focus.
2020-08-05Unicode: Try s/codepoint/code_point/g againNico Weber
This time, without trailing 's'. Ran: git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
2020-08-05Revert "Unicode: s/codepoint/code_point/g"Nico Weber
This reverts commit ea9ac3155d1774f13ac4e9a96605c0e85a8f299e. It replaced "codepoint" with "code_points", not "code_point".
2020-08-03Unicode: s/codepoint/code_point/gAndreas Kling
Unicode calls them "code points" so let's follow their style.
2020-07-12LibVT: Don't scroll to bottom when pressing the right shift keyAndreas Kling
2020-07-09LibVT: Set scrollbar page sizeTom
2020-07-05Terminal+LibVT: Add "clear including history" action (Ctrl+Shift+K) :^)Andreas Kling
Sometimes you just want to get rid of all your scrollback history in the terminal, and now there's a way to do that.
2020-07-04Userspace: Remove a bunch of unnecessary Kernel/API/KeyCode.h includesAndreas Kling
2020-07-04Kernel: Move headers intended for userspace use into Kernel/API/Andreas Kling
2020-07-04LibGUI: Turn GUI::Application::the() into a pointerAndreas Kling
During app teardown, the Application object may be destroyed before something else, and so having Application::the() return a reference was obscuring the truth about its lifetime. This patch makes the API more honest by returning a pointer. While this makes call sites look a bit more sketchy, do note that the global Application pointer only becomes null during app teardown.
2020-06-30Terminal: Bump the default ScrollLength to 4Andreas Kling
This feels so much better than scrolling one line at a time. :^)
2020-06-30LibVT/Terminal: add a scroll length to the TerminalWidgetBenoît Lormeau
The scroll length is the number of lines by which the terminal will go up/down when scrolling the mouse wheel once.
2020-06-25Terminal: Ignore cell background when visual beep is activeAnotherTest
Fixes #2621
2020-06-16LibVT: Replace u8 type to u32 for code pointHüseyin ASLITÜRK
Replace KeyEvent text attribute usage with code_point.
2020-06-12AK: Make string-to-number conversion helpers return OptionalAndreas Kling
Get rid of the weird old signature: - int StringType::to_int(bool& ok) const And replace it with sensible new signature: - Optional<int> StringType::to_int() const