diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-06-30 16:45:12 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-06-30 16:45:12 +0200 |
commit | c1bbac52d78b2e3e93fa43a5a7b3907073493216 (patch) | |
tree | 13ec009562358d01b1845dd08135f4ac8d384551 /src/gui/text_widget.h | |
parent | 915dd4b023d0826166d4887100dbed64d46821a9 (diff) | |
download | abaos-c1bbac52d78b2e3e93fa43a5a7b3907073493216.tar.gz abaos-c1bbac52d78b2e3e93fa43a5a7b3907073493216.tar.bz2 |
text widget has a constant buffer and owns the string to draw now
(passing a const char * from a local stack context is not really a
good idea!)
added more efficiet draw method for characters in vga driver
protected desktop for now against too often redraws (boolean global
variable needs_redraw, this is later a soffisticated set-of-areas-to
-redraw algorithm)
Diffstat (limited to 'src/gui/text_widget.h')
-rw-r--r-- | src/gui/text_widget.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text_widget.h b/src/gui/text_widget.h index 4b00b4f..7e87a3c 100644 --- a/src/gui/text_widget.h +++ b/src/gui/text_widget.h @@ -3,6 +3,8 @@ #include "widget.h" +#define TEXT_WIDGET_MAX_TEXT_SIZE 100 + typedef struct { widget_vtable_t base; void (*set_text)( void *obj, const char *s ); @@ -11,7 +13,7 @@ typedef struct { typedef struct { widget_t base; text_widget_vtable_t *vtable; - const char *s; + char s[TEXT_WIDGET_MAX_TEXT_SIZE]; } text_widget_t; void text_widget_init( text_widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color, const char *s ); |