Commit graph

1377 commits

Author SHA1 Message Date
Hüseyin ASLITÜRK
3ebdb5ea30 Application: KeyboardMapper, make button to like a real key
Change key paint to more like a real key :)
2020-06-13 12:36:30 +02:00
Andreas Kling
6f19067c9a LibWeb+Browser: Add a barebones LayoutTreeModel to the inspector window
This allows you to inspect the layout tree, along side the DOM tree.
It will need more functionality to be truly useful, but it's a start.
2020-06-12 22:30:11 +02:00
Andreas Kling
68ae1de463 Browser: Be a little bit smarter about interpretering command line URLs
If the (optional) URL specified on the command line is an existing file
we now resolve its real path before turning into a URL. This makes
relative URLs inside the loaded document work correctly.

Also interpret all other specified URLs the same way we would if you
had typed them into the location bar.
2020-06-12 21:29:27 +02:00
Andreas Kling
fdfda6dec2 AK: Make string-to-number conversion helpers return Optional
Get rid of the weird old signature:

- int StringType::to_int(bool& ok) const

And replace it with sensible new signature:

- Optional<int> StringType::to_int() const
2020-06-12 21:28:55 +02:00
Sergey Bugaev
eb3700c565 Calendar: Fix using OwnPtr<> with RefCounted types 2020-06-12 16:08:45 +02:00
Andreas Kling
116cf92156 LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
2020-06-10 10:59:04 +02:00
Andreas Kling
5042e560ef LibJS: Make more Interpreter functions take a GlobalObject& 2020-06-08 21:25:16 +02:00
Andreas Kling
92392398a2 LibWeb: Add Page abstraction between PageView and main Frame
* A PageView is a view onto a Page object.
* A Page always has a main Frame (root of Frame tree.)
* Page has a PageClient. PageView is a PageClient.

The goal here is to allow building another kind of view onto
a Page while keeping the rest of LibWeb intact.
2020-06-08 21:12:20 +02:00
Hüseyin ASLITÜRK
ddeb0ab1ad Applications: Add new KeyboardSettings application
GUI application to manage Keyboard settings.
2020-06-08 09:28:18 +02:00
Andreas Kling
896db187e5 LibWeb: Move Frame.{cpp,h} into a new Frame/ directory 2020-06-07 10:14:41 +02:00
Andreas Kling
d127492f0e TextEditor: Allow "TextEditor foo.txt" to create a new file
Attempting to open a non-existent file from the command line should not
fail, it should just open a new text document with that name. Note that
the file is not created until you actually save it.
2020-06-04 22:15:10 +02:00
Andreas Kling
959de19418 LibWeb: Process style sheets in document order
Until now we would simply apply stylesheets in the order they finished
loading. This patch adds a StyleSheetList object that hangs off of each
Document and contains all the style sheets in document order.

There's still a lot of work to do for a proper cascade, but at least
this makes us consistently wrong every time. :^)
2020-06-04 16:06:32 +02:00
Hüseyin ASLITÜRK
d315281d56 PixelPaint: Use new app-pixel-paint.png for app icon 2020-06-04 12:34:31 +02:00
Andreas Kling
6c09420571 KeyboardMapper: Add missing #pragma once 2020-06-03 22:06:08 +02:00
Hüseyin ASLITÜRK
d3578fdf9b Applications: Add new KeyboardMapper application
New editing app for keymap files.
2020-06-03 21:52:40 +02:00
Sergey Bugaev
e651af21f8 Calculator: Set text color through the palette
Unfortunately, this means the Calculator won't pick up system theme changes
dynamically.

Fixes https://github.com/SerenityOS/serenity/issues/1077
2020-06-02 21:49:47 +02:00
Linus Groh
a48080f62d LibJS: Move Interpreter::get_trace() to ConsoleClient
Having it globally on the interpreter is confusing as the last call frame
is skipped, which is specific to console.trace().
2020-06-02 15:22:34 +02:00
Linus Groh
871d88cd91 FontEditor: Fix typo in comment
s/Ediyor/Editor/
2020-06-02 14:38:17 +02:00
Andreas Kling
6ed11f1d1c LibWeb: Move ResourceLoader into a new Loader/ directory 2020-06-01 20:42:50 +02:00
Andreas Kling
8766e49a7c LibWeb+Browser: Use the new HTML parser by default
You can still run the old parser with "br -O", but the new one is good
enough to be the default parser now. We'll fix issues as we go and
eventually remove the old one completely. :^)
2020-06-01 19:08:31 +02:00
Andreas Kling
1a15ca2de4 Browser: Show download progress in the taskbar if available 2020-05-30 23:00:35 +02:00
FalseHonesty
20faa93cb0 LibMarkdown: Change internal MD API to return OwnPtrs
Previously, all Markdown blocks had a virtual parse method which has
been swapped out for a static parse method returning an OwnPtr of
that block's type.

The Text class also now has a static parse method that will return an
Optional<Text>.
2020-05-30 00:32:12 +02:00
FalseHonesty
7ca562b200 LibMarkdown: Change MD Document parse API to return a RefPtr
Markdown documents are now obtained via the static Document::parse
method, which returns a RefPtr<Document>, or nullptr on failure.
2020-05-30 00:32:12 +02:00
FalseHonesty
9a2177437b Browser: Add clear output button to the console 2020-05-29 22:14:45 +02:00
Emanuele Torre
937d0be762 Meta: Add a script check the presence of "#pragma once" in header files
.. and make travis run it.

I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.

It also checks the presence of a (single) blank line above and below the
"#pragma once" line.

I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.

I also ran clang-format on the files I modified.
2020-05-29 07:59:45 +02:00
Gabriel Mihalache
8e151ff33e
PixelPaint: Set active layer to nullptr after its removal (#2433)
This prevents a crash if removal was called twice, without setting a
new active layer in the meanwhile.
2020-05-29 07:58:22 +02:00
Sergey Bugaev
4b300e085d Userland+SystemMonitor: Recognize the MS_RDONLY mount flag 2020-05-29 07:53:30 +02:00
Andreas Kling
42243d2e06 LibWeb: Rename Web::HtmlView => Web::PageView
This widget doesn't just view HTML, it views a web page. :^)
2020-05-28 18:22:54 +02:00
Andreas Kling
e026a50777 Browser: Switch focus to the web page after pressing return in URL bar
Instead of dropping focus entirely, which felt weird.
2020-05-28 18:18:20 +02:00
Emanuele Torre
97b5fbda7f IRCClient: remove some unused headers and replace tabs with spaces 2020-05-28 17:01:31 +02:00
FalseHonesty
112b4de430 IRCClient: Enable history on the message box 2020-05-28 10:33:20 +02:00
Andreas Kling
2cb50f6750 LibWeb+Browser: Add ability to run Browser with the new HTML parser
You can now pass "-n" to the browser to use the new HTML parser.
It's not turned on by default since it's still very immature, but this
is a huge step towards bringing it into maturity. :^)
2020-05-27 21:57:30 +02:00
FalseHonesty
08e2907210 Browser: Add console history to re-send old commands
The console has now enabled history in its input text box. Pretty
nice to not have to retype things all the time :^)
2020-05-27 20:04:52 +02:00
Nick Vella
e53fa97cfb LibGUI, About: Implement system-wide W2k-esque About dialog
The new About dialog reads version information from /res/version.ini,
which is generated at build time.
2020-05-27 11:44:19 +02:00
AnotherTest
70a213a6ec LibLine: Use Core::EventLoop for outer read loop
This commit changes LibLine's internal structure to work in an event
loop, and as a result, also switches it to being a Core::Object.
2020-05-27 11:13:02 +02:00
FalseHonesty
e4760e5b42 Browser: Add option in DownloadWidget to open download's in folder
When a download has completed, instead of graying out the cancel
option, replace it with an option to open your download in the file
manager.
2020-05-26 21:09:45 +02:00
Linus Groh
0f2b3cd280 Browser: Show a "source location hint" for syntax errors :^) 2020-05-26 14:36:30 +02:00
Sergey Bugaev
602c3fdb3a AK: Rename FileSystemPath -> LexicalPath
And move canonicalized_path() to a static method on LexicalPath.

This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
2020-05-26 14:35:10 +02:00
Sergey Bugaev
4139838a93 Userland et al: Pledge sigaction when needed
* In some cases, we can first call sigaction()/signal(), then *not* pledge
  sigaction.
* In other cases, we pledge sigaction at first, call sigaction()/signal()
  second, then pledge again, this time without sigaction.
* In yet other cases, we keep the sigaction pledge. I suppose these could all be
  migrated to drop it or not pledge it at all, if somebody is interested in
  doing that.
2020-05-26 14:35:10 +02:00
Andreas Kling
b5788594f9 PixelPaint: Let Layer track whether it's selected or not
This will simplify a lot of code that keeps getting more confusing.
2020-05-26 10:18:03 +02:00
Andreas Kling
18d68c8c94 PixelPaint: Add selection functionality to the LayerListWidget
Now we can get rid of the old table view and with it the LayerModel.
2020-05-26 10:18:03 +02:00
Andreas Kling
e4b11a23b7 PixelPaint: Allow reordering layer by dragging them in LayerListWidget
This is rather cool! :^)
2020-05-26 10:18:03 +02:00
Andreas Kling
dc3de47b03 PixelPaint: Have layers and images send out notifications on changes
We use this to automatically update the thumbnail in LayerListWidget
when you draw into a layer. We also use it to repaint the ImageEditor
when the image changes somehow. :^)
2020-05-26 10:18:03 +02:00
Andreas Kling
de85cd0907 PixelPaint: Start working on a custom layer list widget
Instead of using a TableView to show the layer stack, let's build a new
custom widget for this purpose and give it some neat features!

This patch also introduces an ImageClient interface for Image to notify
interested parties about things happening. The LayerListWidget is the
first ImageClient and listens for "layer added" and "layer removed"
notifications. :^)
2020-05-26 10:18:03 +02:00
FalseHonesty
d2b493b74e Browser: Add output styles to JS source printed in the console
This patch uses the new JS::MarkupGenerator to stylize all of the
source code and runtime values printed in the console's output panel.
This also does away with the Console's global style sheet, as all
styling is handled by the MarkupGenerator and the System Palette.
2020-05-26 10:17:50 +02:00
FalseHonesty
941b028ca3 LibJS: Create JS to HTML markup generator
The new JS::MarkupGenerator class can convert both a JS source string
and a JS Runtime Value into properly formatted HTML using the new
LibWeb System Palette css color values.

It makes more sense for this JS -> HTML process to occur in LibJS
so that it can be used elsewhere, namely Markdown code block syntax
highlighting. It also means the Browser can worry less about LibJS
implementation details.
2020-05-26 10:17:50 +02:00
AnotherTest
2814b5a918 Terminal: Handle fork error by whining about it 2020-05-25 21:36:51 +02:00
AnotherTest
bc9013f706 LibLine: Change get_line to return a Result<String, Error>
This fixes a bunch of FIXME's in LibLine.
Also handles the case where read() would read zero bytes in vt_dsr() and
effectively block forever by erroring out.

Fixes #2370
2020-05-25 21:36:51 +02:00
Linus Groh
c378a1c730 HexEditor: Fix "Selected Bytes" count for backwards selection 2020-05-25 18:14:25 +02:00
FalseHonesty
2c2ce5be64 Browser: Add output styles to values printed in the console
This patch adds spans around most of the console's output, allowing
for a global document stylesheet to customize the highlighting of
the console's output. It also adds some basic styling for values
like strings, numbers, and arrays using the system Palette.

Note: This patch simply adds support for highlighting output values,
the lines of JS code printed to console are still unformatted.
2020-05-25 11:33:52 +02:00