[dali_1.2.37] Merge branch 'devel/master' 17/127717/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 28 Apr 2017 10:33:28 +0000 (11:33 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 28 Apr 2017 10:33:28 +0000 (11:33 +0100)
Change-Id: Iceced2bd02bd173f4e061397d0f63e581ee6daf0

LICENSE.BSD-3-Clause [new file with mode: 0644]
adaptors/ecore/wayland/event-handler-ecore-wl.cpp
adaptors/public-api/dali-adaptor-version.cpp
adaptors/x11/ecore-x-event-handler.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h
packaging/dali-adaptor.spec

diff --git a/LICENSE.BSD-3-Clause b/LICENSE.BSD-3-Clause
new file mode 100644 (file)
index 0000000..bd25463
--- /dev/null
@@ -0,0 +1,12 @@
+
+Copyright (c) 2017 Samsung Electronics Co, Ltd. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
index 9989810..0b9b3d2 100644 (file)
@@ -44,6 +44,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/integration-api/events/wheel-event-integ.h>
+#include <dali/devel-api/events/key-event-devel.h>
 
 // INTERNAL INCLUDES
 #include <events/gesture-manager.h>
@@ -180,6 +181,57 @@ void GetDeviceName(  Ecore_Event_Key* keyEvent, std::string& result )
   }
 }
 
+/**
+ * Get the device class from the provided ecore key event
+ */
+void GetDeviceClass(  Ecore_Event_Key* keyEvent, DevelKeyEvent::DeviceClass::Type& deviceClass )
+{
+  Ecore_Device_Class ecoreDeviceClass = ecore_device_class_get( keyEvent->dev );
+
+  switch( ecoreDeviceClass )
+  {
+    case ECORE_DEVICE_CLASS_SEAT:
+    {
+      deviceClass = DevelKeyEvent::DeviceClass::USER;
+      break;
+    }
+    case ECORE_DEVICE_CLASS_KEYBOARD:
+    {
+      deviceClass = DevelKeyEvent::DeviceClass::KEYBOARD;
+      break;
+    }
+    case ECORE_DEVICE_CLASS_MOUSE:
+    {
+      deviceClass = DevelKeyEvent::DeviceClass::MOUSE;
+      break;
+    }
+    case ECORE_DEVICE_CLASS_TOUCH:
+    {
+      deviceClass = DevelKeyEvent::DeviceClass::TOUCH;
+      break;
+    }
+    case ECORE_DEVICE_CLASS_PEN:
+    {
+      deviceClass = DevelKeyEvent::DeviceClass::PEN;
+      break;
+    }
+    case ECORE_DEVICE_CLASS_POINTER:
+    {
+      deviceClass = DevelKeyEvent::DeviceClass::POINTER;
+      break;
+    }
+    case ECORE_DEVICE_CLASS_GAMEPAD:
+    {
+      deviceClass = DevelKeyEvent::DeviceClass::GAMEPAD;
+      break;
+    }
+    default:
+    {
+      deviceClass = DevelKeyEvent::DeviceClass::NONE;
+      break;
+    }
+  }
+}
 
 } // unnamed namespace
 
@@ -454,11 +506,14 @@ struct EventHandler::Impl
         }
 
         std::string deviceName;
+        DevelKeyEvent::DeviceClass::Type deviceClass;
+
         GetDeviceName( keyEvent, deviceName );
+        GetDeviceClass( keyEvent, deviceClass );
 
-        DALI_LOG_INFO( gImfLogging, Debug::Verbose, "EVENT EcoreEventKeyDown - >>EcoreEventKeyDown deviceName(%s)\n", deviceName.c_str() );
+        DALI_LOG_INFO( gImfLogging, Debug::Verbose, "EVENT EcoreEventKeyDown - >>EcoreEventKeyDown deviceName(%s) deviceClass(%d)\n", deviceName.c_str(), deviceClass );
 
-        Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, deviceName );
+        Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, deviceName, deviceClass );
         handler->SendEvent( keyEvent );
       }
     }
@@ -531,9 +586,12 @@ struct EventHandler::Impl
         }
 
         std::string deviceName;
+        DevelKeyEvent::DeviceClass::Type deviceClass;
+
         GetDeviceName( keyEvent, deviceName );
+        GetDeviceClass( keyEvent, deviceClass );
 
-        Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, deviceName );
+        Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, deviceName, deviceClass );
         handler->SendEvent( keyEvent );
       }
     }
index a0c940a..9ee7e82 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
 const unsigned int ADAPTOR_MINOR_VERSION = 2;
-const unsigned int ADAPTOR_MICRO_VERSION = 36;
+const unsigned int ADAPTOR_MICRO_VERSION = 37;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index f16d5c1..2d3ce7f 100644 (file)
@@ -49,6 +49,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/integration-api/events/wheel-event-integ.h>
+#include <dali/devel-api/events/key-event-devel.h>
 
 // INTERNAL INCLUDES
 #include <events/gesture-manager.h>
@@ -85,6 +86,8 @@ namespace
 
 const char * DETENT_DEVICE_NAME = "tizen_detent";
 const std::string DEFAULT_DEVICE_NAME = "";
+const DevelKeyEvent::DeviceClass::Type DEFAULT_DEVICE_CLASS = DevelKeyEvent::DeviceClass::NONE;
+
 // DBUS accessibility
 #define A11Y_BUS "org.a11y.Bus"
 #define A11Y_INTERFACE "org.a11y.Bus"
@@ -707,7 +710,7 @@ struct EventHandler::Impl
           keyString = keyEvent->string;
         }
 
-        Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME );
+        Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS );
         handler->SendEvent( keyEvent );
       }
     }
@@ -774,7 +777,7 @@ struct EventHandler::Impl
           keyString = keyEvent->string;
         }
 
-        Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME );
+        Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS );
 
         handler->SendEvent( keyEvent );
       }
index 03c788c..2b84d39 100644 (file)
@@ -23,6 +23,7 @@
 #include <cstdio>
 #include <iostream>
 #include <cstring>
+#include <string>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
@@ -44,6 +45,7 @@ using namespace Dali;
 #define TOKENPASTE(x,y) x y
 #define TOKENPASTE2(x,y) TOKENPASTE( x, y )
 #define TEST_LOCATION TOKENPASTE2( "Test failed in ", TOKENPASTE2( __FILE__, TOKENPASTE2( ", line ", STRINGIZE(__LINE__) ) ) )
+#define TEST_INNER_LOCATION(x) ( std::string(x) + " (" + STRINGIZE(__LINE__) + ")" ).c_str()
 
 #define TET_UNDEF 2
 #define TET_FAIL 1
index 62fb672..11e5c15 100644 (file)
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.2.36
+Version:    1.2.37
 Release:    1
 Group:      System/Libraries
-License:    Apache-2.0 and BSD-2-Clause and MIT
+License:    Apache-2.0 and BSD-3-Clause and MIT
 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
 Source0:    %{name}-%{version}.tar.gz