1 #ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
2 #define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
5 * Copyright (c) 2018 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.
22 #include <dali/public-api/dali-adaptor-common.h>
26 #include <dali/integration-api/platform-abstraction.h>
31 namespace TizenPlatform
37 * Concrete implementation of the platform abstraction class.
39 class TizenPlatformAbstraction : public Integration::PlatformAbstraction
42 public: // Construction & Destruction
47 TizenPlatformAbstraction();
52 virtual ~TizenPlatformAbstraction();
54 public: // PlatformAbstraction overrides
57 * @copydoc PlatformAbstraction::GetClosestImageSize()
59 virtual ImageDimensions GetClosestImageSize( const std::string& filename,
61 FittingMode::Type fittingMode,
62 SamplingMode::Type samplingMode,
63 bool orientationCorrection );
66 * @copydoc PlatformAbstraction::GetClosestImageSize()
68 virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
70 FittingMode::Type fittingMode,
71 SamplingMode::Type samplingMode,
72 bool orientationCorrection );
75 * @copydoc PlatformAbstraction::LoadImageSynchronously()
77 virtual Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath);
80 * @copydoc PlatformAbstraction::DecodeBuffer()
82 virtual Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size );
85 * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
87 virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
90 * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
92 virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
95 * Sets path for data/resource storage.
96 * @param[in] path data/resource storage path
98 void SetDataStoragePath( const std::string& path );
102 TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
103 TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
105 std::string mDataStoragePath;
110 * Construct a platform abstraction and return it.
111 * @return TizenPlatformAbstraction instance
113 TizenPlatformAbstraction* CreatePlatformAbstraction();
116 * Save a file to disk
117 * @param filename to create
118 * @param buffer to store
119 * @param numBytes to store
120 * @return true if successful, false otherwise
122 bool SaveFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes );
124 } // namespace TizenPlatform
128 #endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__