00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __VOP_Language__
00021 #define __VOP_Language__
00022
00023 #include "VOP_API.h"
00024 #include <iostream.h>
00025 #include <PRM/PRM_Type.h>
00026 #include "VOP_Types.h"
00027
00028 class UT_String;
00029 class UT_WorkBuffer;
00030 class UT_SymbolTable;
00031 class PRM_ChoiceList;
00032 class PRM_Template;
00033
00034 class VOP_API VOP_Language {
00035 public:
00036 VOP_Language();
00037 virtual ~VOP_Language();
00038
00039 static VOP_Type castVexType(VEX_Type type);
00040
00041 static VOP_Language *getVex();
00042 static VOP_Language *getRsl();
00043 static VOP_Language *guessFromNetworkPattern(const char *pattern);
00044
00045 static const char *getTypeDescription(VOP_Type type);
00046 virtual const char *getTypeUIColor(VOP_Type type) const;
00047
00048 static bool isValidType(int type);
00049
00050 virtual const char *getName() const = 0;
00051 virtual const char *getFileExtension() const = 0;
00052
00053 virtual int isVex() const;
00054
00055 virtual int supportsUniformVarying() const = 0;
00056 virtual int isParameterUniformVarying(int idx) const = 0;
00057
00058
00059 virtual int getNumParmTypes() const;
00060 virtual VOP_Type getParmType(int idx) const;
00061 virtual VOP_Type getUnconditionedParmType(int idx) const;
00062 virtual const char *getParmName(int idx) const;
00063 virtual int allowMenu(int idx) const;
00064 virtual void fillSwitcherTemplate(PRM_Template *,
00065 int with_ranges) const;
00066 virtual void fillParmTemplate(PRM_Template *, int) const;
00067 virtual int fillDialogScript(int idx,
00068 UT_String &ds_type,
00069 int &ds_size) const;
00070 virtual int fillVexPragma(int idx,
00071 UT_String &vex_pragma) const;
00072 virtual int guessParmIndex(VOP_Type voptype,
00073 PRM_Type parmtype,
00074 int size) const;
00075 virtual int getParmIndex(VOP_Type type) const;
00076 virtual int getSingleFloatParmIndex() const;
00077 virtual int getSingleIntParmIndex() const;
00078 virtual int getPossibleOpListIndex() const;
00079 virtual PRM_ChoiceList *getParmTypeMenu() const;
00080
00081
00082 virtual VOP_Type conditionType(VOP_Type type) const = 0;
00083 int isTypeSupported(VOP_Type type) const
00084 { return conditionType(type) == type; }
00085
00086 virtual const char *getExportKeyword() const = 0;
00087 virtual const char *getSprintf() const = 0;
00088 virtual const char *getIsBoundFunction() const = 0;
00089
00090 virtual const char *getParameterOpName() const;
00091 virtual const char *getConstantOpName() const;
00092
00093 virtual const char *getEmptyConstantString(VOP_Type t) const = 0;
00094 virtual void getConstantString(UT_String &str,
00095 VOP_Type t,
00096 int unquoted,
00097 const UT_String v[]) const = 0;
00098
00099
00100
00101 virtual VOP_Type getTypeFromString(const char *str) const;
00102 virtual const char *getDialogStringFromType(VOP_Type type) const;
00103 virtual const char *getCodeStringFromType(VOP_Type type) const=0;
00104 virtual const char *getVaryingStringFromType(VOP_Type type) const;
00105
00106 virtual const UT_SymbolTable&getReservedWords() const = 0;
00107 };
00108
00109 #endif