Age | Commit message (Collapse) | Author |
|
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
|
|
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.
|
|
We need to get rid of all instances of widgets-on-the-stack since that
will no longer work in the ref-counting world.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also get rid of the custom CNotifier::create() in favor of construct().
|
|
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.
|
|
|
|
Use the same callback signature as GAction so we can just forward it
to GAction instead of chaining callbacks.
|
|
|
|
|
|
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 seems to match what other IRC clients do, and it means we don't
get three separate "server" windows when connecting to Freenode. :^)
|
|
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. :^)
|
|
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.
|
|
It was annoying to always write set_preferred_size({ width, height }). :^)
|
|
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. :^)
|
|
|
|
When handling "/query nick", we now immediately switch to the new query.
|
|
This allows us to send a message to "nickserv" and receive a response from
"NickServ" without getting confused. :^)
|
|
They should be handled slightly differently, but at least now we're doing
*something* withthem.
|
|
|
|
|
|
Also make sure the action is disabled while we're not in a window that
corresponds to an open channel. :^)
Fixes #277.
|
|
|
|
Someone suggested this a long time ago and I never got around to it.
So here we go, here's the warm gray! I have to admit I like it better. :^)
|
|
Further consolidation is of course possible, eg the Games/ programs
follow the same rules more or less.
|
|
|
|
|
|
|
|
(And various related renames that go along with it.)
|
|
|
|
|
|
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
|
|
|
|
|
|
|
|
|
|
Now you can hook activation via GAbstractView::on_activation.
The design still isn't quite right, we should eventually move the selection
away from the model somehow.
|