Revert "[3.0] Added missing newline chars to logging commands"
[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/integration-api/resource-cache.h>
24 #include <dali/public-api/common/dali-common.h>
25
26 // INTERNAL INCLUDES
27
28 namespace Dali
29 {
30 namespace Internal
31 {
32 namespace Emscripten
33 {
34
35 /**
36  * Glyph helper
37  *
38  * Allows Dali adaptor to request a glyph image from the browser
39  *
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
44  *
45  */
46 Dali::Integration::BitmapPtr GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character );
47
48 /**
49  * Image meta data helper
50  *
51  * Allows Dali adaptor to request image metadata from image known to the browser
52  *
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
58  *
59  */
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 );
65
66 /**
67  * Image helper
68  *
69  * Allows Dali adaptor to request an image from the browser
70  *
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)
76  *
77  */
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 );
83
84 /**
85  * Debug statistics for the browser
86  *
87  */
88 struct Statistics
89 {
90   bool on;
91   float frameCount;
92
93   float lastFrameDeltaSeconds;
94   unsigned int lastSyncTimeMilliseconds;
95   unsigned int nextSyncTimeMilliseconds;
96
97   unsigned int keepUpdating; ///< A bitmask of KeepUpdating values
98   bool needsNotification;
99   float secondsFromLastFrame;
100
101 Statistics() :on(true),
102     frameCount(0.0),
103     lastFrameDeltaSeconds(0.0),
104     lastSyncTimeMilliseconds(0.0),
105     nextSyncTimeMilliseconds(0.0),
106     keepUpdating(0),
107     needsNotification(false),
108     secondsFromLastFrame(0.0)
109   {};
110 };
111
112 extern Statistics stats;
113
114 }; // namespace Emscripten
115 }; // namespace Internal
116 }; // namespace Dali
117
118 #endif // header