#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
+#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
using namespace Dali;
namespace Dali
{
-
namespace Toolkit
{
-
///////////////////////////////////////////////////////////////////////////////////////////////////
// RulerDomain
///////////////////////////////////////////////////////////////////////////////////////////////////
return Clamp(x, length, scale, clamped);
}
-float RulerDomain::Clamp(float x, float length, float scale, ClampState &clamped) const
+float RulerDomain::Clamp(float x, float length, float scale, ClampState& clamped) const
{
if(!enabled)
{
float RulerDomain::GetSize() const
{
- return max-min;
+ return max - min;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
Ruler::Ruler()
: mType(FREE),
mEnabled(true),
- mDomain(RulerDomain(0.0f,1.0f,false))
+ mDomain(RulerDomain(0.0f, 1.0f, false))
{
}
mDomain = domain;
}
-const RulerDomain &Ruler::GetDomain() const
+const RulerDomain& Ruler::GetDomain() const
{
return mDomain;
}
void Ruler::DisableDomain()
{
- mDomain = RulerDomain(0.0f,1.0f,false);
+ mDomain = RulerDomain(0.0f, 1.0f, false);
}
float Ruler::Clamp(float x, float length, float scale) const
return mDomain.Clamp(x, length, scale);
}
-float Ruler::Clamp(float x, float length, float scale, ClampState &clamped) const
+float Ruler::Clamp(float x, float length, float scale, ClampState& clamped) const
{
return mDomain.Clamp(x, length, scale, clamped);
}
return Clamp(Snap(x, bias), length, scale);
}
-float Ruler::SnapAndClamp(float x, float bias, float length, float scale, ClampState &clamped) const
+float Ruler::SnapAndClamp(float x, float bias, float length, float scale, ClampState& clamped) const
{
return Clamp(Snap(x, bias), length, scale, clamped);
}
return x;
}
-float DefaultRuler::GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const
+float DefaultRuler::GetPositionFromPage(unsigned int page, unsigned int& volume, bool wrap) const
{
volume = 0;
return 0.0f;
{
if(fabsf(mSpacing) <= Math::MACHINE_EPSILON_1)
{
- DALI_LOG_ERROR( "Page spacing too small (%f).\n", double(spacing) );
+ DALI_LOG_ERROR("Page spacing too small (%f).\n", double(spacing));
mSpacing = spacing >= 0.0f ? Math::MACHINE_EPSILON_1 : -Math::MACHINE_EPSILON_1;
}
mType = FIXED;
return floor(x / mSpacing + bias) * mSpacing;
}
-float FixedRuler::GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const
+float FixedRuler::GetPositionFromPage(unsigned int page, unsigned int& volume, bool wrap) const
{
float position = mDomain.min;
volume = 0;
// spacing must be present.
- if( mEnabled )
+ if(mEnabled)
{
unsigned int column = page;
if(wrap)
{
unsigned int pagesPerVolume = mDomain.GetSize() / mSpacing;
- if(pagesPerVolume>0)
+ if(pagesPerVolume > 0)
{
column += pagesPerVolume;
column %= pagesPerVolume;
- volume = page/pagesPerVolume;
+ volume = page / pagesPerVolume;
}
}
position = mDomain.min + column * mSpacing;
}
- else // Domain (or Spacing) is not present, carry page to volume.
+ else // Domain (or Spacing) is not present, carry page to volume.
{
if(wrap)
{
unsigned int page = 0;
// spacing must be present.
- if( mEnabled )
+ if(mEnabled)
{
- if( wrap )
+ if(wrap)
{
position = WrapInDomain(position, mDomain.min, mDomain.max);
}
if(pagesPerVolume < 1u)
{
pagesPerVolume = 1u;
- DALI_LOG_ERROR("Ruler domain(%f) is smaller than its spacing(%f).\n", mDomain.GetSize() * 1.0, mSpacing * 1.0 );
+ DALI_LOG_ERROR("Ruler domain(%f) is smaller than its spacing(%f).\n", mDomain.GetSize() * 1.0, mSpacing * 1.0);
}
page %= pagesPerVolume;
}
unsigned int pagesPerVolume = 1;
// spacing must be present.
- if( mEnabled )
+ if(mEnabled)
{
pagesPerVolume = mDomain.GetSize() / mSpacing;
}
{
}
-ScrollView::ScrollView( Dali::Internal::CustomActor* internal )
-: Scrollable( internal )
+ScrollView::ScrollView(Dali::Internal::CustomActor* internal)
+: Scrollable(internal)
{
VerifyCustomActorPointer<Internal::ScrollView>(internal);
}
-ScrollView::ScrollView( const ScrollView& handle ) = default;
+ScrollView::ScrollView(const ScrollView& handle) = default;
-ScrollView::ScrollView( ScrollView&& rhs ) = default;
+ScrollView::ScrollView(ScrollView&& rhs) = default;
-ScrollView& ScrollView::operator=( const ScrollView& handle ) = default;
+ScrollView& ScrollView::operator=(const ScrollView& handle) = default;
-ScrollView& ScrollView::operator=( ScrollView&& rhs ) = default;
+ScrollView& ScrollView::operator=(ScrollView&& rhs) = default;
ScrollView ScrollView::New()
{
{
}
-ScrollView ScrollView::DownCast( BaseHandle handle )
+ScrollView ScrollView::DownCast(BaseHandle handle)
{
return Control::DownCast<ScrollView, Internal::ScrollView>(handle);
}
return GetImpl(*this).GetMinimumDistanceForFlick();
}
-void ScrollView::SetMinimumDistanceForFlick( const Vector2& distance )
+void ScrollView::SetMinimumDistanceForFlick(const Vector2& distance)
{
GetImpl(*this).SetMinimumDistanceForFlick(distance);
}
return GetImpl(*this).GetMinimumSpeedForFlick();
}
-void ScrollView::SetMinimumSpeedForFlick( float speed )
+void ScrollView::SetMinimumSpeedForFlick(float speed)
{
GetImpl(*this).SetMinimumSpeedForFlick(speed);
}
return GetImpl(*this).GetCurrentPage();
}
-void ScrollView::ScrollTo(const Vector2 &position)
+void ScrollView::ScrollTo(const Vector2& position)
{
GetImpl(*this).ScrollTo(position);
}
-void ScrollView::ScrollTo(const Vector2 &position, float duration)
+void ScrollView::ScrollTo(const Vector2& position, float duration)
{
GetImpl(*this).ScrollTo(position, duration);
}
-void ScrollView::ScrollTo(const Vector2 &position, float duration, AlphaFunction alpha)
+void ScrollView::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha)
{
GetImpl(*this).ScrollTo(position, duration, alpha);
}
-void ScrollView::ScrollTo(const Vector2 &position, float duration,
- DirectionBias horizontalBias, DirectionBias verticalBias)
+void ScrollView::ScrollTo(const Vector2& position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias)
{
GetImpl(*this).ScrollTo(position, duration, horizontalBias, verticalBias);
}
-void ScrollView::ScrollTo(const Vector2 &position, float duration, AlphaFunction alpha,
- DirectionBias horizontalBias, DirectionBias verticalBias)
+void ScrollView::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias)
{
GetImpl(*this).ScrollTo(position, duration, alpha, horizontalBias, verticalBias);
}
GetImpl(*this).ScrollTo(page, duration, bias);
}
-void ScrollView::ScrollTo(Actor &actor)
+void ScrollView::ScrollTo(Actor& actor)
{
GetImpl(*this).ScrollTo(actor);
}
-void ScrollView::ScrollTo(Actor &actor, float duration)
+void ScrollView::ScrollTo(Actor& actor, float duration)
{
GetImpl(*this).ScrollTo(actor, duration);
}
return GetImpl(*this).SnapStartedSignal();
}
-void ScrollView::SetScrollingDirection( Radian direction, Radian threshold )
+void ScrollView::SetScrollingDirection(Radian direction, Radian threshold)
{
- GetImpl(*this).SetScrollingDirection( direction, threshold );
+ GetImpl(*this).SetScrollingDirection(direction, threshold);
}
-void ScrollView::RemoveScrollingDirection( Radian direction )
+void ScrollView::RemoveScrollingDirection(Radian direction)
{
- GetImpl(*this).RemoveScrollingDirection( direction );
+ GetImpl(*this).RemoveScrollingDirection(direction);
}
} // namespace Toolkit