Commit graph

3407 commits

Author SHA1 Message Date
Andreas Kling
f1af5f26eb GSplitter: Explicitly set the size policies when resizing.
If we don't have the fixed size policy for the first resizee, the layout
system will just ignore the preferred sizes that we're giving it.
2019-07-27 09:36:21 +02:00
Andreas Kling
2b02deef28 GWidget: Remove unused is_widget() virtual.
This is implemented as a bool member in CObject, not a virtual.
2019-07-27 09:35:07 +02:00
Andreas Kling
7dc7f11ed8 GWidget: Add set_size_policy(Orientation, Policy).
This allows you to set the policy for a single orientation rather than
both at the same time.
2019-07-27 09:34:28 +02:00
Andreas Kling
10c35d345a LibCore: Add comment about child events for partially-constructed children.
Since ChildAdded events originate from the CObject constructor, they are not
fully constructed when their parent learns that they were added.
Added a little comment about this to the child_event() declaration.
2019-07-27 09:31:46 +02:00
Andreas Kling
185ba4dc3f ProcessManager: Move the memory stats widget under "Graphs" instead.
Making space for some new thingy under the process table view.
2019-07-27 08:43:32 +02:00
Andreas Kling
cd3463d2e3 ProcessManager: Rename "widget" to "process_table_container". 2019-07-27 08:42:15 +02:00
Andreas Kling
5d83a049c2 FormCompiler: Add some more LibCore object files to host build. 2019-07-26 22:42:10 +02:00
Andreas Kling
be2b585ca6 LibCore: Add CSocket::bind() (virtual) and CSocket::listen().
These will be useful for implementing server sockets.
2019-07-26 22:39:16 +02:00
Andreas Kling
2f373a27a2 AK: Add RELEASE_ASSERT in non-Serenity builds. 2019-07-26 22:15:54 +02:00
Andreas Kling
d7ff2c5b86 LibGUI: GDialog should close its nested event loop on window close.
Make GWindow::close() so we can override it in GDialog and quit from the
internal event loop when the window manager tells us to close ourselves.

The dialog will return GDialog::ExecCancel in these situations.
2019-07-26 16:13:59 +02:00
Andreas Kling
7da5a04131 CEventLoop: Convert dbgprintf() to dbg(). 2019-07-26 16:00:56 +02:00
Andreas Kling
1d3889e24f Meta: Minor tweak to Contributing.md 2019-07-26 15:45:47 +02:00
Andreas Kling
9b17016c17 Meta: Add some basic contribution guidelines. 2019-07-26 15:31:36 +02:00
Andreas Kling
bacbb52f2e Lagom: Let's not hard-code the compiler. Add compiler-relevant flags though.
I'm still getting the hang of this CMake thing.
2019-07-26 11:03:19 +02:00
Andreas Kling
e423bb4901 LibHTML: A tiny bit of work towards block layout. 2019-07-26 08:05:14 +02:00
Andreas Kling
fc9a1a1328 AK: Fix NonnullRefPtr<T>::operator=(NonnullRefPtr<U>). 2019-07-26 08:04:33 +02:00
Rhin
d6cd98cfa1 TextEditor: Fix nullptr refrence to save action & m_path (#364)
We forgot to persist our actions in the constructor for later reference, whoops.
Also use the correct path in the "open" action.
2019-07-26 06:48:39 +02:00
Andreas Kling
4316fa8123 Kernel: Dump backtrace to debugger for DefaultSignalAction::DumpCore.
This makes assertion failures generate backtraces again. Sorry to everyone
who suffered from the lack of backtraces lately. :^)

We share code with the /proc/PID/stack implementation. You can now get the
current backtrace for a Thread via Thread::backtrace(), and all the traces
for a Process via Process::backtrace().
2019-07-25 21:02:19 +02:00
Andreas Kling
a599317624 LibCore: Introduce a C_OBJECT macro.
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.
2019-07-25 19:49:28 +02:00
Andreas Kling
d21a4f7518 CEventLoop: Don't re-process already processed events when un-nesting.
If we had already processed a couple of queued events by the time we were
told to un-nest the event loop, we'd put the entire current batch at the
head of the outer queue. This meant that we might end up trying to process
the same events multiple times.

Let's not do that. :^)
2019-07-25 16:12:51 +02:00
Andreas Kling
3363426a6b Shell: Put failed command exit statuses in the debug output instead.
It was kinda unpleasant to always see "So-and-so exited with status 123."
2019-07-25 15:27:13 +02:00
Andreas Kling
a6b5bb439c LibC: Don't clobber errno in free().
This one is a bit mysterious. I can't find any authoritative answer on what
the correct behavior is, but it seems reasonable to me that free() doesn't
step on errno, since it returns "void" and thus the caller won't know to
inspect errno anyway.
2019-07-25 15:23:29 +02:00
Andreas Kling
3048e4b9f5 LibC: Make sure we always return the intended errno from execvpe(). 2019-07-25 15:21:50 +02:00
Andreas Kling
6ae95945aa AK: Add ScopedValueRollback::set_override_rollback_value().
This can be used if you change your mind about what value we should roll
back to. :^)
2019-07-25 15:21:16 +02:00
Andreas Kling
65c3101897 Lagom: Build with -fPIC for now. 2019-07-25 15:15:56 +02:00
Andreas Kling
9fb2a65716 AK: Rename ValueRestorer => ScopedValueRollback.
Qt had a pretty good name for this concept, so let's steal it. :^)
2019-07-25 15:15:46 +02:00
Andreas Kling
03b9f6b7f8 Lagom: Simplify the CMakeLists.txt a bit.
Now that everything in AK is buildable, we can just build all of it. :^)
2019-07-25 14:33:56 +02:00
Andreas Kling
1bd3fca585 AK: Shim open_with_path_length() for non-Serenity builds.
This is pretty ugly but I don't want to *not* use open_with_path_length()
so let's just shim it.
2019-07-25 14:25:45 +02:00
Andreas Kling
7c8debfe46 AK: Don't compile mmx_memcpy() outside of ARCH(I386). 2019-07-25 14:25:33 +02:00
Andreas Kling
67c8748162 Lagom: Add a tiny test program so we can see that something works. :^) 2019-07-25 13:50:39 +02:00
Andreas Kling
e4c9235c91 Lagom: Let's build liblagom as a static library. 2019-07-25 13:16:59 +02:00
Andreas Kling
6957976796 Lagom: Import the beginnings of a "port" of Serenity libs for the outside.
The C++ facilities of Serenity are getting pretty comfortable, and I'd like
to take them with me to projects outside the system.

Let's make it a bit easier to do that by bundling AK and LibCore (for now)
into a portable library called "Lagom". :^)
2019-07-25 12:02:08 +02:00
Andreas Kling
afc638c3ab AK: Allow NonnullRefPtr::ptr() when in "unknown" typestate.
Clang loses the typestate when passing NonnullRefPtr's via lambda captures.
This is unfortunate, but not much we can do about it. Allowing ptr() makes
it possible to use captured NonnullRefPtrs as you'd expect.
2019-07-25 11:51:24 +02:00
Andreas Kling
f46a1377ac CSocket: Add missing <sys/un.h> include to fix host build. 2019-07-25 11:49:08 +02:00
Andreas Kling
16bcaf08a3 CSocket: Fix Clang warning about unused private member m_type. 2019-07-25 11:48:21 +02:00
Andreas Kling
e940d4b07b LibCore: Only build CThread on Serenity platforms. 2019-07-25 11:47:53 +02:00
Andreas Kling
6a5446d6dd AK: Simplify NonnullPtrVector template a bit.
Add an "ElementType" typedef to NonnullOwnPtr and NonnullRefPtr to allow
clients to easily find the pointee type. Then use this to remove a template
argument from NonnullPtrVector. :^)
2019-07-25 11:10:28 +02:00
Andreas Kling
10d120dc85 AK: Share code between NonnullOwnPtrVector and NonnullRefPtrVector.
These can just inherit from a shared base template. Thanks to Robin for the
sweet idea :^)
2019-07-25 11:00:26 +02:00
Andreas Kling
7c3b2e0728 Shell: Simply print "cmd: Command not found." for ENOENT on execution.
This looks a little nicer than 'execvp(cmd): No such file or directory'
2019-07-25 07:05:38 +02:00
Andreas Kling
f186c018f1 LibC: Fix execvpe() exiting with bad errno when giving up.
This is still not perfect, but at least it fixes one such issue.
2019-07-25 07:05:05 +02:00
Andreas Kling
0846986cac LogStream: Preserve errno for the lifetime of a LogStream object. 2019-07-25 07:00:33 +02:00
Andreas Kling
1d0b464618 AK: Make HashMap::get(Key) return an Optional<Value>.
This allows HashMap::get() to be used for value types that cannot be default
constructed (e.g NonnullOwnPtr.)
2019-07-24 10:25:43 +02:00
Andreas Kling
e2798d6208 VisualBuilder: Convert Vector<OwnPtr> to NonnullOwnPtrVector. 2019-07-24 09:40:11 +02:00
Andreas Kling
31a2a6ca2d Terminal: Convert Vector<OwnPtr> to NonnullOwnPtrVector. 2019-07-24 09:36:58 +02:00
Andreas Kling
1686c4906b AK: Delete Vector::resize() from Nonnull{Own,Ref}PtrVector.
It's not possible to grow one of these vectors beyond what's already in them
since it's not possible to default-construct Nonnull{Own,Ref}Ptr.

Add Vector::shrink() which can be used when you want to shrink the Vector
and delete resize() from the specialized Vectors.
2019-07-24 09:33:26 +02:00
Andreas Kling
394168c0ca Kernel: Convert Vector<OwnPtr> to NonnullOwnPtrVector. 2019-07-24 09:15:33 +02:00
Andreas Kling
2196f17c10 LibGUI: Convert Vector<OwnPtr> to NonnullOwnPtrVector.
This is turning out really nice so far. :^)
2019-07-24 09:13:06 +02:00
Andreas Kling
90ea4918d6 WindowServer: Convert Vector<OwnPtr> to NonnullOwnPtrVector. 2019-07-24 09:04:57 +02:00
Andreas Kling
a635e62e6a AK: Add NonnullOwnPtrVector.
This works just like NonnullRefPtr, except for NonnullOwnPtr's instead.
NonnullOwnPtrVector<T> inherits from Vector<NonnullOwnPtr<T>>, and adds some
comforts on top, like making accessors return T& so we can chase dots (.)
instead of arrows (->) :^)
2019-07-24 08:49:44 +02:00
Andreas Kling
93489fbc4c Convert HashMap<Key, OwnPtr<T>> to HashMap<Key, NonnullOwnPtr<T>>.
In every case I found, we never wanted to support null entry values.
With NonnullOwnPtr, we can encode that at the type level. :^)
2019-07-24 08:42:55 +02:00