mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:32:46 +00:00 
			
		
		
		
	 de44d6c0a6
			
		
	
	
		de44d6c0a6
		
	
	
	
	
		
			
			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
		
			
				
	
	
		
			38 lines
		
	
	
	
		
			962 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
	
		
			962 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * 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;
 | |
| };
 |