Commit graph

20242 commits

Author SHA1 Message Date
Luke
c5c9494f48 LibJS: Use u64 instead of u32 in NumberPrototype::to_string
Update to #7033
Partial fix for #7034 (just ups the range to about 2 ** 54 before
losing precision)
2021-05-11 18:29:55 +01:00
Luke
2ff03ecfa8 LibJS: Make number parts unsigned in NumberPrototype::to_string
Fixes #3931
2021-05-11 17:29:37 +01:00
sin-ack
ecbe17fb11 LibLine+Shell: Add dirty history flag and use it
This patch adds a new flag called history_dirty to Line::Editor that is
set when history is added to but written.  Applications can leverage
this flag to write history only when it changes.  This patch adds an
example usage of this functionality to Shell, which will now only save
the history when it is dirty.
2021-05-11 17:26:30 +01:00
Timothy Flynn
227ccfc61a LibWeb: Paint an element's foreground before painting its children
The current implementation is missing the emphasized text of the
following rule in the painting order spec:

    7. Otherwise: *first for the element*, then for all its in-flow,
       non-positioned, block-level descendants in tree order...

This ensures the foreground is painted for the current element before
descending into its children.
2021-05-11 18:03:21 +02:00
Linus Groh
ecdb6a11b7 Base: Add Magnifier.af 2021-05-11 18:01:55 +02:00
Linus Groh
8afcd22900 Magnifier: Make window resizable
Instead of having the window non-resizable, it now defaults to a frame
size of 200 x 200 pixels but is user-resizable. The shown screenshot
updates its size accordingly. :^)
Sometimes we might need a larger view, or a non-square shape.
2021-05-11 18:01:55 +02:00
Luke
1c1b106f6c LibWeb: Make Element::tag_name return the HTML uppercased qualified name
I forgot to change tag_name when this was added.
Also makes html_uppercased_qualified_name return a const reference.
2021-05-11 18:01:36 +02:00
Luke
56d7d28d41 LibWeb: Expose Element.{prefix,localName} 2021-05-11 18:01:36 +02:00
Ali Mohammad Pur
d42d984a2d GLTeapot: Use glGenLists() a bit to demonstrate that it works 2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
720d21411b LibGL: Implement glGenLists and a few friends
This commit implements glGenLists(), glNewList(), glDeleteLists(), and
glCallList().
The 'compiled' records are implemented as a vector of member function
pointers and tuples containing their arguments, and a mechanism is
implemented to allow the recorded calls to copy-capture values from the
time of the call; this is currently only used with glLoadMatrix.
2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
02de813950 AK: Add a Tuple implementation
Please don't use this outside of metaprogramming needs, *please*.
2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
4fdbac236d AK/Variant: Deduplicate the contained types
This allows the construction of `Variant<int, int, int>`.
While this might not seem useful, it is very useful for making variants
that contain a series of member function pointers, which I plan to use
in LibGL for glGenLists() and co.
2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
3038b6b7dc AK: Avoid the use of typeinfo in Variant
typeid() and RTTI was a nice clutch to implement this, but let's move
away from the horrible slowness and implement variants using type
indices for faster variants.
2021-05-11 14:09:17 +01:00
Gunnar Beutner
659c22e17e Ports: Add missing dependency for vim
The vim port links against gettext when it's available so we
should add it as a dependency in the package.sh script.
2021-05-11 13:13:08 +01:00
Gunnar Beutner
6e2d59b49f Ports: Link gettext against libpthread
Apparently libintl uses pthread_cond_broadcast() so let's make sure
that we link it against libpthread so we don't call libc's pthread
stubs.
2021-05-11 13:13:08 +01:00
Andreas Kling
c68dfcf19f Base: Remove unused icons from the removed Visual Builder app 2021-05-11 11:24:58 +02:00
Umar Haroon
53e1ee2cb7 2048: Added Redo Support 2021-05-11 10:22:27 +01:00
Ali Mohammad Pur
a527256356 Shell: Add an option to autosave history every N ms
...and set it to 10 seconds by default.
2021-05-11 10:19:07 +01:00
Valtteri Koskivuori
4d01183f5c Userland: Implement a magnifier app
This utility is useful for making sure those UI elements are pixel
perfect. A simple 2x/4x magnification around the mouse cursor, shown in
a window.
2021-05-11 10:18:29 +01:00
Valtteri Koskivuori
4864ef9440 WindowServer: Add Optional<Gfx::IntRect> argument to get_screen_bitmap()
This way, we can optionally specify a region of the display to capture.
Defaults to entire screen if no rectangle is given.
2021-05-11 10:18:29 +01:00
Valtteri Koskivuori
cb74f7992a LibGfx: Implement Bitmap::cropped()
This cuts a region of a bitmap specified by the provided Gfx::IntRect
and returns it. Areas outside of the bounds of the original bitmap are
filled in with black.
2021-05-11 10:18:29 +01:00
SViN24
e60c0d675e
strace: Write output to stderr instead of stdout (#7016)
Fixes #7014.
2021-05-11 09:56:28 +02:00
Gunnar Beutner
0ab37dbd03 LibELF: Propagate ELF image validation errors to the caller
With this fixed dlopen() no longer crashes when given an invalid
ELF image and instead returns an error code that can be retrieved
with dlerror().

Fixes #6995.
2021-05-10 21:27:11 +02:00
Gunnar Beutner
461acda76f LibELF: Don't use assignments in return statements
Sure, this saves a couple of characters, but it's probably not
the best style.
2021-05-10 21:27:11 +02:00
Gunnar Beutner
9909a3f015 Ports: Remove obsolete patch for flatbuffers
The patch is not neccessary anymore, in fact it breaks the build
now because we have those functions in the std namespace.
2021-05-10 20:39:19 +02:00
Gunnar Beutner
22ebd754d3 Kernel: Fix loading ELF images without PT_INTERP
Previously we'd try to load ELF images which did not have
an interpreter set with an incorrect load offset of 0, i.e. way
outside of the part of the address space where we'd expect either
the dynamic loader or the user's executable to reside.

This fixes the problem by using get_load_offset for both executables
which have an interpreter set and those which don't. Notably this
allows us to actually successfully execute the Loader.so binary:

courage:~ $ /usr/lib/Loader.so
You have invoked `Loader.so'. This is the helper program for programs
that use shared libraries. Special directives embedded in executables
tell the kernel to load this program.

This helper program loads the shared libraries needed by the program,
prepares the program to run, and runs it. You do not need to invoke
this helper program directly.
courage:~ $
2021-05-10 20:39:08 +02:00
Sergey Bugaev
d8faafef14 Userland: Implement paste --watch mode
You can now watch the clipboard for changes and run a command each time
the clipboard contents change like this:

$ paste --watch some command here

The command will be spawned each time the clipboard contents change. It
can read the clipboard contents from its stdin, and CLIPBOARD_STATE
environment variable will be set to "data" if there is data to be read,
or to "nil"/"clear" if the clipboard has been cleared.
2021-05-10 19:09:53 +01:00
Sergey Bugaev
93a1b88965 Userland: Implement copy --clear
You can now clear the clipboard using copy(1) like this:

$ copy --clear
2021-05-10 19:09:53 +01:00
Sergey Bugaev
f15f03376b LibGUI: Add Clipboard::clear()
Does exactly what it says on the tin :^)
2021-05-10 19:09:53 +01:00
Mart G
e81d35995e Base: Fix a spelling error in the mitigations man page 2021-05-10 17:44:30 +01:00
Gunnar Beutner
759acdb938 LibC: Partially implement pthread_setcancel{state,type}()
With those partially implemented I can start to clone the SerenityOS
git repository via HTTPS.

The download still fails half-way through because SSL_read returns
an error for reasons I haven't investigated yet.
2021-05-10 17:44:18 +01:00
Gunnar Beutner
a14a1f2d61 Ports: Add missing curl dependency for the git port
fixes #6724
2021-05-10 17:44:18 +01:00
Brendan Coles
138d065cbb Themes: Silver: Add window title button icons 2021-05-10 17:15:47 +01:00
Gunnar Beutner
212cd9d8ac LookupServer: Do cache eviction when mDNS cache flush bit is set 2021-05-10 17:26:17 +02:00
Gunnar Beutner
edb21e02ea LookupServer: Track the receive timestamp for DNS answers 2021-05-10 17:26:17 +02:00
Gunnar Beutner
3304d675e1 LookupServer: Correct some flags for DNS packets
This corrects some of the flags in the DNS packets to match
what I saw on my local network.
2021-05-10 17:26:17 +02:00
Gunnar Beutner
c160c6b035 Kernel: Use correct destination MAC address for multicast packets
Previously we'd incorrectly use the default gateway's MAC address.
Instead we must use destination MAC addresses that are derived from
the multicast IPv4 address.

With this patch applied I can query mDNS on a real network.
2021-05-10 17:26:17 +02:00
Gunnar Beutner
a569381037 LookupServer: Handle DNS record types TXT, AAAA, SRV and CNAME
They're not being used elsewhere at the moment but this gets
rid of the debug message for incoming mDNS response packets.
2021-05-10 17:26:17 +02:00
Gunnar Beutner
7b3bed7910 LookupServer: Turn #defines into enum classes and add formatter 2021-05-10 17:26:17 +02:00
Gunnar Beutner
6e70888315 LookupServer: Split mDNS flags into separate field 2021-05-10 17:26:17 +02:00
Andreas Kling
233a9554a5 HackStudio: Tweak Files/Classes tab views
Put a bit of padding around the views, and retitle the "ClassView" tab
to simply "Classes".
2021-05-10 13:45:49 +02:00
Andreas Kling
563d3bdcc9 HackStudio: Use is<GitWidget>() instead of comparing class_name() 2021-05-10 13:45:49 +02:00
Linus Groh
60064e2049 LibJS: Make invalid RegExp flags a SyntaxError at parse time
This patch changes the validation of RegExp flags (checking for
invalid and duplicate values) from a SyntaxError at runtime to a
SyntaxError at parse time - it's not something that's supposed to be
catchable.
As a nice side effect, this simplifies the RegExpObject constructor a
bit, as it can no longer throw an exception and doesn't have to validate
the flags itself.
2021-05-10 12:01:38 +01:00
Linus Groh
c93c2dc72c LibJS: Rename RegExpLiteral m_content to m_pattern
This is what we call it elsewhere, let's be consistent.
2021-05-10 11:57:35 +01:00
Linus Groh
d1a72dc6eb LibJS/Tests: Rename function parameter from 'arguments' to 'arguments_'
The former has a special meaning and should be avoided where possible.
2021-05-10 11:54:01 +01:00
Andreas Kling
0126c81a7f HackStudio: Remove the visual form editor
Okay we've tried this twice now, and nobody ends up working on it.
Meanwhile, more and more people are using GML, and I think it's safe
to say that GML is the future of GUI development here.

So let's get rid of the old form editor from HackStudio and pave the
way for integrating GML editing into the IDE instead. :^)
2021-05-10 12:43:34 +02:00
Andreas Kling
29fe4a5de5 RequestServer: Make the certificate_requested IPC call asynchronous
It was already being used asynchronously inside RequestServer anyway.
2021-05-10 12:38:23 +02:00
Brian Gianforcaro
79ccba908e LibGUI: Retain Taskbar icon when toggling frameless setting
Reapply the app icon if the we are coming back from "frameless" mode.
This will re-initialize the icon representing the app in the task bar,
instead of displaying the default application icon.

This bug was visible in "Cube Demo" as well as the "Analog Clock".
2021-05-10 12:36:05 +02:00
Brian Gianforcaro
1674d06f78 Userland: Allow the Analog Clock window border to be hidden
Introduce the ability to hide the Analog Clock window borde. With this
feature enabled it looks like the clock is floating and integrated into
the desktop.

The "Cube Demo" has the same feature, and was used as inspiration when
implementing the feature in the Analog Clock.
2021-05-10 12:36:05 +02:00
Brian Gianforcaro
3be9af7695 Userland: Reduce pledges requested by AnalogClock
After startup AnalogClock only needs the normal GUI event loop pledges.
2021-05-10 12:36:05 +02:00