HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PRM_TemplateBuilder.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: PRM_TemplateBuilder.h (Parameter Library)
7  *
8  * COMMENTS:
9  * Constructs a PRM_Template * list from an embedded .ds file.
10  *
11  */
12 
13 #ifndef __PRM_TemplateBuilder__
14 #define __PRM_TemplateBuilder__
15 
16 #include "PRM_API.h"
17 #include <UT/UT_StringHolder.h>
18 #include "PRM_Type.h"
19 
20 class PRM_Template;
21 class PRM_ScriptPage;
22 class DS_Stream;
23 class UT_IStream;
24 
25 /// Constructs a PRM_Template list from an embedded .ds file or an istream.
27 {
28 public:
29  /// extra_parms is the number of additional parameter templates at the
30  /// head of templates(). That is, the first parameter from the .ds file is
31  /// loaded into templates()[extra_parms].
32  PRM_TemplateBuilder(const UT_StringHolder &name, const char *dstext,
33  const char **cpp_options = nullptr,
34  int extra_parms = 0);
36  const char **cpp_options = nullptr,
37  int extra_parms = 0);
39 
40  PRM_Template *templates() const { return myTemplate; }
41 
42  int templateLength() const { return myTemplateLength; }
43 
44  void setCallback(const UT_StringRef &name,
45  PRM_Callback callback);
46  void setChoiceListPtr(const UT_StringRef &name,
47  PRM_ChoiceList *list);
48 
49  void setNoResim(const UT_StringRef &name, bool noresim);
50  void setNoCook(const UT_StringRef &name, bool nocook);
51 
52  /// Returns if it was just built, used for any successive one
53  /// time initialization. Calling this function will mark it as
54  /// built.
55  bool justBuilt();
56 
57  /// Returns a template pointer by name. Searches nested multiparms.
58  PRM_Template *findTemplate(const UT_StringRef &name);
59 
60 private:
61 
62  void load(UT_IStream &stream, const char **cpp_options,
63  int extra_parms);
64 
65  PRM_Template *myTemplate;
66  int myTemplateLength;
67  PRM_ScriptPage *myPage;
68  bool myJustBuilt;
69  UT_StringHolder myName;
70 };
71 
72 #endif
GLuint GLuint stream
Definition: glcorearb.h:1832
Constructs a PRM_Template list from an embedded .ds file or an istream.
PRM_Template * templates() const
GLuint const GLchar * name
Definition: glcorearb.h:786
#define PRM_API
Definition: PRM_API.h:10