## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# 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 "ivideo/graph3d.h"
    00031
    00032 class csBox3;
    00033 class csColor;
    00034 class csColor4;
    00035 class csMatrix3;
    00036 class csOBB;
    00037 class csPlane3;
    00038 class csShaderVariable;
    00039 class csVector2;
    00040 class csVector3;
    00041
    00042 struct csAlphaMode;
    00043
    00044 struct iDocumentNode;
    00045 struct iGradient;
    00046 struct iKeyValuePair;
    00047 struct iLoaderContext;
    00048 struct iMaterialWrapper;
    00049 struct iRenderBuffer;
    00050 struct iSector;
    00051 struct iShader;
    00052 struct iShaderVariableAccessor;
    00053 struct iString;
    00054 struct iStringSet;
    00055 struct iThingFactoryState;
    00056
    00059
    00060 #define CSTEX_UV 1
    00062 #define CSTEX_V1 2
    00064 #define CSTEX_V2 4
    00066 #define CSTEX_UV_SHIFT 8
    00067
    00073 struct iSyntaxService : public virtual iBase
    00074 {
    00075   SCF_INTERFACE (iSyntaxService, 2, 1, 0);
    00076
    00083   virtual void ReportError (const char* msgid, iDocumentNode* errornode,
    00084         const char* msg, ...) CS_GNUC_PRINTF(4,5) = 0;
    00085
    00090   virtual void ReportBadToken (iDocumentNode* badtokennode) = 0;
    00091
    00096   virtual void Report (const char* msgid, int severity,
    00097     iDocumentNode* errornode, const char* msg, ...) CS_GNUC_PRINTF(5,6) = 0;
    00114   virtual bool ParseBool (iDocumentNode* node, bool& result,
    00115         bool def_result) = 0;
    00116
    00139   virtual bool ParseBoolAttribute (iDocumentNode* node, const char* attrname,
    00140         bool& result, bool def_result, bool required) = 0;
    00141
    00145   virtual bool WriteBool (iDocumentNode* node, const char* name,
    00146     bool value) = 0;
    00147
    00152   bool WriteBool (iDocumentNode* node, const char* name, bool value,
    00153     bool default_value)
    00154   {
    00155     if (value != default_value)
    00156       return WriteBool (node, name, value);
    00157     else
    00158       return true;
    00159   }
    00160
    00164   virtual bool ParsePlane (iDocumentNode* node, csPlane3 &p) = 0;
    00165
    00169   virtual bool WritePlane (iDocumentNode* node, const csPlane3& p) = 0;
    00170
    00174   virtual bool ParseMatrix (iDocumentNode* node, csMatrix3 &m) = 0;
    00175
    00179   virtual bool WriteMatrix (iDocumentNode* node, const csMatrix3& m) = 0;
    00180
    00184   virtual bool ParseVector (iDocumentNode* node, csVector3 &v) = 0;
    00185
    00189   virtual bool WriteVector (iDocumentNode* node, const csVector3& v) = 0;
    00190
    00194   virtual bool ParseVector (iDocumentNode* node, csVector2 &v) = 0;
    00195
    00199   virtual bool WriteVector (iDocumentNode* node, const csVector2& v) = 0;
    00200
    00204   virtual bool ParseBox (iDocumentNode* node, csBox3 &v) = 0;
    00205
    00209   virtual bool WriteBox (iDocumentNode* node, const csBox3& v) = 0;
    00210
    00214   virtual bool ParseBox (iDocumentNode* node, csOBB &b) = 0;
    00215
    00219   virtual bool WriteBox (iDocumentNode* node, const csOBB& b) = 0;
    00220
    00224   virtual bool ParseColor (iDocumentNode* node, csColor &c) = 0;
    00225
    00229   virtual bool WriteColor (iDocumentNode* node, const csColor& c) = 0;
    00230
    00234   virtual bool ParseColor (iDocumentNode* node, csColor4 &c) = 0;
    00235
    00239   virtual bool WriteColor (iDocumentNode* node, const csColor4& c) = 0;
    00240
    00244   virtual bool ParseMixmode (iDocumentNode* node, uint &mixmode,
    00245     bool allowFxMesh = false) = 0;
    00246
    00250   virtual bool WriteMixmode (iDocumentNode* node, uint mixmode,
    00251     bool allowFxMesh) = 0;
    00252
    00259   virtual bool HandlePortalParameter (
    00260         iDocumentNode* child, iLoaderContext* ldr_context,
    00261         uint32 &flags, bool &mirror, bool &warp, int& msv,
    00262         csMatrix3 &m, csVector3 &before, csVector3 &after,
    00263         iString* destSector, bool& handled, bool& autoresolve) = 0;
    00264
    00271   virtual bool ParseGradient (iDocumentNode* node,
    00272                               iGradient* gradient) = 0;
    00273
    00277   virtual bool WriteGradient (iDocumentNode* node,
    00278                               iGradient* gradient) = 0;
    00279
    00283   virtual bool ParseShaderVar (iLoaderContext* ldr_context,
    00284       iDocumentNode* node, csShaderVariable& var) = 0;
    00289   virtual csRef<iShaderVariableAccessor> ParseShaderVarExpr (
    00290     iDocumentNode* node) = 0;
    00291
    00295   virtual bool WriteShaderVar (iDocumentNode* node,
    00296     csShaderVariable& var) = 0;
    00297
    00301   virtual bool ParseAlphaMode (iDocumentNode* node, iStringSet* strings,
    00302     csAlphaMode& alphaMode, bool allowAutoMode = true) = 0;
    00303
    00307   virtual bool WriteAlphaMode (iDocumentNode* node, iStringSet* strings,
    00308     const csAlphaMode& alphaMode) = 0;
    00309
    00319   virtual bool ParseZMode (iDocumentNode* node, csZBufMode& zmode,
    00320     bool allowZmesh = false) = 0;
    00321
    00325   virtual bool WriteZMode (iDocumentNode* node, csZBufMode zmode,
    00326     bool allowZmesh) = 0;
    00327
    00333   virtual bool ParseKey (iDocumentNode* node, iKeyValuePair*& keyvalue) = 0;
    00334
    00339   virtual bool WriteKey (iDocumentNode* node, iKeyValuePair* keyvalue) = 0;
    00340
    00344   virtual csRef<iRenderBuffer> ParseRenderBuffer (iDocumentNode* node) = 0;
    00345
    00349   virtual bool WriteRenderBuffer (iDocumentNode* node, iRenderBuffer* buffer) = 0;
    00350
    00361   virtual csRef<iShader> ParseShaderRef (iLoaderContext* ldr_context,
    00362       iDocumentNode* node) = 0;
    00363 };
    00364
    00367 #endif // __CS_IMAP_SYNTAXSERVICE_H__
    00368