Changeset 6417 for code/trunk/src/libraries/core/IOConsole.h
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/IOConsole.h
r6105 r6417 41 41 #ifdef ORXONOX_PLATFORM_UNIX 42 42 struct termios; 43 #elif defined(ORXONOX_PLATFORM_WINDOWS) 44 #define WIN32_LEAN_AND_MEAN 45 #ifndef NOMINMAX 46 #define NOMINMAX 47 #endif 48 #include <windows.h> 43 49 #endif 44 50 … … 53 59 ~IOConsole(); 54 60 55 void update(const Clock& time);61 void preUpdate(const Clock& time); 56 62 57 63 private: 58 64 void setTerminalMode(); 59 void resetTerminalMode();60 65 void getTerminalSize(); 61 bool willPrintStatusLines();62 int extractLogLevel(std::string* text);63 64 void printLogText(const std::string& line);65 void printInputLine();66 66 void printStatusLines(); 67 static int extractLogLevel(std::string* text); 67 68 68 69 // Methods from ShellListener … … 74 75 void executed(); 75 76 void exit(); 77 76 78 Shell* shell_; 77 79 InputBuffer* buffer_; 78 80 std::ostream cout_; 79 81 std::ostringstream origCout_; 80 unsigned int terminalWidth_; 81 unsigned int terminalHeight_; 82 unsigned int lastTerminalWidth_; 83 unsigned int lastTerminalHeight_; 82 int terminalWidth_; 83 int terminalHeight_; 84 int lastTerminalWidth_; 85 int lastTerminalHeight_; 86 const std::string promptString_; 87 88 #ifdef ORXONOX_PLATFORM_UNIX 89 bool willPrintStatusLines(); 90 void printInputLine(); 91 void printOutputLine(const std::string& line, Shell::LineType type); 92 static void resetTerminalMode(); 93 84 94 bool bPrintStatusLine_; 85 95 bool bStatusPrinted_; 86 std::vector< unsigned>statusLineWidths_;87 unsigned intstatusLineMaxWidth_;88 const std::string promptString_;89 static const unsigned minOutputLines_ = 3;96 std::vector<int> statusLineWidths_; 97 int statusLineMaxWidth_; 98 static const int minOutputLines_ = 3; 99 termios* originalTerminalSettings_; 90 100 91 #ifdef ORXONOX_PLATFORM_UNIX 92 termios* originalTerminalSettings_; 101 #elif defined(ORXONOX_PLATFORM_WINDOWS) 102 void resetTerminalMode(); 103 void moveCursor(int dx, int dy); 104 void writeText(const std::string& text, const COORD& pos, WORD attributes = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED); 105 void createNewOutputLines(int lines); 106 void printOutputLine(const std::string& line, Shell::LineType type, const COORD& pos); 107 108 static inline COORD makeCOORD(int x, int y) 109 { 110 COORD val = {x, y}; 111 return val; 112 } 113 114 DWORD originalTerminalSettings_; 115 HANDLE stdInHandle_; 116 HANDLE stdOutHandle_; 117 int inputLineRow_; 118 int inputLineHeight_; 119 const int statusLines_; 120 int lastOutputLineHeight_; 121 uint64_t lastRefreshTime_; 93 122 #endif 94 123
Note: See TracChangeset
for help on using the changeset viewer.