Commit graph

19867 commits

Author SHA1 Message Date
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
Andreas Kling
74a4571f02 LibGUI: Reverse internal direction of GUI::UndoStack
The undo stack was very difficult to understand as it grew by adding
new undo commands to the front of the internal vector. This meant we
had to keep updating indices as the stack grew and shrank.

This patch makes the internal vector grow by appending instead.
2021-05-08 13:49:34 +02:00
Andreas Kling
2ef4fbc5c1 Revert "LibGUI: Fix undo stack reporting wrong modified state"
This reverts commit 0b7e19e2bb.

Let's reverse the direction of the undo stack to fix the confusion.
2021-05-08 13:48:15 +02:00
Brendan Coles
29e323269c Themes: Faux Pas: Set HoverHighlight to white 2021-05-08 12:28:48 +01:00
Linus Groh
5468a23fc2 Base: Fix path to LibJS tests in test-js(1) man page 2021-05-08 12:04:55 +01:00
Brendan Coles
dbb88d7dd4 Themes: Add Light theme 2021-05-08 11:13:03 +01:00
Linus Groh
67b47013d2 LibWeb: Use list-style-type circle/square for nested unordered lists
An idea shamelessly stolen from other UAs :^)
2021-05-08 10:49:16 +01:00
Linus Groh
dfa546702a Utilities/CMakeLists: Put all entries in alphabetical order 2021-05-08 10:07:11 +01:00
bleusakura
87de32df59
dd: Add ability to use k, M, & G suffixes for block sizes 2021-05-08 10:03:31 +01:00
Carlos César Neves Enumo
0b7e19e2bb LibGUI: Fix undo stack reporting wrong modified state
Since the `redo` action never goes back to `index: 0`,
we have to mark the clean index as being the current
non-empty index for the undo/redo navigation to work properly.

The problem is that if we never `undo`, the stack index stays at zero,
which is the empty container waiting for commands. In that situation,
if we save the document, it registers the clean index as being 1
(the non-empty index) but because the stack index has never left zero,
the document was being reported as modified, being out of sync with
the window modified state.
2021-05-08 09:55:45 +01:00
Ali Mohammad Pur
3c01de4f0b Utilities/CMakeLists: Put 'file' entry in alphabetical order 2021-05-08 10:54:29 +02:00
Jesse Buhagiar
e8cd89a538 LibGL: Move polygon clipping to Clipper class
This code has also been optimised to be much more memory
friendly by removing a _lot_ of extraneous copies. The result
is that, when profiled, it's around 8x faster than the previous
implementation.

Co-Authored-By: Ali Mohammad Pur <ali.mpfard@gmail.com>
2021-05-08 10:13:22 +02:00
Jesse Buhagiar
834f3c64f0 Demos: Add OpenGL teapot demo :^)
Every GL library needs an implementation of this!
Currently drawn with "pixel vomit" colours as we don't
yet support lighting via the GL library.

This also ships with a super basic Wavefront OBJ loader.
2021-05-08 10:13:22 +02:00
Stephan Unverwerth
5ff248649b LibGL: Add software rasterizer
This is based mostly on Fabian "ryg" Giesen's 2011 blog series
"A trip through the Graphics Pipeline" and Scratchapixel's
"Rasterization: a Practical Implementation".

The rasterizer processes triangles in grid aligned 16x16 pixel blocks,
calculates barycentric coordinates and edge derivatives and interpolates
bilinearly across each block.

This will theoretically allow for better utilization of modern processor
features such as SMT and SIMD, as opposed to a classic scanline based
triangle rasterizer.

This serves as a starting point to get something on the screen.
In the future we might look into properly pipelining the main loop to
make the rasterizer more flexible, enabling us to enable/disable
certain features at the block rather than the pixel level.
2021-05-08 10:13:22 +02:00
Stephan Unverwerth
e6c0600499 LibGL: Add back face culling functions
Adds all needed functions to support back face culling
and implements back face culling in the SoftwareGLContext.
2021-05-08 10:13:22 +02:00
Ali Mohammad Pur
eff3c8a954 LibGL: Implement glColor4(ub,f)v 2021-05-08 10:13:22 +02:00
Ali Mohammad Pur
193b53344a LibGL: Implement glVertex2f(v) 2021-05-08 10:13:22 +02:00
Ali Mohammad Pur
6b11a5688d LibGL: Implement glVertex3fv 2021-05-08 10:13:22 +02:00
Ali Mohammad Pur
f601f12801 LibGL: Implement glOrtho and underlying functions 2021-05-08 10:13:22 +02:00
Jesse Buhagiar
f07a7f7b94 LibGL: Impement glLoadMatrixf and underlying function 2021-05-08 10:13:22 +02:00
Jesse Buhagiar
ea0df0b5da LibGL: Implement glScalef 2021-05-08 10:13:22 +02:00
Jesse Buhagiar
55b3ecfbd3 LibGL: Check for matrix stack over/underflow
We now correctly set the gloabl error if we detect that
a matrix stack overflow will occur in `glPushMatrix` or
`glPopMatrix`
2021-05-08 10:13:22 +02:00
Jesse Buhagiar
1959efe063 LibGL: Set GL error on some calls during begin/end
According to the OpenGL 2.x spec, some calls will set the current
global error to `GL_INVALID_OPERATION` if they are used during
a `glBegin`/`glEnd` block.
2021-05-08 10:13:22 +02:00
Jesse Buhagiar
e537e2690a LibGL: Implement glGetError and underlying function
This implements `glGetError` and correctly sets the state machine's
error macro (similar to LibC `errno`) when an invalid operation is
performed. This is reset on completion of a successful operation.
2021-05-08 10:13:22 +02:00
Jesse Buhagiar
4807d32139 LibGL: Implement a basic OpenGL 1.x compatible library
This currently (obviously) doesn't support any actual 3D hardware,
hence all calls are done via software rendering.

Note that any modern constructs such as shaders are unsupported,
as this driver only implements Fixed Function Pipeline functionality.

The library is split into a base GLContext interface and a software
based renderer implementation of said interface. The global glXXX
functions serve as an OpenGL compatible c-style interface to the
currently bound context instance.

Co-authored-by: Stephan Unverwerth <s.unverwerth@gmx.de>
2021-05-08 10:13:22 +02:00
Hendiadyoin1
1424c4651f LibGfx: Constexpr Matrices and Vectors 2021-05-08 10:13:22 +02:00
Stephan Unverwerth
09f850728a LibGfx: Add some missing operators to Vector3 Vector4 and Matrix4x4 2021-05-08 10:13:22 +02:00
Stephan Unverwerth
0c5d61ae88 LibGfx: Add Vector4 class 2021-05-08 10:13:22 +02:00
Stephan Unverwerth
b0e5e78a01 LibGfx: Mark Vector3 class final 2021-05-08 10:13:22 +02:00
Stephan Unverwerth
0a557d65a0 AK: Add epsilon() to NumericLimits for float, double, long double 2021-05-08 10:13:22 +02:00
Gunnar Beutner
605848787b Utilities: Specify mode argument when creating files with dd
When using open() with the O_CREAT flag we must specify the mode
argument. Otherwise we'll incorrectly set the new file's mode
to whatever is left on the stack:

courage:~ $ dd if=/dev/zero of=test count=1
1+0 blocks in
1+0 blocks out
512 bytes copied.
courage:~ $ ls -l test
--w-r-x---   1    anon   users        512   2021-05-08 01:29:52  test
courage:~ $

This also specifies the mode argument when opening files for
reading. This however is harmless because in those cases the argument
is ignored.

fixes #6923
2021-05-08 09:56:00 +02:00
Gunnar Beutner
eed6ce8b8b Profiler: Fix scrolling behavior
When resizing the timeline view the timelines should scroll to the
bottom when the resize operation reveals space that is beyond the
view.
2021-05-08 09:55:24 +02:00
ry755
9cec9fb1e8 Base: Update TextEditor man page to include line and column arguments
This documents the feature in c2872766f2322aa38490160b571059f05e7dcb2d
2021-05-08 09:54:53 +02:00
Gunnar Beutner
210d2d270d Profiler: Let the user select more than one process 2021-05-08 09:53:53 +02:00
Carlos César Neves Enumo
325d9445fd Profiler: Migrate mouse events to TimelineView
This change allows for continuous mouse events when hovering the
layout spaces between tracks.
2021-05-08 09:53:06 +02:00
Carlos César Neves Enumo
99f141522a Profiler: Fix timeline wrong initial horizontal position
Just after launching the app, when hovering the timeline, it would
start at Time: 2000ms. It fixes itself after scrolling.
2021-05-08 09:53:06 +02:00
Andreas Kling
295cc123c7 LibGUI: Rename UndoStack internals
Since we keep a stack of command combos, let's call entries on the
stack "Combo" instead of "UndoCommandsContainer".

And since it has a vector of commands, let's call it "commands"
instead of "m_undo_vector".
2021-05-08 08:53:37 +02:00
Gunnar Beutner
b25eba10d2 Profiler: Make the timeline resizable
This just moves the timeline and the tab widget into
a horizontal splitter to make them resizable.
2021-05-08 00:30:38 +01:00
Gunnar Beutner
a2f919c760 Ports: SDL2-GNUBoy shouldn't try to link against host libs
Without this patch I'm unable to build this port because it tries
to link against my host's libgcc_s.so.
2021-05-08 00:30:30 +01:00
Rafał Babiarz
7004fab643 Ports: Add SDL2-GNUBoy Gameboy emulator 2021-05-08 00:05:04 +01:00
Brian Gianforcaro
4b8b8b91c2 LibTest: Convert Crash test runner to outln(..) 2021-05-08 00:04:10 +01:00