SET(RESOURCE_DIR ${ROOT_SRC_DIR}/resources)
SET(LOCAL_IMAGES_DIR ${RESOURCE_DIR}/images)
+SET(LOCAL_VIDEOS_DIR ${RESOURCE_DIR}/videos)
SET(LOCAL_MODELS_DIR ${RESOURCE_DIR}/models)
SET(LOCAL_SCRIPTS_DIR ${RESOURCE_DIR}/scripts)
IF(NOT DEFINED LOCAL_STYLE_DIR)
ENDIF()
SET(IMAGES_DIR ${APP_DATA_DIR}/images/)
+SET(VIDEOS_DIR ${APP_DATA_DIR}/videos/)
SET(MODELS_DIR ${APP_DATA_DIR}/models/)
SET(SCRIPTS_DIR ${APP_DATA_DIR}/scripts/)
SET(STYLE_DIR ${APP_DATA_DIR}/style/)
ENDIF()
SET(DEMO_IMAGE_DIR \\"${IMAGES_DIR}\\")
+SET(DEMO_VIDEO_DIR \\"${VIDEOS_DIR}\\")
SET(DEMO_MODEL_DIR \\"${MODELS_DIR}\\")
SET(DEMO_SCRIPT_DIR \\"${SCRIPTS_DIR}\\")
SET(DEMO_STYLE_DIR \\"${STYLE_DIR}\\")
INSTALL(FILES ${LOCAL_IMAGES_DIR}/${flag} DESTINATION ${IMAGES_DIR})
ENDFOREACH(flag)
+FILE(GLOB LOCAL_VIDEOS_LIST RELATIVE "${LOCAL_VIDEOS_DIR}" "${LOCAL_VIDEOS_DIR}/*")
+FOREACH(flag ${LOCAL_VIDEOS_LIST})
+ INSTALL(FILES ${LOCAL_VIDEOS_DIR}/${flag} DESTINATION ${VIDEOS_DIR})
+ENDFOREACH(flag)
+
FILE(GLOB LOCAL_MODELS_LIST RELATIVE "${LOCAL_MODELS_DIR}" "${LOCAL_MODELS_DIR}/*")
FOREACH(flag ${LOCAL_MODELS_LIST})
INSTALL(FILES ${LOCAL_MODELS_DIR}/${flag} DESTINATION ${MODELS_DIR})
SET(PKG_LIST dali-core
dali-adaptor
- dali-toolkit)
+ dali-toolkit )
INCLUDE(FindPkgConfig)
pkg_check_modules(REQUIRED_PKGS REQUIRED ${PKG_LIST})
SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(DALI_DEMO_CFLAGS "-DDEMO_IMAGE_DIR=${DEMO_IMAGE_DIR} -DDEMO_MODEL_DIR=${DEMO_MODEL_DIR} -DDEMO_SCRIPT_DIR=${DEMO_SCRIPT_DIR} -DDEMO_THEME_PATH=${DEMO_THEME_PATH} -DDEMO_EXAMPLE_BIN=${DEMO_EXAMPLE_BIN} -DDEMO_LOCALE_DIR=${DEMO_LOCALE_DIR} -fvisibility=hidden -DHIDE_DALI_INTERNALS -DDEMO_LANG=${DEMO_LANG}")
+SET(DALI_DEMO_CFLAGS "-DDEMO_IMAGE_DIR=${DEMO_IMAGE_DIR} -DDEMO_VIDEO_DIR=${DEMO_VIDEO_DIR} -DDEMO_MODEL_DIR=${DEMO_MODEL_DIR} -DDEMO_SCRIPT_DIR=${DEMO_SCRIPT_DIR} -DDEMO_THEME_PATH=${DEMO_THEME_PATH} -DDEMO_EXAMPLE_BIN=${DEMO_EXAMPLE_BIN} -DDEMO_LOCALE_DIR=${DEMO_LOCALE_DIR} -fvisibility=hidden -DHIDE_DALI_INTERNALS -DDEMO_LANG=${DEMO_LANG}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${REQUIRED_CFLAGS} ${DALI_DEMO_CFLAGS} -Werror -Wall -fPIE")
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
<ui-application appid="flex-container.example" exec="/usr/apps/com.samsung.dali-demo/bin/flex-container.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
<label>Flex Container</label>
</ui-application>
+ <ui-application appid="text-editor.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-editor.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+ <label>Text Editor</label>
+ </ui-application>
+ <ui-application appid="video-view.example" exec="/usr/apps/com.samsung.dali-demo/bin/video-view.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+ <label>Video View</label>
+ </ui-application>
</manifest>
demo.AddExample(Example("text-label-multi-language.example", DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE));
demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT));
demo.AddExample(Example("text-scrolling.example", DALI_DEMO_STR_TITLE_TEXT_SCROLLING));
+ demo.AddExample(Example("text-editor.example", DALI_DEMO_STR_TITLE_TEXT_EDITOR));
demo.AddExample(Example("size-negotiation.example", DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE));
demo.AddExample(Example("popup.example", DALI_DEMO_STR_TITLE_POPUP));
demo.AddExample(Example("buttons.example", DALI_DEMO_STR_TITLE_BUTTONS));
mScrollView.SetAxisAutoLock( true );
mScrollView.ScrollCompletedSignal().Connect( this, &DaliTableView::OnScrollComplete );
mScrollView.ScrollStartedSignal().Connect( this, &DaliTableView::OnScrollStart );
- mScrollView.TouchedSignal().Connect( this, &DaliTableView::OnScrollTouched );
+ mScrollView.TouchSignal().Connect( this, &DaliTableView::OnScrollTouched );
mScrollViewLayer = Layer::New();
content.SetKeyboardFocusable(true);
// connect to the touch events
- content.TouchedSignal().Connect( this, &DaliTableView::OnTilePressed );
+ content.TouchSignal().Connect( this, &DaliTableView::OnTilePressed );
content.HoveredSignal().Connect( this, &DaliTableView::OnTileHovered );
return content;
return stencil;
}
-bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event )
+bool DaliTableView::OnTilePressed( Actor actor, const TouchData& event )
+{
+ return DoTilePress( actor, event.GetState( 0 ) );
+}
+
+bool DaliTableView::DoTilePress( Actor actor, PointState::Type pointState )
{
bool consumed = false;
- const TouchPoint& point = event.GetPoint( 0 );
- if( TouchPoint::Down == point.state )
+ if( PointState::DOWN == pointState )
{
mPressedActor = actor;
consumed = true;
// A button press is only valid if the Down & Up events
// both occurred within the button.
- if( ( TouchPoint::Up == point.state ) &&
+ if( ( PointState::UP == pointState ) &&
( mPressedActor == actor ) )
{
// ignore Example button presses when scrolling or button animating.
accessibilityManager.SetCurrentFocusActor(mPages[mScrollView.GetCurrentPage()].GetChildAt(0) );
}
-bool DaliTableView::OnScrollTouched( Actor actor, const TouchEvent& event )
+bool DaliTableView::OnScrollTouched( Actor actor, const TouchData& event )
{
- const TouchPoint& point = event.GetPoint( 0 );
- if( TouchPoint::Down == point.state )
+ if( PointState::DOWN == event.GetState( 0 ) )
{
mPressedActor = actor;
}
mPressedActor = activatedActor;
// Activate the current focused actor;
- TouchEvent touchEventUp;
- touchEventUp.points.push_back( TouchPoint ( 0, TouchPoint::Up, 0.0f, 0.0f ) );
- OnTilePressed(mPressedActor, touchEventUp);
+ DoTilePress( mPressedActor, PointState::UP );
}
}
*
* @return Consume flag
*/
- bool OnTilePressed( Dali::Actor actor, const Dali::TouchEvent& event );
+ bool OnTilePressed( Dali::Actor actor, const Dali::TouchData& event );
+
+ /**
+ * Called by OnTilePressed & Accessibility to do the appropriate action.
+ *
+ * @param[in] actor The Actor representing this tile.
+ * @param[in] state The Touch state
+ *
+ * @return Consume flag
+ */
+ bool DoTilePress( Dali::Actor actor, Dali::PointState::Type state );
/**
* Signal emitted when any tile has been hovered
*
* @return Consume flag
*/
- bool OnScrollTouched( Dali::Actor actor, const Dali::TouchEvent& event );
+ bool OnScrollTouched( Dali::Actor actor, const Dali::TouchData& event );
/**
* Setup the effect on the scroll view
return imageData;
}
- PixelDataPtr CreatePixelData( const Vector3& color, const unsigned int width, const unsigned int height )
+ PixelData CreatePixelData( const Vector3& color, const unsigned int width, const unsigned int height )
{
unsigned int size = width*height;
unsigned char* pixels = new unsigned char [size*3u];
mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &Benchmark::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &Benchmark::OnTouch );
if( gUseMesh )
{
ShowAnimation();
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
mPaddle.SetPosition( stageSize * Vector3( PADDLE_START_POSITION ) );
mContentLayer.Add(mPaddle);
- mPaddle.TouchedSignal().Connect(this, &ExampleController::OnTouchPaddle);
- mContentLayer.TouchedSignal().Connect(this, &ExampleController::OnTouchLayer);
+ mPaddle.TouchSignal().Connect(this, &ExampleController::OnTouchPaddle);
+ mContentLayer.TouchSignal().Connect(this, &ExampleController::OnTouchLayer);
const float margin(BALL_SIZE.width * stageSize.width * 0.5f);
* @param[in] actor The actor touched
* @param[in] event The touch event
*/
- bool OnTouchPaddle(Actor actor, const TouchEvent& event)
+ bool OnTouchPaddle(Actor actor, const TouchData& event)
{
if(event.GetPointCount()>0)
{
- const TouchPoint& point = event.GetPoint(0);
- if(point.state==TouchPoint::Down) // Commence dragging
+ if( event.GetState( 0 ) == PointState::DOWN ) // Commence dragging
{
// Get point where user touched paddle (relative to paddle's center)
- mRelativeDragPoint = Vector3(point.screen.x, point.screen.y, 0.0f);
+ Vector2 screenPoint = event.GetScreenPosition( 0 );
+ mRelativeDragPoint = screenPoint;
mRelativeDragPoint -= actor.GetCurrentPosition();
mDragActor = actor;
* @param[in] actor The actor touched
* @param[in] event The touch event
*/
- bool OnTouchLayer(Actor actor, const TouchEvent& event)
+ bool OnTouchLayer(Actor actor, const TouchData& event)
{
if(event.GetPointCount()>0)
{
- const TouchPoint& point = event.GetPoint(0);
if(mDragActor)
{
- Vector3 position(point.screen.x, point.screen.y, 0.0f);
+ Vector3 position( event.GetScreenPosition( 0 ) );
mPaddle.SetPosition( position - mRelativeDragPoint );
- if(point.state==TouchPoint::Up) // Stop dragging
+ if( event.GetState( 0 ) == PointState::UP ) // Stop dragging
{
mDragAnimation = Animation::New(0.25f);
mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3(1.0f, 1.0f, 1.0f), AlphaFunction::EASE_IN);
mTimerForBubbleEmission.TickSignal().Connect(this, &BubbleEffectExample::OnTimerTick);
// Connect the callback to the touch signal on the background
- mBackground.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch );
+ mBackground.TouchSignal().Connect( this, &BubbleEffectExample::OnTouch );
}
}
// Callback function of the touch signal on the background
- bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event)
+ bool OnTouch(Dali::Actor actor, const Dali::TouchData& event)
{
- const TouchPoint &point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
- mCurrentTouchPosition = point.screen;
- mEmitPosition = point.screen;
+ mCurrentTouchPosition = mEmitPosition = event.GetScreenPosition( 0 );
mTimerForBubbleEmission.Start();
mNonMovementCount = 0;
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
- Vector2 displacement = point.screen - mCurrentTouchPosition;
- mCurrentTouchPosition = point.screen;
+ Vector2 displacement = event.GetScreenPosition( 0 ) - mCurrentTouchPosition;
+ mCurrentTouchPosition = event.GetScreenPosition( 0 );
//emit multiple bubbles along the moving direction when the finger moves quickly
float step = std::min(5.f, displacement.Length());
for( float i=0.25f; i<step; i=i+1.f)
}
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
mTimerForBubbleEmission.Stop();
mEmitAnimation.Play();
mAnimateComponentCount = 0;
break;
}
- case TouchPoint::Stationary:
- case TouchPoint::Last:
+ case PointState::STATIONARY:
default:
{
break;
contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
-// contentTable.TouchedSignal().Connect( this, &ButtonsController::OnTouchEvent );
for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
{
return true;
}
- bool OnTouchEvent( Actor actor, const TouchEvent& event )
- {
- if( 1u == event.GetPointCount() )
- {
- const TouchPoint::State state = event.GetPoint(0u).state;
-
- // Clamp to integer values; this is to reduce flicking due to pixel misalignment
- const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
-
- if( TouchPoint::Down == state )
- {
- mLastPoint = localPoint;
- mAnimation = Animation::New( 0.25f );
- }
- else if( TouchPoint::Motion == state )
- {
- if( mAnimation )
- {
- mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR );
- mAnimation.Play();
- mLastPoint = localPoint;
- }
- }
- }
-
- return true;
- }
-
- private:
+private:
Application& mApplication;
Toolkit::Control mView; ///< The View instance.
stage.Add( table );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &CompressedTextureFormatsController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &CompressedTextureFormatsController::OnTouch );
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
stage.Add( textLabel );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch );
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
stage.Add(mScrollParent);
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &HomescreenBenchmark::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &HomescreenBenchmark::OnTouch );
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
imagePrevious.SetOpacity( 0.6f );
controlsLayer.Add( imagePrevious );
imagePrevious.SetName( PREVIOUS_BUTTON_ID );
- imagePrevious.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
+ imagePrevious.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
// Next image button:
Toolkit::ImageView imageNext = Toolkit::ImageView::New( playImage );
imageNext.SetOpacity( 0.6f );
controlsLayer.Add( imageNext );
imageNext.SetName( NEXT_BUTTON_ID );
- imageNext.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
+ imageNext.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
// Buttons to popup selectors for fitting and sampling modes:
}
}
- bool OnControlTouched( Actor actor, const TouchEvent& event )
+ bool OnControlTouched( Actor actor, const TouchData& event )
{
if(event.GetPointCount() > 0)
{
- const TouchPoint& point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Up:
+ case PointState::UP:
{
const std::string & name = actor.GetName();
if( name == NEXT_BUTTON_ID )
ImageView image = CreateImageView( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode );
image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) );
image.SetSize( imageSize );
- image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
+ image.TouchSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
mFittingModes[image.GetId()] = fittingMode;
mResourceUrls[image.GetId()] = imageSource.configuration.path;
mSizes[image.GetId()] = imageSize;
* @param[in] actor The actor touched
* @param[in] event The TouchEvent.
*/
- bool OnTouchImage( Actor actor, const TouchEvent& event )
+ bool OnTouchImage( Actor actor, const TouchData& event )
{
- if( (event.points.size() > 0) && (!mScrolling) )
+ if( ( event.GetPointCount() > 0 ) && ( !mScrolling ) )
{
- TouchPoint point = event.points[0];
- if(point.state == TouchPoint::Up)
+ if( event.GetState( 0 ) == PointState::UP )
{
// Spin the image a few times:
Animation animation = Animation::New(SPIN_DURATION);
animation.Play();
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &ImageViewPixelAreaApp::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &ImageViewPixelAreaApp::OnTouch );
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
- const TouchPoint &point = touch.GetPoint(0);
- if(point.state == TouchPoint::Down)
+ if( touch.GetState( 0 ) == PointState::DOWN )
{
mIndex++;
for( int i=0; i<3;i++ )
#include "shared/view.h"
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/slider/slider.h>
using namespace Dali;
contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
-// contentTable.TouchedSignal().Connect( this, &LoggingController::OnTouchEvent );
for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
{
return true;
}
- bool OnTouchEvent( Actor actor, const TouchEvent& event )
- {
- if( 1u == event.GetPointCount() )
- {
- const TouchPoint::State state = event.GetPoint(0u).state;
-
- // Clamp to integer values; this is to reduce flicking due to pixel misalignment
- const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
-
- if( TouchPoint::Down == state )
- {
- mLastPoint = localPoint;
- mAnimation = Animation::New( 0.25f );
- }
- else if( TouchPoint::Motion == state )
- {
- if( mAnimation )
- {
- mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR );
- mAnimation.Play();
- mLastPoint = localPoint;
- }
- }
- }
-
- return true;
- }
-
- private:
+private:
struct LoggerState
{
APPLICATION_TITLE );
mContent.SetLeaveRequired(true);
- mContent.TouchedSignal().Connect( this, &ExampleController::OnTouched );
+ mContent.TouchSignal().Connect( this, &ExampleController::OnTouched );
// Create magnifier (controlled by human touch)
Layer overlay = Layer::New();
* @param[in] actor The actor that received the touch
* @param[in] event The touch-event information
*/
- bool OnTouched( Actor actor, const TouchEvent& event )
+ bool OnTouched( Actor actor, const TouchData& event )
{
if(event.GetPointCount() > 0)
{
- const TouchPoint& point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
- case TouchPoint::Motion:
+ case PointState::DOWN:
+ case PointState::MOTION:
{
ShowMagnifier();
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
HideMagnifier();
break;
}
- default:
+ case PointState::STATIONARY:
{
break;
}
} // end switch
- Vector3 touchPoint(point.screen);
+ Vector3 touchPoint( event.GetScreenPosition( 0 ) );
SetMagnifierPosition(touchPoint - mStageSize * 0.5f);
}
meshActor.RegisterProperty("uHue", i/(float)NUMBER_OF_SAMPLES);
- meshActor.TouchedSignal().Connect(this, &ExampleController::OnTouched);
+ meshActor.TouchSignal().Connect(this, &ExampleController::OnTouched);
std::ostringstream oss;
oss << "Mesh Actor " << i;
meshActor.SetName(oss.str());
mActors[NUMBER_OF_SAMPLES-2].GetRendererAt(0).SetTextures( firstTextureSet );
- stage.GetRootLayer().TouchedSignal().Connect(this, &ExampleController::OnStageTouched);
+ stage.GetRootLayer().TouchSignal().Connect(this, &ExampleController::OnStageTouched);
}
void PrintDepths()
printf("\n");
}
- bool OnTouched( Actor actor, const TouchEvent& event )
+ bool OnTouched( Actor actor, const TouchData& event )
{
- if( event.GetPoint(0).state == TouchPoint::Finished )
+ if( event.GetState( 0 ) == PointState::UP )
{
int index = actor.GetProperty<int>(actor.GetPropertyIndex("index"));
return true;
}
- bool OnStageTouched( Actor rootLayer, const TouchEvent& event )
+ bool OnStageTouched( Actor rootLayer, const TouchData& event )
{
- if( event.GetPoint(0).state == TouchPoint::Finished )
+ if( event.GetState( 0 ) == PointState::UP )
{
switch( mZMode )
{
/**
* Touch event function
*/
- bool OnTouch( Actor actor, const TouchEvent& touch );
+ bool OnTouch( Actor actor, const TouchData& touch );
/**
* Key event function
mTimerDispersion.TickSignal().Connect(this, &MetaballExplosionController::OnTimerDispersionTick);
// Connect the callback to the touch signal on the mesh actor
- stage.GetRootLayer().TouchedSignal().Connect( this, &MetaballExplosionController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &MetaballExplosionController::OnTouch );
}
Geometry MetaballExplosionController::CreateGeometry()
mCompositionActor.SetProperty( mPositionIndex, metaballCenter );
}
-bool MetaballExplosionController::OnTouch( Actor actor, const TouchEvent& touch )
+bool MetaballExplosionController::OnTouch( Actor actor, const TouchData& touch )
{
- const TouchPoint &point = touch.GetPoint(0);
float aspectR = mScreenSize.y / mScreenSize.x;
- switch( point.state )
+ switch( touch.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
ResetMetaballs(true);
- Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+ const Vector2 screen = touch.GetScreenPosition( 0 );
+ Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
SetPositionToMetaballs(metaballCenter);
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
- Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+ const Vector2 screen = touch.GetScreenPosition( 0 );
+ Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
SetPositionToMetaballs(metaballCenter);
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
mTimerDispersion.Start();
break;
~MetaballRefracController();
void Create( Application& app );
- bool OnTouch( Actor actor, const TouchEvent& touch );
+ bool OnTouch( Actor actor, const TouchData& touch );
void OnKeyEvent(const KeyEvent& event);
void SetGravity(const Vector2 & gravity);
CreateAnimations();
// Connect the callback to the touch signal on the mesh actor
- stage.GetRootLayer().TouchedSignal().Connect( this, &MetaballRefracController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &MetaballRefracController::OnTouch );
}
/**
}
}
-bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch )
+bool MetaballRefracController::OnTouch( Actor actor, const TouchData& touch )
{
- const TouchPoint &point = touch.GetPoint(0);
float aspectR = mScreenSize.y / mScreenSize.x;
- switch(point.state)
+ switch( touch.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
StopAfterClickAnimations();
for (int i = 0 ; i < METABALL_NUMBER ; i++)
//We draw with the refraction-composition shader
mRendererRefraction.SetTextures(mTextureSetRefraction);
mRendererRefraction.SetShader( mShaderRefraction );
- mCurrentTouchPosition = point.screen;
+ mCurrentTouchPosition = touch.GetScreenPosition( 0 );
//we use the click position for the metaballs
- Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+ Vector2 metaballCenter = Vector2((mCurrentTouchPosition.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - mCurrentTouchPosition.y) / mScreenSize.y) - 0.5) * 2.0;
SetPositionToMetaballs(metaballCenter);
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
- Vector2 displacement = point.screen - mCurrentTouchPosition;
- mCurrentTouchPosition = point.screen;
+ Vector2 screen = touch.GetScreenPosition( 0 );
+ Vector2 displacement = screen - mCurrentTouchPosition;
+ mCurrentTouchPosition = screen;
mMetaballPosVariationTo.x += (displacement.x / mScreenSize.x) * 2.2;
mMetaballPosVariationTo.y += (- displacement.y / mScreenSize.y) * 2.2;
mPositionVarAnimation[1].Play();
//we use the click position for the metaballs
- Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+ Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
SetPositionToMetaballs(metaballCenter);
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
//Stop click animations
StopClickAnimations();
mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &PerfScroll::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &PerfScroll::OnTouch );
mParent = Actor::New();
mParent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
ShowAnimation();
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
mContent.Add( mMeshActor );
// Connect the callback to the touch signal on the mesh actor
- mContent.TouchedSignal().Connect( this, &RefractionEffectExample::OnTouch );
+ mContent.TouchSignal().Connect( this, &RefractionEffectExample::OnTouch );
// shader used when the finger is touching the screen. render refraction effect
mShaderRefraction = Shader::New( VERTEX_SHADER_REFRACTION, FRAGMENT_SHADER_REFRACTION );
return true;
}
- bool OnTouch( Actor actor , const TouchEvent& event )
+ bool OnTouch( Actor actor, const TouchData& event )
{
- const TouchPoint &point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
mRenderer.SetShader( mShaderRefraction );
- SetLightXYOffset( point.screen );
+ SetLightXYOffset( event.GetScreenPosition( 0 ) );
mLightAnimation.Play();
break;
}
- case TouchPoint::Motion:
+ case PointState::MOTION:
{
// make the light position following the finger movement
- SetLightXYOffset( point.screen );
+ SetLightXYOffset( event.GetScreenPosition( 0 ) );
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
mLightAnimation.Pause();
mStrenghAnimation.Play();
break;
}
- case TouchPoint::Stationary:
- case TouchPoint::Last:
- default:
+ case PointState::STATIONARY:
{
break;
}
actor.SetParentOrigin(ParentOrigin::CENTER);
actor.SetAnchorPoint(AnchorPoint::CENTER);
- actor.TouchedSignal().Connect( this, &ExampleController::OnTouchImage );
+ actor.TouchSignal().Connect( this, &ExampleController::OnTouchImage );
return actor;
}
* @param[in] actor The actor touched
* @param[in] event The TouchEvent.
*/
- bool OnTouchImage( Actor actor, const TouchEvent& event )
+ bool OnTouchImage( Actor actor, const TouchData& event )
{
- if( (event.points.size() > 0) && (!mScrolling) )
+ if( (event.GetPointCount() > 0) && (!mScrolling) )
{
- TouchPoint point = event.points[0];
- if(point.state == TouchPoint::Up)
+ if( event.GetState( 0 ) == PointState::UP )
{
// Spin the Image a few times.
Animation animation = Animation::New(SPIN_DURATION);
mBloomView.Add( mBloomActor );
// Connect the callback to the touch signal on the background
- mSuperBlurView.TouchedSignal().Connect( this, &BlurExample::OnTouch );
- mBloomView.TouchedSignal().Connect( this, &BlurExample::OnTouch );
+ mSuperBlurView.TouchSignal().Connect( this, &BlurExample::OnTouch );
+ mBloomView.TouchSignal().Connect( this, &BlurExample::OnTouch );
}
// Callback function of the touch signal on the background
- bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event)
+ bool OnTouch(Dali::Actor actor, const Dali::TouchData& event)
{
- const TouchPoint &point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
if( mAnimation )
{
mAnimation.Play();
break;
}
- case TouchPoint::Up:
- case TouchPoint::Leave:
- case TouchPoint::Interrupted:
+ case PointState::UP:
+ case PointState::LEAVE:
+ case PointState::INTERRUPTED:
{
if( mAnimation )
{
mAnimation.Play();
break;
}
- case TouchPoint::Motion:
- case TouchPoint::Stationary:
- case TouchPoint::Last:
- default:
+ case PointState::MOTION:
+ case PointState::STATIONARY:
{
break;
}
--- /dev/null
+/*
+ * Copyright (c) 2016 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.
+ *
+ */
+
+/**
+ * @file simple-text-editor-example.cpp
+ * @brief Very basic usage of TextEditor control
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/dali-toolkit.h>
+#include <iostream>
+#include <sstream>
+
+// INTERNAL INCLUDES
+#include "shared/view.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+
+const Vector4 BACKGROUND_COLOR( 0.04f, 0.345f, 0.392f, 1.0f ); ///< The background color.
+const char* TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png"; ///< The tool-bar image.
+const float TOOLBAR_BUTTON_PERCENTAGE = 0.1f; ///< The button's space width as a percentage of the toolbar's width.
+const float TOOLBAR_TITLE_PERCENTAGE = 0.7f; ///< The title's width as a percentage of the toolbar's width.
+const float TOOLBAR_HEIGHT_PERCENTAGE = 0.05f; ///< The toolbar's height as a percentage of the stage's height.
+const float TOOLBAR_PADDING = 4.f; ///< The padding in pixels.
+const Vector3 BUTTON_PERCENTAGE( 0.8f, 0.8f, 1.f ); ///< The button's width as a percentage of the space for the buttons in the toolbar.
+const Vector3 TEXT_EDITOR_RELATIVE_SIZE( 1.f, 0.45f, 1.0f ); ///< The size of the text editor as a percentage of the stage's size.
+const Vector4 TEXT_EDITOR_BACKGROUND_COLOR( 1.f, 1.f, 1.f, 0.15f ); ///< The background color of the text editor.
+
+const Vector4 COLORS[] = { Color::RED,
+ Color::GREEN,
+ Color::BLUE,
+ Color::YELLOW,
+ Color::CYAN,
+ Color::MAGENTA,
+ Color::WHITE,
+ Color::BLACK };
+const unsigned int NUMBER_OF_COLORS = sizeof( COLORS ) / sizeof( Vector4 );
+
+} // Unnamed namespace
+
+/**
+ * @brief The main class of the demo.
+ */
+class TextEditorExample : public ConnectionTracker
+{
+public:
+
+ TextEditorExample( Application& application )
+ : mApplication( application )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &TextEditorExample::Create );
+ }
+
+ ~TextEditorExample()
+ {
+ // Nothing to do here.
+ }
+
+ /**
+ * One-time setup in response to Application InitSignal.
+ */
+ void Create( Application& application )
+ {
+ Stage stage = Stage::GetCurrent();
+
+ // Respond to key events
+ stage.KeyEventSignal().Connect(this, &TextEditorExample::OnKeyEvent);
+
+ // Set a background color.
+ stage.SetBackgroundColor( BACKGROUND_COLOR );
+
+ // The stage size.
+ const Vector2 stageSize = stage.GetSize();
+
+ // Creates a default view with a default tool bar.
+ // The view is added to the stage.
+
+ // Set the toolbar style
+ const float toolBarHeight = TOOLBAR_HEIGHT_PERCENTAGE * stageSize.height;
+ const DemoHelper::ViewStyle viewStyle( TOOLBAR_BUTTON_PERCENTAGE,
+ TOOLBAR_TITLE_PERCENTAGE,
+ toolBarHeight,
+ TOOLBAR_PADDING );
+
+ Layer contents = DemoHelper::CreateView( mApplication,
+ mView,
+ mToolBar,
+ "",
+ TOOLBAR_IMAGE,
+ "",
+ viewStyle );
+
+ // Create a 'select color' button.
+ mColorButtonOption = Toolkit::PushButton::New();
+ mColorButtonOption.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mColorButtonOption.SetSizeModeFactor( BUTTON_PERCENTAGE );
+
+ mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, Color::BLACK );
+ mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, Color::BLACK );
+
+ mColorButtonOption.ClickedSignal().Connect( this, &TextEditorExample::OnChangeColorButtonClicked );
+
+ mToolBar.AddControl( mColorButtonOption, viewStyle.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
+
+ // Create the text editor.
+ mEditor = TextEditor::New();
+ mEditor.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ mEditor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mEditor.SetPosition( 0.f, toolBarHeight, 0.f );
+ mEditor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mEditor.SetSizeModeFactor( TEXT_EDITOR_RELATIVE_SIZE );
+
+ mEditor.SetBackgroundColor( TEXT_EDITOR_BACKGROUND_COLOR );
+
+ mEditor.SetProperty( TextEditor::Property::TEXT_COLOR, Color::BLACK );
+ mEditor.SetProperty( TextEditor::Property::TEXT,
+ "Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.\n"
+ "Usu ne nisl maiorum iudicabit, veniam epicurei oporteat eos an.\n"
+ "Ne nec nulla regione albucius, mea doctus delenit ad!\n"
+ "Et everti blandit adversarium mei, eam porro neglegentur suscipiantur an.\n"
+ "Quidam corpora at duo. An eos possim scripserit?\n\n"
+ "Aťqui dicant sěnťenťíae aň vel!\n"
+ "Vis viris médiocrem elaboraret ét, verear civibus moderatius ex duo!\n"
+ "Án veri laborě iňtěgré quó, mei aď poššit lobortis, mei prompťa čonsťitůťó eů.\n"
+ "Aliquip sanctůs delicáta quí ěá, et natum aliquam est?\n"
+ "Asšúm sapěret usu ůť.\n"
+ "Síť ut apeirián laboramúš percipitur, sůas hařum ín éos?\n" );
+
+ contents.Add( mEditor );
+ }
+
+ void CreateButtonContainer()
+ {
+ mButtonContainer = Toolkit::TableView::New( NUMBER_OF_COLORS, 1u );
+ mButtonContainer.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mButtonContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+ Stage stage = Stage::GetCurrent();
+ const Vector2 stageSize = stage.GetSize();
+ const float toolBarHeight = TOOLBAR_HEIGHT_PERCENTAGE * stageSize.height;
+ mButtonContainer.SetPosition( TOOLBAR_PADDING, 2.f * TOOLBAR_PADDING + toolBarHeight, 0.f );
+
+ mButtonContainer.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+ const Vector3 containerPercentage( 0.8f * TOOLBAR_BUTTON_PERCENTAGE, NUMBER_OF_COLORS, 1.f );
+ mButtonContainer.SetSizeModeFactor( containerPercentage );
+
+ Layer toolbarLayer = mToolBar.GetLayer();
+ toolbarLayer.Add( mButtonContainer );
+
+ const Vector3 buttonPercentage( 1.f, 0.8f / static_cast<float>( NUMBER_OF_COLORS ), 1.f );
+ for( unsigned int index = 0u; index < NUMBER_OF_COLORS; ++index )
+ {
+ Toolkit::PushButton button = Toolkit::PushButton::New();
+ button.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ button.SetSizeModeFactor( buttonPercentage );
+
+ std::ostringstream s;
+ s << "color" << index;
+ button.SetName( s.str() );
+
+ button.SetProperty( Button::Property::UNSELECTED_COLOR, COLORS[index] );
+ button.SetProperty( Button::Property::SELECTED_COLOR, COLORS[index] );
+
+ button.ClickedSignal().Connect( this, &TextEditorExample::OnColorButtonClicked );
+
+ mButtonContainer.Add( button );
+ }
+ }
+
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+ {
+ // Exit application when click back or escape.
+ mApplication.Quit();
+ }
+ }
+ }
+
+ bool OnChangeColorButtonClicked( Button button )
+ {
+ if( !mButtonContainer )
+ {
+ CreateButtonContainer();
+ }
+
+ mButtonContainer.SetVisible( true );
+ mButtonContainer.SetSensitive( true );
+ return true;
+ }
+
+ bool OnColorButtonClicked( Button button )
+ {
+ const std::string& name = button.GetName();
+
+ if( "color" == name.substr( 0u, 5u ) )
+ {
+ const unsigned int index = strtoul( name.substr( 5u, 1u ).c_str(), NULL, 10u );
+ mEditor.SetProperty( TextEditor::Property::INPUT_COLOR, COLORS[index] );
+ }
+
+ mButtonContainer.SetVisible( false );
+ mButtonContainer.SetSensitive( false );
+
+ return true;
+ }
+
+private:
+
+ Application& mApplication;
+
+ Toolkit::Control mView;
+ Toolkit::ToolBar mToolBar;
+ Toolkit::TextEditor mEditor;
+ Toolkit::PushButton mColorButtonOption;
+ Toolkit::TableView mButtonContainer;
+};
+
+void RunTest( Application& application )
+{
+ TextEditorExample test( application );
+
+ application.MainLoop();
+}
+
+/** Entry point for Linux & Tizen applications */
+int main( int argc, char **argv )
+{
+ // DALI_DEMO_THEME_PATH not passed to Application so TextEditor example uses default Toolkit style sheet.
+ Application application = Application::New( &argc, &argv );
+
+ RunTest( application );
+
+ return 0;
+}
popup.SetSize( width, 0.0f );
popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT );
popup.SetSizeModeFactor( POPUP_SIZE_FACTOR_TO_PARENT );
- popup.TouchedSignal().Connect( this, &TextFieldExample::OnPopupTouched );
+ popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched );
return popup;
}
mField.Reset();
}
- bool OnPopupTouched( Actor actor, const TouchEvent& event )
+ bool OnPopupTouched( Actor actor, const TouchData& event )
{
// End edit mode for TextField if parent Popup touched.
if(event.GetPointCount() > 0)
{
- const TouchPoint& point = event.GetPoint(0);
- switch(point.state)
+ switch( event.GetState( 0 ) )
{
- case TouchPoint::Down:
+ case PointState::DOWN:
{
// Update the folder text and lose focus for Key events
if( mButton && mField )
mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mTableView.TouchedSignal().Connect( this, &EmojiExample::OnTouchEvent );
+ mTableView.TouchSignal().Connect( this, &EmojiExample::OnTouch );
stage.Add( mTableView );
for( unsigned int index = 0u; index < NUMBER_OF_EMOJIS; ++index )
}
}
- bool OnTouchEvent( Actor actor, const TouchEvent& event )
+ bool OnTouch( Actor actor, const TouchData& event )
{
if( 1u == event.GetPointCount() )
{
- const TouchPoint::State state = event.GetPoint(0u).state;
+ const PointState::Type state = event.GetState( 0 );
// Clamp to integer values; this is to reduce flicking due to pixel misalignment
- const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
+ const float localPoint = static_cast<float>( static_cast<int>( event.GetLocalPosition( 0 ).y ) );
- if( TouchPoint::Down == state )
+ if( PointState::DOWN == state )
{
mLastPoint = localPoint;
mAnimation = Animation::New( 0.25f );
}
- else if( TouchPoint::Motion == state )
+ else if( PointState::MOTION == state )
{
if( mAnimation )
{
mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mTableView.TouchedSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouchEvent );
+ mTableView.TouchSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouch );
stage.Add( mTableView );
for( unsigned int index = 0u; index < NUMBER_OF_LANGUAGES; ++index )
}
}
- bool OnTouchEvent( Actor actor, const TouchEvent& event )
+ bool OnTouch( Actor actor, const TouchData& event )
{
if( 1u == event.GetPointCount() )
{
- const TouchPoint::State state = event.GetPoint(0u).state;
+ const PointState::Type state = event.GetState( 0 );
// Clamp to integer values; this is to reduce flicking due to pixel misalignment
- const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
+ const float localPoint = static_cast<float>( static_cast<int>( event.GetLocalPosition( 0 ).y ) );
- if( TouchPoint::Down == state )
+ if( PointState::DOWN == state )
{
mLastPoint = localPoint;
mAnimation = Animation::New( 0.25f );
}
- else if( TouchPoint::Motion == state )
+ else if( PointState::MOTION == state )
{
if( mAnimation )
{
stage.Add( mTextLabel );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchedSignal().Connect( this, &TiltController::OnTouch );
+ stage.GetRootLayer().TouchSignal().Connect( this, &TiltController::OnTouch );
CreateSensor();
}
}
}
- bool OnTouch( Actor actor, const TouchEvent& touch )
+ bool OnTouch( Actor actor, const TouchData& touch )
{
// quit the application
mApplication.Quit();
--- /dev/null
+/*
+ * Copyright (c) 2015 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.
+ *
+ */
+
+#include <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+namespace
+{
+ const int SEEK_POS( 5000 );
+ const int INIT_WIDTH( 600 );
+ const int INIT_HEIGHT( 400 );
+ const int BUTTON_SIZE( 80 );
+
+ const char* const PLAY_FILE = DEMO_VIDEO_DIR "big_buck_bunny.mp4";
+ const char* const PLAY_IMAGE = DEMO_IMAGE_DIR "icon-play.png";
+ const char* const PAUSE_IMAGE = DEMO_IMAGE_DIR "Pause.png";
+ const char* const STOP_IMAGE = DEMO_IMAGE_DIR "icon-stop.png";
+ const char* const RESET_IMAGE = DEMO_IMAGE_DIR "icon-reset.png";
+ const char* const FORWARD_IMAGE = DEMO_IMAGE_DIR "Forward.png";
+ const char* const BACKWARD_IMAGE = DEMO_IMAGE_DIR "Backward.png";
+
+const char* DEFAULT_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+ varying mediump vec2 vTexCoord;\n
+ uniform sampler2D sTexture;\n
+ uniform lowp vec4 uColor;\n
+ \n
+ void main()\n
+ {\n
+ gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
+ }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+ precision mediump float;
+ varying mediump vec2 vTexCoord;\n
+ uniform sampler2D sTexture;\n
+ uniform lowp vec4 uColor;\n
+ \n
+ void main()\n
+ {\n
+ vec2 st = vTexCoord.st;\n
+ vec3 irgb = texture2D( sTexture, st ).rgb;\n
+ vec3 negative = vec3( 1., 1., 1. ) - irgb;\n
+ gl_FragColor = vec4( mix( irgb, negative, 1.0), 1. ) * uColor;\n
+ }\n
+);
+
+} // namespace
+
+class VideoViewController: public ConnectionTracker
+{
+ public:
+
+ VideoViewController( Application& application )
+ : mApplication( application ),
+ mIsPlay( false ),
+ mIsStop( false ),
+ mIsFullScreen( false ),
+ mSetCustomShader( false ),
+ mScale( 1.f )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &VideoViewController::Create );
+ }
+
+ ~VideoViewController()
+ {
+ mVideoView.Stop();
+ }
+
+ void Create( Application& application )
+ {
+ mStageSize = Stage::GetCurrent().GetSize();
+
+ mVideoView = Toolkit::VideoView::New();
+ Stage::GetCurrent().Add( mVideoView );
+ mVideoView.SetParentOrigin( ParentOrigin::CENTER );
+ mVideoView.SetAnchorPoint( AnchorPoint::CENTER );
+ mVideoView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ mVideoView.SetSize( INIT_WIDTH, INIT_HEIGHT );
+ mVideoView.SetProperty( VideoView::Property::LOOPING, true );
+ mVideoView.SetProperty( VideoView::Property::MUTED, false );
+ mVideoView.SetProperty( VideoView::Property::VIDEO, PLAY_FILE );
+
+ mMenu = Layer::New();
+ mMenu.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
+ mMenu.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+ mMenu.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ mMenu.SetSize( INIT_WIDTH, 120 );
+ mVideoView.Add( mMenu );
+
+ mPlayButton = PushButton::New();
+ mPlayButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mPlayButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mPlayButton.SetName( "Play" );
+ mPlayButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ mPlayButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+ mPlayButton.SetPosition( 40, 10 );
+ mPlayButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+ mPauseButton = PushButton::New();
+ mPauseButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mPauseButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mPauseButton.SetName( "Pause" );
+ mPauseButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ mPauseButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+ mPauseButton.SetPosition( 40, 10 );
+ mPauseButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+ mStopButton = PushButton::New();
+ mStopButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mStopButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mStopButton.SetName( "Stop" );
+ mStopButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ mStopButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+ mStopButton.SetPosition( 140, 10 );
+ mStopButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+ mResetButton = PushButton::New();
+ mResetButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mResetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mResetButton.SetName( "Reset" );
+ mResetButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ mResetButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+ mResetButton.SetPosition( 140, 10 );
+ mResetButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+ mBackwardButton = PushButton::New();
+ mBackwardButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mBackwardButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mBackwardButton.SetName( "Backward" );
+ mBackwardButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ mBackwardButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+ mBackwardButton.SetPosition( 240, 10 );
+ mBackwardButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+ mForwardButton = PushButton::New();
+ mForwardButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mForwardButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mForwardButton.SetName( "Forward" );
+ mForwardButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ mForwardButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+ mForwardButton.SetPosition( 340, 10 );
+ mForwardButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+ mMenu.Add( mPlayButton );
+ mMenu.Add( mPauseButton );
+ mMenu.Add( mStopButton );
+ mMenu.Add( mResetButton );
+ mMenu.Add( mBackwardButton );
+ mMenu.Add( mForwardButton );
+
+ mPauseButton.SetVisible( false );
+ mPauseButton.SetDisabled( true );
+ mPlayButton.SetVisible( true );
+ mPlayButton.SetDisabled( false );
+ mStopButton.SetVisible( true );
+ mStopButton.SetDisabled( false );
+ mResetButton.SetVisible( false );
+ mResetButton.SetDisabled( true );
+
+ mPlayButton.SetUnselectedImage( PLAY_IMAGE );
+ mPlayButton.SetSelectedImage( PLAY_IMAGE );
+ mPauseButton.SetUnselectedImage( PAUSE_IMAGE );
+ mPauseButton.SetSelectedImage( PAUSE_IMAGE );
+
+ mStopButton.SetUnselectedImage( STOP_IMAGE );
+ mStopButton.SetSelectedImage( STOP_IMAGE );
+ mResetButton.SetUnselectedImage( RESET_IMAGE );
+ mResetButton.SetSelectedImage( RESET_IMAGE );
+
+ mBackwardButton.SetUnselectedImage( BACKWARD_IMAGE );
+ mBackwardButton.SetSelectedImage( BACKWARD_IMAGE );
+ mForwardButton.SetUnselectedImage( FORWARD_IMAGE );
+ mForwardButton.SetSelectedImage( FORWARD_IMAGE );
+
+ mPanGestureDetector = PanGestureDetector::New();
+ mPanGestureDetector.Attach( mVideoView );
+ mPanGestureDetector.DetectedSignal().Connect( this, &VideoViewController::OnPan );
+
+ mPinchGestureDetector = PinchGestureDetector::New();
+ mPinchGestureDetector.Attach( mVideoView );
+ mPinchGestureDetector.DetectedSignal().Connect( this, &VideoViewController::OnPinch );
+
+ mTapGestureDetector = TapGestureDetector::New();
+ mTapGestureDetector.Attach( mVideoView );
+ mTapGestureDetector.DetectedSignal().Connect( this, &VideoViewController::OnTap );
+
+ mRotationAnimation = Animation::New(2.f);
+ mRotationAnimation.AnimateBy( Property(mVideoView, Actor::Property::ORIENTATION), Quaternion(Degree(0.f), Degree(360.f), Degree(0.f)) );
+ mRotationAnimation.SetLooping(false);
+
+ Stage::GetCurrent().KeyEventSignal().Connect( this, &VideoViewController::OnKeyEvent );
+
+ Property::Map customShader;
+ customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
+ mCustomShader.Insert( "rendererType", "image" );
+ mCustomShader.Insert( "shader", customShader );
+
+ Property::Map defaultShader;
+ customShader.Insert( "fragmentShader", DEFAULT_FRAGMENT_SHADER );
+ mDefaultShader.Insert( "rendererType", "image" );
+ mDefaultShader.Insert( "shader", defaultShader );
+
+ mWindowSurfaceTarget.Insert( "RENDERING_TARGET", "windowSurfaceTarget" );
+ mNativeImageTarget.Insert( "RENDERING_TARGET", "nativeImageTarget" );
+
+ mVideoView.FinishedSignal().Connect( this, &VideoViewController::OnFinished );
+ }
+
+ bool OnButtonClicked( Button button )
+ {
+
+ if( mPauseButton.GetId() == button.GetId())
+ {
+ if( mIsPlay )
+ {
+ mPauseButton.SetVisible( false );
+ mPauseButton.SetDisabled( true );
+ mPlayButton.SetVisible( true );
+ mPlayButton.SetDisabled( false );
+
+ mIsPlay = false;
+ mVideoView.Pause();
+ }
+ }
+ else if( mPlayButton.GetId() == button.GetId())
+ {
+ if( mIsStop )
+ {
+ return false;
+ }
+
+ mPauseButton.SetVisible( true );
+ mPauseButton.SetDisabled( false );
+ mPlayButton.SetVisible( false );
+ mPlayButton.SetDisabled( true );
+
+ mIsPlay = true;
+ mVideoView.Play();
+ }
+ else if( mResetButton.GetId() == button.GetId())
+ {
+ if( mIsStop )
+ {
+ mPauseButton.SetVisible( true );
+ mPauseButton.SetDisabled( false );
+ mPlayButton.SetVisible( false );
+ mPlayButton.SetDisabled( true );
+ mResetButton.SetVisible( false );
+ mResetButton.SetDisabled( true );
+ mStopButton.SetVisible( true );
+ mStopButton.SetDisabled( false );
+
+ mIsStop = false;
+ mIsPlay = true;
+ mVideoView.SetProperty( VideoView::Property::VIDEO, PLAY_FILE );
+ mVideoView.Play();
+ }
+ }
+ else if( mStopButton.GetId() == button.GetId())
+ {
+ mPauseButton.SetVisible( false );
+ mPauseButton.SetDisabled( true );
+ mPlayButton.SetVisible( true );
+ mPlayButton.SetDisabled( false );
+ mResetButton.SetVisible( true );
+ mResetButton.SetDisabled( false );
+ mStopButton.SetVisible( false );
+ mStopButton.SetDisabled( true );
+
+ mIsStop = true;
+ mVideoView.Stop();
+ }
+ else if( mBackwardButton.GetId() == button.GetId())
+ {
+ mVideoView.Backward( SEEK_POS );
+ }
+ else if( mForwardButton.GetId() == button.GetId())
+ {
+ mVideoView.Forward( SEEK_POS );
+ }
+
+ return true;
+ }
+
+ void OnFinished( VideoView& view )
+ {
+ if( !mIsFullScreen )
+ {
+ mRotationAnimation.Play();
+ mIsStop = true;
+ }
+ }
+
+ void OnPan( Actor actor, const PanGesture& gesture )
+ {
+ if( !mIsFullScreen && gesture.state == Gesture::Continuing )
+ {
+ mVideoView.TranslateBy( Vector3( gesture.displacement ) );
+ }
+ }
+
+ void OnPinch( Actor actor, const PinchGesture& gesture )
+ {
+ if( gesture.state == Gesture::Started )
+ {
+ mPinchStartScale = mScale;
+ }
+
+ if( gesture.state == Gesture::Finished )
+ {
+ mScale = mPinchStartScale * gesture.scale;
+ if( mScale > 1.f )
+ {
+ mVideoView.SetSize( mStageSize.x, mStageSize.y );
+ mVideoView.SetProperty( VideoView::Property::VIDEO, mWindowSurfaceTarget );
+ mMenu.SetSize( mStageSize.x, 120 );
+ mIsFullScreen = true;
+ }
+ else
+ {
+ mVideoView.SetSize( INIT_WIDTH, INIT_HEIGHT );
+ mVideoView.SetProperty( VideoView::Property::VIDEO, mNativeImageTarget );
+ mMenu.SetSize( INIT_WIDTH, 120 );
+ mIsFullScreen = false;
+ }
+ }
+ }
+
+ void OnTap( Actor actor, const TapGesture& tapGesture )
+ {
+ if( !mIsFullScreen )
+ {
+ mRotationAnimation.Play();
+
+ if( mSetCustomShader )
+ {
+ mSetCustomShader = false;
+ mVideoView.SetProperty( VideoView::Property::VIDEO, mDefaultShader );
+ }
+ else
+ {
+ mSetCustomShader = true;
+ mVideoView.SetProperty( VideoView::Property::VIDEO, mCustomShader );
+ }
+ }
+ }
+
+private:
+
+ /**
+ * Main key event handler
+ */
+ void OnKeyEvent(const KeyEvent& event)
+ {
+ if(event.state == KeyEvent::Down)
+ {
+ if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
+private:
+ Application& mApplication;
+ VideoView mVideoView;
+ Layer mMenu;
+ Vector2 mStageSize;
+
+ bool mIsPlay;
+ bool mIsStop;
+ bool mIsFullScreen;
+ bool mSetCustomShader;
+
+ PushButton mPlayButton;
+ PushButton mPauseButton;
+ PushButton mStopButton;
+ PushButton mResetButton;
+ PushButton mBackwardButton;
+ PushButton mForwardButton;
+
+ PanGestureDetector mPanGestureDetector;
+ PinchGestureDetector mPinchGestureDetector;
+ TapGestureDetector mTapGestureDetector;
+ float mScale;
+ float mPinchStartScale;
+
+ Animation mRotationAnimation;
+ Property::Map mCustomShader;
+ Property::Map mDefaultShader;
+ Property::Map mWindowSurfaceTarget;
+ Property::Map mNativeImageTarget;
+};
+
+void RunTest( Application& application )
+{
+ VideoViewController test( application );
+
+ application.MainLoop();
+}
+
+// Entry point for Linux & Tizen applications
+//
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+ Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
+
+ RunTest( application );
+
+ return 0;
+}
Name: com.samsung.dali-demo
Summary: The OpenGLES Canvas Core Demo
-Version: 1.1.36
+Version: 1.1.39
Release: 1
Group: System/Libraries
License: Apache-2.0
%{dali_app_exe_dir}/*.example
%{dali_app_exe_dir}/dali-builder
%{dali_app_ro_dir}/images/*
+%{dali_app_ro_dir}/videos/*
%{dali_app_ro_dir}/models/*
%{dali_app_ro_dir}/scripts/*
%{dali_app_ro_dir}/style/*
"size": [200, 200, 1],
"orientation": [0, 0, 30],
"signals": [{
- "name": "touched",
+ "name": "touch",
"action": "play",
"animation": "animate"
}]
"position": [-150, -50, 0],
"text": "or me",
"signals": [{
- "name": "touched",
+ "name": "touch",
"action": "play",
"animation": "pathAnimation"
}]
}, {
"name": "image",
"type": "ImageView",
- "image": {
- "url": "{DEMO_IMAGE_DIR}gallery-large-21.jpg"
- },
+ "image": "{DEMO_IMAGE_DIR}gallery-large-21.jpg",
"relayoutEnabled": false,
"position": [0, 200, 0],
"size": [200, 200, 1],
"signals": [{
- "name": "touched",
+ "name": "touch",
"action": "play",
"animation": "rotate"
}],
"showPopup": true,
"showValue": true,
"valuePrecision": 2,
- "value": 0.0,
- "popupTextColor": [0.0, 1.0, 1.0, 1.0]
+ "value": 0.0
}
}
}
"showValue": true,
"valuePrecision": 0,
"value": 50.0,
- "popupTextColor": [1, 0, 0, 1],
- "hitRegion": [0, 48],
- "backingRegion": [0, 10],
- "handleRegion": [48, 48]
+ "trackVisual": {
+ "size": [0, 10]
+ },
+ "handleVisual": {
+ "size": [48, 48]
+ }
}, {
"type": "Slider",
"parentOrigin": "TOP_CENTER",
"showValue": true,
"valuePrescision": 0,
"value": 100.0,
- "hitRegion": [0, 48],
- "backingRegion": [0, 30],
- "handleRegion": [48, 48],
- "backingImageName": "{DEMO_IMAGE_DIR}button-up-14.9.png",
- "handleImageName": "{DEMO_IMAGE_DIR}blocks-ball.png",
- "progressImageName": "{DEMO_IMAGE_DIR}button-down.9.png"
+ "trackVisual": {
+ "url": "{DEMO_IMAGE_DIR}button-up-14.9.png",
+ "size": [0, 30]
+ },
+ "handleVisual": {
+ "url": "{DEMO_IMAGE_DIR}blocks-ball.png",
+ "size": [48, 48]
+ },
+ "progressVisual": {
+ "url": "{DEMO_IMAGE_DIR}button-down.9.png"
+ }
}, {
"type": "Slider",
"parentOrigin": "TOP_CENTER",
"showValue": true,
"valuePrecision": 0,
"value": 50.0,
- "hitRegion": [0, 48],
- "backingRegion": [0, 10],
- "handleRegion": [48, 48],
- "enabled": false
+ "trackVisual": {
+ "size": [0, 10]
+ },
+ "handleVisual": {
+ "size": [48, 48]
+ }
}, {
"type": "Slider",
"parentOrigin": "TOP_CENTER",
"showValue": true,
"valuePrecision": 0,
"value": 50.0,
- "hitRegion": [0, 48],
- "backingRegion": [0, 10],
- "handleRegion": [48, 48],
- "enabled": false,
- "disableColor": [1, 0, 0, 1]
+ "trackVisual": {
+ "size": [0, 10]
+ },
+ "handleVisual": {
+ "size": [48, 48]
+ },
+ "disabledColor": [1, 0, 0, 1]
}]
}
"name":"gallery1",
"type":"ImageView",
"heightResizePolicy":"FILL_TO_PARENT",
- "image": {
- "url": "{DEMO_IMAGE_DIR}gallery-small-1.jpg"
- },
+ "image": "{DEMO_IMAGE_DIR}gallery-small-1.jpg",
"properties": { // properties registered dynamically
"cellIndex": [0,0], // property to specify the top-left cell this child occupies
"rowSpan":4, // property to specify how many rows this child occupies, if not set, default value is 1
"name":"gallery2",
"type":"ImageView",
"heightResizePolicy":"FILL_TO_PARENT",
- "image": {
- "url": "{DEMO_IMAGE_DIR}gallery-small-2.jpg"
- },
+ "image": "{DEMO_IMAGE_DIR}gallery-small-2.jpg",
"properties": { // properties registered dynamically
"cellIndex": [0,1],
"cellHorizontalAlignment": "right" // property to specify how to align horizontally inside the cells, if not set, default value is 'left'
},{
"name":"gallery3",
"type":"ImageView",
- "image": {
- "url": "{DEMO_IMAGE_DIR}gallery-small-3.jpg"
- },
+ "image": "{DEMO_IMAGE_DIR}gallery-small-3.jpg",
"properties": {
"cellIndex":[1,1],
"rowSpan":3,
"name":"gallery4",
"type":"ImageView",
"widthResizePolicy":"FILL_TO_PARENT",
- "image": {
- "url": "{DEMO_IMAGE_DIR}gallery-small-4.jpg"
- },
+ "image": "{DEMO_IMAGE_DIR}gallery-small-4.jpg",
"properties": {
"cellIndex":[2,2]
}
"type":"ImageView",
"widthResizePolicy":"FILL_TO_PARENT",
"heightResizePolicy":"FILL_TO_PARENT",
- "image": {
- "url": "{DEMO_IMAGE_DIR}gallery-small-5.jpg"
- },
+ "image": "{DEMO_IMAGE_DIR}gallery-small-5.jpg",
"properties": {
"cellIndex":[3,2],
"columnSpan": 2
#define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE "Text Scripts"
#define DALI_DEMO_STR_TITLE_EMOJI_TEXT "Emoji Text"
#define DALI_DEMO_STR_TITLE_TEXT_SCROLLING "Text Scrolling"
+#define DALI_DEMO_STR_TITLE_TEXT_EDITOR "Text Editor"
#define DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE "Negotiate Size"
#define DALI_DEMO_STR_TITLE_POPUP "Popup"
#define DALI_DEMO_STR_TITLE_BUTTONS "Buttons"
toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
- // Add the tool bar to the too bar layer.
+ // Add the tool bar to the tool bar layer.
toolBarLayer.Add( toolBar );
// Tool bar text.