Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / vector-animation-renderer.cpp
1 /*
2  * Copyright (c) 2018 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/devel-api/adaptor-framework/vector-animation-renderer.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/vector-animation/common/vector-animation-renderer-impl.h>
23
24 namespace Dali
25 {
26
27 VectorAnimationRenderer VectorAnimationRenderer::New( const std::string& url, Renderer renderer, uint32_t width, uint32_t height )
28 {
29   Internal::Adaptor::VectorAnimationRendererPtr animationRenderer = Internal::Adaptor::VectorAnimationRenderer::New();
30   if( animationRenderer )
31   {
32     animationRenderer->Initialize( url, renderer, width, height );
33   }
34
35   return VectorAnimationRenderer( animationRenderer.Get() );
36 }
37
38 VectorAnimationRenderer::VectorAnimationRenderer()
39 {
40 }
41
42 VectorAnimationRenderer::~VectorAnimationRenderer()
43 {
44 }
45
46 VectorAnimationRenderer::VectorAnimationRenderer( Internal::Adaptor::VectorAnimationRenderer* internal )
47 : BaseHandle( internal )
48 {
49 }
50
51 VectorAnimationRenderer::VectorAnimationRenderer( const VectorAnimationRenderer& handle )
52 : BaseHandle( handle )
53 {
54 }
55
56 VectorAnimationRenderer& VectorAnimationRenderer::operator=( const VectorAnimationRenderer& rhs )
57 {
58   BaseHandle::operator=( rhs );
59   return *this;
60 }
61
62 bool VectorAnimationRenderer::StartRender()
63 {
64   return GetImplementation( *this ).StartRender();
65 }
66
67 void VectorAnimationRenderer::StopRender()
68 {
69   GetImplementation( *this ).StopRender();
70 }
71
72 void VectorAnimationRenderer::Render( uint32_t frameNumber )
73 {
74   GetImplementation( *this ).Render( frameNumber );
75 }
76
77 uint32_t VectorAnimationRenderer::GetTotalFrameNumber()
78 {
79   return GetImplementation( *this ).GetTotalFrameNumber();
80 }
81
82 } // namespace Dali