a4af959337ccded15c44324ce1d8278ad4495023
[platform/core/uifw/dali-adaptor.git] / dali / internal / vector-animation / common / vector-animation-renderer-impl.cpp
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/vector-animation/common/vector-animation-renderer-impl.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/type-registry.h>
23
24 // INTERNAL INCLUDES
25
26 namespace Dali
27 {
28 namespace Internal
29 {
30 namespace Adaptor
31 {
32 namespace // unnamed namespace
33 {
34 // Type Registration
35 Dali::BaseHandle Create()
36 {
37   return Dali::BaseHandle();
38 }
39
40 Dali::TypeRegistration type(typeid(Dali::VectorAnimationRenderer), typeid(Dali::BaseHandle), Create);
41
42 } // unnamed namespace
43
44 VectorAnimationRendererPtr VectorAnimationRenderer::New()
45 {
46   VectorAnimationRendererPtr renderer = new VectorAnimationRenderer();
47   return renderer;
48 }
49
50 VectorAnimationRenderer::VectorAnimationRenderer()
51 : mPlugin(std::string())
52 {
53 }
54
55 VectorAnimationRenderer::~VectorAnimationRenderer()
56 {
57 }
58
59 void VectorAnimationRenderer::Finalize()
60 {
61   mPlugin.Finalize();
62 }
63
64 bool VectorAnimationRenderer::Load(const std::string& url)
65 {
66   return mPlugin.Load(url);
67 }
68
69 void VectorAnimationRenderer::SetRenderer(Dali::Renderer renderer)
70 {
71   mPlugin.SetRenderer(renderer);
72 }
73
74 void VectorAnimationRenderer::SetSize(uint32_t width, uint32_t height)
75 {
76   mPlugin.SetSize(width, height);
77 }
78
79 bool VectorAnimationRenderer::Render(uint32_t frameNumber)
80 {
81   return mPlugin.Render(frameNumber);
82 }
83
84 void VectorAnimationRenderer::RenderStopped()
85 {
86   mPlugin.RenderStopped();
87 }
88
89 uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
90 {
91   return mPlugin.GetTotalFrameNumber();
92 }
93
94 float VectorAnimationRenderer::GetFrameRate() const
95 {
96   return mPlugin.GetFrameRate();
97 }
98
99 void VectorAnimationRenderer::GetDefaultSize(uint32_t& width, uint32_t& height) const
100 {
101   mPlugin.GetDefaultSize(width, height);
102 }
103
104 void VectorAnimationRenderer::GetLayerInfo(Property::Map& map) const
105 {
106   mPlugin.GetLayerInfo(map);
107 }
108
109 bool VectorAnimationRenderer::GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const
110 {
111   return mPlugin.GetMarkerInfo(marker, startFrame, endFrame);
112 }
113
114 void VectorAnimationRenderer::InvalidateBuffer()
115 {
116   mPlugin.InvalidateBuffer();
117 }
118
119 void VectorAnimationRenderer::AddPropertyValueCallback(const std::string& keyPath, Dali::VectorAnimationRenderer::VectorProperty property, CallbackBase* callback, int32_t id)
120 {
121   mPlugin.AddPropertyValueCallback(keyPath, property, callback, id);
122 }
123
124 Dali::VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
125 {
126   return mPlugin.UploadCompletedSignal();
127 }
128
129 } // namespace Adaptor
130
131 } // namespace Internal
132
133 } // namespace Dali