Commit graph

12532 commits

Author SHA1 Message Date
Tom
a89ccd842b Kernel: Make PhysicalPage not movable and use atomic ref counting
We should not be moving ref-counted objects.
2020-08-22 10:46:24 +02:00
Tom
41c005cb14 Kernel: Copy command line to a safe place
This avoids kmalloc overwriting it because it may be within the
kmalloc or eternal pool.
2020-08-22 10:46:24 +02:00
Tom
5a98e329d1 AK: Get rid of make_singleton function
Just default the InitFunction template argument.
2020-08-22 10:46:24 +02:00
Tom
8a75e0b892 Kernel: Fix regression where MemoryManager is initialized twice
MemoryManager cannot use the Singleton class because
MemoryManager::initialize is called before the global constructors
are run. That caused the Singleton to be re-initialized, causing
it to create another MemoryManager instance.
2020-08-22 10:46:24 +02:00
Tom
f0906250a1 Kernel: Move Singleton class to AK 2020-08-22 10:46:24 +02:00
Itamar
0e69ebbce4 Meta: Add missing license header to ThemeEditor 2020-08-22 09:48:59 +02:00
Itamar
5c494eefd6 HackStudio: Implement "Step Over" debugging action
The "Step Over" action continues execution without stepping into
instructions in subsequent function calls.
2020-08-22 09:48:59 +02:00
Itamar
99788e6b32 HackStudio: Implement "Step Out" debugging action
The "Step Out" action continues execution until the current function
returns.

Also, LibDebug/StackFrameUtils was introduced to eliminate the
duplication of stack frame inspection logic between the "Step Out"
action and the BacktraceModel.
2020-08-22 09:48:59 +02:00
Itamar
cb432ffe8c HackStudio: Add icons for "step in" and "step out" 2020-08-22 09:48:59 +02:00
Itamar
ebab512c03 TextEditor: Increase padding in ruler width 2020-08-22 09:48:59 +02:00
Itamar
f5aa0988f5 HackStudio: Move debugger actions to a toolbar in the debug widget 2020-08-22 09:48:59 +02:00
Andreas Kling
dd9d5d6c72 ThemeEditor: Tweak the main UI layout 2020-08-21 21:16:13 +02:00
Andreas Kling
84a272ad2a ThemeEditor: Set window icon and title 2020-08-21 21:16:13 +02:00
Andreas Kling
7703dad36b ThemeEditor: Allow editing of theme colors one at a time
This is not perfect and kinda clunky to use, but these are the best
input widgets we have available at the moment, so let's make do with
what we have. :^)
2020-08-21 21:16:13 +02:00
Andreas Kling
8055813ecf LibGUI: Add ComboBox::selected_index()
This returns the currently selected index. It was a bit strange that
we had set_selected_index() but not a way to read it back. :^)
2020-08-21 21:16:13 +02:00
Andreas Kling
50076997f4 LibGfx: Use an enumerator macro for color roles 2020-08-21 21:16:13 +02:00
Andreas Kling
dfe8adde3f ThemeEditor: Start working on a window theme editor :^) 2020-08-21 21:16:13 +02:00
Andreas Kling
80a9896e83 LibGfx+WindowServer: Simplify WindowTheme::paint_normal_frame() API
Don't require passing in the outer frame rect since the theme can
compute that itself, based on the window rect.
2020-08-21 21:16:13 +02:00
Nico Weber
116c0c0ab3 LibJS: Implement Date's string constructor
... by calling Date.parse().

With this, dates on http://45.33.8.238/ and
http://45.33.8.238/linux/summary.html are correctly converted to local
time :^)
2020-08-21 21:12:54 +02:00
Nico Weber
6e5aa5d5df LibJS: Implement Date.parse()
The spec says Date.parse() should accept at least a simplified form
of ISO 8601, so that's all this implements.
2020-08-21 21:12:54 +02:00
Nico Weber
19a8aa72d2 Kernel: Fix reading RTC
The CMOS sets bit 2 (0x4) if times are binary, if it's not
set they're in BCD.

The CMOS sets bit 1 (0x1) if hours are on a 12 hour clock.
In that case, the highest bit in the hour byte is set for
PM times (both in binary and BCD times).

Three bugs:

1. The lower 7 bits were masked off incorrectly when calling
   bcd_to_binary(). Use 0x7F as mask, not 0x70.

2. The highest bit to check if a time was PM was checked after
   BCD conversion of the low 7 bits, which clobbered that bit.
   Do the check before BCD conversion.

3. In the 12 hour clock, midnight and noon are "12", so those
   need to be converted to 0 even if for non-PM times (else
   midnight is "12", not "0").

With this, SerenityOS consistently shows UTC as the current time,
as it should.

If folks want it to display local time instead, they can get this
by adding `-rtc base=localtime` to Meta/run.sh -- but a better fix
would be to add timezone management and convert from UTC system
clock to the user timezone at display time.
2020-08-21 20:57:52 +02:00
Andreas Kling
7eeecbc0f3 LibWeb: InProcessWebView::selected_text() should use the focused frame 2020-08-21 18:58:21 +02:00
Andreas Kling
684fa0f99b LibWeb: Make selection state recomputation implicit
Add a LayoutDocument API for modifying the selection and make clients
call that so we can recompute selection states automatically.
2020-08-21 17:57:24 +02:00
Andreas Kling
d47f77169f LibWeb: Remember the selection state of each LayoutNode
Instead of computing it on the fly while painting each layout node,
they now remember their selection state. This avoids a whole bunch
of tree traversal while painting with anything selected.
2020-08-21 17:57:24 +02:00
AnotherTest
cf4870c93e LibLine: Do not ignore Ctrl-C when buffer is empty
I am told that this is how people test their shells.
That's bizarre to me, but sure :^)
2020-08-21 17:09:41 +02:00
Nico Weber
8d293601b6 IPCCompiler: Fix formatting mishap after GenericLexer change 2020-08-21 16:40:35 +02:00
Muhammad Zahalqa
5a2ec86048 LibJS: Parser refactored to use constexpr precedence table
Replaced implementation dependent on HashMap with a constexpr PrecedenceTable
based on array lookup.
2020-08-21 16:14:14 +02:00
Andreas Kling
b36ac88349 ResourceGraph: Keep the graph inside the GUI::Frame rect
Part of the graph was hidden under the frame rect, which had the effect
of delaying the appearance of spikes (well, all changes really.)
2020-08-21 16:13:19 +02:00
AnotherTest
30554c969c LibLine: Handle interrupts/window size changes internally 2020-08-21 16:10:51 +02:00
AnotherTest
238e87de4e LibLine: Handle Ctrl-C and Ctrl-D in a way similar to other line editors
Makes C-c print "^C" and continue prompting on a new line.
Also fixes a problem where an interrupted get_line() would need more
read()'s than required to update the display.
2020-08-21 16:10:51 +02:00
Nico Weber
c8cf465174 LibJS: Implement Date.valueOf()
It does exactly the same thing as Date.getTime().
2020-08-21 16:03:34 +02:00
Nico Weber
064159d215 LibWeb: Use GenericLexer in WrapperGenerator 2020-08-21 16:01:48 +02:00
Nico Weber
0d52e7f6e3 IPCCompiler: Use GenericLexer
No behavior change.
2020-08-21 16:01:07 +02:00
AnotherTest
d4bcc689fb Shell: Make 'for' loops read their input as an stream
i.e. process an element as it becomes available.
2020-08-21 16:00:42 +02:00
AnotherTest
9cc996b1e5 AK: Add Stream::offset_of(ReadonlyBytes) 2020-08-21 16:00:42 +02:00
AnotherTest
67f7f6840d AK+LibC+Kernel: Move the implementation of memmem to AK 2020-08-21 16:00:42 +02:00
Andreas Kling
779b643855 Meta: Add Tom (tomuta) to the contributors list :^) 2020-08-21 15:04:27 +02:00
Andreas Kling
23813d9bc9 LibChess: Shrink Chess::Piece from 8 bytes to 1 byte
This makes the engine footprint a lot smaller.
2020-08-21 13:46:07 +02:00
Peter Elliott
1e57e32a93 ChessEngine: Add ChessEngine
This engine is pretty bad, but doesn't let itself get checkmated
2020-08-21 12:26:30 +02:00
Peter Elliott
fb62eed058 Chess: Add support for UCI engines 2020-08-21 12:26:30 +02:00
Peter Elliott
7331b2b2f6 LibChess: Add UCIEndpoint for writing UCI chess engines 2020-08-21 12:26:30 +02:00
Peter Elliott
e80d0abb2c LibChess: Fix the ability to counter check with another check
fixes #3187,#3171
2020-08-21 12:26:30 +02:00
Peter Elliott
d2cb5e0f48 Chess: Refactor game logic into LibChess for use in engines
In the future UCI protocol stuff will also go into LibChess.
2020-08-21 12:26:30 +02:00
Peter Elliott
ffece9cfba Chess: Add serialization of moves and squares 2020-08-21 12:26:30 +02:00
Peter Elliott
f69b419c05 LibCore: Add File::{stdin, stdout, stderr}()
This should make it easier to get a Core::File for standard streams.
2020-08-21 12:26:30 +02:00
Peter Elliott
6c2d0dea91 Chess: Fix generation of promotion moves 2020-08-21 12:26:30 +02:00
Nico Weber
a6b68451dc LibJS: Implement Date.prototype.toISOString() 2020-08-21 12:11:48 +02:00
Nico Weber
1eac1b360b LibJS: Implement Date.UTC() 2020-08-21 12:11:48 +02:00
Nico Weber
221b412210 LibCore: Make DateTime::create() not fill in tm_wday and tm_yday for calling mktime() 2020-08-21 12:11:48 +02:00
Nico Weber
459e4ace93 LibC: Add timegm()
timegm() is like mktime() in that it converts a struct tm to
a timestamp, but it treats the struct tm as UTC instead of as
local time.

timegm() is nonstandard, but availabe in both Linux and BSD,
and it's a useful function to have.
2020-08-21 12:11:48 +02:00