#define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
*/
#include <dali/integration-api/platform-abstraction.h>
-#include <dali/integration-api/resource-cache.h>
#include <dali/public-api/common/dali-common.h>
#include <string>
namespace Dali
{
-/**
- * Construct a platform abstraction and return it.
- */
-Integration::PlatformAbstraction* CreatePlatformAbstraction();
-
namespace TizenPlatform
{
-class DynamicsFactory;
class ResourceLoader;
/**
public: // PlatformAbstraction overrides
/**
- * @copydoc PlatformAbstraction::GetTimeMicroseconds()
- */
- virtual void GetTimeMicroseconds(unsigned int &seconds, unsigned int µSeconds);
-
- /**
- * @copydoc PlatformAbstraction::Suspend()
- */
- virtual void Suspend();
-
- /**
- * @copydoc PlatformAbstraction::Resume()
- */
- virtual void Resume();
-
- /**
* @copydoc PlatformAbstraction::GetClosestImageSize()
*/
- virtual void GetClosestImageSize( const std::string& filename,
- const ImageAttributes& attributes,
- Vector2& closestSize );
+ virtual ImageDimensions GetClosestImageSize( const std::string& filename,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection );
/**
* @copydoc PlatformAbstraction::GetClosestImageSize()
*/
- virtual void GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
- const ImageAttributes& attributes,
- Vector2& closestSize );
+ virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection );
/**
- * @copydoc PlatformAbstraction::LoadResource()
+ * @copydoc PlatformAbstraction::LoadImageSynchronously()
*/
- virtual void LoadResource(const Integration::ResourceRequest& request);
+ virtual Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath);
/**
- * @copydoc PlatformAbstraction::LoadResourceSynchronously()
+ * @copydoc PlatformAbstraction::DecodeBuffer()
*/
- virtual Integration::ResourcePointer LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath);
+ virtual Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size );
/**
- * @copydoc PlatformAbstraction::SaveResource()
+ * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
*/
- virtual void SaveResource(const Integration::ResourceRequest& request);
+ virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
/**
- * @copydoc PlatformAbstraction::CancelLoad()
+ * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
*/
- 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::JoinLoaderThreads()
- */
- virtual void JoinLoaderThreads();
-
- /**
- * @copydoc PlatformAbstraction::GetDefaultFontDescription()
- */
- virtual void GetDefaultFontDescription( std::string& family, std::string& style ) const;
-
- /**
- * @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, std::vector< unsigned char >& buffer ) const;
-
- /**
- * @copydoc PlatformAbstraction::LoadFile()
- */
- virtual std::string LoadFile( const std::string& filename );
-
- /**
- * @copydoc PlatformAbstraction::SaveFile()
- */
- virtual bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const;
-
- /**
- * @copydoc PlatformAbstraction::GetDynamicsFactory();
- */
- virtual Integration::DynamicsFactory* GetDynamicsFactory();
-
- /**
- * @copydoc PlatformAbstraction::LoadShaderBinFile()
- */
- virtual bool LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
+ virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
/**
* Sets path for data/resource storage.
void SetDataStoragePath( const std::string& path );
private:
- ResourceLoader* mResourceLoader;
- DynamicsFactory* mDynamicsFactory;
+
+ TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
+ TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
+
std::string mDataStoragePath;
+
};
+/**
+ * Construct a platform abstraction and return it.
+ * @return TizenPlatformAbstraction instance
+ */
+TizenPlatformAbstraction* CreatePlatformAbstraction();
+
+/**
+ * Save a file to disk
+ * @param filename to create
+ * @param buffer to store
+ * @param numBytes to store
+ * @return true if successful, false otherwise
+ */
+bool SaveFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes );
+
} // namespace TizenPlatform
+
} // namespace Dali
#endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__