From: Daekwang Ryu Date: Thu, 6 Apr 2023 05:16:21 +0000 (+0900) Subject: Move getWindowRoot() implementation to DeviceImpl X-Git-Tag: accepted/tizen/unified/20230427.155836~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc03650a4f3f93857e08e535b73b73f0fd5f1613;p=platform%2Fcore%2Fuifw%2Faurum.git Move getWindowRoot() implementation to DeviceImpl The getTizenWindowInfo function depends on Tizen platform. It has been moved to TizenDeviceImpl. This change helps in running and implementing UTC. Change-Id: Icfe725a21e9178244ae7b9698c1be13fa60efb95 --- diff --git a/libaurum/inc/Impl/MockDeviceImpl.h b/libaurum/inc/Impl/MockDeviceImpl.h index 4631912..e387a8e 100644 --- a/libaurum/inc/Impl/MockDeviceImpl.h +++ b/libaurum/inc/Impl/MockDeviceImpl.h @@ -19,6 +19,7 @@ #define _MOCK_DEVICE_IMPL_H_ #include "config.h" +#include "AccessibleNode.h" #include "IDevice.h" #include @@ -173,6 +174,11 @@ public: */ const Size2D getScreenSize() override; + /** + * @copydoc IDevice::getWindowRoot() + */ + std::vector> getWindowRoot() const override; + protected: /** * @brief TBD diff --git a/libaurum/inc/Impl/TizenDeviceImpl.h b/libaurum/inc/Impl/TizenDeviceImpl.h index 774841c..e73a564 100644 --- a/libaurum/inc/Impl/TizenDeviceImpl.h +++ b/libaurum/inc/Impl/TizenDeviceImpl.h @@ -20,6 +20,7 @@ #include "config.h" #include "IDevice.h" +#include "TizenWindow.h" #include #include @@ -135,6 +136,11 @@ public: */ const Size2D getScreenSize() override; + /** + * @copydoc IDevice::getWindowRoot() + */ + std::vector> getWindowRoot() const override; + protected: /** * @brief Press and release given key during duration time. @@ -186,6 +192,15 @@ private: */ int stopTimer(void); + /** + * @brief Gets currently window information from window system. + * + * @return TizenWindow ptr vector + * + * @since_tizen 7.0 + */ + std::vector> getTizenWindowInfo() const; + private: efl_util_inputgen_h mFakeTouchHandle; efl_util_inputgen_h mFakeKeyboardHandle; @@ -209,6 +224,7 @@ private: */ Size2D mScreenSize; static std::mutex CaptureMutex; + static std::vector> mTizenWindows; }; } diff --git a/libaurum/inc/Impl/TizenWindow.h b/libaurum/inc/Impl/TizenWindow.h new file mode 100644 index 0000000..7c69566 --- /dev/null +++ b/libaurum/inc/Impl/TizenWindow.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + * + */ + +#ifndef _TIZEN_WINDOW_H_ +#define _TIZEN_WINDOW_H_ + +#include + +namespace Aurum { + +class TizenWindow : public std::enable_shared_from_this { +public: + TizenWindow(int pid, Rect geometry, bool transformed, bool alpha, int opaque, int visibility, bool focused, bool mapped, int layer, std::string name); + ~TizenWindow(); + + int getPid(); + Rect getWindowGeometry(); + bool isTransformed(); + bool isAlpha(); + int getOpaque(); + int getVisibility(); + bool isFocused(); + bool isMapped(); + std::string getName(); +private: + int mPid; // window's PID + Rect mWindowGeometry; // window's geometry + bool mIsTransformed; // true : transformed window + bool mIsAlpha; // true : alpha + int mOpaque; // true : opaque state set window + int mVisibility; // 0 : visible + // 1 : partial visible + // 2 : hidden + // -1 : unknown + bool mIsFocused; // true : has focus + bool mIsMapped; // true : mapped + int mLayer; // 200 : normal layer + // 250 : above layer + // 650 ~ 800 : notification layer + std::string mName; // window name +}; + +} + +#endif diff --git a/libaurum/inc/Interface/IDevice.h b/libaurum/inc/Interface/IDevice.h index e501b7e..5dc6314 100644 --- a/libaurum/inc/Interface/IDevice.h +++ b/libaurum/inc/Interface/IDevice.h @@ -20,8 +20,10 @@ #include "config.h" #include "Size2D.h" +#include "AccessibleNode.h" #include + namespace Aurum { /** @@ -290,6 +292,15 @@ public: * @since_tizen 6.5 */ virtual const Size2D getScreenSize() = 0; + + /** + * @brief Gets currently enabled applications root window. + * + * @return AccessibleNode ptr vector + * + * @since_tizen 7.5 + */ + virtual std::vector> getWindowRoot() const = 0; }; } diff --git a/libaurum/inc/TizenWindow.h b/libaurum/inc/TizenWindow.h deleted file mode 100644 index 7c69566..0000000 --- a/libaurum/inc/TizenWindow.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - * - */ - -#ifndef _TIZEN_WINDOW_H_ -#define _TIZEN_WINDOW_H_ - -#include - -namespace Aurum { - -class TizenWindow : public std::enable_shared_from_this { -public: - TizenWindow(int pid, Rect geometry, bool transformed, bool alpha, int opaque, int visibility, bool focused, bool mapped, int layer, std::string name); - ~TizenWindow(); - - int getPid(); - Rect getWindowGeometry(); - bool isTransformed(); - bool isAlpha(); - int getOpaque(); - int getVisibility(); - bool isFocused(); - bool isMapped(); - std::string getName(); -private: - int mPid; // window's PID - Rect mWindowGeometry; // window's geometry - bool mIsTransformed; // true : transformed window - bool mIsAlpha; // true : alpha - int mOpaque; // true : opaque state set window - int mVisibility; // 0 : visible - // 1 : partial visible - // 2 : hidden - // -1 : unknown - bool mIsFocused; // true : has focus - bool mIsMapped; // true : mapped - int mLayer; // 200 : normal layer - // 250 : above layer - // 650 ~ 800 : notification layer - std::string mName; // window name -}; - -} - -#endif diff --git a/libaurum/inc/UiDevice.h b/libaurum/inc/UiDevice.h index 1c6a49b..f1369df 100644 --- a/libaurum/inc/UiDevice.h +++ b/libaurum/inc/UiDevice.h @@ -22,7 +22,6 @@ #include "UiObject.h" #include "UiSelector.h" -#include "TizenWindow.h" #include "IDevice.h" #include "ISearchable.h" @@ -403,16 +402,7 @@ public: * * @since_tizen 6.5 */ - std::vector> getWindowRoot() const; - - /** - * @brief Gets currently window information from window system. - * - * @return TizenWindow ptr vector - * - * @since_tizen 7.0 - */ - std::vector> getTizenWindowInfo() const; + std::vector> getWindowRoot() const override; #ifdef MQTT_ENABLED /** @@ -501,7 +491,6 @@ public: private: IDevice *mDeviceImpl; const Waiter *mWaiter; - static std::vector> mTizenWindows; bool mIsWithSA; #ifdef MQTT_ENABLED static std::shared_ptr mSAWatcher; diff --git a/libaurum/meson.build b/libaurum/meson.build index 58e8e18..7e31175 100644 --- a/libaurum/meson.build +++ b/libaurum/meson.build @@ -4,7 +4,6 @@ libaurum_install_inc = [ './inc/UiDevice.h', './inc/UiObject.h', './inc/UiSelector.h', - './inc/TizenWindow.h', './inc/Sel.h', './inc/Until.h', './inc/Waiter.h', diff --git a/libaurum/src/Impl/MockDeviceImpl.cc b/libaurum/src/Impl/MockDeviceImpl.cc index 3d3ea8f..1f4c8dd 100644 --- a/libaurum/src/Impl/MockDeviceImpl.cc +++ b/libaurum/src/Impl/MockDeviceImpl.cc @@ -16,7 +16,7 @@ */ #include "Aurum.h" - +#include "AccessibleWatcher.h" #include "MockDeviceImpl.h" #include @@ -265,3 +265,23 @@ long long MockDeviceImpl::timeStamp(void) long long rtn = (t.tv_sec + t.tv_nsec/NANO_SEC) * MICRO_SEC; return rtn; } + +std::vector> MockDeviceImpl::getWindowRoot() const +{ + std::vector> ret{}; + + auto apps = AccessibleWatcher::getInstance()->getApplications(); + + for (auto app : apps) + { + auto wins = app->getWindows(); + std::transform(wins.begin(), wins.end(), std::back_inserter(ret), + [&](std::shared_ptr window) { + return window->getAccessibleNode(); + } + ); + } + + return ret; +} + diff --git a/libaurum/src/Impl/TizenDeviceImpl.cc b/libaurum/src/Impl/TizenDeviceImpl.cc index 273bd9c..84ac438 100644 --- a/libaurum/src/Impl/TizenDeviceImpl.cc +++ b/libaurum/src/Impl/TizenDeviceImpl.cc @@ -31,6 +31,7 @@ #include #include #include +#include using namespace Aurum; using namespace AurumInternal; @@ -38,8 +39,14 @@ using namespace AurumInternal; #define NANO_SEC 1000000000.0 #define MICRO_SEC 1000000 +#define WM_BUS_NAME "org.enlightenment.wm" +#define WM_OBJECT_PATH "/org/enlightenment/wm" +#define WM_INTERFACE_NAME "org.enlightenment.wm.proc" +#define WM_METHOD_NAME_INFO "GetVisibleWinInfo_v2" std::mutex TizenDeviceImpl::CaptureMutex = std::mutex{}; +std::vector> TizenDeviceImpl::mTizenWindows; +static GDBusConnection *system_conn; TizenDeviceImpl::TizenDeviceImpl() : mFakeTouchHandle{0}, mFakeKeyboardHandle{0}, mFakeWheelHandle{0}, tStart{}, isTimerStarted{false}, mTouchSeq{} @@ -422,3 +429,145 @@ bool TizenDeviceImpl::releaseTouchSeqNumber(int seq) } return false; } + +std::vector> TizenDeviceImpl::getWindowRoot() const +{ + LOGI("Request window info"); + getTizenWindowInfo(); + + std::vector> ret{}; + std::unordered_map> pidToAppNode{}; + + auto apps = AccessibleWatcher::getInstance()->getApplications(); + for (auto app : apps) + { + app->getAccessibleNode()->updateName(); + app->getAccessibleNode()->updatePid(); + LOGI("App(%s) Pid(%d)", app->getPackageName().c_str(), app->getAccessibleNode()->getPid()); + pidToAppNode[app->getAccessibleNode()->getPid()] = app; + } + + for (auto tWin : mTizenWindows) + { + LOGI("Visible win (%d) (%d %d %d %d) (%s)", tWin->getPid(), tWin->getWindowGeometry().mTopLeft.x, tWin->getWindowGeometry().mTopLeft.y, tWin->getWindowGeometry().width(), + tWin->getWindowGeometry().height(), tWin->getName().c_str()); + + if (pidToAppNode.count(tWin->getPid()) == 0) continue; + + LOGI("Active App : (%s) (%d)", tWin->getName().c_str(), tWin->getPid()); + auto wins = pidToAppNode[tWin->getPid()]->getWindows(); + std::transform(wins.begin(), wins.end(), std::back_inserter(ret), + [&](std::shared_ptr window) { + window->getAccessibleNode()->updateApplication(); + LOGI("Target window add pkg: (%s), name (%s)", window->getAccessibleNode()->getPkg().c_str(), window->getTitle().c_str()); + return window->getAccessibleNode(); + } + ); + + pidToAppNode.erase(tWin->getPid()); + } + + return ret; +} + +std::vector> TizenDeviceImpl::getTizenWindowInfo() const +{ + GError *err = NULL; + GDBusMessage *msg; + GDBusMessage *reply; + GDBusConnection *conn; + GVariant *body; + GVariantIter *iter = NULL; + int idx = 0; + int pid; + int x; + int y; + int w; + int h; + gboolean transformed; + gboolean alpha; + int opaque; + int visibility; + gboolean focused; + gboolean mapped; + int layer; + char *name; + + mTizenWindows.clear(); + + if (system_conn == NULL) { + conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err); + if (conn == NULL) { + LOGE("g_bus_get_sync() is failed. %s", err->message); + g_error_free(err); + return mTizenWindows; + } + system_conn = conn; + } + + msg = g_dbus_message_new_method_call(WM_BUS_NAME, + WM_OBJECT_PATH, + WM_INTERFACE_NAME, + WM_METHOD_NAME_INFO); + if (msg == NULL) { + LOGE("g_dbus_message_new_method_call() is failed."); + return mTizenWindows; + } + + reply = g_dbus_connection_send_message_with_reply_sync(system_conn, msg, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, -1, NULL, NULL, &err); + + if (!reply) { + if (err != NULL) { + LOGE("Failed to get info [%s]", err->message); + g_error_free(err); + } + goto out; + } + + body = g_dbus_message_get_body(reply); + if (!body) { + LOGE("Failed to get body"); + goto out; + } + + g_variant_get(body, "(a(iiiiibbiibbis))", &iter); + if (!iter) { + LOGE("Failed to get iter"); + goto out; + } + + LOGI("%-3s | %-6s | %-4s | %-4s | %-4s | %-4s | %-5s | %-5s | %-6s | %-3s | %-7s | %-6s | %-5s | %-20s", "No" ,"PID", "X", "Y", "W", "H", "Trans", "Alpha", "Opaque", "Vis", "Focused", "Mapped", "Layer", "Name"); + while (g_variant_iter_loop(iter, "(iiiiibbiibbis)", + &pid, + &x, + &y, + &w, + &h, + &transformed, + &alpha, + &opaque, + &visibility, + &focused, + &mapped, + &layer, + &name)) { + LOGI("%-3d | %-6d | %-4d | %-4d | %-4d | %-4d | %-5d | %-5d | %-6d | %-3d | %-7d | %-6d | %-5d | %-20s", idx++, pid, x,y,w,h, transformed, alpha, opaque, visibility, focused, mapped, layer, name); + if (visibility == 0 && pid > 0) + { + Rect geometry = {x, y, w, h}; + std::string winName(name); + mTizenWindows.push_back(std::make_shared(pid, geometry, transformed, alpha, opaque, visibility, focused, mapped, layer, winName)); + } + } + +out: + if (iter) + g_variant_iter_free(iter); + if (msg) + g_object_unref(msg); + if (reply) + g_object_unref(reply); + + return mTizenWindows; +} diff --git a/libaurum/src/Impl/TizenWindow.cc b/libaurum/src/Impl/TizenWindow.cc new file mode 100644 index 0000000..12f226e --- /dev/null +++ b/libaurum/src/Impl/TizenWindow.cc @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + * + */ + +#include "Aurum.h" +#include "TizenWindow.h" + +using namespace Aurum; + +TizenWindow::TizenWindow(int pid, Rect geometry, bool transformed, bool alpha, int opaque, int visibility, bool focused, bool mapped, int layer, std::string name) + : mPid(pid), mWindowGeometry(geometry), mIsTransformed(transformed), mIsAlpha(alpha), mOpaque(opaque), mVisibility(visibility), mIsFocused(focused), mIsMapped(mapped), mLayer(layer), mName(name) +{ + +} + +TizenWindow::~TizenWindow() +{ + +} + +int TizenWindow::getPid() +{ + return mPid; +} + +Rect TizenWindow::getWindowGeometry() +{ + return mWindowGeometry; +} + +bool TizenWindow::isTransformed() +{ + return mIsTransformed; +} + +bool TizenWindow::isAlpha() +{ + return mIsAlpha; +} + +int TizenWindow::getOpaque() +{ + return mOpaque; +} + +int TizenWindow::getVisibility() +{ + return mVisibility; +} + +bool TizenWindow::isFocused() +{ + return mIsFocused; +} + +bool TizenWindow::isMapped() +{ + return mIsMapped; +} + +std::string TizenWindow::getName() +{ + return mName; +} \ No newline at end of file diff --git a/libaurum/src/Impl/meson.build b/libaurum/src/Impl/meson.build index 04bdacc..6feed58 100644 --- a/libaurum/src/Impl/meson.build +++ b/libaurum/src/Impl/meson.build @@ -1,6 +1,7 @@ if get_option('tizen') == true libaurum_src += [ files('TizenDeviceImpl.cc'), + files('TizenWindow.cc'), ] endif diff --git a/libaurum/src/TizenWindow.cc b/libaurum/src/TizenWindow.cc deleted file mode 100644 index 12f226e..0000000 --- a/libaurum/src/TizenWindow.cc +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - * - */ - -#include "Aurum.h" -#include "TizenWindow.h" - -using namespace Aurum; - -TizenWindow::TizenWindow(int pid, Rect geometry, bool transformed, bool alpha, int opaque, int visibility, bool focused, bool mapped, int layer, std::string name) - : mPid(pid), mWindowGeometry(geometry), mIsTransformed(transformed), mIsAlpha(alpha), mOpaque(opaque), mVisibility(visibility), mIsFocused(focused), mIsMapped(mapped), mLayer(layer), mName(name) -{ - -} - -TizenWindow::~TizenWindow() -{ - -} - -int TizenWindow::getPid() -{ - return mPid; -} - -Rect TizenWindow::getWindowGeometry() -{ - return mWindowGeometry; -} - -bool TizenWindow::isTransformed() -{ - return mIsTransformed; -} - -bool TizenWindow::isAlpha() -{ - return mIsAlpha; -} - -int TizenWindow::getOpaque() -{ - return mOpaque; -} - -int TizenWindow::getVisibility() -{ - return mVisibility; -} - -bool TizenWindow::isFocused() -{ - return mIsFocused; -} - -bool TizenWindow::isMapped() -{ - return mIsMapped; -} - -std::string TizenWindow::getName() -{ - return mName; -} \ No newline at end of file diff --git a/libaurum/src/UiDevice.cc b/libaurum/src/UiDevice.cc index 7438bbf..a8f40e7 100644 --- a/libaurum/src/UiDevice.cc +++ b/libaurum/src/UiDevice.cc @@ -29,21 +29,13 @@ #include #include #include -#include #include #include using namespace Aurum; using namespace AurumInternal; -#define WM_BUS_NAME "org.enlightenment.wm" -#define WM_OBJECT_PATH "/org/enlightenment/wm" -#define WM_INTERFACE_NAME "org.enlightenment.wm.proc" -#define WM_METHOD_NAME_INFO "GetVisibleWinInfo_v2" - -std::vector> UiDevice::mTizenWindows; std::once_flag UiDevice::mOnceFlag; -static GDBusConnection *system_conn; #ifdef MQTT_ENABLED std::shared_ptr UiDevice::mSAWatcher; @@ -86,146 +78,9 @@ std::shared_ptr UiDevice::getInstance(IDevice *deviceImpl) return device; } -std::vector> UiDevice::getTizenWindowInfo() const -{ - GError *err = NULL; - GDBusMessage *msg; - GDBusMessage *reply; - GDBusConnection *conn; - GVariant *body; - GVariantIter *iter = NULL; - int idx = 0; - int pid; - int x; - int y; - int w; - int h; - gboolean transformed; - gboolean alpha; - int opaque; - int visibility; - gboolean focused; - gboolean mapped; - int layer; - char *name; - - mTizenWindows.clear(); - - if (system_conn == NULL) { - conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err); - if (conn == NULL) { - LOGE("g_bus_get_sync() is failed. %s", err->message); - g_error_free(err); - return mTizenWindows; - } - system_conn = conn; - } - - msg = g_dbus_message_new_method_call(WM_BUS_NAME, - WM_OBJECT_PATH, - WM_INTERFACE_NAME, - WM_METHOD_NAME_INFO); - if (msg == NULL) { - LOGE("g_dbus_message_new_method_call() is failed."); - return mTizenWindows; - } - - reply = g_dbus_connection_send_message_with_reply_sync(system_conn, msg, - G_DBUS_SEND_MESSAGE_FLAGS_NONE, -1, NULL, NULL, &err); - - if (!reply) { - if (err != NULL) { - LOGE("Failed to get info [%s]", err->message); - g_error_free(err); - } - goto out; - } - - body = g_dbus_message_get_body(reply); - if (!body) { - LOGE("Failed to get body"); - goto out; - } - - g_variant_get(body, "(a(iiiiibbiibbis))", &iter); - if (!iter) { - LOGE("Failed to get iter"); - goto out; - } - - LOGI("%-3s | %-6s | %-4s | %-4s | %-4s | %-4s | %-5s | %-5s | %-6s | %-3s | %-7s | %-6s | %-5s | %-20s", "No" ,"PID", "X", "Y", "W", "H", "Trans", "Alpha", "Opaque", "Vis", "Focused", "Mapped", "Layer", "Name"); - while (g_variant_iter_loop(iter, "(iiiiibbiibbis)", - &pid, - &x, - &y, - &w, - &h, - &transformed, - &alpha, - &opaque, - &visibility, - &focused, - &mapped, - &layer, - &name)) { - LOGI("%-3d | %-6d | %-4d | %-4d | %-4d | %-4d | %-5d | %-5d | %-6d | %-3d | %-7d | %-6d | %-5d | %-20s", idx++, pid, x,y,w,h, transformed, alpha, opaque, visibility, focused, mapped, layer, name); - if (visibility == 0 && pid > 0) - { - Rect geometry = {x, y, w, h}; - std::string winName(name); - mTizenWindows.push_back(std::make_shared(pid, geometry, transformed, alpha, opaque, visibility, focused, mapped, layer, winName)); - } - } - -out: - if (iter) - g_variant_iter_free(iter); - if (msg) - g_object_unref(msg); - if (reply) - g_object_unref(reply); - - return mTizenWindows; -} - std::vector> UiDevice::getWindowRoot() const { - LOGI("Request window info"); - getTizenWindowInfo(); - - std::vector> ret{}; - std::unordered_map> pidToAppNode{}; - - auto apps = AccessibleWatcher::getInstance()->getApplications(); - for (auto app : apps) - { - app->getAccessibleNode()->updateName(); - app->getAccessibleNode()->updatePid(); - LOGI("App(%s) Pid(%d)", app->getPackageName().c_str(), app->getAccessibleNode()->getPid()); - pidToAppNode[app->getAccessibleNode()->getPid()] = app; - } - - for (auto tWin : mTizenWindows) - { - LOGI("Visible win (%d) (%d %d %d %d) (%s)", tWin->getPid(), tWin->getWindowGeometry().mTopLeft.x, tWin->getWindowGeometry().mTopLeft.y, tWin->getWindowGeometry().width(), - tWin->getWindowGeometry().height(), tWin->getName().c_str()); - - if (pidToAppNode.count(tWin->getPid()) == 0) continue; - - LOGI("Active App : (%s) (%d)", tWin->getName().c_str(), tWin->getPid()); - auto wins = pidToAppNode[tWin->getPid()]->getWindows(); - std::transform(wins.begin(), wins.end(), std::back_inserter(ret), - [&](std::shared_ptr window) { - window->getAccessibleNode()->updateApplication(); - LOGI("Target window add pkg: (%s), name (%s)", window->getAccessibleNode()->getPkg().c_str(), window->getTitle().c_str()); - return window->getAccessibleNode(); - } - ); - - pidToAppNode.erase(tWin->getPid()); - } - - return ret; + return mDeviceImpl->getWindowRoot(); } bool UiDevice::hasObject(const std::shared_ptr selector) const diff --git a/libaurum/src/meson.build b/libaurum/src/meson.build index 7e6a215..caae22d 100644 --- a/libaurum/src/meson.build +++ b/libaurum/src/meson.build @@ -11,7 +11,6 @@ libaurum_src += [ files('A11yEvent.cc'), files('A11yEventHandler.cc'), files('AurumXML.cc'), - files('TizenWindow.cc'), ] if get_option('mqtt_enabled') == true