-#ifndef __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__
+#ifndef DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H
+#define DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H
/*
- * Copyright (c) 2017 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/threading/mutex.h>
#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/events/pan-gesture.h>
+#include <dali/internal/event/events/pan-gesture/pan-gesture-impl.h>
#include <dali/internal/update/common/property-owner.h>
#include <dali/internal/update/gestures/gesture-properties.h>
namespace Dali
{
-struct PanGesture;
+class PanGesture;
namespace Internal
{
*/
PanInfo()
: time( 0u ),
- state( Gesture::Clear ),
+ state( GestureState::CLEAR ),
read( true )
{
}
* Assignment operator
* @param[in] gesture A Dali::Gesture
*/
- PanInfo& operator=( const Dali::PanGesture& rhs )
+ PanInfo& operator=( const Internal::PanGesture& rhs )
{
- time = rhs.time;
- state = rhs.state;
+ time = rhs.GetTime();
+ state = rhs.GetState();
- local.velocity = rhs.velocity;
- local.displacement = rhs.displacement;
- local.position = rhs.position;
+ local.velocity = rhs.GetVelocity();
+ local.displacement = rhs.GetDisplacement();
+ local.position = rhs.GetPosition();
- screen.velocity = rhs.screenVelocity;
- screen.displacement = rhs.screenDisplacement;
- screen.position = rhs.screenPosition;
+ screen.velocity = rhs.GetScreenVelocity();
+ screen.displacement = rhs.GetScreenDisplacement();
+ screen.position = rhs.GetScreenPosition();
return *this;
}
// Data
unsigned int time;
- Gesture::State state;
+ GestureState state;
Info local;
Info screen;
volatile bool read;
};
- typedef std::vector<PanInfo> PanInfoHistory;
- typedef PanInfoHistory::iterator PanInfoHistoryIter;
- typedef PanInfoHistory::const_iterator PanInfoHistoryConstIter;
+ using PanInfoHistory = std::vector<PanInfo>;
+ using PanInfoHistoryIter = PanInfoHistory::iterator;
+ using PanInfoHistoryConstIter = PanInfoHistory::const_iterator;
private:
static const unsigned int PAN_GESTURE_HISTORY = 30u;
/**
* Virtual destructor
*/
- virtual ~PanGesture();
+ ~PanGesture() override;
/**
* Adds a PanGesture to the internal circular-buffer waiting to be handled by UpdateProperties.
* @param[in] gesture The latest pan gesture.
*/
- void AddGesture( const Dali::PanGesture& gesture );
+ void AddGesture( const Internal::PanGesture& gesture );
/**
* @brief Removes pan events from the history that are older than maxAge, leaving at least minEvents
// Struct to keep pairs of local and screen data together.
// TODO: This can encapsulate some functionality also.
- typedef struct
+ using RelativeVectors = struct
+
{
Vector2 local;
+
Vector2 screen;
- } RelativeVectors;
+ };
/**
* Houses new code to process input events and generate an output point.
volatile unsigned int mWritePosition; ///< The next PanInfo buffer to write to. (starts at 0).
unsigned int mReadPosition; ///< The next PanInfo buffer to read. (starts at 0).
bool mNotAtTarget; ///< Keeps track of if the last gesture used was the most recent received.
- bool mInGesture; ///< True if the gesture is currently being handled i.e. between Started <-> Finished/Cancelled.
+ bool mInGesture; ///< True if the gesture is currently being handled i.e. between STARTED <-> FINISHED/CANCELLED.
bool mPredictionAmountOverridden;
bool mSmoothingAmountOverridden;
} // namespace Dali
-#endif // __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__
+#endif // DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H