C++ DevKit
C++ set of OOP library
display_device.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "pico/stdlib.h"
14#include "sw/widget/canvas.h"
15
16
25
28class DisplayDevice
29{
30private:
31 /* data */
32public:
33 DisplayDevice(/* args */);
34 virtual ~DisplayDevice();
35};
36
37class rtos_DisplayDevice;
38class rtos_Widget;
39
42{
46 rtos_DisplayDevice *display = nullptr;
48 rtos_Widget *widget = nullptr;
49};
50
53class GraphicDisplayDevice : public DisplayDevice
54{
55protected:
56public:
61
65 virtual void check_display_device_compatibility(struct_ConfigGraphicWidget framebuffer_cfg, CanvasFormat canvas_format) = 0;
66
76 virtual void show(Canvas *canvas, const uint8_t anchor_x, const uint8_t anchor_y) = 0;
77
84 GraphicDisplayDevice(size_t screen_width,
85 size_t screen_height);
86
88 virtual ~GraphicDisplayDevice();
89};
90
95class TerminalConsole : public DisplayDevice
96{
97private:
98public:
106 char *text_buffer = nullptr;
107
111 TerminalConsole(size_t number_of_char_width,
112 size_t number_of_char_hieght);
113 virtual ~TerminalConsole();
114
116 virtual void show();
117};
CanvasFormat
the format of the canvas
Definition canvas.h:62
The canvas is a virtual memory in which the widget draws.
Definition canvas.h:130
virtual ~GraphicDisplayDevice()
Destroy the Display Device object.
Definition display_device.cpp:20
virtual void show(Canvas *canvas, const uint8_t anchor_x, const uint8_t anchor_y)=0
A pure virtual member function. It transfers the pixel buffer to the a part of display screen buffer ...
size_t TFT_panel_width_in_pixel
the physical width of the screen (in pixel)
Definition display_device.h:58
size_t TFT_panel_height_in_pixel
the physical height of the screen (in pixel)
Definition display_device.h:60
virtual void check_display_device_compatibility(struct_ConfigGraphicWidget framebuffer_cfg, CanvasFormat canvas_format)=0
A pure virtual member function. Each device must implement this method and check the compatibility of...
GraphicDisplayDevice(size_t screen_width, size_t screen_height)
Construct a new Display Device object.
Definition display_device.cpp:13
virtual void show()
the method that actually print the content of text_buffer on the console
Definition display_device.cpp:38
TerminalConsole(size_t number_of_char_width, size_t number_of_char_hieght)
Construct a new Terminal Console object.
Definition display_device.cpp:24
size_t number_of_line
the number of line
Definition display_device.h:102
size_t text_buffer_size
the number of characters
Definition display_device.h:104
size_t number_of_column
the size, in number of character of a line
Definition display_device.h:100
char * text_buffer
the effective character buffer
Definition display_device.h:106
DisplayCommand
Enumeration of display commands for display task management.
Definition display_device.h:19
@ SHOW_IMAGE
Command to show an image.
Definition display_device.h:23
@ CLEAR_SCREEN
Command to clear the screen.
Definition display_device.h:21
data structure used to configure graphic framebuffer
Definition canvas.h:82
data structure used to queue widget data to send to the display task
Definition display_device.h:42
DisplayCommand command
the command to be executed by the display task
Definition display_device.h:44
rtos_DisplayDevice * display
the display device
Definition display_device.h:46
rtos_Widget * widget
the widget to be displayed
Definition display_device.h:48