Dali 3D User Interface Engine
platform-abstraction.h
Go to the documentation of this file.
1 #ifndef __DALI_INTEGRATION_PLATFORM_ABSTRACTION_H__
2 #define __DALI_INTEGRATION_PLATFORM_ABSTRACTION_H__
3 
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20 
21 // INTERNAL INCLUDES
22 
27 
28 namespace Dali
29 {
30 
31 namespace Integration
32 {
33 
40 {
41 public:
42 
46  virtual ~PlatformAbstraction() {}
47 
48  // DALi Lifecycle
49 
58  virtual void Suspend() = 0;
59 
66  virtual void Resume() = 0;
67 
68  // Resource Loading
69 
86  virtual ImageDimensions GetClosestImageSize( const std::string& filename,
87  ImageDimensions size = ImageDimensions( 0, 0 ),
90  bool orientationCorrection = true) = 0;
91 
108  virtual ImageDimensions GetClosestImageSize( ResourcePointer resourceBuffer,
109  ImageDimensions size = ImageDimensions( 0, 0 ),
111  SamplingMode::Type samplingMode = SamplingMode::BOX,
112  bool orientationCorrection = true) = 0;
113 
123  virtual void LoadResource(const ResourceRequest& request) = 0;
124 
135  virtual ResourcePointer LoadResourceSynchronously( const ResourceType& resourceType, const std::string& resourcePath ) = 0;
136 
145  virtual BitmapPtr DecodeBuffer( const ResourceType& resourceType, uint8_t * buffer, size_t bufferSize ) = 0;
146 
154  virtual void CancelLoad(ResourceId id, ResourceTypeId typeId) = 0;
155 
163  virtual void GetResources(ResourceCache& cache) = 0;
164 
170  virtual void JoinLoaderThreads() = 0;
171 
172  // Font Queries
173 
182  virtual int GetDefaultFontSize() const = 0;
183 
190  virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const = 0;
191 
198  virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const = 0;
199 
207  virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const = 0;
208 
209 }; // class PlatformAbstraction
210 
211 } // namespace Integration
212 
213 } // namespace Dali
214 
215 #endif // __DALI_INTEGRATION_PLATFORM_ABSTRACTION_H__
Dali Docs Home
Read more about Dali