Commit graph

10619 commits

Author SHA1 Message Date
LepkoQQ
412e566967 Base: Fix slovenian keymap 2020-06-20 17:04:03 +02:00
LepkoQQ
b1c99c1891 AK: Fix JsonParser double encoding multibyte utf-8 chararcters 2020-06-20 17:04:03 +02:00
Andreas Kling
64513f3c23 LibJS: Move native objects towards two-pass construction
To make sure that everything is set up correctly in objects before we
start adding properties to them, we split cell allocation into 3 steps:

1. Allocate a cell of appropriate size from the Heap
2. Call the C++ constructor on the cell
3. Call initialize() on the constructed object

The job of initialize() is to define all the initial properties.
Doing it in a second pass guarantees that the Object has a valid Shape
and can find its own GlobalObject.
2020-06-20 15:46:30 +02:00
Andreas Kling
e4add19915 LibJS: Pass GlobalObject& to native functions and property accessors
More work towards supporting multiple global objects. Native C++ code
now get a GlobalObject& and don't have to ask the Interpreter for it.

I've added macros for declaring and defining native callbacks since
this was pretty tedious and this makes it easier next time we want to
change any of these signatures.
2020-06-20 15:45:07 +02:00
Andreas Kling
4aa98052ca LibJS: Remove some more use of Interpreter::global_object()
Let's do some more work towards supporting multiple global objects.
2020-06-20 15:45:07 +02:00
Nico Weber
ed0740d73c LibC: In posix_spawn(), use _exit instead of exit on child error
posix_spawn() tries to present semantics as if no fork() is happening
behind the scenes, so running arbitrary atexit handlers of the parent
in the child seems like the wrong thing to do.
2020-06-20 14:43:27 +02:00
Nico Weber
5208856688 LibC: Add addchdir() / addfchdir() to posix_spawn file actions
This isn't in posix yet, but it is implemented on some platforms
and it will be in a future version:
https://www.austingroupbugs.net/view.php?id=1208
2020-06-20 14:43:27 +02:00
Nico Weber
2ddca326be LibC: Add POSIX_SPAWN_SETSIGMASK
This isn't in posix yet, but it is implemented on some platforms
and it will be in a future version:
https://www.austingroupbugs.net/view.php?id=1044

It seems useful, so add it.
2020-06-20 14:43:27 +02:00
Nico Weber
39d1a43c45 LibC: Make sigprocmask error check more consistent with rest of this code 2020-06-20 14:43:27 +02:00
Nico Weber
7ffcc5a8b2 LibC: Implement file actions for posix_spawn 2020-06-19 22:11:38 +02:00
Nico Weber
68f281c864 LibC: Make spawn.h parse in C files 2020-06-19 22:11:38 +02:00
Andreas Kling
2188ed54b0 Base: Note that the "setkeymap" pledge promise is an extension 2020-06-19 21:15:25 +02:00
Nico Weber
e34299a136 Ports: Remove dropbear patch that removed calls to seteuid()
This is no longer necessary now that seteuid() / setegid()
is implemented.
2020-06-19 20:34:59 +02:00
Nico Weber
748ac5e01b Ports: Pull dropbear from a mirror
The main web page has been offline for at least a week.
This gets the dropbear port building again.
2020-06-19 20:34:59 +02:00
Nico Weber
e89a82a476 LibC: Add support for POSIX_SPAWN_RESETIDS
This is possible now that seteuid() / setegid() are implemented.
2020-06-19 20:34:59 +02:00
Nico Weber
35c4a4971a CMake: Make the install step more zen
The "Installing $foo..." messages are just noise, so turn them off.
2020-06-19 20:34:25 +02:00
Hüseyin ASLITÜRK
dff5abb073 LibGfxDemo: Fix "90s-bg.png" path
Incorrect image file path cause the application to crash on startup.
2020-06-19 20:34:09 +02:00
Tom Lebreux
605a21b892 Userland: Add base64 tool 2020-06-18 23:21:41 +02:00
Tom Lebreux
e14c8b2707 AK: Add tests for Base64 decoder 2020-06-18 23:21:41 +02:00
Tom Lebreux
79529ffd47 AK: Add a simple and inefficient Base64 encoder
The test cases are taken from RFC 4648.
2020-06-18 23:21:41 +02:00
Nico Weber
dd53e070c5 Kernel+LibC: Remove setreuid() / setregid() again
It looks like they're considered a bad idea, so let's not add
them before we need them. I figured it's good to have them in
git history if we ever do need them though, hence the add/remove
dance.
2020-06-18 23:19:16 +02:00
Nico Weber
a38754d9f2 Kernel+LibC: Implement seteuid() and friends!
Add seteuid()/setegid() under _POSIX_SAVED_IDS semantics,
which also requires adding suid and sgid to Process, and
changing setuid()/setgid() to honor these semantics.

The exact semantics aren't specified by POSIX and differ
between different Unix implementations. This patch makes
serenity follow FreeBSD. The 2002 USENIX paper
"Setuid Demystified" explains the differences well.

In addition to seteuid() and setegid() this also adds
setreuid()/setregid() and setresuid()/setresgid(), and
the accessors getresuid()/getresgid().

Also reorder uid/euid functions so that they are the
same order everywhere (namely, the order that
geteuid()/getuid() already have).
2020-06-18 23:19:16 +02:00
Hüseyin ASLITÜRK
0001bbf182 QuickShow:If image is larger then window size resize it to fit the image 2020-06-18 23:18:11 +02:00
Hüseyin ASLITÜRK
79de1a33cf QuickShow: Add a new "Set as desktop wallpaper" action under Image menu 2020-06-18 23:18:11 +02:00
Hüseyin ASLITÜRK
12671e38e7 LibGUI: Add a new Window::is_maximized method 2020-06-18 23:18:11 +02:00
Hüseyin ASLITÜRK
5950736efa WindowServer: Add a new IsMaximized message
New message to query window maximized state.
2020-06-18 23:18:11 +02:00
Till Mayer
5bd0015583 FileManager: Small improvements to PropertyDialog's apply button logic
The apply button used to be enabled directly after opening the dialog.
Changes in the permissions now enable/disable the apply button as well.
2020-06-18 23:14:13 +02:00
Till Mayer
072e6a6405 WavLoader: Search for DATA marker by reading single bytes
Previously 4 bytes at once were read and compared to the string
"DATA". This worked when the DATA marker was aligned on a 32-bit
boundary relative to the start of the file. However, this is not
guranteed to always be the case, and for some files the loader
would just keep searching for the marker.
2020-06-18 23:13:48 +02:00
Andreas Kling
c053537321 keymap: Add copyright header 2020-06-18 23:00:19 +02:00
Andreas Kling
d480944f6a ClipboardHistory: Use pledge() and unveil() :^) 2020-06-18 22:34:15 +02:00
Andreas Kling
fe458f81ec KeyboardSettings: Call out to /bin/keymap to actually set the keymap
Now that KeyboardSettings is no longer setuid-root, we have to call out
to a helper program to actually set the keymap.

This is a very nice improvement to system security. :^)
2020-06-18 22:29:09 +02:00
Andreas Kling
6e78279614 keymap: Add back a tiny utility for setting the system keyboard layout
This patch removes the setuid-root flag from the KeyboardSettings GUI
application and adds back the old "keymap" program.

It doesn't feel very safe and sound to have a GUI program runnable
as setuid-root, so in the next patch I'll be making KeyboardSettings
call out to the "keymap" program to do its bidding.
2020-06-18 22:19:57 +02:00
Andreas Kling
0609eefd57 Kernel: Add "setkeymap" pledge promise 2020-06-18 22:19:36 +02:00
Andreas Kling
033da11364 LibGUI: Fix MessageBox width calculation not including the icon width 2020-06-18 22:18:19 +02:00
Andreas Kling
07b06cdc7e LibWeb: Fix broken #include after moving files around 2020-06-18 22:01:05 +02:00
Andreas Kling
995d93c9d9 LibWeb: Move StackingContext from Layout/ to Painting/
The stacking context tree doesn't affect layout at all, so let's move
it into the Painting/ directory. I'm not sure yet if it's worth going
for a fullly separate painting tree. So far I'm thinking a stacking
context tree with pointers into the layout tree might be enough.
2020-06-18 21:42:19 +02:00
Andreas Kling
8c82d26668 LibWeb: Rename LayoutNode::render() to paint()
"Paint" matches what we call this in the rest of the system. Let's not
confuse things by mixing paint/render/draw all the time. I'm guilty of
this in more places..

Also rename RenderingContext => PaintContext.
2020-06-18 21:37:20 +02:00
Andreas Kling
dec0cd3755 LibWeb: Respect min-width and max-width on position:absolute elements 2020-06-18 21:31:20 +02:00
Andreas Kling
55a3575a7c LibWeb: More work on width of position:absolute elements
The shrink-to-fit width algorithm actually works a little bit different
in the absolute positioning context, so it can't share all of its code
with non-absolute positioning.

Also, inline-block elements were always inserting unnecessary line
breaks when splitting, which caused the preferred width to be smaller
than it should be. This patch fixes that as well, by just not breaking
after inline-block elements in LayoutMode::OnlyRequiredLineBreaks.
2020-06-18 21:16:29 +02:00
Andreas Kling
cfab53903f LibWeb: Separate layout tree rendering into phases
CSS defines a very specific paint order. This patch starts steering us
towards respecting that by introducing the PaintPhase enum with values:

- Background
- Border
- Foreground
- Overlay (internal overlays used by inspector)

Basically, to get the right visual result, we have to render the page
multiple times, going one phase at a time.
2020-06-18 18:57:35 +02:00
Andreas Kling
abe811104f LibWeb: Better width computation for position:absolute blocks
This patch basically translates the CSS2.2 spec language into C++ for
computing the  width of absolutely positioned non-replaced elements.
2020-06-18 18:28:32 +02:00
Andreas Kling
3f87c98f44 Base: Fix broken ACID2 browser bookmark :^) 2020-06-18 16:47:04 +02:00
William McPherson
34ee76984c Piano: Expose multi-track functionality
This commit adds some actions for creating and cycling through tracks.

set_octave_and_ensure_note_change() was refactored to allow switching
tracks to implement the same behaviour.

KnobsWidget is getting pretty bad.
2020-06-18 16:42:37 +02:00
William McPherson
ee52572ca1 Piano: Allow multiple tracks internally
This commit adds multi-track functionality without exposing it to the
user.

All I really did was rename AudioEngine to Track and allow more than one
Track in TrackManager. A lot of the changes are just changing widgets to
take a TrackManager and use current_track().

The TrackManager creates Tracks and gives them a read-only reference to
the global time value. When the TrackManager wants to fill a sample in
the buffer (in fill_buffer()), it calls fill_sample() on each Track.

The delay code is slightly different - a Track will fill its
m_delay_buffer with the sample it just created rather than the most
recent sample in the buffer (which used to be the same thing).

TrackManager manages the current octave.

Other than those few things, this is a pretty basic separation of
concerns.
2020-06-18 16:42:37 +02:00
Hüseyin ASLITÜRK
db5b28b78e DownloadWidget: Use GUI::Image instead of Label to show image 2020-06-18 16:35:57 +02:00
Hüseyin ASLITÜRK
d139df706a Welcome: Replace Label with Image component to show banner and app icon 2020-06-18 16:35:57 +02:00
Hüseyin ASLITÜRK
d0411f3756 Minesweeper: Replace Label with Image component to show flag and timer 2020-06-18 16:35:57 +02:00
Hüseyin ASLITÜRK
0a2dc1f5c0 AboutDialog: Replace Label with Image to show banner and app icon 2020-06-18 16:35:57 +02:00
Hüseyin ASLITÜRK
77c8a960ad NotificationWindow: Replace Label with Image component to show icons 2020-06-18 16:35:57 +02:00
Hüseyin ASLITÜRK
030d0f9937 MessageBox: Replace Label with Image component to show icons 2020-06-18 16:35:57 +02:00