/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/internal/accessibility/bridge/bridge-accessible.h>
// EXTERNAL INCLUDES
+#include <dali/public-api/math/math-utils.h>
+
#include <algorithm>
#include <iostream>
// Find first with non-zero area
auto first = std::find_if(children.begin(), children.end(), [](Component* child) -> bool {
auto extents = child->GetExtents(CoordinateType::WINDOW);
- return extents.height != 0.0f && extents.width != 0.0f;
+ return !Dali::EqualsZero(extents.height) && !Dali::EqualsZero(extents.width);
});
if(first == children.end())
auto child = *it;
rect = child->GetExtents(CoordinateType::WINDOW);
- if(rect.height == 0.0f || rect.width == 0.0f)
+ if(Dali::EqualsZero(rect.height) || Dali::EqualsZero(rect.width))
{
// Zero area, ignore
continue;
return false;
}
auto extents = obj->GetExtents(CoordinateType::WINDOW);
- return extents.height == 0 || extents.width == 0;
+ return Dali::EqualsZero(extents.height) || Dali::EqualsZero(extents.width);
}
static bool IsObjectAcceptable(Component* obj)
return std::string(GET_NAVIGABLE_AT_POINT_MAX_RECURSION_DEPTH - maxRecursionDepth, ' ');
}
-
static bool IsRoleAcceptableWhenNavigatingNextPrev(Accessible* obj)
{
if(!obj)
AddFunctionToInterface(desc, "DoGesture", &BridgeAccessible::DoGesture);
AddFunctionToInterface(desc, "GetReadingMaterial", &BridgeAccessible::GetReadingMaterial);
AddFunctionToInterface(desc, "GetRelationSet", &BridgeAccessible::GetRelationSet);
+ AddFunctionToInterface(desc, "SetListenPostRender", &BridgeAccessible::SetListenPostRender);
mDbusServer.addInterface("/", desc, true);
}
auto describedByObject = findObjectByRelationType(RelationType::DESCRIBED_BY);
- double currentValue = 0.0;
- double minimumIncrement = 0.0;
- double maximumValue = 0.0;
- double minimumValue = 0.0;
- auto* valueInterface = Value::DownCast(self);
+ double currentValue = 0.0;
+ std::string currentValueText;
+ double minimumIncrement = 0.0;
+ double maximumValue = 0.0;
+ double minimumValue = 0.0;
+ auto* valueInterface = Value::DownCast(self);
if(valueInterface)
{
currentValue = valueInterface->GetCurrent();
+ currentValueText = valueInterface->GetValueText();
minimumIncrement = valueInterface->GetMinimumIncrement();
maximumValue = valueInterface->GetMaximum();
minimumValue = valueInterface->GetMinimum();
localizedRoleName,
childCount,
currentValue,
+ currentValueText,
minimumIncrement,
maximumValue,
minimumValue,
DBus::ValueOrError<Accessible*, uint32_t, std::unordered_map<std::string, std::string>> BridgeAccessible::GetDefaultLabelInfo()
{
- auto defaultLabel = GetDefaultLabel();
- if(defaultLabel == nullptr)
- {
- defaultLabel = FindSelf();
- }
+ auto* defaultLabel = GetDefaultLabel(FindSelf());
+ DALI_ASSERT_DEBUG(defaultLabel);
+
// By default, the text is taken from navigation context root's accessibility properties name and description.
return {defaultLabel, static_cast<uint32_t>(defaultLabel->GetRole()), defaultLabel->GetAttributes()};
}
return ret;
}
+
+DBus::ValueOrError<void> BridgeAccessible::SetListenPostRender(bool enabled)
+{
+ FindSelf()->SetListenPostRender(enabled);
+ return {};
+}