summaryrefslogtreecommitdiff
path: root/src/gui/text_widget.h
blob: 305ec6557250b0b6cd53425335361cff8ed51774 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef TEXT_WIDGET_H
#define TEXT_WIDGET_H

#include "widget.h"

#define TEXT_WIDGET_MAX_TEXT_SIZE 300

typedef struct {
	widget_vtable_t base;
	void (*set_text)( void *obj, const char *s );
} text_widget_vtable_t;

typedef struct {
	widget_t base;
	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 video_rgb_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 );
void text_widget_on_key_down( void *obj, char c );

#endif // TEXT_WIDGET_H