summaryrefslogtreecommitdiff
path: root/src/user/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/include')
-rw-r--r--src/user/include/libfont/fonts.h5
-rw-r--r--src/user/include/libterm/command.h4
-rw-r--r--src/user/include/libterm/terminal.h2
-rw-r--r--src/user/include/pland/syscall.h13
-rw-r--r--src/user/include/popups/info.h6
-rw-r--r--src/user/include/popups/popup.h2
6 files changed, 21 insertions, 11 deletions
diff --git a/src/user/include/libfont/fonts.h b/src/user/include/libfont/fonts.h
index b66659f..f7ed3e1 100644
--- a/src/user/include/libfont/fonts.h
+++ b/src/user/include/libfont/fonts.h
@@ -1,6 +1,8 @@
#ifndef LIBFONT_FONTS_H
#define LIBFONT_FONTS_H
+#include <pland/syscall.h>
+
#include <stdbool.h>
#include <stdint.h>
@@ -16,6 +18,7 @@ struct font_info {
struct font_info *get_font(const char *name);
-void put_char(const struct font_info *font, char ch, uint8_t *pb_ptr, uint32_t pb_pitch, uint8_t bg, uint8_t fg);
+//pitch is in pixels
+void put_char(const struct font_info *font, char ch, _pixel_t *pb_ptr, uint32_t pb_pitch, _pixel_t bg, _pixel_t fg);
#endif \ No newline at end of file
diff --git a/src/user/include/libterm/command.h b/src/user/include/libterm/command.h
index 7587306..ca9e00d 100644
--- a/src/user/include/libterm/command.h
+++ b/src/user/include/libterm/command.h
@@ -37,8 +37,8 @@ struct terminal_command {
uint32_t x;
} as_coords;
struct {
- uint8_t fg;
- uint8_t bg;
+ _pixel_t fg;
+ _pixel_t bg;
} as_color;
char as_char;
uint32_t as_uint;
diff --git a/src/user/include/libterm/terminal.h b/src/user/include/libterm/terminal.h
index 19bd517..40536e0 100644
--- a/src/user/include/libterm/terminal.h
+++ b/src/user/include/libterm/terminal.h
@@ -12,7 +12,7 @@ void term_get_dimensions(uint32_t *width, uint32_t *height);
void term_paint();
void term_clear();
-void term_set_color(uint8_t fg, uint8_t bg);
+void term_set_color(_pixel_t fg, _pixel_t bg);
void term_set_cursor(uint32_t new_y, uint32_t new_x);
void term_cursor_left();
diff --git a/src/user/include/pland/syscall.h b/src/user/include/pland/syscall.h
index fd0b416..9518d09 100644
--- a/src/user/include/pland/syscall.h
+++ b/src/user/include/pland/syscall.h
@@ -18,6 +18,13 @@ typedef struct __attribute__ ((packed)) {
uint8_t pad[23];
} _dir_info_entry_t;
+typedef struct __attribute__ ((packed)) {
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+ uint8_t pad;
+} _pixel_t;
+
enum _scn {
_SCN_OPEN_FILE,
_SCN_CLOSE_FILE,
@@ -177,7 +184,7 @@ static inline uint32_t _count_of_dir(uint8_t drive_number, const char *path) {
return _sc2(_SCN_COUNT_OF_DIR, drive_number, (uint32_t)path);
}
-static inline _window_handle_t _new_window(uint16_t width, uint16_t height, void *pixel_buffer) {
+static inline _window_handle_t _new_window(uint16_t width, uint16_t height, _pixel_t *pixel_buffer) {
return (_window_handle_t)_sc3(_SCN_NEW_WINDOW, width, height, (uint32_t)pixel_buffer);
}
@@ -185,11 +192,11 @@ static inline void _delete_window(_window_handle_t window) {
_sc1(_SCN_DELETE_WINDOW, (uint32_t)window);
}
-static inline void _resize_window(_window_handle_t window, uint16_t width, uint16_t height, const void *pixel_buffer) {
+static inline void _resize_window(_window_handle_t window, uint16_t width, uint16_t height, const _pixel_t *pixel_buffer) {
_sc4(_SCN_RESIZE_WINDOW, (uint32_t)window, width, height, (uint32_t)pixel_buffer);
}
-static inline void _reassign_pixbuf(_window_handle_t window, const void *pixel_buffer) {
+static inline void _reassign_pixbuf(_window_handle_t window, const _pixel_t *pixel_buffer) {
_sc2(_SCN_REASSIGN_PIXBUF, (uint32_t)window, (uint32_t)pixel_buffer);
}
diff --git a/src/user/include/popups/info.h b/src/user/include/popups/info.h
index 2c4e83f..36d557a 100644
--- a/src/user/include/popups/info.h
+++ b/src/user/include/popups/info.h
@@ -7,8 +7,8 @@
#include <stdarg.h>
-void info_popup(struct popup *into, const char *text, uint8_t fg, uint8_t bg);
-void info_popupf(struct popup *into, const char *text, uint8_t fg, uint8_t bg, ...);
-void info_popupf_v(struct popup *into, const char *text, uint8_t fg, uint8_t bg, va_list args);
+void info_popup(struct popup *into, const char *text, _pixel_t fg, _pixel_t bg);
+void info_popupf(struct popup *into, const char *text, _pixel_t fg, _pixel_t bg, ...);
+void info_popupf_v(struct popup *into, const char *text, _pixel_t fg, _pixel_t bg, va_list args);
#endif \ No newline at end of file
diff --git a/src/user/include/popups/popup.h b/src/user/include/popups/popup.h
index 9a39997..cf4315b 100644
--- a/src/user/include/popups/popup.h
+++ b/src/user/include/popups/popup.h
@@ -5,7 +5,7 @@
struct popup {
_window_handle_t handle;
- uint8_t *pixbuf;
+ _pixel_t *pixbuf;
bool has_quit;
struct key_packet quit_as;