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'
206 Model *displayed_object =
nullptr);
217 Model *displayed_object =
nullptr);
231 size_t frame_width,
size_t frame_height,
232 Model *displayed_object =
nullptr);
246 void hline(uint8_t x, uint8_t y,
size_t w,
ColorIndex color = ColorIndex::WHITE);
253 void vline(uint8_t x, uint8_t y,
size_t h,
ColorIndex color = ColorIndex::WHITE);
261 void line(
int x0,
int y0,
int x1,
int y1,
ColorIndex color = ColorIndex::WHITE);
270 void rect(uint8_t start_x, uint8_t start_y,
size_t w,
size_t h,
bool fill =
false,
ColorIndex color = ColorIndex::WHITE);
305 void circle(
int radius,
int x_center,
int y_center,
bool fill =
false,
ColorIndex color = ColorIndex::WHITE);
323 void write(
char character, uint8_t char_column, uint8_t char_line);
331 const unsigned char *
font{
nullptr};
347 const uint8_t anchor_x,
const uint8_t anchor_y);
378 Model *displayed_object =
nullptr);
393 Model *displayed_object =
nullptr);
417 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
bool blink_phase_changed
a flag that indicates the blinking phase has changed
Definition widget.h:61
int8_t previous_blinking_phase
store the value of the previous blinking phase.should be 0 or 1.
Definition widget.h:55
void set_blink_us(uint32_t blink_period=1000000)
Set the blink period in microseconds.
Definition widget.cpp:589
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:574
uint32_t blink_period_us
The period of the blinking, in microseconds.
Definition widget.h:58
bool has_blinking_changed()
return the status of the flag blink_phase_changed
Definition widget.cpp:594
void clear_blinking_phase_change()
set blink_phase_changed = False
Definition widget.cpp:599
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:33
This is the abstract class to handle all generic behavior of physical graphic display devices (e....
Definition display_device.h:58
This is the Model abstract class of Model_View_Control design pattern.
Definition ui_core.h:37
A class dedicated to pure text display such as console, printer, ASCII character line display.
Definition display_device.h:100
uint8_t tab_size
The number of space that ASCII character HT (aka TAB , "\t", 0x9) generates, default to 2.
Definition widget.h:334
void create_text_buffer()
create text buffer and delete the old one if already existing
Definition widget.cpp:315
virtual void draw()
we need draw() to be compliant with the pure virtual draw() inherited from Widget.
Definition widget.cpp:542
void next_char()
character column steps forward one position forward.
Definition widget.cpp:496
void write()
process characters in the internal text buffer and draw it into the pixel buffer.
Definition widget.cpp:423
void draw_glyph(const char character, const uint8_t anchor_x, const uint8_t anchor_y)
a graphic primitive to draw a character at a pixel position. Strongly dependent on font memory organi...
Definition widget.cpp:509
virtual ~TextWidget()
the destructor of TextWidget
Definition widget.cpp:379
bool auto_next_char
auto_next_char flag : if true each char steps one position after being written.
Definition widget.h:340
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:407
const unsigned char * font
The font used. Current font are defined according to IBM CP437. The font files are derived from https...
Definition widget.h:331
void next_line()
character line steps one position downward.
Definition widget.cpp:488
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:339
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:387
void draw_border(ColorIndex color=ColorIndex::WHITE)
draw a one-pixel width around the the frame
Definition widget.cpp:555
uint8_t number_of_column
The max number of line with respect to frame height and font height.
Definition widget.h:355
uint8_t current_char_line
the line number where the next character will be written.
Definition widget.h:314
void clear_text_buffer()
et text buffer memory to "0" and set character current line and column to 0
Definition widget.cpp:399
struct_ConfigTextWidget get_text_frame_config()
Get the text frame config object.
Definition widget.cpp:323
char * text_buffer
the buffer where text are written
Definition widget.h:366
void clear_line()
clean th full current line (writing " " in the text buffer)
Definition widget.cpp:309
size_t text_buffer_size
size of the buffer that contains text as string of characters.
Definition widget.h:364
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:438
uint8_t number_of_line
The max number of column with respect to frame width and font width.
Definition widget.h:357
bool wrap
Wrap flag : if true, text wrap to the next line when end of line is reached.
Definition widget.h:337
uint8_t current_char_column
the column where the next character will be written.
Definition widget.h:317
the data structure used to configure textual widget
Definition canvas.h:100