HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STY_Override.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: STY_Override.h ( STY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __STY_Override__
12 #define __STY_Override__
13 
14 #include "STY_API.h"
15 #include "STY_Types.h"
16 #include <UT/UT_UniquePtr.h>
17 #include <UT/UT_StringArray.h>
18 #include <UT/UT_NonCopyable.h>
19 #include <UT/UT_IntrusivePtr.h>
20 
21 class UT_JSONValue;
22 class STY_LoadContext;
23 
24 /// Describes the way in which a single property override value is calculated.
26  public UT_NonCopyable,
27  public UT_IntrusiveRefCounter<STY_Override>
28 {
29 public:
30  STY_Override(const UT_JSONValue *json,
31  const STY_LoadContext *load_context);
33  const STY_OverrideScriptHandle &script);
34  ~STY_Override();
35 
36  /// Appends data names that the script is interested in for its input
37  /// argument binding.
38  void appendBindingDataNames(UT_StringArray &names) const;
39 
40  /// Save this override set as JSON to a style sheet.
41  void saveStyleSheets(UT_JSONValue *values,
43  const exint num_values,
44  bool evaluate_scripts,
45  bool allow_shared_scripts) const;
46  /// Creates an array of values from an array of closures.
47  bool createOverrideValues(UT_Array<STY_ConstantHandle> &values,
49  const exint num_values) const;
50 
51  /// Direct access to the static override value.
53  { return myConstant; }
54  /// Direct access to the override script.
56  { return myScript; }
57 
58 private:
59  void loadDefinition(const UT_JSONValue *json,
60  const STY_LoadContext *load_context);
61  void loadMapDefinition(const UT_JSONValue *json,
62  const STY_LoadContext *load_context);
63 
64  STY_ConstantHandle myConstant;
65  STY_OverrideScriptHandle myScript;
66 };
67 
68 #endif
69 
const STY_OverrideScriptHandle & getScript() const
Direct access to the override script.
Definition: STY_Override.h:55
const STY_ConstantHandle & getConstant() const
Direct access to the static override value.
Definition: STY_Override.h:52
int64 exint
Definition: SYS_Types.h:125
#define STY_API
Definition: STY_API.h:10
A reference counter base class for use with UT_IntrusivePtr.
Describes the way in which a single property override value is calculated.
Definition: STY_Override.h:25
UT_SharedPtr< const STY_Constant > STY_ConstantHandle
Definition: STY_Types.h:90
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:99
Definition: core.h:1131