21#include "pico/stdlib.h"
24#define SSD1306_ASCII_FULL
34#define HORIZONTAL_TAB '\t'
38#define VERTICAL_TAB '\v'
42#define CARRIAGE_RETURN '\r'
55 int8_t previous_blinking_phase;
58 uint32_t blink_period_us{1000000};
61 bool blink_phase_changed;
148 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);
220 Model *displayed_object =
nullptr);
231 Model *displayed_object =
nullptr);
245 size_t frame_width,
size_t frame_height,
246 Model *displayed_object =
nullptr);
260 void hline(uint8_t x, uint8_t y,
size_t w,
ColorIndex color = ColorIndex::WHITE);
267 void vline(uint8_t x, uint8_t y,
size_t h,
ColorIndex color = ColorIndex::WHITE);
275 void line(
int x0,
int y0,
int x1,
int y1,
ColorIndex color = ColorIndex::WHITE);
284 void rect(uint8_t start_x, uint8_t start_y,
size_t w,
size_t h,
bool fill =
false,
ColorIndex color = ColorIndex::WHITE);
319 void circle(
int radius,
int x_center,
int y_center,
bool fill =
false,
ColorIndex color = ColorIndex::WHITE);
328 uint8_t current_char_line{0};
331 uint8_t current_char_column{0};
337 void write(
char character, uint8_t char_column, uint8_t char_line);
345 const unsigned char *font{
nullptr};
354 bool auto_next_char{
true};
360 void draw_glyph(
const char character,
361 const uint8_t anchor_x,
const uint8_t anchor_y);
392 Model *displayed_object =
nullptr);
407 Model *displayed_object =
nullptr);
431 void write(
const char *c_str);
CanvasFormat
the format of the canvas
Definition canvas.h:60
ColorIndex
define the code value for color
Definition canvas.h:26
void set_blink_us(uint32_t blink_period=1000000)
Set the blink period in microseconds.
Definition widget.cpp:608
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:593
bool has_blinking_changed()
return the status of the flag blink_phase_changed
Definition widget.cpp:613
void clear_blinking_phase_change()
set blink_phase_changed = False
Definition widget.cpp:618
The canvas is a virtual memory in which the widget draws.
Definition canvas.h:121
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:76
void create_text_buffer()
create text buffer and delete the old one if already existing
Definition widget.cpp:289
void draw()
we need draw() to be compliant with the pure virtual draw() inherited from Widget.
Definition widget.cpp:500
void next_char()
character column steps forward one position forward.
Definition widget.cpp:454
void write()
process characters in the internal text buffer and draw it into the pixel buffer.
Definition widget.cpp:381
~TextWidget()
the destructor of TextWidget
Definition widget.cpp:346
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:371
void next_line()
character line steps one position downward.
Definition widget.cpp:446
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:313
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:351
void draw_border(ColorIndex color=ColorIndex::WHITE)
draw a one-pixel width around the the frame
Definition widget.cpp:513
uint8_t number_of_column
The max number of line with respect to frame height and font height.
Definition widget.h:369
void clear_text_buffer()
et text buffer memory to "0" and set character current line and column to 0
Definition widget.cpp:363
struct_ConfigTextWidget get_text_frame_config()
Get the text frame config object.
Definition widget.cpp:297
char * text_buffer
the buffer where text are written
Definition widget.h:380
size_t text_buffer_size
size of the buffer that contains text as string of characters.
Definition widget.h:378
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:396
uint8_t number_of_line
The max number of column with respect to frame width and font width.
Definition widget.h:371
the data structure used to configure textual widget
Definition canvas.h:92