X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Flegacy%2Fcommon%2Ftizen-platform-abstraction.h;h=9f501d7cb34e2c5770ab80eb01025e43e5ba1355;hb=1d0d7873858fd2010b71e5db8f03654fb307370f;hp=13db481811931d24829d0cf7b1e805838eb5be1a;hpb=761f75cd51351b7a4e072130f4a2ad0b3e3231bb;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/legacy/common/tizen-platform-abstraction.h b/dali/internal/legacy/common/tizen-platform-abstraction.h index 13db481..9f501d7 100644 --- a/dali/internal/legacy/common/tizen-platform-abstraction.h +++ b/dali/internal/legacy/common/tizen-platform-abstraction.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__ -#define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__ +#ifndef DALI_TIZEN_PLATFORM_ABSTRACTION_H +#define DALI_TIZEN_PLATFORM_ABSTRACTION_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,17 +18,24 @@ * */ -#include -#include +// INTERNAL INCLUDES +#include +#include + +// EXTERNAL INCLUDES +#include #include +#include +#include namespace Dali { +class CallbackBase; + namespace TizenPlatform { - class ResourceLoader; /** @@ -47,47 +54,57 @@ public: // Construction & Destruction /** * Destructor */ - virtual ~TizenPlatformAbstraction(); + ~TizenPlatformAbstraction() override; public: // PlatformAbstraction overrides /** * @copydoc PlatformAbstraction::GetClosestImageSize() */ - virtual ImageDimensions GetClosestImageSize( const std::string& filename, - ImageDimensions size, - FittingMode::Type fittingMode, - SamplingMode::Type samplingMode, - bool orientationCorrection ); + ImageDimensions GetClosestImageSize( const std::string& filename, + ImageDimensions size, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection ) override; /** * @copydoc PlatformAbstraction::GetClosestImageSize() */ - virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer, - ImageDimensions size, - FittingMode::Type fittingMode, - SamplingMode::Type samplingMode, - bool orientationCorrection ); + ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer, + ImageDimensions size, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection ) override; /** * @copydoc PlatformAbstraction::LoadImageSynchronously() */ - virtual Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath); + Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath) override; /** * @copydoc PlatformAbstraction::DecodeBuffer() */ - virtual Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size ); + Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size ) override; /** * @copydoc PlatformAbstraction::LoadShaderBinaryFile() */ - virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const; + bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const override; /** * @copydoc PlatformAbstraction::SaveShaderBinaryFile() */ - virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const; + bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const override; + + /** + * @copydoc PlatformAbstraction::StartTimer() + */ + uint32_t StartTimer( uint32_t milliseconds, CallbackBase* callback ) override; + + /** + * @copydoc PlatformAbstraction::CancelTimer() + */ + void CancelTimer ( uint32_t timerId ) override; /** * Sets path for data/resource storage. @@ -95,13 +112,27 @@ public: // PlatformAbstraction overrides */ void SetDataStoragePath( const std::string& path ); + /** + * Clears the timers that have completed + */ + void CleanupTimers(); + private: + struct TimerCallback; + + /* + * Executes callback function and cleans up timer + */ + void RunTimerFunction(TimerCallback& timerPtr); + TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined std::string mDataStoragePath; + std::vector< std::unique_ptr< TimerCallback > > mTimerPairsWaiting; + std::vector< std::unique_ptr< TimerCallback > > mTimerPairsSpent; }; /** @@ -123,4 +154,4 @@ bool SaveFile( const std::string& filename, const unsigned char * buffer, unsign } // namespace Dali -#endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__ +#endif // DALI_TIZEN_PLATFORM_ABSTRACTION_H