Commit graph

402 commits

Author SHA1 Message Date
Andreas Kling
db694491f3 LibGUI: Make Model::data_matches() take Variant by const-reference 2021-02-16 20:08:32 +01:00
Andreas Kling
5ddf7e993c LibGUI: Add ScrollableWidget to forwarding header 2021-02-16 19:58:43 +01:00
Andreas Kling
085696ea39 LibTTF: Interpret font names from Windows platform as UTF-16BE
This turns the admittedly aesthetic "T a h o m a" into "Tahoma" :^)
2021-02-16 17:32:42 +01:00
Andreas Kling
0538dc4e28 LibTextCodec: Add a simple UTF-16BE decoder 2021-02-16 17:31:22 +01:00
thankyouverycool
01e00bac9d LibGUI: Set correct ranges for hidable scrollbars
Fixes vertical and horizontal overscroll in widgets that allow
unnecessary scrollbars to be hidden.
2021-02-16 17:17:12 +01:00
Andreas Kling
f24287e0e1 LibGfx: Oops, fix misaligned window buttons for WindowType::Normal 2021-02-16 16:57:45 +01:00
Andreas Kling
11c8596ad3 WindowServer+LibGUI+LibGfx: Add WindowType::ToolWindow
Tool windows are secondary windows with a smaller title bar. The sit on
the layer above normal windows, and cannot be minimized.

These are intended for complex yet non-modal interactions with the
content of a primary window, such as find/replace windows, property
windows, etc.
2021-02-16 16:26:29 +01:00
Nick Vella
15c1f7a40d WindowServer, LibGUI: Variable minimum window sizes
Minimum window size can now be customised and set at runtime via the
SetWindowMinimumSize WindowServer message and the set_minimum_size
LibGUI::Window method. The default minimum size remains at 50x50.

Some behind-the-scenes mechanics had to be added to LibGUI::Window to
ensure that the minimum size is remembered if set before the window is
shown. WindowServer sends a resize event to the client if it requests a
size on create that's smaller than it's minimum size.
2021-02-16 15:46:03 +01:00
Andreas Kling
57a345a590 LibGfx: Remove debug spam from FontDatabase lookups 2021-02-16 13:12:41 +01:00
AnotherTest
e438dd3c9b LibC: Teach scanf how to read "%lu" and "%llu" (unsigned long{, long})
This makes the gcc port work again.
2021-02-16 10:38:52 +01:00
Andreas Kling
2323b6fb74 LibWeb: Use the correct DOM node when moving text cursor with mouse
We should use the DOM node returned by the TextCursor hit test,
and not the one we got from the earlier Exact hit test.
2021-02-15 23:25:29 +01:00
Tom
d590e0c946 WindowServer: Add support for alpha channel based hit testing
This enables implementing non-rectangular window shapes, including
non-rectangular window frames.
2021-02-15 23:07:49 +01:00
Ben Wiederhake
b3f0a5c917 LibC: Fix typo in comment 2021-02-15 22:09:01 +01:00
Ben Wiederhake
cf0d4994c2 LibC+LibPthread: Permit partial pthread_atfork
POSIX explicitly allows providing nullptr's, and our __pthread_*() implementation
stores and calls the provided functions as-is, without checking for nullptr.
2021-02-15 22:09:01 +01:00
Andreas Kling
fc2a4511ec LibVT: Clean up TerminalWidget a bit, removing unused cruft 2021-02-15 19:58:47 +01:00
Jean-Baptiste Boric
d9aaa8afe9 LibGUI: Open context menu on 'Menu' key down 2021-02-15 19:37:14 +01:00
Andreas Kling
c51209a06a LibWeb: Move cursor along when drag-selecting in editable content 2021-02-15 18:12:14 +01:00
Andreas Kling
7f616449ec LibGUI: Make TextEditor write a trailing newline to non-empty files
Fixes #4801.
2021-02-15 18:02:33 +01:00
Andreas Kling
a048f46be5 LibGUI: Use a ScopeGuard to close the fd in TextEditor::write_to_file() 2021-02-15 17:48:38 +01:00
Andreas Kling
015c5e61a8 LibGUI: Fix bogus TextEditor selection when cursor dragged outside view
If the cursor Y position is < 0 in content coordinate space, we should
always map that to the first line of the file.

This fixes unexpected cursor behavior when dragging the selection above
the top of the document.
2021-02-15 17:34:40 +01:00
AnotherTest
8bc1bcb34b LibC: Reimplement scanf from the ground up
This adds support for some previously unsupported features
(e.g. length modifiers) and fixes at least one FIXME.
Fixes #90.
2021-02-15 17:32:56 +01:00
AnotherTest
0bf496f864 LibC: Make strtoull accept the '0x' prefix when base 16 is specified
Dr.POSIX says it should be.
2021-02-15 17:32:56 +01:00
AnotherTest
5729e76c7d Meta: Make it possible to (somewhat) build the system inside Serenity
This removes some hard references to the toolchain, some unnecessary
uses of an external install command, and disables a -Werror flag (for
the time being) - only if run inside serenity.

With this, we can build and link the kernel :^)
2021-02-15 17:32:56 +01:00
AnotherTest
bb777459a0 LibC+LibPthread: Implement pthread_atfork()
This required a bit of rearchitecture, as pthread_atfork() required a
mutex, and duplicating a mutex impl for it was silly.
As such, this patch moves some standalone bits of pthread into LibC and
uses those to implement atfork().
It should be noted that for programs that don't use atfork(), this
mechanism only costs two atomic loads (as opposed to the normal mutex
lock+unlock) :^)
2021-02-15 17:32:56 +01:00
AnotherTest
8e074f8665 LibC+LibPthread: Implement pthread_rwlock_*
This implementation is pretty damn dumb, and probably has more bugs than
features.
But for the time being, it seems to work. however, we should definitely
replace it with a good implementation sometime very soon :^)
2021-02-15 17:32:56 +01:00
AnotherTest
2e50c232f7 LibPthread: Stub out pthread_atfork() 2021-02-15 17:32:56 +01:00
AnotherTest
26a8a84ded LibC+LibPthread: Stub out pthread_rwlock_* functions 2021-02-15 17:32:56 +01:00
AnotherTest
9e2c37a8b2 LibC: Add 'cfmakeraw()' 2021-02-15 17:32:56 +01:00
AnotherTest
0c07c005b5 LibC: Stub out some addrinfo things 2021-02-15 17:32:56 +01:00
AnotherTest
4519950266 Kernel+LibC: Add the _SC_GETPW_R_SIZE_MAX sysconf enum
It just returns 4096 :P
2021-02-15 17:32:56 +01:00
AnotherTest
71054c4c06 LibC: Add reentrant versions of getpw{uid,nam}
Pretty hacky, but it should be fine.
2021-02-15 17:32:56 +01:00
AnotherTest
a3a7ab83c4 Kernel+LibC: Implement readv
We already had writev, so let's just add readv too.
2021-02-15 17:32:56 +01:00
AnotherTest
1e79c04616 Kernel+LibC: Stub out SO_{SND_RCV}BUF 2021-02-15 17:32:56 +01:00
AnotherTest
2db4ab80a2 LibC: Pull fd_set.h into unistd.h 2021-02-15 17:32:56 +01:00
AnotherTest
9b69c73dfe LibC: Stub out semaphore.h 2021-02-15 17:32:56 +01:00
Andreas Kling
9efd80f100 LibJS: Use fabs() instead of abs() in JS::Value
abs() takes an int, so this would only work correctly for numbers
smaller than INT_MAX.
2021-02-15 13:58:24 +01:00
Sergey Bugaev
bc05ab47de LibCore: Expose UDPServer::fd() and make the constructor protected 2021-02-15 09:14:42 +01:00
Stephan Unverwerth
de811faf55 LibTTF: Address some minor TODOs in the font implementation 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
05d31cbeeb LibTTF: Add hack for recognizing fixed-width fonts 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
3b67b55c84 LibGfx: draw_glyph_or_emoji fix check for available glyph
This would cause question marks to be rendered when a ttf with fewer
glyphs than the value of the code_point was used.
2021-02-15 08:50:48 +01:00
Stephan Unverwerth
b8c25bc7ff LibGfx: Remove static load_from_file() from abstract Font class 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
79dfe9846d LibGfx: Generalize glyph placement in Painter 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
972c7cf9f4 LibGUI: Add some default sizes for TTF fonts in FontPicker 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
85158dc0ad LibGfx+LibTTF: Allow Painter to draw TTF glyphs 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
0f41f5d9ba LibGUI+LibGfx+LibTTF: Make fontpicker handle TTF fonts 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
5a70ccecb3 LibGfx: Add more query methods to FontDatabase and Typeface 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
e504d4ef96 LibGfx: Add Color::multiply() for component wise multiplication 2021-02-15 08:50:48 +01:00
Stephan Unverwerth
179dba652e LibGfx: Insert pixel and ttf fonts into Typeface structure
This adds a new structure 'Typeface' to the FontDatabase that
represents all fonts of the same family and variant.
It can contain a list of BitmapFonts with varying size but of
the same family and weight or a pointer to a single TTF font
for all sizes of this Typeface.
2021-02-15 08:50:48 +01:00
Stephan Unverwerth
2c4e13f14a LibTTF: Parse TTF "name" table 2021-02-15 08:50:48 +01:00
AnotherTest
48fbf6a88d LibCrypto: Don't copy the prime test candidates
This was copying a bunch of bigints for no reason.
2021-02-14 13:30:10 +01:00