Commit graph

1301 commits

Author SHA1 Message Date
Andreas Kling
8ef9c272b6 Browser: Accept file:// URLs on the command line
This could be a lot nicer, but at least we can open file:// URLs now.
2020-04-11 23:11:10 +02:00
Brendan Coles
502299919a IRCClient: Add channel member context menus for common CTCP requests
Add menu items for CTCP: USERINFO, FINGER, TIME, VERSION, CLIENTINFO
2020-04-11 14:26:36 +02:00
Brendan Coles
63f8cbfb56 IRCClient: Add NotifyOnMessage/NotifyOnMention config options
Allow IRCClient user to opt out of notifications.
2020-04-10 13:16:07 +02:00
Brendan Coles
df7b617ba1 IRCClient: Add ShowNickChangeMessages/ShowJoinPartMessages conf options
Allow IRCClient to hide nick change spam and join/part spam
2020-04-10 12:56:19 +02:00
Brendan Coles
68c7ca7d3b IRCClient: Autojoin channels after client registration
Wait for the server to advise negotiation was successful (RPL_WELCOME)
before autojoining channels.

Fixes #1713
2020-04-10 11:29:46 +02:00
rhin123
cd84544706 Calendar: Implement add event action 2020-04-10 11:28:34 +02:00
rhin123
06604c3786 Calendar: Implement add event UI 2020-04-10 11:28:34 +02:00
Hüseyin ASLITÜRK
870936085a DisplayProperties: Replace TextBox with ColorInput.
Use new ColorInput component. Delete unnecessary code lines. Fix local variable names.
2020-04-10 11:25:49 +02:00
Brendan Coles
d95362d8cd IRCClient: Set nick and userinfo to OS username when not set in config 2020-04-09 17:18:56 +02:00
rhin123
bdb6b2ced3 Calendar: Corrected spacing on small resizing 2020-04-09 08:38:35 +02:00
Brendan Coles
5c90cfa90f IRCClient: Add application and context menu items to hop/dehop users 2020-04-08 19:53:40 +02:00
Brendan Coles
e4ba949a15 IRCClient: Open query on double click of nick in channel member list 2020-04-08 18:42:01 +02:00
Brendan Coles
036fb4c621 IRCClient: Add nick_without_prefix and nick_at helpers
`IRCChannelMemberListModel->nick_at` returns the nick name of a channel
member at the specified index.

`IRCClient->nick_without_prefix` returns a formatted nick name without
privilege prefix.
2020-04-08 18:42:01 +02:00
Brendan Coles
44f8161166 IRCClient: Remove FIXME for RPL_TOPICWHOTIME
RPL_TOPICWHOTIME is handled by handle_rpl_topicwhotime.
2020-04-08 14:06:03 +02:00
Brendan Coles
9126859679 IRCClient: Rename /hop command to /cycle
Some IRC clients use /hop to part and re-join a channel; however this
can be confused with granting half-op (+h) channel privileges to a user.

The general convention used by other IRC clients is /cycle.
2020-04-08 11:42:05 +02:00
rhin123
e91cb83a23 Calendar: Make the application theme-aware 2020-04-08 10:34:20 +02:00
Brendan Coles
0f91045008 IRCClient: Add right-click context menu to IRCWindow member list 2020-04-07 21:27:06 +02:00
Liav A
7cda0b9027 SystemMonitor: Replace 'device' JSON field with 'source' 2020-04-06 15:36:36 +02:00
Tibor Nagy
63b11e094d QuickShow: Miscellaneous improvements
Major changes are:

The layout and mouse handling has been rewritten to always center
images in the window.

QuickShow now accepts multiple images on drag and drop. The first
image gets opened in the current window, further images are opened in
new processes.

QSWidget now loads images on its own with QSWidget::load_from_file().

An on_drop callback has been introduced for QSWidget.

Added an open menu.

Added an about box and placeholder icons to the application.

QuickShow now starts without loading the sunset-retro wallpaper.
2020-04-06 09:04:15 +02:00
Oriko
2c5faa8ff3 FileManager: Add properties action to directory context menu 2020-04-05 16:02:07 +02:00
Tibor Nagy
a4f6f8e0e7 QuickShow: Use checkerboard background to show transparency 2020-04-05 15:30:53 +02:00
Brendan Coles
ddb8597c0c IRCClient: Allow CTCP replies to be user configurable in IRCClient.ini 2020-04-05 15:29:48 +02:00
Brendan Coles
a1b57216b8 IRCClient: Add handling for server responses and BANLIST command 2020-04-05 12:49:33 +02:00
Andreas Kling
1d468ed6d3 AK: Stop allowing implicit downcast with RefPtr and NonnullRefPtr
We were allowing this dangerous kind of thing:

RefPtr<Base> base;
RefPtr<Derived> derived = base;

This patch changes the {Nonnull,}RefPtr constructors so this is no
longer possible.

To downcast one of these pointers, there is now static_ptr_cast<T>:

RefPtr<Derived> derived = static_ptr_cast<Derived>(base);

Fixing this exposed a ton of cowboy-downcasts in various places,
which we're now forced to fix. :^)
2020-04-05 11:19:00 +02:00
Brendan Coles
4ea71c9571 IRCClient: Add support for raw protocol commands with /RAW 2020-04-05 10:39:36 +02:00
Brendan Coles
55b25b3c9b IRCClient: Add icons for channel list, channel invite, channel topic 2020-04-05 09:37:19 +02:00
Tibor Nagy
192513ec33 QuickShow: Fix crash on startup
QSWidget::relayout get triggered before setting a bitmap to display
while setting the widget as the main widget of the window.

I've added a null check to the paint event too to make sure the
widget works with no bitmap set.
2020-04-05 09:36:46 +02:00
Andreas Kling
26eeaef0a8 LibGUI: Add MenuBar::add_menu(name)
This allows us to construct menus in a more natural way:

    auto& file_menu = menubar->add_menu("File");
    file_menu.add_action(...);

Instead of the old way:

    auto file_menu = GUI::Menu::construct();
    file_menu->add_action(...);
    menubar->add_menu(file_menu);
2020-04-04 12:58:05 +02:00
Brendan Coles
8780151155 Browser: Add Reload option to app menu with F5 shortcut key 2020-04-04 11:47:03 +02:00
Andreas Kling
2463a285ee LibGUI: Make GUI::TabWidget::add_tab<T>() return a T&
Since the newly constructed sub-widget is owned by the TabWidget,
we can simply return a T& here. :^)
2020-04-04 11:10:07 +02:00
Andreas Kling
28be90120b Revert "SystemMonitor: Replace 'device' JSON field with 'source'"
This reverts commit 592f218151.

Reverting these changes since they broke things.
Fixes #1608.
2020-04-03 21:28:25 +02:00
Brendan Coles
40b3203941 IRCClient: Update channel user list when a user joins or quits 2020-04-02 21:50:02 +02:00
Brendan Coles
6bf47252dc IRCClient: Add is_channel_prefix to check if string is a channel name 2020-04-02 15:39:57 +02:00
Brendan Coles
526386a6ba IRCClient: Automatically disable/enable GUI actions upon window change
Toolbar and menu items related to channel operations are now enabled
only when the active window is a channel.
2020-04-02 15:07:32 +02:00
Brendan Coles
855f9286fa IRCClient: Add channel operations to Channel application menu
Add menu options to invite user, op/deop/voice/devoice user,
and cycle channel.
2020-04-02 14:39:05 +02:00
Liav A
592f218151 SystemMonitor: Replace 'device' JSON field with 'source' 2020-04-02 12:03:08 +02:00
Brendan Coles
b3d8ce44a2 IRCClient: Use active channel window for part,hop,topic,kick commands
The /part, /hop, /topic, /kick commands will now default to the
currently active window if no channel name was provided.
2020-04-02 08:54:54 +02:00
Brendan Coles
175ec99814 IRCClient: Add Channel application menu and LIST and KICK commands
The new Channel application menu allow offers various commands
related to the currently visible channel, including changing
the topic, kicking a user, and leaving the channel.
2020-04-01 13:11:46 +02:00
Brendan Coles
2de2f49abc IRCClient: Add support for /HOP and /TOPIC commands 2020-03-31 18:06:30 +02:00
Andreas Kling
297e6625f3 Browser: Refuse to run as root 2020-03-31 13:02:05 +02:00
Andreas Kling
b2b5da8a17 IRCClient: Refuse to run as root
There's no good reason to allow this, and some pretty great reasons
to disallow it. :^)
2020-03-31 13:02:05 +02:00
Tibor Nagy
c56acba75e SoundPlayer: Set parent window for AboutDialog 2020-03-30 10:52:09 +02:00
Tibor Nagy
7a61ed4178 Taskbar: Show default window icons when no icons are set
To be consistent with WindowServer.
2020-03-30 10:52:09 +02:00
Andreas Kling
7cfe712f4d LibGfx+LibIPC: Add Gfx::ShareableBitmap, a bitmap for easy IPC usage
With this patch, it's now possible to pass a Gfx::ShareableBitmap in an
IPC message. As long as the message itself is synchronous, the bitmap
will be adopted by the receiving end, and disowned by the sender nicely
without any accounting effort like we've had to do in the past.

Use this in NotificationServer to allow sending arbitrary bitmaps as
icons instead of paths-to-icons.
2020-03-29 19:37:23 +02:00
Hüseyin ASLITÜRK
7971af474d DisplayProperties: Add options to set the background color and wallpaper mode.
Wallpaper mode and background color change options are now available. Monitor preview
widget show new settings before apply. We have some missing preview features :(
2020-03-29 19:36:37 +02:00
Tibor Nagy
70dc80fa47 SystemMenu: Sort applications alphabetically 2020-03-29 14:58:26 +02:00
Emanuel Sprung
c9059c12dc Browser: Let the user add/remove bookmarks to the bookmarks bar
This patchset adds a Button to the toolbar (right next to the location field)
with a star icon. The star is white if the currently visited url is not yet
bookmarked and yellow if a bookmark for the url exists.

After adding or removing a bookmark, the bookmark json file is synced to disk.
Therefore, some new pledge/unveil's have been added.
2020-03-27 14:12:18 +01:00
Emanuel Sprung
337ade9e4c Browser: Add bookmarks bar
This patchset adds a bookmark bar that is backed by a json file backend.
The json file is loaded and checked for the format. According to the
format, the bookmarks bar is populated with the bookmark items.

If the bookmarks do not fit into one line, an expader button is shown
that brings up a menu containing the missing bookmark items.

There is currently no way to add or remove bookmarks. A hover over a
bookmark is also not yet showing the url in the statusbar.
2020-03-27 14:12:18 +01:00
Emanuel Sprung
a9e943ae4c Browser: Add empty, toogleable bookmarks bar 2020-03-27 14:12:18 +01:00
Andreas Kling
d52c5a94b4 IRCClient: Use the IRCClient app icon in notifications :^) 2020-03-26 20:39:36 +01:00
Andreas Kling
3c29818048 IRCClient: Only notify about channel messages containing our nickname 2020-03-26 20:18:22 +01:00
Andreas Kling
163812df97 IRCClient: Post desktop notifications when messaged while inactive
If you receive a channel or query message while the app is inactive,
or while the channel/query is inactive, we now post a desktop
notification so you can learn that something is happening. :^)
2020-03-26 20:11:23 +01:00
Nick Tiberi
ca067e71a3
Taskbar: Remove FIXME re: tooltip rendering since it's now working (#1502) 2020-03-23 08:21:34 +01:00
rhin123
073ac3a22f Calendar: Add license header 2020-03-19 22:54:30 +01:00
rhin123
8bc412c80b Calendar: Add a 16x16 app icon 2020-03-19 22:54:30 +01:00
rhin123
19e1cd9fb8 Calendar: Corrected spacing for widgets and rectangles 2020-03-19 22:54:30 +01:00
Tibor Nagy
fc71b73c37 Applications: Remove G prefixes from comments 2020-03-19 22:52:44 +01:00
rhin123
6d26714ded Calendar: Allow the widget to resize with the window 2020-03-19 09:55:14 +01:00
rhin123
5744049b74 Calendar: Make const arrays static as well 2020-03-19 09:55:14 +01:00
rhin123
dc680d57aa Calendar: Don't assign next_month button variable to add_event button 2020-03-19 09:55:14 +01:00
Andreas Kling
47fdac7cea Browser: Fix unintentional Web::Element copy 2020-03-18 17:13:22 +01:00
Itamar
d98fbd192e Terminal: Remove working directory argument
Applications that want to spawn Terminal in a specific
directory should chdir to it before execing it.
2020-03-18 08:23:31 +01:00
Itamar
c18f12bb96 Taskbar: chdir to home directory before launching apps 2020-03-18 08:23:31 +01:00
Itamar
e2b7e7c390 SystemMenu: chdir to home directory before launching apps 2020-03-18 08:23:31 +01:00
Itamar
a4497ce375 FileManager: chdir to appropriate directory before starting Terminal 2020-03-18 08:23:31 +01:00
rhin123
39c21f368a Calendar: Implement basic GUI calendar application 2020-03-18 08:17:01 +01:00
Alex Muscar
838d1c38a1 SystemMenu: Remove the unveil() call for /etc/PowerOptions.ini
The file is not used.
2020-03-16 11:05:48 +00:00
Itamar
45d7ea1b63 FileManager: Add "Open Terminal here" action 2020-03-15 19:09:24 +01:00
Itamar
bbe50577f8 Terminal: Add -d option for specifying working directory 2020-03-15 19:09:24 +01:00
Andreas Kling
9c9d3f0904 LibWeb: Parse <script> elements and run any JavaScript found inside
This patch begins integrating LibJS into LibWeb. Document holds the
JS::Interpreter for now, and it is created on demand when you first
call Document::interpreter().

We also add a simple "alert()" function to the global object.
2020-03-14 13:25:38 +01:00
Tibor Nagy
f347dd5c5e Applications: Use "Document - AppName" window title format
Fixes #1444
2020-03-13 23:30:12 +01:00
Oriko
c2884d29d6 TextEditor: Use Javascript syntax highlighter 2020-03-13 22:53:13 +01:00
Tibor Nagy
fa98bbfda5 Terminal: Make the settings window unresizable 2020-03-11 10:12:25 +01:00
Oriko
75672263ce TextEditor: Quit after saving unsaved changes on close event. 2020-03-11 10:11:48 +01:00
Oriko
cb39327b1c TextEditor: Add syntax toggle to View menu 2020-03-11 10:05:01 +01:00
Andreas Kling
37fc6c117c Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
Andreas Kling
830a57c6b2 LibWeb: Rename directory LibHTML => LibWeb
Let's rename this to LibWeb since it aims to provide more parts of the
web platform than just HTML. :^)
2020-03-07 10:32:51 +01:00
Andreas Kling
7a6c4a72d5 LibWeb: Move everything into the Web namespace 2020-03-07 10:27:02 +01:00
Shannon Booth
6a3b12664a LibGUI: Move Icon and FontDatabase into the GUI namespace
We also clean up some old references to the old G prefixed GUI classes

This also fixes a potential bug with using: C_OBJECT_ABSTRACT(GAbstractButton)
instead of C_OBJECT_ABSTRACT(AbstractButton)
2020-03-07 01:33:53 +01:00
Tibor Nagy
c982bfee7e FileManager: Fix asserts on checking properties of symlinks
There were two issues with this code:
- The result of the readlink() call was checked incorrectly for errors.
- This code shouldn't return because otherwise it leaves the GUI buttons
  uninitialized below, causing RefPtr asserts to trigger when the dialog
  tries to access the buttons later on.
2020-03-05 19:04:14 +01:00
Tibor Nagy
90ef6be535 FileManager: Fix group names in the file properties dialog 2020-03-05 16:36:05 +01:00
Andreas Kling
b29ff7b821 LibGUI: Don't use Core::Object::add() to instantiate dialogs
Now that add() returns a WidgetType&, we can't rely on the parent of a
GUI::Dialog to still keep it alive after exec() returns. This happens
because exec() will call remove_from_parent() on itself before
returning.

And so we go back to the old idiom for creating a GUI::Dialog centered
above a specific window. Just call GUI::Dialog::construct(), passing
the "parent" window as the last parameter.
2020-03-04 21:04:06 +01:00
Andreas Kling
028c011760 LibCore: Make Core::Object::add<ChildType> return a ChildType&
Since the returned object is now owned by the callee object, we can
simply vend a ChildType&. This allows us to use "." instead of "->"
at the call site, which is quite nice. :^)
2020-03-04 21:04:06 +01:00
Andreas Kling
0f3e57a6fb LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clients 2020-03-04 14:26:16 +01:00
Andreas Kling
4697195645 LibGUI: Use set_layout<LayoutType>() in lots of client code 2020-03-04 13:49:48 +01:00
Andreas Kling
03e0ddce52 LibGUI: Some more convenience functions for constructing widgets
This patch adds two new API's:

- WidgetType& GUI::Window::set_main_widget<WidgetType>();

  This creates a new main widget for a window, assigns it, and returns
  it to you as a WidgetType&.

- LayoutType& GUI::Widget::set_layout<LayoutType>();

  Same basic idea, creates a new layout, assigns it, and returns it to
  you as a LayoutType&.
2020-03-03 22:37:48 +01:00
Andreas Kling
a26b63a958 LibGUI: Remove Button& parameter from Button::on_click hook
There was but a single user of this parameter and it's a bit tedious
to write it out every time, so let's get rid of it.
2020-03-03 17:02:38 +01:00
Andreas Kling
b1d35248e4 SystemMenu: Fix bad behavior in shutdown dialog
The selected option was stored in a captured stack variable which was
long gone by the time we looked at it, so this dialog didn't really
behave the way you'd expect. Put it in a member instead. :^)
2020-03-03 16:46:39 +01:00
Andreas Kling
686ade6b5a AK: Make quick_sort() a little more ergonomic
Now it actually defaults to "a < b" comparison, instead of forcing you
to provide a trivial less-than comparator. Also you can pass in any
collection type that has .begin() and .end() and we'll sort it for you.
2020-03-03 16:02:58 +01:00
Andreas Kling
2719d6d502 SystemMonitor: Unbreak the in-table progress bars showing disk usage 2020-03-02 23:05:04 +01:00
Andreas Kling
22d0a6d92f AK: Remove unnecessary casts to size_t, after Vector changes
Now that Vector uses size_t, we can remove a whole bunch of redundant
casts to size_t.
2020-03-01 12:58:22 +01:00
Andreas Kling
d61359ae91 About: Add mascot tooltip 2020-02-29 21:35:44 +01:00
Andreas Kling
40860f6f2c Terminal: Put PAGER=more in the default environment
This should be done at some other level (shell rc script for example),
this is just to make "git" stop complaining that I don't have "less".
2020-02-29 18:48:39 +01:00
Andreas Kling
9cf92831e3 Welcome: Remove the default GUI::Frame look from TextWidget 2020-02-29 17:04:46 +01:00
Andreas Kling
e705e4e083 About: Adopt Buggie :^)
Simon Struthers drew a SerenityOS ladybug and since it's so cute,
I figured we could adopt it!
2020-02-29 15:12:58 +01:00
Andreas Kling
f0b68f8bc0 SystemMonitor: Show VMObject types in process memory maps 2020-02-28 23:25:40 +01:00
Andreas Kling
46256da7b0 PaintBrush: Pledge "thread" so that GUI::FilePicker works 2020-02-28 19:48:29 +01:00
Andreas Kling
f72e5bbb17 Kernel+LibC: Rename shared buffer syscalls to use a prefix
This feels a lot more consistent and Unixy:

    create_shared_buffer()   => shbuf_create()
    share_buffer_with()      => shbuf_allow_pid()
    share_buffer_globally()  => shbuf_allow_all()
    get_shared_buffer()      => shbuf_get()
    release_shared_buffer()  => shbuf_release()
    seal_shared_buffer()     => shbuf_seal()
    get_shared_buffer_size() => shbuf_get_size()

Also, "shared_buffer_id" is shortened to "shbuf_id" all around.
2020-02-28 12:55:58 +01:00
Liav A
7beae40508 DisplayProperties: Warn user about failed resolution setting
Also, we have now two new resolutions - 1368x768 and 1366x768.
The 1366x768 resolution is currently not supported but is good
for testing a failed resolution setting.
2020-02-28 12:16:05 +01:00
William McPherson
72cbbd5297 Piano: New timing system and zoomable piano roll
This patch allows roll notes to be of different sizes. This necessitates
a new internal representation of time. BPM and time signatures are
mostly implemented but not exposed.

Roll notes are now sample-accurate and the grid is aligned to 60 BPM
4/4. The roll is divided by the time signature raised to some power of
2, giving the musical divisions of (in the case of 4/4) 16, 32, 64 etc.

Before, our timing was derived from the buffer size and we relied on
that to implement delay. Delay has been rewritten to be sample-granular.
It's now exposed as the proper "divisions of a beat".
Something to be wary of is that the last buffer in the loop is also used
for the start of the next loop. In other words, we loop mid-buffer. This
means we write WAVs with a tiny bit of silence due to breaking the loop
after filling half a buffer.

The data structure for the roll is an array of SinglyLinkedLists of
RollNotes. Separating by pitch (via the array layout) makes insertion
much simpler and faster. Using sorted lists (and thus
SinglyLinkedListIterators) to do lookups is very quick as you know the
sample of the next note and can just compare it to the current sample. I
implemented this with HashMaps and the cost of lookups was abysmal. I
also tried a single SinglyLinkedList and the insertion code got even
more complicated than it already is.
2020-02-27 10:21:13 +01:00
Tibor Nagy
712e7102b0 DisplayProperties: Do not assert on trying to select unset wallpaper
When wallpapers are not present in WindowServer.ini, don't try
to select them in the wallpapers list.
2020-02-27 09:53:11 +01:00
Jesse Buhagiar
9fcb37ad30 Meta: Claim copyright on DisplayProperties files
If anyone's machine blows up setting their wallpaper, they know to blame
me and not AK :P
2020-02-26 12:15:54 +01:00
Andreas Kling
4f99c3726c SystemMonitor: Add pagemap visualization for VM regions
This patch adds a new column to the per-process memory regions view in
SystemMonitor. It's a scaled view of the underlying pagemap of a region
that tells you which chunks of the region are resident/null/zero.
2020-02-25 23:06:40 +01:00
Tibor Nagy
3b8713a9df Terminal: Open settings as a modal window
To prevent the settings window from getting orphaned when someone
closes the main window behind it.
2020-02-25 19:57:48 +01:00
joshua stein
0d2bfe5c65 Build: Only look at SUBDIRS with Makefiles
If a directory is renamed or deleted before 'make clean', git will
delete the Makefile but leave all of the object and dependency files
around.  When make would try to recurse into that directory from the
wildcard, it would error out since there is no Makefile.
2020-02-25 19:56:48 +01:00
joshua stein
a17e702eba Terminal: Don't set an initial command_to_execute
Otherwise we end up executing "/bin/Shell -c /bin/Shell" on a normal
launch.  With a null command_to_execute, we'll just execute
/bin/Shell
2020-02-25 16:17:43 +01:00
joshua stein
61340c12d6 SoundPlayer: Cast Audio::Sample to float for fabsf() 2020-02-25 15:32:58 +01:00
Andreas Kling
fbe4081f4b AK: Make Queue use size_t for its size 2020-02-25 14:55:04 +01:00
Andreas Kling
ceec1a7d38 AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
Andreas Kling
ee3811dee8 TextEditor: Pledge "thread" since it's needed by GUI::FilePicker
This is a little bit awkward since it's only used for generating
thumbnails on a background thread and it's not like I care about
thumbnails very much in a text editor, but for now let's just pledge
"thread" so I can get on with the thing I wanted to get on with.
2020-02-24 19:51:22 +01:00
thatlittlegit
525f8df5b8 SystemMenu: Migrate PowerDialog to (widget)->add like in 3d20da9e
This also fixes the build.
2020-02-23 22:03:03 +01:00
thatlittlegit
30556a0a93 SystemMenu: Move SystemDialog into SystemMenu and remove INI config
I probably would've done INI config removal in another commit, but it
fit well here because I didn't want to pledge wpath for SystemMenu if I
didn't need to.

Frankly, that's something that I think should be done: allow ConfigFile
to be used read-only.
2020-02-23 22:03:03 +01:00
thatlittlegit
9784ab99d2 SystemDialog+Base: Add icon for SystemDialog 2020-02-23 22:03:03 +01:00
thatlittlegit
ba6a290f4f SystemMenu: Remove --shutdown argument when calling SystemDialog 2020-02-23 22:03:03 +01:00
thatlittlegit
efc4861786 SystemDialog: Revamp to be more Win95-like
Only thing I don't like right now is the fact that we rely on the shell.
2020-02-23 22:03:03 +01:00
Andreas Kling
6c5100b644 LibGUI: Add helper for constructing new TabWidget tabs
This patch adds the following convenience helper:

    auto tab_widget = GUI::TabWidget::construct();
    auto my_widget = tab_widget->add_tab<GUI::Widget>("My tab", ...);

The above is equivalent to:

    auto tab_widget = GUI::TabWidget::construct();
    auto my_widget = GUI::Widget::construct(...);
    tab_widget->add_widget("My tab", my_widget);
2020-02-23 12:27:53 +01:00
Andreas Kling
c5d913970a LibGUI: Remove parent parameter to GUI::Widget constructor 2020-02-23 12:27:53 +01:00
Tibor Nagy
3d32c3352b FontEditor: Fix focus and implement keyboard navigation in the glyph map 2020-02-23 12:18:17 +01:00
Andreas Kling
bfd86c4631 LibGUI: Make GUI::Frame have the 2px sunken container look by default
The overwhelming majority of GUI::Frame users set the same appearance,
so let's just make it the default.
2020-02-23 11:10:52 +01:00
Andreas Kling
3d20da9ee4 Userspace: Use Core::Object::add() when building interfaces 2020-02-23 11:10:52 +01:00
Andreas Kling
8efafdfc12 IRCClient: Modernize Core::Object usage 2020-02-23 11:10:52 +01:00
Brian Gianforcaro
edb66f214d SystemMonitor: Fix display of file system size column.
The Size column in the "File systems" tab of SystemMonitor
had a rendering artifact where the bounding box outline would
be drawn in the same location as the text. This makes the text
look strange and hard to read.

Pad the size with a signle space character on either side to
give the text a gap on each side.
2020-02-22 21:25:00 +01:00
Andreas Kling
21c78e2fc3 SystemMenu: Silence debug spam on startup 2020-02-22 17:01:06 +01:00
Tibor Nagy
e490fc9e35 FontEditor: Make the application theme-aware 2020-02-20 14:19:30 +01:00
Andreas Kling
7592f9afd5 AK: Use size_t for CircularQueue and CircularDeque 2020-02-20 13:20:34 +01:00
Andreas Kling
88b9fcb976 AK: Use size_t for ByteBuffer sizes
This matches what we already do for string types.
2020-02-20 13:20:34 +01:00
Tibor Nagy
6eae2ef9cf HexEditor: Make the application theme-aware
Also updates the ruler style a bit to be more consitent with TextEditor.
2020-02-19 12:24:39 +01:00
Tibor Nagy
ca4d4cac45 HexEditor: Clear tracked changes when setting a new buffer 2020-02-19 10:10:53 +01:00
Tibor Nagy
97878dfb4d HexEditor: Fix out of bounds cursor
Fixing out of bounds cursor in three different cases:
- when the buffer is empty
- when loading new files
- when entering values at the end of the buffer
2020-02-19 10:10:53 +01:00
Andreas Kling
25b987ce4c SystemMenu: Use pledge() and unveil() 2020-02-17 20:20:46 +01:00
Andreas Kling
b711f1eab5 SystemMenu: Finish the implementation and start this at boot :^)
Fixes #1231.
2020-02-17 20:20:32 +01:00
Andreas Kling
737e455cbc SystemMenu: Add a separate program to host the system menu
This will allow us to run the system menu as any user. It will also
enable further lockdown of the WindowServer process since it should no
longer need to pledge proc and exec. :^)

Note that this program is not finished yet.

Work towards #1231.
2020-02-17 16:50:48 +01:00
thatlittlegit
6eccd166ed SystemDialog: Use Yes/No dialog instead of OK/Cancel
This also removes some unecessary debug lines. (The debug lines are
unnecessary because LibGUI already outputs the debug information, so
SystemDialog just doubled it up.)
2020-02-17 16:28:21 +01:00
thatlittlegit
14aaf75e3a TextEditor: Use Yes/No/Cancel for some dialogs when buffer is dirty 2020-02-17 16:28:21 +01:00
Andreas Kling
a6e69bda71 AK: Add basic Traits for RefPtr
This allows RefPtr to be stored in a HashTable<RefPtr<T>> :^)

It's unfortunate about the const_casts. We'll need to fix HashMap::get
to play nice with non-const Traits<T>::PeekType at some point.
2020-02-16 21:58:17 +01:00
Andreas Kling
0415db30c6 WindowServer: Move configuration file into /etc/WindowServer
This is in preparation for running WindowServer as a separate user.
2020-02-16 21:58:17 +01:00
Tibor Nagy
1176167944 Piano: Set step property for ADSR sliders 2020-02-16 21:58:01 +01:00
Andreas Kling
2143da6434 LibGUI: Add forwarding header
This patch adds <LibGUI/Forward.h> and uses it a bunch.
It also dragged various header dependency reduction changes into it.
2020-02-16 09:41:56 +01:00
thatlittlegit
51628f64fa Welcome: Apply @shannonbooth's recommendations 2020-02-15 20:46:10 +01:00
thatlittlegit
c07c442640 Welcome: Change copyrights in my code to 'SerenityOS developers' 2020-02-15 20:46:10 +01:00
thatlittlegit
f4958aea21 Welcome: Reduce the width and margins of the menu
I think it looks better where it takes up less space.
2020-02-15 20:46:10 +01:00
thatlittlegit
d5617fc855 Welcome: 'Welcome to Serenity' -> 'Welcome to SerenityOS' 2020-02-15 20:46:10 +01:00
thatlittlegit
7a3bdf3563 Welcome: Add icons to welcome entries 2020-02-15 20:46:10 +01:00
thatlittlegit
a55b96a1ea Welcome: Separate text from source code by parsing
This allows modification at runtime, as well as easier editing than C++
structures.
2020-02-15 20:46:10 +01:00
thatlittlegit
7caa8b7531 Welcome: Add pledge and unveil 2020-02-15 20:46:10 +01:00
thatlittlegit
37daae1451 Welcome: Use a proper heading font for 'Welcome to Serenity!' 2020-02-15 20:46:10 +01:00
thatlittlegit
ce2c1e824d Welcome: Push in the buttons depending on which page is selected 2020-02-15 20:46:10 +01:00
thatlittlegit
783f5dc07f Welcome: Replace PNG background with gradient
This allows scaling to larger window sizes, something that the PNG
didn't do well.
2020-02-15 20:46:10 +01:00
thatlittlegit
d647749737 Welcome: Remove crash and ensure text doesn't all stay on one line.
When size_t replaced int (6f4c370), it caused the 'start = -1' trick to
fail, setting start to (unsigned)-1 instead. This then caused
String.substring to fail, as that is a little bit higher than the length
of the string! This resulted in an outright crash.

Later, the builder is not reset before making a new line. This causes
the line to simply be the earlier one, but with more text on it.

(There's also a few changes from clang-format, namely the #include
reorganization.)

Fixes #1211 (although I wasn't aware of it when I made this commit).
2020-02-15 20:46:10 +01:00
Andreas Kling
b011ea9962 LibGUI: Reduce menu-related header dependencies 2020-02-15 01:56:30 +01:00
Andreas Kling
dcb0766d3f LibGUI: Remove some header dependencies from Application.h 2020-02-15 01:18:32 +01:00
Andreas Kling
e1ff4fa034 LibGUI: Remove more header dependencies from Widget.h 2020-02-15 00:24:14 +01:00
Andreas Kling
69400c2ca1 LibCore: Replace manual forward declarations with <LibCore/Forward.h> 2020-02-15 00:13:44 +01:00
Andreas Kling
34c7322d77 LibGUI: Remove some header dependencies from Widget.h 2020-02-14 23:53:11 +01:00
Andreas Kling
3fe2640c8c LibGfx: Add forward declaration header
This patch adds <LibGfx/Forward.h> with forward declarations for Gfx.
2020-02-14 23:31:18 +01:00
Andreas Kling
8f7333f080 LibCore: Add a forward declaration header
This patch adds <LibCore/Forward.h> and uses it in various places to
shrink the header dependency graph.
2020-02-14 23:31:18 +01:00
Andreas Kling
3bbf4610d2 AK: Add a forward declaration header
You can now #include <AK/Forward.h> to get most of the AK types as
forward declarations.

Header dependency explosion is one of the main contributors to compile
times at the moment, so this is a step towards smaller include graphs.
2020-02-14 23:31:18 +01:00
Andreas Kling
814d59f462 LibGUI: Port the drag&drop code to Core::MimeData 2020-02-14 13:18:59 +01:00
Andreas Kling
4dc15fc063 FileManager: Copy item(s) when dragging and dropping them :^)
This patch implements basic drag & drop file management in a narrow set
of cases. You can now drag & drop a file onto a folder in the same
directory, and the dropped file will be copied into the directory.

We'll need to support a lot more variations of this, but this is nice!
2020-02-13 21:57:02 +01:00
Andreas Kling
95fe78667f FileManager: Run clang-format on main.cpp 2020-02-13 21:54:27 +01:00
Andreas Kling
24dfc5051a IRCClient: Use Core::DateTime 2020-02-11 20:43:32 +01:00
Andreas Kling
6ecf90c6f8 SystemMonitor: Tweak bottom margin of the process table 2020-02-11 11:53:38 +01:00
Andreas Kling
14f9a29502 Terminal: Set up a nice $PROMPT for the shell :^) 2020-02-10 21:53:04 +01:00
ignas-sa
b67035c3ac
Calculator: Accept more keyboard input (#1207)
Allow user to clear/remove last numeral from input (Esc/Backspace
respectively) and type the decimal point.
2020-02-10 19:48:52 +01:00
William McPherson
aa149b9330 LibAudio/Piano: Replace floats with doubles
We should default to double-precision so that clients can make the
choice to use float or double.
2020-02-10 14:04:27 +01:00
William McPherson
4ad96df0d4 Piano: Draw stereo waves
Draw two waves in different colors.
2020-02-10 14:04:27 +01:00
William McPherson
93903c8064 Piano: Try to be more stereo-oriented 2020-02-10 14:04:27 +01:00
William McPherson
255edcb525 Piano: Add nice scale factor to WaveWidget 2020-02-10 14:04:27 +01:00
William McPherson
2a66878148 Piano: Ensure WaveWidget paints in-bounds
Letting GUI::Frame::paint_event() cover up your mistakes is tacky :P
2020-02-10 14:04:27 +01:00
William McPherson
60fdc6c9ab Piano: Put reset() with other setters 2020-02-10 14:04:27 +01:00
William McPherson
9997b0dbf5 Piano: Add sampler
This commit adds basic support for importing, viewing and playing WAV
samples at different pitches.

Naming issues:
- We are using the Sample struct from Music.h, but also the Sample
  struct from LibAudio (Audio::Sample). This is a little confusing.

set_recorded_sample() finds the peak sample and then divides all the
samples by that peak to get a guaranteed min/max of -1/1. This is nice
because our other waves are also bound between these values and we can
just do the same stuff. This is why we're using Audio::Sample, because
it uses floats, whereas Music.h's Sample uses i16s. It's a little
annoying that we have to use a mixture of floats and doubles though.

For playback at lower frequencies, we're calculating in-between samples,
rather than just playing samples multiple times. Basically, you get the
current sample and add the difference between the current sample and the
next sample multiplied by the distance from the current sample. This is
like drawing the hypotenuse of a right-angled triangle.
2020-02-10 14:04:27 +01:00
Andreas Kling
6cbd72f54f AK: Remove bitrotted Traits::dump() mechanism
This was only used by HashTable::dump() which I used when doing the
first HashTable implementation. Removing this allows us to also remove
most includes of <AK/kstdio.h>.
2020-02-10 11:55:34 +01:00
Andreas Kling
3d62cab90f TextEditor: Enable C++ syntax highlighting for .cpp and .h files :^) 2020-02-07 20:12:25 +01:00
Andreas Kling
6a9cc66b97 LibGUI: Remove leading G from filenames 2020-02-06 20:33:02 +01:00
Andreas Kling
2e219255a2 IPCCompiler: Put message classes in the Messages namespace 2020-02-06 20:21:49 +01:00
Andreas Kling
73110e25a9 WindowServer: Move classes into WindowServer namespace
Also remove the leading WS from names and filenames.
2020-02-06 20:03:37 +01:00
William McPherson
b7d190bd10 Piano: Add export action
This is a pretty rudimentary WAV export function for Piano.
2020-02-06 19:13:53 +01:00
William McPherson
5dc014b261 Piano: Fix roll playback at startup
This is not a bug currently, since the first column immediately starts
playing at startup and leaves no time for the user to put notes in it.
However, this is needed for exporting.
2020-02-06 19:13:53 +01:00
William McPherson
9a05bbaace Piano: Move piano roll internals to AudioEngine
The piano roll data definitely belongs in AudioEngine along with the
note and time data. Now RollWidget only has GUI information, much like
the other widgets.

Note that this commit exacerbates issue #1158 which is caused by
RollWidget::paint_event().
2020-02-06 19:13:53 +01:00
Andreas Kling
97edc82a26 LibAudio: Remove leading A from filenames 2020-02-06 15:18:03 +01:00
Andreas Kling
d17e23bd27 LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Andreas Kling
799b0a4fa8 LibGUI: Rename {H,V}BoxLayout => {Horizontal,Vertical}BoxLayout 2020-02-06 14:44:13 +01:00
Andreas Kling
dccf335d5b LibGUI: Add HorizontalSlider and VerticalSlider convenience classes 2020-02-06 14:43:16 +01:00
Andreas Kling
6a71ba1deb LibGUI: Add HorizontalSplitter and VerticalSplitter convenience classes 2020-02-06 14:40:59 +01:00
Andreas Kling
5c06c32df4 LibGfx: Prefer using Gfx::Bitmap::load_from_file instead of load_png()
Code that just wants to open a Gfx::Bitmap from a file should not be
calling the PNG codec directly.
2020-02-06 13:39:17 +01:00
Andreas Kling
f8b00aa290 LibGfx: Unpublish Gfx::Size from the global namespace 2020-02-06 13:32:14 +01:00
Andreas Kling
9b87843af1 LibGfx: Unpublish Gfx::Point from global namespace 2020-02-06 13:08:32 +01:00
Andreas Kling
20cfd2a6bf LibGfx: Unpublish Gfx::Rect from global namespace 2020-02-06 13:02:38 +01:00
Andreas Kling
c39d44fc2e LibGfx: Rename GraphicsBitmap.{cpp,h} => Bitmap.{cpp,h} 2020-02-06 12:07:05 +01:00
Andreas Kling
9ac94d393e LibGfx: Rename from LibDraw :^) 2020-02-06 12:04:00 +01:00
Andreas Kling
11580babbf LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really
wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename
the library to LibGfx. :^)
2020-02-06 11:56:38 +01:00
Andreas Kling
92f77864de LibAudio: Put all classes in the Audio namespace and remove leading A 2020-02-06 10:40:02 +01:00
Andreas Kling
f2a087126c LibC: Add posix_openpt(), grantpt() and unlockpt()
This makes getting a pseudoterminal pair a little bit more portable.
Note that grantpt() and unlockpt() are currently no-ops, since we've
already granted the pseudoterminal slave to the calling user.

We also accept O_CLOEXEC to posix_openpt(), unlike some systems. :^)
2020-02-05 21:17:41 +01:00
joshua stein
c3a32108b2 Piano: Fix building with clang 2020-02-05 18:39:45 +01:00
joshua stein
b4568b1422 Welcome: Pass -m to ld to fix building with clang/lld 2020-02-05 18:39:45 +01:00
joshua stein
8919b61784 SystemMonitor: Fix building with clang 2020-02-05 18:39:45 +01:00
joshua stein
385ba187bd FileManager: Include limits.h for PATH_MAX 2020-02-05 18:39:45 +01:00
joshua stein
a3c79fcdff FileManager: Fix building with clang
FileUtils.cpp:131:34: error: cannot pass object of non-trivial type 'const AK::String' through variadic method; call will abort at runtime [-Wnon-pod-varargs]
2020-02-05 18:39:45 +01:00
joshua stein
384d640293 FileManager: Include sys/stat.h for struct stat 2020-02-05 18:39:45 +01:00
joshua stein
46601690d9 HexEditor: Remove unused m_hover_pos 2020-02-05 18:39:45 +01:00
joshua stein
640cb920e8 FileManager: Remove unused m_row variable 2020-02-05 18:39:45 +01:00
William McPherson
1e0d57a13f Piano: Set some nice defaults 2020-02-05 17:52:10 +01:00
William McPherson
59bde64ba6 Piano: Add release
Notice that we are calculating release time according to the level when
the note is turned off rather than the sustain level. Naively using the
sustain level gives very long release times if you turn the note off
during attack, whereas this deterministically gives the same release
time.
2020-02-05 17:52:10 +01:00
William McPherson
ab9475a3f3 Piano: Add attack 2020-02-05 17:52:10 +01:00
William McPherson
5990b3b2e6 Piano: Add sustain 2020-02-05 17:52:10 +01:00
William McPherson
421a340572 Piano: Make decay more accurate
1. Make decay sample-granular rather than buffer-granular
You only have ~43 buffers per second which can make a jagged signal.

2. Calculate decay in milliseconds
Decay is supposed to be a time value.
2020-02-05 17:52:10 +01:00
William McPherson
44c81ee9db Piano: Remove phony multiple same note playback
I say "phony" because it's not actually playing the same frequency
twice, it's just playing the same frequency at a higher volume. We can
properly implement this later but at the moment it'll get in the way of
our ADSR implementation.
2020-02-05 17:52:10 +01:00
William McPherson
f909095981 Piano: Fix default knob values
Now you can change the defaults in AudioEngine and not be totally
confused.

1. The default for m_octave_knob was actually upside-down.
2. The default for m_decay_knob wasn't respecting AudioEngine.
3. The default for m_delay_knob wasn't respecting AudioEngine.
2020-02-05 17:52:10 +01:00
Sergey Bugaev
a6e7797a31 LibC: Move waitpid() to sys/wait.h
That's where POSIX says it should be.
2020-02-03 19:50:45 +01:00
Andreas Kling
c5bd9d4ed1 LibGUI: Put all classes in the GUI namespace and remove the leading G
This took me a moment. Welcome to the new world of GUI::Widget! :^)
2020-02-02 15:15:33 +01:00
Andreas Kling
2d39da5405 LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.

The new convention is:

- "LibFoo" is a userspace library that provides the "Foo" namespace.

That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
2020-02-02 15:15:30 +01:00
Andreas Kling
b7e3810b5c Terminal: Remove an unused variable 2020-02-02 15:09:48 +01:00
Andreas Kling
d67da8c101 LibGUI: Add GHBoxLayout and GVBoxLayout convenience classes 2020-02-02 15:09:48 +01:00
asliturk
63364f8a5d DisplayProperties: Highlight current wallpaper settings.
Fixes #556.
2020-02-02 15:08:37 +01:00
Andreas Kling
90cbe8a0da FileManager: Scope actions to the window where they logically belong
Most actions should not be app global. This fixes unwanted activations
while another window is active.
2020-02-02 02:03:39 +01:00
William McPherson
4a36a51618 Piano: Rewrite application
Goals:
- Switch to a more typical LibGUI arrangement
- Separate GUI (MainWidget) and audio (AudioEngine)
- Improve on existing features while retaining the same feature set

Improvements:
- Each GUI element is a separate widget
- The wave (WaveWidget) scales with the window
- The piano roll (RollWidget) scales horizontally and scrolls vertically
- The piano (KeysWidget) fits as many notes as possible
- The knobs (KnobsWidget) are now sliders
- All mouse and key events are handled in constant time
- The octave can be changed while playing notes
- The same note can be played with the mouse, keyboard and roll at the
  same time, and the volume of the resulting note is scaled accordingly
- Note frequency constants use the maximum precision available in a
  double
2020-01-31 13:13:04 +01:00
Sergey Bugaev
1e948f1766 SystemMonitor: Unveil /dev
DevicesModel wants to match devices supported by the kernel to device nodes
in /dev.
2020-01-30 12:23:22 +01:00
Sergey Bugaev
f9b4d981a8 LibGUI+FileManager: Try better to detect executables
We will now consider a file to be an executable if any of the executable
permission bits are set.
2020-01-28 15:08:27 +01:00
Sergey Bugaev
f983dfe319 Userland+Terminal: Port to new CArgsParser API
While at it, also add some niceties and fix some things.
2020-01-28 13:50:18 +01:00
Andreas Kling
169a38113e FileManager: Show symlink targets in status bar message
When a single item is selected and it happens to be a symlink pointing
somewhere, we now show where it points to in the status bar. :^)

There is a big ugly FIXME here about how DirectoryView has to work
around the fact that there's a GSortingProxyModel attached to the table
view widget.
2020-01-27 22:45:31 +01:00
Andreas Kling
f7b394af7d LibGUI: Add symlink targets as a column in GFileSystemModel
Also make sure to hide this column by default where we don't expect
to see it.
2020-01-27 22:19:05 +01:00
Andreas Kling
fcb7f6f233 FileManager: Use stat() when activating a file/directory
This makes it possible to open symlinks to directories by activating
them (via double click, for example.) :^)

Fixes #21.
2020-01-27 22:11:26 +01:00
Andreas Kling
6906edee9a LibGUI: Add 64-bit signed integer support to GVariant
What was previously the "Int" type is now "Int32" and "Int64".
2020-01-27 10:55:10 +01:00
Andreas Kling
cf10f22488 Terminal: Start a new session before exec'ing the shell
This will put everything running inside the terminal in the same SID.
2020-01-25 14:52:06 +01:00
Andreas Kling
c05c023664 Terminal: Fetch the user shell from /etc/passwd
This allows you to override the shell used by Terminal. :^)
2020-01-25 12:25:43 +01:00
Sergey Bugaev
c0b32f7b76 Meta: Claim copyright for files created by me
This changes copyright holder to myself for the source code files that I've
created or have (almost) completely rewritten. Not included are the files
that were significantly changed by others even though it was me who originally
created them (think HtmlView), or the many other files I've contributed code to.
2020-01-24 15:15:16 +01:00
Andreas Kling
7c74d3a657 TextEditor: Focus the editor after opening a new file 2020-01-23 21:33:15 +01:00
Andreas Kling
ebfb3d91e2 TextEditor: Various UI text tweaks 2020-01-23 21:33:15 +01:00
Andreas Kling
3de5439579 AK: Let's call decrementing reference counts "unref" instead of "deref"
It always bothered me that we're using the overloaded "dereference"
term for this. Let's call it "unreference" instead. :^)
2020-01-23 15:14:21 +01:00
Andreas Kling
50f9d27d3b Help: Use unveil() 2020-01-21 22:09:12 +01:00
Andreas Kling
a14f08fcc9 LibGUI: Import GColorPicker from the PaintBrush application 2020-01-21 21:55:25 +01:00
Andreas Kling
66598f60fe SystemMonitor: Show process unveil() state as "Veil"
A process has one of three veil states:

- None: unveil() has never been called.
- Dropped: unveil() has been called, and can be called again.
- Locked: unveil() has been called, and cannot be called again.
2020-01-21 18:56:23 +01:00
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