LibreOffice Module slideshow (master) 1
|
This class represents one layer of output on a Slide. More...
#include <layer.hxx>
Classes | |
struct | ViewEntry |
Public Types | |
typedef std::shared_ptr< LayerEndUpdate > | EndUpdater |
Public Member Functions | |
Layer (const Layer &)=delete | |
Forbid copy construction. More... | |
Layer & | operator= (const Layer &)=delete |
Forbid copy assignment. More... | |
bool | isBackgroundLayer () const |
Predicate, whether this layer is the special background layer. More... | |
ViewLayerSharedPtr | addView (const ViewSharedPtr &rNewView) |
Add a view to this layer. More... | |
ViewLayerSharedPtr | removeView (const ViewSharedPtr &rView) |
Remove a view. More... | |
void | setShapeViews (ShapeSharedPtr const &rShape) const |
Init shape with this layer's views. More... | |
void | setPriority (const ::basegfx::B1DRange &rPrioRange) |
Change layer priority range. More... | |
void | addUpdateRange (::basegfx::B2DRange const &rUpdateRange) |
Add an area that needs update. More... | |
bool | isUpdatePending () const |
Whether any update ranges have been added. More... | |
void | updateBounds (ShapeSharedPtr const &rShape) |
Update layer bound rect from shape bounds. More... | |
bool | commitBounds () |
Commit collected layer bounds to ViewLayer. More... | |
void | clearUpdateRanges () |
Clear all registered update ranges. More... | |
void | clearContent () |
Clear whole layer content. More... | |
EndUpdater | beginUpdate () |
Init layer update. More... | |
void | endUpdate () |
Finish layer update. More... | |
bool | isInsideUpdateArea (ShapeSharedPtr const &rShape) const |
Check whether given shape is inside current update area. More... | |
Static Public Member Functions | |
static LayerSharedPtr | createBackgroundLayer () |
Create background layer. More... | |
static LayerSharedPtr | createLayer () |
Create non-background layer. More... | |
Private Types | |
enum | Dummy { BackgroundLayer } |
typedef ::std::vector< ViewEntry > | ViewEntryVector |
Private Member Functions | |
Layer (Dummy eFlag) | |
Create background layer. More... | |
Layer () | |
Create non-background layer. More... | |
Private Attributes | |
ViewEntryVector | maViewEntries |
basegfx::B2DPolyRange | maUpdateAreas |
basegfx::B2DRange | maBounds |
basegfx::B2DRange | maNewBounds |
bool | mbBoundsDirty |
bool | mbBackgroundLayer |
bool | mbClipSet |
This class represents one layer of output on a Slide.
Layers group shapes for a certain depth region of a slide.
Since slides have a notion of depth, i.e. shapes on it have a certain order in which they lie upon each other, this layering must be modelled. A prime example for this necessity are animations of shapes lying behind other shapes. Then, everything behind the animated shape will be in a background layer, the shape itself will be in an animation layer, and everything before it will be in a foreground layer (these layers are most preferably modelled as XSprite objects internally).
typedef std::shared_ptr<LayerEndUpdate> slideshow::internal::Layer::EndUpdater |
|
private |
|
private |
|
delete |
Forbid copy construction.
|
explicitprivate |
|
explicitprivate |
Create non-background layer.
This constructor will create a layer in front of the background, to contain shapes that should appear in front of animated objects.
Definition at line 45 of file layer.cxx.
Referenced by createBackgroundLayer().
void slideshow::internal::Layer::addUpdateRange | ( | ::basegfx::B2DRange const & | rUpdateRange | ) |
Add an area that needs update.
rUpdateRange | Area on this layer that needs update |
Definition at line 129 of file layer.cxx.
References basegfx::B2DPolyRange::appendElement(), basegfx::Range2D< typename TYPE, typename TRAITS >::isEmpty(), maUpdateAreas, and basegfx::Positive.
ViewLayerSharedPtr slideshow::internal::Layer::addView | ( | const ViewSharedPtr & | rNewView | ) |
Add a view to this layer.
If the view is already added, this method does not add it a second time, just returning the existing ViewLayer.
rNewView | New view to add to this layer. |
Definition at line 55 of file layer.cxx.
References maBounds, maViewEntries, and mbBackgroundLayer.
Layer::EndUpdater slideshow::internal::Layer::beginUpdate | ( | ) |
Init layer update.
This method initializes a full layer update of the update area. When the last copy of the returned EndUpdater is destroyed, the Layer leaves update mode again.
Definition at line 208 of file layer.cxx.
References basegfx::B2DPolyPolygon::count(), basegfx::B2DPolyRange::count(), maUpdateAreas, maViewEntries, mbClipSet, and basegfx::B2DPolyRange::solveCrossovers().
void slideshow::internal::Layer::clearContent | ( | ) |
Clear whole layer content.
This method clears the whole layer content. As a byproduct, all update ranges are cleared as well. It makes no sense to maintain them any further, since they only serve for partial updates.
Definition at line 182 of file layer.cxx.
References clearUpdateRanges(), and maViewEntries.
void slideshow::internal::Layer::clearUpdateRanges | ( | ) |
Clear all registered update ranges.
This method clears all update ranges that are registered at this layer.
Definition at line 177 of file layer.cxx.
References basegfx::B2DPolyRange::clear(), and maUpdateAreas.
Referenced by clearContent(), commitBounds(), and endUpdate().
bool slideshow::internal::Layer::commitBounds | ( | ) |
Commit collected layer bounds to ViewLayer.
Call this method when you're done adding new shapes to the layer.
Definition at line 150 of file layer.cxx.
References clearUpdateRanges(), maBounds, maNewBounds, maViewEntries, mbBackgroundLayer, and mbBoundsDirty.
|
static |
Create background layer.
This method will create a layer without a ViewLayer, i.e. one that displays directly on the background.
Definition at line 261 of file layer.cxx.
References BackgroundLayer, and Layer().
Referenced by slideshow::internal::LayerManager::LayerManager().
|
static |
Create non-background layer.
This method will create a layer in front of the background, to contain shapes that should appear in front of animated objects.
Definition at line 266 of file layer.cxx.
Referenced by slideshow::internal::LayerManager::createForegroundLayer().
void slideshow::internal::Layer::endUpdate | ( | ) |
Finish layer update.
Resets clipping and transformation to normal values
Definition at line 242 of file layer.cxx.
References clearUpdateRanges(), maViewEntries, and mbClipSet.
|
inline |
Predicate, whether this layer is the special background layer.
This method is mostly useful for checking invariants.
Definition at line 92 of file layer.hxx.
References mbBackgroundLayer.
bool slideshow::internal::Layer::isInsideUpdateArea | ( | ShapeSharedPtr const & | rShape | ) | const |
Check whether given shape is inside current update area.
Definition at line 256 of file layer.cxx.
References maUpdateAreas, and basegfx::B2DPolyRange::overlaps().
|
inline |
Whether any update ranges have been added.
Definition at line 150 of file layer.hxx.
References basegfx::B2DPolyRange::count(), and maUpdateAreas.
Referenced by slideshow::internal::LayerManager::isUpdatePending(), and slideshow::internal::LayerManager::update().
ViewLayerSharedPtr slideshow::internal::Layer::removeView | ( | const ViewSharedPtr & | rView | ) |
void slideshow::internal::Layer::setPriority | ( | const ::basegfx::B1DRange & | rPrioRange | ) |
Change layer priority range.
The layer priority affects the position of the layer in the z direction (i.e. before/behind which other layers this one appears). The higher the prio, the further on top of the layer stack this one appears.
rPrioRange | The priority range of differing layers must not intersect |
Definition at line 120 of file layer.cxx.
References maViewEntries, and mbBackgroundLayer.
void slideshow::internal::Layer::setShapeViews | ( | ShapeSharedPtr const & | rShape | ) | const |
Init shape with this layer's views.
rShape | The shape, that will subsequently display on this layer's views |
Definition at line 112 of file layer.cxx.
References maViewEntries.
void slideshow::internal::Layer::updateBounds | ( | ShapeSharedPtr const & | rShape | ) |
Update layer bound rect from shape bounds.
Definition at line 137 of file layer.cxx.
References basegfx::Range2D< typename TYPE, typename TRAITS >::expand(), maNewBounds, mbBackgroundLayer, mbBoundsDirty, and basegfx::Range2D< typename TYPE, typename TRAITS >::reset().
|
private |
Definition at line 250 of file layer.hxx.
Referenced by addView(), and commitBounds().
|
private |
Definition at line 251 of file layer.hxx.
Referenced by commitBounds(), and updateBounds().
|
private |
Definition at line 249 of file layer.hxx.
Referenced by addUpdateRange(), beginUpdate(), clearUpdateRanges(), isInsideUpdateArea(), and isUpdatePending().
|
private |
Definition at line 248 of file layer.hxx.
Referenced by addView(), beginUpdate(), clearContent(), commitBounds(), endUpdate(), removeView(), setPriority(), and setShapeViews().
|
private |
Definition at line 253 of file layer.hxx.
Referenced by addView(), commitBounds(), isBackgroundLayer(), setPriority(), and updateBounds().
|
private |
Definition at line 252 of file layer.hxx.
Referenced by commitBounds(), and updateBounds().
|
private |
Definition at line 257 of file layer.hxx.
Referenced by beginUpdate(), and endUpdate().