1 #ifndef __DALI_INTERNAL_EVENT_TO_UPDATE_H__
2 #define __DALI_INTERNAL_EVENT_TO_UPDATE_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/common/buffer-index.h>
23 #include <dali/internal/common/message.h>
24 #include <dali/internal/update/common/scene-graph-buffers.h>
33 * Abstract interface for accessing update-thread data from the event-thread.
34 * Used for queueing messages during the event-thread for the next update.
35 * Allows the event-thread to read double-buffered property values.
44 virtual ~EventToUpdate()
49 * Called by the event-thread to signal that FlushQueue will be called
50 * e.g. when it has finished event processing.
52 virtual void EventProcessingStarted() = 0;
55 * Reserve space for another message in the queue; this must then be initialized by the caller.
56 * The message will be read from the update-thread after the next FlushMessages is called.
57 * @post Calling this method may invalidate any previously returned slots.
58 * @param[in] size The message size with respect to the size of type "char".
59 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
60 * @return A pointer to the first char allocated for the message.
62 virtual unsigned int* ReserveMessageSlot( unsigned int size, bool updateScene = true ) = 0;
65 * Retrieve the current event-buffer index.
67 virtual BufferIndex GetEventBufferIndex() const = 0;
70 * Flush the set of messages, which were previously stored with QueueMessage().
71 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
73 * @return True if there are messages to process.
75 virtual bool FlushQueue() = 0;
78 } // namespace Internal
82 #endif // __DALI_INTERNAL_EVENT_TO_UPDATE_H__