1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:07:34 +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,38 @@
/*
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "LibGUI/Action.h"
#include "Presentation.h"
#include <LibGUI/Event.h>
#include <LibGUI/UIDimensions.h>
#include <LibGUI/Widget.h>
// Title, Author
constexpr StringView const title_template = "{} ({}) — Presenter"sv;
class PresenterWidget : public GUI::Widget {
C_OBJECT(PresenterWidget);
public:
PresenterWidget();
ErrorOr<void> initialize_menubar();
virtual ~PresenterWidget() override = default;
// Errors that happen here are directly displayed to the user.
void set_file(StringView file_name);
protected:
virtual void paint_event(GUI::PaintEvent&) override;
virtual void keydown_event(GUI::KeyEvent&) override;
private:
OwnPtr<Presentation> m_current_presentation;
RefPtr<GUI::Action> m_next_slide_action;
RefPtr<GUI::Action> m_previous_slide_action;
};