From 95ca5b9a928f0fe26b96b8ff2c0de05518ce7141 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 14 Oct 2024 23:08:01 +0200 Subject: [PATCH] Mon 14 Oct 23:06:38 CEST 2024 --- kernel/graphics.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 kernel/graphics.h diff --git a/kernel/graphics.h b/kernel/graphics.h new file mode 100644 index 0000000..84b2852 --- /dev/null +++ b/kernel/graphics.h @@ -0,0 +1,41 @@ +/* +Copyright (C) 2016-2019 The University of Notre Dame +This software is distributed under the GNU General Public License. +See the file LICENSE for details. +*/ + +#ifndef GRAPHICS_H +#define GRAPHICS_H + +#include "kernel/types.h" +#include "kernel/gfxstream.h" + +struct graphics_color { + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t a; +}; + +extern struct graphics graphics_root; + +struct graphics *graphics_create_root(); +struct graphics *graphics_create(struct graphics *parent ); +struct graphics *graphics_addref(struct graphics *g ); +void graphics_delete(struct graphics *g); + +uint32_t graphics_width(struct graphics *g); +uint32_t graphics_height(struct graphics *g); +void graphics_fgcolor(struct graphics *g, struct graphics_color c); +void graphics_bgcolor(struct graphics *g, struct graphics_color c); +int graphics_clip(struct graphics *g, int x, int y, int w, int h); + +void graphics_scrollup(struct graphics *g, int x, int y, int w, int h, int dy); +void graphics_rect(struct graphics *g, int x, int y, int w, int h); +void graphics_clear(struct graphics *g, int x, int y, int w, int h); +void graphics_line(struct graphics *g, int x, int y, int w, int h); +void graphics_char(struct graphics *g, int x, int y, unsigned char c); +void graphics_string(struct graphics *g, int x, int y, const char *str, int length ); +int graphics_write(struct graphics *g, int *cmd, int length ); + +#endif