26#include "pico/stdlib.h"
29#define SSD1306_ASCII_FULL
39#define HORIZONTAL_TAB '\t'
43#define VERTICAL_TAB '\v'
47#define CARRIAGE_RETURN '\r'
60 int8_t previous_blinking_phase;
63 uint32_t blink_period_us{1000000};
66 bool blink_phase_changed;
153 void ellipse(uint8_t x_center, uint8_t y_center, uint8_t x_radius, uint8_t y_radius,
bool fill, uint8_t quadrant,
ColorIndex color);
230 Model *displayed_object =
nullptr);
241 Model *displayed_object =
nullptr);
255 size_t frame_width,
size_t frame_height,
256 Model *displayed_object =
nullptr);
270 void hline(uint8_t x, uint8_t y,
size_t w,
ColorIndex color = ColorIndex::WHITE);
277 void vline(uint8_t x, uint8_t y,
size_t h,
ColorIndex color = ColorIndex::WHITE);
285 void line(
int x0,
int y0,
int x1,
int y1,
ColorIndex color = ColorIndex::WHITE);
294 void rect(uint8_t start_x, uint8_t start_y,
size_t w,
size_t h,
bool fill =
false,
ColorIndex color = ColorIndex::WHITE);
329 void circle(
int radius,
int x_center,
int y_center,
bool fill =
false,
ColorIndex color = ColorIndex::WHITE);
338 uint8_t current_char_line{0};
341 uint8_t current_char_column{0};
347 void write(
char character, uint8_t char_column, uint8_t char_line);
355 const unsigned char *font{
nullptr};
364 bool auto_next_char{
true};
370 void draw_glyph(
const char character,
371 const uint8_t anchor_x,
const uint8_t anchor_y);
402 Model *displayed_object =
nullptr);
417 Model *displayed_object =
nullptr);
441 void write(
const char *c_str);
CanvasFormat
the format of the canvas
Definition canvas.h:61
ColorIndex
define the code value for color
Definition canvas.h:27
void set_blink_us(uint32_t blink_period=1000000)
Set the blink period in microseconds.
Definition widget.cpp:671
virtual void compute_blinking_phase()
compute if the system clock divided by the blink_period is odd or even and if this has changed since ...
Definition widget.cpp:656
bool has_blinking_changed()
return the status of the flag blink_phase_changed
Definition widget.cpp:676
void clear_blinking_phase_change()
set blink_phase_changed = False
Definition widget.cpp:681
The canvas is a virtual memory in which the widget draws.
Definition canvas.h:129
A generic class for all display device.
Definition display_device.h:19
This is the abstract class to handle all generic behavior of physical graphic display devices (e....
Definition display_device.h:30
This is the Model abstract class of Model_View_Control design pattern.
Definition ui_core.h:67
A class dedicated to pure text display such as console, printer, ASCII character line display.
Definition display_device.h:95
void create_text_buffer()
create text buffer and delete the old one if already existing
Definition widget.cpp:336
void draw()
we need draw() to be compliant with the pure virtual draw() inherited from Widget.
Definition widget.cpp:563
void next_char()
character column steps forward one position forward.
Definition widget.cpp:517
void write()
process characters in the internal text buffer and draw it into the pixel buffer.
Definition widget.cpp:444
virtual ~TextWidget()
the destructor of TextWidget
Definition widget.cpp:400
void update_canvas_buffer_size(const unsigned char *font)
compute canvas width and height according to the size of the text (column x line ) and the size of th...
Definition widget.cpp:428
void next_line()
character line steps one position downward.
Definition widget.cpp:509
TextWidget(GraphicDisplayDevice *graphic_display_screen, struct_ConfigTextWidget text_cfg, CanvasFormat canvas_format, Model *displayed_object=nullptr)
The max number of line with respect to frame height and font height.
Definition widget.cpp:360
void update_text_frame_size(const unsigned char *font)
Compute the text size in column x line according to the size of the font and the size of the frame in...
Definition widget.cpp:408
void draw_border(ColorIndex color=ColorIndex::WHITE)
draw a one-pixel width around the the frame
Definition widget.cpp:576
uint8_t number_of_column
The max number of line with respect to frame height and font height.
Definition widget.h:379
void clear_text_buffer()
et text buffer memory to "0" and set character current line and column to 0
Definition widget.cpp:420
struct_ConfigTextWidget get_text_frame_config()
Get the text frame config object.
Definition widget.cpp:344
char * text_buffer
the buffer where text are written
Definition widget.h:390
size_t text_buffer_size
size of the buffer that contains text as string of characters.
Definition widget.h:388
void process_char(char character)
interpret the character and draw it into the pixel buffer at the current line and column character po...
Definition widget.cpp:459
uint8_t number_of_line
The max number of column with respect to frame width and font width.
Definition widget.h:381
the data structure used to configure textual widget
Definition canvas.h:100
data structure used to queue data to send to the display task
Definition display_device.h:77