1 #ifndef DALI_INTERNAL_EVENT_PROCESSOR_H
2 #define DALI_INTERNAL_EVENT_PROCESSOR_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/common/message-buffer.h>
23 #include <dali/internal/event/events/hover-event-processor.h>
24 #include <dali/internal/event/events/key-event-processor.h>
25 #include <dali/internal/event/events/touch-event-processor.h>
26 #include <dali/internal/event/events/wheel-event-processor.h>
38 class GestureEventProcessor;
39 class NotificationManager;
42 * The EventProcessor processes any events that are received by Dali. Such events include
43 * touch events, key events, wheel events, and notification events.
45 * When the EventProcessor receives an event, it determines its type and passes it on to the
46 * appropriate processor.
53 * @param[in] scene The scene.
54 * @param[in] gestureEventProcessor The gesture event processor.
56 EventProcessor(Scene& scene, GestureEventProcessor& gestureEventProcessor);
61 virtual ~EventProcessor();
65 * This function is called when an event is queued.
66 * @param[in] event A event to queue.
68 void QueueEvent(const Integration::Event& event);
71 * This function is called when events are processed.
76 Scene& mScene; ///< The Scene events are processed for.
77 TouchEventProcessor mTouchEventProcessor; ///< Processes touch events.
78 HoverEventProcessor mHoverEventProcessor; ///< Processes hover events.
79 GestureEventProcessor& mGestureEventProcessor; ///< Processes gesture events.
80 KeyEventProcessor mKeyEventProcessor; ///< Processes key events.
81 WheelEventProcessor mWheelEventProcessor; ///< Processes wheel events.
83 // Allow messages to be added safely to one queue, while processing (iterating through) the second queue.
84 MessageBuffer mEventQueue0; ///< An event queue.
85 MessageBuffer mEventQueue1; ///< Another event queue.
86 MessageBuffer* mCurrentEventQueue; ///< QueueEvent() will queue here.
89 } // namespace Internal
93 #endif // DALI_INTERNAL_EVENT_PROCESSOR_H