1 #ifndef __DALI_WAYLAND_INPUT_H__
2 #define __DALI_WAYLAND_INPUT_H__
5 * Copyright (c) 2015 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/public-api/common/dali-vector.h>
23 #include <dali/public-api/events/key-event.h>
26 #include <base/interfaces/window-event-interface.h>
28 #include <input/input-interface.h>
29 #include <input/seat.h>
40 * @brief Listens to Wayland input events.
41 * Translates the wayland events into DALi events and forwards them to a WindowEventInterface
43 class InputManager : public InputInterface
57 virtual ~InputManager();
60 * @brief Assign the window event interface
61 * @param[in] eventInterface event interface
63 void AssignWindowEventInterface( WindowEventInterface* eventInterface);
66 protected: //InputInterface, pointer events
69 * @copydoc InputInterface::PointerEnter
71 virtual void PointerEnter( Seat* seat, unsigned int serial, WlSurface* surface, float x, float y );
74 * @copydoc InputInterface::PointerLeave
76 virtual void PointerLeave( Seat* seat, unsigned int serial, WlSurface* surface );
79 * @copydoc InputInterface::PointerMotion
81 virtual void PointerMotion( Seat* seat, unsigned int timestamp, float x, float y );
84 * @copydoc InputInterface::PointerButton
86 virtual void PointerButton( Seat* seat, unsigned int serial, unsigned int timestamp, unsigned int button, unsigned int state );
89 * @copydoc InputInterface::PointerAxis
91 virtual void PointerAxis( Seat* seat, unsigned int timestamp, unsigned int axis, float value );
94 protected: //InputInterface, keyboard events
97 * @copydoc InputInterface::KeyboardKeymap
99 virtual void KeyboardKeymap( Seat* seat, unsigned int format, int fd, unsigned int size );
102 * @copydoc InputInterface::KeyFocusEnter
104 virtual void KeyFocusEnter( Seat* seat, unsigned int serial, WlSurface* surface, WlArray* keys );
107 * @copydoc InputInterface::KeyFocusLeave
109 virtual void KeyFocusLeave( Seat* seat, unsigned int serial, WlSurface* surface );
112 * @copydoc InputInterface::KeyEvent
114 virtual void KeyEvent( Seat* seat, unsigned int serial, unsigned int timestamp, unsigned int keycode, unsigned int state );
117 * @copydoc InputInterface::KeyModifiers
119 virtual void KeyModifiers( Seat* seat,
121 unsigned int depressed,
122 unsigned int latched,
124 unsigned int group );
127 * @copydoc InputInterface::KeyRepeatInfo
129 virtual void KeyRepeatInfo( Seat* seat, int32_t rate, int32_t delay);
131 protected: //InputInterface, touch events
134 * @copydoc InputInterface::TouchDown
136 virtual void TouchDown( Seat* seat, unsigned int serial, unsigned int timestamp, WlSurface* surface, int touchId, float x, float y);
139 * @copydoc InputInterface::TouchUp
141 virtual void TouchUp( Seat* seat, unsigned int serial, unsigned int timestamp, int touchId );
144 * @copydoc InputInterface::TouchMotion
146 virtual void TouchMotion( Seat* seat, unsigned int timestamp, int touchId, float x, float y );
149 * @copydoc InputInterface::TouchFrame
151 virtual void TouchFrame( Seat* seat );
154 * @copydoc InputInterface::TouchCancel
156 virtual void TouchCancel( Seat* seat );
159 protected: //InputInterface Helper functions
162 * @copydoc InputInterface::GetSeat( const WlKeyboard* keyboard )
164 virtual Seat* GetSeat( const WlKeyboard* keyboard );
167 * @copydoc InputInterface::GetSeat( const WlPointer* pointer )
169 virtual Seat* GetSeat( const WlPointer* pointer );
172 * @copydoc InputInterface::GetSeat( const WlTouch* touch )
174 virtual Seat* GetSeat( const WlTouch* touch );
177 * @copydoc InputInterface::GetSeat( const WlSeat* seat )
179 virtual Seat* GetSeat( const WlSeat* seat );
184 * @brief Add a new seat ( collection of input devices)
185 * @param[in] wlRegistry
186 * @param[in] seatName seat name / id
187 * @param[in] version interface version
189 void AddSeat( Seat* seat );
194 Dali::Vector< Seat* > mSeats;
195 WindowEventInterface* mWindowEventInterface;
203 #endif //__DALI_WAYLAND_INPUT_H__