X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fmagnifier%2Fmagnifier-impl.cpp;h=cc60dd6d4b6a9366e6ae85f573b0bec3058e9786;hb=4d4724513d345467aad5d6ff0ff103b191c32a3f;hp=45a315222317403e2cdb2d2ce967aa99f0ee022c;hpb=618c084142032296c60a188b9438d63a81a2d264;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp index 45a3152..cc60dd6 100644 --- a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp +++ b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp @@ -25,10 +25,12 @@ #include #include #include -#include +#include +#include // INTERNAL INCLUDES #include +#include namespace Dali { @@ -50,10 +52,10 @@ Dali::BaseHandle Create() DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Magnifier, Toolkit::Control, Create ) -DALI_PROPERTY_REGISTRATION( Toolkit, Magnifier, "frame-visibility", BOOLEAN, FRAME_VISIBILITY ) -DALI_PROPERTY_REGISTRATION( Toolkit, Magnifier, "magnification-factor", FLOAT, MAGNIFICATION_FACTOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, Magnifier, "frameVisibility", BOOLEAN, FRAME_VISIBILITY ) +DALI_PROPERTY_REGISTRATION( Toolkit, Magnifier, "magnificationFactor", FLOAT, MAGNIFICATION_FACTOR ) -DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Magnifier, "source-position", VECTOR3, SOURCE_POSITION ) +DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Magnifier, "sourcePosition", VECTOR3, SOURCE_POSITION ) DALI_TYPE_REGISTRATION_END() @@ -139,7 +141,7 @@ Dali::Toolkit::Magnifier Magnifier::New() } Magnifier::Magnifier() -: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ), +: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ), mDefaultCameraDistance(1000.f), mActorSize(Vector3::ZERO), mMagnificationFactor(1.0f) @@ -198,7 +200,7 @@ void Magnifier::Initialize() // Use a 1 frame delayed source position to determine the camera actor's position. // This is necessary as the viewport is determined by the Magnifier's Actor's World position (which is computed // at the end of the update cycle i.e. after constraints have been applied.) - //Property::Index propertySourcePositionDelayed = mCameraActor.RegisterProperty("delayed-source-position", Vector3::ZERO); + //Property::Index propertySourcePositionDelayed = mCameraActor.RegisterProperty("delayedSourcePosition", Vector3::ZERO); constraint = Constraint::New( mCameraActor, Actor::Property::POSITION, CameraActorPositionConstraint(stageSize, mDefaultCameraDistance) ); constraint.AddSource( Source( mSourceActor, Actor::Property::WORLD_POSITION ) ); @@ -255,15 +257,19 @@ void Magnifier::SetFrameVisibility(bool visible) Actor self(Self()); mFrame = Actor::New( ); - mFrame.SetPositionInheritanceMode(DONT_INHERIT_POSITION); + mFrame.SetInheritPosition(false); mFrame.SetInheritScale(true); mFrame.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f); mFrame.SetSizeModeFactor( sizeOffset ); - //TODO Set the renderer onto the control self when Actor::RemoveRenderer is supported Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get(); - Toolkit::ControlRenderer borderRenderer = rendererFactory.GetControlRenderer(IMAGE_BORDER_INDENT, Color::WHITE); + + Property::Map map; + map[ RENDERER_TYPE ] = BORDER_RENDERER; + map[ "borderColor" ] = Color::WHITE; + map[ "borderSize" ] = IMAGE_BORDER_INDENT; + Toolkit::ControlRenderer borderRenderer = rendererFactory.CreateControlRenderer( map ); borderRenderer.SetOnStage( mFrame ); Constraint constraint = Constraint::New( mFrame, Actor::Property::POSITION, EqualToConstraint() ); @@ -280,6 +286,8 @@ void Magnifier::SetFrameVisibility(bool visible) void Magnifier::OnSizeSet(const Vector3& targetSize) { + Control::OnSizeSet( targetSize ); + // TODO: Once Camera/CameraActor properties function as proper animatable properties // this code can disappear. // whenever the size of the magnifier changes, the field of view needs to change