aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/drivers/vga_text_buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/drivers/vga_text_buffer.h')
-rw-r--r--kernel/include/drivers/vga_text_buffer.h57
1 files changed, 26 insertions, 31 deletions
diff --git a/kernel/include/drivers/vga_text_buffer.h b/kernel/include/drivers/vga_text_buffer.h
index 1a506f6..389c864 100644
--- a/kernel/include/drivers/vga_text_buffer.h
+++ b/kernel/include/drivers/vga_text_buffer.h
@@ -27,33 +27,9 @@
#include <stdbool.h>
#include <stdint.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define VGA_WIDTH 80
#define VGA_HEIGHT 25
-/* Hardware text mode color constants. */
-typedef enum {
- VGA_COLOR_BLACK = 0,
- VGA_COLOR_BLUE = 1,
- VGA_COLOR_GREEN = 2,
- VGA_COLOR_CYAN = 3,
- VGA_COLOR_RED = 4,
- VGA_COLOR_MAGENTA = 5,
- VGA_COLOR_BROWN = 6,
- VGA_COLOR_LIGHT_GREY = 7,
- VGA_COLOR_DARK_GREY = 8,
- VGA_COLOR_LIGHT_BLUE = 9,
- VGA_COLOR_LIGHT_GREEN = 10,
- VGA_COLOR_LIGHT_CYAN = 11,
- VGA_COLOR_LIGHT_RED = 12,
- VGA_COLOR_LIGHT_MAGENTA = 13,
- VGA_COLOR_LIGHT_BROWN = 14,
- VGA_COLOR_WHITE = 15
-} vga_color;
-
/*
* bg fg
* 1110 0101
@@ -67,15 +43,34 @@ typedef enum {
#define vga_entry(character, color) \
((uint16_t) color << 8 | (uint16_t) character)
-bool vga_text_buffer_is_initialized(void);
+namespace VGATextBuffer
+{
-void vga_text_buffer_initialize(void);
-void vga_text_buffer_write_char(const char);
-void vga_text_buffer_write_string(const char *string);
-void vga_text_buffer_printf(const char *string, ...);
+/* Hardware text mode color constants. */
+typedef enum {
+ COLOR_BLACK = 0,
+ COLOR_BLUE = 1,
+ COLOR_GREEN = 2,
+ COLOR_CYAN = 3,
+ COLOR_RED = 4,
+ COLOR_MAGENTA = 5,
+ COLOR_BROWN = 6,
+ COLOR_LIGHT_GREY = 7,
+ COLOR_DARK_GREY = 8,
+ COLOR_LIGHT_BLUE = 9,
+ COLOR_LIGHT_GREEN = 10,
+ COLOR_LIGHT_CYAN = 11,
+ COLOR_LIGHT_RED = 12,
+ COLOR_LIGHT_MAGENTA = 13,
+ COLOR_LIGHT_BROWN = 14,
+ COLOR_WHITE = 15
+} colors;
+
+void initialize(void);
+void write_char(const char);
+void write_string(const char *string);
+void printf(const char *string, ...);
-#ifdef __cplusplus
}
-#endif
#endif