* @param[in] location The TEST_LOCATION macro should be used here
*/
template<>
-inline void DALI_TEST_EQUALS<const TextArray&>( const TextArray& str1, const TextArray& str2, const char* location)
+inline void DALI_TEST_EQUALS<const Integration::TextArray&>( const Integration::TextArray& str1, const Integration::TextArray& str2, const char* location)
{
- if (!std::equal(str1.begin(), str1.end(), str2.begin()))
+ if (!std::equal(str1.Begin(), str1.End(), str2.Begin()))
{
fprintf(stderr, "%s, checking '", location);
- for( unsigned int i = 0; i < str1.size(); ++i)
+ for( unsigned int i = 0; i < str1.Count(); ++i)
{
fprintf(stderr, "%c", str1[i]);
}
fprintf(stderr, "' == '");
- for( unsigned int i = 0; i < str2.size(); ++i)
+ for( unsigned int i = 0; i < str2.Count(); ++i)
{
fprintf(stderr, "%c", str2[i]);
}
#define __DALI_ACCESSIBILITY_MANAGER_H__
#define __DALI_TIMER_H__
#define __DALI_CLIPBOARD_H__
-#define IMFMANAGER_H
+#define __DALI_IMF_MANAGER_H__
#include <dali-test-suite-utils.h>
mSurfaceWidth( surfaceWidth ),
mSurfaceHeight( surfaceHeight ),
mFrame( 0u ),
- mDpi( horizontalDpi, verticalDpi )
+ mDpi( horizontalDpi, verticalDpi ),
+ mLastVSyncTime(0u)
{
Initialize();
}
mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
}
-bool TestApplication::Render( unsigned int intervalMilliseconds )
+void TestApplication::DoUpdate( unsigned int intervalMilliseconds )
{
- // Update Time values
- mPlatformAbstraction.IncrementGetTimeResult( intervalMilliseconds );
unsigned int seconds(0u), microseconds(0u);
mPlatformAbstraction.GetTimeMicroseconds( seconds, microseconds );
+ mLastVSyncTime = ( seconds * 1e3 ) + ( microseconds / 1e3 );
+ unsigned int nextVSyncTime = mLastVSyncTime + 16;
+
+ // Update Time values
+ mPlatformAbstraction.IncrementGetTimeResult( intervalMilliseconds );
+
+ float elapsedSeconds = intervalMilliseconds / 1e3f;
+ mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus );
+}
- mCore->VSync( mFrame, seconds, microseconds );
- mCore->Update( mStatus );
+bool TestApplication::Render( unsigned int intervalMilliseconds )
+{
+ DoUpdate( intervalMilliseconds );
mCore->Render( mRenderStatus );
mFrame++;
bool TestApplication::UpdateOnly( unsigned int intervalMilliseconds )
{
- // Update Time values
- mPlatformAbstraction.IncrementGetTimeResult( intervalMilliseconds );
- unsigned int seconds(0u), microseconds(0u);
- mPlatformAbstraction.GetTimeMicroseconds( seconds, microseconds );
-
- mCore->VSync( mFrame, seconds, microseconds );
- mCore->Update( mStatus );
-
+ DoUpdate( intervalMilliseconds );
return mStatus.KeepUpdating();
}
bool RenderOnly( );
void ResetContext();
+private:
+ void DoUpdate( unsigned int intervalMilliseconds );
+
protected:
TestPlatformAbstraction mPlatformAbstraction;
TestRenderController mRenderController;
unsigned int mFrame;
Vector2 mDpi;
+ unsigned int mLastVSyncTime;
};
} // Dali
/**
* @copydoc PlatformAbstraction::GetFontFamilyForChars()
*/
-const std::string& TestPlatformAbstraction::GetFontFamilyForChars(const TextArray& charsRequested) const
+const std::string& TestPlatformAbstraction::GetFontFamilyForChars(const Integration::TextArray& charsRequested) const
{
mTrace.PushCall("GetFontFamilyForChars", "");
return mGetDefaultFontFamilyResult;
/**
* @copydoc PlatformAbstraction::AllGlyphsSupported()
*/
-bool TestPlatformAbstraction::AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const TextArray& text) const
+bool TestPlatformAbstraction::AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const Integration::TextArray& text) const
{
mTrace.PushCall("AllGlyphsSupported", "");
return true;
/**
* @copydoc PlatformAbstraction::GetFontFamilyForChars()
*/
- virtual const std::string& GetFontFamilyForChars(const TextArray& charsRequested) const;
+ virtual const std::string& GetFontFamilyForChars(const Integration::TextArray& charsRequested) const;
/**
* @copydoc PlatformAbstraction::AllGlyphsSupported()
*/
- virtual bool AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const TextArray& text) const;
+ virtual bool AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const Integration::TextArray& text) const;
/**
* @copydoc PlatformAbstraction::ValidateFontFamilyName()
#define __DALI_ACCESSIBILITY_MANAGER_H__
#define __DALI_TIMER_H__
#define __DALI_CLIPBOARD_H__
-#define IMFMANAGER_H
+#define __DALI_IMF_MANAGER_H__
#include "toolkit-adaptor.h"
#include <map>
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/signals/dali-signal-v2.h>
-#include <dali/public-api/orientation.h>
+#include <dali/public-api/adaptor-framework/orientation.h>
namespace Dali
{
#include <string>
// PUBLIC INCLUDES
-#include <dali/public-api/clipboard-event-notifier.h>
+#include <dali/public-api/adaptor-framework/clipboard-event-notifier.h>
namespace Dali
{
-#ifndef _DALI_ADAPTOR_IMF_MANAGER_H_
-#define _DALI_ADAPTOR_IMF_MANAGER_H_
+#ifndef __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__
+#define __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#define IMFMANAGER_H
+#define __DALI_IMF_MANAGER_H__
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal-v2.h>
} // namespace Dali
-#endif // _DALI_ADAPTOR_IMF_MANAGER_H_
+#endif // __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__
// EXTERNAL INCLUDES
#include <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/orientation.h>
+#include <dali/public-api/adaptor-framework/orientation.h>
namespace Dali
{
#define __DALI_STYLE_MONITOR_H__
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal-v2.h>
-#include <dali/public-api/style-change.h>
+#include <dali/public-api/adaptor-framework/style-change.h>
namespace Dali
{
namespace
{
-static bool gObjectCreatedCallBackCalled;
+bool gObjectCreatedCallBackCalled;
-static void TestCallback(BaseHandle handle)
+void TestCallback(BaseHandle handle)
{
gObjectCreatedCallBackCalled = true;
}
+void TestVoidCallback()
+{
+}
+
} // namespace
///////////////////////////////////////////////////////////////////////////////////////////////////
END_TEST;
}
+
+int UtcDaliControlGestureSignals(void)
+{
+ ToolkitTestApplication application;
+ ConnectionTracker connectionTracker;
+ Control control = Control::New();
+
+ // Each gesture detector gets created when connecting to the gesture signals
+ DALI_TEST_CHECK( !control.GetTapGestureDetector() );
+ control.ConnectSignal( &connectionTracker, Control::SIGNAL_TAPPED, &TestVoidCallback );
+ DALI_TEST_CHECK( control.GetTapGestureDetector() );
+
+ DALI_TEST_CHECK( !control.GetPanGestureDetector() );
+ control.ConnectSignal( &connectionTracker, Control::SIGNAL_PANNED, &TestVoidCallback );
+ DALI_TEST_CHECK( control.GetPanGestureDetector() );
+
+ DALI_TEST_CHECK( !control.GetPinchGestureDetector() );
+ control.ConnectSignal( &connectionTracker, Control::SIGNAL_PINCHED, &TestVoidCallback );
+ DALI_TEST_CHECK( control.GetPinchGestureDetector() );
+
+ DALI_TEST_CHECK( !control.GetLongPressGestureDetector() );
+ control.ConnectSignal( &connectionTracker, Control::SIGNAL_LONG_PRESSED, &TestVoidCallback );
+ DALI_TEST_CHECK( control.GetLongPressGestureDetector() );
+
+ END_TEST;
+}
}
}
- ApplyProperties( root, node, handle, replacements );
-
- if( actor)
+ if( actor )
{
// add children of all the styles
if( OptionalChild actors = IsChild( node, KEYNAME_ACTORS ) )
parent.Add( actor );
}
}
-
+ else
+ {
+ ApplyProperties( root, node, handle, replacements );
+ }
}
else
{
}
}
+void ScrollViewTwistEffect::SetMaxSwingAngle(const Vector2& maxSwingAngle)
+{
+ mMaxSwingAngle = maxSwingAngle;
+}
+
+Vector2 ScrollViewTwistEffect::GetMaxSwingAngle() const
+{
+ return mMaxSwingAngle;
+}
+
void ScrollViewTwistEffect::SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function)
{
- if( mDropOffDistance.LengthSquared() > Math::MACHINE_EPSILON_1 && mDropOff.LengthSquared() > Math::MACHINE_EPSILON_1 )
+ if( distance.LengthSquared() > Math::MACHINE_EPSILON_1 && dropOff.LengthSquared() > Math::MACHINE_EPSILON_1 )
{
mFlags |= FlagDropOff;
mDropOff = dropOff;
mFlags = mFlags & ~FlagDefaultDropOff;
}
+void ScrollViewTwistEffect::GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const
+{
+ dropOff = mDropOff;
+ distance = mDropOffDistance;
+ function = mDropOffFunction;
+}
+
void ScrollViewTwistEffect::OnAttach(Toolkit::ScrollView& scrollView)
{
// Create effect-time property if not already created.
/**
* @copydoc Toolkit::ScrollViewEffect::SetMaxSwingAngle
*/
- void SetMaxSwingAngle(const Vector2& maxSwingAngle) { mMaxSwingAngle = maxSwingAngle; }
+ void SetMaxSwingAngle(const Vector2& maxSwingAngle);
+
+ /**
+ * @copydoc Toolkit::ScrollViewEffect::GetMaxSwingAngle
+ */
+ Vector2 GetMaxSwingAngle() const;
/**
* @copydoc Toolkit::ScrollViewEffect::SetSwingDropOff
*/
void SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function = NULL);
+ /**
+ * @copydoc Toolkit::ScrollViewEffect::GetSwingDropOff
+ */
+ void GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const;
+
public:
/**
scrollOffset.x += cursorPosition.x;
}
- if( cursorPosition.y - cursorSize.height < 0.f )
- {
- scrollOffset.y += ( cursorPosition.y - cursorSize.height );
- }
- else if( cursorPosition.y > controlSize.height )
+ if( cursorPosition.y - cursorSize.height < 0.f || cursorPosition.y > controlSize.height )
{
scrollOffset.y += cursorPosition.y;
}
TypeAction ACTION_TYPE_1( CONTROL_TYPE, Toolkit::Control::ACTION_CONTROL_ACTIVATED, &Internal::Control::DoAction );
+SignalConnectorType SIGNAL_CONNECTOR_1( CONTROL_TYPE, Toolkit::Control::SIGNAL_KEY_EVENT, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_2( CONTROL_TYPE, Toolkit::Control::SIGNAL_TAPPED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_3( CONTROL_TYPE, Toolkit::Control::SIGNAL_PANNED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_4( CONTROL_TYPE, Toolkit::Control::SIGNAL_PINCHED, &Internal::Control::DoConnectSignal );
+SignalConnectorType SIGNAL_CONNECTOR_5( CONTROL_TYPE, Toolkit::Control::SIGNAL_LONG_PRESSED, &Internal::Control::DoConnectSignal );
+
/**
* Structure which holds information about the background of a control
*/
return ret;
}
+bool Control::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+ Dali::BaseHandle handle( object );
+
+ bool connected( false );
+ Toolkit::Control control = Toolkit::Control::DownCast(handle);
+ if ( control )
+ {
+ Control& controlImpl( control.GetImplementation() );
+ connected = true;
+
+ if ( Toolkit::Control::SIGNAL_KEY_EVENT == signalName )
+ {
+ controlImpl.KeyEventSignal().Connect( tracker, functor );
+ }
+ else if( Toolkit::Control::SIGNAL_TAPPED == signalName )
+ {
+ controlImpl.EnableGestureDetection( Gesture::Tap );
+ controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
+ }
+ else if( Toolkit::Control::SIGNAL_PANNED == signalName )
+ {
+ controlImpl.EnableGestureDetection( Gesture::Pan );
+ controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
+ }
+ else if( Toolkit::Control::SIGNAL_PINCHED == signalName )
+ {
+ controlImpl.EnableGestureDetection( Gesture::Pinch );
+ controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
+ }
+ else if( Toolkit::Control::SIGNAL_LONG_PRESSED == signalName )
+ {
+ controlImpl.EnableGestureDetection( Gesture::LongPress );
+ controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
+ }
+ else
+ {
+ // signalName does not match any signal
+ connected = false;
+ }
+ }
+ return connected;
+}
+
void Control::DoStyleChange( Toolkit::StyleManager styleManager, StyleChange change )
{
if( change.themeChange )
mImpl->SignalDisconnected( slotObserver, callback );
}
-std::size_t Control::GetConnectionCount() const
-{
- return mImpl->GetConnectionCount();
-}
-
Control::Control( ControlBehaviour behaviourFlags )
: CustomActorImpl( behaviourFlags & REQUIRES_TOUCH_EVENTS ),
mImpl(new Impl(*this))
static bool DoAction(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes);
/**
+ * Connects a callback function with the object's signals.
+ * @param[in] object The object providing the signal.
+ * @param[in] tracker Used to disconnect the signal.
+ * @param[in] signalName The signal to connect to.
+ * @param[in] functor A newly allocated FunctorDelegate.
+ * @return True if the signal was connected.
+ * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
+ */
+ static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+
+ /**
* @brief If deriving classes wish to fine tune pinch gesture
* detection then they can access the gesture detector through this
* API and modify the detection.
*/
virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback );
- /**
- * @copydoc ConnectionTrackerInterface::GetConnectionCount
- */
- virtual std::size_t GetConnectionCount() const;
-
protected:
/**
{
const char* const Control::ACTION_CONTROL_ACTIVATED = "control-activated";
+
const char* const Control::SIGNAL_KEY_EVENT = "key-event";
+const char* const Control::SIGNAL_TAPPED = "tapped";
+const char* const Control::SIGNAL_PANNED = "panned";
+const char* const Control::SIGNAL_PINCHED = "pinched";
+const char* const Control::SIGNAL_LONG_PRESSED = "long-pressed";
Control Control::New()
{
/// @name Signals
/** @{ */
static const char* const SIGNAL_KEY_EVENT; ///< name "key-event"
+ static const char* const SIGNAL_TAPPED; ///< name "tapped"
+ static const char* const SIGNAL_PANNED; ///< name "panned"
+ static const char* const SIGNAL_PINCHED; ///< name "pinched"
+ static const char* const SIGNAL_LONG_PRESSED; ///< name "long-pressed"
/** @} */
/// @name Actions
GetImpl(*this).SetMaxSwingAngle(maxSwingAngle);
}
+Vector2 ScrollViewTwistEffect::GetMaxSwingAngle() const
+{
+ return GetImpl( *this ).GetMaxSwingAngle();
+}
+
void ScrollViewTwistEffect::SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function)
{
GetImpl(*this).SetSwingDropOff(dropOff, distance, function);
}
+void ScrollViewTwistEffect::GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const
+{
+ GetImpl(*this).GetSwingDropOff(dropOff, distance, function);
+}
+
} // namespace Toolkit
} // namespace Dali
void SetMaxSwingAngle(const Vector2& maxSwingAngle);
/**
+ * @brief Retrieve the maximum swing angle when at zero drop off.
+ *
+ * @return The maximum swing angle for x and y axes
+ */
+ Vector2 GetMaxSwingAngle() const;
+
+ /**
* @brief Set the drop off values to affect the amount of swing
* angle applied to an actor the further it is from the scroll
* position.
*/
void SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function = NULL);
+ /**
+ * @brief Get the drop off values that affect the amount of swing angle that is applied to an actor.
+ *
+ * @param[out] dropOff The current drop-off amount.
+ * @param[out] distance The current distance to apply drop-off in pixels.
+ * @param[out] function The current alpha function used to affect how the drop iff is applied over the distance.
+ */
+ void GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const;
+
protected:
/**
* the boundary height the stage height minus the title's height.
* Restrictions - The boundary box should be set up with a fixed z position for the text-input and the default camera.
* @param[in] boundingOriginAndSize Rect( x coordinate, y coordinate, width, height )
- * ------------------------------------------
- * |(x,y) |
- * |o---------------------------------------|
- * || ||
- * || Bounding Box || boundary height
- * || ||
- * |----------------------------------------|
- * ------------------------------------------
- * boundary width
+ * @code
+ * +----------------------------------------+
+ * |(x,y) |
+ * |+--------------------------------------+|
+ * || ||
+ * || Bounding Box || boundary height
+ * || ||
+ * |+--------------------------------------+|
+ * +----------------------------------------+
+ * boundary width
+ * @endcode
*/
void SetBoundingRectangle( const Rect<float>& boundingOriginAndSize );
prefix=@prefix@
exec_prefix=@exec_prefix@
apiversion=@DALI_TOOLKIT_VERSION@
-libdir=${exec_prefix}/lib
+libdir=@libdir@
includedir=@devincludepath@
Name: Samsung OpenGLES Toolkit (including Toolkit)
TYPEDEF_HIDES_STRUCT = NO
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
SHOW_USED_FILES = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = YES
-
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
HTML_STYLESHEET =
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font.
-DOT_FONTNAME = FreeSans
+DOT_FONTNAME =
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
- <tab type="dirs" visible="yes" title="" intro=""/>
<tab type="examples" visible="yes" title="" intro=""/>
<tab type="user" visible="yes" title="Deprecated" intro="" url="deprecated.html"/>
</navindex>
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 4;
+const unsigned int TOOLKIT_MICRO_VERSION = 6;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.0.4
+Version: 1.0.6
Release: 1
Group: System/Libraries
License: Apache-2.0