JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_RelativeCoordinate.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
72class JUCE_API RelativeCoordinate
73{
74public:
75 //==============================================================================
78 RelativeCoordinate (const Expression& expression);
80 RelativeCoordinate& operator= (const RelativeCoordinate&);
82 RelativeCoordinate& operator= (RelativeCoordinate&&) noexcept;
83
88 RelativeCoordinate (double absoluteDistanceFromOrigin);
89
95 RelativeCoordinate (const String& stringVersion);
96
99
100 bool operator== (const RelativeCoordinate&) const noexcept;
101 bool operator!= (const RelativeCoordinate&) const noexcept;
102
103 //==============================================================================
109 double resolve (const Expression::Scope* evaluationScope) const;
110
114 bool references (const String& coordName, const Expression::Scope* evaluationScope) const;
115
117 bool isRecursive (const Expression::Scope* evaluationScope) const;
118
120 bool isDynamic() const;
121
122 //==============================================================================
129 void moveToAbsolute (double absoluteTargetPosition, const Expression::Scope* evaluationScope);
130
132 const Expression& getExpression() const { return term; }
133
134
135 //==============================================================================
139 String toString() const;
140
141 //==============================================================================
149 struct Strings
150 {
151 static const String parent;
152 static const String left;
153 static const String right;
154 static const String top;
155 static const String bottom;
156 static const String x;
157 static const String y;
158 static const String width;
159 static const String height;
160 };
161
164 {
165 enum Type
166 {
167 left, right, top, bottom,
168 x, y, width, height,
169 parent,
170 unknown
171 };
172
173 static Type getTypeOf (const String& s) noexcept;
174 };
175
176private:
177 //==============================================================================
178 Expression term;
179};
180
181} // namespace juce
When evaluating an Expression object, this class is used to resolve symbols and perform functions tha...
A class for dynamically evaluating simple numeric expressions.
Expresses a coordinate as a dynamically evaluated expression.
const Expression & getExpression() const
Returns the expression that defines this coordinate.
bool references(const String &coordName, const Expression::Scope *evaluationScope) const
Returns true if this coordinate uses the specified coord name at any level in its evaluation.
The JUCE String class!
Definition juce_String.h:53
JUCE Namespace.
A set of static strings that are commonly used by the RelativeCoordinate class.