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 Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/internal/update/common/property-owner.h>
22 #include <dali/internal/common/event-to-update.h>
33 // Messages for PropertyOwner
35 inline void InstallCustomPropertyMessage( EventToUpdate& eventToUpdate, const PropertyOwner& owner, PropertyBase& property )
37 typedef MessageValue1< PropertyOwner, PropertyBase* > LocalType;
39 // Reserve some memory inside the message queue
40 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
42 // Construct message in the message queue memory; note that delete should not be called on the return value
43 new (slot) LocalType( &owner, &PropertyOwner::InstallCustomProperty, &property );
46 inline void ApplyConstraintMessage( EventToUpdate& eventToUpdate, const PropertyOwner& owner, ConstraintBase& constraint )
48 typedef MessageValue1< PropertyOwner, OwnerPointer<ConstraintBase> > LocalType;
50 // Reserve some memory inside the message queue
51 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
53 // Construct message in the message queue memory; note that delete should not be called on the return value
54 new (slot) LocalType( &owner, &PropertyOwner::ApplyConstraint, &constraint );
57 inline void RemoveConstraintMessage( EventToUpdate& eventToUpdate, const PropertyOwner& owner, const ConstraintBase& constConstraint )
59 // The update-thread can modify this object.
60 ConstraintBase& constraint = const_cast< ConstraintBase& >( constConstraint );
62 typedef MessageValue1< PropertyOwner, ConstraintBase* > LocalType;
64 // Reserve some memory inside the message queue
65 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
67 // Construct message in the message queue memory; note that delete should not be called on the return value
68 new (slot) LocalType( &owner, &PropertyOwner::RemoveConstraint, &constraint );
71 } // namespace SceneGraph
73 } // namespace Internal
77 #endif // __DALI_INTERNAL_SCENE_GRAPH_PROPERTY_OWNER_MESSAGES_H__