CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | 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 
00026 #include "csutil/scf.h"
00027 #include "csutil/ref.h"
00028 #include "ivideo/graph3d.h"
00029 
00030 class csShaderVariable;
00031 class csMatrix3;
00032 class csVector3;
00033 class csVector2;
00034 class csColor;
00035 class csBox3;
00036 class csGradient;
00037 struct csAlphaMode;
00038 struct iEngine;
00039 struct iSector;
00040 struct iMaterialWrapper;
00041 struct iThingFactoryState;
00042 struct iLoaderContext;
00043 struct iDocumentNode;
00044 struct iString;
00045 struct iStringSet;
00046 struct iKeyValuePair;
00047 
00050 
00051 #define CSTEX_UV 1  
00052 
00053 #define CSTEX_V1 2  
00054 
00055 #define CSTEX_V2 4  
00056 
00057 #define CSTEX_UV_SHIFT 8 
00058 
00060 SCF_VERSION (iSyntaxService, 1, 6, 0);
00061 
00066 struct iSyntaxService : public iBase
00067 {
00082   virtual bool ParseBool (iDocumentNode* node, bool& result,
00083         bool def_result) = 0;
00084   
00088   virtual bool WriteBool (iDocumentNode* node, const char* name, 
00089     bool value) = 0;
00090   
00095   bool WriteBool (iDocumentNode* node, const char* name, bool value, 
00096     bool default_value) 
00097   { 
00098     if (value != default_value) 
00099       return WriteBool (node, name, value); 
00100     else
00101       return true;
00102   }
00103   
00107   virtual bool ParseMatrix (iDocumentNode* node, csMatrix3 &m) = 0;
00108 
00112   virtual bool WriteMatrix (iDocumentNode* node, csMatrix3* m) = 0;
00113 
00117   virtual bool ParseVector (iDocumentNode* node, csVector3 &v) = 0;
00118 
00122   virtual bool WriteVector (iDocumentNode* node, csVector3* v) = 0;
00123 
00127   virtual bool ParseVector (iDocumentNode* node, csVector2 &v) = 0;
00128 
00132   virtual bool WriteVector (iDocumentNode* node, csVector2* v) = 0;
00133 
00137   virtual bool ParseBox (iDocumentNode* node, csBox3 &v) = 0;
00138 
00142   virtual bool WriteBox (iDocumentNode* node, csBox3* v) = 0;
00143 
00147   virtual bool ParseColor (iDocumentNode* node, csColor &c) = 0;
00148 
00152   virtual bool WriteColor (iDocumentNode* node, csColor* c) = 0;
00153 
00157   virtual bool ParseColor (iDocumentNode* node, csColor4 &c) = 0;
00158 
00162   virtual bool WriteColor (iDocumentNode* node, csColor4* c) = 0;
00163 
00167   virtual bool ParseMixmode (iDocumentNode* node, uint &mixmode,
00168     bool allowFxMesh = false) = 0;
00169 
00173   virtual bool WriteMixmode (iDocumentNode* node, uint mixmode,
00174     bool allowFxMesh) = 0;
00175 
00182   virtual bool HandlePortalParameter (
00183         iDocumentNode* child, iLoaderContext* ldr_context,
00184         uint32 &flags, bool &mirror, bool &warp, int& msv,
00185         csMatrix3 &m, csVector3 &before, csVector3 &after,
00186         iString* destSector, bool& handled, bool& autoresolve) = 0;
00187 
00191   virtual bool ParseGradient (iDocumentNode* node,
00192                               csGradient& gradient) = 0;
00193 
00197   virtual bool WriteGradient (iDocumentNode* node,
00198                               csGradient* gradient) = 0;
00199 
00203   virtual bool ParseShaderVar (iDocumentNode* node, 
00204     csShaderVariable& var) = 0;
00205                             
00209   virtual bool WriteShaderVar (iDocumentNode* node, 
00210     csShaderVariable* var) = 0;
00211                             
00215   virtual void ReportError (const char* msgid, iDocumentNode* errornode,
00216         const char* msg, ...) CS_GNUC_PRINTF(4,5) = 0;
00217 
00222   virtual void ReportBadToken (iDocumentNode* badtokennode) = 0;
00223 
00227   virtual void Report (const char* msgid, int severity, 
00228     iDocumentNode* errornode, const char* msg, ...) CS_GNUC_PRINTF(5,6) = 0;
00229   
00233   virtual bool ParseAlphaMode (iDocumentNode* node, iStringSet* strings,
00234     csAlphaMode& alphaMode, bool allowAutoMode = true) = 0;
00235     
00239   virtual bool WriteAlphaMode (iDocumentNode* node, iStringSet* strings,
00240     csAlphaMode* alphaMode) = 0;
00241     
00251   virtual bool ParseZMode (iDocumentNode* node, csZBufMode& zmode,
00252     bool allowZmesh = false) = 0;
00253 
00257   virtual bool WriteZMode (iDocumentNode* node, csZBufMode* zmode,
00258     bool allowZmesh) = 0;
00259 
00265   virtual bool ParseKey (iDocumentNode* node, iKeyValuePair* &keyvalue) = 0;
00266 
00271   virtual bool WriteKey (iDocumentNode* node, iKeyValuePair* keyvalue) = 0;
00272 
00276   virtual csRef<iRenderBuffer> ParseRenderBuffer (iDocumentNode* node) = 0;
00277 };
00278 
00281 #endif // __CS_IMAP_SYNTAXSERVICE_H__
00282 

Generated for Crystal Space by doxygen 1.3.9.1