CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 
00027 #include "csutil/scf.h"
00028 
00029 #include "ivideo/graph3d.h"
00030 
00031 class csBox3;
00032 class csColor;
00033 class csColor4;
00034 class csGradient;
00035 class csMatrix3;
00036 class csPlane3;
00037 class csShaderVariable;
00038 class csVector2;
00039 class csVector3;
00040 
00041 struct csAlphaMode;
00042 
00043 struct iDocumentNode;
00044 struct iKeyValuePair;
00045 struct iLoaderContext;
00046 struct iMaterialWrapper;
00047 struct iRenderBuffer;
00048 struct iSector;
00049 struct iShader;
00050 struct iShaderVariableAccessor;
00051 struct iString;
00052 struct iStringSet;
00053 struct iThingFactoryState;
00054 
00057 
00058 #define CSTEX_UV 1  
00059 
00060 #define CSTEX_V1 2  
00061 
00062 #define CSTEX_V2 4  
00063 
00064 #define CSTEX_UV_SHIFT 8 
00065 
00067 SCF_VERSION (iSyntaxService, 1, 7, 1);
00068 
00073 struct iSyntaxService : public iBase
00074 {
00089   virtual bool ParseBool (iDocumentNode* node, bool& result,
00090         bool def_result) = 0;
00091   
00095   virtual bool WriteBool (iDocumentNode* node, const char* name, 
00096     bool value) = 0;
00097   
00102   bool WriteBool (iDocumentNode* node, const char* name, bool value, 
00103     bool default_value) 
00104   { 
00105     if (value != default_value) 
00106       return WriteBool (node, name, value); 
00107     else
00108       return true;
00109   }
00110 
00114   virtual bool ParsePlane (iDocumentNode* node, csPlane3 &p) = 0;
00115 
00119   virtual bool WritePlane (iDocumentNode* node, csPlane3 &p) = 0;
00120   
00124   virtual bool ParseMatrix (iDocumentNode* node, csMatrix3 &m) = 0;
00125 
00129   virtual bool WriteMatrix (iDocumentNode* node, csMatrix3* m) = 0;
00130 
00134   virtual bool ParseVector (iDocumentNode* node, csVector3 &v) = 0;
00135 
00139   virtual bool WriteVector (iDocumentNode* node, csVector3* v) = 0;
00140 
00144   virtual bool ParseVector (iDocumentNode* node, csVector2 &v) = 0;
00145 
00149   virtual bool WriteVector (iDocumentNode* node, csVector2* v) = 0;
00150 
00154   virtual bool ParseBox (iDocumentNode* node, csBox3 &v) = 0;
00155 
00159   virtual bool WriteBox (iDocumentNode* node, csBox3* v) = 0;
00160 
00164   virtual bool ParseColor (iDocumentNode* node, csColor &c) = 0;
00165 
00169   virtual bool WriteColor (iDocumentNode* node, csColor* c) = 0;
00170 
00174   virtual bool ParseColor (iDocumentNode* node, csColor4 &c) = 0;
00175 
00179   virtual bool WriteColor (iDocumentNode* node, csColor4* c) = 0;
00180 
00184   virtual bool ParseMixmode (iDocumentNode* node, uint &mixmode,
00185     bool allowFxMesh = false) = 0;
00186 
00190   virtual bool WriteMixmode (iDocumentNode* node, uint mixmode,
00191     bool allowFxMesh) = 0;
00192 
00199   virtual bool HandlePortalParameter (
00200         iDocumentNode* child, iLoaderContext* ldr_context,
00201         uint32 &flags, bool &mirror, bool &warp, int& msv,
00202         csMatrix3 &m, csVector3 &before, csVector3 &after,
00203         iString* destSector, bool& handled, bool& autoresolve) = 0;
00204 
00208   virtual bool ParseGradient (iDocumentNode* node,
00209                               csGradient& gradient) = 0;
00210 
00214   virtual bool WriteGradient (iDocumentNode* node,
00215                               csGradient* gradient) = 0;
00216 
00220   virtual bool ParseShaderVar (iDocumentNode* node, 
00221     csShaderVariable& var) = 0;
00226   virtual csRef<iShaderVariableAccessor> ParseShaderVarExpr (
00227     iDocumentNode* node) = 0;
00228                             
00232   virtual bool WriteShaderVar (iDocumentNode* node, 
00233     csShaderVariable* var) = 0;
00234                             
00239   virtual void ReportError (const char* msgid, iDocumentNode* errornode,
00240         const char* msg, ...) CS_GNUC_PRINTF(4,5) = 0;
00241 
00246   virtual void ReportBadToken (iDocumentNode* badtokennode) = 0;
00247 
00252   virtual void Report (const char* msgid, int severity, 
00253     iDocumentNode* errornode, const char* msg, ...) CS_GNUC_PRINTF(5,6) = 0;
00254   
00258   virtual bool ParseAlphaMode (iDocumentNode* node, iStringSet* strings,
00259     csAlphaMode& alphaMode, bool allowAutoMode = true) = 0;
00260     
00264   virtual bool WriteAlphaMode (iDocumentNode* node, iStringSet* strings,
00265     csAlphaMode* alphaMode) = 0;
00266     
00276   virtual bool ParseZMode (iDocumentNode* node, csZBufMode& zmode,
00277     bool allowZmesh = false) = 0;
00278 
00282   virtual bool WriteZMode (iDocumentNode* node, csZBufMode* zmode,
00283     bool allowZmesh) = 0;
00284 
00290   virtual bool ParseKey (iDocumentNode* node, iKeyValuePair* &keyvalue) = 0;
00291 
00296   virtual bool WriteKey (iDocumentNode* node, iKeyValuePair* keyvalue) = 0;
00297 
00301   virtual csRef<iRenderBuffer> ParseRenderBuffer (iDocumentNode* node) = 0;
00302   
00313   virtual csRef<iShader> ParseShaderRef (iDocumentNode* node) = 0;
00314 };
00315 
00318 #endif // __CS_IMAP_SYNTAXSERVICE_H__
00319 

Generated for Crystal Space by doxygen 1.4.4