diff options
author | Oliver Bolte <obo@openoffice.org> | 2007-07-17 14:12:57 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2007-07-17 14:12:57 +0000 |
commit | 9a32a2de1e684128f3bd454a8dec69d9c07558ba (patch) | |
tree | 34172893054ac997a825d9e128ba25fab457f114 /slideshow/source/inc/shape.hxx | |
parent | INTEGRATION: CWS presfixes12 (1.1.2); FILE ADDED (diff) | |
download | core-9a32a2de1e684128f3bd454a8dec69d9c07558ba.tar.gz core-9a32a2de1e684128f3bd454a8dec69d9c07558ba.zip |
INTEGRATION: CWS presfixes12 (1.6.12); FILE MERGED
2007/02/06 17:18:14 thb 1.6.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:02:26 thb 1.6.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
Diffstat (limited to 'slideshow/source/inc/shape.hxx')
-rw-r--r-- | slideshow/source/inc/shape.hxx | 90 |
1 files changed, 32 insertions, 58 deletions
diff --git a/slideshow/source/inc/shape.hxx b/slideshow/source/inc/shape.hxx index 776b37cd9bc1..e534baee5778 100644 --- a/slideshow/source/inc/shape.hxx +++ b/slideshow/source/inc/shape.hxx @@ -4,9 +4,9 @@ * * $RCSfile: shape.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: kz $ $Date: 2006-12-13 16:01:16 $ + * last change: $Author: obo $ $Date: 2007-07-17 15:12:57 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,8 +33,8 @@ * ************************************************************************/ -#ifndef _SLIDESHOW_SHAPE_HXX -#define _SLIDESHOW_SHAPE_HXX +#ifndef INCLUDED_SLIDESHOW_SHAPE_HXX +#define INCLUDED_SLIDESHOW_SHAPE_HXX #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/drawing/XShape.hpp> @@ -42,14 +42,17 @@ #include <basegfx/range/b2drectangle.hxx> -#include <boost/shared_ptr.hpp> -#include <boost/utility.hpp> +#include "viewlayer.hxx" -#include <viewlayer.hxx> +#include <boost/shared_ptr.hpp> +#include <boost/noncopyable.hpp> #include <set> - #include <vector> +namespace basegfx { + class B2DRange; +} + namespace slideshow { namespace internal @@ -115,16 +118,6 @@ namespace slideshow */ virtual bool clearAllViewLayers() = 0; - // TODO(Q3): This is a wart. Use broadcaster, where - // everyone interested can register at. - - /** Notify that view layer has changed - - @param rNewLayer - View layer that changed (size, transformation etc.) - */ - virtual void viewLayerChanged( const ViewLayerSharedPtr& rNewLayer ) = 0; - // render methods //------------------------------------------------------------------ @@ -148,13 +141,13 @@ namespace slideshow */ virtual bool render() const = 0; - /** Query whether an update is necessary. + /** Query whether shape content changed This method returns true, if shape content changed since the last rendering (i.e. the shape needs an update to reflect that changed content on the views). */ - virtual bool isUpdateNecessary() const = 0; + virtual bool isContentChanged() const = 0; // Shape attributes @@ -174,7 +167,7 @@ namespace slideshow shape as-is from the document, assuming a rotation angle of 0). */ - virtual ::basegfx::B2DRectangle getPosSize() const = 0; + virtual ::basegfx::B2DRange getBounds() const = 0; /** Get the DOM position and size of the shape. @@ -187,7 +180,7 @@ namespace slideshow currently take the shape as-is from the document, assuming a rotation angle of 0). */ - virtual ::basegfx::B2DRectangle getDOMBounds() const = 0; + virtual ::basegfx::B2DRange getDomBounds() const = 0; /** Get the current shape update area. @@ -195,9 +188,9 @@ namespace slideshow for the shape, i.e. the area that needs to be updated, should the shape be painted. Normally, this will be the (possibly rotated and sheared) area returned by - getPosSize(). + getBounds(). */ - virtual ::basegfx::B2DRectangle getUpdateArea() const = 0; + virtual ::basegfx::B2DRange getUpdateArea() const = 0; /** Query whether the shape is visible at all. @@ -228,35 +221,6 @@ namespace slideshow */ virtual bool isBackgroundDetached() const = 0; - // TODO(Q1): Maybe the hasIntrinsicAnimation() method is - // superfluous. Depending on the RTTI implementation, that - // might do exactly the same. - - /** Query whether shape has intrinsic animation. - - This method must return true, if the shape has an - intrinsic animation (e.g. drawing layer animation, or - animated GIF), which needs external update triggers. - - @return true, if this shape is intrinsically animated. - - @see IntrinsicAnimation interface - */ - virtual bool hasIntrinsicAnimation() const = 0; - - typedef ::std::pair< ::basegfx::B2DRectangle, - ::rtl::OUString > HyperLinkRegion; - typedef ::std::vector<HyperLinkRegion> HyperLinkRegions; - - /** Checks whether this shape has hyperlinks to be clicked. - */ - virtual bool hasHyperlinks() const = 0; - - /** @return the position and size of all hyperlinks relative to - the upper left corner of the shape. - */ - virtual HyperLinkRegions getHyperlinkRegions() const = 0; - // Misc //------------------------------------------------------------------ @@ -285,13 +249,23 @@ namespace slideshow // If, someday, the above proposition is no longer true, one directly use // the shape's ZOrder property // - inline bool operator()(const ShapeSharedPtr& rLHS, const ShapeSharedPtr& rRHS) const + static bool compare(const Shape* pLHS, const Shape* pRHS) { - const double nPrioL( rLHS->getPriority() ); - const double nPrioR( rRHS->getPriority() ); + const double nPrioL( pLHS->getPriority() ); + const double nPrioR( pRHS->getPriority() ); // if prios are equal, tie-break on ptr value - return nPrioL == nPrioR ? rLHS.get() < rRHS.get() : nPrioL < nPrioR; + return nPrioL == nPrioR ? pLHS < pRHS : nPrioL < nPrioR; + } + + bool operator()(const ShapeSharedPtr& rLHS, const ShapeSharedPtr& rRHS) const + { + return compare(rLHS.get(),rRHS.get()); + } + + bool operator()(const Shape* pLHS, const Shape* pRHS) const + { + return compare(pLHS, pRHS); } }; }; @@ -304,4 +278,4 @@ namespace slideshow } } -#endif /* _SLIDESHOW_SHAPE_HXX */ +#endif /* INCLUDED_SLIDESHOW_SHAPE_HXX */ |