1 #ifndef __DALI_PEPPER_INTERNAL_INPUT_H__
2 #define __DALI_PEPPER_INTERNAL_INPUT_H__
5 * Copyright (c) 2016 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 <pepper-dali/internal/input.h>
25 #include <dali/public-api/common/intrusive-ptr.h>
26 #include <dali/public-api/object/base-object.h>
41 typedef IntrusivePtr<Input> InputPtr;
43 class Input : public BaseObject
47 static InputPtr New( Pepper::Compositor compositor );
49 static Eina_Bool EcoreEventKeyDown( void* data, int type, void* event );
50 static Eina_Bool EcoreEventKeyUp( void* data, int type, void* event );
52 pepper_pointer_t* GetPointer();
53 pepper_keyboard_t* GetKeyboard();
54 pepper_touch_t* GetTouch();
59 * Construct a new Input.
64 * A reference counted object may only be deleted by calling Unreference()
69 * Second-phase constructor. Must be called immediately after creating a new Input;
71 void Initialize( Pepper::Compositor& compositor );
78 Input( const Input& );
81 Input& operator=( const Input& rhs );
85 Pepper::Compositor mCompositor;
88 pepper_input_device_t* mDevice;
89 pepper_pointer_t* mPointer;
90 pepper_keyboard_t* mKeyboard;
91 pepper_touch_t* mTouch;
93 xkb_context* mContext;
95 std::vector<Ecore_Event_Handler*> mEcoreEventHandler;
98 } // namespace Internal
100 // Helpers for public-api forwarding methods
102 inline Pepper::Internal::Input& GetImplementation( Pepper::Input& input )
104 DALI_ASSERT_ALWAYS( input && "Input handle is empty" );
106 BaseObject& handle = input.GetBaseObject();
108 return static_cast< Internal::Input& >( handle );
111 inline const Pepper::Internal::Input& GetImplementation( const Pepper::Input& input )
113 DALI_ASSERT_ALWAYS( input && "Input handle is empty" );
115 const BaseObject& handle = input.GetBaseObject();
117 return static_cast< const Internal::Input& >( handle );
120 } // namespace Pepper
124 #endif // __DALI_PEPPER_INTERNAL_INPUT_H__