Unindent.
Change-Id: I875bdf1eb6df37b07dd19c6a7ff5ba5eb3b8a096
This commit is contained in:
@@ -41,20 +41,20 @@
|
|||||||
|
|
||||||
using namespace com::sun::star;
|
using namespace com::sun::star;
|
||||||
|
|
||||||
namespace
|
namespace {
|
||||||
{
|
|
||||||
// animated extractor
|
|
||||||
|
|
||||||
// Necessary to filter a sequence of animated primitives from
|
// animated extractor
|
||||||
// a sequence of primitives to find out if animated or not. The decision for
|
|
||||||
// what to decompose is hard-coded and only done for knowingly animated primitives
|
// Necessary to filter a sequence of animated primitives from
|
||||||
// to not decompose too deeply and unnecessarily. This implies that the list
|
// a sequence of primitives to find out if animated or not. The decision for
|
||||||
// which is view-specific needs to be expanded by hand when new animated objects
|
// what to decompose is hard-coded and only done for knowingly animated primitives
|
||||||
// are added. This may eventually be changed to a dynamically configurable approach
|
// to not decompose too deeply and unnecessarily. This implies that the list
|
||||||
// if necessary.
|
// which is view-specific needs to be expanded by hand when new animated objects
|
||||||
class AnimatedExtractingProcessor2D : public drawinglayer::processor2d::BaseProcessor2D
|
// are added. This may eventually be changed to a dynamically configurable approach
|
||||||
{
|
// if necessary.
|
||||||
protected:
|
class AnimatedExtractingProcessor2D : public drawinglayer::processor2d::BaseProcessor2D
|
||||||
|
{
|
||||||
|
protected:
|
||||||
// the found animated primitives
|
// the found animated primitives
|
||||||
drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence;
|
drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence;
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ namespace
|
|||||||
// virtual render method when the primitive implementation is BasePrimitive2D-based.
|
// virtual render method when the primitive implementation is BasePrimitive2D-based.
|
||||||
virtual void processBasePrimitive2D(const drawinglayer::primitive2d::BasePrimitive2D& rCandidate) SAL_OVERRIDE;
|
virtual void processBasePrimitive2D(const drawinglayer::primitive2d::BasePrimitive2D& rCandidate) SAL_OVERRIDE;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AnimatedExtractingProcessor2D(
|
AnimatedExtractingProcessor2D(
|
||||||
const drawinglayer::geometry::ViewInformation2D& rViewInformation,
|
const drawinglayer::geometry::ViewInformation2D& rViewInformation,
|
||||||
bool bTextAnimationAllowed,
|
bool bTextAnimationAllowed,
|
||||||
@@ -80,25 +80,25 @@ namespace
|
|||||||
const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
|
const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
|
||||||
bool isTextAnimationAllowed() const { return mbTextAnimationAllowed; }
|
bool isTextAnimationAllowed() const { return mbTextAnimationAllowed; }
|
||||||
bool isGraphicAnimationAllowed() const { return mbGraphicAnimationAllowed; }
|
bool isGraphicAnimationAllowed() const { return mbGraphicAnimationAllowed; }
|
||||||
};
|
};
|
||||||
|
|
||||||
AnimatedExtractingProcessor2D::AnimatedExtractingProcessor2D(
|
AnimatedExtractingProcessor2D::AnimatedExtractingProcessor2D(
|
||||||
const drawinglayer::geometry::ViewInformation2D& rViewInformation,
|
const drawinglayer::geometry::ViewInformation2D& rViewInformation,
|
||||||
bool bTextAnimationAllowed,
|
bool bTextAnimationAllowed,
|
||||||
bool bGraphicAnimationAllowed)
|
bool bGraphicAnimationAllowed)
|
||||||
: drawinglayer::processor2d::BaseProcessor2D(rViewInformation),
|
: drawinglayer::processor2d::BaseProcessor2D(rViewInformation),
|
||||||
maPrimitive2DSequence(),
|
maPrimitive2DSequence(),
|
||||||
mbTextAnimationAllowed(bTextAnimationAllowed),
|
mbTextAnimationAllowed(bTextAnimationAllowed),
|
||||||
mbGraphicAnimationAllowed(bGraphicAnimationAllowed)
|
mbGraphicAnimationAllowed(bGraphicAnimationAllowed)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimatedExtractingProcessor2D::~AnimatedExtractingProcessor2D()
|
AnimatedExtractingProcessor2D::~AnimatedExtractingProcessor2D()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimatedExtractingProcessor2D::processBasePrimitive2D(const drawinglayer::primitive2d::BasePrimitive2D& rCandidate)
|
void AnimatedExtractingProcessor2D::processBasePrimitive2D(const drawinglayer::primitive2d::BasePrimitive2D& rCandidate)
|
||||||
{
|
{
|
||||||
// known implementation, access directly
|
// known implementation, access directly
|
||||||
switch(rCandidate.getPrimitive2DID())
|
switch(rCandidate.getPrimitive2DID())
|
||||||
{
|
{
|
||||||
@@ -154,32 +154,29 @@ namespace
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
|
namespace sdr { namespace contact {
|
||||||
|
|
||||||
|
ViewObjectContact::ViewObjectContact(ObjectContact& rObjectContact, ViewContact& rViewContact)
|
||||||
namespace sdr
|
: mrObjectContact(rObjectContact),
|
||||||
{
|
|
||||||
namespace contact
|
|
||||||
{
|
|
||||||
ViewObjectContact::ViewObjectContact(ObjectContact& rObjectContact, ViewContact& rViewContact)
|
|
||||||
: mrObjectContact(rObjectContact),
|
|
||||||
mrViewContact(rViewContact),
|
mrViewContact(rViewContact),
|
||||||
maObjectRange(),
|
maObjectRange(),
|
||||||
mxPrimitive2DSequence(),
|
mxPrimitive2DSequence(),
|
||||||
mpPrimitiveAnimation(0),
|
mpPrimitiveAnimation(0),
|
||||||
mbLazyInvalidate(false)
|
mbLazyInvalidate(false)
|
||||||
{
|
{
|
||||||
// make the ViewContact remember me
|
// make the ViewContact remember me
|
||||||
mrViewContact.AddViewObjectContact(*this);
|
mrViewContact.AddViewObjectContact(*this);
|
||||||
|
|
||||||
// make the ObjectContact remember me
|
// make the ObjectContact remember me
|
||||||
mrObjectContact.AddViewObjectContact(*this);
|
mrObjectContact.AddViewObjectContact(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewObjectContact::~ViewObjectContact()
|
ViewObjectContact::~ViewObjectContact()
|
||||||
{
|
{
|
||||||
// invalidate in view
|
// invalidate in view
|
||||||
if(!maObjectRange.isEmpty())
|
if(!maObjectRange.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -203,10 +200,10 @@ namespace sdr
|
|||||||
|
|
||||||
// take care of remembered ViewContact
|
// take care of remembered ViewContact
|
||||||
GetViewContact().RemoveViewObjectContact(*this);
|
GetViewContact().RemoveViewObjectContact(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
const basegfx::B2DRange& ViewObjectContact::getObjectRange() const
|
const basegfx::B2DRange& ViewObjectContact::getObjectRange() const
|
||||||
{
|
{
|
||||||
if(maObjectRange.isEmpty())
|
if(maObjectRange.isEmpty())
|
||||||
{
|
{
|
||||||
// if range is not computed (new or LazyInvalidate objects), force it
|
// if range is not computed (new or LazyInvalidate objects), force it
|
||||||
@@ -222,10 +219,10 @@ namespace sdr
|
|||||||
}
|
}
|
||||||
|
|
||||||
return maObjectRange;
|
return maObjectRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewObjectContact::ActionChanged()
|
void ViewObjectContact::ActionChanged()
|
||||||
{
|
{
|
||||||
if(!mbLazyInvalidate)
|
if(!mbLazyInvalidate)
|
||||||
{
|
{
|
||||||
// set local flag
|
// set local flag
|
||||||
@@ -246,10 +243,10 @@ namespace sdr
|
|||||||
// register at OC for lazy invalidate
|
// register at OC for lazy invalidate
|
||||||
GetObjectContact().setLazyInvalidate(*this);
|
GetObjectContact().setLazyInvalidate(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewObjectContact::triggerLazyInvalidate()
|
void ViewObjectContact::triggerLazyInvalidate()
|
||||||
{
|
{
|
||||||
if(mbLazyInvalidate)
|
if(mbLazyInvalidate)
|
||||||
{
|
{
|
||||||
// reset flag
|
// reset flag
|
||||||
@@ -272,11 +269,11 @@ namespace sdr
|
|||||||
GetObjectContact().InvalidatePartOfView(maObjectRange);
|
GetObjectContact().InvalidatePartOfView(maObjectRange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Take some action when new objects are inserted
|
// Take some action when new objects are inserted
|
||||||
void ViewObjectContact::ActionChildInserted(ViewContact& rChild)
|
void ViewObjectContact::ActionChildInserted(ViewContact& rChild)
|
||||||
{
|
{
|
||||||
// force creation of the new VOC and trigger it's refresh, so it
|
// force creation of the new VOC and trigger it's refresh, so it
|
||||||
// will take part in LazyInvalidate immediately
|
// will take part in LazyInvalidate immediately
|
||||||
rChild.GetViewObjectContact(GetObjectContact()).ActionChanged();
|
rChild.GetViewObjectContact(GetObjectContact()).ActionChanged();
|
||||||
@@ -284,10 +281,10 @@ namespace sdr
|
|||||||
// forward action to ObjectContact
|
// forward action to ObjectContact
|
||||||
// const ViewObjectContact& rChildVOC = rChild.GetViewObjectContact(GetObjectContact());
|
// const ViewObjectContact& rChildVOC = rChild.GetViewObjectContact(GetObjectContact());
|
||||||
// GetObjectContact().InvalidatePartOfView(rChildVOC.getObjectRange());
|
// GetObjectContact().InvalidatePartOfView(rChildVOC.getObjectRange());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewObjectContact::checkForPrimitive2DAnimations()
|
void ViewObjectContact::checkForPrimitive2DAnimations()
|
||||||
{
|
{
|
||||||
// remove old one
|
// remove old one
|
||||||
if(mpPrimitiveAnimation)
|
if(mpPrimitiveAnimation)
|
||||||
{
|
{
|
||||||
@@ -314,10 +311,10 @@ namespace sdr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
|
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
|
||||||
{
|
{
|
||||||
// get the view-independent Primitive from the viewContact
|
// get the view-independent Primitive from the viewContact
|
||||||
drawinglayer::primitive2d::Primitive2DSequence xRetval(GetViewContact().getViewIndependentPrimitive2DSequence());
|
drawinglayer::primitive2d::Primitive2DSequence xRetval(GetViewContact().getViewIndependentPrimitive2DSequence());
|
||||||
|
|
||||||
@@ -352,10 +349,10 @@ namespace sdr
|
|||||||
}
|
}
|
||||||
|
|
||||||
return xRetval;
|
return xRetval;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
|
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
|
||||||
{
|
{
|
||||||
drawinglayer::primitive2d::Primitive2DSequence xNewPrimitiveSequence;
|
drawinglayer::primitive2d::Primitive2DSequence xNewPrimitiveSequence;
|
||||||
|
|
||||||
// take care of redirectors and create new list
|
// take care of redirectors and create new list
|
||||||
@@ -387,22 +384,22 @@ namespace sdr
|
|||||||
|
|
||||||
// return current Primitive2DSequence
|
// return current Primitive2DSequence
|
||||||
return mxPrimitive2DSequence;
|
return mxPrimitive2DSequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ViewObjectContact::isPrimitiveVisible(const DisplayInfo& /*rDisplayInfo*/) const
|
bool ViewObjectContact::isPrimitiveVisible(const DisplayInfo& /*rDisplayInfo*/) const
|
||||||
{
|
{
|
||||||
// default: always visible
|
// default: always visible
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ViewObjectContact::isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const
|
bool ViewObjectContact::isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const
|
||||||
{
|
{
|
||||||
// default: standard check
|
// default: standard check
|
||||||
return (GetObjectContact().DoVisualizeEnteredGroup() && !GetObjectContact().isOutputToPrinter() && rDisplayInfo.IsGhostedDrawModeActive());
|
return (GetObjectContact().DoVisualizeEnteredGroup() && !GetObjectContact().isOutputToPrinter() && rDisplayInfo.IsGhostedDrawModeActive());
|
||||||
}
|
}
|
||||||
|
|
||||||
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
|
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
|
||||||
{
|
{
|
||||||
drawinglayer::primitive2d::Primitive2DSequence xRetval;
|
drawinglayer::primitive2d::Primitive2DSequence xRetval;
|
||||||
|
|
||||||
// check model-view visibility
|
// check model-view visibility
|
||||||
@@ -427,10 +424,10 @@ namespace sdr
|
|||||||
}
|
}
|
||||||
|
|
||||||
return xRetval;
|
return xRetval;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const
|
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const
|
||||||
{
|
{
|
||||||
const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
|
const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
|
||||||
drawinglayer::primitive2d::Primitive2DSequence xSeqRetval;
|
drawinglayer::primitive2d::Primitive2DSequence xSeqRetval;
|
||||||
|
|
||||||
@@ -442,8 +439,8 @@ namespace sdr
|
|||||||
}
|
}
|
||||||
|
|
||||||
return xSeqRetval;
|
return xSeqRetval;
|
||||||
}
|
}
|
||||||
} // end of namespace contact
|
|
||||||
} // end of namespace sdr
|
}}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
Reference in New Issue
Block a user