From: Adeel Kazmi Date: Fri, 3 Sep 2021 15:05:08 +0000 (+0100) Subject: [dali_2.0.42] Merge branch 'devel/master' X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=dc808d5569ac8dcfcccc44d885cead307ef2f84a;hp=c2385a20239ab33ff67b20e7231b73b065c9a9e9 [dali_2.0.42] Merge branch 'devel/master' Change-Id: If541fe446728867628e27a48ac1f3c4b27fceeb7 --- diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-buffer.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-buffer.cpp index 21eecf4..83b7899 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-buffer.cpp +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-buffer.cpp @@ -65,7 +65,7 @@ void TestGraphicsBuffer::Upload(uint32_t offset, uint32_t size) } else { - mGl.BufferData(GetTarget(), size, &memory[0], GL_STATIC_DRAW); //@todo Query - do we need other usages? + mGl.BufferData(GetTarget(), GLsizeiptr(size), &memory[0], GL_STATIC_DRAW); //@todo Query - do we need other usages? mCreated = true; } } diff --git a/dali/devel-api/adaptor-framework/accessibility-impl.cpp b/dali/devel-api/adaptor-framework/accessibility-impl.cpp index e7b72cb..3a96638 100644 --- a/dali/devel-api/adaptor-framework/accessibility-impl.cpp +++ b/dali/devel-api/adaptor-framework/accessibility-impl.cpp @@ -736,11 +736,13 @@ public: States state; if(mRoot) { + auto window = Dali::DevelWindow::Get(Self()); + auto visible = window.IsVisible(); state[State::ENABLED] = true; state[State::SENSITIVE] = true; - state[State::SHOWING] = true; + state[State::SHOWING] = visible; state[State::VISIBLE] = true; - state[State::ACTIVE] = true; + state[State::ACTIVE] = visible; } else { diff --git a/dali/devel-api/adaptor-framework/accessibility-impl.h b/dali/devel-api/adaptor-framework/accessibility-impl.h index 262e555..ff8933a 100644 --- a/dali/devel-api/adaptor-framework/accessibility-impl.h +++ b/dali/devel-api/adaptor-framework/accessibility-impl.h @@ -47,6 +47,7 @@ class DALI_ADAPTOR_API Value; class DALI_ADAPTOR_API Component; class DALI_ADAPTOR_API Collection; class DALI_ADAPTOR_API Action; +class DALI_ADAPTOR_API Application; /** * @brief Base class for different accessibility bridges. @@ -873,6 +874,31 @@ public: }; /** + * @brief An interface identifying the root object + * associated with a running application. + * + * @note Provides global properties describing + * application's runtime environment. + */ +class Application : public virtual Accessible +{ +public: + /** + * @brief Gets name of graphic user interface framework used by an application. + * + * @return String with name + */ + virtual std::string GetToolkitName() = 0; + + /** + * @brief Gets version of graphic user interface framework used by an application. + * + * @return String with version + */ + virtual std::string GetVersion() = 0; +}; + +/** * @brief Interface enabling advanced quering of accessibility objects. * * @note since all mathods can be implemented inside bridge, diff --git a/dali/internal/accessibility/bridge/bridge-application.cpp b/dali/internal/accessibility/bridge/bridge-application.cpp new file mode 100644 index 0000000..b892601 --- /dev/null +++ b/dali/internal/accessibility/bridge/bridge-application.cpp @@ -0,0 +1,54 @@ +/* + * 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 + +// INTERNAL INCLUDES +#include + +using namespace Dali::Accessibility; + +void BridgeApplication::RegisterInterfaces() +{ + DBus::DBusInterfaceDescription desc{AtspiDbusInterfaceApplication}; + AddGetPropertyToInterface(desc, "ToolkitName", &BridgeApplication::GetToolkitName); + AddGetPropertyToInterface(desc, "Version", &BridgeApplication::GetVersion); + dbusServer.addInterface("/", desc, true); +} + +Application* BridgeApplication::FindSelf() const +{ + auto self = BridgeBase::FindSelf(); + assert(self); + auto appInterface = dynamic_cast(self); + if(!appInterface) + { + throw std::domain_error{"object " + self->GetAddress().ToString() + " doesn't have Application interface"}; + } + return appInterface; +} + +std::string BridgeApplication::GetToolkitName() +{ + return FindSelf()->GetToolkitName(); +} + +std::string BridgeApplication::GetVersion() +{ + return FindSelf()->GetVersion(); +} diff --git a/dali/internal/accessibility/bridge/bridge-application.h b/dali/internal/accessibility/bridge/bridge-application.h new file mode 100644 index 0000000..21020b3 --- /dev/null +++ b/dali/internal/accessibility/bridge/bridge-application.h @@ -0,0 +1,53 @@ +#ifndef DALI_INTERNAL_ACCESSIBILITY_BRIDGE_APPLICATION_H +#define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_APPLICATION_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. + * + */ + +// INTERNAL INCLUDES +#include + +/* + * Implementation of org.a11y.atspi.Application interface + */ + +class BridgeApplication : public virtual BridgeBase +{ +protected: + BridgeApplication() = default; + + void RegisterInterfaces(); + + Dali::Accessibility::Application* FindSelf() const; + +public: + /** + * @brief Gets name of graphic user interface framework used by an application. + * + * @return String with name + */ + std::string GetToolkitName(); + + /** + * @brief Gets version of graphic user interface framework used by an application. + * + * @return String with version + */ + std::string GetVersion(); +}; + +#endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_APPLICATION_H diff --git a/dali/internal/accessibility/bridge/bridge-base.h b/dali/internal/accessibility/bridge/bridge-base.h index fa46045..0396539 100644 --- a/dali/internal/accessibility/bridge/bridge-base.h +++ b/dali/internal/accessibility/bridge/bridge-base.h @@ -19,13 +19,14 @@ */ // EXTERNAL INCLUDES +#include #include #include // INTERNAL INCLUDES #include -class AppAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection +class AppAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection, public virtual Dali::Accessibility::Application { public: Dali::Accessibility::EmptyAccessibleWithAddress parent; @@ -99,6 +100,16 @@ public: { return {"", "root"}; } + + std::string GetToolkitName() override + { + return {"dali"}; + } + + std::string GetVersion() override + { + return std::to_string(Dali::ADAPTOR_MAJOR_VERSION) + "." + std::to_string(Dali::ADAPTOR_MINOR_VERSION); + } }; enum class FilteredEvents diff --git a/dali/internal/accessibility/bridge/bridge-impl.cpp b/dali/internal/accessibility/bridge/bridge-impl.cpp index 11c580e..b424b6a 100644 --- a/dali/internal/accessibility/bridge/bridge-impl.cpp +++ b/dali/internal/accessibility/bridge/bridge-impl.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +52,8 @@ class BridgeImpl : public virtual BridgeBase, public BridgeValue, public BridgeText, public BridgeEditableText, - public BridgeSelection + public BridgeSelection, + public BridgeApplication { DBus::DBusClient listenOnAtspiEnabledSignalClient; DBus::DBusClient registryClient, directReadingClient; @@ -245,6 +247,7 @@ public: BridgeText::RegisterInterfaces(); BridgeEditableText::RegisterInterfaces(); BridgeSelection::RegisterInterfaces(); + BridgeApplication::RegisterInterfaces(); RegisterOnBridge(&application); diff --git a/dali/internal/accessibility/file.list b/dali/internal/accessibility/file.list index e62ef56..efa4476 100755 --- a/dali/internal/accessibility/file.list +++ b/dali/internal/accessibility/file.list @@ -51,6 +51,7 @@ SET( adaptor_accessibility_atspi_bridge_src_files ${adaptor_accessibility_dir}/bridge/accessible.cpp ${adaptor_accessibility_dir}/bridge/bridge-accessible.cpp ${adaptor_accessibility_dir}/bridge/bridge-action.cpp + ${adaptor_accessibility_dir}/bridge/bridge-application.cpp ${adaptor_accessibility_dir}/bridge/bridge-base.cpp ${adaptor_accessibility_dir}/bridge/bridge-collection.cpp ${adaptor_accessibility_dir}/bridge/bridge-component.cpp diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index fabadaf..c00add5 100644 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -336,6 +336,7 @@ void Adaptor::AccessibilityObserver::OnAccessibleKeyEvent(const Dali::KeyEvent& Adaptor::~Adaptor() { + Accessibility::Bridge::GetCurrentBridge()->ApplicationHidden(); Accessibility::Bridge::GetCurrentBridge()->Terminate(); // Ensure stop status diff --git a/dali/internal/adaptor/common/application-impl.cpp b/dali/internal/adaptor/common/application-impl.cpp index 69e4b4c..fadfc0c 100644 --- a/dali/internal/adaptor/common/application-impl.cpp +++ b/dali/internal/adaptor/common/application-impl.cpp @@ -238,6 +238,7 @@ void Application::Quit() void Application::QuitFromMainLoop() { + Accessibility::Bridge::GetCurrentBridge()->ApplicationHidden(); Accessibility::Bridge::GetCurrentBridge()->Terminate(); mAdaptor->Stop(); diff --git a/dali/internal/graphics/gles-impl/gles-graphics-buffer.cpp b/dali/internal/graphics/gles-impl/gles-graphics-buffer.cpp index b8dafab..ed72c22 100644 --- a/dali/internal/graphics/gles-impl/gles-graphics-buffer.cpp +++ b/dali/internal/graphics/gles-impl/gles-graphics-buffer.cpp @@ -92,7 +92,7 @@ void Buffer::InitializeGPUBuffer() gl->GenBuffers(1, &mBufferId); context->BindBuffer(GL_ARRAY_BUFFER, mBufferId); - gl->BufferData(GL_ARRAY_BUFFER, mCreateInfo.size, nullptr, GL_STATIC_DRAW); + gl->BufferData(GL_ARRAY_BUFFER, GLsizeiptr(mCreateInfo.size), nullptr, GL_STATIC_DRAW); } void Buffer::DestroyResource() @@ -169,4 +169,4 @@ void Buffer::Bind(Graphics::BufferUsage bindingTarget) const } } -} // namespace Dali::Graphics::GLES \ No newline at end of file +} // namespace Dali::Graphics::GLES diff --git a/dali/internal/graphics/gles-impl/gles2-graphics-memory.cpp b/dali/internal/graphics/gles-impl/gles2-graphics-memory.cpp index 4c2e45c..f4505d9 100644 --- a/dali/internal/graphics/gles-impl/gles2-graphics-memory.cpp +++ b/dali/internal/graphics/gles-impl/gles2-graphics-memory.cpp @@ -83,7 +83,7 @@ void Memory2::Unlock(bool flush) if(!buffer->IsCPUAllocated()) { buffer->Bind(BufferUsage::VERTEX_BUFFER); - gl->BufferSubData(GL_ARRAY_BUFFER, mMapBufferInfo.offset, mMapBufferInfo.size, mMappedPointer); + gl->BufferSubData(GL_ARRAY_BUFFER, mMapBufferInfo.offset, GLsizeiptr(mMapBufferInfo.size), mMappedPointer); } } @@ -104,4 +104,4 @@ void Memory2::Flush() // TODO: } -} // namespace Dali::Graphics::GLES \ No newline at end of file +} // namespace Dali::Graphics::GLES diff --git a/dali/internal/graphics/gles-impl/gles3-graphics-memory.cpp b/dali/internal/graphics/gles-impl/gles3-graphics-memory.cpp index 8b3908d..c2864c1 100644 --- a/dali/internal/graphics/gles-impl/gles3-graphics-memory.cpp +++ b/dali/internal/graphics/gles-impl/gles3-graphics-memory.cpp @@ -65,7 +65,7 @@ void* Memory3::LockRegion(uint32_t offset, uint32_t size) // @TODO: trashing vertex binding, better find target that is rarely used buffer->Bind(Graphics::BufferUsage::VERTEX_BUFFER); void* ptr = nullptr; - ptr = gl->MapBufferRange(GL_ARRAY_BUFFER, mMapBufferInfo.offset, mMapBufferInfo.size, GL_MAP_WRITE_BIT); + ptr = gl->MapBufferRange(GL_ARRAY_BUFFER, mMapBufferInfo.offset, GLsizeiptr(mMapBufferInfo.size), GL_MAP_WRITE_BIT); mMappedPointer = ptr; } return mMappedPointer; @@ -101,4 +101,4 @@ void Memory3::Flush() // TODO: } -} // namespace Dali::Graphics::GLES \ No newline at end of file +} // namespace Dali::Graphics::GLES diff --git a/dali/public-api/dali-adaptor-version.cpp b/dali/public-api/dali-adaptor-version.cpp index deadd9f..d918699 100644 --- a/dali/public-api/dali-adaptor-version.cpp +++ b/dali/public-api/dali-adaptor-version.cpp @@ -27,7 +27,7 @@ namespace Dali { const unsigned int ADAPTOR_MAJOR_VERSION = 2; const unsigned int ADAPTOR_MINOR_VERSION = 0; -const unsigned int ADAPTOR_MICRO_VERSION = 41; +const unsigned int ADAPTOR_MICRO_VERSION = 42; const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index cfd6693..37b9210 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -17,7 +17,7 @@ Name: dali2-adaptor Summary: The DALi Tizen Adaptor -Version: 2.0.41 +Version: 2.0.42 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT