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