diff options
author | Uros Majstorovic <majstor@majstor.org> | 2020-08-05 03:39:22 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2020-08-05 03:39:22 +0200 |
commit | cf7c06297d04bade9cd04c056f9ed510e64dd7bd (patch) | |
tree | a3b8cc23574b98e10874b51d33c9fe1bfc012663 /fw/fe310/eos/eve/widget/label.c | |
parent | 5cd610a07468137066ea4daa5176c3e7045113b0 (diff) |
code -> fw
Diffstat (limited to 'fw/fe310/eos/eve/widget/label.c')
-rw-r--r-- | fw/fe310/eos/eve/widget/label.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fw/fe310/eos/eve/widget/label.c b/fw/fe310/eos/eve/widget/label.c new file mode 100644 index 0000000..ebea823 --- /dev/null +++ b/fw/fe310/eos/eve/widget/label.c @@ -0,0 +1,26 @@ +#include <stdlib.h> +#include <string.h> + +#include "eve.h" +#include "eve_kbd.h" +#include "unicode.h" + +#include "screen/screen.h" +#include "screen/window.h" +#include "screen/page.h" +#include "screen/font.h" + +#include "label.h" + +void eve_label_init(EVELabel *label, EVERect *g, EVEFont *font, char *title) { + memset(label, 0, sizeof(EVELabel)); + if (g) label->g = *g; + label->title = title; + label->font = font; + if (label->g.w == 0) label->g.w = eve_font_str_w(font, label->title); + if (label->g.h == 0) label->g.h = eve_font_h(font); +} + +void eve_label_draw(EVELabel *label) { + eve_cmd(CMD_TEXT, "hhhhs", label->g.x, label->g.y, label->font->id, 0, label->title); +}
\ No newline at end of file |