1.10
composerscreen.h
1/*
2 * Copyright (C) 2021 Microchip Technology Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef EGT_DETAIL_SCREEN_COMPOSERSCREEN_H
7#define EGT_DETAIL_SCREEN_COMPOSERSCREEN_H
8
14#include <egt/screen.h>
15#include <egt/signal.h>
16
17namespace egt
18{
19inline namespace v1
20{
21namespace detail
22{
23
27class EGT_API ComposerScreen : public Screen
28{
29public:
30
31 explicit ComposerScreen(const Size& size = Size(800, 480));
32
33 void schedule_flip() override {}
34
35 EGT_NODISCARD bool is_composer() const override { return true; }
36
37 EGT_NODISCARD unsigned char* get_pixmap();
38
39 void resize(const Size& size);
40
66
77
78private:
80 static Signal<> on_screen_resized;
81};
82
83}
84}
85}
86
87#endif
Manages one of more buffers that make up a Screen.
Definition screen.h:34
Signal class used for defining a signal and dispatching events.
Definition signal.h:30
uint32_t RegisterHandle
Handle type.
Definition signal.h:46
std::function< void(Args...)> EventCallback
Event handler callback function.
Definition signal.h:41
Screen in an in-memory buffer for the Microchip Graphic Composer.
Definition composerscreen.h:28
static Signal ::RegisterHandle register_screen_resize_hook(const Signal<>::EventCallback &handler)
Register a handler to manage screen size changes.
EGT_NODISCARD unsigned char * get_pixmap()
void resize(const Size &size)
void schedule_flip() override
Schedule a flip to occur later.
Definition composerscreen.h:33
static void unregister_screen_resize_hook(Signal<>::RegisterHandle handle)
Unregister a handler that managed screen size changes.
EGT_NODISCARD bool is_composer() const override
Returns true if this is a screen used with the Microchip Graphic Composer.
Definition composerscreen.h:35
ComposerScreen(const Size &size=Size(800, 480))
EGT framework namespace.
Definition animation.h:24