Update according to EFL 1.20 59/181959/7
authorLukasz Wlazly <l.wlazly@partner.samsung.com>
Wed, 18 Apr 2018 10:51:25 +0000 (12:51 +0200)
committerLukasz Wlazly <l.wlazly@partner.samsung.com>
Thu, 19 Jul 2018 11:13:40 +0000 (13:13 +0200)
Change-Id: I3d51bc660d9fbf1a1bfdac4942ad8fe5d8d93adf

13 files changed:
CMakeLists.txt
packaging/org.tizen.universal-switch.spec
res/universal-switch.edc
src/Atspi.cpp
src/NavigationInterface.cpp
src/NavigationInterface.hpp
src/SelectActivity.cpp
src/SoundFeedback.cpp
src/UniversalSwitch.cpp
src/Window.cpp
src/Window.hpp
src/batch/BatchRunner.cpp
src/dbusLocators.hpp

index d6f5909..8fd50f8 100644 (file)
@@ -49,6 +49,7 @@ ADD_DEFINITIONS("-DLOCALE_DIR=\"${LOCALE_DIR}\"")
 ADD_DEFINITIONS("-DSOUNDS_DIR=\"${SOUNDS_DIR}\"")
 ADD_DEFINITIONS("-DPROJECT_NAME=\"${PROJECT_NAME}\"")
 ADD_DEFINITIONS("-DUNIVERSAL_SWITCH_EDJ=\"${RES_DIR}/${PROJECT_NAME}.edj\"")
+ADD_DEFINITIONS("-DEFL_BETA_API_SUPPORT=1")
 
 ADD_DEFINITIONS("-DDEBUG_PRINTING_LEVEL=DEBUG_PRINTING_LEVEL_DEBUG")
 
index 3402950..2ffd6e5 100644 (file)
@@ -21,7 +21,8 @@ BuildRequires:  pkgconfig(capi-media-sound-manager)
 BuildRequires:  pkgconfig(capi-telephony)
 BuildRequires:  pkgconfig(capi-system-device)
 BuildRequires:  pkgconfig(ecore)
-BuildRequires:  pkgconfig(elementary)
+BuildRequires:  pkgconfig(ecore-wl2)
+BuildRequires:  pkgconfig(efl)
 BuildRequires:  pkgconfig(efl-extension)
 BuildRequires:  pkgconfig(sqlite3)
 BuildRequires:  pkgconfig(libtzplatform-config)
index 963618e..9bc45ce 100644 (file)
@@ -61,31 +61,31 @@ group { name: "universalSwitchTransparentLayout";
          description { state: "default" 0.0;
             color: 255 255 255 ALPHA;
          }
-         part { name: "elm.swallow.back"; type: SWALLOW;
-            scale: 0;
-            description { state: "default" 0.0;
-               visible: 0;
-            }
-            description { state: "back_visible" 0.0;
-               inherit: "default" 0.0;
-               align: 0.0 0.0;
-               min: 0 50;
-               max: -1 50;
-               visible: 1;
-            }
-         }
-         part { name: "elm.swallow.content"; type: SWALLOW;
-         scale: 0;
-            description { state: "default" 0.0;
-            }
-            description { state: "back_visible" 0.0;
-               inherit: "default" 0.0;
-               rel1.relative: 0.0 1.0;
-               rel1.to_y: "elm.swallow.back";
-               rel2.relative: 1.0 1.0;
-            }
-         }
       }
+     part { name: "elm.swallow.back"; type: SWALLOW;
+        scale: 0;
+        description { state: "default" 0.0;
+           visible: 0;
+        }
+        description { state: "back_visible" 0.0;
+           inherit: "default" 0.0;
+           align: 0.0 0.0;
+           min: 0 50;
+           max: -1 50;
+           visible: 1;
+        }
+     }
+     part { name: "elm.swallow.content"; type: SWALLOW;
+     scale: 0;
+        description { state: "default" 0.0;
+        }
+        description { state: "back_visible" 0.0;
+           inherit: "default" 0.0;
+           rel1.relative: 0.0 1.0;
+           rel1.to_y: "elm.swallow.back";
+           rel2.relative: 1.0 1.0;
+        }
+     }
    }
    programs {
       program {
index 73f86a8..9670e1c 100644 (file)
@@ -1035,19 +1035,19 @@ Optional<TextRange> Atspi::getTextSelection(const AtspiTextPtr &textInterface, i
 
 namespace   //TODO change when atspi_text_get_string_at_offset will be supported by elementary
 {
-       Elm_Atspi_Text_Granularity convertGranularity(Atspi::Granularity granularity)
+       Efl_Access_Text_Granularity convertGranularity(Atspi::Granularity granularity)
        {
                switch (granularity) {
                case Atspi::Granularity::CHAR:
-                       return ELM_ATSPI_TEXT_GRANULARITY_CHAR;
+                       return EFL_ACCESS_TEXT_GRANULARITY_CHAR;
                case Atspi::Granularity::WORD:
-                       return ELM_ATSPI_TEXT_GRANULARITY_WORD;
+                       return EFL_ACCESS_TEXT_GRANULARITY_WORD;
                case Atspi::Granularity::LINE:
-                       return ELM_ATSPI_TEXT_GRANULARITY_LINE;
+                       return EFL_ACCESS_TEXT_GRANULARITY_LINE;
                case Atspi::Granularity::PARAGRAPH:
-                       return ELM_ATSPI_TEXT_GRANULARITY_PARAGRAPH;
+                       return EFL_ACCESS_TEXT_GRANULARITY_PARAGRAPH;
                }
-               return ELM_ATSPI_TEXT_GRANULARITY_CHAR;
+               return EFL_ACCESS_TEXT_GRANULARITY_CHAR;
        }
 }
 
index 9f007e4..a572916 100644 (file)
@@ -685,36 +685,6 @@ private:
                        return;
                }
 
-               auto checkIfHasChildren = [ = ](AtspiAccessiblePtr root, std::function<void(bool)> callback) {
-                       auto atspi = Singleton<UniversalSwitch>::instance().getAtspi();
-                       atspi->getChildrenCount(root, [ = ](DBus::ValueOrError<size_t> count) {
-                               if (continueProcessing(count)) {
-                                       auto atspi = Singleton<UniversalSwitch>::instance().getAtspi();
-                                       DEBUG("elem %s has %d children", Atspi::getUniqueId(root).c_str(), count ? (int)std::get<0>(count) : -1);
-                                       if (std::get<0>(count) == 0) {
-                                               callback(false);
-                                       } else {
-                                               atspi->getChildAtIndex(root, 0, [ = ](DBus::ValueOrError<AtspiAccessiblePtr> child) {
-                                                       if (continueProcessing(child)) {
-                                                               auto atspi = Singleton<UniversalSwitch>::instance().getAtspi();
-                                                               atspi->getChildrenCount(std::get<0>(child), [ = ](DBus::ValueOrError<size_t> count) {
-                                                                       if (continueProcessing(count)) {
-                                                                               DEBUG("elem %s has %d children", Atspi::getUniqueId(root).c_str(), count ? (int)std::get<0>(count) : -1);
-                                                                               callback(std::get<0>(count) > 0);
-                                                                       } else {
-                                                                               callback(false);
-                                                                       }
-                                                               });
-                                                       } else {
-                                                               callback(false);
-                                                       }
-                                               });
-                                       }
-                               } else {
-                                       callback(false);
-                               }
-                       });
-               };
                auto buildNavigationRows = [ = ](AtspiAccessiblePtr app, UIElement::ApplicationCategory application, std::function<void(Optional<NavigationRows>)> callback) {
                        ASSERT(app);
                        auto atspi = Singleton<UniversalSwitch>::instance().getAtspi();
@@ -792,7 +762,6 @@ private:
                        std::unordered_map<AtspiAccessiblePtr, std::string> names;
                        int32_t ourPid;
                        std::vector<int32_t> pids;
-                       bool weHaveChildren = false;
                };
                using ExecHelper = ParallerExecHelper<Empty, All>;
                auto windowsParser = [ = ](ExecHelper & wins) {
@@ -812,7 +781,7 @@ private:
                                DEBUG("checking pid %d", pid);
                                auto ptr = wins.all.pidToAtspi[pid];
                                auto name = wins.all.names[ptr];
-                               if (pid == wins.all.ourPid && !wins.all.weHaveChildren)
+                               if (pid == wins.all.ourPid && !usHasUI)
                                        continue;
                                if (name == keyboardRootName) {
                                        keyboardRoot = std::move(ptr);
@@ -899,11 +868,6 @@ private:
                                                                        auto p = (int32_t)std::get<0>(pid);
                                                                        ptr->all.atspiToPid[app] = p;
                                                                        ptr->all.pidToAtspi[p] = app;
-                                                                       if (p == ptr->all.ourPid) {
-                                                                               checkIfHasChildren(app, [ = ](bool hasChildren) {
-                                                                                       ptr->all.weHaveChildren = hasChildren;
-                                                                               });
-                                                                       }
                                                                }
                                                        });
                                                        atspi->getName(app, [ = ](DBus::ValueOrError<std::string> name) {
index d63446b..ea40507 100644 (file)
@@ -119,6 +119,11 @@ public:
                return ptr;
        }
 
+       void setUIPresence(bool presence)
+       {
+               usHasUI = presence;
+       }
+
 
 protected:
        template <typename T>
@@ -144,6 +149,8 @@ protected:
                        }
                }
        }
+
+       bool usHasUI = false;
 };
 
 #define SPECIALIZE_CALLBACK_TRAITS(Item, FunctionType) \
index 5ace630..ed0851f 100644 (file)
@@ -35,6 +35,7 @@
 #include <memory>
 #include <vector>
 #include <string>
+#include <cmath>
 
 static const double    GENGRID_ITEM_HEIGHT_WIDTH_PROPORTION = 1.2;
 static const int       ITEMS_IN_GENGRID_PER_ROW             = 4;
@@ -65,6 +66,9 @@ private:
        void removeMenu();
        bool isMenuShown() const;
        void createMenuContent();
+       Rectangle calculateMenuGeometry();
+       Size calculateMenuItemSize();
+       std::string findActivityInMenu(int x, int y);
        void addBackButton(Evas_Object *);
        void refreshMenu();
        void navigateThroughSubMenuOrCreateActivityChangeRequest(MenuItem *);
@@ -73,7 +77,7 @@ private:
        void sendTapActivityChangeRequest();
        std::string getCompleteLabelOfMenu();
        std::string getCompleteLabelOfMainMenu();
-       Optional<telephony_call_state_e> getPhoneCallState();
+       Optional<telephony_call_status_e> getPhoneCallState();
        bool isRealUIElementSlider();
        bool hasRealUIElementEditableTextIface();
        std::string getCompleteLabelOfButtonsKeysMenu();
@@ -99,15 +103,38 @@ private:
        Optional<bool> realUiElementHasEditableText;
        std::unique_ptr<Evas_Object, void(*)(Evas_Object *)> popup;
        std::unique_ptr<Evas_Object, void(*)(Evas_Object *)> virtualBackButton;
-       std::unique_ptr<DBus::DBusClient> dbusClient;
+       DBus::DBusClient dbusClient;
+       DBus::DBusClient dbusClient2;
        VConfInterface::CallbackHandle autoTapWaitingPeriodCallbackHandle;
        ecore::Timer timer;
        double autoTapWaitingPeriod;
        DoneCallback activityDoneCallback;
+       std::string checkedMenuItem;
 };
 
 SelectActivity::SelectActivity(): UIActivity(activityType), popup(nullptr, evas_object_del),
-       virtualBackButton(nullptr, evas_object_del), autoTapWaitingPeriod(AUTO_TAP_WAITING_PERIOD_DEFAULT_TIME) {}
+       virtualBackButton(nullptr, evas_object_del), autoTapWaitingPeriod(AUTO_TAP_WAITING_PERIOD_DEFAULT_TIME)
+{
+       // TODO: Creating dbusClient2 is an ugly way to make signals below work properly.
+       // This TEMPORARY solution must be removed during refactor of SelectActivity.
+       dbusClient2 = DBus::DBusClient{dbusLocators::accessibilityEMod::BUS, dbusLocators::accessibilityEMod::OBJ_PATH, dbusLocators::accessibilityEMod::INTERFACE, DBus::ConnectionType::SYSTEM};
+
+       dbusClient2.addSignal<void(int, int)>(dbusLocators::accessibilityEMod::MENU_MOUSE_DOWN_SIGNAL, [this](auto x, auto y) {
+               checkedMenuItem = this->findActivityInMenu(x, y);
+       });
+       dbusClient2.addSignal<void(int, int)>(dbusLocators::accessibilityEMod::MENU_MOUSE_UP_SIGNAL, [this](auto x, auto y) {
+               auto act = this->findActivityInMenu(x, y);
+               if (act == checkedMenuItem) {
+                       for (auto &it : gengridItemsData) {
+                               if (it.first->getName() == act) {
+                                       this->navigateThroughSubMenuOrCreateActivityChangeRequest(it.first.get());
+                               }
+                       }
+               }
+               checkedMenuItem = {};
+       });
+}
+
 
 SelectActivity::~SelectActivity()
 {
@@ -159,7 +186,7 @@ void SelectActivity::update(const std::shared_ptr<UIElement> &elem)
                screenScannerManager->cancelForcingScanningMethod();
        if (isMenuShown()) {
                ASSERT(!realUiElements.empty());
-               notify(std::make_shared<ActivityChangeRequest>("TAP", std::vector<std::shared_ptr<UIElement>> {elem})); /*elem is popup menu item*/
+               elem->activate({});
                return;
        }
 
@@ -216,12 +243,14 @@ void SelectActivity::createMenu()
                return;
        }
 
+       auto navIface = Singleton<UniversalSwitch>::instance().getNavigationInterface();
+       if (navIface)
+               navIface->setUIPresence(true);
+
        auto window = Singleton<UniversalSwitch>::instance().getMainWindow()->getHandler();
        popup.reset(elm_popup_add(window));
-       elm_win_render(window);
        evas_object_smart_callback_add(popup.get(), "dismissed", popupDismissedCb, this);
        menu = Singleton<MenuBuilder>::instance().build(getCompleteLabelOfMenu());
-       elm_popup_orient_set(popup.get(), menu->getAlignment() == Alignment::BOTTOM ? ELM_POPUP_ORIENT_BOTTOM : ELM_POPUP_ORIENT_CENTER);
 
 
        elm_theme_extension_add(NULL, UNIVERSAL_SWITCH_EDJ);
@@ -229,17 +258,21 @@ void SelectActivity::createMenu()
 
        elm_atspi_accessible_attribute_append(popup.get(), "ScanningMethod", "RowScanner");
        elm_atspi_accessible_attribute_append(popup.get(), "EscapeFrameEnabled", "true");
+       elm_popup_orient_set(popup.get(), menu->getAlignment() == Alignment::BOTTOM ? ELM_POPUP_ORIENT_BOTTOM : ELM_POPUP_ORIENT_CENTER);
        createMenuContent();
 
-       dbusClient = std::make_unique<DBus::DBusClient>(dbusLocators::accessibilityEMod::BUS,
-                                dbusLocators::accessibilityEMod::OBJ_PATH, dbusLocators::accessibilityEMod::INTERFACE, DBus::ConnectionType::SYSTEM);
-       dbusClient->method<void(bool)>(dbusLocators::accessibilityEMod::BACK_BUTTON_INTERCEPTION_ENABLED).call(true);
-       dbusClient->addSignal<void()>(dbusLocators::accessibilityEMod::BACK_BUTTON_UP_SIGNAL, [this]() {
+       dbusClient = DBus::DBusClient{dbusLocators::accessibilityEMod::BUS,
+                                                                 dbusLocators::accessibilityEMod::OBJ_PATH, dbusLocators::accessibilityEMod::INTERFACE, DBus::ConnectionType::SYSTEM};
+       dbusClient.method<void(bool)>(dbusLocators::accessibilityEMod::BACK_BUTTON_INTERCEPTION_ENABLED).call(true);
+       dbusClient.addSignal<void()>(dbusLocators::accessibilityEMod::BACK_BUTTON_UP_SIGNAL, [this]() {
                markAsCompleted();
                removeMenu();
        });
 
-       Singleton<UniversalSwitch>::instance().getMainWindow()->acceptTouchInput(true);
+       elm_win_render(Singleton<UniversalSwitch>::instance().getMainWindow()->getHandler());
+       auto geo = calculateMenuGeometry();
+       dbusClient.method<void(bool)>(dbusLocators::accessibilityEMod::MENU_IS_SHOWN).call(true, geo.position.x, geo.position.y, geo.size.width, geo.size.height);
+
        evas_object_show(popup.get());
        timer.reset();
 }
@@ -251,7 +284,6 @@ bool SelectActivity::isMenuShown() const
 
 void SelectActivity::removeMenu()
 {
-       Singleton<UniversalSwitch>::instance().getMainWindow()->acceptTouchInput(false);
        callbackHandle.reset();
 
        for (auto &e : gengridItemsData)
@@ -276,22 +308,30 @@ void SelectActivity::removeMenu()
        timer.reset();
 
        if (dbusClient) {
-               dbusClient->method<void(bool)>(dbusLocators::accessibilityEMod::BACK_BUTTON_INTERCEPTION_ENABLED).call(false);
-               dbusClient.reset();
+               dbusClient.method<void(bool)>(dbusLocators::accessibilityEMod::BACK_BUTTON_INTERCEPTION_ENABLED).call(false);
+               dbusClient.method<void(bool)>(dbusLocators::accessibilityEMod::MENU_IS_SHOWN).call(false, 0, 0, 0, 0);
+               dbusClient = {};
        }
+
+       auto navIface = Singleton<UniversalSwitch>::instance().getNavigationInterface();
+       if (navIface)
+               navIface->setUIPresence(false);
 }
 
 void SelectActivity::createMenuContent()
 {
        auto content = elm_layout_add(popup.get());
        elm_layout_file_set(content, UNIVERSAL_SWITCH_EDJ, "universalSwitchTransparentLayout");
-       evas_object_size_hint_min_set(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_weight_set(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(content, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+       elm_win_render(Singleton<UniversalSwitch>::instance().getMainWindow()->getHandler());
+       auto geo = calculateMenuGeometry();
+       evas_object_geometry_set(content, 0, 0, geo.size.width, geo.size.height);
+
        elm_object_content_set(popup.get(), content);
 
-       auto screenWidth = 0;
-       evas_object_geometry_get(content, nullptr, nullptr, &screenWidth, nullptr);
-       auto itemSize = Size {screenWidth / ITEMS_IN_GENGRID_PER_ROW,
-                                                 static_cast<int>(screenWidth *GENGRID_ITEM_HEIGHT_WIDTH_PROPORTION / ITEMS_IN_GENGRID_PER_ROW)};
+       auto itemSize = calculateMenuItemSize();
 
        auto gengrid = elm_gengrid_add(content);
        elm_object_style_set(gengrid, "popup");
@@ -307,6 +347,55 @@ void SelectActivity::createMenuContent()
                addBackButton(content);
 }
 
+Rectangle SelectActivity::calculateMenuGeometry()
+{
+       using EinaListDestr = Eina_List * (*)(Eina_List *);
+
+       //FIXME: Calculations below base on constant hierarchy of objects and probably should be done without
+       //       asking for accessible tree nodes.
+
+       std::unique_ptr<Eina_List, EinaListDestr> children_1(elm_atspi_accessible_children_get(popup.get()), eina_list_free);
+       auto chld = static_cast<Eo *>(eina_list_nth(children_1.get(), 0));
+
+       std::unique_ptr<Eina_List, EinaListDestr> children_2(elm_atspi_accessible_children_get(chld), eina_list_free);
+       chld = static_cast<Eo *>(eina_list_nth(children_2.get(), 1));
+
+       int x, y, w, h;
+       evas_object_geometry_get(chld, &x, &y, &w, &h);
+
+       return {{x, y}, {w, h}};
+}
+
+Size SelectActivity::calculateMenuItemSize()
+{
+       auto geo = calculateMenuGeometry();
+       return Size {geo.size.width / ITEMS_IN_GENGRID_PER_ROW, static_cast<int>(geo.size.width *GENGRID_ITEM_HEIGHT_WIDTH_PROPORTION / ITEMS_IN_GENGRID_PER_ROW)};
+}
+
+std::string SelectActivity::findActivityInMenu(int x, int y)
+{
+       auto menuGeo = calculateMenuGeometry();
+       auto itemSize = calculateMenuItemSize();
+
+       auto itemsNo = gengridItemsData.size();
+
+       auto fakeElem = Rectangle{{menuGeo.position.x, menuGeo.position.y}, {itemSize}};
+
+       for (auto i = 0u; i < itemsNo; ++i) {
+               if (x > fakeElem.position.x && x < fakeElem.position.x + itemSize.width && y > fakeElem.position.y && y < fakeElem.position.y + itemSize.height)
+                       return gengridItemsData[i].first->getName();
+
+               if ((i + 1) % ITEMS_IN_GENGRID_PER_ROW == 0) {
+                       fakeElem.position.x = menuGeo.position.x;
+                       fakeElem.position.y += itemSize.height;
+               } else {
+                       fakeElem.position.x += itemSize.width;
+               }
+       }
+
+       return {};
+}
+
 void SelectActivity::addBackButton(Evas_Object *content)
 {
        virtualBackButton.reset(elm_button_add(content));
@@ -332,8 +421,6 @@ void SelectActivity::refreshMenu()
 
 void SelectActivity::navigateThroughSubMenuOrCreateActivityChangeRequest(MenuItem *menuItem)
 {
-       DEBUG("element %s", menuItem->getName().c_str());
-
        if (menuItem->getName().empty())
                return;
 
@@ -438,9 +525,9 @@ std::string SelectActivity::getCompleteLabelOfMainMenu()
 {
        auto phoneCallState = getPhoneCallState();
 
-       if (phoneCallState && *phoneCallState == TELEPHONY_CALL_STATE_CONNECTED)
+       if (phoneCallState && *phoneCallState == TELEPHONY_CALL_STATUS_ACTIVE)
                return "IDS_MENU_MAIN_DURING_CALL";
-       if (phoneCallState && *phoneCallState == TELEPHONY_CALL_STATE_CONNECTING)
+       if (phoneCallState && *phoneCallState == TELEPHONY_CALL_STATUS_INCOMING)
                return "IDS_MENU_MAIN_INCOMING_CALL";
 
        if (realUiElements[0]->getApplicationCategory() == UIElement::ApplicationCategory::HOMESCREEN)
@@ -458,7 +545,7 @@ std::string SelectActivity::getCompleteLabelOfMainMenu()
        return "IDS_MENU_MAIN_NORMAL";
 }
 
-Optional<telephony_call_state_e>  SelectActivity::getPhoneCallState()
+Optional<telephony_call_status_e>  SelectActivity::getPhoneCallState()
 {
        telephony_handle_list_s list;
        auto error = telephony_init(&list);
@@ -468,21 +555,32 @@ Optional<telephony_call_state_e>  SelectActivity::getPhoneCallState()
        }
 
        for (auto i = 0u; i < list.count; i++) {
-               telephony_call_state_e callState;
-               error = telephony_call_get_voice_call_state(list.handle[i], &callState);
+               telephony_call_h *callList;
+               unsigned int callCount;
+
+               error = telephony_call_get_call_list(list.handle[i], &callCount, &callList);
                if (error != TELEPHONY_ERROR_NONE) {
-                       ERROR("Can't get call state. Error no. %d", error);
+                       ERROR("Can't get call list. Error no. %d", error);
                        break;
                }
 
-               if (callState != TELEPHONY_CALL_STATE_IDLE) {
-                       telephony_deinit(&list);
-                       return callState;
+               for (auto k = 0u; k < callCount; ++k) {
+                       telephony_call_status_e callState;
+                       error = telephony_call_get_status(callList[i], &callState);
+                       if (error != TELEPHONY_ERROR_NONE) {
+                               ERROR("Can't get call state. Error no. %d", error);
+                               break;
+                       }
+
+                       if (callState != TELEPHONY_CALL_STATUS_IDLE) {
+                               telephony_deinit(&list);
+                               return callState;
+                       }
                }
        }
 
        telephony_deinit(&list);
-       return TELEPHONY_CALL_STATE_IDLE;
+       return TELEPHONY_CALL_STATUS_IDLE;
 }
 
 bool SelectActivity::isRealUIElementSlider()
@@ -557,11 +655,12 @@ void SelectActivity::addItemsToMenu(Evas_Object *gengrid)
 void SelectActivity::gengridItemSelected(Elm_Gengrid_Item *item)
 {
        elm_gengrid_item_selected_set(item, EINA_FALSE);
-       for (auto &e : gengridItemsData)
+       for (auto &e : gengridItemsData) {
                if (e.second == item) {
                        navigateThroughSubMenuOrCreateActivityChangeRequest(e.first.get());
                        break;
                }
+       }
 }
 
 void SelectActivity::popupDismissedCb(void *data, Evas_Object *obj, void *event_info)
@@ -605,4 +704,4 @@ void SelectActivity::sendMessageToEdje(Evas_Object *layout, int value)
        Edje_Message_Int msg = {0, };
        msg.val = value;
        edje_object_message_send(elm_layout_edje_get(layout), EDJE_MESSAGE_INT, 0, &msg);
-}
\ No newline at end of file
+}
index 6c7ad88..f73a0c8 100644 (file)
@@ -42,7 +42,11 @@ SoundFeedback::SoundFeedback()
                ERROR("player_create fail");
                return;
        }
-       error = player_set_sound_type(player, SOUND_TYPE_MEDIA);
+       sound_stream_info_h stream_info = NULL;
+       sound_stream_type_e stream_type = SOUND_STREAM_TYPE_MEDIA;
+       sound_manager_create_stream_information(stream_type, nullptr, nullptr, &stream_info);
+       player_set_sound_stream_info(player, stream_info);
+       error = player_set_sound_stream_info(player, stream_info);
        if (error == PLAYER_ERROR_NONE)
                return;
 
index 0deb3eb..af1fdb5 100644 (file)
@@ -66,6 +66,7 @@ bool UniversalSwitch::initialize(const std::array<Optional<std::string>, (size_t
        auto displayState = DISPLAY_STATE_NORMAL;
        PRINT_ERROR_IF(!device_display_get_state(&displayState));
        isDisplayOn = (displayState == DISPLAY_STATE_NORMAL);
+       DEBUG("isDisplayOn: %d", isDisplayOn);
 
        callbackHandle = Singleton<VConfInterface>::instance().registerAndGet<bool>(VCONF_KEY_INTERACTION_SERVICE, false,
        [this](auto enabled) {
index a17a006..84c7510 100644 (file)
@@ -17,7 +17,7 @@
 #include "UniversalSwitchLog.hpp"
 #include "Window.hpp"
 
-#include "Ecore_Wayland.h"
+#include <Ecore_Wl2.h>
 
 Window::Window()
        : handler(nullptr, removeHandler)
@@ -30,21 +30,27 @@ Window::Window()
        }
 
        handler.reset(windowHandler);
-       waylandWindow = elm_win_wl_window_get(windowHandler);
+       auto ee = ecore_evas_ecore_evas_get(evas_object_evas_get(windowHandler));
+       waylandWindow = ecore_evas_wayland2_window_get(ee);
 
        // TODO: name setter should be removed after reaching full functionality by navigation interface
        elm_atspi_accessible_name_set(windowHandler, "UniversalSwitch Main Window");
 
-       efl_util_set_notification_window_level(windowHandler, EFL_UTIL_NOTIFICATION_LEVEL_3);
+       efl_util_set_notification_window_level(windowHandler, EFL_UTIL_NOTIFICATION_LEVEL_TOP);
        elm_win_alpha_set(windowHandler, EINA_TRUE);
 
        auto size = getDimensions().size;
        evas_object_resize(windowHandler, size.width, size.height);
        int rotations[] = {0, 90, 270};
        elm_win_wm_rotation_available_rotations_set(windowHandler, rotations, 3);
+
        evas_object_show(windowHandler);
 
-       acceptTouchInput(false);
+       Eina_Rectangle rect = {0, 0, 0, 0};
+
+       ecore_wl2_window_input_rect_set(waylandWindow, &rect);
+
+       waiveTouchInput();
 
        auto status = efl_util_set_window_screen_mode(windowHandler, EFL_UTIL_SCREEN_MODE_ALWAYS_ON);
        if (status)
@@ -92,15 +98,10 @@ Quickpanel *Window::getQuickpanel() const
        return quickpanel.get();
 }
 
-void Window::acceptTouchInput(bool state)
+void Window::waiveTouchInput()
 {
-       elm_win_override_set(handler.get(), state ? EINA_FALSE : EINA_TRUE);
-       ecore_wl_window_focus_skip_set(waylandWindow, state ? EINA_FALSE : EINA_TRUE);
-       auto size = 0;
-       if (state) {
-               auto dimensions = getDimensions();
-               size = std::max(dimensions.size.width, dimensions.size.height);
-       }
-
-       ecore_wl_window_input_region_set(waylandWindow, 0, 0, size, size);
+       elm_win_override_set(handler.get(), EINA_TRUE);
+       ecore_wl2_window_focus_skip_set(waylandWindow, EINA_TRUE);
+       Eina_Rectangle rect = {0, 0, 0, 0};
+       ecore_wl2_window_input_rect_set(waylandWindow, &rect);
 }
index a70c26e..d470edc 100644 (file)
@@ -34,13 +34,13 @@ public:
        Rectangle getDimensions() const;
        Quickpanel *getQuickpanel() const;
        void bringToFront();
-       void acceptTouchInput(bool);
+       void waiveTouchInput();
 
 private:
        static void removeHandler(Evas_Object *handler);
 
        std::unique_ptr<Evas_Object, void(*)(Evas_Object *)> handler;
-       Ecore_Wl_Window *waylandWindow;
+       Ecore_Wl2_Window *waylandWindow;
        std::unique_ptr<Quickpanel> quickpanel;
 };
 
index 80baa8e..e74ee1b 100644 (file)
@@ -962,6 +962,7 @@ static void threadFunc(StatPtr result, std::unique_ptr<BatchExecutor> exec, std:
        }
        outputPtr->flush();
        executeOnMainThread([]() {
+               DEBUG("main_loop_quit");
                ecore_main_loop_quit();
        });
        DEBUG("done batch");
index f9bb953..984c120 100644 (file)
@@ -43,6 +43,10 @@ namespace dbusLocators
                static constexpr const char *BACK_BUTTON_INTERCEPTION_ENABLED = "BackButtonInterceptionEnabled";
                static constexpr const char *BACK_BUTTON_DOWN_SIGNAL = "BackButtonDown";
                static constexpr const char *BACK_BUTTON_UP_SIGNAL = "BackButtonUp";
+
+               static constexpr const char *MENU_IS_SHOWN = "MenuIsShown";
+               static constexpr const char *MENU_MOUSE_DOWN_SIGNAL = "MenuMouseDown";
+               static constexpr const char *MENU_MOUSE_UP_SIGNAL = "MenuMouseUp";
        }
 
        namespace freeDesktop
@@ -96,4 +100,3 @@ namespace dbusLocators
 }
 
 #endif
-