Revert "[Tizen] Fix build errors in adaptor-uv by ecore wayland"
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / emscripten / emscripten-callbacks.h
1 #ifndef __DALI_EMSCRIPTEN_CALLBACKS_H__
2 #define __DALI_EMSCRIPTEN_CALLBACKS_H__
3
4 /*
5  * Copyright (c) 2015 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 // EXTERNAL INCLUDES
22 #include <dali/integration-api/platform-abstraction.h>
23 #include <dali/public-api/common/dali-common.h>
24
25 // INTERNAL INCLUDES
26
27 namespace Dali
28 {
29 namespace Internal
30 {
31 namespace Emscripten
32 {
33
34 /**
35  * Glyph helper
36  *
37  * Allows Dali adaptor to request a glyph image from the browser
38  *
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
43  *
44  */
45 Dali::Integration::BitmapPtr GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character );
46
47 /**
48  * Image meta data helper
49  *
50  * Allows Dali adaptor to request image metadata from image known to the browser
51  *
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
57  *
58  */
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 );
64
65 /**
66  * Image helper
67  *
68  * Allows Dali adaptor to request an image from the browser
69  *
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)
75  *
76  */
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 );
82
83 /**
84  * Debug statistics for the browser
85  *
86  */
87 struct Statistics
88 {
89   bool on;
90   float frameCount;
91
92   float lastFrameDeltaSeconds;
93   unsigned int lastSyncTimeMilliseconds;
94   unsigned int nextSyncTimeMilliseconds;
95
96   unsigned int keepUpdating; ///< A bitmask of KeepUpdating values
97   bool needsNotification;
98   float secondsFromLastFrame;
99
100 Statistics() :on(true),
101     frameCount(0.0),
102     lastFrameDeltaSeconds(0.0),
103     lastSyncTimeMilliseconds(0.0),
104     nextSyncTimeMilliseconds(0.0),
105     keepUpdating(0),
106     needsNotification(false),
107     secondsFromLastFrame(0.0)
108   {};
109 };
110
111 extern Statistics stats;
112
113 }; // namespace Emscripten
114 }; // namespace Internal
115 }; // namespace Dali
116
117 #endif // header