Commit graph

19907 commits

Author SHA1 Message Date
Brendan Coles
57c96ce501 UserspaceEmulator: Allow running executables not in PATH 2021-05-09 09:39:40 +02:00
Dylan Katz
3ab37674c6 TextEditor: Add support for SQL highlighting 2021-05-09 09:39:05 +02:00
Dylan Katz
984b6e08cf LibSQL: Add a syntax highlighter 2021-05-09 09:39:05 +02:00
Andreas Kling
5423aba4ef Meta: Fix broken FAQ link in README 2021-05-09 09:15:56 +02:00
Andreas Kling
9d8aa2a57a Taskbar+LibGUI+WindowServer: Shrink taskbar by one pixel
Make the taskbar 27 pixels tall instead of 28. This makes the button
icons and applets vertically centered.

On a related note, this required touching *way* too many places..
2021-05-09 00:11:37 +02:00
Andreas Kling
fbe6c275c9 LibGUI: Clear GUI::TextEditor selection before performing undo/redo
Fixes #6972.
2021-05-08 23:38:46 +02:00
Andreas Kling
194a90884c LibGUI: Remove now-unused undo coalescing timer from GUI::TextEditor
This is no longer used since commands handle merging themselves.
2021-05-08 22:17:51 +02:00
Andreas Kling
ce90d87eb6 LibGUI: Show command name in GUI::TextEditor undo/redo action text
We can now show things like "Undo Insert Text" and "Redo Remove Text"
instead of just "Undo" and "Redo" in menu items. Pretty neat! :^)
2021-05-08 22:17:51 +02:00
Andreas Kling
c670d8c56d LibGUI: Add UndoStack::{undo,redo}_action_text()
These return the action_text() for the current undo and redo commands,
if available.
2021-05-08 22:17:51 +02:00
Andreas Kling
0bfbee4596 LibGUI: Make Command::action_text() virtual
It will be easier for some commands to generate an action text on the
fly instead of having to think of it up front, so a virtual that you
can override seems more convenient here.
2021-05-08 22:17:51 +02:00
Andreas Kling
bfd2ec88f4 LibGUI: Make Action::set_text() update any associated menu items
Now you can change the text of an action and it will actually show
up in the menu. :^)
2021-05-08 22:17:51 +02:00
Andreas Kling
161568103e LibGUI: Remove UndoStack's automatic command combo'ing
UndoStack will now merge adjacent commands *if they want to be merged*
instead of bundling everything you push onto it until you tell it
to "finalize the combo."

This uses less memory and gives applications full control over how
their undo stacks end up. :^)
2021-05-08 22:17:51 +02:00
Andreas Kling
81bc861085 LibGUI: Implement merging of TextDocument's RemoveTextCommand
When deleting text by pressing backspace, the commands will be merged
into a single RemoveTextCommand.
2021-05-08 22:17:51 +02:00
Andreas Kling
ff6bac4854 LibGUI: Implement merging of TextDocument's InsertTextCommand
When performing multiple text insertions in a row, they will now
be merged into a single InsertTextCommand.
2021-05-08 22:17:51 +02:00
Andreas Kling
ff912946ae LibGUI: Support merging of adjacent commands on the UndoStack
When pushing a new command on an undo stack, we will now attempt to
merge it into the stack's current command.

Merging is implemented by overriding the "merge_with(Command const&)"
virtual on GUI::Command. :^)
2021-05-08 22:17:50 +02:00
Andreas Kling
244665d99c LibGUI: Some tweaks for TextEditor's will-execute-command virtual
Renamed the virtual from "on_edit_action" to "will_execute" so it
doesn't clash with our convention for Function hook names.

Also tighten the parameter type to GUI::TextDocumentUndoCommand
since that's the only kind of command it will receive.
2021-05-08 22:17:50 +02:00
Andreas Kling
aaa96e909b LibGUI: Don't fire TextDocument change notification after each command
The undo stack has its own notification mechanism now, and we no longer
piggyback on the document change notifications.
2021-05-08 22:17:50 +02:00
Ali Mohammad Pur
50cb80649f LibWasm: Implement parsing all remaining instructions
With this, we can parse a module at least as simple as the following C
code would generate:
```c
int add(int x, int y) {
    if (x > y)
        return x + y;
    return y - x; // Haha goteeem
}
```
2021-05-08 22:14:39 +02:00
Ali Mohammad Pur
426878c884 LibWasm: Add some more descriptive parse errors
It's much better to tell the user "hey, the magic numbers don't check
out" than "oh there was a problem with your input" :P
Also refactors some stuff to make it possible to efficiently use the
parser error enum without it getting in the way.
2021-05-08 22:14:39 +02:00
Ali Mohammad Pur
aa4d8d26b9 LibWasm: Start implementing a basic WebAssembly binary format parser
This can currently parse a really simple module.
Note that it cannot parse the DataCount section, and it's still missing
almost all of the instructions.
This commit also adds a 'wasm' test utility that tries to parse a given
webassembly binary file.
It currently does nothing but exit when the parse fails, but it's a
start :^)
2021-05-08 22:14:39 +02:00
Ali Mohammad Pur
56a6d7924e AK: Let Result<T, E> know its Value and Error types
It's much easier to ask for T::ValueType than for
RemoveReference<decltype(declval<T>().release_value())>
2021-05-08 22:14:39 +02:00
Ali Mohammad Pur
62af7c4bdf AK+LibCpp: Remove DEBUG_SPAM in favour of per-application defines
What happens if one file defines DEBUG_SPAM, and another doesn't,
then we link them together and get ODR violations? -- @ADKaster
2021-05-08 22:14:39 +02:00
Ali Mohammad Pur
080f2c0e3e AK: Add an optional 'extra' descriptive field to ScopeLogger
Often it's easier to know what the functions are doing with a unique
name next to the function's name :)
2021-05-08 22:14:39 +02:00
Gunnar Beutner
d301bd6732 Ports: Fix building icu
LC_MESSAGES was recently added in LibC which makes the hack in the
package.sh script unnecessary. In fact, this breaks building the
port now.
2021-05-08 20:48:23 +02:00
Mart G
e0deb46723 Kernel: Traverse ext2 directories blockwise.
Instead of reading in the entire contents of a directory into a large
buffer, we can iterate block by block. This only requires a small
buffer.

Because directory entries are guaranteed to never span multiple blocks
we do not have to handle any edge cases related to that.
2021-05-08 20:01:08 +02:00
Liav A
49b132a92d Kernel/ACPI: Map two pages when reading the FADT
On some cases, the FADT could be on the end of a page, so if we don't
have two pages being mapped, we could easily read from a non-mapped
virtual address, which will trigger the UB sanitizer.

Also, we need to treat the FADT structure as volatile and const, as it
may change at any time, but we should not touch (write) it anyhow.
2021-05-08 19:15:54 +02:00
Liav A
f7b5352af0 Kernel/HID: Don't assume that ACPI is initialized 2021-05-08 19:15:54 +02:00
Gunnar Beutner
b05a6a1701 Ports: Add port for gettext 2021-05-08 19:14:21 +02:00
Gunnar Beutner
1c3c072a76 LibC: Add stubs for getrlimit()/setrlimit() 2021-05-08 19:14:21 +02:00
Gunnar Beutner
6e80b9fd01 LibPthread: Add implementation for pthread_mutexattr_gettype 2021-05-08 19:14:21 +02:00
Gunnar Beutner
7fea58c4f1 LibC: Add definition for LC_MESSAGES 2021-05-08 19:14:21 +02:00
Gunnar Beutner
fc2ddd5843 Ports: Build shared libraries for ffmpeg 2021-05-08 19:14:09 +02:00
Gunnar Beutner
be724f184b Ports: Link libtiff against libjpeg
Apparently libtiff uses symbols from libjpeg when that port was
previously built.
2021-05-08 19:14:09 +02:00
Gunnar Beutner
611019e938 Ports: Add port for harfbuzz 2021-05-08 19:13:42 +02:00
Gunnar Beutner
2f3ded4dfd Ports: Add port for libsodium 2021-05-08 18:12:01 +02:00
Gunnar Beutner
5093b76f85 Ports: Add port for libphysfs 2021-05-08 18:11:52 +02:00
Gunnar Beutner
6afb6eb6a9 LibC: Add definition for EDQUOT
This is used by the libphysfs port.
2021-05-08 18:11:52 +02:00
Itamar
8a01167c7d AK: Add missing GenericTraits<NonnullRefPtr>
This enables us to use keys of type NonnullRefPtr in HashMaps and
HashTables.

This commit also includes fixes in various places that used
HashMap<T, NonnullRefPtr<U>>::get() and expected to get an
Optional<NonnullRefPtr<U>> and now get an Optional<U*>.
2021-05-08 18:10:56 +02:00
Itamar
1da0d402b7 AK: Add constructors to Optional that accept non const qualified inputs 2021-05-08 18:10:56 +02:00
Itamar
484823e9d5 AK: Add a non-const overload to HapMap::get()
Additionally, the const version of get() returns Optional<ConstPeekType>
for smart pointers.

For example, if the value in the HashMap is OwnPtr<u32>,
HashMap::get() const returns Optional<const u32*>.
2021-05-08 18:10:56 +02:00
Itamar
b816bd0806 AK: Add ConstPeekType to Traits
Also, the PeekType of smart pointers is now T* instead of const T*.

Note: This commit doesn't compile, it breaks HashMap::get() for some
types. Fixed in the next commit.
2021-05-08 18:10:56 +02:00
Itamar
77d462426b HackStudio: Remove redundant insertion to m_open_files
previous_open_project_file already exists in m_open_files under the
active_file() key.
2021-05-08 18:10:56 +02:00
Mart G
25a5e59f79 Kernel: Place ext2 dir entries so they don't span multiple blocks
Ext2 dir entries spanning multiple blocks are not allowed.
If they do occur they are flagged as corrupt by e2fsck for example.
2021-05-08 15:25:50 +02:00
r-paiva
293a5c2b49 Kernel-VFS: Fixed kernel crash if parent custody is null
In VFS::rename, if new_path is equal to '/', then, parent custody is
set to null.
VFS::rename would then use parent custody without checking it first.

Fixed VFS::rename to check both old and new path parent custody
before actually using them.
2021-05-08 15:22:47 +02:00
r-paiva
90b6f999e5 Utilities: Fix mv command requesting incorrect path
When moving multiple files by using *, e.g.,: mv * /new_path/
If there was an error while trying to move a file to the new path
the next file in the file list to be moved would have its path
incorrectly set.

- Fixed mv loop to always append the correct path to the destination
path.
- Added proper error message when mv fails.
2021-05-08 15:22:47 +02:00
Brendan Coles
2fe6242f15 Themes: Faux Pas: Set RubberBandFill transparency 2021-05-08 14:08:14 +01:00
Maciej Zygmanowski
ece300e1e3 LibGUI: Add missing <AK/Function.h> include 2021-05-08 13:19:24 +01:00
Andreas Kling
2905e10513 LibGUI+TextEditor: Make TextDocument modified state track undo stack
This was quite unreliable before. Changes to the undo stack's modified
state are now reflected in the document's modified state, and the
GUI::TextEditor widget has its undo/redo actions updated automatically.

UndoStack is still a bit hard to understand due to the lazy coalescing
of commands, and that's something we should improve upon (e.g with more
explicit, incremental command merging.) But for now, this is a nice
improvement and undo/redo finally behaves in a way that feels natural.
2021-05-08 13:49:34 +02:00
Andreas Kling
ee19f7c0aa LibGUI: Use UndoStack::on_state_change inside TextDocument/TextEditor
Have TextDocument listen for state changes on the internal undo stack,
and forward those to all clients via a new virtual function.

This simplifies updating the can_undo / can_redo states of TextEditor.
2021-05-08 13:49:34 +02:00
Andreas Kling
0cb6103928 LibGUI: Add UndoStack::on_state_change hook
This will allow clients to react to the undo stack changing state.
It's invoked when the stack or clean index are changed.
2021-05-08 13:49:34 +02:00