Changeset 5068 in orxonox.OLD for orxonox/trunk/src/util/shell.h
- Timestamp:
- Aug 18, 2005, 3:51:43 PM (19 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/shell.h
r5065 r5068 1 1 /*! 2 * @file proto_class.h3 * @brief Definition of ...2 * @file shell.h 3 * Definition of a on-screen-shell 4 4 */ 5 5 6 #ifndef _ PROTO_CLASS_H7 #define _ PROTO_CLASS_H6 #ifndef _SHELL_H 7 #define _SHELL_H 8 8 9 #include "base_object.h" 9 #include "element_2d.h" 10 11 #include <stdio.h> 12 #include <stdarg.h> 13 10 14 11 15 // FORWARD DECLARATION 16 class Text; 17 template<class T> class tList; 18 19 //! A class that is able to redirect all output to a openGL-Shell, and that one can use to input some commands 20 /** 21 * the major idea is, that all the Output can be redirected to the Shell, 22 * and does not have to be displayed to the opening Shell, this is good, 23 * for developers using Windows, where all output is otherwise redirected 24 * to stdout.txt 25 * 26 * Furthermore the Shell should enable us, to input some simple commands 27 * Each Class can tell check itself in to the Shell, and listen for commands. 28 * 29 * @todo implement what is written above :/ 30 */ 31 class Shell : public Element2D { 32 33 public: 34 virtual ~Shell(); 35 /** @returns a Pointer to the only object of this Class */ 36 inline static Shell* getInstance(void) { if (!Shell::singletonRef) Shell::singletonRef = new Shell(); return Shell::singletonRef; }; 12 37 13 38 39 void setBufferSize(unsigned int bufferSize) { this->bufferSize = bufferSize; }; 14 40 15 //! A class for ... 16 class ProtoClass : public BaseObject { 41 void setBufferDisplaySize(unsigned int bufferDisplaySize); 17 42 18 public: 19 ProtoClass(); 20 virtual ~ProtoClass(); 43 // BUFFER // 44 void flushBuffers(); 45 void addBufferLine(const char* Line, va_list args); 46 void moveBuffer(int lineCount); 47 const char* getBufferLine(unsigned int lineNumber); 48 49 // inputLine 50 void flushInputLine(); 51 void addCharacter(char character); 52 void addCharacters(const char* characters); 53 void removeCharacters(unsigned int characterCount = 1); 21 54 22 55 23 private: 56 // Element2D-functions 57 void tick(float dt); 58 virtual void draw() const; 24 59 60 void debug() const; 61 62 private: 63 bool autoComplete(); 64 65 66 private: 67 Shell(); 68 static Shell* singletonRef; 69 70 unsigned int bufferSize; 71 unsigned int bufferDisplaySize; 72 73 char* inputLine; 74 75 tList<const char>* buffer; 76 77 tList<Text>* bufferText; //!< A list of sored bufferLines of the Shell 78 Text* inputLineText; //!< The inputLine of the Shell 25 79 }; 26 80 27 #endif /* _ PROTO_CLASS_H */81 #endif /* _SHELL_H */
Note: See TracChangeset
for help on using the changeset viewer.