Commit Graph

673 Commits

Author SHA1 Message Date
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