ivaria/conout.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2000 by Jorrit Tyberghein 00003 Written by Michael Dale Long 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_IVARIA_CONOUT_H__ 00021 #define __CS_IVARIA_CONOUT_H__ 00022 00027 #include "csutil/scf_interface.h" 00028 #include <stdarg.h> 00029 00030 class csRect; 00031 struct iConsoleOutput; 00032 struct iTextureManager; 00033 struct iFont; 00034 00036 enum 00037 { 00038 csConPageUp = -1, 00039 csConPageDown = -2, 00040 csConVeryTop = -3, 00041 csConVeryBottom = -4 00042 }; 00043 00044 enum 00045 { 00046 csConNoCursor = 0, 00047 csConNormalCursor, 00048 csConInsertCursor 00049 }; 00050 00055 struct iConsoleWatcher : public virtual iBase 00056 { 00057 SCF_INTERFACE (iConsoleWatcher, 1, 0, 0); 00058 00060 virtual void ConsoleVisibilityChanged(iConsoleOutput*, bool visible) = 0; 00061 }; 00062 00063 00080 struct iConsoleOutput : public virtual iBase 00081 { 00082 SCF_INTERFACE (iConsoleOutput, 4, 0, 0); 00083 00098 void PutText (const char *text, ...) CS_GNUC_PRINTF (2, 3) 00099 { 00100 va_list args; 00101 va_start(args, text); 00102 PutTextV(text, args); 00103 va_end(args); 00104 } 00105 00109 virtual void PutTextV (const char *text, va_list args) 00110 CS_GNUC_PRINTF (2, 0) = 0; 00111 00116 virtual const char *GetLine (int line = -1) const = 0; 00117 00127 virtual void Draw2D (csRect *oRect = 0) = 0; 00128 00138 virtual void Draw3D (csRect *oRect = 0) = 0; 00139 00145 virtual void Clear (bool wipe = false) = 0; 00146 00148 virtual void SetBufferSize (int maxLines) = 0; 00149 00151 virtual bool GetTransparency () const = 0; 00153 virtual void SetTransparency (bool transp) = 0; 00154 00156 virtual iFont *GetFont () const = 0; 00158 virtual void SetFont (iFont *font) = 0; 00159 00161 virtual int GetTopLine () const = 0; 00168 virtual void ScrollTo (int topLine, bool snap = true) = 0; 00169 00171 virtual int GetCursorStyle () const = 0; 00173 virtual void SetCursorStyle (int style) = 0; 00174 00179 virtual void SetVisible (bool show) = 0; 00183 virtual bool GetVisible () = 0; 00184 00196 virtual void AutoUpdate (bool autoUpdate) = 0; 00197 00204 virtual void SetCursorPos (int byteNo) = 0; 00205 00207 virtual int GetMaxLineWidth () = 0; 00208 00213 virtual void RegisterWatcher (iConsoleWatcher*) = 0; 00214 00216 bool PerformExtension (const char *command, ...) 00217 { 00218 va_list args; 00219 va_start(args, command); 00220 bool x = PerformExtensionV(command, args); 00221 va_end(args); 00222 return x; 00223 } 00224 00226 virtual bool PerformExtensionV (const char *command, va_list) = 0; 00227 }; 00228 00229 #endif // __CS_IVARIA_CONOUT_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
