Commit graph

2045 commits

Author SHA1 Message Date
Andreas Kling
5eedb22834 Sprinkle use of AK::Vector in various places.
Some of these are less helpful than others. Avoiding a bunch of mallocs
in the event loop wakeup code is definitely nice.
2019-04-20 14:02:19 +02:00
Andreas Kling
7faf8fabf2 AK: Give Vector the ability to have an inline capacity.
This makes Vector malloc-free as long as you stay within the templated
inline capacity. :^)
2019-04-20 13:34:37 +02:00
Andreas Kling
6d4874cb2e LibC: Get rid of the now-unneeded AK/kmalloc.cpp 2019-04-20 13:00:25 +02:00
Andreas Kling
301a269ca0 Get rid of SERENITY macro since the compiler already defines __serenity__
This makes it a bit easier to use AK templates out-of-tree.
2019-04-20 12:58:49 +02:00
Andreas Kling
6aead8998a WindowServer: Fix minor header dependency issue. 2019-04-20 12:49:11 +02:00
Andreas Kling
405fe4f72c LibCore: Hide deferred_invoke() debug spam. 2019-04-20 12:48:49 +02:00
Andreas Kling
6ef8e2df5a Snake: Use a vegetable icon for the fruit. 2019-04-20 04:00:32 +02:00
Andreas Kling
09c087177c Snake: Clear the movement queue on game reset. 2019-04-20 03:47:35 +02:00
Andreas Kling
b41e95b578 Snake: Use a queue for the movement inputs.
This makes it a lot less finicky to make rapid moves like staircasing and
sudden turns.
2019-04-20 03:44:56 +02:00
Andreas Kling
e24e486714 Snake: Flesh out a basic snake game :^) 2019-04-20 03:24:50 +02:00
Andreas Kling
eca9494adf Snake: Import skeleton of a new snake game. 2019-04-20 01:54:10 +02:00
Andreas Kling
54af44e354 VisualBuilder: Expose some more widget properties. 2019-04-19 23:48:19 +02:00
Andreas Kling
986f5806d7 VisualBuilder: Emit on_widget_selected() when appropriate.
This allows the properties window to stay in sync with what's happening.
For multi-widget selections, we don't show any properties.
2019-04-19 23:09:38 +02:00
Andreas Kling
b64408a564 VisualBuilder: Make widget deletion work properly. 2019-04-19 22:52:13 +02:00
Andreas Kling
440700b4cb VisualBuilder: Multiple-widget selection support.
This is pretty damn nice, now I can move and resize entire groups of widgets
together. Diagonal group resizing feels a bit strange but I wasn't expecting
it not to. :^)
2019-04-19 22:46:16 +02:00
Andreas Kling
e001954193 AK: And one more RetainPtr::operator==() G++ complains about in LibGUI. 2019-04-19 21:36:11 +02:00
Andreas Kling
b985d0ec6e AK: Add RetainPtr::operator==() overload G++ is whining about. 2019-04-19 21:34:47 +02:00
Andreas Kling
77418c1942 LibGUI: Remove GListBox since it was not kept up-to-date.
I'll come back and add a GListView eventually, but this is not good enough.
2019-04-19 21:13:40 +02:00
Andreas Kling
b3f657a1c6 VisualBuilder: Expose GGroupBox name property. 2019-04-19 01:40:25 +02:00
Andreas Kling
62d347d12a VisualBuilder: Remove the separate property editor box in favor of inline.
Also make the property names show up in bold text. :^)
2019-04-19 01:16:57 +02:00
Andreas Kling
3a33b8ea08 VisualBuilder: Hook up everything needed for widget property editing.
It's now possible to edit widget properties inline in the properties window.
We're currently relying on the basic GVariant conversion functions to do
all the "parsing" but that's not gonna be good enough.
2019-04-19 01:05:59 +02:00
Andreas Kling
18785ba5c3 LibGUI: Move editing logic from GTableView up to GAbstractView.
GAbstractView should be able to manage the high-level editing logic, as long
as subclasses implement content_rect(GModelIndex) so we know where to put
the editing widgets. :^)
2019-04-19 00:07:33 +02:00
Andreas Kling
9cab7a0707 LibGUI: Move the editing widget along with the content when scrolling. 2019-04-18 23:57:07 +02:00
Andreas Kling
568f3125f3 GWidget: Always update self after a child is removed.
We could probably tighten the amount of invalidation we do here, but this is
definitely more correct than not invalidating at all.
2019-04-18 23:25:30 +02:00
Andreas Kling
cc9cefbd5f LibGUI: GWindow's focused widget should be a WeakPtr.
This fixes some very obvious use-after-free accesses.
2019-04-18 23:16:57 +02:00
Andreas Kling
9e6b0ccc0e LibCore+LibGUI: Make CObject child events synchronous.
...and then make GWidget layout invalidation lazy. This way we coalesce
multiple invalidations into a single relayout and we don't have to worry
about child widgets not being fully constructed.
2019-04-18 22:57:24 +02:00
Andreas Kling
0e6b273620 LibGUI: Start working on GTableView inline editing.
This is pretty shaky still, but the basic idea is that you subclass GModel
and return true for editable indices. The table view also needs to have its
editable flag set.
2019-04-18 22:27:14 +02:00
Andreas Kling
9ef06e2117 LibC: stddbg should be opened with O_CLOEXEC. 2019-04-18 22:20:01 +02:00
Andreas Kling
6f9df89c92 AK: MappedFile should open with O_CLOEXEC. 2019-04-18 22:19:42 +02:00
Andreas Kling
3c0afccca0 WindowServer: Improve the look of menu separators. 2019-04-18 19:58:25 +02:00
Andreas Kling
b88f2bc799 WindowServer: Broadcast window icons to newly joined WM listener clients. 2019-04-18 19:42:48 +02:00
Andreas Kling
3817f5f619 Kernel+LibC: Add a DebugLogDevice that forwards everything to I/O port 0xe9.
This is then used to implement the userspace dbgprintf() in a far more
efficient way than what we had before. :^)
2019-04-18 16:08:52 +02:00
Andreas Kling
3b986da643 CEventLoop: Don't call gettimeofday() at all if there are no timers. 2019-04-18 13:23:59 +02:00
Andreas Kling
ae3ec3fc37 LibGUI: Give GTextEditor a context menu.
Now GTextEditor manages its own editing actions (cut/copy/paste/etc) and
will show a context menu containing them when requested.

Apps that want to put a GTextEditor's actions in its menu can get to the
actions via public getters. :^)
2019-04-18 12:28:29 +02:00
Andreas Kling
67d7fc94fc ProcessManager: Do a little less malloc() in the /proc/memstats parsing. 2019-04-18 04:48:53 +02:00
Andreas Kling
ac19fabaaf ProcessManager: Use a single timer for refreshing the view.
Also add a menu for changing the update frequency to some nice values.
2019-04-18 04:38:31 +02:00
Andreas Kling
d73ed74d1c LibCore: Add CTimer::restart() and make set_interval() take effect soon. 2019-04-18 04:38:04 +02:00
Andreas Kling
a747a10eab LibGUI: Refactor context menus to be event-driven instead of declarative.
The declarative approach had way too many limitations. This patch adds a
context menu event that can be hooked to prepare a custom context menu on
demand just-in-time. :^)
2019-04-18 04:12:27 +02:00
Andreas Kling
e74b5bc054 ProcessManager+WindowServer: Do a little less malloc() in CPU monitor code. 2019-04-18 03:37:01 +02:00
Andreas Kling
36a6c10b09 FontEditor: Add a window icon. 2019-04-18 02:30:35 +02:00
Andreas Kling
c7d6e568ba WindowServer: Tweak window icon placement again. 2019-04-18 02:11:44 +02:00
Andreas Kling
7b3876383f LibCore: CIODevice::seek() should reset EOF state. 2019-04-18 02:09:15 +02:00
Andreas Kling
f6b4013329 WindowServer: Make window title bars slightly thicker. :^) 2019-04-18 01:45:52 +02:00
Andreas Kling
8e0611201e CEventLoop: Consolidate gettimeofday() syscalls. 2019-04-18 01:37:23 +02:00
Andreas Kling
ab539460de ProcessManager: Use a CFile for parsing /proc/memstat. 2019-04-18 00:57:34 +02:00
Andreas Kling
c931eaa22c WindowServer: Generate a separate WM event for window icon changes. 2019-04-18 00:39:11 +02:00
Andreas Kling
c4c7f224d5 WindowServer: Use CFile in the CPU monitor code. 2019-04-18 00:12:04 +02:00
Andreas Kling
34087a9f90 LibC: Bring the C library close enough to newlib to trick GCC.
Now we can build GCC with --with-newlib, which hopefully cuts down on weird
toolchain build issues.
2019-04-17 23:16:16 +02:00
Andreas Kling
c02c6fef28 Kernel+ProcessManager: Show per-process syscall counts.
Added a simple syscall counter to the /proc/all contents. :^)
2019-04-17 23:16:14 +02:00
Andreas Kling
c59f8cd663 Kernel: Scheduler donations need to verify that the beneficiary is valid.
Add a Thread::is_thread(void*) helper that we can use to check that the
incoming donation beneficiary is a valid thread. The O(n) here is a bit sad
and we should eventually rethink the process/thread table data structures.
2019-04-17 12:41:51 +02:00