1 #ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
2 #define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
5 * Copyright (c) 2016 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/public-api/common/dali-common.h>
29 namespace TizenPlatform
35 * Concrete implementation of the platform abstraction class.
37 class TizenPlatformAbstraction : public Integration::PlatformAbstraction
40 public: // Construction & Destruction
45 TizenPlatformAbstraction();
50 virtual ~TizenPlatformAbstraction();
52 public: // PlatformAbstraction overrides
55 * @copydoc PlatformAbstraction::GetClosestImageSize()
57 virtual ImageDimensions GetClosestImageSize( const std::string& filename,
59 FittingMode::Type fittingMode,
60 SamplingMode::Type samplingMode,
61 bool orientationCorrection );
64 * @copydoc PlatformAbstraction::GetClosestImageSize()
66 virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
68 FittingMode::Type fittingMode,
69 SamplingMode::Type samplingMode,
70 bool orientationCorrection );
73 * @copydoc PlatformAbstraction::LoadImageSynchronously()
75 virtual Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath);
78 * @copydoc PlatformAbstraction::DecodeBuffer()
80 virtual Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size );
83 * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
85 virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
88 * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
90 virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
93 * Sets path for data/resource storage.
94 * @param[in] path data/resource storage path
96 void SetDataStoragePath( const std::string& path );
100 TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
101 TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
103 std::string mDataStoragePath;
108 * Construct a platform abstraction and return it.
109 * @return TizenPlatformAbstraction instance
111 TizenPlatformAbstraction* CreatePlatformAbstraction();
114 * Save a file to disk
115 * @param filename to create
116 * @param buffer to store
117 * @param numBytes to store
118 * @return true if successful, false otherwise
120 bool SaveFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes );
122 } // namespace TizenPlatform
126 #endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__