openshot-audio  0.1.5
juce_DrawableRectangle.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_DRAWABLERECTANGLE_H_INCLUDED
26 #define JUCE_DRAWABLERECTANGLE_H_INCLUDED
27 
28 
29 //==============================================================================
38 {
39 public:
40  //==============================================================================
43 
46 
47  //==============================================================================
49  void setRectangle (const RelativeParallelogram& newBounds);
50 
52  const RelativeParallelogram& getRectangle() const noexcept { return bounds; }
53 
55  const RelativePoint& getCornerSize() const noexcept { return cornerSize; }
56 
58  void setCornerSize (const RelativePoint& newSize);
59 
60  //==============================================================================
62  Drawable* createCopy() const;
64  void refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder);
68  static const Identifier valueTreeType;
69 
70  //==============================================================================
73  {
74  public:
75  ValueTreeWrapper (const ValueTree& state);
76 
77  RelativeParallelogram getRectangle() const;
78  void setRectangle (const RelativeParallelogram& newBounds, UndoManager*);
79 
80  void setCornerSize (const RelativePoint& cornerSize, UndoManager*);
81  RelativePoint getCornerSize() const;
82  Value getCornerSizeValue (UndoManager*);
83 
84  static const Identifier topLeft, topRight, bottomLeft, cornerSize;
85  };
86 
87 
88 private:
90 
91  RelativeParallelogram bounds;
92  RelativePoint cornerSize;
93 
94  void rebuildPath();
96  void recalculateCoordinates (Expression::Scope*);
97 
98  DrawableRectangle& operator= (const DrawableRectangle&);
100 };
101 
102 
103 #endif // JUCE_DRAWABLERECTANGLE_H_INCLUDED
Definition: juce_DrawableShape.h:36
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_DrawableRectangle.h:37
Definition: juce_Expression.h:113
const RelativePoint & getCornerSize() const noexcept
Definition: juce_DrawableRectangle.h:55
#define JUCE_API
Definition: juce_StandardHeader.h:139
static const Identifier valueTreeType
Definition: juce_DrawableRectangle.h:68
Definition: juce_RelativePoint.h:35
Definition: juce_Drawable.h:222
Definition: juce_DrawableShape.h:127
Definition: juce_DrawableRectangle.h:72
static const Identifier topRight
Definition: juce_DrawableRectangle.h:84
Definition: juce_RelativeCoordinatePositioner.h:33
virtual Drawable * createCopy() const =0
virtual ValueTree createValueTree(ComponentBuilder::ImageProvider *imageProvider) const =0
Definition: juce_RelativeParallelogram.h:35
bool registerCoordinates() override
Definition: juce_Drawable.h:230
Definition: juce_ComponentBuilder.h:45
Definition: juce_Drawable.h:35
Definition: juce_Value.h:44
const RelativeParallelogram & getRectangle() const noexcept
Definition: juce_DrawableRectangle.h:52
Definition: juce_ValueTree.h:64
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
Definition: juce_UndoManager.h:49
Definition: juce_Identifier.h:43
Definition: juce_ComponentBuilder.h:183