From 6bd4a21bc4de83c23d0cfd51b2d2a5f403859405 Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Tue, 20 Jun 2023 09:27:32 +0900 Subject: [PATCH] Revert "Add DeviceInfo event" This reverts commit 2b85d49b4e74a5c8f7cba3e6966aaea92a5a343c. Change-Id: I811f890ae12efb2a5402e7253643d824f2e3b52e --- .../src/dali-adaptor/utc-Dali-Window.cpp | 15 ----- .../adaptor-framework/device-info-event.h | 77 ---------------------- dali/devel-api/adaptor-framework/window-devel.cpp | 5 -- dali/devel-api/adaptor-framework/window-devel.h | 15 ----- dali/devel-api/file.list | 1 - dali/internal/window-system/common/window-base.cpp | 8 +-- dali/internal/window-system/common/window-base.h | 8 --- dali/internal/window-system/common/window-impl.cpp | 13 +--- dali/internal/window-system/common/window-impl.h | 27 ++------ .../ecore-wl2/window-base-ecore-wl2.cpp | 59 ----------------- .../ecore-wl2/window-base-ecore-wl2.h | 5 -- 11 files changed, 8 insertions(+), 225 deletions(-) delete mode 100644 dali/devel-api/adaptor-framework/device-info-event.h diff --git a/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp b/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp index bc625e9..f224d97 100644 --- a/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp +++ b/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp @@ -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 index 1d956d2..0000000 --- a/dali/devel-api/adaptor-framework/device-info-event.h +++ /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 -#include - -// INTERNAL INCLUDES -#include - -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 diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 691bc35..897ea9f 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -294,11 +294,6 @@ MouseInOutEventSignalType& MouseInOutEventSignal(Window window) return GetImplementation(window).MouseInOutEventSignal(); } -DeviceInfoEventSignalType& DeviceInfoEventSignal(Window window) -{ - return GetImplementation(window).DeviceInfoEventSignal(); -} - } // namespace DevelWindow } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 0096167..9cfaa8f 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -22,7 +22,6 @@ #include // INTERNAL INCLUDES -#include #include #include #include @@ -53,7 +52,6 @@ typedef Signal typedef Signal MouseInOutEventSignalType; ///< MouseInOutEvent signal type typedef Signal MoveCompletedSignalType; ///< Window Moved by Server signal type typedef Signal ResizeCompletedSignalType; ///< Window Resized by Server signal type -typedef Signal 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 diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 4dbcc9c..1b9c636 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -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 diff --git a/dali/internal/window-system/common/window-base.cpp b/dali/internal/window-system/common/window-base.cpp index 9aa3177..a0a89dc 100644 --- a/dali/internal/window-system/common/window-base.cpp +++ b/dali/internal/window-system/common/window-base.cpp @@ -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 diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 48ed76e..699461a 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -27,7 +27,6 @@ #include // INTERNAL INCLUDES -#include #include #include #include @@ -80,7 +79,6 @@ public: typedef Signal MouseInOutEventSignalType; typedef Signal MoveCompletedSignalType; typedef Signal ResizeCompletedSignalType; - typedef Signal DeviceInfoEventSignalType; // Input events typedef Signal 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 diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index aa82ad2..dd75c39 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -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); diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index 6d3fc3b..da9336d 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -52,7 +52,6 @@ class Window; using WindowPtr = IntrusivePtr; using OrientationPtr = IntrusivePtr; using MouseInOutEventPtr = IntrusivePtr; -using DeviceInfoEventPtr = IntrusivePtr; using EventHandlerPtr = IntrusivePtr; /** @@ -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 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& 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 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. }; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 6d5cd11..1e64164 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -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(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(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(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(event); - - if(deviceInfo->window == static_cast(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) diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index e368c16..b70afbc 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -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); -- 2.7.4