-#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) 2018 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.
*/
// INTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/dali-adaptor-common.h>
+
// EXTERNAL INCLUDES
+#include <cstdint>
#include <string>
+#include <memory>
#include <dali/integration-api/platform-abstraction.h>
namespace Dali
{
+class CallbackBase;
+
namespace TizenPlatform
{
-
class ResourceLoader;
/**
/**
* 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.
*/
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;
};
/**
} // namespace Dali
-#endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
+#endif // DALI_TIZEN_PLATFORM_ABSTRACTION_H