1 #ifndef __DALI_EMSCRIPTEN_CALLBACKS_H__
2 #define __DALI_EMSCRIPTEN_CALLBACKS_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.
22 #include <dali/integration-api/platform-abstraction.h>
23 #include <dali/integration-api/resource-cache.h>
24 #include <dali/public-api/common/dali-common.h>
38 * Allows Dali adaptor to request a glyph image from the browser
40 * @param[in] fontFamily The font family name
41 * @param[in] fontStyle The font style name
42 * @param[in] fontSize The font size
43 * @param[in] character The character
46 Dali::Integration::BitmapPtr GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character );
49 * Image meta data helper
51 * Allows Dali adaptor to request image metadata from image known to the browser
53 * @param[in] filename The image name (possibly not directly a filename due to the browser sandboxing)
54 * @param[in] size The image dimensions
55 * @param[in] fittingMode The dali fitting mode
56 * @param[in] samplingMode The dali sampling mode
57 * @param[in] orientationCorrection The orientation correction
60 Dali::ImageDimensions LoadImageMetadata(const std::string filename,
61 Dali::ImageDimensions& size,
62 Dali::FittingMode::Type fittingMode,
63 Dali::SamplingMode::Type samplingMode,
64 bool orientationCorrection );
69 * Allows Dali adaptor to request an image from the browser
71 * @param[in] size The image dimensionsn
72 * @param[in] fittingMode The dali fitting mode
73 * @param[in] samplingMode The dali sampling mode
74 * @param[in] orientationCorrection The orientation correction
75 * @param[in] filename The image name (possibly not directly a filename due to the browser sandboxing)
78 Dali::Integration::BitmapPtr GetImage(const Dali::ImageDimensions& size,
79 const Dali::FittingMode::Type& fittingMode,
80 const Dali::SamplingMode::Type& samplingMode,
81 const bool orientationCorrection,
82 const std::string& filename );
85 * Debug statistics for the browser
93 float lastFrameDeltaSeconds;
94 unsigned int lastSyncTimeMilliseconds;
95 unsigned int nextSyncTimeMilliseconds;
97 unsigned int keepUpdating; ///< A bitmask of KeepUpdating values
98 bool needsNotification;
99 float secondsFromLastFrame;
101 Statistics() :on(true),
103 lastFrameDeltaSeconds(0.0),
104 lastSyncTimeMilliseconds(0.0),
105 nextSyncTimeMilliseconds(0.0),
107 needsNotification(false),
108 secondsFromLastFrame(0.0)
112 extern Statistics stats;
114 }; // namespace Emscripten
115 }; // namespace Internal