openshot-audio  0.1.5
juce_DrawableComposite.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_DRAWABLECOMPOSITE_H_INCLUDED
26 #define JUCE_DRAWABLECOMPOSITE_H_INCLUDED
27 
28 
29 //==============================================================================
36 {
37 public:
38  //==============================================================================
41 
44 
47 
48  //==============================================================================
52  void setBoundingBox (const RelativeParallelogram& newBoundingBox);
53 
57  const RelativeParallelogram& getBoundingBox() const noexcept { return bounds; }
58 
62  void resetBoundingBoxToContentArea();
63 
69  RelativeRectangle getContentArea() const;
70 
76  void setContentArea (const RelativeRectangle& newArea);
77 
81  void resetContentAreaAndBoundingBoxToFitChildren();
82 
83  //==============================================================================
85  static const char* const contentLeftMarkerName;
87  static const char* const contentRightMarkerName;
89  static const char* const contentTopMarkerName;
91  static const char* const contentBottomMarkerName;
92 
93  //==============================================================================
95  Drawable* createCopy() const override;
97  void refreshFromValueTree (const ValueTree&, ComponentBuilder&);
99  ValueTree createValueTree (ComponentBuilder::ImageProvider* imageProvider) const override;
101  static const Identifier valueTreeType;
103  Rectangle<float> getDrawableBounds() const override;
105  void childBoundsChanged (Component*) override;
107  void childrenChanged() override;
109  void parentHierarchyChanged() override;
111  MarkerList* getMarkers (bool xAxis) override;
112 
113  //==============================================================================
116  {
117  public:
118  ValueTreeWrapper (const ValueTree& state);
119 
120  ValueTree getChildList() const;
121  ValueTree getChildListCreating (UndoManager* undoManager);
122 
123  RelativeParallelogram getBoundingBox() const;
124  void setBoundingBox (const RelativeParallelogram& newBounds, UndoManager* undoManager);
125  void resetBoundingBoxToContentArea (UndoManager* undoManager);
126 
127  RelativeRectangle getContentArea() const;
128  void setContentArea (const RelativeRectangle& newArea, UndoManager* undoManager);
129 
130  MarkerList::ValueTreeWrapper getMarkerList (bool xAxis) const;
131  MarkerList::ValueTreeWrapper getMarkerListCreating (bool xAxis, UndoManager* undoManager);
132 
133  static const Identifier topLeft, topRight, bottomLeft;
134 
135  private:
136  static const Identifier childGroupTag, markerGroupTagX, markerGroupTagY;
137  };
138 
139 private:
140  //==============================================================================
141  RelativeParallelogram bounds;
142  MarkerList markersX, markersY;
143  bool updateBoundsReentrant;
144 
147  void recalculateCoordinates (Expression::Scope*);
148 
149  void updateBoundsToFitChildren();
150 
151  DrawableComposite& operator= (const DrawableComposite&);
153 };
154 
155 
156 #endif // JUCE_DRAWABLECOMPOSITE_H_INCLUDED
static const Identifier valueTreeType
Definition: juce_DrawableComposite.h:101
void parentHierarchyChanged() override
Definition: juce_Drawable.cpp:93
Definition: juce_MarkerList.h:36
static const char *const contentLeftMarkerName
Definition: juce_DrawableComposite.h:85
Definition: juce_DrawableComposite.h:115
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_RelativeRectangle.h:37
static const char *const contentTopMarkerName
Definition: juce_DrawableComposite.h:89
Definition: juce_MarkerList.h:150
friend class DrawableComposite
Definition: juce_Drawable.h:207
Definition: juce_Expression.h:113
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_Drawable.h:222
Definition: juce_Rectangle.h:36
static const Identifier topRight
Definition: juce_DrawableComposite.h:133
Definition: juce_Component.h:33
Definition: juce_DrawableComposite.h:35
static const char *const contentBottomMarkerName
Definition: juce_DrawableComposite.h:91
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
virtual MarkerList * getMarkers(bool xAxis)
Definition: juce_Component.cpp:2213
Definition: juce_ComponentBuilder.h:45
Definition: juce_Drawable.h:35
const RelativeParallelogram & getBoundingBox() const noexcept
Definition: juce_DrawableComposite.h:57
virtual void childBoundsChanged(Component *child)
Definition: juce_Component.cpp:2274
virtual void childrenChanged()
Definition: juce_Component.cpp:1647
static const char *const contentRightMarkerName
Definition: juce_DrawableComposite.h:87
Definition: juce_Drawable.h:185
Definition: juce_ValueTree.h:64
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
Definition: juce_UndoManager.h:49
virtual Rectangle< float > getDrawableBounds() const =0
Definition: juce_Identifier.h:43
Definition: juce_ComponentBuilder.h:183