Commit graph

653 commits

Author SHA1 Message Date
Brendan Coles efef77a154 HexEditor: Add 'Go to Offset...' dialog 2021-05-23 18:13:49 +02:00
Andreas Kling a1e133cc6b LibCore: Make ProcessStatisticsReader return results in a Vector
The HashMap API was overkill and made using this less ergonomic than
it should be.
2021-05-23 11:10:15 +02:00
Andreas Kling c1c252ddb2 LibIPC: Remove unnecessary IPC::ServerConnection::handshake()
This is no longer used by any of our IPC pairs.
2021-05-23 09:53:55 +02:00
Andreas Kling 786f6841b3 SystemMonitor: Remove "Inspect Process" action from context menu
Since everyone opts out of being inspectable by default now, let's not
offer inspection from the menu since it will fail in a default setup.
2021-05-22 23:30:40 +02:00
Andreas Kling 9676548800 SystemMonitor: Symbolicate process stacks in a background thread
Use a Threading::BackgroundAction to symbolicate stacks. This avoids
blocking the main thread and keeps the GUI running (mostly.)
2021-05-22 19:57:19 +02:00
Andreas Kling b5d73c834f Userland: Rename LibThread => LibThreading
Also rename the "LibThread" namespace to "Threading"
2021-05-22 18:54:22 +02:00
Andreas Kling 5729b4e9a5 SystemMonitor: Don't unveil /tmp/portal/symbol
This portal doesn't exist after SymbolServer has been removed.
2021-05-22 18:54:22 +02:00
Andreas Kling 5d6252b29e LibSymbolication: Rename Client.{cpp,h} => Symbolication.{cpp,h} 2021-05-22 18:54:22 +02:00
Andreas Kling 252cb54310 LibSymbolication+SystemMonitor+bt: Move symbolication back in-process
Process-separated symbolication was cute, but ultimately the threat
model is kinda silly. We're already *running* the binary, but we're
afraid to parse its symbol table? :^)

This commit makes SystemMonitor and bt do symbolication in-process.
SymbolServer and the symbol user will be removed separately.
2021-05-22 18:54:22 +02:00
Andreas Kling d783076a30 Userland: Rename LibSymbolClient => LibSymbolication 2021-05-22 18:54:22 +02:00
Brendan Coles e5e00bec8f HexEditor: Construct user interface from GML 2021-05-22 15:41:58 +01:00
Brendan Coles cdea9f5339 HexEditor: Fix typo: ASCII 2021-05-22 14:24:07 +01:00
Brendan Coles d1623350b5 HexEditor: Add 'Select All' action 2021-05-22 13:13:49 +04:30
Andreas Kling be3f4c86de DisplaySettings: Restrict selection of fixed-width fonts
Only allow fixed-width fonts to be the system fixed-width font. :^)
2021-05-21 20:15:51 +02:00
Andreas Kling 8ac0d4abe1 DisplaySettings: Add "Fonts" tab
This allows you to view, edit, and apply changes to the system fonts.
2021-05-21 20:15:51 +02:00
Max Wipfli 229414b002 Applications: Use titlecase and distinct underlined characters in menus
This changes (context) menus across the system to conform to titlecase
capitalization and to not underline the same character twice (for
accessing actions with Alt).
2021-05-21 18:41:28 +01:00
Linus Groh 95a11d5737 FileManager: Change shortcut of Display Settings desktop option
'D' is already used by 'New Directory', let's use 'S'.

Fixes #7350.
2021-05-21 17:56:10 +01:00
Jagger De Leo 1d959a7b81 DisplaySettings: Allow deselection of background image
Previously, if you selected a background image you could not revert to a
solid color background.
2021-05-21 21:17:30 +04:30
Andreas Kling 6048e245ee 3DFileViewer: Make the main widget a GUI::Frame 2021-05-21 16:14:40 +02:00
Andreas Kling 8a3e622538 Browser: Stop leaking popup windows
We were leaking the "view source" and "downloading file" windows for
some reason, presumably it was necessary when these were first added.
Since they are owned by the spawning browser window, there's no need
to leak them.
2021-05-21 15:32:53 +02:00
Linus Groh d60ebbbba6 Revert "Userland: static vs non-static constexpr variables"
This reverts commit 800ea8ea96.

Booting the system no longer worked after these changes.
2021-05-21 10:30:52 +01:00
Lenny Maiorani 68f76b9e37 Userland: Change typedef to using directive
Problem:
- `typedef`s are read backwards making it confusing.
- `using` statements can be used in template aliases.
- `using` provides similarity to most other C++ syntax.

- C++ core guidelines say to prefer `using` over `typedef`:
  https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rt-using

Solution:
- Switch these where appropriate.
2021-05-21 10:07:22 +01:00
Lenny Maiorani 800ea8ea96 Userland: static vs non-static constexpr variables
Problem:
- `static` variables consume memory and sometimes are less
  optimizable.
- `static const` variables can be `constexpr`, usually.
- `static` function-local variables require an initialization check
  every time the function is run.

Solution:
- If a global `static` variable is only used in a single function then
  move it into the function and make it non-`static` and `constexpr`.
- Make all global `static` variables `constexpr` instead of `const`.
- Change function-local `static const[expr]` variables to be just
  `constexpr`.
2021-05-21 10:07:06 +01:00
Linus Groh 9dd3203cc6 LibGfx: Add missing TextAlignment::BottomLeft 2021-05-21 08:04:31 +02:00
Gunnar Beutner 2a16c8bdb8 3DFileViewer: Clean up file handling
This unifies how 3DFileViewer handles the initial file when starting
the application and when opening files later on via the menu.

Errors are shown both for the initial load as well as when loading
files later on. An error during file load no longer clears the
existing model.

It also adds support for specifying the filename as a command-line
argument.

The opened file's name is shown in the titlebar.
2021-05-20 22:22:56 +02:00
Gunnar Beutner 728e6dad73 3DFileViewer: Move the example model into the home directory 2021-05-20 22:22:56 +02:00
Andreas Kling 1e0d855fdf TextEditor: Don't launch a WebContent process until it's needed
The HTML and Markdown preview modes both use an OutOfProcessWebView to
render the preview pane, and we were instantiating this view from GML.
This caused us to always spawn a WebContent process alongside every
TextEditor instance.

Fix this by deferring the OOPWV construction until we actually need it.
This makes launching TextEditor on a text file quite a bit faster. :^)
2021-05-20 22:12:42 +02:00
Max Wipfli 4cd8ca07e3 FontEditor: Make statusbar text generation more robust
This makes a few modifications to the statusbar text generation:
* Use the canonical U+XXXX representation of unicode characters.
* For control characters, display their alias instead of whitespace.
* Substitute RTL codepoints with U+FFFD so the text paints correctly.
* Only show the glyph's dimensions if it actually exists in the font.

This fixes #7286.
2021-05-20 22:10:45 +02:00
Max Wipfli 621a4008e6 FontEditor: Add tooltip to "Move Glyph" button
This adds a simple tooltip to the "Move Glyph" button to indicate its
functionality.
2021-05-20 22:10:45 +02:00
Ali Mohammad Pur dc388297eb TextEditor+Browser: Enable HTML syntax highlighting on HTML documents 2021-05-20 22:06:45 +02:00
Andreas Kling 6a012ad79f LibGfx: Remove Gfx::FontDatabase::default_bold_font()
Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
2021-05-20 20:55:29 +02:00
Brendan Coles 3bbae6c18b HexEditor: find_and_highlight: Limit search to remaining buffer size 2021-05-20 18:40:18 +02:00
Andreas Kling 93ef661914 WindowServer+DisplaySettings: Remove the weird "simple" wallpaper mode
Painting the wallpaper at 100% scale in the top left corner is a weird
mode and I don't think we need it. :^)
2021-05-20 17:52:38 +02:00
Andreas Kling 3046b3467c DisplaySettings: Improve wallpaper preview code
Previously, this code would create a bitmap with the size of the screen
resolution, draw the new wallpaper into it, and then scale it down for
display inside the MonitorWidget.

This was done on every paint event, which made the code quite slow and
allocation-happy.

Instead of this, we now scale down the new wallpaper to a miniature
of the same scale as the little MonitorWidget screen. The miniature is
then used for tiling, etc. The miniature is cached and reused across
paint events if nothing else changes.
2021-05-20 17:52:38 +02:00
Andreas Kling df5f382b50 3DFileViewer: Remove unveil() calls and add "thread" pledge
An application that allows opening arbitrary files from the filesystem
needs to allow itself to access the filesystem, otherwise there's no
point in supporting the feature. :^)

And the "thread" pledge is needed for background thumbnail generation.
2021-05-20 17:52:38 +02:00
Andreas Kling 0a70e1728a DisplaySettings: Fix broken path to MonitorSettingsWidget's GML 2021-05-20 00:25:15 +02:00
Andreas Kling 6394ea00d8 DisplaySettings: Remove icon from browse-for-wallpaper button
The icon on this button looked out of place.
2021-05-20 00:13:56 +02:00
Andreas Kling 7f206ca6de DisplaySettings: Select the currently used wallpaper on startup 2021-05-20 00:03:30 +02:00
Andreas Kling bb9e955ef8 DisplaySettings: Make MonitorWidget update itself on property changes 2021-05-20 00:03:30 +02:00
Andreas Kling c79e33d00c DisplaySettings: Rename DisplaySettingsWidget => MonitorSettingsWidget 2021-05-20 00:03:30 +02:00
Andreas Kling 540acc1a32 DisplaySettings: Give the UI a facelift :^)
- Split the main UI into two tabs: "Background" and "Monitor".
- Use a GUI::IconView for selecting background pictures.
- Tweak layout, spacing, etc.
2021-05-20 00:03:30 +02:00
Andreas Kling c14ffdef00 DisplaySettings: Tweak main window layout & setup code
Get rid of the menu and put some padding around the main tab widget.
2021-05-20 00:03:30 +02:00
Andreas Kling 83f43b6464 DisplaySettings: Replace the monitor image with something more thematic
This is a drawing of my own monitor in a familiar style. :^)
2021-05-20 00:03:30 +02:00
Maciej Zygmanowski 4aaf8df865 Browser: Do not use AK::Format for search engine formatting
It is too complex because it supports many options that are not
used by the search engine. It just makes format validation more
complicated.

Additionaly, now it's possible to have { } characters in search
engine URL (although they are not valid URL characters) :)
2021-05-19 20:51:51 +01:00
Maciej Zygmanowski 78bc6c09ba Browser: Add support for custom search engines 2021-05-19 20:51:51 +01:00
Gunnar Beutner d954c11f66 Everywhere: Add missing includes for <AK/OwnPtr.h>
Previously <AK/Function.h> also included <AK/OwnPtr.h>. That's about to
change though. This patch fixes a few build problems that will occur
when that change happens.
2021-05-19 21:36:57 +02:00
Erik Biederstadt 585e7890cd 3DFileViewer: Move Demos/GLTeapot to Applications/3DFileViewer
Also changes the category to `Graphics`
2021-05-19 19:34:12 +01:00
Marcus Nilsson 7aaef8fd4b Browser: Don't add multiple page reloads to history
When reloading a page multiple times, it was also added multiple
times to the history. This commit prohibits an url to be added
twice in a row.

Fixes #7264

Co-authored-by: Linus Groh <mail@linusgroh.de>
2021-05-18 23:14:37 +01:00
Andreas Kling 076018b74b PDFViewer: Ignore wheel events when there is no document loaded 2021-05-18 21:25:35 +02:00
Andreas Kling df29d58e19 PDFViewer+Base: Display application title as "PDF Viewer"
This matches other applications in the system. :^)
2021-05-18 21:00:32 +02:00
Andreas Kling a743075b9f Browser: Move actions from Tab to BrowserWindow
Navigation actions (back/forward/home/reload) now live in BrowserWindow
instead of being duplicated in every new Tab instance.
2021-05-18 20:02:00 +02:00
Andreas Kling aed695d4b2 Browser: Move menu management from Tab to BrowserWindow
It was very confusing for every Tab to have their own GUI::Menubar that
got dynamically swapped in/out when switching tabs.

This change moves us to a single menubar per window, and BrowserWindow
is the owner of its own menubar.
2021-05-18 20:02:00 +02:00
Matthew Olsson fe2d4d85c4 PDFViewer: Add some padding to the outside of the page 2021-05-18 16:35:23 +02:00
Matthew Olsson c3c2121b57 PDFViewer: Allow zooming in and out + scrolling
When holding ctrl and scrolling, the page will be zoomed in an out.
When zoomed in on a page, scrolling with move vertically up and down
the page (or horizontally if shift is being held).

In order to speed up zooming, zoomed bitmaps are cached per-page at
each distinct zoom level. This cache is cleared every 30 seconds to
prevent OOM problems.
2021-05-18 16:35:23 +02:00
Matthew Olsson d5f94aaa7b LibPDF/PDFViewer: Support rotated pages 2021-05-18 16:35:23 +02:00
Matthew Olsson fbe712e265 LibGfx: Rename RotationDirection members
Left => CounterClockwise
Right => Clockwise

Makes much more sense for a rotation
2021-05-18 16:35:23 +02:00
Matthew Olsson f7ea1eb610 Applications: Add a very simple PDFViewer 2021-05-18 16:35:23 +02:00
Marcus Nilsson 63897c469b
SystemMonitor: Don't try and show process window with nothing selected (#7221)
When right-clicking with no selected row in the process list,
SystemMonitor would still show a context menu. This disables
the context menu if index is invalid and also disables Alt+Enter
so that build_process_window() is never called with a PID of -1.

Fixes #7167.
2021-05-18 08:10:27 +02:00
brapru c2ae6c189e SystemMonitor: Show UDP sockets
Creates a new TableView in the socket list for UDP information.

Resolves #6980.
2021-05-18 08:03:40 +02:00
Andreas Kling 719168a1cd Browser: Move main browser window logic into a BrowserWindow class
Having so much the logic and lambdas in main() was getting unwieldy.
Moving it into a class simplifies this, and also opens up a path
towards supporting "Open in New Window" :^)
2021-05-17 23:32:35 +02:00
faxe1008 2b24fbdaaa LibGUI: Reset TextEditor modified state on sucessful write_to_file
Avoids missing reset of the state if saving is done in multiple places.
2021-05-17 21:04:54 +01:00
Grant Yap ca9101e5f0 Piano: Use the return key emoji in the key labels
The new way labels are stored unfortunately makes it *slightly* less
convenient to update the lists of white key and black key labels.
2021-05-17 00:16:49 +01:00
Gunnar Beutner 53d0150827 AK+Userland: Remove nullability feature for the ByteBuffer type
Nobody seems to use this particular feature, in fact there were some
bugs which were uncovered by removing operator bool.
2021-05-16 17:49:42 +02:00
Gunnar Beutner c4d0b0cd6b Userland: Don't explicitly call Vector<T>::is_null()
This method always returns false so there's no reason for calling it.
2021-05-16 17:49:42 +02:00
Gunnar Beutner 24ca645f08 HexEditor: Call size() instead of operator bool()
This previously called operator bool by accident.
2021-05-16 17:49:42 +02:00
Gunnar Beutner fcaf98361f AK: Turn ByteBuffer into a value type
Previously ByteBuffer would internally hold a RefPtr to the byte
buffer and would behave like a reference type, i.e. copying a
ByteBuffer would not create a duplicate byte buffer, but rather
two objects which refer to the same internal buffer.

This also changes ByteBuffer so that it has some internal capacity
much like the Vector<T> type. Unlike Vector<T> however a byte
buffer's data may be uninitialized.

With this commit ByteBuffer makes use of the kmalloc_good_size()
API to pick an optimal allocation size for its internal buffer.
2021-05-16 17:49:42 +02:00
DragonAlex98 47ec5cf340 ImageViewer: Stop animation timer when deleting/changing image
Previously deleting an animated image wouldn't make the animation timer
stop. This resulted in the animation still running in the ViewWidget.

Moreover the timer wasn't stopped when loading different images, which
led to high CPU usage when going from an animated image to a
non-animated one.
2021-05-16 16:22:21 +01:00
DragonAlex98 bce119036a ImageViewer: Disable image actions when there is no image
Previously some actions like Rotate/Flip/Set as Desktop Wallpaper would
make the application crash if no image was loaded. Now image actions are
enabled/disabled based on whether an image has been loaded or not.
2021-05-16 16:22:21 +01:00
spigwitmer 04f26183cb
Debugger: Add basic backtrace support
This adds the "bt" command to the debugger which displays a backtrace
of the current thread.
2021-05-16 00:47:01 +01:00
Andreas Kling 10ea84a815 PixelPaint: Wrap the layer list in a GUI::GroupBox and tweak width 2021-05-16 01:11:56 +02:00
Andreas Kling 6c2c3b920e PixelPaint: Style the application name as "Pixel Paint" :^) 2021-05-16 01:11:56 +02:00
Andreas Kling c7244e37eb PixelPaint: Start with a smaller new image (and smaller window)
We started this app with an overwhelmingly huge window. Shrink it.
2021-05-16 01:11:56 +02:00
Andreas Kling 4c186d1f44 PixelPaint: Stop creating two blue and yellow layers on startup
This was nice for testing, but let's start the app with just a white
background layer instead. :^)
2021-05-16 01:11:56 +02:00
Andreas Kling 5579ec767e PixelPaint: Add a statusbar to the main window 2021-05-16 01:11:56 +02:00
Andreas Kling 864392254e PixelPaint: Tweak height of palette widget 2021-05-16 01:11:56 +02:00
Andreas Kling 01d88f1b31 PixelPaint: Wrap the toolbox widget in a GUI::ToolbarContainer
This makes it consistent with the main toolbar and looks quite nice.
2021-05-16 01:11:56 +02:00
Andreas Kling c7c273c31d PixelPaint: Add a toolbar to the main UI :^) 2021-05-16 01:11:56 +02:00
Andreas Kling 5b6d879721 PixelPaint: Tweak placement of current colors in palette widget 2021-05-16 01:11:56 +02:00
Andreas Kling 8c044d4f52 PixelPaint: Convert main UI to GML :^) 2021-05-16 01:11:56 +02:00
Andreas Kling afc3ed228d PixelPaint: Make the color palette widgets smaller and square 2021-05-16 01:11:56 +02:00
Andreas Kling ad2752276a PixelPaint: Use GUI::Toolbar inside the toolbox widget
We don't need to implement our own toolbar and tool button classes
when the ones from LibGUI work just fine. :^)
2021-05-16 01:11:56 +02:00
Andreas Kling 19a696e397 ImageViewer: Use GUI::CommonActions for zoom related actions 2021-05-15 20:36:41 +02:00
Andreas Kling c6b44e215a PixelPaint: Use GUI::CommonActions for zoom related actions 2021-05-15 20:36:41 +02:00
Andreas Kling ae7c5411a6 PixelPaint+Base: Tool icon refresh :^)
Redraw and shrink all tool icons to 16x16 instead of the off-beat size
(26x26) they had previously.
2021-05-15 18:35:06 +02:00
Daniel Bertalan a5801e9919
FontEditor: Add missing unix pledge
Without this change, FontEditor would crash due to LibDesktop opening an
IPC connection.

Fixes #7137.
2021-05-15 16:07:05 +01:00
Linus Groh d8a3609aa9 Everywhere: Add a blank line after copyright header where missing 2021-05-15 00:27:09 +01:00
Linus Groh 64c0deb1f1 SpaceAnalyzer: Add separator before quit menu action 2021-05-15 00:24:07 +01:00
Linus Groh 067b880459 SystemMonitor: Make ProcessModel icon column non-sortable
Sorting by icon is neither intuitive nor useful, so let's disable it
(like in GUI::FileSystemModel).
2021-05-15 00:15:09 +01:00
Andreas Kling ef09f9c825 SystemMonitor: Make sure we set a model before changing column sizes
Changing a view's column metadata requires that a model is set.
2021-05-15 00:50:51 +02:00
Mart G f70d0f03de SpaceAnalyzer: Use fstatat instead of lstat
By using fstatat during file system analyzation instead of lstat, we
reduce the amount of work the kernel has to do for each stat call.

During profiling it came up that the kernel was spending a lot of time
resolving paths. Because each call to stat passed an absolute path the
kernel had to do the same work over and over again.

When using relative paths the kernel only has to resolve the relative
part as it can reuse the already resolved path of the base directory.
2021-05-14 23:32:10 +02:00
Linus Groh f512b24b21 AnalogClock: Use YYYY-MM-DD format for window title 2021-05-14 20:17:09 +01:00
Andreas Kling 212e1ba0d4 ImageViewer: Sandbox image decoding using the ImageDecoder service :^)
Instead of parsing untrusted and potentially malicious image files in
the ImageViewer GUI process, take advantage of the ImageDecoder service
that we already have on the system to sandbox the decode.

This prevents bugs in our image decoding libraries from being used as
an exploitation vector when viewing files in ImageViewer.
2021-05-14 21:02:18 +02:00
Andreas Kling 3168a4afe8 ImageViewer: Rename QSWidget => ImageViewer::ViewWidget 2021-05-14 18:37:08 +02:00
Andreas Kling 58d73ea36c Userland: Rename QuickShow => Image Viewer
The old name was a bit too ambiguous. This one is crystal clear. :^)
2021-05-14 18:34:44 +02:00
Andreas Kling 5fd65adb19 Browser: Don't spawn RequestServer and WebSocket in multi-process mode
Single-process Browser forces a connection to these services early on,
to avoid having to unveil their paths. I'm suspicious of the benefits
of this (and the comment about it wasn't even accurate) but let's keep
it for now.

In multi-process mode, there's no need to do this, and in fact it was
causing us to spawn two extra totally unused processes.
2021-05-14 17:17:30 +02:00
Andreas Kling 31d4bcf5bf Userland: Tighten a *lot* of pledges! :^)
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
2021-05-13 23:28:40 +02:00
Andreas Kling 3c3b384c80 SystemMonitor: Boost main thread priority to maximum on startup
It's frustrating when the system is under heavy load and you want to
investigate using SystemMonitor, but SystemMonitor chokes on the lag.

Let's at give it a fighting chance by maxing out the main thread prio.
2021-05-13 23:28:40 +02:00
Jelle Raaijmakers 55c3a5969c FileManager: Set minimum folder pane width 2021-05-13 00:43:41 +01:00
Linus Groh 292cd009ea KeyboardMapper: Embed icon in executable
By using serenity_app() instead of serenity_bin() in the CMakeLists.txt,
we can embed an icon as usual.
2021-05-12 23:12:29 +01:00
Linus Groh 847a49209e KeyboardMapper: Stylize title as "Keyboard Mapper"
We already do this in the about dialog and across the system in general.
2021-05-12 23:06:06 +01:00
Linus Groh 76c6bc3186 KeyboardMapper: Remove two useless comments 2021-05-12 23:05:26 +01:00
Andreas Kling a6a57830d0 FileManager: Reorganize main toolbar a little bit
Re-group things so they match the menus better.
2021-05-12 21:37:37 +02:00
Andreas Kling bed2356b11 FileManager: Reorganize menus a little bit
Move the common editing actions (cut/copy/paste/select-all) into a new
"Edit" menu. And move the "Open Terminal Here" action to the "Go" menu.
2021-05-12 21:32:54 +02:00
Linus Groh 91eda22208 Everywhere: Add Alt shortcuts to remaining top-level menus
Not sure why some menus did have one and others didn't, even in the
same application - now they all do. :^)
I added character shortcuts to some menu actions as well.
2021-05-12 18:09:42 +01:00
Linus Groh f2154bca17 Browser: Use URL for window title if tab title is empty
Seeing " - Browser" for loading pages is annoying, so let's do something
more sensible instead for empty tab document titles: "<URL> - Browser".
Also consolidate the two places where this code is used into a lambda to
make any future changes easier.
2021-05-12 17:55:48 +01:00
Linus Groh c8738bbd7e SystemMonitor: Spell process window title as "System Monitor"
This is what we use for the main window and elsewhere.
2021-05-12 17:52:56 +01:00
Ali Mohammad Pur a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Linus Groh 8afcd22900 Magnifier: Make window resizable
Instead of having the window non-resizable, it now defaults to a frame
size of 200 x 200 pixels but is user-resizable. The shown screenshot
updates its size accordingly. :^)
Sometimes we might need a larger view, or a non-square shape.
2021-05-11 18:01:55 +02:00
Valtteri Koskivuori 4d01183f5c Userland: Implement a magnifier app
This utility is useful for making sure those UI elements are pixel
perfect. A simple 2x/4x magnification around the mouse cursor, shown in
a window.
2021-05-11 10:18:29 +01:00
Brian Gianforcaro 1674d06f78 Userland: Allow the Analog Clock window border to be hidden
Introduce the ability to hide the Analog Clock window borde. With this
feature enabled it looks like the clock is floating and integrated into
the desktop.

The "Cube Demo" has the same feature, and was used as inspiration when
implementing the feature in the Analog Clock.
2021-05-10 12:36:05 +02:00
Brian Gianforcaro 3be9af7695 Userland: Reduce pledges requested by AnalogClock
After startup AnalogClock only needs the normal GUI event loop pledges.
2021-05-10 12:36:05 +02:00
Andreas Kling d0637e7923 IRCClient: Apply some polish to menus and actions 2021-05-10 10:28:41 +02:00
Andreas Kling e0508dd38a HexEditor: Apply some polish to menus and actions 2021-05-10 10:27:30 +02:00
Andreas Kling d4081b218c Browser: Apply some polish to menus and actions 2021-05-10 10:27:23 +02:00
Erlend 4c43fc0515
AnalogClock: New analog clock application (#6760) 2021-05-09 15:51:36 +02:00
Dylan Katz 3ab37674c6 TextEditor: Add support for SQL highlighting 2021-05-09 09:39:05 +02:00
Andreas Kling 161568103e LibGUI: Remove UndoStack's automatic command combo'ing
UndoStack will now merge adjacent commands *if they want to be merged*
instead of bundling everything you push onto it until you tell it
to "finalize the combo."

This uses less memory and gives applications full control over how
their undo stacks end up. :^)
2021-05-08 22:17:51 +02:00
Andreas Kling 2905e10513 LibGUI+TextEditor: Make TextDocument modified state track undo stack
This was quite unreliable before. Changes to the undo stack's modified
state are now reflected in the document's modified state, and the
GUI::TextEditor widget has its undo/redo actions updated automatically.

UndoStack is still a bit hard to understand due to the lazy coalescing
of commands, and that's something we should improve upon (e.g with more
explicit, incremental command merging.) But for now, this is a nice
improvement and undo/redo finally behaves in a way that feels natural.
2021-05-08 13:49:34 +02:00
Linus Groh c989550c09 Help: Add "Help" menu and move the about action there 2021-05-07 20:37:28 +01:00
Linus Groh 83d980ab9e Chess+Help: Remove erroneous ampersand from app name
This is not applicable here, the alt shortcut is set elsewhere.
2021-05-07 20:37:28 +01:00
Andreas Kling 840b908c0b Applications: Convert StringBuilder::appendf() => AK::Format 2021-05-07 21:12:09 +02:00
Linus Groh 5391836468 LibC: Remove 'int* aslave' parameter from forkpty()
Only keep track of that (and eventually close() it) internally instead.
This argument is not present on other systems, so we were running into
compatibility issues with ports.
Also bring the implementation closer to Linux and OpenBSD by making sure
to close the slave pty fd in the fork()'d child as well as _exit()'ing
on login_tty() failure - it's non-POSIX, so those are our references
here. :^)
2021-05-06 13:52:46 +01:00
Andreas Kling 434c190667 TextEditor: Minor cleanups in the FileArgument class
* Remove unnecessary #include statements
* Move it into the TextEditor namespace
* Mark the single-argument constructor explicit
* Use move() to avoid some unnecessary copies
2021-05-06 12:35:25 +02:00
Andreas Kling 297a2762cd TextEditor: Rename "file_name" => "filename" 2021-05-06 12:33:46 +02:00
Tom 3aaffa2c47 LibGUI: Move widget registration to LibCore
This also moves Widget::load_from_json into Core::Object as a virtual
function in order to allow loading non-widget objects in GML (e.g.
BoxLayout).

Co-authored-by: Gunnar Beutner <gbeutner@serenityos.org>
2021-05-06 08:50:39 +02:00
Carlos César Neves Enumo 928f16d360 LibGUI: Remember modified state on undo/redo actions 2021-05-06 08:40:26 +02:00
Linus Groh d9702ff561 Spreadsheet: Use shrink-to-fit for cell fg/bg color input layout
This fixes an issue where the bottom of both color inputs was cut off
due to insufficient, hardcoded height.
2021-05-05 15:30:45 +01:00
Gunnar Beutner eb21aa65d1 Userland: Make IPC results with one return value available directly
This changes client methods so that they return the IPC response's
return value directly - instead of the response struct - for IPC
methods which only have a single return value.
2021-05-03 21:14:40 +02:00
Gunnar Beutner 5bb79ea0a7 Userland: Update IPC calls to use proxies
This updates all existing code to use the auto-generated client
methods instead of post_message/send_sync.
2021-05-03 21:14:40 +02:00
Andreas Kling d47f15ab8b LibGUI: Rename ScrollableWidget => AbstractScrollableWidget 2021-05-03 21:03:13 +02:00
Matthew Olsson 88cfaf7bf0 LibGfx: Unify Rect, Point, and Size
This commit unifies methods and method/param names between the above
classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where
appropriate. It also renamed the various move_by methods to
translate_by, as that more closely matches the transformation
terminology.
2021-05-02 22:48:06 +02:00
ry755 8af7cda17a TextEditor: Specify the starting line and column number using colons
This allows the user to specify a specific line and column number to
start at when opening a file in TextEditor through the terminal, by
adding a colon after the file name.

For example, `TextEditor ReadMe.md:10:5` will open ReadMe.md and put
the cursor on line 10 at column 5.

To ensure that the user isn't trying to open a file that actually has
colons in its name, it checks if the file exists before parsing.

Replaces the feature added in b474f49164
Closes #5589
2021-05-02 10:25:51 +02:00
Gunnar Beutner 6cf59b6ae9 Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr 2021-05-01 21:25:06 +02:00
Valtteri Koskivuori 4e6f03a860 PixelPaint: Add fill mode for the ellipse tool
Functionality was already there, just had to hook it up!
2021-05-01 21:11:33 +02:00
Andreas Kling a7fb50567b TextEditor: Make sure to mark the Window as unmodified after saving
This comes with a FIXME, as it would be nicer if this information
would propagate from TextDocument all the way out somehow.
2021-05-01 19:42:29 +02:00
Andreas Kling f0cc712246 TextEditor: Use an automatic "modified" marker in the window title
This simplifies the application somewhat as we no longer need to
manually update the window title whenever the text document changes.
2021-05-01 19:42:29 +02:00
Andreas Kling 20dd5735ce WindowServer+LibGfx: Automatic "modified" markers in window titles
You can now add the string "[*]" to a window title and it will be
replaced with " (*)" if the window is modified, and with "" otherwise.
2021-05-01 19:42:29 +02:00
Andreas Kling e9c40b0243 TextEditor: Plumb modified state from GUI::TextDocument to GUI::Window
Instead of tracking this stuff ourselves at the application level,
we now just act as an intermediary and pass along the information to
the windowing system.
2021-05-01 19:42:29 +02:00
Andreas Kling 443775754f TextEditor: Add some missing curly braces around a nested if statement 2021-05-01 19:42:29 +02:00
Andreas Kling e5ceabfbbb TextEditor: Remove some unnecessary #include statements 2021-05-01 19:42:29 +02:00
Andreas Kling b424e6c86f TextEditor: Rename TextEditorWidget => TextEditor::MainWidget 2021-05-01 19:42:29 +02:00
Andreas Kling 4b0098e52f Everywhere: Rename app_menu to file_menu or game_menu 2021-05-01 17:40:54 +02:00
Tobias Christiansen ef8f97635e Spreadsheet: Use String::bijective_base_from for column name resolution
Updated Spreadsheet to use the new way of converting a number to a
String represenation using the alphabet.
The code responsible for this conversion now lives in AK/String, so it
gets deleted from Spreadsheet.cpp.
2021-05-01 01:19:40 +02:00
Gunnar Beutner f48f26f52d LibC: Implement openpty(), forkpty() and login_tty()
These are used by OpenSSH.
2021-04-30 23:10:22 +02:00
Maciej Zygmanowski 6a12420d9d Browser: Add FrogFind search engine
FrogFind is a search engine for very old computers and can be
loaded and rendered correctly by Serenity Browser :^)
2021-04-30 17:57:22 +02:00
Andreas Kling 3d4afe7614 Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29 22:23:52 +02:00
Andreas Kling 7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
Andreas Kling def1f1444a WindowServer: Move configuration file to /etc/WindowServer.ini
This was in the /etc/WindowServer/ directory which had nothing else in
it, so let's just get rid of the directory and move this up one step.
2021-04-29 22:16:18 +02:00
Brian Gianforcaro adcd56473c Tests: Enable Spreadsheet unit tests so they actually build 2021-04-29 10:37:26 +02:00
Maciej Zygmanowski 1460c93651 Browser: Display search engine format in statusbar 2021-04-29 09:08:22 +02:00
Maciej Zygmanowski 2de0ff28dd Browser: Save search engine setting to preferences 2021-04-29 09:08:22 +02:00
Panagiotis Vasilopoulos 278605cde6
Browser: Add GitHub and Yandex to search engines 2021-04-29 01:15:42 +02:00
Linus Groh 649d2faeab Everywhere: Use "the SerenityOS developers." in copyright headers
We had some inconsistencies before:

- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."

I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.

By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
2021-04-29 00:59:26 +02:00
Linus Groh 5459c744f1 Everywhere: Add missing comma between copyright year and name 2021-04-29 00:59:26 +02:00
Jean-Baptiste Boric f9d82ecf18 Run: Remove useless serenity.h include 2021-04-27 23:06:16 +02:00
thankyouverycool ed634a4582 FontEditor: Don't put invalid clicks on the undo stack 2021-04-26 18:43:35 +02:00
thankyouverycool 8febfb169d FontEditor: Warn on unsaved changes
Standardizes saving conventions: Editor now warns on close, new,
and open if there are unsaved changes, and new files prompt to
Save As.
2021-04-26 18:43:35 +02:00
sppmacd d164da7d19
Browser: Add basic support for search engines
If you start a URL with a '?' character, the Browser will use the
user-selected search engine (none by default).

For now, there are several engines hardcoded and there is no support
for custom search engines.
2021-04-26 11:52:19 +02:00
Linus Groh dbe72fd962 Everywhere: Remove empty line after function body opening curly brace 2021-04-25 20:20:00 +02:00
DexesTTP 71d27abb97 Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with
the recent introduction of the WebSocket service, long-lasting
connections with another server are not part of it. To better reflect
this, this commit renames it to RequestServer.

This commit also changes the existing 'protocol' portal to 'request',
the existing 'protocol' user and group to 'request', and most mentions
of the 'download' aspect of the request to 'request' when relevant, to
make everything consistent across the system.

Note that LibProtocol still exists as-is, but the more generic Client
class and the more specific Download class have both been renamed to a
more accurate RequestClient and Request to match the new names.

This commit only change names, not behaviors.
2021-04-25 19:04:34 +02:00
DexesTTP 22413ef729 LibWeb: Add WebSocket bindings
The WebSocket bindings match the original specification from the
WHATWG living standard, but do not match the later update of the
standard that involves FETCH. The FETCH update will be handled later
since the changes would also affect XMLHttpRequest.
2021-04-25 19:04:34 +02:00
Andreas Kling 6c2ec4c1a4 Userland+Base: Add "ladyball" logo for the system :^)
Thanks to Katalin Kult for the artwork!
2021-04-25 18:57:10 +02:00
TheGeopard 2b78d90d04 FileManager: Unzip from context Menu
This adds a new context menu entry allowing you to extract ZIP archives
by invoking /bin/unzip
2021-04-25 18:40:42 +02:00
kleines Filmröllchen d77e7e99e4 Piano: Add track Volume and improve QOL
This patch implements a couple of enhancements to the synthesizer
engine:

* Each track has a volume control.
* The input and tooltips for all controls are improved.
* The noise channel is pitched, which allows for basic drum synthesis.
2021-04-25 11:30:41 +02:00
Andrew Kaster 35c0a6c54d AK+Userland: Move AK/TestSuite.h into LibTest and rework Tests' CMake
As many macros as possible are moved to Macros.h, while the
macros to create a test case are moved to TestCase.h. TestCase is now
the only user-facing header for creating a test case. TestSuite and its
helpers have moved into a .cpp file. Instead of requiring a TEST_MAIN
macro to be instantiated into the test file, a TestMain.cpp file is
provided instead that will be linked against each test. This has the
side effect that, if we wanted to have test cases split across multiple
files, it's as simple as adding them all to the same executable.

The test main should be portable to kernel mode as well, so if
there's a set of tests that should be run in self-test mode in kernel
space, we can accomodate that.

A new serenity_test CMake function streamlines adding a new test with
arguments for the test source file, subdirectory under /usr/Tests to
install the test application and an optional list of libraries to link
against the test application. To accomodate future test where the
provided TestMain.cpp is not suitable (e.g. test-js), a CUSTOM_MAIN
parameter can be passed to the function to not link against the
boilerplate main function.
2021-04-25 09:36:49 +02:00
Linus Groh 97d49cb92b LibJS: Consolidate exception function names and source ranges
Instead of storing the function names (in a badly named Vector<String>)
and source ranges separately, consolidate them into a new struct:
TracebackFrame. This makes it both easier to use now and easier to
extend in the future.
Unlike before we now keep each call frame's current node source range
in the traceback frame next to the function name, meaning we can display
line and column numbers outside of the VM and after the call stack is
emptied.
2021-04-24 20:11:04 +02:00
kleines Filmröllchen c1345bda3e Userland: Piano: Optimize repaints
The Piano application used to perform very poorly due to unnecessary
draw calls. This is solved with two optimziations:

1. Don't draw the widgets as often as possible. The widgets are instead
   at least updated every 150ms, except for other events.
2. Don't re-draw the entire piano roll sheet. The piano roll background,
   excluding in-motion objects (notes, the play cursor), is only re-drawn
   when its "viewport" changes.

A minor drawback of this change is that notes will appear on top of the
pitch labels if placed at the left edge of the roll. This is IMO
acceptable or may be changed by moving the text to the "foreground".
2021-04-23 22:35:49 +02:00
Linus Groh 4b33365078 Help: Run clang-format on main.cpp 2021-04-23 18:47:42 +02:00
Andreas Kling 935be7f297 SystemMonitor: Show action status tips in the statusbar :^) 2021-04-23 17:25:33 +02:00
Andreas Kling caa39eee6f Help: Add a statusbar and use it for hovered links + action status tips 2021-04-23 17:19:17 +02:00
Andreas Kling b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
thankyouverycool f0f487babd FontEditor: Set proper defaults in NewFontDialog
GlyphBitmap width is currently limited to twiddling 32 bits so
abide by a 32x36 standard for now. Fixes incorrect line values and
ranges and removes unused RefPtr.
2021-04-23 11:08:11 +02:00
thankyouverycool cc7744f6ca LibGfx+FontEditor: Account for raw width when painting glyphs
Fixes hidden glyphs being painted in editor and map, and '?'
subsitute glyphs being overdrawn in the system.
2021-04-23 11:08:11 +02:00
thankyouverycool 0664fbd584 FontEditor: Don't append literal Line Feeds to clipboard metadata
Fixes newline breakage in ClipboardHistory when copying LF glyphs
2021-04-23 11:08:11 +02:00
thankyouverycool 8b3a92de37 FontEditor: Set correct mean- and baseline ranges for new fonts
Fixes out-of-bounds lines in glyph editor
2021-04-23 11:08:11 +02:00
thankyouverycool bada590b91 FontEditor: Add move glyph tool
When toggled on, glyphs can now be repositioned within the glyph
editor by dragging the mouse
2021-04-23 11:08:11 +02:00
thankyouverycool 44cd121e30 FontEditor: Add undo and redo commands 2021-04-23 11:08:11 +02:00
thankyouverycool 2785e12b76 FontEditor: Add adjustable scaling to GlyphEditorWidget
The editor can now be adjusted under the View->Scale menu
2021-04-23 11:08:11 +02:00
thankyouverycool cc781e3d94 FontEditor: Add status tips and missing Alt shortcuts to actions 2021-04-23 11:08:11 +02:00
thankyouverycool a108358feb FontEditor: Add text refresh button to Preview ToolWindow
Cycles through classic pangrams and some symbols
2021-04-23 11:08:11 +02:00
Linus Groh ebdeed087c Everywhere: Use linusg@serenityos.org for my copyright headers 2021-04-22 22:51:19 +02:00
Idan Horowitz 1c512a702a AK+Userland: Use idan.horowitz@serenityos.org for my copyright headers 2021-04-22 22:42:38 +02:00
Andreas Kling 0eedf3bfea SystemMonitor: Only show two decimal digits for the CPU usage 2021-04-22 18:24:12 +02:00
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling 3a891abc37 FontEditor: Convert String::format() => String::formatted() 2021-04-21 23:49:02 +02:00
Andreas Kling 2a6a54dea5 Userland: Use Core::DirIterator::next_full_path()
Simplify some code by using this instead of concatenating the full path
ourselves at the call site.
2021-04-21 23:49:01 +02:00
Lenny Maiorani ece8aeaaf4 Everywhere: Remove redundant inline keyword with constexpr
Problem:
- `constexpr` functions are additionally decorated with `inline`
  keyword. This is redundant since `constexpr` implies `inline`.

Solution:
- Remove redundancies.
2021-04-21 20:49:49 +02:00
Andreas Kling 3f02742504 Terminal: Use 16x16/settings.png for the terminal settings action 2021-04-21 19:03:55 +02:00
Tobias Christiansen a8915ecd61 FileManager+FileOperation: Report Errors when doing an file operation
Report back errors from the FileOperation to the FileManager and
display them in the MessageBox
2021-04-20 12:02:01 +02:00
Tobias Christiansen 7d60164d93 FileManager: Don't crash on error in FileOperation
did_error() caused the program to crash since the DialogBox tried to
run its own Notifier with the same - now invalid because closed - fd.

In addition to setting the member that is the Notifier to nullptr we
also tell the Notifier that it is not enabled anymore.
2021-04-20 12:02:01 +02:00
Andreas Kling 6793574003 LibGfx: Improve PNG encoder API somewhat
This is still far from ideal, but let's at least make it take a
Gfx::Bitmap const&.
2021-04-19 23:49:16 +02:00
Idan Horowitz 18ae37439a FontEditor+LibGfx: Allow user to specify if a specific glyph is present
This replaces the glyph width spinbox in the font editor with a
checkbox when editing fixed width fonts that indicates if the
currently selected character's glyph is present in the edited font
(For variable width fonts a non zero width implies presence)

This commit also changes the background color of glyphs in the glyph
map based on the presence of each specific glyph in the font.
2021-04-18 22:10:25 +02:00
Idan Horowitz 60f82e0626 FontEditor: Update GlyphMap on font type change
Since font type changes also change the amount of glyphs in a font, the
glyph map has to be re-rendered to properly showcase the change.
2021-04-18 18:57:35 +02:00
Linus Groh 8d490aba76 LibJS: Implement console.assert() 2021-04-18 18:28:17 +02:00
Linus Groh e37421bddc Browser+WebContent: Fix HTML injection in console functions output 2021-04-18 18:28:17 +02:00
Andreas Kling e98091ad15 FileManager: Show action status tips in the status bar :^) 2021-04-18 16:44:00 +02:00
Andreas Kling 12546259ff Everywhere: Rename title_bar => titlebar 2021-04-18 16:35:18 +02:00
Andreas Kling f77100d66b Browser: Add status tips to most of the actions 2021-04-18 10:58:22 +02:00
Andreas Kling 679feec195 Browser: Show status tips for any entered action 2021-04-18 10:58:22 +02:00
Andreas Kling a2086ad56e LibGUI: Rename Action::long_text to Action::status_tip
This feels a bit more descriptive.
2021-04-18 10:58:22 +02:00