From: Kingsley Stephens Date: Wed, 25 Feb 2015 11:33:59 +0000 (+0000) Subject: [dali_1.0.31] Merge branch 'tizen' X-Git-Tag: dali_1.9.8~5^2~257 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=c8a0c614eaa58cb6c9aa39a8e44cf027d4fe71eb;hp=3b16ae16f01bd50a26e6c44e6e20ebb8499b4f91 [dali_1.0.31] Merge branch 'tizen' Change-Id: I7229354e6203f86525c9a9d2a84bfa2ce45e67d3 --- diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp index 500b653..8636839 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp @@ -675,7 +675,7 @@ int UtcDaliPushButtonProperties(void) // 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; @@ -687,7 +687,7 @@ int UtcDaliPushButtonProperties(void) // 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; @@ -700,7 +700,7 @@ int UtcDaliPushButtonProperties(void) // 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; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp index 95136ce..f1edb7a 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp @@ -380,7 +380,7 @@ int UtcDaliControlBackgroundImage(void) 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 ); @@ -518,19 +518,19 @@ int UtcDaliControlGestureSignals(void) // 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; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp index 671e19d..9811d1e 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp @@ -326,9 +326,8 @@ int UtcDaliCubeTransitionEffectSetCurrentImage(void) //check the size of the off screen rendered image Wait( application, OFFSCREEN_RENDER_DURATION ); - ImageAttributes attributes( tile.GetImage().GetAttributes() ); - DALI_TEST_EQUALS( static_cast(attributes.GetWidth()), VIEW_AREA_SIZE.x, TEST_LOCATION ); - DALI_TEST_EQUALS( static_cast(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; } @@ -358,9 +357,8 @@ int UtcDaliCubeTransitionEffectSetTargetImage(void) //check the size of the off screen rendered image Wait( application, OFFSCREEN_RENDER_DURATION ); - ImageAttributes attributes( tile.GetImage().GetAttributes() ); - DALI_TEST_EQUALS( static_cast(attributes.GetWidth()), VIEW_AREA_SIZE.x, TEST_LOCATION ); - DALI_TEST_EQUALS( static_cast(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; } @@ -370,7 +368,7 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void) 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 ); @@ -421,7 +419,7 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-DisplacementEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-DisplacementEffect.cpp index 32aa471..522a6fe 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-DisplacementEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-DisplacementEffect.cpp @@ -106,7 +106,7 @@ int UtcDaliDisplacementEffectTestSetProperty(void) 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 ); @@ -114,7 +114,7 @@ int UtcDaliDisplacementEffectTestSetProperty(void) 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 ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp index d4b6e4a..2028c6c 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp @@ -195,7 +195,7 @@ int UtcDaliGaussianBlurViewSetGetRenderTarget(void) 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; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp index b81aa6d..6f45276 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp @@ -66,7 +66,7 @@ public: // From ItemFactory 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; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp index a565f6e..c66a650 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp @@ -83,7 +83,7 @@ public: // From ItemFactory 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; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp index 4b314c0..443de6f 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp @@ -507,7 +507,7 @@ int UtcDaliPageTurnViewSignals(void) // [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; diff --git a/dali-toolkit/dali-toolkit.h b/dali-toolkit/dali-toolkit.h index 942e62d..70f9652 100644 --- a/dali-toolkit/dali-toolkit.h +++ b/dali-toolkit/dali-toolkit.h @@ -111,6 +111,7 @@ #include #include #include +#include #include #include #include diff --git a/dali-toolkit/internal/builder/builder-declarations.h b/dali-toolkit/internal/builder/builder-declarations.h index eabfb29..766e1bf 100644 --- a/dali-toolkit/internal/builder/builder-declarations.h +++ b/dali-toolkit/internal/builder/builder-declarations.h @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/builder/builder-impl.cpp b/dali-toolkit/internal/builder/builder-impl.cpp index 82a502f..0a13013 100644 --- a/dali-toolkit/internal/builder/builder-impl.cpp +++ b/dali-toolkit/internal/builder/builder-impl.cpp @@ -23,9 +23,10 @@ #include #include -// INTERNAL INCLUDES #include +// INTERNAL INCLUDES + #include #include diff --git a/dali-toolkit/internal/builder/json-parser-impl.cpp b/dali-toolkit/internal/builder/json-parser-impl.cpp index 5bce6fb..2cff977 100644 --- a/dali-toolkit/internal/builder/json-parser-impl.cpp +++ b/dali-toolkit/internal/builder/json-parser-impl.cpp @@ -17,9 +17,11 @@ // CLASS HEADER #include -// EXTERNAL + +// EXTERNAL INCLUDES #include +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/builder/json-parser-impl.h b/dali-toolkit/internal/builder/json-parser-impl.h index 987799e..8df13b2 100644 --- a/dali-toolkit/internal/builder/json-parser-impl.h +++ b/dali-toolkit/internal/builder/json-parser-impl.h @@ -18,12 +18,14 @@ * */ +// EXTERNAL INCLUDES #include #include #include -// #include + +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/builder/json-parser-state.cpp b/dali-toolkit/internal/builder/json-parser-state.cpp index 1547156..afa9e59 100644 --- a/dali-toolkit/internal/builder/json-parser-state.cpp +++ b/dali-toolkit/internal/builder/json-parser-state.cpp @@ -18,7 +18,7 @@ // CLASS HEADER #include -// EXTERNAL +// EXTERNAL INCLUDES #include namespace Dali diff --git a/dali-toolkit/internal/builder/json-parser-state.h b/dali-toolkit/internal/builder/json-parser-state.h index 44b911e..17ee739 100644 --- a/dali-toolkit/internal/builder/json-parser-state.h +++ b/dali-toolkit/internal/builder/json-parser-state.h @@ -18,8 +18,10 @@ * */ +// EXTERNAL INCLUDES #include +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/builder/optional-value.h b/dali-toolkit/internal/builder/optional-value.h index eca5303..afa4567 100644 --- a/dali-toolkit/internal/builder/optional-value.h +++ b/dali-toolkit/internal/builder/optional-value.h @@ -18,7 +18,6 @@ * */ -// INTERNAL INCLUDES template struct OptionalTypes { diff --git a/dali-toolkit/internal/builder/replacement.h b/dali-toolkit/internal/builder/replacement.h index 0b54942..7edd9d0 100644 --- a/dali-toolkit/internal/builder/replacement.h +++ b/dali-toolkit/internal/builder/replacement.h @@ -18,7 +18,10 @@ * */ +// EXTERNAL INCLUDES #include + +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/builder/tree-node-manipulator.h b/dali-toolkit/internal/builder/tree-node-manipulator.h index c21f4e1..bd69537 100644 --- a/dali-toolkit/internal/builder/tree-node-manipulator.h +++ b/dali-toolkit/internal/builder/tree-node-manipulator.h @@ -18,13 +18,15 @@ * */ +// EXTERNAL INCLUDES #include // pair #include #include #include -// INTERNAL INCLUDES #include + +// INTERNAL INCLUDES #include namespace Dali diff --git a/dali-toolkit/internal/controls/alignment/alignment-impl.cpp b/dali-toolkit/internal/controls/alignment/alignment-impl.cpp index 97b6f64..0f409f6 100644 --- a/dali-toolkit/internal/controls/alignment/alignment-impl.cpp +++ b/dali-toolkit/internal/controls/alignment/alignment-impl.cpp @@ -16,7 +16,6 @@ */ // CLASS HEADER - #include "alignment-impl.h" // EXTERNAL INCLUDES diff --git a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp index 097097f..cf24627 100644 --- a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp +++ b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp @@ -17,7 +17,6 @@ // CLASS HEADER #include "bloom-view-impl.h" -#include "../gaussian-blur-view/gaussian-blur-view-impl.h" // EXTERNAL INCLUDES #include @@ -30,6 +29,7 @@ // INTERNAL INCLUDES #include #include +#include "../gaussian-blur-view/gaussian-blur-view-impl.h" namespace Dali { @@ -357,9 +357,9 @@ void BloomView::AllocateResources() // 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); ////////////////////////////////////////////////////// diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp index 1faf68c..d9b868f 100644 --- a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp +++ b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -89,7 +90,7 @@ void BubbleEmitter::OnInitialize() 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(); @@ -107,7 +108,7 @@ void BubbleEmitter::OnInitialize() 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] ); @@ -120,7 +121,7 @@ void BubbleEmitter::OnInitialize() 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 ); @@ -169,15 +170,6 @@ void BubbleEmitter::SetBackground( Image bgImage, const Vector3& hsvDelta ) 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 ) diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h index 30ed0a0..3ae36a1 100644 --- a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h +++ b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h @@ -32,8 +32,6 @@ #include #include -#include - namespace Dali { diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index eef0cd8..fdecbba 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -23,6 +23,8 @@ #include #include #include + +// INTERNAL INCLUDES #include namespace Dali @@ -51,20 +53,31 @@ namespace 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 ); @@ -396,7 +409,7 @@ bool Button::DoAction( BaseObject* object, const std::string& actionName, const 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; @@ -547,21 +560,21 @@ bool Button::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tr 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 ); } diff --git a/dali-toolkit/internal/controls/buttons/button-painter-impl.h b/dali-toolkit/internal/controls/buttons/button-painter-impl.h index 3014a75..3a91aef 100644 --- a/dali-toolkit/internal/controls/buttons/button-painter-impl.h +++ b/dali-toolkit/internal/controls/buttons/button-painter-impl.h @@ -18,7 +18,7 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp b/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp index d18afb5..40ee650 100644 --- a/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp @@ -19,11 +19,11 @@ #include "check-box-button-default-painter-impl.h" // EXTERNAL INCLUDES +#include #include +#include // INTERNAL INCLUDES -#include -#include #include "check-box-button-impl.h" namespace Dali diff --git a/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.h b/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.h index a5b5a29..7985942 100644 --- a/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.h +++ b/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.h @@ -18,13 +18,14 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include -#include +// INTERNAL INCLUDES +#include #include "check-box-button-painter-impl.h" namespace Dali diff --git a/dali-toolkit/internal/controls/buttons/check-box-button-impl.h b/dali-toolkit/internal/controls/buttons/check-box-button-impl.h index 619a571..aa60871 100644 --- a/dali-toolkit/internal/controls/buttons/check-box-button-impl.h +++ b/dali-toolkit/internal/controls/buttons/check-box-button-impl.h @@ -18,9 +18,10 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include +// INTERNAL INCLUDES #include #include "button-impl.h" diff --git a/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.h b/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.h index ed13641..312a43c 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.h +++ b/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.h @@ -18,12 +18,13 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include +// INTERNAL INCLUDES #include "push-button-painter-impl.h" namespace Dali diff --git a/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp b/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp index 08d10bf..4ef25d9 100644 --- a/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include +#include using namespace Dali; using namespace Dali::Toolkit::Internal; @@ -58,8 +59,8 @@ Dali::Toolkit::RadioButton RadioButton::New() 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 ); diff --git a/dali-toolkit/internal/controls/cluster/cluster-impl.cpp b/dali-toolkit/internal/controls/cluster/cluster-impl.cpp index d94a94b..25c5fdd 100644 --- a/dali-toolkit/internal/controls/cluster/cluster-impl.cpp +++ b/dali-toolkit/internal/controls/cluster/cluster-impl.cpp @@ -49,17 +49,23 @@ namespace Internal 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 ); } @@ -552,25 +558,25 @@ bool Cluster::DoAction(BaseObject* object, const std::string& actionName, const { 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; } diff --git a/dali-toolkit/internal/controls/cluster/cluster-impl.h b/dali-toolkit/internal/controls/cluster/cluster-impl.h index a7a30e0..17585fe 100644 --- a/dali-toolkit/internal/controls/cluster/cluster-impl.h +++ b/dali-toolkit/internal/controls/cluster/cluster-impl.h @@ -18,9 +18,10 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp b/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp index e53b378..18a5e9d 100644 --- a/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp +++ b/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include + // INTERNAL INCLUDES #include diff --git a/dali-toolkit/internal/controls/cluster/cluster-style-impl.h b/dali-toolkit/internal/controls/cluster/cluster-style-impl.h index a7f3468..bf7b75d 100644 --- a/dali-toolkit/internal/controls/cluster/cluster-style-impl.h +++ b/dali-toolkit/internal/controls/cluster/cluster-style-impl.h @@ -15,11 +15,13 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include + +// INTERNAL INCLUDES #include namespace Dali diff --git a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp index f928e1c..d140750 100644 --- a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp +++ b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp @@ -438,10 +438,10 @@ void EffectsView::AllocateResources() 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(); diff --git a/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp b/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp index 2b993e9..430148a 100644 --- a/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp @@ -427,13 +427,13 @@ void GaussianBlurView::AllocateResources() 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 ); @@ -443,7 +443,7 @@ void GaussianBlurView::AllocateResources() } // 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); diff --git a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp index 2bfd96a..8df457f 100644 --- a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp +++ b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include using namespace Dali; @@ -279,7 +280,7 @@ void Magnifier::SetFrameVisibility(bool visible) { 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 ); diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h b/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h index 8de4edc..bf26399 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h @@ -23,10 +23,9 @@ // INTERNAL INCLUDES #include -#include #include #include - +#include namespace Dali { diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp index 8ef5ec6..3c7e78a 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp @@ -40,15 +40,22 @@ namespace Internal 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() @@ -413,38 +420,38 @@ Toolkit::NavigationControl::ItemPoppedSignalType& NavigationControl::ItemPoppedS 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 (); + DALI_ASSERT_ALWAYS( value.GetType() == Property::STRING ); + std::string itemName = value.Get(); - for (std::list::iterator itemsIter = GetImpl(control).mUnpushedItems.begin(); itemsIter != GetImpl(control).mUnpushedItems.end(); ++itemsIter) + for( std::list::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; } diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h index 1962246..41990a2 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include namespace Dali { diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.cpp index 38c2e95..4e486ba 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.cpp +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.cpp @@ -15,6 +15,7 @@ * */ +// CLASS HEADER #include "navigation-title-bar.h" namespace Dali diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h b/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h index 0715a3d..0377a2e 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h @@ -18,11 +18,12 @@ * */ +// INTERNAL INCLUDES +#include #include #include #include #include -#include namespace Dali { diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.cpp index 6a2d328..aad04b7 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.cpp +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.cpp @@ -15,6 +15,7 @@ * */ +// CLASS HEADER #include "navigation-tool-bar.h" namespace Dali diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h b/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h index acc8cc2..ecb3d3b 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h @@ -18,6 +18,7 @@ * */ +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp b/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp index 615f3a6..a484d64 100644 --- a/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp +++ b/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp @@ -16,7 +16,6 @@ */ // CLASS HEADER - #include "page-impl.h" // EXTERNAL INCLUDES diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp b/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp index c844d88..392f733 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp @@ -376,7 +376,7 @@ void PageTurnView::SetupRenderTasks() 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); diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index 83ea7eb..0cd53c9 100755 --- a/dali-toolkit/internal/controls/popup/popup-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-impl.cpp @@ -27,6 +27,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -52,8 +53,15 @@ const float POPUP_BUTTON_BG_HEIGHT = 96.f; ///< Height of But 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. @@ -108,10 +116,10 @@ BaseHandle Create() 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 ); } @@ -340,7 +348,7 @@ void Popup::ShowTail(const Vector3& position) if(image != "") { - Image tail = Image::New( image ); + Image tail = ResourceImage::New( image ); mTailImage = ImageActor::New(tail); const Vector3 anchorPoint = AnchorPoint::FRONT_BOTTOM_RIGHT - position; @@ -369,12 +377,12 @@ PopupStylePtr Popup::GetStyle() const 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 ); @@ -550,13 +558,13 @@ bool Popup::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra 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 ); } diff --git a/dali-toolkit/internal/controls/popup/popup-style-impl.cpp b/dali-toolkit/internal/controls/popup/popup-style-impl.cpp index 7a97456..2a94eff 100644 --- a/dali-toolkit/internal/controls/popup/popup-style-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-style-impl.cpp @@ -15,6 +15,7 @@ * */ +// EXTERNAL INCLUDES #include using namespace Dali; diff --git a/dali-toolkit/internal/controls/popup/popup-style-impl.h b/dali-toolkit/internal/controls/popup/popup-style-impl.h index 22a1831..34d051a 100644 --- a/dali-toolkit/internal/controls/popup/popup-style-impl.h +++ b/dali-toolkit/internal/controls/popup/popup-style-impl.h @@ -25,6 +25,8 @@ #include #include +#include + namespace Dali { diff --git a/dali-toolkit/internal/controls/relayout-controller-impl.cpp b/dali-toolkit/internal/controls/relayout-controller-impl.cpp index 2f53b67..09b7fcf 100644 --- a/dali-toolkit/internal/controls/relayout-controller-impl.cpp +++ b/dali-toolkit/internal/controls/relayout-controller-impl.cpp @@ -15,8 +15,7 @@ * */ -// FILE HEADER - +// CLASS HEADER #include "relayout-controller-impl.h" // EXTERNAL INCLUDES diff --git a/dali-toolkit/internal/controls/relayout-controller.cpp b/dali-toolkit/internal/controls/relayout-controller.cpp index fa9e70e..19b2ab0 100644 --- a/dali-toolkit/internal/controls/relayout-controller.cpp +++ b/dali-toolkit/internal/controls/relayout-controller.cpp @@ -15,10 +15,8 @@ * */ -// FILE HEADER - +// CLASS HEADER #include "relayout-controller.h" -#include "relayout-controller-impl.h" // EXTERNAL INCLUDES #include @@ -28,6 +26,7 @@ // 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" diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp index 02267f5..8c8923a 100755 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include // INTERNAL INCLUDES #include @@ -120,7 +121,9 @@ BaseHandle Create() 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 ); @@ -148,7 +151,7 @@ void ScrollBar::OnInitialize() { 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 ); @@ -437,6 +440,26 @@ void ScrollBar::OnIndicatorHeightPolicyPropertySet( Property::Value propertyValu } } +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 ) ); diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h index 989ffa4..1d717c2 100755 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h @@ -156,6 +156,17 @@ public: 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 /** diff --git a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp index 72dccbe..bc12931 100755 --- a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -367,7 +368,7 @@ ScrollBarInternal::ScrollBarInternal(Toolkit::Scrollable& container, bool vertic 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 ); diff --git a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.cpp b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.cpp index bb1e629..4728f81 100755 --- a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.cpp +++ b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.cpp @@ -15,6 +15,7 @@ * */ +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index 7301a8b..4e3bb67 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -18,14 +18,13 @@ // CLASS HEADER #include -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include #include -// EXTERNAL INCLUDES #include namespace Dali diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h index b374df5..0fd1b69 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h @@ -18,7 +18,7 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp index 4f3d731..cf0d74e 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include #include namespace Dali @@ -31,6 +32,21 @@ namespace Toolkit 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; @@ -54,6 +70,30 @@ void ScrollConnector::SetScrollPosition( float position ) 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 ), diff --git a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h index f9a201e..8cd176f 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h @@ -120,6 +120,17 @@ public: 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: /** diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp index e346ccb..cc61cba 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp @@ -15,6 +15,7 @@ * */ +// CLASS HEADER #include using namespace Dali; diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp index fd352cb..f396645 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp @@ -18,6 +18,7 @@ // EXTERNAL INCLUDES #include +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h index ccd08b2..bf13222 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h @@ -18,11 +18,13 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include + +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp index d2803f1..bda70a46 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp @@ -18,6 +18,7 @@ // EXTERNAL INCLUDES #include +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h index e747c69..ecfce55 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h @@ -18,11 +18,13 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include + +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp index f48e4c2..f058f16 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp @@ -15,6 +15,7 @@ * */ +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h index c1d6f9c..8625530 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h @@ -18,11 +18,13 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include + +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.cpp index fa4d89c..82bc58f 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.cpp @@ -15,6 +15,7 @@ * */ +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index c6cc755..8bc5fe2 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -52,6 +52,10 @@ using namespace Dali; 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 @@ -522,9 +526,9 @@ BaseHandle Create() 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 ); } @@ -1138,6 +1142,9 @@ void ScrollView::TransformTo(const Vector3& position, 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 @@ -1843,7 +1850,7 @@ bool ScrollView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface 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 ); } diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h index d33aca8..6f6cab6 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h @@ -18,11 +18,13 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include + +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h index eb6dfbe..b0c74c1 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h @@ -18,11 +18,13 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include + +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h index 0415bc5..405223d 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h @@ -18,11 +18,13 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include + +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp index faa2275..e21ef87 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp @@ -15,6 +15,7 @@ * */ +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h index 22ba237..e8bf3b5 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h @@ -18,12 +18,14 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include #include #include #include + +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp b/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp index 36e713f..64fa2b9 100644 --- a/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp @@ -46,18 +46,25 @@ namespace 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", @@ -216,19 +223,19 @@ bool Scrollable::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface 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 ); } diff --git a/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp b/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp index 098e9ae..d47d9bf 100644 --- a/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp +++ b/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp @@ -180,9 +180,9 @@ void ShadowView::SetShadowPlane(Actor shadowPlane) ConstrainCamera(); - mShadowPlane.ApplyConstraint( Constraint::New( Actor::SIZE, Source( mShadowPlaneBg, Actor::SIZE ), EqualToConstraint() ) ); + mShadowPlane.SetSizeMode( SIZE_EQUAL_TO_PARENT ); - mBlurRootActor.ApplyConstraint( Constraint::New( Actor::SIZE, Source( mShadowPlane, Actor::SIZE ), EqualToConstraint() ) ); + mBlurRootActor.SetSizeMode( SIZE_EQUAL_TO_PARENT ); } void ShadowView::SetPointLight(Actor pointLight) @@ -237,7 +237,7 @@ void ShadowView::OnInitialize() { // 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( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() )); + mChildrenRoot.SetSizeMode( SIZE_EQUAL_TO_PARENT ); Vector2 stageSize = Stage::GetCurrent().GetSize(); mCameraActor = CameraActor::New(stageSize); diff --git a/dali-toolkit/internal/controls/slider/slider-impl.cpp b/dali-toolkit/internal/controls/slider/slider-impl.cpp index 76db7ca..509a13e 100755 --- a/dali-toolkit/internal/controls/slider/slider-impl.cpp +++ b/dali-toolkit/internal/controls/slider/slider-impl.cpp @@ -19,14 +19,14 @@ #include // EXTERNAL INCLUDES +#include #include #include +#include -// EXTERNAL INCLUDES +// INTERNAL INCLUDES #include -#include - using namespace Dali; namespace Dali @@ -115,15 +115,20 @@ const bool DEFAULT_SHOW_VALUE = true; 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 ); @@ -439,7 +444,7 @@ void Slider::SetBackingImageName( const std::string& imageName ) { if( mBacking && imageName != String::EMPTY ) { - Image image = Image::New( imageName ); + Image image = ResourceImage::New( imageName ); mBacking.SetImage( image ); } } @@ -448,7 +453,7 @@ std::string Slider::GetBackingImageName() { if( mBacking ) { - return mBacking.GetImage().GetFilename(); + return ResourceImage::DownCast( mBacking.GetImage() ).GetUrl(); } return std::string( "" ); @@ -468,7 +473,7 @@ void Slider::SetProgressImageName( const std::string& imageName ) { if( mProgress && imageName != String::EMPTY ) { - Image image = Image::New( imageName ); + Image image = ResourceImage::New( imageName ); mProgress.SetImage( image ); } } @@ -477,7 +482,7 @@ std::string Slider::GetProgressImageName() { if( mProgress ) { - return mProgress.GetImage().GetFilename(); + return ResourceImage::DownCast( mProgress.GetImage()).GetUrl(); } return std::string( "" ); @@ -497,7 +502,7 @@ void Slider::CreatePopupImage( const std::string& imageName ) { if( mPopup && imageName != String::EMPTY ) { - Image image = Image::New( imageName ); + Image image = ResourceImage::New( imageName ); mPopup.SetImage( image ); } } @@ -516,7 +521,7 @@ void Slider::CreatePopupArrowImage( const std::string& imageName ) { if( mPopupArrow && imageName != String::EMPTY ) { - Image image = Image::New( imageName ); + Image image = ResourceImage::New( imageName ); mPopupArrow.SetImage( image ); } } @@ -575,7 +580,7 @@ void Slider::SetHandleImageName( const std::string& imageName ) { if( mHandle && imageName != String::EMPTY ) { - Image image = Image::New( imageName ); + Image image = ResourceImage::New( imageName ); mHandle.SetImage( image ); } } @@ -584,7 +589,7 @@ std::string Slider::GetHandleImageName() { if( mHandle ) { - return mHandle.GetImage().GetFilename(); + return ResourceImage::DownCast( mHandle.GetImage() ).GetUrl(); } return std::string( "" ); @@ -1018,8 +1023,7 @@ float Slider::GetMarkTolerance() const 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 ); @@ -1027,11 +1031,11 @@ bool Slider::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tr 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 ); } diff --git a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp index 3b2443b..d189ed6 100644 --- a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp @@ -15,6 +15,9 @@ * */ +// CLASS HEADER +#include "super-blur-view-impl.h" + // EXTERNAL INCLUDES #include #include @@ -22,9 +25,6 @@ #include #include -// CLASS HEADER -#include "super-blur-view-impl.h" - namespace //unnamed namespace { @@ -266,7 +266,7 @@ void SuperBlurView::OnControlSizeSet( const Vector3& targetSize ) { float exponent = static_cast(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 ); } } } diff --git a/dali-toolkit/internal/controls/table-view/array-2d.h b/dali-toolkit/internal/controls/table-view/array-2d.h index 371db0f..fe9ecd7 100644 --- a/dali-toolkit/internal/controls/table-view/array-2d.h +++ b/dali-toolkit/internal/controls/table-view/array-2d.h @@ -19,7 +19,7 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include namespace Dali diff --git a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp index 76eab51..30c66f3 100644 --- a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp +++ b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp @@ -1090,7 +1090,7 @@ void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl, { if( item.HasKey( "policy" ) && item.HasKey( "value" ) ) { - Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ); + Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get().c_str(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ); if( policy == Toolkit::TableView::Fixed ) { (tableViewImpl.*funcFixed)( rowIndex, item.GetValue("value").Get() ); diff --git a/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp index 9f83898..77813e8 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp @@ -24,6 +24,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -493,7 +494,7 @@ ImageActor Decorator::CreateCursor( Image cursorImage, const Vector4& border, co } else { - cursor = ImageActor::New( Image::New( DEFAULT_CURSOR ) ); + cursor = ImageActor::New( ResourceImage::New( DEFAULT_CURSOR ) ); } cursor.SetStyle(ImageActor::STYLE_NINE_PATCH); @@ -506,7 +507,7 @@ ImageActor Decorator::CreateCursor( Image cursorImage, const Vector4& border, co 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 ); diff --git a/dali-toolkit/internal/controls/text-input/text-input-handles-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-handles-impl.cpp index c4d831b..aa5ca7d 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-handles-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-handles-impl.cpp @@ -24,6 +24,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -61,7 +62,8 @@ Actor CreateGrabArea( const std::string& name, const Vector3& relativeScale ) 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( 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; @@ -112,8 +114,8 @@ void TextInputHandles::CreateSelectionHandles() { 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; @@ -123,8 +125,8 @@ void TextInputHandles::CreateSelectionHandles() // 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; @@ -245,7 +247,7 @@ void TextInputHandles::CreateGrabHandle() { if ( !mGrabHandleImage ) { - mGrabHandleImage = Image::New( DEFAULT_GRAB_HANDLE ); + mGrabHandleImage = ResourceImage::New( DEFAULT_GRAB_HANDLE ); } mGrabHandle = CreateHandle( AnchorPoint::TOP_CENTER, mGrabHandleImage, "GrabHandle" ); diff --git a/dali-toolkit/internal/controls/text-input/text-input-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-impl.cpp index e891f5b..84f8fc2 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-impl.cpp @@ -30,6 +30,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -197,19 +198,28 @@ namespace Internal 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 ); } @@ -578,25 +588,29 @@ bool TextInput::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* 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 ); } @@ -3021,7 +3035,7 @@ void TextInput::CreateGrabHandle( Dali::Image image ) { if ( !image ) { - mGrabHandleImage = Image::New(DEFAULT_GRAB_HANDLE); + mGrabHandleImage = ResourceImage::New(DEFAULT_GRAB_HANDLE); } else { @@ -3047,7 +3061,8 @@ void TextInput::CreateGrabArea( Actor& parent ) 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( 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 ); @@ -3270,8 +3285,8 @@ void TextInput::CreateSelectionHandles( std::size_t start, std::size_t end, Dali 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"); @@ -3283,7 +3298,8 @@ void TextInput::CreateSelectionHandles( std::size_t start, std::size_t end, Dali mHandleOneGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move mHandleOneGrabArea.SetName("SelectionHandleOneGrabArea"); - mHandleOneGrabArea.ApplyConstraint( Constraint::New( 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 ); @@ -3298,8 +3314,8 @@ void TextInput::CreateSelectionHandles( std::size_t start, std::size_t end, Dali 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"); @@ -3310,7 +3326,8 @@ void TextInput::CreateSelectionHandles( std::size_t start, std::size_t end, Dali mHandleTwoGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move mHandleTwoGrabArea.SetName("SelectionHandleTwoGrabArea"); - mHandleTwoGrabArea.ApplyConstraint( Constraint::New( 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 ); diff --git a/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp index a133275..25480d0 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp @@ -18,6 +18,7 @@ // EXTERNAL INCLUDES #include #include +#include #include // INTERNAL INCLUDES @@ -100,9 +101,16 @@ namespace Toolkit 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. @@ -274,28 +282,28 @@ void TextInputPopup::CreateBackground() // 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( 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( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); + mBackgroundLine.SetSizeMode( SIZE_EQUAL_TO_PARENT ); mBackgroundLine.SetColor( mLineColor ); mBackgroundLine.SetZ( 0.1f ); mBackgroundEffect.Add( mBackgroundLine ); @@ -308,7 +316,7 @@ void TextInputPopup::CreateTail() { 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 ); @@ -316,20 +324,20 @@ void TextInputPopup::CreateTail() 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( 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( 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 ); @@ -389,37 +397,37 @@ void TextInputPopup::CreateOrderedListOfOptions() { 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; } @@ -854,9 +862,9 @@ void TextInputPopup::SetTailPosition( const Vector3& position, bool yAxisFlip ) 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 ); @@ -894,12 +902,12 @@ TextInputPopup::PressedSignalType& TextInputPopup::PressedSignal() return mPressedSignal; } -TextInputPopup::HideFinishedSignalType& TextInputPopup::HideFinishedSignal() +TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::HideFinishedSignal() { return mHideFinishedSignal; } -TextInputPopup::ShowFinishedSignalType& TextInputPopup::ShowFinishedSignal() +TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::ShowFinishedSignal() { return mShowFinishedSignal; } diff --git a/dali-toolkit/internal/controls/text-input/text-input-popup-impl.h b/dali-toolkit/internal/controls/text-input/text-input-popup-impl.h index c7f0fc2..2f9a91d 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-popup-impl.h +++ b/dali-toolkit/internal/controls/text-input/text-input-popup-impl.h @@ -79,19 +79,11 @@ public: 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. @@ -102,13 +94,13 @@ public: * 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: @@ -463,8 +455,8 @@ private: 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 }; diff --git a/dali-toolkit/internal/controls/text-input/text-input-popup-new-impl.h b/dali-toolkit/internal/controls/text-input/text-input-popup-new-impl.h index 29c79ea..92f6bad 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-popup-new-impl.h +++ b/dali-toolkit/internal/controls/text-input/text-input-popup-new-impl.h @@ -52,19 +52,11 @@ public: 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. @@ -75,13 +67,13 @@ public: * 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: @@ -261,9 +253,9 @@ private: 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 }; diff --git a/dali-toolkit/internal/controls/text-input/textview-character-positions-impl.h b/dali-toolkit/internal/controls/text-input/textview-character-positions-impl.h index b548fb8..3f754bf 100644 --- a/dali-toolkit/internal/controls/text-input/textview-character-positions-impl.h +++ b/dali-toolkit/internal/controls/text-input/textview-character-positions-impl.h @@ -20,8 +20,6 @@ // INTERNAL INCLUDES #include - -// EXTERNAL INCLUDES #include namespace Dali diff --git a/dali-toolkit/internal/controls/text-view/split-by-char-policies.cpp b/dali-toolkit/internal/controls/text-view/split-by-char-policies.cpp index 613b0a6..5eb829f 100644 --- a/dali-toolkit/internal/controls/text-view/split-by-char-policies.cpp +++ b/dali-toolkit/internal/controls/text-view/split-by-char-policies.cpp @@ -18,8 +18,10 @@ // FILE HEADER #include -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include + +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/internal/controls/text-view/text-view-impl.cpp b/dali-toolkit/internal/controls/text-view/text-view-impl.cpp index 01566d6..76d4539 100644 --- a/dali-toolkit/internal/controls/text-view/text-view-impl.cpp +++ b/dali-toolkit/internal/controls/text-view/text-view-impl.cpp @@ -55,6 +55,10 @@ namespace Internal 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"}; @@ -68,9 +72,9 @@ BaseHandle Create() 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 ); @@ -910,9 +914,9 @@ bool TextView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* 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 ); } diff --git a/dali-toolkit/internal/controls/text-view/text-view-processor-dbg.cpp b/dali-toolkit/internal/controls/text-view/text-view-processor-dbg.cpp index 713c681..df420cf 100644 --- a/dali-toolkit/internal/controls/text-view/text-view-processor-dbg.cpp +++ b/dali-toolkit/internal/controls/text-view/text-view-processor-dbg.cpp @@ -18,6 +18,9 @@ // FILE HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include diff --git a/dali-toolkit/internal/controls/view/view-impl.cpp b/dali-toolkit/internal/controls/view/view-impl.cpp index 6c374c0..9e4eb86 100644 --- a/dali-toolkit/internal/controls/view/view-impl.cpp +++ b/dali-toolkit/internal/controls/view/view-impl.cpp @@ -37,14 +37,18 @@ namespace Internal 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 ); } @@ -251,7 +255,7 @@ bool View::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* trac 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 ); } diff --git a/dali-toolkit/internal/filters/blur-two-pass-filter.cpp b/dali-toolkit/internal/filters/blur-two-pass-filter.cpp index 5ab09a1..5dd5437 100644 --- a/dali-toolkit/internal/filters/blur-two-pass-filter.cpp +++ b/dali-toolkit/internal/filters/blur-two-pass-filter.cpp @@ -146,7 +146,7 @@ void BlurTwoPassFilter::Enable() 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 ); @@ -155,7 +155,7 @@ void BlurTwoPassFilter::Enable() 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 ); diff --git a/dali-toolkit/internal/filters/emboss-filter.cpp b/dali-toolkit/internal/filters/emboss-filter.cpp index dee4a2e..8f444ac 100644 --- a/dali-toolkit/internal/filters/emboss-filter.cpp +++ b/dali-toolkit/internal/filters/emboss-filter.cpp @@ -125,8 +125,8 @@ void EmbossFilter::Enable() 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 ); diff --git a/dali-toolkit/internal/filters/spread-filter.cpp b/dali-toolkit/internal/filters/spread-filter.cpp index 3d911b9..3f3eaa6 100644 --- a/dali-toolkit/internal/filters/spread-filter.cpp +++ b/dali-toolkit/internal/filters/spread-filter.cpp @@ -100,7 +100,7 @@ void SpreadFilter::Enable() 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 ); diff --git a/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp index 986c475..0b48ecb 100644 --- a/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp @@ -25,11 +25,12 @@ #include #include #include +#include +#include // INTERNAL INCLUDES #include #include -#include namespace Dali { @@ -43,12 +44,18 @@ namespace Internal 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); @@ -658,7 +665,7 @@ void FocusManager::SetFocusable(Actor actor, bool focusable) 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 ); @@ -667,10 +674,7 @@ void FocusManager::CreateDefaultFocusIndicatorActor() focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f)); // Apply size constraint to the focus indicator - Constraint constraint = Constraint::New(Actor::SIZE, - ParentSource(Actor::SIZE), - EqualToConstraint()); - focusIndicator.ApplyConstraint(constraint); + focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT ); SetFocusIndicatorActor(focusIndicator); } @@ -971,17 +975,17 @@ bool FocusManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterfa Dali::BaseHandle handle( object ); bool connected( true ); - FocusManager* manager = dynamic_cast(object); + FocusManager* manager = dynamic_cast( 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 ); } diff --git a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp index 93e5feb..4e26bc7 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -26,13 +26,14 @@ #include #include #include +#include +#include // INTERNAL INCLUDES #include #include #include #include -#include namespace Dali { @@ -46,6 +47,13 @@ namespace Internal 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 @@ -72,8 +80,14 @@ BaseHandle Create() 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() @@ -458,7 +472,7 @@ Actor KeyboardFocusManager::GetFocusIndicatorActor() 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 ); @@ -467,10 +481,7 @@ void KeyboardFocusManager::CreateDefaultFocusIndicatorActor() focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f)); // Apply size constraint to the focus indicator - Constraint constraint = Constraint::New(Actor::SIZE, - ParentSource(Actor::SIZE), - EqualToConstraint()); - focusIndicator.ApplyConstraint(constraint); + focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT ); SetFocusIndicatorActor(focusIndicator); } @@ -720,21 +731,21 @@ bool KeyboardFocusManager::DoConnectSignal( BaseObject* object, ConnectionTracke Dali::BaseHandle handle( object ); bool connected( true ); - KeyboardFocusManager* manager = dynamic_cast(object); + KeyboardFocusManager* manager = dynamic_cast( 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 ); } diff --git a/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp index dc8cefa..5d7d4be 100644 --- a/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp @@ -35,6 +35,16 @@ namespace Toolkit 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 ) { @@ -220,12 +230,16 @@ bool KeyInputFocusManager::DoConnectSignal( BaseObject* object, ConnectionTracke Dali::BaseHandle handle( object ); bool connected( true ); - KeyInputFocusManager* manager = dynamic_cast(object); + KeyInputFocusManager* manager = dynamic_cast( 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 diff --git a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp index 42c121d..1d35050 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp +++ b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include #include namespace Dali @@ -32,6 +33,19 @@ namespace Toolkit 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 ); @@ -179,19 +193,21 @@ void CubeTransitionEffect::SetTargetImage( ImageActor imageActor ) 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 ); } } @@ -299,12 +315,21 @@ void CubeTransitionEffect::StopTransition() } } -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); @@ -325,9 +350,9 @@ void CubeTransitionEffect::OnImageLoaded(Image image) mTiles[mContainerIndex][idx].SetPixelArea( pixelArea ); } } - mIsImageLoading = false; } + void CubeTransitionEffect::OnTransitionFinished(Animation& source) { mRoot.SetVisible(false); @@ -345,6 +370,26 @@ Toolkit::CubeTransitionEffect::TransitionCompletedSignalType& CubeTransitionEffe 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 diff --git a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h index 8e7b983..57fd205 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h +++ b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h @@ -25,6 +25,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -209,6 +210,17 @@ public: //Signal */ 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: /** @@ -249,7 +261,13 @@ private: * 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 diff --git a/dali-toolkit/public-api/builder/json-parser.cpp b/dali-toolkit/public-api/builder/json-parser.cpp index 70aea59..acffb9d 100644 --- a/dali-toolkit/public-api/builder/json-parser.cpp +++ b/dali-toolkit/public-api/builder/json-parser.cpp @@ -18,6 +18,7 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/public-api/builder/json-parser.h b/dali-toolkit/public-api/builder/json-parser.h index 7f47be3..8abbe6a 100644 --- a/dali-toolkit/public-api/builder/json-parser.h +++ b/dali-toolkit/public-api/builder/json-parser.h @@ -18,6 +18,7 @@ * */ +// EXTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/public-api/builder/tree-node.h b/dali-toolkit/public-api/builder/tree-node.h index 210cb77..710e0d8 100644 --- a/dali-toolkit/public-api/builder/tree-node.h +++ b/dali-toolkit/public-api/builder/tree-node.h @@ -18,6 +18,7 @@ * */ +// EXTERNAL INCLUDES #include // pair #include #include diff --git a/dali-toolkit/public-api/controls/alignment/alignment.cpp b/dali-toolkit/public-api/controls/alignment/alignment.cpp index fe0e9b8..99566dc 100644 --- a/dali-toolkit/public-api/controls/alignment/alignment.cpp +++ b/dali-toolkit/public-api/controls/alignment/alignment.cpp @@ -16,14 +16,12 @@ */ // CLASS HEADER - #include // EXTERNAL INCLUDES +#include // INTERNAL INCLUDES - -#include #include namespace Dali diff --git a/dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.cpp b/dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.cpp index f867d01..62389fa 100644 --- a/dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.cpp +++ b/dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.cpp @@ -15,9 +15,10 @@ * */ +// CLASS HEADER #include -//INTERNAL INCLUDES +// INTERNAL INCLUDES #include diff --git a/dali-toolkit/public-api/controls/buttons/button.cpp b/dali-toolkit/public-api/controls/buttons/button.cpp index 3b251da..ab953bf 100644 --- a/dali-toolkit/public-api/controls/buttons/button.cpp +++ b/dali-toolkit/public-api/controls/buttons/button.cpp @@ -29,13 +29,6 @@ namespace Dali 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() {} diff --git a/dali-toolkit/public-api/controls/buttons/button.h b/dali-toolkit/public-api/controls/buttons/button.h index 2078413..0a2780a 100644 --- a/dali-toolkit/public-api/controls/buttons/button.h +++ b/dali-toolkit/public-api/controls/buttons/button.h @@ -41,20 +41,24 @@ class 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 diff --git a/dali-toolkit/public-api/controls/cluster/cluster-style.cpp b/dali-toolkit/public-api/controls/cluster/cluster-style.cpp index bdeac18..6ef28a6 100644 --- a/dali-toolkit/public-api/controls/cluster/cluster-style.cpp +++ b/dali-toolkit/public-api/controls/cluster/cluster-style.cpp @@ -15,7 +15,10 @@ * */ +// CLASS HEADER #include + +// INTERNAL INCLUDES #include using namespace Dali; diff --git a/dali-toolkit/public-api/controls/cluster/cluster.cpp b/dali-toolkit/public-api/controls/cluster/cluster.cpp index 742ad51..aab2765 100644 --- a/dali-toolkit/public-api/controls/cluster/cluster.cpp +++ b/dali-toolkit/public-api/controls/cluster/cluster.cpp @@ -35,10 +35,6 @@ namespace Toolkit 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() { } diff --git a/dali-toolkit/public-api/controls/cluster/cluster.h b/dali-toolkit/public-api/controls/cluster/cluster.h index 6e7033c..f8c845a 100644 --- a/dali-toolkit/public-api/controls/cluster/cluster.h +++ b/dali-toolkit/public-api/controls/cluster/cluster.h @@ -35,7 +35,14 @@ class 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 { @@ -45,11 +52,6 @@ public: 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: /** diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index e6ba7db..f686766 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -53,6 +53,18 @@ const Property::Index Control::PROPERTY_KEY_INPUT_FOCUS = Internal::Contro 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 }, @@ -80,13 +92,13 @@ TypeRegistration CONTROL_TYPE( typeid(Control), typeid(CustomActor), Create ); // 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 @@ -352,13 +364,13 @@ public: 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; } @@ -1001,7 +1013,7 @@ bool Control::DoAction(BaseObject* object, const std::string& actionName, const { 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 ) @@ -1019,32 +1031,32 @@ bool Control::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* t 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 ); diff --git a/dali-toolkit/public-api/controls/control-impl.h b/dali-toolkit/public-api/controls/control-impl.h index 8a5c7e0..8133b26 100644 --- a/dali-toolkit/public-api/controls/control-impl.h +++ b/dali-toolkit/public-api/controls/control-impl.h @@ -477,7 +477,7 @@ private: 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. */ diff --git a/dali-toolkit/public-api/controls/control.cpp b/dali-toolkit/public-api/controls/control.cpp index 77cb876..b987ade 100644 --- a/dali-toolkit/public-api/controls/control.cpp +++ b/dali-toolkit/public-api/controls/control.cpp @@ -15,7 +15,10 @@ * */ +// CLASS HEADER #include + +// INTERNAL INCLUDES #include namespace Dali @@ -24,14 +27,6 @@ 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(); diff --git a/dali-toolkit/public-api/controls/control.h b/dali-toolkit/public-api/controls/control.h index 1911030..01c1c75 100644 --- a/dali-toolkit/public-api/controls/control.h +++ b/dali-toolkit/public-api/controls/control.h @@ -46,6 +46,20 @@ class Control; * * 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 { @@ -62,20 +76,6 @@ public: 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. */ diff --git a/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp b/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp index 5715e49..d803317 100644 --- a/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp +++ b/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp @@ -15,10 +15,12 @@ * */ +// CLASS HEADER #include "check-button-factory.h" // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -44,7 +46,7 @@ Alignment CreateAlignedImage( Actor image ) Alignment CreateAlignedImage( const std::string& imagePath ) { - Image image = Image::New( imagePath ); + Image image = ResourceImage::New( imagePath ); return CreateAlignedImage( ImageActor::New( image ) ); } diff --git a/dali-toolkit/public-api/controls/default-controls/push-button-factory.cpp b/dali-toolkit/public-api/controls/default-controls/push-button-factory.cpp index 43bde47..bba811b 100644 --- a/dali-toolkit/public-api/controls/default-controls/push-button-factory.cpp +++ b/dali-toolkit/public-api/controls/default-controls/push-button-factory.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -45,7 +46,7 @@ Alignment CreateAlignedImage( Actor image ) Alignment CreateAlignedImage( const std::string& imagePath ) { - Image image = Image::New( imagePath ); + Image image = ResourceImage::New( imagePath ); return CreateAlignedImage( ImageActor::New( image ) ); } diff --git a/dali-toolkit/public-api/controls/default-controls/solid-color-actor.cpp b/dali-toolkit/public-api/controls/default-controls/solid-color-actor.cpp index 5e1b62b..d122d48 100644 --- a/dali-toolkit/public-api/controls/default-controls/solid-color-actor.cpp +++ b/dali-toolkit/public-api/controls/default-controls/solid-color-actor.cpp @@ -16,11 +16,11 @@ */ // EXTERNAL INCLUDES +#include // INTERNAL INCLUDES - #include -#include + namespace Dali { diff --git a/dali-toolkit/public-api/controls/default-controls/solid-color-actor.h b/dali-toolkit/public-api/controls/default-controls/solid-color-actor.h index 8e307ce..1949a60 100644 --- a/dali-toolkit/public-api/controls/default-controls/solid-color-actor.h +++ b/dali-toolkit/public-api/controls/default-controls/solid-color-actor.h @@ -18,7 +18,7 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include #include diff --git a/dali-toolkit/public-api/controls/effects-view/effects-view.cpp b/dali-toolkit/public-api/controls/effects-view/effects-view.cpp index ad44243..1925c62 100644 --- a/dali-toolkit/public-api/controls/effects-view/effects-view.cpp +++ b/dali-toolkit/public-api/controls/effects-view/effects-view.cpp @@ -15,8 +15,6 @@ * */ -// EXTERNAL INCLUDES - // CLASS HEADER #include diff --git a/dali-toolkit/public-api/controls/magnifier/magnifier.cpp b/dali-toolkit/public-api/controls/magnifier/magnifier.cpp index 81542f0..6a18f78 100644 --- a/dali-toolkit/public-api/controls/magnifier/magnifier.cpp +++ b/dali-toolkit/public-api/controls/magnifier/magnifier.cpp @@ -15,6 +15,7 @@ * */ +// INTERNAL INCLUDES #include #include diff --git a/dali-toolkit/public-api/controls/navigation-frame/navigation-control.cpp b/dali-toolkit/public-api/controls/navigation-frame/navigation-control.cpp index 821737d..a1d8513 100644 --- a/dali-toolkit/public-api/controls/navigation-frame/navigation-control.cpp +++ b/dali-toolkit/public-api/controls/navigation-frame/navigation-control.cpp @@ -29,9 +29,6 @@ namespace Dali namespace Toolkit { -const char* const NavigationControl::ACTION_PUSH = "push"; -const char* const NavigationControl::ACTION_POP = "pop"; - NavigationControl::NavigationControl() { } diff --git a/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h b/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h index 7ebaf8d..ffc7a44 100644 --- a/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h +++ b/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h @@ -73,17 +73,17 @@ class 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(). diff --git a/dali-toolkit/public-api/controls/page-turn-view/page-factory.cpp b/dali-toolkit/public-api/controls/page-turn-view/page-factory.cpp index 8bde850..60bfce9 100644 --- a/dali-toolkit/public-api/controls/page-turn-view/page-factory.cpp +++ b/dali-toolkit/public-api/controls/page-turn-view/page-factory.cpp @@ -15,6 +15,7 @@ * */ +// CLASS HEADER #include namespace Dali diff --git a/dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h b/dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h index 0c4d0b0..4d6c877 100644 --- a/dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h +++ b/dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h @@ -18,7 +18,7 @@ * */ -//INTERNAL INCLUDES +// INTERNAL INCLUDES #include namespace Dali diff --git a/dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h b/dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h index 7df18f0..124913f 100644 --- a/dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h +++ b/dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h @@ -18,7 +18,7 @@ * */ -//INTERNAL INCLUDES +// INTERNAL INCLUDES #include namespace Dali diff --git a/dali-toolkit/public-api/controls/page-turn-view/page-turn-view.cpp b/dali-toolkit/public-api/controls/page-turn-view/page-turn-view.cpp index 9d60a19..c2c44a5 100644 --- a/dali-toolkit/public-api/controls/page-turn-view/page-turn-view.cpp +++ b/dali-toolkit/public-api/controls/page-turn-view/page-turn-view.cpp @@ -15,7 +15,10 @@ * */ +// CLASS HEADER #include + +// INTERNAL INCLUDES #include using namespace Dali; diff --git a/dali-toolkit/public-api/controls/popup/popup.cpp b/dali-toolkit/public-api/controls/popup/popup.cpp index d3a8187..8e393c7 100644 --- a/dali-toolkit/public-api/controls/popup/popup.cpp +++ b/dali-toolkit/public-api/controls/popup/popup.cpp @@ -15,7 +15,10 @@ * */ +// CLASS HEADER #include + +// INTERNAL INCLUDES #include #include @@ -31,9 +34,6 @@ namespace Toolkit // Popup /////////////////////////////////////////////////////////////////////////////////////////////////// -const char* const Popup::SIGNAL_TOUCHED_OUTSIDE = "touched-outside"; -const char* const Popup::SIGNAL_HIDDEN = "hidden"; - Popup::Popup() { } diff --git a/dali-toolkit/public-api/controls/popup/popup.h b/dali-toolkit/public-api/controls/popup/popup.h index 0c876a2..040cb08 100644 --- a/dali-toolkit/public-api/controls/popup/popup.h +++ b/dali-toolkit/public-api/controls/popup/popup.h @@ -62,16 +62,18 @@ class Button; * * 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. */ diff --git a/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.cpp b/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.cpp index 367e7e4..8475482 100755 --- a/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.cpp +++ b/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.cpp @@ -15,7 +15,10 @@ * */ +// CLASS HEADER #include + +// INTERNAL INCLUDES #include namespace Dali @@ -24,8 +27,6 @@ namespace Dali namespace Toolkit { -const char* const ScrollBar::SCROLL_POSITION_NOTIFIED_SIGNAL_NAME = "scroll-position-notified"; - ScrollBar::ScrollBar() { } diff --git a/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h b/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h index 734bd7c..f246c93 100755 --- a/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h +++ b/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h @@ -43,13 +43,17 @@ class 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 diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp index c89dfab..8650774 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp +++ b/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp @@ -32,9 +32,6 @@ const char* const ScrollConnector::OVERSHOOT_PROPERTY_NAME = "overshoot"; 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() ); diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-connector.h b/dali-toolkit/public-api/controls/scrollable/scroll-connector.h index 578756c..8cd78b7 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-connector.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-connector.h @@ -50,6 +50,12 @@ class ScrollConnector; * 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 { @@ -62,10 +68,7 @@ public: 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; /** diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp index 4bf5e2a..e474d3b 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp @@ -307,8 +307,6 @@ const float ScrollView::DEFAULT_FRICTION_COEFFICIENT(1.0f); 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() { } diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h index b357900..1dcfb85 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h @@ -376,6 +376,11 @@ class 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 { @@ -409,9 +414,6 @@ public: 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 { diff --git a/dali-toolkit/public-api/controls/scrollable/scrollable.cpp b/dali-toolkit/public-api/controls/scrollable/scrollable.cpp index 0c7ec06..21f9615 100644 --- a/dali-toolkit/public-api/controls/scrollable/scrollable.cpp +++ b/dali-toolkit/public-api/controls/scrollable/scrollable.cpp @@ -31,11 +31,6 @@ const std::string Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME( "scroll-positio 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() { } diff --git a/dali-toolkit/public-api/controls/scrollable/scrollable.h b/dali-toolkit/public-api/controls/scrollable/scrollable.h index 907f7a1..0e34526 100644 --- a/dali-toolkit/public-api/controls/scrollable/scrollable.h +++ b/dali-toolkit/public-api/controls/scrollable/scrollable.h @@ -66,6 +66,14 @@ struct ClampState3 * (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 { @@ -104,14 +112,6 @@ public: 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 diff --git a/dali-toolkit/public-api/controls/slider/slider.cpp b/dali-toolkit/public-api/controls/slider/slider.cpp index 4e12873..f26a05e 100644 --- a/dali-toolkit/public-api/controls/slider/slider.cpp +++ b/dali-toolkit/public-api/controls/slider/slider.cpp @@ -30,10 +30,6 @@ namespace Toolkit // Slider /////////////////////////////////////////////////////////////////////////////////////////////////// -// Signals -const char* const Slider::SIGNAL_VALUE_CHANGED = "value-changed"; -const char* const Slider::SIGNAL_MARK = "mark"; - Slider::Slider() { } diff --git a/dali-toolkit/public-api/controls/slider/slider.h b/dali-toolkit/public-api/controls/slider/slider.h index 1a382bd..df0ac20 100644 --- a/dali-toolkit/public-api/controls/slider/slider.h +++ b/dali-toolkit/public-api/controls/slider/slider.h @@ -34,15 +34,17 @@ class 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 diff --git a/dali-toolkit/public-api/controls/text-input/text-input.cpp b/dali-toolkit/public-api/controls/text-input/text-input.cpp index d888a2b..f0a43e3 100644 --- a/dali-toolkit/public-api/controls/text-input/text-input.cpp +++ b/dali-toolkit/public-api/controls/text-input/text-input.cpp @@ -35,13 +35,6 @@ namespace Dali 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() { } diff --git a/dali-toolkit/public-api/controls/text-input/text-input.h b/dali-toolkit/public-api/controls/text-input/text-input.h index f8202db..b20467f 100644 --- a/dali-toolkit/public-api/controls/text-input/text-input.h +++ b/dali-toolkit/public-api/controls/text-input/text-input.h @@ -60,17 +60,6 @@ public: 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: diff --git a/dali-toolkit/public-api/controls/text-view/text-view.cpp b/dali-toolkit/public-api/controls/text-view/text-view.cpp index 36d7ec3..85620de 100644 --- a/dali-toolkit/public-api/controls/text-view/text-view.cpp +++ b/dali-toolkit/public-api/controls/text-view/text-view.cpp @@ -27,9 +27,6 @@ namespace Dali namespace Toolkit { - -const char* const TextView::SIGNAL_TEXT_SCROLLED = "scrolled"; - TextView::CharacterLayoutInfo::CharacterLayoutInfo() : mSize(), mPosition(), diff --git a/dali-toolkit/public-api/controls/text-view/text-view.h b/dali-toolkit/public-api/controls/text-view/text-view.h index 34dbe35..46c1118 100644 --- a/dali-toolkit/public-api/controls/text-view/text-view.h +++ b/dali-toolkit/public-api/controls/text-view/text-view.h @@ -42,14 +42,16 @@ class TextView; * 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 diff --git a/dali-toolkit/public-api/controls/view/view.cpp b/dali-toolkit/public-api/controls/view/view.cpp index 4f3ce8b..277e975 100644 --- a/dali-toolkit/public-api/controls/view/view.cpp +++ b/dali-toolkit/public-api/controls/view/view.cpp @@ -31,8 +31,6 @@ namespace Dali namespace Toolkit { -const char* const View::SIGNAL_ORIENTATION_ANIMATION_START = "orientation-animation-start"; - View::View() { } diff --git a/dali-toolkit/public-api/controls/view/view.h b/dali-toolkit/public-api/controls/view/view.h index bb31adc..5138266 100644 --- a/dali-toolkit/public-api/controls/view/view.h +++ b/dali-toolkit/public-api/controls/view/view.h @@ -72,12 +72,15 @@ class 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: diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index f139b8d..1392db1 100644 --- a/dali-toolkit/public-api/dali-toolkit-version.cpp +++ b/dali-toolkit/public-api/dali-toolkit-version.cpp @@ -31,7 +31,7 @@ namespace Toolkit 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 diff --git a/dali-toolkit/public-api/file.list b/dali-toolkit/public-api/file.list index 1b9307a..85a3702 100755 --- a/dali-toolkit/public-api/file.list +++ b/dali-toolkit/public-api/file.list @@ -85,6 +85,7 @@ public_api_src_files = \ $(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 \ @@ -250,6 +251,7 @@ public_api_shader_effects_header_files = \ $(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 \ diff --git a/dali-toolkit/public-api/focus-manager/focus-manager.cpp b/dali-toolkit/public-api/focus-manager/focus-manager.cpp index 1bd721a..a480129 100644 --- a/dali-toolkit/public-api/focus-manager/focus-manager.cpp +++ b/dali-toolkit/public-api/focus-manager/focus-manager.cpp @@ -30,10 +30,6 @@ namespace Dali 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() { } diff --git a/dali-toolkit/public-api/focus-manager/focus-manager.h b/dali-toolkit/public-api/focus-manager/focus-manager.h index 3d15023..67a359c 100644 --- a/dali-toolkit/public-api/focus-manager/focus-manager.h +++ b/dali-toolkit/public-api/focus-manager/focus-manager.h @@ -43,15 +43,17 @@ class 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. diff --git a/dali-toolkit/public-api/focus-manager/keyboard-focus-manager.cpp b/dali-toolkit/public-api/focus-manager/keyboard-focus-manager.cpp index b47228d..45d0fbf 100644 --- a/dali-toolkit/public-api/focus-manager/keyboard-focus-manager.cpp +++ b/dali-toolkit/public-api/focus-manager/keyboard-focus-manager.cpp @@ -31,11 +31,6 @@ namespace Dali 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() { } diff --git a/dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h b/dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h index 3822fc6..a1e51f5 100644 --- a/dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h +++ b/dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h @@ -40,15 +40,17 @@ class 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: diff --git a/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp b/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp index 91b79e8..ca6a3d0 100644 --- a/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp +++ b/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp @@ -30,9 +30,6 @@ namespace Dali 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() { } diff --git a/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h b/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h index 85fa87c..07c8aa4 100644 --- a/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h +++ b/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h @@ -39,13 +39,16 @@ class 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; diff --git a/dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.cpp b/dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.cpp index d335d37..9752e3b 100644 --- a/dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.cpp @@ -52,7 +52,7 @@ BubbleEffect::~BubbleEffect() { } -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"; @@ -60,8 +60,6 @@ BubbleEffect BubbleEffect::New( unsigned int numberOfBubble, const std::string& " 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" @@ -118,9 +116,7 @@ BubbleEffect BubbleEffect::New( unsigned int numberOfBubble, const std::string& " 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" @@ -157,10 +153,6 @@ BubbleEffect BubbleEffect::New( unsigned int numberOfBubble, const std::string& 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 +#include namespace Dali { @@ -83,7 +84,7 @@ static void DoApply( ImageActor actor, const std::string& maskImage, const Vecto 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( maskEffect.GetPropertyIndex("uImageSize"), @@ -101,7 +102,7 @@ static void DoApply( ImageActor actor, const std::string& maskImage, const Vecto 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; @@ -111,7 +112,7 @@ void Apply( ImageActor actor, const std::string& maskImage ) 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 ); } diff --git a/dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp b/dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp new file mode 100644 index 0000000..7c8965c --- /dev/null +++ b/dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp @@ -0,0 +1,163 @@ +/* + * 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 + +//EXTERNAL HEADERS +#include + +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< + +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__ diff --git a/dali-toolkit/public-api/transition-effects/cube-transition-effect.cpp b/dali-toolkit/public-api/transition-effects/cube-transition-effect.cpp index 363cf58..aec216f 100644 --- a/dali-toolkit/public-api/transition-effects/cube-transition-effect.cpp +++ b/dali-toolkit/public-api/transition-effects/cube-transition-effect.cpp @@ -27,8 +27,6 @@ namespace Dali namespace Toolkit { -const char* const CubeTransitionEffect::SIGNAL_TRANSITION_COMPLETED = "transition-completed"; - CubeTransitionEffect::CubeTransitionEffect() { } @@ -42,6 +40,11 @@ CubeTransitionEffect::CubeTransitionEffect(Internal::CubeTransitionEffect* impl) { } +CubeTransitionEffect CubeTransitionEffect::DownCast( BaseHandle handle ) +{ + return CubeTransitionEffect( dynamic_cast< Dali::Toolkit::Internal::CubeTransitionEffect* >( handle.GetObjectPtr() ) ); +} + void CubeTransitionEffect::SetTransitionDuration( float duration ) { GetImpl(*this).SetTransitionDuration( duration ); diff --git a/dali-toolkit/public-api/transition-effects/cube-transition-effect.h b/dali-toolkit/public-api/transition-effects/cube-transition-effect.h index e57f4bd..e640296 100644 --- a/dali-toolkit/public-api/transition-effects/cube-transition-effect.h +++ b/dali-toolkit/public-api/transition-effects/cube-transition-effect.h @@ -73,6 +73,11 @@ class CubeTransitionEffect; * cubeEffect.StartTransition( ); * * @endcode + * + * Signals + * | %Signal Name | Method | + * |----------------------|----------------------------------| + * | transition-completed | @ref TransitionCompletedSignal() | */ class DALI_IMPORT_API CubeTransitionEffect : public BaseHandle { @@ -90,6 +95,17 @@ public: ~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 */ @@ -174,9 +190,6 @@ public: public: //Signal - //signal name - static const char* const SIGNAL_TRANSITION_COMPLETED; - //Transition animation completed signal typedef Signal< void ( CubeTransitionEffect, ImageActor ) > TransitionCompletedSignalType; diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index 225e80d..0ec7f8a 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ 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 @@ -52,7 +52,7 @@ Application development package for the OpenGLES Canvas toolkit - headers and pa %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