Commit graph

869 commits

Author SHA1 Message Date
Andreas Kling
edf509c19e SystemMonitor: Use unveil() 2020-01-21 18:45:18 +01:00
Andreas Kling
1060d59ddd PaintBrush: Show which line thickness is selected in the tool menus
Put each tool's thickness altering actions into a GActionGroup and make
them mutually exclusive so we get that nice radio button appearance.

This all feel very clunky and we should move towards having something
like a "tool settings" pane that gets populated by the currently active
tool instead.
2020-01-21 13:47:57 +01:00
Andreas Kling
efbd1620d9 Terminal: Unveil the user's config file
I mistakenly thought that we were keeping the config file open, but we
don't. So we'll need to unveil the config path in case we need to write
out a new configuration.
2020-01-21 13:08:22 +01:00
Andreas Kling
3097eb4717 Terminal: Use unveil()
This app needs ("/bin/Terminal", "x") in order to fork+exec itself when
the user requests a new Terminal window. I really like how this reduces
reduces the impact of pledging "exec". :^)

It also needs ("/res", "r") like all GUI apps. We delay the first call
to unveil until after we've already opened the app's config file, so
there's no need to worry about that.
2020-01-21 12:16:17 +01:00
Andreas Kling
21886ff9e2 About: Use unveil() 2020-01-21 12:12:07 +01:00
Andreas Kling
39931733a5 Calculator: Use unveil()
A barebones GUI app like this only needs read access to /res (for fonts
and themes, in case settings change) once it's up and running.
2020-01-21 12:03:08 +01:00
Andreas Kling
d8357ceb26 SystemMonitor: Add an "Unveiled paths" section to the per-process tabs
This shows the data from /proc/PID/unveil in a nice table view. :^)
2020-01-20 22:32:44 +01:00
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
rhin123
488c510e02 Calculator: Added keyboard input 2020-01-18 08:33:20 +01:00
Shannon Booth
6697513d30 Help: Set tree view as focused widget
This allows you to use the start using the keys to navigate the
menu immediately, instead of having to click on the tree view first.
2020-01-18 00:27:39 +01:00
Andreas Kling
26a31c7efb Kernel: Add "accept" pledge promise for accepting incoming connections
This patch adds a new "accept" promise that allows you to call accept()
on an already listening socket. This lets programs set up a socket for
for listening and then dropping "inet" and/or "unix" so that only
incoming (and existing) connections are allowed from that point on.
No new outgoing connections or listening server sockets can be created.

In addition to accept() it also allows getsockopt() with SOL_SOCKET
and SO_PEERCRED, which is used to find the PID/UID/GID of the socket
peer. This is used by our IPC library when creating shared buffers that
should only be accessible to a specific peer process.

This allows us to drop "unix" in WindowServer and LookupServer. :^)

It also makes the debugging/introspection RPC sockets in CEventLoop
based programs work again.
2020-01-17 11:19:06 +01:00
Andreas Kling
d9385d7d62 SystemMonitor: Unbreak the memory stats graph
It was never updating because we'd just seek the start of /proc/memstat
over and over, which didn't generate new contents. Instead, open the
file on every iteration.
2020-01-15 23:14:20 +01:00
Andreas Kling
56428e764e Applications: Use pledge()
Add some basic pledges to the following apps:

- Calculator
- DisplayProperties
- FontEditor
- HexEditor
- PaintBrush
2020-01-13 14:41:15 +01:00
Andreas Kling
6182a1a71c About: Drop "unix" pledge after connecting to WindowServer 2020-01-13 14:41:15 +01:00
Brian Gianforcaro
e9a5b7456e About: Use pledge() 2020-01-13 11:11:18 +01:00
Andreas Kling
22cf24cba7 ChanViewer: Use pledge()
This app should be ported to LibProtocol, which would allow it to drop
"inet" and "dns" as well.
2020-01-12 13:22:34 +01:00
Andreas Kling
e588a41ac9 Browser: Drop "unix" pledge after starting up
We now instantiate a connection to ProtocolServer right away by calling
ResourceLoader::the(). This allows us to drop the "unix" pledge. :^)
2020-01-12 13:20:02 +01:00
Andreas Kling
f813bb52a2 Applications+DevTools+MenuApplets: Drop "unix" pledge when possible
Now that the "unix" pledge is no longer required for socket I/O, we can
drop it after making the connections we need in a program.

In most GUI program cases, once we've connected to the WindowServer by
instantiating a GApplication, we no longer need "unix" :^)
2020-01-12 12:03:57 +01:00
Andreas Kling
0d961ece94 SystemMonitor: Add "proc" pledge so we can send signals to processes 2020-01-12 10:07:42 +01:00
Andreas Kling
17135c9704 SoundPlayer: Use pledge() 2020-01-12 02:28:26 +01:00
Andreas Kling
b79711786c Help: Use pledge() 2020-01-12 02:23:55 +01:00
Andreas Kling
bb6b9d9059 QuickShow: Use pledge() 2020-01-12 02:02:44 +01:00
0xtechnobabble
49e8d34f0e TextEditor: Replace text in find textbox with selection
This patch makes it so that if the find/replace widget is opened while
some text is selected, the find textbox's content is overrided with the
selected text.
2020-01-12 01:41:36 +01:00
0xtechnobabble
ecf58ddd4f TextEditor: Implement replacement functionality
This patch adds a new replace widget that cooperates with the find
widget, the replace widget takes the input in the find textbox, searches
for occurences of that input, and replaces them with the input provied
in the replace textbox.
2020-01-12 01:41:36 +01:00
Andreas Kling
2b20e8e187 IRCClient: Use pledge() 2020-01-11 23:53:54 +01:00
Andreas Kling
2067c003ff TextEditor: Use pledge() 2020-01-11 23:50:05 +01:00
Andreas Kling
f187374c1b Kernel: fork()ed children should inherit pledge promises :^)
Update various places that now need wider promises as they are not
reset by fork() anymore.
2020-01-11 23:28:41 +01:00
Andreas Kling
b39e732eb3 FileManager: Use pledge() 2020-01-11 22:13:38 +01:00
Andreas Kling
c13328bd2b Taskbar: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
f848faeec8 SystemMonitor: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
ec1ae37f69 SystemMonitor+LibCore: Show process pledges in SystemMonitor :^) 2020-01-11 21:33:12 +01:00
Andreas Kling
4132f713c8 Terminal: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
2f880a047f Browser: Use pledge()
This is the first complex app to use pledge(), and it was extremely
easy to get it working.

The main trickiness comes from the RPC sockets that get set up inside
the GApplication constructor. Since it wants to unlink any old RPC
socket with the same filename and change the file mode of the new
socket, it needs both "cpath" and "fattr".

Once the GApplication has been constructed, it seems we can safely
drop those promises. Pretty cool!
2020-01-11 21:33:12 +01:00
Sergey Bugaev
29db900887 SystemMonitor: Display mount flags 2020-01-11 18:57:53 +01:00
Sergey Bugaev
7bc8fa884a FileManager: Add a columns view
This new view, backed by a GColumnsView, joins the existing table and icon
views :^) Even though it displays a file tree, its data is provided by the very
same GFileSystemModel that the other two views use.

This commit also includes my attempt at making an icon for the new mode.
2020-01-10 17:45:59 +01:00
Sergey Bugaev
10324f95b0 LibGUI+FileManager: Misc tweaks courtesy of clang-format 2020-01-10 17:45:59 +01:00
Sergey Bugaev
fdeb91e000 LibGUI+FileManager: Merge GDirectoryModel into GFileSystemModel
We used to have two different models for displaying file system contents:
the FileManager-grade table-like directory model, which exposed rich data
(such as file icons with integrated image previews) about contents of a
single directory, and the tree-like GFileSystemModel, which only exposed
a tree of file names with very basic info about them.

This commit unifies the two. The new GFileSystemModel can be used both as a
tree-like and as a table-like model, or in fact in both ways simultaneously.
It exposes rich data about a file system subtree rooted at the given root.

The users of the two previous models are all ported to use this new model.
2020-01-10 17:45:59 +01:00
Andreas Kling
53e204dfb0 Terminal: Put the Font menu items in an action group :^) 2020-01-08 21:12:40 +01:00
Andreas Kling
7ba7d88fba SystemMonitor: Put the Frequency menu items in an action group
This makes them look like radio buttons in the menu, which is a very
nice increase in polish. :^)
2020-01-08 21:12:40 +01:00
Andreas Kling
2d75396c94 About: Focus the button on startup 2020-01-08 13:14:39 +01:00
Andreas Kling
3f3169c225 FileManager: Unbreak build after "select all" changes 2020-01-07 11:12:33 +01:00
Shannon Booth
6192467de9 Filemanager: Add Ctrl+A select all action
Unfortunately this means that current_view() needed to be made non-const
as changing the selection is a non-const operation.
2020-01-07 11:06:27 +01:00
Matrix89
2dd35916e5 Browser+LibHTML: Change the way computed styles are queried 2020-01-05 17:13:22 +01:00
Matrix89
2ced4c4ec7 Browser+LibHTML: Deduplicate inspector code
The `DOMElementStyleModel` and `DOMComputedElementStyleModel` classes were
replaced by the `StylePropertiesModel`.
2020-01-05 17:13:22 +01:00
Matrix89
988d1deca8 Browser+LibHTML: Add "Computed" styles to the DOM inspector
I though it would be nice to also show the style that the browser uses
to display an element.

In order to do that, in place of the styles table I've put a tab widget,
with tabs for both element and computed element styles.
2020-01-05 17:13:22 +01:00
Shannon Booth
fe67ba032d PaintBrush: Select tool button on context menu event
This means that (for example) if you change the line width of the line
tool, you now switch to the line tool, instead of sticking with the
currently "checked" tool.
2020-01-02 20:12:55 +01:00
Andreas Kling
7cdfb9c6b4 Browser+LibHTML: Add resolved element style to the DOM inspector
When selecting an element in the browser's DOM inspector, we now also
show the resolved CSS properties (and their values) for that element.

Since the inspector was growing a bit more complex, I moved it out of
the "show inspector" action callback and into its own class.

In the future, we will probably want to migrate the inspector down to
LibHTML to make it accessible to other clients of the library, but for
now we can keep working on it inside Browser. :^)
2020-01-02 14:55:19 +01:00
Liav A
e5ffa960d7 Kernel: Create support for PCI ECAM
The new PCI subsystem is initialized during runtime.
PCI::Initializer is supposed to be called during early boot, to
perform a few tests, and initialize the proper configuration space
access mechanism. Kernel boot parameters can be specified by a user to
determine what tests will occur, to aid debugging on problematic
machines.
After that, PCI::Initializer should be dismissed.

PCI::IOAccess is a class that is derived from PCI::Access
class and implements PCI configuration space access mechanism via x86
IO ports.
PCI::MMIOAccess is a class that is derived from PCI::Access
and implements PCI configurtaion space access mechanism via memory
access.

The new PCI subsystem also supports determination of IO/MMIO space
needed by a device by checking a given BAR.
In addition, Every device or component that use the PCI subsystem has
changed to match the last changes.
2020-01-02 00:50:09 +01:00
Andreas Kling
fc86460134 AK: Move the userspace SharedBuffer from LibC to AK
This always felt out-of-place in LibC.
2020-01-01 18:53:34 +01:00
Jami Kettunen
cece0d230d Applications: Add new keyboard shortcuts & update few existing ones 2020-01-01 01:23:27 +01:00