summaryrefslogtreecommitdiff
path: root/src/gui/text_widget.h
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-06-24 21:16:44 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-06-24 21:16:44 +0200
commite74065e71667d8df1529f8ca32e14f3e54119ea1 (patch)
treed5daa165dd618eda0bf6b8760472a95eefaa80ad /src/gui/text_widget.h
parentfd0782099cab0988311aa80d4a6b0871a6403084 (diff)
downloadabaos-e74065e71667d8df1529f8ca32e14f3e54119ea1.tar.gz
abaos-e74065e71667d8df1529f8ca32e14f3e54119ea1.tar.bz2
started to implement a widget showing text, the problem currently
is the inheritance method in draw is not working correctly
Diffstat (limited to 'src/gui/text_widget.h')
-rw-r--r--src/gui/text_widget.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/text_widget.h b/src/gui/text_widget.h
new file mode 100644
index 0000000..4b00b4f
--- /dev/null
+++ b/src/gui/text_widget.h
@@ -0,0 +1,22 @@
+#ifndef TEXT_WIDGET_H
+#define TEXT_WIDGET_H
+
+#include "widget.h"
+
+typedef struct {
+ widget_vtable_t base;
+ void (*set_text)( void *obj, const char *s );
+} text_widget_vtable_t;
+
+typedef struct {
+ widget_t base;
+ text_widget_vtable_t *vtable;
+ const char *s;
+} 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 );
+
+void text_widget_draw( void *obj, graphics_context_t *context );
+void text_widget_set_text( void *obj, const char *s );
+
+#endif // TEXT_WIDGET_H