1 #ifndef DALI_INTERNAL_CONSTRAINT_SOURCE_H
2 #define DALI_INTERNAL_CONSTRAINT_SOURCE_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/internal/event/common/object-impl.h>
23 #include <dali/public-api/animation/constraint-source.h>
24 #include <dali/public-api/common/vector-wrapper.h>
31 using SourceContainer = std::vector<Source>;
32 using SourceIter = SourceContainer::iterator;
35 * The source of an input property for a constraint.
43 : sourceType(OBJECT_PROPERTY),
44 propertyIndex(Property::INVALID_INDEX),
50 * Create a constraint source from a public handle.
51 * The internal object is not referenced by the Internal::Source; therefore
52 * the owner of this object is responsible for observing the Object's lifetime.
54 Source(Dali::ConstraintSource& source)
55 : sourceType(source.sourceType),
56 propertyIndex(source.propertyIndex),
61 object = &dynamic_cast<Object&>(GetImplementation(source.object));
65 SourceType sourceType; ///< The source type
67 Property::Index propertyIndex; ///< The index of the source property
69 Object* object; ///< The target object; only valid if sourceType == OBJECT_PROPERTY
72 } // namespace Internal
76 #endif // DALI_INTERNAL_CONSTRAINT_SOURCE_H