1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:17:45 +00:00

Applications: Add Presenter

This version can already:
- load all of the defined file format except for the image type and the
  frame-specific stuff
- navigate frames and slides (though frames are mostly stubbed out)
- display text with various common settings
- displays text with various fitting and scaling methods
- scale and position objects correctly no matter the window size
This commit is contained in:
kleines Filmröllchen 2022-10-20 22:30:39 +02:00 committed by Andrew Kaster
parent 295f83e54c
commit de44d6c0a6
12 changed files with 828 additions and 0 deletions

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "SlideObject.h"
#include <AK/Forward.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/String.h>
#include <LibGfx/Forward.h>
// A single slide of a presentation.
class Slide final {
public:
static ErrorOr<Slide> parse_slide(JsonObject const& slide_json, NonnullRefPtr<GUI::Window> window);
// FIXME: shouldn't be hard-coded to 1.
unsigned frame_count() const { return 1; }
StringView title() const { return m_title; }
void paint(Gfx::Painter&, unsigned current_frame, Gfx::FloatSize display_scale) const;
private:
Slide(NonnullRefPtrVector<SlideObject> slide_objects, String title);
NonnullRefPtrVector<SlideObject> m_slide_objects;
String m_title;
};