input: use pepper-xkb api to create/set keymap instead of pepper and xkbcommon apis 78/134578/1 accepted/tizen_unified accepted/tizen/4.0/unified/20170816.011805 accepted/tizen/4.0/unified/20170816.014930 accepted/tizen/4.0/unified/20170829.020252 accepted/tizen/unified/20170703.064020 submit/tizen/20170628.060900 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100004 submit/tizen_4.0_unified/20170814.115522 tizen_4.0.IoT.p1_release tizen_4.0.m2_release
authorSung-Jin Park <sj76.park@samsung.com>
Mon, 19 Jun 2017 08:44:33 +0000 (17:44 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 19 Jun 2017 08:44:57 +0000 (17:44 +0900)
Change-Id: Icf2be615cbf2ca6c78ad450bc3b7b8322d447ddc
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
configure.ac
packaging/pepper-dali.spec
pepper-dali/internal/input-impl.cpp
pepper-dali/internal/input-impl.h
pepper-dali/internal/input.h

index e869ebe..ad7f17a 100644 (file)
@@ -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])
index 23d675d..8fbc826 100644 (file)
@@ -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.
index 24a4ebe..e3ec64b 100644 (file)
@@ -25,7 +25,6 @@
 #include <dali/integration-api/debug.h>
 #include <pepper-input-backend.h>
 #include <Ecore_Input.h>
-#include <xkbcommon/xkbcommon.h>
 
 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 )
index ae6ab8d..9a92c9f 100644 (file)
@@ -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<Ecore_Event_Handler*> mEcoreEventHandler;
 };
index 32e384a..5f1303a 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/object/base-handle.h>
 #include <pepper.h>
+#include <pepper-xkb.h>
 
 namespace Dali
 {