Merge "Add a callback for navigation policy in web engine." into devel/master
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 11 Jan 2022 06:45:13 +0000 (06:45 +0000)
committerGerrit Code Review <gerrit@review>
Tue, 11 Jan 2022 06:45:13 +0000 (06:45 +0000)
26 files changed:
dali/devel-api/adaptor-framework/accessibility-bridge.h
dali/devel-api/adaptor-framework/accessibility.cpp
dali/devel-api/adaptor-framework/actor-accessible.cpp [new file with mode: 0644]
dali/devel-api/adaptor-framework/actor-accessible.h [new file with mode: 0644]
dali/devel-api/adaptor-framework/proxy-accessible.h
dali/devel-api/atspi-interfaces/accessible.h
dali/devel-api/atspi-interfaces/action.h
dali/devel-api/atspi-interfaces/application.h
dali/devel-api/atspi-interfaces/collection.h
dali/devel-api/atspi-interfaces/component.h
dali/devel-api/atspi-interfaces/editable-text.h
dali/devel-api/atspi-interfaces/hyperlink.h
dali/devel-api/atspi-interfaces/hypertext.h
dali/devel-api/atspi-interfaces/selection.h
dali/devel-api/atspi-interfaces/text.h
dali/devel-api/atspi-interfaces/value.h
dali/devel-api/file.list
dali/internal/accessibility/bridge/accessible.cpp
dali/internal/accessibility/bridge/bridge-base.cpp
dali/internal/accessibility/bridge/bridge-base.h
dali/internal/accessibility/bridge/bridge-impl.cpp
dali/internal/accessibility/bridge/component.cpp
dali/internal/accessibility/bridge/dummy-atspi.cpp
dali/internal/graphics/gles-impl/gles-graphics-command-buffer.cpp
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 1ef28d0..ba26501 100644 (file)
@@ -51,7 +51,8 @@ struct DALI_ADAPTOR_API Bridge
   enum class ForceUpResult
   {
     JUST_STARTED,
-    ALREADY_UP
+    ALREADY_UP,
+    FAILED
   };
 
   /**
@@ -396,11 +397,11 @@ struct DALI_ADAPTOR_API Bridge
 protected:
   struct Data
   {
-    std::unordered_set<Accessible*> mKnownObjects;
-    std::string                     mBusName;
-    Bridge*                         mBridge = nullptr;
-    Actor                           mHighlightActor;
-    Actor                           mCurrentlyHighlightedActor;
+    std::unordered_set<const Accessible*> mKnownObjects;
+    std::string                           mBusName;
+    Bridge*                               mBridge = nullptr;
+    Actor                                 mHighlightActor;
+    Actor                                 mCurrentlyHighlightedActor;
   };
   std::shared_ptr<Data> mData;
   friend class Accessible;
@@ -425,7 +426,7 @@ protected:
    *
    * @param[in] object The accessible object
    **/
-  void RegisterOnBridge(Accessible* object);
+  void RegisterOnBridge(const Accessible* object);
 
   /**
    * @brief Tells bridge, that given object is considered root (doesn't have any parents).
index fcf60cd..cea55f3 100644 (file)
 #include <dali/public-api/object/object-registry.h>
 #include <dali/public-api/object/type-info.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/object/weak-handle.h>
+#include <string_view>
+#include <unordered_map>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/adaptor-framework/actor-accessible.h>
 #include <dali/devel-api/adaptor-framework/proxy-accessible.h>
 #include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/devel-api/atspi-interfaces/accessible.h>
@@ -42,510 +44,145 @@ const std::string& Dali::Accessibility::Address::GetBus() const
   return mBus.empty() && Bridge::GetCurrentBridge() ? Bridge::GetCurrentBridge()->GetBusName() : mBus;
 }
 
-std::string EmptyAccessibleWithAddress::GetRoleName()
-{
-  return "";
-}
-
-std::string Accessible::GetLocalizedRoleName()
+std::string Accessible::GetLocalizedRoleName() const
 {
   return GetRoleName();
 }
 
-std::string Accessible::GetRoleName()
+std::string Accessible::GetRoleName() const
 {
-  switch(GetRole())
+  static const std::unordered_map<Role, std::string_view> roleMap{
+    {Role::INVALID, "invalid"},
+    {Role::ACCELERATOR_LABEL, "accelerator label"},
+    {Role::ALERT, "alert"},
+    {Role::ANIMATION, "animation"},
+    {Role::ARROW, "arrow"},
+    {Role::CALENDAR, "calendar"},
+    {Role::CANVAS, "canvas"},
+    {Role::CHECK_BOX, "check box"},
+    {Role::CHECK_MENU_ITEM, "check menu item"},
+    {Role::COLOR_CHOOSER, "color chooser"},
+    {Role::COLUMN_HEADER, "column header"},
+    {Role::COMBO_BOX, "combo box"},
+    {Role::DATE_EDITOR, "date editor"},
+    {Role::DESKTOP_ICON, "desktop icon"},
+    {Role::DESKTOP_FRAME, "desktop frame"},
+    {Role::DIAL, "dial"},
+    {Role::DIALOG, "dialog"},
+    {Role::DIRECTORY_PANE, "directory pane"},
+    {Role::DRAWING_AREA, "drawing area"},
+    {Role::FILE_CHOOSER, "file chooser"},
+    {Role::FILLER, "filler"},
+    {Role::FOCUS_TRAVERSABLE, "focus traversable"},
+    {Role::FONT_CHOOSER, "font chooser"},
+    {Role::FRAME, "frame"},
+    {Role::GLASS_PANE, "glass pane"},
+    {Role::HTML_CONTAINER, "html container"},
+    {Role::ICON, "icon"},
+    {Role::IMAGE, "image"},
+    {Role::INTERNAL_FRAME, "internal frame"},
+    {Role::LABEL, "label"},
+    {Role::LAYERED_PANE, "layered pane"},
+    {Role::LIST, "list"},
+    {Role::LIST_ITEM, "list item"},
+    {Role::MENU, "menu"},
+    {Role::MENU_BAR, "menu bar"},
+    {Role::MENU_ITEM, "menu item"},
+    {Role::OPTION_PANE, "option pane"},
+    {Role::PAGE_TAB, "page tab"},
+    {Role::PAGE_TAB_LIST, "page tab list"},
+    {Role::PANEL, "panel"},
+    {Role::PASSWORD_TEXT, "password text"},
+    {Role::POPUP_MENU, "popup menu"},
+    {Role::PROGRESS_BAR, "progress bar"},
+    {Role::PUSH_BUTTON, "push button"},
+    {Role::RADIO_BUTTON, "radio button"},
+    {Role::RADIO_MENU_ITEM, "radio menu item"},
+    {Role::ROOT_PANE, "root pane"},
+    {Role::ROW_HEADER, "row header"},
+    {Role::SCROLL_BAR, "scroll bar"},
+    {Role::SCROLL_PANE, "scroll pane"},
+    {Role::SEPARATOR, "separator"},
+    {Role::SLIDER, "slider"},
+    {Role::SPIN_BUTTON, "spin button"},
+    {Role::SPLIT_PANE, "split pane"},
+    {Role::STATUS_BAR, "status bar"},
+    {Role::TABLE, "table"},
+    {Role::TABLE_CELL, "table cell"},
+    {Role::TABLE_COLUMN_HEADER, "table column header"},
+    {Role::TABLE_ROW_HEADER, "table row header"},
+    {Role::TEAROFF_MENU_ITEM, "tearoff menu item"},
+    {Role::TERMINAL, "terminal"},
+    {Role::TEXT, "text"},
+    {Role::TOGGLE_BUTTON, "toggle button"},
+    {Role::TOOL_BAR, "tool bar"},
+    {Role::TOOL_TIP, "tool tip"},
+    {Role::TREE, "tree"},
+    {Role::TREE_TABLE, "tree table"},
+    {Role::UNKNOWN, "unknown"},
+    {Role::VIEWPORT, "viewport"},
+    {Role::WINDOW, "window"},
+    {Role::EXTENDED, "extended"},
+    {Role::HEADER, "header"},
+    {Role::FOOTER, "footer"},
+    {Role::PARAGRAPH, "paragraph"},
+    {Role::RULER, "ruler"},
+    {Role::APPLICATION, "application"},
+    {Role::AUTOCOMPLETE, "autocomplete"},
+    {Role::EDITBAR, "edit bar"},
+    {Role::EMBEDDED, "embedded"},
+    {Role::ENTRY, "entry"},
+    {Role::CHART, "chart"},
+    {Role::CAPTION, "caution"},
+    {Role::DOCUMENT_FRAME, "document frame"},
+    {Role::HEADING, "heading"},
+    {Role::PAGE, "page"},
+    {Role::SECTION, "section"},
+    {Role::REDUNDANT_OBJECT, "redundant object"},
+    {Role::FORM, "form"},
+    {Role::LINK, "link"},
+    {Role::INPUT_METHOD_WINDOW, "input method window"},
+    {Role::TABLE_ROW, "table row"},
+    {Role::TREE_ITEM, "tree item"},
+    {Role::DOCUMENT_SPREADSHEET, "document spreadsheet"},
+    {Role::DOCUMENT_PRESENTATION, "document presentation"},
+    {Role::DOCUMENT_TEXT, "document text"},
+    {Role::DOCUMENT_WEB, "document web"},
+    {Role::DOCUMENT_EMAIL, "document email"},
+    {Role::COMMENT, "comment"},
+    {Role::LIST_BOX, "list box"},
+    {Role::GROUPING, "grouping"},
+    {Role::IMAGE_MAP, "image map"},
+    {Role::NOTIFICATION, "notification"},
+    {Role::INFO_BAR, "info bar"},
+    {Role::LEVEL_BAR, "level bar"},
+    {Role::TITLE_BAR, "title bar"},
+    {Role::BLOCK_QUOTE, "block quote"},
+    {Role::AUDIO, "audio"},
+    {Role::VIDEO, "video"},
+    {Role::DEFINITION, "definition"},
+    {Role::ARTICLE, "article"},
+    {Role::LANDMARK, "landmark"},
+    {Role::LOG, "log"},
+    {Role::MARQUEE, "marquee"},
+    {Role::MATH, "math"},
+    {Role::RATING, "rating"},
+    {Role::TIMER, "timer"},
+    {Role::STATIC, "static"},
+    {Role::MATH_FRACTION, "math fraction"},
+    {Role::MATH_ROOT, "math root"},
+    {Role::SUBSCRIPT, "subscript"},
+    {Role::SUPERSCRIPT, "superscript"},
+  };
+
+  auto it = roleMap.find(GetRole());
+
+  if(it == roleMap.end())
   {
-    case Role::INVALID:
-    {
-      return "invalid";
-    }
-    case Role::ACCELERATOR_LABEL:
-    {
-      return "accelerator label";
-    }
-    case Role::ALERT:
-    {
-      return "alert";
-    }
-    case Role::ANIMATION:
-    {
-      return "animation";
-    }
-    case Role::ARROW:
-    {
-      return "arrow";
-    }
-    case Role::CALENDAR:
-    {
-      return "calendar";
-    }
-    case Role::CANVAS:
-    {
-      return "canvas";
-    }
-    case Role::CHECK_BOX:
-    {
-      return "check box";
-    }
-    case Role::CHECK_MENU_ITEM:
-    {
-      return "check menu item";
-    }
-    case Role::COLOR_CHOOSER:
-    {
-      return "color chooser";
-    }
-    case Role::COLUMN_HEADER:
-    {
-      return "column header";
-    }
-    case Role::COMBO_BOX:
-    {
-      return "combo box";
-    }
-    case Role::DATE_EDITOR:
-    {
-      return "date editor";
-    }
-    case Role::DESKTOP_ICON:
-    {
-      return "desktop icon";
-    }
-    case Role::DESKTOP_FRAME:
-    {
-      return "desktop frame";
-    }
-    case Role::DIAL:
-    {
-      return "dial";
-    }
-    case Role::DIALOG:
-    {
-      return "dialog";
-    }
-    case Role::DIRECTORY_PANE:
-    {
-      return "directory pane";
-    }
-    case Role::DRAWING_AREA:
-    {
-      return "drawing area";
-    }
-    case Role::FILE_CHOOSER:
-    {
-      return "file chooser";
-    }
-    case Role::FILLER:
-    {
-      return "filler";
-    }
-    case Role::FOCUS_TRAVERSABLE:
-    {
-      return "focus traversable";
-    }
-    case Role::FONT_CHOOSER:
-    {
-      return "font chooser";
-    }
-    case Role::FRAME:
-    {
-      return "frame";
-    }
-    case Role::GLASS_PANE:
-    {
-      return "glass pane";
-    }
-    case Role::HTML_CONTAINER:
-    {
-      return "html container";
-    }
-    case Role::ICON:
-    {
-      return "icon";
-    }
-    case Role::IMAGE:
-    {
-      return "image";
-    }
-    case Role::INTERNAL_FRAME:
-    {
-      return "internal frame";
-    }
-    case Role::LABEL:
-    {
-      return "label";
-    }
-    case Role::LAYERED_PANE:
-    {
-      return "layered pane";
-    }
-    case Role::LIST:
-    {
-      return "list";
-    }
-    case Role::LIST_ITEM:
-    {
-      return "list item";
-    }
-    case Role::MENU:
-    {
-      return "menu";
-    }
-    case Role::MENU_BAR:
-    {
-      return "menu bar";
-    }
-    case Role::MENU_ITEM:
-    {
-      return "menu item";
-    }
-    case Role::OPTION_PANE:
-    {
-      return "option pane";
-    }
-    case Role::PAGE_TAB:
-    {
-      return "page tab";
-    }
-    case Role::PAGE_TAB_LIST:
-    {
-      return "page tab list";
-    }
-    case Role::PANEL:
-    {
-      return "panel";
-    }
-    case Role::PASSWORD_TEXT:
-    {
-      return "password text";
-    }
-    case Role::POPUP_MENU:
-    {
-      return "popup menu";
-    }
-    case Role::PROGRESS_BAR:
-    {
-      return "progress bar";
-    }
-    case Role::PUSH_BUTTON:
-    {
-      return "push button";
-    }
-    case Role::RADIO_BUTTON:
-    {
-      return "radio button";
-    }
-    case Role::RADIO_MENU_ITEM:
-    {
-      return "radio menu item";
-    }
-    case Role::ROOT_PANE:
-    {
-      return "root pane";
-    }
-    case Role::ROW_HEADER:
-    {
-      return "row header";
-    }
-    case Role::SCROLL_BAR:
-    {
-      return "scroll bar";
-    }
-    case Role::SCROLL_PANE:
-    {
-      return "scroll pane";
-    }
-    case Role::SEPARATOR:
-    {
-      return "separator";
-    }
-    case Role::SLIDER:
-    {
-      return "slider";
-    }
-    case Role::SPIN_BUTTON:
-    {
-      return "spin button";
-    }
-    case Role::SPLIT_PANE:
-    {
-      return "split pane";
-    }
-    case Role::STATUS_BAR:
-    {
-      return "status bar";
-    }
-    case Role::TABLE:
-    {
-      return "table";
-    }
-    case Role::TABLE_CELL:
-    {
-      return "table cell";
-    }
-    case Role::TABLE_COLUMN_HEADER:
-    {
-      return "table column header";
-    }
-    case Role::TABLE_ROW_HEADER:
-    {
-      return "table row header";
-    }
-    case Role::TEAROFF_MENU_ITEM:
-    {
-      return "tearoff menu item";
-    }
-    case Role::TERMINAL:
-    {
-      return "terminal";
-    }
-    case Role::TEXT:
-    {
-      return "text";
-    }
-    case Role::TOGGLE_BUTTON:
-    {
-      return "toggle button";
-    }
-    case Role::TOOL_BAR:
-    {
-      return "tool bar";
-    }
-    case Role::TOOL_TIP:
-    {
-      return "tool tip";
-    }
-    case Role::TREE:
-    {
-      return "tree";
-    }
-    case Role::TREE_TABLE:
-    {
-      return "tree table";
-    }
-    case Role::UNKNOWN:
-    {
-      return "unknown";
-    }
-    case Role::VIEWPORT:
-    {
-      return "viewport";
-    }
-    case Role::WINDOW:
-    {
-      return "window";
-    }
-    case Role::EXTENDED:
-    {
-      return "extended";
-    }
-    case Role::HEADER:
-    {
-      return "header";
-    }
-    case Role::FOOTER:
-    {
-      return "footer";
-    }
-    case Role::PARAGRAPH:
-    {
-      return "paragraph";
-    }
-    case Role::RULER:
-    {
-      return "ruler";
-    }
-    case Role::APPLICATION:
-    {
-      return "application";
-    }
-    case Role::AUTOCOMPLETE:
-    {
-      return "autocomplete";
-    }
-    case Role::EDITBAR:
-    {
-      return "edit bar";
-    }
-    case Role::EMBEDDED:
-    {
-      return "embedded";
-    }
-    case Role::ENTRY:
-    {
-      return "entry";
-    }
-    case Role::CHART:
-    {
-      return "chart";
-    }
-    case Role::CAPTION:
-    {
-      return "caution";
-    }
-    case Role::DOCUMENT_FRAME:
-    {
-      return "document frame";
-    }
-    case Role::HEADING:
-    {
-      return "heading";
-    }
-    case Role::PAGE:
-    {
-      return "page";
-    }
-    case Role::SECTION:
-    {
-      return "section";
-    }
-    case Role::REDUNDANT_OBJECT:
-    {
-      return "redundant object";
-    }
-    case Role::FORM:
-    {
-      return "form";
-    }
-    case Role::LINK:
-    {
-      return "link";
-    }
-    case Role::INPUT_METHOD_WINDOW:
-    {
-      return "input method window";
-    }
-    case Role::TABLE_ROW:
-    {
-      return "table row";
-    }
-    case Role::TREE_ITEM:
-    {
-      return "tree item";
-    }
-    case Role::DOCUMENT_SPREADSHEET:
-    {
-      return "document spreadsheet";
-    }
-    case Role::DOCUMENT_PRESENTATION:
-    {
-      return "document presentation";
-    }
-    case Role::DOCUMENT_TEXT:
-    {
-      return "document text";
-    }
-    case Role::DOCUMENT_WEB:
-    {
-      return "document web";
-    }
-    case Role::DOCUMENT_EMAIL:
-    {
-      return "document email";
-    }
-    case Role::COMMENT:
-    {
-      return "comment";
-    }
-    case Role::LIST_BOX:
-    {
-      return "list box";
-    }
-    case Role::GROUPING:
-    {
-      return "grouping";
-    }
-    case Role::IMAGE_MAP:
-    {
-      return "image map";
-    }
-    case Role::NOTIFICATION:
-    {
-      return "notification";
-    }
-    case Role::INFO_BAR:
-    {
-      return "info bar";
-    }
-    case Role::LEVEL_BAR:
-    {
-      return "level bar";
-    }
-    case Role::TITLE_BAR:
-    {
-      return "title bar";
-    }
-    case Role::BLOCK_QUOTE:
-    {
-      return "block quote";
-    }
-    case Role::AUDIO:
-    {
-      return "audio";
-    }
-    case Role::VIDEO:
-    {
-      return "video";
-    }
-    case Role::DEFINITION:
-    {
-      return "definition";
-    }
-    case Role::ARTICLE:
-    {
-      return "article";
-    }
-    case Role::LANDMARK:
-    {
-      return "landmark";
-    }
-    case Role::LOG:
-    {
-      return "log";
-    }
-    case Role::MARQUEE:
-    {
-      return "marquee";
-    }
-    case Role::MATH:
-    {
-      return "math";
-    }
-    case Role::RATING:
-    {
-      return "rating";
-    }
-    case Role::TIMER:
-    {
-      return "timer";
-    }
-    case Role::STATIC:
-    {
-      return "static";
-    }
-    case Role::MATH_FRACTION:
-    {
-      return "math fraction";
-    }
-    case Role::MATH_ROOT:
-    {
-      return "math root";
-    }
-    case Role::SUBSCRIPT:
-    {
-      return "subscript";
-    }
-    case Role::SUPERSCRIPT:
-    {
-      return "superscript";
-    }
-    case Role::MAX_COUNT:
-    {
-      break;
-    }
+    return {};
   }
-  return "";
+
+  return std::string{it->second};
 }
 
 Dali::Actor Accessible::GetCurrentlyHighlightedActor()
@@ -595,66 +232,18 @@ void Bridge::SetIsOnRootLevel(Accessible* owner)
 
 namespace
 {
-class AdaptorAccessible : public virtual Accessible, public virtual Collection, public virtual Component
+class AdaptorAccessible : public ActorAccessible
 {
 protected:
-  Dali::WeakHandle<Dali::Actor> mSelf;
-  bool                          mRoot = false;
-
-  Dali::Actor Self()
-  {
-    auto handle = mSelf.GetHandle();
-
-    // AdaptorAccessible is deleted on ObjectDestroyedSignal
-    // for the respective actor (see `nonControlAccessibles`).
-    DALI_ASSERT_ALWAYS(handle);
-
-    return handle;
-  }
+  bool mRoot = false;
 
 public:
   AdaptorAccessible(Dali::Actor actor, bool isRoot)
-  : mSelf(actor),
+  : ActorAccessible(actor),
     mRoot(isRoot)
   {
   }
 
-  Dali::Rect<> GetExtents(Dali::Accessibility::CoordinateType type) override
-  {
-    Dali::Actor actor                   = Self();
-    Vector2     screenPosition          = actor.GetProperty(Actor::Property::SCREEN_POSITION).Get<Vector2>();
-    Vector3     size                    = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * actor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
-    bool        positionUsesAnchorPoint = actor.GetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT).Get<bool>();
-    Vector3     anchorPointOffSet       = size * (positionUsesAnchorPoint ? actor.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
-    Vector2     position                = Vector2(screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y);
-
-    if(type == Dali::Accessibility::CoordinateType::WINDOW)
-    {
-      return {position.x, position.y, size.x, size.y};
-    }
-    else // Dali::Accessibility::CoordinateType::SCREEN
-    {
-      auto window = Dali::DevelWindow::Get(actor);
-      auto windowPosition = window.GetPosition();
-      return {position.x + windowPosition.GetX(), position.y + windowPosition.GetY(), size.x, size.y};
-    }
-  }
-
-  Dali::Accessibility::ComponentLayer GetLayer() override
-  {
-    return Dali::Accessibility::ComponentLayer::WINDOW;
-  }
-
-  int16_t GetMdiZOrder() override
-  {
-    return 0;
-  }
-
-  double GetAlpha() override
-  {
-    return 0;
-  }
-
   bool GrabFocus() override
   {
     return false;
@@ -670,65 +259,7 @@ public:
     return false;
   }
 
-  bool IsScrollable() override
-  {
-    return false;
-  }
-
-  std::string GetName() override
-  {
-    return Self().GetProperty<std::string>(Dali::Actor::Property::NAME);
-  }
-
-  std::string GetDescription() override
-  {
-    return "";
-  }
-
-  Accessible* GetParent() override
-  {
-    if(IsOnRootLevel())
-    {
-      auto data = GetBridgeData();
-      return data->mBridge->GetApplication();
-    }
-    return Get(Self().GetParent());
-  }
-
-  size_t GetChildCount() override
-  {
-    return static_cast<size_t>(Self().GetChildCount());
-  }
-
-  Accessible* GetChildAtIndex(size_t index) override
-  {
-    auto numberOfChildren = static_cast<size_t>(Self().GetChildCount());
-    if(index >= numberOfChildren)
-    {
-      throw std::domain_error{"invalid index " + std::to_string(index) + " for object with " + std::to_string(numberOfChildren) + " children"};
-    }
-    return Get(Self().GetChildAt(static_cast<unsigned int>(index)));
-  }
-
-  size_t GetIndexInParent() override
-  {
-    auto parent = Self().GetParent();
-    if(!parent)
-    {
-      return 0;
-    }
-    auto size = static_cast<size_t>(parent.GetChildCount());
-    for(auto i = 0u; i < size; ++i)
-    {
-      if(parent.GetChildAt(i) == Self())
-      {
-        return i;
-      }
-    }
-    throw std::domain_error{"actor is not a child of it's parent"};
-  }
-
-  Role GetRole() override
+  Role GetRole() const override
   {
     return mRoot ? Role::WINDOW : Role::REDUNDANT_OBJECT;
   }
@@ -738,8 +269,8 @@ public:
     States state;
     if(mRoot)
     {
-      auto window = Dali::DevelWindow::Get(Self());
-      auto visible = window.IsVisible();
+      auto window             = Dali::DevelWindow::Get(Self());
+      auto visible            = window.IsVisible();
       state[State::ENABLED]   = true;
       state[State::SENSITIVE] = true;
       state[State::SHOWING]   = visible;
@@ -748,19 +279,18 @@ public:
     }
     else
     {
-      auto parentState = GetParent()->GetStates();
+      auto parentState      = GetParent()->GetStates();
       state[State::SHOWING] = parentState[State::SHOWING];
       state[State::VISIBLE] = parentState[State::VISIBLE];
     }
     return state;
   }
 
-  Attributes GetAttributes() override
+  Attributes GetAttributes() const override
   {
     Dali::TypeInfo type;
     Self().GetTypeInfo(type);
-    return
-    {
+    return {
       {"class", type.GetName()},
     };
   }
@@ -774,11 +304,6 @@ public:
   {
     return {};
   }
-
-  Dali::Actor GetInternalActor() override
-  {
-    return mSelf.GetHandle();
-  }
 }; // AdaptorAccessible
 
 using AdaptorAccessiblesType = std::unordered_map<const Dali::RefObject*, std::unique_ptr<AdaptorAccessible> >;
@@ -796,6 +321,9 @@ ObjectRegistry objectRegistry;
 void Accessible::SetObjectRegistry(ObjectRegistry registry)
 {
   objectRegistry = registry;
+  objectRegistry.ObjectDestroyedSignal().Connect([](const Dali::RefObject* obj) {
+    gAdaptorAccessibles.erase(obj);
+  });
 }
 
 void Accessible::RegisterExternalAccessibleGetter(std::function<Accessible*(Dali::Actor)> functor)
@@ -813,12 +341,6 @@ Accessible* Accessible::Get(Dali::Actor actor, bool isRoot)
   auto accessible = convertingFunctor(actor);
   if(!accessible)
   {
-    if(gAdaptorAccessibles.empty() && objectRegistry)
-    {
-      objectRegistry.ObjectDestroyedSignal().Connect([](const Dali::RefObject* obj) {
-        gAdaptorAccessibles.erase(obj);
-      });
-    }
     auto pair = gAdaptorAccessibles.emplace(&actor.GetBaseObject(), nullptr);
     if(pair.second)
     {
diff --git a/dali/devel-api/adaptor-framework/actor-accessible.cpp b/dali/devel-api/adaptor-framework/actor-accessible.cpp
new file mode 100644 (file)
index 0000000..82e4b18
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2021 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/devel-api/adaptor-framework/actor-accessible.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+
+namespace Dali::Accessibility
+{
+ActorAccessible::ActorAccessible(Actor actor)
+: mSelf(actor)
+{
+}
+
+std::string ActorAccessible::GetName() const
+{
+  return Self().GetProperty<std::string>(Dali::Actor::Property::NAME);
+}
+
+std::string ActorAccessible::GetDescription() const
+{
+  return {};
+}
+
+Accessible* ActorAccessible::GetParent()
+{
+  if(IsOnRootLevel())
+  {
+    auto data = GetBridgeData();
+    return data->mBridge->GetApplication();
+  }
+
+  return Get(Self().GetParent());
+}
+
+std::size_t ActorAccessible::GetChildCount() const
+{
+  return static_cast<std::size_t>(Self().GetChildCount());
+}
+
+std::vector<Accessible*> ActorAccessible::GetChildren()
+{
+  std::vector<Accessible*> tmp(GetChildCount());
+  for(auto i = 0u; i < tmp.size(); ++i)
+  {
+    tmp[i] = GetChildAtIndex(i);
+  }
+
+  return tmp;
+}
+
+Accessible* ActorAccessible::GetChildAtIndex(std::size_t index)
+{
+  auto numberOfChildren = GetChildCount();
+  if(DALI_UNLIKELY(index >= numberOfChildren))
+  {
+    throw std::domain_error{"invalid index " + std::to_string(index) + " for object with " + std::to_string(numberOfChildren) + " children"};
+  }
+
+  return Get(Self().GetChildAt(static_cast<std::uint32_t>(index)));
+}
+
+std::size_t ActorAccessible::GetIndexInParent()
+{
+  auto self   = Self();
+  auto parent = self.GetParent();
+
+  if(DALI_UNLIKELY(!parent))
+  {
+    throw std::domain_error{"can't call GetIndexInParent on object without parent"};
+  }
+
+  auto size = static_cast<std::size_t>(parent.GetChildCount());
+  for(auto i = 0u; i < size; ++i)
+  {
+    if(parent.GetChildAt(i) == self)
+    {
+      return i;
+    }
+  }
+
+  throw std::domain_error{"actor is not a child of its parent"};
+}
+
+Dali::Actor ActorAccessible::GetInternalActor()
+{
+  return Self();
+}
+
+ComponentLayer ActorAccessible::GetLayer() const
+{
+  return ComponentLayer::WINDOW;
+}
+
+std::int16_t ActorAccessible::GetMdiZOrder() const
+{
+  return 0;
+}
+
+double ActorAccessible::GetAlpha() const
+{
+  return 0;
+}
+
+bool ActorAccessible::IsScrollable() const
+{
+  return false;
+}
+
+Dali::Rect<> ActorAccessible::GetExtents(CoordinateType type) const
+{
+  Dali::Actor actor                   = Self();
+  Vector2     screenPosition          = actor.GetProperty<Vector2>(Actor::Property::SCREEN_POSITION);
+  Vector3     size                    = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * actor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
+  bool        positionUsesAnchorPoint = actor.GetProperty<bool>(Actor::Property::POSITION_USES_ANCHOR_POINT);
+  Vector3     anchorPointOffSet       = size * (positionUsesAnchorPoint ? actor.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
+  Vector2     position                = Vector2(screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y);
+
+  if(type == CoordinateType::WINDOW)
+  {
+    return {position.x, position.y, size.x, size.y};
+  }
+  else // CoordinateType::SCREEN
+  {
+    auto window         = Dali::DevelWindow::Get(actor);
+    auto windowPosition = window.GetPosition();
+    return {position.x + windowPosition.GetX(), position.y + windowPosition.GetY(), size.x, size.y};
+  }
+}
+
+} // namespace Dali::Accessibility
diff --git a/dali/devel-api/adaptor-framework/actor-accessible.h b/dali/devel-api/adaptor-framework/actor-accessible.h
new file mode 100644 (file)
index 0000000..1306229
--- /dev/null
@@ -0,0 +1,120 @@
+#ifndef DALI_ADAPTOR_ACTOR_ACCESSIBLE_H
+#define DALI_ADAPTOR_ACTOR_ACCESSIBLE_H
+
+/*
+ * Copyright (c) 2021 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/actors/actor.h>
+#include <dali/public-api/object/weak-handle.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/collection.h>
+#include <dali/devel-api/atspi-interfaces/component.h>
+
+namespace Dali::Accessibility
+{
+class DALI_ADAPTOR_API ActorAccessible : public virtual Accessible, public virtual Collection, public virtual Component
+{
+public:
+  ActorAccessible() = delete;
+
+  ActorAccessible(Actor actor);
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetName()
+   */
+  std::string GetName() const override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetDescription()
+   */
+  std::string GetDescription() const override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetParent()
+   */
+  Accessible* GetParent() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetChildCount()
+   */
+  std::size_t GetChildCount() const override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetChildren()
+   */
+  std::vector<Accessible*> GetChildren() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetChildAtIndex()
+   */
+  Accessible* GetChildAtIndex(std::size_t index) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetIndexInParent()
+   */
+  std::size_t GetIndexInParent() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Accessible::GetInternalActor()
+   */
+  Dali::Actor GetInternalActor() override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GetLayer()
+   */
+  ComponentLayer GetLayer() const override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GetMdiZOrder()
+   */
+  std::int16_t GetMdiZOrder() const override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GetAlpha()
+   */
+  double GetAlpha() const override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::IsScrollable()
+   */
+  bool IsScrollable() const override;
+
+  /**
+   * @copydoc Dali::Accessibility::Component::GetExtents()
+   */
+  Dali::Rect<> GetExtents(CoordinateType type) const override;
+
+protected:
+  Dali::Actor Self() const
+  {
+    auto handle = mSelf.GetHandle();
+
+    // It is a bug if the Accessible outlives its Actor
+    DALI_ASSERT_ALWAYS(handle);
+
+    return handle;
+  }
+
+private:
+  Dali::WeakHandle<Dali::Actor> mSelf;
+};
+
+} // namespace Dali::Accessibility
+
+#endif // DALI_ADAPTOR_ACTOR_ACCESSIBLE_H
index c931039..e60c7e1 100644 (file)
@@ -30,16 +30,16 @@ namespace Dali::Accessibility
 /**
  * @brief The minimalistic, always empty Accessible object with settable address.
  *
- * For those situations, where you want to return address in different bridge
- * (embedding for example), but the object itself ain't planned to be used otherwise.
- * This object has null parent, no children, empty name and so on
+ * To be used as a proxy object, in those situations where you want to return an address in
+ * a different bridge (embedding for example), but the object itself isn't planned to be used
+ * otherwise. This object has no parent, no children, an empty name and so on.
  */
-class DALI_ADAPTOR_API EmptyAccessibleWithAddress : public virtual Accessible
+class DALI_ADAPTOR_API ProxyAccessible : public virtual Accessible
 {
 public:
-  EmptyAccessibleWithAddress() = default;
+  ProxyAccessible() = default;
 
-  EmptyAccessibleWithAddress(Address address)
+  ProxyAccessible(Address address)
   : mAddress(std::move(address))
   {
   }
@@ -49,12 +49,12 @@ public:
     this->mAddress = std::move(address);
   }
 
-  std::string GetName() override
+  std::string GetName() const override
   {
     return "";
   }
 
-  std::string GetDescription() override
+  std::string GetDescription() const override
   {
     return "";
   }
@@ -64,7 +64,7 @@ public:
     return nullptr;
   }
 
-  size_t GetChildCount() override
+  size_t GetChildCount() const override
   {
     return 0;
   }
@@ -84,24 +84,27 @@ public:
     return static_cast<size_t>(-1);
   }
 
-  Role GetRole() override
+  Role GetRole() const override
   {
     return {};
   }
 
-  std::string GetRoleName() override;
+  std::string GetRoleName() const override
+  {
+    return {};
+  }
 
   States GetStates() override
   {
     return {};
   }
 
-  Attributes GetAttributes() override
+  Attributes GetAttributes() const override
   {
     return {};
   }
 
-  Address GetAddress() override
+  Address GetAddress() const override
   {
     return mAddress;
   }
index da7786e..1b46e0e 100644 (file)
@@ -21,6 +21,7 @@
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/object/object-registry.h>
+#include <cstdint>
 #include <string>
 #include <vector>
 
@@ -36,7 +37,7 @@ namespace Dali::Accessibility
 class DALI_ADAPTOR_API Accessible
 {
 public:
-  virtual ~Accessible();
+  virtual ~Accessible() noexcept;
 
   using utf8_t = unsigned char;
 
@@ -50,7 +51,7 @@ public:
    *
    * @note Word boundaries are returned as non-zero values in table breaks, which must be of size at least length.
    */
-  void FindWordSeparationsUtf8(const utf8_t* string, size_t length, const char* language, char* breaks);
+  static void FindWordSeparationsUtf8(const utf8_t* string, std::size_t length, const char* language, char* breaks);
 
   /**
    * @brief Calculates and finds line boundaries in given utf8 text.
@@ -62,7 +63,7 @@ public:
    *
    * @note Line boundaries are returned as non-zero values in table breaks, which must be of size at least length.
    */
-  void FindLineSeparationsUtf8(const utf8_t* string, size_t length, const char* language, char* breaks);
+  static void FindLineSeparationsUtf8(const utf8_t* string, std::size_t length, const char* language, char* breaks);
 
   /**
    * @brief Helper function for emiting active-descendant-changed event.
@@ -176,14 +177,14 @@ public:
    *
    * @return The string with name
    */
-  virtual std::string GetName() = 0;
+  virtual std::string GetName() const = 0;
 
   /**
    * @brief Gets accessibility description.
    *
    * @return The string with description
    */
-  virtual std::string GetDescription() = 0;
+  virtual std::string GetDescription() const = 0;
 
   /**
    * @brief Gets parent.
@@ -197,28 +198,28 @@ public:
    *
    * @return The number of children
    */
-  virtual size_t GetChildCount() = 0;
+  virtual std::size_t GetChildCount() const = 0;
 
   /**
    * @brief Gets collection with all children.
    *
    * @return The collection of accessibility objects
    */
-  virtual std::vector<Accessible*> GetChildren();
+  virtual std::vector<Accessible*> GetChildren() = 0;
 
   /**
    * @brief Gets child of the index.
    *
    * @return The child object
    */
-  virtual Accessible* GetChildAtIndex(size_t index) = 0;
+  virtual Accessible* GetChildAtIndex(std::size_t index) = 0;
 
   /**
    * @brief Gets index that current object has in its parent's children collection.
    *
    * @return The index of the current object
    */
-  virtual size_t GetIndexInParent() = 0;
+  virtual std::size_t GetIndexInParent() = 0;
 
   /**
    * @brief Gets accessibility role.
@@ -227,7 +228,7 @@ public:
    *
    * @see Dali::Accessibility::Role
    */
-  virtual Role GetRole() = 0;
+  virtual Role GetRole() const = 0;
 
   /**
    * @brief Gets name of accessibility role.
@@ -237,7 +238,7 @@ public:
    * @see Dali::Accessibility::Role
    * @see Accessibility::Accessible::GetRole
    */
-  virtual std::string GetRoleName();
+  virtual std::string GetRoleName() const;
 
   /**
    * @brief Gets localized name of accessibility role.
@@ -251,7 +252,7 @@ public:
    *
    * @note translation is not supported in this version
    */
-  virtual std::string GetLocalizedRoleName();
+  virtual std::string GetLocalizedRoleName() const;
 
   /**
    * @brief Gets accessibility states.
@@ -270,14 +271,23 @@ public:
    *
    * @return The map of attributes and their values
    */
-  virtual Attributes GetAttributes() = 0;
+  virtual Attributes GetAttributes() const = 0;
+
+  /**
+   * @brief Checks if this is hidden.
+   *
+   * @return True if this is hidden
+   *
+   * @note Hidden means not present in the AT-SPI tree.
+   */
+  virtual bool IsHidden() const;
 
   /**
    * @brief Checks if this is proxy.
    *
    * @return True if this is proxy
    */
-  virtual bool IsProxy();
+  virtual bool IsProxy() const;
 
   /**
    * @brief Gets unique address on accessibility bus.
@@ -286,7 +296,7 @@ public:
    *
    * @see Dali::Accessibility::Address
    */
-  virtual Address GetAddress();
+  virtual Address GetAddress() const;
 
   /**
    * @brief Deputes an object to perform provided gesture.
@@ -329,7 +339,7 @@ public:
    *
    * @return The collection of strings with implemented interfaces
    */
-  std::vector<std::string> GetInterfaces();
+  std::vector<std::string> GetInterfaces() const;
 
   /**
    * @brief Checks if object is on root level.
@@ -347,7 +357,7 @@ protected:
   Accessible(Accessible&&)              = delete;
   Accessible&                   operator=(const Accessible&) = delete;
   Accessible&                   operator=(Accessible&&) = delete;
-  std::shared_ptr<Bridge::Data> GetBridgeData();
+  std::shared_ptr<Bridge::Data> GetBridgeData() const;
 
 public:
   /**
@@ -406,8 +416,8 @@ public:
 private:
   friend class Bridge;
 
-  std::weak_ptr<Bridge::Data> mBridgeData;
-  bool                        mIsOnRootLevel = false;
+  mutable std::weak_ptr<Bridge::Data> mBridgeData;
+  bool                                mIsOnRootLevel = false;
 
 }; // Accessible class
 
index 0276378..b3d9717 100644 (file)
@@ -38,7 +38,7 @@ public:
    *
    * @return The string with name of action
    */
-  virtual std::string GetActionName(size_t index) = 0;
+  virtual std::string GetActionName(std::size_t index) const = 0;
 
   /**
    * @brief Gets translated name of action with given index.
@@ -49,7 +49,7 @@ public:
    *
    * @note The translation is not supported in this version
    */
-  virtual std::string GetLocalizedActionName(size_t index) = 0;
+  virtual std::string GetLocalizedActionName(std::size_t index) const = 0;
 
   /**
    * @brief Gets description of action with given index.
@@ -58,7 +58,7 @@ public:
    *
    * @return The string with description of action
    */
-  virtual std::string GetActionDescription(size_t index) = 0;
+  virtual std::string GetActionDescription(std::size_t index) const = 0;
 
   /**
    * @brief Gets key code binded to action with given index.
@@ -67,14 +67,14 @@ public:
    *
    * @return The string with key name
    */
-  virtual std::string GetActionKeyBinding(size_t index) = 0;
+  virtual std::string GetActionKeyBinding(std::size_t index) const = 0;
 
   /**
    * @brief Gets number of provided actions.
    *
    * @return The number of actions
    */
-  virtual size_t GetActionCount() = 0;
+  virtual std::size_t GetActionCount() const = 0;
 
   /**
    * @brief Performs an action with given index.
@@ -83,7 +83,7 @@ public:
    *
    * @return true on success, false otherwise
    */
-  virtual bool DoAction(size_t index) = 0;
+  virtual bool DoAction(std::size_t index) = 0;
 
   /**
    * @brief Performs an action with given name.
index c4eb62a..5e37f6b 100644 (file)
@@ -40,14 +40,14 @@ public:
    *
    * @return String with name
    */
-  virtual std::string GetToolkitName() = 0;
+  virtual std::string GetToolkitName() const = 0;
 
   /**
    * @brief Gets version of graphic user interface framework used by an application.
    *
    * @return String with version
    */
-  virtual std::string GetVersion() = 0;
+  virtual std::string GetVersion() const = 0;
 };
 
 } // namespace Dali::Accessibility
index 173c929..6452854 100644 (file)
@@ -30,7 +30,6 @@ namespace Dali::Accessibility
  */
 class DALI_ADAPTOR_API Collection : public virtual Accessible
 {
-public:
 };
 
 } // namespace Dali::Accessibility
index b32fe02..1853313 100644 (file)
@@ -42,7 +42,7 @@ public:
    *
    * @see Dali::Rect
    */
-  virtual Rect<> GetExtents(CoordinateType type) = 0;
+  virtual Rect<> GetExtents(CoordinateType type) const = 0;
 
   /**
    * @brief Gets layer current object is localized on.
@@ -51,7 +51,7 @@ public:
    *
    * @see Dali::Accessibility::ComponentLayer
    */
-  virtual ComponentLayer GetLayer() = 0;
+  virtual ComponentLayer GetLayer() const = 0;
 
   /**
    * @brief Gets value of z-order.
@@ -61,7 +61,7 @@ public:
    * which in short means that many stacked windows can be displayed within a single application.
    * In such model, the concept of z-order of UI element became important to deal with element overlapping.
    */
-  virtual int16_t GetMdiZOrder() = 0;
+  virtual int16_t GetMdiZOrder() const = 0;
 
   /**
    * @brief Sets current object as "focused".
@@ -75,7 +75,7 @@ public:
    *
    * @return The alpha channel value in range [0.0, 1.0]
    */
-  virtual double GetAlpha() = 0;
+  virtual double GetAlpha() const = 0;
 
   /**
    * @brief Sets current object as "highlighted".
@@ -105,7 +105,7 @@ public:
    *
    * @see Dali:Accessibility::State
    */
-  virtual bool IsScrollable();
+  virtual bool IsScrollable() const = 0;
 
   /**
    * @brief Gets Accessible object containing given point.
@@ -130,7 +130,7 @@ public:
    * @remarks This method is `Contains` in DBus method.
    * @see Dali::Accessibility::Point
    */
-  virtual bool IsAccessibleContainingPoint(Point point, CoordinateType type);
+  virtual bool IsAccessibleContainingPoint(Point point, CoordinateType type) const;
 };
 
 } // namespace Dali::Accessibility
index b710958..66c822e 100644 (file)
@@ -22,6 +22,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
 
 namespace Dali::Accessibility
 {
@@ -32,7 +33,7 @@ namespace Dali::Accessibility
  *
  * @see Dali::Accessibility::EditableText
  */
-class DALI_ADAPTOR_API EditableText : public virtual Accessible
+class DALI_ADAPTOR_API EditableText : public virtual Accessible, public virtual Text
 {
 public:
   /**
@@ -43,7 +44,7 @@ public:
    *
    * @return true on success, false otherwise
    */
-  virtual bool CopyText(size_t startPosition, size_t endPosition) = 0;
+  virtual bool CopyText(std::size_t startPosition, std::size_t endPosition) = 0;
 
   /**
    * @brief Cuts text in range to system clipboard.
@@ -53,7 +54,7 @@ public:
    *
    * @return true on success, false otherwise
    */
-  virtual bool CutText(size_t startPosition, size_t endPosition) = 0;
+  virtual bool CutText(std::size_t startPosition, std::size_t endPosition) = 0;
 
   /**
    * @brief Deletes text in range.
@@ -63,7 +64,7 @@ public:
    *
    * @return true on success, false otherwise
    */
-  virtual bool DeleteText(size_t startPosition, size_t endPosition) = 0;
+  virtual bool DeleteText(std::size_t startPosition, std::size_t endPosition) = 0;
 
   /**
    * @brief Inserts text at startPosition.
@@ -73,7 +74,7 @@ public:
    *
    * @return true on success, false otherwise
    */
-  virtual bool InsertText(size_t startPosition, std::string text) = 0;
+  virtual bool InsertText(std::size_t startPosition, std::string text) = 0;
 
   /**
    * @brief Replaces text with content.
index dc24615..5f7c8f5 100644 (file)
@@ -37,21 +37,21 @@ public:
    *
    * @return The 0-based index of hyperlink's last character + 1, in its originating hypertext.
    */
-  virtual int32_t GetEndIndex() const = 0;
+  virtual std::int32_t GetEndIndex() const = 0;
 
   /**
    * @brief Gets the index of character in originating hypertext at which this hyperlink starts.
    *
    * @return The 0-based index of hyperlink's first character, in its originating hypertext.
    */
-  virtual int32_t GetStartIndex() const = 0;
+  virtual std::int32_t GetStartIndex() const = 0;
 
   /**
    * @brief Gets the total number of anchors which this hyperlink has. Though, typical hyperlinks will have only one anchor.
    *
    * @return The number of anchors.
    */
-  virtual int32_t GetAnchorCount() const = 0;
+  virtual std::int32_t GetAnchorCount() const = 0;
 
   /**
    * @brief Gets the object associated with a particular hyperlink's anchor.
@@ -60,7 +60,7 @@ public:
    *
    * @return The handle to accessible object.
    */
-  virtual Accessible* GetAnchorAccessible(int32_t anchorIndex) const = 0;
+  virtual Accessible* GetAnchorAccessible(std::int32_t anchorIndex) const = 0;
 
   /**
    * @brief Gets the URI associated with a particular hyperlink's anchor.
@@ -69,7 +69,7 @@ public:
    *
    * @return The string containing URI.
    */
-  virtual std::string GetAnchorUri(int32_t anchorIndex) const = 0;
+  virtual std::string GetAnchorUri(std::int32_t anchorIndex) const = 0;
 
   /**
    * @brief Tells whether this hyperlink object is still valid with respect to its originating hypertext object.
index cc96bbb..e9b4deb 100644 (file)
@@ -39,7 +39,7 @@ public:
    *
    * @return Handle to hyperlink object at a specified index in hyperlink collection of hypertext.
    */
-  virtual Hyperlink* GetLink(int32_t linkIndex) const = 0;
+  virtual Hyperlink* GetLink(std::int32_t linkIndex) const = 0;
 
   /**
    * @brief Gets the index in hyperlink collection occupied by hyperlink which spans over a specified character offset in this hypertext.
@@ -48,14 +48,14 @@ public:
    *
    * @return The value of 0-based index in hyperlink collection (-1 if there is no hyperlink at the specified character offset).
    */
-  virtual int32_t GetLinkIndex(int32_t characterOffset) const = 0;
+  virtual std::int32_t GetLinkIndex(std::int32_t characterOffset) const = 0;
 
   /**
    * @brief Gets number of hyperlinks stored in this hypertext.
    *
    * @return The number of hyperlinks (zero if none or -1 if the number cannot be determined)
    */
-  virtual int32_t GetLinkCount() const = 0;
+  virtual std::int32_t GetLinkCount() const = 0;
 };
 
 } // namespace Dali::Accessibility
index fb6bdf9..2aadd67 100644 (file)
@@ -33,7 +33,7 @@ public:
    *
    * @return The number of selected children (zero if none)
    */
-  virtual int GetSelectedChildrenCount() = 0;
+  virtual int GetSelectedChildrenCount() const = 0;
 
   /**
    * @brief Gets a specific selected child.
@@ -77,7 +77,7 @@ public:
    *
    * @return true if given child is selected, false otherwise
    */
-  virtual bool IsChildSelected(int childIndex) = 0;
+  virtual bool IsChildSelected(int childIndex) const = 0;
 
   /**
    * @brief Selects all children.
index 53158ba..bd2981c 100644 (file)
@@ -42,7 +42,7 @@ public:
    *
    * @return The substring of stored text
    */
-  virtual std::string GetText(size_t startOffset, size_t endOffset) = 0;
+  virtual std::string GetText(std::size_t startOffset, std::size_t endOffset) const = 0;
 
   /**
    * @brief Gets number of all stored characters.
@@ -50,7 +50,7 @@ public:
    * @return The number of characters
    * @remarks This method is `CharacterCount` in DBus method.
    */
-  virtual size_t GetCharacterCount() = 0;
+  virtual std::size_t GetCharacterCount() const = 0;
 
   /**
    * @brief Gets the cursor offset.
@@ -58,7 +58,7 @@ public:
    * @return Value of cursor offset
    * @remarks This method is `CaretOffset` in DBus method.
    */
-  virtual size_t GetCursorOffset() = 0;
+  virtual std::size_t GetCursorOffset() const = 0;
 
   /**
    * @brief Sets the cursor offset.
@@ -68,7 +68,7 @@ public:
    * @return True if successful
    * @remarks This method is `SetCaretOffset` in DBus method.
    */
-  virtual bool SetCursorOffset(size_t offset) = 0;
+  virtual bool SetCursorOffset(std::size_t offset) = 0;
 
   /**
    * @brief Gets substring of stored text truncated in concrete gradation.
@@ -80,7 +80,7 @@ public:
    *
    * @see Dali::Accessibility::Range
    */
-  virtual Range GetTextAtOffset(size_t offset, TextBoundary boundary) = 0;
+  virtual Range GetTextAtOffset(std::size_t offset, TextBoundary boundary) const = 0;
 
   /**
    * @brief Gets selected text.
@@ -93,7 +93,7 @@ public:
    * @remarks This method is `GetSelection` in DBus method.
    * @see Dali::Accessibility::Range
    */
-  virtual Range GetRangeOfSelection(size_t selectionIndex) = 0;
+  virtual Range GetRangeOfSelection(std::size_t selectionIndex) const = 0;
 
   /**
    * @brief Removes the whole selection.
@@ -103,7 +103,7 @@ public:
    *
    * @return bool on success, false otherwise
    */
-  virtual bool RemoveSelection(size_t selectionIndex) = 0;
+  virtual bool RemoveSelection(std::size_t selectionIndex) = 0;
 
   /**
    * @brief Sets selected text.
@@ -117,7 +117,7 @@ public:
    * @return true on success, false otherwise
    * @remarks This method is `SetSelection` in DBus method.
    */
-  virtual bool SetRangeOfSelection(size_t selectionIndex, size_t startOffset, size_t endOffset) = 0;
+  virtual bool SetRangeOfSelection(std::size_t selectionIndex, std::size_t startOffset, std::size_t endOffset) = 0;
 };
 
 } // namespace Dali::Accessibility
index 69bba32..350e2be 100644 (file)
@@ -33,21 +33,21 @@ public:
    *
    * @return The minimum value
   */
-  virtual double GetMinimum() = 0;
+  virtual double GetMinimum() const = 0;
 
   /**
    * @brief Gets the current value.
    *
    * @return The current value
   */
-  virtual double GetCurrent() = 0;
+  virtual double GetCurrent() const = 0;
 
   /**
    * @brief Gets the highest possible value.
    *
    * @return The highest value.
   */
-  virtual double GetMaximum() = 0;
+  virtual double GetMaximum() const = 0;
 
   /**
    * @brief Sets the current value.
@@ -63,7 +63,7 @@ public:
    *
    * @return The lowest increment
   */
-  virtual double GetMinimumIncrement() = 0;
+  virtual double GetMinimumIncrement() const = 0;
 };
 
 } // namespace Dali::Accessibility
index b501e0c..1390bf9 100755 (executable)
@@ -2,6 +2,7 @@
 
 SET( devel_api_src_files
   ${adaptor_devel_api_dir}/adaptor-framework/accessibility.cpp
+  ${adaptor_devel_api_dir}/adaptor-framework/actor-accessible.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/application-devel.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.cpp
@@ -55,6 +56,7 @@ SET( devel_api_src_files
 SET( devel_api_adaptor_framework_header_files
   ${adaptor_devel_api_dir}/adaptor-framework/accessibility.h
   ${adaptor_devel_api_dir}/adaptor-framework/accessibility-bridge.h
+  ${adaptor_devel_api_dir}/adaptor-framework/actor-accessible.h
   ${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.h
   ${adaptor_devel_api_dir}/adaptor-framework/application-devel.h
   ${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.h
index 2921e60..dc0fca2 100644 (file)
 
 using namespace Dali::Accessibility;
 
-std::vector<std::string> Accessible::GetInterfaces()
+std::vector<std::string> Accessible::GetInterfaces() const
 {
   std::vector<std::string> tmp;
   tmp.push_back(AtspiDbusInterfaceAccessible);
-  if(dynamic_cast<Collection*>(this))
+  if(dynamic_cast<const Collection*>(this))
   {
     tmp.push_back(AtspiDbusInterfaceCollection);
   }
-  if(dynamic_cast<Text*>(this))
+  if(dynamic_cast<const Text*>(this))
   {
     tmp.push_back(AtspiDbusInterfaceText);
   }
-  if(dynamic_cast<EditableText*>(this))
+  if(dynamic_cast<const EditableText*>(this))
   {
     tmp.push_back(AtspiDbusInterfaceEditableText);
   }
-  if(dynamic_cast<Value*>(this))
+  if(dynamic_cast<const Value*>(this))
   {
     tmp.push_back(AtspiDbusInterfaceValue);
   }
-  if(dynamic_cast<Component*>(this))
+  if(dynamic_cast<const Component*>(this))
   {
     tmp.push_back(AtspiDbusInterfaceComponent);
   }
-  if(auto action = dynamic_cast<Action*>(this))
+  if(auto action = dynamic_cast<const Action*>(this))
   {
     if(action->GetActionCount() > 0)
     {
       tmp.push_back(AtspiDbusInterfaceAction);
     }
   }
-  if(dynamic_cast<Selection*>(this))
+  if(dynamic_cast<const Selection*>(this))
   {
     tmp.push_back(AtspiDbusInterfaceSelection);
   }
-  if(dynamic_cast<Hypertext*>(this))
+  if(dynamic_cast<const Hypertext*>(this))
   {
     tmp.push_back(AtspiDbusInterfaceHypertext);
   }
-  if(dynamic_cast<Hyperlink*>(this))
+  if(dynamic_cast<const Hyperlink*>(this))
   {
     tmp.push_back(AtspiDbusInterfaceHyperlink);
   }
@@ -86,7 +86,7 @@ Accessible::Accessible()
 {
 }
 
-Accessible::~Accessible()
+Accessible::~Accessible() noexcept
 {
   auto handle = mBridgeData.lock();
   if(handle)
@@ -195,17 +195,7 @@ void Accessible::EmitBoundsChanged(Rect<> rect)
   }
 }
 
-std::vector<Accessible*> Accessible::GetChildren()
-{
-  std::vector<Accessible*> tmp(GetChildCount());
-  for(auto i = 0u; i < tmp.size(); ++i)
-  {
-    tmp[i] = GetChildAtIndex(i);
-  }
-  return tmp;
-}
-
-std::shared_ptr<Bridge::Data> Accessible::GetBridgeData()
+std::shared_ptr<Bridge::Data> Accessible::GetBridgeData() const
 {
   auto handle = mBridgeData.lock();
   if(!handle)
@@ -216,7 +206,7 @@ std::shared_ptr<Bridge::Data> Accessible::GetBridgeData()
   return handle;
 }
 
-Address Accessible::GetAddress()
+Address Accessible::GetAddress() const
 {
   auto handle = mBridgeData.lock();
   if(!handle)
@@ -232,7 +222,7 @@ Address Accessible::GetAddress()
   return {handle ? handle->mBusName : "", tmp.str()};
 }
 
-void Bridge::RegisterOnBridge(Accessible* object)
+void Bridge::RegisterOnBridge(const Accessible* object)
 {
   assert(!object->mBridgeData.lock() || object->mBridgeData.lock() == mData);
   if(!object->mBridgeData.lock())
@@ -243,7 +233,12 @@ void Bridge::RegisterOnBridge(Accessible* object)
   }
 }
 
-bool Accessible::IsProxy()
+bool Accessible::IsHidden() const
+{
+  return false;
+}
+
+bool Accessible::IsProxy() const
 {
   return false;
 }
index 816194a..0f0bc43 100644 (file)
@@ -116,7 +116,8 @@ void BridgeBase::UpdateRegisteredEvents()
 
 BridgeBase::ForceUpResult BridgeBase::ForceUp()
 {
-  if(Bridge::ForceUp() == ForceUpResult::ALREADY_UP)
+  //TODO: checking mBusName is enough? or a new variable to check bridge state?
+  if(Bridge::ForceUp() == ForceUpResult::ALREADY_UP && !GetBusName().empty())
   {
     return ForceUpResult::ALREADY_UP;
   }
@@ -125,7 +126,8 @@ BridgeBase::ForceUpResult BridgeBase::ForceUp()
 
   if(!addr)
   {
-    throw std::domain_error{std::string("failed at call '") + dbusLocators::atspi::GET_ADDRESS + "': " + addr.getError().message};
+    DALI_LOG_ERROR("failed at call '%s': %s\n", dbusLocators::atspi::GET_ADDRESS, addr.getError().message.c_str());
+    return ForceUpResult::FAILED;
   }
 
   mConnectionPtr  = DBusWrapper::Installed()->eldbus_address_connection_get_impl(std::get<0>(addr));
@@ -244,7 +246,6 @@ void BridgeBase::RemoveTopLevelWindow(Accessible* windowAccessible)
   {
     if(windowAccessible->GetInternalActor() == mApplication.mWindows[i].GetRootLayer())
     {
-      Dali::Accessibility::Bridge::GetCurrentBridge()->WindowHidden(mApplication.mWindows[i]);
       Dali::DevelWindow::VisibilityChangedSignal(mApplication.mWindows[i]).Disconnect(this, &BridgeBase::OnWindowVisibilityChanged);
       mApplication.mWindows[i].FocusChangeSignal().Disconnect(this, &BridgeBase::OnWindowFocusChanged);
       mApplication.mWindows.erase(mApplication.mWindows.begin() + i);
index 77cd826..cdffa9e 100644 (file)
 #include <dali/internal/accessibility/bridge/accessibility-common.h>
 
 /**
- * @brief The AppAccessible class is to define Accessibility Application.
+ * @brief The ApplicationAccessible class is to define Accessibility Application.
  */
-class AppAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection, public virtual Dali::Accessibility::Application
+class ApplicationAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection, public virtual Dali::Accessibility::Application
 {
 public:
-  Dali::Accessibility::EmptyAccessibleWithAddress mParent;
-  std::vector<Dali::Accessibility::Accessible*>   mChildren;
-  std::vector<Dali::Window>                       mWindows;
-  std::string                                     mName;
+  Dali::Accessibility::ProxyAccessible          mParent;
+  std::vector<Dali::Accessibility::Accessible*> mChildren;
+  std::vector<Dali::Window>                     mWindows;
+  std::string                                   mName;
 
-  std::string GetName() override
+  std::string GetName() const override
   {
     return mName;
   }
 
-  std::string GetDescription() override
+  std::string GetDescription() const override
   {
     return "";
   }
@@ -58,11 +58,16 @@ public:
     return &mParent;
   }
 
-  size_t GetChildCount() override
+  size_t GetChildCount() const override
   {
     return mChildren.size();
   }
 
+  std::vector<Dali::Accessibility::Accessible*> GetChildren() override
+  {
+    return mChildren;
+  }
+
   Dali::Accessibility::Accessible* GetChildAtIndex(size_t index) override
   {
     auto size = mChildren.size();
@@ -78,7 +83,7 @@ public:
     throw std::domain_error{"can't call GetIndexInParent on application object"};
   }
 
-  Dali::Accessibility::Role GetRole() override
+  Dali::Accessibility::Role GetRole() const override
   {
     return Dali::Accessibility::Role::APPLICATION;
   }
@@ -88,7 +93,7 @@ public:
     return {};
   }
 
-  Dali::Accessibility::Attributes GetAttributes() override
+  Dali::Accessibility::Attributes GetAttributes() const override
   {
     return {};
   }
@@ -137,17 +142,17 @@ public:
     return Dali::Actor{};
   }
 
-  Dali::Accessibility::Address GetAddress() override
+  Dali::Accessibility::Address GetAddress() const override
   {
     return {"", "root"};
   }
 
-  std::string GetToolkitName() override
+  std::string GetToolkitName() const override
   {
     return {"dali"};
   }
 
-  std::string GetVersion() override
+  std::string GetVersion() const override
   {
     return std::to_string(Dali::ADAPTOR_MAJOR_VERSION) + "." + std::to_string(Dali::ADAPTOR_MINOR_VERSION);
   }
@@ -443,7 +448,7 @@ public:
   }
 
 protected:
-  mutable AppAccessible                         mApplication;
+  mutable ApplicationAccessible                 mApplication;
   std::vector<Dali::Accessibility::Accessible*> mDefaultLabels;
   bool                                          mIsScreenReaderSuppressed = false;
 
index 1a7ca8b..0d48895 100644 (file)
@@ -82,6 +82,7 @@ class BridgeImpl : public virtual BridgeBase,
   Dali::Timer                                                   mInitializeTimer;
   Dali::Timer                                                   mReadIsEnabledTimer;
   Dali::Timer                                                   mReadScreenReaderEnabledTimer;
+  Dali::Timer                                                   mForceUpTimer;
 
 public:
   BridgeImpl()
@@ -233,23 +234,33 @@ public:
     mDirectReadingCallbacks.clear();
     mApplication.mChildren.clear();
     mApplication.mWindows.clear();
+    ClearTimer();
   }
 
-  void StopTimer()
+  void ClearTimer()
   {
     if(mInitializeTimer)
     {
       mInitializeTimer.Stop();
+      mInitializeTimer.Reset();
     }
 
     if(mReadIsEnabledTimer)
     {
       mReadIsEnabledTimer.Stop();
+      mReadIsEnabledTimer.Reset();
     }
 
     if(mReadScreenReaderEnabledTimer)
     {
       mReadScreenReaderEnabledTimer.Stop();
+      mReadScreenReaderEnabledTimer.Reset();
+    }
+
+    if(mForceUpTimer)
+    {
+      mForceUpTimer.Stop();
+      mForceUpTimer.Reset();
     }
   }
 
@@ -264,7 +275,6 @@ public:
       mData->mHighlightActor            = {};
     }
     ForceDown();
-    StopTimer();
     if((NULL != mIdleCallback) && Dali::Adaptor::IsAvailable())
     {
       Dali::Adaptor::Get().RemoveIdle(mIdleCallback);
@@ -274,14 +284,34 @@ public:
     mConnectionPtr                    = {};
   }
 
+  bool ForceUpTimerCallback()
+  {
+    if(ForceUp() != ForceUpResult::FAILED)
+    {
+      return false;
+    }
+    return true;
+  }
+
   /**
    * @copydoc Dali::Accessibility::Bridge::ForceUp()
    */
   ForceUpResult ForceUp() override
   {
-    if(BridgeAccessible::ForceUp() == ForceUpResult::ALREADY_UP)
+    auto forceUpResult = BridgeAccessible::ForceUp();
+    if(forceUpResult == ForceUpResult::ALREADY_UP)
     {
-      return ForceUpResult::ALREADY_UP;
+      return forceUpResult;
+    }
+    else if(forceUpResult == ForceUpResult::FAILED)
+    {
+      if(!mForceUpTimer)
+      {
+        mForceUpTimer = Dali::Timer::New(RETRY_INTERVAL);
+        mForceUpTimer.TickSignal().Connect(this, &BridgeImpl::ForceUpTimerCallback);
+        mForceUpTimer.Start();
+      }
+      return forceUpResult;
     }
 
     BridgeObject::RegisterInterfaces();
@@ -456,6 +486,18 @@ public:
     ReadScreenReaderEnabledProperty();
   }
 
+  void SwitchBridge()
+  {
+    if((!mIsScreenReaderSuppressed && mIsScreenReaderEnabled) || mIsEnabled)
+    {
+      ForceUp();
+    }
+    else
+    {
+      ForceDown();
+    }
+  }
+
   bool ReadIsEnabledTimerCallback()
   {
     ReadIsEnabledProperty();
@@ -479,15 +521,15 @@ public:
         }
         return;
       }
-      mIsEnabled = std::get<0>(msg);
-      if((!mIsScreenReaderSuppressed && mIsScreenReaderEnabled) || mIsEnabled)
-      {
-        ForceUp();
-      }
-      else
+
+      if(mReadIsEnabledTimer)
       {
-        ForceDown();
+        mReadIsEnabledTimer.Stop();
+        mReadIsEnabledTimer.Reset();
       }
+
+      mIsEnabled = std::get<0>(msg);
+      SwitchBridge();
     });
   }
 
@@ -495,14 +537,7 @@ public:
   {
     mAccessibilityStatusClient.addPropertyChangedEvent<bool>("IsEnabled", [this](bool res) {
       mIsEnabled = res;
-      if(mIsScreenReaderEnabled || mIsEnabled)
-      {
-        ForceUp();
-      }
-      else
-      {
-        ForceDown();
-      }
+      SwitchBridge();
     });
   }
 
@@ -535,15 +570,15 @@ public:
         }
         return;
       }
-      mIsScreenReaderEnabled = std::get<0>(msg);
-      if((!mIsScreenReaderSuppressed && mIsScreenReaderEnabled) || mIsEnabled)
-      {
-        ForceUp();
-      }
-      else
+
+      if(mReadScreenReaderEnabledTimer)
       {
-        ForceDown();
+        mReadScreenReaderEnabledTimer.Stop();
+        mReadScreenReaderEnabledTimer.Reset();
       }
+
+      mIsScreenReaderEnabled = std::get<0>(msg);
+      SwitchBridge();
     });
   }
 
@@ -551,14 +586,7 @@ public:
   {
     mAccessibilityStatusClient.addPropertyChangedEvent<bool>("ScreenReaderEnabled", [this](bool res) {
       mIsScreenReaderEnabled = res;
-      if((!mIsScreenReaderSuppressed && mIsScreenReaderEnabled) || mIsEnabled)
-      {
-        ForceUp();
-      }
-      else
-      {
-        ForceDown();
-      }
+      SwitchBridge();
     });
   }
 
index 7992df5..640f30f 100644 (file)
@@ -26,7 +26,7 @@
 
 using namespace Dali::Accessibility;
 
-bool Component::IsAccessibleContainingPoint(Point point, Dali::Accessibility::CoordinateType type)
+bool Component::IsAccessibleContainingPoint(Point point, Dali::Accessibility::CoordinateType type) const
 {
   auto extents = GetExtents(type);
   return point.x >= extents.x && point.y >= extents.y && point.x <= extents.x + extents.width && point.y <= extents.y + extents.height;
@@ -45,8 +45,3 @@ Accessible* Component::GetAccessibleAtPoint(Point point, Dali::Accessibility::Co
   }
   return nullptr;
 }
-
-bool Component::IsScrollable()
-{
-  return false;
-}
index 4fd124b..955997b 100644 (file)
@@ -27,7 +27,7 @@ Accessibility::Accessible::Accessible()
 {
 }
 
-Accessibility::Accessible::~Accessible()
+Accessibility::Accessible::~Accessible() noexcept
 {
 }
 
@@ -36,27 +36,32 @@ std::vector<Accessibility::Accessible*> Accessibility::Accessible::GetChildren()
   return {};
 }
 
-Accessibility::Address Accessibility::Accessible::GetAddress()
+Accessibility::Address Accessibility::Accessible::GetAddress() const
 {
   return {};
 }
 
-std::shared_ptr<Accessibility::Bridge::Data> Accessibility::Accessible::GetBridgeData()
+std::shared_ptr<Accessibility::Bridge::Data> Accessibility::Accessible::GetBridgeData() const
 {
   return {};
 }
 
-bool Accessibility::Accessible::IsProxy()
+bool Accessibility::Accessible::IsHidden() const
 {
   return false;
 }
 
-bool Accessibility::Component::IsScrollable()
+bool Accessibility::Accessible::IsProxy() const
 {
   return false;
 }
 
-bool Accessibility::Component::IsAccessibleContainingPoint(Point point, CoordinateType type)
+bool Accessibility::Component::IsScrollable() const
+{
+  return false;
+}
+
+bool Accessibility::Component::IsAccessibleContainingPoint(Point point, CoordinateType type) const
 {
   return false;
 }
index 7cc24f8..98f4830 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -31,9 +31,9 @@ namespace Dali::Graphics::GLES
 {
 class CommandPool
 {
-  static const uint32_t COMMAND_POOL_DEFAULT_INCREMENT = 1024 * 32; // 32kb banks
-  static const uint32_t MEMORY_POOL_DEFAULT_INCREMENT  = 1024;      // 4kb memory pool increment
-  static const uint32_t MEMORY_POOL_DEFAULT_ALIGNMENT  = 64;        // 64bytes alignment
+  static constexpr uint32_t COMMAND_POOL_DEFAULT_INCREMENT = 1024 * 32 / sizeof(Command); // 32kb banks
+  static const     uint32_t MEMORY_POOL_DEFAULT_INCREMENT  = 1024;                        // 1kb memory pool increment
+  static const     uint32_t MEMORY_POOL_DEFAULT_ALIGNMENT  = 64;                          // 64bytes alignment
 
   template<class T>
   struct Block
@@ -94,17 +94,25 @@ class CommandPool
 
     IndirectPtr<T> Allocate(uint32_t count)
     {
-      // set fixed capacity
-      if(fixedCapacity && data.size() != fixedCapacity)
+      // Set fixed capacity
+      if(fixedCapacity)
       {
-        data.resize(fixedCapacity);
-        totalCapacity = data.size();
+        // resize data size when capacity is not setuped.
+        // Note if totalCapacity is bigger than fixedCapacity,
+        // just skip here and resize dynamically
+        if(DALI_UNLIKELY(totalCapacity < fixedCapacity))
+        {
+          data.resize(fixedCapacity);
+          totalCapacity = data.size();
+        }
       }
 
-      // or resize dynamically
-      else if(data.size() <= offset + count)
+      // Resize dynamically
+      if(DALI_UNLIKELY(totalCapacity < offset + count))
       {
-        data.resize(data.size() + Increment);
+        // Resize the memory size as ceil((offset + count - totalCapacity)) / Increment) * Increment
+        // So the incremented size of data is always multiplied of the value Increment.
+        data.resize(data.size() + ((offset + count - totalCapacity - 1) / Increment + 1) * Increment);
 
         // update base pointer, required for address translation
         totalCapacity = data.size();
index a6daef3..ae5d9d1 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 3;
+const unsigned int ADAPTOR_MICRO_VERSION = 4;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 96079bb..ccbc20d 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.1.3
+Version:    2.1.4
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT