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.
With this patch, CEvents no longer stop at the target object, but will
bubble up the ancestor chain as long as CEvent::is_accepted() is false.
To the set accepted flag, call CEvent::accept().
To clear the accepted flag, call CEvent::ignore().
Events start out in the accepted state, so if you want them to bubble
up, you have to call ignore() on them.
Using this mechanism, we now ignore non-tabbing keydown events in
GWidget, causing them to bubble up through the widget's ancestors. :^)
Long-term we should use reference counting for the CObject hierarchy.
Since we've already accumulated a fair amount of code, this is quite a
large task, so I'm breaking it into some steps.
So, ObjectPtr is a "smart" pointer for CObject-derived types.
It becomes null when moved from, and will destroy unparented CObjects
in its destructor.
The idea here is to convert the codebase over to ObjectPtr piece by
piece, and then when everything is moved and CObject itself refactored
for ref-counting, we can just replace ObjectPtr with RefPtr everywhere.
Made getsockopt() and setsockopt() virtual so we can handle them in the
various Socket subclasses. The subclasses map kinda nicely to "levels".
This will allow us to implement things like "traceroute", although..
I spent some time trying to do that, but then hit a wall when it turned
out that the user-mode networking in QEMU doesn't preserve TTL in the
ICMP packets passing through.
The delete action now actually deletes files (after asking the user for
confirmation, of course.) Deleting directories is not yet supported.
Fixes#541.
Booting without a wallpaper is significantly faster in QEMU when the
host machine is under load (e.g while recording the screen..)
Using a wallpaper is now optional. :^)
When we ask LibGUI to hit test, it may return a subwidget of a widget
composed of many smaller widgets. In those cases we need to locate the
appropriate corresponding VBWidget for the composite widget.
This patch makes it possible to put widgets inside one another. The way
you do this right now is by having a (single) widget selected when you
insert a new widget. The new widget then becomes a child of the
selected widget. (In the future we'll make it possible to drag widgets
into each other, and things like that.)
I've also changed the grabber coordinates to be window-relative instead
of parent-relative in order to simplify things for myself. Maybe that's
not the ideal design and we can revisit that.
Normally if a GWidget has the is_greedy_for_hits() flag set, all hit
tests will hit the widget itself instead of its descendants.
Sometimes it may be desirable to override this behavior, and so this
flag now allows you to do that.
You can now copy into the system clipboard like this:
$ copy hello friends
or like this:
$ copy < ReadMe.md
or like this:
$ copy --type png < /res/wallpapers/sunset-retro.png
And paste just with
$ paste
or to view the copied type:
$ paste --print-type