12 #ifndef __OP_OTLDefinition__
13 #define __OP_OTLDefinition__
33 #define OTL_LEGAL_OPTYPE_NAME_CHARS ".:/"
40 { readExtraInfo(extra_info); }
44 void readExtraInfo(
const char *extra_info);
48 void writeExtraInfo(
UT_String &extra_info)
const;
55 {
return (myOptions.getNumOptions() == 1) && (myOptions.hasOption(
"vopnetmask")); }
57 #define OP_EXTRA_ACCESSOR_COMMON(NAME, TOKEN) \
58 const UT_StringHolder &get##NAME##Token() const \
60 static constexpr UT_StringLit token(TOKEN); \
61 return token.asHolder(); \
64 { myOptions.removeOption(get##NAME##Token()); } \
65 bool has##NAME() const \
66 { return myOptions.hasOption(get##NAME##Token()); } \
71 #define OP_EXTRA_ACCESSOR_BOOL(NAME, TOKEN) \
72 OP_EXTRA_ACCESSOR_COMMON(NAME, TOKEN) \
73 bool get##NAME() const \
74 { return myOptions.getOptionB(get##NAME##Token()); } \
75 void set##NAME(bool value) \
76 { myOptions.setOptionB(get##NAME##Token(), value); } \
78 #define OP_EXTRA_ACCESSOR_STRING(NAME, TOKEN) \
79 OP_EXTRA_ACCESSOR_COMMON(NAME, TOKEN) \
80 const UT_StringHolder & \
82 { return myOptions.getOptionS(get##NAME##Token()); } \
83 void set##NAME(const UT_StringHolder &value) \
84 { myOptions.setOptionSRaw(get##NAME##Token(),value); } \
86 #define OP_EXTRA_ACCESSOR_INT(NAME, TOKEN) \
87 OP_EXTRA_ACCESSOR_COMMON(NAME, TOKEN) \
88 exint get##NAME() const \
89 { return myOptions.getOptionI(get##NAME##Token()); } \
90 void set##NAME(exint value) \
91 { myOptions.setOptionI(get##NAME##Token(),value); } \
116 return name == getHideDefaultParmsToken()
117 || name == getHasObjExtParmsToken()
122 return name == getAlwaysSyncToken()
123 || name == getVisibleOutputsToken()
127 #undef OP_EXTRA_ACCESSOR_COMMON
128 #undef OP_EXTRA_ACCESSOR_BOOL
129 #undef OP_EXTRA_ACCESSOR_STRING
130 #undef OP_EXTRA_ACCESSOR_INT
137 myInputColors = colors;
138 setInputColorsString(writeColorString(colors));
146 myOutputColors = colors;
147 setOutputColorsString(writeColorString(colors));
186 { myAuthor = author; }
188 {
return myCopyright; }
190 { myCopyright = copyright; }
192 {
return myOpTableName; }
194 { myOpTableName = optablename; }
196 {
return myIndexPath; }
198 { myIndexPath = indexpath; }
200 {
return myIndexFile; }
202 { myIndexFile = indexfile; }
204 {
return myLicenseInfo; }
206 { myLicenseInfo = licenseinfo; }
212 {
return myExtraInfo; }
214 { myExtraInfo = extrainfo;
215 myExtraInfoBuffer.readExtraInfo(extrainfo);
218 {
return myExtraInfoBuffer; }
220 { myExtraInfoBuffer =
buf;
223 myExtraInfo = std::move(extra);
227 {
return myUserInfo; }
229 { myUserInfo = userinfo; }
231 {
return myMinInputs; }
233 { myMinInputs = inputs; }
235 {
return myMaxInputs; }
237 { myMaxInputs = inputs; }
239 {
return myNumOrderedInputs; }
241 { myNumOrderedInputs = inputs; }
243 {
return myMaxOutputs; }
245 { myMaxOutputs = outputs; }
247 {
return myModTime; }
249 { myModTime = modtime; }
251 {
return myIsSubnet; }
253 { myIsSubnet = issubnet ? 1 : 0; }
255 {
return myIsPython; }
257 { myIsPython = ispython ? 1 : 0; }
259 {
return myIsDummyDefinition; }
261 { myIsDummyDefinition = isdummy ? 1 : 0; }
263 {
return myCachedLicenseType; }
265 { myCachedLicenseType =
type; }
269 {
return myPath == theInternalPath.asRef(); }
273 { setPath(theInternalPath.asHolder()); }
276 int handleOption(
int argc,
char *argv[]);
286 bool save(std::ostream &os);
289 const char *indent = 0)
const;
294 const char *
format)
const;
305 void getDefinitionSectionName(
UT_String §name)
const;
306 void getDefinitionSectionName(
UT_WorkBuffer §name)
const;
314 static time_t getModTimeFromString(
const char *str);
318 static bool isValidOperatorName(
const char *
name);
326 static bool isMatchingNamespaceScope(
const char *op_name,
327 const char *scope_opname );
345 int32 myNumOrderedInputs;
350 char myIsDummyDefinition;
GLenum GLuint GLenum GLsizei const GLchar * buf
UT_ValArray< OP_OTLDefinition * > OP_OTLDefinitionArray
GLuint GLsizei const GLchar * label
void setLicenseInfo(const UT_StringHolder &licenseinfo)
#define OP_EXTRA_ACCESSOR_BOOL(NAME, TOKEN)
#define OP_EXTRA_ACCESSOR_INT(NAME, TOKEN)
const UT_StringHolder & getLicenseInfo() const
#define OP_EXTRA_ACCESSOR_STRING(NAME, TOKEN)
GLsizei const GLchar *const * path
const UT_StringHolder & getUserInfo() const
const UT_StringHolder & getLabel() const
void setIsSubnet(bool issubnet)
int getNumOrderedInputs() const
void setMaxOutputs(int outputs)
void setUserInfo(const UT_StringHolder &userinfo)
const UT_StringHolder & getIcon() const
bool getIsDummyDefinition() const
const UT_StringHolder & getAuthor() const
void setLabel(const UT_StringHolder &label)
void setNumOrderedInputs(int inputs)
bool isInternal() const
Return if this is an internally defined operator.
void setIcon(const UT_StringHolder &icon)
void setExtraInfo(const UT_StringHolder &extrainfo)
const UT_StringHolder & getPath() const
void setIsPython(bool ispython)
OP_OTLLicenseType getCachedLicenseType() const
void setCopyright(const UT_StringHolder ©right)
void setModTime(time_t modtime)
GLint GLint GLsizei GLint GLenum format
GLuint const GLchar * name
void setName(const UT_StringHolder &name)
const OP_ExtraInfoBuffer & getExtraInfoBuffer() const
time_t getModTime() const
A map of string to various well defined value types.
void setMinInputs(int inputs)
void setPath(const UT_StringHolder &path)
void setIndexFile(const UT_StringHolder &indexfile)
LeafData & operator=(const LeafData &)=delete
const UT_StringHolder & getIndexFile() const
void setCachedLicenseType(OP_OTLLicenseType type)
int getMaxOutputs() const
void setIndexPath(const UT_StringHolder &indexpath)
void setOpTableName(const UT_StringHolder &optablename)
const UT_StringHolder & getName() const
void setPathToInternal()
Mark as internal.
void setAuthor(const UT_StringHolder &author)
const UT_StringHolder & getIndexPath() const
void setIsDummyDefinition(bool isdummy)
void setMaxInputs(int inputs)
void setExtraInfoBuffer(const OP_ExtraInfoBuffer &buf)
const UT_StringHolder & getCopyright() const
const UT_StringHolder & getOpTableName() const
const UT_StringHolder & getExtraInfo() const