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.
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. :^)
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.
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.
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. :^)
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.
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. :^)
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. :^)
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.
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.
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.
This patch adds basic keyboard access to the search box. We also yield
focus back gracefully to the text document when the search box is no
longer wanted.
Focus should probably move automatically when an ancestor of the
currently focused widget if made invisible..
WindowServer was led to believe that the Terminal window had an alpha
channel that had to be respected by the compositor. This caused us to
always consider it as non-opaque when culling dirty rects in compose.
This needs to be applied consistently in the rest of this UI, but here
is a start. I can't figure out what the right look should be right now
so I'm just gonna commit it this way and we'll work it out later. :^)
This optimization was broken since who-knows-when. Now we once again do
our best to only repaint the lines that had the "dirty" flag set.
This dramatically reduces the amount of work done by an idle Terminal
since the cursor blinking won't redraw the whole window anymore. :^)
Now that we're bringing back the in-kernel virtual console, we should
move towards having a single implementation of terminal emulation.
This patch rips out the emulation code from the Terminal application
and turns it into the beginnings of LibVT.
The basic design idea is that users of VT::Terminal will implement and
provide a VT::TerminalClient subclass to handle presentation-specific
things. We'll need to iterate on this, but it's a start. :^)
Now there's just CHttpRequest::set_url(URL), no need to specify the
host, port and path manually anymore.
Updated ChanViewer and Downloader for the API change.
Change the custom data massaging callback to take a const JsonObject&.
This will allow binding together data from multiple fields into one
output in the model. :^)
This broke due to a change in JsonValue API. JsonValue::to_string() now
returns the value serialized to a string, which may become "undefined".
You kinda want JsonValue::as_string(), but that is only callable when
the JsonValue *is* a string. Thankfully there is now as_string_or(alt).
GWindow::~GWindow() deletes the main widget, assuming it was
allocated with new; this is what all other applications do,
so heap-allocate the terminal widget as well even though it's
not necessary in this case.
This was really straightforward since all the necessary pieces were
already in place. This patch just passes a bold font to draw_glyphs()
for buffer cells with the bold attribute set. :^)
Fork the IPC Connection classes into Server:: and Client::ConnectionNG.
The new IPC messages are serialized very snugly instead of using the
same generic data structure for all messages.
Remove ASAPI.h since we now generate all of it from AudioServer.ipc :^)
- "seekable": whether the fd is seekable or sequential.
- "class": which kernel C++ class implements this File.
- "offset": the current implicit POSIX API file offset.
This API was returning a "const char*" and it was unclear who took care
of the underlying memory. Returning a String makes that obvious.
Also make sure we close the /etc/passwd file when we're done with it.
FileManager used to open up with the root directory loaded by default.
Now it will try to load either 1) the first argument specified on the
command line, 2) the user's home directory, or 3) the root directory.
Fixes#389
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. :^)
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. :^)
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.
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
This macro goes at the top of every CObject-derived class like so:
class SomeClass : public CObject {
C_OBJECT(SomeClass)
public:
...
At the moment, all it does is create an override for the class_name() getter
but in the future this will be used to automatically insert member functions
into these classes.
This behavior and API was extremely counter-intuitive since our default
behavior was for applications to never exit after you close all of their
windows.
Now that we exit the event loop by default when the very last GWindow is
deleted, we don't have to worry about this.
You now have to pass an Orientation to the GSlider constructor. It's not
possible to change the orientation after construction.
Added some vertical GSliders to the WidgetGallery demo for testing. :^)
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.
This avoids building the code twice, and will encourage better separation
of concerns. :^)
This was a mistake, of course. Nested event loops don't need (or want)
independent server connections.
We initialize the connection early in GEventLoop for e.g. users that
want to get the size of a GDesktop before the connection has been
established.
Bug noticed by Andreas, introduced by me ;-)
As a consequence, move to use an explicit handshake() method rather than
calling virtuals from the constructor. This seemed to not bother
AClientConnection, but LibGUI crashes (rightfully) because of it.
Currently the two available input types are:
- GMessageBox::InputType::OK (default)
- GMessageBox::InputType::OKCancel
Based on your choice, GMessageBox::exec() will return ExecOK or ExecCancel.
Currently this will be used by the WindowServer to show some dialogs.
This is needed since WindowServer can't use LibGUI and reimplementing
message box functionality inside WindowServer would be silly. :^)
The only dialog supported in this initial version is --shutdown
This is the same as calling FileSystemPath(foo).string(). The majority of
clients only care about canonicalizing a path, so let's have an easy way
to express that.
In order to repaint the GUI after the sound thread has produced some sweet
new waves, we post a CCustomEvent to the main thread's event loop and then
wake up that event loop via CEventLoop::wake().
* Add a LibAudio, and move WAV file parsing there (via AWavFile and AWavLoader)
* Add CLocalSocket, and CSocket::connect() variant for local address types.
We make some small use of this in WindowServer (as that's where we
modelled it from), but don't get too invasive as this PR is already
quite large, and the WS I/O is a bit carefully done
* Add an AClientConnection which will eventually be used to talk to
AudioServer (and make use of it in Piano, though right now it really
doesn't do anything except connect, using our new CLocalSocket...)
This frees up the main thread to draw the GUI. The secondary thread uses
a pipe to trick the main thread's event loop to break out of select() and
update() the PianoWidget. :^)
The idea here is to implement a simple synhesizer that allows you to play
music with your keyboard. :^)
It's a huge hack currently but we can improve upon this.
Here goes the first attempt at using VisualBuilder to make an application.
There are many features missing that we are gonna have to implement,
noticeably custom widgets (for the glyph editor and glyph map widgets)
but this patch already moves most of the UI layout to a form file. :^)
Instead of manually doing String::format("%d"/"%u") everywhere, let's have
a String API for this. It's just a wrapper around format() for now, but it
could be made more efficient in the future.