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/public-api/common/dali-common.h>
37 * Allows Dali adaptor to request a glyph image from the browser
39 * @param[in] fontFamily The font family name
40 * @param[in] fontStyle The font style name
41 * @param[in] fontSize The font size
42 * @param[in] character The character
45 Dali::Integration::BitmapPtr GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character );
48 * Image meta data helper
50 * Allows Dali adaptor to request image metadata from image known to the browser
52 * @param[in] filename The image name (possibly not directly a filename due to the browser sandboxing)
53 * @param[in] size The image dimensions
54 * @param[in] fittingMode The dali fitting mode
55 * @param[in] samplingMode The dali sampling mode
56 * @param[in] orientationCorrection The orientation correction
59 Dali::ImageDimensions LoadImageMetadata(const std::string filename,
60 Dali::ImageDimensions& size,
61 Dali::FittingMode::Type fittingMode,
62 Dali::SamplingMode::Type samplingMode,
63 bool orientationCorrection );
68 * Allows Dali adaptor to request an image from the browser
70 * @param[in] size The image dimensionsn
71 * @param[in] fittingMode The dali fitting mode
72 * @param[in] samplingMode The dali sampling mode
73 * @param[in] orientationCorrection The orientation correction
74 * @param[in] filename The image name (possibly not directly a filename due to the browser sandboxing)
77 Dali::Integration::BitmapPtr GetImage(const Dali::ImageDimensions& size,
78 const Dali::FittingMode::Type& fittingMode,
79 const Dali::SamplingMode::Type& samplingMode,
80 const bool orientationCorrection,
81 const std::string& filename );
84 * Debug statistics for the browser
92 float lastFrameDeltaSeconds;
93 unsigned int lastSyncTimeMilliseconds;
94 unsigned int nextSyncTimeMilliseconds;
96 unsigned int keepUpdating; ///< A bitmask of KeepUpdating values
97 bool needsNotification;
98 float secondsFromLastFrame;
100 Statistics() :on(true),
102 lastFrameDeltaSeconds(0.0),
103 lastSyncTimeMilliseconds(0.0),
104 nextSyncTimeMilliseconds(0.0),
106 needsNotification(false),
107 secondsFromLastFrame(0.0)
111 extern Statistics stats;
113 }; // namespace Emscripten
114 }; // namespace Internal