The Pedigree Project  0.1
include/pedigree/kernel/machine/Vga.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 MACHINE_VGA_H
21 #define MACHINE_VGA_H
22 
23 #include "pedigree/kernel/processor/types.h"
24 
28 class Vga
29 {
30  public:
31  enum VgaControl
32  {
33  LineGraphics = 2,
34  Blink = 3,
35  };
36 
37  virtual ~Vga();
38 
42  virtual void setControl(VgaControl which) = 0;
43 
47  virtual void clearControl(VgaControl which) = 0;
48 
57  virtual bool setMode(int mode) = 0;
58 
63  virtual bool setLargestTextMode() = 0;
64 
69  virtual bool
70  isMode(size_t nCols, size_t nRows, bool bIsText, size_t nBpp = 0) = 0;
71 
76  virtual bool isLargestTextMode() = 0;
77 
81  virtual size_t getNumCols() = 0;
82 
86  virtual size_t getNumRows() = 0;
87 
91  virtual void rememberMode() = 0;
92 
96  virtual void restoreMode() = 0;
97 
108  virtual void pokeBuffer(uint8_t *pBuffer, size_t nBufLen) = 0;
109 
118  virtual void peekBuffer(uint8_t *pBuffer, size_t nBufLen) = 0;
119 
125  virtual void moveCursor(size_t nX, size_t nY) = 0;
126 
127  virtual operator uint16_t *() const = 0;
128 };
129 
130 #endif
virtual void moveCursor(size_t nX, size_t nY)=0
virtual void restoreMode()=0
virtual void rememberMode()=0
virtual void pokeBuffer(uint8_t *pBuffer, size_t nBufLen)=0
virtual bool isLargestTextMode()=0
virtual void clearControl(VgaControl which)=0
virtual bool setMode(int mode)=0
virtual void setControl(VgaControl which)=0
virtual void peekBuffer(uint8_t *pBuffer, size_t nBufLen)=0
virtual bool setLargestTextMode()=0
virtual bool isMode(size_t nCols, size_t nRows, bool bIsText, size_t nBpp=0)=0
virtual size_t getNumRows()=0
virtual size_t getNumCols()=0