summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-07-24LibGUI: Convert Vector<OwnPtr> to NonnullOwnPtrVector.Andreas Kling
This is turning out really nice so far. :^)
2019-07-24WindowServer: Convert Vector<OwnPtr> to NonnullOwnPtrVector.Andreas Kling
2019-07-24AK: Add NonnullOwnPtrVector.Andreas Kling
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-24Convert HashMap<Key, OwnPtr<T>> to HashMap<Key, NonnullOwnPtr<T>>.Andreas Kling
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-24CEventLoop: Use NonnullOwnPtr for QueuedEvent::event.Andreas Kling
We don't allow null events in the event queue. :^)
2019-07-24AK: Add NonnullOwnPtr.Andreas Kling
This is just like OwnPtr (also single-owner), except it cannot be null. NonnullOwnPtr is perfect as the return type of functions that never need to return nullptr. It's also useful as an argument type to encode the fact that the argument must not be nullptr. The make<Foo>() helper is changed to return NonnullOwnPtr<Foo>. Note: You can move() out of a NonnullOwnPtr, and after that the object is in an invalid state. Internally it will be a nullptr at this point, so we'll still catch misuse, but the only thing that should be done in this state is running the destructor. I've used consumable annotations to generate some warnings when using a NonnullOwnPtr after moving from it, but these only work when compiling with clang, so be aware of that.
2019-07-24AK: Move clang-specific consumable annotation helpers to Platform.hAndreas Kling
2019-07-24LibHTML: Fetch the box edge values needed for block width computation.Andreas Kling
2019-07-24LibHTML: Fix host build.Andreas Kling
2019-07-24AK: Add Optional::value_or(T).Andreas Kling
This is like value() but with a fallback in case there's no value set.
2019-07-24TextEditor: Add "Save as..." action.Andreas Kling
Add a basic "save as" action to the TextEditor app, and make "save" fall back to using "save as" if there's no name already set. Fixes #282.
2019-07-24Kernel: Simplify PhysicalPage construction.Andreas Kling
There was some leftover cruft from the times when PhysicalPage was allocated using different allocators depending on lifetime.
2019-07-23LibGUI: Destroy tooltip windows when they are not used.Andreas Kling
Cached tooltip windows were preventing the automatic event loop shutdown. It's not like we were gaining much by caching these anyway, since we only cached the GWindow, not anything on the WindowServer side.
2019-07-23LibGUI: Get rid of GWindow::should_exit_event_loop_on_close().Andreas Kling
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.
2019-07-23LibGUI: Exit the main event loop when the last window is deleted.Andreas Kling
This behavior is the new opt-out default. If you don't want your app to exit when the last GWindow is destroyed, call this: - void GApplication::set_quit_set_quit_when_last_window_deleted(bool) Also renamed "windows()" to "reified_windows" in GWindow.cpp to reflect that it only contains GWindows that have a server-side representation. :^)
2019-07-23LibDraw: Add LogStream operator<< overload for Color.Andreas Kling
2019-07-23CEventLoop: Avoid undefined evaluation order in register_timer().Andreas Kling
2019-07-23Piano: Exit the event loop on main window close.Andreas Kling
2019-07-23PaintBrush: Exit the event loop on main window close.Andreas Kling
2019-07-22GDirectoryModel: Don't forget to drain the watch descriptor.Andreas Kling
2019-07-22GDirectoryModel: Automagically update on filesystem changes.Andreas Kling
Use the new watch_file() mechanism to monitor the currently open directory for changes and refresh the model when notified. This makes FileManager automagically show newly added files. :^)
2019-07-22Kernel: Add a mechanism for listening for changes to an inode.Andreas Kling
The syscall is quite simple: int watch_file(const char* path, int path_length); It returns a file descriptor referring to a "InodeWatcher" object in the kernel. It becomes readable whenever something changes about the inode. Currently this is implemented by hooking the "metadata dirty bit" in Inode which isn't perfect, but it's a start. :^)
2019-07-22DevPtsFS: Use String::number() in a place where it makes sense.Andreas Kling
2019-07-22Move runnable/non-runnable list control entirely over to SchedulerRobin Burchell
This way, we can change how the scheduler works without having to change Thread too.
2019-07-22Toolchain: Oops, we can't rely on "install.sh" to build LibC/LibM.Andreas Kling
When we used "make install" in the past, the "install" target would pull in the library targets as dependencies, and everything got built that way. Now that we use "install.sh" instead, we have to build things manually.
2019-07-21Toolchain: Use "install.sh" to install LibC and LibM.Andreas Kling
2019-07-21AK: Remove unused Vector::shift_left().Andreas Kling
I was using this for a makeshift queue, but now there is AK::Queue.
2019-07-21Kernel+LibC: Add a dbgputstr() syscall for sending strings to debug output.Andreas Kling
This is very handy for the DebugLogStream implementation, among others. :^)
2019-07-21Libraries: Fix wrong paths to "Root" in the various install.sh scripts.Andreas Kling
We were installing libraries into /Libraries/Root, rather than in /Root. This made the ports system behave rather unpredictable, since I had old versions of things in /Root and new versions of things in /Libraries/Root.
2019-07-21Libraries: Remove unused "install" targets.Andreas Kling
We've been using a per-directory "install.sh" for some time, so let's get rid of the old way of doing things.
2019-07-21Kernel: Remove bitrotted "spawn stress" code.Andreas Kling
This was something I used during early kernel development to spam creation of new processes to see if the kernel could handle it.
2019-07-21Kernel+LibC: Add a dbgputch() syscall and use it for userspace dbgprintf().Andreas Kling
The "stddbg" stream was a cute idea but we never ended up using it in practice, so let's simplify this and implement userspace dbgprintf() on top of a simple dbgputch() syscall instead. This makes debugging LibC startup a little bit easier. :^)
2019-07-21Ports: Add GNU make 4.2! :^)Andreas Kling
2019-07-21AK: Run host tests on makeRobin Burchell
Restructure the makefile a little so it only builds objects once, and then run them on make clean. This is a little slower (since we're relinking tests each makeall), but it also ensures that it will work.
2019-07-21Ext2FS: Put most debug logging behind EXT2_DEBUG.Andreas Kling
The debug output was basically dominated by Ext2FS spam.
2019-07-21Userspace: Deal with select() returning EINTR on a signal interruptionRobin Burchell
Add a trivial CSafeSyscall template that calls a callback until it stops returning EINTR, and use it everywhere we use select() now. Thanks to Andreas for the suggestion of using a template parameter for the syscall function to invoke.
2019-07-21Process: Fix select/poll EINTRRobin Burchell
Check for EINTR before doing anything with the passed sets, otherwise we zero them out which means a re-call with the same sets won't work.
2019-07-21AK: Fix off-by-one in Vector::prepend(Vector&&).Andreas Kling
Caught by valgrind's uninitialized access checks on the Vector unit test. Yay for finding bugs with valgrind on the unit tests! :^)
2019-07-21AK: Make NonnullRefPtr::operator=(NonnullRefPtr<U>&&) cast incoming pointer.Andreas Kling
Same as the RefPtr issue I just fixed. This makes it possible to assign a NonnullRefPtr<Derived>&& to a NonnullRefPtr<Base>.
2019-07-21Scheduler: Allow reentry into block()Robin Burchell
With the presence of signal handlers, it is possible that a thread might be blocked multiple times. Picture for instance a signal handler using read(), or wait() while the thread is already blocked elsewhere before the handler is invoked. To fix this, we turn m_blocker into a chain of handlers. Each block() call now prepends to the list, and unblocking will only consider the most recent (first) blocker in the chain. Fixes #309
2019-07-21TestSuite: Don't leak the suite instanceRobin Burchell
Makes checking for leaks more straightforward
2019-07-21TestSuite: instance() -> the(), and return a referenceRobin Burchell
To be more consistent with the rest of the codebase
2019-07-21AK: RefPtr::operator=(RefPtr<U>&&) needs to cast the incoming pointer.Andreas Kling
Otherwise it's not possible to assign a RefPtr<Derived>&& to a RefPtr<Base>.
2019-07-21AK: Add a unit test for Vector::prepend(Vector&&) with complex T.Andreas Kling
It's good to verify that complex objects can be moved nicely by Vector.
2019-07-21AK: Add some basic unit tests for WeakPtr.Andreas Kling
2019-07-21TestSuite: Make tests actually run (oops!)Andreas Kling
We were not actually running any of the unit tests, only getting a pointer to them. Thankfully they all pass, even after we start running them. :^)
2019-07-21WindowServer: Disable the global menubar while a modal window is active.Andreas Kling
This makes it much harder to screw with an application while it's showing a modal window, and matches what some other systems are doing. :^)
2019-07-21CEventLoop: Skip over null events in the queue.Andreas Kling
Added some FIXME's about correctness issues in nested event loop exiting.
2019-07-21Kernel+LibC: Add a dump_backtrace() syscall.Andreas Kling
This is very simple but already very useful. Now you're able to call to dump_backtrace() from anywhere userspace to get a nice symbolicated backtrace in the debugger output. :^)
2019-07-21ls: Don't print an empty line if there were no files to show.Andreas Kling
Fixes #352.