1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_PROPERTY_OWNER_MESSAGES_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_PROPERTY_OWNER_MESSAGES_H__
5 * Copyright (c) 2014 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/update/common/property-owner.h>
23 #include <dali/internal/common/event-to-update.h>
34 // Messages for PropertyOwner
36 inline void InstallCustomPropertyMessage( EventToUpdate& eventToUpdate, const PropertyOwner& owner, PropertyBase& property )
38 typedef MessageValue1< PropertyOwner, PropertyBase* > LocalType;
40 // Reserve some memory inside the message queue
41 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
43 // Construct message in the message queue memory; note that delete should not be called on the return value
44 new (slot) LocalType( &owner, &PropertyOwner::InstallCustomProperty, &property );
47 inline void ApplyConstraintMessage( EventToUpdate& eventToUpdate, const PropertyOwner& owner, ConstraintBase& constraint )
49 typedef MessageValue1< PropertyOwner, OwnerPointer<ConstraintBase> > LocalType;
51 // Reserve some memory inside the message queue
52 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
54 // Construct message in the message queue memory; note that delete should not be called on the return value
55 new (slot) LocalType( &owner, &PropertyOwner::ApplyConstraint, &constraint );
58 inline void RemoveConstraintMessage( EventToUpdate& eventToUpdate, const PropertyOwner& owner, const ConstraintBase& constConstraint )
60 // The update-thread can modify this object.
61 ConstraintBase& constraint = const_cast< ConstraintBase& >( constConstraint );
63 typedef MessageValue1< PropertyOwner, ConstraintBase* > LocalType;
65 // Reserve some memory inside the message queue
66 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
68 // Construct message in the message queue memory; note that delete should not be called on the return value
69 new (slot) LocalType( &owner, &PropertyOwner::RemoveConstraint, &constraint );
72 } // namespace SceneGraph
74 } // namespace Internal
78 #endif // __DALI_INTERNAL_SCENE_GRAPH_PROPERTY_OWNER_MESSAGES_H__