The Pedigree Project 0.1
BootIO.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#ifndef BOOTIO_H
21#define BOOTIO_H
22
23#include "pedigree/kernel/compiler.h"
24#include "pedigree/kernel/processor/types.h"
25#include "pedigree/kernel/utilities/StaticString.h"
26#include "pedigree/kernel/utilities/utility.h"
27
28extern class BootIO bootIO;
29
30class Serial;
31
36class BootIO {
37 public:
41 enum Colour {
42 Black = 0,
43 Blue = 1,
44 Green = 2,
45 Cyan = 3,
46 Red = 4,
47 Magenta = 5,
48 Orange = 6,
49 LightGrey = 7,
50 DarkGrey = 8,
51 LightBlue = 9,
52 LightGreen = 10,
53 LightCyan = 11,
54 LightRed = 12,
55 LightMagenta = 13,
56 Yellow = 14,
57 White = 15
58 };
59
61 BootIO() NOTHROW;
63 ~BootIO();
64
67 void initialise();
68
73 template <class T>
74 EXPORTED_PUBLIC void write(T& str, Colour foreColour, Colour backColour);
75
76 private:
77 void putCharVga(const char c, Colour foreColour, Colour backColour);
78 void startColour(Serial* pSerial, Colour foreColour, Colour backColour);
79 void endColour(Serial* pSerial);
80
84 size_t m_CursorX, m_CursorY;
85};
86
87extern template EXPORTED_PUBLIC void BootIO::write<TinyStaticString>(TinyStaticString& str,
88 Colour foreColour,
89 Colour backColour);
90extern template EXPORTED_PUBLIC void BootIO::write<NormalStaticString>(NormalStaticString& str,
91 Colour foreColour,
92 Colour backColour);
93extern template EXPORTED_PUBLIC void BootIO::write<LargeStaticString>(LargeStaticString& str,
94 Colour foreColour,
95 Colour backColour);
96extern template EXPORTED_PUBLIC void BootIO::write<HugeStaticString>(HugeStaticString& str,
97 Colour foreColour,
98 Colour backColour);
99
100#endif
Colour
Definition BootIO.h:41
EXPORTED_PUBLIC void write(T &str, Colour foreColour, Colour backColour)
void initialise()
Definition BootIO.cc:32
BootIO() NOTHROW
Definition BootIO.cc:28
size_t m_CursorX
Definition BootIO.h:84