text.h (1068B)
1 #ifndef TA_TEXT_H
2 #define TA_TEXT_H
3
4 #include <tuxanci2/syscall.h>
5 #include <tuxanci2/abi.h>
6 #include <stdint.h>
7 #include <stdbool.h>
8 #include <stddef.h>
9
10 typedef uint32_t ta_text;
11
12 static inline ta_text ta_text_create(const char *text, uint32_t size, uint32_t color, uint32_t border_width, uint32_t border_color) {
13 return ta_syscall(TA_SYS_TEXT_CREATE, (uint32_t)(size_t)text, size, color, border_width, border_color, 0);
14 }
15
16 static inline uint32_t ta_text_width(ta_text text) {
17 return ta_syscall(TA_SYS_TEXT_WIDTH, text, 0, 0, 0, 0, 0);
18 }
19
20 static inline uint32_t ta_text_height(ta_text text) {
21 return ta_syscall(TA_SYS_TEXT_HEIGHT, text, 0, 0, 0, 0, 0);
22 }
23
24 static inline void ta_text_draw(ta_text text, uint32_t x, uint32_t y) {
25 ta_syscall(TA_SYS_TEXT_DRAW, text, x, y, 0, 0, 0);
26 }
27
28 static inline bool ta_text_change_color(ta_text text, uint32_t color) {
29 return ta_syscall(TA_SYS_TEXT_CHANGE_COLOR, text, color, 0, 0, 0, 0) != 0;
30 }
31
32 static inline void ta_text_destroy(ta_text text) {
33 ta_syscall(TA_SYS_TEXT_DESTROY, text, 0, 0, 0, 0, 0);
34 }
35
36 #endif // TA_TEXT_H