summaryrefslogtreecommitdiff
path: root/Libraries
AgeCommit message (Collapse)Author
2019-08-02Kernel: mount system call (#396)Jesse
It is now possible to mount ext2 `DiskDevice` devices under Serenity on any folder in the root filesystem. Currently any user can do this with any permissions. There's a fair amount of assumptions made here too, that might not be too good, but can be worked on in the future. This is a good start to allow more dynamic operation under the OS itself. It is also currently impossible to unmount and such, and devices will fail to mount in Linux as the FS 'needs to be cleaned'. I'll work on getting `umount` done ASAP to rectify this (as well as working on less assumption-making in the mount syscall. We don't want to just be able to mount DiskDevices!). This could probably be fixed with some `-t` flag or something similar.
2019-08-02CEventLoop: Devirtualize take_pending_events_from(CEventLoop)Andreas Kling
2019-08-01LibHTML: Make some use of Vector::empend().Andreas Kling
2019-08-01GDirectoryModel: Fix redundant identical comparison.Andreas Kling
Found by PVS-Studio.
2019-08-01LibCore: Initialize pid/id variables in CoreIPC{Client,Server}Andreas Kling
Also rename CoreIPCServer::m_pid to m_client_pid for clarification. Found by PVS-Studio.
2019-08-01Painter: Scaling RGBA32 bitmaps treated the source as alpha-less RGB32Andreas Kling
Found by PVS-Studio.
2019-08-01Kernel+LibC: A lot of the signal handling code was off-by-one.Andreas Kling
There is no signal 0. The valid ones are 1 (SIGHUP) through 31 (SIGSYS) Found by PVS-Studio.
2019-08-01LibC: In fgetc(), fread() will never return < 0.Andreas Kling
Furthermore, fread() has already handled EOF, so there's no need to do it again. If we read a character, return it, otherwise return EOF. Note that EOF means "EOF or error" here.
2019-08-01CEventLoop: Add a missing initializer to EventLoopTimer.Andreas Kling
2019-08-01CIODevice: printf() thought it was calling ::write() but it was write()Andreas Kling
There's some confusion between the write syscall and CIODevice::write() here. The internal write() returns a boolean, and has already whined in case the syscall failed, so we don't need to do that again.
2019-07-31GDirectoryModel: Tweak default width of permission bits columnAndreas Kling
Now that GTableView elides text content by default, this column was a little too wide and ended up getting elided sometimes.
2019-07-31GTableView: Elide cell content so it doesn't overflow the cell rectAndreas Kling
I originally thought I'd have to implement text clipping in Painter for this, but it seems like I can get away without doing that today. :^) Fixes #390.
2019-07-31LibGUI: Simplify GTreeView ancestor traversalConrad Pankoff
2019-07-31LibGUI: Reify intermediate nodes during index traversalConrad Pankoff
In the event where you want to find the index of a deeply-nested path with a GFileSystemModel that hasn't yet traversed most of that path, it is possible for a false negative failure to occur. This failure is caused by the GFileSystemModel incorrectly bailing out of the search when it hits the first unseen path segment that is not at the very end of the path. This patch fixes this problem by reifying the intermediate nodes during that search and traversal process.
2019-07-31GDirectoryModel: Add "modification time" column.Andreas Kling
Fixes #373.
2019-07-31GVariant: Add Type::UnsignedInt.Andreas Kling
2019-07-31GDirectoryModel: Shrink the Permissions and Inode columns a little bit.Andreas Kling
2019-07-30LibCore: Rename CFileStreamReader => CIODeviceStreamReader.Andreas Kling
2019-07-30GFilePicker: Edit file name on opening windowrhin123
Overlooked that you can't have two GWidgets selected at the same time, whoops!
2019-07-29AudioServer: Begin work on a new IPC API style.Andreas Kling
The goal here is to generate most of this code from IPC protocol descriptions, but for now I've spelled them all out to get started. Each message gets a wrapper class in the ASAPI_Client or ASAPI_Server namespace. They are convertible to and from the old message structs. The real hotness happens when you want to make a synchronous request to the other side: auto response = send_sync<ASAPI_Client::GetMainMixVolume>(); Each request class knows his corresponding response class, so in the above example, "response" will be an ASAPI_Server::DidGetMainMixVolume object, and we can get the volume like so: int volume = response.volume(); For posting messages that don't expect a response, you can still use post_message() since the message classes are convertible: post_message(ASAPI_Server::DidGetMainMixVolume(volume)); It's not perfect yet, but I already really like it. :^)
2019-07-29TextEditor: Include extension during SaveAsrhin123
When we save-as in the text editor we now auto-populate GFilePicker /w the current name & extension.
2019-07-29AudioServer: Add a "main mix volume" and a simple program to get/set itAndreas Kling
Give the mixer a main volume value (percent) that we scale all the outgoing samples by (before clipping.) Also add a simple "avol" program for querying and setting the volume: - "avol" prints the current volume. - "avol 200" sets the main mix volume to 200%
2019-07-29Kernel+AK: Remove AK/StdLibExtras.cpp, moving kernel stuff to Kernel/.Andreas Kling
We had some kernel-specific gizmos in AK that should really just be in the Kernel subdirectory instead. The only thing remaining after moving those was mmx_memcpy() which I moved to the ARCH(i386)-specific section of LibC/string.cpp.
2019-07-29Kernel+ProcessManager: Let processes have an icon and show it in the table.Andreas Kling
Processes can now have an icon assigned, which is essentially a 16x16 RGBA32 bitmap exposed as a shared buffer ID. You set the icon ID by calling set_process_icon(int) and the icon ID will be exposed through /proc/all. To make this work, I added a mechanism for making shared buffers globally accessible. For safety reasons, each app seals the icon buffer before making it global. Right now the first call to GWindow::set_icon() is what determines the process icon. We'll probably change this in the future. :^)
2019-07-28LibAudio: Silence some debug spam in the WAV loader.Andreas Kling
2019-07-28LibAudio+aplay: Make the aplay output look a little funner.Andreas Kling
Show some information about the file we're playing, and display how many samples we've played out of how many total. This might be a bit buggy as I haven't tested it with many different files, but it's a start. :^)
2019-07-28LibAudio: WAV: Don't emit the very last sample in each decoded batch.Andreas Kling
This is a total hack, because I haven't really looked into why these are happening. Somehow we're producing one extra sample and it's glitching up the sound stream ever so slightly.
2019-07-28AudioServer+LibAudio: Make mixing queue-based instead of buffer-based.Andreas Kling
Each client connection now sets up an ASBufferQueue, which is basically a queue of ABuffers. This allows us to immediately start streaming the next pending buffer whenever our current buffer runs out of samples. This makes the majority of the skippiness go away for me. :^) Also get rid of the old PlayBuffer API, since we don't need it anymore.
2019-07-28GFilePicker: Quality of life improvements (#370)Rhin
Added: - Default to home directory on open. - Save button focus. - Correct title for the mode were in. - Home directory shortcut.
2019-07-28AudioServer: Add a buffer queue so we can buffer some sound.Andreas Kling
The idea here is to keep a small number of sample buffers queued in the AudioServer so we don't get caught without something to play.
2019-07-28GTabWidget: Allow putting the tabs on the bottom of the widget.Andreas Kling
They're still painted as if they are top tabs, but the subwidget placement logic is all there.
2019-07-28WindowServer+LibGUI: Remove old "icon path" way of doing things.Andreas Kling
Now that we can set icons directly "by bitmap", there's no need for passing around the icon paths anymore, so get rid of all the IPC and API related to that. :^)
2019-07-28WindowServer+LibGUI: Pass window icons as shared buffers rather than paths.Andreas Kling
Now that we support more than 2 clients per shared buffer, we can use them for window icons. I didn't do that previously since it would have made the Taskbar process unable to access the icons. This opens up some nice possibilities for programmatically generated icons.
2019-07-27LibAudio: Remove an unnecessary copy of sample buffers before sending them.Andreas Kling
I missed this earlier, but *now* we're actually using the same SharedBuffer all the way from client-side WAV reading to server-side mixing. :^)
2019-07-27TextEditor: Let's have line numbers starting at 1.Andreas Kling
Thanks to Dan for pointing this out on IRC: <danboid> I see TextEditor still numbers its lines from 0. You're too much of a programmer sometimes kling! :) < kling> that might be the most extreme form of "programmer design" I've seen in serenity
2019-07-27LibAudio: Allow WAV files up to 1GB.Andreas Kling
We were limiting ourselves to only play WAV files smaller than 42 MB for no particular reason. This patch increases the limit to 1 GB. Perhaps there should not be any limit at all, but 1GB seems like a reasonable sanity check at the moment. :^)
2019-07-27LibAudio: WAV reading should stop when we run out of file. :^)Andreas Kling
2019-07-27Audio: Make ABuffer sit on top of a SharedBuffer.Andreas Kling
This allows us to carry the same buffer all the way from the WAV loader to the AudioServer mixer. This alleviates some of the stutter, but there's still a noticeable skip when switching buffers. We're gonna need to do better. :^)
2019-07-27Audio: Make basic streaming WAV playback work.Andreas Kling
I had to solve a bunch of things simultaneously to make this work. Refactor AWavLoader to be a streaming loader rather than a one-shot one. The constructor parses the header, and if everything looks good, you can repeatedly ask the AWavLoader for sample buffers until it runs out. Also send a message from AudioServer when a buffer has finished playing. That allows us to implement a blocking variant of play(). Use all of this in aplay to play WAV files chunk-at-a-time. This is definitely not perfect and it's a little glitchy and skippy, but I think it's a step in the right direction.
2019-07-27LibCore: Add CFileStreamReader, a simple streaming CFile reader.Andreas Kling
This is extremely barebones right now, but can be used to easily read binary data from a CFile piece by piece.
2019-07-27LibAudio: Use ByteBuffer::slice_view() to avoid double memory usage.Andreas Kling
We only need a temporary copy for passing to ABuffer::from_pcm_data().
2019-07-27LibAudio: Run clang-format on all of it to make editing easier.Andreas Kling
2019-07-27CIODevice: Try to preallocate the exact needed buffer size in read_all().Andreas Kling
If we can get the exact file size from fstat(), it's a very good idea to use it since it means we avoid eleventy thousand reallocations.
2019-07-27LibDraw: Tweak the hover highlight color.Andreas Kling
It was a tad too bright. Also make sure we're using the same color in all the different places. At some point it would be nice to improve global color settings, etc.
2019-07-27LibCore: Remove CSocket's bind() and listen().Andreas Kling
We're going to be using dedicated server socket classes instead. This was only implemented for CLocalSocket, and clients have been switched over to using CLocalServer.
2019-07-27LibCore: Port CoreIPCServer to using CLocalServer.Andreas Kling
Use CLocalServer to listen for connections in WindowServer and AudioServer. This allows us to accept incoming CLocalSocket objects from the CLocalServer and construct client connections based on those. Removed COpenedSocket since it's replaced by CLocalSocket.
2019-07-27LibCore: Use clang-format on CoreIPC{Client,Server}.Andreas Kling
2019-07-27CSocket: Add an on_ready_to_read callback.Andreas Kling
This callback uses a CNotifier internally and will fire whenever there's something to be read from the socket.
2019-07-27CIODevice: Add a virtual did_update_fd() no notify subclasses of fd change.Andreas Kling
This will allow subclasses to react when the file descriptor changes.
2019-07-27LibCore: Add CLocalServer, a server-only local socket class.Andreas Kling
Instead of trying to support both client and server in CLocalSocket, let's have a specialized server class. The basic usage is: CLocalServer server; server.listen("/tmp/name-of-portal"); server.on_ready_to_accept = [&] { CLocalSocket* client = server.accept(); ... }; This will make things a lot simpler, since an accepting socket doesn't need half of the stuff that a regular CIODevice provides. :^)