Commit graph

1301 commits

Author SHA1 Message Date
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
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
Jami Kettunen
7f15604f72 HexEditor: Clarify in InputBox which offset (Hex/Dec) you're Going To 2020-01-01 01:23:27 +01:00
Jami Kettunen
74a18c86c9 Applications: Implement some missing MenuBars & AboutDialogs 2019-12-31 01:46:42 +01:00
Jami Kettunen
33b8d37dd3 Applications: Space out SystemMonitor & TextEditor in AboutDialogs 2019-12-31 01:46:42 +01:00
Andreas Kling
50677bf806 Kernel: Refactor scheduler to use dynamic thread priorities
Threads now have numeric priorities with a base priority in the 1-99
range.

Whenever a runnable thread is *not* scheduled, its effective priority
is incremented by 1. This is tracked in Thread::m_extra_priority.
The effective priority of a thread is m_priority + m_extra_priority.

When a runnable thread *is* scheduled, its m_extra_priority is reset to
zero and the effective priority returns to base.

This means that lower-priority threads will always eventually get
scheduled to run, once its effective priority becomes high enough to
exceed the base priority of threads "above" it.

The previous values for ThreadPriority (Low, Normal and High) are now
replaced as follows:

    Low -> 10
    Normal -> 30
    High -> 50

In other words, it will take 20 ticks for a "Low" priority thread to
get to "Normal" effective priority, and another 20 to reach "High".

This is not perfect, and I've used some quite naive data structures,
but I think the mechanism will allow us to build various new and
interesting optimizations, and we can figure out better data structures
later on. :^)
2019-12-30 18:46:17 +01:00
Jesse Buhagiar
ba98666b05 DisplayProperties: Add a menubar
Add a menubar to the `DisplayProperties` application to make it
more consistent with the other programs in the system.
2019-12-30 14:03:31 +01:00
Tibor Nagy
62d79a77d6 FontEditor: Add glyph spacing spinbox 2019-12-30 14:02:12 +01:00
Andreas Kling
6a94214502 About: Embrace the SerenityOS name 2019-12-29 19:07:52 +01:00
Andreas Kling
c74cde918a Kernel+SystemMonitor: Expose amount of per-process clean inode memory
This is memory that's loaded from an inode (file) but not modified in
memory, so still identical to what's on disk. This kind of memory can
be freed and reloaded transparently from disk if needed.
2019-12-29 12:45:58 +01:00
Andreas Kling
0d5e0e4cad Kernel+SystemMonitor: Expose amount of per-process dirty private memory
Dirty private memory is all memory in non-inode-backed mappings that's
process-private, meaning it's not shared with any other process.

This patch exposes that number via SystemMonitor, giving us an idea of
how much memory each process is responsible for all on its own.
2019-12-29 12:28:32 +01:00
Andreas Kling
7b2dd7e116 LibDraw+LibGUI: Allow changing individual colors in a Palette
Palette is now a value wrapper around a NonnullRefPtr<PaletteImpl>.
A new function, set_color(ColorRole, Color) implements a simple
copy-on-write mechanism so that we're sharing the PaletteImpl in the
common case, but allowing you to create custom palettes if you like,
by getting a GWidget's palette, modifying it, and then assigning the
modified palette to the widget via GWidget::set_palette().

Use this to make PaintBrush show its palette colors once again.

Fixes #943.
2019-12-29 00:47:49 +01:00
joshua stein
b624eaaf78 Build: consider IPCCOMPILER and FORMCOMPILER just for ordering
Build them if they don't exist, but don't care about them being
newer or older than the target.

I believe this is what was causing build loops where IPCCompiler was
being run a second time, rebuilding its .h file, then a library
would depend on that .h file and get re-archived, then an
application would need relinking, and something in that whole
process would trigger IPCCompiler running again touching its .h
file.
2019-12-28 21:09:33 +01:00
joshua stein
0b501335f5 Build: wrap make invocations with flock(1)
Lock each directory before entering it so when using -j, the same
dependency isn't built more than once at a time.

This doesn't get full -j parallelism though, since one make child
will be sitting idle waiting for flock to receive its lock and
continue making (which should then do nothing since it will have
been built already).  Unfortunately there's not much that can be
done to fix that since it can't proceed until its dependency is
built by another make process.
2019-12-28 21:09:33 +01:00
Valtteri Koskivuori
415a5d68ce Build: Fix missing IPC dependency for Browser.
It forgot to compile IPC for ProtocolClient before building the browser.
2019-12-27 15:52:12 +01:00
Shannon Booth
c85bdff57a PaintBrush: Add an "ellipse tool"
The tool currently supports drawing an elliptical line of a specified
thickness. Further improvements can include adding a fill mode, and
holding down shift to draw a perfect circle.

Closes #375.
2019-12-27 00:52:17 +01:00
Shannon Booth
b830639912 PaintBrush: Add a "rectangle tool"
Fill, line, and gradient modes initially supported :^)
2019-12-26 21:22:29 +01:00
William McPherson
6cf4468506 Piano: Factor wave rendering to its own function 2019-12-25 16:14:11 +01:00
William McPherson
bc65971df6 Piano: Use switch statements on m_wave_type 2019-12-25 16:14:11 +01:00
William McPherson
e80061c808 Piano: Move m_front_buffer/m_back_buffer off heap 2019-12-25 16:14:11 +01:00
William McPherson
b3b522bae2 Piano: Initialize m_note_on[]
This was being read before initialization.
2019-12-25 16:14:11 +01:00
William McPherson
2573c33ffe Piano: Rename "release" to "decay"
That's not release!
2019-12-25 16:14:11 +01:00
William McPherson
27ebf3ff32 Piano: Initialize keys[] at member definition 2019-12-25 16:14:11 +01:00
joshua stein
c127d16326 Build: support library and generator dependencies
Instead of directly manipulating LDFLAGS, set LIB_DEPS in each
subdirectory Makefile listing the libraries needed for
building/linking such as "LIB_DEPS = Core GUI Draw IPC Core".

This adds each library as an -L and -l argument in LDFLAGS, but
also adds the library.a file as a link dependency on the current
$(PROGRAM).  This causes the given library to be (re)built before
linking the current $(PROGRAM), but will also re-link any binaries
depending on that library when it is modified, when running make
from the root directory.

Also turn generator tools like IPCCompiler into dependencies on the
files they generate, so they are built on-demand when a particular
directory needs them.

This all allows the root Makefile to just list directories and not
care about the order, as all of the dependency tracking will figure
it out.
2019-12-25 10:11:09 +01:00
Andreas Kling
a79bac428b LibGUI+LibDraw: Add "Palette" concept for scoped color theming
GApplication now has a palette. This palette contains all the system
theme colors by default, and is inherited by a new top-level GWidget.
New child widgets inherit their parents palette.

It is possible to override the GApplication palette, and the palette
of any GWidget.

The Palette object contains a bunch of colors, each corresponding to
a ColorRole. Each role has a convenience getter as well.

Each GWidget now has a background_role() and foreground_role(), which
are then looked up in their current palette when painting. This means
that you no longer alter the background color of a widget by setting
it directly, rather you alter either its background role, or the
widget's palette.
2019-12-24 21:27:16 +01:00
Andreas Kling
b6eba388e3 LibDraw: Add Selection and SelectionText system theme colors 2019-12-24 12:13:49 +01:00
Shannon Booth
bbe99ae960 SystemMonitor: Remove uneeded cast from unsigned to int
GVariant now supports unsigned ints :^)
2019-12-24 11:11:13 +01:00
Shannon Booth
889a60a6ed Browser: Stop reloads from pushing to history 2019-12-24 00:20:05 +01:00
Andreas Kling
411058b2a3 WindowServer+LibGUI: Implement basic color theming
Color themes are loaded from .ini files in /res/themes/
The theme can be switched from the "Themes" section in the system menu.

The basic mechanism is that WindowServer broadcasts a SharedBuffer with
all of the color values of the current theme. Clients receive this with
the response to their initial WindowServer::Greet handshake.

When the theme is changed, WindowServer tells everyone by sending out
an UpdateSystemTheme message with a new SharedBuffer to use.

This does feel somewhat bloated somehow, but I'm sure we can iterate on
it over time and improve things.

To get one of the theme colors, use the Color(SystemColor) constructor:

    painter.fill_rect(rect, SystemColor::HoverHighlight);

Some things don't work 100% right without a reboot. Specifically, when
constructing a GWidget, it will set its own background and foreground
colors based on the current SystemColor::Window and SystemColor::Text.
The widget is then stuck with these values, and they don't update on
system theme change, only on app restart.

All in all though, this is pretty cool. Merry Christmas! :^)
2019-12-23 20:33:01 +01:00
William McPherson
7c8bbea995 Piano: Add piano roll
m_roll_notes[] is an array of 2 bools, pressed and playing. A roll note
is highlighted if it is pressed or in the currently playing column, but
the note is only actually played if the roll note is both pressed and
playing.

We change columns every m_tick which is currently 10 frames. The delay
is synchronised with this. change_roll_column() tracks the previous
column and current column to be played. Each roll note in the previous
column is set to "not playing" and the underlying audio note is turned
off if it was pressed. For the current column, each roll note is set to
playing and the underlying audio note is turned on if pressed.
2019-12-23 15:08:15 +01:00
William McPherson
ebaadda6bd Piano: Make note() callable by multiple sources
Rather than checking key codes and mouse positions, we should have a
more general way to play notes. You can call note() either with a
KeyCode or a PianoKey directly.

Additionally, m_note_on[] is now an array of integers instead of bools.
This allows multiple sources to play a note. This is kind of like a
"reference counted note": two sources can increment the note and it will
only turn off once they have both decremented it back to 0.

We are now only using keys[] to prevent multiple consecutive calls to
keydown_event() (when a key is held), since that would result in playing
a note many times.
2019-12-23 15:08:15 +01:00
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
Sergey Bugaev
22e6978c71 WindowServer+LibGUI+FontEditor: Encode special characters as UTF-8 2019-09-05 16:37:39 +02:00
rhin123
9f8a2af921 Terminal: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
1f666abcd2 SystemMonitor: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
2d8318a474 QuickShow: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
962b65b42f Piano: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
a538968cc2 PaintBrush: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
7df4cfe606 IRCCient: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
86c68210f0 FileManager: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
f468634494 TextEditorWidget: Added GCommonActions 2019-09-05 09:40:54 +02:00
Andreas Kling
5cfd67ecbb FileManager: Open ".wav" files in SoundPlayer when activated
Now you can double-click on WAV files in the FileManager. Neato! :^)
2019-09-04 20:20:36 +02:00
Andreas Kling
1188a036e9 SoundPlayer: Start working on a GUI sound player application
This can play anything that AWavLoader can load (so obviously only WAV
files at the moment.)

It works by having a timer that wakes up every 100ms and tries to send
a sample buffer to the AudioServer. If our server-side queue is full
then we wait until the next timer iteration and try again.

We display the most recently enqueued sample buffer in a nice little
widget that just plots the samples in green-on-black. :^)
2019-09-04 20:18:41 +02:00
Andreas Kling
2441c1fde2 IRCClient: Use GAboutDialog :^) 2019-09-04 19:11:37 +02:00
Andreas Kling
75eb84c7e4 IRCClient: Size columns to-fit in the window and member views 2019-09-04 19:07:59 +02:00
Andreas Kling
e12bbc097f IRCClient: Add 16x16 icon 2019-09-04 18:56:39 +02:00
Andreas Kling
52f62c2d7e IRCClient: Tweak UI to look less padding-bloated 2019-09-04 18:54:43 +02:00
Andreas Kling
2216c7ecc6 IRCClient: Make the auto-join on connect feature actually do something 2019-09-04 17:37:11 +02:00
Andreas Kling
9cb4e5ac81 IRCClient: Don't auto-open new queries for NOTICE or CTCP messages
This seems to match what other IRC clients do, and it means we don't
get three separate "server" windows when connecting to Freenode. :^)
2019-09-03 21:47:43 +02:00
Andreas Kling
5c7ef5977d IRCClient: Handle incoming CTCP requests VERSION and PING
CTCP requests are client-to-client messages that are sent as either
PRIVMSG (for requests) or NOTICE (for responses) and wrapped in ASCII
character 0x01 on both sides.

This patch implements responding to the very common VERSION and PING
requests. We always get a VERSION request from freenode when connecting
there, for instance. :^)
2019-09-03 21:18:28 +02:00
Andreas Kling
841f1276e6 TextEditor: Use GAboutDialog :^) 2019-09-02 19:48:47 +02:00
Andreas Kling
aea6a28e9c Terminal: Use GAboutDialog :^) 2019-09-02 19:46:35 +02:00
Conrad Pankoff
1f56612c8a Terminal: Add -e (execute) command line option
This allows a user to specify a command to run after opening the terminal
program. By default it will still spawn an interactive shell.
2019-09-02 08:33:36 +02:00
Andreas Kling
cfe09784a4 TextEditor: Clear the dirty flag in newly opened documents 2019-08-29 18:54:06 +02:00
Andreas Kling
a71e411b27 Terminal: Use a gear icon for the "Settings" menu 2019-08-29 18:19:40 +02:00
Andreas Kling
72950f93a3 TextEditor: Move the Font menu inside the View menu
This will be our first user of the nested menus feature. :^)
2019-08-29 06:36:35 +02:00
Andreas Kling
b1763238d7 TextEditor: Ask the user before closing a dirty (modified) document
It's a little unfortunate that we have two separate code paths that can
lead to asking the user about this. Longer-term we should find a way to
unify these things.

Fixes #491.
2019-08-27 20:39:01 +02:00
Andreas Kling
ecbedda34c TextEditor: Add a "document dirty" flag and show it in the window title
This lets you know if the document has been modified since last save.
2019-08-27 20:18:19 +02:00
Andreas Kling
07933d0b46 TextEditor: Let's enable line wrapping by default 2019-08-27 17:05:01 +02:00
Andreas Kling
b6de723eb3 TextEditor: Move line wrapping setting to a new "View" menu 2019-08-27 17:01:52 +02:00
Andreas Kling
b0b94560c3 FileManager: Add "go home" action to the "Go" menu 2019-08-26 21:20:39 +02:00
Andreas Kling
08d7c86e90 FileManager: Move "File" menu entries to the app menu 2019-08-26 19:18:54 +02:00
Andreas Kling
cef2c04952 TextEditor: Move all "File" menu entries into the app menu instead
It felt weird to have both the app menu *and* a "File" menu.
2019-08-26 17:59:05 +02:00
Sergey Bugaev
d91efd4cd0 Piano: Port threading to LibThread 2019-08-26 11:31:14 +02:00
Sergey Bugaev
e1a6f8a27d LibThread: Introduce a new threading library
This library is meant to provide C++-style wrappers over lower
level APIs such as syscalls and pthread_* functions, as well as
utilities for easily running pieces of logic on different
threads.
2019-08-26 11:31:14 +02:00
Andreas Kling
d5f3487203 TextEditor: Select everything in the find textbox when pressing Ctrl+F
This allows you to press Ctrl+F and immediately start typing a new
search string, instead of having to remove the old one first. :^)
2019-08-25 21:46:39 +02:00
Andreas Kling
e8e8741c88 LibGUI+TextEditor: Make GButton activate its action if present
Previously even if you assigned a GAction to a GButton, you still had
to activate() the action manually by hooking the GButton::on_click
callback.
2019-08-25 21:46:39 +02:00
Andreas Kling
ded005500d TextEditor: Add actions for find next/previous (Ctrl+G, Ctrl+Shift+G) 2019-08-25 21:46:39 +02:00
Andreas Kling
d88c40568f TextEditor: Add search-related actions to the text editor context menu
Using the new GTextEditor::add_custom_context_menu_action() mechanism.

Fixes #478.
2019-08-25 21:46:28 +02:00
rhin123
0df7213670 Terminal: Fixed bounding issue when clearing the selection on type
We were checking the columns of the whole selection instead of the
the specfic line were modifying. Because of this, the selection
remained if the selection's column on another line was less than
the cursor.
2019-08-25 19:53:57 +02:00
Andreas Kling
97a695403b TextEditor: Add a menu action for turning line-wrapping on/off 2019-08-25 12:23:34 +02:00