Commit graph

8943 commits

Author SHA1 Message Date
Peter Nelson
9a2c8102cd LibGfx: Use content sniffing to choose which ImageDecoder plugin to use 2020-04-25 16:49:09 +02:00
Peter Nelson
2cd9716b38 LibGfx: Add a sniff method to ImageDecoder and implement for GIF and PNG
The sniff method is intended to be used for content sniffing. It should be a
cheap test to rapidly rule out whether a candidate image can be successfully
decoded. For the GIF and PNG implementations it simply attempts to decode the
image header, returning true if successful and false if not.
2020-04-25 16:49:09 +02:00
Peter Nelson
df0d6e241c LibGfx: Extract GIF header decoding into separate function 2020-04-25 16:49:09 +02:00
Peter Nelson
d5af7b220c LibGfx: implement remaining GIFImageDecoderPlugin methods 2020-04-25 16:49:09 +02:00
Peter Nelson
e06518211b LibGfx: decode first frame of GIF LZW data
Also:
- Define the GIFLoadingContext structure.
- The load_gif_impl function now returns load operation success, and takes a
  reference to a GIFLoadingContext as input.
- Implement GIFImageDecoderPlugin::bitmap which calls onto load_gif_impl.
2020-04-25 16:49:09 +02:00
Peter Nelson
9c2a675c38 LibGfx: Implement GIF LZW decoding
Add an LZWDecoder class that can decode GIF LZW data.
2020-04-25 16:49:09 +02:00
Andreas Kling
cba9550f1c HackStudio: Toolbar icon overhaul 2020-04-25 14:17:02 +02:00
Itamar
74f41d5f98 HackStudio: Add cpp debugger
The HackStudio debugger integrates with LibDebug to provide
source-level debugging.

The user can set breakpoints at various positions in the source code,
and then run the program in debug mode.

When the program is stopped, the current execution position is
displayed, and the user can insert/remove breakpoints, continue
execution, or single step the program.
2020-04-25 13:16:46 +02:00
Itamar
393560d8a2 HackStudio: GUI support for setting breakpoints on source code lines 2020-04-25 13:16:46 +02:00
Itamar
009b4ea3f4 LibDebug: Add remove_breakpoint
Also, change the interface of all breakpoint management functions to
only take the address of the breakpoint as an argument.
2020-04-25 13:16:46 +02:00
Hüseyin ASLITÜRK
e00b85b8c0 Userland/ls: Remove unnecessary output 2020-04-25 12:09:46 +02:00
Brendan Coles
6dde2c7f47 Browser: Add Browser.ini configuration file
The Browser can now load a home page URL from the user's Browser.ini
configuration file rather than using a hard-coded URL.
2020-04-25 10:55:55 +02:00
Andreas Kling
0f4fa43541 LibGUI: Tweak TabWidget tab icon placement 2020-04-24 22:49:57 +02:00
Andreas Kling
260e4049ff Browser: Use the active tab's favicon as the window icon :^) 2020-04-24 22:47:53 +02:00
Andreas Kling
4d8206f7c2 LibGUI: Use bold font for the currently active TabWidget tab 2020-04-24 22:44:36 +02:00
Andreas Kling
d6bbf12b7c LibGUI: Add "uniform tabs" mode to TabWidget (all tabs have same width)
...and enable this in the main Browser UI. :^)
2020-04-24 22:36:25 +02:00
Andreas Kling
682f0ac93b Browser: React to favicon notifications and put favicons in the tabs! 2020-04-24 22:28:05 +02:00
Andreas Kling
53cb5325ee LibGUI: Allow TabWidget tabs to have icons and custom text alignment 2020-04-24 22:27:46 +02:00
Andreas Kling
2be184f49c LibWeb: Try fetching a favicon when loading a non-file URL in HtmlView
If valid and decodable, the favicon will be provided to clients via the
on_favicon_change hook. :^)
2020-04-24 22:26:53 +02:00
Andreas Kling
3fcfab4404 Browser: Move the "About" action to WindowActions 2020-04-24 20:50:06 +02:00
Andreas Kling
45a932a600 Base: New "cut" action icon 2020-04-24 20:42:34 +02:00
Andreas Kling
dfe8dea2ac Browser: Remove padding from the main TabWidget
This makes the active tab "take over" the whole window UI, even though
it's actually inside a TabWidget.
2020-04-24 20:42:34 +02:00
Andreas Kling
1587b53001 LibGUI: Allow overriding the padding inside a TabWidget 2020-04-24 20:42:34 +02:00
Andreas Kling
9d8620f956 Browser: Add icons for the "new tab" and "close tab" actions 2020-04-24 20:42:34 +02:00
Andreas Kling
2b64cf3efe Base: New "open" and "save" action icons 2020-04-24 20:42:34 +02:00
Andreas Kling
7db0194d4b Base: Tweak Calendar app icon 2020-04-24 20:42:34 +02:00
DexesTTP
424f47cbe5 LibGUI: Fix display issue when selecting multi-lines in TextEditor
When selecting the start of a multi-line line, a selection rect was
displayed for the whole line but the text wasn't rendered properly.
This change prevents the selection rect from being drawn in virtual
lines with no selected characters.
2020-04-24 20:29:47 +02:00
Linus Groh
a832ab0f4e js: Interrupt running script or REPL evaluation when receiving SIGINT 2020-04-24 19:43:34 +02:00
Andreas Kling
c350bb9178 LibGUI: Fix laggy mouse selection in TextEditor widget
We were letting the automatic scrolling timer drive all selection
updates to fix an unwanted acceleration that was happening. However,
if a mousemove occurs *within* the editor widget, we should just
handle it right then and there.
2020-04-24 19:14:22 +02:00
Andreas Kling
344e66caaa LibGUI: Shrink GUI::Splitter by 1 pixel to make it look just right
Splitters were slightly oversized to work around the fact that we
were ignoring 2px on both sides of them. Now that the whole splitter
can be interacted with, we can lose 1px of fat and look great! :^)
2020-04-24 19:05:04 +02:00
Andreas Kling
9617b7ede4 FileManager: Set content margin of DirectoryView to same as children 2020-04-24 19:05:04 +02:00
Andreas Kling
42f0b2522b LibGUI: Introduce widget content margins + improve splitters
A GUI::Widget can now set an optional content margin (4x0 by default.)
Pixels in the content margin will be ignored for hit testing purposes.

Use this to allow frame-like widgets (like GUI::Frame!) to ignore any
mouse events in the frame area, and instead let those go to parent.

This allows GUI::Splitter to react "sooner" to mouse events that were
previously swallowed by the child widgets instead of ending up in the
splitter. The net effect is that 2 more pixels on each side of a
splitter handle are now interactive and usable for splitting! :^)
2020-04-24 19:05:02 +02:00
Andreas Kling
9badcff1ba WindowServer: Don't allow activating disabled menu items with keyboard 2020-04-24 17:29:42 +02:00
Andreas Kling
e786444ffa WindowServer: Fix name typo in descend_into_submenu_at_hovered_item() 2020-04-24 17:26:16 +02:00
Andreas Kling
cbb3c7aade WindowServer: Skip over disabled menu items during keyboard navigation 2020-04-24 17:24:09 +02:00
Andreas Kling
4218b00cb4 Base: Tweak ladybug icon 2020-04-24 17:10:59 +02:00
Andreas Kling
5d88022252 LibGUI: When removing a TabWidget tab, activate the next tab 2020-04-24 17:10:59 +02:00
Kesse Jones
b0ca174d49 LibJS: Add Array.prototype.find 2020-04-24 17:10:19 +02:00
Linus Groh
fd5f05079d QuickShow: Properly hide toolbar on toggle action
Similar to fullscreen mode we need to hide the toolbar's container.
2020-04-24 17:00:00 +02:00
Linus Groh
d86d73f6e8 QuickShow: Hide toolbar container in fullscreen mode
If we just hide the toolbar itself, its container is still visible and
taking up space at the top of the screen.
2020-04-24 17:00:00 +02:00
Andreas Kling
5c2bdbf27f Browser+LibWeb: Open link in new tab on Ctrl+Click :^) 2020-04-24 14:43:56 +02:00
Andreas Kling
d5d8e87d56 Browser: Scope tab-specific actions to the tab itself
This makes LibGUI choose the correct action depending on which tab
is currently active (technically which tab is *focused*.)

Fixes #1935.
2020-04-24 14:34:24 +02:00
Andreas Kling
a2bdcfabc9 LibGUI: Grant focus when activating a new stack/tab child widget
This makes opening a tab actually focus the opened tab.
2020-04-24 14:34:24 +02:00
Andreas Kling
d0578bfa32 LibGUI: Search the entire focus chain for shortcut actions
Instead of only looking in the focused widget, we now also look in the
ancestor chain of that widget for any ancestor with a registered action
for the given shortcut.

This makes it possible for parent widgets to capture action activations
while one of their children is focused.
2020-04-24 14:34:24 +02:00
Linus Groh
896decd4d5 Browser: Open links with target="_blank" in new tab 2020-04-24 14:34:11 +02:00
Linus Groh
061205b3b3 LibWeb: Pass link target to HtmlView's on_link_click callback 2020-04-24 14:34:11 +02:00
Linus Groh
95b51e857d LibJS: Add TokenType::TemplateLiteral
This is required for template literals - we're not quite there yet, but at
least the parser can now tell us when this token is encountered -
currently this yields "Unexpected token Invalid". Not really helpful.

The character is a "backtick", but as we already have
TokenType::{StringLiteral,RegexLiteral} this seemed like a fitting name.

This also enables syntax highlighting for template literals in the js
REPL and LibGUI's JSSyntaxHighlighter.
2020-04-24 11:18:57 +02:00
Linus Groh
57caca3171 LibJS: Fix ObjectExpression::execute()
Change from code review changed key() and value() getters - forgot to
update this...
2020-04-24 00:02:07 +02:00
Linus Groh
746dd5b190 LibJS: Implement computed properties in object expressions 2020-04-23 23:56:04 +02:00
Linus Groh
bebd5c097c LibJS: Require colon in object expression for non-identifier keys
{foo} is valid - {"foo"} or {1} is not.
2020-04-23 23:56:04 +02:00