From c17f147be95e7490e5207c747add2da1cc8b167f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 6 Feb 2019 12:13:17 -0800 Subject: A variety of displayio improvements This changes a number of things in displayio: * Introduces BuiltinFont and Glyph so the built in font can be used by libraries. For boards with a font it is available as board.TERMINAL_FONT. Fixes #1172 * Remove _load_row from Bitmap in favor of bitmap[] access. Index can be x/y tuple or overall index. Fixes #1191 * Add width and height properties to Bitmap. * Add insert and [] access to Group. Fixes #1518 * Add index param to pop on Group. * Terminal no longer takes unicode character info. It takes a BuiltinFont instead. * Fix Terminal's handling of [###D vt100 commands used when up arrowing into repl history. * Add x and y positions to Group plus scale as well. * Add bitmap accessor for BuiltinFont --- supervisor/shared/display.c | 3 ++- supervisor/shared/display.h | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'supervisor/shared') diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 2652630be..679354473 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -134,7 +134,8 @@ displayio_bitmap_t blinka_bitmap = { .bits_per_value = 4, .x_shift = 3, .x_mask = 0x7, - .bitmask = 0xf + .bitmask = 0xf, + .read_only = true }; uint32_t blinka_transparency[1] = {0x80000000}; diff --git a/supervisor/shared/display.h b/supervisor/shared/display.h index cca907916..cb321e85e 100644 --- a/supervisor/shared/display.h +++ b/supervisor/shared/display.h @@ -27,6 +27,7 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_SHARED_DISPLAY_H #define MICROPY_INCLUDED_SUPERVISOR_SHARED_DISPLAY_H +#include "shared-bindings/displayio/BuiltinFont.h" #include "shared-bindings/displayio/Bitmap.h" #include "shared-bindings/displayio/TileGrid.h" #include "shared-bindings/terminalio/Terminal.h" @@ -34,7 +35,9 @@ // These are autogenerated resources. // This is fixed so it doesn't need to be in RAM. -extern const displayio_bitmap_t supervisor_terminal_font; +extern const displayio_bitmap_t supervisor_terminal_font_bitmap; + +extern const displayio_builtinfont_t supervisor_terminal_font; // These will change so they must live in RAM. extern displayio_tilegrid_t supervisor_terminal_text_grid; -- cgit v1.2.3