Commit Graph

940 Commits

Author SHA1 Message Date
William McPherson
165765145c Piano: Remove redundant logic in fill_audio_buffer
"If 0, set to val" is the same as "add val".
2019-12-23 15:08:15 +01:00
Paweł Cholewa
e2dcf27a2e TextEditor: Ask before opening a file if current document is dirty
This commit should be a fix of issue #892
2019-12-22 09:10:26 +01:00
Andreas Kling
c5c1cc817e Kernel: Expose region executable bit in /proc/PID/vm
Also show it in SystemMonitor's process memory map table (as 'X') :^)
2019-12-21 16:26:42 +01:00
joshua stein
23158aef2e Build: only setup git defines for About application 2019-12-20 23:55:08 +01:00
joshua stein
ac25438d54 Build: clean up build system, use one shared Makefile
Allow everything to be built from the top level directory with just
'make', cleaned with 'make clean', and installed with 'make
install'.  Also support these in any particular subdirectory.

Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as
it runs.

Kernel and early host tools (IPCCompiler, etc.) are built as
object.host.o so that they don't conflict with other things built
with the cross-compiler.
2019-12-20 20:20:54 +01:00
Andreas Kling
ea91f24a49 QuickShow: Allow dropping an image file on the QuickShow window
We now try to open image files dropped on us from FileManager. :^)

The QuickShow code is not exactly well-factored, and should be fixes up
to not do the same thing twice, etc.
2019-12-20 20:07:10 +01:00
Andreas Kling
f276030969 QuickShow: Don't disable background fill 2019-12-20 20:07:10 +01:00
Andreas Kling
6425b8714a TextEditor: Handle drop events
We now handle drop events with data type "url-list". This makes it
possible to drop a file from FileManager on TextEditor to open it.
2019-12-20 20:07:10 +01:00
Hüseyin ASLITÜRK
1c9742a4a5 DisplayProperties: Highlight current resolution at startup 2019-12-19 10:34:44 +01:00
Zyper
413618454b PaintBrush: Shift key constrains LineTool angle
Holding Shift key will constrain the LineTool's line angle to 15 degrees
increments. Many graphics editors have similar feature.
2019-12-17 21:21:24 +01:00
Zyper
b185c7f58a PaintBrush: Tools can receive KeyUp events 2019-12-17 21:21:24 +01:00
Andreas Kling
931e4b7f5e Kernel+SystemMonitor: Prevent userspace access to process ELF image
Every process keeps its own ELF executable mapped in memory in case we
need to do symbol lookup (for backtraces, etc.)

Until now, it was mapped in a way that made it accessible to the
program, despite the program not having mapped it itself.
I don't really see a need for userspace to have access to this right
now, so let's lock things down a little bit.

This patch makes it inaccessible to userspace and exposes that fact
through /proc/PID/vm (per-region "user_accessible" flag.)
2019-12-15 20:11:57 +01:00
Andreas Kling
39a6d29b39 SystemMonitor: Make the memory map the "default view"
The memory map is a lot more interesting than the "open files" view :^)
2019-12-15 20:00:19 +01:00
Hüseyin ASLITÜRK
22b190e4be DisplayProperties: Start at top left position for full view at low resoluations. 2019-12-15 19:50:54 +01:00
Andreas Kling
3fbc50a350 Kernel+SystemMonitor: Expose the number of set CoW bits in each Region
This number tells us how many more pages in a given region will trigger
a CoW fault if written to.
2019-12-15 16:53:00 +01:00
William McPherson
69d05fbf44 Piano: Add triangle wave and noise
The squad is complete :^)

You can find the equation for the triangle wave here:
https://en.wikipedia.org/wiki/Triangle_wave
We're using this one:
|x mod 4 - 2| - 1
Modifications have been made to correct the frequency and phase:
|(4x + 1) mod 4 - 2| - 1

The white noise is generated by calling rand() and dividing it by
RAND_MAX to get a value from 0 to 1. Then it's adjusted to fit between
-1 and 1.
2019-12-13 19:30:14 +01:00
Tommy Nguyen
091c783626 FileManager: Check which widget has focus for context menu actions
This fixes the issue where application shortcuts only operated on the
TreeView.
2019-12-12 23:53:12 +01:00
Tommy Nguyen
17f3948b15 FileManager: Add a context menu to the TreeView
This adds a context menu to the TreeView with the ability to copy/paste, create
new directories, etc. This does not address the issue mentioned above where
using the global application shortcut does not apply to whatever view has
focus.
2019-12-12 11:19:02 +01:00
Andreas Kling
fd5eb79d19 LibGUI: Make GMenu inherit from CObject
This is primarily to make it possible to pass a GMenu* where a CObject*
is expected.
2019-12-09 21:05:44 +01:00
Andreas Kling
92b46d9814 SystemMonitor: Show information about purgeable memory
This patch exposes some fields about purgeable memory regions.
We now also show total purgeable volatile and non-volatile memory in
the big process table.
2019-12-09 19:16:58 +01:00
Andreas Kling
6f4c380d95 AK: Use size_t for the length of strings
Using int was a mistake. This patch changes String, StringImpl,
StringView and StringBuilder to use size_t instead of int for lengths.
Obviously a lot of code needs to change as a result of this.
2019-12-09 17:51:21 +01:00
Andrew Kaster
e09a02ad3f SystemMonitor: Show thread name instead of process name
Add the thread name to CThreadStatistics and display it in the
system monitor's process model instead of the process name.
2019-12-08 14:09:29 +01:00
Tommy Nguyen
875ab0cf10 FileManager: Add separate context menus for entries
Ref: #826

Right-clicking a directory no longer has the "Open in TextEditor" entry.
Right-clicking the directory view now allows you to create a new directory.
2019-12-08 14:07:06 +01:00
Sasan Hezarkhani
8cea5c053d TextEditor: `Fix bug when document is marked dirty on open.
Currently, when `set_text()` is called on GTextDocument a change is
triggered and all clients registered get a document_did_set_text
call. This in turn causes the TextEditorWidget to mark the document
as dirty even on the first open, which makes for a weird experience.
2019-12-06 19:45:13 +01:00
Sergey Bugaev
f2546d15ce Taskbar: Add a quick launch bar
This is a tiny bar at the left of the taskbar where you can put
your most used apps to launch them with a single click. In a way,
it's another replacement for the Launcher, in addition to the app
menu. Unlike the launcher and the menu, it's not meant to be the
primary way to launch apps; it's only a faster way to launch a few
most often used utilities.
2019-12-04 14:32:15 +01:00
Andreas Kling
d111b6ead4 WindowServer+Taskbar: Animate window frames on minimize/unminimize
We now show a quick window outline animation when going in/out of
minimized state. It's a simple 10 frame animation at 60fps, just to
give a visual cue of what's happening with the window.

The Taskbar sends over the corresponding button rect for each window
to the WindowServer using a new WM_SetWindowTaskbarRect message.

Note that when unminimizing, we still *show* the window right away,
and don't hold off until the animation has finished. This avoids
making the desktop feel slow/sluggish. :^)
2019-12-03 21:34:34 +01:00
Tommy Nguyen
9a01e70ff9 FileManager: Refresh tree view when deleting directories
Fixes #825

The logic already existed. I just moved it to a separate lambda then added it
to the appropriate action. Note that when the tree view refreshes, it seems to
randomly open trees. I would like to fix this in a separate PR.
2019-12-03 12:50:47 +01:00
Sasan Hezarkhani
6db11e5bba IRCClient: Sort the member list ignoring the character cases.
I compared a few clients and they do the same sort of sorting.
2019-12-03 12:50:06 +01:00
Andreas Kling
b9f58a0e2e SystemMonitor: Enable sorting by column in the process memory map view 2019-12-02 17:43:52 +01:00
Andreas Kling
7970b594d5 SystemMonitor: Update the process memory map once every second 2019-12-02 17:36:10 +01:00
Andreas Kling
790a27a444 Terminal: Ignore SIGCHLD with SA_NOCLDWAIT
Otherwise we'll accumulate a bunch of dead Terminal children if you
open and close more terminal windows.
2019-12-02 16:50:10 +01:00
Andreas Kling
272d65e3e2 WindowServer: Port to the new IPC system
This patch introduces code generation for the WindowServer IPC with
its clients. The client/server endpoints are defined by the two .ipc
files in Servers/WindowServer/: WindowServer.ipc and WindowClient.ipc

It now becomes significantly easier to add features and capabilities
to WindowServer since you don't have to know nearly as much about all
the intricate paths that IPC messages take between LibGUI and WSWindow.

The new system also uses significantly less IPC bandwidth since we're
now doing packed serialization instead of passing fixed-sized structs
of ~600 bytes for each message.

Some repaint coalescing optimizations are lost in this conversion and
we'll need to look at how to implement those in the new world.

The old CoreIPC::Client::Connection and CoreIPC::Server::Connection
classes are removed by this patch and replaced by use of ConnectionNG,
which will be renamed eventually.

Goodbye, old WindowServer IPC. You served us well :^)
2019-12-02 11:11:05 +01:00
Jonathan Archer
f4949fcf83 About: Show repository info
Fixes #832
2019-12-02 09:21:47 +01:00
Andreas Kling
5a45376180 Kernel+SystemMonitor: Log amounts of I/O per thread
This patch adds these I/O counters to each thread:

- (Inode) file read bytes
- (Inode) file write bytes
- Unix socket read bytes
- Unix socket write bytes
- IPv4 socket read bytes
- IPv4 socket write bytes

These are then exposed in /proc/all and seen in SystemMonitor.
2019-12-01 17:40:27 +01:00
Andreas Kling
f8703d44cc TextEditor: Focus the editor widget on startup 2019-11-30 15:35:19 +01:00
Andreas Kling
b09ac26311 PaintBrush: Allow canceling a line by pressing the Escape key
Sometimes you change your mind mid-line, and just want to get out of
the situation. You can now do that :^)
2019-11-29 22:41:36 +01:00
Andreas Kling
4e6cd541c9 PaintBrush: Add a "line" tool for drawing straight lines
This implements "preview" of the line by allowing tool subclasses to
hook the second_paint_event on the PaintableWidget.

Work towards #375.
2019-11-29 22:41:19 +01:00
Andreas Kling
5ca88bf9b4 DisplayProperties: Add 1280x720 to the list of resolutions 2019-11-29 21:07:24 +01:00
Andreas Kling
f99e554c5e Calculator: Add a 16x16 app icon 2019-11-29 21:04:19 +01:00
Andreas Kling
5b8cf2ee23 Kernel: Make syscall counters and page fault counters per-thread
Now that we show individual threads in SystemMonitor and "top",
it's also very nice to have individual counters for the threads. :^)
2019-11-26 21:37:38 +01:00
Andreas Kling
712ae73581 Kernel: Expose per-thread information in /proc/all
Previously it was not possible to see what each thread in a process was
up to, or how much CPU it was consuming. This patch fixes that.

SystemMonitor and "top" now show threads instead of just processes.
"ps" is gonna need some more fixing, but it at least builds for now.

Fixes #66.
2019-11-26 21:37:30 +01:00
Andreas Kling
029455cb40 Browser: Add a simple "view source" menu action
This opens the source of the current document in TextEditor.
For file:// URLs, we open the local file, but for all other protocols,
a temporary file is generated, containing the document source.

Longer-term we should build some kind of viewer into the Browser app
instead. That would avoid silly problems like how this forgets to
delete the temporary files, for instance :^)
2019-11-25 00:28:18 +01:00
Andreas Kling
0d2659c0a2 LibHTML: Use LibProtocol for HTTP requests :^)
This moves all of the browser networking to ProtocolServer.
2019-11-24 14:24:59 +01:00
Andreas Kling
5d8324f133 Applications: Remove unused/unfinished "Downloader" program 2019-11-23 19:26:57 +01:00
Till Mayer
09189e34e3 FileManager: Added support for deleting directories
Directories can now be deleted using the "Delete..." action from the
context menu
2019-11-23 16:38:24 +01:00
Andreas Kling
bd857cd0fa Browser: Add a debug menu action to dump the current style sheets 2019-11-21 19:52:09 +01:00
Till Mayer
b0b523e973 FileManager: Added properties dialog
The user can rename files, change the permissions and view different
properties of the file.
2019-11-20 23:23:57 +01:00
Andreas Kling
dbf8d6bc1e Terminal+LibVT: Switch Terminal to using explicit copy/paste actions
Instead of implicitly copying whatever you select, and pasting when you
middle-click, let's have traditional copy and paste actions bound to
Ctrl+Shift+C and Ctrl+Shift+V respectively.
2019-11-20 21:47:12 +01:00
Andreas Kling
ef552add6c Terminal: Add action to open a new terminal with Ctrl+Shift+N 2019-11-20 21:47:12 +01:00
Andreas Kling
02f89dc419 Kernel+SystemMonitor: Show VM region "shared" and "stack" bits in UI
Expose these two region bits through /proc/PID/vm and show them in the
SystemMonitor process memory map view.
2019-11-17 12:15:46 +01:00
Andreas Kling
69ca9cfd78 LibPthread: Start working on a POSIX threading library
This patch adds pthread_create() and pthread_exit(), which currently
simply wrap our existing create_thread() and exit_thread() syscalls.

LibThread is also ported to using LibPthread.
2019-11-13 21:49:24 +01:00
Sergey Bugaev
d3504b4f9b Terminal+HackStudio: Fix leaking PTM fd to child processes
The pseudoterminal *master* fd is not supposed to be inherited,
so make sure to open it with O_CLOEXEC.
2019-11-13 16:37:04 +01:00
Andreas Kling
dd2900eda0 Launcher: Remove the Launcher app, and all hacks in support of it
The Launcher's functionality has been replaced by the app shortcuts in
the system menu.

There were various window management hacks to ensure that the launcher
stayed below all other windows while also being movable, etc.
2019-11-11 13:13:08 +01:00
Andreas Kling
06a80bcf69 Kernel+SystemMonitor: Publish can_read/write state for open files
The can_read() and can_write() states for file descriptions are now
published in /proc, allowing SystemMonitor to display it.
2019-11-09 22:42:19 +01:00
Till Mayer
b4c18870de SoundPlayer: Add option to hide scope
Fixes #521. The scope can be hidden using the option in the app menu.
2019-11-09 20:55:47 +01:00
Till Mayer
56cd8b4d17 SoundPlayer: Let the user open a file from the GUI
The user now can open a file without passing it as an argument
2019-11-09 20:55:47 +01:00
Hüseyin ASLITÜRK
aba6e6de6a FileManager: Remember my last position and size. 2019-11-09 20:50:53 +01:00
Andreas Kling
70a4678d77 LibHTML: Paint a magenta rectangle around the currently inspected node
Document now tracks one "inspected" node, set by set_inspected_node()
which is called by Browser's DOM inspector view on_selection callback.
2019-11-09 11:58:50 +01:00
Andreas Kling
e3d975e943 LibHTML+Browser: Add a simple DOM inspector popup window
LibHTML now provides a DOMTreeModel which can be used to view a given
Document's DOM tree. :^)
2019-11-09 11:31:03 +01:00
Andreas Kling
8a024a3305 LibGUI: Rename GEventLoop.{cpp,h} => GWindowServerConnection
The GEventLoop class is long gone, and the only class in these files is
GWindowServerConnection, so let's update the file names. :^)
2019-11-08 11:40:25 +01:00
Andreas Kling
d6f9349f15 IRCClient: Escape HTML entities in nicknames, too, just in case 2019-11-07 18:09:52 +01:00
Andreas Kling
a377e8d3f5 LibHTML+IRCClient: Add an escape_html_entities() helper
This simple helper escapes '<', '>' and '&' so they can be used in HTML
text without interfering with the parser.

Use this in IRCClient to prevent incoming messages from messing with
the DOM :^)
2019-11-06 22:40:01 +01:00
Andreas Kling
f60c46ceb7 IRCClient: Use parse_html_fragment() to add messages to the HtmlView
HTML fragment strings are so much nicer to work with than raw DOM APIs.
This makes it feel like we're using innerHTML :^)
2019-11-06 20:53:30 +01:00
Andreas Kling
794f2d5645 LibHTML: Rename parse_html() => parse_html_document() 2019-11-06 20:52:18 +01:00
Andreas Kling
f5cf8d4ad8 Revert "LibHTML: Rename parse_html() => parse_html_document()"
This reverts commit f6439789db.
Oops, I committed unrelated changes here, let me clean that up..
2019-11-06 20:51:07 +01:00
Andreas Kling
f6439789db LibHTML: Rename parse_html() => parse_html_document() 2019-11-06 20:31:56 +01:00
Till Mayer
ac9907ee61 SoundPlayer: Changed some small cosmetic things
Renamed "Position" to "Elapsed". "channel/channels" automatically
changes now when more than one channel exist. The current file name
is now displayed in the window title.
2019-11-05 19:50:11 +01:00
Till Mayer
77f3c12dc9 SoundPlayer: Added playback controls
The playback of a file can now be paused, stopped, continued and the
user can seek to any part of the file.
2019-11-04 20:55:46 +01:00
Till Mayer
112d36bfa0 SoundPlayer: Make sample widget display contents of the whole buffer
The SampleWidget now displays the contents of the whole buffer.
2019-11-04 20:55:46 +01:00
Your Name
e46b251d61 SystemMonitor: Add device column to filesystems tab 2019-11-04 19:42:21 +01:00
Hüseyin ASLITÜRK
e2f0ac13a4 FileManager: Remember my last view mode (#731) 2019-11-04 17:27:56 +01:00
Andreas Kling
f76168a3ea FileManager: Make copying faster with ftruncate() and a bigger buffer
Apply the same techniques from "cp" to make copying files much faster.
2019-11-04 17:25:44 +01:00
Andreas Kling
b8bf998b61 LibGUI: Move text search functions from GTextEditor to GTextDocument
Also add a find_all() that retuns a Vector<GTextRange> and simply does
a find_next() loop, returning all the matching ranges.
2019-11-01 21:31:06 +01:00
Andreas Kling
fa69b9fbb7 IRCClient: Switch to using an HtmlView for the IRC window contents :^)
This seemed like a perfect fit for LibHTML. We can now style the IRC
channels and queries however we like with the power of HTML and CSS.

This patch doesn't do much in the way of styling, it just gets the
basic mechanism into place.
2019-10-28 20:53:19 +01:00
Brandon Scott
98e556fee9 HexEditor: Created has_selection() method.
Created has_selection() method and fixed a few small issues.
2019-10-27 00:44:42 +02:00
Brandon Scott
c77fe5161c HexEditor: Added fill selection action.
Added the ability to fill the current selection with a given byte.
2019-10-27 00:44:42 +02:00
Brandon Scott
f947353a56 HexEditor: Added new file action.
Added a new file action, allowing you to create a new file of a specific
size.
2019-10-27 00:44:42 +02:00
Brandon Scott
bddabad3d9 HexEditor: Fixed startup error
When attempting to open a file that doesnt exist or has permission
problems, the application would end after hitting OK on the message
box instead of starting up to an empty editor.

I believe this has something to do with the dialog event loop
interfering with the application event loop, or possibly the fact
that the window creation code is in the show() method.

To work around this I now call the open_file() method after the
show() method.
2019-10-24 09:57:27 +02:00
Brandon Scott
e3fbd2fe60 HexEditor: Added a multi-label status bar, and a new copy option.
Make use of the new multi-label status bar, and added a menu
option to allow you to copy generated C code from a selection
to the clipboard.
2019-10-24 09:57:27 +02:00
Andreas Kling
cd1eee6604 LibVT+Terminal: Give TerminalWidget a hook for EOF on the pty
Instead of quitting the application immediately when the pty gives an
EOF, fire an on_command_exit hook so the TerminalWidget client can
decide for himself what to do.
2019-10-22 21:57:53 +02:00
Andreas Kling
e9f6e1e287 LibVT+Terminal: Don't set window title directly from TerminalWidget
Instead, have TerminalWidget provide an on_title_change hook.
This allows embedders to decide for themselves what to do if we receive
a "set terminal title" escape sequence.
2019-10-21 22:07:59 +02:00
Andreas Kling
da0958a882 LibVT: Make TerminalWidget's automatic size policy updates optional
When embedding a TerminalWidget, you might not want it to automatically
update its own size policy based on the exact terminal buffer size.

This behavior is now passed as a flag to the TerminalWidget constructor
which makes it behave nicely both inside HackStudio and in Terminal.
2019-10-21 20:28:30 +02:00
Andreas Kling
8b4903e733 LibVT: Move TerminalWidget from the Terminal app to here
It would be nice to be able to reuse this widget in other apps. :^)
2019-10-21 19:50:07 +02:00
Brandon Scott
465a33443c HexEditor: Fix half byte offset bug
If you had made a change to the first 4 bits of a byte and then changed
your offset via keyboard or menu option it would change the last 4 bits
of the new offset the next time you made a change and would not show that
the byte had been changed at the new offset.
2019-10-21 09:45:21 +02:00
Brandon Scott
a76b02f741 HexEditor: Added navigate to a hex offset
Added the ability to navigate to a specified hex offset.
2019-10-21 09:45:21 +02:00
Brandon Scott
443eda986a HexEditor: Fixed off-by-one copying bug
When copying as hex or text we missed the last byte.
2019-10-21 09:45:21 +02:00
Brandon Scott
5cc722cec4 HexEditor: Reverse selections
Added the ability to select text and hex in reverse.
2019-10-21 09:45:21 +02:00
Andreas Kling
c41bae3d54 LibHTML+Browser: Support scrolling to anchor with <a href="#foo">
This patch implements basic support for <a href="#foo"> fragment links.

To figure out where we actually want to scroll to, we have to do
something different based on the layout node's box type. So if it's a
regular LayoutBox we can just use the LayoutBox::position().

However, if it's an inline layout node, we use the position of the
first line box fragment in the containing block contributed by this
layout node or one of its descendants.
2019-10-20 10:07:26 +02:00
Andreas Kling
884ae80699 LibHTML+Browser: Show target URL of hovered links in Browser statusbar
HtmlView will now invoke the on_link_hover hook when the cursor enters
or leaves a DOM node that has an enclosing link element.

This patch also updates the meaning of Node::enclosing_link_element()
to find the nearest HTMLAnchorElementAncestor *with an href attribute*.
2019-10-19 21:25:49 +02:00
Andreas Kling
fbdd0def47 Terminal: Make Shift+PgUp/PgDown scroll the terminal up/down one page
I keep doing this out of habit, expecting it to scroll, and now it
actually will scroll. :^)
2019-10-19 20:54:47 +02:00
Andreas Kling
89aaae82a1 Browser: Add basic back/forward history 2019-10-17 23:39:31 +02:00
Chyza
36bb03b6dd PaintBrush: Use secondary color for eraser (like in ms_paint)
Comes with a checkbox to turn it off if you dislike it.
2019-10-15 19:18:04 +02:00
Kevin Murphy
10324bc574 TextEditor: suppress "Not found" window when searching for empty string
Minor patch, but I was watching one of your videos on YouTube and
thought that the pop-up was unecessary/annoying in this case.  Love
your enthusiasm for the project :^)
2019-10-15 09:10:10 +02:00
Andreas Kling
49ac0c2e24 LibHTML: Move layout root from HtmlView to Document
The layout root is now kept alive via Document::m_layout_root.
This will allow us to do more layout-related things inside the inner
layer of LibHTML without reaching out to the HtmlView.

I'd like to keep HtmlView at a slightly higher level, to prevent it
from getting too complex.

This patch also fixes accidental disconnection of the layout tree from
the DOM after doing a layout tree rebuild. ~LayoutNode() now only
unsets the DOM node's layout_node() if it's itself.
2019-10-13 12:43:31 +02:00
Brandon Scott
48ef1d1bd1 HexEditor: Initial application release
The very first release of the Hex Editor for Serenity.
2019-10-13 08:45:49 +02:00
Andreas Kling
2530378f59 LibHTML+Browser: Add debug option to draw borders around line boxes
This will be very useful when debugging line layout.
2019-10-12 15:02:53 +02:00
Andreas Kling
bf79b198f6 Browser: Add a debug menu with actions to dump DOM and Layout trees 2019-10-12 13:44:17 +02:00
Andreas Kling
06113b4ffe LibHTML+Browser: Show the number of pending resource loads
For now this is simply a counter+hook exposed by ResourceLoader and
shown in the Browser status bar.

This is not very nuanced, and it would be nice to expose more info so
we could eventually do something like a progress bar.
2019-10-10 22:07:08 +02:00
Andreas Kling
850955053f LibHTML: Rename Document::normalize() to fixup() and always do it
Node.normalize() is a standard DOM API that coalesces Text nodes.
To avoid clashing with that, rename it to fixup().

This patch also makes it happen automagically as part of parsing.
2019-10-09 18:54:34 +02:00
Andreas Kling
1ce8a175e1 FileManager: Add "Open in TextEditor..." action to context menu 2019-10-07 20:03:19 +02:00
Andreas Kling
5da385c16e Browser: Turn command-line path arguments into file:// URLs 2019-10-07 20:02:29 +02:00
Andreas Kling
90cd363a8e FileManager: Open .html files in Browser instead of "html" 2019-10-07 19:52:35 +02:00
Andreas Kling
b5a043cf42 Browser: Add a simple "Go home" button to the toolbar
Currently this just takes us to /home/anon/www/welcome.html :^)
2019-10-06 22:03:41 +02:00
Andreas Kling
ac3079b433 LibGUI: Add "Go home" to GCommonActions 2019-10-06 22:00:04 +02:00
Conrad Pankoff
15a016d3e3 Browser: Support opening a URL from the command line at startup 2019-10-06 14:25:58 +02:00
Andreas Kling
4173c77eb5 Browser: Show the page title in the window title bar :^) 2019-10-05 10:30:49 +02:00
Andreas Kling
31e361b827 Base: Add a little welcome page for the browser at ~/www/welcome.html 2019-10-05 10:29:52 +02:00
Andreas Kling
0a38e0028f Browser: Start working on a simple browser using LibHTML
This was inevitable. :^)
2019-10-05 10:20:17 +02:00
Andreas Kling
7dd03b7846 LibGUI: Add back/forward actions to GCommonActions 2019-10-05 09:21:55 +02:00
Andreas Kling
ee64d99a96 LibHTML: Make StyleResolver responsible for loading the default style
Instead of HtmlView clients having to worry about parsing and loading
the default CSS, just take care of it inside StyleResolver.

The default style is automatically inserted into the stylesheet list,
at the very start, so everyone else gets a chance to override it.
2019-10-05 09:02:29 +02:00
Sergey Bugaev
395e4210ef Help: Follow clicked links
This also adds a toolbar and a menu which allow you to
navigate back and forth through history ^)
2019-10-03 08:23:54 +02:00
Andreas Kling
9da121f837 SystemMonitor: Make all tabs except the process table lazily loaded
We now use GLazyWidget for all the secondary tabs, which makes the
program start up way faster than before.

There's a noticeable delay when you click on the "PCI Devices" tab
for the first time, but that's definitely better than always eating
that delay before seeing a window at all. :^)
2019-10-02 20:26:19 +02:00
Andreas Kling
da463d9b11 Terminal: Remove crashy assertion about line length
If we resize/maximize the window, we might end up with some lines in
history that had a different length than the current terminal width.
That's okay, so let's not crash because of it.

Fixes #620.
2019-10-02 17:12:46 +02:00
Andreas Kling
35138437ef Kernel+SystemMonitor: Add fault counters
This patch adds three separate per-process fault counters:

- Inode faults

    An inode fault happens when we've memory-mapped a file from disk
    and we end up having to load 1 page (4KB) of the file into memory.

- Zero faults

    Memory returned by mmap() is lazily zeroed out. Every time we have
    to zero out 1 page, we count a zero fault.

- CoW faults

    VM objects can be shared by multiple mappings that make their own
    unique copy iff they want to modify it. The typical reason here is
    memory shared between a parent and child process.
2019-10-02 14:13:49 +02:00
Brandon Scott
08a1fb8f1a LibGUI+PaintBrush: Fix to GFilePicker and PaintBrush enhancements.
GFilePicker
- Fixed GFilePicker to use new ref-counted construct method to stop crashing on open dialog.
  - PaintBrush is still crashing on open dialog due to an unrelated issue.

PaintBrush
- Created 16x16 icon for PaintBrush
- Moved Open option into App menu.
- Changed help menu to make use of the standardized About dialog.
2019-10-01 09:17:56 +02:00
Larkin Nickle
3fb88cb76d Help+man.md: Add man sections
Also correct minor formatting mistake in TelnetServer.md.
2019-09-30 21:38:39 +02:00
Andreas Kling
1a279c5b2a GMessageBox: Hide the constructor and fix broken usages
We no longer support creating CObjects on the stack. Use construct().
2019-09-30 17:20:53 +02:00
Andreas Kling
8f45a259fc ByteBuffer: Remove pointer() in favor of data()
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-30 08:57:01 +02:00
Andreas Kling
3900eebf15 FileManager+LibGUI+html: Add an icon to represent HTML files
This also becomes the app icon for the little "html" program. :^)
2019-09-29 21:00:41 +02:00
Sergey Bugaev
801fe7beac SystemMonitor: Display whether an fd is cloexec and blocking 2019-09-28 22:27:45 +02:00
Andreas Kling
09ad58f837 Help: Don't crash on startup when non-md man pages are present :^) 2019-09-28 18:38:27 +02:00
Sergey Bugaev
02ee8cbbe2 Applications: Add a new Help app
This is a neat simple app that can display the Serenity manual ^)
2019-09-28 18:29:42 +02:00
Sergey Bugaev
dd5541fefc Terminal: Add underline support 2019-09-28 18:29:42 +02:00
Andreas Kling
34d0e96aec LibCore+LibGUI: Remove GEventLoop and use CEventLoop everywhere
GEventLoop was just a dummy subclass of CEventLoop anyway. The only
thing it actually did was make sure a GWindowServerConnectionw was
instantiated. We now take care of that in GApplication instead.

CEventLoop is now non-virtual and a little less confusing. :^)
2019-09-22 20:50:39 +02:00
Andreas Kling
df837562ad Taskbar: Remove window buttons from the taskbar when appropriate 2019-09-22 00:41:52 +02:00
Andreas Kling
d6abfbdc5a LibCore: Remove ObjectPtr in favor of RefPtr
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
2019-09-22 00:31:54 +02:00
Andreas Kling
bc319d9e88 LibCore: Make CObject reference-counted
Okay, I've spent a whole day on this now, and it finally kinda works!
With this patch, CObject and all of its derived classes are reference
counted instead of tree-owned.

The previous, Qt-like model was nice and familiar, but ultimately also
outdated and difficult to reason about.

CObject-derived types should now be stored in RefPtr/NonnullRefPtr and
each class can be constructed using the forwarding construct() helper:

    auto widget = GWidget::construct(parent_widget);

Note that construct() simply forwards all arguments to an existing
constructor. It is inserted into each class by the C_OBJECT macro,
see CObject.h to understand how that works.

CObject::delete_later() disappears in this patch, as there is no longer
a single logical owner of a CObject.
2019-09-22 00:25:25 +02:00
Andreas Kling
8d550c174e LibCore: Convert CFile to ObjectPtr 2019-09-21 20:50:06 +02:00
Andreas Kling
31b38ed88f LibGUI: Don't create GMessageBox and GInputBox on the stack
We need to get rid of all instances of widgets-on-the-stack since that
will no longer work in the ref-counting world.
2019-09-21 20:32:31 +02:00
Andreas Kling
defafd72bc LibGUI: Convert custom widgets and subclasses to ObjectPtr 2019-09-21 20:04:00 +02:00
Andreas Kling
15a66dc8ab Welcome: Unbreak after ObjectPtr changes 2019-09-21 19:42:16 +02:00
Andreas Kling
409494193e LibGUI: Convert remaining random little things to ObjectPtr 2019-09-21 19:40:14 +02:00
Andreas Kling
60530a7cd9 Calculator: Convert to using ObjectPtr 2019-09-21 19:37:28 +02:00
Andreas Kling
45cfd57f6e GButton: Convert most code to using ObjectPtr for GButton 2019-09-21 19:28:28 +02:00
Andreas Kling
55a6e4ac0b LibGUI: Convert GFrame to ObjectPtr 2019-09-21 19:21:36 +02:00
Andreas Kling
f8d751440b LibGUI: Convert GRadioButton to ObjectPtr 2019-09-21 18:58:03 +02:00
Andreas Kling
7584480f62 LibGUI: Convert GWindow to ObjectPtr 2019-09-21 18:34:06 +02:00
Andreas Kling
70412c7d4f DisplayProperties: Remove all remaining naked "new" usage 2019-09-21 18:18:47 +02:00
Andreas Kling
f57cc5873c SystemMonitor: Remove all remaining naked "new" usage 2019-09-21 18:17:23 +02:00
Andreas Kling
f4b51a63ec LibCore: Remove CTimer::create() overloads in favor of construct() 2019-09-21 18:13:17 +02:00
Andreas Kling
0c4508c00d SystemMonitor: Unbreak after ObjectPtr<GWidget> changes 2019-09-21 17:36:52 +02:00
Andreas Kling
bdf23a3d23 LibCore: Make it possible to cancel pending CNetworkJobs
Subclasses of CNetworkJob handle this by overriding shutdown().
This patch implements it for CHttpJob by simply tearing down the
underlying socket.

We also automatically call shutdown() after the job finishes,
regardless of success or failure. :^)
2019-09-21 17:32:26 +02:00
Andreas Kling
ff6ce422dd LibGUI: Convert GWidget to ObjectPtr 2019-09-21 17:05:35 +02:00
Andreas Kling
e4e92980a1 LibGUI: Convert GComboBox to ObjectPtr 2019-09-21 16:35:11 +02:00
Andreas Kling
7aaad27778 LibGUI: Convert GSlider to ObjectPtr 2019-09-21 16:33:53 +02:00
Andreas Kling
ceb5508fea LibGUI: Convert GProgressBar to ObjectPtr 2019-09-21 16:31:12 +02:00
Andreas Kling
3476a63415 LibGUI: Convert GStatusBar to ObjectPtr 2019-09-21 16:29:47 +02:00
Andreas Kling
f4531c976c LibGUI: Convert GToolBar to ObjectPtr 2019-09-21 16:27:54 +02:00
Andreas Kling
b78225941d LibGUI: Convert GSpinBox to ObjectPtr 2019-09-21 16:15:11 +02:00
Andreas Kling
83b5f6c11a LibGUI: Convert GGroupBox to ObjectPtr 2019-09-21 16:13:33 +02:00
Andreas Kling
4f4438c04c LibGUI: Convert GSplitter to ObjectPtr 2019-09-21 16:11:02 +02:00
Andreas Kling
efb8f9d538 LibGUI: Convert GTreeView to ObjectPtr 2019-09-21 16:06:43 +02:00
Andreas Kling
e7b55037f4 LibGUI: Convert GTableView to ObjectPtr 2019-09-21 16:03:59 +02:00
Andreas Kling
c13b9e2214 LibGUI: Convert GItemView to ObjectPtr 2019-09-21 15:47:58 +02:00
Andreas Kling
93851c3832 LibGUI: Convert GTextBox, GTextEditor and GResizeCorner to ObjectPtr 2019-09-21 15:46:47 +02:00
Andreas Kling
4ea229accd LibCore: Convert CTCPServer to ObjectPtr
Also get rid of the custom CNotifier::create() in favor of construct().
2019-09-21 15:25:08 +02:00
Andreas Kling
bce58bbbca LibGUI: Convert GScrollBar to ObjectPtr 2019-09-21 15:25:08 +02:00
Andreas Kling
c7437f9caa LibGUI: Convert GLabel to ObjectPtr 2019-09-21 15:25:08 +02:00
Andreas Kling
6b347747f2 LibCore: Convert CHttpJob to ObjectPtr 2019-09-21 15:25:08 +02:00
Andreas Kling
4298ba25c3 LibCore: Convert CTCPSocket to ObjectPtr, add construct() helper
The C_OBJECT macro now also inserts a static construct(...) helper into
the class. Now we can make the constructor(s) private and instead call:

    auto socket = CTCPSocket::construct(arguments);

construct() returns an ObjectPtr<T>, which we'll later switch to being
a NonnullRefPtr<T>, once everything else in in place for ref-counting.
2019-09-21 15:25:08 +02:00
Andreas Kling
74c4e62659 GCommonActions: Add "Open..." action
Make use of this in PaintBrush and TextEditor. :^)
2019-09-20 19:36:39 +02:00
Andreas Kling
d1bacb9885 LibCore: Convert CNotifier to ObjectPtr 2019-09-20 15:39:15 +02:00
Andreas Kling
50a6560413 LibCore: Convert CTimer to ObjectPtr 2019-09-20 15:20:10 +02:00
Andreas Kling
482d5295f1 FileManager: Allow deleting without confirmation via Shift+Delete
A powerful command for powerful users. :^)
2019-09-18 21:53:47 +02:00
Andreas Kling
33b8c807a6 FileManager: Implement basic file deletion
The delete action now actually deletes files (after asking the user for
confirmation, of course.) Deleting directories is not yet supported.

Fixes #541.
2019-09-18 21:46:14 +02:00
Andreas Kling
101b32236c SystemMonitor: Use GAboutDialog :^) 2019-09-18 18:43:23 +02:00
Brandon Scott
a4d52b122d FileManager+LibGUI: Fix two folder-related crashes (#569)
Fix a crash when opening a folder, and another one when trying to open
a newly created folder.

It was not safe to modify a GModelSelection while it's being iterated over.

Fixes #536.
2019-09-17 09:26:10 +02:00
Jesse
6557a31049 Terminal: Scroll cursor into view when typing (#568)
When the user has scrolled up and begins typing, the scrollbar will
automatically return them to the current cursor position so that they
can see what they're typing.
2019-09-16 07:52:27 +02:00
Jesse
444a4e4d39 DisplayProperties: Auto-resolution and graphical fix (#566)
The program will now automatically select the user's currently
chosen resolution when it is loaded up, however it is not
"visually selected" in the `GListView`

Moved the `resolution_list` list to be on the top to keep it consistent
with the wallpaper tab.
2019-09-16 07:50:47 +02:00
Conrad Pankoff
aa95bd7037 LibGUI: Fix move() of const StringView& 2019-09-16 07:49:43 +02:00
Conrad Pankoff
6fd096999e Applications: Add "Welcome" application, inspired by Windows 98 2019-09-16 07:49:43 +02:00
Andreas Kling
4463adc0ff FileManager: Show human-readable file size info in the status bar
Fixes #553.
2019-09-15 17:50:15 +02:00
Andreas Kling
e83390387c LibGUI: Simplify GCommonActions a bit
Use the same callback signature as GAction so we can just forward it
to GAction instead of chaining callbacks.
2019-09-14 22:10:44 +02:00
Jesse Buhagiar
58ceaebd5a DisplayProperties: Wallpaper tab now has preview
As was mentioned in #556, the `DisplayProperties` Wallpaper tab
contained a lot of "extra space", in which half the tab was taken up
by the list of wallpapers. The rest of that space is now reserved for
a wallpaper preview, so the user can see the selected image before
applying it.
2019-09-14 19:27:16 +02:00
Andreas Kling
31046b18bb FileManager: Use a special clipboard data type for copied file lists
When copying a list of files to the clipboard, we now use the special
data type "file-list".

This allows us to have the paste action's enabled state reflect the
actual ability to paste something. :^)
2019-09-14 09:20:20 +02:00
Andreas Kling
9d2c4d223a TextEditor+Base: Add an icon for the "Find" action :^) 2019-09-13 23:56:37 +02:00
Andreas Kling
ff72b4d475 FileManager+Base: Add "properties" icon
Something to show for the properties action in FileManager. It still
doesn't actually do anything, but at least now it looks neat. :^)
2019-09-13 23:07:59 +02:00
Andreas Kling
11f2e7cd5c GMenu: Update apps now that you can create a nameless GMenu
We had many context menus with names, simply because you were forced
to give them names.
2019-09-13 22:14:07 +02:00
Andreas Kling
5eb2c138e2 FileManager: Update enabled state of the copy and delete actions
Based on whether something is selected or not. I added a FIXME about
the paste action, since that will require some more coordination with
the system clipboard.
2019-09-13 22:09:01 +02:00
Andreas Kling
27e1128e6e FileManager: Assign keyboard shortcuts to the various actions 2019-09-13 22:04:08 +02:00
Andreas Kling
3a02bd40f8 FileManager: Add a basic context menu with copy/paste/delete/...
I also added a dummy "Properties..." action just to fill out the menu a
little bit. :^)

Fixes #270.
2019-09-13 22:00:47 +02:00
MinusGix
ad75b61eca IRCClient: Fix unneeded conversion to String 2019-09-13 09:22:30 +02:00
Andreas Kling
27321e9c44 PaintBrush: Only send left and right mouse button events to tools
Tools don't know what to do with the middle mouse button anyway,
so it's better if we just don't pass it along.

Fixes #546.
2019-09-12 20:33:05 +02:00
Andreas Kling
d86fb8033e FileManager: Show info about currently selected items in statusbar
When there's a non-zero number of selected items, we now show the
number in the statusbar, along with the total selected file size. :^)

Fixes #271.
2019-09-12 18:59:13 +02:00
Andreas Kling
1632f6b2dd FileManager: Add C_OBJECT macro to DirectoryView 2019-09-12 18:26:26 +02:00
Max Thrun
ae060d7450 SoundPlayer: Scale y coordinate to prevent drawing outside clip rect
Previously if sample.left amplitude was more than 0.5 we would draw
outside the painters clip rect.
2019-09-11 10:20:08 +02:00
Aaron Malpas
026a8be4e5 File Manager: Implement copy-paste
The files to copy are remembered with the clipboard, which stores a 
command (e.g. "copy") and files to be copied on different lines.
2019-09-10 19:28:41 +02:00
Aaron Malpas
7841aadb41 FileManager: Create FileUtils
This could later be replaced with library-provided utility functions
when/if they exist.
2019-09-10 19:28:41 +02:00
Aaron Malpas
b894803a30 FileManager: Add on_selection event for DirectoryView
There needs to be a way to know when a user has selected a file. 
file_system_model->on_selection_changed only fires on directory 
change.
2019-09-10 19:28:41 +02:00
Andreas Kling
fb275c9442 FileManager: Make the tree view follow the path changes correctly
The left-side tree view was not following along when switching paths
via the right-side views. Hook this back up.
2019-09-08 09:08:50 +02:00
Andreas Kling
6dec328af7 LibGUI+FileManager: Add GAbstractView::on_selection_change hook
This hook will be called whenever the view's selection changes somehow.
Use this in the FileManager to keep the left and right views in sync.
2019-09-07 21:35:04 +02:00
Andreas Kling
9d97781e37 FileManager: Port to using GModelSelection 2019-09-07 20:41:14 +02:00
Andreas Kling
f8c0168adc IRCClient: Fix window selection after GModelSelection changes 2019-09-07 20:01:37 +02:00
Andreas Kling
9c1fa0bd51 SystemMonitor: Fix PID selection after GModelSelection changes 2019-09-07 19:59:03 +02:00
Andreas Kling
a635619cc0 GTabWidget: Rename get_active_tab() => active_tab_index() 2019-09-07 16:57:26 +02:00
Andreas Kling
568936775f DisplayProperties: Fix build after AKString.h => String.h change 2019-09-07 16:57:03 +02:00
Jesse Buhagiar
ecbc0322c1 Applications: Create a display properties manager
An interactive application to modify the current display settings, such as
the current wallpaper as well as the screen resolution. Currently we're
adding the resolutions ourselves, because there's currently no way to
detect was resolutions the current display adapter supports (or at least
I can't see one... Maybe VBE does and I'm stupid). It even comes with
a very nice template'd `ItemList` that can support a vector of any type,
which makes life much simpler.
2019-09-07 16:51:15 +02:00
Andrew Weller
16aba5100d TextEditor: Implement File/New Action
The user is asked if they want to save a dirty file before they create
a new one.
2019-09-06 18:38:26 +02:00
Andreas Kling
73fdbba59c AK: Rename <AK/AKString.h> to <AK/String.h>
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.

Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
2019-09-06 15:36:54 +02:00
Sergey Bugaev
6d3f52c4a4 Terminal: Add some basic emoji support
This is not as perfect as it is elsewhere in the system, as we cannot
really change how terminal "thinks about" characters and bytes. What
we can do though, and what this commit does, is to *render* emojis, but
make it seem as if they take up all the space, and all the columns their
bytes would take if they were all regular characters.
2019-09-05 16:37:39 +02:00