1 #ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
2 #define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include <dali/integration-api/platform-abstraction.h>
22 #include <dali/integration-api/resource-cache.h>
23 #include <dali/public-api/common/dali-common.h>
31 * Construct a platform abstraction and return it.
33 Integration::PlatformAbstraction* CreatePlatformAbstraction();
35 namespace TizenPlatform
41 * Concrete implementation of the platform abstraction class.
43 class TizenPlatformAbstraction : public Integration::PlatformAbstraction
46 public: // Construction & Destruction
51 TizenPlatformAbstraction();
56 virtual ~TizenPlatformAbstraction();
58 public: // PlatformAbstraction overrides
61 * @copydoc PlatformAbstraction::GetTimeNanoseconds()
63 virtual void GetTimeNanoseconds( uint64_t& seconds, uint64_t& nanoseconds );
66 * @copydoc PlatformAbstraction::Suspend()
68 virtual void Suspend();
71 * @copydoc PlatformAbstraction::Resume()
73 virtual void Resume();
76 * @copydoc PlatformAbstraction::GetClosestImageSize()
78 virtual ImageDimensions GetClosestImageSize( const std::string& filename,
80 FittingMode::Type fittingMode,
81 SamplingMode::Type samplingMode,
82 bool orientationCorrection );
85 * @copydoc PlatformAbstraction::GetClosestImageSize()
87 virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
89 FittingMode::Type fittingMode,
90 SamplingMode::Type samplingMode,
91 bool orientationCorrection );
94 * @copydoc PlatformAbstraction::LoadResource()
96 virtual void LoadResource(const Integration::ResourceRequest& request);
99 * @copydoc PlatformAbstraction::LoadResourceSynchronously()
101 virtual Integration::ResourcePointer LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath);
104 * @copydoc PlatformAbstraction::DecodeBuffer()
106 virtual Integration::BitmapPtr DecodeBuffer( const Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
109 * @copydoc PlatformAbstraction::CancelLoad()
111 virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
114 * @copydoc PlatformAbstraction::GetResources()
116 virtual void GetResources(Integration::ResourceCache& cache);
119 * @copydoc PlatformAbstraction::JoinLoaderThreads()
121 virtual void JoinLoaderThreads();
124 * @copydoc PlatformAbstraction::GetDefaultFontSize()
126 virtual int GetDefaultFontSize() const;
129 * @copydoc PlatformAbstraction::LoadFile()
131 virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
134 * @copydoc PlatformAbstraction::LoadFile()
136 virtual std::string LoadFile( const std::string& filename );
139 * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
141 virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
144 * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
146 virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
149 * Sets path for data/resource storage.
150 * @param[in] path data/resource storage path
152 void SetDataStoragePath( const std::string& path );
155 ResourceLoader* mResourceLoader;
156 std::string mDataStoragePath;
159 } // namespace TizenPlatform
162 #endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__