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 );
76 Input( const Input& );
79 Input& operator=( const Input& rhs );
83 Pepper::Compositor mCompositor;
86 pepper_input_device_t* mDevice;
87 pepper_pointer_t* mPointer;
88 pepper_keyboard_t* mKeyboard;
89 pepper_touch_t* mTouch;
92 std::vector<Ecore_Event_Handler*> mEcoreEventHandler;
95 } // namespace Internal
97 // Helpers for public-api forwarding methods
99 inline Pepper::Internal::Input& GetImplementation( Pepper::Input& input )
101 DALI_ASSERT_ALWAYS( input && "Input handle is empty" );
103 BaseObject& handle = input.GetBaseObject();
105 return static_cast< Internal::Input& >( handle );
108 inline const Pepper::Internal::Input& GetImplementation( const Pepper::Input& input )
110 DALI_ASSERT_ALWAYS( input && "Input handle is empty" );
112 const BaseObject& handle = input.GetBaseObject();
114 return static_cast< const Internal::Input& >( handle );
117 } // namespace Pepper
121 #endif // __DALI_PEPPER_INTERNAL_INPUT_H__