Revert "Add DeviceInfo event" 64/294464/1
authorjoogab.yun <joogab.yun@samsung.com>
Tue, 20 Jun 2023 00:27:32 +0000 (09:27 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Tue, 20 Jun 2023 00:27:51 +0000 (09:27 +0900)
This reverts commit 2b85d49b4e74a5c8f7cba3e6966aaea92a5a343c.

Change-Id: I811f890ae12efb2a5402e7253643d824f2e3b52e

automated-tests/src/dali-adaptor/utc-Dali-Window.cpp
dali/devel-api/adaptor-framework/device-info-event.h [deleted file]
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/devel-api/file.list
dali/internal/window-system/common/window-base.cpp
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h

index bc625e9..f224d97 100644 (file)
@@ -1637,18 +1637,3 @@ int UtcDaliWindowResizeCompletedSignalNegative(void)
   }
   END_TEST;
 }
-
-int UtcDaliWindowDeviceInfoSignalNegative(void)
-{
-  Dali::Window instance;
-  try
-  {
-    DevelWindow::DeviceInfoEventSignal(instance);
-    DALI_TEST_CHECK(false); // Should not get here
-  }
-  catch(...)
-  {
-    DALI_TEST_CHECK(true); // We expect an assert
-  }
-  END_TEST;
-}
diff --git a/dali/devel-api/adaptor-framework/device-info-event.h b/dali/devel-api/adaptor-framework/device-info-event.h
deleted file mode 100644 (file)
index 1d956d2..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef DALI_WINDOW_DEVEL_DEVICE_INFO_EVENT_H
-#define DALI_WINDOW_DEVEL_DEVICE_INFO_EVENT_H
-
-/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/events/device.h>
-#include <dali/public-api/math/vector2.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
-
-namespace Dali
-{
-namespace DevelWindow
-{
-/**
- * @brief DeviceInfoEvent occurs when a device such as a mouse or keyboard is connected or disconnected.
- *
- * A signal is emitted whenever when a device such as a mouse or keyboard is connected or disconnected.
- */
-struct DALI_ADAPTOR_API DeviceInfoEvent
-{
-  enum class Type
-  {
-    NONE = 0,
-    CONNECTED,
-    DISCONNECTED
-  };
-
-  /**
-   * @brief Constructor which creates a DeviceInfoEvent instance
-   * @param[in] type The type of the event.
-   * @param[in] name The device name.
-   * @param[in] identifier The identifier.
-   * @param[in] seatname The seat name.
-   * @param[in] deviceClass The device class the event originated from.
-   * @param[in] deviceSubclass The device subclass the event originated from.
-   */
-  DeviceInfoEvent(Type type, const std::string& name, const std::string& identifier, const std::string& seatname, const Device::Class::Type deviceClass, const Device::Subclass::Type deviceSubclass)
-  : type(type),
-    name(name),
-    identifier(identifier),
-    seatname(seatname),
-    deviceClass(deviceClass),
-    deviceSubclass(deviceSubclass)
-  {
-  }
-
-  Type                         type;
-  const std::string            name;
-  const std::string            identifier;
-  const std::string            seatname;
-  const Device::Class::Type    deviceClass;
-  const Device::Subclass::Type deviceSubclass;
-};
-
-} // namespace DevelWindow
-
-} // namespace Dali
-
-#endif // DALI_WINDOW_DEVEL_DEVICE_INFO_EVENT_H
index 691bc35..897ea9f 100644 (file)
@@ -294,11 +294,6 @@ MouseInOutEventSignalType& MouseInOutEventSignal(Window window)
   return GetImplementation(window).MouseInOutEventSignal();
 }
 
-DeviceInfoEventSignalType& DeviceInfoEventSignal(Window window)
-{
-  return GetImplementation(window).DeviceInfoEventSignal();
-}
-
 } // namespace DevelWindow
 
 } // namespace Dali
index 0096167..9cfaa8f 100644 (file)
@@ -22,7 +22,6 @@
 #include <memory>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/device-info-event.h>
 #include <dali/devel-api/adaptor-framework/mouse-in-out-event.h>
 #include <dali/public-api/adaptor-framework/window-enumerations.h>
 #include <dali/public-api/adaptor-framework/window.h>
@@ -53,7 +52,6 @@ typedef Signal<void(Window, Dali::WindowOrientation)>
 typedef Signal<void(Window, const Dali::DevelWindow::MouseInOutEvent&)>              MouseInOutEventSignalType;               ///< MouseInOutEvent signal type
 typedef Signal<void(Window, Dali::Window::WindowPosition)>                           MoveCompletedSignalType;                 ///< Window Moved by Server signal type
 typedef Signal<void(Window, Dali::Window::WindowSize)>                               ResizeCompletedSignalType;               ///< Window Resized by Server signal type
-typedef Signal<void(Window, const Dali::DevelWindow::DeviceInfoEvent&)>              DeviceInfoEventSignalType;               ///< DeviceInfoEvent signal type
 
 /**
  * @brief Creates an initialized handle to a new Window.
@@ -612,19 +610,6 @@ DALI_ADAPTOR_API MoveCompletedSignalType& MoveCompletedSignal(Window window);
  */
 DALI_ADAPTOR_API ResizeCompletedSignalType& ResizeCompletedSignal(Window window);
 
-/**
- * @brief This signal is emitted when the device info event is received.
- *
- * A callback of the following type may be connected:
- * @code
- *   void YourCallbackName( Window window, Dali::DeviceInfoEvent event );
- * @endcode
- *
- * @param[in] window The window instance.
- * @return The signal to connect to
- */
-DALI_ADAPTOR_API DeviceInfoEventSignalType& DeviceInfoEventSignal(Window window);
-
 } // namespace DevelWindow
 
 } // namespace Dali
index 4dbcc9c..1b9c636 100755 (executable)
@@ -68,7 +68,6 @@ SET( devel_api_adaptor_framework_header_files
   ${adaptor_devel_api_dir}/adaptor-framework/capture-devel.h
   ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.h
   ${adaptor_devel_api_dir}/adaptor-framework/clipboard.h
-  ${adaptor_devel_api_dir}/adaptor-framework/device-info-event.h
   ${adaptor_devel_api_dir}/adaptor-framework/drag-and-drop.h
   ${adaptor_devel_api_dir}/adaptor-framework/color-controller-plugin.h
   ${adaptor_devel_api_dir}/adaptor-framework/color-controller.h
index 9aa3177..a0a89dc 100644 (file)
@@ -44,8 +44,7 @@ WindowBase::WindowBase()
   mAuxiliaryMessageSignal(),
   mMouseInOutEventSignal(),
   mMoveCompletedSignal(),
-  mResizeCompletedSignal(),
-  mDeviceInfoEventSignal()
+  mResizeCompletedSignal()
 {
 }
 
@@ -158,11 +157,6 @@ WindowBase::ResizeCompletedSignalType& WindowBase::ResizeCompletedSignal()
   return mResizeCompletedSignal;
 }
 
-WindowBase::DeviceInfoEventSignalType& WindowBase::DeviceInfoEventSignal()
-{
-  return mDeviceInfoEventSignal;
-}
-
 } // namespace Adaptor
 
 } // namespace Internal
index 48ed76e..699461a 100644 (file)
@@ -27,7 +27,6 @@
 #include <vector>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/device-info-event.h>
 #include <dali/devel-api/adaptor-framework/mouse-in-out-event.h>
 #include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/internal/graphics/gles/egl-implementation.h>
@@ -80,7 +79,6 @@ public:
   typedef Signal<void(const Dali::DevelWindow::MouseInOutEvent&)>                      MouseInOutEventSignalType;
   typedef Signal<void(Dali::Int32Pair&)>                                               MoveCompletedSignalType;
   typedef Signal<void(Dali::Uint16Pair&)>                                              ResizeCompletedSignalType;
-  typedef Signal<void(const Dali::DevelWindow::DeviceInfoEvent&)>                      DeviceInfoEventSignalType;
 
   // Input events
   typedef Signal<void(Integration::Point&, uint32_t)> TouchEventSignalType;
@@ -579,11 +577,6 @@ public:
    */
   ResizeCompletedSignalType& ResizeCompletedSignal();
 
-  /**
-   * @brief This signal is emitted when a device info event is recevied.
-   */
-  DeviceInfoEventSignalType& DeviceInfoEventSignal();
-
 protected:
   // Undefined
   WindowBase(const WindowBase&) = delete;
@@ -613,7 +606,6 @@ protected:
   MouseInOutEventSignalType               mMouseInOutEventSignal;
   MoveCompletedSignalType                 mMoveCompletedSignal;
   ResizeCompletedSignalType               mResizeCompletedSignal;
-  DeviceInfoEventSignalType               mDeviceInfoEventSignal;
 };
 
 } // namespace Adaptor
index aa82ad2..dd75c39 100644 (file)
@@ -94,7 +94,6 @@ Window::Window()
   mMouseInOutEventSignal(),
   mMoveCompletedSignal(),
   mResizeCompletedSignal(),
-  mDeviceInfoEventSignal(),
   mLastKeyEvent(),
   mLastTouchEvent(),
   mIsTransparent(false),
@@ -165,7 +164,6 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std
   mWindowBase->MouseInOutEventSignal().Connect(this, &Window::OnMouseInOutEvent);
   mWindowBase->MoveCompletedSignal().Connect(this, &Window::OnMoveCompleted);
   mWindowBase->ResizeCompletedSignal().Connect(this, &Window::OnResizeCompleted);
-  mWindowBase->DeviceInfoEventSignal().Connect(this, &Window::OnDeviceInfoEvent);
 
   mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
   mWindowSurface->RotationFinishedSignal().Connect(this, &Window::OnRotationFinished);
@@ -192,8 +190,8 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std
   bool isSetWithScreenSize = false;
   if(mWindowWidth <= 0 || mWindowHeight <= 0)
   {
-    mWindowWidth        = screenWidth;
-    mWindowHeight       = screenHeight;
+    mWindowWidth         = screenWidth;
+    mWindowHeight        = screenHeight;
     isSetWithScreenSize = true;
     DALI_LOG_RELEASE_INFO("Window size is set with screen size(%d x %d)\n", mWindowWidth, mWindowHeight);
   }
@@ -1159,13 +1157,6 @@ void Window::OnMoveCompleted(Dali::Window::WindowPosition& position)
   mMoveCompletedSignal.Emit(handle, position);
 }
 
-void Window::OnDeviceInfoEvent(const Dali::DevelWindow::DeviceInfoEvent& deviceInfoEvent)
-{
-  Dali::Window handle(this);
-
-  mDeviceInfoEventSignal.Emit(handle, deviceInfoEvent);
-}
-
 void Window::OnResizeCompleted(Dali::Window::WindowSize& size)
 {
   Dali::Window handle(this);
index 6d3fc3b..da9336d 100644 (file)
@@ -52,7 +52,6 @@ class Window;
 using WindowPtr          = IntrusivePtr<Window>;
 using OrientationPtr     = IntrusivePtr<Orientation>;
 using MouseInOutEventPtr = IntrusivePtr<Dali::DevelWindow::MouseInOutEvent>;
-using DeviceInfoEventPtr = IntrusivePtr<Dali::DevelWindow::DeviceInfoEvent>;
 using EventHandlerPtr    = IntrusivePtr<EventHandler>;
 
 /**
@@ -73,7 +72,6 @@ public:
   typedef Dali::DevelWindow::MouseInOutEventSignalType               MouseInOutEventSignalType;
   typedef Dali::DevelWindow::MoveCompletedSignalType                 MoveCompletedSignalType;
   typedef Dali::DevelWindow::ResizeCompletedSignalType               ResizeCompletedSignalType;
-  typedef Dali::DevelWindow::DeviceInfoEventSignalType               DeviceInfoEventSignalType;
   typedef Signal<void()>                                             SignalType;
 
   /**
@@ -627,12 +625,6 @@ private:
   void OnResizeCompleted(Dali::Window::WindowSize& size);
 
   /**
-   * @brief Called when a device such as a mouse or keyboard is connected or disconnected.
-   * @param[in] deviceInfoEvent the device info event
-   */
-  void OnDeviceInfoEvent(const Dali::DevelWindow::DeviceInfoEvent& deviceInfoEvent);
-
-  /**
    * @brief Set available orientation to window base.
    */
   void SetAvailableAnlges(const std::vector<int>& angles);
@@ -820,14 +812,6 @@ public: // Signals
     return mResizeCompletedSignal;
   }
 
-  /**
-   * @copydoc Dali::DevelWindow::DeviceInfoEventSignal()
-   */
-  DeviceInfoEventSignalType& DeviceInfoEventSignal()
-  {
-    return mDeviceInfoEventSignal;
-  }
-
 private:
   WindowRenderSurface* mWindowSurface; ///< The window rendering surface
   WindowBase*          mWindowBase;
@@ -839,10 +823,10 @@ private:
   std::vector<int> mAvailableAngles;
   int              mPreferredAngle;
 
-  int mRotationAngle;  ///< The angle of the rotation
-  int mWindowWidth;    ///< The width of the window
-  int mWindowHeight;   ///< The height of the window
-  int mNativeWindowId; ///< The Native Window Id
+  int mRotationAngle;               ///< The angle of the rotation
+  int mWindowWidth;                 ///< The width of the window
+  int mWindowHeight;                ///< The height of the window
+  int mNativeWindowId;              ///< The Native Window Id
 
   EventHandlerPtr mEventHandler;    ///< The window events handler
   OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
@@ -861,7 +845,6 @@ private:
   MouseInOutEventSignalType               mMouseInOutEventSignal;
   MoveCompletedSignalType                 mMoveCompletedSignal;
   ResizeCompletedSignalType               mResizeCompletedSignal;
-  DeviceInfoEventSignalType               mDeviceInfoEventSignal;
 
   Dali::KeyEvent   mLastKeyEvent;
   Dali::TouchEvent mLastTouchEvent;
@@ -873,7 +856,7 @@ private:
   bool mOpaqueState : 1;
   bool mWindowRotationAcknowledgement : 1;
   bool mFocused : 1;
-  bool mIsWindowRotating : 1;      ///< The window rotating flag.
+  bool mIsWindowRotating : 1;     ///< The window rotating flag.
   bool mIsEnabledUserGeometry : 1; ///< The user geometry enable flag.
 };
 
index 6d5cd11..1e64164 100644 (file)
@@ -739,35 +739,6 @@ static Eina_Bool EcoreEventWindowResizeCompleted(void* data, int type, void* eve
   return ECORE_CALLBACK_RENEW;
 }
 
-/////////////////////////////////////////////////////////////////////////////////////////////////
-// Window Device Info Callbacks
-/////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Called when a device is added.
- */
-static Eina_Bool EcoreEventDeviceAdd(void* data, int type, void* event)
-{
-  WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
-  if(windowBase)
-  {
-    windowBase->OnDeviceInfo(data, type, event, Dali::DevelWindow::DeviceInfoEvent::Type::CONNECTED);
-  }
-  return ECORE_CALLBACK_PASS_ON;
-}
-
-/**
- * Called when a device is removed
- */
-static Eina_Bool EcoreEventDeviceDel(void* data, int type, void* event)
-{
-  WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
-  if(windowBase)
-  {
-    windowBase->OnDeviceInfo(data, type, event, Dali::DevelWindow::DeviceInfoEvent::Type::DISCONNECTED);
-  }
-  return ECORE_CALLBACK_PASS_ON;
-}
-
 static void RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
 {
   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
@@ -1018,10 +989,6 @@ void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool
   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_MOVE_DONE, EcoreEventWindowMoveCompleted, this));
   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_RESIZE_DONE, EcoreEventWindowResizeCompleted, this));
 
-  // Register Device Info
-  mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_DEVICE_ADD, EcoreEventDeviceAdd, this));
-  mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_DEVICE_DEL, EcoreEventDeviceDel, this));
-
   Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
   mDisplay                   = ecore_wl2_display_get(display);
 
@@ -1637,32 +1604,6 @@ void WindowBaseEcoreWl2::OnResizeCompleted(void* event)
   }
 }
 
-void WindowBaseEcoreWl2::OnDeviceInfo(void* data, int type, void* event, Dali::DevelWindow::DeviceInfoEvent::Type action)
-{
-  Ecore_Event_Device_Info* deviceInfo = static_cast<Ecore_Event_Device_Info*>(event);
-
-  if(deviceInfo->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
-  {
-    DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_DEVICE_INFO");
-
-    DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnDeviceInfo: name: %s, identifier: %s, seatname: %s\n", deviceInfo->name, deviceInfo->identifier, deviceInfo->seatname);
-
-    std::string name(deviceInfo->name);
-    std::string identifier(deviceInfo->identifier);
-    std::string seatname(deviceInfo->seatname);
-
-    Device::Class::Type    deviceClass;
-    Device::Subclass::Type deviceSubclass;
-
-    GetDeviceClass(deviceInfo->clas, deviceClass);
-    GetDeviceSubclass(deviceInfo->subclas, deviceSubclass);
-
-    Dali::DevelWindow::DeviceInfoEvent deviceInfoEvent(action, name, identifier, seatname, deviceClass, deviceSubclass);
-
-    mDeviceInfoEventSignal.Emit(deviceInfoEvent);
-  }
-}
-
 void WindowBaseEcoreWl2::RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
 {
   if(strcmp(interface, tizen_policy_interface.name) == 0)
index e368c16..b70afbc 100644 (file)
@@ -201,11 +201,6 @@ public:
   void KeymapChanged(void* data, int type, void* event);
 
   /**
-   * @brief Called when a device info changed.
-   */
-  void OnDeviceInfo(void* data, int type, void* event, Dali::DevelWindow::DeviceInfoEvent::Type action);
-
-  /**
    * @brief RegistryGlobalCallback
    */
   void RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version);