{
const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
-const unsigned int EMOJI_FONT_SIZE = 3968u;
+const unsigned int EMOJI_FONT_SIZE = 3840u; // 60 * 64
const unsigned int NON_DEFAULT_FONT_SIZE = 40u;
struct MergeFontDescriptionsData
// Load some fonts.
fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
- fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenColorEmoji.ttf", EMOJI_FONT_SIZE );
+ fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf", EMOJI_FONT_SIZE );
fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf", pointSize01 );
fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf", pointSize02 );
fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf", pointSize01 );
// Font id 1 --> TizenSansArabicRegular.ttf
// Font id 2 --> TizenSansHebrewRegular.ttf
- // Font id 3 --> TizenColorEmoji.ttf
+ // Font id 3 --> BreezeColorEmoji.ttf
// Font id 4 --> TizenSansRegular.ttf, size 8
// Font id 5 --> TizenSansRegular.ttf, size 16
// Font id 6 --> TizenSansHebrewRegular.ttf, size 8
0u,
4u
},
- const_cast<char*>( "TizenColorEmoji" ),
- 15u,
+ const_cast<char*>( "BreezeColorEmoji" ),
+ 16u,
TextAbstraction::FontWeight::NORMAL,
TextAbstraction::FontWidth::NORMAL,
TextAbstraction::FontSlant::NORMAL,
{
"Emojis",
"\xF0\x9F\x98\x81\xF0\x9F\x98\x82\xF0\x9F\x98\x83\xF0\x9F\x98\x84",
- "/tizen/TizenColorEmoji.ttf",
+ "/tizen/BreezeColorEmoji.ttf",
EMOJI_FONT_SIZE,
0u,
4u,
namespace
{
const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
-const PointSize26Dot6 EMOJI_FONT_SIZE = 62u * 64u;
+const PointSize26Dot6 EMOJI_FONT_SIZE = 3840u; // 60 * 64
} // namespace
int UtcDaliTextTypesetter(void)
const std::string pathName( pathNamePtr );
free( pathNamePtr );
- fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenColorEmoji.ttf", EMOJI_FONT_SIZE );
+ fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf", EMOJI_FONT_SIZE );
fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
// Creates a text controller.
// Sets the text.
controller->SetMarkupProcessorEnabled( true );
- controller->SetText( "<font family='TizenSansRegular'>Hello world </font><font family='TizenColorEmoji'>\xF0\x9F\x98\x81</font>" );
+ controller->SetText( "<font family='TizenSansRegular'>Hello world </font><font family='BreezeColorEmoji'>\xF0\x9F\x98\x81</font>" );
// Creates the text's model and relais-out the text.
const Size relayoutSize( 120.f, 60.f );
mTextureTrace.PushCall("TexSubImage2D", out.str(), namedParams);
}
- inline void Uniform1f(GLint location, GLfloat x)
+ inline void Uniform1f(GLint location, GLfloat value )
{
- if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, x ) )
+ std::string params = ToString( value );
+ AddUniformCallToTraceStack( location, params );
+
+ if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, value ) )
{
mGetErrorResult = GL_INVALID_OPERATION;
}
inline void Uniform1fv(GLint location, GLsizei count, const GLfloat* v)
{
+ std::string params;
+ for( int i = 0; i < count; ++i )
+ {
+ params = params + ToString( v[i] ) + ",";
+ }
+
+ AddUniformCallToTraceStack( location, params );
+
for( int i = 0; i < count; ++i )
{
if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, v[i] ) )
inline void Uniform1i(GLint location, GLint x)
{
+ std::string params = ToString( x );
+
+ AddUniformCallToTraceStack( location, params );
+
if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram, location, x ) )
{
mGetErrorResult = GL_INVALID_OPERATION;
inline void Uniform1iv(GLint location, GLsizei count, const GLint* v)
{
+ std::string params = ToString( v );
+ AddUniformCallToTraceStack( location, params );
+
for( int i = 0; i < count; ++i )
{
if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram,
inline void Uniform2f(GLint location, GLfloat x, GLfloat y)
{
+ std::string params = ToString( x ) + "," + ToString( y );
+ AddUniformCallToTraceStack( location, params );
+
if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
location,
Vector2( x, y ) ) )
inline void Uniform2fv(GLint location, GLsizei count, const GLfloat* v)
{
+ std::string params = ToString( v );
+ AddUniformCallToTraceStack( location, params );
+
for( int i = 0; i < count; ++i )
{
if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
inline void Uniform2i(GLint location, GLint x, GLint y)
{
+ std::string params = ToString( x ) + "," + ToString( y );
+ AddUniformCallToTraceStack( location, params );
}
inline void Uniform2iv(GLint location, GLsizei count, const GLint* v)
{
+ std::string params = ToString( v );
+ AddUniformCallToTraceStack( location, params );
}
inline void Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
{
+ std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z );
+ AddUniformCallToTraceStack( location, params );
+
if( ! mProgramUniforms3f.SetUniformValue( mCurrentProgram,
location,
Vector3( x, y, z ) ) )
inline void Uniform3fv(GLint location, GLsizei count, const GLfloat* v)
{
+ std::string params = ToString( v );
+ AddUniformCallToTraceStack( location, params );
+
for( int i = 0; i < count; ++i )
{
if( ! mProgramUniforms3f.SetUniformValue(
inline void Uniform3i(GLint location, GLint x, GLint y, GLint z)
{
+ std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z );
+ AddUniformCallToTraceStack( location, params );
}
inline void Uniform3iv(GLint location, GLsizei count, const GLint* v)
{
+ std::string params = ToString( v );
+ AddUniformCallToTraceStack( location, params );
}
inline void Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
+ std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z ) + "," + ToString( w );
+ AddUniformCallToTraceStack( location, params );
+
if( ! mProgramUniforms4f.SetUniformValue( mCurrentProgram,
location,
Vector4( x, y, z, w ) ) )
inline void Uniform4fv(GLint location, GLsizei count, const GLfloat* v)
{
+ std::string params = ToString( v );
+ AddUniformCallToTraceStack( location, params );
+
for( int i = 0; i < count; ++i )
{
if( ! mProgramUniforms4f.SetUniformValue(
inline void Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
{
+ std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z ) + "," + ToString( w );
+ AddUniformCallToTraceStack( location, params );
}
inline void Uniform4iv(GLint location, GLsizei count, const GLint* v)
{
+ std::string params = ToString( v );
+ AddUniformCallToTraceStack( location, params );
}
inline void UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
+ std::string params = ToString( value );
+ AddUniformCallToTraceStack( location, params );
}
inline void UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
+ std::string params = ToString( value );
+ AddUniformCallToTraceStack( location, params );
+
for( int i = 0; i < count; ++i )
{
if( ! mProgramUniformsMat3.SetUniformValue(
inline void UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
+ std::string params = ToString( value );
+ AddUniformCallToTraceStack( location, params );
+
for( int i = 0; i < count; ++i )
{
if( ! mProgramUniformsMat4.SetUniformValue(
{
}
+private:
+
+ inline void AddUniformCallToTraceStack( GLint location, std::string& value )
+ {
+ std::string name = "<not found>";
+ bool matched = false;
+
+ UniformIDMap& map = mUniforms[mCurrentProgram];
+ for (UniformIDMap::iterator it=map.begin(); it!=map.end(); ++it)
+ {
+ if( it->second == location )
+ {
+ name = it->first;
+ matched = true;
+ break;
+ }
+ }
+
+ if ( matched )
+ {
+ mSetUniformTrace.PushCall( name, value );
+ }
+ }
+
+
public: // TEST FUNCTIONS
inline void SetCompileStatus( GLuint value ) { mCompileStatus = value; }
inline void SetLinkStatus( GLuint value ) { mLinkStatus = value; }
inline void ResetStencilFunctionCallStack() { mStencilFunctionTrace.Reset(); }
inline TraceCallStack& GetStencilFunctionTrace() { return mStencilFunctionTrace; }
+ //Methods for Uniform function verification
+ inline void EnableSetUniformCallTrace(bool enable) { mSetUniformTrace.Enable(enable); }
+ inline void ResetSetUniformCallStack() { mSetUniformTrace.Reset(); }
+ inline TraceCallStack& GetSetUniformTrace() { return mSetUniformTrace; }
+
template <typename T>
inline bool GetUniformValue( const char* name, T& value ) const
{
TraceCallStack mDrawTrace;
TraceCallStack mDepthFunctionTrace;
TraceCallStack mStencilFunctionTrace;
+ TraceCallStack mSetUniformTrace;
// Shaders & Uniforms
GLuint mLastShaderIdUsed;
ProgramUniformValue<Matrix> mProgramUniformsMat4;
ProgramUniformValue<Matrix3> mProgramUniformsMat3;
-
-
-
inline const ProgramUniformValue<int>& GetProgramUniformsForType( const int ) const
{
return mProgramUniforms1i;
TestPlatformAbstraction::TestPlatformAbstraction()
: mTrace(),
mIsLoadingResult( false ),
- mGetDefaultFontSizeResult( 0 ),
- mLoadedResourcesQueue(),
- mFailedLoadQueue(),
- mResourceRequests(),
mSize(),
mClosestSize(),
mLoadFileResult(),
TestPlatformAbstraction::~TestPlatformAbstraction()
{
- DiscardRequest();
-}
-
-void TestPlatformAbstraction::Suspend()
-{
- mTrace.PushCall("Suspend", "");
-}
-
-void TestPlatformAbstraction::Resume()
-{
- mTrace.PushCall("Resume", "");
}
ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
return closestSize;
}
-void TestPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
-{
- std::ostringstream out;
- out << "Type:" << request.GetType()->id << ", Path: " << request.GetPath() << std::endl ;
-
- mTrace.PushCall("LoadResource", out.str());
-
- mResourceRequests.PushBack( new Integration::ResourceRequest(request) );
-}
-
Integration::ResourcePointer TestPlatformAbstraction::LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath )
{
mTrace.PushCall("LoadResourceSynchronously", "");
return mDecodedBitmap;
}
-void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
-{
- mTrace.PushCall("CancelLoad", "");
-}
-
-void TestPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
-{
- mTrace.PushCall("GetResources", "");
-
- while( !mLoadedResourcesQueue.empty() )
- {
- LoadedResource loaded( *mLoadedResourcesQueue.begin() );
- mLoadedResourcesQueue.erase( mLoadedResourcesQueue.begin() );
- cache.LoadResponse( loaded.id, loaded.type, loaded.resource, Integration::RESOURCE_COMPLETELY_LOADED );
- }
-
- // iterate through the resources which failed to load
- while( !mFailedLoadQueue.empty() )
- {
- FailedLoad failed( *mFailedLoadQueue.begin() );
- mFailedLoadQueue.erase( mFailedLoadQueue.begin() );
- cache.LoadFailed( failed.id, failed.failure );
- }
-}
-
-bool TestPlatformAbstraction::IsLoading()
-{
- mTrace.PushCall("IsLoading", "");
- return mIsLoadingResult;
-}
-
-int TestPlatformAbstraction::GetDefaultFontSize() const
-{
- mTrace.PushCall("GetDefaultFontSize", "");
- return mGetDefaultFontSizeResult;
-}
-
-void TestPlatformAbstraction::SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical)
-{
- mTrace.PushCall("SetDpi", "");
-}
-
-bool TestPlatformAbstraction::LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
-{
- mTrace.PushCall("LoadFile", "");
- if( mLoadFileResult.loadResult )
- {
- buffer = mLoadFileResult.buffer;
- }
-
- return mLoadFileResult.loadResult;
-}
-
bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
{
mTrace.PushCall("LoadShaderBinaryFile", "");
return mLoadFileResult.loadResult;
}
-bool TestPlatformAbstraction::SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const
-{
- mTrace.PushCall("SaveFile", "");
- return false;
-}
-
-void TestPlatformAbstraction::JoinLoaderThreads()
-{
- mTrace.PushCall("JoinLoaderThreads", "");
-}
/** Call this every test */
void TestPlatformAbstraction::Initialize()
{
mTrace.Reset();
mTrace.Enable(true);
- mLoadedResourcesQueue.clear();
- mFailedLoadQueue.clear();
- mResourceRequests.Clear();
mIsLoadingResult=false;
mSynchronouslyLoadedResource.Reset();
mDecodedBitmap.Reset();
{
switch(func)
{
- case SuspendFunc: return mTrace.FindMethod("Suspend");
- case ResumeFunc: return mTrace.FindMethod("Resume");
- case LoadResourceFunc: return mTrace.FindMethod("LoadResource");
case LoadResourceSynchronouslyFunc: return mTrace.FindMethod("LoadResourceSynchronously");
- case LoadFileFunc: return mTrace.FindMethod("LoadFile");
case LoadShaderBinaryFileFunc: return mTrace.FindMethod("LoadShaderBinaryFile");
case SaveShaderBinaryFileFunc: return mTrace.FindMethod("SaveShaderBinaryFile");
- case SaveFileFunc: return mTrace.FindMethod("SaveFile");
- case CancelLoadFunc: return mTrace.FindMethod("CancelLoad");
- case GetResourcesFunc: return mTrace.FindMethod("GetResources");
- case IsLoadingFunc: return mTrace.FindMethod("IsLoading");
- case SetDpiFunc: return mTrace.FindMethod("SetDpi");
- case JoinLoaderThreadsFunc: return mTrace.FindMethod("JoinLoaderThreads");
}
return false;
}
void TestPlatformAbstraction::ClearReadyResources()
{
- mLoadedResourcesQueue.clear();
- mFailedLoadQueue.clear();
mSynchronouslyLoadedResource.Reset();
mDecodedBitmap.Reset();
}
-void TestPlatformAbstraction::SetResourceLoaded(Integration::ResourceId loadedId,
- Integration::ResourceTypeId loadedType,
- Integration::ResourcePointer loadedResource)
-{
- LoadedResource loadedInfo;
- loadedInfo.id = loadedId;
- loadedInfo.type = loadedType;
- loadedInfo.resource = loadedResource;
- mLoadedResourcesQueue.push_back( loadedInfo );
-}
-
-void TestPlatformAbstraction::SetResourceLoadFailed(Integration::ResourceId id,
- Integration::ResourceFailure failure)
-{
- FailedLoad failedInfo;
- failedInfo.id = id;
- failedInfo.failure = failure;
- mFailedLoadQueue.push_back( failedInfo );
-}
-
-Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
-{
- Integration::ResourceRequest* request = NULL;
-
- // Return last request
- if( ! mResourceRequests.Empty() )
- {
- request = *( mResourceRequests.End() - 1 );
- }
-
- return request;
-}
-
-const TestPlatformAbstraction::ResourceRequestContainer& TestPlatformAbstraction::GetAllRequests() const
-{
- return mResourceRequests;
-}
-
-void TestPlatformAbstraction::SetAllResourceRequestsAsLoaded()
-{
- for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
- iter != endIter; ++iter )
- {
- Integration::ResourceRequest* request = *iter;
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
- Integration::ResourcePointer resource(bitmap);
- bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
- SetResourceLoaded( request->GetId(), request->GetType()->id, resource );
- delete request;
- }
- mResourceRequests.Clear();
-}
-
-void TestPlatformAbstraction::SetAllResourceRequestsAsFailed( Integration::ResourceFailure failure )
-{
- for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
- iter != endIter; ++iter )
- {
- Integration::ResourceRequest* request = *iter;
- SetResourceLoadFailed( (*iter)->GetId(), failure);
- delete request;
- }
- mResourceRequests.Clear();
-}
-
-void TestPlatformAbstraction::DiscardRequest()
-{
- for( ResourceRequestContainer::Iterator iter = mResourceRequests.Begin(), endIter = mResourceRequests.End();
- iter != endIter; ++iter )
- {
- Integration::ResourceRequest* request = *iter;
- delete request;
- }
- mResourceRequests.Clear();
-}
-
void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
{
mClosestSize = size;
public:
- typedef Vector< Integration::ResourceRequest* > ResourceRequestContainer;
-
/**
* Constructor
*/
virtual ~TestPlatformAbstraction();
/**
- * @copydoc PlatformAbstraction::Suspend()
- */
- virtual void Suspend();
-
- /**
- * @copydoc PlatformAbstraction::Resume()
- */
- virtual void Resume();
-
- /**
* @copydoc PlatformAbstraction::GetClosestImageSize()
*/
virtual ImageDimensions GetClosestImageSize( const std::string& filename,
bool orientationCorrection );
/**
- * @copydoc PlatformAbstraction::LoadResource()
- */
- virtual void LoadResource(const Integration::ResourceRequest& request);
-
- /**
* @copydoc PlatformAbstraction::LoadResourceSynchronously()
*/
virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
virtual Integration::BitmapPtr DecodeBuffer( const Dali::Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
/**
- * @copydoc PlatformAbstraction::CancelLoad()
- */
- virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
-
- /**
- * @copydoc PlatformAbstraction::GetResources()
- */
- virtual void GetResources(Integration::ResourceCache& cache);
-
- /**
- * @copydoc PlatformAbstraction::IsLoading()
- */
- virtual bool IsLoading();
-
- /**
- * @copydoc PlatformAbstraction::GetDefaultFontSize()
- */
- virtual int GetDefaultFontSize() const;
-
- /**
- * @copydoc PlatformAbstraction::SetDpi()
- */
- virtual void SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical);
-
- /**
- * @copydoc PlatformAbstraction::LoadFile()
- */
- virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
-
- /**
* @copydoc PlatformAbstraction::LoadShaderBinaryFile()
*/
virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
/**
- * @copydoc PlatformAbstraction::SaveFile()
+ * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
*/
- virtual bool SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
-
- /**
- * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
- */
virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const { return true; }
- virtual void JoinLoaderThreads();
public: // TEST FUNCTIONS
// Enumeration of Platform Abstraction methods
typedef enum
{
- SuspendFunc,
- ResumeFunc,
- LoadResourceFunc,
LoadResourceSynchronouslyFunc,
- SaveFileFunc,
- LoadFileFunc,
LoadShaderBinaryFileFunc,
- SaveShaderBinaryFileFunc,
- CancelLoadFunc,
- GetResourcesFunc,
- IsLoadingFunc,
- SetDpiFunc,
- JoinLoaderThreadsFunc,
+ SaveShaderBinaryFileFunc
} TestFuncEnum;
/** Call this every test */
void SetIsLoadingResult(bool result);
/**
- * @brief Sets the value returned by GetDefaultFontSize
- * @param[in] result The value to return
- */
- void SetGetDefaultFontSizeResult(float result);
-
- /**
* @brief Clears all resource queues
*/
void ClearReadyResources();
/**
- * @brief Sets a particular resource request as loaded.
- * @param[in] loadedId The ResourceID of the resource that has been loaded.
- * @param[in] loadedType The type of resource that has been loaded.
- * @param[in] loadedResource A pointer to the resource that has been loaded.
- */
- void SetResourceLoaded(Integration::ResourceId loadedId,
- Integration::ResourceTypeId loadedType,
- Integration::ResourcePointer loadedResource);
-
- /**
- * @brief Sets a particular resource request as load failure.
- * @param[in] id The ID of the failed resource request.
- * @param[in] failure The type of failure.
- */
- void SetResourceLoadFailed(Integration::ResourceId id,
- Integration::ResourceFailure failure);
-
- /**
- * @brief Retrieves the latest resource request
- * @return A pointer to the latest resource request.
- */
- Integration::ResourceRequest* GetRequest();
-
- /**
- * @brief Retrieves a reference to a container of all the resource requests.
- * @return A reference to a container of all the resource requests.
- */
- const ResourceRequestContainer& GetAllRequests() const;
-
- /**
- * @brief Sets all resource requests as loaded.
- */
- void SetAllResourceRequestsAsLoaded();
-
- /**
- * @brief Sets all resource requests as loaded.
- * @param[in] failure The failure type
- */
- void SetAllResourceRequestsAsFailed( Integration::ResourceFailure failure );
-
- /**
- * @brief Discards all current resource requests.
- */
- void DiscardRequest();
-
- /**
* @brief Sets the value returned by GetClosestImageSize.
* @param[in] size The size that should be returned.
*/
private:
- struct LoadedResource
- {
- Integration::ResourceId id;
- Integration::ResourceTypeId type;
- Integration::ResourcePointer resource;
- };
-
- struct FailedLoad
- {
- Integration::ResourceId id;
- Integration::ResourceFailure failure;
- };
-
struct LoadFileResult
{
inline LoadFileResult()
Dali::Vector< unsigned char> buffer;
};
- typedef std::vector< LoadedResource > LoadedResourceContainer;
- typedef std::vector< FailedLoad > FailedLoadContainer;
-
mutable TraceCallStack mTrace;
bool mIsLoadingResult;
- int mGetDefaultFontSizeResult;
- LoadedResourceContainer mLoadedResourcesQueue;
- FailedLoadContainer mFailedLoadQueue;
- ResourceRequestContainer mResourceRequests;
Vector2 mSize;
Vector2 mClosestSize;
namespace Dali
{
+
+template<typename T>
+std::string ToString(const T& x)
+{
+ return "undefined";
+}
+
std::string ToString(int x);
std::string ToString(unsigned int x);
std::string ToString(float x);
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/pan-gesture-event.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar-devel.h>
using namespace Dali;
using namespace Toolkit;
END_TEST;
}
+int UtcDaliToolkitScrollBarActionShowIndicator(void)
+{
+ ToolkitTestApplication application;
+
+ // Create a scroll bar
+ ScrollBar scrollBar = ScrollBar::New();
+ DALI_TEST_CHECK( scrollBar );
+
+ Stage::GetCurrent().Add( scrollBar );
+
+ Actor indicator = scrollBar.GetScrollIndicator();
+ DALI_TEST_CHECK( indicator );
+
+ // Get the default duration to hide the indicator
+ float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+
+ // Check that the default duration is greater than 0
+ DALI_TEST_CHECK( duration > 0.0f );
+
+ // Make the indicator invisible
+ indicator.SetOpacity(0.0f);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is invisible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+ // Do the "ShowIndicator" action
+ Property::Map emptyMap;
+ scrollBar.DoAction( "ShowIndicator", emptyMap );
+
+ // Wait for the specified duration
+ Wait(application, duration * 1000);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now visible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitScrollBarActionHideIndicator(void)
+{
+ ToolkitTestApplication application;
+
+ // Create a scroll bar
+ ScrollBar scrollBar = ScrollBar::New();
+ DALI_TEST_CHECK( scrollBar );
+
+ Stage::GetCurrent().Add( scrollBar );
+
+ Actor indicator = scrollBar.GetScrollIndicator();
+ DALI_TEST_CHECK( indicator );
+
+ // Get the default duration to hide the indicator
+ float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+
+ // Check that the default duration is greater than 0
+ DALI_TEST_CHECK( duration > 0.0f );
+
+ // Make the indicator visible
+ indicator.SetOpacity(1.0f);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is visible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+ // Do the "HideIndicator" action
+ Property::Map emptyMap;
+ scrollBar.DoAction( "HideIndicator", emptyMap );
+
+ // Wait for the specified duration
+ Wait(application, duration * 1000);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now invisible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitScrollBarActionShowTransientIndicator(void)
+{
+ ToolkitTestApplication application;
+
+ // Create a scroll bar
+ ScrollBar scrollBar = ScrollBar::New();
+ DALI_TEST_CHECK( scrollBar );
+
+ Stage::GetCurrent().Add( scrollBar );
+
+ Actor indicator = scrollBar.GetScrollIndicator();
+ DALI_TEST_CHECK( indicator );
+
+ // Get the default duration to hide the indicator
+ float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+
+ // Check that the default duration is greater than 0
+ DALI_TEST_CHECK( duration > 0.0f );
+
+ // Make the indicator invisible
+ indicator.SetOpacity(0.0f);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is invisible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+ // Do the "ShowIndicator" action
+ Property::Map emptyMap;
+ scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+
+ // Wait for the specified duration
+ Wait(application, duration * 1000);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now visible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+ // Get the default duration to hide the indicator
+ float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+ float transientDuration = scrollBar.GetProperty<float>( DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+ float totalVisibleDuration = hideDuration + transientDuration;
+
+ // Check that the default duration is greater than 0
+ DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+
+ // Wait for the specified duration
+ Wait(application, totalVisibleDuration * 1000);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now invisible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitScrollBarActionShowTransientIndicatorImmediate(void)
+{
+ ToolkitTestApplication application;
+
+ // Create a scroll bar
+ ScrollBar scrollBar = ScrollBar::New();
+ DALI_TEST_CHECK( scrollBar );
+
+ Stage::GetCurrent().Add( scrollBar );
+
+ Actor indicator = scrollBar.GetScrollIndicator();
+ DALI_TEST_CHECK( indicator );
+
+ // Make the indicator invisible
+ indicator.SetOpacity(0.0f);
+
+ // Don't use a show animation; the indicator should appear immediately
+ scrollBar.SetProperty( ScrollBar::Property::INDICATOR_SHOW_DURATION, 0.0f );
+ float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+ DALI_TEST_EQUALS( duration, 0.0f, TEST_LOCATION );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Do the "ShowIndicator" action
+ Property::Map emptyMap;
+ scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+
+ // Wait for the specified duration
+ Wait(application);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now visible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+ // Get the default duration to hide the indicator
+ float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+ float transientDuration = scrollBar.GetProperty<float>( DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+ float totalVisibleDuration = hideDuration + transientDuration;
+
+ // Check that the default duration is greater than 0
+ DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+
+ // Wait for the specified duration
+ Wait(application, totalVisibleDuration * 1000);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now invisible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliToolkitScrollBarActionShowTransientIndicatorDuringHide(void)
+{
+ ToolkitTestApplication application;
+
+ // Create a scroll bar
+ ScrollBar scrollBar = ScrollBar::New();
+ DALI_TEST_CHECK( scrollBar );
+
+ Stage::GetCurrent().Add( scrollBar );
+
+ Actor indicator = scrollBar.GetScrollIndicator();
+ DALI_TEST_CHECK( indicator );
+
+ // Get the default duration to hide the indicator
+ float duration = scrollBar.GetIndicatorHideDuration();
+
+ // Check that the default duration is greater than 0
+ DALI_TEST_CHECK( duration > 0.0f );
+
+ // Make the indicator visible
+ indicator.SetOpacity(1.0f);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is visible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+ // Hide the indicator
+ scrollBar.HideIndicator();
+
+ // Wait for half the specified duration
+ Wait(application, duration * 0.5f * 1000);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now partially hidden
+ DALI_TEST_CHECK( indicator.GetCurrentOpacity() < 1.0f );
+
+ // Now interrupt the Hide with a DoAction( "ShowTransientIndicator" )
+
+ // Get the default duration to hide the indicator
+ duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+
+ // Check that the default duration is greater than 0
+ DALI_TEST_CHECK( duration > 0.0f );
+
+ // Do the "ShowIndicator" action
+ Property::Map emptyMap;
+ scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+
+ // Wait for the specified duration
+ Wait(application, duration * 1000);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now visible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+ // Get the default duration to hide the indicator
+ float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+ float transientDuration = scrollBar.GetProperty<float>( DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+ float totalVisibleDuration = hideDuration + transientDuration;
+
+ // Check that the default duration is greater than 0
+ DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+
+ // Wait for the specified duration
+ Wait(application, totalVisibleDuration * 1000);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Check that the indicator is now invisible
+ DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
{
ToolkitTestApplication application;
void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height)
{
- Integration::ResourceRequest* request = platform.GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, width, height, width, height);
-
- if(request)
- {
- platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
- }
}
class SignalHandler : public Dali::ConnectionTracker
DALI_TEST_EQUALS( editor.GetProperty<float>( DevelTextEditor::Property::SMOOTH_SCROLL_DURATION ), 0.1f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::SMOOTH_SCROLL ), true, TEST_LOCATION );
+ // Press Escape to increase coverage
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up ) );
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK( !editor.HasKeyInputFocus() );
+
END_TEST;
}
static void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height)
{
- Integration::ResourceRequest* request = platform.GetRequest();
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, width, height, width, height);
-
- if(request)
- {
- platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
- }
}
static void LoadMarkerImages(ToolkitTestApplication& app, TextField textField)
DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
+ // Press Escape to increase coverage
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up ) );
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK( !field.HasKeyInputFocus() );
+
END_TEST;
}
const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
-const unsigned int EMOJI_FONT_SIZE = 3968u;
+const unsigned int EMOJI_FONT_SIZE = 3840u; // 60 * 64
bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Map& fontStyleMapSet )
{
application.SendNotification();
application.Render();
+ END_TEST;
+}
+
+int UtcDaliToolkitTextLabelEmojisP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextLabelLanguagesP");
+ TextLabel label = TextLabel::New();
+ DALI_TEST_CHECK( label );
+
+ Stage::GetCurrent().Add( label );
+
TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
char* pathNamePtr = get_current_dir_name();
const std::string pathName( pathNamePtr );
free( pathNamePtr );
- fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenColorEmoji.ttf", EMOJI_FONT_SIZE );
+ TextAbstraction::FontDescription fontDescription;
+ fontDescription.path = pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf";
+ fontDescription.family = "BreezeColorEmoji";
+ fontDescription.width = TextAbstraction::FontWidth::NONE;
+ fontDescription.weight = TextAbstraction::FontWeight::NORMAL;
+ fontDescription.slant = TextAbstraction::FontSlant::NONE;
+
+ fontClient.GetFontId( fontDescription, EMOJI_FONT_SIZE );
- const std::string emojis = "<font family='TizenColorEmoji'>\xF0\x9F\x98\x81 \xF0\x9F\x98\x82 \xF0\x9F\x98\x83 \xF0\x9F\x98\x84</font>";
+ const std::string emojis = "<font family='BreezeColorEmoji' size='60'>\xF0\x9F\x98\x81 \xF0\x9F\x98\x82 \xF0\x9F\x98\x83 \xF0\x9F\x98\x84</font>";
label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
label.SetProperty( TextLabel::Property::TEXT, emojis );
application.SendNotification();
application.Render();
- if( resourcePtr )
- {
- Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
- if(request)
- {
- application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resourcePtr );
- }
- }
-
application.Render();
application.SendNotification();
if( resourcePtr )
{
- DALI_TEST_EQUALS( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) ||
- application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc ), true, TEST_LOCATION);
+ DALI_TEST_EQUALS( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc ), true, TEST_LOCATION);
}
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
application.SendNotification();
application.Render( 0 );
- //Tell the platform abstraction that the required resources have been loaded.
- TestPlatformAbstraction& platform = application.GetPlatform();
- platform.SetAllResourceRequestsAsLoaded();
-
//Render again to upload the now-loaded textures.
application.SendNotification();
application.Render( 0 );
application.SendNotification();
application.Render( 0 );
- //Tell the platform abstraction that the required resources have been loaded.
- TestPlatformAbstraction& platform = application.GetPlatform();
- platform.SetAllResourceRequestsAsLoaded();
-
//Render again to upload the now-loaded textures.
application.SendNotification();
application.Render( 0 );
develapigaussianblurviewdir = $(develapicontrolsdir)/gaussian-blur-view
develapimagnifierdir = $(develapicontrolsdir)/magnifier
develapiitemviewdir = $(develapicontrolsdir)/scrollable/item-view
+develapiscrollbardir = $(develapicontrolsdir)/scroll-bar
develapinavigationviewdir = $(develapicontrolsdir)/navigation-view
develapipageturnviewdir = $(develapicontrolsdir)/page-turn-view
develapipopupdir = $(develapicontrolsdir)/popup
develapigaussianblurview_HEADERS = $(devel_api_gaussian_blur_view_header_files)
develapiimageloader_HEADERS = $(devel_api_image_loader_header_files)
develapiitemview_HEADERS = $(devel_api_item_view_header_files)
+develapiscrollbar_HEADERS = $(devel_api_scroll_bar_header_files)
develapimagnifier_HEADERS = $(devel_api_magnifier_header_files)
develapinavigationview_HEADERS = $(devel_api_navigation_view_header_files)
develapipageturnview_HEADERS = $(devel_api_page_turn_view_header_files)
--- /dev/null
+#ifndef DALI_TOOLKIT_SCROLL_BAR_DEVEL_H
+#define DALI_TOOLKIT_SCROLL_BAR_DEVEL_H
+
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelScrollBar
+{
+
+namespace Property
+{
+
+/**
+ * @brief ScrollBar is a UI component that can be linked to the scrollable objects
+ * indicating the current scroll position of the scrollable object.
+ *
+ * Actions
+ * | %Action Name | Attributes | Description |
+ * |------------------------|-------------------------|-------------------------------------------|
+ * | ShowIndicator | Doesn't have attributes | Shows the scroll-indicator |
+ * | HideIndicator | Doesn't have attributes | Hides the scroll-indicator |
+ * | ShowTransientIndicator | Doesn't have attributes | Shows the scroll-indicator for short time |
+ */
+
+/**
+ * @brief Enumeration for the instance of properties belonging to the ScrollBar class.
+ */
+enum
+{
+ SCROLL_DIRECTION = Dali::Toolkit::ScrollBar::Property::SCROLL_DIRECTION,
+ INDICATOR_HEIGHT_POLICY = Dali::Toolkit::ScrollBar::Property::INDICATOR_HEIGHT_POLICY,
+ INDICATOR_FIXED_HEIGHT = Dali::Toolkit::ScrollBar::Property::INDICATOR_FIXED_HEIGHT,
+ INDICATOR_SHOW_DURATION = Dali::Toolkit::ScrollBar::Property::INDICATOR_SHOW_DURATION,
+ INDICATOR_HIDE_DURATION = Dali::Toolkit::ScrollBar::Property::INDICATOR_HIDE_DURATION,
+ SCROLL_POSITION_INTERVALS = Dali::Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS,
+ INDICATOR_MINIMUM_HEIGHT = Dali::Toolkit::ScrollBar::Property::INDICATOR_MINIMUM_HEIGHT,
+ INDICATOR_START_PADDING = Dali::Toolkit::ScrollBar::Property::INDICATOR_START_PADDING,
+ INDICATOR_END_PADDING = Dali::Toolkit::ScrollBar::Property::INDICATOR_END_PADDING,
+
+ /**
+ * @brief The duration that transient indicators will remain fully visible.
+ * @details name "indicatorTransientDuration", type float.
+ */
+ INDICATOR_TRANSIENT_DURATION = INDICATOR_END_PADDING + 1
+};
+
+} // namespace Property
+
+} // namespace DevelScrollBar
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_SCROLL_BAR_DEVEL_H
$(devel_api_src_dir)/controls/scrollable/item-view/default-item-layout-property.h \
$(devel_api_src_dir)/controls/scrollable/item-view/item-view-devel.h
+devel_api_scroll_bar_header_files = \
+ $(devel_api_src_dir)/controls/scroll-bar/scroll-bar-devel.h
+
devel_api_magnifier_header_files = \
$(devel_api_src_dir)/controls/magnifier/magnifier.h
#include <dali/public-api/object/property-array.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
+#include <dali/devel-api/object/property-helper-devel.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar-devel.h>
using namespace Dali;
const float DEFAULT_INDICATOR_MINIMUM_HEIGHT(0.0f);
const float DEFAULT_INDICATOR_START_PADDING(0.0f);
const float DEFAULT_INDICATOR_END_PADDING(0.0f);
+const float DEFAULT_INDICATOR_TRANSIENT_DURATION(1.0f);
/**
* Indicator size constraint
// Setup properties, signals and actions using the type-registry.
DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBar, Toolkit::Control, Create );
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollDirection", STRING, SCROLL_DIRECTION )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHeightPolicy", STRING, INDICATOR_HEIGHT_POLICY )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorFixedHeight", FLOAT, INDICATOR_FIXED_HEIGHT )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorShowDuration", FLOAT, INDICATOR_SHOW_DURATION )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHideDuration", FLOAT, INDICATOR_HIDE_DURATION )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollPositionIntervals", ARRAY, SCROLL_POSITION_INTERVALS )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorMinimumHeight", FLOAT, INDICATOR_MINIMUM_HEIGHT )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorStartPadding", FLOAT, INDICATOR_START_PADDING )
-DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorEndPadding", FLOAT, INDICATOR_END_PADDING )
-
-DALI_SIGNAL_REGISTRATION( Toolkit, ScrollBar, "panFinished", PAN_FINISHED_SIGNAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollDirection", STRING, SCROLL_DIRECTION )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHeightPolicy", STRING, INDICATOR_HEIGHT_POLICY )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorFixedHeight", FLOAT, INDICATOR_FIXED_HEIGHT )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorShowDuration", FLOAT, INDICATOR_SHOW_DURATION )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorHideDuration", FLOAT, INDICATOR_HIDE_DURATION )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scrollPositionIntervals", ARRAY, SCROLL_POSITION_INTERVALS )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorMinimumHeight", FLOAT, INDICATOR_MINIMUM_HEIGHT )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorStartPadding", FLOAT, INDICATOR_START_PADDING )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorEndPadding", FLOAT, INDICATOR_END_PADDING )
+
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicatorTransientDuration", FLOAT, INDICATOR_TRANSIENT_DURATION )
+
+DALI_SIGNAL_REGISTRATION( Toolkit, ScrollBar, "panFinished", PAN_FINISHED_SIGNAL )
DALI_SIGNAL_REGISTRATION( Toolkit, ScrollBar, "scrollPositionIntervalReached", SCROLL_POSITION_INTERVAL_REACHED_SIGNAL )
+DALI_ACTION_REGISTRATION( Toolkit, ScrollBar, "ShowIndicator", ACTION_SHOW_INDICATOR )
+DALI_ACTION_REGISTRATION( Toolkit, ScrollBar, "HideIndicator", ACTION_HIDE_INDICATOR )
+DALI_ACTION_REGISTRATION( Toolkit, ScrollBar, "ShowTransientIndicator", ACTION_SHOW_TRANSIENT_INDICATOR )
+
DALI_TYPE_REGISTRATION_END()
const char* SCROLL_DIRECTION_NAME[] = {"Vertical", "Horizontal"};
mPropertyScrollContentSize(Property::INVALID_INDEX),
mIndicatorShowDuration(DEFAULT_INDICATOR_SHOW_DURATION),
mIndicatorHideDuration(DEFAULT_INDICATOR_HIDE_DURATION),
+ mTransientIndicatorDuration(DEFAULT_INDICATOR_TRANSIENT_DURATION),
mScrollStart(0.0f),
mCurrentScrollPosition(0.0f),
mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
}
}
+void ScrollBar::ShowTransientIndicator()
+{
+ // Cancel any animation
+ if(mAnimation)
+ {
+ mAnimation.Clear();
+ mAnimation.Reset();
+ }
+
+ mAnimation = Animation::New( mIndicatorShowDuration + mTransientIndicatorDuration + mIndicatorHideDuration );
+ if(mIndicatorShowDuration > 0.0f)
+ {
+ mAnimation.AnimateTo( Property( mIndicator, Actor::Property::COLOR_ALPHA ),
+ mIndicatorShowAlpha, AlphaFunction::EASE_IN, TimePeriod(0, mIndicatorShowDuration) );
+ }
+ else
+ {
+ mIndicator.SetOpacity(mIndicatorShowAlpha);
+ }
+ mAnimation.AnimateTo( Property( mIndicator, Actor::Property::COLOR_ALPHA ),
+ 0.0f, AlphaFunction::EASE_IN, TimePeriod((mIndicatorShowDuration + mTransientIndicatorDuration), mIndicatorHideDuration) );
+ mAnimation.Play();
+}
+
bool ScrollBar::OnPanGestureProcessTick()
{
// Update the scroll position property.
scrollBarImpl.ApplyConstraints();
break;
}
+ case Toolkit::DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION:
+ {
+ scrollBarImpl.mTransientIndicatorDuration = value.Get<float>();
+ break;
+ }
}
}
}
value = scrollBarImpl.mIndicatorEndPadding;
break;
}
+ case Toolkit::DevelScrollBar::Property::INDICATOR_TRANSIENT_DURATION:
+ {
+ value = scrollBarImpl.mTransientIndicatorDuration;
+ break;
+ }
}
}
return value;
}
+bool ScrollBar::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
+{
+ bool ret = false;
+
+ Dali::BaseHandle handle( object );
+
+ Toolkit::ScrollBar scrollBar = Toolkit::ScrollBar::DownCast( handle );
+
+ DALI_ASSERT_DEBUG( scrollBar );
+
+ if( scrollBar )
+ {
+ if( 0 == strcmp( actionName.c_str(), ACTION_SHOW_INDICATOR ) )
+ {
+ GetImpl( scrollBar ).ShowIndicator();
+ ret = true;
+ }
+ else if( 0 == strcmp( actionName.c_str(), ACTION_HIDE_INDICATOR ) )
+ {
+ GetImpl( scrollBar ).HideIndicator();
+ ret = true;
+ }
+ else if( 0 == strcmp( actionName.c_str(), ACTION_SHOW_TRANSIENT_INDICATOR ) )
+ {
+ GetImpl( scrollBar ).ShowTransientIndicator();
+ ret = true;
+ }
+ }
+
+ return ret;
+}
+
Toolkit::ScrollBar ScrollBar::New(Toolkit::ScrollBar::Direction direction)
{
// Create the implementation, temporarily owned by this handle on stack
/**
* @copydoc Toolkit::ScrollBar::HideIndicator()
*/
- void HideIndicator();
+ void HideIndicator();
+
+ /**
+ * @brief Shows indicator until the transient duration has expired
+ */
+ void ShowTransientIndicator();
/**
* @copydoc Toolkit::ScrollBar::PanFinishedSignal()
*/
static Property::Value GetProperty( BaseObject* object, Property::Index index );
+ /**
+ * Performs actions as requested using the action name.
+ * @param[in] object The object on which to perform the action.
+ * @param[in] actionName The action to perform.
+ * @param[in] attributes The attributes with which to perfrom this action.
+ * @return true if action has been accepted by this control
+ */
+ static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes );
+
private: // from Control
/**
float mIndicatorShowDuration; ///< The duration of scroll indicator show animation
float mIndicatorHideDuration; ///< The duration of scroll indicator hide animation
+ float mTransientIndicatorDuration; ///< The duration before hiding transient indicator
float mScrollStart; ///< Scroll Start position (start of drag)
Vector3 mGestureDisplacement; ///< Gesture Displacement.
#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/object/property-map.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
if( mTransientScrollBar )
{
- scrollBar.SetVisible( false );
- scrollBar.HideIndicator();
+ // Show the scroll-indicator for a brief period
+ Property::Map emptyMap;
+ scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
}
}
else if(mAlterChild)
if( ( rulerDomainX.max > size.width ) || ( rulerDomainY.max > size.height ) )
{
- scrollBar.SetVisible( true );
scrollBar.ShowIndicator();
}
}
if( Dali::DALI_KEY_ESCAPE == event.keyCode ) // Make a Dali key code for this
{
- ClearKeyInputFocus();
+ // Make sure ClearKeyInputFocus when only key is up
+ if( event.state == KeyEvent::Up )
+ {
+ ClearKeyInputFocus();
+ }
+
return true;
}
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyEvent %p keyCode %d\n", mController.Get(), event.keyCode );
- if( Dali::DALI_KEY_ESCAPE == event.keyCode ||
- "Return" == event.keyPressedName ) // Make a Dali key code for this
+ if( Dali::DALI_KEY_ESCAPE == event.keyCode || "Return" == event.keyPressedName ) // Make a Dali key code for this
{
- ClearKeyInputFocus();
+ // Make sure ClearKeyInputFocus when only key is up
+ if( event.state == KeyEvent::Up )
+ {
+ ClearKeyInputFocus();
+ }
+
return true;
}
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_RENDERING");
#endif
-#define MAKE_SHADER(A)#A
-
-const char* VERTEX_SHADER = MAKE_SHADER(
-attribute mediump vec2 aPosition;
-attribute mediump vec2 aTexCoord;
-attribute mediump vec4 aColor;
-uniform mediump vec2 uOffset;
-uniform mediump mat4 uMvpMatrix;
-varying mediump vec2 vTexCoord;
-varying mediump vec4 vColor;
-
-void main()
-{
- mediump vec4 position = vec4( aPosition.xy + uOffset, 0.0, 1.0 );
- gl_Position = uMvpMatrix * position;
- vTexCoord = aTexCoord;
- vColor = aColor;
-}
-);
-
-const char* FRAGMENT_SHADER_L8 = MAKE_SHADER(
-uniform lowp vec4 uColor;
-uniform sampler2D sTexture;
-varying mediump vec2 vTexCoord;
-varying mediump vec4 vColor;
-
-void main()
-{
- mediump vec4 color = texture2D( sTexture, vTexCoord );
- gl_FragColor = vec4( vColor.rgb * uColor.rgb, vColor.a * uColor.a * color.r );
-}
-);
-
-const char* FRAGMENT_SHADER_RGBA = MAKE_SHADER(
-uniform lowp vec4 uColor;
-uniform sampler2D sTexture;
-varying mediump vec2 vTexCoord;
-
-void main()
-{
- gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;
-}
-);
-
} // unnamed namespace
namespace Dali
AtlasGlyphManager::AtlasGlyphManager()
{
- mShaderL8 = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_L8 );
- mShaderRgba = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_RGBA );
mAtlasManager = Dali::Toolkit::AtlasManager::New();
}
return mAtlasManager.GetTextures( atlasId );
}
-Shader AtlasGlyphManager::GetShader( uint32_t atlasId ) const
-{
- Pixel::Format pixelFormat = mAtlasManager.GetPixelFormat( atlasId );
- return pixelFormat == Pixel::L8 ? mShaderL8 : mShaderRgba;
-}
-
AtlasGlyphManager::~AtlasGlyphManager()
{
// mAtlasManager handle is automatically released here
TextureSet GetTextures( uint32_t atlasId ) const;
/**
- * @copydoc Toolkit::AtlasGlyphManager::GetShader
- */
- Shader GetShader( uint32_t atlasId ) const;
-
- /**
* @copydoc Toolkit::AtlasGlyphManager::GetMetrics
*/
const Toolkit::AtlasGlyphManager::Metrics& GetMetrics();
Dali::Toolkit::AtlasManager mAtlasManager; ///> Atlas Manager created by GlyphManager
std::vector< FontGlyphRecord > mFontGlyphRecords;
Toolkit::AtlasGlyphManager::Metrics mMetrics; ///> Metrics to pass back on GlyphManager status
-
- Shader mShaderL8;
- Shader mShaderRgba;
};
} // namespace Internal
return GetImplementation(*this).GetTextures( atlasId );
}
-Shader AtlasGlyphManager::GetShader( uint32_t atlasId ) const
-{
- return GetImplementation(*this).GetShader( atlasId );
-}
-
const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics()
{
return GetImplementation(*this).GetMetrics();
TextureSet GetTextures( uint32_t atlasId ) const;
/**
- * @brief Get the shader used by an atlas
- *
- * @param[in] atlasId Id of an atlas
- *
- * @return The shader used by the atlas
- */
- Shader GetShader( uint32_t atlasId ) const;
-
- /**
* @brief Get Glyph Manager metrics
*
* @return const reference to glyph manager metrics
}
Dali::Texture atlas = Dali::Texture::New( TextureType::TEXTURE_2D, pixelformat, width, height );
+
+ // Clear the background
+ unsigned int bufferSize( width * height * Dali::Pixel::GetBytesPerPixel( pixelformat ) );
+ unsigned char* background = new unsigned char[bufferSize];
+ memset( background, 0, bufferSize );
+ PixelData backgroundPixels = PixelData::New( background, bufferSize, width, height, pixelformat, PixelData::DELETE_ARRAY );
+ atlas.Upload( backgroundPixels, 0u, 0u, 0u, 0u, width, height );
+
AtlasDescriptor atlasDescriptor;
atlasDescriptor.mAtlas = atlas;
atlasDescriptor.mSize = size;
atlasDescriptor.mTotalBlocks = ( ( width - 1u ) / blockWidth ) * ( ( height - 1u ) / blockHeight );
atlasDescriptor.mAvailableBlocks = atlasDescriptor.mTotalBlocks;
- unsigned int bufferSize( blockWidth * SINGLE_PIXEL_PADDING * Dali::Pixel::GetBytesPerPixel(pixelformat) );
+ bufferSize = blockWidth * SINGLE_PIXEL_PADDING * Dali::Pixel::GetBytesPerPixel(pixelformat);
unsigned char* bufferHorizontalStrip = new unsigned char[bufferSize];
memset( bufferHorizontalStrip, 0, bufferSize );
atlasDescriptor.mHorizontalStrip = PixelData::New( bufferHorizontalStrip, bufferSize, blockWidth, SINGLE_PIXEL_PADDING, pixelformat, PixelData::DELETE_ARRAY );
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_RENDERING");
#endif
+#define MAKE_SHADER(A)#A
+
+const char* VERTEX_SHADER = MAKE_SHADER(
+attribute mediump vec2 aPosition;
+attribute mediump vec2 aTexCoord;
+attribute mediump vec4 aColor;
+uniform mediump vec2 uOffset;
+uniform mediump mat4 uMvpMatrix;
+varying mediump vec2 vTexCoord;
+varying mediump vec4 vColor;
+
+void main()
+{
+ mediump vec4 position = vec4( aPosition.xy + uOffset, 0.0, 1.0 );
+ gl_Position = uMvpMatrix * position;
+ vTexCoord = aTexCoord;
+ vColor = aColor;
+}
+);
+
+const char* FRAGMENT_SHADER_L8 = MAKE_SHADER(
+uniform lowp vec4 uColor;
+uniform sampler2D sTexture;
+varying mediump vec2 vTexCoord;
+varying mediump vec4 vColor;
+
+void main()
+{
+ mediump vec4 color = texture2D( sTexture, vTexCoord );
+ gl_FragColor = vec4( vColor.rgb * uColor.rgb, vColor.a * uColor.a * color.r );
+}
+);
+
+const char* FRAGMENT_SHADER_RGBA = MAKE_SHADER(
+uniform lowp vec4 uColor;
+uniform sampler2D sTexture;
+varying mediump vec2 vTexCoord;
+
+void main()
+{
+ gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;
+}
+);
+
const float ZERO( 0.0f );
const float HALF( 0.5f );
const float ONE( 1.0f );
}
// Create a new image for the glyph
- PixelData bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
+ PixelData bitmap;
+
+ // Whether the current glyph is a color one.
+ const bool isColorGlyph = mFontClient.IsColorGlyph( glyph.fontId, glyph.index );
+
+ // Retrieve the emoji's bitmap.
+ TextAbstraction::FontClient::GlyphBufferData glyphBufferData;
+ glyphBufferData.width = isColorGlyph ? glyph.width : 0; // Desired width and height.
+ glyphBufferData.height = isColorGlyph ? glyph.height : 0;
+
+ mFontClient.CreateBitmap( glyph.fontId,
+ glyph.index,
+ glyphBufferData );
+
+ // Create the pixel data.
+ bitmap = PixelData::New( glyphBufferData.buffer,
+ glyph.width * glyph.height * GetBytesPerPixel( glyphBufferData.format ),
+ glyph.width,
+ glyph.height,
+ glyphBufferData.format,
+ PixelData::DELETE_ARRAY );
+
if( bitmap )
{
MaxBlockSize& blockSize = mBlockSizes[currentBlockSize];
AtlasManager::Vertex2D* verticesBuffer = newMesh.mVertices.Begin();
- // Adjust the vertices if the fixed-size font should be down-scaled
- if( glyph.scaleFactor > 0 )
- {
- for( unsigned int index = 0u, size = newMesh.mVertices.Count();
- index < size;
- ++index )
- {
- AtlasManager::Vertex2D& vertex = *( verticesBuffer + index );
-
- // Set the position of the vertex.
- vertex.mPosition.x = position.x + ( ( vertex.mPosition.x - position.x ) * glyph.scaleFactor );
- vertex.mPosition.y = position.y + ( ( vertex.mPosition.y - position.y ) * glyph.scaleFactor );
- }
- }
-
// Get the color of the character.
const ColorIndex colorIndex = useDefaultColor ? 0u : *( colorIndicesBuffer + i );
const Vector4& color = ( useDefaultColor || ( 0u == colorIndex ) ) ? defaultColor : *( colorsBuffer + colorIndex - 1u );
{
MeshRecord& meshRecord = *it;
- Actor actor = CreateMeshActor( meshRecord, textSize );
+ Actor actor = CreateMeshActor( meshRecord, textSize, STYLE_NORMAL );
// Whether the actor has renderers.
const bool hasRenderer = actor.GetRendererCount() > 0u;
vertex.mColor = shadowColor;
}
- Actor shadowActor = CreateMeshActor( meshRecord, textSize );
+ Actor shadowActor = CreateMeshActor( meshRecord, textSize, STYLE_DROP_SHADOW );
#if defined(DEBUG_ENABLED)
shadowActor.SetName( "Text Shadow renderable actor" );
#endif
mTextCache.Resize( 0 );
}
- Actor CreateMeshActor( const MeshRecord& meshRecord, const Vector2& actorSize )
+ Actor CreateMeshActor( const MeshRecord& meshRecord, const Vector2& actorSize, Style style )
{
PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat );
quadVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &meshRecord.mMesh.mVertices[ 0 ] ), meshRecord.mMesh.mVertices.Size() );
quadGeometry.SetIndexBuffer( &meshRecord.mMesh.mIndices[0], meshRecord.mMesh.mIndices.Size() );
TextureSet textureSet( mGlyphManager.GetTextures( meshRecord.mAtlasId ) );
- Shader shader( mGlyphManager.GetShader( meshRecord.mAtlasId ) );
+
+ // Choose the shader to use.
+ const bool isColorShader = ( STYLE_DROP_SHADOW != style ) && ( Pixel::BGRA8888 == mGlyphManager.GetPixelFormat( meshRecord.mAtlasId ) );
+ Shader shader;
+ if( isColorShader )
+ {
+ // The glyph is an emoji and is not a shadow.
+ if( !mShaderRgba )
+ {
+ mShaderRgba = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_RGBA );
+ }
+ shader = mShaderRgba;
+ }
+ else
+ {
+ // The glyph is text or a shadow.
+ if( !mShaderL8 )
+ {
+ mShaderL8 = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_L8 );
+ }
+ shader = mShaderL8;
+ }
+
Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, shader );
renderer.SetTextures( textureSet );
renderer.SetProperty( Dali::Renderer::Property::BLEND_MODE, BlendMode::ON );
Actor mActor; ///< The actor parent which renders the text
AtlasGlyphManager mGlyphManager; ///< Glyph Manager to handle upload and caching
- TextAbstraction::FontClient mFontClient; ///> The font client used to supply glyph information
- std::vector< MaxBlockSize > mBlockSizes; ///> Maximum size needed to contain a glyph in a block within a new atlas
- Vector< TextCacheEntry > mTextCache; ///> Caches data from previous render
- Property::Map mQuadVertexFormat; ///> Describes the vertex format for text
- int mDepth; ///> DepthIndex passed by control when connect to stage
+ TextAbstraction::FontClient mFontClient; ///< The font client used to supply glyph information
+ Shader mShaderL8; ///< The shader for glyphs and emoji's shadows.
+ Shader mShaderRgba; ///< The shader for emojis.
+ std::vector< MaxBlockSize > mBlockSizes; ///< Maximum size needed to contain a glyph in a block within a new atlas
+ Vector< TextCacheEntry > mTextCache; ///< Caches data from previous render
+ Property::Map mQuadVertexFormat; ///< Describes the vertex format for text
+ int mDepth; ///< DepthIndex passed by control when connect to stage
};
Text::RendererPtr AtlasRenderer::New()
// Retrieves the glyph's bitmap.
glyphData.glyphBitmap.buffer = NULL;
+ glyphData.glyphBitmap.width = glyphInfo->width; // Desired width and height.
+ glyphData.glyphBitmap.height = glyphInfo->height;
fontClient.CreateBitmap( glyphInfo->fontId,
glyphInfo->index,
glyphData.glyphBitmap );
mEventData->mUpdateRightSelectionPosition = true;
mEventData->mUpdateHighlightBox = true;
+ // It may happen an IMF commit event arrives before the selection event
+ // if the IMF manager is in pre-edit state. The commit event will set the
+ // mEventData->mUpdateCursorPosition flag to true. If it's not set back
+ // to false, the highlight box won't be updated.
+ mEventData->mUpdateCursorPosition = false;
+
mEventData->mScrollAfterUpdatePosition = ( mEventData->mLeftSelectionPosition != mEventData->mRightSelectionPosition );
}
else
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 28;
+const unsigned int TOOLKIT_MICRO_VERSION = 29;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
"TextSelectionScrollBar":
{
"indicatorShowDuration":0.25,
- "indicatorHideDuration":0.25
+ "indicatorHideDuration":0.25,
+ "indicatorTransientDuration":1.0
},
"TextSelectionScrollIndicator":
{
"TextSelectionScrollBar":
{
"indicatorShowDuration":0.25,
- "indicatorHideDuration":0.25
+ "indicatorHideDuration":0.25,
+ "indicatorTransientDuration":1.0
},
"TextSelectionScrollIndicator":
{
"TextSelectionScrollBar":
{
"indicatorShowDuration":0.25,
- "indicatorHideDuration":0.25
+ "indicatorHideDuration":0.25,
+ "indicatorTransientDuration":1.0
},
"TextSelectionScrollIndicator":
{
Name: dali-addon
Summary: DALi module for Node.JS
-Version: 1.2.28
+Version: 1.2.29
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.2.28
+Version: 1.2.29
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT
%apply float& OUTPUT { float& viewportX };
%apply float& OUTPUT { float& viewportY };
-#if defined(SWIGCSHARP)
-
%include arrays_csharp.i
%apply unsigned char INPUT[] { unsigned char* pixelBuffer}
%apply unsigned char INPUT[] { unsigned char* buffer}
%apply unsigned short INPUT[] { unsigned short* indices}
%apply float INPUT[] { float* array }
-#endif
-
%ignore *::Animation(Internal::Animation*);
%ignore *::Actor(Internal::Actor*);
%ignore *::BufferImage(Internal::BufferImage*);
%ignore *::GetKeyValue(SizeType) const;
%ignore *::TypeInfo::GetCreator() const;
%ignore Dali::Stage::TouchedSignal;
+%ignore Dali::DevelActor::Property::Type;
%rename(ParentOriginTop) Dali::ParentOrigin::TOP;
%rename(ParentOriginBottom) Dali::ParentOrigin::BOTTOM;
%rename(Z) Dali::Vector4::z;
%rename(W) Dali::Vector4::w;
-
typedef std::pair<std::string, Dali::Property::Value> StringValuePair;
typedef std::vector<Dali::TouchPoint> TouchPointContainer;
typedef std::pair< Dali::Radian, Dali::Radian > AngleThresholdPair;
%include <dali/public-api/events/wheel-event.h>
%include <dali/public-api/actors/actor.h>
+%include <dali/devel-api/actors/actor-devel.h>
%include <dali/public-api/actors/layer.h>
%include <dali/public-api/common/stage.h>
%include <dali/public-api/size-negotiation/relayout-container.h>
%template(VectorUnsignedChar) Dali::Vector<unsigned char>;
%template(VectorUint16Pair) Dali::Vector<Dali::Uint16Pair>;
%template(VoidSignal) Dali::Signal<void()>;
-%template(BoolSignal) Dali::Signal<bool()>;
%template(FloatSignal) Dali::Signal<void(float)>;
%template(ObjectCreatedSignal) Dali::Signal<void(Dali::BaseHandle)>;
%template(ObjectDestroyedSignal) Dali::Signal<void(const Dali::RefObject*)>;
//DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, (std::pair< Dali::Radian, Dali::Radian >), AngleThresholdPair);
//DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, (std::pair< Dali::Radian, Dali::Radian >), AngleThresholdPair);
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::ProgressBar, float, float)>, ProgressBarValueChangedSignal);
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Signal<void(Dali::Toolkit::ProgressBar, float, float)>, ProgressBarValueChangedSignal);
+
DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, ApplicationExtensions );
DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, ApplicationExtensions );
%template(GaussianBlurViewSignal) Dali::Signal<void (Dali::Toolkit::GaussianBlurView)>;
%template(PageTurnSignal) Dali::Signal<void(Dali::Toolkit::PageTurnView, unsigned int, bool)>;
%template(PagePanSignal) Dali::Signal<void(Dali::Toolkit::PageTurnView)>;
+%template(ProgressBarValueChangedSignal) Dali::Signal<void(Dali::Toolkit::ProgressBar, float, float)>;
%template(ScrollViewSnapStartedSignal) Dali::Signal< void(const Dali::Toolkit::ScrollView::SnapEvent&)>;
%template(ScrollableSignal) Dali::Signal< void(const Dali::Vector2&)>;
%template(TextEditorSignal) Dali::Signal<void(Dali::Toolkit::TextEditor)>;
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/actors/actor-devel.h>
+
#include <dali/public-api/math/matrix.h>
#include <dali/public-api/math/matrix3.h>
#include <dali/public-api/math/viewport.h>
%include events/pinchgesture-event.i
%include events/pageturnview-event.i
%include events/pangesture-event.i
+%include events/progress-bar-event.i
%include events/propertynotification-event.i
%include events/longpressgesture-event.i
%include events/rectangle.i
{
SetVisible(false);
}
+
+ public void Raise()
+ {
+ NDalicPINVOKE.Raise(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public void Lower()
+ {
+ NDalicPINVOKE.Lower(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public void RaiseToTop()
+ {
+ NDalicPINVOKE.RaiseToTop(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public void LowerToBottom()
+ {
+ NDalicPINVOKE.LowerToBottom(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public void RaiseAbove(Actor target)
+ {
+ NDalicPINVOKE.RaiseAbove(swigCPtr, Actor.getCPtr(target));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public void LowerBelow(Actor target)
+ {
+ NDalicPINVOKE.RaiseAbove(swigCPtr, Actor.getCPtr(target));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
%}
%enddef
--- /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.
+ *
+ */
+
+%define PROGRESS_BAR_EVENTHANDLER_TYPEMAP_EVENTARG(NameSpace, ClassName)
+%typemap(csimports) NameSpace::ClassName %{
+using System;
+using System.Runtime.InteropServices;
+
+%}
+%enddef
+
+%define PROGRESS_BAR_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
+%typemap(cscode) NameSpace::ClassName %{
+
+public class ValueChangedEventArgs : EventArgs
+{
+ private ProgressBar _progressBar;
+ private float _progressValue;
+ private float _secondaryProgressValue;
+
+ public ProgressBar ProgressBar
+ {
+ get
+ {
+ return _progressBar;
+ }
+ set
+ {
+ _progressBar = value;
+ }
+ }
+
+ public float ProgressValue
+ {
+ get
+ {
+ return _progressValue;
+ }
+ set
+ {
+ _progressValue = value;
+ }
+ }
+
+ public float SecondaryProgressValue
+ {
+ get
+ {
+ return _secondaryProgressValue;
+ }
+ set
+ {
+ _secondaryProgressValue = value;
+ }
+ }
+
+}
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue);
+ private DaliEventHandler<object,ValueChangedEventArgs> _progressBarValueChangedEventHandler;
+ private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate;
+
+ public event DaliEventHandler<object,ValueChangedEventArgs> ValueChanged
+ {
+ add
+ {
+ lock(this)
+ {
+ // Restricted to only one listener
+ if (_progressBarValueChangedEventHandler == null)
+ {
+ _progressBarValueChangedEventHandler += value;
+
+ _progressBarValueChangedCallbackDelegate = new ValueChangedCallbackDelegate(OnValueChanged);
+ this.ValueChangedSignal().Connect(_progressBarValueChangedCallbackDelegate);
+ }
+ }
+ }
+
+ remove
+ {
+ lock(this)
+ {
+ if (_progressBarValueChangedEventHandler != null)
+ {
+ this.ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
+ }
+
+ _progressBarValueChangedEventHandler -= value;
+ }
+ }
+ }
+
+ // Callback for ProgressBar ValueChanged signal
+ private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue)
+ {
+ ValueChangedEventArgs e = new ValueChangedEventArgs();
+
+ // Populate all members of "e" (ValueChangedEventArgs) with real page
+ e.ProgressBar = ProgressBar.GetProgressBarFromPtr( progressBar );
+ e.ProgressValue = progressValue;
+ e.SecondaryProgressValue = secondaryProgressValue;
+
+ if (_progressBarValueChangedEventHandler != null)
+ {
+ _progressBarValueChangedEventHandler(this, e);
+ }
+ }
+
+ public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
+ ClassName ret = new ClassName(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+%}
+
+%enddef
+
+
+%define DALI_PROGRESS_BAR_EVENTHANDLER_PARAM( NameSpace, ClassName)
+
+ PROGRESS_BAR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
+ PROGRESS_BAR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
+
+%enddef
+
+namespace Dali
+{
+ DALI_PROGRESS_BAR_EVENTHANDLER_PARAM( Dali::Toolkit, ProgressBar);
+}
* (in the type of TickEventHandler-DaliEventHandlerWithReturnType<object,TickEventArgs,bool>)
* provided by the user. Ticked signal is emitted after specified time interval.
*/
- public event DaliEventHandlerWithReturnType<object,TickEventArgs,bool> Ticked
+ public event DaliEventHandlerWithReturnType<object,TickEventArgs,bool> Tick
{
add
{
namespace Dali
{
- DALI_TIMER_EVENTHANDLER_PARAM( Dali::Adaptor, Timer);
+ DALI_TIMER_EVENTHANDLER_PARAM( Dali, Timer);
}
Macros for signals with return values
*****************/
+// 0 param signals ( with return )
+%define DALI_SIGNAL_0_PARAM_RETURN( returnType )
+
+ SIGNAL_TYPEMAP_HELPER( returnType (*func) () );
+ SIGNAL_TEMPLATE_HELPER_0( returnType, return);
+%enddef
+
// 1 param signals ( with return )
%define DALI_SIGNAL_1_PARAM_RETURN( returnType, argumentType1 )
// Signal< void () >
DALI_SIGNAL_0_PARAM();
+// Signal< bool () >
+DALI_SIGNAL_0_PARAM_RETURN( bool );
+
// Signal< void (Actor) >
DALI_SIGNAL_1_PARAM( Dali::Actor );
// void Signal< Dali::Toolkit::PageTurnView >;
DALI_SIGNAL_1_PARAM( Dali::Toolkit::PageTurnView );
+// void Signal< Dali::Toolkit::ProgressBar, float, float >;
+DALI_SIGNAL_3_PARAM( Dali::Toolkit::ProgressBar, float, float );
+
// void Signal< const Dali::Toolkit::ScrollView::SnapEvent& >;
DALI_SIGNAL_1_PARAM( const Dali::Toolkit::ScrollView::SnapEvent& );
private Dali.Application _application;
private TableView _contentContainer;
+ private Timer _timer;
private Stage _stage;
private Popup _popup;
+ private ProgressBar _progressBar;
// List of items
private Item[] mViewList = {
new Item("PushButton", true), new Item("DropDown", false), new Item("Toggle", true),
new Item("InputField", false), new Item("AnimateGif", false), new Item("Loading", false),
- new Item("ProgressBar", false), new Item("CheckBox", false), new Item("RadioButton", true),
+ new Item("ProgressBar", true), new Item("CheckBox", false), new Item("RadioButton", true),
new Item("Tooltip", true), new Item("Popup", true), new Item("Toast", true),
new Item("ItemView", false), new Item("CheckBox", true)
};
}
if (item.name.CompareTo("ProgressBar") == 0)
{
+ _progressBar = new ProgressBar();
+ _progressBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+ _progressBar.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT);
+ _progressBar.SetSize( 0, 50 );
+ _progressBar.ValueChanged += OnProgressBarValueChanged;
+
+ _timer = new Timer( 100 );
+ _timer.Tick += ( obj, e ) =>
+ {
+ float progress = (float)Math.Round( _progressBar.ProgressValue , 2 );
+
+ if( progress == 1.0f )
+ {
+ _progressBar.ProgressValue = 0.0f;
+ _progressBar.SecondaryProgressValue = 0.01f;
+ }
+ else
+ {
+ _progressBar.ProgressValue = progress + 0.01f;
+ _progressBar.SecondaryProgressValue = progress + 0.21f;
+ }
+ return true;
+ };
+ _timer.Start();
+
+ _contentContainer.AddChild(_progressBar, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
}
if (item.name.CompareTo("ScrollBar") == 0)
{
return cancelButton;
}
+ void OnProgressBarValueChanged( object source, ProgressBar.ValueChangedEventArgs e )
+ {
+ Property.Map labelVisual = new Property.Map();
+ labelVisual.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text) )
+ .Add( Dali.Constants.TextVisualProperty.Text, new Property.Value( Math.Round( e.ProgressBar.ProgressValue, 2 ) +" / "+Math.Round( e.ProgressBar.SecondaryProgressValue, 2 )) );
+ e.ProgressBar.LabelVisual = labelVisual;
+ return;
+ }
+
public void MainLoop()
{
_application.MainLoop();