From: Sung-Jin Park Date: Mon, 19 Jun 2017 08:44:33 +0000 (+0900) Subject: input: use pepper-xkb api to create/set keymap instead of pepper and xkbcommon apis X-Git-Tag: submit/tizen_4.0/20170814.115522 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=refs%2Ftags%2Fsubmit%2Ftizen_4.0%2F20170814.115522;p=platform%2Fcore%2Fuifw%2Fpepper-dali.git input: use pepper-xkb api to create/set keymap instead of pepper and xkbcommon apis Change-Id: Icf2be615cbf2ca6c78ad450bc3b7b8322d447ddc Signed-off-by: Sung-Jin Park --- diff --git a/configure.ac b/configure.ac index e869ebe..ad7f17a 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AC_PROG_CXX AC_PROG_LIBTOOL # Checks for libraries. -PKG_CHECK_MODULES([PEPPER], [pepper xkbcommon]) +PKG_CHECK_MODULES([PEPPER], [pepper pepper-xkb]) PKG_CHECK_MODULES([WAYLAND], [wayland-server xdg-shell-server tizen-extension-client]) PKG_CHECK_MODULES([DALI], [dali-core dali-adaptor dali-toolkit dali-adaptor-integration]) PKG_CHECK_MODULES([EFL], [ecore ecore-input ecore-wayland]) diff --git a/packaging/pepper-dali.spec b/packaging/pepper-dali.spec index 23d675d..8fbc826 100644 --- a/packaging/pepper-dali.spec +++ b/packaging/pepper-dali.spec @@ -13,6 +13,7 @@ BuildRequires: pkgconfig(dali-adaptor-integration) BuildRequires: pkgconfig(dali-toolkit) BuildRequires: pkgconfig(wayland-server) BuildRequires: pkgconfig(pepper) +BuildRequires: pkgconfig(pepper-xkb) BuildRequires: pkgconfig(xdg-shell-server) BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(tizen-extension-client) @@ -22,6 +23,7 @@ BuildRequires: pkgconfig(ecore-wayland) BuildRequires: pkgconfig(wayland-tbm-server) BuildRequires: pkgconfig(wayland-tbm-client) Requires: libwayland-extension-server +Requires: pepper-xkb %description DALi backend for pepper. diff --git a/pepper-dali/internal/input-impl.cpp b/pepper-dali/internal/input-impl.cpp index 24a4ebe..e3ec64b 100644 --- a/pepper-dali/internal/input-impl.cpp +++ b/pepper-dali/internal/input-impl.cpp @@ -25,7 +25,6 @@ #include #include #include -#include namespace Dali { @@ -61,7 +60,6 @@ Input::Input() mPointer( NULL ), mKeyboard( NULL ), mTouch( NULL ), - mContext( NULL ), mEcoreEventHandler() { } @@ -73,7 +71,8 @@ Input::~Input() ecore_event_handler_del( *iter ); } - xkb_context_unref( mContext ); + pepper_xkb_destroy( mXkb ); + pepper_seat_remove_input_device( mSeat, mDevice ); pepper_input_device_destroy( mDevice ); @@ -112,45 +111,19 @@ void Input::Initialize( Pepper::Compositor& compositor ) mTouch = pepper_seat_get_touch( mSeat ); mCompositor = compositor; - - SetKeymap(); - - mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this ) ); - mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this ) ); - - DALI_LOG_INFO( gPepperInputLogging, Debug::Verbose, "Input::Initialize: success\n" ); -} - -void Input::SetKeymap() -{ - struct xkb_keymap* keymap; - struct xkb_context* context; - struct xkb_rule_names names; - - names.rules = "evdev"; - names.model = "pc105"; - names.layout = "us"; - names.options = NULL; - - context = xkb_context_new( XKB_CONTEXT_NO_FLAGS ); - if( !context ) + mXkb = pepper_xkb_create( ); + if( !mXkb ) { - DALI_LOG_INFO( gPepperInputLogging, Debug::General, "failed to create xkb_context\n" ); + DALI_LOG_INFO( gPepperInputLogging, Debug::General, "failed to create pepper xkb\n"); return; } - keymap = xkb_map_new_from_names( context, &names, XKB_KEYMAP_COMPILE_NO_FLAGS ); - if( !keymap ) - { - DALI_LOG_INFO( gPepperInputLogging, Debug::General, "failed to get keymap\n" ); - xkb_context_unref( context ); - return; - } + pepper_xkb_keyboard_set_keymap( mXkb, mKeyboard, NULL); - pepper_keyboard_set_keymap( mKeyboard, keymap ); - xkb_map_unref( keymap ); + mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this ) ); + mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this ) ); - mContext = context; + DALI_LOG_INFO( gPepperInputLogging, Debug::Verbose, "Input::Initialize: success\n" ); } Eina_Bool Input::EcoreEventKeyDown( void* data, int type, void* event ) diff --git a/pepper-dali/internal/input-impl.h b/pepper-dali/internal/input-impl.h index ae6ab8d..9a92c9f 100644 --- a/pepper-dali/internal/input-impl.h +++ b/pepper-dali/internal/input-impl.h @@ -70,8 +70,6 @@ private: */ void Initialize( Pepper::Compositor& compositor ); - void SetKeymap(); - private: // Undefined @@ -89,8 +87,7 @@ private: // Data pepper_pointer_t* mPointer; pepper_keyboard_t* mKeyboard; pepper_touch_t* mTouch; - - xkb_context* mContext; + pepper_xkb_t *mXkb; std::vector mEcoreEventHandler; }; diff --git a/pepper-dali/internal/input.h b/pepper-dali/internal/input.h index 32e384a..5f1303a 100644 --- a/pepper-dali/internal/input.h +++ b/pepper-dali/internal/input.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace Dali {