CrystalSpace

Public API Reference

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  
00063 #define CSTEX_V1 2  
00065 #define CSTEX_V2 4  
00067 #define CSTEX_UV_SHIFT 8 
00068 
00074 struct iSyntaxService : public virtual iBase
00075 {
00076   SCF_INTERFACE (iSyntaxService, 2, 1, 2);
00077   
00084   virtual void ReportError (const char* msgid, iDocumentNode* errornode,
00085         const char* msg, ...) CS_GNUC_PRINTF(4,5) = 0;
00086 
00091   virtual void ReportBadToken (iDocumentNode* badtokennode) = 0;
00092 
00097   virtual void Report (const char* msgid, int severity, 
00098     iDocumentNode* errornode, const char* msg, ...) CS_GNUC_PRINTF(5,6) = 0;
00115   virtual bool ParseBool (iDocumentNode* node, bool& result,
00116         bool def_result) = 0;
00117  
00140   virtual bool ParseBoolAttribute (iDocumentNode* node, const char* attrname,
00141         bool& result, bool def_result, bool required) = 0;
00142 
00146   virtual bool WriteBool (iDocumentNode* node, const char* name, 
00147     bool value) = 0;
00148   
00153   bool WriteBool (iDocumentNode* node, const char* name, bool value, 
00154     bool default_value) 
00155   { 
00156     if (value != default_value) 
00157       return WriteBool (node, name, value); 
00158     else
00159       return true;
00160   }
00161 
00165   virtual bool ParsePlane (iDocumentNode* node, csPlane3 &p) = 0;
00166 
00170   virtual bool WritePlane (iDocumentNode* node, const csPlane3& p) = 0;
00171   
00175   virtual bool ParseMatrix (iDocumentNode* node, csMatrix3 &m) = 0;
00176 
00180   virtual bool WriteMatrix (iDocumentNode* node, const csMatrix3& m) = 0;
00181 
00185   virtual bool ParseVector (iDocumentNode* node, csVector3 &v) = 0;
00186 
00190   virtual bool WriteVector (iDocumentNode* node, const csVector3& v) = 0;
00191 
00195   virtual bool ParseVector (iDocumentNode* node, csVector2 &v) = 0;
00196 
00200   virtual bool WriteVector (iDocumentNode* node, const csVector2& v) = 0;
00201 
00205   virtual bool ParseBox (iDocumentNode* node, csBox3 &v) = 0;
00206 
00210   virtual bool WriteBox (iDocumentNode* node, const csBox3& v) = 0;
00211 
00215   virtual bool ParseBox (iDocumentNode* node, csOBB &b) = 0;
00216 
00220   virtual bool WriteBox (iDocumentNode* node, const csOBB& b) = 0;
00221 
00225   virtual bool ParseColor (iDocumentNode* node, csColor &c) = 0;
00226 
00230   virtual bool WriteColor (iDocumentNode* node, const csColor& c) = 0;
00231 
00235   virtual bool ParseColor (iDocumentNode* node, csColor4 &c) = 0;
00236 
00240   virtual bool WriteColor (iDocumentNode* node, const csColor4& c) = 0;
00241 
00245   virtual bool ParseMixmode (iDocumentNode* node, uint &mixmode,
00246     bool allowFxMesh = false) = 0;
00247 
00251   virtual bool WriteMixmode (iDocumentNode* node, uint mixmode,
00252     bool allowFxMesh) = 0;
00253 
00260   virtual bool HandlePortalParameter (
00261         iDocumentNode* child, iLoaderContext* ldr_context,
00262         uint32 &flags, bool &mirror, bool &warp, int& msv,
00263         csMatrix3 &m, csVector3 &before, csVector3 &after,
00264         iString* destSector, bool& handled, bool& autoresolve) = 0;
00265 
00272   virtual bool ParseGradient (iDocumentNode* node,
00273                               iGradient* gradient) = 0;
00274 
00278   virtual bool WriteGradient (iDocumentNode* node,
00279                               iGradient* gradient) = 0;
00280 
00284   virtual bool ParseShaderVar (iLoaderContext* ldr_context,
00285       iDocumentNode* node, csShaderVariable& var) = 0;
00290   virtual csRef<iShaderVariableAccessor> ParseShaderVarExpr (
00291     iDocumentNode* node) = 0;
00292                             
00296   virtual bool WriteShaderVar (iDocumentNode* node, 
00297     csShaderVariable& var) = 0;
00298                             
00302   virtual bool ParseAlphaMode (iDocumentNode* node, iStringSet* strings,
00303     csAlphaMode& alphaMode, bool allowAutoMode = true) = 0;
00304     
00308   virtual bool WriteAlphaMode (iDocumentNode* node, iStringSet* strings,
00309     const csAlphaMode& alphaMode) = 0;
00310     
00320   virtual bool ParseZMode (iDocumentNode* node, csZBufMode& zmode,
00321     bool allowZmesh = false) = 0;
00322 
00326   virtual bool WriteZMode (iDocumentNode* node, csZBufMode zmode,
00327     bool allowZmesh) = 0;
00328 
00334   CS_DEPRECATED_METHOD_MSG("Use the csRef<iKeyValuePair> version instead")
00335   virtual bool ParseKey (iDocumentNode* node, iKeyValuePair*& keyvalue) = 0;
00336 
00341   virtual bool WriteKey (iDocumentNode* node, iKeyValuePair* keyvalue) = 0;
00342 
00346   virtual csRef<iRenderBuffer> ParseRenderBuffer (iDocumentNode* node) = 0;
00347 
00356   virtual bool WriteRenderBuffer (iDocumentNode* node, iRenderBuffer* buffer) = 0;
00357   
00368   virtual csRef<iShader> ParseShaderRef (iLoaderContext* ldr_context,
00369       iDocumentNode* node) = 0;
00370 
00375   virtual csPtr<iKeyValuePair> ParseKey (iDocumentNode* node) = 0;
00376   
00382   virtual csRef<iRenderBuffer> ReadRenderBuffer (iDataBuffer* buf) = 0;
00383   
00388   virtual csRef<iDataBuffer> StoreRenderBuffer (iRenderBuffer* rbuf) = 0;
00389 };
00390 
00393 #endif // __CS_IMAP_SYNTAXSERVICE_H__
00394 

Generated for Crystal Space 1.2.1 by doxygen 1.5.3