027de42deb28a1b189a4c939d0c4f2460b198d08
[platform/core/uifw/dali-core.git] / dali / internal / event / common / property-buffer-impl.cpp
1 /*
2  * Copyright (c) 2015 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/event/common/property-buffer-impl.h>  // Dali::Internal::PropertyBuffer
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/object/property-buffer.h>     // Dali::Internal::PropertyBuffer
23 #include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
24 #include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
25 #include <dali/internal/update/common/scene-graph-property-buffer.h>
26
27 namespace Dali
28 {
29 namespace Internal
30 {
31
32 namespace
33 {
34
35 /**
36  *            |name    |type             |writable|animatable|constraint-input|enum for index-checking|
37  */
38 DALI_PROPERTY_TABLE_BEGIN
39 DALI_PROPERTY( "size",          UNSIGNED_INTEGER, true, false,  true,   Dali::PropertyBuffer::Property::SIZE )
40 DALI_PROPERTY( "buffer-format", MAP,              false, false, false,  Dali::PropertyBuffer::Property::BUFFER_FORMAT )
41 DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
42
43 const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> PROPERTY_BUFFER_IMPL = { DEFAULT_PROPERTY_DETAILS };
44
45 } // unnamed namespace
46
47 PropertyBufferPtr PropertyBuffer::New()
48 {
49   return PropertyBufferPtr( new PropertyBuffer() );
50 }
51
52 void PropertyBuffer::SetSize( std::size_t size )
53 {
54   //TODO: MESH_REWORK
55   DALI_ASSERT_ALWAYS( false && "MESH_REWORK" );
56 }
57
58 std::size_t PropertyBuffer::GetSize() const
59 {
60   //TODO: MESH_REWORK
61   DALI_ASSERT_ALWAYS( false && "MESH_REWORK" );
62
63   return 0;
64 }
65
66 void PropertyBuffer::SetData( void* data )
67 {
68   //TODO: MESH_REWORK
69   DALI_ASSERT_ALWAYS( false && "MESH_REWORK" );
70 }
71
72 Dali::Property::Index PropertyBuffer::GetPropertyIndex( const std::string name, std::size_t index )
73 {
74   //TODO: MESH_REWORK
75   DALI_ASSERT_ALWAYS( false && "MESH_REWORK" );
76   return 0;
77 }
78
79 unsigned int PropertyBuffer::GetDefaultPropertyCount() const
80 {
81   return PROPERTY_BUFFER_IMPL.GetDefaultPropertyCount();
82 }
83
84 void PropertyBuffer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
85 {
86   PROPERTY_BUFFER_IMPL.GetDefaultPropertyIndices( indices );
87 }
88
89 const char* PropertyBuffer::GetDefaultPropertyName(Property::Index index) const
90 {
91   return PROPERTY_BUFFER_IMPL.GetDefaultPropertyName( index );
92 }
93
94 Property::Index PropertyBuffer::GetDefaultPropertyIndex( const std::string& name ) const
95 {
96   return PROPERTY_BUFFER_IMPL.GetDefaultPropertyIndex( name );
97 }
98
99 bool PropertyBuffer::IsDefaultPropertyWritable( Property::Index index ) const
100 {
101   return PROPERTY_BUFFER_IMPL.IsDefaultPropertyWritable( index );
102 }
103
104 bool PropertyBuffer::IsDefaultPropertyAnimatable( Property::Index index ) const
105 {
106   return PROPERTY_BUFFER_IMPL.IsDefaultPropertyAnimatable( index );
107 }
108
109 bool PropertyBuffer::IsDefaultPropertyAConstraintInput( Property::Index index ) const
110 {
111   return PROPERTY_BUFFER_IMPL.IsDefaultPropertyAConstraintInput( index );
112 }
113
114 Property::Type PropertyBuffer::GetDefaultPropertyType( Property::Index index ) const
115 {
116   return PROPERTY_BUFFER_IMPL.GetDefaultPropertyType( index );
117 }
118
119 void PropertyBuffer::SetDefaultProperty( Property::Index index,
120                                    const Property::Value& propertyValue )
121 {
122   PROPERTY_BUFFER_IMPL.SetDefaultProperty( index, propertyValue );
123 }
124
125 void PropertyBuffer::SetSceneGraphProperty( Property::Index index,
126                                       const CustomProperty& entry,
127                                       const Property::Value& value )
128 {
129   PROPERTY_BUFFER_IMPL.SetSceneGraphProperty( index, entry, value );
130 }
131
132 Property::Value PropertyBuffer::GetDefaultProperty( Property::Index index ) const
133 {
134   return PROPERTY_BUFFER_IMPL.GetDefaultProperty( index );
135 }
136
137 const SceneGraph::PropertyOwner* PropertyBuffer::GetPropertyOwner() const
138 {
139   return PROPERTY_BUFFER_IMPL.GetPropertyOwner();
140 }
141
142 const SceneGraph::PropertyOwner* PropertyBuffer::GetSceneObject() const
143 {
144   return mSceneObject;
145 }
146
147 const SceneGraph::PropertyBase* PropertyBuffer::GetSceneObjectAnimatableProperty( Property::Index index ) const
148 {
149   return PROPERTY_BUFFER_IMPL.GetSceneObjectAnimatableProperty( index );
150 }
151
152 const PropertyInputImpl* PropertyBuffer::GetSceneObjectInputProperty( Property::Index index ) const
153 {
154   return PROPERTY_BUFFER_IMPL.GetSceneObjectInputProperty( index );
155 }
156
157 int PropertyBuffer::GetPropertyComponentIndex( Property::Index index ) const
158 {
159   return PROPERTY_BUFFER_IMPL.GetPropertyComponentIndex( index );
160 }
161
162 bool PropertyBuffer::OnStage() const
163 {
164   // TODO: MESH_REWORK
165   DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
166   return false;
167 }
168
169 void PropertyBuffer::Connect()
170 {
171   // TODO: MESH_REWORK
172 }
173
174 void PropertyBuffer::Disconnect()
175 {
176   // TODO: MESH_REWORK
177 }
178
179 PropertyBuffer::PropertyBuffer()
180 : mSceneObject(NULL)
181 {
182 }
183
184 } // namespace Internal
185 } // namespace Dali