My Project
Loading...
Searching...
No Matches
mg.h
Go to the documentation of this file.
1#ifndef X86_MATANEL_GRAPHICAL_H
2#define X86_MATANEL_GRAPHICAL_H
3
4/*++
5
6Module Name:
7
8 mg.h
9
10Purpose:
11
12 This module contains the header files & prototypes required for graphical interfaces. - Note that this only contains a very basic driver, advanced drivers should be loaded dynamically.
13
14Author:
15
16 slep (Matanel) 2025.
17
18Revision History:
19
20--*/
21
22
23#include <stdint.h>
24#include <stdbool.h>
25#include "stdarg_myos.h"
26#include "efi.h"
27
29#define COLOR_RED 0xFFFF0000
30#define COLOR_GREEN 0xFF00FF00
31#define COLOR_BLUE 0xFF0000FF
32#define COLOR_WHITE 0xFFFFFFFF
33#define COLOR_BLACK 0xFF000000
34#define COLOR_YELLOW 0xFFFFFF00
35#define COLOR_CYAN 0xFF00FFFF
36#define COLOR_MAGENTA 0xFFFF00FF
37#define COLOR_GRAY 0xFF808080
38#define COLOR_DARK_GRAY 0xFF404040
39#define COLOR_LIGHT_GRAY 0xFFD3D3D3
40#define COLOR_ORANGE 0xFFFFA500
41#define COLOR_BROWN 0xFFA52A2A
42#define COLOR_PURPLE 0xFF800080
43#define COLOR_PINK 0xFFFFC0CB
44#define COLOR_LIME 0xFF32CD32
45#define COLOR_NAVY 0xFF000080
46#define COLOR_TEAL 0xFF008080
47#define COLOR_OLIVE 0xFF808000
48
49void gop_printf(uint32_t color, const char* fmt, ...)
50__attribute__((format(printf, 2, 3)));
51void gop_clear_screen(GOP_PARAMS* gop, uint32_t color);
52
53
54int ksnprintf(char* buf, size_t bufsize, const char* fmt, ...);
55int kstrcmp(const char* s1, const char* s2);
56int kstrncmp(const char* s1, const char* s2, size_t length);
57size_t kstrlen(const char* str);
58char* kstrcpy(char* dst, const char* src);
59// Gurantees null termination.
60char* kstrncpy(char* dst, const char* src, size_t n);
61char* kstrtok_r(char* str, const char* delim, char** save_ptr);
62char* kstrncat(char* dest, const char* src, size_t max_len);
63
64
67
68#endif
struct _GOP_PARAMS GOP_PARAMS
void MgAcquireExclusiveGopOwnerShip(void)
Definition gop.c:794
char * kstrncat(char *dest, const char *src, size_t max_len)
Concatenates src onto dest, up to max_len total bytes in dest.
Definition gop.c:365
size_t kstrlen(const char *str)
Definition gop.c:393
int ksnprintf(char *buf, size_t bufsize, const char *fmt,...)
Definition gop.c:546
void MgReleaseExclusiveGopOwnerShip(void)
Definition gop.c:806
char * kstrtok_r(char *str, const char *delim, char **save_ptr)
Definition gop.c:491
char * kstrcpy(char *dst, const char *src)
Definition gop.c:404
char * kstrncpy(char *dst, const char *src, size_t n)
Definition gop.c:416
void gop_clear_screen(GOP_PARAMS *gop, uint32_t color)
Definition gop.c:249
int kstrncmp(const char *s1, const char *s2, size_t length)
Definition gop.c:666
int kstrcmp(const char *s1, const char *s2)
Definition gop.c:657
void gop_printf(uint32_t color, const char *fmt,...) __attribute__((format(printf