summaryrefslogtreecommitdiff
path: root/Userland/Applications/Presenter/Presentation.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-01-09 00:44:32 +0100
committerLinus Groh <mail@linusgroh.de>2023-01-09 22:34:57 +0000
commit3110f5b32869e2e7cce08d226400f33152429229 (patch)
tree14875b1cafaf9dc143e102fc4673bbf0b9ff0e94 /Userland/Applications/Presenter/Presentation.h
parented3c2cbdf6e29e545fabfb862bbbbfaf05bb1ad6 (diff)
downloadserenity-3110f5b32869e2e7cce08d226400f33152429229.zip
Presenter: Rearchitect on top of LibWeb
This patch replaces the bespoke rendering engine in Presenter with a simple pipeline that turns presentations into single-page HTML files. The HTML is then loaded into an OutOfProcessWebView. This achieves a number of things, most importantly: - Access to all the CSS features supported by LibWeb - Sandboxed, multi-process rendering The code could be simplified a lot further, but I wanted to get the new architecture in place without changing anything about the file format.
Diffstat (limited to 'Userland/Applications/Presenter/Presentation.h')
-rw-r--r--Userland/Applications/Presenter/Presentation.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/Userland/Applications/Presenter/Presentation.h b/Userland/Applications/Presenter/Presentation.h
index 6ad200811d..f2e6084d0a 100644
--- a/Userland/Applications/Presenter/Presentation.h
+++ b/Userland/Applications/Presenter/Presentation.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
+ * Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -8,11 +9,9 @@
#include "Slide.h"
#include <AK/DeprecatedString.h>
-#include <AK/Forward.h>
#include <AK/HashMap.h>
#include <AK/NonnullOwnPtr.h>
#include <AK/Vector.h>
-#include <LibGfx/Painter.h>
#include <LibGfx/Size.h>
static constexpr int const PRESENTATION_FORMAT_VERSION = 1;
@@ -23,8 +22,7 @@ class Presentation {
public:
~Presentation() = default;
- // We can't pass this class directly in an ErrorOr because some of the components are not properly moveable under these conditions.
- static ErrorOr<NonnullOwnPtr<Presentation>> load_from_file(StringView file_name, NonnullRefPtr<GUI::Window> window);
+ static ErrorOr<NonnullOwnPtr<Presentation>> load_from_file(StringView file_name);
StringView title() const;
StringView author() const;
@@ -38,8 +36,7 @@ public:
void previous_frame();
void go_to_first_slide();
- // This assumes that the caller has clipped the painter to exactly the display area.
- void paint(Gfx::Painter& painter) const;
+ ErrorOr<DeprecatedString> render();
private:
static HashMap<DeprecatedString, DeprecatedString> parse_metadata(JsonObject const& metadata_object);