LongPressGestureDetector detector = LongPressGestureDetector::New();
- detector.SetTouchesRequired(2,2);
-
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
application.Render();
detector.Attach(actor);
+ detector.SetTouchesRequired(2,2); // Set after we've attached forcing us to change things internally
SignalData data;
GestureReceivedFunctor functor(data);
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/events/gesture-devel.h>
-#include <dali/devel-api/events/rotation-gesture.h>
#include <dali-test-suite-utils.h>
using namespace Dali;
RotationGesture gesture(Gesture::Started);
DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
RotationGesture gesture2(Gesture::Continuing);
DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture2.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture2.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture2.type, TEST_LOCATION);
RotationGesture gesture3(Gesture::Finished);
DALI_TEST_EQUALS(Gesture::Finished, gesture3.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture3.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture3.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture3.type, TEST_LOCATION);
// Test copy constructor
gesture3.rotation = 3.0f;
RotationGesture rotation(gesture3);
DALI_TEST_EQUALS(Gesture::Finished, rotation.state, TEST_LOCATION);
DALI_TEST_EQUALS(3.0f, rotation.rotation.radian, TEST_LOCATION);
-DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( rotation.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, rotation.type, TEST_LOCATION);
END_TEST;
}
RotationGesture gesture(Gesture::Started);
DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
RotationGesture gesture2(Gesture::Continuing);
DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture2.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture2.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture2.type, TEST_LOCATION);
gesture2.rotation.radian = 3.0f;
gesture = gesture2;
DALI_TEST_EQUALS(Gesture::Continuing, gesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(3.0f, gesture.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
END_TEST;
}
RotationGesture* gesture = new RotationGesture( Gesture::Started );
DALI_TEST_EQUALS(Gesture::Started, gesture->state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture->rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture->type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture->type, TEST_LOCATION);
delete gesture;
END_TEST;
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/render-task-list-integ.h>
-#include <dali/devel-api/events/gesture-devel.h>
-#include <dali/devel-api/events/rotation-gesture.h>
-#include <dali/devel-api/events/rotation-gesture-detector.h>
#include <dali-test-suite-utils.h>
#include <test-touch-event-utils.h>
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/input-options.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/devel-api/events/rotation-gesture.h>
-#include <dali/devel-api/events/rotation-gesture-detector.h>
#include <dali-test-suite-utils.h>
#include <dali/internal/event/common/type-info-impl.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
-#include <dali/devel-api/events/rotation-gesture-detector.h>
using namespace Dali;
+++ /dev/null
-#ifndef DALI_GESTURE_DEVEL_H
-#define DALI_GESTURE_DEVEL_H
-
-/*
- * Copyright (c) 2019 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/public-api/events/gesture.h>
-
-namespace Dali
-{
-
-namespace DevelGesture
-{
-
-/**
- * @copydoc Dali::Gesture::Type
- */
-enum Type
-{
- Pinch = Gesture::Pinch,
- Pan = Gesture::Pan,
- Tap = Gesture::Tap,
- LongPress = Gesture::LongPress,
-
- // Devel Gesture Types
- Rotation = 1 << 4, ///< When the user rotates two fingers around a particular ares of the screen.
-};
-
-} // namespace DevelGesture
-
-} // namespace Dali
-
-#endif // DALI_GESTURE_DEVEL_H
${devel_api_src_dir}/common/stage.cpp
${devel_api_src_dir}/events/hit-test-algorithm.cpp
${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
- ${devel_api_src_dir}/events/rotation-gesture.cpp
- ${devel_api_src_dir}/events/rotation-gesture-detector.cpp
${devel_api_src_dir}/events/key-event-devel.cpp
${devel_api_src_dir}/events/wheel-event-devel.cpp
${devel_api_src_dir}/images/distance-field.cpp
SET( devel_api_core_events_header_files
- ${devel_api_src_dir}/events/gesture-devel.h
${devel_api_src_dir}/events/hit-test-algorithm.h
${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
- ${devel_api_src_dir}/events/rotation-gesture.h
- ${devel_api_src_dir}/events/rotation-gesture-detector.h
${devel_api_src_dir}/events/key-event-devel.h
${devel_api_src_dir}/events/wheel-event-devel.h
)
return *mGestureData;
}
-bool Actor::IsGestureRequred( DevelGesture::Type type ) const
+bool Actor::IsGestureRequred( Gesture::Type type ) const
{
return mGestureData && mGestureData->IsGestureRequred( type );
}
#include <dali/public-api/math/viewport.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/size-negotiation/relayout-container.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/common/memory-pool-object-allocator.h>
#include <dali/internal/event/actors/actor-declarations.h>
#include <dali/internal/event/common/object-impl.h>
* @param[in] type The gesture type.
* @return True if the gesture is required, false otherwise.
*/
- bool IsGestureRequred( DevelGesture::Type type ) const;
+ bool IsGestureRequred( Gesture::Type type ) const;
// Signals
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
ActorGestureData::ActorGestureData()
-: gesturesRequired( DevelGesture::Type( 0 ) ),
+: gesturesRequired( Gesture::Type( 0 ) ),
panDetectors( nullptr ),
pinchDetectors( nullptr ),
longPressDetectors( nullptr ),
void ActorGestureData::AddGestureDetector( GestureDetector& detector )
{
- const DevelGesture::Type type( detector.GetType() );
+ const Gesture::Type type( detector.GetType() );
GestureDetectorContainer*& containerPtr( GetContainerPtr( type ) );
if ( NULL == containerPtr )
}
containerPtr->push_back( &detector );
- gesturesRequired = DevelGesture::Type( gesturesRequired | type );
+ gesturesRequired = Gesture::Type( gesturesRequired | type );
}
void ActorGestureData::RemoveGestureDetector( GestureDetector& detector )
{
- const DevelGesture::Type type( detector.GetType() );
+ const Gesture::Type type( detector.GetType() );
GestureDetectorContainer*& containerPtr( GetContainerPtr( type ) );
DALI_ASSERT_DEBUG( containerPtr && "Container had not been created" );
if ( container.empty() )
{
- gesturesRequired = DevelGesture::Type( gesturesRequired & ~type );
+ gesturesRequired = Gesture::Type( gesturesRequired & ~type );
delete containerPtr;
containerPtr = NULL;
}
}
-GestureDetectorContainer& ActorGestureData::GetGestureDetectorContainer( DevelGesture::Type type )
+GestureDetectorContainer& ActorGestureData::GetGestureDetectorContainer( Gesture::Type type )
{
return *GetContainerPtr( type );
}
-GestureDetectorContainer*& ActorGestureData::GetContainerPtr( DevelGesture::Type type )
+GestureDetectorContainer*& ActorGestureData::GetContainerPtr( Gesture::Type type )
{
switch ( type )
{
- case DevelGesture::Pan:
+ case Gesture::Pan:
{
return panDetectors;
}
- case DevelGesture::Pinch:
+ case Gesture::Pinch:
{
return pinchDetectors;
}
- case DevelGesture::LongPress:
+ case Gesture::LongPress:
{
return longPressDetectors;
}
- case DevelGesture::Tap:
+ case Gesture::Tap:
{
return tapDetectors;
}
- case DevelGesture::Rotation:
+ case Gesture::Rotation:
{
return rotationDetectors;
}
#define DALI_INTERNAL_ACTOR_GESTURE_DATA_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
// INTERNAL INCLUDES
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-detector-impl.h>
namespace Dali
* @param[in] type The gesture type.
* @return true if the gesture is required, false otherwise.
*/
- inline bool IsGestureRequred( DevelGesture::Type type ) const
+ inline bool IsGestureRequred( Gesture::Type type ) const
{
return type & gesturesRequired;
}
* @param[in] type The container type required
* @pre Ensure IsGestureRequired() is used to check if the container is actually available.
*/
- GestureDetectorContainer& GetGestureDetectorContainer( DevelGesture::Type type );
+ GestureDetectorContainer& GetGestureDetectorContainer( Gesture::Type type );
private:
* Helper to retrieve the appropriate container type.
* @param[in] type The container type required.
*/
- inline GestureDetectorContainer*& GetContainerPtr( DevelGesture::Type type );
+ inline GestureDetectorContainer*& GetContainerPtr( Gesture::Type type );
private:
- DevelGesture::Type gesturesRequired; ///< Stores which gestures are required
+ Gesture::Type gesturesRequired; ///< Stores which gestures are required
GestureDetectorContainer* panDetectors; ///< Pointer to a container of pan-detectors
GestureDetectorContainer* pinchDetectors; ///< Pointer to a container of pinch-detectors
namespace Internal
{
-GestureDetector::GestureDetector( DevelGesture::Type type, const SceneGraph::PropertyOwner* sceneObject )
+GestureDetector::GestureDetector( Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject )
: Object( sceneObject ),
mType( type ),
mGestureEventProcessor( ThreadLocalStorage::Get().GetGestureEventProcessor() )
{
}
-GestureDetector::GestureDetector( Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject )
-: GestureDetector( static_cast< DevelGesture::Type >( type ), sceneObject )
-{
-}
-
GestureDetector::~GestureDetector()
{
if ( !mPendingAttachActors.empty() )
#define DALI_INTERNAL_GESTURE_DETECTOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* Retrieves the type of GestureDetector
* @return The GestureDetector Type
*/
- DevelGesture::Type GetType() const
+ Gesture::Type GetType() const
{
return mType;
}
* @param pointer to the scene object, nullptr if none
* by default GestureDetectors don't have our own scene object
*/
- GestureDetector( DevelGesture::Type type, const SceneGraph::PropertyOwner* sceneObject = nullptr );
-
- /**
- * @copydoc GestureDetector( DevelGesture::Type, const SceneGraph::PropertyOwner* )
- */
GestureDetector( Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject = nullptr );
/**
protected:
- DevelGesture::Type mType; ///< The gesture detector will detect this type of gesture.
+ Gesture::Type mType; ///< The gesture detector will detect this type of gesture.
GestureDetectorActorContainer mAttachedActors; ///< Object::Observer is used to provide weak-pointer behaviour
GestureDetectorActorContainer mPendingAttachActors; ///< Object::Observer is used to provide weak-pointer behaviour
GestureEventProcessor& mGestureEventProcessor; ///< A reference to the gesture event processor.
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
switch (gestureDetector->GetType())
{
- case DevelGesture::LongPress:
+ case Gesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.AddGestureDetector(longPress, scene);
break;
}
- case DevelGesture::Pan:
+ case Gesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.AddGestureDetector(pan, scene, envOptionMinimumPanDistance, envOptionMinimumPanEvents);
break;
}
- case DevelGesture::Pinch:
+ case Gesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.AddGestureDetector(pinch, scene);
break;
}
- case DevelGesture::Tap:
+ case Gesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.AddGestureDetector(tap, scene);
break;
}
- case DevelGesture::Rotation:
+ case Gesture::Rotation:
{
RotationGestureDetector* rotation = static_cast<RotationGestureDetector*>(gestureDetector);
mRotationGestureProcessor.AddGestureDetector(rotation, scene);
{
switch (gestureDetector->GetType())
{
- case DevelGesture::LongPress:
+ case Gesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.RemoveGestureDetector(longPress);
break;
}
- case DevelGesture::Pan:
+ case Gesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.RemoveGestureDetector(pan);
break;
}
- case DevelGesture::Pinch:
+ case Gesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.RemoveGestureDetector(pinch);
break;
}
- case DevelGesture::Tap:
+ case Gesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.RemoveGestureDetector(tap);
break;
}
- case DevelGesture::Rotation:
+ case Gesture::Rotation:
{
RotationGestureDetector* rotation = static_cast<RotationGestureDetector*>(gestureDetector);
mRotationGestureProcessor.RemoveGestureDetector(rotation);
{
switch (gestureDetector->GetType())
{
- case DevelGesture::LongPress:
+ case Gesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.GestureDetectorUpdated(longPress);
break;
}
- case DevelGesture::Pan:
+ case Gesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.GestureDetectorUpdated(pan);
break;
}
- case DevelGesture::Pinch:
+ case Gesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.GestureDetectorUpdated(pinch);
break;
}
- case DevelGesture::Tap:
+ case Gesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.GestureDetectorUpdated(tap);
break;
}
- case DevelGesture::Rotation:
+ case Gesture::Rotation:
{
// Nothing to do
break;
void GestureEventProcessor::SetGestureProperties( const Gesture& gesture )
{
- bool requestUpdate = false;
+ DALI_ASSERT_DEBUG( gesture.type == Gesture::Pan && "Only PanGesture has a scene object\n" );
- switch ( static_cast< DevelGesture::Type >( gesture.type ) )
- {
- case DevelGesture::Pan:
- {
- const PanGesture& pan = static_cast< const PanGesture& >( gesture );
- requestUpdate = mPanGestureProcessor.SetPanGestureProperties( pan );
- break;
- }
-
- case DevelGesture::LongPress:
- case DevelGesture::Pinch:
- case DevelGesture::Tap:
- case DevelGesture::Rotation:
- {
- DALI_ASSERT_DEBUG( false && "Gesture type does not have scene object\n" );
- break;
- }
- }
-
- if( requestUpdate )
+ const PanGesture& pan = static_cast< const PanGesture& >( gesture );
+ if( mPanGestureProcessor.SetPanGestureProperties( pan ) )
{
// We may not be updating so we need to ask the render controller for an update.
mRenderController.RequestUpdate( false );
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
{
}
-GestureEvent::GestureEvent( DevelGesture::Type gesture, Gesture::State gestureState )
+GestureEvent::GestureEvent( Gesture::Type gesture, Gesture::State gestureState )
: gestureType( gesture ),
state( gestureState ),
time( 0 )
{
}
-
-GestureEvent::GestureEvent(Gesture::Type gesture, Gesture::State gestureState)
-: GestureEvent( static_cast< DevelGesture::Type >( gesture ), gestureState )
-{
-}
} // namespace Internal
} // namespace Dali
#define DALI_INTERNAL_EVENT_GESTURE_EVENT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
// INTERNAL INCLUDES
#include <dali/public-api/events/gesture.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/integration-api/events/event.h>
namespace Dali
/**
* Gesture Type.
*/
- DevelGesture::Type gestureType;
+ Gesture::Type gestureType;
/**
* The state of the gesture.
* @param[in] gesture The type of gesture event.
* @param[in] gestureState The state of the gesture event.
*/
- GestureEvent( DevelGesture::Type gesture, Gesture::State gestureState);
-
- /**
- * @copydoc GestureEvent( DevelGesture::Type, Gesture::State )
- */
- GestureEvent( Gesture::Type gesture, Gesture::State gestureState );
+ GestureEvent( Gesture::Type gesture, Gesture::State gestureState);
};
} // namespace Internal
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
struct GestureHitTestCheck : public HitTestAlgorithm::HitTestInterface
{
- GestureHitTestCheck( DevelGesture::Type type )
- : mType( type )
- {
- }
-
GestureHitTestCheck( Gesture::Type type )
- : GestureHitTestCheck( static_cast< DevelGesture::Type >( type ) )
+ : mType( type )
{
}
return layer->IsTouchConsumed();
}
- DevelGesture::Type mType;
+ Gesture::Type mType;
};
} // unnamed namespace
-GestureProcessor::GestureProcessor( DevelGesture::Type type )
+GestureProcessor::GestureProcessor( Gesture::Type type )
: mGestureRecognizer(),
mNeedsUpdate( false ),
mType( type ),
{
}
-GestureProcessor::GestureProcessor( Gesture::Type type )
-: GestureProcessor( static_cast< DevelGesture::Type >( type ) )
-{
-}
-
-
GestureProcessor::~GestureProcessor()
{
ResetActor();
#define DALI_INTERNAL_GESTURE_PROCESSOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
// INTERNAL INCLUDES
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-detector-impl.h>
#include <dali/internal/event/events/hit-test-algorithm-impl.h>
#include <dali/internal/event/events/gesture-recognizer.h>
/**
* Protected constructor. Cannot create an instance of GestureProcessor
*/
- GestureProcessor( DevelGesture::Type type );
-
- /**
- * Protected constructor. Cannot create an instance of GestureProcessor
- */
GestureProcessor( Gesture::Type type );
/**
private: // Data
- DevelGesture::Type mType; ///< Type of GestureProcessor
+ Gesture::Type mType; ///< Type of GestureProcessor
Actor* mCurrentGesturedActor; ///< The current actor that has been gestured.
bool mGesturedActorDisconnected:1; ///< Indicates whether the gestured actor has been disconnected from the scene
};
#define DALI_INTERNAL_GESTURE_RECOGNIZER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#include <dali/public-api/events/gesture.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/object/ref-object.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-event.h>
namespace Dali
* Returns the type of gesture detector.
* @return Type of gesture detector.
*/
- DevelGesture::Type GetType() const { return mType; }
+ Gesture::Type GetType() const { return mType; }
/**
* Called when we get a touch event.
* @param[in] screenSize The size of the screen.
* @param[in] detectorType The type of gesture detector.
*/
- GestureRecognizer( Vector2 screenSize, DevelGesture::Type detectorType )
+ GestureRecognizer( Vector2 screenSize, Gesture::Type detectorType )
: mScreenSize( screenSize ),
mType( detectorType ),
mScene( nullptr )
}
/**
- * copydoc GestureRecognizer( Vector2, DevelGesture::Type )
- */
- GestureRecognizer( Vector2 screenSize, Gesture::Type detectorType )
- : GestureRecognizer( screenSize, static_cast< DevelGesture::Type >( detectorType ) )
- {
- }
-
- /**
* Protected Constructor. Should only be able to create derived class objects.
*
* Use this constructor with the screen size is not used in the dereived class.
* @param[in] detectorType The type of gesture detector.
*/
- GestureRecognizer( DevelGesture::Type detectorType )
+ GestureRecognizer( Gesture::Type detectorType )
: GestureRecognizer( Vector2::ZERO, detectorType )
{
}
protected:
Vector2 mScreenSize;
- DevelGesture::Type mType;
+ Gesture::Type mType;
Scene* mScene;
};
#define DALI_INTERNAL_GESTURE_REQUESTS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
// INTERNAL INCLUDES
#include <dali/public-api/events/gesture.h>
-#include <dali/devel-api/events/gesture-devel.h>
namespace Dali
{
* Default Constructor
* @param[in] typeRequired The gesture type required
*/
- GestureRequest( DevelGesture::Type typeRequired )
- : type( typeRequired )
- {
- }
-
- /**
- * @copydoc GestureRequest( DevelGesture::Type )
- */
GestureRequest( Gesture::Type typeRequired )
- : GestureRequest( static_cast< DevelGesture::Type >( typeRequired ) )
+ : type( typeRequired )
{
}
// Data Members
- DevelGesture::Type type; ///< The type of gesture required.
+ Gesture::Type type; ///< The type of gesture required.
};
/**
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#include <cstring> // for strcmp
// INTERNAL INCLUDES
+#include <dali/public-api/events/rotation-gesture.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-event-processor.h>
#include <dali/integration-api/debug.h>
-#include <dali/devel-api/events/rotation-gesture.h>
namespace Dali
{
}
RotationGestureDetector::RotationGestureDetector()
-: GestureDetector( DevelGesture::Rotation )
+: GestureDetector( Gesture::Rotation )
{
}
#define DALI_INTERNAL_ROTATION_GESTURE_DETECTOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
// INTERNAL INCLUDES
+#include <dali/public-api/events/rotation-gesture-detector.h>
#include <dali/internal/event/events/gesture-detector-impl.h>
-#include <dali/devel-api/events/rotation-gesture-detector.h>
namespace Dali
{
#define DALI_INTERNAL_EVENT_ROTATION_GESTURE_EVENT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
// INTERNAL INCLUDES
#include <dali/public-api/math/radian.h>
#include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-event.h>
namespace Dali
* @param[in] state The state of the gesture
*/
RotationGestureEvent( Gesture::State state )
- : GestureEvent( DevelGesture::Rotation, state )
+ : GestureEvent( Gesture::Rotation, state )
{
}
// INTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/events/rotation-gesture.h>
#include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/rotation-gesture/rotation-gesture-event.h>
#include <dali/integration-api/debug.h>
#include <dali/internal/event/common/scene-impl.h>
#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.h>
#include <dali/internal/event/events/gesture-requests.h>
-#include <dali/devel-api/events/rotation-gesture.h>
namespace Dali
{
} // unnamed namespace
RotationGestureProcessor::RotationGestureProcessor()
-: GestureProcessor( DevelGesture::Rotation ),
+: GestureProcessor( Gesture::Rotation ),
mRotationGestureDetectors(),
mCurrentRotationEmitters(),
mCurrentRotationEvent( nullptr ),
// INTERNAL INCLUDES
#include <dali/public-api/events/touch-point.h>
#include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/internal/event/events/rotation-gesture/rotation-gesture-event.h>
#include <dali/internal/event/common/scene-impl.h>
} // unnamed namespace
RotationGestureRecognizer::RotationGestureRecognizer( Observer& observer, uint32_t minimumTouchEvents, uint32_t minimumTouchEventsAfterStart )
-: GestureRecognizer( DevelGesture::Rotation ),
+: GestureRecognizer( Gesture::Rotation ),
mObserver( observer ),
mState( Clear ),
mTouchEvents(),
#include <dali/public-api/events/pinch-gesture-detector.h>
#include <dali/public-api/events/pinch-gesture.h>
#include <dali/public-api/events/point-state.h>
+#include <dali/public-api/events/rotation-gesture-detector.h>
+#include <dali/public-api/events/rotation-gesture.h>
#include <dali/public-api/events/tap-gesture-detector.h>
#include <dali/public-api/events/tap-gesture.h>
#include <dali/public-api/events/touch-event.h>
#define DALI_GESTURE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
Pinch = 1 << 0, ///< When two touch points move away or towards each other. @SINCE_1_0.0
Pan = 1 << 1, ///< When the user drags their finger(s) in a particular direction. @SINCE_1_0.0
Tap = 1 << 2, ///< When the user taps the screen. @SINCE_1_0.0
- LongPress = 1 << 3 ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_0.0
+ LongPress = 1 << 3, ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_0.0
+ Rotation = 1 << 4, ///< When the user rotates two fingers around a particular ares of the screen. @SINCE_1_9.27
};
/**
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
// CLASS HEADER
-#include <dali/devel-api/events/rotation-gesture-detector.h>
+#include <dali/public-api/events/rotation-gesture-detector.h>
// INTERNAL INCLUDES
#include <dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.h>
#define DALI_ROTATION_GESTURE_DETECTOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* | %Signal Name | Method |
* |-------------------|-----------------------|
* | rotationDetected | @ref DetectedSignal() |
+ *
+ * @SINCE_1_9.27
*/
class DALI_CORE_API RotationGestureDetector : public GestureDetector
{
/**
* @brief Creates an uninitialized RotationGestureDetector; this can be initialized with RotationGestureDetector::New().
*
+ * @SINCE_1_9.27
* Calling member functions with an uninitialized RotationGestureDetector handle is not allowed.
*/
RotationGestureDetector();
/**
* @brief Creates an initialized RotationGestureDetector.
*
+ * @SINCE_1_9.27
* @return A handle to a newly allocated Dali resource
*/
static RotationGestureDetector New();
/**
* @brief Downcasts a handle to RotationGestureDetector handle.
*
+ * @SINCE_1_9.27
* If handle points to a RotationGestureDetector object, the
* downcast produces valid handle. If not, the returned handle is left uninitialized.
* @param[in] handle Handle to an object
/**
* @brief Destructor.
*
+ * @SINCE_1_9.27
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
~RotationGestureDetector();
/**
* @brief This copy constructor is required for (smart) pointer semantics.
*
+ * @SINCE_1_9.27
* @param[in] handle A reference to the copied handle
*/
RotationGestureDetector(const RotationGestureDetector& handle);
/**
* @brief This assignment operator is required for (smart) pointer semantics.
*
+ * @SINCE_1_9.27
* @param[in] rhs A reference to the copied handle
* @return A reference to this
*/
* @code
* void YourCallbackName( Actor actor, const RotationGesture& gesture );
* @endcode
+ * @SINCE_1_9.27
* @return The signal to connect to
* @pre The gesture detector has been initialized.
*/
/**
* @brief This constructor is used by RotationGestureDetector::New() methods.
*
+ * @SINCE_1_9.27
* @param[in] internal A pointer to a newly allocated Dali resource
*/
explicit DALI_INTERNAL RotationGestureDetector(Internal::RotationGestureDetector* internal);
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
// CLASS HEADER
-#include <dali/devel-api/events/rotation-gesture.h>
+#include <dali/public-api/events/rotation-gesture.h>
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
-#include <dali/devel-api/events/gesture-devel.h>
namespace Dali
{
RotationGesture::RotationGesture( Gesture::State state )
-: Gesture( static_cast< Gesture::Type >( DevelGesture::Rotation ), state )
+: Gesture( Gesture::Rotation, state )
{
}
#define DALI_ROTATION_GESTURE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*
* A rotation gesture will continue to be sent to the actor under the center point of the rotation
* until the rotation ends.
+ * @SINCE_1_9.27
*/
struct DALI_CORE_API RotationGesture: public Gesture
{
/**
* @brief Default Constructor.
- *
+ * @SINCE_1_9.27
* @param[in] state The state of the gesture
*/
RotationGesture( Gesture::State state );
/**
* @brief Copy constructor.
+ * @SINCE_1_9.27
* @param[in] rhs A reference to the copied handle
*/
RotationGesture( const RotationGesture& rhs );
/**
* @brief Assignment operator.
+ * @SINCE_1_9.27
* @param[in] rhs A reference to the copied handle
* @return A reference to this
*/
/**
* @brief Virtual destructor.
+ * @SINCE_1_9.27
*/
virtual ~RotationGesture();
/**
* @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
+ * @SINCE_1_9.27
*/
Radian rotation;
/**
* @brief The center point of the two points that caused the rotation gesture in screen coordinates.
+ * @SINCE_1_9.27
*/
Vector2 screenCenterPoint;
/**
* @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
+ * @SINCE_1_9.27
*/
Vector2 localCenterPoint;
};
${public_api_src_dir}/events/pan-gesture-detector.cpp
${public_api_src_dir}/events/pinch-gesture.cpp
${public_api_src_dir}/events/pinch-gesture-detector.cpp
+ ${public_api_src_dir}/events/rotation-gesture.cpp
+ ${public_api_src_dir}/events/rotation-gesture-detector.cpp
${public_api_src_dir}/events/tap-gesture.cpp
${public_api_src_dir}/events/tap-gesture-detector.cpp
${public_api_src_dir}/events/touch-point.cpp
${public_api_src_dir}/events/pinch-gesture.h
${public_api_src_dir}/events/pinch-gesture-detector.h
${public_api_src_dir}/events/point-state.h
+ ${public_api_src_dir}/events/rotation-gesture.h
+ ${public_api_src_dir}/events/rotation-gesture-detector.h
${public_api_src_dir}/events/tap-gesture.h
${public_api_src_dir}/events/tap-gesture-detector.h
${public_api_src_dir}/events/touch-point.h