Commit graph

1026 commits

Author SHA1 Message Date
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