imap/services.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2001 by Norman Kraemer 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_IMAP_SYNTAXSERVICE_H__ 00020 #define __CS_IMAP_SYNTAXSERVICE_H__ 00021 00028 #include "csutil/scf.h" 00029 00030 #include "iutil/databuff.h" 00031 #include "ivideo/graph3d.h" 00032 00033 #include <stdarg.h> 00034 00035 class csBox3; 00036 class csColor; 00037 class csColor4; 00038 class csMatrix3; 00039 class csOBB; 00040 class csPlane3; 00041 class csShaderVariable; 00042 class csVector2; 00043 class csVector3; 00044 00045 struct csAlphaMode; 00046 00047 struct iDocumentNode; 00048 struct iGradient; 00049 struct iKeyValuePair; 00050 struct iLoaderContext; 00051 struct iMaterialWrapper; 00052 struct iRenderBuffer; 00053 struct iSector; 00054 struct iShader; 00055 struct iShaderVariableAccessor; 00056 struct iString; 00057 struct iStringSet; 00058 00061 00062 #define CSTEX_UV 1 00064 #define CSTEX_V1 2 00066 #define CSTEX_V2 4 00068 #define CSTEX_UV_SHIFT 8 00069 00071 namespace CS 00072 { 00073 namespace Utility 00074 { 00075 struct PortalParameters 00076 { 00077 uint32 flags; 00078 bool mirror; 00079 bool warp; 00080 int msv; 00081 csMatrix3 m; 00082 csVector3 before; 00083 csVector3 after; 00084 iString* destSector; 00085 bool autoresolve; 00086 00087 PortalParameters() : flags (0), mirror (false), warp (false), msv (-1), 00088 before(0.0f), after(0.0f), destSector (0), autoresolve (true) {} 00089 }; 00090 } // namespace CS 00091 } // namespace CS 00092 00097 struct iSyntaxService : public virtual iBase 00098 { 00099 SCF_INTERFACE (iSyntaxService, 4, 0, 0); 00100 00107 void ReportError (const char* msgid, iDocumentNode* errornode, 00108 const char* msg, ...) CS_GNUC_PRINTF(4,5) 00109 { 00110 va_list args; 00111 va_start(args, msg); 00112 ReportErrorV(msgid, errornode, msg, args); 00113 va_end(args); 00114 } 00115 00120 virtual void ReportErrorV (const char* msgid, iDocumentNode* errornode, 00121 const char* msg, va_list args) = 0; 00122 00127 virtual void ReportBadToken (iDocumentNode* badtokennode) = 0; 00128 00133 void Report (const char* msgid, int severity, 00134 iDocumentNode* errornode, const char* msg, ...) CS_GNUC_PRINTF(5,6) 00135 { 00136 va_list args; 00137 va_start(args, msg); 00138 ReportV(msgid, severity, errornode, msg, args); 00139 va_end(args); 00140 } 00141 00146 virtual void ReportV (const char* msgid, int severity, 00147 iDocumentNode* errornode, const char* msg, va_list args) = 0; 00164 virtual bool ParseBool (iDocumentNode* node, bool& result, 00165 bool def_result) = 0; 00166 00189 virtual bool ParseBoolAttribute (iDocumentNode* node, const char* attrname, 00190 bool& result, bool def_result, bool required) = 0; 00191 00195 virtual bool WriteBool (iDocumentNode* node, const char* name, 00196 bool value) = 0; 00197 00202 bool WriteBool (iDocumentNode* node, const char* name, bool value, 00203 bool default_value) 00204 { 00205 if (value != default_value) 00206 return WriteBool (node, name, value); 00207 else 00208 return true; 00209 } 00210 00214 virtual bool ParsePlane (iDocumentNode* node, csPlane3 &p) = 0; 00215 00219 virtual bool WritePlane (iDocumentNode* node, const csPlane3& p) = 0; 00220 00224 virtual bool ParseMatrix (iDocumentNode* node, csMatrix3 &m) = 0; 00225 00229 virtual bool WriteMatrix (iDocumentNode* node, const csMatrix3& m) = 0; 00230 00234 virtual bool ParseVector (iDocumentNode* node, csVector3 &v) = 0; 00235 00239 virtual bool WriteVector (iDocumentNode* node, const csVector3& v) = 0; 00240 00244 virtual bool ParseVector (iDocumentNode* node, csVector2 &v) = 0; 00245 00249 virtual bool WriteVector (iDocumentNode* node, const csVector2& v) = 0; 00250 00254 virtual bool ParseBox (iDocumentNode* node, csBox3 &v) = 0; 00255 00259 virtual bool WriteBox (iDocumentNode* node, const csBox3& v) = 0; 00260 00264 virtual bool ParseBox (iDocumentNode* node, csOBB &b) = 0; 00265 00269 virtual bool WriteBox (iDocumentNode* node, const csOBB& b) = 0; 00270 00274 virtual bool ParseColor (iDocumentNode* node, csColor &c) = 0; 00275 00279 virtual bool WriteColor (iDocumentNode* node, const csColor& c) = 0; 00280 00284 virtual bool ParseColor (iDocumentNode* node, csColor4 &c) = 0; 00285 00289 virtual bool WriteColor (iDocumentNode* node, const csColor4& c) = 0; 00290 00294 virtual bool ParseMixmode (iDocumentNode* node, uint &mixmode, 00295 bool allowFxMesh = false) = 0; 00296 00300 virtual bool WriteMixmode (iDocumentNode* node, uint mixmode, 00301 bool allowFxMesh) = 0; 00302 00309 virtual bool ParseGradient (iDocumentNode* node, 00310 iGradient* gradient) = 0; 00311 00315 virtual bool WriteGradient (iDocumentNode* node, 00316 iGradient* gradient) = 0; 00317 00321 virtual bool ParseShaderVar (iLoaderContext* ldr_context, 00322 iDocumentNode* node, csShaderVariable& var, 00323 iStringArray* failedTextures = 0) = 0; 00328 virtual csRef<iShaderVariableAccessor> ParseShaderVarExpr ( 00329 iDocumentNode* node) = 0; 00330 00334 virtual bool WriteShaderVar (iDocumentNode* node, 00335 csShaderVariable& var) = 0; 00336 00340 virtual bool ParseAlphaMode (iDocumentNode* node, iStringSet* strings, 00341 csAlphaMode& alphaMode, bool allowAutoMode = true) = 0; 00342 00346 virtual bool WriteAlphaMode (iDocumentNode* node, iStringSet* strings, 00347 const csAlphaMode& alphaMode) = 0; 00348 00358 virtual bool ParseZMode (iDocumentNode* node, csZBufMode& zmode, 00359 bool allowZmesh = false) = 0; 00360 00364 virtual bool WriteZMode (iDocumentNode* node, csZBufMode zmode, 00365 bool allowZmesh) = 0; 00366 00371 virtual csPtr<iKeyValuePair> ParseKey (iDocumentNode* node) = 0; 00372 00377 virtual bool WriteKey (iDocumentNode* node, iKeyValuePair* keyvalue) = 0; 00378 00382 virtual csRef<iRenderBuffer> ParseRenderBuffer (iDocumentNode* node) = 0; 00383 00389 virtual bool ParseRenderBuffer (iDocumentNode* node, iRenderBuffer* buffer) = 0; 00390 00399 virtual bool WriteRenderBuffer (iDocumentNode* node, iRenderBuffer* buffer) = 0; 00400 00406 virtual csRef<iRenderBuffer> ReadRenderBuffer (iDataBuffer* buf) = 0; 00407 00412 virtual csRef<iDataBuffer> StoreRenderBuffer (iRenderBuffer* rbuf) = 0; 00413 00424 virtual csRef<iShader> ParseShaderRef (iLoaderContext* ldr_context, 00425 iDocumentNode* node) = 0; 00426 00431 virtual csRef<iShader> ParseShader (iLoaderContext* ldr_context, 00432 iDocumentNode* node) = 0; 00433 00446 virtual bool HandlePortalParameter ( 00447 iDocumentNode* child, iLoaderContext* ldr_context, 00448 csRef<csRefCount>& parseState, CS::Utility::PortalParameters& params, 00449 bool& handled) = 0; 00450 00454 virtual bool ParseMatrix (iDocumentNode* node, CS::Math::Matrix4& m) = 0; 00455 }; 00456 00459 #endif // __CS_IMAP_SYNTAXSERVICE_H__ 00460
Generated for Crystal Space 2.1 by doxygen 1.6.1
