xref: /aosp_15_r20/external/rmi4utils/f54test/display.h (revision a248dafd7653b99fc45f9d29e5f139b04f2f28bc)
1*a248dafdSChristopher Ferris /*
2*a248dafdSChristopher Ferris  * Copyright (C) 2014 Satoshi Noguchi
3*a248dafdSChristopher Ferris  * Copyright (C) 2014 Synaptics Inc
4*a248dafdSChristopher Ferris  *
5*a248dafdSChristopher Ferris  * Licensed under the Apache License, Version 2.0 (the "License");
6*a248dafdSChristopher Ferris  * you may not use this file except in compliance with the License.
7*a248dafdSChristopher Ferris  * You may obtain a copy of the License at
8*a248dafdSChristopher Ferris  *
9*a248dafdSChristopher Ferris  *      http://www.apache.org/licenses/LICENSE-2.0
10*a248dafdSChristopher Ferris  *
11*a248dafdSChristopher Ferris  * Unless required by applicable law or agreed to in writing, software
12*a248dafdSChristopher Ferris  * distributed under the License is distributed on an "AS IS" BASIS,
13*a248dafdSChristopher Ferris  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*a248dafdSChristopher Ferris  * See the License for the specific language governing permissions and
15*a248dafdSChristopher Ferris  * limitations under the License.
16*a248dafdSChristopher Ferris  */
17*a248dafdSChristopher Ferris 
18*a248dafdSChristopher Ferris #ifndef _DISPLAY_H_
19*a248dafdSChristopher Ferris #define _DISPLAY_H_
20*a248dafdSChristopher Ferris 
21*a248dafdSChristopher Ferris class Display
22*a248dafdSChristopher Ferris {
23*a248dafdSChristopher Ferris public:
Display()24*a248dafdSChristopher Ferris 	Display() {}
~Display()25*a248dafdSChristopher Ferris 	virtual ~Display() {}
26*a248dafdSChristopher Ferris 
Clear()27*a248dafdSChristopher Ferris 	virtual void Clear() {};
Reflesh()28*a248dafdSChristopher Ferris 	virtual void Reflesh() {};
29*a248dafdSChristopher Ferris 	virtual void Output(const char * buf);
30*a248dafdSChristopher Ferris };
31*a248dafdSChristopher Ferris 
32*a248dafdSChristopher Ferris class AnsiConsole : public Display
33*a248dafdSChristopher Ferris {
34*a248dafdSChristopher Ferris public:
35*a248dafdSChristopher Ferris 	AnsiConsole();
36*a248dafdSChristopher Ferris 	virtual ~AnsiConsole();
37*a248dafdSChristopher Ferris 
38*a248dafdSChristopher Ferris 	virtual void Clear();
39*a248dafdSChristopher Ferris 	virtual void Reflesh();
40*a248dafdSChristopher Ferris 	virtual void Output(const char * buf);
41*a248dafdSChristopher Ferris 
42*a248dafdSChristopher Ferris private:
43*a248dafdSChristopher Ferris 	void GetWindowSize();
44*a248dafdSChristopher Ferris 
45*a248dafdSChristopher Ferris protected:
46*a248dafdSChristopher Ferris 	int m_numCols;
47*a248dafdSChristopher Ferris 	int m_numRows;
48*a248dafdSChristopher Ferris 	int m_curX;
49*a248dafdSChristopher Ferris 	int m_curY;
50*a248dafdSChristopher Ferris 	int m_maxCurX;
51*a248dafdSChristopher Ferris 	int m_maxCurY;
52*a248dafdSChristopher Ferris 	char * m_buf;
53*a248dafdSChristopher Ferris };
54*a248dafdSChristopher Ferris 
55*a248dafdSChristopher Ferris #endif // _DISPLAY_H_
56