my $percent = 0;
if($total_exec > 0) { $percent = 100 * $total_covered_lines / $total_exec; }
- return [ $total_exec, $percent ];
+ return [ $total_exec, $percent, $total_covered_lines ];
}
#
print RESET;
}
+printf("Line Coverage: %d/%d\n", $percentref->[2], $percentref->[0]);
printf("Percentage of change covered: %5.2f%\n", $percent);
exit($percent<90);
return true;
}
+bool TestGlAbstraction::IsAdvancedBlendEquationSupported()
+{
+ return true;
+}
+
+bool TestGlAbstraction::IsBlendEquationSupported(DevelBlendEquation::Type blendEquation)
+{
+ return true;
+}
+
+std::string TestGlAbstraction::GetShaderVersionPrefix()
+{
+ return std::string("");
+}
+
+std::string TestGlAbstraction::GetVertexShaderPrefix()
+{
+ return std::string("");
+}
+
+std::string TestGlAbstraction::GetFragmentShaderPrefix()
+{
+ return std::string("");
+}
+
bool TestGlAbstraction::TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const
{
return ((imageGlFormat == GL_RGB) && (textureGlFormat == GL_RGBA));
bool IsSurfacelessContextSupported() const override;
+ bool IsAdvancedBlendEquationSupported() override;
+
+ bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation) override;
+
+ std::string GetShaderVersionPrefix();
+
+ std::string GetVertexShaderPrefix();
+
+ std::string GetFragmentShaderPrefix();
+
bool TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const override;
/* OpenGL ES 2.0 */
{
}
+ inline void BlendBarrier(void)
+ {
+ }
+
private:
inline void AddUniformCallToTraceStack(GLint location, std::string& value)
{
#include <sys/types.h>
#include <sys/wait.h>
#include <testcase.h>
+
+#include <time.h>
#include <unistd.h>
+#include <chrono>
#include <cstring>
#include <map>
#include <vector>
{
typedef std::map<int32_t, TestCase> RunningTestCases;
+const double MAXIMUM_CHILD_LIFETIME(60.0f); // 1 minute
+
const char* basename(const char* path)
{
const char* ptr = path;
else // Parent process
{
TestCase tc(nextTestCase, tc_array[nextTestCase].name);
+ tc.startTime = std::chrono::steady_clock::now();
+
children[pid] = tc;
nextTestCase++;
numRunningChildren++;
}
}
- // Wait for the next child to finish
-
+ // Check to see if any children have finished yet
int32_t status = 0;
- int32_t childPid = waitpid(-1, &status, 0);
- if(childPid == -1)
+ int32_t childPid = waitpid(-1, &status, WNOHANG);
+ if(childPid == 0)
+ {
+ // No children have finished.
+ // Check if any have exceeded execution time
+ auto endTime = std::chrono::steady_clock::now();
+
+ for(auto& tc : children)
+ {
+ std::chrono::steady_clock::duration timeSpan = endTime - tc.second.startTime;
+ std::chrono::duration<double> seconds = std::chrono::duration_cast<std::chrono::duration<double>>(timeSpan);
+ if(seconds.count() > MAXIMUM_CHILD_LIFETIME)
+ {
+ // Kill the child process. A subsequent call to waitpid will process signal result below.
+ kill(tc.first, SIGKILL);
+ }
+ }
+ }
+ else if(childPid == -1) // waitpid errored
{
perror("waitpid");
exit(EXIT_STATUS_WAITPID_FAILED);
}
-
- if(WIFEXITED(status))
+ else // a child has finished
{
- if(childPid > 0)
+ if(WIFEXITED(status))
{
int32_t testResult = WEXITSTATUS(status);
if(testResult)
}
numRunningChildren--;
}
- }
-
- else if(WIFSIGNALED(status) || WIFSTOPPED(status))
- {
- status = WIFSIGNALED(status) ? WTERMSIG(status) : WSTOPSIG(status);
- if(childPid > 0)
+ else if(WIFSIGNALED(status) || WIFSTOPPED(status))
{
+ status = WIFSIGNALED(status) ? WTERMSIG(status) : WSTOPSIG(status);
+
RunningTestCases::iterator iter = children.find(childPid);
if(iter != children.end())
{
#include <stdio.h>
#include <testcase.h>
+#include <chrono>
#include <cstdint>
namespace TestHarness
struct TestCase
{
- int32_t testCase;
- const char* testCaseName;
+ int32_t testCase;
+ const char* testCaseName;
+ std::chrono::steady_clock::time_point startTime;
TestCase()
: testCase(0),
- testCaseName(NULL)
+ testCaseName(NULL),
+ startTime()
{
}
TestCase(int32_t tc, const char* name)
: testCase(tc),
- testCaseName(name)
+ testCaseName(name),
+ startTime()
{
}
TestCase(const TestCase& rhs)
: testCase(rhs.testCase),
- testCaseName(rhs.testCaseName)
+ testCaseName(rhs.testCaseName),
+ startTime(rhs.startTime)
{
}
TestCase& operator=(const TestCase& rhs)
{
testCase = rhs.testCase;
testCaseName = rhs.testCaseName;
+ startTime = rhs.startTime;
return *this;
}
};
try
{
- Dali::Vector< Dali::GlWindow::GlWindowOrientation> orientations;
- orientations.PushBack( Dali::GlWindow::GlWindowOrientation::PORTRAIT );
- orientations.PushBack( Dali::GlWindow::GlWindowOrientation::LANDSCAPE );
- orientations.PushBack( Dali::GlWindow::GlWindowOrientation::PORTRAIT_INVERSE );
- orientations.PushBack( Dali::GlWindow::GlWindowOrientation::LANDSCAPE_INVERSE );
- orientations.PushBack( Dali::GlWindow::GlWindowOrientation::NO_ORIENTATION_PREFERENCE );
- orientations.PushBack( Dali::GlWindow::GlWindowOrientation::PORTRAIT );
- orientations.PushBack( Dali::GlWindow::GlWindowOrientation::LANDSCAPE );
- orientations.PushBack( Dali::GlWindow::GlWindowOrientation::PORTRAIT_INVERSE );
+ Dali::Vector< Dali::WindowOrientation> orientations;
+ orientations.PushBack( Dali::WindowOrientation::PORTRAIT );
+ orientations.PushBack( Dali::WindowOrientation::LANDSCAPE );
+ orientations.PushBack( Dali::WindowOrientation::PORTRAIT_INVERSE );
+ orientations.PushBack( Dali::WindowOrientation::LANDSCAPE_INVERSE );
+ orientations.PushBack( Dali::WindowOrientation::NO_ORIENTATION_PREFERENCE );
+ orientations.PushBack( Dali::WindowOrientation::PORTRAIT );
+ orientations.PushBack( Dali::WindowOrientation::LANDSCAPE );
+ orientations.PushBack( Dali::WindowOrientation::PORTRAIT_INVERSE );
window.SetAvailableOrientations(orientations);
DALI_TEST_CHECK( false );
try
{
- window.SetPreferredOrientation(Dali::GlWindow::GlWindowOrientation::PORTRAIT);
+ window.SetPreferredOrientation(Dali::WindowOrientation::PORTRAIT);
DALI_TEST_CHECK( false );
}
try
{
- window.SetPreferredOrientation(Dali::GlWindow::GlWindowOrientation::NO_ORIENTATION_PREFERENCE);
+ window.SetPreferredOrientation(Dali::WindowOrientation::NO_ORIENTATION_PREFERENCE);
DALI_TEST_CHECK( false );
}
try
{
- Dali::GlWindow::GlWindowOrientation orientation = window.GetCurrentOrientation();
- DALI_TEST_CHECK( orientation == Dali::GlWindow::GlWindowOrientation::PORTRAIT );
+ Dali::WindowOrientation orientation = window.GetCurrentOrientation();
+ DALI_TEST_CHECK( orientation == Dali::WindowOrientation::PORTRAIT );
DALI_TEST_CHECK( false );
}
}
// Internal callback function
-void glInit()
+void glInit(void)
{
}
-void glRenderFrame()
+int glRenderFrame(void)
{
+ static unsigned int retFlag = 0;
+ return retFlag++;
}
-void glTerminate()
+void glTerminate(void)
{
}
try
{
- window.RegisterGlCallback( glInit, glRenderFrame, glTerminate );
+ window.RegisterGlCallback( Dali::MakeCallback( glInit ), Dali::MakeCallback( glRenderFrame ), Dali::MakeCallback( glTerminate ) );
DALI_TEST_CHECK( false );
}
try
{
- window.RegisterGlCallback( glInit, glRenderFrame, glTerminate );
+ window.RegisterGlCallback( Dali::MakeCallback( glInit ), Dali::MakeCallback( glRenderFrame ), Dali::MakeCallback( glTerminate ) );
window.RenderOnce();
DALI_TEST_CHECK( false );
Dali::Window window;
try
{
- window.AddAvailableOrientation(Dali::Window::PORTRAIT);
+ window.AddAvailableOrientation(Dali::WindowOrientation::PORTRAIT);
DALI_TEST_CHECK(false); // Should not reach here!
}
catch(...)
Dali::Window window;
try
{
- window.RemoveAvailableOrientation(Dali::Window::PORTRAIT);
+ window.RemoveAvailableOrientation(Dali::WindowOrientation::PORTRAIT);
DALI_TEST_CHECK(false); // Should not reach here!
}
catch(...)
Dali::Window window;
try
{
- window.SetPreferredOrientation(Dali::Window::PORTRAIT);
+ window.SetPreferredOrientation(Dali::WindowOrientation::PORTRAIT);
DALI_TEST_CHECK(false); // Should not reach here!
}
catch(...)
Dali::Window window;
try
{
- Dali::Window::WindowOrientation orientation = window.GetPreferredOrientation();
- DALI_TEST_CHECK(orientation == Dali::Window::PORTRAIT); // Should not reach here!
+ Dali::WindowOrientation orientation = window.GetPreferredOrientation();
+ DALI_TEST_CHECK(orientation == Dali::WindowOrientation::PORTRAIT); // Should not reach here!
}
catch(...)
{
OPTION(ENABLE_PKG_CONFIGURE "Use pkgconfig" ON)
OPTION(ENABLE_LINK_TEST "Enable the link test" ON)
+OPTION(ENABLE_ATSPI "Enable AT-SPI accessibility" ON)
# Include additional macros
INCLUDE( common.cmake )
INCLUDE( deps-check.cmake )
ENDIF()
+IF( NOT DALI_ELDBUS_AVAILABLE )
+ SET( ENABLE_ATSPI OFF )
+ENDIF()
+
# Set up compiler flags and warnings
IF( UNIX )
ADD_COMPILE_OPTIONS( -Wall ${DALI_CFLAGS} )# -Wextra -Wno-unused-parameter )# -Wfloat-equal )
# Include profile specific setup
INCLUDE( profiles/${PROFILE_LCASE}-profile.cmake )
+IF ( ENABLE_ATSPI )
+ SET( SOURCES ${SOURCES} ${adaptor_accessibility_atspi_bridge_src_files} )
+ELSE()
+ SET( SOURCES ${SOURCES} ${adaptor_accessibility_atspi_dummy_src_files} )
+ENDIF()
+
IF( ENABLE_PKG_CONFIGURE )
# Configure the pkg-config file
# Requires the following variables to be setup:
MESSAGE( STATUS "Profile: ${ENABLE_PROFILE}")
MESSAGE( STATUS "Data Dir (Read/Write): ${dataReadWriteDir}")
MESSAGE( STATUS "Data Dir (Read Only): ${dataReadOnlyDir}")
-MESSAGE( STATUS "EldBus: ${eldbus_available_ENABLED}")
MESSAGE( STATUS "WebP: ${webp_available_ENABLED}")
MESSAGE( STATUS "Shader Binary Cache: ${ENABLE_SHADERBINCACHE}")
MESSAGE( STATUS "Network logging enabled: ${ENABLE_NETWORKLOGGING}")
MESSAGE( STATUS "Using Tizen APP FW libraries: ${ENABLE_APPFW}")
MESSAGE( STATUS "Use pkg configure: ${ENABLE_PKG_CONFIGURE}" )
MESSAGE( STATUS "Enable link test: ${ENABLE_LINK_TEST}" )
+MESSAGE( STATUS "Enable AT-SPI: ${ENABLE_ATSPI}" )
MESSAGE( STATUS "Tizen Platform Config supported ${TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG}")
MESSAGE( STATUS "Compile flags: ${CMAKE_CXX_FLAGS}")
MESSAGE( STATUS "Compile flags: ${CMAKE_C_FLAGS}")
SET( FREETYPE_BITMAP_SUPPORT_VERSION 17.1.11 )
ENDIF()
+SET( ELDBUS_REQUIRED 1.16.0 )
+
# checking all possibly used modules (required and optionals)
CHECK_MODULE_AND_SET( EXIF exif exif_available )
CHECK_MODULE_AND_SET( FREETYPE freetype2>=${FREETYPE_REQUIRED} freetype_available )
CHECK_MODULE_AND_SET( ECORE ecore [] )
CHECK_MODULE_AND_SET( ECORE_IPC ecore-ipc [] )
CHECK_MODULE_AND_SET( ECORE_IMF ecore-imf [] )
-CHECK_MODULE_AND_SET( ELDBUS eldbus eldbus_available )
+CHECK_MODULE_AND_SET( ELDBUS eldbus>=${ELDBUS_REQUIRED} eldbus_available )
+CHECK_MODULE_AND_SET( TPKP_CURL tpkp-curl tpkp_curl_available )
CHECK_MODULE_AND_SET( UTILX utilX utilx_available )
CHECK_MODULE_AND_SET( OPENGLES20 glesv2 [] )
CHECK_MODULE_AND_SET( EGL egl [] )
+++ /dev/null
-#ifndef DALI_ACCESSIBILITY_ACTION_HANDLER_H
-#define DALI_ACCESSIBILITY_ACTION_HANDLER_H
-
-/*
- * Copyright (c) 2020 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/dali-adaptor-common.h>
-#include <dali/public-api/events/touch-event.h>
-
-namespace Dali
-{
-/**
- * AccessibilityActionHandler is an abstract interface, used by Dali to handle accessibility actions
- * passed by the accessibility manager.
- */
-class AccessibilityActionHandler
-{
-public:
- /**
- * Change the accessibility status when Accessibility feature(screen-reader) turned on or off.
- * @return whether the status is changed or not.
- */
- virtual bool ChangeAccessibilityStatus() = 0;
-
- /**
- * Clear the accessibility focus from the current focused actor.
- * @return whether the focus is cleared or not.
- */
- virtual bool ClearAccessibilityFocus() = 0;
-
- /**
- * Perform the accessibility action associated with a scroll event.
- * @param touch The touch point (and time) of the event.
- * @return whether the focus is cleared or not.
- */
- virtual bool AccessibilityActionScroll(Dali::TouchEvent& touch) = 0;
-
- /**
- * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPrevious(bool allowEndFeedback) = 0;
-
- /**
- * Perform the accessibility action to move focus to the next focusable actor (by one finger flick down).
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionNext(bool allowEndFeedback) = 0;
-
- /**
- * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick left).
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadPrevious(bool allowEndFeedback) = 0;
-
- /**
- * Perform the accessibility action to move focus to the next focusable actor (by one finger flick right).
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadNext(bool allowEndFeedback) = 0;
-
- /**
- * Perform the accessibility action to focus and read the actor (by one finger tap or move).
- * @param allowReadAgain true if the action read again the same object (i.e. read action)
- * false if the action just read when the focus object is changed (i.e. over action)
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionRead(bool allowReadAgain) = 0;
-
- /**
- * Perform the accessibility action to activate the current focused actor (by one finger double tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionActivate() = 0;
-
- /**
- * Perform the accessibility action to change the value when the current focused actor is a slider
- * (by double finger down and move up and right).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionUp() = 0;
-
- /**
- * Perform the accessibility action to change the value when the current focused actor is a slider
- * (by double finger down and move down and left).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionDown() = 0;
-
- /**
- * Perform the accessibility action to navigate back (by two fingers circle draw).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionBack() = 0;
-
- /**
- * Perform the accessibility action to scroll up the list and focus on the first item on the list
- * after the scrolling and read the item (by two finger swipe up).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionScrollUp() = 0;
-
- /**
- * Perform the accessibility action to scroll down the list and focus on the first item on the list
- * after the scrolling and read the item (by two finger swipe down).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionScrollDown() = 0;
-
- /**
- * Perform the accessibility action to scroll left to the previous page (by two finger swipe left).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPageLeft() = 0;
-
- /**
- * Perform the accessibility action to scroll right to the next page (by two finger swipe right).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPageRight() = 0;
-
- /**
- * Perform the accessibility action to scroll up to the previous page (by one finger swipe left and right).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPageUp() = 0;
-
- /**
- * Perform the accessibility action to scroll down to the next page (by one finger swipe right and left).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPageDown() = 0;
-
- /**
- * Perform the accessibility action to move the focus to the first item on the screen
- * (by one finger swipe up and down).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionMoveToFirst() = 0;
-
- /**
- * Perform the accessibility action to move the focus to the last item on the screen
- * (by one finger swipe down and up).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionMoveToLast() = 0;
-
- /**
- * Perform the accessibility action to move the focus to the first item on the top
- * and read from the top item continuously (by three fingers single tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadFromTop() = 0;
-
- /**
- * Perform the accessibility action to move the focus to and read from the next item
- * continuously (by three fingers double tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadFromNext() = 0;
-
- /**
- * Perform the accessibility action to move the focus to do the zooming (by one finger triple tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionZoom() = 0;
-
- /**
- * Perform the accessibility action to pause/resume the current read out (by two fingers single tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadPauseResume() = 0;
-
- /**
- * Perform the accessibility action to start/stop the current action (by two fingers double tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionStartStop() = 0;
-
-}; // class AccessibilityActionHandler
-
-} // namespace Dali
-
-#endif // DALI_ACCESSIBILITY_ACTION_HANDLER_H
+++ /dev/null
-/*
- * Copyright (c) 2020 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/accessibility-adaptor.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-namespace Dali
-{
-AccessibilityAdaptor::AccessibilityAdaptor()
-{
-}
-
-AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- return Internal::Adaptor::AccessibilityAdaptor::Get();
-}
-
-AccessibilityAdaptor::~AccessibilityAdaptor()
-{
-}
-
-Vector2 AccessibilityAdaptor::GetReadPosition() const
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).GetReadPosition();
-}
-
-bool AccessibilityAdaptor::IsEnabled() const
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).IsEnabled();
-}
-
-void AccessibilityAdaptor::SetActionHandler(AccessibilityActionHandler& handler)
-{
- Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetActionHandler(handler);
-}
-
-void AccessibilityAdaptor::SetGestureHandler(AccessibilityGestureHandler& handler)
-{
- Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetGestureHandler(handler);
-}
-
-bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionNextEvent(allowEndFeedback);
-}
-
-bool AccessibilityAdaptor::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPreviousEvent(allowEndFeedback);
-}
-
-bool AccessibilityAdaptor::HandleActionActivateEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionActivateEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadEvent(x, y, allowReadAgain);
-}
-
-bool AccessibilityAdaptor::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadNextEvent(allowEndFeedback);
-}
-
-bool AccessibilityAdaptor::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadPreviousEvent(allowEndFeedback);
-}
-
-bool AccessibilityAdaptor::HandleActionUpEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionUpEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionDownEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionDownEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionClearFocusEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionClearFocusEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionScrollEvent(point, timeStamp);
-}
-
-bool AccessibilityAdaptor::HandleActionBackEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionBackEvent();
-}
-
-void AccessibilityAdaptor::HandleActionEnableEvent()
-{
- Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionEnableEvent();
-}
-
-void AccessibilityAdaptor::HandleActionDisableEvent()
-{
- Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionDisableEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionScrollUpEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionScrollUpEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionScrollDownEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionScrollDownEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionPageLeftEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPageLeftEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionPageRightEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPageRightEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionPageUpEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPageUpEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionPageDownEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPageDownEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionMoveToFirstEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionMoveToFirstEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionMoveToLastEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionMoveToLastEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionReadFromTopEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadFromTopEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionReadFromNextEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadFromNextEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionZoomEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionZoomEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionReadPauseResumeEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadPauseResumeEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionStartStopEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionStartStopEvent();
-}
-
-AccessibilityAdaptor::AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor& manager)
-: BaseHandle(&manager)
-{
-}
-
-AccessibilityAdaptor::AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor* manager)
-: BaseHandle(manager)
-{
-}
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_ACCESSIBILITY_ADAPTOR_H
-#define DALI_ACCESSIBILITY_ADAPTOR_H
-
-/*
- * Copyright (c) 2020 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/devel-api/events/touch-point.h>
-#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/public-api/object/base-handle.h>
-
-namespace Dali
-{
-namespace Internal DALI_INTERNAL
-{
-namespace Adaptor
-{
-class AccessibilityAdaptor;
-}
-} // namespace DALI_INTERNAL
-
-class AccessibilityActionHandler;
-class AccessibilityGestureHandler;
-struct TouchPoint;
-
-/**
- * @brief The AccessibilityAdaptor provides communication to the accessibility manager interface (implemented in toolkit).
- *
- */
-class DALI_ADAPTOR_API AccessibilityAdaptor : public BaseHandle
-{
-public:
- /**
- * @brief Create an uninitialized handle.
- *
- * This can be initialized by calling getting the adaptor from Dali::Adaptor.
- */
- AccessibilityAdaptor();
-
- /**
- * @brief Retrieve a handle to the AccessibilityAdaptor.
- *
- * @return A handle to the AccessibilityAdaptor.
- */
- static AccessibilityAdaptor Get();
-
- /**
- * @brief Destructor
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- */
- ~AccessibilityAdaptor();
-
- /**
- * @brief Returns the current position of the read action.
- * @return The current event position.
- */
- Vector2 GetReadPosition() const;
-
- /**
- * @brief Query whether the accessibility(screen-reader) is enabled.
- *
- * The accessibility will be enabled by system setting.
- * @return True if the accessibility(screen-reader) is enabled.
- */
- bool IsEnabled() const;
-
- /**
- * @brief Set the handler to handle accessibility actions.
- *
- * @param[in] handler The Accessibility action handler.
- * @note Handlers should remove themselves when they are destroyed.
- */
- void SetActionHandler(AccessibilityActionHandler& handler);
-
- /**
- * @brief Set the handler to handle accessibility gestures.
- *
- * @param[in] handler The Accessibility gesture handler.
- * @note Handlers should remove themselves when they are destroyed.
- */
- void SetGestureHandler(AccessibilityGestureHandler& handler);
-
- /**
- * @brief Handle the accessibility action to move focus to the next focusable actor
- * (by one finger flick down).
- *
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionNextEvent(bool allowEndFeedback = true);
-
- /**
- * @brief Handle the accessibility action to move focus to the previous focusable actor
- * (by one finger flick up).
- *
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPreviousEvent(bool allowEndFeedback = true);
-
- /**
- * @brief Handle the accessibility action to activate the current focused actor (by one
- * finger )
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionActivateEvent();
-
- /**
- * @brief Handle the accessibility action to focus and read the actor (by one finger tap or move).
- *
- * @param x x position of event
- * @param y y position of event
- * @param allowReadAgain true if the action read again the same object (i.e. read action)
- * false if the action just read when the focus object is changed (i.e. over action)
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain);
-
- /**
- * @brief Handle the accessibility action to move focus to the next focusable actor
- * (by one finger flick right).
- *
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadNextEvent(bool allowEndFeedback = true);
-
- /**
- * @brief Handle the accessibility action to move focus to the previous focusable actor
- * (by one finger flick up).
- *
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the front
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadPreviousEvent(bool allowEndFeedback = true);
-
- /**
- * @brief Handle the accessibility action to change the value when the current focused
- * actor is a slider (by double finger down and move up and right).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionUpEvent();
-
- /**
- * @brief Handle the accessibility action to change the value when the current focused
- * actor is a slider (by double finger down and move down and left).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionDownEvent();
-
- /**
- * @brief Handle the accessibility action to clear the focus from the current focused
- * actor if any, so that no actor is focused in the focus chain.
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionClearFocusEvent();
-
- /**
- * @brief Handle the accessibility action to scroll when there is a scroller on the touched position
- * (by 2 finger touch & move, 2 finger flick).
- *
- * @param[in] point The touch point information.
- * @param[in] timeStamp The time the touch occurred.
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp);
-
- /**
- * @brief Handle the accessibility action to navigate back (by two fingers circle draw).
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionBackEvent();
-
- /**
- * @brief Handle the accessibility action to enable the feature.
- */
- void HandleActionEnableEvent();
-
- /**
- * @brief Handle the accessibility action to disable the feature.
- */
- void HandleActionDisableEvent();
-
- /**
- * @brief Handle the accessibility action to scroll up the list and focus on
- * the first item on the list after the scrolling and read the item
- * (by two finger swipe up).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionScrollUpEvent();
-
- /**
- * @brief Handle the accessibility action to scroll down the list and focus on
- * the first item on the list after the scrolling and read the item
- * (by two finger swipe down).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionScrollDownEvent();
-
- /**
- * @brief Handle the accessibility action to scroll left to the previous page
- * (by two finger swipe left).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPageLeftEvent();
-
- /**
- * @brief Handle the accessibility action to scroll right to the next page
- * (by two finger swipe right).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPageRightEvent();
-
- /**
- * @brief Handle the accessibility action to scroll up to the previous page
- * (by one finger swipe left and right).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPageUpEvent();
-
- /**
- * @brief Handle the accessibility action to scroll down to the next page
- * (by one finger swipe right and left).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPageDownEvent();
-
- /**
- * @brief Handle the accessibility action to move the focus to the first item on the screen
- * (by one finger swipe up and down).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionMoveToFirstEvent();
-
- /**
- * @brief Handle the accessibility action to move the focus to the last item on the screen
- * (by one finger swipe down and up).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionMoveToLastEvent();
-
- /**
- * @brief Handle the accessibility action to move the focus to the first item on the top
- * and read from the top item continuously (by three fingers single tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadFromTopEvent();
-
- /**
- * @brief Handle the accessibility action to move focus to and read from the next focusable
- * actor continuously (by three fingers double tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadFromNextEvent();
-
- /**
- * @brief Handle the accessibility action to do the zooming
- * (by one finger triple tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionZoomEvent();
-
- /**
- * @brief Handle the accessibility action to pause/resume the current speech
- * (by two fingers single tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadPauseResumeEvent();
-
- /**
- * @brief Handle the accessibility action to start/stop the current action
- * (by two fingers double tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionStartStopEvent();
-
-public: // Not intended for application developers
- /**
- * @brief Creates a handle using the Adaptor::Internal implementation.
- *
- * @param[in] adaptor The AccessibilityAdaptor implementation.
- */
- DALI_INTERNAL AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor& adaptor);
-
- /**
- * @brief This constructor is used by AccessibilityAdaptor::Get().
- *
- * @param[in] adaptor A pointer to the accessibility adaptor.
- */
- explicit DALI_INTERNAL AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor* adaptor);
-};
-
-} // namespace Dali
-
-#endif // DALI_ACCESSIBILITY_ADAPTOR_H
+++ /dev/null
-#ifndef DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
-#define DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
-
-/*
- * Copyright (c) 2020 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 <dali/public-api/events/gesture.h>
-#include <dali/public-api/math/vector2.h>
-
-namespace Dali
-{
-struct AccessibilityGestureEvent
-{
- // Construction & Destruction
-
- /**
- * Virtual destructor
- */
- ~AccessibilityGestureEvent()
- {
- }
-
- // Data
-
- /**
- * The previous touch position of the primary touch point in screen coordinates.
- */
- Vector2 previousPosition;
-
- /**
- * This current touch position of the primary touch point in screen coordinates.
- */
- Vector2 currentPosition;
-
- /**
- * The time difference between the previous and latest touch motion events (in ms).
- */
- unsigned long timeDelta;
-
- /**
- * The total number of fingers touching the screen in a pan gesture.
- */
- unsigned int numberOfTouches;
-
- enum State
- {
- CLEAR, ///< There is no state associated with this gesture. @SINCE_1_9.28
- STARTED, ///< The touched points on the screen have moved enough to be considered a gesture. @SINCE_1_9.28
- CONTINUING, ///< The gesture is continuing. @SINCE_1_9.28
- FINISHED, ///< The user has lifted a finger or touched an additional point on the screen. @SINCE_1_9.28
- CANCELLED, ///< The gesture has been cancelled. @SINCE_1_9.28
- POSSIBLE ///< A gesture is possible. @SINCE_1_9.28
- };
-
- State state;
-
- uint32_t time;
-
- /**
- * Default Constructor
- * @param[in] state The state of the gesture
- */
- AccessibilityGestureEvent(AccessibilityGestureEvent::State state)
- : timeDelta(0),
- numberOfTouches(0),
- state(state),
- time(0)
- {
- }
-};
-
-} // namespace Dali
-
-#endif // DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
+++ /dev/null
-#ifndef DALI_ACCESSIBILITY_GESTURE_HANDLER_H
-#define DALI_ACCESSIBILITY_GESTURE_HANDLER_H
-
-/*
- * Copyright (c) 2020 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/devel-api/adaptor-framework/accessibility-gesture-event.h>
-
-namespace Dali
-{
-/**
- * AccessibilityGestureHandler is an interface used by Dali to handle accessibility gestures
- * passed by the accessibility manager.
- */
-class AccessibilityGestureHandler
-{
-public:
- /**
- * Handle the accessibility pan gesture.
- * @param[in] panEvent The pan event to be handled.
- * @return whether the gesture is handled successfully or not.
- */
- virtual bool HandlePanGesture(const AccessibilityGestureEvent& panEvent) = 0;
-
-}; // class AccessibilityGestureHandler
-
-} // namespace Dali
-
-#endif // DALI_ACCESSIBILITY_GESTURE_HANDLER_H
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
using namespace Dali::Accessibility;
{
return false;
}
- int GetHighlightIndex() override
- {
- return 0;
- }
bool IsScrollable() override
{
return false;
States s;
if( root )
{
- s[State::HIGHLIGHTABLE] = true;
s[State::ENABLED] = true;
s[State::SENSITIVE] = true;
s[State::SHOWING] = true;
return nullptr;
};
+ObjectRegistry objectRegistry;
+} // namespace
+
+void Accessible::SetObjectRegistry(ObjectRegistry registry)
+{
+ objectRegistry = registry;
}
void Accessible::RegisterControlAccessibilityGetter( std::function< Accessible*( Dali::Actor ) > functor )
auto accessible = convertingFunctor( actor );
if( !accessible )
{
- if( nonControlAccessibles.empty() )
+ if( nonControlAccessibles.empty() && objectRegistry )
{
- auto registry = Adaptor::Get().GetObjectRegistry();
- registry.ObjectDestroyedSignal().Connect( []( const Dali::RefObject* obj )
+ objectRegistry.ObjectDestroyedSignal().Connect( []( const Dali::RefObject* obj )
{
nonControlAccessibles.erase( obj );
}
// EXTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/object/object-registry.h>
#include <atomic>
#include <bitset>
#include <exception>
#include <stdexcept>
//INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/atspi-accessibility.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
#include <dali/integration-api/debug.h>
namespace Dali
{
namespace Accessibility
{
-class Accessible;
-class Text;
-class Value;
-class Component;
-class Collection;
-class Action;
+class DALI_ADAPTOR_API Accessible;
+class DALI_ADAPTOR_API Text;
+class DALI_ADAPTOR_API Value;
+class DALI_ADAPTOR_API Component;
+class DALI_ADAPTOR_API Collection;
+class DALI_ADAPTOR_API Action;
/**
* @brief Base class for different accessibility bridges
*
* @note This class is singleton.
*/
-struct Bridge
+struct DALI_ADAPTOR_API Bridge
{
enum class ForceUpResult
{
/**
* @brief Emits property-changed event
- * @param[in] Property changed event
+ * @param[in] event Property changed event
**/
void Emit( ObjectPropertyChangeEvent event );
Accessible& operator=( const Accessible& ) = delete;
Accessible& operator=( Accessible&& ) = delete;
std::shared_ptr< Bridge::Data > GetBridgeData();
+
+public:
static Dali::Actor GetHighlightActor();
static void SetHighlightActor(Dali::Actor actor);
static Dali::Actor GetCurrentlyHighlightedActor();
static void SetCurrentlyHighlightedActor(Dali::Actor);
+ static void SetObjectRegistry(ObjectRegistry registry);
private:
friend class Bridge;
virtual bool ClearHighlight() = 0;
/**
- * @brief Get index of "highlighted" object
- *
- * @return The index of "highlighted" object
- *
- * @see Dali:Accessibility::State
- */
- virtual int GetHighlightIndex() = 0;
-
- /**
* @brief Check whether object can be scrolled
*
* @return true if object is scrollable, false otherwise
*
* @see Dali::Accessibility::EditableText
*/
-class Text : public virtual Accessible
+class DALI_ADAPTOR_API Text : public virtual Accessible
{
public:
/**
/**
* @brief Set caret offset
*
- * @param[in] caret offset
+ * @param[in] offset Caret offset
*
* @return True if successful
*/
*
* @see Dali::Accessibility::EditableText
*/
-class EditableText : public virtual Accessible
+class DALI_ADAPTOR_API EditableText : public virtual Accessible
{
public:
/**
* (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
*/
-class EmptyAccessibleWithAddress : public virtual Accessible
+class DALI_ADAPTOR_API EmptyAccessibleWithAddress : public virtual Accessible
{
public:
EmptyAccessibleWithAddress() = default;
\r
// EXTERNAL INCLUDES\r
\r
+#include <array>\r
#include <atomic>\r
#include <bitset>\r
#include <exception>\r
*/\r
enum class TextChangedState : uint32_t\r
{\r
- INSERT,\r
- DELETE,\r
+ INSERTED,\r
+ DELETED,\r
MAX_COUNT\r
};\r
\r
* @brief Class representing unique object address on accessibility bus\r
* @see Dali::Accessibility::Accessible::GetAddress\r
*/\r
-class Address\r
+class DALI_ADAPTOR_API Address\r
{\r
public:\r
Address() = default;\r
/**\r
* @brief Helper class representing two dimensional point with integer coordinates\r
*/\r
-struct Point\r
+struct DALI_ADAPTOR_API Point\r
{\r
int x = 0;\r
int y = 0;\r
/**\r
* @brief Helper class representing size of rectangle object with usage of two integer values\r
*/\r
-struct Size\r
+struct DALI_ADAPTOR_API Size\r
{\r
int width = 0;\r
int height = 0;\r
* @see Dali::Accessibility::Text::GetTextAtOffset\r
* @see Dali::Accessibility::Text::GetSelection\r
*/\r
-struct Range\r
+struct DALI_ADAPTOR_API Range\r
{\r
int32_t startOffset = 0;\r
int32_t endOffset = 0;\r
* eventTime : time when event occured\r
* @see Dali::Accessibility::Accessible::DoGesture\r
*/\r
-struct GestureInfo\r
+struct DALI_ADAPTOR_API GestureInfo\r
{\r
GestureInfo() = default;\r
GestureInfo(Gesture type, int32_t xBeg, int32_t xEnd, int32_t yBeg, int32_t yEnd, GestureState state, uint32_t eventTime)\r
* @see Dali::Accessibility::Accessible::Address\r
* @see Dali::Accessibility::Accessible::RelationType\r
*/\r
-struct Relation\r
+struct DALI_ADAPTOR_API Relation\r
{\r
Relation(RelationType relationType, std::vector<Address> targets)\r
: relationType(relationType),\r
*/
#include <dali/devel-api/adaptor-framework/atspi-accessibility.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-impl.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
-
-#include <mutex>
-#include <Eldbus.h>
-#include <Ecore_Input.h>
-#include <dali/integration-api/debug.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
void Dali::AtspiAccessibility::Pause()
{
namespace Dali
{
+
GlWindow GlWindow::New()
{
PositionSize positionSize( 0, 0, 0, 0 );
return Dali::GlWindow::New( positionSize, "", "", false );
}
+
GlWindow GlWindow::New(PositionSize positionSize, const std::string& name, const std::string& className, bool isTransparent )
{
GlWindow newWindow;
}
return newWindow;
}
+
GlWindow::GlWindow()
{
}
+
GlWindow::~GlWindow()
{
}
{
GetImplementation(*this).SetEglConfig( depth, stencil, msaa, version );
}
+
void GlWindow::Raise()
{
GetImplementation(*this).Raise();
}
+
void GlWindow::Lower()
{
GetImplementation(*this).Lower();
}
+
void GlWindow::Activate()
{
GetImplementation(*this).Activate();
}
+
void GlWindow::Show()
{
GetImplementation(*this).Show();
}
+
void GlWindow::Hide()
{
GetImplementation(*this).Hide();
}
+
unsigned int GlWindow::GetSupportedAuxiliaryHintCount() const
{
return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
}
+
std::string GlWindow::GetSupportedAuxiliaryHint( unsigned int index ) const
{
return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
}
+
unsigned int GlWindow::AddAuxiliaryHint( const std::string& hint, const std::string& value )
{
return GetImplementation(*this).AddAuxiliaryHint( hint, value );
}
+
bool GlWindow::RemoveAuxiliaryHint( unsigned int id )
{
return GetImplementation(*this).RemoveAuxiliaryHint( id );
}
+
bool GlWindow::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
{
return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
}
+
std::string GlWindow::GetAuxiliaryHintValue( unsigned int id ) const
{
return GetImplementation(*this).GetAuxiliaryHintValue( id );
}
+
unsigned int GlWindow::GetAuxiliaryHintId( const std::string& hint ) const
{
return GetImplementation(*this).GetAuxiliaryHintId( hint );
}
+
void GlWindow::SetInputRegion( const Rect< int >& inputRegion )
{
GetImplementation(*this).SetInputRegion( inputRegion );
}
+
void GlWindow::SetOpaqueState( bool opaque )
{
GetImplementation(*this).SetOpaqueState( opaque );
}
+
bool GlWindow::IsOpaqueState() const
{
return GetImplementation(*this).IsOpaqueState();
}
+
void GlWindow::SetPositionSize( PositionSize positionSize )
{
GetImplementation(*this).SetPositionSize( positionSize );
}
+
PositionSize GlWindow::GetPositionSize() const
{
return GetImplementation(*this).GetPositionSize();
}
-Dali::GlWindow::GlWindowOrientation GlWindow::GetCurrentOrientation() const
+
+WindowOrientation GlWindow::GetCurrentOrientation() const
{
return GetImplementation( *this ).GetCurrentOrientation();
}
-void GlWindow::SetAvailableOrientations( const Dali::Vector< Dali::GlWindow::GlWindowOrientation >& orientations )
+
+void GlWindow::SetAvailableOrientations( const Dali::Vector< WindowOrientation >& orientations )
{
GetImplementation( *this ).SetAvailableOrientations( orientations );
}
-void GlWindow::SetPreferredOrientation( Dali::GlWindow::GlWindowOrientation orientation )
+
+void GlWindow::SetPreferredOrientation( WindowOrientation orientation )
{
GetImplementation(*this).SetPreferredOrientation( orientation );
}
-void GlWindow::RegisterGlCallback( GlInitialize glInit, GlRenderFrame glRenderFrame, GlTerminate glTerminate )
+
+void GlWindow::RegisterGlCallback( CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback )
{
- GetImplementation(*this).RegisterGlCallback( glInit, glRenderFrame, glTerminate );
+ GetImplementation(*this).RegisterGlCallback( initCallback, renderFrameCallback, terminateCallback );
}
+
void GlWindow::RenderOnce()
{
GetImplementation(*this).RenderOnce();
}
+
GlWindow::FocusChangeSignalType& GlWindow::FocusChangeSignal()
{
return GetImplementation(*this).FocusChangeSignal();
}
+
GlWindow::ResizeSignalType& GlWindow::ResizeSignal()
{
return GetImplementation(*this).ResizeSignal();
}
+
GlWindow::KeyEventSignalType& GlWindow::KeyEventSignal()
{
return GetImplementation(*this).KeyEventSignal();
}
+
GlWindow::TouchEventSignalType& GlWindow::TouchedSignal()
{
return GetImplementation(*this).TouchedSignal();
}
+
GlWindow::VisibilityChangedSignalType& GlWindow::VisibilityChangedSignal()
{
return GetImplementation(*this).VisibilityChangedSignal();
}
+
GlWindow::GlWindow( Internal::Adaptor::GlWindow* window )
: BaseHandle( window )
{
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/object/any.h>
#include <dali/public-api/signals/dali-signal.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
}
}
-namespace
-{
-typedef void (*GlInitialize)();
-typedef void (*GlRenderFrame)();
-typedef void (*GlTerminate)();
-}
-
class TouchEvent;
class KeyEvent;
// Enumerations
/**
- * @brief Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
- *
- * This Enumeration is used the available orientation APIs and the preferred orientation.
- *
- */
- enum class GlWindowOrientation
- {
- PORTRAIT = 0, ///< Portrait orientation. The height of the display area is greater than the width.
- LANDSCAPE = 1, ///< Landscape orientation. A wide view area is needed.
- PORTRAIT_INVERSE = 2, ///< Portrait inverse orientation
- LANDSCAPE_INVERSE = 3, ///< Landscape inverse orientation
- NO_ORIENTATION_PREFERENCE = -1 ///< Invalid angle value. It is used to initialize or unset the preferred orientation.
- };
-
- /**
* @brief Enumeration for GLES verion
*
* This Enumeration is used the GLES version for EGL configuration.
*
* @return The current GlWindow rotation angle if previously set, or none
*/
- Dali::GlWindow::GlWindowOrientation GetCurrentOrientation() const;
+ WindowOrientation GetCurrentOrientation() const;
/**
* @brief Sets available orientations of the window.
*
* @param[in] orientations The available orientations list to add
*/
- void SetAvailableOrientations( const Dali::Vector<Dali::GlWindow::GlWindowOrientation>& orientations );
+ void SetAvailableOrientations( const Dali::Vector<WindowOrientation>& orientations );
/**
* @brief Sets a preferred orientation.
*
* @note To unset the preferred orientation, angle should be set NO_ORIENTATION_PREFERENCE.
*/
- void SetPreferredOrientation( Dali::GlWindow::GlWindowOrientation orientation );
+ void SetPreferredOrientation( WindowOrientation orientation );
/**
* @brief Registers a GL callback function for application.
*
- * @param[in] glInit the callback function for application initialize
- * @param[in] glRenderFrame the callback function to render to the frame.
- * @param[in] glTerminate the callback function to clean-up application GL resource.
+ * @param[in] initCallback the callback function for application initialize
+ * @param[in] renderFrameCallback the callback function to render for the frame.
+ * @param[in] terminateCallback the callback function to clean-up application GL resource.
*
+ * @note Function must be called on idle time
+ *
+ * A initCallback of the following type should be used:
+ * @code
+ * void intializeGL();
+ * @endcode
+ * This callback will be called before renderFrame callback is called at once.
+ *
+ * A renderFrameCallback of the following type should be used:
+ * @code
+ * int renderFrameGL();
+ * @endcode
+ * This callback's return value is not 0, the eglSwapBuffers() will be called.
+ *
+ * A terminateCallback of the following type should be used:
+ * @code
+ * void terminateGL();
+ * @endcode
+ * This callback is called when GlWindow is deleted.
*/
- void RegisterGlCallback( GlInitialize glInit, GlRenderFrame glRenderFrame, GlTerminate glTerminate );
+ void RegisterGlCallback( CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback );
/**
* @brief Renders once more even if GL render functions are not added to idler.
// EXTERNAL INCLUDES
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/events/wheel-event.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/window-devel.h>
return Window(dynamic_cast<Dali::Internal::Adaptor::Window*>(handle.GetObjectPtr()));
}
-Dali::Window::WindowOrientation GetCurrentOrientation(Window window)
+WindowOrientation GetCurrentOrientation(Window window)
{
return GetImplementation(window).GetCurrentOrientation();
}
-void SetAvailableOrientations(Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations)
+void SetAvailableOrientations(Window window, const Dali::Vector<WindowOrientation>& orientations)
{
GetImplementation(window).SetAvailableOrientations(orientations);
}
// INTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/window.h>
#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
namespace Dali
{
namespace DevelWindow
{
-/**
- * @brief Enumeration for transition effect's state.
- */
-enum class EffectState
-{
- NONE = 0, ///< None state
- START, ///< Transition effect is started.
- END ///< Transition effect is ended.
-};
-
-/**
- * @brief Enumeration for transition effect's type.
- */
-enum class EffectType
-{
- NONE = 0, ///< None type
- SHOW, ///< Window show effect.
- HIDE, ///< Window hide effect.
-};
typedef Signal<void()> EventProcessingFinishedSignalType; ///< Event Processing finished signal type
typedef Signal<void(Window, bool)> VisibilityChangedSignalType; ///< Visibility changed signal type
-typedef Signal<void(Window, EffectState, EffectType)> TransitionEffectEventSignalType; ///< Effect signal type and state
+typedef Signal<void(Window, WindowEffectState, WindowEffectType)> TransitionEffectEventSignalType; ///< Effect signal type and state
typedef Signal<void()> KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type
* @param[in] window The window instance
* @return The current window orientation if previously set, or none
*/
-DALI_ADAPTOR_API Dali::Window::WindowOrientation GetCurrentOrientation(Window window);
+DALI_ADAPTOR_API WindowOrientation GetCurrentOrientation(Window window);
/**
* @brief Sets available orientations of the window.
* @param[in] window The window instance
* @param[in] orientations The available orientation list to add
*/
-DALI_ADAPTOR_API void SetAvailableOrientations(Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations);
+DALI_ADAPTOR_API void SetAvailableOrientations(Window window, const Dali::Vector<WindowOrientation>& orientations);
/**
* @brief Gets current window ID.
SET( devel_api_src_files
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/accessibility-impl.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
${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp
${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp
${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp
SET( devel_api_adaptor_framework_header_files
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.h
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-action-handler.h
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-gesture-handler.h
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-gesture-event.h
+ ${adaptor_devel_api_dir}/adaptor-framework/accessibility.h
+ ${adaptor_devel_api_dir}/adaptor-framework/accessibility-impl.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
#include <dali/internal/graphics/gles/egl-graphics.h>
#include <dali/internal/input/common/key-impl.h>
#include <dali/internal/input/common/physical-keyboard-impl.h>
+#include <dali/internal/system/common/time-service.h>
namespace Dali
{
#if defined(DEBUG_ENABLED)
Debug::Filter* gSceneHolderLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_SCENE_HOLDER");
#endif
-
-// Copied from x server
-static uint32_t GetCurrentMilliSeconds(void)
-{
- struct timeval tv;
-
- struct timespec tp;
- static clockid_t clockid;
-
- if(!clockid)
- {
-#ifdef CLOCK_MONOTONIC_COARSE
- if(clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
- (tp.tv_nsec / 1000) <= 1000 && clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
- {
- clockid = CLOCK_MONOTONIC_COARSE;
- }
- else
-#endif
- if(clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
- {
- clockid = CLOCK_MONOTONIC;
- }
- else
- {
- clockid = ~0L;
- }
- }
- if(clockid != ~0L && clock_gettime(clockid, &tp) == 0)
- {
- return static_cast<uint32_t>((tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L));
- }
-
- gettimeofday(&tv, NULL);
- return static_cast<uint32_t>((tv.tv_sec * 1000) + (tv.tv_usec / 1000));
-}
-
} // unnamed namespace
uint32_t SceneHolder::mSceneHolderCounter = 0;
{
if(timeStamp < 1)
{
- timeStamp = GetCurrentMilliSeconds();
+ timeStamp = TimeService::GetMilliSeconds();
}
RecalculateTouchPosition(point);
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/dbus.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/dbus-locators.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/internal/accessibility/bridge/dbus.h>
+#include <dali/internal/accessibility/bridge/dbus-locators.h>
#define A11yDbusName "org.a11y.Bus"
#define A11yDbusPath "/org/a11y/bus"
{
template < typename T >
-struct signature_accessible_impl
+struct signature_accessible_impl : signature_helper<signature_accessible_impl<T>>
{
+ using subtype = std::pair< std::string, ObjectPath >;
-using subtype = std::pair< std::string, ObjectPath >;
-
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "AtspiAccessiblePtr";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "(so)";
- }
+ static constexpr auto name_v = concat("AtspiAccessiblePtr");
+ static constexpr auto sig_v = concat("(so)");
/**
* @brief Marshals value v as marshalled type into message
};
template <>
-struct signature< Dali::Accessibility::Address >
+struct signature< Dali::Accessibility::Address > : signature_helper<signature<Dali::Accessibility::Address>>
{
-using subtype = std::pair< std::string, ObjectPath >;
+ using subtype = std::pair< std::string, ObjectPath >;
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "AtspiAccessiblePtr";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "(so)";
- }
+ static constexpr auto name_v = concat("AtspiAccessiblePtr");
+ static constexpr auto sig_v = concat("(so)");
/**
* @brief Marshals value v as marshalled type into message
{
return false;
}
-
+
v = { std::move( tmp.first ), tmp.second.value.substr( strlen( ATSPI_PREFIX_PATH ) ) };
return true;
}
};
template <>
-struct signature< Dali::Accessibility::States >
+struct signature< Dali::Accessibility::States > : signature_helper<signature<Dali::Accessibility::States>>
{
-using subtype = std::array< uint32_t, 2 >;
-
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return signature< subtype >::name();
- }
+ using subtype = std::array<uint32_t, 2>;
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< subtype >::sig();
- }
+ static constexpr auto name_v = signature<subtype>::name_v;
+ static constexpr auto sig_v = signature<subtype>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
// CLASS HEADER
//INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
#include <third-party/libunibreak/wordbreak.h>
#include <third-party/libunibreak/linebreak.h>
{
tmp.push_back(AtspiDbusInterfaceText);
}
+ if (dynamic_cast<EditableText*>(this))
+ {
+ tmp.push_back(AtspiDbusInterfaceEditableText);
+ }
if (dynamic_cast<Value*>(this))
{
tmp.push_back(AtspiDbusInterfaceValue);
void Accessible::EmitTextInserted(unsigned int position, unsigned int length, const std::string& content)
{
if (auto b = GetBridgeData()) {
- b->bridge->EmitTextChanged(this, TextChangedState::INSERT, position, length, content);
+ b->bridge->EmitTextChanged(this, TextChangedState::INSERTED, position, length, content);
}
}
void Accessible::EmitTextDeleted(unsigned int position, unsigned int length, const std::string& content)
{
if (auto b = GetBridgeData()) {
- b->bridge->EmitTextChanged(this, TextChangedState::DELETE, position, length, content);
+ b->bridge->EmitTextChanged(this, TextChangedState::DELETED, position, length, content);
}
}
void Accessible::EmitTextCaretMoved(unsigned int cursorPosition)
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-accessible.h>
+#include <dali/internal/accessibility/bridge/bridge-accessible.h>
// EXTERNAL INCLUDES
#include <iostream>
return false;
if ( !AcceptObjectCheckRelations( obj ) )
return false;
- // if (CALL(get_object_in_relation_by_type, obj, ATSPI_RELATION_CONTROLLED_BY) != NULL) return 0;
- if ( !AcceptObjectCheckRelations( obj ) )
- return false;
if( !states[State::HIGHLIGHTABLE] )
return false;
double maximumValue = 0.0;
double minimumValue = 0.0;
+ auto *value = dynamic_cast<Dali::Accessibility::Value *>(self);
+ if (value)
+ {
+ currentValue = value->GetCurrent();
+ minimumIncrement = value->GetMinimumIncrement();
+ maximumValue = value->GetMaximum();
+ minimumValue = value->GetMinimum();
+ }
+
auto description = self->GetDescription();
auto indexInParent = static_cast< int32_t >( self->GetIndexInParent() );
bool isSelectedInParent = false;
bool hasCheckBoxChild = false;
- int32_t firstSelectedChildIndex = 0;
+ int32_t firstSelectedChildIndex = -1;
int32_t selectedChildCount = 0;
for( auto i = 0u; i < static_cast< size_t >( childCount ); ++i )
auto s = q->GetStates();
if( s[State::SELECTABLE] )
{
- ++selectedChildCount;
if( s[State::SELECTED] )
{
+ ++selectedChildCount;
if( firstSelectedChildIndex < 0 )
firstSelectedChildIndex = static_cast< int32_t >( i );
}
bool recurse = false;
if( component )
{
- const auto states = component->GetStates();
- if( states[State::MODAL] )
- {
- component = nullptr;
- }
- }
- if( component )
- {
recurse = component->IsProxy();
}
//TODO: add deputy
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-action.h>
+#include <dali/internal/accessibility/bridge/bridge-action.h>
// EXTERNAL INCLUDES
#include <iostream>
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeAction : public virtual BridgeBase
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
// EXTERNAL INCLUDES
#include <atomic>
{
return Find( name );
}
- catch( std::domain_error )
+ catch( std::domain_error& )
{
return nullptr;
}
#include <memory>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
class AppAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-collection.h>
+#include <dali/internal/accessibility/bridge/bridge-collection.h>
// EXTERNAL INCLUDES
#include <algorithm>
void BridgeCollection::VisitNodes( Accessible* obj, std::vector< Accessible* >& result, Comparer& cmp, size_t maxCount )
{
- if( result.size() >= maxCount )
+ if( maxCount > 0 && result.size() >= maxCount )
return;
if( cmp( obj ) )
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeCollection : public virtual BridgeBase
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-component.h>
+#include <dali/internal/accessibility/bridge/bridge-component.h>
// EXTERNAL INCLUDES
#include <iostream>
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeComponent : public virtual BridgeBase
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-editable-text.h>
+#include <dali/internal/accessibility/bridge/bridge-editable-text.h>
// INTERNAL INCLUDES
#include <dali/internal/clipboard/common/clipboard-impl.h>
*/
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeEditableText : public virtual BridgeBase
{
#include <unordered_map>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-accessible.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-action.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-collection.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-component.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-object.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-value.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-text.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-editable-text.h>
+#include <dali/internal/accessibility/bridge/bridge-accessible.h>
+#include <dali/internal/accessibility/bridge/bridge-action.h>
+#include <dali/internal/accessibility/bridge/bridge-collection.h>
+#include <dali/internal/accessibility/bridge/bridge-component.h>
+#include <dali/internal/accessibility/bridge/bridge-object.h>
+#include <dali/internal/accessibility/bridge/bridge-value.h>
+#include <dali/internal/accessibility/bridge/bridge-text.h>
+#include <dali/internal/accessibility/bridge/bridge-editable-text.h>
using namespace Dali::Accessibility;
void Pause() override
{
- auto r = directReadingClient.method< DBus::ValueOrError< void >( bool ) > ( "PauseResume" ).call( true );
- if (!r)
+ if (!IsUp())
{
- LOG() << "Direct reading command failed (" << r.getError().message << ")";
+ return;
}
+
+ directReadingClient.method< DBus::ValueOrError< void >( bool ) > ( "PauseResume" ).asyncCall(
+ []( DBus::ValueOrError< void > msg ) {
+ if (!msg)
+ {
+ LOG() << "Direct reading command failed (" << msg.getError().message << ")";
+ }
+ },
+ true);
}
void Resume() override
{
- auto r = directReadingClient.method< DBus::ValueOrError< void >( bool ) > ( "PauseResume" ).call( false );
- if (!r)
+ if (!IsUp())
{
- LOG() << "Direct reading command failed (" << r.getError().message << ")";
+ return;
}
+
+ directReadingClient.method< DBus::ValueOrError< void >( bool ) > ( "PauseResume" ).asyncCall(
+ []( DBus::ValueOrError< void > msg) {
+ if (!msg)
+ {
+ LOG() << "Direct reading command failed (" << msg.getError().message << ")";
+ }
+ },
+ false);
}
void Say( const std::string& text, bool discardable, std::function< void(std::string) > callback ) override
{
- auto commandId = directReadingClient.method< DBus::ValueOrError< std::string, bool, int32_t >( std::string, bool ) > ( "ReadCommand" ).call( text, discardable );
- if ( !commandId )
- {
- LOG() << "Direct reading command failed (" << commandId.getError().message << ")";
- }
- else if( callback )
+ if (!IsUp())
{
- directReadingCallbacks.emplace( std::get< 2 >( commandId ), callback);
+ return;
}
+
+ directReadingClient.method< DBus::ValueOrError< std::string, bool, int32_t >( std::string, bool ) > ( "ReadCommand" ).asyncCall(
+ [=]( DBus::ValueOrError<std::string, bool, int32_t> msg ) {
+ if ( !msg )
+ {
+ LOG() << "Direct reading command failed (" << msg.getError().message << ")";
+ }
+ else if( callback )
+ {
+ directReadingCallbacks.emplace( std::get< 2 >( msg ), callback);
+ }
+ },
+ text,
+ discardable);
}
void ForceDown() override
if (it != directReadingCallbacks.end())
{
it->second( readingState );
- directReadingCallbacks.erase( it );
+ if (readingState != "ReadingPaused" && readingState != "ReadingResumed" && readingState != "ReadingStarted")
+ directReadingCallbacks.erase( it );
}
}
);
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-object.h>
+#include <dali/internal/accessibility/bridge/bridge-object.h>
// EXTERNAL INCLUDES
#include <iostream>
const char* stateName = nullptr;
switch( state )
{
- case TextChangedState::INSERT:
+ case TextChangedState::INSERTED:
{
stateName = "insert";
break;
}
- case TextChangedState::DELETE:
+ case TextChangedState::DELETED:
{
stateName = "delete";
break;
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
#include <dali/public-api/math/rect.h>
class BridgeObject : public virtual BridgeBase
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-text.h>
+#include <dali/internal/accessibility/bridge/bridge-text.h>
// INTERNAL INCLUDES
#include <dali/internal/input/common/input-method-context-factory.h>
*/
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeText : public virtual BridgeBase
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-value.h>
+#include <dali/internal/accessibility/bridge/bridge-value.h>
// EXTERNAL INCLUDES
#include <iostream>
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeValue : public virtual BridgeBase
{
#include <iostream>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
using namespace Dali::Accessibility;
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/dbus.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
+#include <dali/internal/accessibility/bridge/dbus.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
// EXTERNAL INCLUDES
#include <sstream>
* limitations under the License.
*/
- // EXTERNAL INCLUDES
-#include <memory>
+// EXTERNAL INCLUDES
#include <array>
#include <atomic>
+#include <cassert>
#include <cstdint>
+#include <cstring>
+#include <functional>
#include <map>
+#include <memory>
#include <sstream>
#include <string>
+#include <string_view>
#include <thread>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <vector>
-#include <functional>
-#include <string.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/atspi-accessibility.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-optional.h>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
#define ATSPI_PREFIX_PATH "/org/a11y/atspi/accessible/"
#define ATSPI_NULL_PATH "/org/a11y/atspi/null"
*/
namespace detail
{
+ inline namespace strings {
+ template <std::size_t N>
+ using char_array = std::array<char, N>;
+
+ constexpr char *xcopy_n(const char *src, size_t n, char *dst)
+ {
+ for (std::size_t i = 0; i < n; ++i)
+ dst[i] = src[i];
+
+ return dst + n;
+ }
+
+ template <std::size_t N>
+ constexpr std::size_t xlen(const char (&)[N])
+ {
+ return N - 1;
+ }
+
+ template <std::size_t N>
+ constexpr std::size_t xlen(const char_array<N> &)
+ {
+ return N - 1;
+ }
+
+ template <typename... Args>
+ constexpr auto concat(const Args &... args)
+ {
+ char_array<(1U + ... + xlen(args))> arr{};
+ char *ptr = arr.data();
+
+ if constexpr (!arr.empty())
+ ((ptr = xcopy_n(std::data(args), xlen(args), ptr)), ...);
+
+ return arr;
+ }
+
+ template<std::size_t... Digits>
+ struct to_chars {
+ static constexpr const char value[] = {('0' + static_cast<char>(Digits))..., '\0'};
+
+ static_assert((true && ... && (Digits < 10)));
+ };
+
+ template<std::size_t Remainder, std::size_t... Digits>
+ struct to_chars_helper : to_chars_helper<Remainder / 10, Remainder % 10, Digits...> {};
+
+ template<std::size_t... Digits>
+ struct to_chars_helper<0, Digits...> : to_chars<Digits...> {};
+
+ template<std::size_t N>
+ using to_string = to_chars_helper<N / 10, N % 10>;
+ }
+
template < typename T, typename = void >
struct signature;
template < typename... ARGS >
template < typename A, typename B >
struct signature< std::map< A, B > >;
- /**
- * @brief Signature class for marshalling uint8 type.
- */
- template <>
- struct signature< uint8_t >
+ template <typename T>
+ struct signature_helper
{
/**
* @brief Returns name of type marshalled, for informative purposes
*/
- static std::string name()
+ static constexpr std::string_view name()
{
- return "uint8_t";
+ return {T::name_v.data()};
}
/**
* @brief Returns DBUS' signature of type marshalled
*/
- static std::string sig()
+ static constexpr std::string_view sig()
{
- return "y";
+ return {T::sig_v.data()};
}
+ };
+
+ /**
+ * @brief Signature class for marshalling uint8 type.
+ */
+ template <>
+ struct signature< uint8_t > : signature_helper<signature<uint8_t>>
+ {
+ static constexpr auto name_v = concat("uint8_t");
+ static constexpr auto sig_v = concat("y");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling uint16 type.
*/
template <>
- struct signature< uint16_t >
+ struct signature< uint16_t > : signature_helper<signature<uint16_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "uint16_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "q";
- }
+ static constexpr auto name_v = concat("uint16_t");
+ static constexpr auto sig_v = concat("q");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling uint32 type.
*/
template <>
- struct signature< uint32_t >
+ struct signature< uint32_t > : signature_helper<signature<uint32_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "uint32_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "u";
- }
+ static constexpr auto name_v = concat("uint32_t");
+ static constexpr auto sig_v = concat("u");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling uint64 type.
*/
template <>
- struct signature< uint64_t >
+ struct signature< uint64_t > : signature_helper<signature<uint64_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "uint64_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "t";
- }
+ static constexpr auto name_v = concat("uint64_t");
+ static constexpr auto sig_v = concat("t");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling int16 type.
*/
template <>
- struct signature< int16_t >
+ struct signature< int16_t > : signature_helper<signature<int16_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "int16_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "n";
- }
+ static constexpr auto name_v = concat("int16_t");
+ static constexpr auto sig_v = concat("n");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling int32 type.
*/
template <>
- struct signature< int32_t >
+ struct signature< int32_t > : signature_helper<signature<int32_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "int32_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "i";
- }
+ static constexpr auto name_v = concat("int32_t");
+ static constexpr auto sig_v = concat("i");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling int64 type.
*/
template <>
- struct signature< int64_t >
+ struct signature< int64_t > : signature_helper<signature<int64_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "int64_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "x";
- }
+ static constexpr auto name_v = concat("int64_t");
+ static constexpr auto sig_v = concat("x");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling double type.
*/
template <>
- struct signature< double >
+ struct signature< double > : signature_helper<signature<double>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "double";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "d";
- }
+ static constexpr auto name_v = concat("double");
+ static constexpr auto sig_v = concat("d");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling float type.
*/
template <>
- struct signature< float >
+ struct signature< float > : signature_helper<signature<float>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "float";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "d";
- }
+ static constexpr auto name_v = concat("float");
+ static constexpr auto sig_v = concat("d");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling boolean type.
*/
template <>
- struct signature< bool >
+ struct signature< bool > : signature_helper<signature<bool>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "bool";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "b";
- }
+ static constexpr auto name_v = concat("bool");
+ static constexpr auto sig_v = concat("b");
/**
* @brief Marshals value v as marshalled type into message
};
template < typename T >
- struct signature< T, typename std::enable_if< std::is_enum< T >::value, void >::type >
+ struct signature<T, typename std::enable_if_t<std::is_enum_v<T>, void>> : signature_helper<signature<T>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "enum";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature<typename std::underlying_type<T>::type>::sig();
- }
+ static constexpr auto name_v = concat("enum");
+ static constexpr auto sig_v = signature<typename std::underlying_type<T>::type>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
* Only std::string is accepted as value to receive.
*/
template <>
- struct signature< std::string >
+ struct signature< std::string > : signature_helper<signature<std::string>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "string";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "s";
- }
+ static constexpr auto name_v = concat("string");
+ static constexpr auto sig_v = concat("s");
/**
* @brief Marshals value v as marshalled type into message
};
template <>
- struct signature< ObjectPath >
+ struct signature< ObjectPath > : signature_helper<signature<ObjectPath>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "path";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "o";
- }
+ static constexpr auto name_v = concat("path");
+ static constexpr auto sig_v = concat("o");
/**
* @brief Marshals value v as marshalled type into message
* You can't use (const) char * variable type to receive value.
*/
template <>
- struct signature< char* >
+ struct signature< char* > : signature_helper<signature<char *>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "string";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "s";
- }
+ static constexpr auto name_v = concat("string");
+ static constexpr auto sig_v = concat("s");
/**
* @brief Marshals value v as marshalled type into message
* until INDEX is equal to SIZE, where recursive calling ends.
*/
template < size_t INDEX, size_t SIZE, typename... ARGS >
- struct signature_tuple_helper
+ struct signature_tuple_helper : signature_helper<signature_tuple_helper<INDEX, SIZE, ARGS...>>
{
using current_type = typename signature_tuple_element_type_helper< INDEX, ARGS... >::type;
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- if (INDEX + 1 >= SIZE)
- return signature< current_type >::name();
- return signature< current_type >::name() + ", " + signature_tuple_helper< INDEX + 1, SIZE, ARGS... >::name();
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< current_type >::sig() + signature_tuple_helper< INDEX + 1, SIZE, ARGS... >::sig();
- }
+ static constexpr auto name_v = concat(signature<current_type>::name_v, ", ", signature_tuple_helper<INDEX + 1, SIZE, ARGS...>::name_v);
+ static constexpr auto sig_v = concat(signature<current_type>::sig_v, signature_tuple_helper<INDEX + 1, SIZE, ARGS...>::sig_v);
/**
* @brief Marshals value v as marshalled type into message
* when INDEX value is equal to SIZE.
*/
template < size_t SIZE, typename... ARGS >
- struct signature_tuple_helper< SIZE, SIZE, ARGS... >
+ struct signature_tuple_helper< SIZE, SIZE, ARGS... > : signature_helper<signature_tuple_helper<SIZE, SIZE, ARGS...>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "";
- }
+ static constexpr auto name_v = concat("");
+ static constexpr auto sig_v = concat("");
/**
* @brief Marshals value v as marshalled type into message
* DBUS struct typle, encoded with character 'r'
*/
template < typename... ARGS >
- struct signature< std::tuple< ARGS... > >
+ struct signature< std::tuple< ARGS... > > : signature_helper<signature<std::tuple<ARGS...>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "tuple<" + signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "(" + signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::sig() + ")";
- }
+ static constexpr auto name_v = concat("tuple<", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::name_v, ">");
+ static constexpr auto sig_v = concat("(", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::sig_v, ")");
/**
* @brief Marshals value v as marshalled type into message
* \code{.cpp} ValueOrError<std::tuple<std::string, std::string, std::tuple<std::string>>> \endcode
*/
template < typename... ARGS >
- struct signature< ValueOrError< ARGS... > >
+ struct signature< ValueOrError< ARGS... > > : signature_helper<signature<ValueOrError<ARGS...>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "ValueOrError<" + signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::sig();
- }
+ static constexpr auto name_v = concat("ValueOrError<", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::name_v, ">");
+ static constexpr auto sig_v = signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling ValueOrError<void> type
*/
template <>
- struct signature< ValueOrError< void > >
+ struct signature< ValueOrError< void > > : signature_helper<signature<ValueOrError<void>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "ValueOrError<void>";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "";
- }
+ static constexpr auto name_v = concat("ValueOrError<void>");
+ static constexpr auto sig_v = concat("");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling ValueOrError<> type
*/
template <>
- struct signature< ValueOrError<> >
+ struct signature< ValueOrError<> > : signature_helper<signature<ValueOrError<>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "ValueOrError<>";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "";
- }
+ static constexpr auto name_v = concat("ValueOrError<>");
+ static constexpr auto sig_v = concat("");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling pair of types
*/
template < typename A, typename B >
- struct signature< std::pair< A, B > >
+ struct signature< std::pair< A, B > > : signature_helper<signature<std::pair<A, B>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "pair<" + signature_tuple_helper< 0, 2, A, B >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "(" + signature_tuple_helper< 0, 2, A, B >::sig() + ")";
- }
+ static constexpr auto name_v = concat("pair<", signature_tuple_helper<0, 2, A, B>::name_v, ">");
+ static constexpr auto sig_v = concat("(", signature_tuple_helper<0, 2, A, B>::sig_v, ")");
/**
* @brief Marshals value v as marshalled type into message
* This marshals container's content as DBUS a ascii character type code.
*/
template < typename A >
- struct signature< std::vector< A > >
+ struct signature< std::vector< A > > : signature_helper<signature<std::vector<A>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "vector<" + signature< A >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "a" + signature< A >::sig();
- }
+ static constexpr auto name_v = concat("vector<", signature<A>::name_v, ">");
+ static constexpr auto sig_v = concat("a", signature<A>::sig_v);
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const std::vector< A >& v)
{
- auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', signature< A >::sig());
+ auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', std::string{signature< A >::sig()});
assert(lst);
for (auto& a : v)
{
* This marshals container's content as DBUS a ascii character type code.
*/
template < typename A, size_t N >
- struct signature< std::array< A, N > >
+ struct signature< std::array< A, N > > : signature_helper<signature<std::array<A, N>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "array<" + signature< A >::name() + ", " + std::to_string(N) + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "a" + signature< A >::sig();
- }
+ static constexpr auto name_v = concat("array<", signature<A>::name_v, ", ", to_string<N>::value, ">");
+ static constexpr auto sig_v = concat("a", signature<A>::sig_v);
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const std::array< A, N >& v)
{
- auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', signature< A >::sig());
+ auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', std::string{signature< A >::sig()});
assert(lst);
for (auto& a : v)
{
* This marshals variant's content as DBUS v ascii character type code.
*/
template < typename A >
- struct signature< EldbusVariant< A > >
+ struct signature< EldbusVariant< A > > : signature_helper<signature<EldbusVariant<A>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "variant<" + signature< A >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "v";
- }
+ static constexpr auto name_v = concat("variant<", signature<A>::name_v, ">");
+ static constexpr auto sig_v = concat("v");
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const A& v)
{
- auto var = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'v', signature< A >::sig());
+ auto var = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'v', std::string{signature< A >::sig()});
signature< A >::set(var, v);
}
* Order of such values is unspecified.
*/
template < typename A, typename B >
- struct signature< std::unordered_map< A, B > >
+ struct signature< std::unordered_map< A, B > > : signature_helper<signature<std::unordered_map<A, B>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "unordered_map<" + signature< A >::name() + ", " + signature< B >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "a{" + signature_tuple_helper< 0, 2, A, B >::sig() + "}";
- }
+ static constexpr auto name_v = concat("unordered_map<", signature<A>::name_v, ", ", signature<B>::name_v, ">");
+ static constexpr auto sig_v = concat("a{", signature_tuple_helper<0, 2, A, B>::sig_v, "}");
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const std::unordered_map< A, B >& v)
{
- auto sig = "{" + signature_tuple_helper< 0, 2, A, B >::sig() + "}";
+ auto sig = "{" + std::string{signature_tuple_helper< 0, 2, A, B >::sig()} + "}";
auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', sig);
assert(lst);
for (auto& a : v)
* Order of such values is unspecified.
*/
template < typename A, typename B >
- struct signature< std::map< A, B > >
+ struct signature< std::map< A, B > > : signature_helper<signature<std::map<A, B>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "map<" + signature< A >::name() + ", " + signature< B >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "a{" + signature_tuple_helper< 0, 2, A, B >::sig() + "}";
- }
+ static constexpr auto name_v = concat("map<", signature<A>::name_v, ", ", signature<B>::name_v, ">");
+ static constexpr auto sig_v = concat("a{", signature_tuple_helper<0, 2, A, B>::sig_v, "}");
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const std::map< A, B >& v)
{
- auto sig = "{" + signature_tuple_helper< 0, 2, A, B >::sig() + "}";
+ auto sig = "{" + std::string{signature_tuple_helper< 0, 2, A, B >::sig()} + "}";
auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', sig);
assert(lst);
for (auto& a : v)
* @brief Signature helper class for marshalling const reference types
*/
template < typename A >
- struct signature< const A& >
+ struct signature< const A& > : signature_helper<signature<const A &>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "const " + signature< A >::name() + "&";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< A >::sig();
- }
+ static constexpr auto name_v = concat("const ", signature<A>::name_v, "&");
+ static constexpr auto sig_v = signature<A>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature helper class for marshalling reference types
*/
template < typename A >
- struct signature< A& >
+ struct signature< A& > : signature_helper<signature<A &>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return signature< A >::name() + "&";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< A >::sig();
- }
+ static constexpr auto name_v = concat(signature<A>::name_v, "&");
+ static constexpr auto sig_v = signature<A>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature helper class for marshalling const types
*/
template < typename A >
- struct signature< const A >
+ struct signature< const A > : signature_helper<signature<const A>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "const " + signature< A >::name();
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< A >::sig();
- }
+ static constexpr auto name_v = concat("const ", signature<A>::name_v);
+ static constexpr auto sig_v = signature<A>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
template < typename ValueType >
ValueType unpackValues(CallId callId, const DBusWrapper::MessagePtr& msg)
{
+ static const std::string sig{signature< ValueType >::sig().data()};
+
auto iter = DBUS_W->eldbus_message_iter_get_impl(msg, false);
ValueType r;
{
if (!signature< ValueType >::get(iter, r))
{
- DBUS_DEBUG("ValueType is %s", signature< ValueType >::name().c_str());
+ DBUS_DEBUG("ValueType is %s", signature< ValueType >::name().data());
r = Error{ "call " + std::to_string(callId.id) + ": failed to unpack values, got signature '" +
- DBUS_W->eldbus_message_signature_get_impl(msg) + "', expected '" + signature< ValueType >::sig() + "'" };
+ DBUS_W->eldbus_message_signature_get_impl(msg) + "', expected '" + sig + "'" };
}
}
else
packValues_helper(iter, std::forward< ARGS >(r)...);
}
- template < typename >
- struct ReturnType;
- template < typename R, typename... ARGS >
- struct ReturnType< R(ARGS...) >
- {
- using type = R;
- };
-
- template < typename R, typename... ARGS >
- struct ReturnType< std::function< R(ARGS...) > >
- {
- using type = R;
- };
-
- template < int... >
- struct sequence
- {
- };
-
- template < int N, int... S >
- struct sequence_gen : sequence_gen< N - 1, N - 1, S... >
- {
- };
-
- template < int... S >
- struct sequence_gen< 0, S... >
- {
- typedef sequence< S... > type;
- };
-
- template < typename C, typename... ARGS >
- struct apply_helper
- {
- const std::function< C >& c;
- const std::tuple< ARGS... >& args;
-
- template < int... S >
- auto apply_2(sequence< S... >) const -> decltype(c(std::get< S >(args)...))
- {
- return c(std::get< S >(args)...);
- }
- auto apply_1() const -> decltype(apply_2(typename sequence_gen< sizeof...(ARGS) >::type()))
- {
- return apply_2(typename sequence_gen< sizeof...(ARGS) >::type());
- }
- };
-
- template < typename C, typename A, typename... ARGS >
- struct apply_helper_2
- {
- const std::function< C >& c;
- const A& a;
- const std::tuple< ARGS... >& args;
-
- template < int... S >
- auto apply_2(sequence< S... >) const -> decltype(c(a, std::get< S >(args)...))
- {
- return c(a, std::get< S >(args)...);
- }
- auto apply_1() const -> decltype(apply_2(typename sequence_gen< sizeof...(ARGS) >::type()))
- {
- return apply_2(typename sequence_gen< sizeof...(ARGS) >::type());
- }
- };
-
- template < typename C, typename... ARGS >
- auto apply(const std::function< C >& c, const std::tuple< ARGS... >& args) -> typename ReturnType< C >::type
- {
- apply_helper< C, ARGS... > ah{ c, args };
- return ah.apply_1();
- }
-
- template < typename C, typename D, typename... ARGS >
- auto apply(const std::function< C >& c, const D& d, const std::tuple< ARGS... >& args) -> typename ReturnType< C >::type
- {
- apply_helper_2< C, D, ARGS... > ah{ c, d, args };
- return ah.apply_1();
- }
-
struct ConnectionState
{
DBusWrapper::ConnectionPtr connection;
static void add(std::vector< std::pair<std::string, std::string> >& r)
{
auto s = r.size();
- auto sig = signature< A >::sig();
+ auto sig = std::string{signature< A >::sig()};
assert(!sig.empty());
auto name = "p" + std::to_string(s + 1);
r.push_back({ std::move(sig), std::move(name) });
{
static std::string name()
{
- return signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::name();
+ return std::string{signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::name()};
}
static std::vector< std::pair<std::string, std::string> > get()
{
{
static std::string name()
{
- return signature< RetType >::name();
+ return std::string{signature< RetType >::name()};
}
static std::vector< std::pair<std::string, std::string> > get()
{
}
try
{
- detail::apply(callback, params.getValues());
+ std::apply(callback, params.getValues());
}
- catch (...)
+ catch (const Dali::DaliException &e)
{
DBUS_DEBUG("unhandled exception");
assert(0);
{
detail::CallId getterId;
z.getterId = getterId;
- DBUS_DEBUG("call %d: property %s (get) type %s", getterId.id, memberName.c_str(), detail::signature< T >::name().c_str());
+ DBUS_DEBUG("call %d: property %s (get) type %s", getterId.id, memberName.c_str(), detail::signature< T >::name().data());
z.getCallback = [=](const DBusWrapper::MessagePtr& src, const DBusWrapper::MessageIterPtr& dst) -> std::string {
try
{
- auto v = detail::apply(getter, std::tuple<>{});
+ auto v = std::apply(getter, std::tuple<>{});
if (v)
{
detail::signature< T >::set(dst, std::get< 0 >(v.getValues()));
{
return std::string("unhandled exception (") + e.what() + ")";
}
- catch (...)
+ catch (const Dali::DaliException &e)
{
- return "unhandled exception";
+ return std::string("unhandled exception (") + e.condition + ")";
}
};
}
{
detail::CallId setterId;
z.setterId = setterId;
- DBUS_DEBUG("call %d: property %s (set) type %s", setterId.id, memberName.c_str(), detail::signature< T >::name().c_str());
+ DBUS_DEBUG("call %d: property %s (set) type %s", setterId.id, memberName.c_str(), detail::signature< T >::name().data());
z.setCallback = [=](const DBusWrapper::MessagePtr& src, const DBusWrapper::MessageIterPtr& src_iter) -> std::string {
std::tuple< T > value;
auto src_signature = DBUS_W->eldbus_message_iter_signature_get_impl(src_iter);
{
try
{
- auto v = detail::apply(setter, std::move(value));
+ auto v = std::apply(setter, std::move(value));
if (v)
{
DBUS_DEBUG("call %d: success", setterId.id);
{
return std::string("unhandled exception (") + e.what() + ")";
}
- catch (...)
+ catch (const Dali::DaliException &e)
{
- return "unhandled exception";
+ return std::string("unhandled exception (") + e.condition + ")";
}
}
DBUS_DEBUG("call %d: failed to unpack values, got signature '%s', expected '%s'", setterId.id,
- src_signature.c_str(), detail::signature< T >::sig().c_str());
+ src_signature.c_str(), detail::signature< T >::sig().data());
return "call " + std::to_string(setterId.id) + ": failed to unpack values, got signature '" +
- src_signature + "', expected '" + detail::signature< T >::sig() + "'";
+ src_signature + "', expected '" + std::string{detail::signature< T >::sig()} + "'";
};
}
}
{
try
{
- auto v = detail::apply(callback, std::move(args.getValues()));
+ auto v = std::apply(callback, std::move(args.getValues()));
if (v)
{
DBUS_DEBUG("call %d: success", callId.id);
DBUS_DEBUG("call %d: failed: %s", callId.id, txt.c_str());
ret = DBUS_W->eldbus_message_error_new_impl(msg, "org.freedesktop.DBus.Error.Failed", txt);
}
- catch (...)
+ catch (const Dali::DaliException &e)
{
- DBUS_DEBUG("call %d: failed: %s", callId.id, "unhandled exception");
- ret = DBUS_W->eldbus_message_error_new_impl(msg, "org.freedesktop.DBus.Error.Failed", "unhandled exception");
+ auto txt = std::string("unhandled exception (") + e.condition + ")";
+ DBUS_DEBUG("call %d: failed: %s", callId.id, txt.c_str());
+ ret = DBUS_W->eldbus_message_error_new_impl(msg, "org.freedesktop.DBus.Error.Failed", txt);
}
}
else
--- /dev/null
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+
+namespace Dali {
+namespace {
+
+struct DummyBridge : Dali::Accessibility::Bridge
+{
+ const std::string& GetBusName() const override
+ {
+ static const std::string name = "";
+ return name;
+ }
+
+ void AddTopLevelWindow(Accessibility::Accessible *) override
+ {
+ }
+
+ void RemoveTopLevelWindow(Accessibility::Accessible *) override
+ {
+ }
+
+ void AddPopup(Accessibility::Accessible *) override
+ {
+ }
+
+ void RemovePopup(Accessibility::Accessible *) override
+ {
+ }
+
+ void SetApplicationName(std::string) override
+ {
+ }
+
+ Accessibility::Accessible *GetApplication() const override
+ {
+ return nullptr;
+ }
+
+ Accessibility::Accessible *FindByPath(const std::string& s) const override
+ {
+ return nullptr;
+ }
+
+ void ApplicationShown() override
+ {
+ }
+
+ void ApplicationHidden() override
+ {
+ }
+
+ void Initialize() override
+ {
+ }
+
+ void Terminate() override
+ {
+ }
+
+ ForceUpResult ForceUp() override
+ {
+ return ForceUpResult::JUST_STARTED;
+ }
+
+ void ForceDown() override
+ {
+ }
+
+ void EmitCaretMoved(Accessibility::Accessible *obj, unsigned int cursorPosition) override
+ {
+ }
+
+ void EmitActiveDescendantChanged(Accessibility::Accessible *obj, Accessibility::Accessible *child) override
+ {
+ }
+
+ void EmitTextChanged(Accessibility::Accessible *obj, Accessibility::TextChangedState state, unsigned int position, unsigned int length, const std::string &content) override
+ {
+ }
+
+ void EmitStateChanged(Accessibility::Accessible *obj, Accessibility::State state, int val1, int val2) override
+ {
+ }
+
+ void Emit(Accessibility::Accessible *obj, Accessibility::WindowEvent we, unsigned int detail1) override
+ {
+ }
+
+ void Emit(Accessibility::Accessible *obj, Accessibility::ObjectPropertyChangeEvent event) override
+ {
+ }
+
+ void EmitBoundsChanged(Accessibility::Accessible *obj, Rect<> rect) override
+ {
+ }
+
+ Accessibility::Consumed Emit(Accessibility::KeyEventType type, unsigned int keyCode, const std::string& keyName, unsigned int timeStamp, bool isText) override
+ {
+ return Accessibility::Consumed::YES;
+ }
+
+ void Say( const std::string& text, bool discardable, std::function<void(std::string)> callback ) override
+ {
+ }
+
+ void Pause() override
+ {
+ }
+
+ void Resume() override
+ {
+ }
+
+ bool GetScreenReaderEnabled() override
+ {
+ return false;
+ }
+
+ bool GetIsEnabled() override
+ {
+ return false;
+ }
+};
+
+DummyBridge dummyBridge;
+
+} // namespace
+
+Accessibility::Accessible::Accessible()
+{
+}
+
+Accessibility::Accessible::~Accessible()
+{
+}
+
+std::vector<Accessibility::Accessible *> Accessibility::Accessible::GetChildren()
+{
+ return {};
+}
+
+Accessibility::Accessible *Accessibility::Accessible::GetDefaultLabel()
+{
+ return nullptr;
+}
+
+Accessibility::Address Accessibility::Accessible::GetAddress()
+{
+ return {};
+}
+
+std::shared_ptr< Accessibility::Bridge::Data > Accessibility::Accessible::GetBridgeData()
+{
+ return {};
+}
+
+bool Accessibility::Accessible::IsProxy()
+{
+ return false;
+}
+
+bool Accessibility::Component::IsScrollable()
+{
+ return false;
+}
+
+bool Accessibility::Component::Contains(Point p, CoordType ctype)
+{
+ return false;
+}
+
+Accessibility::Accessible *Accessibility::Component::GetAccessibleAtPoint(Accessibility::Point p, Accessibility::CoordType ctype)
+{
+ return nullptr;
+}
+
+Accessibility::Bridge *Accessibility::Bridge::GetCurrentBridge()
+{
+ return &dummyBridge;
+}
+
+void Accessibility::Accessible::EmitStateChanged(Accessibility::State state, int newValue1, int newValue2)
+{
+}
+
+void Accessibility::Accessible::Emit(Accessibility::ObjectPropertyChangeEvent event)
+{
+}
+
+void Accessibility::Accessible::EmitHighlighted(bool set)
+{
+}
+
+void Accessibility::Accessible::EmitBoundsChanged(Rect<> rect)
+{
+}
+
+void Accessibility::Accessible::EmitShowing(bool showing)
+{
+}
+
+void Accessibility::Accessible::EmitFocused(bool set)
+{
+}
+
+void Accessibility::Accessible::EmitVisible(bool visible)
+{
+}
+
+void Accessibility::Accessible::EmitTextInserted(unsigned int position, unsigned int length, const std::string &content)
+{
+}
+
+void Accessibility::Accessible::EmitTextDeleted(unsigned int position, unsigned int length, const std::string &content)
+{
+}
+
+void Accessibility::Accessible::EmitTextCaretMoved(unsigned int cursorPosition)
+{
+}
+
+void Accessibility::Accessible::EmitActiveDescendantChanged(Accessibility::Accessible* obj, Accessibility::Accessible *child)
+{
+}
+
+void Accessibility::Accessible::FindWordSeparationsUtf8(const utf8_t *s, size_t length, const char *language, char *breaks)
+{
+}
+
+void Accessibility::Accessible::FindLineSeparationsUtf8(const utf8_t *s, size_t length, const char *language, char *breaks)
+{
+}
+
+void Accessibility::Accessible::NotifyAccessibilityStateChange(Accessibility::States states, bool doRecursive)
+{
+}
+
+} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2020 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/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/type-registry.h>
-#include <dali/integration-api/debug.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
-#include <dali/integration-api/events/hover-event-integ.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/system/common/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace // unnamed namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR");
-#endif
-
-} // unnamed namespace
-
-AccessibilityAdaptor::AccessibilityAdaptor()
-: mReadPosition(),
- mActionHandler( NULL ),
- mIsEnabled( false )
-{
- mAccessibilityGestureDetector = new AccessibilityGestureDetector();
-}
-
-void AccessibilityAdaptor::EnableAccessibility()
-{
- if(mIsEnabled == false)
- {
- mIsEnabled = true;
-
- if( mActionHandler )
- {
- mActionHandler->ChangeAccessibilityStatus();
- }
- }
-}
-
-void AccessibilityAdaptor::DisableAccessibility()
-{
- if(mIsEnabled == true)
- {
- mIsEnabled = false;
-
- if( mActionHandler )
- {
- mActionHandler->ChangeAccessibilityStatus();
- }
-
- // Destroy the TtsPlayer if exists.
- if ( Adaptor::IsAvailable() )
- {
- Dali::Adaptor& adaptor = Dali::Adaptor::Get();
- Adaptor& adaptorImpl = Adaptor::GetImplementation( adaptor );
- adaptorImpl.DestroyTtsPlayer( Dali::TtsPlayer::SCREEN_READER );
- }
- }
-}
-
-bool AccessibilityAdaptor::IsEnabled() const
-{
- return mIsEnabled;
-}
-
-Vector2 AccessibilityAdaptor::GetReadPosition() const
-{
- return mReadPosition;
-}
-
-void AccessibilityAdaptor::SetActionHandler(AccessibilityActionHandler& handler)
-{
- mActionHandler = &handler;
-}
-
-void AccessibilityAdaptor::SetGestureHandler(AccessibilityGestureHandler& handler)
-{
- if( mAccessibilityGestureDetector )
- {
- mAccessibilityGestureDetector->SetGestureHandler(handler);
- }
-}
-
-bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionActivateEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionActivate();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- bool ret = false;
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y);
-
- mReadPosition.x = static_cast< float > (x);
- mReadPosition.y = static_cast< float > (y);
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionRead( allowReadAgain );
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionClearFocusEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->ClearAccessibilityFocus();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, uint32_t timeStamp)
-{
- bool ret = false;
-
- // We always need to emit a scroll signal, whether it's only a hover or not,
- // so always send the action to the action handler.
- if( mActionHandler )
- {
- Dali::TouchEvent touch = Integration::NewTouchEvent( timeStamp, point );
- ret = mActionHandler->AccessibilityActionScroll( touch );
- }
-
- Integration::TouchEvent touchEvent;
- Integration::HoverEvent hoverEvent;
- Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent( Integration::Point( point ), timeStamp, touchEvent, hoverEvent );
- if( type == Integration::TouchEventCombiner::DISPATCH_TOUCH || type == Integration::TouchEventCombiner::DISPATCH_BOTH ) // hover event is ignored
- {
- // Process the touch event in accessibility gesture detector
- if( mAccessibilityGestureDetector )
- {
- mAccessibilityGestureDetector->SendEvent( touchEvent );
- ret = true;
- }
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionBackEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionBack();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-void AccessibilityAdaptor::HandleActionEnableEvent()
-{
- EnableAccessibility();
-}
-
-void AccessibilityAdaptor::HandleActionDisableEvent()
-{
- DisableAccessibility();
-}
-
-bool AccessibilityAdaptor::HandleActionScrollUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionScrollUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-
-bool AccessibilityAdaptor::HandleActionScrollDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionScrollDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPageLeftEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPageLeft();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPageRightEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPageRight();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPageUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPageUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPageDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPageDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionMoveToFirstEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionMoveToFirst();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionMoveToLastEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionMoveToLast();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadFromTopEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadFromTop();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadFromNextEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadFromNext();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionZoomEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionZoom();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadPauseResumeEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPauseResume();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionStartStopEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionStartStop();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-AccessibilityAdaptor::~AccessibilityAdaptor()
-{
- // Do any platform specific clean-up in OnDestroy()
- OnDestroy();
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H
-#define DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H
-
-/*
- * Copyright (c) 2019 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 <string>
-
-#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/events/touch-point.h>
-#include <dali/integration-api/events/touch-event-combiner.h>
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
-#include <dali/devel-api/adaptor-framework/accessibility-action-handler.h>
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
-#include <dali/internal/accessibility/common/accessibility-gesture-detector.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * This class detects to accessibility action
- */
-class AccessibilityAdaptor : public Dali::BaseObject
-{
-public:
-
- /**
- * Constructor.
- */
- AccessibilityAdaptor();
-
- /**
- * @brief Get an instance of the AccessibilityAdaptor.
- *
- * @note This singleton-style getter can be reimplemented for different platforms.
- * @return The instance of the AccessibilityAdaptor.
- */
- static Dali::AccessibilityAdaptor Get();
-
- /**
- * Turn on accessibility action
- * This method should be called by vconf callback
- */
- void EnableAccessibility();
-
- /**
- * Turn off accessibility action
- * This method should be called by vconf callback
- */
- void DisableAccessibility();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::IsEnabled()
- */
- bool IsEnabled() const;
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::GetReadPosition() const
- */
- Vector2 GetReadPosition() const;
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::SetActionHandler()
- */
- void SetActionHandler(AccessibilityActionHandler& handler);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::SetGestureHandler()
- */
- void SetGestureHandler(AccessibilityGestureHandler& handler);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionNextEvent()
- */
- virtual bool HandleActionNextEvent( bool allowEndFeedback = true);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPreviousEvent()
- */
- virtual bool HandleActionPreviousEvent( bool allowEndFeedback = true);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionActivateEvent()
- */
- virtual bool HandleActionActivateEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadEvent()
- */
- virtual bool HandleActionReadEvent( unsigned int x, unsigned int y, bool allowReadAgain );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadNextEvent()
- */
- virtual bool HandleActionReadNextEvent( bool allowEndFeedback = true);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadPreviousEvent()
- */
- virtual bool HandleActionReadPreviousEvent( bool allowEndFeedback = true);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionUpEvent()
- */
- virtual bool HandleActionUpEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionDownEvent()
- */
- virtual bool HandleActionDownEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionClearFocusEvent()
- */
- bool HandleActionClearFocusEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionScrollEvent()
- */
- bool HandleActionScrollEvent(const TouchPoint& point, uint32_t timeStamp);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionBackEvent()
- */
- bool HandleActionBackEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionEnableEvent()
- */
- void HandleActionEnableEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionDisableEvent()
- */
- void HandleActionDisableEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionScrollUpEvent()
- */
- bool HandleActionScrollUpEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionScrollDownEvent()
- */
- bool HandleActionScrollDownEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPageLeftEvent()
- */
- bool HandleActionPageLeftEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPageRightEvent()
- */
- bool HandleActionPageRightEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPageUpEvent()
- */
- bool HandleActionPageUpEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPageDownEvent()
- */
- bool HandleActionPageDownEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionMoveToFirstEvent()
- */
- bool HandleActionMoveToFirstEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionMoveToLastEvent()
- */
- bool HandleActionMoveToLastEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadFromTopEvent()
- */
- bool HandleActionReadFromTopEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadFromNextEvent()
- */
- bool HandleActionReadFromNextEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionZoomEvent()
- */
- bool HandleActionZoomEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadPauseResumeEvent()
- */
- bool HandleActionReadPauseResumeEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionStartStopEvent()
- */
- bool HandleActionStartStopEvent();
-
-protected:
-
- /**
- * Destructor.
- */
- ~AccessibilityAdaptor() override;
-
-private:
-
- /**
- * @brief Called when the singleton is destroyed.
- *
- * @note This can be reimplemented for different platforms.
- * @return The instance of the AccessibilityAdaptor.
- */
- static void OnDestroy();
-
- // Undefined
- AccessibilityAdaptor( const AccessibilityAdaptor& );
- AccessibilityAdaptor& operator=( AccessibilityAdaptor& );
-
-protected:
-
- Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events.
-
- Vector2 mReadPosition; ///< ActionRead position
-
- AccessibilityActionHandler* mActionHandler; ///< The pointer of accessibility action handler
-
- AccessibilityGestureDetectorPtr mAccessibilityGestureDetector; ///< The accessibility gesture detector
-
- bool mIsEnabled : 1; ///< enable/disable the accessibility action
-
-public:
-
- // Helpers for public-api forwarding methods
-
- inline static Internal::Adaptor::AccessibilityAdaptor& GetImplementation(Dali::AccessibilityAdaptor& adaptor)
- {
- DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptor handle is empty" );
-
- BaseObject& handle = adaptor.GetBaseObject();
-
- return static_cast<Internal::Adaptor::AccessibilityAdaptor&>(handle);
- }
-
- inline static const Internal::Adaptor::AccessibilityAdaptor& GetImplementation(const Dali::AccessibilityAdaptor& adaptor)
- {
- DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptor handle is empty" );
-
- const BaseObject& handle = adaptor.GetBaseObject();
-
- return static_cast<const Internal::Adaptor::AccessibilityAdaptor&>(handle);
- }
-
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/common/accessibility-gesture-detector.h>
-
-// EXTERNAL INCLUDES
-#include <cmath>
-#include <dali/integration-api/events/touch-event-integ.h>
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
- const float MINIMUM_MOTION_DISTANCE_BEFORE_PAN( 15.0f );
- const float MINIMUM_MOTION_DISTANCE_BEFORE_PAN_SQUARED( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_BEFORE_PAN );
- const float MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO( 2.0f / 3.0f );
- const unsigned long MAXIMUM_TIME_DIFF_ALLOWED( 500 );
- const unsigned long MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS( 100 );
- const unsigned int MINIMUM_MOTION_EVENTS_BEFORE_PAN(2);
- const unsigned int MINIMUM_TOUCHES_BEFORE_PAN(1);
- const unsigned int MAXIMUM_TOUCHES_BEFORE_PAN(1);
-} // unnamed namespace
-
-
-AccessibilityGestureDetector::AccessibilityGestureDetector()
-: mState( CLEAR ),
- mScene(nullptr),
- mGestureHandler(nullptr),
- mPanning(false),
- mThresholdAdjustmentsRemaining( 0 ),
- mThresholdTotalAdjustments( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO ),
- mPrimaryTouchDownTime( 0 ),
- mMinimumTouchesRequired( MINIMUM_TOUCHES_BEFORE_PAN ),
- mMaximumTouchesRequired( MAXIMUM_TOUCHES_BEFORE_PAN ),
- mMinimumDistanceSquared( MINIMUM_MOTION_DISTANCE_BEFORE_PAN_SQUARED ),
- mMinimumMotionEvents( MINIMUM_MOTION_EVENTS_BEFORE_PAN ),
- mMotionEvents( 0 )
-{
-}
-
-AccessibilityGestureDetector::~AccessibilityGestureDetector()
-{
-}
-
-void AccessibilityGestureDetector::SetGestureHandler(AccessibilityGestureHandler& handler)
-{
- mGestureHandler = &handler;
-}
-
-void AccessibilityGestureDetector::EmitPan(const AccessibilityGestureEvent gesture)
-{
- if( mGestureHandler )
- {
- if(gesture.state == AccessibilityGestureEvent::STARTED)
- {
- mPanning = true;
- }
-
- if( mPanning )
- {
- mGestureHandler->HandlePanGesture(gesture);
-
- if( (gesture.state == AccessibilityGestureEvent::FINISHED) ||
- (gesture.state == AccessibilityGestureEvent::CANCELLED) )
- {
- mPanning = false;
- }
- }
- }
-}
-
-void AccessibilityGestureDetector::SendEvent(const Integration::TouchEvent& event)
-{
- PointState::Type primaryPointState(event.points[0].GetState());
-
- if (primaryPointState == PointState::INTERRUPTED)
- {
- if ( ( mState == STARTED ) || ( mState == POSSIBLE ) )
- {
- // If our pan had started and we are interrupted, then tell Core that pan is cancelled.
- mTouchEvents.push_back(event);
- SendPan(AccessibilityGestureEvent::CANCELLED, event);
- }
- mState = CLEAR; // We should change our state to CLEAR.
- mTouchEvents.clear();
- }
- else
- {
- switch (mState)
- {
- case CLEAR:
- {
- if ( ( primaryPointState == PointState::DOWN ) || ( primaryPointState == PointState::STATIONARY ) )
- {
- mPrimaryTouchDownLocation = event.points[0].GetScreenPosition();
- mPrimaryTouchDownTime = event.time;
- mMotionEvents = 0;
- if (event.GetPointCount() == mMinimumTouchesRequired)
- {
- // We have satisfied the minimum touches required for a pan, tell core that a gesture may be possible and change our state accordingly.
- mState = POSSIBLE;
- SendPan(AccessibilityGestureEvent::POSSIBLE, event);
- }
-
- mTouchEvents.push_back(event);
- }
- break;
- }
-
- case POSSIBLE:
- {
- unsigned int pointCount(event.GetPointCount());
- if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
- {
- if (primaryPointState == PointState::MOTION)
- {
- mTouchEvents.push_back(event);
- mMotionEvents++;
-
- Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
-
- if ( ( mMotionEvents >= mMinimumMotionEvents ) &&
- ( delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) ) )
- {
- // If the touch point(s) have moved enough distance to be considered a pan, then tell Core that the pan gesture has started and change our state accordingly.
- mState = STARTED;
- SendPan(AccessibilityGestureEvent::STARTED, event);
- }
- }
- else if (primaryPointState == PointState::UP)
- {
- Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
- if (delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) )
- {
- SendPan(AccessibilityGestureEvent::STARTED, event);
- mTouchEvents.push_back(event);
- SendPan(AccessibilityGestureEvent::FINISHED, event);
- }
- else
- {
- // If we have lifted the primary touch point then tell core the pan is cancelled and change our state to CLEAR.
- SendPan(AccessibilityGestureEvent::CANCELLED, event);
- }
- mState = CLEAR;
- mTouchEvents.clear();
- }
- }
- else
- {
- // We do not satisfy pan conditions, tell Core our Gesture has been cancelled.
- SendPan(AccessibilityGestureEvent::CANCELLED, event);
-
- if (pointCount == 1 && primaryPointState == PointState::UP)
- {
- // If we have lifted the primary touch point, then change our state to CLEAR...
- mState = CLEAR;
- mTouchEvents.clear();
- }
- else
- {
- // ...otherwise change it to FAILED.
- mState = FAILED;
- }
- }
- break;
- }
-
- case STARTED:
- {
- mTouchEvents.push_back(event);
-
- unsigned int pointCount(event.GetPointCount());
- if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
- {
- switch (primaryPointState)
- {
- case PointState::MOTION:
- // Pan is continuing, tell Core.
- SendPan(AccessibilityGestureEvent::CONTINUING, event);
- break;
-
- case PointState::UP:
- // Pan is finally finished when our primary point is lifted, tell Core and change our state to CLEAR.
- SendPan(AccessibilityGestureEvent::FINISHED, event);
- mState = CLEAR;
- mTouchEvents.clear();
- break;
-
- case PointState::STATIONARY:
- if (pointCount == mMinimumTouchesRequired)
- {
- Integration::PointContainerConstIterator iter = event.points.begin() + 1; // We already know the state of the first point
- for(; iter != event.points.end(); ++iter)
- {
- if(iter->GetState() == PointState::UP)
- {
- // The number of touch points will be less than the minimum required. Inform core and change our state to FINISHED.
- SendPan(AccessibilityGestureEvent::FINISHED, event);
- mState = FINISHED;
- break;
- }
- }
- }
- break;
-
- default:
- break;
- }
- }
- else
- {
- // We have gone outside of the pan requirements, inform Core that the gesture is finished.
- SendPan(AccessibilityGestureEvent::FINISHED, event);
-
- if (pointCount == 1 && primaryPointState == PointState::UP)
- {
- // If this was the primary point being released, then we change our state back to CLEAR...
- mState = CLEAR;
- mTouchEvents.clear();
- }
- else
- {
- // ...otherwise we change it to FINISHED.
- mState = FINISHED;
- }
- }
- break;
- }
-
- case FINISHED:
- case FAILED:
- {
- if (primaryPointState == PointState::UP)
- {
- // Change our state back to clear when the primary touch point is released.
- mState = CLEAR;
- mTouchEvents.clear();
- }
- break;
- }
- }
- }
-}
-
-void AccessibilityGestureDetector::SendPan(AccessibilityGestureEvent::State state, const Integration::TouchEvent& currentEvent)
-{
- AccessibilityGestureEvent gesture(state);
- gesture.currentPosition = currentEvent.points[0].GetScreenPosition();
- gesture.numberOfTouches = currentEvent.GetPointCount();
-
- if ( mTouchEvents.size() > 1 )
- {
- // Get the second last event in the queue, the last one is the current event
- const Integration::TouchEvent& previousEvent( *( mTouchEvents.rbegin() + 1 ) );
-
- Vector2 previousPosition( mPreviousPosition );
- uint32_t previousTime( previousEvent.time );
-
- // If we've just started then we want to remove the threshold from Core calculations.
- if ( state == AccessibilityGestureEvent::STARTED )
- {
- previousPosition = mPrimaryTouchDownLocation;
- previousTime = mPrimaryTouchDownTime;
-
- // If it's a slow pan, we do not want to phase in the threshold over the first few pan-events
- // A slow pan is defined as one that starts the specified number of milliseconds after the down-event
- if ( ( currentEvent.time - previousTime ) > MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS )
- {
- mThresholdAdjustmentsRemaining = mThresholdTotalAdjustments;
- mThresholdAdjustmentPerFrame = ( gesture.currentPosition - previousPosition ) / static_cast<float>( mThresholdTotalAdjustments );
- }
- else
- {
- mThresholdAdjustmentsRemaining = 0;
- mThresholdAdjustmentPerFrame = Vector2::ZERO;
- }
- }
-
- gesture.previousPosition = previousPosition;
- gesture.timeDelta = currentEvent.time - previousTime;
-
- // Apply the threshold with a phased approach
- if ( mThresholdAdjustmentsRemaining > 0 )
- {
- --mThresholdAdjustmentsRemaining;
- gesture.currentPosition -= mThresholdAdjustmentPerFrame * static_cast<float>( mThresholdAdjustmentsRemaining );
- }
-
- mPreviousPosition = gesture.currentPosition;
- }
- else
- {
- gesture.previousPosition = gesture.currentPosition;
- gesture.timeDelta = 0;
- }
-
- gesture.time = currentEvent.time;
-
- EmitPan(gesture);
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
-#define DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
-
-/*
- * Copyright (c) 2019 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
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-event.h>
-#include <dali/integration-api/scene.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-struct TouchEvent;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * Detects an accessibility pan gesture and sends it to the gesture handler.
- */
-class AccessibilityGestureDetector : public RefObject
-{
-public:
-
- /**
- * Constructor
- */
- AccessibilityGestureDetector();
-
- /**
- * Virtual destructor.
- */
- ~AccessibilityGestureDetector() override;
-
- /**
- * Set the handler to handle accessibility gestures.
- * @param[in] handler The Accessibility gesture handler.
- * @note Handlers should remove themselves when they are destroyed.
- */
- void SetGestureHandler(AccessibilityGestureHandler& handler);
-
- void SendEvent(const Integration::TouchEvent& event);
-
- void SendEvent(Integration::Scene& scene, const Integration::TouchEvent& event)
- {
- mScene = &scene;
- SendEvent(event);
- }
-
-private:
-
- /**
- * Emits the pan gesture event (performs some smoothing operation).
- * @param[in] state The state of the pan.
- * @param[in] currentEvent The latest touch event.
- */
- void SendPan(AccessibilityGestureEvent::State state, const Integration::TouchEvent& currentEvent);
-
- /**
- * Emits the pan gesture event to the gesture handler.
- * @param[in] gesture The pan gesture event.
- */
- void EmitPan(const AccessibilityGestureEvent gesture);
-
-private:
-
- /**
- * Internal state machine.
- */
- enum State
- {
- CLEAR, ///< No gesture detected.
- POSSIBLE, ///< The current touch event data suggests that a gesture is possible.
- STARTED, ///< A gesture has been detected.
- FINISHED, ///< A previously started pan gesture has finished.
- FAILED, ///< Current touch event data suggests a pan gesture is not possible.
- };
-
- State mState; ///< The current state of the detector.
-
- Integration::Scene* mScene;
- AccessibilityGestureHandler* mGestureHandler; ///< The pointer of accessibility gesture handler
- bool mPanning; ///< Keep track of panning state, when panning is occuring, this is true.
-
- std::vector<Integration::TouchEvent> mTouchEvents; ///< A container of all touch events after an initial down event.
-
- Vector2 mPrimaryTouchDownLocation; ///< The initial touch down point.
- Vector2 mThresholdAdjustmentPerFrame; ///< The adjustment per frame at the start of a slow pan.
- Vector2 mPreviousPosition; ///< The previous position.
-
- unsigned int mThresholdAdjustmentsRemaining; ///< No. of threshold adjustments still to apply (for a slow-pan).
- unsigned int mThresholdTotalAdjustments; ///< The total number of adjustments required.
-
- uint32_t mPrimaryTouchDownTime; ///< The initial touch down time.
- unsigned int mMinimumTouchesRequired; ///< The minimum touches required before a pan should be emitted.
- unsigned int mMaximumTouchesRequired; ///< The maximum touches after which a pan should not be emitted.
- unsigned int mMinimumDistanceSquared; ///< The minimum distance squared before pan should start.
- unsigned int mMinimumMotionEvents; ///< The minimum motion events before pan should start.
- unsigned int mMotionEvents; ///< The motion events received so far (before pan is emitted).
-};
-
-using AccessibilityGestureDetectorPtr = Dali::IntrusivePtr<AccessibilityGestureDetector>;
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
SET( adaptor_accessibility_common_src_files
${adaptor_accessibility_dir}/common/tts-player-factory.cpp
${adaptor_accessibility_dir}/common/tts-player-impl.cpp
- ${adaptor_accessibility_dir}/common/accessibility-adaptor-impl.cpp
- ${adaptor_accessibility_dir}/common/accessibility-gesture-detector.cpp
)
# module: accessibility, backend: tizen-wayland
SET( adaptor_accessibility_tizen_wayland_src_files
${adaptor_accessibility_dir}/tizen-wayland/tts-player-factory-tizen.cpp
${adaptor_accessibility_dir}/tizen-wayland/tts-player-impl-tizen.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/atspi-accessibility-tizen.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/accessibility-impl.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/accessible.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-accessible.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-action.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-base.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-collection.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-component.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-editable-text.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-impl.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-object.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-text.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-value.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/component.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/dbus-tizen.cpp
)
# module: accessibility, backend: tizen-common profile
SET( adaptor_accessibility_tizen_common_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-common/accessibility-adaptor-impl-tizen.cpp
)
# module: accessibility, backend: tizen-ivi profile
SET( adaptor_accessibility_tizen_ivi_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp
)
# module: accessibility, backend: tizen-mobile profile
SET( adaptor_accessibility_tizen_mobile_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp
)
# module: accessibility, backend: tizen-tv profile
SET( adaptor_accessibility_tizen_tv_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-tv/accessibility-adaptor-impl-tv.cpp
)
# module: accessibility, backend: tizen-wearable profile
SET( adaptor_accessibility_tizen_wearable_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp
)
# module: accessibility, backend: ubuntu
SET( adaptor_accessibility_ubuntu_src_files
- ${adaptor_accessibility_dir}/generic/accessibility-adaptor-impl-generic.cpp
- ${adaptor_accessibility_dir}/generic/atspi-accessibility-generic.cpp
${adaptor_accessibility_dir}/generic/tts-player-factory-generic.cpp
${adaptor_accessibility_dir}/generic/tts-player-impl-generic.cpp
)
# module: accessibility, backend: android
SET( adaptor_accessibility_android_src_files
- ${adaptor_accessibility_dir}/generic/accessibility-adaptor-impl-generic.cpp
${adaptor_accessibility_dir}/generic/tts-player-factory-generic.cpp
${adaptor_accessibility_dir}/generic/tts-player-impl-generic.cpp
)
# module: accessibility, backend: windows
SET( adaptor_accessibility_windows_src_files
- ${adaptor_accessibility_dir}/generic/accessibility-adaptor-impl-generic.cpp
+)
+
+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-base.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-collection.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-component.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-editable-text.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-impl.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-object.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-text.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-value.cpp
+ ${adaptor_accessibility_dir}/bridge/component.cpp
+ ${adaptor_accessibility_dir}/bridge/dbus-tizen.cpp
+)
+
+SET( adaptor_accessibility_atspi_dummy_src_files
+ ${adaptor_accessibility_dir}/bridge/dummy-atspi.cpp
)
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptor() );
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- // Nothing to do here
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2019 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.
- *
- */
-
-#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/devel-api/adaptor-framework/atspi-accessibility.h>
-#include <dali/integration-api/debug.h>
-
-void Dali::AtspiAccessibility::Pause()
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
-}
-
-void Dali::AtspiAccessibility::Resume()
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
-}
-
-void Dali::AtspiAccessibility::Say( const std::string &text, bool discardable, std::function<void(std::string)> callback )
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
-}
-
-int Dali::AtspiAccessibility::SetForcefully( bool turnOn )
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
- return -1;
-}
-
-int Dali::AtspiAccessibility::GetStatus()
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
- return -1;
-}
+++ /dev/null
-#ifndef DALI_INTERNAL_ATSPI_ACCESSIBILITY_OPTIONAL_H
-#define DALI_INTERNAL_ATSPI_ACCESSIBILITY_OPTIONAL_H
-
-/*
- * Copyright 2019 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 <cassert>
-#include <new>
-#include <type_traits>
-#include <utility>
-
-/**
- * Minimalistic implementation of standard library std::optional (c++17) for c++11 compiler.
- *
- * After project conversion to C++17 standard, this template class will be deleted and
- * Optional will point to std::optional.
- *
- * Allowed operations (note, to make code simplier, than original, value class must have accessible copy and move constructor):
- * - constructing empty (valueless) object
- * - copying Optional (with and without value)
- * - moving Optional (with and without value)
- * - querying, if Optional has value (via explicit operator bool), for example:
- * Optional<int> v = ...;
- * if (v) ... // if v has value, then do something
- * - accessing value (via operator *), for example:
- * Optional<int> v = ...;
- * auto z = *v; // z now has the same int, as v (copied)
- * auto &y = *v; // y now has REFERENCE to int inside v, so modifying y modifies v
- */
-
-template < typename A >
-class Optional
-{
- union
- {
- A place;
- };
- bool hasValue = false;
-
-public:
- /**
- * @brief Empty constructor.
- * Creates empty Optional object, which will be false in boolean context.
- * So:
- * \code{.cpp}
- * Optional<int> o;
- * if (o) printf("1\n");
- * \endcode
- * won't print 1.
- */
- Optional() {}
-
- /**
- * @brief Single element constructor, when implicit convertion can be applied.
- * This constructor will be selected, when type of given argument (U) is
- * implicitly convertable to expected type A. In other words following
- * code must be valid:
- * \code{.cpp}
- * A foo() {
- * return U();
- * }
- * \endcode
- * @param a value held by Optional object will be initialized from a.
- */
- template < typename U = A, typename std::enable_if<
- std::is_convertible< U&&, A >::value &&
- std::is_constructible< A, U&& >::value &&
- !std::is_same< typename std::decay< U >::type, Optional< A > >::value,
- int* >::type = nullptr >
- constexpr Optional( U&& a )
- : place( std::forward< U >( a ) ),
- hasValue( true )
- {
- }
-
- /**
- * @brief Single element constructor, when only explicit convertion can be applied.
- * This constructor will be selected, when type of given argument (U) is
- * convertable to expected type A.
- * @param a value held by Optional object will be initialized from a.
- */
- template < typename U = A, typename std::enable_if<
- !std::is_convertible< U&&, A >::value &&
- std::is_constructible< A, U&& >::value &&
- !std::is_same< typename std::decay< U >::type, Optional< A > >::value,
- int* >::type = nullptr >
- explicit constexpr Optional( U&& a )
- : place( std::forward< U >( a ) ),
- hasValue( true )
- {
- }
-
- /**
- * @brief Copy constructor.
- * @param v Optional value to copy from. Will cause to copy data held by object v,
- * if v has data.
- */
- Optional( const Optional& v ) : hasValue( v.hasValue )
- {
- if( hasValue )
- {
- new( &place ) A( v.place );
- }
- }
-
- /**
- * @brief Move constructor.
- * @param v Optional value to copy from. Will move data help by v, if any.
- * After construction \code{.cpp} bool(v) \endcode will be false.
- */
- Optional( Optional&& v ) : hasValue( v.hasValue )
- {
- if( hasValue )
- {
- new( &place ) A( std::move( v.place ) );
- }
- }
-
- /**
- * @brief Destructor.
- */
- ~Optional()
- {
- if( hasValue )
- {
- place.~A();
- }
- }
-
- /**
- * @brief Explicit bool operator
- * Will return true if and only if object is helding data.
- */
- explicit operator bool() const
- {
- return hasValue;
- }
-
- /**
- * @brief Accessor (*) operator
- * Will return modifiable reference to held object. Will assert, if not object is held.
- */
- A& operator*()
- {
- assert( hasValue );
- return place;
- }
-
- /**
- * @brief Accessor (*) const operator
- * Will return const reference to held object. Will assert, if not object is held.
- */
- const A& operator*() const
- {
- assert( hasValue );
- return place;
- }
-
- /**
- * @brief Accessor (->) operator
- * Will return pointer to held object allowing access to the value's members.
- * Will assert, if not object is held.
- */
- A* operator->()
- {
- assert( hasValue );
- return &place;
- }
-
- /**
- * @brief Accessor (->) operator
- * Will return pointer to (const) held object allowing access to the value's members.
- * Will assert, if not object is held.
- */
- const A* operator->() const
- {
- assert( hasValue );
- return &place;
- }
-
- /**
- * @brief Assignment operator
- * Will copy held value from v, if any.
- * @param v Value to copy from
- */
- Optional& operator=( const Optional& v )
- {
- if( this != &v )
- {
- if( hasValue != v.hasValue )
- {
- if( v.hasValue )
- {
- new( &place ) A( v.place );
- }
- else
- {
- place.~A();
- }
- hasValue = v.hasValue;
- }
- else if( hasValue )
- {
- place = v.place;
- }
- }
- return *this;
- }
-
- /**
- * @brief Assignment move operator
- * Will move held value from v, if any. In all cases v won't held a value
- * after assignment is done.
- * @param v Value to copy from
- */
- Optional& operator=( Optional&& v )
- {
- if( this != &v )
- {
- if( hasValue != v.hasValue )
- {
- if( v.hasValue )
- {
- new( &place ) A( std::move( v.place ) );
- }
- else
- {
- place.~A();
- }
- hasValue = v.hasValue;
- }
- else if( hasValue )
- {
- place = std::move( v.place );
- }
- }
- return *this;
- }
-
- /**
- * @brief Assignment operator from value of type held.
- * Will initialize held value from given parameter a.
- * Type of the parameter must be the same (barring cv convertions),
- * as the type of the value held.
- * @param a Value to copy from
- */
- template < class U, class = typename std::enable_if<
- std::is_same< typename std::remove_reference< U >::type, A >::value &&
- std::is_constructible< A, U >::value &&
- std::is_assignable< A&, U >::value >::type >
- Optional& operator=( U&& a )
- {
- if( hasValue )
- {
- place = std::forward< U >( a );
- }
- else
- {
- hasValue = true;
- new( &place ) A( std::forward< U >( a ) );
- }
- return *this;
- }
-};
-
-#endif // DALI_INTERNAL_ATSPI_ACCESSIBILITY_OPTIONAL_H
+++ /dev/null
-/*
- * Copyright (c) 2018 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/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-// Disabled Accessibility temporarily in Tizen platform
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- //vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- //vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return static_cast<bool>(isEnabled);
-}
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR" );
-#endif
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptor() );
- AccessibilityAdaptor& adaptorImpl = AccessibilityAdaptor::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#ifndef WAYLAND
-#include <dali/internal/system/linux/dali-ecore-x.h>
-#include <dali/internal/system/linux/dali-elementary.h>
-#endif
-
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-#ifndef WAYLAND
-#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
-#endif
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace // unnamed namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR");
-#endif
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return bool( isEnabled );
-}
-
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptorMobile() );
- AccessibilityAdaptorMobile& adaptorImpl = AccessibilityAdaptorMobile::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-AccessibilityAdaptorMobile::AccessibilityAdaptorMobile()
-{
-}
-
-bool AccessibilityAdaptorMobile::HandleActionNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionActivateEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionActivate();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- bool ret = false;
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y);
-
- mReadPosition.x = x;
- mReadPosition.y = y;
-
- if( mActionHandler )
- {
- // The accessibility actions should be handled by the registered accessibility action handler (e.g. focus manager)
- ret = mActionHandler->AccessibilityActionRead(allowReadAgain);
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-AccessibilityAdaptorMobile::~AccessibilityAdaptorMobile()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#ifndef WAYLAND
-#include <dali/internal/system/linux/dali-ecore-x.h>
-#include <dali/internal/system/linux/dali-elementary.h>
-#endif
-
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-#ifndef WAYLAND
-#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
-#endif
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace // unnamed namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR");
-#endif
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return bool( isEnabled );
-}
-
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptorMobile() );
- AccessibilityAdaptorMobile& adaptorImpl = AccessibilityAdaptorMobile::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-AccessibilityAdaptorMobile::AccessibilityAdaptorMobile()
-{
-}
-
-bool AccessibilityAdaptorMobile::HandleActionNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionActivateEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionActivate();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- bool ret = false;
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y);
-
- mReadPosition.x = x;
- mReadPosition.y = y;
-
- if( mActionHandler )
- {
- // The accessibility actions should be handled by the registered accessibility action handler (e.g. focus manager)
- ret = mActionHandler->AccessibilityActionRead(allowReadAgain);
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-AccessibilityAdaptorMobile::~AccessibilityAdaptorMobile()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_MOBILE_H
-#define DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_MOBILE_H
-
-/*
- * Copyright (c) 2019 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 <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
-#include <dali/devel-api/adaptor-framework/accessibility-action-handler.h>
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
-#include <dali/internal/accessibility/common/accessibility-gesture-detector.h>
-#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * This mobile version is different since it forwards events to the indicator.
- */
-class AccessibilityAdaptorMobile : public AccessibilityAdaptor
-{
-public:
-
- /**
- * Constructor.
- */
- AccessibilityAdaptorMobile();
-
- // From AccessibilityAdaptor base class
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionNextEvent()
- */
- virtual bool HandleActionNextEvent( bool allowEndFeedback );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPreviousEvent()
- */
- virtual bool HandleActionPreviousEvent( bool allowEndFeedback );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionActivateEvent()
- */
- virtual bool HandleActionActivateEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadEvent()
- */
- virtual bool HandleActionReadEvent( unsigned int x, unsigned int y, bool allowReadAgain );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadNextEvent()
- */
- virtual bool HandleActionReadNextEvent( bool allowEndFeedback );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadPreviousEvent()
- */
- virtual bool HandleActionReadPreviousEvent( bool allowEndFeedback );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionUpEvent()
- */
- virtual bool HandleActionUpEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionDownEvent()
- */
- virtual bool HandleActionDownEvent();
-
-private:
-
- /**
- * Destructor.
- */
- virtual ~AccessibilityAdaptorMobile();
-
- // Undefined
- AccessibilityAdaptorMobile( const AccessibilityAdaptorMobile& );
- AccessibilityAdaptorMobile& operator=( AccessibilityAdaptorMobile& );
-
-public:
-
- // Helpers for public-api forwarding methods
-
- inline static Internal::Adaptor::AccessibilityAdaptorMobile& GetImplementation(Dali::AccessibilityAdaptor& adaptor)
- {
- DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptorMobile handle is empty" );
-
- BaseObject& handle = adaptor.GetBaseObject();
-
- return static_cast<Internal::Adaptor::AccessibilityAdaptorMobile&>(handle);
- }
-
- inline static const Internal::Adaptor::AccessibilityAdaptorMobile& GetImplementation(const Dali::AccessibilityAdaptor& adaptor)
- {
- DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptorMobile handle is empty" );
-
- const BaseObject& handle = adaptor.GetBaseObject();
-
- return static_cast<const Internal::Adaptor::AccessibilityAdaptorMobile&>(handle);
- }
-
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_MOBILE_H
+++ /dev/null
-/*
- * Copyright (c) 2018 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/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-// Disabled Accessibility temporarily in Tizen platform
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- //vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- //vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return static_cast<bool>(isEnabled);
-}
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR" );
-#endif
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptor() );
- AccessibilityAdaptor& adaptorImpl = AccessibilityAdaptor::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#ifndef WAYLAND
-#include <dali/internal/system/linux/dali-ecore-x.h>
-#include <dali/internal/system/linux/dali-elementary.h>
-#endif
-
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-#ifndef WAYLAND
-#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
-#endif
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace // unnamed namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR");
-#endif
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return bool( isEnabled );
-}
-
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptorMobile() );
- AccessibilityAdaptorMobile& adaptorImpl = AccessibilityAdaptorMobile::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-AccessibilityAdaptorMobile::AccessibilityAdaptorMobile()
-{
-}
-
-bool AccessibilityAdaptorMobile::HandleActionNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionActivateEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionActivate();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- bool ret = false;
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y);
-
- mReadPosition.x = x;
- mReadPosition.y = y;
-
- if( mActionHandler)
- {
- // The accessibility actions should be handled by the registered accessibility action handler (e.g. focus manager)
- ret = mActionHandler->AccessibilityActionRead(allowReadAgain);
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-AccessibilityAdaptorMobile::~AccessibilityAdaptorMobile()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
#include <dali/public-api/object/object-registry.h>
#include <dali/public-api/events/wheel-event.h>
#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/context-notifier.h>
#include <dali/internal/system/common/callback-manager.h>
#include <dali/internal/accessibility/common/tts-player-impl.h>
-#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
#include <dali/internal/window-system/common/event-handler.h>
#include <dali/internal/graphics/gles/gl-proxy-implementation.h>
#include <dali/internal/graphics/gles/gl-implementation.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/internal/system/common/logging.h>
#include <dali/internal/system/common/locale-utils.h>
}
mConfigurationManager = Utils::MakeUnique<ConfigurationManager>( systemCachePath, eglGraphics, mThreadController );
+
+ auto appName = GetApplicationPackageName();
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ bridge->SetApplicationName( appName );
+ bridge->Initialize();
+ Dali::Stage::GetCurrent().KeyEventSignal().Connect( &accessibilityObserver, &AccessibilityObserver::OnAccessibleKeyEvent );
+}
+
+void Adaptor::AccessibilityObserver::OnAccessibleKeyEvent( const Dali::KeyEvent& event )
+{
+ Accessibility::KeyEventType type;
+ if( event.GetState() == Dali::KeyEvent::DOWN )
+ {
+ type = Accessibility::KeyEventType::KEY_PRESSED;
+ }
+ else if( event.GetState() == Dali::KeyEvent::UP )
+ {
+ type = Accessibility::KeyEventType::KEY_RELEASED;
+ }
+ else
+ {
+ return;
+ }
+ Dali::Accessibility::Bridge::GetCurrentBridge()->Emit( type, event.GetKeyCode(), event.GetKeyName(), event.GetTime(), !event.GetKeyString().empty() );
}
Adaptor::~Adaptor()
{
+ Accessibility::Bridge::GetCurrentBridge()->Terminate();
+
// Ensure stop status
Stop();
Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( maxTextureSize );
}
+ // Set cached isAdvancedBlendEquationSupported
+ GraphicsInterface* graphics = mGraphics.get(); // This interface is temporary until Core has been updated to match
+ auto eglGraphics = static_cast<EglGraphics *>( graphics );
+ GlImplementation& mGLES = eglGraphics->GetGlesInterface();
+ mGLES.SetIsAdvancedBlendEquationSupported( mConfigurationManager->IsAdvancedBlendEquationSupported() );
+ mGLES.SetShadingLanguageVersion( mConfigurationManager->GetShadingLanguageVersion() );
+
ProcessCoreEvents(); // Ensure any startup messages are processed.
// Initialize the image loader plugin
void Adaptor::OnWindowShown()
{
+ Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationShown();
+
if( PAUSED_WHILE_HIDDEN == mState )
{
// Adaptor can now be resumed
void Adaptor::OnWindowHidden()
{
+ Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationHidden();
+
if( RUNNING == mState || READY == mState )
{
bool allWindowsHidden = true;
#include <dali/internal/window-system/common/damage-observer.h>
#include <dali/internal/window-system/common/window-visibility-observer.h>
+#include <string>
+
namespace Dali
{
class RenderSurfaceInterface;
+namespace Accessibility
+{
+class Bridge;
+}
+
namespace Integration
{
class Core;
*/
void SceneCreated();
+ static std::string GetApplicationPackageName();
+
public: // AdaptorInternalServices implementation
/**
* @copydoc Dali::Adaptor::Start()
std::unique_ptr<Integration::AddOnManager> mAddOnManager; ///< Pointer to the addon manager
+ class AccessibilityObserver : public ConnectionTracker
+ {
+ public:
+ void OnAccessibleKeyEvent( const Dali::KeyEvent& event );
+ };
+ AccessibilityObserver accessibilityObserver;
+
public:
inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) { return *adaptor.mImpl; }
};
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
#include <dali/devel-api/adaptor-framework/style-monitor.h>
#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
#include <dali/integration-api/adaptor-framework/scene-holder.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/style-monitor.h>
#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/system/common/command-line-options.h>
#include <dali/internal/adaptor/common/framework.h>
void Application::QuitFromMainLoop()
{
+ Accessibility::Bridge::GetCurrentBridge()->Terminate();
+
mAdaptor->Stop();
mFramework->Quit();
// Run the adaptor
mAdaptor->Start();
+ Accessibility::Accessible::SetObjectRegistry(mAdaptor->GetObjectRegistry());
if( ! mStylesheet.empty() )
{
}
}
- eglGraphics->GetGlesInterface().ContextCreated();
+ GlImplementation& gles = eglGraphics->GetGlesInterface();
+ gles.ContextCreated();
+ eglGraphics->SetGlesVersion( gles.GetGlesVersion() );
// Tell core it has a context
mCore.ContextCreated();
namespace Adaptor
{
+std::string Adaptor::GetApplicationPackageName()
+{
+ return "";
+}
+
void Adaptor::GetDataStoragePath( std::string& path)
{
path = "";
#include <dali/internal/adaptor/tizen-wayland/dali-ecore-wayland.h>
#endif
+#include <aul.h>
+#include <unistd.h>
namespace Dali
{
} // namesapce
+std::string Adaptor::GetApplicationPackageName()
+{
+ char appname[4096] = {0};
+ int pid = getpid();
+ aul_app_get_pkgname_bypid( pid, appname, sizeof( appname ) );
+ return appname;
+}
+
void Adaptor::GetDataStoragePath( std::string& path)
{
#ifdef USE_APPFW
Impl()
{
Eldbus_Object *eldbus_obj;
+ eldbus_init();
cbhm_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
eldbus_obj = eldbus_object_get(cbhm_conn, CBHM_DBUS_INTERFACE, CBHM_DBUS_OBJPATH);
eldbus_proxy = eldbus_proxy_get(eldbus_obj, CBHM_DBUS_INTERFACE);
{
if (cbhm_conn)
eldbus_connection_unref(cbhm_conn);
+ eldbus_shutdown();
}
Eldbus_Proxy* cbhm_proxy_get()
{
const uint32_t THRESHOLD_SWAPBUFFER_COUNT = 5;
const uint32_t CHECK_EXTENSION_NUMBER = 4;
+ const uint32_t EGL_VERSION_SUPPORT_SURFACELESS_CONTEXT = 15;
const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context";
const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_context";
const std::string EGL_KHR_PARTIAL_UPDATE = "EGL_KHR_partial_update";
mIsOwnSurface = isOwnSurface;
}
- // Query EGL extensions to check whether surfaceless context is supported
+ const char* const versionStr = eglQueryString( mEglDisplay, EGL_VERSION );
const char* const extensionStr = eglQueryString( mEglDisplay, EGL_EXTENSIONS );
- std::istringstream stream( extensionStr );
- std::string currentExtension;
+
+ // Query EGL extensions to check whether required extensions are supported
+ std::istringstream versionStream( versionStr );
+ std::string majorVersion, minorVersion;
+ std::getline( versionStream, majorVersion, '.' );
+ std::getline( versionStream, minorVersion );
uint32_t extensionCheckCount = 0;
+ if( stoul( majorVersion ) * 10 + stoul( minorVersion ) >= EGL_VERSION_SUPPORT_SURFACELESS_CONTEXT )
+ {
+ mIsSurfacelessContextSupported = true;
+ mIsKhrCreateContextSupported = true;
+ extensionCheckCount += 2;
+ }
+
+ std::istringstream stream(extensionStr);
+ std::string currentExtension;
bool isKhrPartialUpdateSupported = false;
bool isKhrSwapBuffersWithDamageSupported = false;
- while( std::getline( stream, currentExtension, ' ' ) && extensionCheckCount < CHECK_EXTENSION_NUMBER )
+ while(std::getline(stream, currentExtension, ' ') && extensionCheckCount < CHECK_EXTENSION_NUMBER)
{
- if( currentExtension == EGL_KHR_SURFACELESS_CONTEXT )
+ if(currentExtension == EGL_KHR_SURFACELESS_CONTEXT && !mIsSurfacelessContextSupported)
{
mIsSurfacelessContextSupported = true;
extensionCheckCount++;
}
- if( currentExtension == EGL_KHR_CREATE_CONTEXT )
+ if(currentExtension == EGL_KHR_CREATE_CONTEXT && !mIsKhrCreateContextSupported)
{
mIsKhrCreateContextSupported = true;
extensionCheckCount++;
}
- if( currentExtension == EGL_KHR_PARTIAL_UPDATE )
+ if(currentExtension == EGL_KHR_PARTIAL_UPDATE)
{
isKhrPartialUpdateSupported = true;
extensionCheckCount++;
}
- if( currentExtension == EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE )
+ if(currentExtension == EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE)
{
isKhrSwapBuffersWithDamageSupported = true;
extensionCheckCount++;
}
}
- if( !isKhrPartialUpdateSupported || !isKhrSwapBuffersWithDamageSupported )
+ if(!isKhrPartialUpdateSupported || !isKhrSwapBuffersWithDamageSupported)
{
mPartialUpdateRequired = false;
}
" Extensions: %s\n",
mPartialUpdateRequired,
eglQueryString( mEglDisplay, EGL_VENDOR ),
- eglQueryString( mEglDisplay, EGL_VERSION ),
+ versionStr,
eglQueryString( mEglDisplay, EGL_CLIENT_APIS ),
extensionStr);
public:
/**
- * (Called from ECoreX::RenderSurface, not RenderThread, so not in i/f, hence, not virtual)
+ * (Called from RenderSurface, not RenderThread, so not in i/f, hence, not virtual)
* Initialize GL
* @param display The display
* @param isOwnSurface whether the surface is own or not
namespace Adaptor
{
-namespace ECoreX
-{
-
GlExtensions::GlExtensions()
:
#ifdef GL_EXT_discard_framebuffer
#endif
}
+bool GlExtensions::BlendBarrierKHR()
+{
+ // initialize extension on first use as on some hw platforms a context
+ // has to be bound for the extensions to return correct pointer
+ if( !mInitialized )
+ {
+ Initialize();
+ }
+
+#ifdef GL_KHR_blend_equation_advanced
+ if (mBlendBarrierKHR)
+ {
+ mBlendBarrierKHR();
+ return true;
+ }
+ return false;
+#endif
+
+ return false;
+}
+
void GlExtensions::Initialize()
{
mInitialized = true;
mGlGetProgramBinaryOES = reinterpret_cast< PFNGLGETPROGRAMBINARYOESPROC >( eglGetProcAddress("glGetProgramBinaryOES") );
mGlProgramBinaryOES = reinterpret_cast< PFNGLPROGRAMBINARYOESPROC >( eglGetProcAddress("glProgramBinaryOES") );
#endif
-}
-} // namespace ECoreX
+#ifdef GL_KHR_blend_equation_advanced
+ mBlendBarrierKHR = reinterpret_cast< PFNGLBLENDBARRIERKHRPROC >( eglGetProcAddress("glBlendBarrierKHR") );
+#endif
+}
} // namespace Adaptor
namespace Adaptor
{
-namespace ECoreX
-{
-
/**
* GlExtensions class provides GL extensions support
*/
*/
void ProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
+ /**
+ * KHR extension
+ * Specify a boundary between passes when using advanced blend equations.
+ */
+ bool BlendBarrierKHR ();
+
private:
/**
PFNGLPROGRAMBINARYOESPROC mGlProgramBinaryOES;
#endif
+#ifdef GL_KHR_blend_equation_advanced
+ PFNGLBLENDBARRIERKHRPROC mBlendBarrierKHR;
+#endif
+
bool mInitialized;
};
-} // namespace ECoreX
-
} // namespace Adaptor
} // namespace Internal
#define DALI_INTERNAL_GL_IMPLEMENTATION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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 <memory>
#include <cstdlib>
#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/devel-api/threading/conditional-wait.h>
+#include <dali/internal/graphics/common/egl-include.h>
// INTERNAL INCLUDES
#include <dali/internal/graphics/gles/gles-abstraction.h>
namespace Adaptor
{
+namespace
+{
+
+const int32_t INITIAL_GLES_VERSION = 30;
+const int32_t GLES_VERSION_SUPPORT_BLEND_EQUATION_ADVANCED = 32;
+const char* KHR_BLEND_EQUATION_ADVANCED = "GL_KHR_blend_equation_advanced";
+
+const char* FRAGMENT_SHADER_ADVANCED_BLEND_EQUATION_PREFIX =
+ "#extension GL_KHR_blend_equation_advanced : enable\n"
+
+ "#if GL_KHR_blend_equation_advanced==1 || __VERSION__>=320\n"
+ " layout(blend_support_all_equations) out;\n"
+ "#endif\n";
+
+const char* FRAGMENT_SHADER_OUTPUT_COLOR_STRING =
+ "out mediump vec4 fragColor;\n";
+}
+
/**
* GlImplementation is a concrete implementation for GlAbstraction.
* The class provides an OpenGL-ES 2.0 or 3.0 implementation.
public:
GlImplementation()
- : mGlesVersion( 30 ),
+ : mContextCreatedWaitCondition(),
+ mMaxTextureSize( 0 ),
+ mVertexShaderPrefix(""),
+ mGlesVersion( INITIAL_GLES_VERSION ),
+ mShadingLanguageVersion( 100 ),
+ mShadingLanguageVersionCached( false ),
mIsSurfacelessContextSupported( false ),
- mIsContextCreated( false ),
- mContextCreatedWaitCondition(),
- mMaxTextureSize( 0 )
+ mIsAdvancedBlendEquationSupportedCached( false ),
+ mIsAdvancedBlendEquationSupported( false ),
+ mIsContextCreated( false )
{
mImpl.reset( new Gles3Implementation() );
}
{
glGetIntegerv( GL_MAX_TEXTURE_SIZE, &mMaxTextureSize );
- if( !mIsContextCreated )
+ GLint majorVersion, minorVersion;
+ glGetIntegerv( GL_MAJOR_VERSION, &majorVersion );
+ glGetIntegerv( GL_MINOR_VERSION, &minorVersion );
+ mGlesVersion = majorVersion * 10 + minorVersion;
+
+ if( mGlesVersion >= GLES_VERSION_SUPPORT_BLEND_EQUATION_ADVANCED )
+ {
+ mIsAdvancedBlendEquationSupported = true;
+ }
+ else
{
- mContextCreatedWaitCondition.Notify();
+ // when mIsAdvancedBlendEquationSupported is cached, we don't need to check all the extensions.
+ if( !mIsAdvancedBlendEquationSupportedCached )
+ {
+ const char* const extensionStr = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
+ std::istringstream stream(extensionStr);
+ std::string currentExtension;
+ while(std::getline(stream, currentExtension, ' '))
+ {
+ if(currentExtension == KHR_BLEND_EQUATION_ADVANCED)
+ {
+ mIsAdvancedBlendEquationSupported = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if(!mShadingLanguageVersionCached)
+ {
+ std::istringstream shadingLanguageVersionStream(reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)));
+ std::string token;
+ uint32_t tokenCount = 0;
+ while(std::getline(shadingLanguageVersionStream, token, ' '))
+ {
+ if(tokenCount == 3 && token == "ES")
+ {
+ std::getline(shadingLanguageVersionStream, token, '.');
+ mShadingLanguageVersion = std::atoi(token.c_str());
+ mShadingLanguageVersion *= 100;
+ std::getline(shadingLanguageVersionStream, token, '.');
+ mShadingLanguageVersion += std::atoi(token.c_str());
+ break;
+ }
+ tokenCount++;
+ }
+ }
+
+ {
+ ConditionalWait::ScopedLock lock( mContextCreatedWaitCondition );
+ mIsContextCreated = true;
+ mContextCreatedWaitCondition.Notify( lock );
}
- mIsContextCreated = true;
}
void SetGlesVersion( const int32_t glesVersion )
{
- if( mGlesVersion != glesVersion )
+ if( mGlesVersion / 10 != glesVersion / 10 )
{
mGlesVersion = glesVersion;
if( mGlesVersion >= 30 )
return mIsSurfacelessContextSupported;
}
+ void SetIsAdvancedBlendEquationSupported(const bool isSupported)
+ {
+ mIsAdvancedBlendEquationSupported = isSupported;
+ mIsAdvancedBlendEquationSupportedCached = true;
+ }
+
+ bool IsAdvancedBlendEquationSupported()
+ {
+ ConditionalWait::ScopedLock lock( mContextCreatedWaitCondition );
+ if(!mIsContextCreated && !mIsAdvancedBlendEquationSupportedCached)
+ {
+ mContextCreatedWaitCondition.Wait( lock );
+ }
+ return mIsAdvancedBlendEquationSupported;
+ }
+
+ bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation)
+ {
+ switch(blendEquation)
+ {
+ case DevelBlendEquation::ADD:
+ case DevelBlendEquation::SUBTRACT:
+ case DevelBlendEquation::REVERSE_SUBTRACT:
+ {
+ return true;
+ }
+ case DevelBlendEquation::MIN:
+ case DevelBlendEquation::MAX:
+ {
+ return (GetGlesVersion() >= 30);
+ }
+ case DevelBlendEquation::MULTIPLY:
+ case DevelBlendEquation::SCREEN:
+ case DevelBlendEquation::OVERLAY:
+ case DevelBlendEquation::DARKEN:
+ case DevelBlendEquation::LIGHTEN:
+ case DevelBlendEquation::COLOR_DODGE:
+ case DevelBlendEquation::COLOR_BURN:
+ case DevelBlendEquation::HARD_LIGHT:
+ case DevelBlendEquation::SOFT_LIGHT:
+ case DevelBlendEquation::DIFFERENCE:
+ case DevelBlendEquation::EXCLUSION:
+ case DevelBlendEquation::HUE:
+ case DevelBlendEquation::SATURATION:
+ case DevelBlendEquation::COLOR:
+ case DevelBlendEquation::LUMINOSITY:
+ {
+ return IsAdvancedBlendEquationSupported();
+ }
+
+ default:
+ {
+ return false;
+ }
+ }
+
+ return false;
+ }
+
+ std::string GetShaderVersionPrefix()
+ {
+ if(mShaderVersionPrefix == "")
+ {
+ mShaderVersionPrefix = "#version " + std::to_string( GetShadingLanguageVersion() );
+ if(GetShadingLanguageVersion() < 300)
+ {
+ mShaderVersionPrefix += "\n";
+ }
+ else
+ {
+ mShaderVersionPrefix += " es\n";
+ }
+ }
+ return mShaderVersionPrefix;
+ }
+
+ std::string GetVertexShaderPrefix()
+ {
+ if(mVertexShaderPrefix == "")
+ {
+ mVertexShaderPrefix = GetShaderVersionPrefix();
+
+ if(GetShadingLanguageVersion() < 300)
+ {
+ mVertexShaderPrefix += "#define INPUT attribute\n";
+ mVertexShaderPrefix += "#define OUTPUT varying\n";
+ }
+ else
+ {
+ mVertexShaderPrefix += "#define INPUT in\n";
+ mVertexShaderPrefix += "#define OUTPUT out\n";
+ }
+ }
+ return mVertexShaderPrefix;
+ }
+
+ std::string GetFragmentShaderPrefix()
+ {
+ if(mFragmentShaderPrefix == "")
+ {
+ mFragmentShaderPrefix = GetShaderVersionPrefix();
+
+ if(GetShadingLanguageVersion() < 300)
+ {
+ mFragmentShaderPrefix += "#define INPUT varying\n";
+ mFragmentShaderPrefix += "#define OUT_COLOR gl_FragColor\n";
+ mFragmentShaderPrefix += "#define TEXTURE texture2D\n";
+ }
+ else
+ {
+ mFragmentShaderPrefix += "#define INPUT in\n";
+ mFragmentShaderPrefix += "#define OUT_COLOR fragColor\n";
+ mFragmentShaderPrefix += "#define TEXTURE texture\n";
+
+ if(IsAdvancedBlendEquationSupported())
+ {
+ mFragmentShaderPrefix += FRAGMENT_SHADER_ADVANCED_BLEND_EQUATION_PREFIX;
+ }
+
+ mFragmentShaderPrefix += FRAGMENT_SHADER_OUTPUT_COLOR_STRING;
+ }
+ }
+ return mFragmentShaderPrefix;
+ }
+
bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const override
{
bool convert = ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
int GetMaxTextureSize()
{
+ ConditionalWait::ScopedLock lock( mContextCreatedWaitCondition );
if( !mIsContextCreated )
{
- mContextCreatedWaitCondition.Wait();
+ mContextCreatedWaitCondition.Wait( lock );
}
return mMaxTextureSize;
}
+ int GetGlesVersion()
+ {
+ ConditionalWait::ScopedLock lock( mContextCreatedWaitCondition );
+ if( !mIsContextCreated )
+ {
+ mContextCreatedWaitCondition.Wait( lock );
+ }
+ return mGlesVersion;
+ }
+
+ void SetShadingLanguageVersion( int shadingLanguageVersion )
+ {
+ mShadingLanguageVersion = shadingLanguageVersion;
+ mShadingLanguageVersionCached = true;
+ }
+
+ int GetShadingLanguageVersion()
+ {
+ ConditionalWait::ScopedLock lock( mContextCreatedWaitCondition );
+ if( !mIsContextCreated && !mShadingLanguageVersionCached )
+ {
+ mContextCreatedWaitCondition.Wait( lock );
+ }
+ return mShadingLanguageVersion;
+ }
+
/* OpenGL ES 2.0 */
void ActiveTexture( GLenum texture ) override
mImpl->GetInternalformativ( target, internalformat, pname, bufSize, params );
}
+ void BlendBarrier(void)
+ {
+ if(mIsAdvancedBlendEquationSupported)
+ {
+ mImpl->BlendBarrier();
+ }
+ }
+
private:
- int32_t mGlesVersion;
- bool mIsSurfacelessContextSupported;
- bool mIsContextCreated;
- ConditionalWait mContextCreatedWaitCondition;
- GLint mMaxTextureSize;
std::unique_ptr<GlesAbstraction> mImpl;
+
+ ConditionalWait mContextCreatedWaitCondition;
+ GLint mMaxTextureSize;
+ std::string mShaderVersionPrefix;
+ std::string mVertexShaderPrefix;
+ std::string mFragmentShaderPrefix;
+ int32_t mGlesVersion;
+ int32_t mShadingLanguageVersion;
+ bool mShadingLanguageVersionCached;
+ bool mIsSurfacelessContextSupported;
+ bool mIsAdvancedBlendEquationSupportedCached;
+ bool mIsAdvancedBlendEquationSupported;
+ bool mIsContextCreated;
};
} // namespace Adaptor
#define DALI_INTERNAL_GLES_ABSTRACTION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
virtual void TexStorage3D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) = 0;
virtual void GetInternalformativ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params ) = 0;
+
+ virtual void BlendBarrier( void ) = 0;
};
} // namespace Adaptor
#define DALI_INTERNAL_GLES2_IMPLEMENTATION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
DALI_LOG_ERROR( "glGetInternalformativ is not supported in OpenGL es 2.0\n" );
}
+ void BlendBarrier( void ) override
+ {
+ DALI_LOG_ERROR( "BlendBarrier is not supported in OpenGL es 2.0\n" );
+ }
+
private:
- ECoreX::GlExtensions mGlExtensions;
+ GlExtensions mGlExtensions;
};
} // namespace Adaptor
#define DALI_INTERNAL_GLES3_IMPLEMENTATION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
// EXTERNAL INCLUDES
#include <GLES3/gl3.h>
+#include <GLES3/gl32.h>
// INTERNAL INCLUDES
#include <dali/internal/graphics/gles/gles-abstraction.h>
{
glGetInternalformativ( target, internalformat, pname, bufSize, params );
}
+
+ void BlendBarrier( void ) override
+ {
+ if(!mGlExtensions.BlendBarrierKHR())
+ {
+ glBlendBarrier();
+ }
+ }
+
+private:
+ GlExtensions mGlExtensions;
};
} // namespace Adaptor
const std::string SYSTEM_CACHE_FILE = "gpu-environment.conf";
const std::string DALI_ENV_MULTIPLE_WINDOW_SUPPORT = "DALI_ENV_MULTIPLE_WINDOW_SUPPORT";
+const std::string DALI_BLEND_EQUATION_ADVANCED_SUPPORT = "DALI_BLEND_EQUATION_ADVANCED_SUPPORT";
+const std::string DALI_GLSL_VERSION = "DALI_GLSL_VERSION";
bool RetrieveKeyFromConfigFile( std::iostream& stream, const std::string& key, std::string& value )
{
mThreadController( threadController ),
mMaxTextureSize( 0u ),
mIsMultipleWindowSupported( true ),
- mMaxTextureSizeCached( false ) ,
- mIsMultipleWindowSupportedCached( false )
+ mIsAdvancedBlendEquationSupported( true ),
+ mMaxTextureSizeCached( false ),
+ mIsMultipleWindowSupportedCached( false ),
+ mIsAdvancedBlendEquationSupportedCached( false ),
+ mGlslVersionCached( false )
{
}
mMaxTextureSizeCached = true;
}
+ if( !mGlslVersionCached &&
+ RetrieveKeyFromConfigFile( stream, DALI_GLSL_VERSION, value ) )
+ {
+ mGlslVersion = std::atoi( value.c_str() );
+ mGlslVersionCached = true;
+ }
+
if( !mIsMultipleWindowSupportedCached &&
RetrieveKeyFromConfigFile( stream, DALI_ENV_MULTIPLE_WINDOW_SUPPORT, value ) )
{
mIsMultipleWindowSupported = std::atoi( value.c_str() );
mIsMultipleWindowSupportedCached = true;
}
+
+ if( !mIsAdvancedBlendEquationSupportedCached &&
+ RetrieveKeyFromConfigFile( stream, DALI_BLEND_EQUATION_ADVANCED_SUPPORT, value ) )
+ {
+ mIsAdvancedBlendEquationSupported = std::atoi( value.c_str() );
+ mIsAdvancedBlendEquationSupportedCached = true;
+ }
}
}
-unsigned int ConfigurationManager::GetMaxTextureSize()
+uint32_t ConfigurationManager::GetMaxTextureSize()
{
if( !mMaxTextureSizeCached )
{
return mMaxTextureSize;
}
+uint32_t ConfigurationManager::GetShadingLanguageVersion()
+{
+ if ( !mGlslVersionCached )
+ {
+ RetrieveKeysFromConfigFile( mSystemCacheFilePath );
+
+ if ( !mGlslVersionCached )
+ {
+ EglImplementation& eglImpl = mEglGraphics->GetEglImplementation();
+ if ( !eglImpl.IsGlesInitialized() )
+ {
+ // Wait until GLES is initialised, but this will happen once.
+ // This method blocks until the render thread has initialised the graphics.
+ mThreadController->WaitForGraphicsInitialization();
+ }
+
+ // Query from GLES and save the cache
+ mGlslVersion = mEglGraphics->GetGlesInterface().GetShadingLanguageVersion();
+ DALI_LOG_ERROR("mGlslVersion : %d\n", mGlslVersion);
+ mGlslVersionCached = true;
+
+ Dali::FileStream configFile( mSystemCacheFilePath, Dali::FileStream::READ | Dali::FileStream::APPEND | Dali::FileStream::TEXT );
+ std::fstream& stream = dynamic_cast<std::fstream&>( configFile.GetStream() );
+ if ( stream.is_open() )
+ {
+ stream << DALI_GLSL_VERSION << " " << mGlslVersion << std::endl;
+ }
+ else
+ {
+ DALI_LOG_ERROR( "Fail to open file : %s\n", mSystemCacheFilePath.c_str() );
+ }
+ }
+ }
+
+ return mGlslVersion;
+}
+
bool ConfigurationManager::IsMultipleWindowSupported()
{
if ( !mIsMultipleWindowSupportedCached )
return mIsMultipleWindowSupported;
}
+bool ConfigurationManager::IsAdvancedBlendEquationSupported()
+{
+ if ( !mIsAdvancedBlendEquationSupportedCached )
+ {
+ RetrieveKeysFromConfigFile( mSystemCacheFilePath );
+
+ if ( !mIsAdvancedBlendEquationSupportedCached )
+ {
+ EglImplementation& eglImpl = mEglGraphics->GetEglImplementation();
+ if ( !eglImpl.IsGlesInitialized() )
+ {
+ // Wait until GLES is initialised, but this will happen once.
+ // This method blocks until the render thread has initialised the graphics.
+ mThreadController->WaitForGraphicsInitialization();
+ }
+
+ // Query from GLES and save the cache
+ mIsAdvancedBlendEquationSupported = mEglGraphics->GetGlesInterface().IsAdvancedBlendEquationSupported();
+ mIsAdvancedBlendEquationSupportedCached = true;
+
+ Dali::FileStream configFile( mSystemCacheFilePath, Dali::FileStream::READ | Dali::FileStream::APPEND | Dali::FileStream::TEXT );
+ std::fstream& stream = dynamic_cast<std::fstream&>( configFile.GetStream() );
+ if ( stream.is_open() )
+ {
+ stream << DALI_BLEND_EQUATION_ADVANCED_SUPPORT << " " << mIsAdvancedBlendEquationSupported << std::endl;
+ }
+ else
+ {
+ DALI_LOG_ERROR( "Fail to open file : %s\n", mSystemCacheFilePath.c_str() );
+ }
+ }
+ }
+
+ return mIsAdvancedBlendEquationSupported;
+}
+
} // Adaptor
} // Internal
/**
* This class retrieves and caches the system configuration.
- *
+ * Some of the methods in this class can block system until GL has been initialized,
+ * only at the first time the DALi application is launched in the system.
*/
class ConfigurationManager
{
* @brief Get the maximum texture size.
* @return The maximum texture size
*/
- unsigned int GetMaxTextureSize();
+ uint32_t GetMaxTextureSize();
+
+ /**
+ * @brief Get the GLSL version that the system supports
+ * @return the GLSL version.
+ */
+ uint32_t GetShadingLanguageVersion();
/**
* @brief Check whether multiple window is supported
*/
bool IsMultipleWindowSupported();
+ /**
+ * @brief Check whether blend equation advanced (extension) is supported
+ * @return Whether blend equation advanced (extension is supported
+ */
+ bool IsAdvancedBlendEquationSupported();
+
// Deleted copy constructor.
ConfigurationManager( const ConfigurationManager& ) = delete;
EglGraphics* mEglGraphics; ///< EGL graphics
ThreadController* mThreadController; ///< The thread controller
unsigned int mMaxTextureSize; ///< The largest texture that the GL can handle
+ unsigned int mGlslVersion; ///< The GLSL version that the system supports.
bool mIsMultipleWindowSupported:1; ///< Whether multiple window is supported by the GLES
+ bool mIsAdvancedBlendEquationSupported:1; ///< Whether blend equation advanced (extension) is supported by the GLES
bool mMaxTextureSizeCached:1; ///< Whether we have checked the maximum texture size
bool mIsMultipleWindowSupportedCached:1; ///< Whether we have checked the support of multiple window
+ bool mIsAdvancedBlendEquationSupportedCached:1;///< Whether we have checked the support of blend equation advanced (extension)
+ bool mGlslVersionCached:1; ///< Whether we have checked the GLSL version
};
} // Adaptor
#include <dali/internal/system/common/time-service.h>
// EXTERNAL INCLUDES
-#include <ctime>
+#include <chrono>
+#include <thread>
namespace Dali
{
namespace TimeService
{
-namespace
+void GetNanoseconds( uint64_t& timeInNanoseconds )
{
-const uint64_t NANOSECONDS_PER_SECOND = 1e+9;
+ // Get the time of a monotonic clock since its epoch.
+ auto epoch = std::chrono::steady_clock::now().time_since_epoch();
+
+ auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(epoch);
+
+ timeInNanoseconds = static_cast<uint64_t>(duration.count());
}
-void GetNanoseconds( uint64_t& timeInNanoseconds )
+uint32_t GetMilliSeconds()
{
- timespec timeSpec;
- if( clock_gettime( CLOCK_MONOTONIC, &timeSpec ) == 0 )
- {
- // Convert all values to uint64_t to match our return type
- timeInNanoseconds = ( static_cast< uint64_t >( timeSpec.tv_sec ) * NANOSECONDS_PER_SECOND ) + static_cast< uint64_t >( timeSpec.tv_nsec );
- }
- else
- {
- timeInNanoseconds = 0;
- }
+ // Get the time of a monotonic clock since its epoch.
+ auto epoch = std::chrono::steady_clock::now().time_since_epoch();
+
+ auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(epoch);
+
+ return static_cast<uint32_t>(duration.count());
}
+
void SleepUntil( uint64_t timeInNanoseconds )
{
- timespec timeSpec;
- timeSpec.tv_sec = timeInNanoseconds / NANOSECONDS_PER_SECOND;
- timeSpec.tv_nsec = timeInNanoseconds % NANOSECONDS_PER_SECOND;
-
- // clock_nanosleep returns 0 if it sleeps for the period specified, otherwise it returns an error value
- // If an error value is returned, just sleep again till the absolute time specified
- while( clock_nanosleep( CLOCK_MONOTONIC, TIMER_ABSTIME, &timeSpec, NULL ) )
- {
- }
+ using Clock = std::chrono::steady_clock;
+ using TimePoint = std::chrono::time_point<Clock>;
+
+ const Clock::duration duration = std::chrono::nanoseconds(timeInNanoseconds);
+ const TimePoint timePoint(duration);
+
+ std::this_thread::sleep_until(timePoint);
}
} // namespace TimeService
{
/**
- * @brief Get the monotonic time since some unspecified starting point (usually the boot time).
+ * @brief Get the monotonic time since the clock's epoch.
*
* @param[out] timeInNanoseconds The time in nanoseconds since the reference point.
*
void GetNanoseconds( uint64_t& timeInNanoseconds );
/**
- * @brief Sleeps until the monotonic time specified since some unspecified starting point (usually the boot time).
+ * @brief Get the monotonic time since the clock's epoch.
+ *
+ * @return The time in milliseconds since the reference point.
+ *
+ * @note The maximum value that can be returned is 0xFFFFFFFF which is 4,294,967,295. Therefore, this can overflow after approximately 49 days.
+ */
+uint32_t GetMilliSeconds();
+
+/**
+ * @brief Sleeps until the monotonic time specified since the clock's epoch.
*
* If the time specified has already passed, then it returns immediately.
*
{
}
-void WindowBaseAndroid::SetType( Dali::Window::Type type )
+void WindowBaseAndroid::SetType( Dali::WindowType type )
{
}
-bool WindowBaseAndroid::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+bool WindowBaseAndroid::SetNotificationLevel( Dali::WindowNotificationLevel level )
{
return false;
}
-Dali::Window::NotificationLevel::Type WindowBaseAndroid::GetNotificationLevel() const
+Dali::WindowNotificationLevel WindowBaseAndroid::GetNotificationLevel() const
{
- return Dali::Window::NotificationLevel::NONE;
+ return Dali::WindowNotificationLevel::NONE;
}
void WindowBaseAndroid::SetOpaqueState( bool opaque )
{
}
-bool WindowBaseAndroid::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+bool WindowBaseAndroid::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
return false;
}
-Dali::Window::ScreenOffMode::Type WindowBaseAndroid::GetScreenOffMode() const
+WindowScreenOffMode WindowBaseAndroid::GetScreenOffMode() const
{
- return Dali::Window::ScreenOffMode::TIMEOUT;
+ return WindowScreenOffMode::TIMEOUT;
}
bool WindowBaseAndroid::SetBrightness( int brightness )
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::WindowType type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::WindowNotificationLevel level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::WindowNotificationLevel GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ WindowScreenOffMode GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
} // unnamed namespace
#endif
-#ifdef DALI_ELDBUS_AVAILABLE
-namespace
-{
-
-// Copied from x server
-static uint32_t GetCurrentMilliSeconds(void)
-{
- struct timeval tv;
-
- struct timespec tp;
- static clockid_t clockid;
-
- if (!clockid)
- {
-#ifdef CLOCK_MONOTONIC_COARSE
- if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
- (tp.tv_nsec / 1000) <= 1000 && clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
- {
- clockid = CLOCK_MONOTONIC_COARSE;
- }
- else
-#endif
- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
- {
- clockid = CLOCK_MONOTONIC;
- }
- else
- {
- clockid = ~0L;
- }
- }
- if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
- {
- return static_cast<uint32_t>( (tp.tv_sec * 1000 ) + (tp.tv_nsec / 1000000L) );
- }
-
- gettimeofday(&tv, NULL);
- return static_cast<uint32_t>( (tv.tv_sec * 1000 ) + (tv.tv_usec / 1000) );
-}
-
-} // unnamed namespace
-#endif
-
EventHandler::EventHandler( WindowBase* windowBase, DamageObserver& damageObserver )
: mStyleMonitor( StyleMonitor::Get() ),
mDamageObserver( damageObserver ),
- mAccessibilityAdaptor( AccessibilityAdaptor::Get() ),
mClipboardEventNotifier( ClipboardEventNotifier::Get() ),
mClipboard( Clipboard::Get() ),
mPaused( false )
windowBase->SelectionDataSendSignal().Connect( this, &EventHandler::OnSelectionDataSend );
windowBase->SelectionDataReceivedSignal().Connect( this, &EventHandler::OnSelectionDataReceived );
windowBase->StyleChangedSignal().Connect( this, &EventHandler::OnStyleChanged );
- windowBase->AccessibilitySignal().Connect( this, &EventHandler::OnAccessibilityNotification );
}
else
{
SendEvent( styleChange );
}
-void EventHandler::OnAccessibilityNotification( const WindowBase::AccessibilityInfo& info )
-{
-#ifdef DALI_ELDBUS_AVAILABLE
- if( mPaused )
- {
- return;
- }
-
- if( !mAccessibilityAdaptor )
- {
- DALI_LOG_ERROR( "Invalid accessibility adaptor\n" );
- return;
- }
-
- AccessibilityAdaptor* accessibilityAdaptor( &AccessibilityAdaptor::GetImplementation( mAccessibilityAdaptor ) );
- if( !accessibilityAdaptor )
- {
- DALI_LOG_ERROR( "Cannot access accessibility adaptor\n" );
- return;
- }
-
- // Create a touch point object.
- PointState::Type touchPointState( PointState::DOWN );
- if( info.state == 0 )
- {
- touchPointState = PointState::DOWN; // Mouse down.
- }
- else if( info.state == 1 )
- {
- touchPointState = PointState::MOTION; // Mouse move.
- }
- else if( info.state == 2 )
- {
- touchPointState = PointState::UP; // Mouse up.
- }
- else
- {
- touchPointState = PointState::INTERRUPTED; // Error.
- }
-
- // Send touch event to accessibility adaptor.
- TouchPoint point( 0, touchPointState, static_cast< float >( info.startX ), static_cast< float >( info.startY ) );
-
- // Perform actions based on received gestures.
- // Note: This is seperated from the reading so we can have other input readers without changing the below code.
- switch( info.gestureValue )
- {
- case 0: // OneFingerHover
- {
- // Focus, read out.
- accessibilityAdaptor->HandleActionReadEvent( static_cast< unsigned int >( info.startX ), static_cast< unsigned int >( info.startY ), true /* allow read again */ );
- break;
- }
- case 1: // TwoFingersHover
- {
- // In accessibility mode, scroll action should be handled when the currently focused actor is contained in scrollable control
- accessibilityAdaptor->HandleActionScrollEvent( point, GetCurrentMilliSeconds() );
- break;
- }
- case 2: // ThreeFingersHover
- {
- // Read from top item on screen continuously.
- accessibilityAdaptor->HandleActionReadFromTopEvent();
- break;
- }
- case 3: // OneFingerFlickLeft
- {
- // Move to previous item.
- accessibilityAdaptor->HandleActionReadPreviousEvent();
- break;
- }
- case 4: // OneFingerFlickRight
- {
- // Move to next item.
- accessibilityAdaptor->HandleActionReadNextEvent();
- break;
- }
- case 5: // OneFingerFlickUp
- {
- // Move to previous item.
- accessibilityAdaptor->HandleActionPreviousEvent();
- break;
- }
- case 6: // OneFingerFlickDown
- {
- // Move to next item.
- accessibilityAdaptor->HandleActionNextEvent();
- break;
- }
- case 7: // TwoFingersFlickUp
- {
- // Scroll up the list.
- accessibilityAdaptor->HandleActionScrollUpEvent();
- break;
- }
- case 8: // TwoFingersFlickDown
- {
- // Scroll down the list.
- accessibilityAdaptor->HandleActionScrollDownEvent();
- break;
- }
- case 9: // TwoFingersFlickLeft
- {
- // Scroll left to the previous page
- accessibilityAdaptor->HandleActionPageLeftEvent();
- break;
- }
- case 10: // TwoFingersFlickRight
- {
- // Scroll right to the next page
- accessibilityAdaptor->HandleActionPageRightEvent();
- break;
- }
- case 11: // ThreeFingersFlickLeft
- {
- // Not exist yet
- break;
- }
- case 12: // ThreeFingersFlickRight
- {
- // Not exist yet
- break;
- }
- case 13: // ThreeFingersFlickUp
- {
- // Not exist yet
- break;
- }
- case 14: // ThreeFingersFlickDown
- {
- // Not exist yet
- break;
- }
- case 15: // OneFingerSingleTap
- {
- // Focus, read out.
- accessibilityAdaptor->HandleActionReadEvent( static_cast< unsigned int >( info.startX ), static_cast< unsigned int >( info.startY ), true /* allow read again */ );
- break;
- }
- case 16: // OneFingerDoubleTap
- {
- // Activate selected item / active edit mode.
- accessibilityAdaptor->HandleActionActivateEvent();
- break;
- }
- case 17: // OneFingerTripleTap
- {
- // Zoom
- accessibilityAdaptor->HandleActionZoomEvent();
- break;
- }
- case 18: // TwoFingersSingleTap
- {
- // Pause/Resume current speech
- accessibilityAdaptor->HandleActionReadPauseResumeEvent();
- break;
- }
- case 19: // TwoFingersDoubleTap
- {
- // Start/Stop current action
- accessibilityAdaptor->HandleActionStartStopEvent();
- break;
- }
- case 20: // TwoFingersTripleTap
- {
- // Read information from indicator
- // Not supported
- break;
- }
- case 21: // ThreeFingersSingleTap
- {
- // Read from top item on screen continuously.
- accessibilityAdaptor->HandleActionReadFromTopEvent();
- break;
- }
- case 22: // ThreeFingersDoubleTap
- {
- // Read from next item continuously.
- accessibilityAdaptor->HandleActionReadFromNextEvent();
- break;
- }
- case 23: // ThreeFingersTripleTap
- {
- // Not exist yet
- break;
- }
- case 24: // OneFingerFlickLeftReturn
- {
- // Scroll up to the previous page
- accessibilityAdaptor->HandleActionPageUpEvent();
- break;
- }
- case 25: // OneFingerFlickRightReturn
- {
- // Scroll down to the next page
- accessibilityAdaptor->HandleActionPageDownEvent();
- break;
- }
- case 26: // OneFingerFlickUpReturn
- {
- // Move to the first item on screen
- accessibilityAdaptor->HandleActionMoveToFirstEvent();
- break;
- }
- case 27: // OneFingerFlickDownReturn
- {
- // Move to the last item on screen
- accessibilityAdaptor->HandleActionMoveToLastEvent();
- break;
- }
- case 28: // TwoFingersFlickLeftReturn
- {
- // Not exist yet
- break;
- }
- case 29: // TwoFingersFlickRightReturn
- {
- // Not exist yet
- break;
- }
- case 30: // TwoFingersFlickUpReturn
- {
- // Not exist yet
- break;
- }
- case 31: // TwoFingersFlickDownReturn
- {
- // Not exist yet
- break;
- }
- case 32: // ThreeFingersFlickLeftReturn
- {
- // Not exist yet
- break;
- }
- case 33: // ThreeFingersFlickRightReturn
- {
- // Not exist yet
- break;
- }
- case 34: // ThreeFingersFlickUpReturn
- {
- // Not exist yet
- break;
- }
- case 35: // ThreeFingersFlickDownReturn
- {
- // Not exist yet
- break;
- }
- }
-#endif
-}
-
void EventHandler::AddObserver( Observer& observer )
{
ObserverContainer::iterator match ( find(mObservers.begin(), mObservers.end(), &observer) );
#include <dali/devel-api/adaptor-framework/style-monitor.h>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
#include <dali/internal/clipboard/common/clipboard-event-notifier-impl.h>
#include <dali/internal/window-system/common/damage-observer.h>
#include <dali/internal/window-system/common/window-base.h>
*/
void OnStyleChanged( StyleChange::Type styleChange );
- /**
- * Called when Ecore ElDBus accessibility event is received.
- */
- void OnAccessibilityNotification( const WindowBase::AccessibilityInfo& info );
-
private:
// Undefined
Dali::StyleMonitor mStyleMonitor; ///< Handle to the style monitor, set on construction, to send font size and font change events to.
DamageObserver& mDamageObserver; ///< Reference to the DamageObserver, set on construction, to sent damage events to.
- Dali::AccessibilityAdaptor mAccessibilityAdaptor; ///< Pointer to the accessibility adaptor
Dali::ClipboardEventNotifier mClipboardEventNotifier; ///< Pointer to the clipboard event notifier
Dali::Clipboard mClipboard;///< Pointer to the clipboard
mFocusChangeSignal(),
mResizeSignal(),
mVisibilityChangedSignal(),
- mGLInitCallback( 0 ),
- mGLRenderFrameCallback( 0 ),
- mGLTerminateCallback( 0 ),
+ mGLInitCallback(),
+ mGLRenderFrameCallback(),
+ mGLTerminateCallback(),
mGLRenderCallback( nullptr ),
mEGLSurface( nullptr ),
mEGLContext( nullptr ),
if( mGLTerminateCallback )
{
- mGLTerminateCallback();
+ CallbackBase::Execute(*mGLTerminateCallback);
}
if( mIsEGLInitialize )
mWindowBase->SetAvailableAnlges( angles );
}
-bool GlWindow::IsOrientationAvailable( Dali::GlWindow::GlWindowOrientation orientation ) const
+bool GlWindow::IsOrientationAvailable( WindowOrientation orientation ) const
{
- if( orientation <= Dali::GlWindow::GlWindowOrientation::NO_ORIENTATION_PREFERENCE
- || orientation > Dali::GlWindow::GlWindowOrientation::LANDSCAPE_INVERSE )
+ if( orientation <= WindowOrientation::NO_ORIENTATION_PREFERENCE
+ || orientation > WindowOrientation::LANDSCAPE_INVERSE )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::IsOrientationAvailable: Invalid input orientation [%d]\n", orientation );
return false;
return true;
}
-int GlWindow::ConvertToAngle( Dali::GlWindow::GlWindowOrientation orientation )
+int GlWindow::ConvertToAngle( WindowOrientation orientation )
{
int convertAngle = 0;
if ( mOrientationMode == 0 )
{
- convertAngle = ( static_cast< int >( orientation ) ) * 90;
+ convertAngle = static_cast< int >( orientation );
}
else if( mOrientationMode == 1)
{
switch( orientation )
{
- case Dali::GlWindow::GlWindowOrientation::LANDSCAPE:
+ case WindowOrientation::LANDSCAPE:
{
convertAngle = 0;
break;
}
- case Dali::GlWindow::GlWindowOrientation::PORTRAIT:
+ case WindowOrientation::PORTRAIT:
{
convertAngle = 90;
break;
}
- case Dali::GlWindow::GlWindowOrientation::LANDSCAPE_INVERSE:
+ case WindowOrientation::LANDSCAPE_INVERSE:
{
convertAngle = 180;
break;
}
- case Dali::GlWindow::GlWindowOrientation::PORTRAIT_INVERSE:
+ case WindowOrientation::PORTRAIT_INVERSE:
{
convertAngle = 270;
break;
}
- case Dali::GlWindow::GlWindowOrientation::NO_ORIENTATION_PREFERENCE:
+ case WindowOrientation::NO_ORIENTATION_PREFERENCE:
{
convertAngle = -1;
break;
return convertAngle;
}
-Dali::GlWindow::GlWindowOrientation GlWindow::ConvertToOrientation( int angle ) const
+WindowOrientation GlWindow::ConvertToOrientation( int angle ) const
{
- Dali::GlWindow::GlWindowOrientation orientation = Dali::GlWindow::GlWindowOrientation::NO_ORIENTATION_PREFERENCE;
+ WindowOrientation orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
if ( mOrientationMode == 0 ) // Portrate mode
{
- orientation = static_cast< Dali::GlWindow::GlWindowOrientation >( angle / 90 );
+ orientation = static_cast< WindowOrientation >( angle );
}
else if( mOrientationMode == 1 ) // Landscape mode
{
{
case 0:
{
- orientation = Dali::GlWindow::GlWindowOrientation::LANDSCAPE;
+ orientation = WindowOrientation::LANDSCAPE;
break;
}
case 90:
{
- orientation = Dali::GlWindow::GlWindowOrientation::PORTRAIT;
+ orientation = WindowOrientation::PORTRAIT;
break;
}
case 180:
{
- orientation = Dali::GlWindow::GlWindowOrientation::LANDSCAPE_INVERSE;
+ orientation = WindowOrientation::LANDSCAPE_INVERSE;
break;
}
case 270:
{
- orientation = Dali::GlWindow::GlWindowOrientation::PORTRAIT_INVERSE;
+ orientation = WindowOrientation::PORTRAIT_INVERSE;
break;
}
case -1:
{
- orientation = Dali::GlWindow::GlWindowOrientation::NO_ORIENTATION_PREFERENCE;
+ orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
break;
}
}
return orientation;
}
-Dali::GlWindow::GlWindowOrientation GlWindow::GetCurrentOrientation() const
+WindowOrientation GlWindow::GetCurrentOrientation() const
{
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetCurrentOrientation(): %d\n", this, mNativeWindowId, mTotalRotationAngle );
return ConvertToOrientation( mTotalRotationAngle );
}
-void GlWindow::SetAvailableOrientations( const Dali::Vector< Dali::GlWindow::GlWindowOrientation >& orientations )
+void GlWindow::SetAvailableOrientations( const Dali::Vector< WindowOrientation >& orientations )
{
Dali::Vector<float>::SizeType count = orientations.Count();
for( Dali::Vector<float>::SizeType index = 0; index < count; ++index )
SetAvailableAnlges( mAvailableAngles );
}
-void GlWindow::SetPreferredOrientation( Dali::GlWindow::GlWindowOrientation orientation )
+void GlWindow::SetPreferredOrientation( WindowOrientation orientation )
{
if( IsOrientationAvailable( orientation ) == false )
{
}
}
-void GlWindow::RegisterGlCallback( GlInitialize glInit, GlRenderFrame glRenderFrame, GlTerminate glTerminate )
+void GlWindow::RegisterGlCallback( CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback )
{
if( mIsEGLInitialize == false )
{
InitializeGraphics();
}
- mGLInitCallback = glInit;
- mGLRenderFrameCallback = glRenderFrame;
- mGLTerminateCallback = glTerminate;
+ mGLInitCallback = std::unique_ptr< CallbackBase >(initCallback);
+ mGLRenderFrameCallback = std::unique_ptr< CallbackBase >( renderFrameCallback );
+ mGLTerminateCallback = std::unique_ptr< CallbackBase >( terminateCallback );
mInitCallback = false;
eglImpl.MakeContextCurrent( mEGLSurface, mEGLContext );
+ int renderFrameResult = 0;
+
if( mIsRotated )
{
mWindowBase->SetEglWindowBufferTransform( mTotalRotationAngle );
{
if( mGLInitCallback )
{
- mGLInitCallback();
+ CallbackBase::Execute(*mGLInitCallback);
}
mInitCallback = true;
}
if( mGLRenderFrameCallback )
{
- mGLRenderFrameCallback();
+ renderFrameResult = CallbackBase::ExecuteReturn<int>(*mGLRenderFrameCallback);
}
if( mIsWindowRotated )
mIsWindowRotated = false;
}
- eglImpl.SwapBuffers( mEGLSurface );
+ if(renderFrameResult)
+ {
+ eglImpl.SwapBuffers( mEGLSurface );
+ }
return true;
}
/**
* @copydoc Dali::GlWindow::GetCurrentOrientation() const
*/
- Dali::GlWindow::GlWindowOrientation GetCurrentOrientation() const;
+ WindowOrientation GetCurrentOrientation() const;
/**
* @copydoc Dali::GlWindow::SetAvailableOrientations()
*/
- void SetAvailableOrientations( const Dali::Vector< Dali::GlWindow::GlWindowOrientation >& orientations );
+ void SetAvailableOrientations( const Dali::Vector< WindowOrientation >& orientations );
/**
* @copydoc Dali::GlWindow::SetPreferredOrientation()
*/
- void SetPreferredOrientation( Dali::GlWindow::GlWindowOrientation orientation );
+ void SetPreferredOrientation( WindowOrientation orientation );
/**
* @copydoc Dali::GlWindow::RegisterGlCallback()
*/
- void RegisterGlCallback( GlInitialize glInit, GlRenderFrame glRenderFrame, GlTerminate glTerminate );
+ void RegisterGlCallback( CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback );
/**
* @copydoc Dali::GlWindow::RenderOnce()
*
* @return true is available window orientation. false is not available.
*/
- bool IsOrientationAvailable( Dali::GlWindow::GlWindowOrientation orientation ) const;
+ bool IsOrientationAvailable( WindowOrientation orientation ) const;
/**
* @brief Convert from window orientation to angle using orientation mode value.
*
* @return The coverted angle value is returned.
*/
- int ConvertToAngle( Dali::GlWindow::GlWindowOrientation orientation );
+ int ConvertToAngle( WindowOrientation orientation );
/**
* @brief Convert from angle to window orientation using orientation mode value.
*
* @return The converted window orientation value is returned.
*/
- Dali::GlWindow::GlWindowOrientation ConvertToOrientation( int angle ) const;
+ WindowOrientation ConvertToOrientation( int angle ) const;
/**
* @brief Run Ui GL callback function.
VisibilityChangedSignalType mVisibilityChangedSignal;
// EGL, GL Resource
- GlInitialize mGLInitCallback;
- GlRenderFrame mGLRenderFrameCallback;
- GlTerminate mGLTerminateCallback;
+ std::unique_ptr< CallbackBase > mGLInitCallback;
+ std::unique_ptr< CallbackBase > mGLRenderFrameCallback;
+ std::unique_ptr< CallbackBase > mGLTerminateCallback;
CallbackBase* mGLRenderCallback;
EGLSurface mEGLSurface;
EGLContext mEGLContext;
#include <dali/public-api/adaptor-framework/window.h>
#include <dali/public-api/adaptor-framework/key-grab.h>
#include <dali/public-api/adaptor-framework/style-change.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/internal/window-system/common/damage-observer.h>
#include <dali/internal/window-system/common/rotation-event.h>
typedef Signal< void ( ) > DeleteSignalType;
typedef Signal< void ( const DamageArea& ) > DamageSignalType;
typedef Signal< void ( const RotationEvent& ) > RotationSignalType;
- typedef Signal< void ( DevelWindow::EffectState, DevelWindow::EffectType ) > TransitionEffectEventSignalType;
+ typedef Signal< void ( WindowEffectState, WindowEffectType ) > TransitionEffectEventSignalType;
typedef Signal< void ( ) > KeyboardRepeatSettingsChangedSignalType;
typedef Signal< void ( ) > WindowRedrawRequestSignalType;
/**
* @copydoc Dali::Window::SetType()
*/
- virtual void SetType( Dali::Window::Type type ) = 0;
+ virtual void SetType( Dali::WindowType type ) = 0;
/**
* @copydoc Dali::Window::SetNotificationLevel()
*/
- virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) = 0;
+ virtual bool SetNotificationLevel( Dali::WindowNotificationLevel level ) = 0;
/**
* @copydoc Dali::Window::GetNotificationLevel()
*/
- virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const = 0;
+ virtual Dali::WindowNotificationLevel GetNotificationLevel() const = 0;
/**
* @copydoc Dali::Window::SetOpaqueState()
/**
* @copydoc Dali::Window::SetScreenOffMode()
*/
- virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) = 0;
+ virtual bool SetScreenOffMode(WindowScreenOffMode screenOffMode) = 0;
/**
* @copydoc Dali::Window::GetScreenOffMode()
*/
- virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const = 0;
+ virtual WindowScreenOffMode GetScreenOffMode() const = 0;
/**
* @copydoc Dali::Window::SetBrightness()
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/rendering/frame-buffer.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
#include <dali/devel-api/adaptor-framework/orientation.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/internal/window-system/common/window-system.h>
#include <dali/internal/window-system/common/window-render-surface.h>
#include <dali/internal/window-system/common/window-visibility-observer.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
namespace Dali
{
mIconified( false ),
mOpaqueState( false ),
mResizeEnabled( false ),
- mType( Dali::Window::NORMAL ),
+ mType( WindowType::NORMAL ),
mParentWindow( NULL ),
- mPreferredAngle( Dali::Window::NO_ORIENTATION_PREFERENCE ),
+ mPreferredAngle( static_cast< int >( WindowOrientation::NO_ORIENTATION_PREFERENCE ) ),
mRotationAngle( -1 ),
mWindowWidth( 0 ),
mWindowHeight( 0 ),
Window::~Window()
{
+ if ( mAdaptor )
+ {
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto accessible2 = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get( accessible2 );
+ bridge->RemoveTopLevelWindow( accessible );
+
+ mAdaptor->RemoveWindow( this );
+ }
+
if ( mEventHandler )
{
mEventHandler->RemoveObserver( *this );
{
mEventHandler = EventHandlerPtr(new EventHandler( mWindowSurface->GetWindowBase(), *mAdaptor ) );
mEventHandler->AddObserver( *this );
+
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto v = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get( v, true );
+ bridge->AddTopLevelWindow( accessible );
+
+ //FIXME: line below is temporary solution for missing "activate" signal and should be removed
+ Show();
}
void Window::OnSurfaceSet( Dali::RenderSurfaceInterface* surface )
return mScene.GetRenderTaskList();
}
-void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation )
+void Window::AddAvailableOrientation( WindowOrientation orientation )
{
if( IsOrientationAvailable( orientation ) == false )
{
}
}
-void Window::RemoveAvailableOrientation( Dali::Window::WindowOrientation orientation )
+void Window::RemoveAvailableOrientation( WindowOrientation orientation )
{
if( IsOrientationAvailable( orientation ) == false )
{
SetAvailableAnlges( mAvailableAngles );
}
-void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
+void Window::SetPreferredOrientation( WindowOrientation orientation )
{
- if( orientation < Dali::Window::NO_ORIENTATION_PREFERENCE || orientation > Dali::Window::LANDSCAPE_INVERSE )
+ if( orientation < WindowOrientation::NO_ORIENTATION_PREFERENCE || orientation > WindowOrientation::LANDSCAPE_INVERSE )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::CheckOrientation: Invalid input orientation [%d]\n", orientation );
return;
mWindowBase->SetPreferredAngle( mPreferredAngle );
}
-Dali::Window::WindowOrientation Window::GetPreferredOrientation()
+WindowOrientation Window::GetPreferredOrientation()
{
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle );
- Dali::Window::WindowOrientation preferredOrientation = ConvertToOrientation( mPreferredAngle );
+ WindowOrientation preferredOrientation = ConvertToOrientation( mPreferredAngle );
return preferredOrientation;
}
mWindowBase->SetAvailableAnlges( angles );
}
-int Window::ConvertToAngle( Dali::Window::WindowOrientation orientation )
+int Window::ConvertToAngle( WindowOrientation orientation )
{
int convertAngle = static_cast< int >( orientation );
if( mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE )
{
switch( orientation )
{
- case Dali::Window::LANDSCAPE:
+ case WindowOrientation::LANDSCAPE:
{
convertAngle = 0;
break;
}
- case Dali::Window::PORTRAIT:
+ case WindowOrientation::PORTRAIT:
{
convertAngle = 90;
break;
}
- case Dali::Window::LANDSCAPE_INVERSE:
+ case WindowOrientation::LANDSCAPE_INVERSE:
{
convertAngle = 180;
break;
}
- case Dali::Window::PORTRAIT_INVERSE:
+ case WindowOrientation::PORTRAIT_INVERSE:
{
convertAngle = 270;
break;
}
- case Dali::Window::NO_ORIENTATION_PREFERENCE:
+ case WindowOrientation::NO_ORIENTATION_PREFERENCE:
{
convertAngle = -1;
break;
return convertAngle;
}
-Dali::Window::WindowOrientation Window::ConvertToOrientation( int angle ) const
+WindowOrientation Window::ConvertToOrientation( int angle ) const
{
- Dali::Window::WindowOrientation orientation = static_cast< Dali::Window::WindowOrientation >( angle );
+ WindowOrientation orientation = static_cast< WindowOrientation >( angle );
if( mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE )
{
switch( angle )
{
case 0:
{
- orientation = Dali::Window::LANDSCAPE;
+ orientation = WindowOrientation::LANDSCAPE;
break;
}
case 90:
{
- orientation = Dali::Window::PORTRAIT;
+ orientation = WindowOrientation::PORTRAIT;
break;
}
case 180:
{
- orientation = Dali::Window::LANDSCAPE_INVERSE;
+ orientation = WindowOrientation::LANDSCAPE_INVERSE;
break;
}
case 270:
{
- orientation = Dali::Window::PORTRAIT_INVERSE;
+ orientation = WindowOrientation::PORTRAIT_INVERSE;
break;
}
case -1:
{
- orientation = Dali::Window::NO_ORIENTATION_PREFERENCE;
+ orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
break;
}
}
return orientation;
}
-bool Window::IsOrientationAvailable( Dali::Window::WindowOrientation orientation ) const
+bool Window::IsOrientationAvailable( WindowOrientation orientation ) const
{
- if( orientation <= Dali::Window::NO_ORIENTATION_PREFERENCE || orientation > Dali::Window::LANDSCAPE_INVERSE )
+ if( orientation <= WindowOrientation::NO_ORIENTATION_PREFERENCE || orientation > WindowOrientation::LANDSCAPE_INVERSE )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::IsOrientationAvailable: Invalid input orientation [%d]\n", orientation );
return false;
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
}
-void Window::SetType( Dali::Window::Type type )
+void Window::SetType( WindowType type )
{
if( type != mType )
{
}
}
-Dali::Window::Type Window::GetType() const
+WindowType Window::GetType() const
{
return mType;
}
-bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+bool Window::SetNotificationLevel( WindowNotificationLevel level )
{
- if( mType != Dali::Window::NOTIFICATION )
+ if( mType != WindowType::NOTIFICATION )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
return false;
return mWindowBase->SetNotificationLevel( level );
}
-Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
+WindowNotificationLevel Window::GetNotificationLevel() const
{
- if( mType != Dali::Window::NOTIFICATION )
+ if( mType != WindowType::NOTIFICATION )
{
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
- return Dali::Window::NotificationLevel::NONE;
+ return WindowNotificationLevel::NONE;
}
return mWindowBase->GetNotificationLevel();
return mOpaqueState;
}
-bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+bool Window::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
return mWindowBase->SetScreenOffMode( screenOffMode );
}
-Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
+WindowScreenOffMode Window::GetScreenOffMode() const
{
return mWindowBase->GetScreenOffMode();
}
mFocusChangeSignal.Emit( handle, focusIn );
mSurface->SetFullSwapNextFrame();
+
+ if (auto b = Dali::Accessibility::Bridge::GetCurrentBridge())
+ {
+ if (focusIn)
+ {
+ b->ApplicationShown();
+ }
+ else
+ {
+ b->ApplicationHidden();
+ }
+ }
}
void Window::OnOutputTransformed()
mDeleteRequestSignal.Emit();
}
-void Window::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type )
+void Window::OnTransitionEffectEvent( WindowEffectState state, WindowEffectType type )
{
Dali::Window handle( this );
mTransitionEffectEventSignal.Emit( handle, state, type );
return mParentWindow;
}
-Dali::Window::WindowOrientation Window::GetCurrentOrientation() const
+WindowOrientation Window::GetCurrentOrientation() const
{
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), GetCurrentOrientation(): %d\n", this, mNativeWindowId, mRotationAngle );
return ConvertToOrientation( mRotationAngle );
}
-void Window::SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+void Window::SetAvailableOrientations( const Dali::Vector<WindowOrientation>& orientations )
{
Dali::Vector<float>::SizeType count = orientations.Count();
for( Dali::Vector<float>::SizeType index = 0; index < count; ++index )
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/object/property-array.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
// INTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/window.h>
/**
* @copydoc Dali::Window::AddAvailableOrientation()
*/
- void AddAvailableOrientation(Dali::Window::WindowOrientation orientation);
+ void AddAvailableOrientation(WindowOrientation orientation);
/**
* @copydoc Dali::Window::RemoveAvailableOrientation()
*/
- void RemoveAvailableOrientation(Dali::Window::WindowOrientation orientation);
+ void RemoveAvailableOrientation(WindowOrientation orientation);
/**
* @copydoc Dali::Window::SetPreferredOrientation()
*/
- void SetPreferredOrientation(Dali::Window::WindowOrientation orientation);
+ void SetPreferredOrientation(WindowOrientation orientation);
/**
* @copydoc Dali::Window::GetPreferredOrientation()
*/
- Dali::Window::WindowOrientation GetPreferredOrientation();
+ WindowOrientation GetPreferredOrientation();
/**
* @copydoc Dali::Window::SetAcceptFocus()
/**
* @copydoc Dali::Window::SetType()
*/
- void SetType( Dali::Window::Type type );
+ void SetType( WindowType type );
/**
* @copydoc Dali::Window::GetType() const
*/
- Dali::Window::Type GetType() const;
+ WindowType GetType() const;
/**
* @copydoc Dali::Window::SetNotificationLevel()
*/
- bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level );
+ bool SetNotificationLevel( WindowNotificationLevel level );
/**
* @copydoc Dali::Window::GetNotificationLevel()
*/
- Dali::Window::NotificationLevel::Type GetNotificationLevel() const;
+ WindowNotificationLevel GetNotificationLevel() const;
/**
* @copydoc Dali::Window::SetOpaqueState()
/**
* @copydoc Dali::Window::SetScreenOffMode()
*/
- bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode);
+ bool SetScreenOffMode(WindowScreenOffMode screenOffMode);
/**
* @copydoc Dali::Window::GetScreenOffMode()
*/
- Dali::Window::ScreenOffMode::Type GetScreenOffMode() const;
+ WindowScreenOffMode GetScreenOffMode() const;
/**
* @copydoc Dali::Window::SetBrightness()
/**
* @copydoc Dali::DevelWindow::GetCurrentOrientation()
*/
- Dali::Window::WindowOrientation GetCurrentOrientation() const;
+ WindowOrientation GetCurrentOrientation() const;
/**
* @copydoc Dali::DevelWindow::SetAvailableOrientations()
*/
- void SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
+ void SetAvailableOrientations( const Dali::Vector<WindowOrientation>& orientations );
public: // Dali::Internal::Adaptor::SceneHolder
/**
* Called when the window receives a Transition effect-start/end event.
*/
- void OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type );
+ void OnTransitionEffectEvent( WindowEffectState state, WindowEffectType type );
/**
* @brief Called when window receives a keyboard repeat event.
/**
* @brief Convert from window orientation to angle using OrientationMode.
*/
- int ConvertToAngle( Dali::Window::WindowOrientation orientation );
+ int ConvertToAngle( WindowOrientation orientation );
/**
* @brief Convert from angle to window orientation using OrientationMode.
*/
- Dali::Window::WindowOrientation ConvertToOrientation( int angle ) const;
+ WindowOrientation ConvertToOrientation( int angle ) const;
/**
* @brief Check available window orientation for Available orientation.
*/
- bool IsOrientationAvailable( Dali::Window::WindowOrientation orientation ) const;
+ bool IsOrientationAvailable( WindowOrientation orientation ) const;
private: // Dali::Internal::Adaptor::SceneHolder
bool mIconified:1;
bool mOpaqueState:1;
bool mResizeEnabled:1;
- Dali::Window::Type mType;
+ WindowType mType;
Dali::Window mParentWindow;
OrientationPtr mOrientation;
ecore_wl_window_input_region_set( mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
}
-void WindowBaseEcoreWl::SetType( Dali::Window::Type type )
+void WindowBaseEcoreWl::SetType( Dali::WindowType type )
{
Ecore_Wl_Window_Type windowType;
switch( type )
{
- case Dali::Window::NORMAL:
+ case Dali::WindowType::NORMAL:
{
windowType = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
break;
}
- case Dali::Window::NOTIFICATION:
+ case Dali::WindowType::NOTIFICATION:
{
windowType = ECORE_WL_WINDOW_TYPE_NOTIFICATION;
break;
}
- case Dali::Window::UTILITY:
+ case Dali::WindowType::UTILITY:
{
windowType = ECORE_WL_WINDOW_TYPE_UTILITY;
break;
}
- case Dali::Window::DIALOG:
+ case Dali::WindowType::DIALOG:
{
windowType = ECORE_WL_WINDOW_TYPE_DIALOG;
break;
ecore_wl_window_type_set( mEcoreWindow, windowType );
}
-bool WindowBaseEcoreWl::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+bool WindowBaseEcoreWl::SetNotificationLevel( Dali::WindowNotificationLevel level )
{
while( !mTizenPolicy )
{
switch( level )
{
- case Dali::Window::NotificationLevel::NONE:
+ case Dali::WindowNotificationLevel::NONE:
{
notificationLevel = TIZEN_POLICY_LEVEL_NONE;
break;
}
- case Dali::Window::NotificationLevel::BASE:
+ case Dali::WindowNotificationLevel::BASE:
{
notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
break;
}
- case Dali::Window::NotificationLevel::MEDIUM:
+ case Dali::WindowNotificationLevel::MEDIUM:
{
notificationLevel = TIZEN_POLICY_LEVEL_MEDIUM;
break;
}
- case Dali::Window::NotificationLevel::HIGH:
+ case Dali::WindowNotificationLevel::HIGH:
{
notificationLevel = TIZEN_POLICY_LEVEL_HIGH;
break;
}
- case Dali::Window::NotificationLevel::TOP:
+ case Dali::WindowNotificationLevel::TOP:
{
notificationLevel = TIZEN_POLICY_LEVEL_TOP;
break;
return true;
}
-Dali::Window::NotificationLevel::Type WindowBaseEcoreWl::GetNotificationLevel() const
+Dali::WindowNotificationLevel WindowBaseEcoreWl::GetNotificationLevel() const
{
while( !mTizenPolicy )
{
return Dali::Window::NotificationLevel::NONE;
}
- Dali::Window::NotificationLevel::Type level;
+ Dali::WindowNotificationLevel level;
switch( mNotificationLevel )
{
case TIZEN_POLICY_LEVEL_NONE:
{
- level = Dali::Window::NotificationLevel::NONE;
+ level = Dali::WindowNotificationLevel::NONE;
break;
}
case TIZEN_POLICY_LEVEL_DEFAULT:
{
- level = Dali::Window::NotificationLevel::BASE;
+ level = Dali::WindowNotificationLevel::BASE;
break;
}
case TIZEN_POLICY_LEVEL_MEDIUM:
{
- level = Dali::Window::NotificationLevel::MEDIUM;
+ level = Dali::WindowNotificationLevel::MEDIUM;
break;
}
case TIZEN_POLICY_LEVEL_HIGH:
{
- level = Dali::Window::NotificationLevel::HIGH;
+ level = Dali::WindowNotificationLevel::HIGH;
break;
}
case TIZEN_POLICY_LEVEL_TOP:
{
- level = Dali::Window::NotificationLevel::TOP;
+ level = Dali::WindowNotificationLevel::TOP;
break;
}
default:
{
DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetNotificationLevel: invalid level [%d]\n", mNotificationLevel );
- level = Dali::Window::NotificationLevel::NONE;
+ level = Dali::WindowNotificationLevel::NONE;
break;
}
}
tizen_policy_set_opaque_state( mTizenPolicy, ecore_wl_window_surface_get( mEcoreWindow ), ( opaque ? 1 : 0 ) );
}
-bool WindowBaseEcoreWl::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+bool WindowBaseEcoreWl::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
while( !mTizenPolicy )
{
switch( screenOffMode )
{
- case Dali::Window::ScreenOffMode::TIMEOUT:
+ case WindowScreenOffMode::TIMEOUT:
{
mode = 0;
break;
}
- case Dali::Window::ScreenOffMode::NEVER:
+ case WindowScreenOffMode::NEVER:
{
mode = 1;
break;
return true;
}
-Dali::Window::ScreenOffMode::Type WindowBaseEcoreWl::GetScreenOffMode() const
+WindowScreenOffMode WindowBaseEcoreWl::GetScreenOffMode() const
{
while( !mTizenPolicy )
{
if( !mScreenOffModeChangeDone )
{
DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetScreenOffMode: Error! [%d]\n", mScreenOffModeChangeState );
- return Dali::Window::ScreenOffMode::TIMEOUT;
+ return WindowScreenOffMode::TIMEOUT;
}
- Dali::Window::ScreenOffMode::Type screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
+ WindowScreenOffMode screenMode = WindowScreenOffMode::TIMEOUT;
switch( mScreenOffMode )
{
case 0:
{
- screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
+ screenMode = WindowScreenOffMode::TIMEOUT;
break;
}
case 1:
{
- screenMode = Dali::Window::ScreenOffMode::NEVER;
+ screenMode = WindowScreenOffMode::NEVER;
break;
}
}
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::WindowType type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::WindowNotificationLevel level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::WindowNotificationLevel GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ WindowScreenOffMode GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
// EXTERNAL_HEADERS
#include <dali/public-api/object/any.h>
#include <dali/public-api/events/mouse-button.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
#include <dali/integration-api/debug.h>
#include <Ecore_Input.h>
#include <vconf.h>
{
if( effectStart->type < 3 ) // only under restack
{
- windowBase->OnTransitionEffectEvent( DevelWindow::EffectState::START, static_cast<DevelWindow::EffectType>( effectStart->type ) );
+ windowBase->OnTransitionEffectEvent( WindowEffectState::START, static_cast<WindowEffectType>( effectStart->type ) );
}
}
return ECORE_CALLBACK_PASS_ON;
{
if( effectEnd->type < 3 ) // only under restack
{
- windowBase->OnTransitionEffectEvent( DevelWindow::EffectState::END, static_cast<DevelWindow::EffectType>( effectEnd->type ) );
+ windowBase->OnTransitionEffectEvent( WindowEffectState::END, static_cast<WindowEffectType>( effectEnd->type ) );
}
}
return ECORE_CALLBACK_PASS_ON;
#endif
}
-void WindowBaseEcoreWl2::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type )
+void WindowBaseEcoreWl2::OnTransitionEffectEvent( WindowEffectState state, WindowEffectType type )
{
mTransitionEffectEventSignal.Emit( state, type );
}
ecore_wl2_window_input_region_set( mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
}
-void WindowBaseEcoreWl2::SetType( Dali::Window::Type type )
+void WindowBaseEcoreWl2::SetType( Dali::WindowType type )
{
Ecore_Wl2_Window_Type windowType;
switch( type )
{
- case Dali::Window::NORMAL:
+ case Dali::WindowType::NORMAL:
{
windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
break;
}
- case Dali::Window::NOTIFICATION:
+ case Dali::WindowType::NOTIFICATION:
{
windowType = ECORE_WL2_WINDOW_TYPE_NOTIFICATION;
break;
}
- case Dali::Window::UTILITY:
+ case Dali::WindowType::UTILITY:
{
windowType = ECORE_WL2_WINDOW_TYPE_UTILITY;
break;
}
- case Dali::Window::DIALOG:
+ case Dali::WindowType::DIALOG:
{
windowType = ECORE_WL2_WINDOW_TYPE_DIALOG;
break;
ecore_wl2_window_type_set( mEcoreWindow, windowType );
}
-bool WindowBaseEcoreWl2::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+bool WindowBaseEcoreWl2::SetNotificationLevel( Dali::WindowNotificationLevel level )
{
while( !mTizenPolicy )
{
switch( level )
{
- case Dali::Window::NotificationLevel::NONE:
+ case Dali::WindowNotificationLevel::NONE:
{
notificationLevel = TIZEN_POLICY_LEVEL_NONE;
break;
}
- case Dali::Window::NotificationLevel::BASE:
+ case Dali::WindowNotificationLevel::BASE:
{
notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
break;
}
- case Dali::Window::NotificationLevel::MEDIUM:
+ case Dali::WindowNotificationLevel::MEDIUM:
{
notificationLevel = TIZEN_POLICY_LEVEL_MEDIUM;
break;
}
- case Dali::Window::NotificationLevel::HIGH:
+ case Dali::WindowNotificationLevel::HIGH:
{
notificationLevel = TIZEN_POLICY_LEVEL_HIGH;
break;
}
- case Dali::Window::NotificationLevel::TOP:
+ case Dali::WindowNotificationLevel::TOP:
{
notificationLevel = TIZEN_POLICY_LEVEL_TOP;
break;
return true;
}
-Dali::Window::NotificationLevel::Type WindowBaseEcoreWl2::GetNotificationLevel() const
+Dali::WindowNotificationLevel WindowBaseEcoreWl2::GetNotificationLevel() const
{
while( !mTizenPolicy )
{
if( !mNotificationLevelChangeDone )
{
DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: Error! [%d]\n", mNotificationChangeState );
- return Dali::Window::NotificationLevel::NONE;
+ return Dali::WindowNotificationLevel::NONE;
}
- Dali::Window::NotificationLevel::Type level;
+ Dali::WindowNotificationLevel level;
switch( mNotificationLevel )
{
case TIZEN_POLICY_LEVEL_NONE:
{
- level = Dali::Window::NotificationLevel::NONE;
+ level = Dali::WindowNotificationLevel::NONE;
break;
}
case TIZEN_POLICY_LEVEL_DEFAULT:
{
- level = Dali::Window::NotificationLevel::BASE;
+ level = Dali::WindowNotificationLevel::BASE;
break;
}
case TIZEN_POLICY_LEVEL_MEDIUM:
{
- level = Dali::Window::NotificationLevel::MEDIUM;
+ level = Dali::WindowNotificationLevel::MEDIUM;
break;
}
case TIZEN_POLICY_LEVEL_HIGH:
{
- level = Dali::Window::NotificationLevel::HIGH;
+ level = Dali::WindowNotificationLevel::HIGH;
break;
}
case TIZEN_POLICY_LEVEL_TOP:
{
- level = Dali::Window::NotificationLevel::TOP;
+ level = Dali::WindowNotificationLevel::TOP;
break;
}
default:
{
DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: invalid level [%d]\n", mNotificationLevel );
- level = Dali::Window::NotificationLevel::NONE;
+ level = Dali::WindowNotificationLevel::NONE;
break;
}
}
tizen_policy_set_opaque_state( mTizenPolicy, ecore_wl2_window_surface_get( mEcoreWindow ), ( opaque ? 1 : 0 ) );
}
-bool WindowBaseEcoreWl2::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+bool WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
while( !mTizenPolicy )
{
switch( screenOffMode )
{
- case Dali::Window::ScreenOffMode::TIMEOUT:
+ case WindowScreenOffMode::TIMEOUT:
{
mode = 0;
break;
}
- case Dali::Window::ScreenOffMode::NEVER:
+ case WindowScreenOffMode::NEVER:
{
mode = 1;
break;
return true;
}
-Dali::Window::ScreenOffMode::Type WindowBaseEcoreWl2::GetScreenOffMode() const
+WindowScreenOffMode WindowBaseEcoreWl2::GetScreenOffMode() const
{
while( !mTizenPolicy )
{
if( !mScreenOffModeChangeDone )
{
DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetScreenOffMode: Error! [%d]\n", mScreenOffModeChangeState );
- return Dali::Window::ScreenOffMode::TIMEOUT;
+ return WindowScreenOffMode::TIMEOUT;
}
- Dali::Window::ScreenOffMode::Type screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
+ WindowScreenOffMode screenMode = WindowScreenOffMode::TIMEOUT;
switch( mScreenOffMode )
{
case 0:
{
- screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
+ screenMode = WindowScreenOffMode::TIMEOUT;
break;
}
case 1:
{
- screenMode = Dali::Window::ScreenOffMode::NEVER;
+ screenMode = WindowScreenOffMode::NEVER;
break;
}
}
/**
* @brief Called when a transition effect-start/end event is received.
*/
- void OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type );
+ void OnTransitionEffectEvent( WindowEffectState state, WindowEffectType type );
/**
* @brief Called when a keyboard repeat event is changed.
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::WindowType type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::WindowNotificationLevel level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::WindowNotificationLevel GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ WindowScreenOffMode GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
{
}
-void WindowBaseEcoreX::SetType( Dali::Window::Type type )
+void WindowBaseEcoreX::SetType( Dali::WindowType type )
{
}
-bool WindowBaseEcoreX::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+bool WindowBaseEcoreX::SetNotificationLevel( Dali::WindowNotificationLevel level )
{
return false;
}
-Dali::Window::NotificationLevel::Type WindowBaseEcoreX::GetNotificationLevel() const
+Dali::WindowNotificationLevel WindowBaseEcoreX::GetNotificationLevel() const
{
- return Dali::Window::NotificationLevel::NONE;
+ return Dali::WindowNotificationLevel::NONE;
}
void WindowBaseEcoreX::SetOpaqueState( bool opaque )
{
}
-bool WindowBaseEcoreX::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+bool WindowBaseEcoreX::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
return false;
}
-Dali::Window::ScreenOffMode::Type WindowBaseEcoreX::GetScreenOffMode() const
+WindowScreenOffMode WindowBaseEcoreX::GetScreenOffMode() const
{
- return Dali::Window::ScreenOffMode::TIMEOUT;
+ return WindowScreenOffMode::TIMEOUT;
}
bool WindowBaseEcoreX::SetBrightness( int brightness )
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::WindowType type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::WindowNotificationLevel level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::WindowNotificationLevel GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ WindowScreenOffMode GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
{
}
-void WindowBaseWin::SetType( Dali::Window::Type type )
+void WindowBaseWin::SetType( Dali::WindowType type )
{
}
-bool WindowBaseWin::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+bool WindowBaseWin::SetNotificationLevel( Dali::WindowNotificationLevel level )
{
return false;
}
-Dali::Window::NotificationLevel::Type WindowBaseWin::GetNotificationLevel() const
+Dali::WindowNotificationLevel WindowBaseWin::GetNotificationLevel() const
{
- return Dali::Window::NotificationLevel::NONE;
+ return Dali::WindowNotificationLevel::NONE;
}
void WindowBaseWin::SetOpaqueState( bool opaque )
{
}
-bool WindowBaseWin::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+bool WindowBaseWin::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
return false;
}
-Dali::Window::ScreenOffMode::Type WindowBaseWin::GetScreenOffMode() const
+WindowScreenOffMode WindowBaseWin::GetScreenOffMode() const
{
- return Dali::Window::ScreenOffMode::TIMEOUT;
+ return WindowScreenOffMode::TIMEOUT;
}
bool WindowBaseWin::SetBrightness( int brightness )
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::WindowType type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::WindowNotificationLevel level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::WindowNotificationLevel GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ WindowScreenOffMode GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
--- /dev/null
+#ifndef DALI_WINDOW_ENUMERATIONS_H
+#define DALI_WINDOW_ENUMERATIONS_H
+
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+namespace Dali
+{
+/**
+ * @brief Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
+ *
+ * This Enumeration is used the available orientation APIs and the preferred orientation.
+ *
+ * @SINCE_2_0.0
+ */
+enum class WindowOrientation
+{
+ PORTRAIT = 0, ///< Portrait orientation. The height of the display area is greater than the width. @SINCE_2_0.0
+ LANDSCAPE = 90, ///< Landscape orientation. A wide view area is needed. @SINCE_2_0.0
+ PORTRAIT_INVERSE = 180, ///< Portrait inverse orientation. @SINCE_2_0.0
+ LANDSCAPE_INVERSE = 270, ///< Landscape inverse orientation. @SINCE_2_0.0
+ NO_ORIENTATION_PREFERENCE = -1 ///< No orientation. It is used to initialize or unset the preferred orientation. @SINCE_2_0.0
+};
+
+/**
+ * @brief An enum of Window types.
+ * @SINCE_2_0.0
+ */
+enum class WindowType
+{
+ NORMAL, ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type. @SINCE_2_0.0
+ NOTIFICATION, ///< A notification window, like a warning about battery life or a new E-Mail received. @SINCE_2_0.0
+ UTILITY, ///< A persistent utility window, like a toolbox or palette. @SINCE_2_0.0
+ DIALOG ///< Used for simple dialog windows. @SINCE_2_0.0
+};
+
+/**
+ * @brief An enum of notification level.
+ * @SINCE_2_0.0
+ */
+enum class WindowNotificationLevel
+{
+ NONE = -1, ///< No notification level. Default level. This value makes the notification window place in the layer of the normal window. @SINCE_2_0.0
+ BASE = 10, ///< Base notification level. @SINCE_2_0.0
+ MEDIUM = 20, ///< Higher notification level than base. @SINCE_2_0.0
+ HIGH = 30, ///< Higher notification level than medium. @SINCE_2_0.0
+ TOP = 40 ///< The highest notification level. @SINCE_2_0.0
+};
+
+/**
+ * @brief An enum of screen mode.
+ * @SINCE_2_0.0
+ */
+enum class WindowScreenOffMode
+{
+ TIMEOUT, ///< The mode which turns the screen off after a timeout. @SINCE_2_0.0
+ NEVER, ///< The mode which keeps the screen turned on. @SINCE_2_0.0
+};
+
+/**
+ * @brief Enumeration for transition effect's state.
+ * @SINCE_2_0.0
+ */
+enum class WindowEffectState
+{
+ NONE = 0, ///< None state. @SINCE_2_0.0
+ START, ///< Transition effect is started. @SINCE_2_0.0
+ END ///< Transition effect is ended. @SINCE_2_0.0
+};
+
+/**
+ * @brief Enumeration for transition effect's type.
+ * @SINCE_2_0.0
+ */
+enum class WindowEffectType
+{
+ NONE = 0, ///< None type. @SINCE_2_0.0
+ SHOW, ///< Window show effect. @SINCE_2_0.0
+ HIDE, ///< Window hide effect. @SINCE_2_0.0
+};
+
+}
+
+#endif // DALI_WINDOW_ENUMERATIONS_H
GetImplementation(*this).SetPreferredOrientation(orientation);
}
-Dali::Window::WindowOrientation Window::GetPreferredOrientation()
+WindowOrientation Window::GetPreferredOrientation()
{
return GetImplementation(*this).GetPreferredOrientation();
}
return GetImplementation(*this).SetInputRegion(inputRegion);
}
-void Window::SetType(Window::Type type)
+void Window::SetType(WindowType type)
{
GetImplementation(*this).SetType(type);
}
-Window::Type Window::GetType() const
+WindowType Window::GetType() const
{
return GetImplementation(*this).GetType();
}
-bool Window::SetNotificationLevel(Window::NotificationLevel::Type level)
+bool Window::SetNotificationLevel(WindowNotificationLevel level)
{
return GetImplementation(*this).SetNotificationLevel(level);
}
-Window::NotificationLevel::Type Window::GetNotificationLevel() const
+WindowNotificationLevel Window::GetNotificationLevel() const
{
return GetImplementation(*this).GetNotificationLevel();
}
return GetImplementation(*this).IsOpaqueState();
}
-bool Window::SetScreenOffMode(Window::ScreenOffMode::Type screenMode)
+bool Window::SetScreenOffMode(WindowScreenOffMode screenMode)
{
return GetImplementation(*this).SetScreenOffMode(screenMode);
}
-Window::ScreenOffMode::Type Window::GetScreenOffMode() const
+WindowScreenOffMode Window::GetScreenOffMode() const
{
return GetImplementation(*this).GetScreenOffMode();
}
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
#include <string>
// INTERNAL INCLUDES
using TouchEventSignalType = Signal<void(const TouchEvent&)>; ///< Touch signal type @SINCE_1_9.28
public:
- // Enumerations
-
- /**
- * @brief Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
- *
- * This Enumeration is used the available orientation APIs and the preferred orientation.
- *
- * @SINCE_1_0.0
- */
- enum WindowOrientation
- {
- PORTRAIT = 0, ///< Portrait orientation. The height of the display area is greater than the width. @SINCE_1_0.0
- LANDSCAPE = 90, ///< Landscape orientation. A wide view area is needed. @SINCE_1_0.0
- PORTRAIT_INVERSE = 180, ///< Portrait inverse orientation @SINCE_1_0.0
- LANDSCAPE_INVERSE = 270, ///< Landscape inverse orientation @SINCE_1_0.0
- NO_ORIENTATION_PREFERENCE = -1 ///< No orientation. It is used to initialize or unset the preferred orientation. @SINCE_1_4.51
- };
-
- /**
- * @brief An enum of Window types.
- * @SINCE_1_2.60
- */
- enum Type
- {
- NORMAL, ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type. @SINCE_1_2.60
- NOTIFICATION, ///< A notification window, like a warning about battery life or a new E-Mail received. @SINCE_1_2.60
- UTILITY, ///< A persistent utility window, like a toolbox or palette. @SINCE_1_2.60
- DIALOG ///< Used for simple dialog windows. @SINCE_1_2.60
- };
-
- /**
- * @brief An enum of screen mode.
- * @SINCE_1_2.60
- */
- struct NotificationLevel
- {
- /**
- * @brief An enum of screen mode.
- * @SINCE_1_2.60
- */
- enum Type
- {
- NONE = -1, ///< No notification level. Default level. This value makes the notification window place in the layer of the normal window. @SINCE_1_2.60
- BASE = 10, ///< Base notification level. @SINCE_1_2.60
- MEDIUM = 20, ///< Higher notification level than base. @SINCE_1_2.60
- HIGH = 30, ///< Higher notification level than medium. @SINCE_1_2.60
- TOP = 40 ///< The highest notification level. @SINCE_1_2.60
- };
- };
-
- /**
- * @brief An enum of screen mode.
- * @SINCE_1_2.60
- */
- struct ScreenOffMode
- {
- /**
- * @brief An enum of screen mode.
- * @SINCE_1_2.60
- */
- enum Type
- {
- TIMEOUT, ///< The mode which turns the screen off after a timeout. @SINCE_1_2.60
- NEVER, ///< The mode which keeps the screen turned on. @SINCE_1_2.60
- };
-
- static constexpr Type DEFAULT{TIMEOUT}; ///< The default mode. @SINCE_1_2.60
- };
// Methods
/**
* @brief Sets a window type.
- * @SINCE_1_2.60
+ * @@SINCE_2_0.0
* @param[in] type The window type.
* @remarks The default window type is NORMAL.
*/
- void SetType(Type type);
+ void SetType(WindowType type);
/**
* @brief Gets a window type.
- * @SINCE_1_2.60
+ * @@SINCE_2_0.0
* @return A window type.
*/
- Type GetType() const;
+ WindowType GetType() const;
/**
* @brief Sets a priority level for the specified notification window.
- * @SINCE_1_2.60
+ * @@SINCE_2_0.0
* @param[in] level The notification window level.
* @return True if no error occurred, false otherwise.
* @PRIVLEVEL_PUBLIC
* @PRIVILEGE_WINDOW_PRIORITY
* @remarks This can be used for a notification type window only. The default level is NotificationLevel::NONE.
*/
- bool SetNotificationLevel(NotificationLevel::Type level);
+ bool SetNotificationLevel(WindowNotificationLevel level);
/**
* @brief Gets a priority level for the specified notification window.
- * @SINCE_1_2.60
+ * @@SINCE_2_0.0
* @return The notification window level.
* @remarks This can be used for a notification type window only.
*/
- NotificationLevel::Type GetNotificationLevel() const;
+ WindowNotificationLevel GetNotificationLevel() const;
/**
* @brief Sets a transparent window's visual state to opaque.
/**
* @brief Sets a window's screen off mode.
* @details This API is useful when the application needs to keep the display turned on.
- * If the application sets the screen mode to #::Dali::Window::ScreenOffMode::NEVER to its window and the window is shown,
+ * If the application sets the screen mode to #::Dali::WindowScreenOffMode::NEVER to its window and the window is shown,
* the window manager requests the display system to keep the display on as long as the window is shown.
* If the window is no longer shown, then the window manager requests the display system to go back to normal operation.
- * @SINCE_1_2.60
+ * @@SINCE_2_0.0
* @param[in] screenOffMode The screen mode.
* @return True if no error occurred, false otherwise.
* @PRIVLEVEL_PUBLIC
* @PRIVILEGE_DISPLAY
*/
- bool SetScreenOffMode(ScreenOffMode::Type screenOffMode);
+ bool SetScreenOffMode(WindowScreenOffMode screenOffMode);
/**
* @brief Gets a screen off mode of the window.
- * @SINCE_1_2.60
+ * @@SINCE_2_0.0
* @return The screen off mode.
*/
- ScreenOffMode::Type GetScreenOffMode() const;
+ WindowScreenOffMode GetScreenOffMode() const;
/**
* @brief Sets preferred brightness of the window.
namespace Dali
{
-const unsigned int ADAPTOR_MAJOR_VERSION = 1;
-const unsigned int ADAPTOR_MINOR_VERSION = 9;
-const unsigned int ADAPTOR_MICRO_VERSION = 35;
+const unsigned int ADAPTOR_MAJOR_VERSION = 2;
+const unsigned int ADAPTOR_MINOR_VERSION = 0;
+const unsigned int ADAPTOR_MICRO_VERSION = 0;
const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
${adaptor_public_api_dir}/adaptor-framework/widget.h
${adaptor_public_api_dir}/adaptor-framework/widget-application.h
${adaptor_public_api_dir}/adaptor-framework/widget-impl.h
+ ${adaptor_public_api_dir}/adaptor-framework/window-enumerations.h
)
Name: dali2-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.9.35
+Version: 2.0.0
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
BuildRequires: pkgconfig(capi-system-system-settings)
+# for ATSPI (Accessibility) support
+BuildRequires: pkgconfig(eldbus)
+
# for feedback plugin
BuildRequires: pkgconfig(mm-sound)
BuildRequires: pkgconfig(feedback)
CFLAGS+=" -DWAYLAND"
CXXFLAGS+=" -DWAYLAND"
-cmake_flags=" -DENABLE_WAYLAND=ON"
+cmake_flags=" -DENABLE_WAYLAND=ON -DENABLE_ATSPI=OFF"
# Use this conditional when Tizen version is 5.x or greater
%if 0%{?tizen_version_major} >= 5