// Button::PROPERTY_NORMAL_STATE_ACTOR
{
- button.SetButtonImage( Image::New( "IMAGE_PATH_1") );
+ button.SetButtonImage( ResourceImage::New( "IMAGE_PATH_1") );
DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
// Button::PROPERTY_SELECTED_STATE_ACTOR
{
- button.SetSelectedImage( Image::New( "IMAGE_PATH_2") );
+ button.SetSelectedImage( ResourceImage::New( "IMAGE_PATH_2") );
DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
// Button::PROPERTY_DISABLED_STATE_ACTOR
{
- button.SetDisabledImage( Image::New( "IMAGE_PATH_3") );
+ button.SetDisabledImage( ResourceImage::New( "IMAGE_PATH_3") );
DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
DALI_TEST_CHECK( !control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
- Image image = Image::New("TestImage");
+ Image image = ResourceImage::New("TestImage");
control.SetBackground( image );
DALI_TEST_CHECK( control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::WHITE, TEST_LOCATION );
// Each gesture detector gets created when connecting to the gesture signals
DALI_TEST_CHECK( !control.GetTapGestureDetector() );
- control.ConnectSignal( &connectionTracker, Control::SIGNAL_TAPPED, &TestVoidCallback );
+ control.ConnectSignal( &connectionTracker, "tapped", &TestVoidCallback );
DALI_TEST_CHECK( control.GetTapGestureDetector() );
DALI_TEST_CHECK( !control.GetPanGestureDetector() );
- control.ConnectSignal( &connectionTracker, Control::SIGNAL_PANNED, &TestVoidCallback );
+ control.ConnectSignal( &connectionTracker, "panned", &TestVoidCallback );
DALI_TEST_CHECK( control.GetPanGestureDetector() );
DALI_TEST_CHECK( !control.GetPinchGestureDetector() );
- control.ConnectSignal( &connectionTracker, Control::SIGNAL_PINCHED, &TestVoidCallback );
+ control.ConnectSignal( &connectionTracker, "pinched", &TestVoidCallback );
DALI_TEST_CHECK( control.GetPinchGestureDetector() );
DALI_TEST_CHECK( !control.GetLongPressGestureDetector() );
- control.ConnectSignal( &connectionTracker, Control::SIGNAL_LONG_PRESSED, &TestVoidCallback );
+ control.ConnectSignal( &connectionTracker, "long-pressed", &TestVoidCallback );
DALI_TEST_CHECK( control.GetLongPressGestureDetector() );
END_TEST;
//check the size of the off screen rendered image
Wait( application, OFFSCREEN_RENDER_DURATION );
- ImageAttributes attributes( tile.GetImage().GetAttributes() );
- DALI_TEST_EQUALS( static_cast<float>(attributes.GetWidth()), VIEW_AREA_SIZE.x, TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<float>(attributes.GetHeight()), VIEW_AREA_SIZE.y, TEST_LOCATION );
+ DALI_TEST_EQUALS( tile.GetImage().GetWidth(), VIEW_AREA_SIZE.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( tile.GetImage().GetHeight(), VIEW_AREA_SIZE.y, TEST_LOCATION );
END_TEST;
}
//check the size of the off screen rendered image
Wait( application, OFFSCREEN_RENDER_DURATION );
- ImageAttributes attributes( tile.GetImage().GetAttributes() );
- DALI_TEST_EQUALS( static_cast<float>(attributes.GetWidth()), VIEW_AREA_SIZE.x, TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<float>(attributes.GetHeight()), VIEW_AREA_SIZE.y, TEST_LOCATION );
+ DALI_TEST_EQUALS( tile.GetImage().GetWidth(), VIEW_AREA_SIZE.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( tile.GetImage().GetHeight(), VIEW_AREA_SIZE.y, TEST_LOCATION );
END_TEST;
}
tet_infoline(" UtcDaliCubeTransitionWaveEffectStartTransition ");
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- ImageActor imageActor = CreateSolidColorImageActor(application, Color::BLUE,30,30);
+ ImageActor imageActor = ImageActor::New(ResourceImage::New("Image.jpg"));
CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS, VIEW_AREA_SIZE );
waveEffect.SetTransitionDuration( TRANSITION_DURATION );
tet_infoline(" UtcDaliCubeTransitionCrossEffectStartTransition ");
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- ImageActor imageActor = CreateSolidColorImageActor(application, Color::BLUE,30,30);
+ ImageActor imageActor = ImageActor::New(ResourceImage::New("Image.jpg"));
CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS, VIEW_AREA_SIZE );
crossEffect.SetTransitionDuration( TRANSITION_DURATION );
Toolkit::DisplacementEffect effect = Toolkit::DisplacementEffect::New(Toolkit::DisplacementEffect::DISPLACED);
DALI_TEST_CHECK( effect );
- ImageActor actor = ImageActor::New( Image::New(TEST_IMAGE_FILE_NAME) );
+ ImageActor actor = ImageActor::New( ResourceImage::New(TEST_IMAGE_FILE_NAME) );
actor.SetSize( 100.0f, 100.0f );
actor.SetShaderEffect( effect );
Stage::GetCurrent().Add( actor );
Toolkit::DisplacementEffect effect2 = Toolkit::DisplacementEffect::New(Toolkit::DisplacementEffect::FIXED);
DALI_TEST_CHECK( effect );
- ImageActor actor2 = ImageActor::New( Image::New(TEST_IMAGE_FILE_NAME) );
+ ImageActor actor2 = ImageActor::New( ResourceImage::New(TEST_IMAGE_FILE_NAME) );
actor2.SetSize( 100.0f, 100.0f );
actor2.SetShaderEffect( effect2 );
Stage::GetCurrent().Add( actor2 );
view.Activate();
FrameBufferImage renderTarget = FrameBufferImage::New( 480.0f, 800.0f, Pixel::RGB888 );
- view.SetUserImageAndOutputRenderTarget(Image::New(TEST_IMAGE_FILE_NAME), renderTarget);
+ view.SetUserImageAndOutputRenderTarget(ResourceImage::New(TEST_IMAGE_FILE_NAME), renderTarget);
DALI_TEST_CHECK( view.GetBlurredRenderTarget() == renderTarget );
END_TEST;
}
virtual Actor NewItem(unsigned int itemId)
{
// Create an image actor for this item
- Image image = Image::New( TEST_IMAGE_FILE_NAME );
+ Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
Actor actor = ImageActor::New(image);
return actor;
virtual Actor NewItem(unsigned int itemId)
{
// Create an image actor for this item
- Image image = Image::New( TEST_IMAGE_FILE_NAME );
+ Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
Actor actor = ImageActor::New(image);
return actor;
// [0]: testing PageTurnStartedSignal; [1]: testing PageTurnFinishedSignal
// [2]: testing PagePanStartedSignal; [3]: testing PagePanFinishedSignal
- bool signalVerified[4];
+ bool signalVerified[4] = {false, false, false, false};
PageTurnView currentView;
unsigned int pageIndex;
bool isTurningForwards;
#include <dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.h>
#include <dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.h>
#include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
+#include <dali-toolkit/public-api/shader-effects/quadratic-bezier.h>
#include <dali-toolkit/public-api/shader-effects/ripple-effect.h>
#include <dali-toolkit/public-api/shader-effects/ripple2d-effect.h>
#include <dali-toolkit/public-api/shader-effects/swirl-effect.h>
// EXTERNAL INCLUDES
#include <dali.h>
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/builder/tree-node.h>
#include <dali-toolkit/internal/builder/optional-value.h>
#include <boost/function.hpp>
#include <sstream>
-// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+// INTERNAL INCLUDES
+
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/builder/json-parser.h>
// CLASS HEADER
#include <dali-toolkit/internal/builder/json-parser-impl.h>
-// EXTERNAL
+
+// EXTERNAL INCLUDES
#include <cstring>
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/builder/tree-node-manipulator.h>
#include <dali-toolkit/internal/builder/json-parser-state.h>
*
*/
+// EXTERNAL INCLUDES
#include <string>
#include <vector>
#include <list>
-//
#include <dali/public-api/object/base-object.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/builder/json-parser.h>
#include <dali-toolkit/public-api/builder/tree-node.h>
// CLASS HEADER
#include <dali-toolkit/internal/builder/json-parser-state.h>
-// EXTERNAL
+// EXTERNAL INCLUDES
#include <algorithm>
namespace Dali
*
*/
+// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/builder/tree-node.h>
#include <dali-toolkit/internal/builder/tree-node-manipulator.h>
*
*/
-// INTERNAL INCLUDES
template <typename T>
struct OptionalTypes
{
*
*/
+// EXTERNAL INCLUDES
#include <dali/public-api/object/property-value.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/builder/builder.h>
#include <dali-toolkit/internal/builder/builder-get-is.inl.h>
*
*/
+// EXTERNAL INCLUDES
#include <utility> // pair
#include <iterator>
#include <vector>
#include <cstring>
-// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/builder/tree-node.h>
namespace Dali
*/
// CLASS HEADER
-
#include "alignment-impl.h"
// EXTERNAL INCLUDES
// CLASS HEADER
#include "bloom-view-impl.h"
-#include "../gaussian-blur-view/gaussian-blur-view-impl.h"
// EXTERNAL INCLUDES
#include <sstream>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
#include <dali-toolkit/public-api/controls/bloom-view/bloom-view.h>
+#include "../gaussian-blur-view/gaussian-blur-view-impl.h"
namespace Dali
{
// Create render targets
// create off screen buffer of new size to render our child actors to
- mRenderTargetForRenderingChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::Unused );
- mBloomExtractTarget = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat, Dali::Image::Unused );
- mOutputRenderTarget = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::Unused );
+ mRenderTargetForRenderingChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
+ mBloomExtractTarget = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat, Dali::Image::UNUSED );
+ mOutputRenderTarget = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED);
//////////////////////////////////////////////////////
#include <cmath>
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/shader-effects/bubble-effect/color-adjuster.h>
mBubbleRoot.SetSize(mMovementArea);
// Prepare the frame buffer to store the color adjusted background image
- mEffectImage = FrameBufferImage::New( mMovementArea.width/4.f, mMovementArea.height/4.f, Pixel::RGBA8888, Dali::Image::Unused );
+ mEffectImage = FrameBufferImage::New( mMovementArea.width/4.f, mMovementArea.height/4.f, Pixel::RGBA8888, Dali::Image::UNUSED );
// Generate the material object, which is used by all meshActors
GenMaterial();
mMeshActor[i] = MeshActor::New( mMesh[i] );
mMeshActor[i].SetAffectedByLighting( false );
mMeshActor[i].SetParentOrigin(ParentOrigin::TOP_LEFT);
- mEffect[i] = BubbleEffect::New( mNumBubblePerShader, mShapeImage.GetFilename() );
+ mEffect[i] = BubbleEffect::New( mNumBubblePerShader );
mEffect[i].SetEffectImage( mEffectImage );
mEffect[i].SetMovementArea( mMovementArea );
mMeshActor[i].SetShaderEffect( mEffect[i] );
mMeshActorForNoise = MeshActor::New( Mesh::New(meshDataForNoise) );
mMeshActorForNoise.SetAffectedByLighting( false );
mMeshActorForNoise.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mEffectForNoise = BubbleEffect::New( mNumBubblePerShader, mShapeImage.GetFilename() );
+ mEffectForNoise = BubbleEffect::New( mNumBubblePerShader );
mEffectForNoise.SetMovementArea( mMovementArea );
mEffectForNoise.SetEffectImage( mEffectImage );
mMeshActorForNoise.SetShaderEffect( mEffectForNoise );
void BubbleEmitter::SetShapeImage( Image shapeImage )
{
mCustomMaterial.SetDiffuseTexture( shapeImage );
-
- //Get pixel width of the shape
- float width = Image::GetImageSize(shapeImage.GetFilename()).width;
-
- for(unsigned int i=0; i < mNumShader; i++ )
- {
- mEffect[i].SetShapeImageWidth(width);
- }
- mEffectForNoise.SetShapeImageWidth(width);
}
void BubbleEmitter::SetBubbleScale( float scale )
#include <dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.h>
#include <dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.h>
-#include <map>
-
namespace Dali
{
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/scripting/scripting.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-view/text-view.h>
namespace Dali
const unsigned int INITIAL_AUTOREPEATING_DELAY( 0.15f );
const unsigned int NEXT_AUTOREPEATING_DELAY( 0.05f );
+// Signals
+
+const char* const SIGNAL_PRESSED = "pressed";
+const char* const SIGNAL_RELEASED = "released";
+const char* const SIGNAL_CLICKED = "clicked";
+const char* const SIGNAL_STATE_CHANGED = "state-changed";
+
+// Actions
+
+const char* const ACTION_BUTTON_CLICK = "button-click";
+
BaseHandle Create()
{
// empty handle as we cannot create button (but type registered for clicked signal)
return BaseHandle();
}
-TypeRegistration typeRegistration( typeid(Toolkit::Button), typeid(Toolkit::Control), Create );
+TypeRegistration typeRegistration( typeid( Toolkit::Button ), typeid( Toolkit::Control ), Create );
-SignalConnectorType signalConnector1( typeRegistration, Toolkit::Button::SIGNAL_PRESSED , &Button::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, Toolkit::Button::SIGNAL_RELEASED, &Button::DoConnectSignal );
-SignalConnectorType signalConnector3( typeRegistration, Toolkit::Button::SIGNAL_CLICKED, &Button::DoConnectSignal );
-SignalConnectorType signalConnector4( typeRegistration, Toolkit::Button::SIGNAL_STATE_CHANGED, &Button::DoConnectSignal );
+SignalConnectorType signalConnector1( typeRegistration, SIGNAL_PRESSED , &Button::DoConnectSignal );
+SignalConnectorType signalConnector2( typeRegistration, SIGNAL_RELEASED, &Button::DoConnectSignal );
+SignalConnectorType signalConnector3( typeRegistration, SIGNAL_CLICKED, &Button::DoConnectSignal );
+SignalConnectorType signalConnector4( typeRegistration, SIGNAL_STATE_CHANGED, &Button::DoConnectSignal );
-TypeAction action1( typeRegistration, Toolkit::Button::ACTION_BUTTON_CLICK, &Button::DoAction );
+TypeAction action1( typeRegistration, ACTION_BUTTON_CLICK, &Button::DoAction );
PropertyRegistration property1( typeRegistration, "disabled", Toolkit::Button::PROPERTY_DISABLED, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
PropertyRegistration property2( typeRegistration, "auto-repeating", Toolkit::Button::PROPERTY_AUTO_REPEATING, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
DALI_ASSERT_ALWAYS( button );
- if( Toolkit::Button::ACTION_BUTTON_CLICK == actionName )
+ if( 0 == strcmp( actionName.c_str(), ACTION_BUTTON_CLICK ) )
{
GetImplementation( button ).DoClickAction( attributes );
ret = true;
Dali::BaseHandle handle( object );
bool connected( true );
- Toolkit::Button button = Toolkit::Button::DownCast(handle);
+ Toolkit::Button button = Toolkit::Button::DownCast( handle );
- if( Toolkit::Button::SIGNAL_PRESSED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_PRESSED ) )
{
button.PressedSignal().Connect( tracker, functor );
}
- else if( Toolkit::Button::SIGNAL_RELEASED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_RELEASED ) )
{
button.ReleasedSignal().Connect( tracker, functor );
}
- else if( Dali::Toolkit::Button::SIGNAL_CLICKED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_CLICKED ) )
{
button.ClickedSignal().Connect( tracker, functor );
}
- else if( Dali::Toolkit::Button::SIGNAL_STATE_CHANGED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_STATE_CHANGED ) )
{
button.StateChangedSignal().Connect( tracker, functor );
}
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/signals/connection-tracker.h>
#include "check-box-button-default-painter-impl.h"
// EXTERNAL INCLUDES
+#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/object/ref-object.h>
// INTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/object/ref-object.h>
#include "check-box-button-impl.h"
namespace Dali
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/images/image.h>
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/animation/animation.h>
-#include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
#include "check-box-button-painter-impl.h"
namespace Dali
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
#include "button-impl.h"
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/images/image.h>
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/animation/animation.h>
+// INTERNAL INCLUDES
#include "push-button-painter-impl.h"
namespace Dali
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/images/resource-image.h>
using namespace Dali;
using namespace Dali::Toolkit::Internal;
RadioButton::RadioButton()
{
- mUnselectedImage = Dali::Image::New( UNSELECTED_BUTTON_IMAGE_DIR );
- mSelectedImage = Dali::Image::New( SELECTED_BUTTON_IMAGE_DIR );
+ mUnselectedImage = Dali::ResourceImage::New( UNSELECTED_BUTTON_IMAGE_DIR );
+ mSelectedImage = Dali::ResourceImage::New( SELECTED_BUTTON_IMAGE_DIR );
mRadioIcon = Dali::ImageActor::New( mUnselectedImage );
namespace
{
+// Actions
+
+const char* const ACTION_EXPAND = "expand";
+const char* const ACTION_COLLAPSE = "collapse";
+const char* const ACTION_TRANSFORM = "transform";
+
BaseHandle Create()
{
- Toolkit::ClusterStyleStandard s = Toolkit::ClusterStyleStandard::New(Toolkit::ClusterStyleStandard::ClusterStyle1);
+ Toolkit::ClusterStyleStandard s = Toolkit::ClusterStyleStandard::New( Toolkit::ClusterStyleStandard::ClusterStyle1 );
return Toolkit::Cluster::New( s );
}
-TypeRegistration mType( typeid(Toolkit::Cluster), typeid(Toolkit::Control), Create );
+TypeRegistration mType( typeid( Toolkit::Cluster ), typeid( Toolkit::Control ), Create );
-TypeAction a1(mType, Toolkit::Cluster::ACTION_EXPAND , &Cluster::DoAction);
-TypeAction a2(mType, Toolkit::Cluster::ACTION_COLLAPSE , &Cluster::DoAction);
-TypeAction a3(mType, Toolkit::Cluster::ACTION_TRANSFORM, &Cluster::DoAction);
+TypeAction a1( mType, ACTION_EXPAND, &Cluster::DoAction );
+TypeAction a2( mType, ACTION_COLLAPSE, &Cluster::DoAction );
+TypeAction a3( mType, ACTION_TRANSFORM, &Cluster::DoAction );
}
{
bool ret = false;
- Dali::BaseHandle handle(object);
+ Dali::BaseHandle handle( object );
- Toolkit::Cluster cluster = Toolkit::Cluster::DownCast(handle);
+ Toolkit::Cluster cluster = Toolkit::Cluster::DownCast( handle );
- DALI_ASSERT_ALWAYS(cluster);
+ DALI_ASSERT_ALWAYS( cluster );
- if(Toolkit::Cluster::ACTION_EXPAND == actionName)
+ if( 0 == strcmp( actionName.c_str(), ACTION_EXPAND ) )
{
- GetImpl(cluster).DoExpandAction(attributes);
+ GetImpl( cluster ).DoExpandAction( attributes );
ret = true;
}
- else if(Toolkit::Cluster::ACTION_COLLAPSE == actionName)
+ else if( 0 == strcmp( actionName.c_str(), ACTION_COLLAPSE ) )
{
- GetImpl(cluster).DoCollapseAction(attributes);
+ GetImpl( cluster ).DoCollapseAction( attributes );
ret = true;
}
- else if(Toolkit::Cluster::ACTION_TRANSFORM == actionName)
+ else if( 0 == strcmp( actionName.c_str(), ACTION_TRANSFORM ) )
{
- GetImpl(cluster).DoTransformAction(attributes);
+ GetImpl( cluster ).DoTransformAction( attributes );
ret = true;
}
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/object/ref-object.h>
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/cluster/cluster.h>
#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/cluster/cluster.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/math/vector3.h>
#include <dali/public-api/object/base-object.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
namespace Dali
SetupCameras();
- mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::Unused );
+ mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
mActorForChildren.SetImage(mImageForChildren);
- mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::Unused );
+ mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
mActorPostFilter.SetImage(mImagePostFilter);
SetupFilters();
mRenderFullSizeCamera.SetPosition(0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale);
// create offscreen buffer of new size to render our child actors to
- mRenderTargetForRenderingChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::Unused );
+ mRenderTargetForRenderingChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
// Set ImageActor for performing a horizontal blur on the texture
mImageActorHorizBlur.SetImage( mRenderTargetForRenderingChildren );
// Create offscreen buffer for vert blur pass
- mRenderTarget1 = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat, Dali::Image::Unused );
+ mRenderTarget1 = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat, Dali::Image::UNUSED );
// use the completed blur in the first buffer and composite with the original child actors render
mImageActorComposite.SetImage( mRenderTarget1 );
}
// Create offscreen buffer for horiz blur pass
- mRenderTarget2 = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat, Dali::Image::Unused );
+ mRenderTarget2 = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat, Dali::Image::UNUSED );
// size needs to match render target
mImageActorHorizBlur.SetSize(mDownsampledWidth, mDownsampledHeight);
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/images/resource-image.h>
using namespace Dali;
{
Actor self(Self());
- Image image = Image::New( DEFAULT_FRAME_IMAGE_PATH );
+ Image image = ResourceImage::New( DEFAULT_FRAME_IMAGE_PATH );
mFrame = ImageActor::New( image );
mFrame.SetDrawMode(DrawMode::OVERLAY);
mFrame.SetStyle( ImageActor::STYLE_NINE_PATCH );
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/table-view/table-view.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
#include <dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h>
-
+#include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
namespace Dali
{
namespace // to register type
{
+
+// Actions
+
+const char* const ACTION_PUSH = "push";
+const char* const ACTION_POP = "pop";
+
BaseHandle Create()
{
return Toolkit::NavigationControl::New();
}
-TypeRegistration mType( typeid(Toolkit::NavigationControl), typeid(Toolkit::Control), Create );
+TypeRegistration mType( typeid( Toolkit::NavigationControl ), typeid( Toolkit::Control ), Create );
+
+TypeAction a1( mType, ACTION_PUSH, &NavigationControl::DoAction );
+TypeAction a2( mType, ACTION_POP, &NavigationControl::DoAction );
-TypeAction a1(mType, Toolkit::NavigationControl::ACTION_PUSH, &NavigationControl::DoAction);
-TypeAction a2(mType, Toolkit::NavigationControl::ACTION_POP, &NavigationControl::DoAction);
}
NavigationControl::NavigationControl()
return mItemPoppedSignal;
}
-bool NavigationControl::DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes)
+bool NavigationControl::DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes )
{
bool ret = false;
- Dali::BaseHandle handle(object);
- Toolkit::NavigationControl control = Toolkit::NavigationControl::DownCast(handle);
- DALI_ASSERT_ALWAYS(control);
+ Dali::BaseHandle handle( object );
+ Toolkit::NavigationControl control = Toolkit::NavigationControl::DownCast( handle );
+ DALI_ASSERT_ALWAYS( control );
- if (Toolkit::NavigationControl::ACTION_PUSH == actionName)
+ if( 0 == strcmp( actionName.c_str(), ACTION_PUSH ) )
{
- for (PropertyValueConstIter iter = attributes.begin(); iter != attributes.end(); ++iter)
+ for( PropertyValueConstIter iter = attributes.begin(); iter != attributes.end(); ++iter )
{
const Property::Value& value = *iter;
- DALI_ASSERT_ALWAYS(value.GetType() == Property::STRING);
- std::string itemName = value.Get<std::string> ();
+ DALI_ASSERT_ALWAYS( value.GetType() == Property::STRING );
+ std::string itemName = value.Get<std::string>();
- for (std::list<Toolkit::Page>::iterator itemsIter = GetImpl(control).mUnpushedItems.begin(); itemsIter != GetImpl(control).mUnpushedItems.end(); ++itemsIter)
+ for( std::list<Toolkit::Page>::iterator itemsIter = GetImpl( control ).mUnpushedItems.begin(); itemsIter != GetImpl( control ).mUnpushedItems.end(); ++itemsIter )
{
Toolkit::Page page = *itemsIter;
- if (page.GetName() == itemName)
+ if( page.GetName() == itemName )
{
- GetImpl(control).PushItem(page);
+ GetImpl( control ).PushItem( page );
ret = true;
break;
}
}
}
}
- else if(Toolkit::NavigationControl::ACTION_POP == actionName)
+ else if( 0 == strcmp( actionName.c_str(), ACTION_POP ) )
{
- GetImpl(control).PopItem();
+ GetImpl( control ).PopItem();
ret = true;
}
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/navigation-frame/navigation-control.h>
#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-bar.h>
#include <dali-toolkit/public-api/controls/popup/popup.h>
+#include <dali-toolkit/internal/controls/navigation-frame/navigation-bar.h>
namespace Dali
{
*
*/
+// CLASS HEADER
#include "navigation-title-bar.h"
namespace Dali
*
*/
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
#include <dali-toolkit/public-api/controls/table-view/table-view.h>
#include <dali-toolkit/public-api/controls/text-view/text-view.h>
#include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
#include <dali-toolkit/internal/controls/navigation-frame/navigation-bar.h>
-#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
namespace Dali
{
*
*/
+// CLASS HEADER
#include "navigation-tool-bar.h"
namespace Dali
*
*/
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/table-view/table-view.h>
#include <dali-toolkit/public-api/controls/text-view/text-view.h>
#include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
*/
// CLASS HEADER
-
#include "page-impl.h"
// EXTERNAL INCLUDES
Self().Add( mPageSourceActor[i] );
mPageSourceActor[i].SetSensitive( false );
- mRenderedPage[i] = FrameBufferImage::New( mControlSize.width, mControlSize.height, Pixel::RGB8888, Image::Unused );
+ mRenderedPage[i] = FrameBufferImage::New( mControlSize.width, mControlSize.height, Pixel::RGB8888, Image::UNUSED );
mOffscreenTask[i] = taskList.CreateTask();
mOffscreenTask[i].SetRefreshRate( RenderTask::REFRESH_ONCE );
mOffscreenTask[i].SetCameraActor(mCameraActor);
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/buttons/button.h>
const Vector3 DEFAULT_DIALOG_SIZE = Vector3(POPUP_TITLE_WIDTH/POPUP_WIDTH, 0.5f, 0.0f);
const Vector3 DEFAULT_BOTTOM_SIZE = Vector3(1.0f, 0.2f, 0.0f);
-const char* const PROPERTY_TITLE = "title";
-const char* const PROPERTY_STATE = "state";
+// Signals
+
+const char* const SIGNAL_TOUCHED_OUTSIDE = "touched-outside";
+const char* const SIGNAL_HIDDEN = "hidden";
+
+// Properties
+
+const char* const PROPERTY_TITLE = "title";
+const char* const PROPERTY_STATE = "state";
/**
* The background size should be at least as big as the Dialog.
return Toolkit::Popup::New();
}
-TypeRegistration typeRegistration( typeid(Toolkit::Popup), typeid(Toolkit::Control), Create );
+TypeRegistration typeRegistration( typeid( Toolkit::Popup ), typeid( Toolkit::Control ), Create );
-SignalConnectorType signalConnector1( typeRegistration, Toolkit::Popup::SIGNAL_TOUCHED_OUTSIDE, &Popup::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, Toolkit::Popup::SIGNAL_HIDDEN, &Popup::DoConnectSignal );
+SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TOUCHED_OUTSIDE, &Popup::DoConnectSignal );
+SignalConnectorType signalConnector2( typeRegistration, SIGNAL_HIDDEN, &Popup::DoConnectSignal );
}
if(image != "")
{
- Image tail = Image::New( image );
+ Image tail = ResourceImage::New( image );
mTailImage = ImageActor::New(tail);
const Vector3 anchorPoint = AnchorPoint::FRONT_BOTTOM_RIGHT - position;
void Popup::SetDefaultBackgroundImage()
{
- Image bg = Image::New( mPopupStyle->backgroundImage );
+ Image bg = ResourceImage::New( mPopupStyle->backgroundImage );
ImageActor bgImage = ImageActor::New( bg );
bgImage.SetStyle( ImageActor::STYLE_NINE_PATCH );
bgImage.SetNinePatchBorder( mPopupStyle->backgroundScale9Border );
- Image buttonBg = Image::New( mPopupStyle->buttonAreaImage );
+ Image buttonBg = ResourceImage::New( mPopupStyle->buttonAreaImage );
ImageActor buttonBgImage = ImageActor::New( buttonBg );
buttonBgImage.SetStyle( ImageActor::STYLE_NINE_PATCH );
buttonBgImage.SetNinePatchBorder( mPopupStyle->buttonArea9PatchBorder );
Dali::BaseHandle handle( object );
bool connected( true );
- Toolkit::Popup popup = Toolkit::Popup::DownCast(handle);
+ Toolkit::Popup popup = Toolkit::Popup::DownCast( handle );
- if( Dali::Toolkit::Popup::SIGNAL_TOUCHED_OUTSIDE == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_TOUCHED_OUTSIDE ) )
{
popup.OutsideTouchedSignal().Connect( tracker, functor );
}
- else if( Dali::Toolkit::Popup::SIGNAL_HIDDEN == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_HIDDEN ) )
{
popup.HiddenSignal().Connect( tracker, functor );
}
*
*/
+// EXTERNAL INCLUDES
#include <dali-toolkit/internal/controls/popup/popup-style-impl.h>
using namespace Dali;
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/ref-object.h>
+#include <string>
+
namespace Dali
{
*
*/
-// FILE HEADER
-
+// CLASS HEADER
#include "relayout-controller-impl.h"
// EXTERNAL INCLUDES
*
*/
-// FILE HEADER
-
+// CLASS HEADER
#include "relayout-controller.h"
-#include "relayout-controller-impl.h"
// EXTERNAL INCLUDES
#include <stack>
// INTERNAL INCLUDES
+#include "relayout-controller-impl.h"
#include "dali-toolkit/public-api/controls/control.h"
#include "dali-toolkit/public-api/controls/control-impl.h"
#include "dali-toolkit/public-api/controls/text-view/text-view.h"
// EXTERNAL INCLUDES
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
return Toolkit::ScrollBar::New();
}
-TypeRegistration typeRegistration( typeid(Toolkit::ScrollBar), typeid(Toolkit::ScrollComponent), Create );
+TypeRegistration typeRegistration( typeid( Toolkit::ScrollBar ), typeid( Toolkit::ScrollComponent ), Create );
+
+const char* const SCROLL_POSITION_NOTIFIED_SIGNAL_NAME = "scroll-position-notified";
PropertyRegistration property1( typeRegistration, "indicator-height-policy", Toolkit::ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY, Property::STRING, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
PropertyRegistration property2( typeRegistration, "indicator-fixed-height", Toolkit::ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT, Property::FLOAT, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
{
Actor self = Self();
- Image indicatorImage = Image::New( DEFAULT_INDICATOR_IMAGE_PATH );
+ Image indicatorImage = ResourceImage::New( DEFAULT_INDICATOR_IMAGE_PATH );
mIndicator = ImageActor::New( indicatorImage );
mIndicator.SetNinePatchBorder( DEFAULT_INDICATOR_NINE_PATCH_BORDER );
mIndicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
}
}
+bool ScrollBar::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+ Dali::BaseHandle handle( object );
+
+ bool connected( true );
+ Toolkit::ScrollBar scrollBar = Toolkit::ScrollBar::DownCast( handle );
+
+ if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_NOTIFIED_SIGNAL_NAME ) )
+ {
+ scrollBar.ScrollPositionNotifiedSignal().Connect( tracker, functor );
+ }
+ else
+ {
+ // signalName does not match any signal
+ connected = false;
+ }
+
+ return connected;
+}
+
void ScrollBar::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
{
Toolkit::ScrollBar scrollBar = Toolkit::ScrollBar::DownCast( Dali::BaseHandle( object ) );
return mScrollPositionNotifiedSignal;
}
+ /**
+ * Connects a callback function with the object's signals.
+ * @param[in] object The object providing the signal.
+ * @param[in] tracker Used to disconnect the signal.
+ * @param[in] signalName The signal to connect to.
+ * @param[in] functor A newly allocated FunctorDelegate.
+ * @return True if the signal was connected.
+ * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
+ */
+ static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+
// Properties
/**
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/enums.h>
mAxisMask(vertical ? Vector3::YAXIS : Vector3::XAXIS),
mDragMode(false)
{
- Image sliderImage = Image::New( BAR_TAB_IMAGE_PATH );
+ Image sliderImage = ResourceImage::New( BAR_TAB_IMAGE_PATH );
mSlider = ImageActor::New( sliderImage );
mSlider.SetParentOrigin( ParentOrigin::TOP_LEFT );
*
*/
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.h>
#include <dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.h>
// CLASS HEADER
#include <dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h>
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/actors/mesh-actor.h>
#include <dali/public-api/geometry/animatable-mesh.h>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/shader-effects/shader-effect.h>
#include <dali/public-api/math/vector3.h>
-// EXTERNAL INCLUDES
#include <math.h>
namespace Dali
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/object/property.h>
// EXTERNAL INCLUDES
#include <dali/public-api/object/property-index.h>
+#include <dali/public-api/object/type-registry.h>
#include <dali/integration-api/debug.h>
namespace Dali
namespace Internal
{
+namespace
+{
+
+// Signals
+
+const char* const DOMAIN_CHANGED_SIGNAL_NAME = "domain-changed";
+const char* const SCROLL_POSITION_CHANGED_SIGNAL_NAME = "scroll-position-changed";
+
+TypeRegistration typeRegistration( typeid( Toolkit::ScrollConnector ), typeid( Dali::BaseHandle ), NULL );
+
+SignalConnectorType signalConnector1( typeRegistration, DOMAIN_CHANGED_SIGNAL_NAME , &ScrollConnector::DoConnectSignal );
+SignalConnectorType signalConnector2( typeRegistration, SCROLL_POSITION_CHANGED_SIGNAL_NAME , &ScrollConnector::DoConnectSignal );
+
+}
+
const Property::Index ScrollConnector::SCROLL_POSITION = Dali::PROPERTY_CUSTOM_START_INDEX;
const Property::Index ScrollConnector::OVERSHOOT = Dali::PROPERTY_CUSTOM_START_INDEX + 1;
mScrollPositionChangedSignal.Emit( position );
}
+bool ScrollConnector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+ Dali::BaseHandle handle( object );
+
+ bool connected( true );
+ Toolkit::ScrollConnector scrollConnector = Toolkit::ScrollConnector::DownCast( handle );
+
+ if( 0 == strcmp( signalName.c_str(), DOMAIN_CHANGED_SIGNAL_NAME ) )
+ {
+ scrollConnector.DomainChangedSignal().Connect( tracker, functor );
+ }
+ else if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_CHANGED_SIGNAL_NAME ) )
+ {
+ scrollConnector.ScrollPositionChangedSignal().Connect( tracker, functor );
+ }
+ else
+ {
+ // signalName does not match any signal
+ connected = false;
+ }
+
+ return connected;
+}
+
ScrollConnector::ScrollConnector()
: mMinLimit( 0.0f ),
mMaxLimit( 0.0f ),
return mScrollPositionObject;
}
+ /**
+ * Connects a callback function with the object's signals.
+ * @param[in] object The object providing the signal.
+ * @param[in] tracker Used to disconnect the signal.
+ * @param[in] signalName The signal to connect to.
+ * @param[in] functor A newly allocated FunctorDelegate.
+ * @return True if the signal was connected.
+ * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
+ */
+ static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+
private:
/**
*
*/
+// CLASS HEADER
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h>
using namespace Dali;
// EXTERNAL INCLUDES
#include <boost/bind.hpp>
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/alpha-functions.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/object/ref-object.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h>
// EXTERNAL INCLUDES
#include <boost/bind.hpp>
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/alpha-functions.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/object/ref-object.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h>
*
*/
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/alpha-functions.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/object/ref-object.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h>
*
*/
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
namespace
{
+// Signals
+
+const char* const SIGNAL_SNAP_STARTED = "snap-started";
+
const int DEFAULT_REFRESH_INTERVAL_MILLISECONDS = 50; ///< Refresh rate TODO: Animation should have an update signal (and see item-view-impl)
const Vector2 DEFAULT_MIN_FLICK_DISTANCE(30.0f, 30.0f); ///< minimum distance for pan before flick allowed
const float DEFAULT_MIN_FLICK_SPEED_THRESHOLD(500.0f); ///< Minimum pan speed required for flick in pixels/s
return Toolkit::ScrollView::New();
}
-TypeRegistration typeRegistration( typeid(Toolkit::ScrollView), typeid(Toolkit::Scrollable), Create );
+TypeRegistration typeRegistration( typeid( Toolkit::ScrollView ), typeid( Toolkit::Scrollable ), Create );
-SignalConnectorType signalConnector1( typeRegistration, Toolkit::ScrollView::SIGNAL_SNAP_STARTED, &ScrollView::DoConnectSignal );
+SignalConnectorType signalConnector1( typeRegistration, SIGNAL_SNAP_STARTED, &ScrollView::DoConnectSignal );
}
void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunction alpha,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
+ // If this is called while the timer is running, then cancel it
+ StopTouchDownTimer();
+
Actor self( Self() );
// Guard against destruction during signal emission
bool connected( true );
Toolkit::ScrollView view = Toolkit::ScrollView::DownCast( handle );
- if( Toolkit::ScrollView::SIGNAL_SNAP_STARTED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_SNAP_STARTED ) )
{
view.SnapStartedSignal().Connect( tracker, functor );
}
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/alpha-functions.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/object/ref-object.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/alpha-functions.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/object/ref-object.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/alpha-functions.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/object/ref-object.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
*
*/
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/alpha-functions.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/actors/custom-actor.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
const Vector4 DEFAULT_OVERSHOOT_COLOUR(0.0f, 0.64f, 0.85f, 0.25f);
const float DEFAULT_OVERSHOOT_ANIMATION_SPEED(120.0f); // 120 pixels per second
+// Signals
+
+const char* const SIGNAL_SCROLL_STARTED = "scroll-started";
+const char* const SIGNAL_SCROLL_COMPLETED = "scroll-completed";
+const char* const SIGNAL_SCROLL_UPDATED = "scroll-updated";
+const char* const SIGNAL_SCROLL_CLAMPED = "scroll-clamped";
+
BaseHandle Create()
{
// empty handle as we cannot create Scrollable (but type registered for scroll signal)
return BaseHandle();
}
-TypeRegistration mType( typeid(Toolkit::Scrollable), typeid(Toolkit::Control), Create );
+TypeRegistration mType( typeid( Toolkit::Scrollable ), typeid( Toolkit::Control ), Create );
-SignalConnectorType s1(mType, Toolkit::Scrollable::SIGNAL_SCROLL_STARTED, &Scrollable::DoConnectSignal);
-SignalConnectorType s2(mType, Toolkit::Scrollable::SIGNAL_SCROLL_COMPLETED, &Scrollable::DoConnectSignal);
-SignalConnectorType s3(mType, Toolkit::Scrollable::SIGNAL_SCROLL_UPDATED, &Scrollable::DoConnectSignal);
-SignalConnectorType s4(mType, Toolkit::Scrollable::SIGNAL_SCROLL_CLAMPED, &Scrollable::DoConnectSignal);
+SignalConnectorType s1( mType, SIGNAL_SCROLL_STARTED, &Scrollable::DoConnectSignal );
+SignalConnectorType s2( mType, SIGNAL_SCROLL_COMPLETED, &Scrollable::DoConnectSignal );
+SignalConnectorType s3( mType, SIGNAL_SCROLL_UPDATED, &Scrollable::DoConnectSignal );
+SignalConnectorType s4( mType, SIGNAL_SCROLL_CLAMPED, &Scrollable::DoConnectSignal );
PropertyRegistration property1( mType,
"overshoot-effect-color",
bool connected( true );
Toolkit::Scrollable scrollable = Toolkit::Scrollable::DownCast( handle );
- if( Toolkit::Scrollable::SIGNAL_SCROLL_STARTED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_SCROLL_STARTED ) )
{
scrollable.ScrollStartedSignal().Connect( tracker, functor );
}
- else if( Toolkit::Scrollable::SIGNAL_SCROLL_UPDATED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_SCROLL_UPDATED ) )
{
scrollable.ScrollUpdatedSignal().Connect( tracker, functor );
}
- else if( Toolkit::Scrollable::SIGNAL_SCROLL_COMPLETED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_SCROLL_COMPLETED ) )
{
scrollable.ScrollCompletedSignal().Connect( tracker, functor );
}
- else if( Toolkit::Scrollable::SIGNAL_SCROLL_CLAMPED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_SCROLL_CLAMPED ) )
{
scrollable.ScrollClampedSignal().Connect( tracker, functor );
}
ConstrainCamera();
- mShadowPlane.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, Source( mShadowPlaneBg, Actor::SIZE ), EqualToConstraint() ) );
+ mShadowPlane.SetSizeMode( SIZE_EQUAL_TO_PARENT );
- mBlurRootActor.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, Source( mShadowPlane, Actor::SIZE ), EqualToConstraint() ) );
+ mBlurRootActor.SetSizeMode( SIZE_EQUAL_TO_PARENT );
}
void ShadowView::SetPointLight(Actor pointLight)
{
// root actor to parent all user added actors. Used as source actor for shadow render task.
mChildrenRoot.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
- mChildrenRoot.ApplyConstraint(Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ));
+ mChildrenRoot.SetSizeMode( SIZE_EQUAL_TO_PARENT );
Vector2 stageSize = Stage::GetCurrent().GetSize();
mCameraActor = CameraActor::New(stageSize);
#include <dali-toolkit/internal/controls/slider/slider-impl.h>
// EXTERNAL INCLUDES
+#include <sstream>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/images/resource-image.h>
-// EXTERNAL INCLUDES
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <sstream>
-
using namespace Dali;
namespace Dali
const bool DEFAULT_ENABLED = true;
const bool DEFAULT_SNAP_TO_MARKS = false;
+// Signals
+
+const char* const SIGNAL_VALUE_CHANGED = "value-changed";
+const char* const SIGNAL_MARK = "mark";
+
BaseHandle Create()
{
return Dali::Toolkit::Slider::New();
}
-TypeRegistration typeRegistration( typeid(Dali::Toolkit::Slider), typeid(Dali::Toolkit::Control), Create );
+TypeRegistration typeRegistration( typeid( Dali::Toolkit::Slider ), typeid( Dali::Toolkit::Control ), Create );
-SignalConnectorType signalConnector1( typeRegistration, Toolkit::Slider::SIGNAL_VALUE_CHANGED, &Toolkit::Internal::Slider::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, Toolkit::Slider::SIGNAL_MARK, &Toolkit::Internal::Slider::DoConnectSignal );
+SignalConnectorType signalConnector1( typeRegistration, SIGNAL_VALUE_CHANGED, &Toolkit::Internal::Slider::DoConnectSignal );
+SignalConnectorType signalConnector2( typeRegistration, SIGNAL_MARK, &Toolkit::Internal::Slider::DoConnectSignal );
PropertyRegistration property1( typeRegistration, "lower-bound", Toolkit::Slider::LOWER_BOUND_PROPERTY, Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
PropertyRegistration property2( typeRegistration, "upper-bound", Toolkit::Slider::UPPER_BOUND_PROPERTY, Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
{
if( mBacking && imageName != String::EMPTY )
{
- Image image = Image::New( imageName );
+ Image image = ResourceImage::New( imageName );
mBacking.SetImage( image );
}
}
{
if( mBacking )
{
- return mBacking.GetImage().GetFilename();
+ return ResourceImage::DownCast( mBacking.GetImage() ).GetUrl();
}
return std::string( "" );
{
if( mProgress && imageName != String::EMPTY )
{
- Image image = Image::New( imageName );
+ Image image = ResourceImage::New( imageName );
mProgress.SetImage( image );
}
}
{
if( mProgress )
{
- return mProgress.GetImage().GetFilename();
+ return ResourceImage::DownCast( mProgress.GetImage()).GetUrl();
}
return std::string( "" );
{
if( mPopup && imageName != String::EMPTY )
{
- Image image = Image::New( imageName );
+ Image image = ResourceImage::New( imageName );
mPopup.SetImage( image );
}
}
{
if( mPopupArrow && imageName != String::EMPTY )
{
- Image image = Image::New( imageName );
+ Image image = ResourceImage::New( imageName );
mPopupArrow.SetImage( image );
}
}
{
if( mHandle && imageName != String::EMPTY )
{
- Image image = Image::New( imageName );
+ Image image = ResourceImage::New( imageName );
mHandle.SetImage( image );
}
}
{
if( mHandle )
{
- return mHandle.GetImage().GetFilename();
+ return ResourceImage::DownCast( mHandle.GetImage() ).GetUrl();
}
return std::string( "" );
return mMarkTolerance;
}
-// static class method to support script connecting signals
-
+// Static class method to support script connecting signals
bool Slider::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
Dali::BaseHandle handle( object );
bool connected = true;
Toolkit::Slider slider = Toolkit::Slider::DownCast( handle );
- if( signalName == Dali::Toolkit::Slider::SIGNAL_VALUE_CHANGED )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_VALUE_CHANGED ) )
{
slider.ValueChangedSignal().Connect( tracker, functor );
}
- else if( signalName == Dali::Toolkit::Slider::SIGNAL_MARK )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_MARK ) )
{
slider.MarkSignal().Connect( tracker, functor );
}
*
*/
+// CLASS HEADER
+#include "super-blur-view-impl.h"
+
// EXTERNAL INCLUDES
#include <cmath>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
-// CLASS HEADER
-#include "super-blur-view-impl.h"
-
namespace //unnamed namespace
{
{
float exponent = static_cast<float>(i+1);
mBlurredImage[i] = FrameBufferImage::New( mTargetSize.width/std::pow(2.f,exponent) , mTargetSize.height/std::pow(2.f,exponent),
- GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT, Dali::Image::Never );
+ GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT, Dali::Image::NEVER );
}
}
}
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
namespace Dali
{
if( item.HasKey( "policy" ) && item.HasKey( "value" ) )
{
- Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get<std::string>(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT );
+ Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get<std::string>().c_str(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT );
if( policy == Toolkit::TableView::Fixed )
{
(tableViewImpl.*funcFixed)( rowIndex, item.GetValue("value").Get<float>() );
#include <dali/public-api/events/pan-gesture.h>
#include <dali/public-api/object/property-notification.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/text-input/text-input-handles-impl.h>
}
else
{
- cursor = ImageActor::New( Image::New( DEFAULT_CURSOR ) );
+ cursor = ImageActor::New( ResourceImage::New( DEFAULT_CURSOR ) );
}
cursor.SetStyle(ImageActor::STYLE_NINE_PATCH);
void Decorator::CreateCursors( Actor targetParent )
{
- Image mCursorImage = Image::New( DEFAULT_CURSOR );
+ Image mCursorImage = ResourceImage::New( DEFAULT_CURSOR );
mCursor = CreateCursor (mCursorImage, DEFAULT_CURSOR_IMAGE_9_BORDER , "mainCursor");
mCursorRTL = CreateCursor ( mCursorImage, DEFAULT_CURSOR_IMAGE_9_BORDER, "rtlCursor");
targetParent.Add( mCursor );
#include <algorithm>
#include <dali/public-api/animation/constraints.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/text-input/textview-character-positions-impl.h>
Actor handleGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
handleGrabArea.SetName( name );
- handleGrabArea.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( relativeScale ) ) ); // grab area to be larger than text actor
+ handleGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ handleGrabArea.SetSizeModeFactor( relativeScale );
handleGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
return handleGrabArea;
{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextInputHandles: CreateSelectionHandles\n" );
- mSelectionHandleOneImage = Image::New( DEFAULT_SELECTION_HANDLE_ONE );
- mSelectionHandleOneImagePressed = Image::New( DEFAULT_SELECTION_HANDLE_ONE_PRESSED );
+ mSelectionHandleOneImage = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE );
+ mSelectionHandleOneImagePressed = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE_PRESSED );
mSelectionHandleOne = CreateHandle( AnchorPoint::TOP_RIGHT, mSelectionHandleOneImage, "SelectionHandleOne" );
mIsSelectionHandleOneFlipped = false;
// mTapDetector.Attach( mHandleOneGrabArea );
- mSelectionHandleTwoImage = Image::New( DEFAULT_SELECTION_HANDLE_TWO );
- mSelectionHandleTwoImagePressed = Image::New( DEFAULT_SELECTION_HANDLE_TWO_PRESSED );
+ mSelectionHandleTwoImage = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO );
+ mSelectionHandleTwoImagePressed = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO_PRESSED );
mSelectionHandleTwo = CreateHandle( AnchorPoint::TOP_LEFT, mSelectionHandleTwoImage, "SelectionHandleTwo" );
mIsSelectionHandleTwoFlipped = false;
{
if ( !mGrabHandleImage )
{
- mGrabHandleImage = Image::New( DEFAULT_GRAB_HANDLE );
+ mGrabHandleImage = ResourceImage::New( DEFAULT_GRAB_HANDLE );
}
mGrabHandle = CreateHandle( AnchorPoint::TOP_CENTER, mGrabHandleImage, "GrabHandle" );
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/property-notification.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/text-view/text-processor.h>
namespace
{
+// Signals
+
+const char* const SIGNAL_START_INPUT = "start-input";
+const char* const SIGNAL_END_INPUT = "end-input";
+const char* const SIGNAL_STYLE_CHANGED = "style-changed";
+const char* const SIGNAL_MAX_INPUT_CHARACTERS_REACHED = "max-input-characters-reached";
+const char* const SIGNAL_TOOLBAR_DISPLAYED = "toolbar-displayed";
+const char* const SIGNAL_TEXT_EXCEED_BOUNDARIES = "text-exceed-boundaries";
+
BaseHandle Create()
{
return Toolkit::TextInput::New();
}
-TypeRegistration typeRegistration( typeid(Toolkit::TextInput), typeid(Toolkit::Control), Create );
+TypeRegistration typeRegistration( typeid( Toolkit::TextInput ), typeid( Toolkit::Control ), Create );
-SignalConnectorType signalConnector1( typeRegistration, Toolkit::TextInput::SIGNAL_START_INPUT, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, Toolkit::TextInput::SIGNAL_END_INPUT, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector3( typeRegistration, Toolkit::TextInput::SIGNAL_STYLE_CHANGED, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector4( typeRegistration, Toolkit::TextInput::SIGNAL_MAX_INPUT_CHARACTERS_REACHED, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector5( typeRegistration, Toolkit::TextInput::SIGNAL_TOOLBAR_DISPLAYED, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector6( typeRegistration, Toolkit::TextInput::SIGNAL_TEXT_EXCEED_BOUNDARIES, &TextInput::DoConnectSignal );
+SignalConnectorType signalConnector1( typeRegistration, SIGNAL_START_INPUT, &TextInput::DoConnectSignal );
+SignalConnectorType signalConnector2( typeRegistration, SIGNAL_END_INPUT, &TextInput::DoConnectSignal );
+SignalConnectorType signalConnector3( typeRegistration, SIGNAL_STYLE_CHANGED, &TextInput::DoConnectSignal );
+SignalConnectorType signalConnector4( typeRegistration, SIGNAL_MAX_INPUT_CHARACTERS_REACHED, &TextInput::DoConnectSignal );
+SignalConnectorType signalConnector5( typeRegistration, SIGNAL_TOOLBAR_DISPLAYED, &TextInput::DoConnectSignal );
+SignalConnectorType signalConnector6( typeRegistration, SIGNAL_TEXT_EXCEED_BOUNDARIES, &TextInput::DoConnectSignal );
}
Dali::BaseHandle handle( object );
bool connected( true );
- Toolkit::TextInput textInput = Toolkit::TextInput::DownCast(handle);
+ Toolkit::TextInput textInput = Toolkit::TextInput::DownCast( handle );
- if( Toolkit::TextInput::SIGNAL_START_INPUT == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_START_INPUT ) )
{
textInput.InputStartedSignal().Connect( tracker, functor );
}
- else if( Toolkit::TextInput::SIGNAL_END_INPUT == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_END_INPUT ) )
{
textInput.InputFinishedSignal().Connect( tracker, functor );
}
- else if( Toolkit::TextInput::SIGNAL_STYLE_CHANGED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_STYLE_CHANGED ) )
{
textInput.StyleChangedSignal().Connect( tracker, functor );
}
- else if( Toolkit::TextInput::SIGNAL_MAX_INPUT_CHARACTERS_REACHED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_MAX_INPUT_CHARACTERS_REACHED ) )
{
textInput.MaxInputCharactersReachedSignal().Connect( tracker, functor );
}
- else if( Toolkit::TextInput::SIGNAL_TEXT_EXCEED_BOUNDARIES == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_TOOLBAR_DISPLAYED ) )
+ {
+ textInput.CutAndPasteToolBarDisplayedSignal().Connect( tracker, functor );
+ }
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_TEXT_EXCEED_BOUNDARIES ) )
{
textInput.InputTextExceedBoundariesSignal().Connect( tracker, functor );
}
{
if ( !image )
{
- mGrabHandleImage = Image::New(DEFAULT_GRAB_HANDLE);
+ mGrabHandleImage = ResourceImage::New(DEFAULT_GRAB_HANDLE);
}
else
{
mGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
mGrabArea.SetName( "GrabArea" );
mGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
- mGrabArea.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE ) ) ); // grab area to be larger than text actor
+ mGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mGrabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
mGrabArea.TouchedSignal().Connect(this,&TextInput::OnPressDown);
mTapDetector.Attach( mGrabArea );
mPanGestureDetector.Attach( mGrabArea );
if ( !mSelectionHandleOne )
{
// create normal and pressed images
- mSelectionHandleOneImage = Image::New( DEFAULT_SELECTION_HANDLE_ONE );
- mSelectionHandleOneImagePressed = Image::New( DEFAULT_SELECTION_HANDLE_ONE_PRESSED );
+ mSelectionHandleOneImage = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE );
+ mSelectionHandleOneImagePressed = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE_PRESSED );
mSelectionHandleOne = ImageActor::New( mSelectionHandleOneImage );
mSelectionHandleOne.SetName("SelectionHandleOne");
mHandleOneGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
mHandleOneGrabArea.SetName("SelectionHandleOneGrabArea");
- mHandleOneGrabArea.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE ) ) ); // grab area to be larger than text actor
+ mHandleOneGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mHandleOneGrabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
mHandleOneGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
mTapDetector.Attach( mHandleOneGrabArea );
if ( !mSelectionHandleTwo )
{
// create normal and pressed images
- mSelectionHandleTwoImage = Image::New( DEFAULT_SELECTION_HANDLE_TWO );
- mSelectionHandleTwoImagePressed = Image::New( DEFAULT_SELECTION_HANDLE_TWO_PRESSED );
+ mSelectionHandleTwoImage = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO );
+ mSelectionHandleTwoImagePressed = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO_PRESSED );
mSelectionHandleTwo = ImageActor::New( mSelectionHandleTwoImage );
mSelectionHandleTwo.SetName("SelectionHandleTwo");
mHandleTwoGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
mHandleTwoGrabArea.SetName("SelectionHandleTwoGrabArea");
- mHandleTwoGrabArea.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE ) ) ); // grab area to be larger than text actor
+ mHandleTwoGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mHandleTwoGrabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
mHandleTwoGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
mTapDetector.Attach( mHandleTwoGrabArea );
// EXTERNAL INCLUDES
#include <libintl.h>
#include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/images/resource-image.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
namespace Internal
{
-const char* const TextInputPopup::SIGNAL_PRESSED = "pressed";
-const char* const TextInputPopup::SIGNAL_HIDE_FINISHED = "hide-finished";
-const char* const TextInputPopup::SIGNAL_SHOW_FINISHED = "show-finished";
+namespace
+{
+
+// Signals
+
+const char* const SIGNAL_PRESSED = "pressed";
+const char* const SIGNAL_HIDE_FINISHED = "hide-finished";
+const char* const SIGNAL_SHOW_FINISHED = "show-finished";
+
+}
const char* const TextInputPopup::OPTION_SELECT_WORD = "option-select_word"; // "Select Word" popup option.
const char* const TextInputPopup::OPTION_SELECT_ALL("option-select_all"); // "Select All" popup option.
// Create background-panel if not already created (required if we have at least one option)
if ( !mBackground )
{
- Image bgImg = Image::New( POPUP_BACKGROUND );
+ Image bgImg = ResourceImage::New( POPUP_BACKGROUND );
mBackground = ImageActor::New( bgImg );
mBackground.SetAnchorPoint( AnchorPoint::CENTER );
mBackground.SetParentOrigin( ParentOrigin::CENTER );
mBackground.SetName( "text-input-popup-background" );
mBackground.SetColor( mBackgroundColor );
- Image bgEffectImg = Image::New( POPUP_BACKGROUND_EFFECT );
+ Image bgEffectImg = ResourceImage::New( POPUP_BACKGROUND_EFFECT );
mBackgroundEffect = ImageActor::New( bgEffectImg );
mBackgroundEffect.SetAnchorPoint( AnchorPoint::CENTER );
mBackgroundEffect.SetParentOrigin( ParentOrigin::CENTER );
mBackgroundEffect.SetName( "text-input-popup-background-effect" );
- mBackgroundEffect.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mBackgroundEffect.SetSizeMode( SIZE_EQUAL_TO_PARENT );
mBackgroundEffect.SetZ( 1.0f );
mBackground.Add( mBackgroundEffect );
- Image bgLine = Image::New( POPUP_BACKGROUND_LINE );
+ Image bgLine = ResourceImage::New( POPUP_BACKGROUND_LINE );
mBackgroundLine = ImageActor::New( bgLine );
mBackgroundLine.SetAnchorPoint( AnchorPoint::CENTER);
mBackgroundLine.SetParentOrigin( ParentOrigin::CENTER );
mBackgroundLine.SetName( "text-input-popup-background-effect" );
- mBackgroundLine.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mBackgroundLine.SetSizeMode( SIZE_EQUAL_TO_PARENT );
mBackgroundLine.SetColor( mLineColor );
mBackgroundLine.SetZ( 0.1f );
mBackgroundEffect.Add( mBackgroundLine );
{
if ( !mTail )
{
- Image tail = Image::New( POPUP_TAIL_BOTTOM );
+ Image tail = ResourceImage::New( POPUP_TAIL_BOTTOM );
mTail = ImageActor::New( tail );
mTail.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
mTail.SetAnchorPoint( AnchorPoint::TOP_CENTER );
mTail.SetPosition( 0.0f, POPUP_TAIL_Y_OFFSET - POPUP_BORDER.w, 1.2f );
mTail.SetColor( mBackgroundColor );
- Image tailEffect = Image::New( POPUP_TAIL_BOTTOM_EFFECT );
+ Image tailEffect = ResourceImage::New( POPUP_TAIL_BOTTOM_EFFECT );
mTailEffect = ImageActor::New( tailEffect );
mTailEffect.SetParentOrigin( ParentOrigin::CENTER );
mTailEffect.SetAnchorPoint( AnchorPoint::CENTER );
mTailEffect.SetName( "text-input-popup-tail-effect" );
- mTailEffect.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mTailEffect.SetSizeMode( SIZE_EQUAL_TO_PARENT );
mTailEffect.SetZ( 0.1f );
mTail.Add( mTailEffect );
- Image tailLine = Image::New( POPUP_TAIL_BOTTOM_LINE );
+ Image tailLine = ResourceImage::New( POPUP_TAIL_BOTTOM_LINE );
mTailLine = ImageActor::New( tailLine );
mTailLine.SetParentOrigin( ParentOrigin::CENTER );
mTailLine.SetAnchorPoint( AnchorPoint::CENTER );
- mTailLine.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mTailLine.SetSizeMode( SIZE_EQUAL_TO_PARENT );
mTailLine.SetName( "text-input-popup-tail-line" );
mTailLine.SetColor( mLineColor );
mTailLine.SetZ( 0.1f );
{
case ButtonsCut:
{
- Image cutIcon = Image::New( OPTION_ICON_CUT );
+ Image cutIcon = ResourceImage::New( OPTION_ICON_CUT );
currentButton = CreateRequiredButton( ButtonsCut, mCutOptionPriority, OPTION_CUT, GET_LOCALE_TEXT("IDS_COM_BODY_CUT"), cutIcon, false );
break;
}
case ButtonsCopy:
{
- Image copyIcon = Image::New( OPTION_ICON_COPY );
+ Image copyIcon = ResourceImage::New( OPTION_ICON_COPY );
currentButton = CreateRequiredButton( ButtonsCopy, mCopyOptionPriority, OPTION_COPY, GET_LOCALE_TEXT("IDS_COM_BODY_COPY"), copyIcon, false );
break;
}
case ButtonsPaste:
{
- Image pasteIcon = Image::New( OPTION_ICON_PASTE );
+ Image pasteIcon = ResourceImage::New( OPTION_ICON_PASTE );
currentButton = CreateRequiredButton( ButtonsPaste, mPasteOptionPriority, OPTION_PASTE, GET_LOCALE_TEXT("IDS_COM_BODY_PASTE"), pasteIcon, false );
break;
}
case ButtonsSelect:
{
- Image selectIcon = Image::New( OPTION_ICON_SELECT );
+ Image selectIcon = ResourceImage::New( OPTION_ICON_SELECT );
currentButton = CreateRequiredButton( ButtonsSelect, mSelectOptionPriority, OPTION_SELECT_WORD, GET_LOCALE_TEXT("IDS_COM_SK_SELECT"), selectIcon, false );
break;
}
case ButtonsSelectAll:
{
- Image selectAllIcon = Image::New( OPTION_ICON_SELECT_ALL );
+ Image selectAllIcon = ResourceImage::New( OPTION_ICON_SELECT_ALL );
currentButton = CreateRequiredButton( ButtonsSelectAll, mSelectAllOptionPriority, OPTION_SELECT_ALL, GET_LOCALE_TEXT("IDS_COM_BODY_SELECT_ALL"), selectAllIcon, false );
break;
}
case ButtonsClipboard:
{
- Image clipboardIcon = Image::New( OPTION_ICON_CLIPBOARD );
+ Image clipboardIcon = ResourceImage::New( OPTION_ICON_CLIPBOARD );
currentButton = CreateRequiredButton( ButtonsClipboard, mClipboardOptionPriority, OPTION_CLIPBOARD, GET_LOCALE_TEXT("IDS_COM_BODY_CLIPBOARD"), clipboardIcon, false );
break;
}
if ( yAxisFlip )
{
- Image tail = Image::New( POPUP_TAIL_TOP );
- Image tailEffect = Image::New( POPUP_TAIL_TOP_EFFECT );
- Image tailLine = Image::New( POPUP_TAIL_TOP_LINE );
+ Image tail = ResourceImage::New( POPUP_TAIL_TOP );
+ Image tailEffect = ResourceImage::New( POPUP_TAIL_TOP_EFFECT );
+ Image tailLine = ResourceImage::New( POPUP_TAIL_TOP_LINE );
mTail.SetImage( tail );
mTailEffect.SetImage( tailEffect );
return mPressedSignal;
}
-TextInputPopup::HideFinishedSignalType& TextInputPopup::HideFinishedSignal()
+TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::HideFinishedSignal()
{
return mHideFinishedSignal;
}
-TextInputPopup::ShowFinishedSignalType& TextInputPopup::ShowFinishedSignal()
+TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::ShowFinishedSignal()
{
return mShowFinishedSignal;
}
static const char* const OPTION_PASTE;
static const char* const OPTION_CLIPBOARD;
- // Signal names
- static const char* const SIGNAL_PRESSED;
- static const char* const SIGNAL_HIDE_FINISHED;
- static const char* const SIGNAL_SHOW_FINISHED;
-
// Popup Button Pressed
typedef Signal< bool( Toolkit::Button ) > PressedSignalType;
- // Popup Hide Finished
- typedef Signal< void( TextInputPopup& ) > HideFinishedSignalType;
-
- // Popup Show Finished
- typedef Signal< void( TextInputPopup& ) > ShowFinishedSignalType;
+ // Popup Hide / Show Finished
+ typedef Signal< void( TextInputPopup& ) > VisibilityChangeFinishedSignalType;
/**
* Signal emitted when the button is touched.
* Signal emitted when popup is completely hidden
* @note Only occurs after a Show() call with animation enabled.
*/
- HideFinishedSignalType& HideFinishedSignal();
+ VisibilityChangeFinishedSignalType& HideFinishedSignal();
/**
* Signal emitted when popup is completely shown
* @note Only occurs after a Hide() call with animation enabled.
*/
- ShowFinishedSignalType& ShowFinishedSignal();
+ VisibilityChangeFinishedSignalType& ShowFinishedSignal();
public:
std::size_t mClipboardOptionPriority; // Position of Clipboard button
PressedSignalType mPressedSignal; ///< Signal emitted when a button within the popup is pressed.
- HideFinishedSignalType mHideFinishedSignal; ///< Signal emitted when popup is completely hidden
- ShowFinishedSignalType mShowFinishedSignal; ///< Signal emitted when popup is completely shown
+ VisibilityChangeFinishedSignalType mHideFinishedSignal; ///< Signal emitted when popup is completely hidden
+ VisibilityChangeFinishedSignalType mShowFinishedSignal; ///< Signal emitted when popup is completely shown
};
StateShown
};
- // Signal names
- static const char* const SIGNAL_PRESSED;
- static const char* const SIGNAL_HIDE_FINISHED;
- static const char* const SIGNAL_SHOW_FINISHED;
-
// Popup Button Pressed
typedef Signal< bool( Toolkit::Button ) > PopUpPressedSignal;
// Popup Hide Finished
- typedef Signal< void( TextInputPopupNew& ) > PopUpHideFinishedSignal;
-
- // Popup Show Finished
- typedef Signal< void( TextInputPopupNew& ) > PopUpShowFinishedSignal;
+ typedef Signal< void( TextInputPopupNew& ) > PopUpVisibilityChangeFinishedSignal;
/**
* Signal emitted when the button is touched.
* Signal emitted when popup is completely hidden
* @note Only occurs after a Show() call with animation enabled.
*/
- PopUpHideFinishedSignal& HideFinishedSignal() {return mHideFinishedSignal;}
+ PopUpVisibilityChangeFinishedSignal& HideFinishedSignal() { return mHideFinishedSignal; }
/**
* Signal emitted when popup is completely shown
* @note Only occurs after a Hide() call with animation enabled.
*/
- PopUpShowFinishedSignal& ShowFinishedSignal() {return mShowFinishedSignal;}
+ PopUpVisibilityChangeFinishedSignal& ShowFinishedSignal() { return mShowFinishedSignal; }
public:
ActorContainer mDividerContainer; // List of dividers added to popup.
Animation mAnimation; // Popup Hide/Show animation.
- PopUpPressedSignal mPressedSignal; // Signal emitted when a button within the popup is pressed.
- PopUpHideFinishedSignal mHideFinishedSignal; // Signal emitted when popup is completely hidden
- PopUpShowFinishedSignal mShowFinishedSignal; // Signal emitted when popup is completely shown
+ PopUpPressedSignal mPressedSignal; // Signal emitted when a button within the popup is pressed.
+ PopUpVisibilityChangeFinishedSignal mHideFinishedSignal; // Signal emitted when popup is completely hidden
+ PopUpVisibilityChangeFinishedSignal mShowFinishedSignal; // Signal emitted when popup is completely shown
};
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/text-input/text-input-text-style-impl.h>
-
-// EXTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-view/text-view.h>
namespace Dali
// FILE HEADER
#include <dali-toolkit/internal/controls/text-view/split-by-char-policies.h>
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/text-view/relayout-utilities.h>
#include <dali-toolkit/internal/controls/text-view/text-view-processor.h>
namespace
{
+// Signals
+
+const char* const SIGNAL_TEXT_SCROLLED = "scrolled";
+
const char* MULTILINE_POLICY_NAME[] = {"SplitByNewLineChar", "SplitByWord", "SplitByChar"};
const char* EXCEED_POLICY_NAME[] = {"Original", "Truncate", "Fade", "Split","ShrinkToFit","EllipsizeEnd"};
const char* LINE_JUSTIFICATION_NAME[] = {"Left","Center","Right","Justified"};
return Toolkit::TextView::New();
}
-TypeRegistration typeRegistration( typeid(Toolkit::TextView), typeid(Toolkit::Control), Create );
+TypeRegistration typeRegistration( typeid( Toolkit::TextView ), typeid( Toolkit::Control ), Create );
-SignalConnectorType signalConnector1( typeRegistration, Toolkit::TextView::SIGNAL_TEXT_SCROLLED , &TextView::DoConnectSignal );
+SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TEXT_SCROLLED , &TextView::DoConnectSignal );
PropertyRegistration property1( typeRegistration, "markup-enabled", Toolkit::TextView::PROPERTY_MARKUP_ENABLED, Property::BOOLEAN, &TextView::SetProperty, &TextView::GetProperty );
PropertyRegistration property2( typeRegistration, "text", Toolkit::TextView::PROPERTY_TEXT, Property::STRING, &TextView::SetProperty, &TextView::GetProperty );
Dali::BaseHandle handle( object );
bool connected( true );
- Toolkit::TextView textView = Toolkit::TextView::DownCast(handle);
+ Toolkit::TextView textView = Toolkit::TextView::DownCast( handle );
- if( Dali::Toolkit::TextView::SIGNAL_TEXT_SCROLLED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_TEXT_SCROLLED ) )
{
textView.ScrolledSignal().Connect( tracker, functor );
}
// FILE HEADER
#include <dali-toolkit/internal/controls/text-view/text-view-processor-dbg.h>
+// EXTERNAL INCLUDES
+#include <iostream>
+
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/text-view/text-view-processor-types.h>
namespace // to register type
{
+// Signals
+
+const char* const SIGNAL_ORIENTATION_ANIMATION_START = "orientation-animation-start";
+
BaseHandle Create()
{
return Toolkit::View::New();
}
-TypeRegistration typeRegistration( typeid(Toolkit::View), typeid(Toolkit::Control), Create );
+TypeRegistration typeRegistration( typeid( Toolkit::View ), typeid( Toolkit::Control ), Create );
-SignalConnectorType signalConnector1( typeRegistration, Toolkit::View::SIGNAL_ORIENTATION_ANIMATION_START , &View::DoConnectSignal );
+SignalConnectorType signalConnector1( typeRegistration, SIGNAL_ORIENTATION_ANIMATION_START , &View::DoConnectSignal );
}
bool connected( true );
Toolkit::View view = Toolkit::View::DownCast(handle);
- if( Toolkit::View::SIGNAL_ORIENTATION_ANIMATION_START == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_ORIENTATION_ANIMATION_START ) )
{
view.OrientationAnimationStartedSignal().Connect( tracker, functor );
}
mActorForInput.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) );
// create internal offscreen for result of horizontal pass
- mImageForHorz = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::Unused );
+ mImageForHorz = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::UNUSED );
// create an actor to render mImageForHorz for vertical blur pass
mActorForHorz = ImageActor::New( mImageForHorz );
mActorForHorz.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) );
// create internal offscreen for result of the two pass blurred image
- mBlurredImage = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::Unused );
+ mBlurredImage = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::UNUSED);
// create an actor to blend the blurred image and the input image with the given blur strength
mActorForBlending = ImageActor::New( mBlurredImage );
mCameraActor = CameraActor::New();
mCameraActor.SetParentOrigin(ParentOrigin::CENTER);
- mImageForEmboss1 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::Unused );
- mImageForEmboss2 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::Unused );
+ mImageForEmboss1 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::UNUSED );
+ mImageForEmboss2 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::UNUSED );
// create actor to render input with applied emboss effect
mActorForInput1 = ImageActor::New( mInputImage );
mActorForInput.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) );
// create internal offscreen for result of horizontal pass
- mImageForHorz = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::Unused );
+ mImageForHorz = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::UNUSED );
// create an actor to render mImageForHorz for vertical blur pass
mActorForHorz = ImageActor::New( mImageForHorz );
#include <dali/public-api/adaptor-framework/tts-player.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/events/hit-test-algorithm.h>
+#include <dali/public-api/images/resource-image.h>
+#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali/integration-api/debug.h>
namespace Dali
{
namespace // unnamed namespace
{
+// Signals
+
+const char* const SIGNAL_FOCUS_CHANGED = "focus-changed";
+const char* const SIGNAL_FOCUS_OVERSHOT = "focus-overshot";
+const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED = "focused-actor-activated";
+
#if defined(DEBUG_ENABLED)
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FOCUS_MANAGER");
#endif
-const char * const ACTOR_FOCUSABLE("focusable");
-const char * const IS_FOCUS_GROUP("is-focus-group");
+const char* const ACTOR_FOCUSABLE("focusable");
+const char* const IS_FOCUS_GROUP("is-focus-group");
const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.png";
const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
void FocusManager::CreateDefaultFocusIndicatorActor()
{
// Create a focus indicator actor shared by all the focusable actors
- Image borderImage = Image::New(FOCUS_BORDER_IMAGE_PATH);
+ Image borderImage = ResourceImage::New(FOCUS_BORDER_IMAGE_PATH);
ImageActor focusIndicator = ImageActor::New(borderImage);
focusIndicator.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
// Apply size constraint to the focus indicator
- Constraint constraint = Constraint::New<Vector3>(Actor::SIZE,
- ParentSource(Actor::SIZE),
- EqualToConstraint());
- focusIndicator.ApplyConstraint(constraint);
+ focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT );
SetFocusIndicatorActor(focusIndicator);
}
Dali::BaseHandle handle( object );
bool connected( true );
- FocusManager* manager = dynamic_cast<FocusManager*>(object);
+ FocusManager* manager = dynamic_cast<FocusManager*>( object );
- if( Dali::Toolkit::FocusManager::SIGNAL_FOCUS_CHANGED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
{
manager->FocusChangedSignal().Connect( tracker, functor );
}
- else if( Dali::Toolkit::FocusManager::SIGNAL_FOCUS_OVERSHOT == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) )
{
manager->FocusOvershotSignal().Connect( tracker, functor );
}
- else if( Dali::Toolkit::FocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED== signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
{
manager->FocusedActorActivatedSignal().Connect( tracker, functor );
}
#include <dali/public-api/common/stage.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/images/resource-image.h>
+#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
#include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
-#include <dali/integration-api/debug.h>
namespace Dali
{
namespace // unnamed namespace
{
+// Signals
+
+const char* const SIGNAL_PRE_FOCUS_CHANGE = "keyboard-pre-focus-change";
+const char* const SIGNAL_FOCUS_CHANGED = "keyboard-focus-changed";
+const char* const SIGNAL_FOCUS_GROUP_CHANGED = "keyboard-focus-group-changed";
+const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED = "keyboard-focused-actor-activated";
+
#if defined(DEBUG_ENABLED)
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_KEYBOARD_FOCUS_MANAGER");
#endif
return handle;
}
+
TypeRegistration KEYBOARD_FOCUS_MANAGER_TYPE( typeid(Dali::Toolkit::KeyboardFocusManager), typeid(Dali::BaseHandle), Create, true /* Create instance at startup */ );
+SignalConnectorType signalConnector1( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_PRE_FOCUS_CHANGE , &KeyboardFocusManager::DoConnectSignal );
+SignalConnectorType signalConnector2( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUS_CHANGED , &KeyboardFocusManager::DoConnectSignal );
+SignalConnectorType signalConnector3( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUS_GROUP_CHANGED , &KeyboardFocusManager::DoConnectSignal );
+SignalConnectorType signalConnector4( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUSED_ACTOR_ACTIVATED , &KeyboardFocusManager::DoConnectSignal );
+
} // unnamed namespace
Toolkit::KeyboardFocusManager KeyboardFocusManager::Get()
void KeyboardFocusManager::CreateDefaultFocusIndicatorActor()
{
// Create a focus indicator actor shared by all the keyboard focusable actors
- Image borderImage = Image::New(FOCUS_BORDER_IMAGE_PATH);
+ Image borderImage = ResourceImage::New(FOCUS_BORDER_IMAGE_PATH);
ImageActor focusIndicator = ImageActor::New(borderImage);
focusIndicator.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
// Apply size constraint to the focus indicator
- Constraint constraint = Constraint::New<Vector3>(Actor::SIZE,
- ParentSource(Actor::SIZE),
- EqualToConstraint());
- focusIndicator.ApplyConstraint(constraint);
+ focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT );
SetFocusIndicatorActor(focusIndicator);
}
Dali::BaseHandle handle( object );
bool connected( true );
- KeyboardFocusManager* manager = dynamic_cast<KeyboardFocusManager*>(object);
+ KeyboardFocusManager* manager = dynamic_cast<KeyboardFocusManager*>( object );
- if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_PRE_FOCUS_CHANGE == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_PRE_FOCUS_CHANGE ) )
{
manager->PreFocusChangeSignal().Connect( tracker, functor );
}
- if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUS_CHANGED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
{
manager->FocusChangedSignal().Connect( tracker, functor );
}
- if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUS_GROUP_CHANGED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_GROUP_CHANGED ) )
{
manager->FocusGroupChangedSignal().Connect( tracker, functor );
}
- else if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED== signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
{
manager->FocusedActorActivatedSignal().Connect( tracker, functor );
}
namespace Internal
{
+namespace
+{
+
+// Signals
+
+const char* const SIGNAL_KEY_INPUT_FOCUS_CHANGED = "key-input-focus-changed";
+const char* const SIGNAL_UNHANDLED_KEY_EVENT = "unhandled-key-event";
+
+}
+
KeyInputFocusManager::KeyInputFocusManager()
: mSlotDelegate( this )
{
Dali::BaseHandle handle( object );
bool connected( true );
- KeyInputFocusManager* manager = dynamic_cast<KeyInputFocusManager*>(object);
+ KeyInputFocusManager* manager = dynamic_cast<KeyInputFocusManager*>( object );
- if( Dali::Toolkit::KeyInputFocusManager::SIGNAL_KEY_INPUT_FOCUS_CHANGED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_CHANGED ) )
{
manager->KeyInputFocusChangedSignal().Connect( tracker, functor );
}
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_UNHANDLED_KEY_EVENT ) )
+ {
+ manager->UnhandledKeyEventSignal().Connect( tracker, functor );
+ }
else
{
// signalName does not match any signal
// EXTERNAL INCLUDES
#include <dali/public-api/common/stage.h>
#include <dali/public-api/images/image-attributes.h>
+#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/render-tasks/render-task-list.h>
namespace Dali
namespace Internal
{
+namespace
+{
+
+// Signals
+
+const char* const SIGNAL_TRANSITION_COMPLETED = "transition-completed";
+
+TypeRegistration typeRegistration( typeid( Toolkit::CubeTransitionEffect ), typeid( Dali::BaseHandle ), NULL );
+
+SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TRANSITION_COMPLETED , &CubeTransitionEffect::DoConnectSignal );
+
+}
+
const Vector4 CubeTransitionEffect::FULL_BRIGHTNESS( 1.0f, 1.0f, 1.0f, 1.0f );
const Vector4 CubeTransitionEffect::HALF_BRIGHTNESS( 0.5f, 0.5f, 0.5f, 1.0f );
void CubeTransitionEffect::SetImage( ImageActor imageActor )
{
mCurrentImage = imageActor;
- mIsImageLoading = true;
Image image = imageActor.GetImage();
+ ResourceImage resourceImage = ResourceImage::DownCast( image );
mBufferIndex = mBufferIndex^1;
//must make sure the image is already loaded before using its attributes
- if( image.GetLoadingState() == ResourceLoadingSucceeded )
+ if( resourceImage && resourceImage.GetLoadingState() != ResourceLoadingSucceeded )
{
- OnImageLoaded( image );
+ mIsImageLoading = true;
+ resourceImage.LoadingFinishedSignal().Connect( this, &CubeTransitionEffect::OnImageLoaded );
}
else
{
- image.LoadingFinishedSignal().Connect( this, &CubeTransitionEffect::OnImageLoaded );
+ mIsImageLoading = false;
+ PrepareTiles( image );
}
}
}
}
-void CubeTransitionEffect::OnImageLoaded(Image image)
+void CubeTransitionEffect::OnImageLoaded(ResourceImage image)
+{
+ mIsImageLoading = false;
+ PrepareTiles( image );
+}
+
+/**
+ * Set sub-image to each tile.
+ * @param[in] image The image content of the imageActor for transition
+ */
+void CubeTransitionEffect::PrepareTiles( Image image )
{
// Fit the image to view area, while keeping the aspect; FitKeepAspectRatio(imageSize, viewAreaSize)
- ImageAttributes attributes( image.GetAttributes() );
- float scale = std::min( mViewAreaSize.width / attributes.GetWidth(), mViewAreaSize.height / attributes.GetHeight() );
- Vector2 imageSize(attributes.GetWidth()*scale, attributes.GetHeight()*scale);
+ float scale = std::min( mViewAreaSize.width / image.GetWidth(), mViewAreaSize.height / image.GetHeight() );
+ Vector2 imageSize(image.GetWidth()*scale, image.GetHeight()*scale);
mFullImageCreator.SetEffectImage(image);
mFullImageCreator.SetRegionSize(mViewAreaSize, imageSize);
mTiles[mContainerIndex][idx].SetPixelArea( pixelArea );
}
}
- mIsImageLoading = false;
}
+
void CubeTransitionEffect::OnTransitionFinished(Animation& source)
{
mRoot.SetVisible(false);
return mTransitionCompletedSignal;
}
+bool CubeTransitionEffect::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+ Dali::BaseHandle handle( object );
+
+ bool connected( true );
+ Toolkit::CubeTransitionEffect cubeTransitionEffect = Toolkit::CubeTransitionEffect::DownCast( handle );
+
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_TRANSITION_COMPLETED ) )
+ {
+ cubeTransitionEffect.TransitionCompletedSignal().Connect( tracker, functor );
+ }
+ else
+ {
+ // signalName does not match any signal
+ connected = false;
+ }
+
+ return connected;
+}
+
} // namespace Internal
} // namespace Toolkit
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/shader-effects/shader-effect.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/transition-effects/cube-transition-effect.h>
*/
Toolkit::CubeTransitionEffect::TransitionCompletedSignalType& TransitionCompletedSignal();
+ /**
+ * Connects a callback function with the object's signals.
+ * @param[in] object The object providing the signal.
+ * @param[in] tracker Used to disconnect the signal.
+ * @param[in] signalName The signal to connect to.
+ * @param[in] functor A newly allocated FunctorDelegate.
+ * @return True if the signal was connected.
+ * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
+ */
+ static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+
protected:
/**
* Set image and pixelArea to tiles
* @param[in] image The image content of the imageActor for transition
*/
- void OnImageLoaded(Image image);
+ void OnImageLoaded(ResourceImage image);
+
+ /**
+ * Set sub-image to each tile.
+ * @param[in] image The image content of the imageActor for transition
+ */
+ void PrepareTiles( Image image );
/**
* Callback function of transition animation finished
// CLASS HEADER
#include <dali-toolkit/public-api/builder/json-parser.h>
+// EXTERNAL INCLUDES
#include <memory.h>
#include <functional>
#include <iostream>
*
*/
+// EXTERNAL INCLUDES
#include <string>
#include <vector>
#include <list>
*
*/
+// EXTERNAL INCLUDES
#include <utility> // pair
#include <iterator>
#include <vector>
*/
// CLASS HEADER
-
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-
-#include <dali/integration-api/debug.h>
#include <dali-toolkit/internal/controls/alignment/alignment-impl.h>
namespace Dali
*
*/
+// CLASS HEADER
#include <dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.h>
-//INTERNAL INCLUDES
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h>
namespace Toolkit
{
-const char* const Button::SIGNAL_PRESSED = "pressed";
-const char* const Button::SIGNAL_RELEASED = "released";
-const char* const Button::SIGNAL_CLICKED = "clicked";
-const char* const Button::SIGNAL_STATE_CHANGED = "state-changed";
-
-const char* const Button::ACTION_BUTTON_CLICK = "button-click";
-
Button::Button()
{}
* point doesn't leave the boundary of the button.
*
* When the \e disabled property is set to \e true, no signal is emitted.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------|-----------------------------|
+ * | pressed | @ref PressedSignal() |
+ * | released | @ref ReleasedSignal() |
+ * | clicked | @ref ClickedSignal() |
+ * | state-changed | @ref StateChangedSignal() |
+ *
+ * Actions
+ * | %Action Name | %Button method called |
+ * |-------------------|-----------------------------|
+ * | button-click | %DoClickAction() |
*/
class DALI_IMPORT_API Button : public Control
{
public:
- // Signal Names
- static const char* const SIGNAL_PRESSED; ///< name "pressed"
- static const char* const SIGNAL_RELEASED; ///< name "released"
- static const char* const SIGNAL_CLICKED; ///< name "clicked"
- static const char* const SIGNAL_STATE_CHANGED; ///< name "state-changed"
-
- //Action Names
- static const char* const ACTION_BUTTON_CLICK; ///< name "button-click"
-
// Properties
static const Property::Index PROPERTY_DISABLED; ///< name "disabled", @see SetDisabled(), type BOOLEAN
static const Property::Index PROPERTY_AUTO_REPEATING; ///< name "auto-repeating", @see SetAutoRepeating(), type BOOLEAN
*
*/
+// CLASS HEADER
#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/cluster/cluster-style-impl.h>
using namespace Dali;
const std::string Cluster::CLUSTER_ACTOR_DEPTH( "cluster-actor-depth" );
-const char* const Cluster::ACTION_EXPAND = "expand";
-const char* const Cluster::ACTION_COLLAPSE = "collapse";
-const char* const Cluster::ACTION_TRANSFORM = "transform";
-
Cluster::Cluster()
{
}
class ClusterStyle;
/**
- * Cluster is a container of grouped actors positioned in different cluster styles.
+ * @brief Cluster is a container of grouped actors positioned in different cluster styles.
+ *
+ * Actions
+ * | %Action Name | Method |
+ * |---------------------------|---------------------------|
+ * | expand | DoExpandAction() |
+ * | collapse | DoCollapseAction() |
+ * | transform | DoTransformAction() |
*/
class DALI_IMPORT_API Cluster : public Control
{
static const std::string CLUSTER_ACTOR_DEPTH; ///< Property, name "cluster-actor-depth", type FLOAT
- //Action Names
- static const char* const ACTION_EXPAND;
- static const char* const ACTION_COLLAPSE;
- static const char* const ACTION_TRANSFORM;
-
public:
/**
namespace
{
+// Signals
+
+const char* const SIGNAL_KEY_EVENT = "key-event";
+const char* const SIGNAL_TAPPED = "tapped";
+const char* const SIGNAL_PANNED = "panned";
+const char* const SIGNAL_PINCHED = "pinched";
+const char* const SIGNAL_LONG_PRESSED = "long-pressed";
+
+// Actions
+
+const char* const ACTION_CONTROL_ACTIVATED = "control-activated";
+
const Scripting::StringEnum< Control::SizePolicy > SIZE_POLICY_STRING_TABLE[] =
{
{ "FIXED", Control::Fixed },
// Property Registration after Internal::Control::Impl definition below
-TypeAction ACTION_TYPE_1( CONTROL_TYPE, Toolkit::Control::ACTION_CONTROL_ACTIVATED, &Internal::Control::DoAction );
+TypeAction ACTION_TYPE_1( CONTROL_TYPE, ACTION_CONTROL_ACTIVATED, &Internal::Control::DoAction );
-SignalConnectorType SIGNAL_CONNECTOR_1( CONTROL_TYPE, Toolkit::Control::SIGNAL_KEY_EVENT, &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_2( CONTROL_TYPE, Toolkit::Control::SIGNAL_TAPPED, &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_3( CONTROL_TYPE, Toolkit::Control::SIGNAL_PANNED, &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_4( CONTROL_TYPE, Toolkit::Control::SIGNAL_PINCHED, &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_5( CONTROL_TYPE, Toolkit::Control::SIGNAL_LONG_PRESSED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_1( CONTROL_TYPE, SIGNAL_KEY_EVENT, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_2( CONTROL_TYPE, SIGNAL_TAPPED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_3( CONTROL_TYPE, SIGNAL_PANNED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_4( CONTROL_TYPE, SIGNAL_PINCHED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_5( CONTROL_TYPE, SIGNAL_LONG_PRESSED, &Internal::Control::DoConnectSignal );
/**
* Structure which holds information about the background of a control
case Toolkit::Control::PROPERTY_WIDTH_POLICY:
{
- controlImpl.mImpl->mWidthPolicy = Scripting::GetEnumeration< Toolkit::Control::SizePolicy >( value.Get< std::string >(), SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT );
+ controlImpl.mImpl->mWidthPolicy = Scripting::GetEnumeration< Toolkit::Control::SizePolicy >( value.Get< std::string >().c_str(), SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT );
break;
}
case Toolkit::Control::PROPERTY_HEIGHT_POLICY:
{
- controlImpl.mImpl->mHeightPolicy = Scripting::GetEnumeration< Toolkit::Control::SizePolicy >( value.Get< std::string >(), SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT );
+ controlImpl.mImpl->mHeightPolicy = Scripting::GetEnumeration< Toolkit::Control::SizePolicy >( value.Get< std::string >().c_str(), SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT );
break;
}
{
bool ret = false;
- if( object && (actionName == Toolkit::Control::ACTION_CONTROL_ACTIVATED) )
+ if( object && ( 0 == strcmp( actionName.c_str(), ACTION_CONTROL_ACTIVATED ) ) )
{
Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
if( control )
Dali::BaseHandle handle( object );
bool connected( false );
- Toolkit::Control control = Toolkit::Control::DownCast(handle);
+ Toolkit::Control control = Toolkit::Control::DownCast( handle );
if ( control )
{
Control& controlImpl( control.GetImplementation() );
connected = true;
- if ( Toolkit::Control::SIGNAL_KEY_EVENT == signalName )
+ if ( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
{
controlImpl.KeyEventSignal().Connect( tracker, functor );
}
- else if( Toolkit::Control::SIGNAL_TAPPED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
{
controlImpl.EnableGestureDetection( Gesture::Tap );
controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
}
- else if( Toolkit::Control::SIGNAL_PANNED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
{
controlImpl.EnableGestureDetection( Gesture::Pan );
controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
}
- else if( Toolkit::Control::SIGNAL_PINCHED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
{
controlImpl.EnableGestureDetection( Gesture::Pinch );
controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
}
- else if( Toolkit::Control::SIGNAL_LONG_PRESSED == signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
{
controlImpl.EnableGestureDetection( Gesture::LongPress );
controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
virtual void OnInitialize();
/**
- * @brief This method is called when the control is activates.
+ * @brief This method is called when the control is activated.
*
* Derived classes should override this if they wish to be notified when they are activated.
*/
*
*/
+// CLASS HEADER
#include <dali-toolkit/public-api/controls/control.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
namespace Dali
namespace Toolkit
{
-const char* const Control::ACTION_CONTROL_ACTIVATED = "control-activated";
-
-const char* const Control::SIGNAL_KEY_EVENT = "key-event";
-const char* const Control::SIGNAL_TAPPED = "tapped";
-const char* const Control::SIGNAL_PANNED = "panned";
-const char* const Control::SIGNAL_PINCHED = "pinched";
-const char* const Control::SIGNAL_LONG_PRESSED = "long-pressed";
-
Control Control::New()
{
return Internal::Control::New();
*
* The implementation of the control must be supplied; see Internal::Control for more details.
* @see Internal::Control
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------|-----------------------------------------------------|
+ * | key-event | @ref KeyEventSignal() |
+ * | tapped | @ref GetTapGestureDetector().DetectedSignal() |
+ * | panned | @ref GetPanGestureDetector().DetectedSignal() |
+ * | pinched | @ref GetPinchGestureDetector().DetectedSignal() |
+ * | long-pressed | @ref GetLongPressGestureDetector().DetectedSignal() |
+ *
+ * Actions
+ * | %Action Name | %Control method called |
+ * |-------------------|-----------------------------------------------------|
+ * | control-activated | %OnActivated() |
*/
class DALI_IMPORT_API Control : public CustomActor
{
static const Property::Index PROPERTY_KEY_INPUT_FOCUS; ///< name "key-input-focus", @see SetKeyInputFocus, type BOOLEAN
/** @} */
- /// @name Signals
- /** @{ */
- static const char* const SIGNAL_KEY_EVENT; ///< name "key-event"
- static const char* const SIGNAL_TAPPED; ///< name "tapped"
- static const char* const SIGNAL_PANNED; ///< name "panned"
- static const char* const SIGNAL_PINCHED; ///< name "pinched"
- static const char* const SIGNAL_LONG_PRESSED; ///< name "long-pressed"
- /** @} */
-
- /// @name Actions
- /** @{ */
- static const char* const ACTION_CONTROL_ACTIVATED; ///< name "control-activated"
- /** @} */
-
/**
* @brief Describes how a control could be resized.
*/
*
*/
+// CLASS HEADER
#include "check-button-factory.h"
// EXTERNAL INCLUDES
#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
Alignment CreateAlignedImage( const std::string& imagePath )
{
- Image image = Image::New( imagePath );
+ Image image = ResourceImage::New( imagePath );
return CreateAlignedImage( ImageActor::New( image ) );
}
// EXTERNAL INCLUDES
#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
Alignment CreateAlignedImage( const std::string& imagePath )
{
- Image image = Image::New( imagePath );
+ Image image = ResourceImage::New( imagePath );
return CreateAlignedImage( ImageActor::New( image ) );
}
*/
// EXTERNAL INCLUDES
+#include <dali/public-api/images/bitmap-image.h>
// INTERNAL INCLUDES
-
#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
-#include <dali/public-api/images/bitmap-image.h>
+
namespace Dali
{
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/actors/image-actor.h>
*
*/
-// EXTERNAL INCLUDES
-
// CLASS HEADER
#include <dali-toolkit/public-api/controls/effects-view/effects-view.h>
*
*/
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/magnifier/magnifier.h>
#include <dali-toolkit/internal/controls/magnifier/magnifier-impl.h>
namespace Toolkit
{
-const char* const NavigationControl::ACTION_PUSH = "push";
-const char* const NavigationControl::ACTION_POP = "pop";
-
NavigationControl::NavigationControl()
{
}
* | +-+ +-----+ +-----+ +-+ |
* | +-+ +-----+ +-----+ +-+ | tool bar
* +----------------------------------------+
+ *
+ * Actions
+ * | %Action Name | %NavigationControl method called |
+ * |-------------------|----------------------------------|
+ * | push | %PushItem() |
+ * | pop | %PopItem() |
*/
-
class DALI_IMPORT_API NavigationControl : public Control
{
public:
- //Action Names
- static const char* const ACTION_PUSH;
- static const char* const ACTION_POP;
-
-public:
/**
* Create a NavigationControl handle; this can be initialize with NavigationControl::New().
*
*/
+// CLASS HEADER
#include <dali-toolkit/public-api/controls/page-turn-view/page-factory.h>
namespace Dali
*
*/
-//INTERNAL INCLUDES
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
namespace Dali
*
*/
-//INTERNAL INCLUDES
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
namespace Dali
*
*/
+// CLASS HEADER
#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h>
using namespace Dali;
*
*/
+// CLASS HEADER
#include <dali-toolkit/public-api/controls/popup/popup.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/popup/popup-impl.h>
#include <dali-toolkit/public-api/controls/buttons/button.h>
// Popup
///////////////////////////////////////////////////////////////////////////////////////////////////
-const char* const Popup::SIGNAL_TOUCHED_OUTSIDE = "touched-outside";
-const char* const Popup::SIGNAL_HIDDEN = "hidden";
-
Popup::Popup()
{
}
*
* A popup can use various custom transition effects, e.g.
* Alpha fade, Scaling transition, position/rotation, shader effects.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------|------------------------------|
+ * | touched-outside | @ref OutsideTouchedSignal() |
+ * | hidden | @ref HiddenSignal() |
*/
class DALI_IMPORT_API Popup : public Control
{
public:
- //Signal Names
- static const char* const SIGNAL_TOUCHED_OUTSIDE; ///< name "touched-outside"
- static const char* const SIGNAL_HIDDEN; ///< name "hidden"
-
/**
* @brief Current popup state.
*/
*
*/
+// CLASS HEADER
#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h>
namespace Dali
namespace Toolkit
{
-const char* const ScrollBar::SCROLL_POSITION_NOTIFIED_SIGNAL_NAME = "scroll-position-notified";
-
ScrollBar::ScrollBar()
{
}
/**
* ScrollBar is a UI component that can be added to the scrollable controls
* indicating the current scroll position of the scrollable content.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |--------------------------|-------------------------------------|
+ * | scroll-position-notified | @ref ScrollPositionNotifiedSignal() |
*/
class DALI_IMPORT_API ScrollBar : public ScrollComponent
{
public:
// Signals
- static const char* const SCROLL_POSITION_NOTIFIED_SIGNAL_NAME; ///< "scroll-position-notified" signal name
typedef Signal< void ( float ) > ScrollPositionNotifiedSignalType;
// Properties
const Property::Index ScrollConnector::SCROLL_POSITION = Internal::ScrollConnector::SCROLL_POSITION;
const Property::Index ScrollConnector::OVERSHOOT = Internal::ScrollConnector::OVERSHOOT;
-const char* const ScrollConnector::DOMAIN_CHANGED_SIGNAL_NAME = "domain-changed";
-const char* const ScrollConnector::SCROLL_POSITION_CHANGED_SIGNAL_NAME = "scroll-position-changed";
-
ScrollConnector ScrollConnector::New()
{
return ScrollConnector( Internal::ScrollConnector::New() );
* The overshoot property is intended for implementing 'end of list' style indicators. This property is expected to be in the range
* -1 to 1, where -1 shows an attempt the scroll beyond the minimum limit, and 1 shows an attempt the scroll beyond the maximum limit.
* Zero indicates normal scrolling i.e. when overshoot indicators should be hidden.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------------|------------------------------------|
+ * | domain-changed | @ref DomainChangedSignal() |
+ * | scroll-position-changed | @ref ScrollPositionChangedSignal() |
*/
class DALI_IMPORT_API ScrollConnector : public BaseHandle
{
static const Property::Index OVERSHOOT; ///< The index of the "overshoot" property
// Signals
- static const char* const DOMAIN_CHANGED_SIGNAL_NAME; ///< "domain-changed" signal name
typedef Signal< void ( float min, float max, float size ) > DomainChangedSignalType;
-
- static const char* const SCROLL_POSITION_CHANGED_SIGNAL_NAME; ///< "scroll-position-changed" signal name
typedef Signal< void ( float position ) > ScrollPositionChangedSignalType;
/**
const float ScrollView::DEFAULT_FLICK_SPEED_COEFFICIENT(1.0f);
const float ScrollView::DEFAULT_MAX_FLICK_SPEED(3.0f);
-const char* const ScrollView::SIGNAL_SNAP_STARTED = "snap-started";
-
ScrollView::ScrollView()
{
}
/**
* @brief ScrollView contains actors that can be scrolled manually (via touch)
* or automatically.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------|----------------------------|
+ * | snap-started | @ref SnapStartedSignal() |
*/
class DALI_IMPORT_API ScrollView : public Scrollable
{
static const float DEFAULT_FLICK_SPEED_COEFFICIENT; ///< Default Flick speed coefficient (multiples input touch velocity)
static const float DEFAULT_MAX_FLICK_SPEED; ///< Default Maximum flick speed. (in stage diagonals per second)
- //Signal Names
- static const char* const SIGNAL_SNAP_STARTED; ///< Name "snap-started"
-
/// Direction of transitions
enum EDirectionFlag
{
const std::string Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME( "scroll-position-max" );
const std::string Scrollable::SCROLL_DIRECTION_PROPERTY_NAME( "scroll-direction" );
-const char* const Scrollable::SIGNAL_SCROLL_STARTED = "scroll-started";
-const char* const Scrollable::SIGNAL_SCROLL_COMPLETED = "scroll-completed";
-const char* const Scrollable::SIGNAL_SCROLL_UPDATED = "scroll-updated";
-const char* const Scrollable::SIGNAL_SCROLL_CLAMPED = "scroll-clamped";
-
Scrollable::Scrollable()
{
}
* (via touch) or automatically.
*
* Scrollables such as ScrollView and ItemView can be derived from this class.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------|------------------------------|
+ * | scroll-started | @ref ScrollStartedSignal() |
+ * | scroll-completed | @ref ScrollUpdatedSignal() |
+ * | scroll-updated | @ref ScrollCompletedSignal() |
+ * | scroll-clamped | @ref ScrollClampedSignal() |
*/
class DALI_IMPORT_API Scrollable : public Control
{
static const Property::Index PROPERTY_OVERSHOOT_ANIMATION_SPEED; ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type FLOAT
/** @} */
- /// @name Signals
- /** @{ */
- static const char* const SIGNAL_SCROLL_STARTED; ///< "scroll-started";
- static const char* const SIGNAL_SCROLL_COMPLETED; ///< "scroll-completed";
- static const char* const SIGNAL_SCROLL_UPDATED; ///< "scroll-updated";
- static const char* const SIGNAL_SCROLL_CLAMPED; ///< "scroll-clamped";
- /** @} */
-
public:
typedef Signal< void ( const Vector3& ) > ScrollStartedSignalType; ///< ScrollStarted signal type
// Slider
///////////////////////////////////////////////////////////////////////////////////////////////////
-// Signals
-const char* const Slider::SIGNAL_VALUE_CHANGED = "value-changed";
-const char* const Slider::SIGNAL_MARK = "mark";
-
Slider::Slider()
{
}
/**
* @brief Slider is a control to enable sliding an indicator between two values
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------|-----------------------------|
+ * | value-changed | @ref ValueChangedSignal() |
+ * | mark | @ref MarkSignal() |
*/
class DALI_IMPORT_API Slider : public Control
{
public:
- //Signal Names
- static const char* const SIGNAL_VALUE_CHANGED;
- static const char* const SIGNAL_MARK;
-
// Properties
static const Property::Index LOWER_BOUND_PROPERTY; ///< Property, name "lower-bound", type FLOAT
static const Property::Index UPPER_BOUND_PROPERTY; ///< Property, name "upper-bound", type FLOAT
namespace Toolkit
{
-const char* const TextInput::SIGNAL_START_INPUT( "start-input" );
-const char* const TextInput::SIGNAL_END_INPUT( "end-input" );
-const char* const TextInput::SIGNAL_STYLE_CHANGED( "style-changed" );
-const char* const TextInput::SIGNAL_MAX_INPUT_CHARACTERS_REACHED( "max-input-characters-reached" );
-const char* const TextInput::SIGNAL_TOOLBAR_DISPLAYED = "toolbar-displayed";
-const char* const TextInput::SIGNAL_TEXT_EXCEED_BOUNDARIES = "text-exceed-boundaries";
-
TextInput::TextInput()
{
}
static const Property::Index CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY; // Property, name "clipboard-button-position-priority", type unsigned int
static const Property::Index POP_UP_OFFSET_FROM_TEXT_PROPERTY; // Property, name "popup-offset-from-text", type VECTOR4
static const Property::Index CURSOR_COLOR_PROPERTY; // Property, name "cursor-color", type VECTOR4
-
- /** @} */
-
- /// @name Signals
- /** @{ */
- static const char* const SIGNAL_START_INPUT; ///< name "start-input"
- static const char* const SIGNAL_END_INPUT; ///< name "end-input"
- static const char* const SIGNAL_STYLE_CHANGED; ///< name "style-changed"
- static const char* const SIGNAL_MAX_INPUT_CHARACTERS_REACHED; ///< name "max-input-characters-reached"
- static const char* const SIGNAL_TOOLBAR_DISPLAYED; ///< name "toolbar-displayed"
- static const char* const SIGNAL_TEXT_EXCEED_BOUNDARIES; ///< name "text-exceed-boundaries"
/** @} */
public:
namespace Toolkit
{
-
-const char* const TextView::SIGNAL_TEXT_SCROLLED = "scrolled";
-
TextView::CharacterLayoutInfo::CharacterLayoutInfo()
: mSize(),
mPosition(),
* It provides support for multi-line wrapping, multi-language font detection, text alignment, scrolling and styling.
*
* See the \link text-view Text View \endlink page of the Programming Guide for more details and examples.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------|---------------------------|
+ * | scrolled | @ref ScrolledSignal() |
*/
class DALI_IMPORT_API TextView : public Control
{
public:
- // Signal Names
- static const char* const SIGNAL_TEXT_SCROLLED; ///< Signal emitted when the scroll position changes. @see ScrolledSignal()
-
// Properties
static const Property::Index PROPERTY_MARKUP_ENABLED; ///< name "markup-enabled", @see SetMarkupProcessingEnabled(), type BOOLEAN
static const Property::Index PROPERTY_TEXT; ///< name "text", @see SetText(), type STRING
namespace Toolkit
{
-const char* const View::SIGNAL_ORIENTATION_ANIMATION_START = "orientation-animation-start";
-
View::View()
{
}
* contentLayer.ApplyConstraint( ParentConstraint::Size::New( ParentSize() ) );
* view.AddContentLayer( contentLayer );
* \endcode
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-----------------------------|------------------------------------------|
+ * | orientation-animation-start | @ref OrientationAnimationStartedSignal() |
+
*/
class DALI_IMPORT_API View : public Control
{
-public:
- //Signal Names
- static const char* const SIGNAL_ORIENTATION_ANIMATION_START;
public:
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 30;
+const unsigned int TOOLKIT_MICRO_VERSION = 31;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
$(public_api_src_dir)/shader-effects/overlay-effect.cpp \
$(public_api_src_dir)/shader-effects/page-turn-book-spine-effect.cpp \
$(public_api_src_dir)/shader-effects/page-turn-effect.cpp \
+ $(public_api_src_dir)/shader-effects/quadratic-bezier.cpp \
$(public_api_src_dir)/shader-effects/ripple-effect.cpp \
$(public_api_src_dir)/shader-effects/ripple2d-effect.cpp \
$(public_api_src_dir)/shader-effects/shear-effect.cpp \
$(public_api_src_dir)/shader-effects/overlay-effect.h \
$(public_api_src_dir)/shader-effects/page-turn-book-spine-effect.h \
$(public_api_src_dir)/shader-effects/page-turn-effect.h \
+ $(public_api_src_dir)/shader-effects/quadratic-bezier.h \
$(public_api_src_dir)/shader-effects/ripple-effect.h \
$(public_api_src_dir)/shader-effects/ripple2d-effect.h \
$(public_api_src_dir)/shader-effects/shear-effect.h \
namespace Toolkit
{
-const char* const FocusManager::SIGNAL_FOCUS_CHANGED = "focus-changed";
-const char* const FocusManager::SIGNAL_FOCUS_OVERSHOT = "focus-overshot";
-const char* const FocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED = "focused-actor-activated";
-
FocusManager::FocusManager()
{
}
* It provides functionality of setting the
* focus and moving the focus forward and backward. It also draws a highlight for the
* focused actor and emits a signal when the focus is changed.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------------|------------------------------------|
+ * | focus-changed | @ref FocusChangedSignal() |
+ * | focus-overshot | @ref FocusOvershotSignal() |
+ * | focused-actor-activated | @ref FocusedActorActivatedSignal() |
*/
-
class DALI_IMPORT_API FocusManager : public BaseHandle
{
public:
- // Signal Names
- static const char* const SIGNAL_FOCUS_CHANGED; ///< name "focus-changed"
- static const char* const SIGNAL_FOCUS_OVERSHOT; ///< name "focus-overshot"
- static const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED; ///< name "focused-actor-activated"
/**
* @brief Accessibility needs four information which will be read by screen-reader.
namespace Toolkit
{
-const char* const KeyboardFocusManager::SIGNAL_PRE_FOCUS_CHANGE = "keyboard-pre-focus-change";
-const char* const KeyboardFocusManager::SIGNAL_FOCUS_CHANGED = "keyboard-focus-changed";
-const char* const KeyboardFocusManager::SIGNAL_FOCUS_GROUP_CHANGED = "keyboard-focus-group-changed";
-const char* const KeyboardFocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED = "keyboard-focused-actor-activated";
-
KeyboardFocusManager::KeyboardFocusManager()
{
}
* in four directions (i.e. Left, Right, Up and Down). It also draws a
* highlight for the focused actor and emits a signal when the focus
* is changed.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |----------------------------------|------------------------------------|
+ * | keyboard-pre-focus-change | @ref PreFocusChangeSignal() |
+ * | keyboard-focus-changed | @ref FocusChangedSignal() |
+ * | keyboard-focus-group-changed | @ref FocusGroupChangedSignal() |
+ * | keyboard-focused-actor-activated | @ref FocusedActorActivatedSignal() |
*/
class DALI_IMPORT_API KeyboardFocusManager : public BaseHandle
{
-public:
- //Signal Names
- static const char* const SIGNAL_PRE_FOCUS_CHANGE; ///< name "keyboard-pre-focus-change"
- static const char* const SIGNAL_FOCUS_CHANGED; ///< name "keyboard-focus-changed"
- static const char* const SIGNAL_FOCUS_GROUP_CHANGED; ///< name "keyboard-focus-group-changed"
- static const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED; ///< name "keyboard-focused-actor-activated"
public:
namespace Toolkit
{
-const char* const KeyInputFocusManager::SIGNAL_KEY_INPUT_FOCUS_CHANGED = "key-input-focus-changed";
-const char* const KeyInputFocusManager::SIGNAL_UNHANDLED_KEY_EVENT = "unhandled-key-event";
-
KeyInputFocusManager::KeyInputFocusManager()
{
}
* all the keyboard events first. And if the conrol doesn't consume the event it is passed to
* the next control in the stack. If none of the controls in the stack consume the key event then
* UnhandledKeyEventSignal() is emitted.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------------|-----------------------------------|
+ * | key-input-focus-changed | @ref KeyInputFocusChangedSignal() |
+ * | unhandled-key-event | @ref UnhandledKeyEventSignal() |
*/
class DALI_IMPORT_API KeyInputFocusManager : public BaseHandle
{
public:
- // Signal Names
- static const char* const SIGNAL_KEY_INPUT_FOCUS_CHANGED;
- static const char* const SIGNAL_UNHANDLED_KEY_EVENT;
// KeyInputFocusChanged
typedef Signal< void (Control, Control) > KeyInputFocusChangedSignalType;
{
}
-BubbleEffect BubbleEffect::New( unsigned int numberOfBubble, const std::string& shapeImagePath)
+BubbleEffect BubbleEffect::New( unsigned int numberOfBubble)
{
std::ostringstream vertexShaderStringStream;
vertexShaderStringStream << "#define NUMBER_OF_BUBBLE "<< numberOfBubble << "\n";
" precision mediump float;\n"
// the gravity applied to the y direction
" uniform float uGravity; \n"
- // Width of the texture in pixels
- " uniform float uShapeWidth; \n"
// xy: the emit position of the bubble; zw: the destinationof the bubble.
// The bubble is moving from (xy) to (zw plus the y drop influenced by gravity).
" uniform vec4 uStartAndEndPos[NUMBER_OF_BUBBLE];\n"
" gl_Position = uMvpMatrix * position;\n"
"\n"
// Add multiple bubble shapes in the effect
- " mediump float texCoordX = floor( mod(startAndEnd.z, uShapeWidth) );\n "
- " mediump float texCoordY = floor( mod(startAndEnd.w, uShapeWidth) );\n "
- " vTexCoord = vec2( (texCoordX + aTexCoord.x)/ uShapeWidth,(texCoordY + aTexCoord.y)/ uShapeWidth );\n"
+ " vTexCoord = aTexCoord;\n"
" vPercentage = percentage;\n"
// Use the emit position color for the bubble
" vEffectTexCoord = startAndEnd.xy * uInvertedMovementArea;\n"
handle.SetUniform( "uMagnification", 1.f );
handle.SetUniform( "uDynamicScale", 1.f );
- //Get pixel width of the shape
- float width = Image::GetImageSize(shapeImagePath).width;
- handle.SetUniform( "uShapeWidth", (width/EACH_WIDTH_PER_SHAPE) );
-
Vector4 zeroVector;
for( unsigned int i=0; i<numberOfBubble; i++ )
{
SetUniform( "uGravity", gravity );
}
-void BubbleEffect::SetShapeImageWidth( float imageWidth )
-{
- SetUniform( "uShapeWidth", (imageWidth/EACH_WIDTH_PER_SHAPE) );
-}
-
void BubbleEffect::SetDynamicScale( float scale )
{
SetUniform( "uDynamicScale", scale );
* Ideally use one group of uniform to control one bubble.
* If the num of patches in the MeshActor is more than groups of uniforms,
* the uniform values will be shared by multiple bubbles. Allow up to 9 times.
- * @param shapeImagePath File path of the image that will be used as a texture for each bubble.
* @return A handle to a newly allocated Dali resource.
*/
- static BubbleEffect New( unsigned int numberOfBubble, const std::string& shapeImagePath);
+ static BubbleEffect New( unsigned int numberOfBubble);
/**
* Set the bubble movement area for the BubbleEffect
*/
void SetGravity( float gravity );
- /*
- * Set the width of shape image
- * If one image has multiple shape, bubble effect will parse one shape from the image randomly.
- * @param[in] imageWidth width of shape image
- */
- void SetShapeImageWidth( float imageWidth );
-
/**
* Set the scale factor applied to the bubbles
* @param[in] scale The scale factor applied on all bubbles.
// EXTERNAL INCLUDES
#include <dali/public-api/shader-effects/shader-effect.h>
+#include <dali/public-api/images/resource-image.h>
namespace Dali
{
GeometryType( GEOMETRY_TYPE_IMAGE ),
ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) );
- maskEffect.SetEffectImage( Image::New( maskImage ) );
+ maskEffect.SetEffectImage( ResourceImage::New( maskImage ) );
maskEffect.SetUniform( "uImageSize", Vector2(0,0) /*Constrained to actor size*/ );
maskEffect.ApplyConstraint( Constraint::New<Vector2>( maskEffect.GetPropertyIndex("uImageSize"),
void Apply( ImageActor actor, const std::string& maskImage )
{
- Vector2 maskSize = Image::GetImageSize( maskImage );
+ Vector2 maskSize = ResourceImage::GetImageSize( maskImage );
const float leftRight = (maskSize.width - 1.0f) * 0.5f;
const float topBottom = (maskSize.height - 1.0f) * 0.5f;
void Apply( ImageActor actor, const std::string& maskImage, const Vector4& maskBorder )
{
- Vector2 maskSize = Image::GetImageSize( maskImage );
+ Vector2 maskSize = ResourceImage::GetImageSize( maskImage );
DoApply( actor, maskImage, maskSize, maskBorder );
}
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+//CLASS HEADER
+#include <dali-toolkit/public-api/shader-effects/quadratic-bezier.h>
+
+//EXTERNAL HEADERS
+#include <sstream>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace
+{
+const char* POINT_PROPERTY_NAME( "uPoint" );
+const char* LINEWIDTH_PROPERTY_NAME( "uLineWidth" );
+const char* COLOR_PROPERTY_NAME( "uColor" );
+} // namespace
+
+QuadraticBezier::QuadraticBezier()
+{
+}
+
+//Call the Parent copy constructor to add reference to the implementation for this object
+QuadraticBezier::QuadraticBezier(ShaderEffect handle)
+:ShaderEffect(handle)
+{
+}
+
+QuadraticBezier::~QuadraticBezier()
+{
+}
+
+QuadraticBezier QuadraticBezier::New(unsigned int pointCount, bool filled )
+{
+ std::string vertexShader = DALI_COMPOSE_SHADER
+ (
+ uniform mediump vec3 uPoint[MAX_POINT_COUNT];\n
+ varying highp vec2 vCoefficient;
+ void main()\n
+ {\n
+ int vertexId = int(aNormal.z);\n
+ gl_Position = uMvpMatrix * vec4(uPoint[vertexId], 1.0);\n
+ vCoefficient = aNormal.xy;\n
+ }\n
+ );
+
+ std::string fragmentShader;
+
+ if( filled )
+ {
+ fragmentShader = DALI_COMPOSE_SHADER
+ (
+ varying highp vec2 vCoefficient;\n
+
+ void main()\n
+ {\n
+ highp float C = (vCoefficient.x*vCoefficient.x-vCoefficient.y);\n
+ highp float Cdx = dFdx(C);\n
+ highp float Cdy = dFdy(C);\n
+
+ highp float distance = float(C / sqrt(Cdx*Cdx + Cdy*Cdy));\n
+
+ gl_FragColor = uColor;\n
+ highp float alpha = 0.5 - distance;\n
+ if( alpha < 0.0 )\n
+ discard;\n
+
+ gl_FragColor.w = alpha;\n
+ }\n
+ );
+ }
+ else
+ {
+ fragmentShader = DALI_COMPOSE_SHADER
+ (
+ varying highp vec2 vCoefficient;\n
+ uniform lowp float uLineWidth;\n
+
+ void main()\n
+ {\n
+ highp float C = (vCoefficient.x*vCoefficient.x-vCoefficient.y);\n
+ highp float Cdx = dFdx(C);\n
+ highp float Cdy = dFdy(C);\n
+ highp float distance = abs(float(C / sqrt(Cdx*Cdx + Cdy*Cdy)));\n
+ gl_FragColor = uColor*(uLineWidth-distance);\n
+ }\n
+ );
+ }
+
+ std::ostringstream vertexShaderPrefix;
+ vertexShaderPrefix << "#define MAX_POINT_COUNT "<< pointCount << "\n";
+
+ Dali::ShaderEffect shaderEffectCustom = Dali::ShaderEffect::NewWithPrefix( vertexShaderPrefix.str(),vertexShader,
+ "#extension GL_OES_standard_derivatives:enable\n", fragmentShader,
+ GEOMETRY_TYPE_UNTEXTURED_MESH );
+
+ Dali::Toolkit::QuadraticBezier handle( shaderEffectCustom );
+
+ //Set default uniform values
+ handle.SetUniform( COLOR_PROPERTY_NAME, Vector4(1.0f,1.0f,1.0f,1.0f) );
+ if( !filled )
+ {
+ //Set default line widht to 1 pixel
+ handle.SetUniform( LINEWIDTH_PROPERTY_NAME, 1.0f );
+ }
+
+ return handle;
+}
+
+void QuadraticBezier::SetPoint(unsigned int index, const Vector3& position)
+{
+ SetUniform( GetPointPropertyName(index), position );
+}
+
+void QuadraticBezier::SetLineWidth( float width )
+{
+ SetUniform( LINEWIDTH_PROPERTY_NAME, width );
+}
+
+void QuadraticBezier::SetColor( const Vector4& color )
+{
+ SetUniform( COLOR_PROPERTY_NAME, color );
+}
+
+std::string QuadraticBezier::GetPointPropertyName(unsigned int index) const
+{
+ std::ostringstream propertyName;
+ propertyName<<POINT_PROPERTY_NAME<<"["<<index<<"]";
+ return propertyName.str();
+}
+
+std::string QuadraticBezier::GetLineWidthPropertyName( ) const
+{
+ return LINEWIDTH_PROPERTY_NAME;
+}
+
+std::string QuadraticBezier::GetColorPropertyName( ) const
+{
+ return COLOR_PROPERTY_NAME;
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
+
--- /dev/null
+#ifndef __DALI_TOOLKIT_QUADRATIC_BEZIER_H__
+#define __DALI_TOOLKIT_QUADRATIC_BEZIER_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/shader-effects/shader-effect.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+/**
+ * @brief QuadraticBezier is a custom shader to render quadratic bezier curves and bounded regions.
+ *
+ * Implementation based on the paper "Resolution Independent Curve Rendering using Programmable Graphics Hardware"
+ * by Charles Loop and Jim Blinn.
+ *
+ * The coordinates of the control points is passed to the shader via uniforms.
+ * aNormal attribute is used to pass the coefficients of each control point (xy coordinates) as well as the vertex ID (z coordinate).
+ * A quadratic curve should have as normal for the first control point (0.0,0.0), (0.5,0.0) for the second and (1.0,1.0) for the third.
+ * Triangles that do not contain curves should have coordinates (0.0,1.0) for each control point in order to be filled properly.
+ */
+
+class DALI_IMPORT_API QuadraticBezier : public ShaderEffect
+{
+public:
+
+ /**
+ * @brief Create an uninitialized QuadraticBezier; this can be initialized with QuadraticBezier::New().
+ *
+ * Calling member functions with an uninitialized Dali::Object is not allowed.
+ */
+ QuadraticBezier();
+
+ /**
+ * @brief Destructor
+ *
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ */
+ ~QuadraticBezier();
+
+ /**
+ * @brief Create an initialized QuadraticBezier.
+ *
+ * @param[in] pointCount The maximum number of vertices
+ * @param[in] filled Specify whether the the bounded region should be filled or not
+ * @return A handle to a newly allocated Dali resource.
+ */
+ static QuadraticBezier New(unsigned int pointCount, bool filled );
+
+ /**
+ * @brief Set position coordinates for a point in the curve
+ *
+ * @param[in] index The index of the vertex
+ * @param[in] position The new position
+ */
+ void SetPoint( unsigned int index, const Vector3& position );
+
+ /**
+ * @brief Set the width of the pathThis is only for not filled curves
+ *
+ * @param[in] width Width of the line in pixels
+ */
+ void SetLineWidth( float width );
+
+ /**
+ * @brief Sets the color of the curve
+ *
+ * @param[in] color The new color
+ */
+ void SetColor( const Vector4& color );
+
+ /**
+ * @brief Get the name of a the point property given its index
+ *
+ * @param[in] index Index of the vertex
+ * @return A std::string containing the property name
+ */
+ std::string GetPointPropertyName( unsigned int index ) const;
+
+ /**
+ * @brief Get the name of the line width property
+ *
+ * @return A std::string containing the property name
+ */
+ std::string GetLineWidthPropertyName( ) const;
+
+ /**
+ * @brief Get the name of the color property
+ *
+ * @return A std::string containing the property name
+ */
+ std::string GetColorPropertyName( ) const;
+
+private: // Not intended for application developers
+
+ DALI_INTERNAL QuadraticBezier(ShaderEffect handle);
+
+};
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_IMAGE_REGION_EFFECT_H__
namespace Toolkit
{
-const char* const CubeTransitionEffect::SIGNAL_TRANSITION_COMPLETED = "transition-completed";
-
CubeTransitionEffect::CubeTransitionEffect()
{
}
{
}
+CubeTransitionEffect CubeTransitionEffect::DownCast( BaseHandle handle )
+{
+ return CubeTransitionEffect( dynamic_cast< Dali::Toolkit::Internal::CubeTransitionEffect* >( handle.GetObjectPtr() ) );
+}
+
void CubeTransitionEffect::SetTransitionDuration( float duration )
{
GetImpl(*this).SetTransitionDuration( duration );
* cubeEffect.StartTransition( );
*
* @endcode
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |----------------------|----------------------------------|
+ * | transition-completed | @ref TransitionCompletedSignal() |
*/
class DALI_IMPORT_API CubeTransitionEffect : public BaseHandle
{
~CubeTransitionEffect();
/**
+ * @brief Downcast an Object handle to a CubeTransitionEffect handle.
+ *
+ * If handle points to a CubeTransitionEffect object the downcast produces
+ * a valid handle. If not the returned handle is left uninitialized.
+ *
+ * @param[in] handle A handle to an object
+ * @return A handle to a CubeTransitionEffect object or an uninitialized handle
+ */
+ static CubeTransitionEffect DownCast( BaseHandle handle );
+
+ /**
* Set the duration of transition animation
* @param[in] duration The duration of transition animation
*/
public: //Signal
- //signal name
- static const char* const SIGNAL_TRANSITION_COMPLETED;
-
//Transition animation completed signal
typedef Signal< void ( CubeTransitionEffect, ImageActor ) > TransitionCompletedSignalType;
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.0.30
+Version: 1.0.31
Release: 1
Group: System/Libraries
License: Apache-2.0
%build
PREFIX="/usr"
CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
-LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections "
+LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
libtoolize --force
cd %{_builddir}/dali-toolkit-%{version}/build/tizen