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 class csBox3; 00034 class csColor; 00035 class csColor4; 00036 class csMatrix3; 00037 class csOBB; 00038 class csPlane3; 00039 class csShaderVariable; 00040 class csVector2; 00041 class csVector3; 00042 00043 struct csAlphaMode; 00044 00045 struct iDocumentNode; 00046 struct iGradient; 00047 struct iKeyValuePair; 00048 struct iLoaderContext; 00049 struct iMaterialWrapper; 00050 struct iRenderBuffer; 00051 struct iSector; 00052 struct iShader; 00053 struct iShaderVariableAccessor; 00054 struct iString; 00055 struct iStringSet; 00056 struct iThingFactoryState; 00057 00060 00061 #define CSTEX_UV 1 00062 00063 #define CSTEX_V1 2 00064 00065 #define CSTEX_V2 4 00066 00067 #define CSTEX_UV_SHIFT 8 00068 00070 namespace CS 00071 { 00072 namespace Utility 00073 { 00074 struct PortalParameters 00075 { 00076 uint32 flags; 00077 bool mirror; 00078 bool warp; 00079 int msv; 00080 csMatrix3 m; 00081 csVector3 before; 00082 csVector3 after; 00083 iString* destSector; 00084 bool autoresolve; 00085 00086 PortalParameters() : flags (0), mirror (false), warp (false), msv (-1), 00087 before(0.0f), after(0.0f), destSector (0), autoresolve (true) {} 00088 }; 00089 } // namespace CS 00090 } // namespace CS 00091 00096 struct iSyntaxService : public virtual iBase 00097 { 00098 SCF_INTERFACE (iSyntaxService, 2, 1, 3); 00099 00106 virtual void ReportError (const char* msgid, iDocumentNode* errornode, 00107 const char* msg, ...) CS_GNUC_PRINTF(4,5) = 0; 00108 00113 virtual void ReportBadToken (iDocumentNode* badtokennode) = 0; 00114 00119 virtual void Report (const char* msgid, int severity, 00120 iDocumentNode* errornode, const char* msg, ...) CS_GNUC_PRINTF(5,6) = 0; 00137 virtual bool ParseBool (iDocumentNode* node, bool& result, 00138 bool def_result) = 0; 00139 00162 virtual bool ParseBoolAttribute (iDocumentNode* node, const char* attrname, 00163 bool& result, bool def_result, bool required) = 0; 00164 00168 virtual bool WriteBool (iDocumentNode* node, const char* name, 00169 bool value) = 0; 00170 00175 bool WriteBool (iDocumentNode* node, const char* name, bool value, 00176 bool default_value) 00177 { 00178 if (value != default_value) 00179 return WriteBool (node, name, value); 00180 else 00181 return true; 00182 } 00183 00187 virtual bool ParsePlane (iDocumentNode* node, csPlane3 &p) = 0; 00188 00192 virtual bool WritePlane (iDocumentNode* node, const csPlane3& p) = 0; 00193 00197 virtual bool ParseMatrix (iDocumentNode* node, csMatrix3 &m) = 0; 00198 00202 virtual bool WriteMatrix (iDocumentNode* node, const csMatrix3& m) = 0; 00203 00207 virtual bool ParseVector (iDocumentNode* node, csVector3 &v) = 0; 00208 00212 virtual bool WriteVector (iDocumentNode* node, const csVector3& v) = 0; 00213 00217 virtual bool ParseVector (iDocumentNode* node, csVector2 &v) = 0; 00218 00222 virtual bool WriteVector (iDocumentNode* node, const csVector2& v) = 0; 00223 00227 virtual bool ParseBox (iDocumentNode* node, csBox3 &v) = 0; 00228 00232 virtual bool WriteBox (iDocumentNode* node, const csBox3& v) = 0; 00233 00237 virtual bool ParseBox (iDocumentNode* node, csOBB &b) = 0; 00238 00242 virtual bool WriteBox (iDocumentNode* node, const csOBB& b) = 0; 00243 00247 virtual bool ParseColor (iDocumentNode* node, csColor &c) = 0; 00248 00252 virtual bool WriteColor (iDocumentNode* node, const csColor& c) = 0; 00253 00257 virtual bool ParseColor (iDocumentNode* node, csColor4 &c) = 0; 00258 00262 virtual bool WriteColor (iDocumentNode* node, const csColor4& c) = 0; 00263 00267 virtual bool ParseMixmode (iDocumentNode* node, uint &mixmode, 00268 bool allowFxMesh = false) = 0; 00269 00273 virtual bool WriteMixmode (iDocumentNode* node, uint mixmode, 00274 bool allowFxMesh) = 0; 00275 00286 CS_DEPRECATED_METHOD_MSG("Use bool HandlePortalParameter " 00287 "(iDocumentNode*, iLoaderContext*, csRef<csRefCount>&, " 00288 "CS::Utility::PortalParameters&, bool&) instead ") 00289 virtual bool HandlePortalParameter ( 00290 iDocumentNode* child, iLoaderContext* ldr_context, 00291 uint32 &flags, bool &mirror, bool &warp, int& msv, 00292 csMatrix3 &m, csVector3 &before, csVector3 &after, 00293 iString* destSector, bool& handled, bool& autoresolve) = 0; 00294 00301 virtual bool ParseGradient (iDocumentNode* node, 00302 iGradient* gradient) = 0; 00303 00307 virtual bool WriteGradient (iDocumentNode* node, 00308 iGradient* gradient) = 0; 00309 00313 virtual bool ParseShaderVar (iLoaderContext* ldr_context, 00314 iDocumentNode* node, csShaderVariable& var) = 0; 00319 virtual csRef<iShaderVariableAccessor> ParseShaderVarExpr ( 00320 iDocumentNode* node) = 0; 00321 00325 virtual bool WriteShaderVar (iDocumentNode* node, 00326 csShaderVariable& var) = 0; 00327 00331 virtual bool ParseAlphaMode (iDocumentNode* node, iStringSet* strings, 00332 csAlphaMode& alphaMode, bool allowAutoMode = true) = 0; 00333 00337 virtual bool WriteAlphaMode (iDocumentNode* node, iStringSet* strings, 00338 const csAlphaMode& alphaMode) = 0; 00339 00349 virtual bool ParseZMode (iDocumentNode* node, csZBufMode& zmode, 00350 bool allowZmesh = false) = 0; 00351 00355 virtual bool WriteZMode (iDocumentNode* node, csZBufMode zmode, 00356 bool allowZmesh) = 0; 00357 00363 CS_DEPRECATED_METHOD_MSG("Use the csRef<iKeyValuePair> version instead") 00364 virtual bool ParseKey (iDocumentNode* node, iKeyValuePair*& keyvalue) = 0; 00365 00370 virtual bool WriteKey (iDocumentNode* node, iKeyValuePair* keyvalue) = 0; 00371 00375 virtual csRef<iRenderBuffer> ParseRenderBuffer (iDocumentNode* node) = 0; 00376 00385 virtual bool WriteRenderBuffer (iDocumentNode* node, iRenderBuffer* buffer) = 0; 00386 00397 virtual csRef<iShader> ParseShaderRef (iLoaderContext* ldr_context, 00398 iDocumentNode* node) = 0; 00399 00404 virtual csPtr<iKeyValuePair> ParseKey (iDocumentNode* node) = 0; 00405 00411 virtual csRef<iRenderBuffer> ReadRenderBuffer (iDataBuffer* buf) = 0; 00412 00417 virtual csRef<iDataBuffer> StoreRenderBuffer (iRenderBuffer* rbuf) = 0; 00418 00431 virtual bool HandlePortalParameter ( 00432 iDocumentNode* child, iLoaderContext* ldr_context, 00433 csRef<csRefCount>& parseState, CS::Utility::PortalParameters& params, 00434 bool& handled) = 0; 00435 00439 virtual bool ParseRenderBuffer (iDocumentNode* node, iRenderBuffer* buffer) = 0; 00440 }; 00441 00444 #endif // __CS_IMAP_SYNTAXSERVICE_H__ 00445
Generated for Crystal Space 1.4.1 by doxygen 1.7.1