Commit graph

3037 commits

Author SHA1 Message Date
Andreas Kling
9ca453d8c9 LibHTML: LayoutDocument should call LayoutBlock parent constructor. 2019-07-01 08:01:30 +02:00
Andreas Kling
7a9d5e2a69 LibHTML: Let's not support CSS shorthand properties right away.
This will simplify style building right now, and we can come back later
and implement shorthand expansion.
2019-07-01 07:33:21 +02:00
Andreas Kling
22fec1a250 LibHTML: Start fleshing out block layout.
The basic idea of block layout is: width, then children based on width,
then height based on height of children.
2019-07-01 07:31:04 +02:00
Andreas Kling
f1a0e8b8e6 LibHTML: The document node should have a LayoutDocument representative.
This will be a special LayoutBlock that provides the ICB dimensions based
on the containing frame.
2019-07-01 07:27:17 +02:00
Andreas Kling
0bfa864021 LibC: Fix -Werror build in new strtol(). 2019-07-01 06:37:36 +02:00
Christopher Dumas
df34de369b LibC: New implementation of strtol (NIH) (#263)
Fixes #189.
2019-07-01 06:07:10 +02:00
Andreas Kling
c70fbca23a QuickShow: Make the window background black for a nicer contrast. 2019-06-30 17:22:12 +02:00
Andreas Kling
575acfac98 WindowServer: Add a separator before "close" in window menus. 2019-06-30 15:59:11 +02:00
Andreas Kling
1fa467a424 Launcher: Tighten up the widget layout a bit. 2019-06-30 15:58:53 +02:00
Andreas Kling
daf44d5ec5 Terminal: Unbreak single-line text selection. 2019-06-30 15:11:56 +02:00
Andreas Kling
f6498bb0e9 Kernel: Make more crash info show up in dmesg.
kprintf() shows up in dmesg, dbgprintf() does not.
2019-06-30 15:02:23 +02:00
Andreas Kling
038f99eeff QuickShow: When zooming with the mouse wheel, keep image centered at cursor. 2019-06-30 15:01:35 +02:00
Andreas Kling
e7ce4514ec Kernel: Disable interrupts in Thread::set_state().
We don't want to get interrupted while we're manipulating the thread lists.
2019-06-30 11:42:27 +02:00
VAN BOSSUYT Nicolas
802d4dcb6b Meta: Removed all gitignore in the source tree only keeping the root one 2019-06-30 10:41:26 +02:00
Andreas Kling
29bd0d9f90 Meta: Tweak ReadMe. 2019-06-30 10:11:13 +02:00
Andreas Kling
0a44837738 PaintBrush: Make a little icon for the eraser tool. 2019-06-30 09:40:15 +02:00
Andreas Kling
77dc11f481 ProcessManager: Add app icon. 2019-06-30 09:31:47 +02:00
Andreas Kling
0299cf5b02 PaintBrush: Make app icon transparent. 2019-06-30 09:26:00 +02:00
Andreas Kling
315716d193 GUI: Use Win2K-like "warm gray" color instead of the older colder gray.
Someone suggested this a long time ago and I never got around to it.
So here we go, here's the warm gray! I have to admit I like it better. :^)
2019-06-30 09:23:16 +02:00
Andreas Kling
73d0e7cd8f Userland: Add a simple JSON pretty-printing utility called /bin/jp 2019-06-30 09:11:04 +02:00
Andreas Kling
9962cb7291 ProcessManager: Add process-specific context menus to the main table view. 2019-06-30 08:15:55 +02:00
Andreas Kling
b8ef5b5804 GTableView: Support per-index context menus.
This patch adds an on_context_menu_request hook to GAbstractView which is
currently only invoked by GTableView. We also pass along the entire context
menu event, so that anyone using the hook can use it for menu placement etc.
2019-06-30 08:15:55 +02:00
Rhin
ce0b615bef Userland: Fixed "id" usage error typo (#254) 2019-06-30 07:36:14 +02:00
Andreas Kling
806b91b444 PaintBrush: Add a simple app icon.
I ended up drawing four crayons for the app icon. This is not a great fit
for the app name. But uh, we'll figure this out somehow. :^)
2019-06-29 22:32:34 +02:00
Rhin
1d39310d01 Userland: Added flags to id command (#253)
Fixes #158.
2019-06-29 21:47:38 +02:00
Andreas Kling
7eef69ad4b LibHTML: Refactor to go from DOM -> styled tree -> layout tree.
Frame::layout() drives everything now, it takes the DOM contained in the
frame and puts it through the tree transformations.
2019-06-29 21:42:07 +02:00
Andreas Kling
6e95b11395 AK: Allow HashMap to be used with non-default-constructible values.
Solve this by adding find() overloads to HashTable and SinglyLinkedList
that take a templated functor for comparing the values.

This allows HashMap to call HashTable::find() without having to create
a temporary Entry for use as the table key. :^)
2019-06-29 21:09:40 +02:00
Andreas Kling
d5bb98acbc AK: Defer to Traits<T> for equality comparison in container templates.
This is prep work for supporting HashMap with NonnullRefPtr<T> as values.
It's currently not possible because many HashTable functions require being
able to default-construct the value type.
2019-06-29 19:14:03 +02:00
Andreas Kling
9a7dc06567 LibHTML: Add Selector::specificity(), which returns a Specificity object. 2019-06-29 17:32:32 +02:00
Andreas Kling
b729b5fc64 VisualBuilder: Support loading a saved form from JSON.
The form to load is specified on the command line, e.g "vb test.frm".
2019-06-29 12:07:46 +02:00
Andreas Kling
57a589a6e7 LibGUI: Make it easy to construct a GVariant from a JsonValue. 2019-06-29 12:07:46 +02:00
Andreas Kling
2735ff4687 ProcFS: Remove unused StringBuilder in procfs$all(). 2019-06-29 12:07:46 +02:00
Andreas Kling
293946c960 JsonValue: Add is_bool() and various as_foo() helpers. 2019-06-29 12:07:46 +02:00
Andreas Kling
7f224ade60 JsonValue: No need to null-check StringImpls if type is Type::String.
If you try to create a JsonValue from a null String(), it will become a
null JsonValue anyway.
2019-06-29 12:07:46 +02:00
Andreas Kling
50677a58d4 StringView: Make it easy to construct from a ByteBuffer. 2019-06-29 12:07:46 +02:00
Andreas Kling
53479f9356 HashTable: Don't use move assignment in set(const T&). 2019-06-29 12:07:46 +02:00
Andreas Kling
b1d113e32a AK: Make a tiny JSON unit test based on a saved VisualBuilder form. 2019-06-29 12:07:42 +02:00
Andreas Kling
c9826bb429 LibCore: Port CProcessStatisticsReader to the JSON formatted /proc/all. 2019-06-29 10:12:40 +02:00
Andreas Kling
14b51253c0 WindowServer: Allow changing window opacity with Logo+MouseWheel.
This is just a silly little feature that I thought was a bit neat. :^)
2019-06-29 09:27:55 +02:00
Andreas Kling
2bd8118843 Kernel: Change the format of /proc/all to JSON.
Update ProcessManager, top and WSCPUMonitor to handle the new format.

Since the kernel is not allowed to use floating-point math, we now compile
the JSON classes in AK without JsonValue::Type::Double support.
To accomodate large unsigned ints, I added a JsonValue::Type::UnsignedInt.
2019-06-29 09:04:45 +02:00
Andreas Kling
561bfd3ed6 Terminal: Make it so typing resets the cursor blink timer.
Patch contributed by "pd"
2019-06-28 21:46:23 +02:00
Andreas Kling
96ca8bea6c Terminal: Don't write erroneous characters to PTY when modifiers pressed.
Additionally the Alt modifier now generates the correct characters, as do
Insert/Delete/PgUp/PgDown.

Patch contributed by "pd"
2019-06-28 21:46:05 +02:00
Andreas Kling
274b41e47c Terminal: Changex internal opacity representation to byte instead of float.
This lets us avoid some math during paint events.
Patch contributed by "pd"
2019-06-28 21:42:15 +02:00
Andreas Kling
ffcbe8f0de LibHTML: Start building the style tree.
Walk the DOM and construct a parallel style tree that points back to the DOM
and has the relevant CSS property values hanging off of them.

The values are picked based on naive selector matching. There's no cascade
or specificity taken into account yet.
2019-06-28 21:25:44 +02:00
Andreas Kling
3af59dfed1 AK: We can't use std::initializer_list in LibC builds.
The LibC build is a bit complicated, since the toolchain depends on it.
During the toolchain bootstrap, after we've built parts of GCC, we have
to stop and build Serenity's LibC, so that the rest of GCC can use it.

This means that during that specific LibC build, we don't yet have access
to things like std::initializer_list.

For now we solve this by defining SERENITY_LIBC_BUILD during the LibC
build and excluding the Vector/initializer_list support inside LibC.
2019-06-28 20:58:41 +02:00
Andreas Kling
872cccb8f7 WindowServer: Make use of the new Vector(initializer_list). 2019-06-28 20:21:28 +02:00
Andreas Kling
4c285f9e1a AK: Add Vector(std::initializer_list<T>) constructor.
This allows us to construct a Vector from an initializer list like so:

Vector<Object> objects = { object1, object2, object3 };
2019-06-28 20:21:23 +02:00
Robin Burchell
933cd3848f PaintBrush: Add size context menu to SprayTool 2019-06-28 15:27:23 +02:00
Robin Burchell
24ada6bd1f PaintBrush: Add an erase tool 2019-06-28 15:27:23 +02:00
Andreas Kling
e971f5604c LibHTML: Implement some very simple selector matching.
We walk the entire DOM and check all selectors against all elements. Only
id, class and tag name are checked right now. There's no ancestor stack
or compound selectors. All in good time :^)
2019-06-27 20:40:21 +02:00