+++ /dev/null
----
-Language: Cpp
-DisableFormat: true
-SortIncludes: false
-...
#include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali/devel-api/common/stage.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
#include "dbus-wrapper.h"
namespace Dali
bool markupProcessorEnabled,
LineWrap::Mode wrapMode,
bool ellipsisEnabled,
- DevelText::EllipsisPosition::Type ellipsisPosition)
+ DevelText::EllipsisPosition::Type ellipsisPosition,
+ float lineSpacing)
{
textModel = Model::New(); ///< Pointer to the text's model.
LogicalModelPtr logicalModel = textModel->mLogicalModel;
Layout::Engine layoutEngine;
layoutEngine.SetMetrics( metrics );
layoutEngine.SetLayout( Layout::Engine::MULTI_LINE_BOX );
+ layoutEngine.SetDefaultLineSpacing(lineSpacing);
// Set the layout parameters.
textModel->mHorizontalAlignment = Text::HorizontalAlignment::BEGIN;
* @param[in] wrapMode Line wrap mode.
* @param[in] ellipsisEnabled Whether the ellipsis layout option is enabled.
* @param[in] ellipsisPosition Where is the location the text elide.
+ * @param[in] lineSpacing The height of the line in points.
*/
void CreateTextModel( const std::string& text,
const Size& textArea,
bool markupProcessorEnabled,
LineWrap::Mode wrapMode,
bool ellipsisEnabled,
- DevelText::EllipsisPosition::Type ellipsisPosition);
+ DevelText::EllipsisPosition::Type ellipsisPosition,
+ float lineSpacing);
/**
* @brief Configures the text @p controller similarly to the one configured by the text-label.
#include <dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
#include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h>
END_TEST;
}
+
+int utcDaliAccessibilityHidden(void)
+{
+ ToolkitTestApplication application;
+
+ auto control = Toolkit::Control::New();
+ auto* accessible = Dali::Accessibility::Accessible::Get(control);
+
+ // Check not hidden
+ DALI_TEST_CHECK(accessible);
+ DALI_TEST_CHECK(!accessible->IsHidden());
+ DALI_TEST_CHECK(!control.GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN));
+
+ control.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN, true);
+
+ // Check hidden
+ DALI_TEST_CHECK(accessible->IsHidden());
+ DALI_TEST_CHECK(control.GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN));
+
+ END_TEST;
+}
#include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/action.h>
+#include <dali/devel-api/atspi-interfaces/component.h>
#include <dali-toolkit/devel-api/controls/buttons/toggle-button.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/popup/popup.h>
child_1_accessible -> GetIndexInParent();
DALI_ABORT("Object has parent, test abort");
}
- catch (Dali::DaliException &){}
+ catch (const std::domain_error&){}
parent.Add(child_1);
parent.Add(child_2);
Wait(application);
- auto* accessibleParent = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(scrollView));
+ auto* accessibleParent = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(scrollView));
DALI_TEST_CHECK(accessibleParent);
- auto* accessibleA = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(actorA));
+ auto* accessibleA = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(actorA));
DALI_TEST_CHECK(accessibleA);
- auto* accessibleB = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(actorB));
+ auto* accessibleB = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(actorB));
DALI_TEST_CHECK(accessibleB);
accessibleA->GrabHighlight(); // == scrollView.ScrollTo(actorA)
Wait(application);
- auto* accessibleParent = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(view));
+ auto* accessibleParent = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(view));
DALI_TEST_CHECK(accessibleParent);
- auto* accessibleA = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(view.GetItem(0)));
+ auto* accessibleA = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(view.GetItem(0)));
DALI_TEST_CHECK(accessibleA);
- auto* accessibleB = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(view.GetItem(1)));
+ auto* accessibleB = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(view.GetItem(1)));
DALI_TEST_CHECK(accessibleB);
accessibleA->GrabHighlight(); // == view.ScrollToItem(view.GetItemId(actorA))
TextLabel label = TextLabel::New("123");
- auto* accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(label));
+ auto* accessible = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(label));
DALI_TEST_CHECK(accessible);
DALI_TEST_EQUALS(accessible->IsScrollable(), false, TEST_LOCATION);
DALI_TEST_EQUALS(accessible->ScrollToChild({}), false, TEST_LOCATION);
- DALI_TEST_EQUALS(accessible->GetInternalActor(), Dali::Actor{}, TEST_LOCATION);
+ DALI_TEST_EQUALS(accessible->GetInternalActor(), label, TEST_LOCATION);
Dali::Accessibility::TestEnableSC( false );
END_TEST;
Wait(application);
// Set highlight to first child (A) to enable movement tracking
- auto* accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonA));
+ auto* accessible = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(buttonA));
DALI_TEST_CHECK(accessible);
accessible->GrabHighlight();
Wait(application);
Dali::Accessibility::TestResetMoveOutedCalled();
// Set highlight to second child (B) to enable movement tracking
- accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonB));
+ accessible = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(buttonB));
DALI_TEST_CHECK(accessible);
accessible->GrabHighlight();
Wait(application);
Dali::Accessibility::TestResetMoveOutedCalled();
// Disable movement tracking on B by giving highlight to A
- accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonA));
+ accessible = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(buttonA));
DALI_TEST_CHECK(accessible);
accessible->GrabHighlight();
Wait(application);
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/action.h>
+#include <dali/devel-api/atspi-interfaces/editable-text.h>
+#include <dali/devel-api/atspi-interfaces/hyperlink.h>
+#include <dali/devel-api/atspi-interfaces/hypertext.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
#include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
#include <dali-toolkit/internal/controls/text-controls/text-field-impl.h>
#include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/value.h>
#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
data.markupProcessorEnabled,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
END_TEST;
}
+
+int UtcDaliDebugRenderingGetVisual3(void)
+{
+ EnvironmentVariable::SetTestingEnvironmentVariable( true );
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliDebugRenderingGetVisual3: Request visual with various parameters" );
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ // Test that image visual is replaced with debug visual
+ Dali::Property::Map map;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
+ map[ ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME;
+ Visual::Base imageVisual = factory.CreateVisual( map );
+ DALI_TEST_CHECK( imageVisual );
+ TestDebugVisual( application.GetScene(), imageVisual, Visual::IMAGE, Vector2(64.0f, 64.0f /* Broken Image Size */ ));
+
+ // Test that image visual with null string don't make visual
+ map.Clear();
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
+ map[ ImageVisual::Property::URL ] = "";
+ Visual::Base emptyVisual = factory.CreateVisual( map );
+ DALI_TEST_CHECK( emptyVisual );
+ TestDebugVisual( application.GetScene(), emptyVisual, Visual::WIREFRAME, Vector2::ZERO);
+
+ tet_infoline( "Check that GetVisualObject returns the actual WireframeVisual" );
+ Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( emptyVisual ).GetVisualObject();
+ DALI_TEST_CHECK( dynamic_cast< Toolkit::Internal::WireframeVisual* >( &visualImpl ) );
+
+ tet_infoline( "Compare the returned emptyVisual with the visual implementation, should be the same" );
+ DALI_TEST_CHECK( emptyVisual.GetObjectPtr() == &visualImpl );
+
+ // Test that image view with empty property map don't make visual even DebugRendering is enabled.
+ map.Clear();
+ ImageView imageView = ImageView::New();
+ imageView.SetProperty(Control::Property::BACKGROUND, map);
+ imageView.SetProperty(ImageView::Property::IMAGE, map);
+
+ application.GetScene().Add(imageView);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( imageView.GetRendererCount(), 0u, TEST_LOCATION );
+
+ EnvironmentVariable::SetTestingEnvironmentVariable(false);
+ END_TEST;
+}
+
+
int UtcDaliDebugRenderingGetVisualObject01(void)
{
EnvironmentVariable::SetTestingEnvironmentVariable( true );
tet_infoline( "Compare the returned TextVisual with the visual implementation, should differ" );
DALI_TEST_CHECK( textVisual.GetObjectPtr() != &visualImpl );
+ EnvironmentVariable::SetTestingEnvironmentVariable( false );
END_TEST;
}
}
END_TEST;
-}
+}
\ No newline at end of file
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
*/
#include <iostream>
-
#include <stdlib.h>
+#include <unistd.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/internal/text/cursor-helper-functions.h>
namespace
{
+ const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
+ const unsigned int DEFAULT_FONT_SIZE = 1152u;
struct GetClosestLineData
{
CharacterIndex* noTextHitIndex; ///< The expected character index when there is no hit.
};
+struct PrimaryCursorHeightData
+{
+ std::string description; ///< Description of the test.
+ std::string text; ///< Input text.
+ unsigned int numberOfTests; ///< The number of tests.
+ CharacterIndex* logicalIndex; ///< The logical cursor index for each test.
+ float* heights; ///< The expected primary cursor height for each test.
+};
+
bool GetClosestLineTest( const GetClosestLineData& data )
{
std::cout << " testing : " << data.description << std::endl;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
parameters.logical = data.logicalIndex[index];
GetCursorPosition( parameters,
+ 0.f,// Since this test case is not testing the primary cursor height, the default font line height can be set to 0.f.
cursorInfo );
if( floor(cursorInfo.primaryPosition.x) != data.visualX[index] )
if( floor(cursorInfo.primaryPosition.y) != data.visualY[index] )
{
std::cout << " test " << index << " failed. Different 'y' cursor position : " << cursorInfo.primaryPosition.y << ", expected : " << data.visualY[index] << std::endl;
- return false;
+ return false;
}
}
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
return true;
}
+bool PrimaryCursorHeightTest( const PrimaryCursorHeightData& data )
+{
+ std::cout << " testing : " << data.description << std::endl;
+
+ // 1) Create the model.
+ ModelPtr textModel;
+ MetricsPtr metrics;
+ Size textArea(400.f, 600.f);
+ Size layoutSize;
+
+ Vector<FontDescriptionRun> fontDescriptionRuns;
+
+ const std::string fontFamily( "DejaVuSans" );
+
+ // Set a known font description
+ FontDescriptionRun fontDescriptionRun1;
+ fontDescriptionRun1.characterRun.characterIndex = 0u;
+ fontDescriptionRun1.characterRun.numberOfCharacters = 13u;
+ fontDescriptionRun1.familyLength = fontFamily.size();
+ fontDescriptionRun1.familyName = new char[fontDescriptionRun1.familyLength];
+ memcpy( fontDescriptionRun1.familyName, fontFamily.c_str(), fontDescriptionRun1.familyLength );
+ fontDescriptionRun1.familyDefined = true;
+ fontDescriptionRun1.weightDefined = false;
+ fontDescriptionRun1.widthDefined = false;
+ fontDescriptionRun1.slantDefined = false;
+ fontDescriptionRun1.sizeDefined = true;
+ fontDescriptionRun1.size = 768u;//Font size = 12.0f (768/64 = 12)
+
+ fontDescriptionRuns.PushBack( fontDescriptionRun1 );
+
+ LayoutOptions options;
+ CreateTextModel( data.text,
+ textArea,
+ fontDescriptionRuns,
+ options,
+ layoutSize,
+ textModel,
+ metrics,
+ false,
+ LineWrap::WORD,
+ false,
+ Toolkit::DevelText::EllipsisPosition::END,
+ 50.f );
+
+ LogicalModelPtr logicalModel = textModel->mLogicalModel;
+ VisualModelPtr visualModel = textModel->mVisualModel;
+
+ GetCursorPositionParameters parameters;
+ parameters.visualModel = visualModel;
+ parameters.logicalModel = logicalModel;
+ parameters.metrics = metrics;
+ parameters.isMultiline = true;
+
+ for( unsigned int index = 0; index < data.numberOfTests; ++index )
+ {
+ CursorInfo cursorInfo;
+ parameters.logical = data.logicalIndex[index];
+
+ // Load some fonts.
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ fontClient.SetDpi( 93u, 93u );
+
+ char* pathNamePtr = get_current_dir_name();
+ const std::string pathName( pathNamePtr );
+ free( pathNamePtr );
+
+ FontId fontID = fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/dejavu/DejaVuSans.ttf" );
+
+ Text::FontMetrics fontMetrics;
+ MetricsPtr mMetrics = Metrics::New(fontClient);
+ mMetrics->GetFontMetrics(fontID, fontMetrics);
+ float defaultFontLineHeight = (fontMetrics.ascender - fontMetrics.descender);
+
+ GetCursorPosition( parameters,
+ defaultFontLineHeight,
+ cursorInfo );
+
+ if( floor(cursorInfo.primaryCursorHeight) != data.heights[index] )
+ {
+ std::cout << " test " << index << " failed. Different primaryCursorHeight : " << cursorInfo.primaryCursorHeight << ", expected : " << data.heights[index] << std::endl;
+ return false;
+ }
+ }
+
+ return true;
+}
+
} // namespace
//////////////////////////////////////////////////////////
//
// UtcDaliGetClosestLine
// UtcDaliGetClosestCursorIndex
+// UtcDaliGetCursorPosition
+// UtcDaliFindSelectionIndices
+// UtcDaliPrimaryCursorHeight
//
//////////////////////////////////////////////////////////
tet_result(TET_PASS);
END_TEST;
}
+
+int UtcDaliPrimaryCursorHeight(void)
+{
+ tet_infoline(" UtcDaliPrimaryCursorHeight");
+
+ float heights[] = { 19.f };
+ CharacterIndex logicalIndex[] = { 1u };
+
+ struct PrimaryCursorHeightData data[] =
+ {
+ {
+ "Testing primary cursor height when line spacing is used.",
+ "Hello World",
+ 1u,
+ logicalIndex,
+ heights,
+ }
+ };
+ const unsigned int numberOfTests = 1u;
+
+ for( unsigned int index = 0; index < numberOfTests; ++index )
+ {
+ ToolkitTestApplication application;
+ if( !PrimaryCursorHeightTest( data[index] ) )
+ {
+ tet_result(TET_FAIL);
+ }
+ }
+
+ tet_result(TET_PASS);
+ END_TEST;
+}
false,
data.wrapMode,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
Vector<LineRun>& lines = textModel->mVisualModel->mLines;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
data.markupProcessorEnabled,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-#include <iostream>
#include <stdlib.h>
+#include <iostream>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
#include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/text-controller.h>
using namespace Dali;
using namespace Toolkit;
int UtcDaliTextEditorSelectText(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliTextEditorSelectText" );
+ tet_infoline("UtcDaliTextEditorSelectText");
// Create a text editor
TextEditor textEditor = TextEditor::New();
- textEditor.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 60.f ) );
- textEditor.SetProperty( TextEditor::Property::TEXT, "Hello World" );
+ textEditor.SetProperty(Actor::Property::SIZE, Vector2(400.f, 60.f));
+ textEditor.SetProperty(TextEditor::Property::TEXT, "Hello World");
// Add the text editor to the stage
- application.GetScene().Add( textEditor );
+ application.GetScene().Add(textEditor);
application.SendNotification();
application.Render();
- Toolkit::Internal::TextEditor& textEditorImpl = GetImpl( textEditor );
+ Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor);
application.SendNotification();
application.Render();
application.Render();
std::string selectedText = textEditorImpl.GetSelectedText();
- DALI_TEST_CHECK( selectedText == "Hello World" );
+ DALI_TEST_CHECK(selectedText == "Hello World");
// Select None
textEditorImpl.SelectNone();
application.Render();
selectedText = textEditorImpl.GetSelectedText();
- DALI_TEST_CHECK( selectedText == "" );
+ DALI_TEST_CHECK(selectedText == "");
END_TEST;
}
TextEditor textEditor = TextEditor::New();
- application.GetScene().Add( textEditor );
+ application.GetScene().Add(textEditor);
- textEditor.SetProperty( TextEditor::Property::TEXT, "<u>ABC</u>EF<u>GH</u>" );
- textEditor.SetProperty( TextEditor ::Property::ENABLE_MARKUP, true );
+ textEditor.SetProperty(TextEditor::Property::TEXT, "<u>ABC</u>EF<u>GH</u>");
+ textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true);
application.SendNotification();
application.Render();
uint32_t expectedNumberOfUnderlinedGlyphs = 5u;
- Toolkit::Internal::TextEditor& textEditorImpl = GetImpl( textEditor );
- const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns();
+ Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor);
+ const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns();
- DALI_TEST_EQUALS( numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION );
+ DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION);
Vector<GlyphRun> underlineRuns;
underlineRuns.Resize(numberOfUnderlineRuns);
textEditorImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns);
//ABC are underlined
- DALI_TEST_EQUALS( underlineRuns[0u].glyphIndex, 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( underlineRuns[1u].glyphIndex, 1u, TEST_LOCATION);
- DALI_TEST_EQUALS( underlineRuns[2u].glyphIndex, 2u, TEST_LOCATION);
+ DALI_TEST_EQUALS(underlineRuns[0u].glyphIndex, 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(underlineRuns[1u].glyphIndex, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(underlineRuns[2u].glyphIndex, 2u, TEST_LOCATION);
//GH are underlined
- DALI_TEST_EQUALS( underlineRuns[3u].glyphIndex, 5u, TEST_LOCATION);
- DALI_TEST_EQUALS( underlineRuns[4u].glyphIndex, 6u, TEST_LOCATION);
+ DALI_TEST_EQUALS(underlineRuns[3u].glyphIndex, 5u, TEST_LOCATION);
+ DALI_TEST_EQUALS(underlineRuns[4u].glyphIndex, 6u, TEST_LOCATION);
END_TEST;
}
// Create a text editor
TextEditor textEditor = TextEditor::New();
//Set size to avoid automatic eliding
- textEditor.SetProperty( Actor::Property::SIZE, Vector2(1025, 1025));
+ textEditor.SetProperty(Actor::Property::SIZE, Vector2(1025, 1025));
//Set very large font-size using point-size
- textEditor.SetProperty( TextEditor::Property::POINT_SIZE, 1000);
+ textEditor.SetProperty(TextEditor::Property::POINT_SIZE, 1000);
//Specify font-family
- textEditor.SetProperty( TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+ textEditor.SetProperty(TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
//Set text to check if appear or not
textEditor.SetProperty(TextEditor::Property::TEXT, "A");
- application.GetScene().Add( textEditor );
+ application.GetScene().Add(textEditor);
application.SendNotification();
application.Render();
//Check if Glyph is added to AtlasGlyphManger or not
int countAtlas = AtlasGlyphManager::Get().GetMetrics().mAtlasMetrics.mAtlasCount;
- DALI_TEST_EQUALS( countAtlas, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(countAtlas, 1, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliTextEditorFontPointSizeLargerThanAtlasPlaceholderCase(void)
{
ToolkitTestApplication application;
//Set Map of placeholder: text, font-family and point-size
Property::Map placeholderMapSet;
- placeholderMapSet["text"] = "A";
+ placeholderMapSet["text"] = "A";
placeholderMapSet["fontFamily"] = "DejaVu Sans";
- placeholderMapSet["pixelSize"] = 1000.0f;
+ placeholderMapSet["pixelSize"] = 1000.0f;
// Create a text editor
TextEditor textEditor = TextEditor::New();
//Set size to avoid automatic eliding
- textEditor.SetProperty( Actor::Property::SIZE, Vector2(1025, 1025));
+ textEditor.SetProperty(Actor::Property::SIZE, Vector2(1025, 1025));
//Set placeholder
- textEditor.SetProperty( TextEditor::Property::PLACEHOLDER, placeholderMapSet) ;
+ textEditor.SetProperty(TextEditor::Property::PLACEHOLDER, placeholderMapSet);
- application.GetScene().Add( textEditor );
+ application.GetScene().Add(textEditor);
application.SendNotification();
application.Render();
//Check if Glyph is added to AtlasGlyphManger or not
int countAtlas = AtlasGlyphManager::Get().GetMetrics().mAtlasMetrics.mAtlasCount;
- DALI_TEST_EQUALS( countAtlas, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(countAtlas, 1, TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliTextEditorBackgroundTag\n");
TextEditor editor = TextEditor::New();
- DALI_TEST_CHECK( editor );
+ DALI_TEST_CHECK(editor);
- editor.SetProperty( TextEditor ::Property::ENABLE_MARKUP, true );
- editor.SetProperty( TextEditor::Property::TEXT, "H<background color='red'>e</background> Worl<background color='yellow'>d</background>" );
- application.GetScene().Add( editor );
+ editor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true);
+ editor.SetProperty(TextEditor::Property::TEXT, "H<background color='red'>e</background> Worl<background color='yellow'>d</background>");
+ application.GetScene().Add(editor);
application.SendNotification();
application.Render();
- Toolkit::Internal::TextEditor& editorImpl = GetImpl( editor );
- const ColorIndex* const backgroundColorIndicesBuffer = editorImpl.GetTextController()->GetTextModel()->GetBackgroundColorIndices();
+ Toolkit::Internal::TextEditor& editorImpl = GetImpl(editor);
+ const ColorIndex* const backgroundColorIndicesBuffer = editorImpl.GetTextController()->GetTextModel()->GetBackgroundColorIndices();
- DALI_TEST_CHECK( backgroundColorIndicesBuffer );
+ DALI_TEST_CHECK(backgroundColorIndicesBuffer);
//default color
- DALI_TEST_EQUALS( backgroundColorIndicesBuffer[0], 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(backgroundColorIndicesBuffer[0], 0u, TEST_LOCATION);
//red color
- DALI_TEST_EQUALS( backgroundColorIndicesBuffer[1], 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(backgroundColorIndicesBuffer[1], 1u, TEST_LOCATION);
//yellow color
- DALI_TEST_EQUALS( backgroundColorIndicesBuffer[7], 2u, TEST_LOCATION);
+ DALI_TEST_EQUALS(backgroundColorIndicesBuffer[7], 2u, TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliTextEditorTextWithSpan\n");
TextEditor editor = TextEditor::New();
- DALI_TEST_CHECK( editor );
+ DALI_TEST_CHECK(editor);
- editor.SetProperty( TextEditor ::Property::ENABLE_MARKUP, true );
- editor.SetProperty( TextEditor::Property::TEXT, "Hello Span" );
- application.GetScene().Add( editor );
+ editor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true);
+ editor.SetProperty(TextEditor::Property::TEXT, "Hello Span");
+ application.GetScene().Add(editor);
application.SendNotification();
application.Render();
Vector3 originalSize = editor.GetNaturalSize();
- editor.SetProperty( TextEditor::Property::TEXT, "H<span font-size='45' font-family='DejaVu Sans' font-width='condensed' font-slant='italic' text-color='red'>ello</span> Span" );
+ editor.SetProperty(TextEditor::Property::TEXT, "H<span font-size='45' font-family='DejaVu Sans' font-width='condensed' font-slant='italic' text-color='red'>ello</span> Span");
application.SendNotification();
application.Render();
DALI_TEST_GREATER(spanSize.width, originalSize.width, TEST_LOCATION);
- Toolkit::Internal::TextEditor& editorImpl = GetImpl( editor );
- const ColorIndex* const colorIndicesBuffer1 = editorImpl.GetTextController()->GetTextModel()->GetColorIndices();
+ Toolkit::Internal::TextEditor& editorImpl = GetImpl(editor);
+ const ColorIndex* const colorIndicesBuffer1 = editorImpl.GetTextController()->GetTextModel()->GetColorIndices();
- DALI_TEST_CHECK( colorIndicesBuffer1 );
+ DALI_TEST_CHECK(colorIndicesBuffer1);
//default color
- DALI_TEST_EQUALS( colorIndicesBuffer1[0], 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(colorIndicesBuffer1[0], 0u, TEST_LOCATION);
//span color
- DALI_TEST_EQUALS( colorIndicesBuffer1[1], 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(colorIndicesBuffer1[1], 1u, TEST_LOCATION);
//default color
- DALI_TEST_EQUALS( colorIndicesBuffer1[6], 0u, TEST_LOCATION);
-
+ DALI_TEST_EQUALS(colorIndicesBuffer1[6], 0u, TEST_LOCATION);
- editor.SetProperty( TextEditor::Property::TEXT, "<span font-size='45'>H</span>ello <span text-color='red'>S</span>pan" );
+ editor.SetProperty(TextEditor::Property::TEXT, "<span font-size='45'>H</span>ello <span text-color='red'>S</span>pan");
application.SendNotification();
application.Render();
const ColorIndex* const colorIndicesBuffer2 = editorImpl.GetTextController()->GetTextModel()->GetColorIndices();
- DALI_TEST_CHECK( colorIndicesBuffer2 );
+ DALI_TEST_CHECK(colorIndicesBuffer2);
//default color
- DALI_TEST_EQUALS( colorIndicesBuffer2[0], 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(colorIndicesBuffer2[0], 0u, TEST_LOCATION);
//default color
- DALI_TEST_EQUALS( colorIndicesBuffer2[1], 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(colorIndicesBuffer2[1], 0u, TEST_LOCATION);
//span color
- DALI_TEST_EQUALS( colorIndicesBuffer2[6], 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(colorIndicesBuffer2[6], 1u, TEST_LOCATION);
//default color
- DALI_TEST_EQUALS( colorIndicesBuffer2[7], 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(colorIndicesBuffer2[7], 0u, TEST_LOCATION);
END_TEST;
}
application.SendNotification();
application.Render();
- Toolkit::Internal::TextEditor& editorImpl = GetImpl(editor);
- ControllerPtr controller = editorImpl.GetTextController();
- Controller::Impl& controllerImpl = Controller::Impl::GetImplementation(*controller.Get());
+ Toolkit::Internal::TextEditor& editorImpl = GetImpl(editor);
+ ControllerPtr controller = editorImpl.GetTextController();
+ Controller::Impl& controllerImpl = Controller::Impl::GetImplementation(*controller.Get());
// Default color is transparent
controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
END_TEST;
}
+
+int UtcDaliTextEditorTextPositionWithMinLineAndBigFont(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextEditorTextPositionWithMinLine ");
+
+ TextEditor textEditor = TextEditor::New();
+
+ textEditor.SetProperty(TextEditor::Property::TEXT, "<span font-size='45'>H</span>\ni");
+ textEditor.SetProperty(DevelTextEditor::Property::MIN_LINE_SIZE, 50);
+ textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true);
+
+ application.GetScene().Add(textEditor);
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor);
+ Text::ViewInterface& view = textEditorImpl.GetTextController()->GetView();
+
+ Length numberOfGlyphs = view.GetNumberOfGlyphs();
+
+ DALI_TEST_EQUALS(numberOfGlyphs, 3u, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+ Vector<GlyphInfo> glyphs;
+ glyphs.Resize(numberOfGlyphs);
+
+ Vector<Vector2> positions;
+ positions.Resize(numberOfGlyphs);
+
+ float alignmentOffset = 0u;
+ numberOfGlyphs = view.GetGlyphs(glyphs.Begin(),
+ positions.Begin(),
+ alignmentOffset,
+ 0u,
+ numberOfGlyphs);
+
+ DALI_TEST_EQUALS(positions[2].y, 165.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+ END_TEST;
+}
\ No newline at end of file
{
}
- virtual void UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet,
- bool useAtlasing, const Vector4& atlasRect, bool preMultiplied ) override
+ virtual void LoadComplete( bool loadSuccess, TextureInformation textureInformation ) override
{
- mCompleteType = CompleteType::UPLOAD_COMPLETE;
- mLoaded = loadSuccess;
- mObserverCalled = true;
- mTextureSet = textureSet;
- }
-
- virtual void LoadComplete( bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied ) override
- {
- mCompleteType = CompleteType::LOAD_COMPLETE;
+ if(textureInformation.returnType == TextureUploadObserver::ReturnType::TEXTURE)
+ {
+ mCompleteType = CompleteType::UPLOAD_COMPLETE;
+ }
+ else
+ {
+ mCompleteType = CompleteType::LOAD_COMPLETE;
+ }
mLoaded = loadSuccess;
mObserverCalled = true;
+ mTextureSet = textureInformation.textureSet;
}
CompleteType mCompleteType;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
false,
LineWrap::WORD,
false,
- Toolkit::DevelText::EllipsisPosition::END );
+ Toolkit::DevelText::EllipsisPosition::END,
+ 0.f );
LogicalModelPtr logicalModel = textModel->mLogicalModel;
VisualModelPtr visualModel = textModel->mVisualModel;
// INTERNAL INCLUDES
#include <dali-test-suite-utils.h>
#include <dali/devel-api/text-abstraction/font-client.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <toolkit-adaptor-impl.h>
#include <toolkit-lifecycle-controller.h>
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
DALI_TEST_CHECK( ! visual ); // Visual should be invalid
+ // Set a URL in property map again
+ propertyMap[ImageVisual::Property::URL] = gImage_34_RGBA;
+ imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+
+ application.SendNotification();
+ application.Render( 16 );
+
+ value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+ visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+
+ DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
+ DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
+ DALI_TEST_CHECK( visual ); // Visual should be valid
+
+ // Set an empty property map
+ propertyMap.Clear();
+ imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+
+ application.SendNotification();
+ application.Render( 16 );
+
+ value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+ visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+
+ DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
+ DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
+ DALI_TEST_CHECK( map.Empty() ); // But PropertyMap should be empty
+ DALI_TEST_CHECK( ! visual ); // Visual should be invalid
+
END_TEST;
}
END_TEST;
}
+int UtcDaliImageViewImageLoadFailure04(void)
+{
+ ToolkitTestApplication application;
+
+ ImageView imageView = ImageView::New("invalidUrl.png");
+ imageView.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+ application.GetScene().Add( imageView );
+ application.SendNotification();
+ application.Render(16);
+
+ // loading started, this waits for the loader thread
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+
+ Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+ DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL, TEST_BROKEN_IMAGE_S);
+ DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::NORMAL, "invalidBroken.png");
+ DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::LARGE, TEST_BROKEN_IMAGE_L);
+
+ ImageView imageView2 = ImageView::New("invalidUrl.png");
+ imageView2.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+ application.GetScene().Add( imageView2 );
+
+ std::string brokenUrl;
+ brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL);
+ DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_S, brokenUrl, TEST_LOCATION);
+
+ brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::LARGE);
+ DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_L, brokenUrl, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render(16);
+
+ // loading started, this waits for the loader thread
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+
+ DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::NORMAL, "invalidBroken.9.png");
+
+ ImageView imageView3 = ImageView::New("invalidUrl.png");
+ imageView3.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+ application.GetScene().Add( imageView3 );
+
+ application.SendNotification();
+ application.Render(16);
+
+ // loading started, this waits for the loader thread
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+ END_TEST;
+}
+
+
namespace
{
if(gResourceReadySignalCounter == 0)
{
// Queue loading
- // 1. Use cached image, then UploadComplete will be called right after OnResourceReadySignal03.
+ // 1. Use cached image, then LoadComplete will be called right after OnResourceReadySignal03.
gImageView2[ImageView::Property::IMAGE] = gImage_34_RGBA;
// 2. Load a new image
const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION = "matchSystemLanguageDirection";
const char* const PROPERTY_NAME_MAX_LENGTH = "maxLength";
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
+const char* const PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE = "enableFontSizeScale";
const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup";
const char* const PROPERTY_NAME_INPUT_METHOD_SETTINGS = "inputMethodSettings";
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == TextEditor::Property::ENABLE_SELECTION );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == TextEditor::Property::PLACEHOLDER );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextEditor::Property::FONT_SIZE_SCALE );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE ) == DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == DevelTextEditor::Property::PLACEHOLDER_TEXT );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextEditor::Property::ENABLE_SHIFT_SELECTION );
DALI_TEST_EQUALS( editor.GetProperty<float>( DevelTextEditor::Property::FONT_SIZE_SCALE ), 2.5f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
editor.SetProperty( DevelTextEditor::Property::FONT_SIZE_SCALE, 1.0f );
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE, false );
+ DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE ), false, TEST_LOCATION );
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE, true );
+
// Reset font style.
fontStyleMapSet.Clear();
fontStyleMapSet.Insert( "weight", "normal" );
END_TEST;
}
+int utcDaliTextEditorSelectionWithSecondaryCursor(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorSelectionWithSecondaryCursor");
+
+ // Checks if the actor is created.
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ application.GetScene().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+ editor.SetProperty( TextEditor::Property::TEXT, "اللغة العربية\nمرØبا بالجميع\nالسلام عليكم <span font-size='12' font-family='DejaVu Sans' >Hello world</span>" );
+ editor.SetProperty( TextEditor::Property::POINT_SIZE, 12.f );
+ editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+ editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ editor.SetProperty( DevelTextEditor::Property::MIN_LINE_SIZE, 50.f );
+ editor.SetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Tap on the text editor
+ TestGenerateTap( application, 3.0f, 25.0f );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ //Select the last Arabic word (RTL) & some the space before the English (LTR) letters.
+ DevelTextEditor::SelectText( editor, 35, 41 );// This will activate the alternative cursor position and thus 'cursorInfo.isSecondaryCursor' will be true.
+
+ application.SendNotification();
+ application.Render();
+
+ std::string selectedText = editor.GetProperty( DevelTextEditor::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "عليكم ", selectedText, TEST_LOCATION );
+
+ END_TEST;
+}
+
int utcDaliTextEditorSelectionChangedSignal(void)
{
ToolkitTestApplication application;
const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup";
const char* const PROPERTY_NAME_BACKGROUND = "textBackground";
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
+const char* const PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE = "enableFontSizeScale";
const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
const char* const PROPERTY_NAME_INPUT_FILTER = "inputFilter";
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == TextField::Property::PLACEHOLDER );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextField::Property::ELLIPSIS );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextField::Property::FONT_SIZE_SCALE );
+ DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE ) == DevelTextField::Property::ENABLE_FONT_SIZE_SCALE );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextField::Property::ENABLE_SHIFT_SELECTION );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE ) == DevelTextField::Property::ENABLE_GRAB_HANDLE );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION );
DALI_TEST_EQUALS( field.GetProperty<float>( DevelTextField::Property::FONT_SIZE_SCALE ), 2.5f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
field.SetProperty( DevelTextField::Property::FONT_SIZE_SCALE, 1.0f );
+ field.SetProperty( DevelTextField::Property::ENABLE_FONT_SIZE_SCALE, false );
+ DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::ENABLE_FONT_SIZE_SCALE ), false, TEST_LOCATION );
+ field.SetProperty( DevelTextField::Property::ENABLE_FONT_SIZE_SCALE, true );
+
// Reset font style.
fontStyleMapSet.Clear();
fontStyleMapSet.Insert( "weight", "normal" );
application.SendNotification();
application.Render();
+ // Even if resize, selection should remain.
+ textField.SetProperty( Actor::Property::SIZE, Vector2( 150.f, 50.f ) );
+
+ application.SendNotification();
+ application.Render();
+
// Should be 2 children, the stencil and the layer
DALI_TEST_EQUALS( 2u, textField.GetChildCount(), TEST_LOCATION );
const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis";
const char* const PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY = "autoScrollLoopDelay";
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
+const char* const PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE = "enableFontSizeScale";
const char* const PROPERTY_NAME_ELLIPSIS_POSITION = "ellipsisPosition";
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextLabel::Property::ELLIPSIS );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY ) == TextLabel::Property::AUTO_SCROLL_LOOP_DELAY );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextLabel::Property::FONT_SIZE_SCALE );
+ DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE ) == DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS_POSITION ) == DevelTextLabel::Property::ELLIPSIS_POSITION );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextLabel::Property::STRIKETHROUGH );
DALI_TEST_EQUALS( label.GetProperty<float>( DevelTextLabel::Property::FONT_SIZE_SCALE ), 2.5f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
label.SetProperty( DevelTextLabel::Property::FONT_SIZE_SCALE, 1.0f );
+ label.SetProperty( DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE, false );
+ DALI_TEST_EQUALS( label.GetProperty<bool>( DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE ), false, TEST_LOCATION );
+ label.SetProperty( DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE, true );
+
// Reset font style.
fontStyleMapSet.Clear();
fontStyleMapSet.Insert( "weight", "normal" );
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<int>() == WrapMode::MIRRORED_REPEAT);
- value = resultMap.Find( "synchronousLoading", Property::BOOLEAN );
+ value = resultMap.Find( ImageVisual::Property::SYNCHRONOUS_LOADING, Property::BOOLEAN );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<bool>() == true );
*/
// CLASS HEADER
-#include "accessible-impl.h"
+#include "control-accessible.h"
// EXTERNAL INCLUDES
#ifdef DGETTEXT_ENABLED
}
} // unnamed namespace
-AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal)
-: mSelf(self),
+ControlAccessible::ControlAccessible(Dali::Actor self, Dali::Accessibility::Role role, bool modal)
+: ActorAccessible(self),
mIsModal(modal)
{
auto control = Dali::Toolkit::Control::DownCast(Self());
});
}
-std::string AccessibleImpl::GetName()
+std::string ControlAccessible::GetName() const
{
auto control = Dali::Toolkit::Control::DownCast(Self());
return GetLocaleText(name);
}
-std::string AccessibleImpl::GetNameRaw()
+std::string ControlAccessible::GetNameRaw() const
{
return {};
}
-std::string AccessibleImpl::GetDescription()
+std::string ControlAccessible::GetDescription() const
{
auto control = Dali::Toolkit::Control::DownCast(Self());
return GetLocaleText(description);
}
-std::string AccessibleImpl::GetDescriptionRaw()
+std::string ControlAccessible::GetDescriptionRaw() const
{
return {};
}
-Dali::Accessibility::Accessible* AccessibleImpl::GetParent()
-{
- return Dali::Accessibility::Accessible::Get(Self().GetParent());
-}
-
-size_t AccessibleImpl::GetChildCount()
-{
- return Self().GetChildCount();
-}
-
-Dali::Accessibility::Accessible* AccessibleImpl::GetChildAtIndex(size_t index)
-{
- return Dali::Accessibility::Accessible::Get(Self().GetChildAt(static_cast<unsigned int>(index)));
-}
-
-size_t AccessibleImpl::GetIndexInParent()
-{
- auto self = Self();
- auto parent = self.GetParent();
- DALI_ASSERT_ALWAYS(parent && "can't call GetIndexInParent on object without parent");
-
- auto count = parent.GetChildCount();
- for(auto i = 0u; i < count; ++i)
- {
- auto child = parent.GetChildAt(i);
- if(child == self)
- {
- return i;
- }
- }
- DALI_ASSERT_ALWAYS(false && "object isn't child of it's parent");
- return static_cast<size_t>(-1);
-}
-
-Dali::Accessibility::Role AccessibleImpl::GetRole()
+Dali::Accessibility::Role ControlAccessible::GetRole() const
{
return Self().GetProperty<Dali::Accessibility::Role>(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE);
}
-std::string AccessibleImpl::GetLocalizedRoleName()
+std::string ControlAccessible::GetLocalizedRoleName() const
{
return GetLocaleText(GetRoleName());
}
-bool AccessibleImpl::IsShowing()
+bool ControlAccessible::IsShowing()
{
Dali::Actor self = Self();
if(!self.GetProperty<bool>(Actor::Property::VISIBLE) || self.GetProperty<Vector4>(Actor::Property::WORLD_COLOR).a == 0 || self.GetProperty<bool>(Dali::DevelActor::Property::CULLED))
}
auto* child = this;
- auto* parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(child->GetParent());
+ auto* parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(child->GetParent());
if(!parent)
{
return true;
{
return false;
}
- parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(parent->GetParent());
+ parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(parent->GetParent());
}
return true;
}
-Dali::Accessibility::States AccessibleImpl::CalculateStates()
+Dali::Accessibility::States ControlAccessible::CalculateStates()
{
Dali::Actor self = Self();
Dali::Accessibility::States state;
return state;
}
-Dali::Accessibility::States AccessibleImpl::GetStates()
+Dali::Accessibility::States ControlAccessible::GetStates()
{
return CalculateStates();
}
-Dali::Accessibility::Attributes AccessibleImpl::GetAttributes()
+Dali::Accessibility::Attributes ControlAccessible::GetAttributes() const
{
std::unordered_map<std::string, std::string> attributeMap;
auto control = Dali::Toolkit::Control::DownCast(Self());
return attributeMap;
}
-Dali::Accessibility::ComponentLayer AccessibleImpl::GetLayer()
-{
- return Dali::Accessibility::ComponentLayer::WINDOW;
-}
-
-Dali::Rect<> AccessibleImpl::GetExtents(Dali::Accessibility::CoordinateType type)
+bool ControlAccessible::IsHidden() const
{
- Dali::Actor self = Self();
-
- Vector2 screenPosition = self.GetProperty(Dali::DevelActor::Property::SCREEN_POSITION).Get<Vector2>();
- auto size = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
- bool positionUsesAnchorPoint = self.GetProperty(Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT).Get<bool>();
- Vector3 anchorPointOffSet = size * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
- Vector2 position = Vector2((screenPosition.x - anchorPointOffSet.x), (screenPosition.y - anchorPointOffSet.y));
+ auto control = Dali::Toolkit::Control::DownCast(Self());
- if(type == Dali::Accessibility::CoordinateType::WINDOW)
- {
- return {position.x, position.y, size.x, size.y};
- }
- else // Dali::Accessibility::CoordinateType::SCREEN
- {
- auto window = Dali::DevelWindow::Get(self);
- auto windowPosition = window.GetPosition();
- return {position.x + windowPosition.GetX(), position.y + windowPosition.GetY(), size.x, size.y};
- }
-}
+ Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
+ Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get(internalControl);
-int16_t AccessibleImpl::GetMdiZOrder()
-{
- return 0;
-}
-double AccessibleImpl::GetAlpha()
-{
- return 0;
+ return controlImpl.mAccessibilityHidden;
}
-bool AccessibleImpl::GrabFocus()
+bool ControlAccessible::GrabFocus()
{
return Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self());
}
-void AccessibleImpl::ScrollToSelf()
+void ControlAccessible::ScrollToSelf()
{
auto* child = this;
- auto* parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(child->GetParent());
+ auto* parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(child->GetParent());
while (parent)
{
parent->ScrollToChild(child->Self());
}
- parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(parent->GetParent());
+ parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(parent->GetParent());
}
}
-void AccessibleImpl::RegisterPositionPropertyNotification()
+void ControlAccessible::RegisterPositionPropertyNotification()
{
auto control = Dali::Toolkit::Control::DownCast(Self());
Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
controlImpl.RegisterAccessibilityPositionPropertyNotification();
}
-void AccessibleImpl::UnregisterPositionPropertyNotification()
+void ControlAccessible::UnregisterPositionPropertyNotification()
{
auto control = Dali::Toolkit::Control::DownCast(Self());
Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
controlImpl.UnregisterAccessibilityPositionPropertyNotification();
}
-bool AccessibleImpl::GrabHighlight()
+bool ControlAccessible::GrabHighlight()
{
Dali::Actor self = Self();
auto oldHighlightedActor = GetCurrentlyHighlightedActor();
highlight.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
// Need to set resize policy again, to update SIZE property which is set by
- // AccessibleImpl_NUI. The highlight could move from AccessibleImpl_NUI to
- // AccessibleImpl. In this case, highlight has incorrect size.
+ // NUIViewAccessible. The highlight could move from NUIViewAccessible to
+ // ControlAccessible. In this case, highlight has incorrect size.
highlight.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
// Remember the highlight actor, so that when the default is changed with
return true;
}
-bool AccessibleImpl::ClearHighlight()
+bool ControlAccessible::ClearHighlight()
{
Dali::Actor self = Self();
return false;
}
-std::string AccessibleImpl::GetActionName(size_t index)
+std::string ControlAccessible::GetActionName(size_t index) const
{
if(index >= GetActionCount())
{
return type.GetActionName(index);
}
-std::string AccessibleImpl::GetLocalizedActionName(size_t index)
+std::string ControlAccessible::GetLocalizedActionName(size_t index) const
{
return GetLocaleText(GetActionName(index));
}
-std::string AccessibleImpl::GetActionDescription(size_t index)
+std::string ControlAccessible::GetActionDescription(size_t index) const
{
return {};
}
-size_t AccessibleImpl::GetActionCount()
+size_t ControlAccessible::GetActionCount() const
{
Dali::TypeInfo type;
Self().GetTypeInfo(type);
return type.GetActionCount();
}
-std::string AccessibleImpl::GetActionKeyBinding(size_t index)
+std::string ControlAccessible::GetActionKeyBinding(size_t index) const
{
return {};
}
-bool AccessibleImpl::DoAction(size_t index)
+bool ControlAccessible::DoAction(size_t index)
{
std::string actionName = GetActionName(index);
return Self().DoAction(actionName, {});
}
-bool AccessibleImpl::DoAction(const std::string& name)
+bool ControlAccessible::DoAction(const std::string& name)
{
return Self().DoAction(name, {});
}
-bool AccessibleImpl::DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo)
+bool ControlAccessible::DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo)
{
auto control = Dali::Toolkit::Control::DownCast(Self());
return false;
}
-std::vector<Dali::Accessibility::Relation> AccessibleImpl::GetRelationSet()
+std::vector<Dali::Accessibility::Relation> ControlAccessible::GetRelationSet()
{
auto control = Dali::Toolkit::Control::DownCast(Self());
return ret;
}
-Dali::Actor AccessibleImpl::GetInternalActor()
-{
- return Dali::Actor{};
-}
-
-bool AccessibleImpl::ScrollToChild(Actor child)
+bool ControlAccessible::ScrollToChild(Actor child)
{
return false;
}
-Dali::Property::Index AccessibleImpl::GetNamePropertyIndex()
+Dali::Property::Index ControlAccessible::GetNamePropertyIndex()
{
return Actor::Property::NAME;
}
-Dali::Property::Index AccessibleImpl::GetDescriptionPropertyIndex()
+Dali::Property::Index ControlAccessible::GetDescriptionPropertyIndex()
{
return Dali::Property::INVALID_INDEX;
}
-void AccessibleImpl::SetLastPosition(Vector2 position)
+void ControlAccessible::SetLastPosition(Vector2 position)
{
mLastPosition = position;
}
-Vector2 AccessibleImpl::GetLastPosition() const
+Vector2 ControlAccessible::GetLastPosition() const
{
return mLastPosition;
}
-#ifndef DALI_TOOLKIT_ACCESSIBLE_IMPL_H
-#define DALI_TOOLKIT_ACCESSIBLE_IMPL_H
+#ifndef DALI_TOOLKIT_CONTROL_ACCESSIBLE_H
+#define DALI_TOOLKIT_CONTROL_ACCESSIBLE_H
+
/*
* Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* limitations under the License.
*
*/
+
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/adaptor-framework/actor-accessible.h>
+#include <dali/devel-api/atspi-interfaces/action.h>
#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
* @see Dali::Accessibility::Text
* @see Dali::Accessibility::EditableText
*/
-struct DALI_TOOLKIT_API AccessibleImpl : public virtual Dali::Accessibility::Accessible,
- public virtual Dali::Accessibility::Component,
- public virtual Dali::Accessibility::Collection,
- public virtual Dali::Accessibility::Action
+struct DALI_TOOLKIT_API ControlAccessible : public Dali::Accessibility::ActorAccessible,
+ public virtual Dali::Accessibility::Action
{
protected:
Vector2 mLastPosition{0.0f, 0.0f};
- Dali::WeakHandle<Dali::Actor> mSelf;
Dali::WeakHandle<Dali::Actor> mCurrentHighlightActor;
bool mIsModal = false;
bool mIsRoot = false;
- Dali::Actor Self() const
- {
- auto handle = mSelf.GetHandle();
-
- // Control::Impl holds a std::unique_ptr to the Accessible object,
- // so that one does not outlive the other.
- DALI_ASSERT_ALWAYS(handle);
-
- return handle;
- }
-
void ScrollToSelf();
/**
bool IsShowing();
public:
- AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal = false);
+ ControlAccessible(Dali::Actor self, Dali::Accessibility::Role role, bool modal = false);
/**
* @copydoc Dali::Accessibility::Accessible::GetName()
*/
- std::string GetName() override;
+ std::string GetName() const override;
/**
* @brief Returns the actor's name in the absence of ACCESSIBILITY_NAME property
*/
- virtual std::string GetNameRaw();
+ virtual std::string GetNameRaw() const;
/**
* @copydoc Dali::Accessibility::Accessible::GetDescription()
*/
- std::string GetDescription() override;
+ std::string GetDescription() const override;
/**
* @brief Returns the actor's description in the absence of ACCESSIBILITY_DESCRIPTION property
*/
- virtual std::string GetDescriptionRaw();
-
- /**
- * @copydoc Dali::Accessibility::Accessible::GetParent()
- */
- Dali::Accessibility::Accessible* GetParent() override;
-
- /**
- * @copydoc Dali::Accessibility::Accessible::GetChildCount()
- */
- size_t GetChildCount() override;
-
- /**
- * @copydoc Dali::Accessibility::Accessible::GetChildAtIndex()
- */
- Dali::Accessibility::Accessible* GetChildAtIndex(size_t index) override;
-
- /**
- * @copydoc Dali::Accessibility::Accessible::GetIndexInParent()
- */
- size_t GetIndexInParent() override;
+ virtual std::string GetDescriptionRaw() const;
/**
* @copydoc Dali::Accessibility::Accessible::GetRole()
*/
- Dali::Accessibility::Role GetRole() override;
+ Dali::Accessibility::Role GetRole() const override;
/**
* @copydoc Dali::Accessibility::Accessible::GetLocalizedRoleName()
*/
- std::string GetLocalizedRoleName() override;
+ std::string GetLocalizedRoleName() const override;
/**
* @copydoc Dali::Accessibility::Accessible::GetStates()
/**
* @copydoc Dali::Accessibility::Accessible::GetAttributes()
*/
- Dali::Accessibility::Attributes GetAttributes() override;
-
- /**
- * @copydoc Dali::Accessibility::Component::GetExtents()
- */
- Dali::Rect<> GetExtents(Accessibility::CoordinateType type) override;
-
- /**
- * @copydoc Dali::Accessibility::Component::GetLayer()
- */
- Dali::Accessibility::ComponentLayer GetLayer() override;
+ Dali::Accessibility::Attributes GetAttributes() const override;
/**
- * @copydoc Dali::Accessibility::Component::GetMdiZOrder()
+ * @copydoc Dali::Accessibility::Accessible::IsHidden()
*/
- int16_t GetMdiZOrder() override;
+ bool IsHidden() const override;
/**
* @copydoc Dali::Accessibility::Component::GrabFocus()
bool GrabFocus() override;
/**
- * @copydoc Dali::Accessibility::Component::GetAlpha()
- */
- double GetAlpha() override;
-
- /**
* @copydoc Dali::Accessibility::Component::GrabHighlight()
*/
bool GrabHighlight() override;
/**
* @copydoc Dali::Accessibility::Action::GetActionName()
*/
- std::string GetActionName(size_t index) override;
+ std::string GetActionName(size_t index) const override;
/**
* @copydoc Dali::Accessibility::Action::GetLocalizedActionName()
*/
- std::string GetLocalizedActionName(size_t index) override;
+ std::string GetLocalizedActionName(size_t index) const override;
/**
* @copydoc Dali::Accessibility::Action::GetActionDescription()
*/
- std::string GetActionDescription(size_t index) override;
+ std::string GetActionDescription(size_t index) const override;
/**
* @copydoc Dali::Accessibility::Action::GetActionCount()
*/
- size_t GetActionCount() override;
+ size_t GetActionCount() const override;
/**
* @copydoc Dali::Accessibility::Action::GetActionKeyBinding()
*/
- std::string GetActionKeyBinding(size_t index) override;
+ std::string GetActionKeyBinding(size_t index) const override;
/**
- * @copydoc Dali::Accessibility::Action::DoAction(size_t)
+ * @copydoc Dali::Accessibility::Action::DoAction(std::size_t)
*/
bool DoAction(size_t index) override;
std::vector<Dali::Accessibility::Relation> GetRelationSet() override;
/**
- * @copydoc Dali::Accessibility::Accessible::GetInternalActor()
- */
- Dali::Actor GetInternalActor() override;
-
- /**
* @copydoc Dali::Accessibility::Accessible::GetStates()
*/
virtual Dali::Accessibility::States CalculateStates();
} // namespace Dali::Toolkit::DevelControl
-#endif // DALI_TOOLKIT_ACCESSIBLE_IMPL_H
+#endif // DALI_TOOLKIT_CONTROL_ACCESSIBLE_H
*
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
#include <dali/devel-api/adaptor-framework/input-method-context.h>
#include <dali/public-api/animation/alpha-function.h>
#include <dali/public-api/animation/time-period.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/controls/accessible-impl.h>
+#include <dali-toolkit/devel-api/controls/control-accessible.h>
#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
#include <dali-toolkit/public-api/controls/control.h>
* @see Dali::Accessibility::Role
*/
ACCESSIBILITY_ROLE,
+
/**
* @brief Mark of able to highlight object.
* @details Name "accessibilityHighlightable", type Property::BOOLEAN.
*/
ACCESSIBILITY_HIGHLIGHTABLE,
+
/**
* @brief Set of accessibility attributes describing object in accessibility hierarchy
* @details Name "accessibilityAttributes", type Property::MAP
* @note If a control's dispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
*/
DISPATCH_KEY_EVENTS,
+
+ /**
+ * @brief Marks the object as invisible to AT-SPI clients.
+ * @details Name "accessibilityHidden", type Property::BOOLEAN.
+ * @note The representative Accessible object will not appear in the AT-SPI tree.
+ */
+ ACCESSIBILITY_HIDDEN,
};
} // namespace Property
* @code
* SetAccessibilityConstructor( []( Dali::Actor actor ) {
return std::unique_ptr< Dali::Accessibility::Accessible >(
- new AccessibleImpl( actor, Dali::Accessibility::Role::DIALOG, true ) );
+ new ControlAccessible( actor, Dali::Accessibility::Role::DIALOG, true ) );
} );
* @endcode
*
#define DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
FONT_SIZE_SCALE,
/**
+ * @brief True to enable the font size scale or false to disable.
+ * @details Name "enableFontSizeScale", type Property::BOOLEAN.
+ * @note The default value is true.
+ * If false, font size scale is not apppied.
+ */
+ ENABLE_FONT_SIZE_SCALE,
+
+ /**
* @brief The position for primary cursor.
* @details Name "primaryCursorPosition", type Property::INTEGER.
*/
#define DALI_TOOLKIT_TEXT_FIELD_DEVEL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
FONT_SIZE_SCALE,
/**
+ * @brief True to enable the font size scale or false to disable.
+ * @details Name "enableFontSizeScale", type Property::BOOLEAN.
+ * @note The default value is true.
+ * If false, font size scale is not apppied.
+ */
+ ENABLE_FONT_SIZE_SCALE,
+
+ /**
* @brief The position for primary cursor.
* @details Name "primaryCursorPosition", type Property::INTEGER.
*/
#define DALI_TOOLKIT_TEXT_LABEL_DEVEL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
FONT_SIZE_SCALE,
/**
+ * @brief True to enable the font size scale or false to disable.
+ * @details Name "enableFontSizeScale", type Property::BOOLEAN.
+ * @note The default value is true.
+ * If false, font size scale is not apppied.
+ */
+ ENABLE_FONT_SIZE_SCALE,
+
+ /**
* @brief The enumerations used to specify whether to position the ellipsis at the END, START or MIDDLE of the text.
* @details Name "EllipsisPosition", type [Type](@ref Dali::Toolkit::DevelText::EllipsisPosition::Type) (Property::INTEGER), or Property::STRING. Read/Write
* @note Default is EllipsisPosition::END.
${devel_api_src_dir}/builder/builder.cpp
${devel_api_src_dir}/builder/json-parser.cpp
${devel_api_src_dir}/builder/tree-node.cpp
- ${devel_api_src_dir}/controls/accessible-impl.cpp
${devel_api_src_dir}/controls/canvas-view/canvas-view.cpp
+ ${devel_api_src_dir}/controls/control-accessible.cpp
${devel_api_src_dir}/controls/control-devel.cpp
${devel_api_src_dir}/controls/control-wrapper.cpp
${devel_api_src_dir}/controls/control-wrapper-impl.cpp
${devel_api_src_dir}/transition-effects/cube-transition-fold-effect.cpp
${devel_api_src_dir}/transition-effects/cube-transition-wave-effect.cpp
${devel_api_src_dir}/utility/npatch-utilities.cpp
+ ${devel_api_src_dir}/utility/npatch-helper.cpp
${devel_api_src_dir}/visual-factory/transition-data.cpp
${devel_api_src_dir}/visual-factory/visual-factory.cpp
${devel_api_src_dir}/visual-factory/visual-base.cpp
)
SET( devel_api_controls_header_files
- ${devel_api_src_dir}/controls/accessible-impl.h
${devel_api_src_dir}/controls/canvas-view/canvas-view.h
+ ${devel_api_src_dir}/controls/control-accessible.h
${devel_api_src_dir}/controls/control-depth-index-ranges.h
${devel_api_src_dir}/controls/control-devel.h
${devel_api_src_dir}/controls/control-wrapper.h
SET( devel_api_utility_header_files
${devel_api_src_dir}/utility/npatch-utilities.h
+ ${devel_api_src_dir}/utility/npatch-helper.h
)
SET( SOURCES ${SOURCES}
{\r
// Recursively children\r
const auto childCount = actor.GetChildCount();\r
- for(auto i = 0u; i < childCount; ++i)\r
+ for(auto i = childCount; i > 0u; --i)\r
{\r
- Dali::Actor child = actor.GetChildAt(i);\r
+ Dali::Actor child = actor.GetChildAt(i-1);\r
if(child && child != focusedActor && IsFocusable(child))\r
{\r
Rect<float> candidateRect = DevelActor::CalculateScreenExtents(child);\r
\r
} // unnamed namespace\r
\r
-Actor GetNearestFocusableActor(Actor focusedActor, Toolkit::Control::KeyboardFocus::Direction direction)\r
+Actor GetNearestFocusableActor(Actor rootActor, Actor focusedActor, Toolkit::Control::KeyboardFocus::Direction direction)\r
{\r
Actor nearestActor;\r
- if(!focusedActor)\r
+ if(!focusedActor || !rootActor)\r
{\r
return nearestActor;\r
}\r
ConvertCoordinate(bestCandidateRect);\r
\r
ConvertCoordinate(focusedRect);\r
-\r
- Integration::SceneHolder window = Integration::SceneHolder::Get(focusedActor);\r
- if(window)\r
- {\r
- Actor rootActor = window.GetRootLayer();\r
- nearestActor = FindNextFocus(rootActor, focusedActor, focusedRect, bestCandidateRect, direction);\r
- }\r
+ nearestActor = FindNextFocus(rootActor, focusedActor, focusedRect, bestCandidateRect, direction);\r
return nearestActor;\r
}\r
\r
{\r
namespace FocusFinder\r
{\r
+\r
/**\r
* Get the nearest focusable actor.\r
+ * @param [in] rootActor The root actor.\r
* @param [in] focusedActor The current focused actor.\r
* @param [in] direction The direction.\r
* @return The nearest focusable actor, or an empty handle if none exists.\r
*/\r
-DALI_TOOLKIT_API Actor GetNearestFocusableActor(Actor focusedActor, Toolkit::Control::KeyboardFocus::Direction direction);\r
+DALI_TOOLKIT_API Actor GetNearestFocusableActor(Actor rootActor, Actor focusedActor, Toolkit::Control::KeyboardFocus::Direction direction);\r
\r
} // namespace FocusFinder\r
\r
--- /dev/null
+/*
+* Copyright (c) 2021 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/utility/npatch-helper.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace NPatchHelper
+{
+namespace
+{
+/**
+ * @brief Creates the geometry formed from the vertices and indices
+ *
+ * @param[in] vertices The vertices to generate the geometry from
+ * @param[in] indices The indices to generate the geometry from
+ * @return The geometry formed from the vertices and indices
+ */
+Geometry GenerateGeometry(const Vector<Vector2>& vertices, const Vector<unsigned short>& indices)
+{
+ Property::Map vertexFormat;
+ vertexFormat["aPosition"] = Property::VECTOR2;
+ VertexBuffer vertexBuffer = VertexBuffer::New(vertexFormat);
+ if(vertices.Size() > 0)
+ {
+ vertexBuffer.SetData(&vertices[0], vertices.Size());
+ }
+
+ // Create the geometry object
+ Geometry geometry = Geometry::New();
+ geometry.AddVertexBuffer(vertexBuffer);
+ if(indices.Size() > 0)
+ {
+ geometry.SetIndexBuffer(&indices[0], indices.Size());
+ }
+
+ return geometry;
+}
+
+/**
+ * @brief Adds the indices to form a quad composed off two triangles where the indices are organised in a grid
+ *
+ * @param[out] indices The indices to add to
+ * @param[in] rowIdx The row index to start the quad
+ * @param[in] nextRowIdx The index to the next row
+ */
+void AddQuadIndices(Vector<unsigned short>& indices, unsigned int rowIdx, unsigned int nextRowIdx)
+{
+ indices.PushBack(rowIdx);
+ indices.PushBack(nextRowIdx + 1);
+ indices.PushBack(rowIdx + 1);
+
+ indices.PushBack(rowIdx);
+ indices.PushBack(nextRowIdx);
+ indices.PushBack(nextRowIdx + 1);
+}
+
+/**
+ * @brief Adds the vertices to create for npatch
+ * @param[out] vertices The vertices to add to
+ * @param[in] x The x value of vector
+ * @param[in] y The y value of vector
+ */
+void AddVertex(Vector<Vector2>& vertices, unsigned int x, unsigned int y)
+{
+ vertices.PushBack(Vector2(x, y));
+}
+
+} // unnamed namespace
+
+Geometry CreateGridGeometry(Uint16Pair gridSize)
+{
+ uint16_t gridWidth = gridSize.GetWidth();
+ uint16_t gridHeight = gridSize.GetHeight();
+
+ // Create vertices
+ Vector<Vector2> vertices;
+ vertices.Reserve((gridWidth + 1) * (gridHeight + 1));
+
+ for(int y = 0; y < gridHeight + 1; ++y)
+ {
+ for(int x = 0; x < gridWidth + 1; ++x)
+ {
+ AddVertex(vertices, x, y);
+ }
+ }
+
+ // Create indices
+ Vector<unsigned short> indices;
+ indices.Reserve(gridWidth * gridHeight * 6);
+
+ unsigned int rowIdx = 0;
+ unsigned int nextRowIdx = gridWidth + 1;
+ for(int y = 0; y < gridHeight; ++y, ++nextRowIdx, ++rowIdx)
+ {
+ for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
+ {
+ AddQuadIndices(indices, rowIdx, nextRowIdx);
+ }
+ }
+
+ return GenerateGeometry(vertices, indices);
+}
+
+Geometry CreateBorderGeometry(Uint16Pair gridSize)
+{
+ uint16_t gridWidth = gridSize.GetWidth();
+ uint16_t gridHeight = gridSize.GetHeight();
+
+ // Create vertices
+ Vector<Vector2> vertices;
+ vertices.Reserve((gridWidth + 1) * (gridHeight + 1));
+
+ //top
+ int y = 0;
+ for(; y < 2; ++y)
+ {
+ for(int x = 0; x < gridWidth + 1; ++x)
+ {
+ AddVertex(vertices, x, y);
+ }
+ }
+
+ for(; y < gridHeight - 1; ++y)
+ {
+ //left
+ AddVertex(vertices, 0, y);
+ AddVertex(vertices, 1, y);
+
+ //right
+ AddVertex(vertices, gridWidth - 1, y);
+ AddVertex(vertices, gridWidth, y);
+ }
+
+ //bottom
+ for(; y < gridHeight + 1; ++y)
+ {
+ for(int x = 0; x < gridWidth + 1; ++x)
+ {
+ AddVertex(vertices, x, y);
+ }
+ }
+
+ // Create indices
+ Vector<unsigned short> indices;
+ indices.Reserve(gridWidth * gridHeight * 6);
+
+ //top
+ unsigned int rowIdx = 0;
+ unsigned int nextRowIdx = gridWidth + 1;
+ for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
+ {
+ AddQuadIndices(indices, rowIdx, nextRowIdx);
+ }
+
+ if(gridHeight > 2)
+ {
+ rowIdx = gridWidth + 1;
+ nextRowIdx = (gridWidth + 1) * 2;
+
+ unsigned increment = gridWidth - 1;
+ if(gridHeight > 3)
+ {
+ increment = 2;
+ //second row left
+ AddQuadIndices(indices, rowIdx, nextRowIdx);
+
+ rowIdx = gridWidth * 2;
+ nextRowIdx = (gridWidth + 1) * 2 + 2;
+ //second row right
+ AddQuadIndices(indices, rowIdx, nextRowIdx);
+
+ //left and right
+ rowIdx = nextRowIdx - 2;
+ nextRowIdx = rowIdx + 4;
+ for(int y = 2; y < 2 * (gridHeight - 3); ++y, rowIdx += 2, nextRowIdx += 2)
+ {
+ AddQuadIndices(indices, rowIdx, nextRowIdx);
+ }
+ }
+
+ //second row left
+ AddQuadIndices(indices, rowIdx, nextRowIdx);
+
+ rowIdx += increment;
+ nextRowIdx += gridWidth - 1;
+ //second row right
+ AddQuadIndices(indices, rowIdx, nextRowIdx);
+ }
+
+ //bottom
+ rowIdx = nextRowIdx - gridWidth + 1;
+ nextRowIdx = rowIdx + gridWidth + 1;
+ for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
+ {
+ AddQuadIndices(indices, rowIdx, nextRowIdx);
+ }
+
+ return GenerateGeometry(vertices, indices);
+}
+
+void RegisterStretchProperties(Renderer& renderer, const char* uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent)
+{
+ uint16_t prevEnd = 0;
+ uint16_t prevFix = 0;
+ uint16_t prevStretch = 0;
+ unsigned int i = 1;
+ for(NPatchUtility::StretchRanges::ConstIterator it = stretchPixels.Begin(); it != stretchPixels.End(); ++it, ++i)
+ {
+ uint16_t start = it->GetX();
+ uint16_t end = it->GetY();
+
+ uint16_t fix = prevFix + start - prevEnd;
+ uint16_t stretch = prevStretch + end - start;
+
+ std::stringstream uniform;
+ uniform << uniformName << "[" << i << "]";
+ renderer.RegisterProperty(uniform.str(), Vector2(fix, stretch));
+
+ prevEnd = end;
+ prevFix = fix;
+ prevStretch = stretch;
+ }
+
+ {
+ prevFix += imageExtent - prevEnd;
+ std::stringstream uniform;
+ uniform << uniformName << "[" << i << "]";
+ renderer.RegisterProperty(uniform.str(), Vector2(prevFix, prevStretch));
+ }
+}
+
+void ApplyTextureAndUniforms(Renderer& renderer, const Internal::NPatchData* data)
+{
+ TextureSet textureSet;
+ textureSet = data->GetTextures();
+
+ if(data->GetStretchPixelsX().Size() == 1 && data->GetStretchPixelsY().Size() == 1)
+ {
+ //special case for 9 patch
+ Uint16Pair stretchX = data->GetStretchPixelsX()[0];
+ Uint16Pair stretchY = data->GetStretchPixelsY()[0];
+
+ uint16_t stretchWidth = (stretchX.GetY() >= stretchX.GetX()) ? stretchX.GetY() - stretchX.GetX() : 0;
+ uint16_t stretchHeight = (stretchY.GetY() >= stretchY.GetX()) ? stretchY.GetY() - stretchY.GetX() : 0;
+
+ renderer.RegisterProperty("uFixed[0]", Vector2::ZERO);
+ renderer.RegisterProperty("uFixed[1]", Vector2(stretchX.GetX(), stretchY.GetX()));
+ renderer.RegisterProperty("uFixed[2]", Vector2(data->GetCroppedWidth() - stretchWidth, data->GetCroppedHeight() - stretchHeight));
+ renderer.RegisterProperty("uStretchTotal", Vector2(stretchWidth, stretchHeight));
+ }
+ else
+ {
+ renderer.RegisterProperty("uNinePatchFactorsX[0]", Vector2::ZERO);
+ renderer.RegisterProperty("uNinePatchFactorsY[0]", Vector2::ZERO);
+
+ RegisterStretchProperties(renderer, "uNinePatchFactorsX", data->GetStretchPixelsX(), data->GetCroppedWidth());
+ RegisterStretchProperties(renderer, "uNinePatchFactorsY", data->GetStretchPixelsY(), data->GetCroppedHeight());
+ }
+}
+
+} // namespace NPatchHelper
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_NPATCH_HELPER_H
+#define DALI_TOOLKIT_NPATCH_HELPER_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/math/uint-16-pair.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
+#include <dali-toolkit/internal/visuals/npatch-data.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace NPatchHelper
+{
+/**
+ * The list that includes stretch pixel ranges
+ */
+using StretchRanges = Dali::Vector<Uint16Pair>;
+
+/**
+ * @brief Creates a Npatch Geometry object
+ *
+ * @param[in] gridSize The gridSize for creating a geometry
+ * @return The Geometry for NPatch
+ */
+DALI_TOOLKIT_API Geometry CreateGridGeometry(Uint16Pair gridSize);
+
+/**
+ * @brief Creates a geometry with the border only for the grid size to be used by this visuals' shaders
+ * e.g. a 5x4 grid would create a geometry that would look like:
+ *
+ * ---------------------
+ * | /| /| /| /| /|
+ * |/ |/ |/ |/ |/ |
+ * ---------------------
+ * | /| | /|
+ * |/ | |/ |
+ * ----- -----
+ * | /| | /|
+ * |/ | |/ |
+ * ---------------------
+ * | /| /| /| /| /|
+ * |/ |/ |/ |/ |/ |
+ * ---------------------
+ *
+ * @param[in] gridSize The grid size of the solid geometry to create
+ * @return Returns the created geometry for the grid size
+ */
+DALI_TOOLKIT_API Geometry CreateBorderGeometry(Uint16Pair gridSize);
+
+
+/**
+ * @brief Registers a properties for Stretch Ranges
+ *
+ * @param[in,out] renderer The renderer for broken image
+ * @param[in] uniformName The name of the uniform
+ * @param[in] stretchPixels The stretchable pixels in the cropped image space
+ * @param[in] imageExtent The imageExtent
+ */
+void RegisterStretchProperties(Renderer& renderer, const char* uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent);
+
+/**
+ * @brief Apply a texture and uniforms
+ *
+ * @param[in,out] renderer The renderer for broken image
+ * @param[in] data The pointer of npatch-data
+ */
+void ApplyTextureAndUniforms(Renderer& renderer, const Internal::NPatchData* data);
+
+} // namespace NPatchUtility
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_NPATCH_HELPER_H
#include "accessibility-manager-impl.h"
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/control-devel.h>
{
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
});
}
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::ANIMATION));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::ANIMATION));
});
}
return mForegroundPadding;
}
-std::string Button::AccessibleImpl::GetNameRaw()
+std::string Button::AccessibleImpl::GetNameRaw() const
{
std::string labelText;
auto slf = Toolkit::Button::DownCast(Self());
Dali::Accessibility::States Button::AccessibleImpl::CalculateStates()
{
- auto tmp = DevelControl::AccessibleImpl::CalculateStates();
+ auto tmp = DevelControl::ControlAccessible::CalculateStates();
tmp[Dali::Accessibility::State::SELECTABLE] = true;
auto slf = Toolkit::Button::DownCast(Self());
tmp[Dali::Accessibility::State::ENABLED] = !slf.GetProperty<bool>(Toolkit::Button::Property::DISABLED);
bool mClickActionPerforming; ///< Used to manage signal emissions during action
protected:
- struct AccessibleImpl : public DevelControl::AccessibleImpl
+ struct AccessibleImpl : public DevelControl::ControlAccessible
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
+ using DevelControl::ControlAccessible::ControlAccessible;
Dali::Accessibility::States CalculateStates() override;
- std::string GetNameRaw() override;
+ std::string GetNameRaw() const override;
Property::Index GetNamePropertyIndex() override;
};
};
return states;
}
-std::string ToggleButton::AccessibleImpl::GetDescriptionRaw()
+std::string ToggleButton::AccessibleImpl::GetDescriptionRaw() const
{
auto button = Toolkit::ToggleButton::DownCast(Self());
auto index = button.GetProperty<int>(Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX);
using Button::AccessibleImpl::AccessibleImpl;
Dali::Accessibility::States CalculateStates() override;
- std::string GetDescriptionRaw() override;
+ std::string GetDescriptionRaw() const override;
Property::Index GetDescriptionPropertyIndex() override;
};
void OnStateChange(State newState) override;
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::IMAGE));
});
Adaptor::Get().RegisterProcessor(*this, true);
}
}
-Dali::Rect<> GetShowingGeometry(Dali::Rect<> rect, Dali::Toolkit::DevelControl::AccessibleImpl* accessibleImpl)
+Dali::Rect<> GetShowingGeometry(Dali::Rect<> rect, Dali::Toolkit::DevelControl::ControlAccessible* accessible)
{
Rect<> parentRect;
Vector2 currentPosition;
- auto parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(accessibleImpl->GetParent());
+ auto parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(accessible->GetParent());
while(parent)
{
return rect;
}
- parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(parent->GetParent());
+ parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(parent->GetParent());
}
return rect;
const PropertyRegistration Control::Impl::PROPERTY_19(typeRegistration, "accessibilityRole", Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
const PropertyRegistration Control::Impl::PROPERTY_20(typeRegistration, "accessibilityHighlightable", Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
const PropertyRegistration Control::Impl::PROPERTY_21(typeRegistration, "accessibilityAttributes", Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
-const PropertyRegistration Control::Impl::PROPERTY_22(typeRegistration, "dispatchKeyEvents", Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
+const PropertyRegistration Control::Impl::PROPERTY_22(typeRegistration, "dispatchKeyEvents", Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
+const PropertyRegistration Control::Impl::PROPERTY_23(typeRegistration, "accessibilityHidden", Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
// clang-format on
});
mAccessibilityConstructor = [](Dali::Actor actor) -> std::unique_ptr<Dali::Accessibility::Accessible> {
- return std::unique_ptr<Dali::Accessibility::Accessible>(new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::UNKNOWN));
+ return std::unique_ptr<Dali::Accessibility::Accessible>(new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::UNKNOWN));
};
}
void Control::Impl::CheckHighlightedObjectGeometry()
{
- auto accessibleImpl = dynamic_cast<Dali::Toolkit::DevelControl::AccessibleImpl*>(mAccessibilityObject.get());
- if(!accessibleImpl)
+ auto accessible = dynamic_cast<Dali::Toolkit::DevelControl::ControlAccessible*>(mAccessibilityObject.get());
+ if(!accessible)
{
- DALI_LOG_ERROR("accessibleImpl is not a pointer to a DevelControl::AccessibleImpl type");
+ DALI_LOG_ERROR("accessible is not a pointer to a DevelControl::ControlAccessible type");
return;
}
- auto lastPosition = accessibleImpl->GetLastPosition();
- auto accessibleRect = accessibleImpl->GetExtents(Dali::Accessibility::CoordinateType::WINDOW);
- auto rect = GetShowingGeometry(accessibleRect, accessibleImpl);
+ auto lastPosition = accessible->GetLastPosition();
+ auto accessibleRect = accessible->GetExtents(Dali::Accessibility::CoordinateType::WINDOW);
+ auto rect = GetShowingGeometry(accessibleRect, accessible);
switch(mAccessibilityLastScreenRelativeMoveType)
{
}
}
- accessibleImpl->SetLastPosition(Vector2(accessibleRect.x, accessibleRect.y));
+ accessible->SetLastPosition(Vector2(accessibleRect.x, accessibleRect.y));
}
void Control::Impl::RegisterAccessibilityPositionPropertyNotification()
}
break;
}
+
+ case Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN:
+ {
+ bool hidden;
+ if(value.Get(hidden))
+ {
+ controlImpl.mImpl->mAccessibilityHidden = hidden;
+ }
+ break;
+ }
}
}
}
value = controlImpl.mImpl->mAccessibilityAttributes;
break;
}
+
case Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS:
{
value = controlImpl.mImpl->mDispatchKeyEvents;
break;
}
+
+ case Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN:
+ {
+ value = controlImpl.mImpl->mAccessibilityHidden;
+ break;
+ }
}
}
*/
class Control::Impl : public ConnectionTracker, public Visual::EventObserver
{
- friend class Toolkit::DevelControl::AccessibleImpl;
+ friend class Toolkit::DevelControl::ControlAccessible;
public:
/**
bool mAccessibilityHighlightable = false;
bool mAccessibilityHighlightableSet = false;
+ bool mAccessibilityHidden = false;
+
Dali::Accessibility::Role mAccessibilityRole = Dali::Accessibility::Role::UNKNOWN;
std::map<Dali::Accessibility::RelationType, std::set<Accessibility::Accessible*>> mAccessibilityRelations;
static const PropertyRegistration PROPERTY_20;
static const PropertyRegistration PROPERTY_21;
static const PropertyRegistration PROPERTY_22;
+ static const PropertyRegistration PROPERTY_23;
private:
// Accessibility - notification for highlighted object to check if it is showing.
DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
});
}
DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
});
}
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
});
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::IMAGE));
});
}
map = value.GetMap();
if(map)
{
- Property::Value* shaderValue = map->Find(Toolkit::Visual::Property::SHADER, CUSTOM_SHADER);
- // set image only if property map contains image information other than custom shader
- if(map->Count() > 1u || !shaderValue)
+ // the property map is emtpy map. Unregister visual.
+ if(DALI_UNLIKELY(map->Count() == 0u))
{
- impl.SetImage(*map);
+ // Clear cached properties
+ impl.mPropertyMap.Clear();
+ impl.mUrl.clear();
+
+ // Unregister the exsiting visual
+ DevelControl::UnregisterVisual(impl, Toolkit::ImageView::Property::IMAGE);
+
+ // Trigger a size negotiation request that may be needed when unregistering a visual.
+ impl.RelayoutRequest();
}
- // the property map contains only the custom shader
- else if((map->Count() == 1u) && (shaderValue))
+ else
{
- Property::Map* shaderMap = shaderValue->GetMap();
- if(shaderMap)
+ Property::Value* shaderValue = map->Find(Toolkit::Visual::Property::SHADER, CUSTOM_SHADER);
+ // set image only if property map contains image information other than custom shader
+ if(map->Count() > 1u || !shaderValue)
{
- impl.mShaderMap = *shaderMap;
-
- if(!impl.mUrl.empty())
- {
- impl.SetImage(impl.mUrl, impl.mImageSize);
- }
- else if(!impl.mPropertyMap.Empty())
+ impl.SetImage(*map);
+ }
+ // the property map contains only the custom shader
+ else if((map->Count() == 1u) && (shaderValue))
+ {
+ Property::Map* shaderMap = shaderValue->GetMap();
+ if(shaderMap)
{
- impl.SetImage(impl.mPropertyMap);
+ impl.mShaderMap = *shaderMap;
+
+ if(!impl.mUrl.empty())
+ {
+ impl.SetImage(impl.mUrl, impl.mImageSize);
+ }
+ else if(!impl.mPropertyMap.Empty())
+ {
+ impl.SetImage(impl.mPropertyMap);
+ }
}
}
}
DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
});
}
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::IMAGE));
});
}
{
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
});
}
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::PAGE_TAB_LIST));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::PAGE_TAB_LIST));
});
}
}
}
-std::string Popup::AccessibleImpl::GetNameRaw()
+std::string Popup::AccessibleImpl::GetNameRaw() const
{
auto popup = Toolkit::Popup::DownCast(Self());
std::string title;
Dali::Accessibility::States Popup::AccessibleImpl::CalculateStates()
{
- auto states = DevelControl::AccessibleImpl::CalculateStates();
+ auto states = DevelControl::ControlAccessible::CalculateStates();
auto popup = Toolkit::Popup::DownCast(Self());
auto displayState = popup.GetProperty<std::string>(Toolkit::Popup::Property::DISPLAY_STATE);
static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex);
protected:
- struct AccessibleImpl : public DevelControl::AccessibleImpl
+ struct AccessibleImpl : public DevelControl::ControlAccessible
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
+ using DevelControl::ControlAccessible::ControlAccessible;
- std::string GetNameRaw() override;
+ std::string GetNameRaw() const override;
Dali::Accessibility::States CalculateStates() override;
};
}
}
-double ProgressBar::AccessibleImpl::GetMinimum()
+double ProgressBar::AccessibleImpl::GetMinimum() const
{
return DEFAULT_LOWER_BOUND;
}
-double ProgressBar::AccessibleImpl::GetCurrent()
+double ProgressBar::AccessibleImpl::GetCurrent() const
{
auto self = Toolkit::ProgressBar::DownCast(Self());
return self.GetProperty(Toolkit::ProgressBar::Property::PROGRESS_VALUE).Get<float>();
}
-double ProgressBar::AccessibleImpl::GetMaximum()
+double ProgressBar::AccessibleImpl::GetMaximum() const
{
return DEFAULT_UPPER_BOUND;
}
return true;
}
-double ProgressBar::AccessibleImpl::GetMinimumIncrement()
+double ProgressBar::AccessibleImpl::GetMinimumIncrement() const
{
return 0.0;
}
*
*/
+// EXTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/value.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h>
Property::Map mSecondaryProgressVisualMap; ///< To backup visual properties when switching determinate/indeterminate.
protected:
- struct AccessibleImpl : public DevelControl::AccessibleImpl,
+ struct AccessibleImpl : public DevelControl::ControlAccessible,
public virtual Dali::Accessibility::Value
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
- double GetMinimum() override;
- double GetCurrent() override;
- double GetMaximum() override;
+ using DevelControl::ControlAccessible::ControlAccessible;
+
+ double GetMinimum() const override;
+ double GetCurrent() const override;
+ double GetMaximum() const override;
bool SetCurrent(double) override;
- double GetMinimumIncrement() override;
+ double GetMinimumIncrement() const override;
};
};
return handle;
}
-double ScrollBar::AccessibleImpl::GetMinimum()
+double ScrollBar::AccessibleImpl::GetMinimum() const
{
auto self = Toolkit::ScrollBar::DownCast(Self());
Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(self).mPropertyMinScrollPosition) : 0.0f;
}
-double ScrollBar::AccessibleImpl::GetCurrent()
+double ScrollBar::AccessibleImpl::GetCurrent() const
{
auto self = Toolkit::ScrollBar::DownCast(Self());
Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(self).mPropertyScrollPosition) : 0.0f;
}
-double ScrollBar::AccessibleImpl::GetMaximum()
+double ScrollBar::AccessibleImpl::GetMaximum() const
{
auto self = Toolkit::ScrollBar::DownCast(Self());
Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
return true;
}
-double ScrollBar::AccessibleImpl::GetMinimumIncrement()
+double ScrollBar::AccessibleImpl::GetMinimumIncrement() const
{
return 1.0;
}
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/value.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/constraint.h>
bool mIndicatorFirstShow : 1; ///< True if the indicator has never been shown
protected:
- struct AccessibleImpl : public DevelControl::AccessibleImpl,
+ struct AccessibleImpl : public DevelControl::ControlAccessible,
public virtual Dali::Accessibility::Value
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
- double GetMinimum() override;
- double GetCurrent() override;
- double GetMaximum() override;
+ using DevelControl::ControlAccessible::ControlAccessible;
+
+ double GetMinimum() const override;
+ double GetCurrent() const override;
+ double GetMaximum() const override;
bool SetCurrent(double) override;
- double GetMinimumIncrement() override;
+ double GetMinimumIncrement() const override;
};
};
{
}
-bool Scrollable::AccessibleImpl::IsScrollable()
+bool Scrollable::AccessibleImpl::IsScrollable() const
{
return true;
}
virtual void SetOvershootSize(const Vector2& size) = 0;
protected: // From Control
- struct AccessibleImpl : public DevelControl::AccessibleImpl
+ struct AccessibleImpl : public DevelControl::ControlAccessible
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
+ using DevelControl::ControlAccessible::ControlAccessible;
- bool IsScrollable() override;
+ bool IsScrollable() const override;
};
/**
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
});
}
return value;
}
-double Slider::AccessibleImpl::GetMinimum()
+double Slider::AccessibleImpl::GetMinimum() const
{
auto self = Toolkit::Slider::DownCast(Self());
return self.GetProperty(Toolkit::Slider::Property::LOWER_BOUND).Get<float>();
}
-double Slider::AccessibleImpl::GetCurrent()
+double Slider::AccessibleImpl::GetCurrent() const
{
auto self = Toolkit::Slider::DownCast(Self());
return self.GetProperty(Toolkit::Slider::Property::VALUE).Get<float>();
}
-double Slider::AccessibleImpl::GetMaximum()
+double Slider::AccessibleImpl::GetMaximum() const
{
auto self = Toolkit::Slider::DownCast(Self());
return self.GetProperty(Toolkit::Slider::Property::UPPER_BOUND).Get<float>();
return true;
}
-double Slider::AccessibleImpl::GetMinimumIncrement()
+double Slider::AccessibleImpl::GetMinimumIncrement() const
{
auto self = Toolkit::Slider::DownCast(Self());
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/value.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/object/property-array.h>
#include <dali/public-api/object/property-map.h>
mSnapToMarks : 1; ///< Turn on or off snapping to marks
protected:
- struct AccessibleImpl : public DevelControl::AccessibleImpl,
+ struct AccessibleImpl : public DevelControl::ControlAccessible,
public virtual Dali::Accessibility::Value
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
- double GetMinimum() override;
- double GetCurrent() override;
- double GetMaximum() override;
+ using DevelControl::ControlAccessible::ControlAccessible;
+
+ double GetMinimum() const override;
+ double GetCurrent() const override;
+ double GetMaximum() const override;
bool SetCurrent(double) override;
- double GetMinimumIncrement() override;
+ double GetMinimumIncrement() const override;
};
};
DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
});
}
DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TABLE));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::TABLE));
});
}
*/
// EXTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali/devel-api/atspi-interfaces/hyperlink.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/text-controls/text-anchor-devel.h>
#include <dali-toolkit/internal/controls/control/control-data-impl.h>
#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
+#include <dali-toolkit/public-api/controls/control-impl.h>
namespace Dali
{
/**
* @brief This structure is to connect TextAnchor with Accessible functions.
*/
- struct AccessibleImpl : public DevelControl::AccessibleImpl,
+ struct AccessibleImpl : public DevelControl::ControlAccessible,
public virtual Dali::Accessibility::Hyperlink
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
+ using DevelControl::ControlAccessible::ControlAccessible;
/**
* @copydoc Dali::Accessibility::Hyperlink::GetEndIndex()
*/
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "enableEditing", BOOLEAN, ENABLE_EDITING )
DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY(Toolkit, TextEditor, "selectedText", STRING, SELECTED_TEXT )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "enableFontSizeScale", BOOLEAN, ENABLE_FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP )
}
}
-std::string TextEditor::AccessibleImpl::GetName()
+std::string TextEditor::AccessibleImpl::GetName() const
{
auto self = Toolkit::TextEditor::DownCast(Self());
return self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
}
-std::string TextEditor::AccessibleImpl::GetText(size_t startOffset, size_t endOffset)
+std::string TextEditor::AccessibleImpl::GetText(size_t startOffset, size_t endOffset) const
{
if(endOffset <= startOffset)
{
return text.substr(startOffset, endOffset - startOffset);
}
-size_t TextEditor::AccessibleImpl::GetCharacterCount()
+size_t TextEditor::AccessibleImpl::GetCharacterCount() const
{
auto self = Toolkit::TextEditor::DownCast(Self());
auto text = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
return text.size();
}
-size_t TextEditor::AccessibleImpl::GetCursorOffset()
+size_t TextEditor::AccessibleImpl::GetCursorOffset() const
{
auto slf = Toolkit::TextEditor::DownCast(Self());
return Dali::Toolkit::GetImpl(slf).GetTextController()->GetCursorPosition();
return true;
}
-Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary)
+Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary) const
{
auto self = Toolkit::TextEditor::DownCast(Self());
auto text = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
return range;
}
-Dali::Accessibility::Range TextEditor::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex)
+Dali::Accessibility::Range TextEditor::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex) const
{
// Since DALi supports only one selection indexes higher than 0 are ignored
if(selectionIndex > 0)
{
using namespace Dali::Accessibility;
- auto states = DevelControl::AccessibleImpl::CalculateStates();
+ auto states = DevelControl::ControlAccessible::CalculateStates();
states[State::EDITABLE] = true;
states[State::FOCUSABLE] = true;
Toolkit::Control focusControl = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
- if(mSelf == focusControl)
+ if(Self() == focusControl)
{
states[State::FOCUSED] = true;
}
#include <dali/devel-api/adaptor-framework/accessibility.h>
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/adaptor-framework/input-method-context.h>
+#include <dali/devel-api/atspi-interfaces/editable-text.h>
+#include <dali/devel-api/atspi-interfaces/hypertext.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
#include <dali/public-api/animation/animation.h>
// INTERNAL INCLUDES
/**
* @brief This structure is to connect TextEditor with Accessible functions.
*/
- struct AccessibleImpl : public DevelControl::AccessibleImpl,
- public virtual Dali::Accessibility::Text,
+ struct AccessibleImpl : public DevelControl::ControlAccessible,
public virtual Dali::Accessibility::EditableText,
public virtual Dali::Accessibility::Hypertext
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
+ using DevelControl::ControlAccessible::ControlAccessible;
/**
* @copydoc Dali::Accessibility::Accessible::GetName()
*/
- std::string GetName() override;
+ std::string GetName() const override;
/**
* @copydoc Dali::Accessibility::Text::GetText()
*/
- std::string GetText(size_t startOffset, size_t endOffset) override;
+ std::string GetText(size_t startOffset, size_t endOffset) const override;
/**
* @copydoc Dali::Accessibility::Text::GetCharacterCount()
*/
- size_t GetCharacterCount() override;
+ size_t GetCharacterCount() const override;
/**
* @copydoc Dali::Accessibility::Text::GetCursorOffset()
*/
- size_t GetCursorOffset() override;
+ size_t GetCursorOffset() const override;
/**
* @copydoc Dali::Accessibility::Text::SetCursorOffset()
/**
* @copydoc Dali::Accessibility::Text::GetTextAtOffset()
*/
- Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) override;
+ Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) const override;
/**
* @copydoc Dali::Accessibility::Text::GetRangeOfSelection()
*/
- Accessibility::Range GetRangeOfSelection(size_t selectionIndex) override;
+ Accessibility::Range GetRangeOfSelection(size_t selectionIndex) const override;
/**
* @copydoc Dali::Accessibility::Text::RemoveSelection()
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
break;
}
+ case Toolkit::DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE:
+ {
+ const bool enableFontSizeScale = value.Get<bool>();
+ if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale))
+ {
+ impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale);
+ }
+ break;
+ }
case Toolkit::DevelTextEditor::Property::PRIMARY_CURSOR_POSITION:
{
uint32_t position = static_cast<uint32_t>(value.Get<int>());
value = impl.mController->GetFontSizeScale();
break;
}
+ case Toolkit::DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE:
+ {
+ value = impl.mController->IsFontSizeScaleEnabled();
+ break;
+ }
case Toolkit::DevelTextEditor::Property::PRIMARY_CURSOR_POSITION:
{
value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "selectedTextEnd", INTEGER, SELECTED_TEXT_END )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableEditing", BOOLEAN, ENABLE_EDITING )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableFontSizeScale", BOOLEAN, ENABLE_FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "inputFilter", MAP, INPUT_FILTER )
return mController->GetTextPosition(startIndex, endIndex);
}
-std::string TextField::AccessibleImpl::GetName()
+std::string TextField::AccessibleImpl::GetName() const
{
auto self = Toolkit::TextField::DownCast(Self());
if(IsHiddenInput(self))
return self.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
}
-std::string TextField::AccessibleImpl::GetText(size_t startOffset, size_t endOffset)
+std::string TextField::AccessibleImpl::GetText(size_t startOffset, size_t endOffset) const
{
if(endOffset <= startOffset)
{
return text.substr(startOffset, endOffset - startOffset);
}
-size_t TextField::AccessibleImpl::GetCharacterCount()
+size_t TextField::AccessibleImpl::GetCharacterCount() const
{
auto self = Toolkit::TextField::DownCast(Self());
auto text = self.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
return text.size();
}
-size_t TextField::AccessibleImpl::GetCursorOffset()
+size_t TextField::AccessibleImpl::GetCursorOffset() const
{
auto self = Toolkit::TextField::DownCast(Self());
return Dali::Toolkit::GetImpl(self).GetTextController()->GetCursorPosition();
}
Dali::Accessibility::Range TextField::AccessibleImpl::GetTextAtOffset(
- size_t offset, Dali::Accessibility::TextBoundary boundary)
+ size_t offset, Dali::Accessibility::TextBoundary boundary) const
{
auto self = Toolkit::TextField::DownCast(Self());
auto range = Dali::Accessibility::Range{};
return range;
}
-Dali::Accessibility::Range TextField::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex)
+Dali::Accessibility::Range TextField::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex) const
{
// Since DALi supports only one selection indexes higher than 0 are ignored
if(selectionIndex > 0)
{
using namespace Dali::Accessibility;
- auto states = DevelControl::AccessibleImpl::CalculateStates();
+ auto states = DevelControl::ControlAccessible::CalculateStates();
states[State::EDITABLE] = true;
states[State::FOCUSABLE] = true;
Toolkit::Control focusControl = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
- if(mSelf == focusControl)
+ if(Self() == focusControl)
{
states[State::FOCUSED] = true;
}
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/adaptor-framework/input-method-context.h>
+#include <dali/devel-api/atspi-interfaces/editable-text.h>
+#include <dali/devel-api/atspi-interfaces/hypertext.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/control-devel.h>
/**
* @brief This structure is to connect TextField with Accessible functions.
*/
- struct AccessibleImpl : public DevelControl::AccessibleImpl,
- public virtual Dali::Accessibility::Text,
+ struct AccessibleImpl : public DevelControl::ControlAccessible,
public virtual Dali::Accessibility::EditableText,
public virtual Dali::Accessibility::Hypertext
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
+ using DevelControl::ControlAccessible::ControlAccessible;
/**
* @copydoc Dali::Accessibility::Accessible::GetName()
*/
- std::string GetName() override;
+ std::string GetName() const override;
/**
* @copydoc Dali::Accessibility::Text::GetText()
*/
- std::string GetText(size_t startOffset, size_t endOffset) override;
+ std::string GetText(size_t startOffset, size_t endOffset) const override;
/**
* @copydoc Dali::Accessibility::Text::GetCharacterCount()
*/
- size_t GetCharacterCount() override;
+ size_t GetCharacterCount() const override;
/**
* @copydoc Dali::Accessibility::Text::GetCursorOffset()
*/
- size_t GetCursorOffset() override;
+ size_t GetCursorOffset() const override;
/**
* @copydoc Dali::Accessibility::Text::SetCursorOffset()
/**
* @copydoc Dali::Accessibility::Text::GetTextAtOffset()
*/
- Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) override;
+ Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) const override;
/**
* @copydoc Dali::Accessibility::Text::GetRangeOfSelection()
*/
- Accessibility::Range GetRangeOfSelection(size_t selectionIndex) override;
+ Accessibility::Range GetRangeOfSelection(size_t selectionIndex) const override;
/**
* @copydoc Dali::Accessibility::Text::RemoveSelection()
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
break;
}
+ case Toolkit::DevelTextField::Property::ENABLE_FONT_SIZE_SCALE:
+ {
+ const bool enableFontSizeScale = value.Get<bool>();
+ if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale))
+ {
+ impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale);
+ }
+ break;
+ }
case Toolkit::DevelTextField::Property::PRIMARY_CURSOR_POSITION:
{
uint32_t position = static_cast<uint32_t>(value.Get<int>());
value = impl.mController->GetFontSizeScale();
break;
}
+ case Toolkit::DevelTextField::Property::ENABLE_FONT_SIZE_SCALE:
+ {
+ value = impl.mController->IsFontSizeScaleEnabled();
+ break;
+ }
case Toolkit::DevelTextField::Property::PRIMARY_CURSOR_POSITION:
{
value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "minLineSize", FLOAT, MIN_LINE_SIZE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "renderingBackend", INTEGER, RENDERING_BACKEND )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "enableFontSizeScale", BOOLEAN, ENABLE_FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "ellipsisPosition", INTEGER, ELLIPSIS_POSITION )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "strikethrough", MAP, STRIKETHROUGH )
}
break;
}
+ case Toolkit::DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE:
+ {
+ const bool enableFontSizeScale = value.Get<bool>();
+ if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale))
+ {
+ impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale);
+ }
+ break;
+ }
case Toolkit::DevelTextLabel::Property::ELLIPSIS_POSITION:
{
DevelText::EllipsisPosition::Type ellipsisPositionType(static_cast<DevelText::EllipsisPosition::Type>(-1)); // Set to invalid value to ensure a valid mode does get set
value = impl.mController->GetFontSizeScale();
break;
}
+ case Toolkit::DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE:
+ {
+ value = impl.mController->IsFontSizeScaleEnabled();
+ break;
+ }
case Toolkit::DevelTextLabel::Property::ELLIPSIS_POSITION:
{
value = impl.mController->GetEllipsisPosition();
return mController->GetTextPosition(startIndex, endIndex);
}
-std::string TextLabel::AccessibleImpl::GetNameRaw()
+std::string TextLabel::AccessibleImpl::GetNameRaw() const
{
auto self = Toolkit::TextLabel::DownCast(Self());
return self.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
return Toolkit::TextLabel::Property::TEXT;
}
-std::string TextLabel::AccessibleImpl::GetText(size_t startOffset, size_t endOffset)
+std::string TextLabel::AccessibleImpl::GetText(size_t startOffset, size_t endOffset) const
{
if(endOffset <= startOffset)
{
return text.substr(startOffset, endOffset - startOffset);
}
-size_t TextLabel::AccessibleImpl::GetCharacterCount()
+size_t TextLabel::AccessibleImpl::GetCharacterCount() const
{
auto self = Toolkit::TextLabel::DownCast(Self());
auto text = self.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
return text.size();
}
-size_t TextLabel::AccessibleImpl::GetCursorOffset()
+size_t TextLabel::AccessibleImpl::GetCursorOffset() const
{
return {};
}
return {};
}
-Dali::Accessibility::Range TextLabel::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary)
+Dali::Accessibility::Range TextLabel::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary) const
{
auto self = Toolkit::TextLabel::DownCast(Self());
auto text = self.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
return range;
}
-Dali::Accessibility::Range TextLabel::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex)
+Dali::Accessibility::Range TextLabel::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex) const
{
// Since DALi supports only one selection indexes higher than 0 are ignored
if(selectionIndex > 0)
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/hypertext.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
#include <dali/public-api/object/property-map.h>
// INTERNAL INCLUDES
/**
* @brief This structure is to connect TextLabel with Accessible functions.
*/
- struct AccessibleImpl : public DevelControl::AccessibleImpl,
+ struct AccessibleImpl : public DevelControl::ControlAccessible,
public virtual Dali::Accessibility::Text,
public virtual Dali::Accessibility::Hypertext
{
- using DevelControl::AccessibleImpl::AccessibleImpl;
+ using DevelControl::ControlAccessible::ControlAccessible;
/**
* @copydoc Dali::Accessibility::Text::GetText()
*/
- std::string GetText(size_t startOffset, size_t endOffset) override;
+ std::string GetText(size_t startOffset, size_t endOffset) const override;
/**
* @copydoc Dali::Accessibility::Text::GetCharacterCount()
*/
- size_t GetCharacterCount() override;
+ size_t GetCharacterCount() const override;
/**
* @copydoc Dali::Accessibility::Text::GetCursorOffset()
*/
- size_t GetCursorOffset() override;
+ size_t GetCursorOffset() const override;
/**
* @copydoc Dali::Accessibility::Text::SetCursorOffset()
/**
* @copydoc Dali::Accessibility::Text::GetTextAtOffset()
*/
- Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) override;
+ Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) const override;
/**
* @copydoc Dali::Accessibility::Text::GetRangeOfSelection()
*/
- Accessibility::Range GetRangeOfSelection(size_t selectionIndex) override;
+ Accessibility::Range GetRangeOfSelection(size_t selectionIndex) const override;
/**
* @copydoc Dali::Accessibility::Text::RemoveSelection()
/**
* @copydoc Dali::Accessibility::Text::GetNameRaw()
*/
- std::string GetNameRaw() override;
+ std::string GetNameRaw() const override;
/**
* @copydoc Dali::Accessibility::Text::GetNamePropertyIndex()
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::DIALOG, true));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::DIALOG, true));
});
//Enable highightability
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TOOL_BAR));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::TOOL_BAR));
});
}
DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TOOL_BAR));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::TOOL_BAR));
});
}
DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
return std::unique_ptr<Dali::Accessibility::Accessible>(
- new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::VIDEO));
+ new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::VIDEO));
});
//Enable highightability
Actor self = Self();
self.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ self.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, true);
self.TouchedSignal().Connect(this, &WebView::OnTouchEvent);
self.HoveredSignal().Connect(this, &WebView::OnHoverEvent);
self.WheelEventSignal().Connect(this, &WebView::OnWheelEvent);
else if(mEnableDefaultAlgorithm)
{
// We should find it among the actors nearby.
- nextFocusableActor = Toolkit::FocusFinder::GetNearestFocusableActor(currentFocusActor, direction);
+ Integration::SceneHolder window = Integration::SceneHolder::Get(currentFocusActor);
+ if(window)
+ {
+ nextFocusableActor = Toolkit::FocusFinder::GetNearestFocusableActor(window.GetRootLayer(), currentFocusActor, direction);
+ }
}
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
void GetCursorPosition(GetCursorPositionParameters& parameters,
+ float defaultFontLineHeight,
CursorInfo& cursorInfo)
{
const LineRun* const modelLines = parameters.visualModel->mLines.Begin();
const LineIndex lineIndex = parameters.visualModel->GetLineOfCharacter(characterOfLine);
const LineRun& line = *(modelLines + lineIndex);
+ const GlyphIndex* const charactersToGlyphBuffer = parameters.visualModel->mCharactersToGlyph.Begin();
+ const Length* const glyphsPerCharacterBuffer = parameters.visualModel->mGlyphsPerCharacter.Begin();
+ const GlyphInfo* const glyphInfoBuffer = parameters.visualModel->mGlyphs.Begin();
+ CharacterIndex index;
+ GlyphMetrics glyphMetrics;
+ MetricsPtr& metrics = parameters.metrics;
+ GlyphIndex glyphIndex = 0u;
+ Length numberOfGlyphs = 0u;
+
if(isLastNewParagraph)
{
// The cursor is in a new line with no characters. Place the cursor in that line.
cursorInfo.lineHeight = GetLineHeight(newLine);
+ index = 0u;
+ const Length totalNumberOfCharacters = parameters.logicalModel->mText.Count();
+ if(totalNumberOfCharacters > 0u)
+ {
+ index = totalNumberOfCharacters - 1u;
+ }
+
+ GetGlyphMetricsFromCharacterIndex(index, glyphInfoBuffer, charactersToGlyphBuffer, glyphsPerCharacterBuffer, metrics, glyphMetrics, glyphIndex, numberOfGlyphs);
+
// Set the primary cursor's height.
- cursorInfo.primaryCursorHeight = cursorInfo.lineHeight;
+ // The primary cursor height will take the font height of the last character and if there are no characters, it'll take the default font line height.
+ cursorInfo.primaryCursorHeight = (totalNumberOfCharacters > 0) ? (cursorInfo.isSecondaryCursor ? 0.5f * glyphMetrics.fontHeight : glyphMetrics.fontHeight) : defaultFontLineHeight;
// Set the primary cursor's position.
cursorInfo.primaryPosition.x = (LTR == line.direction) ? newLine.alignmentOffset : parameters.visualModel->mControlSize.width - newLine.alignmentOffset;
// Calculate the primary cursor.
- CharacterIndex index = characterIndex;
+ index = characterIndex;
if(cursorInfo.isSecondaryCursor)
{
// If there is a secondary position, the primary cursor may be in a different place than the logical index.
}
}
- const GlyphIndex* const charactersToGlyphBuffer = parameters.visualModel->mCharactersToGlyph.Begin();
- const Length* const glyphsPerCharacterBuffer = parameters.visualModel->mGlyphsPerCharacter.Begin();
const Length* const charactersPerGlyphBuffer = parameters.visualModel->mCharactersPerGlyph.Begin();
const CharacterIndex* const glyphsToCharactersBuffer = parameters.visualModel->mGlyphsToCharacters.Begin();
const Vector2* const glyphPositionsBuffer = parameters.visualModel->mGlyphPositions.Begin();
- const GlyphInfo* const glyphInfoBuffer = parameters.visualModel->mGlyphs.Begin();
- // Convert the cursor position into the glyph position.
- const GlyphIndex primaryGlyphIndex = *(charactersToGlyphBuffer + index);
- const Length primaryNumberOfGlyphs = *(glyphsPerCharacterBuffer + index);
+ GetGlyphMetricsFromCharacterIndex(index, glyphInfoBuffer, charactersToGlyphBuffer, glyphsPerCharacterBuffer, metrics, glyphMetrics, glyphIndex, numberOfGlyphs);
+ const GlyphIndex primaryGlyphIndex = glyphIndex;
const Length primaryNumberOfCharacters = *(charactersPerGlyphBuffer + primaryGlyphIndex);
- // Get the metrics for the group of glyphs.
- GlyphMetrics glyphMetrics;
- GetGlyphsMetrics(primaryGlyphIndex,
- primaryNumberOfGlyphs,
- glyphMetrics,
- glyphInfoBuffer,
- parameters.metrics);
-
// Whether to add the glyph's advance to the cursor position.
// i.e if the paragraph is left to right and the logical cursor is zero, the position is the position of the first glyph and the advance is not added,
// if the logical cursor is one, the position is the position of the first glyph and the advance is added.
index = (isRightToLeftParagraph == isCurrentRightToLeft) ? nextCharacterIndex : characterIndex;
}
- const GlyphIndex secondaryGlyphIndex = *(charactersToGlyphBuffer + index);
- const Length secondaryNumberOfGlyphs = *(glyphsPerCharacterBuffer + index);
-
- const Vector2& secondaryPosition = *(glyphPositionsBuffer + secondaryGlyphIndex);
-
- GetGlyphsMetrics(secondaryGlyphIndex,
- secondaryNumberOfGlyphs,
- glyphMetrics,
- glyphInfoBuffer,
- parameters.metrics);
+ GetGlyphMetricsFromCharacterIndex(index, glyphInfoBuffer, charactersToGlyphBuffer, glyphsPerCharacterBuffer, metrics, glyphMetrics, glyphIndex, numberOfGlyphs);
+ const GlyphIndex secondaryGlyphIndex = glyphIndex;
+ const Vector2& secondaryPosition = *(glyphPositionsBuffer + secondaryGlyphIndex);
// Set the secondary cursor's position.
#include <dali-toolkit/internal/text/logical-model-impl.h>
#include <dali-toolkit/internal/text/metrics.h>
#include <dali-toolkit/internal/text/visual-model-impl.h>
+#include <dali-toolkit/internal/text/glyph-metrics-helper.h>
namespace Dali
{
* if there is a valid alternative cursor, its position and height.
*
* @param[in] parameters Parameters used to calculate the cursor's position.
+ * @param[in] defaultFontLineHeight The default font line height.
* @param[out] cursorInfo The line's height, the cursor's height, the cursor's position and whether there is an alternative cursor.
*/
void GetCursorPosition(GetCursorPositionParameters& parameters,
+ float defaultFontLineHeight,
CursorInfo& cursorInfo);
/**
glyphMetrics.width += (firstGlyph.isItalicRequired && !isItalicFont) ? TextAbstraction::FontClient::DEFAULT_ITALIC_ANGLE * firstGlyph.height : 0.f;
}
+void GetGlyphMetricsFromCharacterIndex(CharacterIndex index, const GlyphInfo* const glyphInfoBuffer, const GlyphIndex* const charactersToGlyphBuffer, const Length* const glyphsPerCharacterBuffer, MetricsPtr& metrics, GlyphMetrics& glyphMetrics, GlyphIndex& glyphIndex, Length& numberOfGlyphs)
+{
+ //Takes the character index, obtains the glyph index (and the number of Glyphs) from it and finally gets the glyph metrics.
+ glyphIndex = *(charactersToGlyphBuffer + index);
+ numberOfGlyphs = *(glyphsPerCharacterBuffer + index);
+
+ // Get the metrics for the group of glyphs.
+ GetGlyphsMetrics(glyphIndex,
+ numberOfGlyphs,
+ glyphMetrics,
+ glyphInfoBuffer,
+ metrics);
+}
+
} // namespace Text
} // namespace Toolkit
const GlyphInfo* const glyphsBuffer,
MetricsPtr& metrics);
+/**
+ * @brief Takes the character index, obtains the glyph index (and the number of Glyphs) from it and finally gets the glyph metrics.
+ *
+ * @param[in] index The character index.
+ * @param[in] glyphInfoBuffer The glyphs buffer.
+ * @param[in] charactersToGlyphBuffer A vector containing the glyph index for each character.
+ * @param[in] glyphsPerCharacterBuffer A vector containing the number of glyphs in each character.
+ * @param[in] metrics Used to access metrics from FontClient.
+ * @param[out] glyphMetrics Some glyph metrics (font height, advance, ascender and x bearing).
+ * @param[out] glyphIndex The glyph index obtained from the character index.
+ * @param[out] numberOfGlyphs The number of glyphs in the character of which the index was passed to the function.
+ *
+ */
+void GetGlyphMetricsFromCharacterIndex(CharacterIndex index,
+ const GlyphInfo* const glyphInfoBuffer,
+ const GlyphIndex* const charactersToGlyphBuffer,
+ const Length* const glyphsPerCharacterBuffer,
+ MetricsPtr& metrics,
+ GlyphMetrics& glyphMetrics,
+ GlyphIndex& glyphIndex,
+ Length& numberOfGlyphs);
+
} // namespace Text
} // namespace Toolkit
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali::Toolkit::Text
{
-
namespace
{
#if defined(DEBUG_ENABLED)
// Check whether the indices for updating the text is valid
if(numberOfCharacters > 0u &&
(impl.mTextUpdateInfo.mParagraphCharacterIndex > numberOfCharacters ||
- impl.mTextUpdateInfo.mRequestedNumberOfCharacters > numberOfCharacters))
+ impl.mTextUpdateInfo.mRequestedNumberOfCharacters > numberOfCharacters))
{
std::string currentText;
Utf32ToUtf8(impl.mModel->mLogicalModel->mText.Begin(), numberOfCharacters, currentText);
lineBreakInfo);
if(impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::HYPHENATION) ||
- impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::MIXED))
+ impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::MIXED))
{
CharacterIndex end = startIndex + requestedNumberOfCharacters;
LineBreakInfo* lineBreakInfoBuffer = lineBreakInfo.Begin();
// Get the default font's description.
TextAbstraction::FontDescription defaultFontDescription;
- TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE * impl.mFontSizeScale;
+ TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE * impl.GetFontSizeScale();
//Get the number of points per one unit of point-size
uint32_t numberOfPointsPerOneUnitOfPointSize = impl.mFontClient.GetNumberOfPointsPerOneUnitOfPointSize();
defaultFontDescription = impl.mEventData->mPlaceholderFont->mFontDescription;
if(impl.mEventData->mPlaceholderFont->sizeDefined)
{
- defaultPointSize = impl.mEventData->mPlaceholderFont->mDefaultPointSize * impl.mFontSizeScale * numberOfPointsPerOneUnitOfPointSize;
+ defaultPointSize = impl.mEventData->mPlaceholderFont->mDefaultPointSize * impl.GetFontSizeScale() * numberOfPointsPerOneUnitOfPointSize;
}
}
else if(nullptr != impl.mFontDefaults)
}
else
{
- defaultPointSize = impl.mFontDefaults->mDefaultPointSize * impl.mFontSizeScale * numberOfPointsPerOneUnitOfPointSize;
+ defaultPointSize = impl.mFontDefaults->mDefaultPointSize * impl.GetFontSizeScale() * numberOfPointsPerOneUnitOfPointSize;
}
}
}
if((nullptr != impl.mEventData) &&
- impl.mEventData->mPreEditFlag &&
+ impl.mEventData->mPreEditFlag &&
(0u != impl.mModel->mVisualModel->mCharactersToGlyph.Count()))
{
Dali::InputMethodContext::PreEditAttributeDataContainer attrs;
if((Controller::NO_OPERATION != (Controller::SHAPE_TEXT & operations)) &&
!((nullptr != impl.mEventData) &&
- impl.mEventData->mPreEditFlag &&
+ impl.mEventData->mPreEditFlag &&
(0u != impl.mModel->mVisualModel->mCharactersToGlyph.Count())))
{
//Mark-up processor case
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if(nullptr == mFontDefaults)
{
TextAbstraction::FontDescription fontDescription;
- defaultFontId = mFontClient.GetFontId(fontDescription, TextAbstraction::FontClient::DEFAULT_POINT_SIZE * mFontSizeScale);
+ defaultFontId = mFontClient.GetFontId(fontDescription, TextAbstraction::FontClient::DEFAULT_POINT_SIZE * GetFontSizeScale());
}
else
{
- defaultFontId = mFontDefaults->GetFontId(mFontClient, mFontDefaults->mDefaultPointSize * mFontSizeScale);
+ defaultFontId = mFontDefaults->GetFontId(mFontClient, mFontDefaults->mDefaultPointSize * GetFontSizeScale());
}
Text::FontMetrics fontMetrics;
parameters.logical = logical;
parameters.isMultiline = isMultiLine;
+ float defaultFontLineHeight = GetDefaultFontLineHeight();
+
Text::GetCursorPosition(parameters,
+ defaultFontLineHeight,
cursorInfo);
// Adds Outline offset.
#define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mTextFitMaxSize(DEFAULT_TEXTFIT_MAX),
mTextFitStepSize(DEFAULT_TEXTFIT_STEP),
mFontSizeScale(DEFAULT_FONT_SIZE_SCALE),
+ mFontSizeScaleEnabled(true),
mTextFitEnabled(false),
mTextFitChanged(false),
mIsLayoutDirectionChanged(false)
}
}
+ float GetFontSizeScale()
+ {
+ return mFontSizeScaleEnabled ? mFontSizeScale : 1.0f;
+ }
+
/**
* @brief Helper to notify InputMethodContext with surrounding text & cursor changes.
*/
float mTextFitMaxSize; ///< Maximum Font Size for text fit. Default 100
float mTextFitStepSize; ///< Step Size for font intervalse. Default 1
float mFontSizeScale; ///< Scale value for Font Size. Default 1.0
+ bool mFontSizeScaleEnabled : 1; ///< Whether the font size scale is enabled.
bool mTextFitEnabled : 1; ///< Whether the text's fit is enabled.
bool mTextFitChanged : 1; ///< Whether the text fit property has changed.
bool mIsLayoutDirectionChanged : 1; ///< Whether the layout has changed.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
startOfSelectedText,
lengthOfSelectedText);
- fontDescriptionRun.size = static_cast<PointSize26Dot6>(size * controller.mImpl->mFontSizeScale * 64.f);
+ fontDescriptionRun.size = static_cast<PointSize26Dot6>(size * controller.mImpl->GetFontSizeScale() * 64.f);
fontDescriptionRun.sizeDefined = true;
controller.mImpl->mTextUpdateInfo.mCharacterIndex = startOfSelectedText;
textUpdateInfo.mCharacterIndex = 0u;
}
+ bool layoutDirectionChanged = false;
if(impl.mLayoutDirection != layoutDirection)
{
+ // Flag to indicate that the layout direction has changed.
+ layoutDirectionChanged = true;
// Clear the update info. This info will be set the next time the text is updated.
textUpdateInfo.mClearAll = true;
// Apply modifications to the model
if(isEditable)
{
- if(newSize)
+ if(newSize || layoutDirectionChanged)
{
- // If there is a new size, the scroll position needs to be clamped.
+ // If there is a new size or layout direction is changed, the scroll position needs to be clamped.
impl.ClampHorizontalScroll(layoutSize);
// Update the decorator's positions is needed if there is a new size.
impl.mEventData->mDecorator->UpdatePositions(model->mScrollPosition - offset);
+
+ // All decorator elements need to be updated.
+ if(EventData::IsEditingState(impl.mEventData->mState))
+ {
+ impl.mEventData->mScrollAfterUpdatePosition = true;
+ impl.mEventData->mUpdateCursorPosition = true;
+ impl.mEventData->mUpdateGrabHandlePosition = true;
+ }
+ else if(impl.mEventData->mState == EventData::SELECTING)
+ {
+ impl.mEventData->mUpdateHighlightBox = true;
+ }
}
// Move the cursor, grab handle etc.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if(addFontSizeRun)
{
- fontDescriptionRun.size = static_cast<PointSize26Dot6>(inputStyle.size * impl.mFontSizeScale * 64.f);
+ fontDescriptionRun.size = static_cast<PointSize26Dot6>(inputStyle.size * impl.GetFontSizeScale() * 64.f);
fontDescriptionRun.sizeDefined = true;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
mImpl->mFontSizeScale = scale;
+ // No relayout is required
+ if(!mImpl->mFontSizeScaleEnabled) return;
+
// Update the cursor position if it's in editing mode
UpdateCursorPosition(mImpl->mEventData);
return mImpl->mFontDefaults ? mImpl->mFontSizeScale : 1.0f;
}
+void Controller::SetFontSizeScaleEnabled(bool enabled)
+{
+ mImpl->mFontSizeScaleEnabled = enabled;
+
+ // Update the cursor position if it's in editing mode
+ UpdateCursorPosition(mImpl->mEventData);
+
+ // Clear the font-specific data
+ mImpl->ClearFontData();
+
+ mImpl->RequestRelayout();
+}
+
+bool Controller::IsFontSizeScaleEnabled() const
+{
+ return mImpl->mFontSizeScaleEnabled;
+}
+
void Controller::SetDefaultFontSize(float fontSize, FontSizeType type)
{
EnsureCreated(mImpl->mFontDefaults);
#define DALI_TOOLKIT_TEXT_CONTROLLER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
float GetFontSizeScale() const;
/**
+ * @brief Set the font size scale enabled flag.
+ *
+ * @param[in] enabled whether to enable the font size scale.
+ */
+ void SetFontSizeScaleEnabled(bool enabled);
+
+ /**
+ * @brief Returns whether the font size scale is enabled or not.
+ *
+ * @return @e true if the font size scale is enabled, otherwise returns @e false.
+ */
+ bool IsFontSizeScaleEnabled() const;
+
+ /**
* @brief Sets the Placeholder text font size.
* @param[in] fontSize The placeholder text font size
* @param[in] type The font size type is point size or pixel size
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if(lastGlyphIndexOfLine == index)
{
- penY += -line->descender;
+ penY += -line->descender + line->lineSpacing;
// Get the next line.
++lineIndex;
lastGlyphIndexOfLine = (line->isSplitToTwoHalves ? line->glyphRunSecondHalf.glyphIndex + line->glyphRunSecondHalf.numberOfGlyphs : line->glyphRun.glyphIndex + line->glyphRun.numberOfGlyphs) - 1u;
- penY += line->ascender + line->lineSpacing;
+ penY += line->ascender;
}
}
}
mReadyFlags.push_back(false);
- // Note, if the image is already loaded, then UploadComplete will get called
+ // Note, if the image is already loaded, then LoadComplete will get called
// from within this method. This means it won't yet have a texture id, so we
- // need to account for this inside the UploadComplete method using mRequestingLoad.
+ // need to account for this inside the LoadComplete method using mRequestingLoad.
mRequestingLoad = true;
bool synchronousLoading = false;
}
}
-void FixedImageCache::UploadComplete(
- bool loadSuccess,
- int32_t textureId,
- TextureSet textureSet,
- bool useAtlasing,
- const Vector4& atlasRect,
- bool preMultiplied)
+void FixedImageCache::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
{
bool frontFrameReady = IsFrontReady();
if(!mRequestingLoad)
{
- SetImageFrameReady(textureId);
+ SetImageFrameReady(textureInformation.textureId);
CheckFrontFrame(frontFrameReady);
}
else
{
- // UploadComplete has been called from within RequestLoad. TextureManager must
+ // LoadComplete has been called from within RequestLoad. TextureManager must
// therefore already have the texture cached, so make the texture ready.
// (Use the last texture, as the texture id hasn't been assigned yet)
mReadyFlags.back() = true;
}
}
-void FixedImageCache::LoadComplete(
- bool loadSuccess,
- Devel::PixelBuffer pixelBuffer,
- const VisualUrl& url,
- bool preMultiplied)
-{
- // LoadComplete is called if this TextureUploadObserver requested to load
- // an image that will be returned as a type of PixelBuffer by using a method
- // TextureManager::LoadPixelBuffer.
-}
-
} //namespace Internal
} //namespace Toolkit
} //namespace Dali
\ No newline at end of file
void CheckFrontFrame(bool wasReady);
protected:
- void UploadComplete(
- bool loadSuccess,
- int32_t textureId,
- TextureSet textureSet,
- bool useAtlasing,
- const Vector4& atlasRect,
- bool premultiplied) override;
-
- void LoadComplete(
- bool loadSuccess,
- Devel::PixelBuffer pixelBuffer,
- const VisualUrl& url,
- bool preMultiplied) override;
+ void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
private:
std::vector<UrlStore>& mImageUrls;
}
}
-void RollingAnimatedImageCache::UploadComplete(
- bool loadSuccess,
- int32_t textureId,
- TextureSet textureSet,
- bool useAtlasing,
- const Vector4& atlasRect,
- bool preMultiplied)
+void RollingAnimatedImageCache::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
{
- DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::UploadComplete(textureId:%d) start\n", textureId);
+ DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::LoadComplete(textureId:%d) start\n", textureInformation.textureId);
LOG_CACHE;
bool frontFrameReady = IsFrontReady();
if(!mRequestingLoad)
{
- SetImageFrameReady(textureId);
+ SetImageFrameReady(textureInformation.textureId);
CheckFrontFrame(frontFrameReady);
}
else
{
- // UploadComplete has been called from within RequestLoad. TextureManager must
+ // LoadComplete has been called from within RequestLoad. TextureManager must
// therefore already have the texture cached, so make the texture ready.
// (Use the last texture, as the texture id hasn't been assigned yet)
mQueue.Back().mReady = true;
LOG_CACHE;
}
-void RollingAnimatedImageCache::LoadComplete(
- bool loadSuccess,
- Devel::PixelBuffer pixelBuffer,
- const VisualUrl& url,
- bool preMultiplied)
-{
- // LoadComplete is called if this TextureUploadObserver requested to load
- // an image that will be returned as a type of PixelBuffer by using a method
- // TextureManager::LoadPixelBuffer.
-}
-
} //namespace Internal
} //namespace Toolkit
} //namespace Dali
void CheckFrontFrame(bool wasReady);
protected:
- void UploadComplete(
- bool loadSuccess,
- int32_t textureId,
- TextureSet textureSet,
- bool useAtlasing,
- const Vector4& atlasRect,
- bool preMultiplied) override;
-
- void LoadComplete(
- bool loadSuccess,
- Devel::PixelBuffer pixelBuffer,
- const VisualUrl& url,
- bool preMultiplied) override;
+ void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
private:
/**
mQueue.PushBack(imageFrame);
- // Note, if the image is already loaded, then UploadComplete will get called
+ // Note, if the image is already loaded, then LoadComplete will get called
// from within this method. This means it won't yet have a texture id, so we
- // need to account for this inside the UploadComplete method using mRequestingLoad.
+ // need to account for this inside the LoadComplete method using mRequestingLoad.
mRequestingLoad = true;
bool synchronousLoading = false;
}
}
-void RollingImageCache::UploadComplete(
- bool loadSuccess,
- int32_t textureId,
- TextureSet textureSet,
- bool useAtlasing,
- const Vector4& atlasRect,
- bool preMultiplied)
+void RollingImageCache::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
{
- DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::UploadComplete(textureId:%d) start\n", textureId);
+ DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::LoadComplete(textureId:%d) start\n", textureInformation.textureId);
LOG_CACHE;
bool frontFrameReady = IsFrontReady();
if(!mRequestingLoad)
{
- SetImageFrameReady(textureId);
+ SetImageFrameReady(textureInformation.textureId);
CheckFrontFrame(frontFrameReady);
}
else
{
- // UploadComplete has been called from within RequestLoad. TextureManager must
+ // LoadComplete has been called from within RequestLoad. TextureManager must
// therefore already have the texture cached, so make the texture ready.
// (Use the last texture, as the texture id hasn't been assigned yet)
mQueue.Back().mReady = true;
LOG_CACHE;
}
-void RollingImageCache::LoadComplete(
- bool loadSuccess,
- Devel::PixelBuffer pixelBuffer,
- const VisualUrl& url,
- bool preMultiplied)
-{
- // LoadComplete is called if this TextureUploadObserver requested to load
- // an image that will be returned as a type of PixelBuffer by using a method
- // TextureManager::LoadPixelBuffer.
-}
-
} //namespace Internal
} //namespace Toolkit
} //namespace Dali
void CheckFrontFrame(bool wasReady);
protected:
- void UploadComplete(
- bool loadSuccess,
- int32_t textureId,
- TextureSet textureSet,
- bool useAtlasing,
- const Vector4& atlasRect,
- bool preMultiplied) override;
-
- void LoadComplete(
- bool loadSuccess,
- Devel::PixelBuffer pixelBuffer,
- const VisualUrl& url,
- bool preMultiplied) override;
+ void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
private:
/**
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
bool sync = IsSynchronousLoadingRequired();
- map.Insert(SYNCHRONOUS_LOADING, sync);
+ map.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, sync);
if(mImageUrl.IsValid())
{
map.Insert(Toolkit::ImageVisual::Property::URL, mImageUrl.GetUrl());
}
// From Texture Manager
-void ImageVisual::UploadComplete(bool loadingSuccess, int32_t textureId, TextureSet textureSet, bool usingAtlas, const Vector4& atlasRectangle, bool preMultiplied)
+void ImageVisual::LoadComplete(bool loadingSuccess, TextureInformation textureInformation)
{
Toolkit::Visual::ResourceStatus resourceStatus;
if(mImpl->mRenderer)
{
- if(usingAtlas)
+ if(textureInformation.useAtlasing)
{
mImpl->mRenderer.RegisterProperty(ATLAS_RECT_UNIFORM_NAME, mAtlasRect);
}
- EnablePreMultipliedAlpha(preMultiplied);
+ EnablePreMultipliedAlpha(textureInformation.preMultiplied);
Actor actor = mPlacementActor.GetHandle();
if(!loadingSuccess)
imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
}
mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
- textureSet = mImpl->mRenderer.GetTextures();
+ textureInformation.textureSet = mImpl->mRenderer.GetTextures();
}
else
{
Sampler sampler = Sampler::New();
sampler.SetWrapMode(mWrapModeU, mWrapModeV);
- textureSet.SetSampler(0u, sampler);
- mImpl->mRenderer.SetTextures(textureSet);
+ textureInformation.textureSet.SetSampler(0u, sampler);
+ mImpl->mRenderer.SetTextures(textureInformation.textureSet);
}
if(actor)
// Storing TextureSet needed when renderer staged.
if(!mImpl->mRenderer)
{
- mTextures = textureSet;
+ mTextures = textureInformation.textureSet;
}
// Image loaded, set status regardless of staged status.
void UploadCompleted() override;
/**
- * @copydoc TextureUploadObserver::UploadCompleted
+ * @copydoc TextureUploadObserver::LoadCompleted
*
* To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
* This callback is the place to add the renderer as it would be called once the loading is finished.
*/
- void UploadComplete(bool success, int32_t textureId, TextureSet textureSet, bool usingAtlas, const Vector4& atlasRectangle, bool preMultiplied) override;
+ void LoadComplete(bool success, TextureInformation textureInformation) override;
private:
/**
- * @copydoc TextureUploadObserver::LoadComplete
- *
- * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
- * This callback is the place to add the renderer as it would be called once the PixelBuffer loading is finished.
- */
- void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override
- {
- }
-
- /**
* Allocate the mask data when a masking property is defined in the property map
*/
void AllocateMaskData();
mLoadingState = LoadingState::LOAD_COMPLETE;
}
-void NPatchData::LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied)
+void NPatchData::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
{
if(loadSuccess)
{
- SetLoadedNPatchData(pixelBuffer, preMultiplied);
+ SetLoadedNPatchData(textureInformation.pixelBuffer, textureInformation.preMultiplied);
}
else
{
for(uint32_t index = 0; index < mObserverList.Count(); ++index)
{
TextureUploadObserver* observer = mObserverList[index];
- observer->UploadComplete(loadSuccess, TextureManager::INVALID_TEXTURE_ID, mTextureSet, false, Vector4(), preMultiplied);
+ observer->LoadComplete(loadSuccess, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, TextureManager::INVALID_TEXTURE_ID, mTextureSet, false, Vector4(), textureInformation.preMultiplied));
}
}
private:
/**
- * @copydoc TextureUploadObserver::UploadCompleted
- *
- * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
- * This callback is the place to add the renderer as it would be called once the loading is finished.
- */
- void UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied) override
- {
- }
-
- /**
* @copydoc TextureUploadObserver::LoadComplete
*
* To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
* This callback is the place to add the renderer as it would be called once the loading is finished.
*/
- void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override;
+ void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
private:
using ObserverListType = Dali::Vector<TextureUploadObserver*>;
#include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
#include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
#include <dali-toolkit/internal/visuals/npatch-loader.h>
+#include <dali-toolkit/devel-api/utility/npatch-helper.h>
#include <dali-toolkit/internal/visuals/rendering-addon.h>
#include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
{
namespace Internal
{
-namespace
-{
-/**
- * @brief Creates the geometry formed from the vertices and indices
- *
- * @param[in] vertices The vertices to generate the geometry from
- * @param[in] indices The indices to generate the geometry from
- * @return The geometry formed from the vertices and indices
- */
-Geometry GenerateGeometry(const Vector<Vector2>& vertices, const Vector<unsigned short>& indices)
-{
- Property::Map vertexFormat;
- vertexFormat["aPosition"] = Property::VECTOR2;
- VertexBuffer vertexBuffer = VertexBuffer::New(vertexFormat);
- if(vertices.Size() > 0)
- {
- vertexBuffer.SetData(&vertices[0], vertices.Size());
- }
-
- // Create the geometry object
- Geometry geometry = Geometry::New();
- geometry.AddVertexBuffer(vertexBuffer);
- if(indices.Size() > 0)
- {
- geometry.SetIndexBuffer(&indices[0], indices.Size());
- }
-
- return geometry;
-}
-
-/**
- * @brief Adds the indices to form a quad composed off two triangles where the indices are organised in a grid
- *
- * @param[out] indices The indices to add to
- * @param[in] rowIdx The row index to start the quad
- * @param[in] nextRowIdx The index to the next row
- */
-void AddQuadIndices(Vector<unsigned short>& indices, unsigned int rowIdx, unsigned int nextRowIdx)
-{
- indices.PushBack(rowIdx);
- indices.PushBack(nextRowIdx + 1);
- indices.PushBack(rowIdx + 1);
-
- indices.PushBack(rowIdx);
- indices.PushBack(nextRowIdx);
- indices.PushBack(nextRowIdx + 1);
-}
-
-void AddVertex(Vector<Vector2>& vertices, unsigned int x, unsigned int y)
-{
- vertices.PushBack(Vector2(x, y));
-}
-
-void RegisterStretchProperties(Renderer& renderer, const char* uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent)
-{
- uint16_t prevEnd = 0;
- uint16_t prevFix = 0;
- uint16_t prevStretch = 0;
- unsigned int i = 1;
- for(NPatchUtility::StretchRanges::ConstIterator it = stretchPixels.Begin(); it != stretchPixels.End(); ++it, ++i)
- {
- uint16_t start = it->GetX();
- uint16_t end = it->GetY();
-
- uint16_t fix = prevFix + start - prevEnd;
- uint16_t stretch = prevStretch + end - start;
-
- std::stringstream uniform;
- uniform << uniformName << "[" << i << "]";
- renderer.RegisterProperty(uniform.str(), Vector2(fix, stretch));
-
- prevEnd = end;
- prevFix = fix;
- prevStretch = stretch;
- }
-
- {
- prevFix += imageExtent - prevEnd;
- std::stringstream uniform;
- uniform << uniformName << "[" << i << "]";
- renderer.RegisterProperty(uniform.str(), Vector2(prevFix, prevStretch));
- }
-}
-
-} //unnamed namespace
/////////////////NPatchVisual////////////////
Uint16Pair gridSize(2 * data->GetStretchPixelsX().Size() + 1, 2 * data->GetStretchPixelsY().Size() + 1);
if(!data->GetRenderingMap())
{
- geometry = !mBorderOnly ? CreateGridGeometry(gridSize) : CreateBorderGeometry(gridSize);
+ geometry = !mBorderOnly ? NPatchHelper::CreateGridGeometry(gridSize) : NPatchHelper::CreateBorderGeometry(gridSize);
}
else
{
uint32_t elementCount[2];
- geometry = !mBorderOnly ? RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), gridSize, elementCount) : CreateBorderGeometry(gridSize);
+ geometry = !mBorderOnly ? RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), gridSize, elementCount) : NPatchHelper::CreateBorderGeometry(gridSize);
if(mImpl->mRenderer)
{
RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
{
textureSet = data->GetTextures();
-
- if(data->GetStretchPixelsX().Size() == 1 && data->GetStretchPixelsY().Size() == 1)
- {
- //special case for 9 patch
- Uint16Pair stretchX = data->GetStretchPixelsX()[0];
- Uint16Pair stretchY = data->GetStretchPixelsY()[0];
-
- uint16_t stretchWidth = (stretchX.GetY() >= stretchX.GetX()) ? stretchX.GetY() - stretchX.GetX() : 0;
- uint16_t stretchHeight = (stretchY.GetY() >= stretchY.GetX()) ? stretchY.GetY() - stretchY.GetX() : 0;
-
- mImpl->mRenderer.RegisterProperty("uFixed[0]", Vector2::ZERO);
- mImpl->mRenderer.RegisterProperty("uFixed[1]", Vector2(stretchX.GetX(), stretchY.GetX()));
- mImpl->mRenderer.RegisterProperty("uFixed[2]", Vector2(data->GetCroppedWidth() - stretchWidth, data->GetCroppedHeight() - stretchHeight));
- mImpl->mRenderer.RegisterProperty("uStretchTotal", Vector2(stretchWidth, stretchHeight));
- }
- else
- {
- mImpl->mRenderer.RegisterProperty("uNinePatchFactorsX[0]", Vector2::ZERO);
- mImpl->mRenderer.RegisterProperty("uNinePatchFactorsY[0]", Vector2::ZERO);
-
- RegisterStretchProperties(mImpl->mRenderer, "uNinePatchFactorsX", data->GetStretchPixelsX(), data->GetCroppedWidth());
- RegisterStretchProperties(mImpl->mRenderer, "uNinePatchFactorsY", data->GetStretchPixelsY(), data->GetCroppedHeight());
- }
+ NPatchHelper::ApplyTextureAndUniforms(mImpl->mRenderer, data);
}
else
{
{
if(DALI_LIKELY(VisualFactoryCache::NINE_PATCH_GEOMETRY == subType))
{
- geometry = CreateGridGeometry(Uint16Pair(3, 3));
+ geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3, 3));
}
else if(VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY == subType)
{
- geometry = CreateBorderGeometry(Uint16Pair(3, 3));
+ geometry = NPatchHelper::CreateBorderGeometry(Uint16Pair(3, 3));
}
mFactoryCache.SaveGeometry(subType, geometry);
}
return geometry;
}
-Geometry NPatchVisual::CreateGridGeometry(Uint16Pair gridSize)
-{
- uint16_t gridWidth = gridSize.GetWidth();
- uint16_t gridHeight = gridSize.GetHeight();
-
- // Create vertices
- Vector<Vector2> vertices;
- vertices.Reserve((gridWidth + 1) * (gridHeight + 1));
-
- for(int y = 0; y < gridHeight + 1; ++y)
- {
- for(int x = 0; x < gridWidth + 1; ++x)
- {
- AddVertex(vertices, x, y);
- }
- }
-
- // Create indices
- Vector<unsigned short> indices;
- indices.Reserve(gridWidth * gridHeight * 6);
-
- unsigned int rowIdx = 0;
- unsigned int nextRowIdx = gridWidth + 1;
- for(int y = 0; y < gridHeight; ++y, ++nextRowIdx, ++rowIdx)
- {
- for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
- {
- AddQuadIndices(indices, rowIdx, nextRowIdx);
- }
- }
-
- return GenerateGeometry(vertices, indices);
-}
-
-Geometry NPatchVisual::CreateBorderGeometry(Uint16Pair gridSize)
-{
- uint16_t gridWidth = gridSize.GetWidth();
- uint16_t gridHeight = gridSize.GetHeight();
-
- // Create vertices
- Vector<Vector2> vertices;
- vertices.Reserve((gridWidth + 1) * (gridHeight + 1));
-
- //top
- int y = 0;
- for(; y < 2; ++y)
- {
- for(int x = 0; x < gridWidth + 1; ++x)
- {
- AddVertex(vertices, x, y);
- }
- }
-
- for(; y < gridHeight - 1; ++y)
- {
- //left
- AddVertex(vertices, 0, y);
- AddVertex(vertices, 1, y);
-
- //right
- AddVertex(vertices, gridWidth - 1, y);
- AddVertex(vertices, gridWidth, y);
- }
-
- //bottom
- for(; y < gridHeight + 1; ++y)
- {
- for(int x = 0; x < gridWidth + 1; ++x)
- {
- AddVertex(vertices, x, y);
- }
- }
-
- // Create indices
- Vector<unsigned short> indices;
- indices.Reserve(gridWidth * gridHeight * 6);
-
- //top
- unsigned int rowIdx = 0;
- unsigned int nextRowIdx = gridWidth + 1;
- for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
- {
- AddQuadIndices(indices, rowIdx, nextRowIdx);
- }
-
- if(gridHeight > 2)
- {
- rowIdx = gridWidth + 1;
- nextRowIdx = (gridWidth + 1) * 2;
-
- unsigned increment = gridWidth - 1;
- if(gridHeight > 3)
- {
- increment = 2;
- //second row left
- AddQuadIndices(indices, rowIdx, nextRowIdx);
-
- rowIdx = gridWidth * 2;
- nextRowIdx = (gridWidth + 1) * 2 + 2;
- //second row right
- AddQuadIndices(indices, rowIdx, nextRowIdx);
-
- //left and right
- rowIdx = nextRowIdx - 2;
- nextRowIdx = rowIdx + 4;
- for(int y = 2; y < 2 * (gridHeight - 3); ++y, rowIdx += 2, nextRowIdx += 2)
- {
- AddQuadIndices(indices, rowIdx, nextRowIdx);
- }
- }
-
- //second row left
- AddQuadIndices(indices, rowIdx, nextRowIdx);
-
- rowIdx += increment;
- nextRowIdx += gridWidth - 1;
- //second row right
- AddQuadIndices(indices, rowIdx, nextRowIdx);
- }
-
- //bottom
- rowIdx = nextRowIdx - gridWidth + 1;
- nextRowIdx = rowIdx + gridWidth + 1;
- for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
- {
- AddQuadIndices(indices, rowIdx, nextRowIdx);
- }
-
- return GenerateGeometry(vertices, indices);
-}
-
void NPatchVisual::SetResource()
{
const NPatchData* data;
}
}
-void NPatchVisual::UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied)
+void NPatchVisual::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
{
- EnablePreMultipliedAlpha(preMultiplied);
- if(!loadSuccess)
- {
- // Image loaded and ready to display
- ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
- }
-
- if(mAuxiliaryPixelBuffer || !mAuxiliaryUrl.IsValid())
+ if(textureInformation.returnType == TextureUploadObserver::ReturnType::TEXTURE)
{
- SetResource();
- }
-}
+ EnablePreMultipliedAlpha(textureInformation.preMultiplied);
+ if(!loadSuccess)
+ {
+ // Image loaded and ready to display
+ ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+ }
-void NPatchVisual::LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied)
-{
- if(loadSuccess && url.GetUrl() == mAuxiliaryUrl.GetUrl())
- {
- mAuxiliaryPixelBuffer = pixelBuffer;
- SetResource();
+ if(mAuxiliaryPixelBuffer || !mAuxiliaryUrl.IsValid())
+ {
+ SetResource();
+ }
}
- else
+ else // for the ReturnType::PIXEL_BUFFER
{
- // Image loaded and ready to display
- ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+ if(loadSuccess && textureInformation.url == mAuxiliaryUrl.GetUrl())
+ {
+ mAuxiliaryPixelBuffer = textureInformation.pixelBuffer;
+ SetResource();
+ }
+ else
+ {
+ // Image loaded and ready to display
+ ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+ }
}
}
private:
/**
- * @copydoc TextureUploadObserver::UploadCompleted
+ * @copydoc TextureUploadObserver::LoadCompleted
*
* To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
* This callback is the place to add the renderer as it would be called once the loading is finished.
*/
- void UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied) override;
-
- /**
- * @copydoc TextureUploadObserver::LoadComplete
- *
- * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
- * This callback is the place to add the renderer as it would be called once the loading is finished.
- */
- void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override;
+ void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
private:
WeakHandle<Actor> mPlacementActor; ///< Weakhandle to contain Actor during texture loading
TextureManager::LoadState loadState = GetTextureStateInternal(textureId);
if(loadState == TextureManager::LoadState::UPLOADED)
{
- // UploadComplete has already been called - keep the same texture set
+ // LoadComplete has already been called - keep the same texture set
textureSet = GetTextureSet(textureId);
}
}
TextureManager::LoadState loadState = GetTextureStateInternal(textureId);
if(loadState == TextureManager::LoadState::UPLOADED)
{
- // UploadComplete has already been called - keep the same texture set
+ // LoadComplete has already been called - keep the same texture set
textureSet = GetTextureSet(textureId);
}
{
// The Texture has already loaded. The other observers have already been notified.
// We need to send a "late" loaded notification for this observer.
- observer->UploadComplete(true, textureInfo.textureId, textureInfo.textureSet, textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied);
+ observer->LoadComplete(true, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, textureInfo.textureId, textureInfo.textureSet, textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied));
}
break;
}
TextureInfo& textureInfo(mTextureInfoContainer[cacheIndex]);
if(textureInfo.loadState == LoadState::UPLOADED)
{
- element.mObserver->UploadComplete(true, textureInfo.textureId, textureInfo.textureSet, textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied);
+ element.mObserver->LoadComplete(true, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, textureInfo.textureId, textureInfo.textureSet, textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied));
}
else if(textureInfo.loadState == LoadState::LOAD_FINISHED && textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER)
{
- element.mObserver->LoadComplete(true, textureInfo.pixelBuffer, textureInfo.url, textureInfo.preMultiplied);
+ element.mObserver->LoadComplete(true, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::PIXEL_BUFFER, textureInfo.pixelBuffer, textureInfo.url.GetUrl(), textureInfo.preMultiplied));
}
else
{
{
TextureUploadObserver* observer = info->observerList[0];
- // During UploadComplete() a Control ResourceReady() signal is emitted.
+ // During LoadComplete() a Control ResourceReady() signal is emitted.
// During that signal the app may add remove /add Textures (e.g. via
// ImageViews).
// It is possible for observers to be removed from the observer list,
if(info->storageType == StorageType::RETURN_PIXEL_BUFFER)
{
- observer->LoadComplete(success, info->pixelBuffer, info->url, info->preMultiplied);
+ observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::PIXEL_BUFFER, info->pixelBuffer, info->url.GetUrl(), info->preMultiplied));
}
else
{
- observer->UploadComplete(success, info->textureId, info->textureSet, info->useAtlas, info->atlasRect, info->preMultiplied);
+ observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, info->textureId, info->textureSet, info->useAtlas, info->atlasRect, info->preMultiplied));
}
// Get the textureInfo from the container again as it may have been invalidated.
* @brief Requests an image load of the given URL.
*
* The parameters are used to specify how the image is loaded.
- * The observer has the UploadComplete method called when the load is ready.
+ * The observer has the LoadComplete method called when the load is ready.
*
* When the client has finished with the Texture, Remove() should be called.
*
* @brief Requests an image load of the given URL.
*
* The parameters are used to specify how the image is loaded.
- * The observer has the UploadComplete method called when the load is ready.
+ * The observer has the LoadComplete method called when the load is ready.
*
* When the client has finished with the Texture, Remove() should be called.
*
* the blended texture.
*
* The parameters are used to specify how the image is loaded.
- * The observer has the UploadComplete method called when the load is ready.
+ * The observer has the LoadComplete method called when the load is ready.
*
* When the client has finished with the Texture, Remove() should be called.
*
* CPU blend with the mask, and upload the blend texture.
*
* The parameters are used to specify how the image is loaded.
- * The observer has the UploadComplete method called when the load is ready.
+ * The observer has the LoadComplete method called when the load is ready.
*
* When the client has finished with the Texture, Remove() should be called.
*
bool CreateTiledGeometry(const Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo);
/**
- * Mark the texture as complete, and inform observers
- * @param[in] textureInfo The struct associated with this Texture
- */
- void UploadComplete(TextureInfo& textureInfo);
-
- /**
* Notify the current observers that the texture upload is complete,
* then remove the observers from the list.
* @param[in] textureInfo The struct associated with this Texture
// CLASS HEADER
#include "texture-upload-observer.h"
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
+
namespace Dali
{
namespace Toolkit
{
+TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied)
+: returnType(returnType),
+ textureId(textureId),
+ textureSet(textureSet),
+ useAtlasing(useAtlasing),
+ atlasRect(atlasRect),
+ preMultiplied(preMultiplied),
+ pixelBuffer(),
+ url()
+{
+}
+
+TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, Devel::PixelBuffer pixelBuffer, const std::string& url, bool preMultiplied)
+: returnType(returnType),
+ textureId(Internal::TextureManager::INVALID_TEXTURE_ID),
+ textureSet(),
+ useAtlasing(false),
+ atlasRect(Vector4::ZERO),
+ preMultiplied(preMultiplied),
+ pixelBuffer(pixelBuffer),
+ url(url)
+{
+}
+
TextureUploadObserver::TextureUploadObserver()
{
}
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali/public-api/signals/dali-signal.h>
+#include <dali/public-api/rendering/texture-set.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-url.h>
namespace Dali
{
-class TextureSet;
namespace Toolkit
{
/**
* @brief Base class used to observe the upload status of a texture.
*
- * Derived class must implement the UploadComplete method which is
+ * Derived class must implement the LoadComplete method which is
* executed once the texture is ready to draw.
*/
class TextureUploadObserver
public:
typedef Signal<void(TextureUploadObserver*)> DestructionSignalType; ///< Signal prototype for the Destruction Signal.
+ enum class ReturnType
+ {
+ TEXTURE = 0,
+ PIXEL_BUFFER
+ };
+
+ struct TextureInformation
+ {
+ TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied);
+ TextureInformation(ReturnType returnType, Devel::PixelBuffer pixelBuffer, const std::string& url, bool preMultiplied);
+
+ TextureInformation();
+
+ ReturnType returnType; ///< Returned Texture type.
+ int32_t textureId; ///< The textureId of the loaded texture in the TextureManager
+ TextureSet textureSet; ///< The TextureSet containing the Texture
+ bool useAtlasing; ///< True if atlasing was used (note: this may be different to what was requested)
+ const Vector4& atlasRect; ///< If using atlasing, this is the rectangle within the atlas to use.
+ bool preMultiplied; ///< True if the image had pre-multiplied alpha applied
+ Devel::PixelBuffer pixelBuffer; ///< The PixelBuffer of the loaded image.
+ std::string_view url; ///< The url address of the loaded image.
+ };
+
+public:
/**
* @brief Constructor.
*/
virtual ~TextureUploadObserver();
/**
- * The action to be taken once the async load has finished and the upload to GPU is completed.
- * This should be overridden by the deriving class.
- *
- * @param[in] loadSuccess True if the texture load was successful (i.e. the resource is available). If false, then the resource failed to load. In future, this will automatically upload a "broken" image.
- * @param[in] textureId The textureId of the loaded texture in the TextureManager
- * @param[in] textureSet The TextureSet containing the Texture
- * @param[in] useAtlasing True if atlasing was used (note: this may be different to what was requested)
- * @param[in] atlasRect If using atlasing, this is the rectangle within the atlas to use.
- * @param[in] preMultiplied True if the image had pre-multiplied alpha applied
- */
- virtual void UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied) = 0;
-
- /**
* The action to be taken once the async load has finished.
+ * And in case of texture loading, this method is called after uploading.
* This should be overridden by the deriving class.
*
- * @param[in] loadSuccess True if the image load was successful (i.e. the resource is available). If false, then the resource failed to load.
- * @param[in] pixelBuffer The PixelBuffer of the loaded image.
- * @param[in] url The url address of the loaded image.
- * @param[in] preMultiplied True if the image had pre-multiplied alpha applied
+ * @param[in] loadSuccess True if the texture load was successful (i.e. the resource is available). If false, then the resource failed to load. In future, this will automatically upload a "broken" image.
+ * @param[in] textureInformation Structure that contains loaded texture information.
*/
- virtual void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const Internal::VisualUrl& url, bool preMultiplied) = 0;
+ virtual void LoadComplete(bool loadSuccess, TextureInformation textureInformation) = 0;
/**
* @brief Returns the destruction signal.
#include <dali-toolkit/internal/visuals/image-atlas-manager.h>
#include <dali-toolkit/internal/visuals/svg/svg-visual.h>
#include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
+#include <dali-toolkit/devel-api/utility/npatch-helper.h>
#include <dali/integration-api/debug.h>
namespace Dali
{
namespace Internal
{
-namespace
-{
-
-/**
- * @brief Creates the geometry formed from the vertices and indices
- *
- * @param[in] vertices The vertices to generate the geometry from
- * @param[in] indices The indices to generate the geometry from
- * @return The geometry formed from the vertices and indices
- */
-Geometry GenerateGeometry(const Vector<Vector2>& vertices, const Vector<unsigned short>& indices)
-{
- Property::Map vertexFormat;
- vertexFormat["aPosition"] = Property::VECTOR2;
- VertexBuffer vertexBuffer = VertexBuffer::New(vertexFormat);
- if(vertices.Size() > 0)
- {
- vertexBuffer.SetData(&vertices[0], vertices.Size());
- }
-
- // Create the geometry object
- Geometry geometry = Geometry::New();
- geometry.AddVertexBuffer(vertexBuffer);
- if(indices.Size() > 0)
- {
- geometry.SetIndexBuffer(&indices[0], indices.Size());
- }
-
- return geometry;
-}
-
-/**
- * @brief Adds the indices to form a quad composed off two triangles where the indices are organised in a grid
- *
- * @param[out] indices The indices to add to
- * @param[in] rowIdx The row index to start the quad
- * @param[in] nextRowIdx The index to the next row
- */
-void AddQuadIndices(Vector<unsigned short>& indices, unsigned int rowIdx, unsigned int nextRowIdx)
-{
- indices.PushBack(rowIdx);
- indices.PushBack(nextRowIdx + 1);
- indices.PushBack(rowIdx + 1);
-
- indices.PushBack(rowIdx);
- indices.PushBack(nextRowIdx);
- indices.PushBack(nextRowIdx + 1);
-}
-
-/**
- * @brief Adds the vertices to create for npatch
- * @param[out] vertices The vertices to add to
- * @param[in] x The x value of vector
- * @param[in] y The y value of vector
- */
-void AddVertex(Vector<Vector2>& vertices, unsigned int x, unsigned int y)
-{
- vertices.PushBack(Vector2(x, y));
-}
-
-} //unnamed namespace
VisualFactoryCache::VisualFactoryCache(bool preMultiplyOnLoad)
: mSvgRasterizeThread(NULL),
mVectorAnimationManager(),
mPreMultiplyOnLoad(preMultiplyOnLoad),
- mBrokenImageInfoContainer()
+ mBrokenImageInfoContainer(),
+ mDefaultBrokenImageUrl(""),
+ mUseDefaultBrokenImageOnly(true)
{
}
if(!mAtlasManager)
{
mAtlasManager = new ImageAtlasManager();
- if(!mBrokenImageInfoContainer.empty())
- {
- mAtlasManager->SetBrokenImage(mBrokenImageInfoContainer[0].url);
- }
+ mAtlasManager->SetBrokenImage(mDefaultBrokenImageUrl);
}
return mAtlasManager;
return mPreMultiplyOnLoad;
}
-void VisualFactoryCache::SetBrokenImageUrl(const std::vector<std::string>& brokenImageUrlList)
+void VisualFactoryCache::SetBrokenImageUrl(std::string& defaultBrokenUrl, const std::vector<std::string>& brokenImageUrlList)
{
+ mUseDefaultBrokenImageOnly = false;
mBrokenImageInfoContainer.clear();
mBrokenImageInfoContainer.assign(brokenImageUrlList.size(), BrokenImageInfo());
for(unsigned int i = 0; i < brokenImageUrlList.size(); i++)
{
mBrokenImageInfoContainer[i].url = brokenImageUrlList[i];
}
+
+ mDefaultBrokenImageUrl = defaultBrokenUrl;
}
VisualUrl::Type VisualFactoryCache::GetBrokenImageVisualType(int index)
return mBrokenImageInfoContainer[index].visualType;
}
-Geometry VisualFactoryCache::CreateNPatchGeometry(Uint16Pair gridSize)
-{
- uint16_t gridWidth = gridSize.GetWidth();
- uint16_t gridHeight = gridSize.GetHeight();
-
- // Create vertices
- Vector<Vector2> vertices;
- vertices.Reserve((gridWidth + 1) * (gridHeight + 1));
-
- for(int y = 0; y < gridHeight + 1; ++y)
- {
- for(int x = 0; x < gridWidth + 1; ++x)
- {
- AddVertex(vertices, x, y);
- }
- }
-
- // Create indices
- Vector<unsigned short> indices;
- indices.Reserve(gridWidth * gridHeight * 6);
-
- unsigned int rowIdx = 0;
- unsigned int nextRowIdx = gridWidth + 1;
- for(int y = 0; y < gridHeight; ++y, ++nextRowIdx, ++rowIdx)
- {
- for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
- {
- AddQuadIndices(indices, rowIdx, nextRowIdx);
- }
- }
-
- return GenerateGeometry(vertices, indices);
-}
-
Geometry VisualFactoryCache::GetNPatchGeometry(int index)
{
Geometry geometry;
geometry = GetGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
if(!geometry)
{
- geometry = CreateNPatchGeometry(Uint16Pair(3,3));
+ geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3,3));
SaveGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY, geometry);
}
}
else if(data->GetStretchPixelsX().Size() > 0 || data->GetStretchPixelsY().Size() > 0)
{
Uint16Pair gridSize(2 * data->GetStretchPixelsX().Size() + 1, 2 * data->GetStretchPixelsY().Size() + 1);
- geometry = CreateNPatchGeometry(gridSize);
+ geometry = NPatchHelper::CreateGridGeometry(gridSize);
}
}
else
geometry = GetGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
if(!geometry)
{
- geometry = CreateNPatchGeometry(Uint16Pair(3,3));
+ geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3,3));
SaveGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY, geometry);
}
}
yStretchCount = data->GetStretchPixelsY().Count();
}
- if(DALI_LIKELY((xStretchCount == 0 && yStretchCount == 0)))
+ if(DALI_LIKELY((xStretchCount == 0 && yStretchCount == 0) || (xStretchCount == 1 && yStretchCount == 1)))
{
shader = GetShader(VisualFactoryCache::NINE_PATCH_SHADER);
if(DALI_UNLIKELY(!shader))
return shader;
}
-void VisualFactoryCache::RegisterStretchProperties(Renderer& renderer, const char* uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent)
-{
- uint16_t prevEnd = 0;
- uint16_t prevFix = 0;
- uint16_t prevStretch = 0;
- unsigned int i = 1;
- for(NPatchUtility::StretchRanges::ConstIterator it = stretchPixels.Begin(); it != stretchPixels.End(); ++it, ++i)
- {
- uint16_t start = it->GetX();
- uint16_t end = it->GetY();
-
- uint16_t fix = prevFix + start - prevEnd;
- uint16_t stretch = prevStretch + end - start;
-
- std::stringstream uniform;
- uniform << uniformName << "[" << i << "]";
- renderer.RegisterProperty(uniform.str(), Vector2(fix, stretch));
-
- prevEnd = end;
- prevFix = fix;
- prevStretch = stretch;
- }
-
- {
- prevFix += imageExtent - prevEnd;
- std::stringstream uniform;
- uniform << uniformName << "[" << i << "]";
- renderer.RegisterProperty(uniform.str(), Vector2(prevFix, prevStretch));
- }
-}
-
void VisualFactoryCache::ApplyTextureAndUniforms(Renderer& renderer, int index)
{
const NPatchData* data;
if(mNPatchLoader.GetNPatchData(mBrokenImageInfoContainer[index].npatchId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
{
textureSet = data->GetTextures();
- mBrokenImageInfoContainer[index].texture = data->GetTextures().GetTexture(0);
-
- if(data->GetStretchPixelsX().Size() == 1 && data->GetStretchPixelsY().Size() == 1)
- {
- //special case for 9 patch
- Uint16Pair stretchX = data->GetStretchPixelsX()[0];
- Uint16Pair stretchY = data->GetStretchPixelsY()[0];
-
- uint16_t stretchWidth = (stretchX.GetY() >= stretchX.GetX()) ? stretchX.GetY() - stretchX.GetX() : 0;
- uint16_t stretchHeight = (stretchY.GetY() >= stretchY.GetX()) ? stretchY.GetY() - stretchY.GetX() : 0;
-
- renderer.RegisterProperty("uFixed[0]", Vector2::ZERO);
- renderer.RegisterProperty("uFixed[1]", Vector2(stretchX.GetX(), stretchY.GetX()));
- renderer.RegisterProperty("uFixed[2]", Vector2(data->GetCroppedWidth() - stretchWidth, data->GetCroppedHeight() - stretchHeight));
- renderer.RegisterProperty("uStretchTotal", Vector2(stretchWidth, stretchHeight));
- }
- else
- {
- renderer.RegisterProperty("uNinePatchFactorsX[0]", Vector2::ZERO);
- renderer.RegisterProperty("uNinePatchFactorsY[0]", Vector2::ZERO);
-
- RegisterStretchProperties(renderer, "uNinePatchFactorsX", data->GetStretchPixelsX(), data->GetCroppedWidth());
- RegisterStretchProperties(renderer, "uNinePatchFactorsY", data->GetStretchPixelsY(), data->GetCroppedHeight());
- }
+ mBrokenImageInfoContainer[index].texture = textureSet.GetTexture(0);
+ NPatchHelper::ApplyTextureAndUniforms(renderer, data);
renderer.SetTextures(textureSet);
}
}
void VisualFactoryCache::UpdateBrokenImageRenderer(Renderer& renderer, const Vector2& size)
{
+
+ bool useDefaultBrokenImage = false;
+ if(mBrokenImageInfoContainer.size() == 0)
+ {
+ useDefaultBrokenImage = true;
+ }
+
// Load Information for broken image
- for(uint32_t index = 0; index < mBrokenImageInfoContainer.size(); index++)
+ for(uint32_t index = 0; (index < mBrokenImageInfoContainer.size()) && !useDefaultBrokenImage; index++)
{
if(mBrokenImageInfoContainer[index].width == 0 && mBrokenImageInfoContainer[index].height == 0)
{
}
else
{
- DALI_LOG_ERROR("Can't update renderer for broken image. maybe image loading is failed [path:%s] \n",mBrokenImageInfoContainer[index].url.c_str());
+ DALI_LOG_ERROR("Can't update renderer for broken image. maybe image loading is failed [index:%d] [path:%s] \n",index, mBrokenImageInfoContainer[index].url.c_str());
+ useDefaultBrokenImage = true;
}
}
else
{
- GetBrokenVisualImage(index);
+ if(!GetBrokenVisualImage(index))
+ {
+ DALI_LOG_ERROR("Can't update renderer for broken image. maybe image loading is failed [index:%d] [path:%s] \n",index, mBrokenImageInfoContainer[index].url.c_str());
+ useDefaultBrokenImage = true;
+ }
}
}
}
}
+ if(!mUseDefaultBrokenImageOnly && useDefaultBrokenImage)
+ {
+ // Clear broken info
+ mBrokenImageInfoContainer.clear();
+
+ // assign for broken image
+ const int defaultBrokenIndex = 0;
+ mBrokenImageInfoContainer.assign(1, BrokenImageInfo());
+ mBrokenImageInfoContainer[defaultBrokenIndex].url = mDefaultBrokenImageUrl;
+ VisualUrl visualUrl(mBrokenImageInfoContainer[defaultBrokenIndex].url);
+ mBrokenImageInfoContainer[defaultBrokenIndex].visualType = visualUrl.GetType();
+ mUseDefaultBrokenImageOnly = true;
+ }
+
// Set Texutre to renderer
int brokenIndex = GetProperBrokenImageIndex(size);
if(GetBrokenImageVisualType(brokenIndex) == VisualUrl::N_PATCH)
{
// Sets the default broken type
int32_t returnIndex = 0;
- if((size.width == 0 || size.height == 0))
+ if((size.width == 0 || size.height == 0) || mUseDefaultBrokenImageOnly )
{
// To do : Need to add observer about size
return returnIndex;
* @brief Set an image to be used when a visual has failed to correctly render
* @param[in] brokenImageUrlList The broken image url list
*/
- void SetBrokenImageUrl(const std::vector<std::string>& brokenImageUrlList);
+ void SetBrokenImageUrl(std::string& defaultBrokenUrl, const std::vector<std::string>& brokenImageUrlList);
/**
* @brief Update the broken image Renderer object
void ApplyTextureAndUniforms(Renderer& renderer, int index);
/**
- * @brief Creates a Npatch Geometry object
- *
- * @param[in] gridSize The gridSize for creating a geometry
- * @return The Geometry for NPatch
- */
- Geometry CreateNPatchGeometry(Uint16Pair gridSize);
-
- /**
* @brief Gets a geometry for npatch image
*
* @param[in] index the index of broken image
Shader GetNPatchShader(int index);
/**
- * @brief Registers a properties for Stretch Ranges
- *
- * @param[in,out] renderer The renderer for broken image
- * @param[in] uniformName The name of the uniform
- * @param[in] stretchPixels The stretchable pixels in the cropped image space
- * @param[in] imageExtent The imageExtent
- */
- void RegisterStretchProperties(Renderer& renderer, const char* uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent);
-
- /**
* @brief Returns a broken image type
* @param[in] index BrokenImage index
* @return The broken image type.
std::unique_ptr<VectorAnimationManager> mVectorAnimationManager;
bool mPreMultiplyOnLoad;
std::vector<BrokenImageInfo> mBrokenImageInfoContainer;
+ std::string mDefaultBrokenImageUrl;
+ bool mUseDefaultBrokenImageOnly;
};
} // namespace Internal
if(styleManager)
{
customBrokenImageUrlList = Toolkit::DevelStyleManager::GetBrokenImageUrlList(styleManager);
- if(customBrokenImageUrlList.size() == 0)
- {
- Property::Map config = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
- config["brokenImageUrl"].Get(brokenImageUrl);
- customBrokenImageUrlList.push_back(brokenImageUrl);
- }
- mFactoryCache->SetBrokenImageUrl(customBrokenImageUrlList);
- }
- else
- {
- // Set default image
- customBrokenImageUrlList.push_back(brokenImageUrl);
- mFactoryCache->SetBrokenImageUrl(customBrokenImageUrlList);
+ Property::Map config = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
+ config["brokenImageUrl"].Get(brokenImageUrl);
}
+
+ // Add default image
+ mFactoryCache->SetBrokenImageUrl(brokenImageUrl, customBrokenImageUrlList);
}
Internal::VisualFactoryCache& VisualFactory::GetFactoryCache()
}
case Actor::Property::VISIBLE:
{
- if(Dali::Accessibility::IsUp())
+ if(Dali::Accessibility::IsUp() && !Self().GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN))
{
Dali::Accessibility::Accessible::Get(Self())->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE).Get<bool>());
}
{
const unsigned int TOOLKIT_MAJOR_VERSION = 2;
const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 2;
+const unsigned int TOOLKIT_MICRO_VERSION = 4;
const char* const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 2.1.2
+Version: 2.1.4
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT